mmhglobal-dynamicform 1.1.34 → 1.1.35
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 +4 -0
- package/bundles/mmhglobal-dynamicform.umd.js +141 -154
- package/bundles/mmhglobal-dynamicform.umd.js.map +1 -1
- package/bundles/mmhglobal-dynamicform.umd.min.js +1 -1
- package/bundles/mmhglobal-dynamicform.umd.min.js.map +1 -1
- package/esm2015/lib/zgrid/zgrid.binding.directive.js +129 -134
- package/esm2015/lib/zgrid/zgrid.component.js +15 -13
- package/fesm2015/mmhglobal-dynamicform.js +141 -142
- package/fesm2015/mmhglobal-dynamicform.js.map +1 -1
- package/lib/zgrid/zgrid.binding.directive.d.ts +8 -8
- package/mmhglobal-dynamicform.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.13.
|
|
4
4
|
|
|
5
5
|
## Changelog
|
|
6
|
+
`1.35`<br/>
|
|
7
|
+
Temp disable get grid setting from cookiestore when load.
|
|
8
|
+
Fix and enable back grid session storage.
|
|
9
|
+
|
|
6
10
|
`1.34`<br/>
|
|
7
11
|
Fix zgrid intermittent display all column.
|
|
8
12
|
Fix zText tooltip issue.
|
|
@@ -2127,23 +2127,99 @@
|
|
|
2127
2127
|
_this.getGrantType();
|
|
2128
2128
|
_this.setHiddenColumn(gridSetting);
|
|
2129
2129
|
_this.params.referId = _this.getFieldReferenceId() || _this.grp.referenceId || null;
|
|
2130
|
-
|
|
2131
|
-
//
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
//
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
//
|
|
2138
|
-
|
|
2139
|
-
//switchMap(() => {
|
|
2140
|
-
// //Set grid data
|
|
2141
|
-
// return this.setGridSessionFilter(this.grp, this);
|
|
2130
|
+
}), operators.switchMap(function () {
|
|
2131
|
+
//Get Session
|
|
2132
|
+
return _this.getGridSessionFilter(_this.grp, _this);
|
|
2133
|
+
}), operators.switchMap(function () {
|
|
2134
|
+
//Before get grid data
|
|
2135
|
+
return _this.beforeGridGetData(_this.grp, _this);
|
|
2136
|
+
}), operators.switchMap(function () {
|
|
2137
|
+
//Set grid data
|
|
2138
|
+
return _this.setGridSessionFilter(_this.grp, _this);
|
|
2142
2139
|
}))
|
|
2143
2140
|
.subscribe(function () {
|
|
2144
2141
|
_this.getDataBinding();
|
|
2145
2142
|
});
|
|
2146
2143
|
};
|
|
2144
|
+
ZGridBindingDirective.prototype.getFilterParamsColumns = function () {
|
|
2145
|
+
var colFields = [];
|
|
2146
|
+
this.gridColumns.forEach(function (field) {
|
|
2147
|
+
if (field.valueExpr) {
|
|
2148
|
+
colFields.push(field.valueExpr + " as " + field.field);
|
|
2149
|
+
}
|
|
2150
|
+
else {
|
|
2151
|
+
colFields.push(field.field);
|
|
2152
|
+
}
|
|
2153
|
+
});
|
|
2154
|
+
if (colFields.length > 0) {
|
|
2155
|
+
if (colFields.indexOf("Id") === -1) {
|
|
2156
|
+
colFields.push("Id");
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
var tmpGridColumn = [];
|
|
2160
|
+
tmpGridColumn.push(colFields.join(","));
|
|
2161
|
+
if (this.usableColumns.length > 0) {
|
|
2162
|
+
tmpGridColumn.push(this.usableColumns.join(","));
|
|
2163
|
+
}
|
|
2164
|
+
this.params.columns = tmpGridColumn.join(",");
|
|
2165
|
+
};
|
|
2166
|
+
ZGridBindingDirective.prototype.getFilter = function () {
|
|
2167
|
+
var _this = this;
|
|
2168
|
+
if (this.params.filters && this.field.Filters) {
|
|
2169
|
+
this.params.filters = this.params.filters + " && " + this.field.Filters;
|
|
2170
|
+
}
|
|
2171
|
+
else if (!this.params.filters && this.field.Filters) {
|
|
2172
|
+
this.params.filters = this.field.Filters;
|
|
2173
|
+
}
|
|
2174
|
+
if (this.field.Filters && this.field.Filters.indexOf("group.") !== -1) {
|
|
2175
|
+
var filterKeyValPairs = this.field.Filters.split(" ");
|
|
2176
|
+
var grpValues = filterKeyValPairs.filter(function (element) { return element.trim().indexOf("group.") !== -1; });
|
|
2177
|
+
grpValues.forEach(function (val) {
|
|
2178
|
+
var actualVal = i3.ZComponentHelper.getGroupValue(val, _this.grp);
|
|
2179
|
+
_this.params.filters = _this.params.filters.replace(val, actualVal);
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
ZGridBindingDirective.prototype.getFilterParams = function () {
|
|
2184
|
+
if (this.field['FilterParams']) {
|
|
2185
|
+
if (this.field['FilterParams'].indexOf("group.") !== -1) {
|
|
2186
|
+
this.params.filterParams = i3.ZComponentHelper.getGroupValue(this.field['FilterParams'], this.grp);
|
|
2187
|
+
}
|
|
2188
|
+
else {
|
|
2189
|
+
this.params.filterParams = this.field['FilterParams'];
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
};
|
|
2193
|
+
ZGridBindingDirective.prototype.getSorting = function () {
|
|
2194
|
+
if (this.field.SortOrder) {
|
|
2195
|
+
if (this.field.SortOrder.indexOf("group.") !== -1) {
|
|
2196
|
+
this.params.sortOrder = i3.ZComponentHelper.getGroupValue(this.field.SortOrder, this.grp);
|
|
2197
|
+
}
|
|
2198
|
+
else {
|
|
2199
|
+
this.params.sortOrder = this.field.SortOrder;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
ZGridBindingDirective.prototype.getGrantType = function () {
|
|
2204
|
+
if (this.field.GrantType) {
|
|
2205
|
+
this.params.grantType = i3.ZComponentHelper.getGroupValue(this.field.GrantType.toString(), this.grp);
|
|
2206
|
+
}
|
|
2207
|
+
};
|
|
2208
|
+
ZGridBindingDirective.prototype.setHiddenColumn = function (gridSetting) {
|
|
2209
|
+
var _this = this;
|
|
2210
|
+
if (this.gridColumns && gridSetting) {
|
|
2211
|
+
// filter out hidden == false array.
|
|
2212
|
+
var gridSettingHiddenCol = gridSetting.filter(function (item) {
|
|
2213
|
+
return item['hidden'] == true;
|
|
2214
|
+
});
|
|
2215
|
+
// find and set the hidden to current column setting.
|
|
2216
|
+
Object.values(gridSettingHiddenCol).forEach(function (value) {
|
|
2217
|
+
if (_this.gridColumns.find(function (c) { return c.field === value.field; })) {
|
|
2218
|
+
_this.gridColumns.find(function (c) { return c.field === value.field; })['hidden'] = value['hidden'];
|
|
2219
|
+
}
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2147
2223
|
ZGridBindingDirective.prototype.getDataBinding = function () {
|
|
2148
2224
|
var _this = this;
|
|
2149
2225
|
this.grid.loading = true;
|
|
@@ -2201,38 +2277,6 @@
|
|
|
2201
2277
|
ZGridBindingDirective.prototype.clearData = function () {
|
|
2202
2278
|
this.grid.data = { data: [], total: 0 };
|
|
2203
2279
|
};
|
|
2204
|
-
ZGridBindingDirective.prototype.getFilterParamsColumns = function () {
|
|
2205
|
-
var colFields = [];
|
|
2206
|
-
this.gridColumns.forEach(function (field) {
|
|
2207
|
-
if (field.valueExpr) {
|
|
2208
|
-
colFields.push(field.valueExpr + " as " + field.field);
|
|
2209
|
-
}
|
|
2210
|
-
else {
|
|
2211
|
-
colFields.push(field.field);
|
|
2212
|
-
}
|
|
2213
|
-
});
|
|
2214
|
-
if (colFields.length > 0) {
|
|
2215
|
-
if (colFields.indexOf("Id") === -1) {
|
|
2216
|
-
colFields.push("Id");
|
|
2217
|
-
}
|
|
2218
|
-
}
|
|
2219
|
-
var tmpGridColumn = [];
|
|
2220
|
-
tmpGridColumn.push(colFields.join(","));
|
|
2221
|
-
if (this.usableColumns.length > 0) {
|
|
2222
|
-
tmpGridColumn.push(this.usableColumns.join(","));
|
|
2223
|
-
}
|
|
2224
|
-
this.params.columns = tmpGridColumn.join(",");
|
|
2225
|
-
};
|
|
2226
|
-
ZGridBindingDirective.prototype.getFilterParams = function () {
|
|
2227
|
-
if (this.field['FilterParams']) {
|
|
2228
|
-
if (this.field['FilterParams'].indexOf("group.") !== -1) {
|
|
2229
|
-
this.params.filterParams = i3.ZComponentHelper.getGroupValue(this.field['FilterParams'], this.grp);
|
|
2230
|
-
}
|
|
2231
|
-
else {
|
|
2232
|
-
this.params.filterParams = this.field['FilterParams'];
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
};
|
|
2236
2280
|
ZGridBindingDirective.prototype.aggregateHandling = function (data) {
|
|
2237
2281
|
var aggregateColumns = this.gridColumns.filter(function (x) { return x.aggregateType; });
|
|
2238
2282
|
aggregateColumns.forEach(function (col) {
|
|
@@ -2273,38 +2317,6 @@
|
|
|
2273
2317
|
col.aggregateValue = 0;
|
|
2274
2318
|
});
|
|
2275
2319
|
};
|
|
2276
|
-
ZGridBindingDirective.prototype.getFilter = function () {
|
|
2277
|
-
var _this = this;
|
|
2278
|
-
if (this.params.filters && this.field.Filters) {
|
|
2279
|
-
this.params.filters = this.params.filters + " && " + this.field.Filters;
|
|
2280
|
-
}
|
|
2281
|
-
else if (!this.params.filters && this.field.Filters) {
|
|
2282
|
-
this.params.filters = this.field.Filters;
|
|
2283
|
-
}
|
|
2284
|
-
if (this.field.Filters && this.field.Filters.indexOf("group.") !== -1) {
|
|
2285
|
-
var filterKeyValPairs = this.field.Filters.split(" ");
|
|
2286
|
-
var grpValues = filterKeyValPairs.filter(function (element) { return element.trim().indexOf("group.") !== -1; });
|
|
2287
|
-
grpValues.forEach(function (val) {
|
|
2288
|
-
var actualVal = i3.ZComponentHelper.getGroupValue(val, _this.grp);
|
|
2289
|
-
_this.params.filters = _this.params.filters.replace(val, actualVal);
|
|
2290
|
-
});
|
|
2291
|
-
}
|
|
2292
|
-
};
|
|
2293
|
-
ZGridBindingDirective.prototype.getSorting = function () {
|
|
2294
|
-
if (this.field.SortOrder) {
|
|
2295
|
-
if (this.field.SortOrder.indexOf("group.") !== -1) {
|
|
2296
|
-
this.params.sortOrder = i3.ZComponentHelper.getGroupValue(this.field.SortOrder, this.grp);
|
|
2297
|
-
}
|
|
2298
|
-
else {
|
|
2299
|
-
this.params.sortOrder = this.field.SortOrder;
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
};
|
|
2303
|
-
ZGridBindingDirective.prototype.getGrantType = function () {
|
|
2304
|
-
if (this.field.GrantType) {
|
|
2305
|
-
this.params.grantType = i3.ZComponentHelper.getGroupValue(this.field.GrantType.toString(), this.grp);
|
|
2306
|
-
}
|
|
2307
|
-
};
|
|
2308
2320
|
ZGridBindingDirective.prototype.pageChange = function (event) {
|
|
2309
2321
|
this.params.pageNo = event.skip / this.params.pageSize;
|
|
2310
2322
|
this.state.skip = event.skip;
|
|
@@ -2421,21 +2433,6 @@
|
|
|
2421
2433
|
}
|
|
2422
2434
|
}
|
|
2423
2435
|
};
|
|
2424
|
-
ZGridBindingDirective.prototype.setHiddenColumn = function (gridSetting) {
|
|
2425
|
-
var _this = this;
|
|
2426
|
-
if (this.gridColumns && gridSetting) {
|
|
2427
|
-
// filter out hidden == false array.
|
|
2428
|
-
var gridSettingHiddenCol = gridSetting.filter(function (item) {
|
|
2429
|
-
return item['hidden'] == true;
|
|
2430
|
-
});
|
|
2431
|
-
// find and set the hidden to current column setting.
|
|
2432
|
-
Object.values(gridSettingHiddenCol).forEach(function (value) {
|
|
2433
|
-
if (_this.gridColumns.find(function (c) { return c.field === value.field; })) {
|
|
2434
|
-
_this.gridColumns.find(function (c) { return c.field === value.field; })['hidden'] = value['hidden'];
|
|
2435
|
-
}
|
|
2436
|
-
});
|
|
2437
|
-
}
|
|
2438
|
-
};
|
|
2439
2436
|
ZGridBindingDirective.prototype.beforeGridGetData = function (group, me) {
|
|
2440
2437
|
console.warn("beforeDataBinding triggered");
|
|
2441
2438
|
if (!group.beforeGridGetData) {
|
|
@@ -2445,61 +2442,49 @@
|
|
|
2445
2442
|
return group.beforeGridGetData(group, me);
|
|
2446
2443
|
};
|
|
2447
2444
|
ZGridBindingDirective.prototype.getGridSessionFilter = function (group, me) {
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2445
|
+
var _this = this;
|
|
2446
|
+
if (!group["GridStorageKey"]) {
|
|
2447
|
+
return rxjs.of([]);
|
|
2448
|
+
}
|
|
2449
|
+
var StorageKey = group["GridStorageKey"];
|
|
2450
|
+
if (this.storageService) {
|
|
2451
|
+
var subject_1 = new rxjs.Subject();
|
|
2452
|
+
rxjs.of(true)
|
|
2453
|
+
.pipe(operators.switchMap(function () {
|
|
2454
|
+
return _this.storageService.get(StorageKey);
|
|
2455
|
+
}), operators.tap(function (data) {
|
|
2456
|
+
if (!data || !data.value || data.value === "null") {
|
|
2457
|
+
subject_1.next();
|
|
2458
|
+
}
|
|
2459
|
+
else {
|
|
2460
|
+
var result = JSON.parse(data.value);
|
|
2461
|
+
_this.state.filter = JSON.parse(result["StateFilter"]);
|
|
2462
|
+
_this.params.filterParams = JSON.parse(result["FilterParams"]);
|
|
2463
|
+
_this.state.filter.filters.forEach(function (d) {
|
|
2464
|
+
if (d.field.includes('UTC')) {
|
|
2465
|
+
d.value = new Date(d.value);
|
|
2456
2466
|
}
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
return [4 /*yield*/, this.storageService.get(StorageKey)
|
|
2460
|
-
.then(function (data) {
|
|
2461
|
-
if (!data || !data.value || data.value === "null") {
|
|
2462
|
-
return null;
|
|
2463
|
-
}
|
|
2464
|
-
else {
|
|
2465
|
-
var result = JSON.parse(data.value);
|
|
2466
|
-
_this.state.filter = JSON.parse(result["StateFilter"]);
|
|
2467
|
-
_this.params.filterParams = JSON.parse(result["FilterParams"]);
|
|
2468
|
-
_this.state.filter.filters.forEach(function (d) {
|
|
2469
|
-
if (d.field.includes('UTC')) {
|
|
2470
|
-
d.value = new Date(d.value);
|
|
2471
|
-
}
|
|
2472
|
-
});
|
|
2473
|
-
return data;
|
|
2474
|
-
}
|
|
2475
|
-
})];
|
|
2476
|
-
case 1:
|
|
2477
|
-
_a.sent();
|
|
2478
|
-
return [3 /*break*/, 3];
|
|
2479
|
-
case 2: return [2 /*return*/, null];
|
|
2480
|
-
case 3: return [2 /*return*/];
|
|
2467
|
+
});
|
|
2468
|
+
subject_1.next();
|
|
2481
2469
|
}
|
|
2482
|
-
});
|
|
2483
|
-
|
|
2470
|
+
})).subscribe();
|
|
2471
|
+
return subject_1.asObservable();
|
|
2472
|
+
}
|
|
2473
|
+
else {
|
|
2474
|
+
return rxjs.of([]);
|
|
2475
|
+
}
|
|
2484
2476
|
};
|
|
2485
2477
|
ZGridBindingDirective.prototype.setGridSessionFilter = function (group, me) {
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
|
|
2497
|
-
//create session storage
|
|
2498
|
-
this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
|
|
2499
|
-
}
|
|
2500
|
-
return [2 /*return*/];
|
|
2501
|
-
});
|
|
2502
|
-
});
|
|
2478
|
+
if (!group["GridStorageKey"]) {
|
|
2479
|
+
return null;
|
|
2480
|
+
}
|
|
2481
|
+
var StorageKey = group["GridStorageKey"];
|
|
2482
|
+
if (me.state.filter && this.storageService && this.field['SaveFilter']) {
|
|
2483
|
+
//list of data for StateFilter and FilterParams
|
|
2484
|
+
var lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
|
|
2485
|
+
//create session storage
|
|
2486
|
+
this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
|
|
2487
|
+
}
|
|
2503
2488
|
};
|
|
2504
2489
|
return ZGridBindingDirective;
|
|
2505
2490
|
}(kendoAngularGrid.DataBindingDirective));
|
|
@@ -5575,17 +5560,20 @@
|
|
|
5575
5560
|
// Grid saved setting key(Used in CookieStore & LocalStorage)
|
|
5576
5561
|
this.gridStorageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
|
|
5577
5562
|
rxjs.of(true)
|
|
5578
|
-
.pipe(
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
}
|
|
5563
|
+
.pipe(
|
|
5564
|
+
//concatMap(() => {
|
|
5565
|
+
// // try get gridsetting from cookiestore
|
|
5566
|
+
// return this.mainService.cookieStoreGet(this.gridStorageKey, this.authService.e1Token.access_token);
|
|
5567
|
+
//}),
|
|
5568
|
+
//switchMap(savedGridCache => {
|
|
5569
|
+
// if (savedGridCache) {
|
|
5570
|
+
// // Keep the gridSetting from cookiestore to localStorage
|
|
5571
|
+
// this.zGridStatePersistingService.set(this.gridStorageKey, savedGridCache);
|
|
5572
|
+
// return of(true);
|
|
5573
|
+
// }
|
|
5574
|
+
// return of(false);
|
|
5575
|
+
//}),
|
|
5576
|
+
operators.switchMap(function () {
|
|
5589
5577
|
// Grid default setting
|
|
5590
5578
|
_this.columns = [];
|
|
5591
5579
|
_this.widthReduce = _this.data.WidthReduce || 60;
|
|
@@ -5640,7 +5628,6 @@
|
|
|
5640
5628
|
return rxjs.of(true);
|
|
5641
5629
|
}), operators.tap(function () {
|
|
5642
5630
|
_this.gridCallback(_this.group);
|
|
5643
|
-
return rxjs.of(true);
|
|
5644
5631
|
})).subscribe();
|
|
5645
5632
|
};
|
|
5646
5633
|
ZgridComponent.prototype.ngOnDestroy = function () {
|