mmhglobal-dynamicform 1.1.44 → 1.2.2
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 +18 -0
- package/bundles/mmhglobal-dynamicform.umd.js +782 -1524
- 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/mmhglobal-dynamicform.module.js +4 -8
- package/esm2015/lib/services/zcomponent.debug.service.js +1 -8
- package/esm2015/lib/services/zcomponent.service.js +1 -3
- package/esm2015/lib/zgrid/zgrid.component.js +130 -18
- package/esm2015/lib/zgrid/zgrid.popup.anchor-target.directive.js +16 -0
- package/esm2015/lib/ztree/ztree.component.js +8 -3
- package/esm2015/mmhglobal-dynamicform.js +2 -3
- package/esm2015/public-api.js +2 -2
- package/fesm2015/mmhglobal-dynamicform.js +438 -1135
- package/fesm2015/mmhglobal-dynamicform.js.map +1 -1
- package/lib/zgrid/zgrid.component.d.ts +28 -0
- package/lib/zgrid/zgrid.popup.anchor-target.directive.d.ts +5 -0
- package/lib/ztree/ztree.component.d.ts +1 -0
- package/mmhglobal-dynamicform.d.ts +1 -2
- package/mmhglobal-dynamicform.metadata.json +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -1
- package/esm2015/lib/zgridcalendar/zgridcalendar.binding.directive.js +0 -295
- package/esm2015/lib/zgridcalendar/zgridcalendar.component.js +0 -542
- package/lib/zgridcalendar/zgridcalendar.binding.directive.d.ts +0 -47
- package/lib/zgridcalendar/zgridcalendar.component.d.ts +0 -111
|
@@ -752,18 +752,12 @@
|
|
|
752
752
|
modalFields = this.fieldService.getFormFieldCode("mvEditFieldNodeForm", "FormField", null, null);
|
|
753
753
|
initialModel = {
|
|
754
754
|
Name: 'Name', DisplayName: 'Name', Value: 'Name', Type: 'text',
|
|
755
|
-
enableHiding: true,
|
|
756
755
|
gridColVisible: true,
|
|
757
756
|
width: 150,
|
|
758
757
|
minWidth: 100,
|
|
759
|
-
cellFilter: "",
|
|
760
|
-
filterCellFiltered: false,
|
|
761
758
|
enableFiltering: true,
|
|
762
759
|
enableSorting: true,
|
|
763
|
-
enablePinning: true,
|
|
764
760
|
pinnedLeft: false,
|
|
765
|
-
pinnedRight: false,
|
|
766
|
-
UpdateOnBlur: true,
|
|
767
761
|
PlaceHolder: "Name",
|
|
768
762
|
IsRequired: false,
|
|
769
763
|
MinLength: 2,
|
|
@@ -773,7 +767,6 @@
|
|
|
773
767
|
ReadOnly: false,
|
|
774
768
|
ShowLabel: true,
|
|
775
769
|
Visible: true,
|
|
776
|
-
AppendDivClearFix: false,
|
|
777
770
|
};
|
|
778
771
|
zmodel = {
|
|
779
772
|
nodeModel: JSON.stringify(initialModel, null, 2)
|
|
@@ -2547,6 +2540,22 @@
|
|
|
2547
2540
|
zgridbinding: [{ type: i0.Input }]
|
|
2548
2541
|
};
|
|
2549
2542
|
|
|
2543
|
+
var ZGridPopupAnchorDirective = /** @class */ (function () {
|
|
2544
|
+
function ZGridPopupAnchorDirective(element) {
|
|
2545
|
+
this.element = element;
|
|
2546
|
+
}
|
|
2547
|
+
return ZGridPopupAnchorDirective;
|
|
2548
|
+
}());
|
|
2549
|
+
ZGridPopupAnchorDirective.decorators = [
|
|
2550
|
+
{ type: i0.Directive, args: [{
|
|
2551
|
+
selector: '[popupAnchor]',
|
|
2552
|
+
exportAs: 'popupAnchor'
|
|
2553
|
+
},] }
|
|
2554
|
+
];
|
|
2555
|
+
ZGridPopupAnchorDirective.ctorParameters = function () { return [
|
|
2556
|
+
{ type: i0.ElementRef }
|
|
2557
|
+
]; };
|
|
2558
|
+
|
|
2550
2559
|
/********** Angular **********/
|
|
2551
2560
|
/********** Component & Service **********/
|
|
2552
2561
|
var OpenOnFocusDirective = /** @class */ (function () {
|
|
@@ -2577,430 +2586,111 @@
|
|
|
2577
2586
|
onBlur: [{ type: i0.HostListener, args: ['blur',] }]
|
|
2578
2587
|
};
|
|
2579
2588
|
|
|
2580
|
-
var
|
|
2581
|
-
|
|
2582
|
-
function ZGridCalendarBindingDirective(grid, webapiService, authService, storageService, zGridStatePersistingService) {
|
|
2583
|
-
var _this = _super.call(this, grid) || this;
|
|
2584
|
-
_this.webapiService = webapiService;
|
|
2585
|
-
_this.authService = authService;
|
|
2586
|
-
_this.storageService = storageService;
|
|
2587
|
-
_this.zGridStatePersistingService = zGridStatePersistingService;
|
|
2588
|
-
_this.state = {
|
|
2589
|
-
skip: 0,
|
|
2590
|
-
take: 10,
|
|
2591
|
-
};
|
|
2592
|
-
_this.gridColumns = [];
|
|
2593
|
-
_this.usableColumns = [];
|
|
2594
|
-
_this.resourceURL = null;
|
|
2595
|
-
_this.paginationApiPostUrl = null;
|
|
2596
|
-
_this.dataSource = null;
|
|
2597
|
-
return _this;
|
|
2589
|
+
var DateParserFilter = /** @class */ (function () {
|
|
2590
|
+
function DateParserFilter() {
|
|
2598
2591
|
}
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
enumerable: false,
|
|
2604
|
-
configurable: true
|
|
2605
|
-
});
|
|
2606
|
-
Object.defineProperty(ZGridCalendarBindingDirective.prototype, "grp", {
|
|
2607
|
-
get: function () {
|
|
2608
|
-
return this.zgridcalendarbinding.group;
|
|
2609
|
-
},
|
|
2610
|
-
enumerable: false,
|
|
2611
|
-
configurable: true
|
|
2612
|
-
});
|
|
2613
|
-
Object.defineProperty(ZGridCalendarBindingDirective.prototype, "gridSubject", {
|
|
2614
|
-
get: function () {
|
|
2615
|
-
return this.zgridcalendarbinding.gridSubject;
|
|
2616
|
-
},
|
|
2617
|
-
enumerable: false,
|
|
2618
|
-
configurable: true
|
|
2619
|
-
});
|
|
2620
|
-
Object.defineProperty(ZGridCalendarBindingDirective.prototype, "params", {
|
|
2621
|
-
get: function () {
|
|
2622
|
-
return this.zgridcalendarbinding.params;
|
|
2623
|
-
},
|
|
2624
|
-
enumerable: false,
|
|
2625
|
-
configurable: true
|
|
2626
|
-
});
|
|
2627
|
-
Object.defineProperty(ZGridCalendarBindingDirective.prototype, "getData", {
|
|
2628
|
-
get: function () {
|
|
2629
|
-
return this.grid.data;
|
|
2630
|
-
},
|
|
2631
|
-
enumerable: false,
|
|
2632
|
-
configurable: true
|
|
2633
|
-
});
|
|
2634
|
-
ZGridCalendarBindingDirective.prototype.ngOnInit = function () {
|
|
2635
|
-
if (this.field.SkipDirective) {
|
|
2636
|
-
return;
|
|
2592
|
+
DateParserFilter.prototype.transform = function (items) {
|
|
2593
|
+
// debugger;
|
|
2594
|
+
if (!items) {
|
|
2595
|
+
return items;
|
|
2637
2596
|
}
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
if (!this.dataSource) {
|
|
2644
|
-
this.resourceURL = i3.ZComponentHelper.getGroupValue(this.field.ResourceURL, this.grp);
|
|
2645
|
-
if (!this.resourceURL) {
|
|
2646
|
-
this.grid.loading = false;
|
|
2647
|
-
if (this.zgridcalendarbinding.data.Name !== "ActivityLogGrid") {
|
|
2648
|
-
console.warn("No initialise for Field.ResourceURL: ", this.field.ResourceURL);
|
|
2649
|
-
}
|
|
2650
|
-
return;
|
|
2651
|
-
}
|
|
2652
|
-
var array = this.resourceURL.split("/api/");
|
|
2653
|
-
if (!!array[1]) {
|
|
2654
|
-
array[1] = "Page" + array[1];
|
|
2655
|
-
this.paginationApiPostUrl = array.join("/api/");
|
|
2656
|
-
}
|
|
2657
|
-
else {
|
|
2658
|
-
var arr = this.resourceURL.split("/");
|
|
2659
|
-
arr[arr.length - 2] = "Page" + arr[arr.length - 2];
|
|
2660
|
-
this.paginationApiPostUrl = arr.join("/");
|
|
2661
|
-
}
|
|
2597
|
+
// filter items array, items which match and return true will be
|
|
2598
|
+
// kept, false will be filtered out
|
|
2599
|
+
try {
|
|
2600
|
+
var d = new Date(items);
|
|
2601
|
+
return d;
|
|
2662
2602
|
}
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
ZGridCalendarBindingDirective.prototype.ngOnDestroy = function () {
|
|
2667
|
-
if (this.serviceSubscription) {
|
|
2668
|
-
this.serviceSubscription.unsubscribe();
|
|
2603
|
+
catch (error) {
|
|
2604
|
+
console.log("DateParserFilter error: ", error);
|
|
2605
|
+
return null;
|
|
2669
2606
|
}
|
|
2670
|
-
_super.prototype.ngOnDestroy.call(this);
|
|
2671
|
-
};
|
|
2672
|
-
ZGridCalendarBindingDirective.prototype.generateGridColumns = function () {
|
|
2673
|
-
var _this = this;
|
|
2674
|
-
var columnFields$ = i3.ZComponentHelper.getGroupValue(this.field.ColumnFields, this.grp);
|
|
2675
|
-
columnFields$
|
|
2676
|
-
.pipe(operators.tap(function (data) {
|
|
2677
|
-
var gridSetting = _this.getGridSettings();
|
|
2678
|
-
var fieldName = _this.field["FieldElementName"];
|
|
2679
|
-
i3.ZComponentHelper.getGridColumns(data, _this.gridColumns, _this.zgridcalendarbinding.group, _this.authService, fieldName, gridSetting, _this.usableColumns);
|
|
2680
|
-
_this.getFilterParamsColumns();
|
|
2681
|
-
_this.getGrantType();
|
|
2682
|
-
_this.setHiddenColumn(gridSetting);
|
|
2683
|
-
}), operators.switchMap(function () {
|
|
2684
|
-
//Get Session
|
|
2685
|
-
return _this.getGridSessionFilter(_this.grp, _this);
|
|
2686
|
-
}), operators.switchMap(function () {
|
|
2687
|
-
//Before get grid data
|
|
2688
|
-
return _this.beforeGridGetData(_this.grp, _this);
|
|
2689
|
-
}))
|
|
2690
|
-
.subscribe(function () {
|
|
2691
|
-
_this.getDataBinding();
|
|
2692
|
-
});
|
|
2693
2607
|
};
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2608
|
+
return DateParserFilter;
|
|
2609
|
+
}());
|
|
2610
|
+
DateParserFilter.decorators = [
|
|
2611
|
+
{ type: i0.Pipe, args: [{
|
|
2612
|
+
name: "dateParser",
|
|
2613
|
+
pure: true,
|
|
2614
|
+
},] }
|
|
2615
|
+
];
|
|
2616
|
+
|
|
2617
|
+
/********** Angular **********/
|
|
2618
|
+
/********** Ionic **********/
|
|
2619
|
+
/********** Plugin **********/
|
|
2620
|
+
/********** Component & Service **********/
|
|
2621
|
+
var EditorFilter = /** @class */ (function () {
|
|
2622
|
+
function EditorFilter() {
|
|
2623
|
+
}
|
|
2624
|
+
EditorFilter.prototype.transform = function (source) {
|
|
2625
|
+
if (!source) {
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
if (typeof source === "string") {
|
|
2629
|
+
try {
|
|
2630
|
+
var jsonValue = JSON.parse(source);
|
|
2631
|
+
return JSON.stringify(jsonValue, null, 2);
|
|
2632
|
+
// return this.safeStringify(jsonValue);
|
|
2708
2633
|
}
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
this.webapiService
|
|
2712
|
-
.getApi(this.resourceURL, null, null, null, null, null, true)
|
|
2713
|
-
.subscribe(function (data) {
|
|
2714
|
-
var _data = null;
|
|
2715
|
-
var _totalCount = 0;
|
|
2716
|
-
if (data.dataSet) {
|
|
2717
|
-
_data = data.dataSet;
|
|
2718
|
-
_totalCount = data.totalCount;
|
|
2719
|
-
}
|
|
2720
|
-
else {
|
|
2721
|
-
_data = data;
|
|
2722
|
-
_totalCount = data.length;
|
|
2723
|
-
}
|
|
2724
|
-
_this.grid.data = { data: _data, total: _totalCount };
|
|
2725
|
-
_this.grid.pageSize = _totalCount;
|
|
2726
|
-
_this.grid.loading = false;
|
|
2727
|
-
_this.notifyDataChange();
|
|
2728
|
-
});
|
|
2634
|
+
catch (_a) {
|
|
2635
|
+
return source;
|
|
2729
2636
|
}
|
|
2730
2637
|
}
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
this.
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
this.grid.pageSize = ds.length;
|
|
2638
|
+
if (typeof source === "object" || Array.isArray(source)) {
|
|
2639
|
+
try {
|
|
2640
|
+
return JSON.stringify(source, null, 2);
|
|
2641
|
+
// return this.safeStringify(source);
|
|
2642
|
+
}
|
|
2643
|
+
catch (_b) {
|
|
2644
|
+
return "problem - [Circular structure to JSON]";
|
|
2739
2645
|
}
|
|
2740
|
-
this.grid.loading = false;
|
|
2741
2646
|
}
|
|
2742
2647
|
};
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
if (colFields.length > 0) {
|
|
2757
|
-
if (colFields.indexOf("Id") === -1) {
|
|
2758
|
-
colFields.push("Id");
|
|
2648
|
+
EditorFilter.prototype.safeStringify = function (jsonValue) {
|
|
2649
|
+
// Note: cache should not be re-used by repeated calls to JSON.stringify.
|
|
2650
|
+
var cache = [];
|
|
2651
|
+
return JSON.stringify(jsonValue, function (key, value) {
|
|
2652
|
+
if (typeof value === 'object' && value !== null) {
|
|
2653
|
+
// Duplicate reference found, discard key
|
|
2654
|
+
if (cache.includes(value)) {
|
|
2655
|
+
// debugger;
|
|
2656
|
+
// return "problem - [Circular structure to JSON]";
|
|
2657
|
+
return;
|
|
2658
|
+
}
|
|
2659
|
+
// Store value in our collection
|
|
2660
|
+
cache.push(value);
|
|
2759
2661
|
}
|
|
2662
|
+
return value;
|
|
2663
|
+
}, 2);
|
|
2664
|
+
// cache = null; // Enable garbage collection
|
|
2665
|
+
};
|
|
2666
|
+
return EditorFilter;
|
|
2667
|
+
}());
|
|
2668
|
+
EditorFilter.decorators = [
|
|
2669
|
+
{ type: i0.Pipe, args: [{
|
|
2670
|
+
name: 'editorfilter',
|
|
2671
|
+
pure: false
|
|
2672
|
+
},] }
|
|
2673
|
+
];
|
|
2674
|
+
|
|
2675
|
+
var DivzLayout = /** @class */ (function () {
|
|
2676
|
+
function DivzLayout() {
|
|
2677
|
+
}
|
|
2678
|
+
DivzLayout.prototype.transform = function (items, zlayout) {
|
|
2679
|
+
if (!items || !zlayout) {
|
|
2680
|
+
return items;
|
|
2760
2681
|
}
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2682
|
+
// if got zlayout, in div: 2 = 2 col per row; 3 = 1 col per row;
|
|
2683
|
+
if (zlayout == "2") {
|
|
2684
|
+
Object.values(items).forEach(function (value) {
|
|
2685
|
+
value['DivClass'] = "col-sm-6";
|
|
2686
|
+
});
|
|
2765
2687
|
}
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
this.params.grantType = i3.ZComponentHelper.getGroupValue(this.field.GrantType.toString(), this.grp);
|
|
2688
|
+
else if (zlayout == '3') {
|
|
2689
|
+
Object.values(items).forEach(function (value) {
|
|
2690
|
+
value['DivClass'] = "col-sm-12";
|
|
2691
|
+
});
|
|
2771
2692
|
}
|
|
2772
|
-
|
|
2773
|
-
ZGridCalendarBindingDirective.prototype.dataStateChange = function (state) {
|
|
2774
|
-
// this.state = state;
|
|
2775
|
-
this.skip = state.skip;
|
|
2776
|
-
this.pageSize = state.take;
|
|
2777
|
-
this.state.skip = state.skip;
|
|
2778
|
-
this.state.take = state.take;
|
|
2779
|
-
this.grid.loading = true;
|
|
2780
|
-
};
|
|
2781
|
-
ZGridCalendarBindingDirective.prototype.mapFilterOperator = function (operator) {
|
|
2782
|
-
switch (operator) {
|
|
2783
|
-
case "eq":
|
|
2784
|
-
return "eq";
|
|
2785
|
-
case "neq":
|
|
2786
|
-
return "neq";
|
|
2787
|
-
case "lt":
|
|
2788
|
-
return "lt";
|
|
2789
|
-
case "lte":
|
|
2790
|
-
return "lte";
|
|
2791
|
-
case "gt":
|
|
2792
|
-
return "gt";
|
|
2793
|
-
case "gte":
|
|
2794
|
-
return "gte";
|
|
2795
|
-
case "startswith":
|
|
2796
|
-
return "startswith";
|
|
2797
|
-
case "endswith":
|
|
2798
|
-
return "endswith";
|
|
2799
|
-
case "isnull":
|
|
2800
|
-
return "isnull";
|
|
2801
|
-
case "isnotnull":
|
|
2802
|
-
return "isnotnull";
|
|
2803
|
-
default:
|
|
2804
|
-
return "==";
|
|
2805
|
-
// eq, neq, isnull, isnotnull, endswith, startswith
|
|
2806
|
-
}
|
|
2807
|
-
};
|
|
2808
|
-
ZGridCalendarBindingDirective.prototype.getGridSettings = function () {
|
|
2809
|
-
var _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
|
|
2810
|
-
var _gridName = this.field.Name + '::' + this.field.Value;
|
|
2811
|
-
// Find any setting from localstorage..
|
|
2812
|
-
var _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
|
|
2813
|
-
if (_arrGridCaching && _arrGridCaching[0]) {
|
|
2814
|
-
var _gridCaching = _arrGridCaching.find(function (x) { return x['dataFormFields'] === _gridName; });
|
|
2815
|
-
if (_gridCaching) {
|
|
2816
|
-
return _gridCaching.gridSettings.columnsConfig.sort(function (a, b) { return a.orderIndex - b.orderIndex; });
|
|
2817
|
-
}
|
|
2818
|
-
}
|
|
2819
|
-
};
|
|
2820
|
-
ZGridCalendarBindingDirective.prototype.setHiddenColumn = function (gridSetting) {
|
|
2821
|
-
var _this = this;
|
|
2822
|
-
if (this.gridColumns && gridSetting) {
|
|
2823
|
-
// filter out hidden == false array.
|
|
2824
|
-
var gridSettingHiddenCol = gridSetting.filter(function (item) {
|
|
2825
|
-
return item['hidden'] == true;
|
|
2826
|
-
});
|
|
2827
|
-
// find and set the hidden to current column setting.
|
|
2828
|
-
Object.values(gridSettingHiddenCol).forEach(function (value) {
|
|
2829
|
-
if (_this.gridColumns.find(function (c) { return c.field === value.field; })) {
|
|
2830
|
-
_this.gridColumns.find(function (c) { return c.field === value.field; })['hidden'] = value['hidden'];
|
|
2831
|
-
}
|
|
2832
|
-
});
|
|
2833
|
-
}
|
|
2834
|
-
};
|
|
2835
|
-
ZGridCalendarBindingDirective.prototype.beforeGridGetData = function (group, me) {
|
|
2836
|
-
console.warn("beforeDataBinding triggered");
|
|
2837
|
-
if (!group.beforeGridGetData) {
|
|
2838
|
-
console.warn("group.beforeDataBinding is undefined");
|
|
2839
|
-
return rxjs.of(true);
|
|
2840
|
-
}
|
|
2841
|
-
return group.beforeGridGetData(group, me);
|
|
2842
|
-
};
|
|
2843
|
-
ZGridCalendarBindingDirective.prototype.getGridSessionFilter = function (group, me) {
|
|
2844
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
2845
|
-
var StorageKey;
|
|
2846
|
-
var _this = this;
|
|
2847
|
-
return __generator(this, function (_a) {
|
|
2848
|
-
switch (_a.label) {
|
|
2849
|
-
case 0:
|
|
2850
|
-
if (!group["GridStorageKey"]) {
|
|
2851
|
-
return [2 /*return*/, null];
|
|
2852
|
-
}
|
|
2853
|
-
StorageKey = group["GridStorageKey"];
|
|
2854
|
-
if (!this.storageService) return [3 /*break*/, 2];
|
|
2855
|
-
return [4 /*yield*/, this.storageService.get(StorageKey)
|
|
2856
|
-
.then(function (data) {
|
|
2857
|
-
if (!data || !data.value || data.value === "null") {
|
|
2858
|
-
return null;
|
|
2859
|
-
}
|
|
2860
|
-
else {
|
|
2861
|
-
var result = JSON.parse(data.value);
|
|
2862
|
-
_this.state.filter = JSON.parse(result["StateFilter"]);
|
|
2863
|
-
_this.params.filterParams = JSON.parse(result["FilterParams"]);
|
|
2864
|
-
_this.state.filter.filters.forEach(function (d) {
|
|
2865
|
-
if (d.field.includes('UTC')) {
|
|
2866
|
-
d.value = new Date(d.value);
|
|
2867
|
-
}
|
|
2868
|
-
});
|
|
2869
|
-
return data;
|
|
2870
|
-
}
|
|
2871
|
-
})];
|
|
2872
|
-
case 1:
|
|
2873
|
-
_a.sent();
|
|
2874
|
-
return [3 /*break*/, 3];
|
|
2875
|
-
case 2: return [2 /*return*/, null];
|
|
2876
|
-
case 3: return [2 /*return*/];
|
|
2877
|
-
}
|
|
2878
|
-
});
|
|
2879
|
-
});
|
|
2880
|
-
};
|
|
2881
|
-
return ZGridCalendarBindingDirective;
|
|
2882
|
-
}(kendoAngularGrid.DataBindingDirective));
|
|
2883
|
-
ZGridCalendarBindingDirective.decorators = [
|
|
2884
|
-
{ type: i0.Directive, args: [{
|
|
2885
|
-
selector: "[zgridcalendarbinding]",
|
|
2886
|
-
},] }
|
|
2887
|
-
];
|
|
2888
|
-
ZGridCalendarBindingDirective.ctorParameters = function () { return [
|
|
2889
|
-
{ type: undefined, decorators: [{ type: i0.Inject, args: [kendoAngularGrid.GridComponent,] }] },
|
|
2890
|
-
{ type: i3.WebApiService },
|
|
2891
|
-
{ type: i3.AuthService },
|
|
2892
|
-
{ type: i3.StorageSessionService },
|
|
2893
|
-
{ type: i3.ZGridStatePersistingService }
|
|
2894
|
-
]; };
|
|
2895
|
-
ZGridCalendarBindingDirective.propDecorators = {
|
|
2896
|
-
zgridcalendarbinding: [{ type: i0.Input }]
|
|
2897
|
-
};
|
|
2898
|
-
|
|
2899
|
-
var DateParserFilter = /** @class */ (function () {
|
|
2900
|
-
function DateParserFilter() {
|
|
2901
|
-
}
|
|
2902
|
-
DateParserFilter.prototype.transform = function (items) {
|
|
2903
|
-
// debugger;
|
|
2904
|
-
if (!items) {
|
|
2905
|
-
return items;
|
|
2906
|
-
}
|
|
2907
|
-
// filter items array, items which match and return true will be
|
|
2908
|
-
// kept, false will be filtered out
|
|
2909
|
-
try {
|
|
2910
|
-
var d = new Date(items);
|
|
2911
|
-
return d;
|
|
2912
|
-
}
|
|
2913
|
-
catch (error) {
|
|
2914
|
-
console.log("DateParserFilter error: ", error);
|
|
2915
|
-
return null;
|
|
2916
|
-
}
|
|
2917
|
-
};
|
|
2918
|
-
return DateParserFilter;
|
|
2919
|
-
}());
|
|
2920
|
-
DateParserFilter.decorators = [
|
|
2921
|
-
{ type: i0.Pipe, args: [{
|
|
2922
|
-
name: "dateParser",
|
|
2923
|
-
pure: true,
|
|
2924
|
-
},] }
|
|
2925
|
-
];
|
|
2926
|
-
|
|
2927
|
-
/********** Angular **********/
|
|
2928
|
-
/********** Ionic **********/
|
|
2929
|
-
/********** Plugin **********/
|
|
2930
|
-
/********** Component & Service **********/
|
|
2931
|
-
var EditorFilter = /** @class */ (function () {
|
|
2932
|
-
function EditorFilter() {
|
|
2933
|
-
}
|
|
2934
|
-
EditorFilter.prototype.transform = function (source) {
|
|
2935
|
-
if (!source) {
|
|
2936
|
-
return;
|
|
2937
|
-
}
|
|
2938
|
-
if (typeof source === "string") {
|
|
2939
|
-
try {
|
|
2940
|
-
var jsonValue = JSON.parse(source);
|
|
2941
|
-
return JSON.stringify(jsonValue, null, 2);
|
|
2942
|
-
// return this.safeStringify(jsonValue);
|
|
2943
|
-
}
|
|
2944
|
-
catch (_a) {
|
|
2945
|
-
return source;
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
if (typeof source === "object" || Array.isArray(source)) {
|
|
2949
|
-
try {
|
|
2950
|
-
return JSON.stringify(source, null, 2);
|
|
2951
|
-
// return this.safeStringify(source);
|
|
2952
|
-
}
|
|
2953
|
-
catch (_b) {
|
|
2954
|
-
return "problem - [Circular structure to JSON]";
|
|
2955
|
-
}
|
|
2956
|
-
}
|
|
2957
|
-
};
|
|
2958
|
-
EditorFilter.prototype.safeStringify = function (jsonValue) {
|
|
2959
|
-
// Note: cache should not be re-used by repeated calls to JSON.stringify.
|
|
2960
|
-
var cache = [];
|
|
2961
|
-
return JSON.stringify(jsonValue, function (key, value) {
|
|
2962
|
-
if (typeof value === 'object' && value !== null) {
|
|
2963
|
-
// Duplicate reference found, discard key
|
|
2964
|
-
if (cache.includes(value)) {
|
|
2965
|
-
// debugger;
|
|
2966
|
-
// return "problem - [Circular structure to JSON]";
|
|
2967
|
-
return;
|
|
2968
|
-
}
|
|
2969
|
-
// Store value in our collection
|
|
2970
|
-
cache.push(value);
|
|
2971
|
-
}
|
|
2972
|
-
return value;
|
|
2973
|
-
}, 2);
|
|
2974
|
-
// cache = null; // Enable garbage collection
|
|
2975
|
-
};
|
|
2976
|
-
return EditorFilter;
|
|
2977
|
-
}());
|
|
2978
|
-
EditorFilter.decorators = [
|
|
2979
|
-
{ type: i0.Pipe, args: [{
|
|
2980
|
-
name: 'editorfilter',
|
|
2981
|
-
pure: false
|
|
2982
|
-
},] }
|
|
2983
|
-
];
|
|
2984
|
-
|
|
2985
|
-
var DivzLayout = /** @class */ (function () {
|
|
2986
|
-
function DivzLayout() {
|
|
2987
|
-
}
|
|
2988
|
-
DivzLayout.prototype.transform = function (items, zlayout) {
|
|
2989
|
-
if (!items || !zlayout) {
|
|
2990
|
-
return items;
|
|
2991
|
-
}
|
|
2992
|
-
// if got zlayout, in div: 2 = 2 col per row; 3 = 1 col per row;
|
|
2993
|
-
if (zlayout == "2") {
|
|
2994
|
-
Object.values(items).forEach(function (value) {
|
|
2995
|
-
value['DivClass'] = "col-sm-6";
|
|
2996
|
-
});
|
|
2997
|
-
}
|
|
2998
|
-
else if (zlayout == '3') {
|
|
2999
|
-
Object.values(items).forEach(function (value) {
|
|
3000
|
-
value['DivClass'] = "col-sm-12";
|
|
3001
|
-
});
|
|
3002
|
-
}
|
|
3003
|
-
return items;
|
|
2693
|
+
return items;
|
|
3004
2694
|
};
|
|
3005
2695
|
return DivzLayout;
|
|
3006
2696
|
}());
|
|
@@ -5468,817 +5158,91 @@
|
|
|
5468
5158
|
rangeTo: 100,
|
|
5469
5159
|
rangeColor: '#ff6358',
|
|
5470
5160
|
rangeLineCap: 'round',
|
|
5471
|
-
showLabels: true,
|
|
5472
|
-
rangeSize: 10,
|
|
5473
|
-
};
|
|
5474
|
-
}
|
|
5475
|
-
ZgaugeComponent.prototype.ngOnInit = function () {
|
|
5476
|
-
i3.ZComponentHelper.setComponentProperties(this);
|
|
5477
|
-
i3.ZComponentHelper.registerComponent(this);
|
|
5478
|
-
if (this.data.Options) {
|
|
5479
|
-
var optionType = typeof (this.data.Options);
|
|
5480
|
-
if (optionType === 'object') {
|
|
5481
|
-
Object.assign(this.options, this.data.Options);
|
|
5482
|
-
}
|
|
5483
|
-
else if (optionType === 'string') {
|
|
5484
|
-
var optionValue = i3.ZComponentHelper.getGroupEvalValue.call(this, this.data.Options);
|
|
5485
|
-
if (typeof (optionValue) === 'object') {
|
|
5486
|
-
Object.assign(this.options, optionValue);
|
|
5487
|
-
}
|
|
5488
|
-
}
|
|
5489
|
-
}
|
|
5490
|
-
this.getFieldDeclarationForSetup(this.data, this.options);
|
|
5491
|
-
this.isLoading = false;
|
|
5492
|
-
};
|
|
5493
|
-
ZgaugeComponent.prototype.getFieldDeclarationForSetup = function (field, options) {
|
|
5494
|
-
options.value = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Value) || options.value;
|
|
5495
|
-
options.title = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Title) || options.title;
|
|
5496
|
-
options.scaleMax = field.Max || options.scaleMax;
|
|
5497
|
-
options.minValue = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MinValue) || options.minValue;
|
|
5498
|
-
options.maxValue = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MaxValue) || options.maxValue;
|
|
5499
|
-
options.colors = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Color) || options.colors;
|
|
5500
|
-
options.transitions = field.Transitions || options.transitions;
|
|
5501
|
-
options.majorTicks = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MajorTicks) || options.majorTicks;
|
|
5502
|
-
options.showLabels = field.ShowLabels || options.showLabels;
|
|
5503
|
-
options.style = field.Style || options.style;
|
|
5504
|
-
options.minorTicks = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MinorTicks) || options.minorTicks;
|
|
5505
|
-
options.reverse = field.Reverse || options.reverse;
|
|
5506
|
-
options.startAngle = i3.ZComponentHelper.getGroupEvalValue.call(this, field.StartAngle) || options.startAngle;
|
|
5507
|
-
options.endAngle = i3.ZComponentHelper.getGroupEvalValue.call(this, field.EndAngle) || options.endAngle;
|
|
5508
|
-
options.rangePlaceholderColor = field.RangePlaceholderColor || options.rangePlaceholderColor;
|
|
5509
|
-
options.rangeFrom = i3.ZComponentHelper.getGroupEvalValue.call(this, field.RangeFrom) || options.rangeFrom;
|
|
5510
|
-
options.rangeTo = i3.ZComponentHelper.getGroupEvalValue.call(this, field.RangeTo) || options.rangeTo;
|
|
5511
|
-
options.rangeColor = field.RangeColor || options.rangeColor;
|
|
5512
|
-
options.rangeLineCap = field.RangeLineCap || options.rangeLineCap;
|
|
5513
|
-
options.rangeSize = field.RangeSize || options.rangeSize;
|
|
5514
|
-
options.GaugeAlignment = i3.ZComponentHelper.getGroupEvalValue.call(this, field.GaugeAlignment) || options.GaugeAlignment;
|
|
5515
|
-
options.paddingValue = options.value.toString() === 'NaN' ? options.GaugeAlignment : '0%';
|
|
5516
|
-
};
|
|
5517
|
-
ZgaugeComponent.prototype.alignment = function () {
|
|
5518
|
-
var alignmentStyle = {
|
|
5519
|
-
"padding-right": this.options["paddingValue"]
|
|
5520
|
-
};
|
|
5521
|
-
return alignmentStyle;
|
|
5522
|
-
};
|
|
5523
|
-
ZgaugeComponent.prototype.setEnable = function (status) {
|
|
5524
|
-
// const fc = this.group.form.controls[this.data.Value];
|
|
5525
|
-
// status ? fc.enable() : fc.disable();
|
|
5526
|
-
this.componentProperties.isReadOnly = !status;
|
|
5527
|
-
};
|
|
5528
|
-
ZgaugeComponent.prototype.setVisible = function (status) {
|
|
5529
|
-
this.componentProperties.isVisible = status;
|
|
5530
|
-
this.data.Visible = status;
|
|
5531
|
-
};
|
|
5532
|
-
ZgaugeComponent.prototype.setRequire = function (status) {
|
|
5533
|
-
this.componentProperties.isRequired = status;
|
|
5534
|
-
};
|
|
5535
|
-
ZgaugeComponent.prototype.setData = function (gData) {
|
|
5536
|
-
this.getFieldDeclarationForSetup(this.data, this.options);
|
|
5537
|
-
};
|
|
5538
|
-
return ZgaugeComponent;
|
|
5539
|
-
}());
|
|
5540
|
-
ZgaugeComponent.decorators = [
|
|
5541
|
-
{ type: i0.Component, args: [{
|
|
5542
|
-
selector: 'app-zgauge',
|
|
5543
|
-
template: "<div *ngIf=\"!isLoading && (!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" style=\"text-align: center;\">\r\n <div id=\"marketShareContainer\" class=\"ion-row\" class=\"col-xs-12 stats-graph\">\r\n <h6 style=\"color: gray;\">{{ options.title }}</h6>\r\n </div>\r\n <div [ngStyle]='alignment()'>\r\n <kendo-arcgauge [value]=\"options.value\" [transitions]=\"options.transitions\" [colors]=\"options.colors\" style=\"margin-top:50px;width:90% ;height:100%; min-width: 330px;\">\r\n <kendo-arcgauge-scale\r\n [majorTicks]=\"{ visible: true, color: '#0000ff' }\"\r\n [minorTicks]=\"{ visible: true, color: '#0000ff' }\"\r\n [reverse]=\"options.reverse\"\r\n [startAngle]=\"0\"\r\n [endAngle]=\"180\"\r\n [min]=\"options.minValue\"\r\n [max]=\"options.maxValue\"\r\n [rangePlaceholderColor]=\"options.rangePlaceholderColor\"\r\n [rangeSize]=\"options.rangeSize\"\r\n [rangeLineCap]=\"options.rangeLineCap\">\r\n <kendo-arcgauge-scale-labels format=\"l\" [color]=\"options.labelsColor\" [visible]=\"options.showLabels\">\r\n </kendo-arcgauge-scale-labels>\r\n </kendo-arcgauge-scale>\r\n <ng-template kendoArcGaugeCenterTemplate let-value=\"value\" let-color=\"color\">\r\n <span [style.color]=\"color\">{{ value }}</span>\r\n </ng-template>\r\n </kendo-arcgauge>\r\n </div>\r\n</div>\r\n",
|
|
5544
|
-
styles: [""]
|
|
5545
|
-
},] }
|
|
5546
|
-
];
|
|
5547
|
-
ZgaugeComponent.ctorParameters = function () { return []; };
|
|
5548
|
-
ZgaugeComponent.propDecorators = {
|
|
5549
|
-
data: [{ type: i0.Input }],
|
|
5550
|
-
group: [{ type: i0.Input }],
|
|
5551
|
-
form: [{ type: i0.Input }]
|
|
5552
|
-
};
|
|
5553
|
-
|
|
5554
|
-
var ZgridComponent = /** @class */ (function () {
|
|
5555
|
-
function ZgridComponent(activatedRoute, router, formBuilder, authService, webApiService, zGridStatePersistingService, toastService, zcoreService, storageService, mainService) {
|
|
5556
|
-
var _this = this;
|
|
5557
|
-
this.activatedRoute = activatedRoute;
|
|
5558
|
-
this.router = router;
|
|
5559
|
-
this.formBuilder = formBuilder;
|
|
5560
|
-
this.authService = authService;
|
|
5561
|
-
this.webApiService = webApiService;
|
|
5562
|
-
this.zGridStatePersistingService = zGridStatePersistingService;
|
|
5563
|
-
this.toastService = toastService;
|
|
5564
|
-
this.zcoreService = zcoreService;
|
|
5565
|
-
this.storageService = storageService;
|
|
5566
|
-
this.mainService = mainService;
|
|
5567
|
-
// @ViewChild(ZGridBindingDirective, { static: false }) zgrid: ZGridBindingDirective;
|
|
5568
|
-
this.zgrid = null;
|
|
5569
|
-
this.oauthUrl = null;
|
|
5570
|
-
this.mySelection = [];
|
|
5571
|
-
this.componentProperties = new i3.ZComponentProperties();
|
|
5572
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle, id-blacklist, id-match
|
|
5573
|
-
this._state = {
|
|
5574
|
-
skip: 0,
|
|
5575
|
-
take: 10
|
|
5576
|
-
};
|
|
5577
|
-
this.params = {
|
|
5578
|
-
referId: null,
|
|
5579
|
-
pageNo: 0,
|
|
5580
|
-
pageSize: 20,
|
|
5581
|
-
sortColumnName: "",
|
|
5582
|
-
sortOrder: "",
|
|
5583
|
-
sortColumnNames: [],
|
|
5584
|
-
sortOrders: [],
|
|
5585
|
-
filterParams: [],
|
|
5586
|
-
parameters: "",
|
|
5587
|
-
filters: "",
|
|
5588
|
-
columns: "",
|
|
5589
|
-
grantType: 4
|
|
5590
|
-
};
|
|
5591
|
-
this.gridSubject = new rxjs.Subject();
|
|
5592
|
-
this.gridDefaultStateExist = false;
|
|
5593
|
-
this.setData = function (gData) {
|
|
5594
|
-
_this.gridData = {
|
|
5595
|
-
data: gData,
|
|
5596
|
-
total: (gData ? gData.length : 0)
|
|
5597
|
-
};
|
|
5598
|
-
_this.gData = gData;
|
|
5599
|
-
if (!!_this.data.ShowRecordNumber) {
|
|
5600
|
-
if (_this.gridData.data) {
|
|
5601
|
-
_this.gridData.data.forEach(function (d, i) {
|
|
5602
|
-
d.GridNo = i + 1;
|
|
5603
|
-
});
|
|
5604
|
-
}
|
|
5605
|
-
}
|
|
5606
|
-
if (_this.gData) {
|
|
5607
|
-
_this.createFormControls();
|
|
5608
|
-
}
|
|
5609
|
-
};
|
|
5610
|
-
/* Available Functions */
|
|
5611
|
-
this.setEnable = function (status) {
|
|
5612
|
-
_this.componentProperties.isReadOnly = !status;
|
|
5613
|
-
};
|
|
5614
|
-
this.setVisible = function (status) {
|
|
5615
|
-
_this.componentProperties.isVisible = status;
|
|
5616
|
-
_this.data.Visible = status;
|
|
5617
|
-
};
|
|
5618
|
-
this.setRequire = function (status) {
|
|
5619
|
-
_this.componentProperties.isRequired = status;
|
|
5620
|
-
i3.ZComponentHelper.changeValidator(status, _this.group, _this.data.Value, _this.componentProperties, forms.Validators.required);
|
|
5621
|
-
};
|
|
5622
|
-
this.oauthUrl = this.zcoreService.getEnvironment().e1OauthUrl + "/";
|
|
5623
|
-
this.allResults = this.allResults.bind(this);
|
|
5624
|
-
this.refreshData = this.refreshData.bind(this);
|
|
5625
|
-
this.clearData = this.clearData.bind(this);
|
|
5626
|
-
this.saveGridSettings = this.saveGridSettings.bind(this);
|
|
5627
|
-
this.restoreGridSettings = this.restoreGridSettings.bind(this);
|
|
5628
|
-
}
|
|
5629
|
-
ZgridComponent.prototype.ngOnInit = function () {
|
|
5630
|
-
var _this = this;
|
|
5631
|
-
i3.ZComponentHelper.setComponentProperties(this);
|
|
5632
|
-
i3.ZComponentHelper.registerComponent(this);
|
|
5633
|
-
// Grid saved setting key(Used in CookieStore & LocalStorage)
|
|
5634
|
-
this.gridStorageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
|
|
5635
|
-
rxjs.of(true)
|
|
5636
|
-
.pipe(
|
|
5637
|
-
//concatMap(() => {
|
|
5638
|
-
// // try get gridsetting from cookiestore
|
|
5639
|
-
// return this.mainService.cookieStoreGet(this.gridStorageKey, this.authService.e1Token.access_token);
|
|
5640
|
-
//}),
|
|
5641
|
-
//switchMap(savedGridCache => {
|
|
5642
|
-
// if (savedGridCache) {
|
|
5643
|
-
// // Keep the gridSetting from cookiestore to localStorage
|
|
5644
|
-
// this.zGridStatePersistingService.set(this.gridStorageKey, savedGridCache);
|
|
5645
|
-
// return of(true);
|
|
5646
|
-
// }
|
|
5647
|
-
// return of(false);
|
|
5648
|
-
//}),
|
|
5649
|
-
operators.switchMap(function () {
|
|
5650
|
-
// Grid default setting
|
|
5651
|
-
_this.columns = [];
|
|
5652
|
-
_this.widthReduce = _this.data.WidthReduce || 60;
|
|
5653
|
-
_this.heightReduce = _this.data.HeightReduce || 560;
|
|
5654
|
-
_this._state.take = _this.data.PageSize || 20;
|
|
5655
|
-
_this.pageSizes = [20, 50, 100, 200, 500];
|
|
5656
|
-
// [Mobile] Disable PageSize
|
|
5657
|
-
if (_this.data.PageSizes === false || i3.ZComponentHelper.isMobileScreen()) {
|
|
5658
|
-
_this.pageSizes = false;
|
|
5659
|
-
}
|
|
5660
|
-
// Grid Selection column
|
|
5661
|
-
if (_this.data.SelectOptions) {
|
|
5662
|
-
_this.selectableSettings = {
|
|
5663
|
-
// checkboxOnly: this.checkboxOnly,
|
|
5664
|
-
mode: _this.data.SelectOptions === 'single' ? 'single' : 'multiple'
|
|
5665
|
-
};
|
|
5666
|
-
}
|
|
5667
|
-
// bind this to group using Grid value
|
|
5668
|
-
if (_this.data.Value.startsWith('group.')) {
|
|
5669
|
-
var gridValue = _this.data.Value.slice(6);
|
|
5670
|
-
_this.group[gridValue] = _this;
|
|
5671
|
-
}
|
|
5672
|
-
// clear any Subscription
|
|
5673
|
-
if (_this.subscription) {
|
|
5674
|
-
_this.subscription.unsubscribe();
|
|
5675
|
-
}
|
|
5676
|
-
// if no ResourceURL, still generate Column first, then insert grid data using DataSource
|
|
5677
|
-
if (!_this.data.ResourceURL) {
|
|
5678
|
-
_this.generateGridColumns().subscribe(function () {
|
|
5679
|
-
if (_this.data.DataSource && _this.data.SkipDirective) {
|
|
5680
|
-
var ds = i3.ZComponentHelper.getGroupValue(_this.data.DataSource, _this.group);
|
|
5681
|
-
_this.setData(ds);
|
|
5682
|
-
}
|
|
5683
|
-
});
|
|
5684
|
-
}
|
|
5685
|
-
// subscribe to set grid setting from directive to component
|
|
5686
|
-
_this.subscription = _this.gridSubject.subscribe(function (grid) {
|
|
5687
|
-
_this.zgrid = grid;
|
|
5688
|
-
_this._state = _this.zgrid.state;
|
|
5689
|
-
_this.columns = _this.zgrid.gridColumns;
|
|
5690
|
-
if (_this.zgrid && _this.zgrid.grid.data) {
|
|
5691
|
-
_this.gridData = Object.assign({}, _this.zgrid.grid.data);
|
|
5692
|
-
_this.createFormControls();
|
|
5693
|
-
}
|
|
5694
|
-
});
|
|
5695
|
-
// Check Grid setting exist in localstorage
|
|
5696
|
-
_this.stateExist();
|
|
5697
|
-
// Set Filter SessionKey
|
|
5698
|
-
if (_this.data['SaveFilter']) {
|
|
5699
|
-
_this.setGridSessionKey(_this.group);
|
|
5700
|
-
}
|
|
5701
|
-
return rxjs.of(true);
|
|
5702
|
-
}), operators.tap(function () {
|
|
5703
|
-
_this.gridCallback(_this.group);
|
|
5704
|
-
})).subscribe();
|
|
5705
|
-
};
|
|
5706
|
-
ZgridComponent.prototype.ngOnDestroy = function () {
|
|
5707
|
-
if (this.subscription) {
|
|
5708
|
-
this.subscription.unsubscribe();
|
|
5709
|
-
}
|
|
5710
|
-
};
|
|
5711
|
-
Object.defineProperty(ZgridComponent.prototype, "state", {
|
|
5712
|
-
/* Start Grid State (pagination, sortable, filter, ordering) */
|
|
5713
|
-
get: function () {
|
|
5714
|
-
return this._state;
|
|
5715
|
-
},
|
|
5716
|
-
enumerable: false,
|
|
5717
|
-
configurable: true
|
|
5718
|
-
});
|
|
5719
|
-
ZgridComponent.prototype.stateExist = function () {
|
|
5720
|
-
var userGridState = this.zGridStatePersistingService.get(this.gridStorageKey);
|
|
5721
|
-
if (userGridState) {
|
|
5722
|
-
this.gridDefaultStateExist = true;
|
|
5723
|
-
}
|
|
5724
|
-
else {
|
|
5725
|
-
this.gridDefaultStateExist = false;
|
|
5726
|
-
}
|
|
5727
|
-
};
|
|
5728
|
-
ZgridComponent.prototype.dataStateChange = function (state) {
|
|
5729
|
-
if (this.zgrid) {
|
|
5730
|
-
this.zgrid.dataStateChange(state);
|
|
5731
|
-
}
|
|
5732
|
-
else {
|
|
5733
|
-
this.gridData = kendoDataQuery.process(this.gData, state);
|
|
5734
|
-
this.createFormControls();
|
|
5735
|
-
}
|
|
5736
|
-
};
|
|
5737
|
-
ZgridComponent.prototype.filterable = function (value) {
|
|
5738
|
-
if (value === false) {
|
|
5739
|
-
return false;
|
|
5740
|
-
}
|
|
5741
|
-
return true;
|
|
5742
|
-
};
|
|
5743
|
-
ZgridComponent.prototype.sortable = function (value) {
|
|
5744
|
-
if (value === false) {
|
|
5745
|
-
return false;
|
|
5746
|
-
}
|
|
5747
|
-
return true;
|
|
5748
|
-
};
|
|
5749
|
-
ZgridComponent.prototype.locked = function (colSetting) {
|
|
5750
|
-
if (colSetting['enablePinning'] == true) {
|
|
5751
|
-
if (colSetting['pinnedLeft'] == true) {
|
|
5752
|
-
return true;
|
|
5753
|
-
}
|
|
5754
|
-
}
|
|
5755
|
-
return false;
|
|
5756
|
-
};
|
|
5757
|
-
/* End Grid State (pagination, sortable, filter, ordering) */
|
|
5758
|
-
/* Start Grid Styling, Display */
|
|
5759
|
-
ZgridComponent.prototype.getGridStyle = function () {
|
|
5760
|
-
return {
|
|
5761
|
-
"height.px": this.getGridHeight(),
|
|
5762
|
-
"width.px": window.innerWidth - this.widthReduce
|
|
5763
|
-
}; // "width.px": this.innerWidth - 35
|
|
5764
|
-
};
|
|
5765
|
-
ZgridComponent.prototype.getGridHeight = function () {
|
|
5766
|
-
var gridHeight = window.innerHeight - this.heightReduce;
|
|
5767
|
-
return (gridHeight < 250) ? 250 : gridHeight;
|
|
5768
|
-
// const v = ZComponentHelper.isMobileScreen();
|
|
5769
|
-
// if(v){
|
|
5770
|
-
// const h = window.innerHeight - this.heightReduce;
|
|
5771
|
-
// return (h < 250) ? 250 : h;
|
|
5772
|
-
// }else{
|
|
5773
|
-
// return "auto";
|
|
5774
|
-
// }
|
|
5775
|
-
};
|
|
5776
|
-
/* End Grid Styling, Display */
|
|
5777
|
-
/* Start Grid Columns */
|
|
5778
|
-
ZgridComponent.prototype.isSelectOption = function () {
|
|
5779
|
-
var selectOptionExist = false;
|
|
5780
|
-
if (this.data.SelectOptions) {
|
|
5781
|
-
this.selectableSettings = {
|
|
5782
|
-
checkboxOnly: false,
|
|
5783
|
-
mode: (this.data.SelectOptions == "multiple") ? "multiple" : "single"
|
|
5784
|
-
};
|
|
5785
|
-
selectOptionExist = true;
|
|
5786
|
-
}
|
|
5787
|
-
return selectOptionExist;
|
|
5788
|
-
};
|
|
5789
|
-
ZgridComponent.prototype.setColumns = function (columnName, columns) {
|
|
5790
|
-
this.group[columnName] = this.wrapColumnNamesInFieldElement(columns);
|
|
5791
|
-
this.generateGridColumns().subscribe();
|
|
5792
|
-
};
|
|
5793
|
-
ZgridComponent.prototype.wrapColumnNamesInFieldElement = function (columnList) {
|
|
5794
|
-
return rxjs.of(columnList.map(function (c) {
|
|
5795
|
-
var isHidden = c.Hidden;
|
|
5796
|
-
return {
|
|
5797
|
-
Name: c.Name,
|
|
5798
|
-
Value: c.Code,
|
|
5799
|
-
Type: c.Type,
|
|
5800
|
-
gridColVisible: !isHidden,
|
|
5801
|
-
width: 100 + c.Name.length * 4,
|
|
5802
|
-
enableFiltering: false,
|
|
5803
|
-
enableSorting: true,
|
|
5804
|
-
enablePinning: true,
|
|
5805
|
-
DivClass: "col-xs-12 col-sm-6",
|
|
5806
|
-
IsEditableInGrid: c.Editable
|
|
5807
|
-
};
|
|
5808
|
-
}));
|
|
5809
|
-
};
|
|
5810
|
-
ZgridComponent.prototype.generateGridColumns = function () {
|
|
5811
|
-
var _this = this;
|
|
5812
|
-
var gridSetting = this.getGridSettings();
|
|
5813
|
-
var columnFields$ = i3.ZComponentHelper.getGroupValue(this.data.ColumnFields, this.group);
|
|
5814
|
-
if (!this.data.ColumnFields) {
|
|
5815
|
-
console.warn('Invalid/Empty grid(' + this.data.Name + ') columnField');
|
|
5816
|
-
}
|
|
5817
|
-
return columnFields$.pipe(operators.tap(function (data) {
|
|
5818
|
-
if (!data) {
|
|
5819
|
-
console.warn('Invalid/Empty grid(' + _this.data.Name + ') data to generate column');
|
|
5820
|
-
}
|
|
5821
|
-
var fieldName = _this.data['FieldElementName'];
|
|
5822
|
-
_this.columns = [];
|
|
5823
|
-
i3.ZComponentHelper.getGridColumns(data, _this.columns, _this.group, _this.authService, fieldName, gridSetting, null, _this.data);
|
|
5824
|
-
}));
|
|
5825
|
-
};
|
|
5826
|
-
/* End Grid Columns */
|
|
5827
|
-
ZgridComponent.prototype.editModel = function (dataItem) {
|
|
5828
|
-
if (this.data.EditClickURL) {
|
|
5829
|
-
// Edit incell field
|
|
5830
|
-
var colFields = i3.ZComponentHelper.getGroupValue(this.data.ColumnFields, this.group);
|
|
5831
|
-
this.group.subject.next({
|
|
5832
|
-
type: "zgrid-cellClick",
|
|
5833
|
-
target: this.data.EditClickURL,
|
|
5834
|
-
data: dataItem,
|
|
5835
|
-
columnFields$: colFields
|
|
5836
|
-
});
|
|
5837
|
-
}
|
|
5838
|
-
else {
|
|
5839
|
-
// When clicked route to page
|
|
5840
|
-
this.router.navigate([this.group.editModelURL, dataItem.Id, 'edit'], {
|
|
5841
|
-
relativeTo: this.activatedRoute
|
|
5842
|
-
});
|
|
5843
|
-
}
|
|
5844
|
-
};
|
|
5845
|
-
ZgridComponent.prototype.gridCallback = function (group) {
|
|
5846
|
-
if (this.data['AfterloadCallback']) {
|
|
5847
|
-
var me = Object.assign({}, this);
|
|
5848
|
-
this.group.subject.next({
|
|
5849
|
-
type: "zgrid-AfterloadCallback",
|
|
5850
|
-
target: this.data['AfterloadCallback'],
|
|
5851
|
-
data: me
|
|
5852
|
-
});
|
|
5853
|
-
}
|
|
5854
|
-
};
|
|
5855
|
-
ZgridComponent.prototype.getData = function () {
|
|
5856
|
-
if (this.zgrid) {
|
|
5857
|
-
this.zgrid.getDataBinding();
|
|
5858
|
-
}
|
|
5859
|
-
if (this.data.SkipDirective) {
|
|
5860
|
-
this.gridData = kendoDataQuery.process(this.gData, this.state);
|
|
5861
|
-
this.createFormControls();
|
|
5862
|
-
}
|
|
5863
|
-
};
|
|
5864
|
-
ZgridComponent.prototype.getGridData = function () {
|
|
5865
|
-
return this.gData;
|
|
5866
|
-
};
|
|
5867
|
-
ZgridComponent.prototype.getFormControl = function (rowIndex, property) {
|
|
5868
|
-
var formArray = this.inlineEditedFormGroups.get('items');
|
|
5869
|
-
return formArray.at(rowIndex).get(property);
|
|
5870
|
-
};
|
|
5871
|
-
ZgridComponent.prototype.createFormControls = function () {
|
|
5872
|
-
var _this = this;
|
|
5873
|
-
if (this.columns) {
|
|
5874
|
-
// only create if there is at least 1 editable column
|
|
5875
|
-
if (this.columns.find(function (c) { return c.isEditableInGrid; }) === undefined) {
|
|
5876
|
-
return;
|
|
5877
|
-
}
|
|
5878
|
-
this.inlineEditedFormGroups = new forms.FormGroup({ items: new forms.FormArray([]) });
|
|
5879
|
-
this.gridData.data.forEach(function (d) {
|
|
5880
|
-
var items = {};
|
|
5881
|
-
_this.columns.forEach(function (c) {
|
|
5882
|
-
items[c.field] = new forms.FormControl(d[c.field]);
|
|
5883
|
-
});
|
|
5884
|
-
var formGroup = new forms.FormGroup(items);
|
|
5885
|
-
_this.inlineEditedFormGroups.get("items").push(formGroup);
|
|
5886
|
-
});
|
|
5887
|
-
}
|
|
5888
|
-
};
|
|
5889
|
-
ZgridComponent.prototype.createFormGroup = function (dataItem, fieldName) {
|
|
5890
|
-
var _a;
|
|
5891
|
-
return this.formBuilder.group((_a = {},
|
|
5892
|
-
_a[fieldName] = dataItem[fieldName],
|
|
5893
|
-
_a));
|
|
5894
|
-
};
|
|
5895
|
-
ZgridComponent.prototype.getGroupValue = function (value, group) {
|
|
5896
|
-
return i3.ZComponentHelper.getGroupValue(this.data.Value, this.group);
|
|
5897
|
-
};
|
|
5898
|
-
ZgridComponent.prototype.onBtnClick = function (event, colSetting, rowData, cellData) {
|
|
5899
|
-
this.onNavigateTo(event, colSetting, rowData, cellData);
|
|
5900
|
-
};
|
|
5901
|
-
ZgridComponent.prototype.cellClickHandler = function (event) {
|
|
5902
|
-
var _this = this;
|
|
5903
|
-
var disableCellClickHandler = this.data.DisableCellClickHandler ? this.data.DisableCellClickHandler : false;
|
|
5904
|
-
if (!disableCellClickHandler) {
|
|
5905
|
-
var inCellEditable = this.data.InCellEditable ? this.data.InCellEditable : false;
|
|
5906
|
-
if (inCellEditable) {
|
|
5907
|
-
this.editableColumns = this.columns.filter(function (s) { return s.isEditableInDataItem === true; });
|
|
5908
|
-
if (!!this.editableColumns) {
|
|
5909
|
-
this.editableColumns.map(function (s) { return event.sender.editCell(event.rowIndex, event.columnIndex, _this.createFormGroup(event.dataItem, s.field)); });
|
|
5910
|
-
}
|
|
5911
|
-
}
|
|
5912
|
-
else {
|
|
5913
|
-
console.log("cellClick event: ", event);
|
|
5914
|
-
if (this.data.OnItemClick) {
|
|
5915
|
-
var func = i3.ZComponentHelper.getGroupEvalValue.call(this, this.data.OnItemClick);
|
|
5916
|
-
if (typeof func === 'function') {
|
|
5917
|
-
var callFunc = func.bind(this.group.ctrlScope);
|
|
5918
|
-
callFunc(event);
|
|
5919
|
-
}
|
|
5920
|
-
return;
|
|
5921
|
-
}
|
|
5922
|
-
this.editModel(event.dataItem);
|
|
5923
|
-
}
|
|
5924
|
-
}
|
|
5925
|
-
};
|
|
5926
|
-
ZgridComponent.prototype.editCellCloseHandler = function (args) {
|
|
5927
|
-
var formGroup = args.formGroup, dataItem = args.dataItem;
|
|
5928
|
-
if (!formGroup.valid) {
|
|
5929
|
-
args.preventDefault();
|
|
5930
|
-
}
|
|
5931
|
-
else if (formGroup.dirty) {
|
|
5932
|
-
this.editableColumns = this.columns.filter(function (s) { return s.isEditableInDataItem === true; });
|
|
5933
|
-
this.editableColumns.map(function (s) {
|
|
5934
|
-
var _a;
|
|
5935
|
-
return Object.assign(dataItem, (_a = {}, _a[s.field] = formGroup.value[s.field], _a));
|
|
5936
|
-
});
|
|
5937
|
-
this.mySelection.map(function (s) { return (s.Id === dataItem.Id) ? Object.assign(s, dataItem) : null; });
|
|
5938
|
-
}
|
|
5939
|
-
};
|
|
5940
|
-
ZgridComponent.prototype.onNavigateTo = function (event, clickAction, rowData, cellData) {
|
|
5941
|
-
// debugger;
|
|
5942
|
-
// const n = colSetting.navigateTo.replace('/:id', cellData);
|
|
5943
|
-
var n = i3.ZComponentHelper.getGroupEvalValue.call(this, clickAction.Click);
|
|
5944
|
-
if (n) {
|
|
5945
|
-
event.stopPropagation();
|
|
5946
|
-
this.group.subject.next({
|
|
5947
|
-
type: 'zgrid-onNavigateTo',
|
|
5948
|
-
target: clickAction.Click,
|
|
5949
|
-
rowData: rowData,
|
|
5950
|
-
data: cellData
|
|
5951
|
-
});
|
|
5952
|
-
}
|
|
5953
|
-
};
|
|
5954
|
-
ZgridComponent.prototype.showTooltip = function (e) {
|
|
5955
|
-
var element = e.target;
|
|
5956
|
-
if ((element.nodeName === 'TD' || element.nodeName === 'TH') &&
|
|
5957
|
-
element.offsetWidth < element.scrollWidth) {
|
|
5958
|
-
this.tooltipDir.toggle(element);
|
|
5959
|
-
}
|
|
5960
|
-
else {
|
|
5961
|
-
this.tooltipDir.hide();
|
|
5962
|
-
}
|
|
5963
|
-
};
|
|
5964
|
-
ZgridComponent.prototype.rowSelectionKey = function (context) {
|
|
5965
|
-
return context.dataItem;
|
|
5966
|
-
};
|
|
5967
|
-
ZgridComponent.prototype.getSeletectedValues = function () {
|
|
5968
|
-
return this.mySelection;
|
|
5969
|
-
};
|
|
5970
|
-
ZgridComponent.prototype.refreshGrid = function (event, group, me) {
|
|
5971
|
-
var _gridOptionSegment = event.target.trim().split('.');
|
|
5972
|
-
var _gridOption = _gridOptionSegment[1];
|
|
5973
|
-
if (_gridOption) {
|
|
5974
|
-
var zgridControl = group[_gridOption];
|
|
5975
|
-
if (zgridControl) {
|
|
5976
|
-
zgridControl.getData();
|
|
5977
|
-
}
|
|
5978
|
-
else {
|
|
5979
|
-
console.log('Unable to find grid value: ' + _gridOption);
|
|
5980
|
-
}
|
|
5981
|
-
}
|
|
5982
|
-
else {
|
|
5983
|
-
console.log('Invalid refreshGrid event: ', event);
|
|
5984
|
-
}
|
|
5985
|
-
};
|
|
5986
|
-
ZgridComponent.prototype.refreshData = function () {
|
|
5987
|
-
this.getData();
|
|
5988
|
-
};
|
|
5989
|
-
ZgridComponent.prototype.clearData = function () {
|
|
5990
|
-
this.zgrid.clearData();
|
|
5991
|
-
};
|
|
5992
|
-
ZgridComponent.prototype.allResults = function () {
|
|
5993
|
-
var _zgridControl = this.zgrid;
|
|
5994
|
-
var _zgridComponent = this.zgrid.grid;
|
|
5995
|
-
var _data = _zgridComponent.data;
|
|
5996
|
-
var paginationApiPostUrl = _zgridControl.paginationApiPostUrl;
|
|
5997
|
-
// Need to clone, if not will affect the grid params.
|
|
5998
|
-
var params = Object.assign({}, this.params);
|
|
5999
|
-
params.pageNo = 0;
|
|
6000
|
-
params.pageSize = _data.total;
|
|
6001
|
-
return this.webApiService.httpPost$(paginationApiPostUrl, params).pipe(operators.map(function (data) {
|
|
6002
|
-
var result = {
|
|
6003
|
-
data: kendoDataQuery.process(data.dataSet, {}).data
|
|
6004
|
-
};
|
|
6005
|
-
return result;
|
|
6006
|
-
}));
|
|
6007
|
-
};
|
|
6008
|
-
ZgridComponent.prototype.getClass = function (dataItem, col) {
|
|
6009
|
-
var ngClass = "gridCell ";
|
|
6010
|
-
if (col.fieldType === 'number' || col.fieldType === 'currency' || col.fieldType === 'znumeric') {
|
|
6011
|
-
ngClass += "rightAligned ";
|
|
6012
|
-
}
|
|
6013
|
-
if (dataItem[col.field + '_Class']) {
|
|
6014
|
-
ngClass += dataItem[col.field + '_Class'] + " ";
|
|
6015
|
-
}
|
|
6016
|
-
if (col.Class) {
|
|
6017
|
-
ngClass += col.Class + " ";
|
|
6018
|
-
}
|
|
6019
|
-
return ngClass;
|
|
6020
|
-
};
|
|
6021
|
-
ZgridComponent.prototype.getFormat = function (col, defaultFormat) {
|
|
6022
|
-
var format = "";
|
|
6023
|
-
if (col.FormatOptions === undefined) {
|
|
6024
|
-
format = defaultFormat ? defaultFormat : "";
|
|
6025
|
-
}
|
|
6026
|
-
else {
|
|
6027
|
-
var formatArr = col.FormatOptions.split(".");
|
|
6028
|
-
var dp = 0;
|
|
6029
|
-
if (formatArr.length > 1) {
|
|
6030
|
-
dp = formatArr[1].length;
|
|
6031
|
-
}
|
|
6032
|
-
if (dp !== 0) {
|
|
6033
|
-
format = "1." + dp + "-" + dp;
|
|
6034
|
-
}
|
|
6035
|
-
}
|
|
6036
|
-
return format;
|
|
6037
|
-
};
|
|
6038
|
-
ZgridComponent.prototype.setHeaderText = function (columnName, newHeaderTitle) {
|
|
6039
|
-
var gridColumns = this.columns;
|
|
6040
|
-
gridColumns.forEach(function (col) {
|
|
6041
|
-
if (col.Name === columnName) {
|
|
6042
|
-
col.title = newHeaderTitle;
|
|
6043
|
-
}
|
|
6044
|
-
});
|
|
6045
|
-
};
|
|
6046
|
-
ZgridComponent.prototype.setGridIsLoading = function (triggered) {
|
|
6047
|
-
this.isLoading = triggered;
|
|
6048
|
-
};
|
|
6049
|
-
ZgridComponent.prototype.setGridSessionKey = function (group) {
|
|
6050
|
-
if (group["GridStorageKey"]) {
|
|
6051
|
-
return;
|
|
6052
|
-
}
|
|
6053
|
-
else {
|
|
6054
|
-
group["GridStorageKey"] = 'zgrid_' + group.resourceURL + '_' + this.data.Value + '::' + this.authService.e1Token.userName;
|
|
6055
|
-
}
|
|
6056
|
-
};
|
|
6057
|
-
ZgridComponent.prototype.trackBy = function (index, item) {
|
|
6058
|
-
//console.log(item.data['Id'] || index);
|
|
6059
|
-
return index;
|
|
6060
|
-
};
|
|
6061
|
-
/* Grid configuration function */
|
|
6062
|
-
ZgridComponent.prototype.saveGridSettings = function () {
|
|
6063
|
-
var _this = this;
|
|
6064
|
-
var _zgridComponent = this.zgrid.grid;
|
|
6065
|
-
var _columns = _zgridComponent.columns;
|
|
6066
|
-
rxjs.of(this.columns)
|
|
6067
|
-
.pipe(operators.switchMap(function () {
|
|
6068
|
-
var configValue = _columns.toArray().map(function (item) {
|
|
6069
|
-
var _zGridColumnSettings = Object.keys(item)
|
|
6070
|
-
.filter(function (propName) {
|
|
6071
|
-
return !propName.toLowerCase().includes('template');
|
|
6072
|
-
})
|
|
6073
|
-
.reduce(function (acc, curr) {
|
|
6074
|
-
var _a;
|
|
6075
|
-
return (Object.assign(Object.assign({}, acc), (_a = {}, _a[curr] = item[curr], _a)));
|
|
6076
|
-
}, {});
|
|
6077
|
-
return _zGridColumnSettings;
|
|
6078
|
-
});
|
|
6079
|
-
// remove extra element form array
|
|
6080
|
-
configValue.forEach(function (item) {
|
|
6081
|
-
delete item['headerStyle'];
|
|
6082
|
-
delete item['__ngContext__'];
|
|
6083
|
-
});
|
|
6084
|
-
var gridSetting = {
|
|
6085
|
-
// state: this.state,
|
|
6086
|
-
columnsConfig: configValue
|
|
6087
|
-
};
|
|
6088
|
-
// Find any setting from localstorage and update, if not just add in.
|
|
6089
|
-
var _arrGridCaching = _this.zGridStatePersistingService.get(_this.gridStorageKey);
|
|
6090
|
-
var _gridConfig = null;
|
|
6091
|
-
if (_arrGridCaching && _arrGridCaching[0]) {
|
|
6092
|
-
_gridConfig = _arrGridCaching.find(function (x) { return x['dataFormFields'] === _this.gridStorageKey; });
|
|
6093
|
-
if (_gridConfig) {
|
|
6094
|
-
_gridConfig.gridSettings = gridSetting;
|
|
6095
|
-
}
|
|
6096
|
-
}
|
|
6097
|
-
else {
|
|
6098
|
-
_arrGridCaching = [];
|
|
6099
|
-
}
|
|
6100
|
-
if (!_gridConfig) {
|
|
6101
|
-
_gridConfig = {
|
|
6102
|
-
dataFormFields: _this.gridStorageKey,
|
|
6103
|
-
gridSettings: gridSetting
|
|
6104
|
-
};
|
|
6105
|
-
_arrGridCaching.push(_gridConfig);
|
|
6106
|
-
}
|
|
6107
|
-
return _arrGridCaching;
|
|
6108
|
-
}), operators.concatMap(function (gridCache) {
|
|
6109
|
-
// Save grid caching to localstorage
|
|
6110
|
-
_this.zGridStatePersistingService.set(_this.gridStorageKey, gridCache);
|
|
6111
|
-
// Save to CookieStore
|
|
6112
|
-
return _this.mainService.cookieStorePost(_this.gridStorageKey, gridCache);
|
|
6113
|
-
}), operators.tap(function (savedGridCache) {
|
|
6114
|
-
// check is saved state exist to enable/hide restore button
|
|
6115
|
-
_this.stateExist();
|
|
6116
|
-
}), operators.tap(function () {
|
|
6117
|
-
// Alert
|
|
6118
|
-
_this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
|
|
6119
|
-
})).subscribe();
|
|
6120
|
-
};
|
|
6121
|
-
ZgridComponent.prototype.restoreGridSettings = function () {
|
|
6122
|
-
var _this = this;
|
|
6123
|
-
rxjs.of(true)
|
|
6124
|
-
.pipe(operators.switchMap(function () {
|
|
6125
|
-
// Clear localstorage grid setting
|
|
6126
|
-
_this.zGridStatePersistingService.remove(_this.gridStorageKey);
|
|
6127
|
-
return rxjs.of(true);
|
|
6128
|
-
}), operators.switchMap(function () {
|
|
6129
|
-
// delete cookiestore gridSetting by storagekey as name
|
|
6130
|
-
return _this.mainService.cookieStoreDeleteMultiple(_this.gridStorageKey);
|
|
6131
|
-
}), operators.concatMap(function () {
|
|
6132
|
-
// Use original column setting
|
|
6133
|
-
return _this.generateGridColumns();
|
|
6134
|
-
}), operators.tap(function () {
|
|
6135
|
-
// check is saved state exist
|
|
6136
|
-
_this.stateExist();
|
|
6137
|
-
// Alert
|
|
6138
|
-
_this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
|
|
6139
|
-
})).subscribe();
|
|
6140
|
-
};
|
|
6141
|
-
ZgridComponent.prototype.getGridSettings = function () {
|
|
6142
|
-
var _storageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
|
|
6143
|
-
// Find any setting from localstorage..
|
|
6144
|
-
var _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
|
|
6145
|
-
if (_arrGridCaching) {
|
|
6146
|
-
var _gridCaching = JSON.parse(_arrGridCaching['Value']);
|
|
6147
|
-
if (_gridCaching) {
|
|
6148
|
-
return _gridCaching.gridSettings.columnsConfig.sort(function (a, b) { return a.orderIndex - b.orderIndex; });
|
|
6149
|
-
}
|
|
6150
|
-
}
|
|
6151
|
-
};
|
|
6152
|
-
/* Inline setting */
|
|
6153
|
-
ZgridComponent.prototype.getInlineField = function (value) {
|
|
6154
|
-
return this.columns.find(function (x) { return x.Value === value; });
|
|
6155
|
-
};
|
|
6156
|
-
ZgridComponent.prototype.getInlineForm = function (rowIndex) {
|
|
6157
|
-
var formArray = this.inlineEditedFormGroups.get('items');
|
|
6158
|
-
return formArray.at(rowIndex);
|
|
6159
|
-
};
|
|
6160
|
-
ZgridComponent.prototype.getFormControlData = function (value) {
|
|
6161
|
-
return this.inlineEditedFormGroups.value.items;
|
|
6162
|
-
};
|
|
6163
|
-
/* Event */
|
|
6164
|
-
ZgridComponent.prototype.beforeGridGetData = function (group, me) {
|
|
6165
|
-
console.warn("beforeDataBinding triggered");
|
|
6166
|
-
if (!group.beforeGridGetData) {
|
|
6167
|
-
console.warn("group.beforeDataBinding is undefined");
|
|
6168
|
-
return rxjs.of(true);
|
|
6169
|
-
}
|
|
6170
|
-
return group.beforeGridGetData(group, me);
|
|
6171
|
-
};
|
|
6172
|
-
ZgridComponent.prototype.getGridSessionFilter = function (group, me) {
|
|
6173
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
6174
|
-
var StorageKey;
|
|
6175
|
-
var _this = this;
|
|
6176
|
-
return __generator(this, function (_a) {
|
|
6177
|
-
switch (_a.label) {
|
|
6178
|
-
case 0:
|
|
6179
|
-
if (!group["GridStorageKey"]) {
|
|
6180
|
-
return [2 /*return*/, null];
|
|
6181
|
-
}
|
|
6182
|
-
StorageKey = group["GridStorageKey"];
|
|
6183
|
-
if (!this.storageService) return [3 /*break*/, 2];
|
|
6184
|
-
return [4 /*yield*/, this.storageService.get(StorageKey)
|
|
6185
|
-
.then(function (data) {
|
|
6186
|
-
if (!data || !data.value || data.value === "null") {
|
|
6187
|
-
return null;
|
|
6188
|
-
}
|
|
6189
|
-
else {
|
|
6190
|
-
var result = JSON.parse(data.value);
|
|
6191
|
-
_this.state.filter = JSON.parse(result["StateFilter"]);
|
|
6192
|
-
_this.params.filterParams = JSON.parse(result["FilterParams"]);
|
|
6193
|
-
_this.state.filter.filters.forEach(function (stateFilter) {
|
|
6194
|
-
if (stateFilter.field.includes('UTC')) {
|
|
6195
|
-
stateFilter.value = new Date(stateFilter.value);
|
|
6196
|
-
}
|
|
6197
|
-
});
|
|
6198
|
-
return data;
|
|
6199
|
-
}
|
|
6200
|
-
})];
|
|
6201
|
-
case 1:
|
|
6202
|
-
_a.sent();
|
|
6203
|
-
return [3 /*break*/, 3];
|
|
6204
|
-
case 2: return [2 /*return*/, null];
|
|
6205
|
-
case 3: return [2 /*return*/];
|
|
5161
|
+
showLabels: true,
|
|
5162
|
+
rangeSize: 10,
|
|
5163
|
+
};
|
|
5164
|
+
}
|
|
5165
|
+
ZgaugeComponent.prototype.ngOnInit = function () {
|
|
5166
|
+
i3.ZComponentHelper.setComponentProperties(this);
|
|
5167
|
+
i3.ZComponentHelper.registerComponent(this);
|
|
5168
|
+
if (this.data.Options) {
|
|
5169
|
+
var optionType = typeof (this.data.Options);
|
|
5170
|
+
if (optionType === 'object') {
|
|
5171
|
+
Object.assign(this.options, this.data.Options);
|
|
5172
|
+
}
|
|
5173
|
+
else if (optionType === 'string') {
|
|
5174
|
+
var optionValue = i3.ZComponentHelper.getGroupEvalValue.call(this, this.data.Options);
|
|
5175
|
+
if (typeof (optionValue) === 'object') {
|
|
5176
|
+
Object.assign(this.options, optionValue);
|
|
6206
5177
|
}
|
|
6207
|
-
}
|
|
6208
|
-
});
|
|
6209
|
-
};
|
|
6210
|
-
ZgridComponent.prototype.setGridSessionFilter = function (group, me) {
|
|
6211
|
-
if (!group["GridStorageKey"]) {
|
|
6212
|
-
return null;
|
|
6213
|
-
}
|
|
6214
|
-
var StorageKey = group["GridStorageKey"];
|
|
6215
|
-
var lstGridFilter = {};
|
|
6216
|
-
if (me.state.filter && this.storageService && this.data['SaveFilter']) {
|
|
6217
|
-
//list of data for StateFilter and FilterParams
|
|
6218
|
-
lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
|
|
6219
|
-
//create session storage
|
|
6220
|
-
this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
|
|
5178
|
+
}
|
|
6221
5179
|
}
|
|
5180
|
+
this.getFieldDeclarationForSetup(this.data, this.options);
|
|
5181
|
+
this.isLoading = false;
|
|
6222
5182
|
};
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
5183
|
+
ZgaugeComponent.prototype.getFieldDeclarationForSetup = function (field, options) {
|
|
5184
|
+
options.value = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Value) || options.value;
|
|
5185
|
+
options.title = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Title) || options.title;
|
|
5186
|
+
options.scaleMax = field.Max || options.scaleMax;
|
|
5187
|
+
options.minValue = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MinValue) || options.minValue;
|
|
5188
|
+
options.maxValue = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MaxValue) || options.maxValue;
|
|
5189
|
+
options.colors = i3.ZComponentHelper.getGroupEvalValue.call(this, field.Color) || options.colors;
|
|
5190
|
+
options.transitions = field.Transitions || options.transitions;
|
|
5191
|
+
options.majorTicks = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MajorTicks) || options.majorTicks;
|
|
5192
|
+
options.showLabels = field.ShowLabels || options.showLabels;
|
|
5193
|
+
options.style = field.Style || options.style;
|
|
5194
|
+
options.minorTicks = i3.ZComponentHelper.getGroupEvalValue.call(this, field.MinorTicks) || options.minorTicks;
|
|
5195
|
+
options.reverse = field.Reverse || options.reverse;
|
|
5196
|
+
options.startAngle = i3.ZComponentHelper.getGroupEvalValue.call(this, field.StartAngle) || options.startAngle;
|
|
5197
|
+
options.endAngle = i3.ZComponentHelper.getGroupEvalValue.call(this, field.EndAngle) || options.endAngle;
|
|
5198
|
+
options.rangePlaceholderColor = field.RangePlaceholderColor || options.rangePlaceholderColor;
|
|
5199
|
+
options.rangeFrom = i3.ZComponentHelper.getGroupEvalValue.call(this, field.RangeFrom) || options.rangeFrom;
|
|
5200
|
+
options.rangeTo = i3.ZComponentHelper.getGroupEvalValue.call(this, field.RangeTo) || options.rangeTo;
|
|
5201
|
+
options.rangeColor = field.RangeColor || options.rangeColor;
|
|
5202
|
+
options.rangeLineCap = field.RangeLineCap || options.rangeLineCap;
|
|
5203
|
+
options.rangeSize = field.RangeSize || options.rangeSize;
|
|
5204
|
+
options.GaugeAlignment = i3.ZComponentHelper.getGroupEvalValue.call(this, field.GaugeAlignment) || options.GaugeAlignment;
|
|
5205
|
+
options.paddingValue = options.value.toString() === 'NaN' ? options.GaugeAlignment : '0%';
|
|
6228
5206
|
};
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
this.
|
|
6232
|
-
}
|
|
5207
|
+
ZgaugeComponent.prototype.alignment = function () {
|
|
5208
|
+
var alignmentStyle = {
|
|
5209
|
+
"padding-right": this.options["paddingValue"]
|
|
5210
|
+
};
|
|
5211
|
+
return alignmentStyle;
|
|
6233
5212
|
};
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
5213
|
+
ZgaugeComponent.prototype.setEnable = function (status) {
|
|
5214
|
+
// const fc = this.group.form.controls[this.data.Value];
|
|
5215
|
+
// status ? fc.enable() : fc.disable();
|
|
5216
|
+
this.componentProperties.isReadOnly = !status;
|
|
6238
5217
|
};
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
this.
|
|
5218
|
+
ZgaugeComponent.prototype.setVisible = function (status) {
|
|
5219
|
+
this.componentProperties.isVisible = status;
|
|
5220
|
+
this.data.Visible = status;
|
|
6242
5221
|
};
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
var _zgridComponent = this.zgrid.grid;
|
|
6246
|
-
var _data = _zgridComponent.data;
|
|
6247
|
-
if (this.zgrid) {
|
|
6248
|
-
var _zgrid = this.zgrid;
|
|
6249
|
-
}
|
|
5222
|
+
ZgaugeComponent.prototype.setRequire = function (status) {
|
|
5223
|
+
this.componentProperties.isRequired = status;
|
|
6250
5224
|
};
|
|
6251
|
-
|
|
5225
|
+
ZgaugeComponent.prototype.setData = function (gData) {
|
|
5226
|
+
this.getFieldDeclarationForSetup(this.data, this.options);
|
|
5227
|
+
};
|
|
5228
|
+
return ZgaugeComponent;
|
|
6252
5229
|
}());
|
|
6253
|
-
|
|
5230
|
+
ZgaugeComponent.decorators = [
|
|
6254
5231
|
{ type: i0.Component, args: [{
|
|
6255
|
-
selector:
|
|
6256
|
-
template: "<!--\r\n<div style=\"margin: 10px\">\r\n <div class=\"card\">\r\n <div class=\"card-block k-form\">\r\n <fieldset>\r\n <legend>Binding types</legend>\r\n <div class=\"k-form-field\">\r\n <span>Bind the data to:</span>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"array\" value=\"array\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"array\">Array object</label>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"gridDataResult\" value=\"gridDataResult\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"gridDataResult\">GridDataResult object</label>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"async\" value=\"async\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"async\">Asynchronous source</label>\r\n </div>\r\n </fieldset>\r\n </div>\r\n </div>\r\n</div> -->\r\n<div style=\"margin: 10px 0 6px 0;\">\r\n <div *ngIf=\"data.Title\" class=\"gridTitle\">{{data.Title}}</div>\r\n <ng-template #template let-anchor>\r\n <span>{{ anchor.nativeElement.innerText }}</span>\r\n </ng-template>\r\n <div kendoTooltip\r\n showOn=\"none\"\r\n [tooltipTemplate]=\"template\"\r\n filter=\".k-grid td\"\r\n (mouseover)=\"showTooltip($event)\">\r\n <kendo-grid [zgridbinding]=\"{data: data, group: group, params: params, gridSubject: gridSubject}\" [ngClass]=\"data.Class\"\r\n [data]=\"gridData\"\r\n [pageSize]=\"state.take\"\r\n [pageable]=\"{buttonCount: 5, pageSizes: pageSizes, previousNext: false}\"\r\n [skip]=\"state.skip\"\r\n [sort]=\"state.sort\"\r\n [sortable]=\"{allowUnsort: true,mode: 'multiple'}\"\r\n [filter]=\"state.filter\"\r\n [filterable]=\"data.enableFiltering !== false\"\r\n [resizable]=\"true\"\r\n [reorderable]=\"true\"\r\n [columnMenu]=\"data.DisableGridColumnMenu ? false : { filter: true }\"\r\n [hidden] =\"!(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\"\r\n (cellClick)=\"cellClickHandler($event)\"\r\n (cellClose)=\"editCellCloseHandler($event)\"\r\n (dataStateChange)=\"dataStateChange($event)\"\r\n (pageChange)=\"pageChange($event)\"\r\n (sortChange)=\"sortChange($event)\"\r\n (filterChange)=\"filterChange($event)\"\r\n (columnReorder)=\"columnsOrderChanged($event)\"\r\n [kendoGridSelectBy]=\"rowSelectionKey\"\r\n [selectable]=\"selectableSettings\"\r\n [selectedKeys]=\"mySelection\"\r\n [ngStyle]=\"getGridStyle()\"\r\n [trackBy]=\"trackBy\">\r\n <ng-template kendoGridToolbarTemplate *ngIf=\"data.AllowRefreshButton || data.AllowExport || data.AllowSaveState\">\r\n <button class=\"k-button\" (click)=\"refreshData()\" *ngIf=\"data.AllowRefreshButton\"><span class=\"k-icon k-i-refresh-sm\"></span> Refresh</button>\r\n <button type=\"button\" kendoGridExcelCommand *ngIf=\"data.AllowExport\"><span class=\"k-icon k-i-file-excel\"></span> Export Data to Excel</button>\r\n <button class=\"k-button\" (click)=\"saveGridSettings()\" *ngIf=\"data.AllowSaveState\"><span class=\"k-icon k-i-star\"></span> Save Setting</button>\r\n <button class=\"k-button\" (click)=\"restoreGridSettings()\" *ngIf=\"gridDefaultStateExist\"><span class=\"k-icon k-i-star-outline\"></span> Restore Setting</button>\r\n </ng-template>\r\n <kendo-grid-checkbox-column *ngIf=\"!!data.SelectOptions\" [width]=\"60\" showSelectAll=\"true\" [columnMenu]=\"true\"></kendo-grid-checkbox-column>\r\n <kendo-grid-column *ngFor=\"let col of columns\"\r\n [field]=\"col.field\"\r\n [title]=\"col.title\"\r\n [width]=\"col.width\"\r\n [minResizableWidth]=\"col.minResizableWidth\"\r\n [filter]=\"col.filter\"\r\n [filterable]=\"filterable(col.enableFiltering)\"\r\n [sortable]=\"sortable(col.enableSorting)\"\r\n [headerStyle]=\"{'white-space': 'initial'}\"\r\n [hidden]=\"col.hidden\"\r\n [format]=\"col.format\"\r\n [class]=\"col.Class\"\r\n [locked]=\"locked(col)\"\r\n editor=\"numeric\">\r\n <div [ngSwitch]=\"true\">\r\n <div *ngSwitchCase=\"col.fieldType === 'number'\r\n || col.fieldType === 'currency'\r\n || col.fieldType === 'znumeric'\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-numeric-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"eq\">\r\n <kendo-filter-eq-operator></kendo-filter-eq-operator>\r\n <kendo-filter-neq-operator></kendo-filter-neq-operator>\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-numeric-filter-cell>\r\n </ng-template>\r\n </div>\r\n <div *ngSwitchCase=\"col.fieldType == 'zdate'\r\n || col.fieldType === 'ztime'\r\n || col.fieldType === 'zdatetime'\r\n || col.fieldType === 'zuidatetime'\">\r\n <div *ngIf=\"col.filterByDateRange === true\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\" operator=\"lte\">\r\n <date-range-filter-cell class=\"date-range-filter\"\r\n [filter]=\"filter\"\r\n [field]=\"col.field\">\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </date-range-filter-cell>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"col.filterByDateRange === false\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-date-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"lte\">\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-date-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-string-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"contains\">\r\n <kendo-filter-contains-operator></kendo-filter-contains-operator>\r\n <kendo-filter-eq-operator></kendo-filter-eq-operator>\r\n <kendo-filter-neq-operator></kendo-filter-neq-operator>\r\n <kendo-filter-startswith-operator></kendo-filter-startswith-operator>\r\n <kendo-filter-endswith-operator></kendo-filter-endswith-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-string-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <ng-template kendoGridCellTemplate let-dataItem let-rowIndex=\"rowIndex\">\r\n <div style=\"margin: 1px 0;\" *ngIf=\"!col.clickableIcons && col.isEditableInGrid !== true\" [ngSwitch]=\"col.fieldType\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'zdate'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'ztime'\">\r\n {{ dataItem[col.field] | date: 'HH:mm' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zshortdate'\">\r\n {{ dataItem[col.field] | date: 'MMM yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zdatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuidatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'number'\">\r\n {{ dataItem[col.field] | number }}\r\n </span>\r\n <span *ngSwitchCase=\"'currency'\">\r\n {{ dataItem[col.field] | number: getFormat(col, '1.2-2') }}\r\n </span>\r\n <span *ngSwitchCase=\"'znumeric'\">\r\n {{ dataItem[col.field] | number: getFormat(col) }}\r\n </span>\r\n <span *ngSwitchCase=\"'url'\" style=\"color: blue; cursor: pointer; text-decoration:underline;\">\r\n {{ dataItem[col.field] }}\r\n </span>\r\n <span *ngSwitchDefault>\r\n {{ dataItem[col.field]}}\r\n </span>\r\n </div>\r\n <!-- <span *ngIf=\"!!col.navigateTo\" (click)=\"onNavigateTo($event, col, dataItem, dataItem[col.field])\">\r\n <ion-button color=\"light\" size=\"small\">\r\n {{ col.ClickableIcons }}\r\n <ion-icon slot= \"end\" name=\"arrow-forward\"></ion-icon>\r\n </ion-button>\r\n </span> -->\r\n <div style=\"margin: 5px 0;\" *ngIf=\"col.isEditableInGrid === true && inlineEditedFormGroups\" [ngSwitch]=\"col.fieldType\" [formGroup]=\"inlineEditedFormGroups\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'number'\">\r\n <input type=\"number\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" />\r\n </span>\r\n <span *ngSwitchCase=\"'checkbox'\">\r\n <ion-checkbox [disabled]=\"(!!col.ReadOnly ? col.ReadOnly : false)\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" color=\"primary\" (ionChange)=\"inCellCheckBoxOnChange($event, rowIndex, col)\"></ion-checkbox>\r\n </span>\r\n <span *ngSwitchCase=\"'zuiselectmultiple'\">\r\n <app-zselectmultiple style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-zselectmultiple>\r\n </span>\r\n <span *ngSwitchCase=\"'textarea'\">\r\n <app-ztextarea style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-ztextarea>\r\n </span>\r\n <span *ngSwitchCase=\"['zuidatetime','zdate', 'ztime','zdatetime','zshortdate'].includes(col.fieldType) ? col.fieldType : ''\">\r\n <app-zdatetime style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-zdatetime>\r\n </span>\r\n <span *ngSwitchDefault>\r\n <input style=\"width: 100%;\" type=\"text\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" />\r\n </span>\r\n </div>\r\n <span style=\"margin-top: 10px;\" *ngFor=\"let icon of col.clickableIcons\">\r\n <span [ngClass]=\"icon.Class ? icon.Class : ''\" *ngIf=\"!!icon && (!!dataItem.WFS_StatusCode && !!icon)\r\n ? dataItem.WFS_StatusCode !== icon.WFS_StatusCode\r\n : true;\r\n else disabledButton\" (click)=\"onBtnClick($event, icon, dataItem, dataItem[col.field])\">\r\n {{icon.Name || dataItem[col.field]}} <fa-icon [icon]=\"icon.Icon\" style=\"padding: 4px 6px;\">\r\n </fa-icon>\r\n </span>\r\n <ng-template #disabledButton>\r\n </ng-template>\r\n </span>\r\n <!-- <strong>{{ dataItem[col.field] }}</strong> -->\r\n <!-- <span class=\"{{dataItem.Discontinued ? 'discontinued' : 'active'}}\">\r\n {{dataItem.Discontinued ? \"discontinued\" : \"active\"}}\r\n </span> -->\r\n </ng-template>\r\n <ng-template kendoGridFooterTemplate let-column let-columnIndex=\"columnIndex\" *ngIf=\"data.EnableAggregate\">\r\n <div style=\"margin: 5px 0;\" [ngSwitch]=\"col.fieldType\">\r\n {{col.aggregateType}}\r\n <span *ngSwitchCase=\"'zdate'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'ztime'\">\r\n {{ col.aggregateValue | date: 'HH:mm' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zshortdate'\">\r\n {{ col.aggregateValue | date: 'MMM yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zdatetime'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuidatetime'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'number'\">\r\n {{ col.aggregateValue | number }}\r\n </span>\r\n <span *ngSwitchCase=\"'currency'\">\r\n {{ col.aggregateValue | number: getFormat(col, '1.2.2') }}\r\n </span>\r\n <span *ngSwitchCase=\"'znumeric'\">\r\n {{ col.aggregateValue | number: getFormat(col) }}\r\n </span>\r\n <span *ngSwitchCase=\"'url'\" style=\"color: blue; cursor: pointer; text-decoration:underline;\">\r\n {{ col.aggregateValue }}\r\n </span>\r\n <span *ngSwitchDefault>\r\n {{ col.aggregateValue }}\r\n </span>\r\n </div>\r\n </ng-template>\r\n </kendo-grid-column>\r\n <kendo-grid-excel fileName=\"Export.xlsx\" [fetchData]=\"allResults\"></kendo-grid-excel>\r\n </kendo-grid>\r\n <div *ngIf=\"isLoading\" class=\"k-i-loading\"></div>\r\n </div>\r\n</div>\r\n",
|
|
6257
|
-
styles: ["
|
|
5232
|
+
selector: 'app-zgauge',
|
|
5233
|
+
template: "<div *ngIf=\"!isLoading && (!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" style=\"text-align: center;\">\r\n <div id=\"marketShareContainer\" class=\"ion-row\" class=\"col-xs-12 stats-graph\">\r\n <h6 style=\"color: gray;\">{{ options.title }}</h6>\r\n </div>\r\n <div [ngStyle]='alignment()'>\r\n <kendo-arcgauge [value]=\"options.value\" [transitions]=\"options.transitions\" [colors]=\"options.colors\" style=\"margin-top:50px;width:90% ;height:100%; min-width: 330px;\">\r\n <kendo-arcgauge-scale\r\n [majorTicks]=\"{ visible: true, color: '#0000ff' }\"\r\n [minorTicks]=\"{ visible: true, color: '#0000ff' }\"\r\n [reverse]=\"options.reverse\"\r\n [startAngle]=\"0\"\r\n [endAngle]=\"180\"\r\n [min]=\"options.minValue\"\r\n [max]=\"options.maxValue\"\r\n [rangePlaceholderColor]=\"options.rangePlaceholderColor\"\r\n [rangeSize]=\"options.rangeSize\"\r\n [rangeLineCap]=\"options.rangeLineCap\">\r\n <kendo-arcgauge-scale-labels format=\"l\" [color]=\"options.labelsColor\" [visible]=\"options.showLabels\">\r\n </kendo-arcgauge-scale-labels>\r\n </kendo-arcgauge-scale>\r\n <ng-template kendoArcGaugeCenterTemplate let-value=\"value\" let-color=\"color\">\r\n <span [style.color]=\"color\">{{ value }}</span>\r\n </ng-template>\r\n </kendo-arcgauge>\r\n </div>\r\n</div>\r\n",
|
|
5234
|
+
styles: [""]
|
|
6258
5235
|
},] }
|
|
6259
5236
|
];
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
{ type: i1.Router },
|
|
6263
|
-
{ type: forms.FormBuilder },
|
|
6264
|
-
{ type: i3.AuthService },
|
|
6265
|
-
{ type: i3.WebApiService },
|
|
6266
|
-
{ type: i3.ZGridStatePersistingService },
|
|
6267
|
-
{ type: i3.ToastService },
|
|
6268
|
-
{ type: i3.ZCoreService },
|
|
6269
|
-
{ type: i3.StorageSessionService },
|
|
6270
|
-
{ type: MainService }
|
|
6271
|
-
]; };
|
|
6272
|
-
ZgridComponent.propDecorators = {
|
|
5237
|
+
ZgaugeComponent.ctorParameters = function () { return []; };
|
|
5238
|
+
ZgaugeComponent.propDecorators = {
|
|
6273
5239
|
data: [{ type: i0.Input }],
|
|
6274
5240
|
group: [{ type: i0.Input }],
|
|
6275
|
-
form: [{ type: i0.Input }]
|
|
6276
|
-
tooltipDir: [{ type: i0.ViewChild, args: [kendoAngularTooltip.TooltipDirective,] }]
|
|
5241
|
+
form: [{ type: i0.Input }]
|
|
6277
5242
|
};
|
|
6278
5243
|
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
function ZgridcalendarComponent(activatedRoute, router, formBuilder, authService, webApiService, zGridStatePersistingService, toastService, zcoreService) {
|
|
5244
|
+
var ZgridComponent = /** @class */ (function () {
|
|
5245
|
+
function ZgridComponent(activatedRoute, router, formBuilder, authService, webApiService, zGridStatePersistingService, toastService, zcoreService, storageService, mainService) {
|
|
6282
5246
|
var _this = this;
|
|
6283
5247
|
this.activatedRoute = activatedRoute;
|
|
6284
5248
|
this.router = router;
|
|
@@ -6288,6 +5252,9 @@
|
|
|
6288
5252
|
this.zGridStatePersistingService = zGridStatePersistingService;
|
|
6289
5253
|
this.toastService = toastService;
|
|
6290
5254
|
this.zcoreService = zcoreService;
|
|
5255
|
+
this.storageService = storageService;
|
|
5256
|
+
this.mainService = mainService;
|
|
5257
|
+
// @ViewChild(ZGridBindingDirective, { static: false }) zgrid: ZGridBindingDirective;
|
|
6291
5258
|
this.zgrid = null;
|
|
6292
5259
|
this.oauthUrl = null;
|
|
6293
5260
|
this.mySelection = [];
|
|
@@ -6312,23 +5279,17 @@
|
|
|
6312
5279
|
grantType: 4
|
|
6313
5280
|
};
|
|
6314
5281
|
this.gridSubject = new rxjs.Subject();
|
|
6315
|
-
this.
|
|
6316
|
-
|
|
6317
|
-
};
|
|
6318
|
-
this.setVisible = function (status) {
|
|
6319
|
-
_this.componentProperties.isVisible = status;
|
|
6320
|
-
_this.data.Visible = status;
|
|
6321
|
-
};
|
|
6322
|
-
this.setRequire = function (status) {
|
|
6323
|
-
_this.componentProperties.isRequired = status;
|
|
6324
|
-
i3.ZComponentHelper.changeValidator(status, _this.group, _this.data.Value, _this.componentProperties, forms.Validators.required);
|
|
6325
|
-
};
|
|
5282
|
+
this.gridDefaultStateExist = false;
|
|
5283
|
+
this.isNew = true;
|
|
6326
5284
|
this.setData = function (gData) {
|
|
6327
5285
|
_this.gridData = {
|
|
6328
5286
|
data: gData,
|
|
6329
5287
|
total: (gData ? gData.length : 0)
|
|
6330
5288
|
};
|
|
6331
5289
|
_this.gData = gData;
|
|
5290
|
+
if (_this.zgrid) {
|
|
5291
|
+
_this.zgrid.grid['pageSize'] = gData.length; // set grid size
|
|
5292
|
+
}
|
|
6332
5293
|
if (!!_this.data.ShowRecordNumber) {
|
|
6333
5294
|
if (_this.gridData.data) {
|
|
6334
5295
|
_this.gridData.data.forEach(function (d, i) {
|
|
@@ -6336,7 +5297,21 @@
|
|
|
6336
5297
|
});
|
|
6337
5298
|
}
|
|
6338
5299
|
}
|
|
6339
|
-
_this.
|
|
5300
|
+
if (_this.gData) {
|
|
5301
|
+
_this.createFormControls();
|
|
5302
|
+
}
|
|
5303
|
+
};
|
|
5304
|
+
/* Available Functions */
|
|
5305
|
+
this.setEnable = function (status) {
|
|
5306
|
+
_this.componentProperties.isReadOnly = !status;
|
|
5307
|
+
};
|
|
5308
|
+
this.setVisible = function (status) {
|
|
5309
|
+
_this.componentProperties.isVisible = status;
|
|
5310
|
+
_this.data.Visible = status;
|
|
5311
|
+
};
|
|
5312
|
+
this.setRequire = function (status) {
|
|
5313
|
+
_this.componentProperties.isRequired = status;
|
|
5314
|
+
i3.ZComponentHelper.changeValidator(status, _this.group, _this.data.Value, _this.componentProperties, forms.Validators.required);
|
|
6340
5315
|
};
|
|
6341
5316
|
this.oauthUrl = this.zcoreService.getEnvironment().e1OauthUrl + "/";
|
|
6342
5317
|
this.allResults = this.allResults.bind(this);
|
|
@@ -6345,80 +5320,232 @@
|
|
|
6345
5320
|
this.saveGridSettings = this.saveGridSettings.bind(this);
|
|
6346
5321
|
this.restoreGridSettings = this.restoreGridSettings.bind(this);
|
|
6347
5322
|
}
|
|
6348
|
-
|
|
5323
|
+
ZgridComponent.prototype.ngOnInit = function () {
|
|
6349
5324
|
var _this = this;
|
|
6350
5325
|
i3.ZComponentHelper.setComponentProperties(this);
|
|
6351
5326
|
i3.ZComponentHelper.registerComponent(this);
|
|
6352
|
-
|
|
6353
|
-
this.
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
5327
|
+
// Grid saved setting key(Used in CookieStore & LocalStorage)
|
|
5328
|
+
this.gridStorageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
|
|
5329
|
+
rxjs.of(true)
|
|
5330
|
+
.pipe(
|
|
5331
|
+
//concatMap(() => {
|
|
5332
|
+
// // try get gridsetting from cookiestore
|
|
5333
|
+
// return this.mainService.cookieStoreGet(this.gridStorageKey, this.authService.e1Token.access_token);
|
|
5334
|
+
//}),
|
|
5335
|
+
//switchMap(savedGridCache => {
|
|
5336
|
+
// if (savedGridCache) {
|
|
5337
|
+
// // Keep the gridSetting from cookiestore to localStorage
|
|
5338
|
+
// this.zGridStatePersistingService.set(this.gridStorageKey, savedGridCache);
|
|
5339
|
+
// return of(true);
|
|
5340
|
+
// }
|
|
5341
|
+
// return of(false);
|
|
5342
|
+
//}),
|
|
5343
|
+
operators.switchMap(function () {
|
|
5344
|
+
// Grid default setting
|
|
5345
|
+
_this.columns = [];
|
|
5346
|
+
_this.widthReduce = _this.data.WidthReduce || 60;
|
|
5347
|
+
_this.heightReduce = _this.data.HeightReduce || 560;
|
|
5348
|
+
_this._state.take = _this.data.PageSize || 20;
|
|
5349
|
+
_this.pageSizes = [20, 50, 100, 200, 500];
|
|
5350
|
+
_this.previousNext = _this.data['EnablePreviousNextButton'] || false;
|
|
5351
|
+
// [Mobile] Disable PageSize
|
|
5352
|
+
if (_this.data.PageSizes === false || i3.ZComponentHelper.isMobileScreen()) {
|
|
5353
|
+
_this.pageSizes = false;
|
|
5354
|
+
}
|
|
5355
|
+
// Grid Selection column
|
|
5356
|
+
if (_this.data.SelectOptions) {
|
|
5357
|
+
_this.selectableSettings = {
|
|
5358
|
+
// checkboxOnly: this.checkboxOnly,
|
|
5359
|
+
mode: _this.data.SelectOptions === 'single' ? 'single' : 'multiple'
|
|
5360
|
+
};
|
|
5361
|
+
}
|
|
5362
|
+
// bind this to group using Grid value
|
|
5363
|
+
if (_this.data.Value.startsWith('group.')) {
|
|
5364
|
+
var gridValue = _this.data.Value.slice(6);
|
|
5365
|
+
_this.group[gridValue] = _this;
|
|
5366
|
+
}
|
|
5367
|
+
// clear any Subscription
|
|
5368
|
+
if (_this.subscription) {
|
|
5369
|
+
_this.subscription.unsubscribe();
|
|
5370
|
+
}
|
|
5371
|
+
// if no ResourceURL, still generate Column first, then insert grid data using DataSource
|
|
5372
|
+
if (!_this.data.ResourceURL) {
|
|
5373
|
+
_this.generateGridColumns().subscribe(function () {
|
|
5374
|
+
if (_this.data.DataSource && _this.data.SkipDirective) {
|
|
5375
|
+
var ds = i3.ZComponentHelper.getGroupValue(_this.data.DataSource, _this.group);
|
|
5376
|
+
_this.setData(ds);
|
|
5377
|
+
}
|
|
5378
|
+
});
|
|
5379
|
+
}
|
|
5380
|
+
// subscribe to set grid setting from directive to component
|
|
5381
|
+
_this.subscription = _this.gridSubject.subscribe(function (grid) {
|
|
5382
|
+
_this.zgrid = grid;
|
|
5383
|
+
_this._state = _this.zgrid.state;
|
|
5384
|
+
_this.columns = _this.zgrid.gridColumns;
|
|
5385
|
+
if (_this.zgrid && _this.zgrid.grid.data) {
|
|
5386
|
+
_this.gridData = Object.assign({}, _this.zgrid.grid.data);
|
|
5387
|
+
_this.createFormControls();
|
|
5388
|
+
}
|
|
5389
|
+
});
|
|
5390
|
+
// Check Grid setting exist in localstorage
|
|
5391
|
+
_this.stateExist();
|
|
5392
|
+
// Set Filter SessionKey
|
|
5393
|
+
if (_this.data['SaveFilter']) {
|
|
5394
|
+
_this.setGridSessionKey(_this.group);
|
|
5395
|
+
}
|
|
5396
|
+
return rxjs.of(true);
|
|
5397
|
+
}), operators.tap(function () {
|
|
5398
|
+
_this.gridCallback(_this.group);
|
|
5399
|
+
})).subscribe();
|
|
5400
|
+
};
|
|
5401
|
+
ZgridComponent.prototype.ngOnDestroy = function () {
|
|
5402
|
+
if (this.subscription) {
|
|
5403
|
+
this.subscription.unsubscribe();
|
|
6359
5404
|
}
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
5405
|
+
};
|
|
5406
|
+
Object.defineProperty(ZgridComponent.prototype, "state", {
|
|
5407
|
+
/* Start Grid State (pagination, sortable, filter, ordering) */
|
|
5408
|
+
get: function () {
|
|
5409
|
+
return this._state;
|
|
5410
|
+
},
|
|
5411
|
+
enumerable: false,
|
|
5412
|
+
configurable: true
|
|
5413
|
+
});
|
|
5414
|
+
ZgridComponent.prototype.stateExist = function () {
|
|
5415
|
+
var userGridState = this.zGridStatePersistingService.get(this.gridStorageKey);
|
|
5416
|
+
if (userGridState) {
|
|
5417
|
+
this.gridDefaultStateExist = true;
|
|
6365
5418
|
}
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
5419
|
+
else {
|
|
5420
|
+
this.gridDefaultStateExist = false;
|
|
5421
|
+
}
|
|
5422
|
+
};
|
|
5423
|
+
ZgridComponent.prototype.dataStateChange = function (state) {
|
|
5424
|
+
if (this.zgrid) {
|
|
5425
|
+
this.zgrid.dataStateChange(state);
|
|
6369
5426
|
}
|
|
6370
|
-
|
|
6371
|
-
this.
|
|
5427
|
+
else {
|
|
5428
|
+
this.gridData = kendoDataQuery.process(this.gData, state);
|
|
5429
|
+
this.createFormControls();
|
|
6372
5430
|
}
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
_this.setData(ds);
|
|
6378
|
-
}
|
|
6379
|
-
});
|
|
5431
|
+
};
|
|
5432
|
+
ZgridComponent.prototype.filterable = function (value) {
|
|
5433
|
+
if (value === false) {
|
|
5434
|
+
return false;
|
|
6380
5435
|
}
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
_this.gridData = Object.assign({}, _this.zgrid.grid.data);
|
|
6387
|
-
_this.createFormControls();
|
|
6388
|
-
}
|
|
6389
|
-
});
|
|
6390
|
-
//Set Filter SessionKey
|
|
6391
|
-
if (this.data['SaveFilter']) {
|
|
6392
|
-
this.setGridSessionKey(this.group);
|
|
5436
|
+
return true;
|
|
5437
|
+
};
|
|
5438
|
+
ZgridComponent.prototype.sortable = function (value) {
|
|
5439
|
+
if (value === false) {
|
|
5440
|
+
return false;
|
|
6393
5441
|
}
|
|
5442
|
+
return true;
|
|
6394
5443
|
};
|
|
6395
|
-
|
|
6396
|
-
if (
|
|
6397
|
-
|
|
5444
|
+
ZgridComponent.prototype.locked = function (colSetting) {
|
|
5445
|
+
if (colSetting['pinnedLeft'] == true) {
|
|
5446
|
+
return true;
|
|
6398
5447
|
}
|
|
5448
|
+
return false;
|
|
6399
5449
|
};
|
|
6400
|
-
|
|
5450
|
+
/* End Grid State (pagination, sortable, filter, ordering) */
|
|
5451
|
+
/* Start Grid Styling, Display */
|
|
5452
|
+
ZgridComponent.prototype.getGridStyle = function () {
|
|
6401
5453
|
return {
|
|
6402
5454
|
"height.px": this.getGridHeight(),
|
|
6403
5455
|
"width.px": window.innerWidth - this.widthReduce
|
|
6404
|
-
};
|
|
5456
|
+
}; // "width.px": this.innerWidth - 35
|
|
6405
5457
|
};
|
|
6406
|
-
|
|
6407
|
-
var
|
|
5458
|
+
ZgridComponent.prototype.getGridHeight = function () {
|
|
5459
|
+
var gridHeight = window.innerHeight - this.heightReduce;
|
|
5460
|
+
return (gridHeight < 250) ? 250 : gridHeight;
|
|
5461
|
+
// const v = ZComponentHelper.isMobileScreen();
|
|
5462
|
+
// if(v){
|
|
5463
|
+
// const h = window.innerHeight - this.heightReduce;
|
|
5464
|
+
// return (h < 250) ? 250 : h;
|
|
5465
|
+
// }else{
|
|
5466
|
+
// return "auto";
|
|
5467
|
+
// }
|
|
5468
|
+
};
|
|
5469
|
+
/* End Grid Styling, Display */
|
|
5470
|
+
/* Start Grid Columns */
|
|
5471
|
+
ZgridComponent.prototype.isSelectOption = function () {
|
|
5472
|
+
var selectOptionExist = false;
|
|
6408
5473
|
if (this.data.SelectOptions) {
|
|
6409
5474
|
this.selectableSettings = {
|
|
6410
5475
|
checkboxOnly: false,
|
|
6411
5476
|
mode: (this.data.SelectOptions == "multiple") ? "multiple" : "single"
|
|
6412
5477
|
};
|
|
6413
|
-
|
|
5478
|
+
selectOptionExist = true;
|
|
6414
5479
|
}
|
|
6415
|
-
return
|
|
5480
|
+
return selectOptionExist;
|
|
6416
5481
|
};
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
5482
|
+
ZgridComponent.prototype.setColumns = function (columnName, columns) {
|
|
5483
|
+
this.group[columnName] = this.wrapColumnNamesInFieldElement(columns);
|
|
5484
|
+
this.generateGridColumns().subscribe();
|
|
5485
|
+
};
|
|
5486
|
+
ZgridComponent.prototype.wrapColumnNamesInFieldElement = function (columnList) {
|
|
5487
|
+
return rxjs.of(columnList.map(function (c) {
|
|
5488
|
+
var isHidden = c.Hidden;
|
|
5489
|
+
return {
|
|
5490
|
+
Name: c.Name,
|
|
5491
|
+
Value: c.Code,
|
|
5492
|
+
Type: c.Type,
|
|
5493
|
+
gridColVisible: !isHidden,
|
|
5494
|
+
width: 100 + c.Name.length * 4,
|
|
5495
|
+
enableFiltering: false,
|
|
5496
|
+
enableSorting: true,
|
|
5497
|
+
enablePinning: true,
|
|
5498
|
+
DivClass: "col-xs-12 col-sm-6",
|
|
5499
|
+
IsEditableInGrid: c.Editable
|
|
5500
|
+
};
|
|
5501
|
+
}));
|
|
5502
|
+
};
|
|
5503
|
+
ZgridComponent.prototype.generateGridColumns = function () {
|
|
5504
|
+
var _this = this;
|
|
5505
|
+
var gridSetting = this.getGridSettings();
|
|
5506
|
+
var columnFields$ = i3.ZComponentHelper.getGroupValue(this.data.ColumnFields, this.group);
|
|
5507
|
+
if (!this.data.ColumnFields) {
|
|
5508
|
+
console.warn('Invalid/Empty grid(' + this.data.Name + ') columnField');
|
|
5509
|
+
}
|
|
5510
|
+
return columnFields$.pipe(operators.tap(function (data) {
|
|
5511
|
+
if (!data) {
|
|
5512
|
+
console.warn('Invalid/Empty grid(' + _this.data.Name + ') data to generate column');
|
|
5513
|
+
}
|
|
5514
|
+
var fieldName = _this.data['FieldElementName'];
|
|
5515
|
+
_this.columns = [];
|
|
5516
|
+
i3.ZComponentHelper.getGridColumns(data, _this.columns, _this.group, _this.authService, fieldName, gridSetting, null, _this.data);
|
|
5517
|
+
}));
|
|
5518
|
+
};
|
|
5519
|
+
/* End Grid Columns */
|
|
5520
|
+
ZgridComponent.prototype.editModel = function (dataItem) {
|
|
5521
|
+
if (this.data.EditClickURL) {
|
|
5522
|
+
// Edit incell field
|
|
5523
|
+
var colFields = i3.ZComponentHelper.getGroupValue(this.data.ColumnFields, this.group);
|
|
5524
|
+
this.group.subject.next({
|
|
5525
|
+
type: "zgrid-cellClick",
|
|
5526
|
+
target: this.data.EditClickURL,
|
|
5527
|
+
data: dataItem,
|
|
5528
|
+
columnFields$: colFields
|
|
5529
|
+
});
|
|
5530
|
+
}
|
|
5531
|
+
else {
|
|
5532
|
+
// When clicked route to page
|
|
5533
|
+
this.router.navigate([this.group.editModelURL, dataItem.Id, 'edit'], {
|
|
5534
|
+
relativeTo: this.activatedRoute
|
|
5535
|
+
});
|
|
5536
|
+
}
|
|
5537
|
+
};
|
|
5538
|
+
ZgridComponent.prototype.gridCallback = function (group) {
|
|
5539
|
+
if (this.data['AfterloadCallback']) {
|
|
5540
|
+
var me = Object.assign({}, this);
|
|
5541
|
+
this.group.subject.next({
|
|
5542
|
+
type: "zgrid-AfterloadCallback",
|
|
5543
|
+
target: this.data['AfterloadCallback'],
|
|
5544
|
+
data: me
|
|
5545
|
+
});
|
|
5546
|
+
}
|
|
6420
5547
|
};
|
|
6421
|
-
|
|
5548
|
+
ZgridComponent.prototype.getData = function () {
|
|
6422
5549
|
if (this.zgrid) {
|
|
6423
5550
|
this.zgrid.getDataBinding();
|
|
6424
5551
|
}
|
|
@@ -6427,60 +5554,56 @@
|
|
|
6427
5554
|
this.createFormControls();
|
|
6428
5555
|
}
|
|
6429
5556
|
};
|
|
6430
|
-
|
|
5557
|
+
ZgridComponent.prototype.getGridData = function () {
|
|
6431
5558
|
return this.gData;
|
|
6432
5559
|
};
|
|
6433
|
-
|
|
5560
|
+
ZgridComponent.prototype.getFormControl = function (rowIndex, property) {
|
|
6434
5561
|
var formArray = this.inlineEditedFormGroups.get('items');
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
var _this = this;
|
|
6439
|
-
// only create if there is at least 1 editable column
|
|
6440
|
-
if (this.columns.find(function (c) { return c.isEditableInGrid; }) === undefined) {
|
|
6441
|
-
return;
|
|
6442
|
-
}
|
|
6443
|
-
this.inlineEditedFormGroups = new forms.FormGroup({ items: new forms.FormArray([]) });
|
|
6444
|
-
this.gridData.data.forEach(function (d) {
|
|
6445
|
-
var items = {};
|
|
6446
|
-
_this.columns.forEach(function (c) {
|
|
6447
|
-
items[c.field] = new forms.FormControl(d[c.field]);
|
|
6448
|
-
});
|
|
6449
|
-
var formGroup = new forms.FormGroup(items);
|
|
6450
|
-
_this.inlineEditedFormGroups.get("items").push(formGroup);
|
|
6451
|
-
});
|
|
6452
|
-
};
|
|
6453
|
-
Object.defineProperty(ZgridcalendarComponent.prototype, "state", {
|
|
6454
|
-
get: function () {
|
|
6455
|
-
return this._state;
|
|
6456
|
-
},
|
|
6457
|
-
enumerable: false,
|
|
6458
|
-
configurable: true
|
|
6459
|
-
});
|
|
6460
|
-
ZgridcalendarComponent.prototype.dataStateChange = function (state) {
|
|
6461
|
-
if (this.zgrid) {
|
|
6462
|
-
this.zgrid.dataStateChange(state);
|
|
5562
|
+
var formItem = formArray.at(rowIndex);
|
|
5563
|
+
if (formItem) {
|
|
5564
|
+
return formItem.get(property);
|
|
6463
5565
|
}
|
|
6464
5566
|
else {
|
|
6465
|
-
|
|
6466
|
-
this.createFormControls();
|
|
5567
|
+
return null;
|
|
6467
5568
|
}
|
|
6468
5569
|
};
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
5570
|
+
ZgridComponent.prototype.createFormControls = function () {
|
|
5571
|
+
var _this = this;
|
|
5572
|
+
if (this.columns) {
|
|
5573
|
+
// only create if there is at least 1 editable column
|
|
5574
|
+
if (this.columns.find(function (c) { return c.isEditableInGrid; }) === undefined) {
|
|
5575
|
+
return;
|
|
5576
|
+
}
|
|
5577
|
+
this.inlineEditedFormGroups = new forms.FormGroup({ items: new forms.FormArray([]) });
|
|
5578
|
+
if (Array.isArray(this.gridData.data)) {
|
|
5579
|
+
this.gridData.data.forEach(function (d) {
|
|
5580
|
+
var items = {};
|
|
5581
|
+
_this.columns.forEach(function (c) {
|
|
5582
|
+
items[c.field] = new forms.FormControl(d[c.field]);
|
|
5583
|
+
});
|
|
5584
|
+
var formGroup = new forms.FormGroup(items);
|
|
5585
|
+
_this.inlineEditedFormGroups.get("items").push(formGroup);
|
|
5586
|
+
});
|
|
5587
|
+
}
|
|
6472
5588
|
}
|
|
6473
5589
|
};
|
|
6474
|
-
|
|
5590
|
+
ZgridComponent.prototype.createFormGroup = function (dataItem, fieldName) {
|
|
5591
|
+
var _a;
|
|
5592
|
+
return this.formBuilder.group((_a = {},
|
|
5593
|
+
_a[fieldName] = dataItem[fieldName],
|
|
5594
|
+
_a));
|
|
5595
|
+
};
|
|
5596
|
+
ZgridComponent.prototype.getGroupValue = function (value, group) {
|
|
6475
5597
|
return i3.ZComponentHelper.getGroupValue(this.data.Value, this.group);
|
|
6476
5598
|
};
|
|
6477
|
-
|
|
5599
|
+
ZgridComponent.prototype.onBtnClick = function (event, colSetting, rowData, cellData) {
|
|
6478
5600
|
this.onNavigateTo(event, colSetting, rowData, cellData);
|
|
6479
5601
|
};
|
|
6480
|
-
|
|
5602
|
+
ZgridComponent.prototype.cellClickHandler = function (event) {
|
|
6481
5603
|
var _this = this;
|
|
6482
|
-
var
|
|
6483
|
-
|
|
5604
|
+
var disableAllColumnCellClickHandler = this.data.DisableCellClickHandler ? this.data.DisableCellClickHandler : false;
|
|
5605
|
+
var isCommandColumn = event.column.constructor.name == 'CommandColumnComponent' ? true : false;
|
|
5606
|
+
if (!disableAllColumnCellClickHandler && !isCommandColumn) {
|
|
6484
5607
|
var inCellEditable = this.data.InCellEditable ? this.data.InCellEditable : false;
|
|
6485
5608
|
if (inCellEditable) {
|
|
6486
5609
|
this.editableColumns = this.columns.filter(function (s) { return s.isEditableInDataItem === true; });
|
|
@@ -6498,10 +5621,11 @@
|
|
|
6498
5621
|
}
|
|
6499
5622
|
return;
|
|
6500
5623
|
}
|
|
5624
|
+
this.editModel(event.dataItem);
|
|
6501
5625
|
}
|
|
6502
5626
|
}
|
|
6503
5627
|
};
|
|
6504
|
-
|
|
5628
|
+
ZgridComponent.prototype.editCellCloseHandler = function (args) {
|
|
6505
5629
|
var formGroup = args.formGroup, dataItem = args.dataItem;
|
|
6506
5630
|
if (!formGroup.valid) {
|
|
6507
5631
|
args.preventDefault();
|
|
@@ -6515,13 +5639,9 @@
|
|
|
6515
5639
|
this.mySelection.map(function (s) { return (s.Id === dataItem.Id) ? Object.assign(s, dataItem) : null; });
|
|
6516
5640
|
}
|
|
6517
5641
|
};
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
_a[fieldName] = dataItem[fieldName],
|
|
6522
|
-
_a));
|
|
6523
|
-
};
|
|
6524
|
-
ZgridcalendarComponent.prototype.onNavigateTo = function (event, clickAction, rowData, cellData) {
|
|
5642
|
+
ZgridComponent.prototype.onNavigateTo = function (event, clickAction, rowData, cellData) {
|
|
5643
|
+
// debugger;
|
|
5644
|
+
// const n = colSetting.navigateTo.replace('/:id', cellData);
|
|
6525
5645
|
var n = i3.ZComponentHelper.getGroupEvalValue.call(this, clickAction.Click);
|
|
6526
5646
|
if (n) {
|
|
6527
5647
|
event.stopPropagation();
|
|
@@ -6533,44 +5653,28 @@
|
|
|
6533
5653
|
});
|
|
6534
5654
|
}
|
|
6535
5655
|
};
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
enableSorting: true,
|
|
6551
|
-
enablePinning: true,
|
|
6552
|
-
DivClass: "col-xs-12 col-sm-6",
|
|
6553
|
-
IsEditableInGrid: c.Editable
|
|
6554
|
-
};
|
|
6555
|
-
}));
|
|
6556
|
-
};
|
|
6557
|
-
ZgridcalendarComponent.prototype.generateGridColumns = function () {
|
|
6558
|
-
var _this = this;
|
|
6559
|
-
var columnFields$ = i3.ZComponentHelper.getGroupValue(this.data.ColumnFields, // "group.gridCalendarColumnFields"
|
|
6560
|
-
this.group);
|
|
6561
|
-
return columnFields$.pipe(operators.tap(function (data) {
|
|
6562
|
-
var fieldName = _this.data['FieldElementName'];
|
|
6563
|
-
_this.columns = [];
|
|
6564
|
-
i3.ZComponentHelper.getGridColumns(data, _this.columns, _this.group, _this.authService, fieldName, null, null, _this.data);
|
|
6565
|
-
}));
|
|
5656
|
+
ZgridComponent.prototype.showTooltip = function (e) {
|
|
5657
|
+
var element = e.target;
|
|
5658
|
+
var isCommandColumn = false;
|
|
5659
|
+
element.classList.forEach(function (data) {
|
|
5660
|
+
if (data == 'k-command-cell') {
|
|
5661
|
+
isCommandColumn = true;
|
|
5662
|
+
}
|
|
5663
|
+
});
|
|
5664
|
+
if (((element.nodeName === 'TD' || element.nodeName === 'TH') && element.offsetWidth < element.scrollWidth) && !isCommandColumn) {
|
|
5665
|
+
this.tooltipDir.toggle(element);
|
|
5666
|
+
}
|
|
5667
|
+
else {
|
|
5668
|
+
this.tooltipDir.hide();
|
|
5669
|
+
}
|
|
6566
5670
|
};
|
|
6567
|
-
|
|
5671
|
+
ZgridComponent.prototype.rowSelectionKey = function (context) {
|
|
6568
5672
|
return context.dataItem;
|
|
6569
5673
|
};
|
|
6570
|
-
|
|
5674
|
+
ZgridComponent.prototype.getSeletectedValues = function () {
|
|
6571
5675
|
return this.mySelection;
|
|
6572
5676
|
};
|
|
6573
|
-
|
|
5677
|
+
ZgridComponent.prototype.refreshGrid = function (event, group, me) {
|
|
6574
5678
|
var _gridOptionSegment = event.target.trim().split('.');
|
|
6575
5679
|
var _gridOption = _gridOptionSegment[1];
|
|
6576
5680
|
if (_gridOption) {
|
|
@@ -6586,13 +5690,13 @@
|
|
|
6586
5690
|
console.log('Invalid refreshGrid event: ', event);
|
|
6587
5691
|
}
|
|
6588
5692
|
};
|
|
6589
|
-
|
|
5693
|
+
ZgridComponent.prototype.refreshData = function () {
|
|
6590
5694
|
this.getData();
|
|
6591
5695
|
};
|
|
6592
|
-
|
|
5696
|
+
ZgridComponent.prototype.clearData = function () {
|
|
6593
5697
|
this.zgrid.clearData();
|
|
6594
5698
|
};
|
|
6595
|
-
|
|
5699
|
+
ZgridComponent.prototype.allResults = function () {
|
|
6596
5700
|
var _zgridControl = this.zgrid;
|
|
6597
5701
|
var _zgridComponent = this.zgrid.grid;
|
|
6598
5702
|
var _data = _zgridComponent.data;
|
|
@@ -6604,114 +5708,11 @@
|
|
|
6604
5708
|
return this.webApiService.httpPost$(paginationApiPostUrl, params).pipe(operators.map(function (data) {
|
|
6605
5709
|
var result = {
|
|
6606
5710
|
data: kendoDataQuery.process(data.dataSet, {}).data
|
|
6607
|
-
};
|
|
6608
|
-
return result;
|
|
6609
|
-
}));
|
|
6610
|
-
};
|
|
6611
|
-
ZgridcalendarComponent.prototype.columnsOrderChanged = function (event) {
|
|
6612
|
-
var _zgridControl = this.zgrid;
|
|
6613
|
-
var _zgridComponent = this.zgrid.grid;
|
|
6614
|
-
var _data = _zgridComponent.data;
|
|
6615
|
-
if (this.zgrid) {
|
|
6616
|
-
var _zgrid = this.zgrid;
|
|
6617
|
-
}
|
|
6618
|
-
};
|
|
6619
|
-
ZgridcalendarComponent.prototype.saveGridSettings = function () {
|
|
6620
|
-
var _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
|
|
6621
|
-
var _gridName = this.data.Name + '::' + this.data.Value;
|
|
6622
|
-
var _zgridComponent = this.zgrid.grid;
|
|
6623
|
-
var _columns = _zgridComponent.columns;
|
|
6624
|
-
// Keep existing grid column setting
|
|
6625
|
-
this.zGridStatePersistingService.set(_gridName, this.columns);
|
|
6626
|
-
var configValue = _columns.toArray().map(function (item) {
|
|
6627
|
-
var _zGridColumnSettings = Object.keys(item)
|
|
6628
|
-
.filter(function (propName) {
|
|
6629
|
-
return !propName.toLowerCase().includes('template');
|
|
6630
|
-
})
|
|
6631
|
-
.reduce(function (acc, curr) {
|
|
6632
|
-
var _a;
|
|
6633
|
-
return (Object.assign(Object.assign({}, acc), (_a = {}, _a[curr] = item[curr], _a)));
|
|
6634
|
-
}, {});
|
|
6635
|
-
return _zGridColumnSettings;
|
|
6636
|
-
});
|
|
6637
|
-
// remove extra element form array
|
|
6638
|
-
configValue.forEach(function (item) {
|
|
6639
|
-
delete item['headerStyle'];
|
|
6640
|
-
delete item['__ngContext__'];
|
|
6641
|
-
});
|
|
6642
|
-
var gridSetting = {
|
|
6643
|
-
// state: this.state,
|
|
6644
|
-
columnsConfig: configValue
|
|
6645
|
-
};
|
|
6646
|
-
// Find any setting from localstorage and update, if not just add in.
|
|
6647
|
-
var _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
|
|
6648
|
-
var _gridConfig = null;
|
|
6649
|
-
if (_arrGridCaching && _arrGridCaching[0]) {
|
|
6650
|
-
_gridConfig = _arrGridCaching.find(function (x) { return x['dataFormFields'] === _gridName; });
|
|
6651
|
-
if (_gridConfig) {
|
|
6652
|
-
_gridConfig.gridSettings = gridSetting;
|
|
6653
|
-
}
|
|
6654
|
-
}
|
|
6655
|
-
else {
|
|
6656
|
-
_arrGridCaching = [];
|
|
6657
|
-
}
|
|
6658
|
-
if (!_gridConfig) {
|
|
6659
|
-
_gridConfig = {
|
|
6660
|
-
dataFormFields: _gridName,
|
|
6661
|
-
gridSettings: gridSetting
|
|
6662
|
-
};
|
|
6663
|
-
_arrGridCaching.push(_gridConfig);
|
|
6664
|
-
}
|
|
6665
|
-
// Save grid caching to localstorage
|
|
6666
|
-
this.zGridStatePersistingService.set(_storageKey, _arrGridCaching);
|
|
6667
|
-
// Save grid caching to database
|
|
6668
|
-
this.postGridSetting(_storageKey, _arrGridCaching);
|
|
6669
|
-
// Alert
|
|
6670
|
-
this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
|
|
6671
|
-
};
|
|
6672
|
-
ZgridcalendarComponent.prototype.restoreGridSettings = function () {
|
|
6673
|
-
var _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
|
|
6674
|
-
var _gridName = this.data.Name + '::' + this.data.Value;
|
|
6675
|
-
// Find any setting from localstorage..
|
|
6676
|
-
var _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
|
|
6677
|
-
if (_arrGridCaching && _arrGridCaching[0]) {
|
|
6678
|
-
var _gridIndex = _arrGridCaching.findIndex(function (x) { return x['dataFormFields'] === _gridName; });
|
|
6679
|
-
if (_gridIndex != null) {
|
|
6680
|
-
_arrGridCaching.splice(_gridIndex, 1);
|
|
6681
|
-
if (_arrGridCaching[0]) {
|
|
6682
|
-
this.zGridStatePersistingService.set(_storageKey, _arrGridCaching);
|
|
6683
|
-
// Save grid caching to database
|
|
6684
|
-
this.postGridSetting(_storageKey, _arrGridCaching);
|
|
6685
|
-
}
|
|
6686
|
-
else {
|
|
6687
|
-
// Remove since no value
|
|
6688
|
-
this.zGridStatePersistingService.remove(_storageKey);
|
|
6689
|
-
var _deleteCookieStoreURL = this.oauthUrl + "Admin/DeleteMultipleCookies";
|
|
6690
|
-
var _deleteCookieStoreValue = { 'containName': _storageKey };
|
|
6691
|
-
this.webApiService.httpPost$(_deleteCookieStoreURL, _deleteCookieStoreValue).subscribe();
|
|
6692
|
-
}
|
|
6693
|
-
// Use original column setting
|
|
6694
|
-
this.columns = this.zGridStatePersistingService.get(_gridName);
|
|
6695
|
-
// Clear original column setting
|
|
6696
|
-
this.zGridStatePersistingService.remove(_gridName);
|
|
6697
|
-
// Alert
|
|
6698
|
-
this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
|
|
6699
|
-
}
|
|
6700
|
-
}
|
|
6701
|
-
};
|
|
6702
|
-
ZgridcalendarComponent.prototype.postGridSetting = function (_storageKey, _arrGridCaching) {
|
|
6703
|
-
var _cookieStoreURL = this.oauthUrl + "api/CookieStores";
|
|
6704
|
-
var _cookieStoreValue = {
|
|
6705
|
-
'Name': _storageKey,
|
|
6706
|
-
'Value': JSON.stringify(_arrGridCaching)
|
|
6707
|
-
};
|
|
6708
|
-
this.webApiService.httpPost$(_cookieStoreURL, _cookieStoreValue).subscribe(function (res) {
|
|
6709
|
-
if (res.status === "success") {
|
|
6710
|
-
console.log("grid config saved: ", res);
|
|
6711
|
-
}
|
|
6712
|
-
});
|
|
5711
|
+
};
|
|
5712
|
+
return result;
|
|
5713
|
+
}));
|
|
6713
5714
|
};
|
|
6714
|
-
|
|
5715
|
+
ZgridComponent.prototype.getClass = function (dataItem, col) {
|
|
6715
5716
|
var ngClass = "gridCell ";
|
|
6716
5717
|
if (col.fieldType === 'number' || col.fieldType === 'currency' || col.fieldType === 'znumeric') {
|
|
6717
5718
|
ngClass += "rightAligned ";
|
|
@@ -6724,14 +5725,7 @@
|
|
|
6724
5725
|
}
|
|
6725
5726
|
return ngClass;
|
|
6726
5727
|
};
|
|
6727
|
-
|
|
6728
|
-
return this.columns.find(function (x) { return x.Value === value; });
|
|
6729
|
-
};
|
|
6730
|
-
ZgridcalendarComponent.prototype.getInlineForm = function (rowIndex) {
|
|
6731
|
-
var formArray = this.inlineEditedFormGroups.get('items');
|
|
6732
|
-
return formArray.at(rowIndex);
|
|
6733
|
-
};
|
|
6734
|
-
ZgridcalendarComponent.prototype.getFormat = function (col, defaultFormat) {
|
|
5728
|
+
ZgridComponent.prototype.getFormat = function (col, defaultFormat) {
|
|
6735
5729
|
var format = "";
|
|
6736
5730
|
if (col.FormatOptions === undefined) {
|
|
6737
5731
|
format = defaultFormat ? defaultFormat : "";
|
|
@@ -6748,7 +5742,7 @@
|
|
|
6748
5742
|
}
|
|
6749
5743
|
return format;
|
|
6750
5744
|
};
|
|
6751
|
-
|
|
5745
|
+
ZgridComponent.prototype.setHeaderText = function (columnName, newHeaderTitle) {
|
|
6752
5746
|
var gridColumns = this.columns;
|
|
6753
5747
|
gridColumns.forEach(function (col) {
|
|
6754
5748
|
if (col.Name === columnName) {
|
|
@@ -6756,61 +5750,322 @@
|
|
|
6756
5750
|
}
|
|
6757
5751
|
});
|
|
6758
5752
|
};
|
|
6759
|
-
|
|
6760
|
-
var isChecked = event.detail.checked;
|
|
6761
|
-
this.gData[rowIndex][column.Value] = isChecked;
|
|
6762
|
-
};
|
|
6763
|
-
ZgridcalendarComponent.prototype.setGridIsLoading = function (triggered) {
|
|
5753
|
+
ZgridComponent.prototype.setGridIsLoading = function (triggered) {
|
|
6764
5754
|
this.isLoading = triggered;
|
|
6765
5755
|
};
|
|
6766
|
-
|
|
6767
|
-
if (
|
|
6768
|
-
return
|
|
5756
|
+
ZgridComponent.prototype.setGridSessionKey = function (group) {
|
|
5757
|
+
if (group["GridStorageKey"]) {
|
|
5758
|
+
return;
|
|
6769
5759
|
}
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
ZgridcalendarComponent.prototype.sortable = function (value) {
|
|
6773
|
-
if (value === false) {
|
|
6774
|
-
return false;
|
|
5760
|
+
else {
|
|
5761
|
+
group["GridStorageKey"] = 'zgrid_' + group.resourceURL + '_' + this.data.Value + '::' + this.authService.e1Token.userName;
|
|
6775
5762
|
}
|
|
6776
|
-
return true;
|
|
6777
5763
|
};
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
5764
|
+
ZgridComponent.prototype.trackBy = function (index, item) {
|
|
5765
|
+
//console.log(item.data['Id'] || index);
|
|
5766
|
+
return index;
|
|
5767
|
+
};
|
|
5768
|
+
/* Grid configuration function */
|
|
5769
|
+
ZgridComponent.prototype.saveGridSettings = function () {
|
|
5770
|
+
var _this = this;
|
|
5771
|
+
var _zgridComponent = this.zgrid.grid;
|
|
5772
|
+
var _columns = _zgridComponent.columns;
|
|
5773
|
+
rxjs.of(this.columns)
|
|
5774
|
+
.pipe(operators.switchMap(function () {
|
|
5775
|
+
var configValue = _columns.toArray().map(function (item) {
|
|
5776
|
+
var _zGridColumnSettings = Object.keys(item)
|
|
5777
|
+
.filter(function (propName) {
|
|
5778
|
+
return !propName.toLowerCase().includes('template');
|
|
5779
|
+
})
|
|
5780
|
+
.reduce(function (acc, curr) {
|
|
5781
|
+
var _a;
|
|
5782
|
+
return (Object.assign(Object.assign({}, acc), (_a = {}, _a[curr] = item[curr], _a)));
|
|
5783
|
+
}, {});
|
|
5784
|
+
return _zGridColumnSettings;
|
|
5785
|
+
});
|
|
5786
|
+
// remove extra element form array
|
|
5787
|
+
configValue.forEach(function (item) {
|
|
5788
|
+
delete item['headerStyle'];
|
|
5789
|
+
delete item['__ngContext__'];
|
|
5790
|
+
});
|
|
5791
|
+
var gridSetting = {
|
|
5792
|
+
// state: this.state,
|
|
5793
|
+
columnsConfig: configValue
|
|
5794
|
+
};
|
|
5795
|
+
// Find any setting from localstorage and update, if not just add in.
|
|
5796
|
+
var _arrGridCaching = _this.zGridStatePersistingService.get(_this.gridStorageKey);
|
|
5797
|
+
var _gridConfig = null;
|
|
5798
|
+
if (_arrGridCaching && _arrGridCaching[0]) {
|
|
5799
|
+
_gridConfig = _arrGridCaching.find(function (x) { return x['dataFormFields'] === _this.gridStorageKey; });
|
|
5800
|
+
if (_gridConfig) {
|
|
5801
|
+
_gridConfig.gridSettings = gridSetting;
|
|
5802
|
+
}
|
|
5803
|
+
}
|
|
5804
|
+
else {
|
|
5805
|
+
_arrGridCaching = [];
|
|
5806
|
+
}
|
|
5807
|
+
if (!_gridConfig) {
|
|
5808
|
+
_gridConfig = {
|
|
5809
|
+
dataFormFields: _this.gridStorageKey,
|
|
5810
|
+
gridSettings: gridSetting
|
|
5811
|
+
};
|
|
5812
|
+
_arrGridCaching.push(_gridConfig);
|
|
5813
|
+
}
|
|
5814
|
+
return _arrGridCaching;
|
|
5815
|
+
}), operators.concatMap(function (gridCache) {
|
|
5816
|
+
// Save grid caching to localstorage
|
|
5817
|
+
_this.zGridStatePersistingService.set(_this.gridStorageKey, gridCache);
|
|
5818
|
+
// Save to CookieStore
|
|
5819
|
+
return _this.mainService.cookieStorePost(_this.gridStorageKey, gridCache);
|
|
5820
|
+
}), operators.tap(function (savedGridCache) {
|
|
5821
|
+
// check is saved state exist to enable/hide restore button
|
|
5822
|
+
_this.stateExist();
|
|
5823
|
+
}), operators.tap(function () {
|
|
5824
|
+
// Alert
|
|
5825
|
+
_this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
|
|
5826
|
+
})).subscribe();
|
|
5827
|
+
};
|
|
5828
|
+
ZgridComponent.prototype.restoreGridSettings = function () {
|
|
5829
|
+
var _this = this;
|
|
5830
|
+
rxjs.of(true)
|
|
5831
|
+
.pipe(operators.switchMap(function () {
|
|
5832
|
+
// Clear localstorage grid setting
|
|
5833
|
+
_this.zGridStatePersistingService.remove(_this.gridStorageKey);
|
|
5834
|
+
return rxjs.of(true);
|
|
5835
|
+
}), operators.switchMap(function () {
|
|
5836
|
+
// delete cookiestore gridSetting by storagekey as name
|
|
5837
|
+
return _this.mainService.cookieStoreDeleteMultiple(_this.gridStorageKey);
|
|
5838
|
+
}), operators.concatMap(function () {
|
|
5839
|
+
// Use original column setting
|
|
5840
|
+
return _this.generateGridColumns();
|
|
5841
|
+
}), operators.tap(function () {
|
|
5842
|
+
// check is saved state exist
|
|
5843
|
+
_this.stateExist();
|
|
5844
|
+
// Alert
|
|
5845
|
+
_this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
|
|
5846
|
+
})).subscribe();
|
|
5847
|
+
};
|
|
5848
|
+
ZgridComponent.prototype.getGridSettings = function () {
|
|
5849
|
+
var _storageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
|
|
5850
|
+
// Find any setting from localstorage..
|
|
5851
|
+
var _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
|
|
5852
|
+
if (_arrGridCaching) {
|
|
5853
|
+
var _gridCaching = JSON.parse(_arrGridCaching['Value']);
|
|
5854
|
+
if (_gridCaching) {
|
|
5855
|
+
return _gridCaching.gridSettings.columnsConfig.sort(function (a, b) { return a.orderIndex - b.orderIndex; });
|
|
6782
5856
|
}
|
|
6783
5857
|
}
|
|
6784
|
-
return false;
|
|
6785
5858
|
};
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
5859
|
+
/* Inline setting */
|
|
5860
|
+
ZgridComponent.prototype.getInlineField = function (value) {
|
|
5861
|
+
return this.columns.find(function (x) { return x.Value === value; });
|
|
5862
|
+
};
|
|
5863
|
+
ZgridComponent.prototype.getInlineForm = function (rowIndex) {
|
|
5864
|
+
var formArray = this.inlineEditedFormGroups.get('items');
|
|
5865
|
+
return formArray.at(rowIndex);
|
|
5866
|
+
};
|
|
5867
|
+
ZgridComponent.prototype.getFormControlData = function (value) {
|
|
5868
|
+
return this.inlineEditedFormGroups.value.items;
|
|
5869
|
+
};
|
|
5870
|
+
/* Event */
|
|
5871
|
+
ZgridComponent.prototype.beforeGridGetData = function (group, me) {
|
|
5872
|
+
console.warn("beforeDataBinding triggered");
|
|
5873
|
+
if (!group.beforeGridGetData) {
|
|
5874
|
+
console.warn("group.beforeDataBinding is undefined");
|
|
5875
|
+
return rxjs.of(true);
|
|
6793
5876
|
}
|
|
6794
|
-
return
|
|
5877
|
+
return group.beforeGridGetData(group, me);
|
|
6795
5878
|
};
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
5879
|
+
ZgridComponent.prototype.getGridSessionFilter = function (group, me) {
|
|
5880
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
5881
|
+
var StorageKey;
|
|
5882
|
+
var _this = this;
|
|
5883
|
+
return __generator(this, function (_a) {
|
|
5884
|
+
switch (_a.label) {
|
|
5885
|
+
case 0:
|
|
5886
|
+
if (!group["GridStorageKey"]) {
|
|
5887
|
+
return [2 /*return*/, null];
|
|
5888
|
+
}
|
|
5889
|
+
StorageKey = group["GridStorageKey"];
|
|
5890
|
+
if (!this.storageService) return [3 /*break*/, 2];
|
|
5891
|
+
return [4 /*yield*/, this.storageService.get(StorageKey)
|
|
5892
|
+
.then(function (data) {
|
|
5893
|
+
if (!data || !data.value || data.value === "null") {
|
|
5894
|
+
return null;
|
|
5895
|
+
}
|
|
5896
|
+
else {
|
|
5897
|
+
var result = JSON.parse(data.value);
|
|
5898
|
+
_this.state.filter = JSON.parse(result["StateFilter"]);
|
|
5899
|
+
_this.params.filterParams = JSON.parse(result["FilterParams"]);
|
|
5900
|
+
_this.state.filter.filters.forEach(function (stateFilter) {
|
|
5901
|
+
if (stateFilter.field.includes('UTC')) {
|
|
5902
|
+
stateFilter.value = new Date(stateFilter.value);
|
|
5903
|
+
}
|
|
5904
|
+
});
|
|
5905
|
+
return data;
|
|
5906
|
+
}
|
|
5907
|
+
})];
|
|
5908
|
+
case 1:
|
|
5909
|
+
_a.sent();
|
|
5910
|
+
return [3 /*break*/, 3];
|
|
5911
|
+
case 2: return [2 /*return*/, null];
|
|
5912
|
+
case 3: return [2 /*return*/];
|
|
5913
|
+
}
|
|
5914
|
+
});
|
|
5915
|
+
});
|
|
5916
|
+
};
|
|
5917
|
+
ZgridComponent.prototype.setGridSessionFilter = function (group, me) {
|
|
5918
|
+
if (!group["GridStorageKey"]) {
|
|
5919
|
+
return null;
|
|
6799
5920
|
}
|
|
6800
|
-
|
|
6801
|
-
|
|
5921
|
+
var StorageKey = group["GridStorageKey"];
|
|
5922
|
+
var lstGridFilter = {};
|
|
5923
|
+
if (me.state.filter && this.storageService && this.data['SaveFilter']) {
|
|
5924
|
+
//list of data for StateFilter and FilterParams
|
|
5925
|
+
lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
|
|
5926
|
+
//create session storage
|
|
5927
|
+
this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
|
|
5928
|
+
}
|
|
5929
|
+
};
|
|
5930
|
+
/* onchange Events */
|
|
5931
|
+
ZgridComponent.prototype.filterChange = function (event) {
|
|
5932
|
+
if (this.zgrid) {
|
|
5933
|
+
this.zgrid.filterChange(event);
|
|
5934
|
+
}
|
|
5935
|
+
};
|
|
5936
|
+
ZgridComponent.prototype.pageChange = function (event) {
|
|
5937
|
+
if (this.zgrid) {
|
|
5938
|
+
this.zgrid.pageChange(event);
|
|
5939
|
+
}
|
|
5940
|
+
};
|
|
5941
|
+
ZgridComponent.prototype.sortChange = function (sort) {
|
|
5942
|
+
if (this.zgrid) {
|
|
5943
|
+
this.zgrid.sortChange(sort);
|
|
5944
|
+
}
|
|
5945
|
+
};
|
|
5946
|
+
ZgridComponent.prototype.inCellCheckBoxOnChange = function (event, rowIndex, column) {
|
|
5947
|
+
var isChecked = event.detail.checked;
|
|
5948
|
+
this.gData[rowIndex][column.Value] = isChecked;
|
|
5949
|
+
};
|
|
5950
|
+
ZgridComponent.prototype.columnsOrderChanged = function (event) {
|
|
5951
|
+
var _zgridControl = this.zgrid;
|
|
5952
|
+
var _zgridComponent = this.zgrid.grid;
|
|
5953
|
+
var _data = _zgridComponent.data;
|
|
5954
|
+
if (this.zgrid) {
|
|
5955
|
+
var _zgrid = this.zgrid;
|
|
5956
|
+
}
|
|
5957
|
+
};
|
|
5958
|
+
/* */
|
|
5959
|
+
ZgridComponent.prototype.addHandler = function (_a) {
|
|
5960
|
+
var sender = _a.sender;
|
|
5961
|
+
this.isNew = true;
|
|
5962
|
+
// close any existing editor
|
|
5963
|
+
this.closeEditor(sender);
|
|
5964
|
+
// loop all column to get validation and create form control
|
|
5965
|
+
var colFormControl = {};
|
|
5966
|
+
this.zgrid.gridColumns.forEach(function (col) {
|
|
5967
|
+
var validators = [];
|
|
5968
|
+
if (col.IsRequired) {
|
|
5969
|
+
validators.push(forms.Validators.required);
|
|
5970
|
+
}
|
|
5971
|
+
if (col.ValidatorPattern) {
|
|
5972
|
+
validators.push(forms.Validators.pattern(col.ValidatorPattern));
|
|
5973
|
+
}
|
|
5974
|
+
colFormControl[col.Value] = new forms.FormControl(null, validators);
|
|
5975
|
+
});
|
|
5976
|
+
// set form control object to form group
|
|
5977
|
+
this.formGroup = new forms.FormGroup(colFormControl);
|
|
5978
|
+
// add to grid row
|
|
5979
|
+
sender.addRow(this.formGroup);
|
|
5980
|
+
};
|
|
5981
|
+
ZgridComponent.prototype.saveHandler = function (_a) {
|
|
5982
|
+
var sender = _a.sender, rowIndex = _a.rowIndex, formGroup = _a.formGroup, isNew = _a.isNew;
|
|
5983
|
+
// get grid data.
|
|
5984
|
+
var gridExistingData = this.gData ? this.gData : [];
|
|
5985
|
+
// if valid
|
|
5986
|
+
if (formGroup.valid) {
|
|
5987
|
+
// check for duplicate UniqueKey
|
|
5988
|
+
var uniqueKeyExist_1 = false;
|
|
5989
|
+
var uniqueKey_1 = this.data['UniqueKey'];
|
|
5990
|
+
if (uniqueKey_1) {
|
|
5991
|
+
gridExistingData.forEach(function (data) {
|
|
5992
|
+
if (data[uniqueKey_1] === formGroup.value[uniqueKey_1]) {
|
|
5993
|
+
uniqueKeyExist_1 = true;
|
|
5994
|
+
}
|
|
5995
|
+
});
|
|
5996
|
+
}
|
|
5997
|
+
if (!uniqueKeyExist_1) {
|
|
5998
|
+
if (isNew) {
|
|
5999
|
+
// if new, push to data
|
|
6000
|
+
gridExistingData.push(formGroup.value);
|
|
6001
|
+
}
|
|
6002
|
+
else {
|
|
6003
|
+
// if edit, update data
|
|
6004
|
+
gridExistingData[rowIndex] = formGroup.value;
|
|
6005
|
+
}
|
|
6006
|
+
this.setData(gridExistingData);
|
|
6007
|
+
sender.closeRow(rowIndex);
|
|
6008
|
+
}
|
|
6009
|
+
}
|
|
6010
|
+
};
|
|
6011
|
+
ZgridComponent.prototype.cancelHandler = function (_a) {
|
|
6012
|
+
var sender = _a.sender, rowIndex = _a.rowIndex;
|
|
6013
|
+
// cancel any existing editor
|
|
6014
|
+
sender.closeRow(rowIndex);
|
|
6015
|
+
};
|
|
6016
|
+
ZgridComponent.prototype.editHandler = function (_a) {
|
|
6017
|
+
var sender = _a.sender, rowIndex = _a.rowIndex, dataItem = _a.dataItem;
|
|
6018
|
+
this.isNew = false;
|
|
6019
|
+
// close any existing editor
|
|
6020
|
+
this.closeEditor(sender);
|
|
6021
|
+
// loop all column to get validation and create form control, append current row value
|
|
6022
|
+
var colFormControl = {};
|
|
6023
|
+
this.zgrid.gridColumns.forEach(function (col) {
|
|
6024
|
+
var validators = [];
|
|
6025
|
+
if (col.IsRequired) {
|
|
6026
|
+
validators.push(forms.Validators.required);
|
|
6027
|
+
}
|
|
6028
|
+
if (col.ValidatorPattern) {
|
|
6029
|
+
validators.push(forms.Validators.pattern(col.ValidatorPattern));
|
|
6030
|
+
}
|
|
6031
|
+
colFormControl[col.Value] = new forms.FormControl(dataItem[col.Value], validators);
|
|
6032
|
+
});
|
|
6033
|
+
// set form control object to form group
|
|
6034
|
+
this.formGroup = new forms.FormGroup(colFormControl);
|
|
6035
|
+
// set grid row to edit
|
|
6036
|
+
this.editedRowIndex = rowIndex;
|
|
6037
|
+
sender.editRow(rowIndex, this.formGroup);
|
|
6038
|
+
};
|
|
6039
|
+
ZgridComponent.prototype.removeHandler = function (_a) {
|
|
6040
|
+
var sender = _a.sender, dataItem = _a.dataItem;
|
|
6041
|
+
var index = this.getItemIndex(dataItem, this.gData, this.data['UniqueKey']);
|
|
6042
|
+
this.gData.splice(index, 1);
|
|
6043
|
+
sender.cancelCell();
|
|
6044
|
+
};
|
|
6045
|
+
ZgridComponent.prototype.closeEditor = function (grid, rowIndex) {
|
|
6046
|
+
if (rowIndex === void 0) { rowIndex = this.editedRowIndex; }
|
|
6047
|
+
grid.closeRow(rowIndex);
|
|
6048
|
+
this.editedRowIndex = undefined;
|
|
6049
|
+
this.formGroup = undefined;
|
|
6050
|
+
};
|
|
6051
|
+
ZgridComponent.prototype.getItemIndex = function (item, data, key) {
|
|
6052
|
+
for (var idx = 0; idx < data.length; idx++) {
|
|
6053
|
+
if (data[idx][key] === item[key]) {
|
|
6054
|
+
return idx;
|
|
6055
|
+
}
|
|
6802
6056
|
}
|
|
6057
|
+
return -1;
|
|
6803
6058
|
};
|
|
6804
|
-
return
|
|
6059
|
+
return ZgridComponent;
|
|
6805
6060
|
}());
|
|
6806
|
-
|
|
6061
|
+
ZgridComponent.decorators = [
|
|
6807
6062
|
{ type: i0.Component, args: [{
|
|
6808
|
-
selector: "app-
|
|
6809
|
-
template: " <div style=\"margin: 10px 0 6px 0;\">\r\n <div *ngIf=\"data.Title\" class=\"gridTitle\">{{data.Title}}</div>\r\n <ng-template #template let-anchor>\r\n <span>{{ anchor.nativeElement.innerText }}</span>\r\n </ng-template>\r\n <kendo-grid [zgridcalendarbinding]=\"{data: data, group: group, params: params, gridSubject: gridSubject}\" [ngClass]=\"data.Class\"\r\n [data]=\"gridData\"\r\n [skip]=\"state.skip\"\r\n [filterable]=\"false\"\r\n [resizable]=\"true\"\r\n [reorderable]=\"false\"\r\n [columnMenu]=\"false\"\r\n (cellClick)=\"cellClickHandler($event)\"\r\n (cellClose)=\"editCellCloseHandler($event)\"\r\n (dataStateChange)=\"dataStateChange($event)\"\r\n (columnReorder)=\"columnsOrderChanged($event)\"\r\n [kendoGridSelectBy]=\"rowSelectionKey\"\r\n [selectable]=\"selectableSettings\"\r\n [selectedKeys]=\"mySelection\">\r\n <!--[hidden]=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\"\r\n [filter]=\"state.filter\"\r\n -->\r\n\r\n <kendo-grid-checkbox-column *ngIf=\"!!data.SelectOptions\" [width]=\"60\" showSelectAll=\"true\" [columnMenu]=\"true\"></kendo-grid-checkbox-column>\r\n <kendo-grid-column *ngFor=\"let col of columns\"\r\n [field]=\"col.field\"\r\n [title]=\"col.title\"\r\n [width]=\"col.width\"\r\n [minResizableWidth]=\"col.minResizableWidth\"\r\n [filter]=\"col.filter\"\r\n [filterable]=\"filterable(col.enableFiltering)\"\r\n [headerStyle]=\"{'white-space': 'initial'}\"\r\n [hidden]=\"col.hidden\"\r\n [format]=\"col.format\"\r\n [class]=\"col.Class\"\r\n [locked]=\"locked(col)\"\r\n editor=\"numeric\">\r\n <div [ngSwitch]=\"true\">\r\n <div *ngSwitchCase=\"col.fieldType == 'zdate'\r\n || col.fieldType === 'zdatetime'\r\n || col.fieldType === 'zuidatetime'\r\n || col.fieldType === 'zuitime'\r\n || col.fieldType === 'ztime'\">\r\n <div *ngIf=\"col.filterByDateRange === false\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-date-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"lte\">\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-date-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-string-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"contains\">\r\n <kendo-filter-contains-operator></kendo-filter-contains-operator>\r\n <kendo-filter-eq-operator></kendo-filter-eq-operator>\r\n <kendo-filter-neq-operator></kendo-filter-neq-operator>\r\n <kendo-filter-startswith-operator></kendo-filter-startswith-operator>\r\n <kendo-filter-endswith-operator></kendo-filter-endswith-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-string-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <ng-template kendoGridCellTemplate let-dataItem let-rowIndex=\"rowIndex\">\r\n <div style=\"margin: 1px 0;\" *ngIf=\"!col.clickableIcons && col.isEditableInGrid !== true\" [ngSwitch]=\"col.fieldType\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'zdate'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zshortdate'\">\r\n {{ dataItem[col.field] | date: 'MMM yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'ztime'\">\r\n {{ dataItem[col.field] | date: 'HH:mm' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuitime'\">\r\n {{ dataItem[col.field] | date: 'HH:mm:ss' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zdatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuidatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchDefault>\r\n {{ dataItem[col.field]}}\r\n </span>\r\n </div>\r\n <div style=\"margin: 5px 0;\" *ngIf=\"col.isEditableInGrid === true\" [ngSwitch]=\"col.fieldType\" [formGroup]=\"inlineEditedFormGroups\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'checkbox'\">\r\n <ion-checkbox [disabled]=\"(!!col.ReadOnly ? col.ReadOnly : false)\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" color=\"primary\" (ionChange)=\"inCellCheckBoxOnChange($event, rowIndex, col)\"></ion-checkbox>\r\n </span>\r\n <span *ngSwitchCase=\"['zuidatetime','zdate','ztime','zuitime','zdatetime','zshortdate'].includes(col.fieldType) ? col.fieldType : ''\">\r\n <app-zdatetime style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-zdatetime>\r\n </span>\r\n <span *ngSwitchDefault>\r\n <input style=\"width: 100%;\" type=\"text\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" />\r\n </span>\r\n </div>\r\n </ng-template>\r\n </kendo-grid-column>\r\n </kendo-grid>\r\n <div *ngIf=\"isLoading\" class=\"k-i-loading\"></div>\r\n </div>\r\n\r\n\r\n",
|
|
6063
|
+
selector: "app-zgrid",
|
|
6064
|
+
template: "<!--\r\n<div style=\"margin: 10px\">\r\n <div class=\"card\">\r\n <div class=\"card-block k-form\">\r\n <fieldset>\r\n <legend>Binding types</legend>\r\n <div class=\"k-form-field\">\r\n <span>Bind the data to:</span>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"array\" value=\"array\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"array\">Array object</label>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"gridDataResult\" value=\"gridDataResult\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"gridDataResult\">GridDataResult object</label>\r\n <input [(ngModel)]=\"bindingType\" type=\"radio\" name=\"mode\" id=\"async\" value=\"async\" class=\"k-radio\"\r\n (change)=\"changeBindingType($event)\">\r\n <label class=\"k-radio-label\" for=\"async\">Asynchronous source</label>\r\n </div>\r\n </fieldset>\r\n </div>\r\n </div>\r\n</div> -->\r\n<div style=\"margin: 10px 0 6px 0;\">\r\n <div *ngIf=\"data.Title\" class=\"gridTitle\">{{data.Title}}</div>\r\n <ng-template #template let-anchor>\r\n <span>{{ anchor.nativeElement.innerText }}</span>\r\n </ng-template>\r\n <div kendoTooltip\r\n showOn=\"none\"\r\n [tooltipTemplate]=\"template\"\r\n filter=\".k-grid td\"\r\n (mouseover)=\"showTooltip($event)\"> \r\n <kendo-grid [zgridbinding]=\"{data: data, group: group, params: params, gridSubject: gridSubject}\" [ngClass]=\"data.Class\"\r\n [data]=\"gridData\"\r\n [pageSize]=\"state.take\"\r\n [pageable]=\"{responsive: true, buttonCount: 3, pageSizes: pageSizes, previousNext: previousNext}\"\r\n [skip]=\"state.skip\"\r\n [sort]=\"state.sort\"\r\n [sortable]=\"{allowUnsort: true,mode: 'multiple'}\"\r\n [filter]=\"state.filter\"\r\n [filterable]=\"data.enableFiltering !== false\"\r\n [resizable]=\"true\"\r\n [reorderable]=\"true\"\r\n [columnMenu]=\"data.DisableGridColumnMenu ? false : { filter: true }\"\r\n [hidden]=\"!(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\"\r\n (cellClick)=\"cellClickHandler($event)\"\r\n (cellClose)=\"editCellCloseHandler($event)\"\r\n (dataStateChange)=\"dataStateChange($event)\"\r\n (pageChange)=\"pageChange($event)\"\r\n (sortChange)=\"sortChange($event)\"\r\n (filterChange)=\"filterChange($event)\"\r\n (columnReorder)=\"columnsOrderChanged($event)\"\r\n [kendoGridSelectBy]=\"rowSelectionKey\"\r\n [selectable]=\"selectableSettings\"\r\n [selectedKeys]=\"mySelection\"\r\n [ngStyle]=\"getGridStyle()\"\r\n [trackBy]=\"trackBy\"\r\n (cancel)=\"cancelHandler($event)\"\r\n (save)=\"saveHandler($event)\"\r\n (remove)=\"removeHandler($event)\"\r\n (edit)=\"editHandler($event)\"\r\n (add)=\"addHandler($event)\">\r\n <ng-template kendoGridToolbarTemplate *ngIf=\"data.AllowRefreshButton || data.AllowExport || data.AllowSaveState || data.EnableGridCommand\">\r\n <button type=\"button\" kendoButton (click)=\"refreshData()\" *ngIf=\"data.AllowRefreshButton\"><span class=\"k-icon k-i-refresh-sm\"></span> Refresh</button>\r\n <button type=\"button\" kendoGridExcelCommand *ngIf=\"data.AllowExport\"><span class=\"k-icon k-i-file-excel\"></span> Export Data to Excel</button>\r\n <button type=\"button\" kendoButton (click)=\"saveGridSettings()\" *ngIf=\"data.AllowSaveState\"><span class=\"k-icon k-i-star\"></span> Save Setting</button>\r\n <button type=\"button\" kendoButton (click)=\"restoreGridSettings()\" *ngIf=\"gridDefaultStateExist\"><span class=\"k-icon k-i-star-outline\"></span> Restore Setting</button>\r\n <button type=\"button\" kendoGridAddCommand *ngIf=\"data.EnableGridCommand \"><span class=\"k-icon k-i-add\"></span>Add New</button>\r\n </ng-template>\r\n <kendo-grid-checkbox-column *ngIf=\"!!data.SelectOptions\" [width]=\"60\" showSelectAll=\"true\" [columnMenu]=\"true\"></kendo-grid-checkbox-column>\r\n <kendo-grid-column *ngFor=\"let col of columns\"\r\n [field]=\"col.field\"\r\n [title]=\"col.title\"\r\n [width]=\"col.width\"\r\n [minResizableWidth]=\"col.minResizableWidth\"\r\n [filter]=\"col.filter\"\r\n [filterable]=\"filterable(col.enableFiltering)\"\r\n [sortable]=\"sortable(col.enableSorting)\"\r\n [headerStyle]=\"{'white-space': 'initial'}\"\r\n [hidden]=\"col.hidden\"\r\n [format]=\"col.format\"\r\n [class]=\"col.Class\"\r\n [locked]=\"locked(col)\"\r\n [columnMenu]=\"!col.disableColumnMenu\"\r\n [editor]=\"col.editorType\">\r\n <div [ngSwitch]=\"true\">\r\n <div *ngSwitchCase=\"col.fieldType === 'number'\r\n || col.fieldType === 'currency'\r\n || col.fieldType === 'znumeric'\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-numeric-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"eq\">\r\n <kendo-filter-eq-operator></kendo-filter-eq-operator>\r\n <kendo-filter-neq-operator></kendo-filter-neq-operator>\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-numeric-filter-cell>\r\n </ng-template>\r\n </div>\r\n <div *ngSwitchCase=\"col.fieldType == 'zdate'\r\n || col.fieldType === 'ztime'\r\n || col.fieldType === 'zdatetime'\r\n || col.fieldType === 'zuidatetime'\">\r\n <div *ngIf=\"col.filterByDateRange === true\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\" operator=\"lte\">\r\n <date-range-filter-cell class=\"date-range-filter\"\r\n [filter]=\"filter\"\r\n [field]=\"col.field\">\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </date-range-filter-cell>\r\n </ng-template>\r\n </div>\r\n <div *ngIf=\"col.filterByDateRange === false\">\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-date-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"lte\">\r\n <kendo-filter-lt-operator></kendo-filter-lt-operator>\r\n <kendo-filter-lte-operator></kendo-filter-lte-operator>\r\n <kendo-filter-gt-operator></kendo-filter-gt-operator>\r\n <kendo-filter-gte-operator></kendo-filter-gte-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-date-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ng-template kendoGridFilterCellTemplate let-filter let-column=\"column\">\r\n <kendo-grid-string-filter-cell [column]=\"column\" [filter]=\"filter\" operator=\"contains\">\r\n <kendo-filter-contains-operator></kendo-filter-contains-operator>\r\n <kendo-filter-eq-operator></kendo-filter-eq-operator>\r\n <kendo-filter-neq-operator></kendo-filter-neq-operator>\r\n <kendo-filter-startswith-operator></kendo-filter-startswith-operator>\r\n <kendo-filter-endswith-operator></kendo-filter-endswith-operator>\r\n <kendo-filter-isnull-operator></kendo-filter-isnull-operator>\r\n <kendo-filter-isnotnull-operator></kendo-filter-isnotnull-operator>\r\n </kendo-grid-string-filter-cell>\r\n </ng-template>\r\n </div>\r\n </div>\r\n <!-- Grid Edit Template -->\r\n <ng-template kendoGridEditTemplate *ngIf=\"data.EnableGridCommand \" let-dataItem=\"dataItem\" let-column=\"col\" let-formGroup=\"formGroup\" let-isNew=\"isNew\">\r\n <div [ngSwitch]=\"col.fieldType\">\r\n <div *ngSwitchCase=\"'number'\">\r\n <kendo-numerictextbox #cellAnchor [formControl]=\"formGroup.get(col.field)\"></kendo-numerictextbox>\r\n <kendo-popup [anchor]=\"cellAnchor.numericInput\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !(isNew && formGroup.get(col.field).untouched)\"\r\n popupClass=\"k-widget k-tooltip k-tooltip-validation k-invalid-msg\"\r\n style=\"padding-left: 2px; opacity: 0.5;\">\r\n <span class=\"k-icon k-i-warning\"></span>\r\n <ion-label style=\"padding-top: 1px; padding-left: 3px;\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !formGroup.get(col.field).untouched && formGroup.get(col.field).errors?.required\">\r\n {{ col.Name }} required.\r\n </ion-label>\r\n <ion-label style=\"padding-top: 1px; padding-left: 3px;\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !formGroup.get(col.field).untouched && formGroup.get(col.field).errors?.pattern\">\r\n {{ col.ValidatorMessage ? col.ValidatorMessage : \"Please check the input value.\" }}\r\n </ion-label>\r\n </kendo-popup>\r\n </div>\r\n <div *ngSwitchDefault>\r\n <kendo-textbox #cellAnchor [formControl]=\"formGroup.get(col.field)\"></kendo-textbox>\r\n <kendo-popup [anchor]=\"cellAnchor.input\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !(isNew && formGroup.get(col.field).untouched)\"\r\n popupClass=\"k-widget k-tooltip k-tooltip-validation k-invalid-msg\"\r\n style=\"padding-left: 2px; opacity: 0.5;\">\r\n <span class=\"k-icon k-i-warning\"></span>\r\n <!--<ion-label style=\"padding-top: 1px; padding-left: 3px;\">{{ col.Name }} is required.</ion-label>-->\r\n\r\n <ion-label style=\"padding-top: 1px; padding-left: 3px;\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !formGroup.get(col.field).untouched && formGroup.get(col.field).errors?.required\">\r\n {{ col.Name }} required.\r\n </ion-label>\r\n <ion-label style=\"padding-top: 1px; padding-left: 3px;\"\r\n *ngIf=\"formGroup.get(col.field).invalid && !formGroup.get(col.field).untouched && formGroup.get(col.field).errors?.pattern\">\r\n {{ col.ValidatorMessage ? col.ValidatorMessage : \"Please check the input value.\" }}\r\n </ion-label>\r\n </kendo-popup>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template kendoGridCellTemplate let-dataItem let-rowIndex=\"rowIndex\">\r\n <div style=\"margin: 1px 0;\" *ngIf=\"!col.clickableIcons && col.isEditableInGrid !== true\" [ngSwitch]=\"col.fieldType\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'zdate'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'ztime'\">\r\n {{ dataItem[col.field] | date: 'HH:mm' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zshortdate'\">\r\n {{ dataItem[col.field] | date: 'MMM yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zdatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuidatetime'\">\r\n {{ dataItem[col.field] | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'number'\">\r\n {{ dataItem[col.field] | number }}\r\n </span>\r\n <span *ngSwitchCase=\"'currency'\">\r\n {{ dataItem[col.field] | number: getFormat(col, '1.2-2') }}\r\n </span>\r\n <span *ngSwitchCase=\"'znumeric'\">\r\n {{ dataItem[col.field] | number: getFormat(col) }}\r\n </span>\r\n <span *ngSwitchCase=\"'url'\" style=\"color: blue; cursor: pointer; text-decoration:underline;\">\r\n {{ dataItem[col.field] }}\r\n </span>\r\n <span *ngSwitchDefault>\r\n {{ dataItem[col.field]}}\r\n </span>\r\n </div>\r\n <!-- <span *ngIf=\"!!col.navigateTo\" (click)=\"onNavigateTo($event, col, dataItem, dataItem[col.field])\">\r\n <ion-button color=\"light\" size=\"small\">\r\n {{ col.ClickableIcons }}\r\n <ion-icon slot= \"end\" name=\"arrow-forward\"></ion-icon>\r\n </ion-button>\r\n </span> -->\r\n <div style=\"margin: 5px 0;\" *ngIf=\"col.isEditableInGrid === true && inlineEditedFormGroups\" [ngSwitch]=\"col.fieldType\" [formGroup]=\"inlineEditedFormGroups\"\r\n [ngClass]=\"getClass(dataItem, col)\">\r\n <span *ngSwitchCase=\"'number'\">\r\n <input type=\"number\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" />\r\n </span>\r\n <span *ngSwitchCase=\"'checkbox'\">\r\n <ion-checkbox [disabled]=\"(!!col.ReadOnly ? col.ReadOnly : false)\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" color=\"primary\" (ionChange)=\"inCellCheckBoxOnChange($event, rowIndex, col)\"></ion-checkbox>\r\n </span>\r\n <span *ngSwitchCase=\"'zuiselectmultiple'\">\r\n <app-zselectmultiple style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-zselectmultiple>\r\n </span>\r\n <span *ngSwitchCase=\"'textarea'\">\r\n <app-ztextarea style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-ztextarea>\r\n </span>\r\n <span *ngSwitchCase=\"['zuidatetime','zdate', 'ztime','zdatetime','zshortdate'].includes(col.fieldType) ? col.fieldType : ''\">\r\n <app-zdatetime style=\"width: 100%;\" [data]=\"getInlineField(col.Value)\" [group]=\"group\" [form]=\"getInlineForm(rowIndex)\"></app-zdatetime>\r\n </span>\r\n <span *ngSwitchDefault>\r\n <input style=\"width: 100%;\" type=\"text\" [formControl]=\"this.getFormControl(rowIndex, col.field)\" />\r\n </span>\r\n </div>\r\n <span style=\"margin-top: 10px;\" *ngFor=\"let icon of col.clickableIcons\">\r\n <span [ngClass]=\"icon.Class ? icon.Class : ''\" *ngIf=\"!!icon && (!!dataItem.WFS_StatusCode && !!icon)\r\n ? dataItem.WFS_StatusCode !== icon.WFS_StatusCode\r\n : true;\r\n else disabledButton\" (click)=\"onBtnClick($event, icon, dataItem, dataItem[col.field])\">\r\n {{icon.Name || dataItem[col.field]}} <fa-icon [icon]=\"icon.Icon\" style=\"padding: 4px 6px;\">\r\n </fa-icon>\r\n </span>\r\n <ng-template #disabledButton>\r\n </ng-template>\r\n </span>\r\n <!-- <strong>{{ dataItem[col.field] }}</strong> -->\r\n <!-- <span class=\"{{dataItem.Discontinued ? 'discontinued' : 'active'}}\">\r\n {{dataItem.Discontinued ? \"discontinued\" : \"active\"}}\r\n </span> -->\r\n </ng-template>\r\n <ng-template kendoGridFooterTemplate let-column let-columnIndex=\"columnIndex\" *ngIf=\"data.EnableAggregate\">\r\n <div style=\"margin: 5px 0;\" [ngSwitch]=\"col.fieldType\">\r\n {{col.aggregateType}}\r\n <span *ngSwitchCase=\"'zdate'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'ztime'\">\r\n {{ col.aggregateValue | date: 'HH:mm' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zshortdate'\">\r\n {{ col.aggregateValue | date: 'MMM yyyy' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zdatetime'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'zuidatetime'\">\r\n {{ col.aggregateValue | date: 'dd/MM/yyyy hh:mm:ss aa' }}\r\n </span>\r\n <span *ngSwitchCase=\"'number'\">\r\n {{ col.aggregateValue | number }}\r\n </span>\r\n <span *ngSwitchCase=\"'currency'\">\r\n {{ col.aggregateValue | number: getFormat(col, '1.2.2') }}\r\n </span>\r\n <span *ngSwitchCase=\"'znumeric'\">\r\n {{ col.aggregateValue | number: getFormat(col) }}\r\n </span>\r\n <span *ngSwitchCase=\"'url'\" style=\"color: blue; cursor: pointer; text-decoration:underline;\">\r\n {{ col.aggregateValue }}\r\n </span>\r\n <span *ngSwitchDefault>\r\n {{ col.aggregateValue }}\r\n </span>\r\n </div>\r\n </ng-template>\r\n </kendo-grid-column>\r\n <kendo-grid-command-column *ngIf=\"data.EnableGridCommand\" width=\"180\" [columnMenu]=\"false\">\r\n <ng-template kendoGridCellTemplate let-isNew=\"isNew\">\r\n <button kendoGridSaveCommand>\r\n {{ isNew ? 'Save' : 'Update' }}\r\n </button>\r\n <button kendoGridCancelCommand [primary]=\"true\">\r\n {{ isNew ? 'Discard changes' : 'Cancel' }}\r\n </button>\r\n <button kendoGridEditCommand>\r\n {{ \"Edit\" }}\r\n </button>\r\n <button kendoGridRemoveCommand>\r\n {{ \"Remove\" }}\r\n </button>\r\n </ng-template>\r\n </kendo-grid-command-column>\r\n <kendo-grid-excel fileName=\"Export.xlsx\" [fetchData]=\"allResults\"></kendo-grid-excel>\r\n </kendo-grid>\r\n <div *ngIf=\"isLoading\" class=\"k-i-loading\"></div>\r\n </div>\r\n</div>\r\n",
|
|
6810
6065
|
styles: [":host ::ng-deep kendo-grid .k-grid-content{white-space:nowrap}:host ::ng-deep kendo-grid .k-toolbar{background-color:#e3ecf8}:host ::ng-deep kendo-grid .k-grid-header{background-color:#e3ecf8;font-weight:600}:host ::ng-deep kendo-grid .k-button{border-radius:5px;box-shadow:0 2px 2px rgba(0,0,0,.1);background-color:#c9daf2}:host ::ng-deep kendo-grid .k-grid-header .k-grid-filter:hover,:host ::ng-deep kendo-grid .k-grid-header .k-header-column-menu:hover,:host ::ng-deep kendo-grid .k-grid-header .k-hierarchy-cell .k-icon:hover{background-color:#c9daf2}:host ::ng-deep kendo-grid .k-grid .k-grid-filter,:host ::ng-deep kendo-grid .k-grid .k-header-column-menu,:host ::ng-deep kendo-grid .k-grid .k-hierarchy-cell .k-icon{color:#132842}:host ::ng-deep kendo-grid .k-dropdown .k-dropdown-wrap,:host ::ng-deep kendo-grid .k-dropdowntree .k-dropdown-wrap{border-radius:2px;background-color:rgba(214,224,239,.5)}:host ::ng-deep kendo-grid tr.k-alt{background-color:rgba(232,238,246,.5)}:host ::ng-deep kendo-grid tbody tr.k-state-hover,:host ::ng-deep kendo-grid tbody tr:hover{background-color:rgba(214,224,239,.5)}:host ::ng-deep kendo-grid .k-pager-wrap{background-color:#e3ecf8}:host ::ng-deep kendo-grid .k-pager-numbers .k-link.k-state-selected{color:#ff5e5b;background-color:rgba(255,94,91,.4)}:host ::ng-deep kendo-grid .k-pager-numbers .k-link.k-state-hover,:host ::ng-deep kendo-grid .k-pager-numbers .k-link:hover{color:#ff5e5b;background-color:rgba(255,94,91,.15)}.cellWrapText .gridCell{white-space:pre-line!important}.rightAligned{text-align:right}.centerAligned{text-align:center}.gridTitle{margin:20px 10px 5px;font-size:18px;font-weight:700}.gridCell.primary{color:var(--ion-color-primary)}.gridCell.secondary{color:var(--ion-color-secondary)}.gridCell.tertiary{color:var(--ion-color-tertiary)}.gridCell.success{color:var(--ion-color-success-shade)}.gridCell.warning{color:var(--ion-color-warning)}.gridCell.danger{color:var(--ion-color-danger)}.gridCell.dark{color:var(--ion-color-dark)}.gridCell.medium{color:var(--ion-color-medium)}.gridCell.light{color:var(--ion-color-light)}.k-i-loading{position:absolute;top:100px;left:0;right:0;bottom:0;font-size:45px;background-color:hsla(0,0%,100%,.3);color:#0f4800}"]
|
|
6811
6066
|
},] }
|
|
6812
6067
|
];
|
|
6813
|
-
|
|
6068
|
+
ZgridComponent.ctorParameters = function () { return [
|
|
6814
6069
|
{ type: i1.ActivatedRoute },
|
|
6815
6070
|
{ type: i1.Router },
|
|
6816
6071
|
{ type: forms.FormBuilder },
|
|
@@ -6818,12 +6073,15 @@
|
|
|
6818
6073
|
{ type: i3.WebApiService },
|
|
6819
6074
|
{ type: i3.ZGridStatePersistingService },
|
|
6820
6075
|
{ type: i3.ToastService },
|
|
6821
|
-
{ type: i3.ZCoreService }
|
|
6076
|
+
{ type: i3.ZCoreService },
|
|
6077
|
+
{ type: i3.StorageSessionService },
|
|
6078
|
+
{ type: MainService }
|
|
6822
6079
|
]; };
|
|
6823
|
-
|
|
6080
|
+
ZgridComponent.propDecorators = {
|
|
6824
6081
|
data: [{ type: i0.Input }],
|
|
6825
6082
|
group: [{ type: i0.Input }],
|
|
6826
|
-
form: [{ type: i0.Input }]
|
|
6083
|
+
form: [{ type: i0.Input }],
|
|
6084
|
+
tooltipDir: [{ type: i0.ViewChild, args: [kendoAngularTooltip.TooltipDirective,] }]
|
|
6827
6085
|
};
|
|
6828
6086
|
|
|
6829
6087
|
var ZimgComponent = /** @class */ (function () {
|
|
@@ -9837,6 +9095,7 @@
|
|
|
9837
9095
|
this.state = { expandedkeys: [] };
|
|
9838
9096
|
this.itemIndex = [];
|
|
9839
9097
|
this.selectedKeys = [];
|
|
9098
|
+
this.absoluteText = false;
|
|
9840
9099
|
this.componentProperties = new i3.ZComponentProperties();
|
|
9841
9100
|
this.isExpanded = function (dataItem, index) {
|
|
9842
9101
|
// console.log(index);
|
|
@@ -9912,6 +9171,10 @@
|
|
|
9912
9171
|
if (this.data.TreeviewExpandAll) {
|
|
9913
9172
|
this.expandAll();
|
|
9914
9173
|
}
|
|
9174
|
+
// fix text align issue
|
|
9175
|
+
if (this.data.OnAddNode || this.data.OnRemoveNode) {
|
|
9176
|
+
this.absoluteText = true;
|
|
9177
|
+
}
|
|
9915
9178
|
};
|
|
9916
9179
|
ZtreeComponent.prototype.ngAfterViewInit = function () {
|
|
9917
9180
|
// const componentId = ZComponentHelper.getComponentId(this.data);
|
|
@@ -10181,8 +9444,8 @@
|
|
|
10181
9444
|
ZtreeComponent.decorators = [
|
|
10182
9445
|
{ type: i0.Component, args: [{
|
|
10183
9446
|
selector: "app-ztree",
|
|
10184
|
-
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)\"
|
|
10185
|
-
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
|
|
9447
|
+
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",
|
|
9448
|
+
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-state-selected{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:3px;background-color:#a9c3e8;color:#0a45ab;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}"]
|
|
10186
9449
|
},] }
|
|
10187
9450
|
];
|
|
10188
9451
|
ZtreeComponent.ctorParameters = function () { return []; };
|
|
@@ -11642,7 +10905,6 @@
|
|
|
11642
10905
|
zdiv: ZdivComponent,
|
|
11643
10906
|
zgauge: ZgaugeComponent,
|
|
11644
10907
|
zgrid: ZgridComponent,
|
|
11645
|
-
zgridcalendar: ZgridcalendarComponent,
|
|
11646
10908
|
zimg: ZimgComponent,
|
|
11647
10909
|
zkcard: ZkcardComponent,
|
|
11648
10910
|
zlabel: ZlabelComponent,
|
|
@@ -11806,7 +11068,7 @@
|
|
|
11806
11068
|
ScrollbarThemeDirective,
|
|
11807
11069
|
FieldElementDirective,
|
|
11808
11070
|
ZGridBindingDirective,
|
|
11809
|
-
|
|
11071
|
+
ZGridPopupAnchorDirective,
|
|
11810
11072
|
OpenOnFocusDirective,
|
|
11811
11073
|
DateParserFilter,
|
|
11812
11074
|
EditorFilter,
|
|
@@ -11837,7 +11099,6 @@
|
|
|
11837
11099
|
ZformcontrolComponent,
|
|
11838
11100
|
ZgaugeComponent,
|
|
11839
11101
|
ZgridComponent,
|
|
11840
|
-
ZgridcalendarComponent,
|
|
11841
11102
|
ZimgComponent,
|
|
11842
11103
|
ZkcardComponent,
|
|
11843
11104
|
ZlabelComponent,
|
|
@@ -11906,7 +11167,7 @@
|
|
|
11906
11167
|
ScrollbarThemeDirective,
|
|
11907
11168
|
FieldElementDirective,
|
|
11908
11169
|
ZGridBindingDirective,
|
|
11909
|
-
|
|
11170
|
+
ZGridPopupAnchorDirective,
|
|
11910
11171
|
OpenOnFocusDirective,
|
|
11911
11172
|
DateParserFilter,
|
|
11912
11173
|
EditorFilter,
|
|
@@ -11937,7 +11198,6 @@
|
|
|
11937
11198
|
ZformcontrolComponent,
|
|
11938
11199
|
ZgaugeComponent,
|
|
11939
11200
|
ZgridComponent,
|
|
11940
|
-
ZgridcalendarComponent,
|
|
11941
11201
|
ZimgComponent,
|
|
11942
11202
|
ZkcardComponent,
|
|
11943
11203
|
ZlabelComponent,
|
|
@@ -11987,7 +11247,6 @@
|
|
|
11987
11247
|
ZformcontrolComponent,
|
|
11988
11248
|
ZgaugeComponent,
|
|
11989
11249
|
ZgridComponent,
|
|
11990
|
-
ZgridcalendarComponent,
|
|
11991
11250
|
ZimgComponent,
|
|
11992
11251
|
ZkcardComponent,
|
|
11993
11252
|
ZlabelComponent,
|
|
@@ -12050,6 +11309,7 @@
|
|
|
12050
11309
|
exports.ZBulletComponent = ZBulletComponent;
|
|
12051
11310
|
exports.ZChipComponent = ZChipComponent;
|
|
12052
11311
|
exports.ZGridBindingDirective = ZGridBindingDirective;
|
|
11312
|
+
exports.ZGridPopupAnchorDirective = ZGridPopupAnchorDirective;
|
|
12053
11313
|
exports.ZSchedulerToolBarComponent = ZSchedulerToolBarComponent;
|
|
12054
11314
|
exports.ZTreeListOptions = ZTreeListOptions;
|
|
12055
11315
|
exports.ZbuttonsComponent = ZbuttonsComponent;
|
|
@@ -12064,7 +11324,6 @@
|
|
|
12064
11324
|
exports.ZformcontrolComponent = ZformcontrolComponent;
|
|
12065
11325
|
exports.ZgaugeComponent = ZgaugeComponent;
|
|
12066
11326
|
exports.ZgridComponent = ZgridComponent;
|
|
12067
|
-
exports.ZgridcalendarComponent = ZgridcalendarComponent;
|
|
12068
11327
|
exports.ZimgComponent = ZimgComponent;
|
|
12069
11328
|
exports.ZkcardComponent = ZkcardComponent;
|
|
12070
11329
|
exports.ZlabelComponent = ZlabelComponent;
|
|
@@ -12091,8 +11350,7 @@
|
|
|
12091
11350
|
exports.refreshGrid = refreshGrid;
|
|
12092
11351
|
exports.toQueryRule = toQueryRule;
|
|
12093
11352
|
exports.ɵa = ZComponentDebugService;
|
|
12094
|
-
exports.ɵb =
|
|
12095
|
-
exports.ɵc = ZComponentService;
|
|
11353
|
+
exports.ɵb = ZComponentService;
|
|
12096
11354
|
|
|
12097
11355
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
12098
11356
|
|