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.
@@ -448,18 +448,12 @@ class ZComponentDebugService {
448
448
  // delete dataItem._DataValue;
449
449
  const initialModel = {
450
450
  Name: 'Name', DisplayName: 'Name', Value: 'Name', Type: 'text',
451
- enableHiding: true,
452
451
  gridColVisible: true,
453
452
  width: 150,
454
453
  minWidth: 100,
455
- cellFilter: "",
456
- filterCellFiltered: false,
457
454
  enableFiltering: true,
458
455
  enableSorting: true,
459
- enablePinning: true,
460
456
  pinnedLeft: false,
461
- pinnedRight: false,
462
- UpdateOnBlur: true,
463
457
  PlaceHolder: "Name",
464
458
  IsRequired: false,
465
459
  MinLength: 2,
@@ -469,7 +463,6 @@ class ZComponentDebugService {
469
463
  ReadOnly: false,
470
464
  ShowLabel: true,
471
465
  Visible: true,
472
- AppendDivClearFix: false,
473
466
  };
474
467
  const zmodel = {
475
468
  nodeModel: JSON.stringify(initialModel, null, 2)
@@ -2191,6 +2184,21 @@ ZGridBindingDirective.propDecorators = {
2191
2184
  zgridbinding: [{ type: Input }]
2192
2185
  };
2193
2186
 
2187
+ class ZGridPopupAnchorDirective {
2188
+ constructor(element) {
2189
+ this.element = element;
2190
+ }
2191
+ }
2192
+ ZGridPopupAnchorDirective.decorators = [
2193
+ { type: Directive, args: [{
2194
+ selector: '[popupAnchor]',
2195
+ exportAs: 'popupAnchor'
2196
+ },] }
2197
+ ];
2198
+ ZGridPopupAnchorDirective.ctorParameters = () => [
2199
+ { type: ElementRef }
2200
+ ];
2201
+
2194
2202
  /********** Angular **********/
2195
2203
  /********** Component & Service **********/
2196
2204
  class OpenOnFocusDirective {
@@ -2218,388 +2226,103 @@ OpenOnFocusDirective.propDecorators = {
2218
2226
  onBlur: [{ type: HostListener, args: ['blur',] }]
2219
2227
  };
2220
2228
 
2221
- class ZGridCalendarBindingDirective extends DataBindingDirective {
2222
- constructor(grid, webapiService, authService, storageService, zGridStatePersistingService) {
2223
- super(grid);
2224
- this.webapiService = webapiService;
2225
- this.authService = authService;
2226
- this.storageService = storageService;
2227
- this.zGridStatePersistingService = zGridStatePersistingService;
2228
- this.state = {
2229
- skip: 0,
2230
- take: 10,
2231
- };
2232
- this.gridColumns = [];
2233
- this.usableColumns = [];
2234
- this.resourceURL = null;
2235
- this.paginationApiPostUrl = null;
2236
- this.dataSource = null;
2237
- }
2238
- get field() {
2239
- return this.zgridcalendarbinding.data;
2240
- }
2241
- get grp() {
2242
- return this.zgridcalendarbinding.group;
2243
- }
2244
- get gridSubject() {
2245
- return this.zgridcalendarbinding.gridSubject;
2246
- }
2247
- get params() {
2248
- return this.zgridcalendarbinding.params;
2249
- }
2250
- get getData() {
2251
- return this.grid.data;
2252
- }
2253
- ngOnInit() {
2254
- if (this.field.SkipDirective) {
2255
- return;
2229
+ class DateParserFilter {
2230
+ transform(items) {
2231
+ // debugger;
2232
+ if (!items) {
2233
+ return items;
2256
2234
  }
2257
- super.ngOnInit();
2258
- this.grid.loading = true;
2259
- this.state.take = this.field.PageSize || 20;
2260
- this.pageSize = this.state.take;
2261
- this.dataSource = this.field.DataSource ? this.field.DataSource : null;
2262
- if (!this.dataSource) {
2263
- this.resourceURL = ZComponentHelper.getGroupValue(this.field.ResourceURL, this.grp);
2264
- if (!this.resourceURL) {
2265
- this.grid.loading = false;
2266
- if (this.zgridcalendarbinding.data.Name !== "ActivityLogGrid") {
2267
- console.warn("No initialise for Field.ResourceURL: ", this.field.ResourceURL);
2268
- }
2269
- return;
2270
- }
2271
- const array = this.resourceURL.split("/api/");
2272
- if (!!array[1]) {
2273
- array[1] = "Page" + array[1];
2274
- this.paginationApiPostUrl = array.join("/api/");
2275
- }
2276
- else {
2277
- const arr = this.resourceURL.split("/");
2278
- arr[arr.length - 2] = "Page" + arr[arr.length - 2];
2279
- this.paginationApiPostUrl = arr.join("/");
2280
- }
2235
+ // filter items array, items which match and return true will be
2236
+ // kept, false will be filtered out
2237
+ try {
2238
+ const d = new Date(items);
2239
+ return d;
2281
2240
  }
2282
- this.gridSubject.next(this);
2283
- this.generateGridColumns();
2284
- }
2285
- ngOnDestroy() {
2286
- if (this.serviceSubscription) {
2287
- this.serviceSubscription.unsubscribe();
2241
+ catch (error) {
2242
+ console.log("DateParserFilter error: ", error);
2243
+ return null;
2288
2244
  }
2289
- super.ngOnDestroy();
2290
- }
2291
- generateGridColumns() {
2292
- const columnFields$ = ZComponentHelper.getGroupValue(this.field.ColumnFields, this.grp);
2293
- columnFields$
2294
- .pipe(tap((data) => {
2295
- const gridSetting = this.getGridSettings();
2296
- const fieldName = this.field["FieldElementName"];
2297
- ZComponentHelper.getGridColumns(data, this.gridColumns, this.zgridcalendarbinding.group, this.authService, fieldName, gridSetting, this.usableColumns);
2298
- this.getFilterParamsColumns();
2299
- this.getGrantType();
2300
- this.setHiddenColumn(gridSetting);
2301
- }), switchMap(() => {
2302
- //Get Session
2303
- return this.getGridSessionFilter(this.grp, this);
2304
- }), switchMap(() => {
2305
- //Before get grid data
2306
- return this.beforeGridGetData(this.grp, this);
2307
- }))
2308
- .subscribe(() => {
2309
- this.getDataBinding();
2310
- });
2311
2245
  }
2312
- getDataBinding() {
2313
- this.grid.loading = true;
2314
- if (!this.dataSource) {
2315
- this.params.pageSize = this.state.take;
2316
- if (this.field.ExternalPagination) {
2317
- // For POST method Page WebAPI
2318
- this.webapiService
2319
- .postApi(this.paginationApiPostUrl, this.params, null, null, null, null, true)
2320
- .subscribe((data) => {
2321
- this.grid.data = { data: data.dataSet, total: data.totalCount };
2322
- this.grid.loading = false;
2323
- this.notifyDataChange();
2324
- });
2246
+ }
2247
+ DateParserFilter.decorators = [
2248
+ { type: Pipe, args: [{
2249
+ name: "dateParser",
2250
+ pure: true,
2251
+ },] }
2252
+ ];
2253
+
2254
+ /********** Angular **********/
2255
+ /********** Ionic **********/
2256
+ /********** Plugin **********/
2257
+ /********** Component & Service **********/
2258
+ class EditorFilter {
2259
+ transform(source) {
2260
+ if (!source) {
2261
+ return;
2262
+ }
2263
+ if (typeof source === "string") {
2264
+ try {
2265
+ const jsonValue = JSON.parse(source);
2266
+ return JSON.stringify(jsonValue, null, 2);
2267
+ // return this.safeStringify(jsonValue);
2325
2268
  }
2326
- else {
2327
- // For GET method
2328
- this.webapiService
2329
- .getApi(this.resourceURL, null, null, null, null, null, true)
2330
- .subscribe((data) => {
2331
- let _data = null;
2332
- let _totalCount = 0;
2333
- if (data.dataSet) {
2334
- _data = data.dataSet;
2335
- _totalCount = data.totalCount;
2336
- }
2337
- else {
2338
- _data = data;
2339
- _totalCount = data.length;
2340
- }
2341
- this.grid.data = { data: _data, total: _totalCount };
2342
- this.grid.pageSize = _totalCount;
2343
- this.grid.loading = false;
2344
- this.notifyDataChange();
2345
- });
2269
+ catch (_a) {
2270
+ return source;
2346
2271
  }
2347
2272
  }
2348
- else {
2349
- const ds = ZComponentHelper.getGroupValue(this.field.DataSource, this.grp);
2350
- if (ds) {
2351
- this.grid.data = {
2352
- data: ds,
2353
- total: ds.length,
2354
- };
2355
- this.grid.pageSize = ds.length;
2273
+ if (typeof source === "object" || Array.isArray(source)) {
2274
+ try {
2275
+ return JSON.stringify(source, null, 2);
2276
+ // return this.safeStringify(source);
2277
+ }
2278
+ catch (_b) {
2279
+ return "problem - [Circular structure to JSON]";
2356
2280
  }
2357
- this.grid.loading = false;
2358
2281
  }
2359
2282
  }
2360
- clearData() {
2361
- this.grid.data = { data: [], total: 0 };
2362
- }
2363
- getFilterParamsColumns() {
2364
- const colFields = [];
2365
- this.gridColumns.forEach((field) => {
2366
- if (field.valueExpr) {
2367
- colFields.push(field.valueExpr + " as " + field.field);
2368
- }
2369
- else {
2370
- colFields.push(field.field);
2371
- }
2372
- });
2373
- if (colFields.length > 0) {
2374
- if (colFields.indexOf("Id") === -1) {
2375
- colFields.push("Id");
2283
+ safeStringify(jsonValue) {
2284
+ // Note: cache should not be re-used by repeated calls to JSON.stringify.
2285
+ const cache = [];
2286
+ return JSON.stringify(jsonValue, (key, value) => {
2287
+ if (typeof value === 'object' && value !== null) {
2288
+ // Duplicate reference found, discard key
2289
+ if (cache.includes(value)) {
2290
+ // debugger;
2291
+ // return "problem - [Circular structure to JSON]";
2292
+ return;
2293
+ }
2294
+ // Store value in our collection
2295
+ cache.push(value);
2376
2296
  }
2297
+ return value;
2298
+ }, 2);
2299
+ // cache = null; // Enable garbage collection
2300
+ }
2301
+ }
2302
+ EditorFilter.decorators = [
2303
+ { type: Pipe, args: [{
2304
+ name: 'editorfilter',
2305
+ pure: false
2306
+ },] }
2307
+ ];
2308
+
2309
+ class DivzLayout {
2310
+ transform(items, zlayout) {
2311
+ if (!items || !zlayout) {
2312
+ return items;
2377
2313
  }
2378
- let tmpGridColumn = [];
2379
- tmpGridColumn.push(colFields.join(","));
2380
- if (this.usableColumns.length > 0) {
2381
- tmpGridColumn.push(this.usableColumns.join(","));
2314
+ // if got zlayout, in div: 2 = 2 col per row; 3 = 1 col per row;
2315
+ if (zlayout == "2") {
2316
+ Object.values(items).forEach(value => {
2317
+ value['DivClass'] = "col-sm-6";
2318
+ });
2382
2319
  }
2383
- this.params.columns = tmpGridColumn.join(",");
2384
- }
2385
- getGrantType() {
2386
- if (this.field.GrantType) {
2387
- this.params.grantType = ZComponentHelper.getGroupValue(this.field.GrantType.toString(), this.grp);
2320
+ else if (zlayout == '3') {
2321
+ Object.values(items).forEach(value => {
2322
+ value['DivClass'] = "col-sm-12";
2323
+ });
2388
2324
  }
2389
- }
2390
- dataStateChange(state) {
2391
- // this.state = state;
2392
- this.skip = state.skip;
2393
- this.pageSize = state.take;
2394
- this.state.skip = state.skip;
2395
- this.state.take = state.take;
2396
- this.grid.loading = true;
2397
- }
2398
- mapFilterOperator(operator) {
2399
- switch (operator) {
2400
- case "eq":
2401
- return "eq";
2402
- case "neq":
2403
- return "neq";
2404
- case "lt":
2405
- return "lt";
2406
- case "lte":
2407
- return "lte";
2408
- case "gt":
2409
- return "gt";
2410
- case "gte":
2411
- return "gte";
2412
- case "startswith":
2413
- return "startswith";
2414
- case "endswith":
2415
- return "endswith";
2416
- case "isnull":
2417
- return "isnull";
2418
- case "isnotnull":
2419
- return "isnotnull";
2420
- default:
2421
- return "==";
2422
- // eq, neq, isnull, isnotnull, endswith, startswith
2423
- }
2424
- }
2425
- getGridSettings() {
2426
- const _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
2427
- const _gridName = this.field.Name + '::' + this.field.Value;
2428
- // Find any setting from localstorage..
2429
- let _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
2430
- if (_arrGridCaching && _arrGridCaching[0]) {
2431
- const _gridCaching = _arrGridCaching.find(x => x['dataFormFields'] === _gridName);
2432
- if (_gridCaching) {
2433
- return _gridCaching.gridSettings.columnsConfig.sort((a, b) => a.orderIndex - b.orderIndex);
2434
- }
2435
- }
2436
- }
2437
- setHiddenColumn(gridSetting) {
2438
- if (this.gridColumns && gridSetting) {
2439
- // filter out hidden == false array.
2440
- const gridSettingHiddenCol = gridSetting.filter(function (item) {
2441
- return item['hidden'] == true;
2442
- });
2443
- // find and set the hidden to current column setting.
2444
- Object.values(gridSettingHiddenCol).forEach(value => {
2445
- if (this.gridColumns.find((c) => c.field === value.field)) {
2446
- this.gridColumns.find((c) => c.field === value.field)['hidden'] = value['hidden'];
2447
- }
2448
- });
2449
- }
2450
- }
2451
- beforeGridGetData(group, me) {
2452
- console.warn("beforeDataBinding triggered");
2453
- if (!group.beforeGridGetData) {
2454
- console.warn("group.beforeDataBinding is undefined");
2455
- return of(true);
2456
- }
2457
- return group.beforeGridGetData(group, me);
2458
- }
2459
- getGridSessionFilter(group, me) {
2460
- return __awaiter(this, void 0, void 0, function* () {
2461
- if (!group["GridStorageKey"]) {
2462
- return null;
2463
- }
2464
- const StorageKey = group["GridStorageKey"];
2465
- if (this.storageService) {
2466
- yield this.storageService.get(StorageKey)
2467
- .then(data => {
2468
- if (!data || !data.value || data.value === "null") {
2469
- return null;
2470
- }
2471
- else {
2472
- const result = JSON.parse(data.value);
2473
- this.state.filter = JSON.parse(result["StateFilter"]);
2474
- this.params.filterParams = JSON.parse(result["FilterParams"]);
2475
- this.state.filter.filters.forEach((d) => {
2476
- if (d.field.includes('UTC')) {
2477
- d.value = new Date(d.value);
2478
- }
2479
- });
2480
- return data;
2481
- }
2482
- });
2483
- }
2484
- else {
2485
- return null;
2486
- }
2487
- });
2488
- }
2489
- }
2490
- ZGridCalendarBindingDirective.decorators = [
2491
- { type: Directive, args: [{
2492
- selector: "[zgridcalendarbinding]",
2493
- },] }
2494
- ];
2495
- ZGridCalendarBindingDirective.ctorParameters = () => [
2496
- { type: undefined, decorators: [{ type: Inject, args: [GridComponent,] }] },
2497
- { type: WebApiService },
2498
- { type: AuthService },
2499
- { type: StorageSessionService },
2500
- { type: ZGridStatePersistingService }
2501
- ];
2502
- ZGridCalendarBindingDirective.propDecorators = {
2503
- zgridcalendarbinding: [{ type: Input }]
2504
- };
2505
-
2506
- class DateParserFilter {
2507
- transform(items) {
2508
- // debugger;
2509
- if (!items) {
2510
- return items;
2511
- }
2512
- // filter items array, items which match and return true will be
2513
- // kept, false will be filtered out
2514
- try {
2515
- const d = new Date(items);
2516
- return d;
2517
- }
2518
- catch (error) {
2519
- console.log("DateParserFilter error: ", error);
2520
- return null;
2521
- }
2522
- }
2523
- }
2524
- DateParserFilter.decorators = [
2525
- { type: Pipe, args: [{
2526
- name: "dateParser",
2527
- pure: true,
2528
- },] }
2529
- ];
2530
-
2531
- /********** Angular **********/
2532
- /********** Ionic **********/
2533
- /********** Plugin **********/
2534
- /********** Component & Service **********/
2535
- class EditorFilter {
2536
- transform(source) {
2537
- if (!source) {
2538
- return;
2539
- }
2540
- if (typeof source === "string") {
2541
- try {
2542
- const jsonValue = JSON.parse(source);
2543
- return JSON.stringify(jsonValue, null, 2);
2544
- // return this.safeStringify(jsonValue);
2545
- }
2546
- catch (_a) {
2547
- return source;
2548
- }
2549
- }
2550
- if (typeof source === "object" || Array.isArray(source)) {
2551
- try {
2552
- return JSON.stringify(source, null, 2);
2553
- // return this.safeStringify(source);
2554
- }
2555
- catch (_b) {
2556
- return "problem - [Circular structure to JSON]";
2557
- }
2558
- }
2559
- }
2560
- safeStringify(jsonValue) {
2561
- // Note: cache should not be re-used by repeated calls to JSON.stringify.
2562
- const cache = [];
2563
- return JSON.stringify(jsonValue, (key, value) => {
2564
- if (typeof value === 'object' && value !== null) {
2565
- // Duplicate reference found, discard key
2566
- if (cache.includes(value)) {
2567
- // debugger;
2568
- // return "problem - [Circular structure to JSON]";
2569
- return;
2570
- }
2571
- // Store value in our collection
2572
- cache.push(value);
2573
- }
2574
- return value;
2575
- }, 2);
2576
- // cache = null; // Enable garbage collection
2577
- }
2578
- }
2579
- EditorFilter.decorators = [
2580
- { type: Pipe, args: [{
2581
- name: 'editorfilter',
2582
- pure: false
2583
- },] }
2584
- ];
2585
-
2586
- class DivzLayout {
2587
- transform(items, zlayout) {
2588
- if (!items || !zlayout) {
2589
- return items;
2590
- }
2591
- // if got zlayout, in div: 2 = 2 col per row; 3 = 1 col per row;
2592
- if (zlayout == "2") {
2593
- Object.values(items).forEach(value => {
2594
- value['DivClass'] = "col-sm-6";
2595
- });
2596
- }
2597
- else if (zlayout == '3') {
2598
- Object.values(items).forEach(value => {
2599
- value['DivClass'] = "col-sm-12";
2600
- });
2601
- }
2602
- return items;
2325
+ return items;
2603
2326
  }
2604
2327
  }
2605
2328
  DivzLayout.decorators = [
@@ -5168,12 +4891,16 @@ class ZgridComponent {
5168
4891
  };
5169
4892
  this.gridSubject = new Subject();
5170
4893
  this.gridDefaultStateExist = false;
4894
+ this.isNew = true;
5171
4895
  this.setData = (gData) => {
5172
4896
  this.gridData = {
5173
4897
  data: gData,
5174
4898
  total: (gData ? gData.length : 0)
5175
4899
  };
5176
4900
  this.gData = gData;
4901
+ if (this.zgrid) {
4902
+ this.zgrid.grid['pageSize'] = gData.length; // set grid size
4903
+ }
5177
4904
  if (!!this.data.ShowRecordNumber) {
5178
4905
  if (this.gridData.data) {
5179
4906
  this.gridData.data.forEach((d, i) => {
@@ -5230,6 +4957,7 @@ class ZgridComponent {
5230
4957
  this.heightReduce = this.data.HeightReduce || 560;
5231
4958
  this._state.take = this.data.PageSize || 20;
5232
4959
  this.pageSizes = [20, 50, 100, 200, 500];
4960
+ this.previousNext = this.data['EnablePreviousNextButton'] || false;
5233
4961
  // [Mobile] Disable PageSize
5234
4962
  if (this.data.PageSizes === false || ZComponentHelper.isMobileScreen()) {
5235
4963
  this.pageSizes = false;
@@ -5320,10 +5048,8 @@ class ZgridComponent {
5320
5048
  return true;
5321
5049
  }
5322
5050
  locked(colSetting) {
5323
- if (colSetting['enablePinning'] == true) {
5324
- if (colSetting['pinnedLeft'] == true) {
5325
- return true;
5326
- }
5051
+ if (colSetting['pinnedLeft'] == true) {
5052
+ return true;
5327
5053
  }
5328
5054
  return false;
5329
5055
  }
@@ -5438,7 +5164,13 @@ class ZgridComponent {
5438
5164
  }
5439
5165
  getFormControl(rowIndex, property) {
5440
5166
  const formArray = this.inlineEditedFormGroups.get('items');
5441
- return formArray.at(rowIndex).get(property);
5167
+ const formItem = formArray.at(rowIndex);
5168
+ if (formItem) {
5169
+ return formItem.get(property);
5170
+ }
5171
+ else {
5172
+ return null;
5173
+ }
5442
5174
  }
5443
5175
  createFormControls() {
5444
5176
  if (this.columns) {
@@ -5447,14 +5179,16 @@ class ZgridComponent {
5447
5179
  return;
5448
5180
  }
5449
5181
  this.inlineEditedFormGroups = new FormGroup({ items: new FormArray([]) });
5450
- this.gridData.data.forEach(d => {
5451
- const items = {};
5452
- this.columns.forEach(c => {
5453
- items[c.field] = new FormControl(d[c.field]);
5182
+ if (Array.isArray(this.gridData.data)) {
5183
+ this.gridData.data.forEach(d => {
5184
+ const items = {};
5185
+ this.columns.forEach(c => {
5186
+ items[c.field] = new FormControl(d[c.field]);
5187
+ });
5188
+ const formGroup = new FormGroup(items);
5189
+ this.inlineEditedFormGroups.get("items").push(formGroup);
5454
5190
  });
5455
- const formGroup = new FormGroup(items);
5456
- this.inlineEditedFormGroups.get("items").push(formGroup);
5457
- });
5191
+ }
5458
5192
  }
5459
5193
  }
5460
5194
  createFormGroup(dataItem, fieldName) {
@@ -5469,8 +5203,9 @@ class ZgridComponent {
5469
5203
  this.onNavigateTo(event, colSetting, rowData, cellData);
5470
5204
  }
5471
5205
  cellClickHandler(event) {
5472
- const disableCellClickHandler = this.data.DisableCellClickHandler ? this.data.DisableCellClickHandler : false;
5473
- if (!disableCellClickHandler) {
5206
+ const disableAllColumnCellClickHandler = this.data.DisableCellClickHandler ? this.data.DisableCellClickHandler : false;
5207
+ const isCommandColumn = event.column.constructor.name == 'CommandColumnComponent' ? true : false;
5208
+ if (!disableAllColumnCellClickHandler && !isCommandColumn) {
5474
5209
  const inCellEditable = this.data.InCellEditable ? this.data.InCellEditable : false;
5475
5210
  if (inCellEditable) {
5476
5211
  this.editableColumns = this.columns.filter(s => s.isEditableInDataItem === true);
@@ -5519,8 +5254,13 @@ class ZgridComponent {
5519
5254
  }
5520
5255
  showTooltip(e) {
5521
5256
  const element = e.target;
5522
- if ((element.nodeName === 'TD' || element.nodeName === 'TH') &&
5523
- element.offsetWidth < element.scrollWidth) {
5257
+ let isCommandColumn = false;
5258
+ element.classList.forEach(data => {
5259
+ if (data == 'k-command-cell') {
5260
+ isCommandColumn = true;
5261
+ }
5262
+ });
5263
+ if (((element.nodeName === 'TD' || element.nodeName === 'TH') && element.offsetWidth < element.scrollWidth) && !isCommandColumn) {
5524
5264
  this.tooltipDir.toggle(element);
5525
5265
  }
5526
5266
  else {
@@ -5555,697 +5295,21 @@ class ZgridComponent {
5555
5295
  clearData() {
5556
5296
  this.zgrid.clearData();
5557
5297
  }
5558
- allResults() {
5559
- const _zgridControl = this.zgrid;
5560
- const _zgridComponent = this.zgrid.grid;
5561
- const _data = _zgridComponent.data;
5562
- const paginationApiPostUrl = _zgridControl.paginationApiPostUrl;
5563
- // Need to clone, if not will affect the grid params.
5564
- const params = Object.assign({}, this.params);
5565
- params.pageNo = 0;
5566
- params.pageSize = _data.total;
5567
- return this.webApiService.httpPost$(paginationApiPostUrl, params).pipe(map((data) => {
5568
- const result = {
5569
- data: process(data.dataSet, {}).data
5570
- };
5571
- return result;
5572
- }));
5573
- }
5574
- getClass(dataItem, col) {
5575
- let ngClass = "gridCell ";
5576
- if (col.fieldType === 'number' || col.fieldType === 'currency' || col.fieldType === 'znumeric') {
5577
- ngClass += "rightAligned ";
5578
- }
5579
- if (dataItem[col.field + '_Class']) {
5580
- ngClass += dataItem[col.field + '_Class'] + " ";
5581
- }
5582
- if (col.Class) {
5583
- ngClass += col.Class + " ";
5584
- }
5585
- return ngClass;
5586
- }
5587
- getFormat(col, defaultFormat) {
5588
- let format = "";
5589
- if (col.FormatOptions === undefined) {
5590
- format = defaultFormat ? defaultFormat : "";
5591
- }
5592
- else {
5593
- const formatArr = col.FormatOptions.split(".");
5594
- let dp = 0;
5595
- if (formatArr.length > 1) {
5596
- dp = formatArr[1].length;
5597
- }
5598
- if (dp !== 0) {
5599
- format = "1." + dp + "-" + dp;
5600
- }
5601
- }
5602
- return format;
5603
- }
5604
- setHeaderText(columnName, newHeaderTitle) {
5605
- const gridColumns = this.columns;
5606
- gridColumns.forEach((col) => {
5607
- if (col.Name === columnName) {
5608
- col.title = newHeaderTitle;
5609
- }
5610
- });
5611
- }
5612
- setGridIsLoading(triggered) {
5613
- this.isLoading = triggered;
5614
- }
5615
- setGridSessionKey(group) {
5616
- if (group["GridStorageKey"]) {
5617
- return;
5618
- }
5619
- else {
5620
- group["GridStorageKey"] = 'zgrid_' + group.resourceURL + '_' + this.data.Value + '::' + this.authService.e1Token.userName;
5621
- }
5622
- }
5623
- trackBy(index, item) {
5624
- //console.log(item.data['Id'] || index);
5625
- return index;
5626
- }
5627
- /* Grid configuration function */
5628
- saveGridSettings() {
5629
- const _zgridComponent = this.zgrid.grid;
5630
- const _columns = _zgridComponent.columns;
5631
- of(this.columns)
5632
- .pipe(switchMap(() => {
5633
- const configValue = _columns.toArray().map(item => {
5634
- const _zGridColumnSettings = Object.keys(item)
5635
- .filter(propName => {
5636
- return !propName.toLowerCase().includes('template');
5637
- })
5638
- .reduce((acc, curr) => (Object.assign(Object.assign({}, acc), { [curr]: item[curr] })), {});
5639
- return _zGridColumnSettings;
5640
- });
5641
- // remove extra element form array
5642
- configValue.forEach(item => {
5643
- delete item['headerStyle'];
5644
- delete item['__ngContext__'];
5645
- });
5646
- const gridSetting = {
5647
- // state: this.state,
5648
- columnsConfig: configValue
5649
- };
5650
- // Find any setting from localstorage and update, if not just add in.
5651
- let _arrGridCaching = this.zGridStatePersistingService.get(this.gridStorageKey);
5652
- let _gridConfig = null;
5653
- if (_arrGridCaching && _arrGridCaching[0]) {
5654
- _gridConfig = _arrGridCaching.find(x => x['dataFormFields'] === this.gridStorageKey);
5655
- if (_gridConfig) {
5656
- _gridConfig.gridSettings = gridSetting;
5657
- }
5658
- }
5659
- else {
5660
- _arrGridCaching = [];
5661
- }
5662
- if (!_gridConfig) {
5663
- _gridConfig = {
5664
- dataFormFields: this.gridStorageKey,
5665
- gridSettings: gridSetting
5666
- };
5667
- _arrGridCaching.push(_gridConfig);
5668
- }
5669
- return _arrGridCaching;
5670
- }), concatMap(gridCache => {
5671
- // Save grid caching to localstorage
5672
- this.zGridStatePersistingService.set(this.gridStorageKey, gridCache);
5673
- // Save to CookieStore
5674
- return this.mainService.cookieStorePost(this.gridStorageKey, gridCache);
5675
- }), tap(savedGridCache => {
5676
- // check is saved state exist to enable/hide restore button
5677
- this.stateExist();
5678
- }), tap(() => {
5679
- // Alert
5680
- this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
5681
- })).subscribe();
5682
- }
5683
- restoreGridSettings() {
5684
- of(true)
5685
- .pipe(switchMap(() => {
5686
- // Clear localstorage grid setting
5687
- this.zGridStatePersistingService.remove(this.gridStorageKey);
5688
- return of(true);
5689
- }), switchMap(() => {
5690
- // delete cookiestore gridSetting by storagekey as name
5691
- return this.mainService.cookieStoreDeleteMultiple(this.gridStorageKey);
5692
- }), concatMap(() => {
5693
- // Use original column setting
5694
- return this.generateGridColumns();
5695
- }), tap(() => {
5696
- // check is saved state exist
5697
- this.stateExist();
5698
- // Alert
5699
- this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
5700
- })).subscribe();
5701
- }
5702
- getGridSettings() {
5703
- const _storageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
5704
- // Find any setting from localstorage..
5705
- let _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
5706
- if (_arrGridCaching) {
5707
- const _gridCaching = JSON.parse(_arrGridCaching['Value']);
5708
- if (_gridCaching) {
5709
- return _gridCaching.gridSettings.columnsConfig.sort((a, b) => a.orderIndex - b.orderIndex);
5710
- }
5711
- }
5712
- }
5713
- /* Inline setting */
5714
- getInlineField(value) {
5715
- return this.columns.find(x => x.Value === value);
5716
- }
5717
- getInlineForm(rowIndex) {
5718
- const formArray = this.inlineEditedFormGroups.get('items');
5719
- return formArray.at(rowIndex);
5720
- }
5721
- getFormControlData(value) {
5722
- return this.inlineEditedFormGroups.value.items;
5723
- }
5724
- /* Event */
5725
- beforeGridGetData(group, me) {
5726
- console.warn("beforeDataBinding triggered");
5727
- if (!group.beforeGridGetData) {
5728
- console.warn("group.beforeDataBinding is undefined");
5729
- return of(true);
5730
- }
5731
- return group.beforeGridGetData(group, me);
5732
- }
5733
- getGridSessionFilter(group, me) {
5734
- return __awaiter(this, void 0, void 0, function* () {
5735
- if (!group["GridStorageKey"]) {
5736
- return null;
5737
- }
5738
- const StorageKey = group["GridStorageKey"];
5739
- if (this.storageService) {
5740
- yield this.storageService.get(StorageKey)
5741
- .then(data => {
5742
- if (!data || !data.value || data.value === "null") {
5743
- return null;
5744
- }
5745
- else {
5746
- const result = JSON.parse(data.value);
5747
- this.state.filter = JSON.parse(result["StateFilter"]);
5748
- this.params.filterParams = JSON.parse(result["FilterParams"]);
5749
- this.state.filter.filters.forEach((stateFilter) => {
5750
- if (stateFilter.field.includes('UTC')) {
5751
- stateFilter.value = new Date(stateFilter.value);
5752
- }
5753
- });
5754
- return data;
5755
- }
5756
- });
5757
- }
5758
- else {
5759
- return null;
5760
- }
5761
- });
5762
- }
5763
- setGridSessionFilter(group, me) {
5764
- if (!group["GridStorageKey"]) {
5765
- return null;
5766
- }
5767
- const StorageKey = group["GridStorageKey"];
5768
- let lstGridFilter = {};
5769
- if (me.state.filter && this.storageService && this.data['SaveFilter']) {
5770
- //list of data for StateFilter and FilterParams
5771
- lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
5772
- //create session storage
5773
- this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
5774
- }
5775
- }
5776
- /* onchange Events */
5777
- filterChange(event) {
5778
- if (this.zgrid) {
5779
- this.zgrid.filterChange(event);
5780
- }
5781
- }
5782
- pageChange(event) {
5783
- if (this.zgrid) {
5784
- this.zgrid.pageChange(event);
5785
- }
5786
- }
5787
- sortChange(sort) {
5788
- if (this.zgrid) {
5789
- this.zgrid.sortChange(sort);
5790
- }
5791
- }
5792
- inCellCheckBoxOnChange(event, rowIndex, column) {
5793
- const isChecked = event.detail.checked;
5794
- this.gData[rowIndex][column.Value] = isChecked;
5795
- }
5796
- columnsOrderChanged(event) {
5797
- const _zgridControl = this.zgrid;
5798
- const _zgridComponent = this.zgrid.grid;
5799
- const _data = _zgridComponent.data;
5800
- if (this.zgrid) {
5801
- const _zgrid = this.zgrid;
5802
- }
5803
- }
5804
- }
5805
- ZgridComponent.decorators = [
5806
- { type: Component, args: [{
5807
- selector: "app-zgrid",
5808
- 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>&nbsp;Refresh</button>\r\n <button type=\"button\" kendoGridExcelCommand *ngIf=\"data.AllowExport\"><span class=\"k-icon k-i-file-excel\"></span>&nbsp;Export Data to Excel</button>\r\n <button class=\"k-button\" (click)=\"saveGridSettings()\" *ngIf=\"data.AllowSaveState\"><span class=\"k-icon k-i-star\"></span>&nbsp;Save Setting</button>\r\n <button class=\"k-button\" (click)=\"restoreGridSettings()\" *ngIf=\"gridDefaultStateExist\"><span class=\"k-icon k-i-star-outline\"></span>&nbsp;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",
5809
- 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}"]
5810
- },] }
5811
- ];
5812
- ZgridComponent.ctorParameters = () => [
5813
- { type: ActivatedRoute },
5814
- { type: Router },
5815
- { type: FormBuilder },
5816
- { type: AuthService },
5817
- { type: WebApiService },
5818
- { type: ZGridStatePersistingService },
5819
- { type: ToastService },
5820
- { type: ZCoreService },
5821
- { type: StorageSessionService },
5822
- { type: MainService }
5823
- ];
5824
- ZgridComponent.propDecorators = {
5825
- data: [{ type: Input }],
5826
- group: [{ type: Input }],
5827
- form: [{ type: Input }],
5828
- tooltipDir: [{ type: ViewChild, args: [TooltipDirective,] }]
5829
- };
5830
-
5831
- /********** Angular **********/
5832
- class ZgridcalendarComponent {
5833
- constructor(activatedRoute, router, formBuilder, authService, webApiService, zGridStatePersistingService, toastService, zcoreService) {
5834
- this.activatedRoute = activatedRoute;
5835
- this.router = router;
5836
- this.formBuilder = formBuilder;
5837
- this.authService = authService;
5838
- this.webApiService = webApiService;
5839
- this.zGridStatePersistingService = zGridStatePersistingService;
5840
- this.toastService = toastService;
5841
- this.zcoreService = zcoreService;
5842
- this.zgrid = null;
5843
- this.oauthUrl = null;
5844
- this.mySelection = [];
5845
- this.componentProperties = new ZComponentProperties();
5846
- // eslint-disable-next-line @typescript-eslint/naming-convention, no-underscore-dangle, id-blacklist, id-match
5847
- this._state = {
5848
- skip: 0,
5849
- take: 10
5850
- };
5851
- this.params = {
5852
- referId: null,
5853
- pageNo: 0,
5854
- pageSize: 20,
5855
- sortColumnName: "",
5856
- sortOrder: "",
5857
- sortColumnNames: [],
5858
- sortOrders: [],
5859
- filterParams: [],
5860
- parameters: "",
5861
- filters: "",
5862
- columns: "",
5863
- grantType: 4
5864
- };
5865
- this.gridSubject = new Subject();
5866
- this.setEnable = (status) => {
5867
- this.componentProperties.isReadOnly = !status;
5868
- };
5869
- this.setVisible = (status) => {
5870
- this.componentProperties.isVisible = status;
5871
- this.data.Visible = status;
5872
- };
5873
- this.setRequire = (status) => {
5874
- this.componentProperties.isRequired = status;
5875
- ZComponentHelper.changeValidator(status, this.group, this.data.Value, this.componentProperties, Validators.required);
5876
- };
5877
- this.setData = (gData) => {
5878
- this.gridData = {
5879
- data: gData,
5880
- total: (gData ? gData.length : 0)
5881
- };
5882
- this.gData = gData;
5883
- if (!!this.data.ShowRecordNumber) {
5884
- if (this.gridData.data) {
5885
- this.gridData.data.forEach((d, i) => {
5886
- d.GridNo = i + 1;
5887
- });
5888
- }
5889
- }
5890
- this.createFormControls();
5891
- };
5892
- this.oauthUrl = this.zcoreService.getEnvironment().e1OauthUrl + "/";
5893
- this.allResults = this.allResults.bind(this);
5894
- this.refreshData = this.refreshData.bind(this);
5895
- this.clearData = this.clearData.bind(this);
5896
- this.saveGridSettings = this.saveGridSettings.bind(this);
5897
- this.restoreGridSettings = this.restoreGridSettings.bind(this);
5898
- }
5899
- ngOnInit() {
5900
- ZComponentHelper.setComponentProperties(this);
5901
- ZComponentHelper.registerComponent(this);
5902
- this.columns = [];
5903
- this.widthReduce = this.data.WidthReduce || 60;
5904
- this.heightReduce = this.data.HeightReduce || 560;
5905
- this._state.take = this.data.PageSize || 20;
5906
- this.pageSizes = [20, 50, 100, 200, 500];
5907
- if (this.data.PageSizes === false || ZComponentHelper.isMobileScreen()) {
5908
- this.pageSizes = false;
5909
- }
5910
- if (this.data.SelectOptions) {
5911
- this.selectableSettings = {
5912
- // checkboxOnly: this.checkboxOnly,
5913
- mode: this.data.SelectOptions === 'single' ? 'single' : 'multiple'
5914
- };
5915
- }
5916
- if (this.data.Value.startsWith('group.')) {
5917
- const v = this.data.Value.slice(6);
5918
- this.group[v] = this;
5919
- }
5920
- if (this.subscription) {
5921
- this.subscription.unsubscribe();
5922
- }
5923
- if (!this.data.ResourceURL) {
5924
- this.generateGridColumns().subscribe(() => {
5925
- if (this.data.DataSource && this.data.SkipDirective) {
5926
- const ds = ZComponentHelper.getGroupValue(this.data.DataSource, this.group);
5927
- this.setData(ds);
5928
- }
5929
- });
5930
- }
5931
- this.subscription = this.gridSubject.subscribe(grid => {
5932
- this.zgrid = grid;
5933
- this._state = this.zgrid.state;
5934
- this.columns = this.zgrid.gridColumns;
5935
- if (this.zgrid && this.zgrid.grid.data) {
5936
- this.gridData = Object.assign({}, this.zgrid.grid.data);
5937
- this.createFormControls();
5938
- }
5939
- });
5940
- //Set Filter SessionKey
5941
- if (this.data['SaveFilter']) {
5942
- this.setGridSessionKey(this.group);
5943
- }
5944
- }
5945
- ngOnDestroy() {
5946
- if (this.subscription) {
5947
- this.subscription.unsubscribe();
5948
- }
5949
- }
5950
- getGridStyle() {
5951
- return {
5952
- "height.px": this.getGridHeight(),
5953
- "width.px": window.innerWidth - this.widthReduce
5954
- };
5955
- }
5956
- isSelectOption() {
5957
- let v = false;
5958
- if (this.data.SelectOptions) {
5959
- this.selectableSettings = {
5960
- checkboxOnly: false,
5961
- mode: (this.data.SelectOptions == "multiple") ? "multiple" : "single"
5962
- };
5963
- v = true;
5964
- }
5965
- return v;
5966
- }
5967
- getGridHeight() {
5968
- const h = window.innerHeight - this.heightReduce;
5969
- return (h < 250) ? 250 : h;
5970
- }
5971
- getData() {
5972
- if (this.zgrid) {
5973
- this.zgrid.getDataBinding();
5974
- }
5975
- if (this.data.SkipDirective) {
5976
- this.gridData = process(this.gData, this.state);
5977
- this.createFormControls();
5978
- }
5979
- }
5980
- getGridData() {
5981
- return this.gData;
5982
- }
5983
- getFormControl(rowIndex, property) {
5984
- const formArray = this.inlineEditedFormGroups.get('items');
5985
- return formArray.at(rowIndex).get(property);
5986
- }
5987
- createFormControls() {
5988
- // only create if there is at least 1 editable column
5989
- if (this.columns.find(c => c.isEditableInGrid) === undefined) {
5990
- return;
5991
- }
5992
- this.inlineEditedFormGroups = new FormGroup({ items: new FormArray([]) });
5993
- this.gridData.data.forEach(d => {
5994
- const items = {};
5995
- this.columns.forEach(c => {
5996
- items[c.field] = new FormControl(d[c.field]);
5997
- });
5998
- const formGroup = new FormGroup(items);
5999
- this.inlineEditedFormGroups.get("items").push(formGroup);
6000
- });
6001
- }
6002
- get state() {
6003
- return this._state;
6004
- }
6005
- dataStateChange(state) {
6006
- if (this.zgrid) {
6007
- this.zgrid.dataStateChange(state);
6008
- }
6009
- else {
6010
- this.gridData = process(this.gData, state);
6011
- this.createFormControls();
6012
- }
6013
- }
6014
- filterChange(event) {
6015
- if (this.zgrid) {
6016
- this.zgrid.filterChange(event);
6017
- }
6018
- }
6019
- getGroupValue(value, group) {
6020
- return ZComponentHelper.getGroupValue(this.data.Value, this.group);
6021
- }
6022
- onBtnClick(event, colSetting, rowData, cellData) {
6023
- this.onNavigateTo(event, colSetting, rowData, cellData);
6024
- }
6025
- cellClickHandler(event) {
6026
- const disableCellClickHandler = this.data.DisableCellClickHandler ? this.data.DisableCellClickHandler : false;
6027
- if (!disableCellClickHandler) {
6028
- const inCellEditable = this.data.InCellEditable ? this.data.InCellEditable : false;
6029
- if (inCellEditable) {
6030
- this.editableColumns = this.columns.filter(s => s.isEditableInDataItem === true);
6031
- if (!!this.editableColumns) {
6032
- this.editableColumns.map(s => event.sender.editCell(event.rowIndex, event.columnIndex, this.createFormGroup(event.dataItem, s.field)));
6033
- }
6034
- }
6035
- else {
6036
- console.log("cellClick event: ", event);
6037
- if (this.data.OnItemClick) {
6038
- const func = ZComponentHelper.getGroupEvalValue.call(this, this.data.OnItemClick);
6039
- if (typeof func === 'function') {
6040
- const callFunc = func.bind(this.group.ctrlScope);
6041
- callFunc(event);
6042
- }
6043
- return;
6044
- }
6045
- }
6046
- }
6047
- }
6048
- editCellCloseHandler(args) {
6049
- const { formGroup, dataItem } = args;
6050
- if (!formGroup.valid) {
6051
- args.preventDefault();
6052
- }
6053
- else if (formGroup.dirty) {
6054
- this.editableColumns = this.columns.filter(s => s.isEditableInDataItem === true);
6055
- this.editableColumns.map(s => Object.assign(dataItem, { [s.field]: formGroup.value[s.field] }));
6056
- this.mySelection.map(s => (s.Id === dataItem.Id) ? Object.assign(s, dataItem) : null);
6057
- }
6058
- }
6059
- createFormGroup(dataItem, fieldName) {
6060
- return this.formBuilder.group({
6061
- [fieldName]: dataItem[fieldName]
6062
- });
6063
- }
6064
- onNavigateTo(event, clickAction, rowData, cellData) {
6065
- const n = ZComponentHelper.getGroupEvalValue.call(this, clickAction.Click);
6066
- if (n) {
6067
- event.stopPropagation();
6068
- this.group.subject.next({
6069
- type: 'zgrid-onNavigateTo',
6070
- target: clickAction.Click,
6071
- rowData: rowData,
6072
- data: cellData
6073
- });
6074
- }
6075
- }
6076
- setColumns(columnName, columns) {
6077
- this.group[columnName] = this.wrapColumnNamesInFieldElement(columns);
6078
- this.generateGridColumns().subscribe();
6079
- }
6080
- wrapColumnNamesInFieldElement(columnList) {
6081
- return of(columnList.map(c => {
6082
- const isHidden = c.Hidden;
6083
- return {
6084
- Name: c.Name,
6085
- Value: c.Code,
6086
- Type: c.Type,
6087
- gridColVisible: !isHidden,
6088
- width: 100 + c.Name.length * 4,
6089
- enableFiltering: false,
6090
- enableSorting: true,
6091
- enablePinning: true,
6092
- DivClass: "col-xs-12 col-sm-6",
6093
- IsEditableInGrid: c.Editable
6094
- };
6095
- }));
6096
- }
6097
- generateGridColumns() {
6098
- const columnFields$ = ZComponentHelper.getGroupValue(this.data.ColumnFields, // "group.gridCalendarColumnFields"
6099
- this.group);
6100
- return columnFields$.pipe(tap(data => {
6101
- const fieldName = this.data['FieldElementName'];
6102
- this.columns = [];
6103
- ZComponentHelper.getGridColumns(data, this.columns, this.group, this.authService, fieldName, null, null, this.data);
6104
- }));
6105
- }
6106
- rowSelectionKey(context) {
6107
- return context.dataItem;
6108
- }
6109
- getSeletectedValues() {
6110
- return this.mySelection;
6111
- }
6112
- refreshGrid(event, group, me) {
6113
- const _gridOptionSegment = event.target.trim().split('.');
6114
- const _gridOption = _gridOptionSegment[1];
6115
- if (_gridOption) {
6116
- const zgridControl = group[_gridOption];
6117
- if (zgridControl) {
6118
- zgridControl.getData();
6119
- }
6120
- else {
6121
- console.log('Unable to find grid value: ' + _gridOption);
6122
- }
6123
- }
6124
- else {
6125
- console.log('Invalid refreshGrid event: ', event);
6126
- }
6127
- }
6128
- refreshData() {
6129
- this.getData();
6130
- }
6131
- clearData() {
6132
- this.zgrid.clearData();
6133
- }
6134
- allResults() {
6135
- const _zgridControl = this.zgrid;
6136
- const _zgridComponent = this.zgrid.grid;
6137
- const _data = _zgridComponent.data;
6138
- const paginationApiPostUrl = _zgridControl.paginationApiPostUrl;
6139
- // Need to clone, if not will affect the grid params.
6140
- const params = Object.assign({}, this.params);
6141
- params.pageNo = 0;
6142
- params.pageSize = _data.total;
6143
- return this.webApiService.httpPost$(paginationApiPostUrl, params).pipe(map((data) => {
6144
- const result = {
6145
- data: process(data.dataSet, {}).data
6146
- };
6147
- return result;
6148
- }));
6149
- }
6150
- columnsOrderChanged(event) {
6151
- const _zgridControl = this.zgrid;
6152
- const _zgridComponent = this.zgrid.grid;
6153
- const _data = _zgridComponent.data;
6154
- if (this.zgrid) {
6155
- const _zgrid = this.zgrid;
6156
- }
6157
- }
6158
- saveGridSettings() {
6159
- const _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
6160
- const _gridName = this.data.Name + '::' + this.data.Value;
6161
- const _zgridComponent = this.zgrid.grid;
6162
- const _columns = _zgridComponent.columns;
6163
- // Keep existing grid column setting
6164
- this.zGridStatePersistingService.set(_gridName, this.columns);
6165
- const configValue = _columns.toArray().map(item => {
6166
- const _zGridColumnSettings = Object.keys(item)
6167
- .filter(propName => {
6168
- return !propName.toLowerCase().includes('template');
6169
- })
6170
- .reduce((acc, curr) => (Object.assign(Object.assign({}, acc), { [curr]: item[curr] })), {});
6171
- return _zGridColumnSettings;
6172
- });
6173
- // remove extra element form array
6174
- configValue.forEach(item => {
6175
- delete item['headerStyle'];
6176
- delete item['__ngContext__'];
6177
- });
6178
- const gridSetting = {
6179
- // state: this.state,
6180
- columnsConfig: configValue
6181
- };
6182
- // Find any setting from localstorage and update, if not just add in.
6183
- let _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
6184
- let _gridConfig = null;
6185
- if (_arrGridCaching && _arrGridCaching[0]) {
6186
- _gridConfig = _arrGridCaching.find(x => x['dataFormFields'] === _gridName);
6187
- if (_gridConfig) {
6188
- _gridConfig.gridSettings = gridSetting;
6189
- }
6190
- }
6191
- else {
6192
- _arrGridCaching = [];
6193
- }
6194
- if (!_gridConfig) {
6195
- _gridConfig = {
6196
- dataFormFields: _gridName,
6197
- gridSettings: gridSetting
6198
- };
6199
- _arrGridCaching.push(_gridConfig);
6200
- }
6201
- // Save grid caching to localstorage
6202
- this.zGridStatePersistingService.set(_storageKey, _arrGridCaching);
6203
- // Save grid caching to database
6204
- this.postGridSetting(_storageKey, _arrGridCaching);
6205
- // Alert
6206
- this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
6207
- }
6208
- restoreGridSettings() {
6209
- const _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
6210
- const _gridName = this.data.Name + '::' + this.data.Value;
6211
- // Find any setting from localstorage..
6212
- let _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
6213
- if (_arrGridCaching && _arrGridCaching[0]) {
6214
- const _gridIndex = _arrGridCaching.findIndex(x => x['dataFormFields'] === _gridName);
6215
- if (_gridIndex != null) {
6216
- _arrGridCaching.splice(_gridIndex, 1);
6217
- if (_arrGridCaching[0]) {
6218
- this.zGridStatePersistingService.set(_storageKey, _arrGridCaching);
6219
- // Save grid caching to database
6220
- this.postGridSetting(_storageKey, _arrGridCaching);
6221
- }
6222
- else {
6223
- // Remove since no value
6224
- this.zGridStatePersistingService.remove(_storageKey);
6225
- const _deleteCookieStoreURL = this.oauthUrl + "Admin/DeleteMultipleCookies";
6226
- const _deleteCookieStoreValue = { 'containName': _storageKey };
6227
- this.webApiService.httpPost$(_deleteCookieStoreURL, _deleteCookieStoreValue).subscribe();
6228
- }
6229
- // Use original column setting
6230
- this.columns = this.zGridStatePersistingService.get(_gridName);
6231
- // Clear original column setting
6232
- this.zGridStatePersistingService.remove(_gridName);
6233
- // Alert
6234
- this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
6235
- }
6236
- }
6237
- }
6238
- postGridSetting(_storageKey, _arrGridCaching) {
6239
- const _cookieStoreURL = this.oauthUrl + "api/CookieStores";
6240
- const _cookieStoreValue = {
6241
- 'Name': _storageKey,
6242
- 'Value': JSON.stringify(_arrGridCaching)
6243
- };
6244
- this.webApiService.httpPost$(_cookieStoreURL, _cookieStoreValue).subscribe(res => {
6245
- if (res.status === "success") {
6246
- console.log("grid config saved: ", res);
6247
- }
6248
- });
5298
+ allResults() {
5299
+ const _zgridControl = this.zgrid;
5300
+ const _zgridComponent = this.zgrid.grid;
5301
+ const _data = _zgridComponent.data;
5302
+ const paginationApiPostUrl = _zgridControl.paginationApiPostUrl;
5303
+ // Need to clone, if not will affect the grid params.
5304
+ const params = Object.assign({}, this.params);
5305
+ params.pageNo = 0;
5306
+ params.pageSize = _data.total;
5307
+ return this.webApiService.httpPost$(paginationApiPostUrl, params).pipe(map((data) => {
5308
+ const result = {
5309
+ data: process(data.dataSet, {}).data
5310
+ };
5311
+ return result;
5312
+ }));
6249
5313
  }
6250
5314
  getClass(dataItem, col) {
6251
5315
  let ngClass = "gridCell ";
@@ -6260,13 +5324,6 @@ class ZgridcalendarComponent {
6260
5324
  }
6261
5325
  return ngClass;
6262
5326
  }
6263
- getInlineField(value) {
6264
- return this.columns.find(x => x.Value === value);
6265
- }
6266
- getInlineForm(rowIndex) {
6267
- const formArray = this.inlineEditedFormGroups.get('items');
6268
- return formArray.at(rowIndex);
6269
- }
6270
5327
  getFormat(col, defaultFormat) {
6271
5328
  let format = "";
6272
5329
  if (col.FormatOptions === undefined) {
@@ -6292,60 +5349,302 @@ class ZgridcalendarComponent {
6292
5349
  }
6293
5350
  });
6294
5351
  }
6295
- inCellCheckBoxOnChange(event, rowIndex, column) {
6296
- const isChecked = event.detail.checked;
6297
- this.gData[rowIndex][column.Value] = isChecked;
6298
- }
6299
5352
  setGridIsLoading(triggered) {
6300
5353
  this.isLoading = triggered;
6301
5354
  }
6302
- filterable(value) {
6303
- if (value === false) {
6304
- return false;
5355
+ setGridSessionKey(group) {
5356
+ if (group["GridStorageKey"]) {
5357
+ return;
5358
+ }
5359
+ else {
5360
+ group["GridStorageKey"] = 'zgrid_' + group.resourceURL + '_' + this.data.Value + '::' + this.authService.e1Token.userName;
6305
5361
  }
6306
- return true;
6307
5362
  }
6308
- sortable(value) {
6309
- if (value === false) {
6310
- return false;
5363
+ trackBy(index, item) {
5364
+ //console.log(item.data['Id'] || index);
5365
+ return index;
5366
+ }
5367
+ /* Grid configuration function */
5368
+ saveGridSettings() {
5369
+ const _zgridComponent = this.zgrid.grid;
5370
+ const _columns = _zgridComponent.columns;
5371
+ of(this.columns)
5372
+ .pipe(switchMap(() => {
5373
+ const configValue = _columns.toArray().map(item => {
5374
+ const _zGridColumnSettings = Object.keys(item)
5375
+ .filter(propName => {
5376
+ return !propName.toLowerCase().includes('template');
5377
+ })
5378
+ .reduce((acc, curr) => (Object.assign(Object.assign({}, acc), { [curr]: item[curr] })), {});
5379
+ return _zGridColumnSettings;
5380
+ });
5381
+ // remove extra element form array
5382
+ configValue.forEach(item => {
5383
+ delete item['headerStyle'];
5384
+ delete item['__ngContext__'];
5385
+ });
5386
+ const gridSetting = {
5387
+ // state: this.state,
5388
+ columnsConfig: configValue
5389
+ };
5390
+ // Find any setting from localstorage and update, if not just add in.
5391
+ let _arrGridCaching = this.zGridStatePersistingService.get(this.gridStorageKey);
5392
+ let _gridConfig = null;
5393
+ if (_arrGridCaching && _arrGridCaching[0]) {
5394
+ _gridConfig = _arrGridCaching.find(x => x['dataFormFields'] === this.gridStorageKey);
5395
+ if (_gridConfig) {
5396
+ _gridConfig.gridSettings = gridSetting;
5397
+ }
5398
+ }
5399
+ else {
5400
+ _arrGridCaching = [];
5401
+ }
5402
+ if (!_gridConfig) {
5403
+ _gridConfig = {
5404
+ dataFormFields: this.gridStorageKey,
5405
+ gridSettings: gridSetting
5406
+ };
5407
+ _arrGridCaching.push(_gridConfig);
5408
+ }
5409
+ return _arrGridCaching;
5410
+ }), concatMap(gridCache => {
5411
+ // Save grid caching to localstorage
5412
+ this.zGridStatePersistingService.set(this.gridStorageKey, gridCache);
5413
+ // Save to CookieStore
5414
+ return this.mainService.cookieStorePost(this.gridStorageKey, gridCache);
5415
+ }), tap(savedGridCache => {
5416
+ // check is saved state exist to enable/hide restore button
5417
+ this.stateExist();
5418
+ }), tap(() => {
5419
+ // Alert
5420
+ this.toastService.show('Grid Setting Saved', "top", true, 2000, 'success');
5421
+ })).subscribe();
5422
+ }
5423
+ restoreGridSettings() {
5424
+ of(true)
5425
+ .pipe(switchMap(() => {
5426
+ // Clear localstorage grid setting
5427
+ this.zGridStatePersistingService.remove(this.gridStorageKey);
5428
+ return of(true);
5429
+ }), switchMap(() => {
5430
+ // delete cookiestore gridSetting by storagekey as name
5431
+ return this.mainService.cookieStoreDeleteMultiple(this.gridStorageKey);
5432
+ }), concatMap(() => {
5433
+ // Use original column setting
5434
+ return this.generateGridColumns();
5435
+ }), tap(() => {
5436
+ // check is saved state exist
5437
+ this.stateExist();
5438
+ // Alert
5439
+ this.toastService.show('Grid Setting Restored', "top", true, 2000, 'success');
5440
+ })).subscribe();
5441
+ }
5442
+ getGridSettings() {
5443
+ const _storageKey = 'ionic-field::' + this.authService.e1Token.userName + '::' + this.data.Name + '::' + this.router.url;
5444
+ // Find any setting from localstorage..
5445
+ let _arrGridCaching = this.zGridStatePersistingService.get(_storageKey);
5446
+ if (_arrGridCaching) {
5447
+ const _gridCaching = JSON.parse(_arrGridCaching['Value']);
5448
+ if (_gridCaching) {
5449
+ return _gridCaching.gridSettings.columnsConfig.sort((a, b) => a.orderIndex - b.orderIndex);
5450
+ }
6311
5451
  }
6312
- return true;
6313
5452
  }
6314
- locked(colSetting) {
6315
- if (colSetting['enablePinning'] == true) {
6316
- if (colSetting['pinnedLeft'] == true) {
6317
- return true;
5453
+ /* Inline setting */
5454
+ getInlineField(value) {
5455
+ return this.columns.find(x => x.Value === value);
5456
+ }
5457
+ getInlineForm(rowIndex) {
5458
+ const formArray = this.inlineEditedFormGroups.get('items');
5459
+ return formArray.at(rowIndex);
5460
+ }
5461
+ getFormControlData(value) {
5462
+ return this.inlineEditedFormGroups.value.items;
5463
+ }
5464
+ /* Event */
5465
+ beforeGridGetData(group, me) {
5466
+ console.warn("beforeDataBinding triggered");
5467
+ if (!group.beforeGridGetData) {
5468
+ console.warn("group.beforeDataBinding is undefined");
5469
+ return of(true);
5470
+ }
5471
+ return group.beforeGridGetData(group, me);
5472
+ }
5473
+ getGridSessionFilter(group, me) {
5474
+ return __awaiter(this, void 0, void 0, function* () {
5475
+ if (!group["GridStorageKey"]) {
5476
+ return null;
5477
+ }
5478
+ const StorageKey = group["GridStorageKey"];
5479
+ if (this.storageService) {
5480
+ yield this.storageService.get(StorageKey)
5481
+ .then(data => {
5482
+ if (!data || !data.value || data.value === "null") {
5483
+ return null;
5484
+ }
5485
+ else {
5486
+ const result = JSON.parse(data.value);
5487
+ this.state.filter = JSON.parse(result["StateFilter"]);
5488
+ this.params.filterParams = JSON.parse(result["FilterParams"]);
5489
+ this.state.filter.filters.forEach((stateFilter) => {
5490
+ if (stateFilter.field.includes('UTC')) {
5491
+ stateFilter.value = new Date(stateFilter.value);
5492
+ }
5493
+ });
5494
+ return data;
5495
+ }
5496
+ });
5497
+ }
5498
+ else {
5499
+ return null;
6318
5500
  }
5501
+ });
5502
+ }
5503
+ setGridSessionFilter(group, me) {
5504
+ if (!group["GridStorageKey"]) {
5505
+ return null;
5506
+ }
5507
+ const StorageKey = group["GridStorageKey"];
5508
+ let lstGridFilter = {};
5509
+ if (me.state.filter && this.storageService && this.data['SaveFilter']) {
5510
+ //list of data for StateFilter and FilterParams
5511
+ lstGridFilter = { "StateFilter": JSON.stringify(me.state.filter), "FilterParams": JSON.stringify(me.params.filterParams) };
5512
+ //create session storage
5513
+ this.storageService.set(StorageKey, JSON.stringify(lstGridFilter));
6319
5514
  }
6320
- return false;
6321
5515
  }
6322
- stateExist() {
6323
- const _storageKey = 'ionic-field::' + this.authService.e1Token.userName;
6324
- const _gridName = this.data.Name + '::' + this.data.Value;
6325
- const userGridState = this.zGridStatePersistingService.get(_storageKey);
6326
- const originalGridState = this.zGridStatePersistingService.get(_gridName);
6327
- if (userGridState || originalGridState) {
6328
- return true;
5516
+ /* onchange Events */
5517
+ filterChange(event) {
5518
+ if (this.zgrid) {
5519
+ this.zgrid.filterChange(event);
6329
5520
  }
6330
- return false;
6331
5521
  }
6332
- setGridSessionKey(group) {
6333
- if (group["GridStorageKey"]) {
6334
- return;
5522
+ pageChange(event) {
5523
+ if (this.zgrid) {
5524
+ this.zgrid.pageChange(event);
6335
5525
  }
6336
- else {
6337
- group["GridStorageKey"] = 'zgrid_' + group.resourceURL + '_' + this.data.Value + '::' + this.authService.e1Token.userName;
5526
+ }
5527
+ sortChange(sort) {
5528
+ if (this.zgrid) {
5529
+ this.zgrid.sortChange(sort);
5530
+ }
5531
+ }
5532
+ inCellCheckBoxOnChange(event, rowIndex, column) {
5533
+ const isChecked = event.detail.checked;
5534
+ this.gData[rowIndex][column.Value] = isChecked;
5535
+ }
5536
+ columnsOrderChanged(event) {
5537
+ const _zgridControl = this.zgrid;
5538
+ const _zgridComponent = this.zgrid.grid;
5539
+ const _data = _zgridComponent.data;
5540
+ if (this.zgrid) {
5541
+ const _zgrid = this.zgrid;
5542
+ }
5543
+ }
5544
+ /* */
5545
+ addHandler({ sender }) {
5546
+ this.isNew = true;
5547
+ // close any existing editor
5548
+ this.closeEditor(sender);
5549
+ // loop all column to get validation and create form control
5550
+ const colFormControl = {};
5551
+ this.zgrid.gridColumns.forEach(col => {
5552
+ const validators = [];
5553
+ if (col.IsRequired) {
5554
+ validators.push(Validators.required);
5555
+ }
5556
+ if (col.ValidatorPattern) {
5557
+ validators.push(Validators.pattern(col.ValidatorPattern));
5558
+ }
5559
+ colFormControl[col.Value] = new FormControl(null, validators);
5560
+ });
5561
+ // set form control object to form group
5562
+ this.formGroup = new FormGroup(colFormControl);
5563
+ // add to grid row
5564
+ sender.addRow(this.formGroup);
5565
+ }
5566
+ saveHandler({ sender, rowIndex, formGroup, isNew }) {
5567
+ // get grid data.
5568
+ const gridExistingData = this.gData ? this.gData : [];
5569
+ // if valid
5570
+ if (formGroup.valid) {
5571
+ // check for duplicate UniqueKey
5572
+ let uniqueKeyExist = false;
5573
+ const uniqueKey = this.data['UniqueKey'];
5574
+ if (uniqueKey) {
5575
+ gridExistingData.forEach(data => {
5576
+ if (data[uniqueKey] === formGroup.value[uniqueKey]) {
5577
+ uniqueKeyExist = true;
5578
+ }
5579
+ });
5580
+ }
5581
+ if (!uniqueKeyExist) {
5582
+ if (isNew) {
5583
+ // if new, push to data
5584
+ gridExistingData.push(formGroup.value);
5585
+ }
5586
+ else {
5587
+ // if edit, update data
5588
+ gridExistingData[rowIndex] = formGroup.value;
5589
+ }
5590
+ this.setData(gridExistingData);
5591
+ sender.closeRow(rowIndex);
5592
+ }
5593
+ }
5594
+ }
5595
+ cancelHandler({ sender, rowIndex }) {
5596
+ // cancel any existing editor
5597
+ sender.closeRow(rowIndex);
5598
+ }
5599
+ editHandler({ sender, rowIndex, dataItem }) {
5600
+ this.isNew = false;
5601
+ // close any existing editor
5602
+ this.closeEditor(sender);
5603
+ // loop all column to get validation and create form control, append current row value
5604
+ const colFormControl = {};
5605
+ this.zgrid.gridColumns.forEach(col => {
5606
+ const validators = [];
5607
+ if (col.IsRequired) {
5608
+ validators.push(Validators.required);
5609
+ }
5610
+ if (col.ValidatorPattern) {
5611
+ validators.push(Validators.pattern(col.ValidatorPattern));
5612
+ }
5613
+ colFormControl[col.Value] = new FormControl(dataItem[col.Value], validators);
5614
+ });
5615
+ // set form control object to form group
5616
+ this.formGroup = new FormGroup(colFormControl);
5617
+ // set grid row to edit
5618
+ this.editedRowIndex = rowIndex;
5619
+ sender.editRow(rowIndex, this.formGroup);
5620
+ }
5621
+ removeHandler({ sender, dataItem }) {
5622
+ const index = this.getItemIndex(dataItem, this.gData, this.data['UniqueKey']);
5623
+ this.gData.splice(index, 1);
5624
+ sender.cancelCell();
5625
+ }
5626
+ closeEditor(grid, rowIndex = this.editedRowIndex) {
5627
+ grid.closeRow(rowIndex);
5628
+ this.editedRowIndex = undefined;
5629
+ this.formGroup = undefined;
5630
+ }
5631
+ getItemIndex(item, data, key) {
5632
+ for (let idx = 0; idx < data.length; idx++) {
5633
+ if (data[idx][key] === item[key]) {
5634
+ return idx;
5635
+ }
6338
5636
  }
5637
+ return -1;
6339
5638
  }
6340
5639
  }
6341
- ZgridcalendarComponent.decorators = [
5640
+ ZgridComponent.decorators = [
6342
5641
  { type: Component, args: [{
6343
- selector: "app-zgridcalendar",
6344
- 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",
5642
+ selector: "app-zgrid",
5643
+ 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>&nbsp;Refresh</button>\r\n <button type=\"button\" kendoGridExcelCommand *ngIf=\"data.AllowExport\"><span class=\"k-icon k-i-file-excel\"></span>&nbsp;Export Data to Excel</button>\r\n <button type=\"button\" kendoButton (click)=\"saveGridSettings()\" *ngIf=\"data.AllowSaveState\"><span class=\"k-icon k-i-star\"></span>&nbsp;Save Setting</button>\r\n <button type=\"button\" kendoButton (click)=\"restoreGridSettings()\" *ngIf=\"gridDefaultStateExist\"><span class=\"k-icon k-i-star-outline\"></span>&nbsp;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",
6345
5644
  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}"]
6346
5645
  },] }
6347
5646
  ];
6348
- ZgridcalendarComponent.ctorParameters = () => [
5647
+ ZgridComponent.ctorParameters = () => [
6349
5648
  { type: ActivatedRoute },
6350
5649
  { type: Router },
6351
5650
  { type: FormBuilder },
@@ -6353,12 +5652,15 @@ ZgridcalendarComponent.ctorParameters = () => [
6353
5652
  { type: WebApiService },
6354
5653
  { type: ZGridStatePersistingService },
6355
5654
  { type: ToastService },
6356
- { type: ZCoreService }
5655
+ { type: ZCoreService },
5656
+ { type: StorageSessionService },
5657
+ { type: MainService }
6357
5658
  ];
6358
- ZgridcalendarComponent.propDecorators = {
5659
+ ZgridComponent.propDecorators = {
6359
5660
  data: [{ type: Input }],
6360
5661
  group: [{ type: Input }],
6361
- form: [{ type: Input }]
5662
+ form: [{ type: Input }],
5663
+ tooltipDir: [{ type: ViewChild, args: [TooltipDirective,] }]
6362
5664
  };
6363
5665
 
6364
5666
  class ZimgComponent {
@@ -9279,6 +8581,7 @@ class ZtreeComponent {
9279
8581
  this.state = { expandedkeys: [] };
9280
8582
  this.itemIndex = [];
9281
8583
  this.selectedKeys = [];
8584
+ this.absoluteText = false;
9282
8585
  this.componentProperties = new ZComponentProperties();
9283
8586
  this.isExpanded = (dataItem, index) => {
9284
8587
  // console.log(index);
@@ -9354,6 +8657,10 @@ class ZtreeComponent {
9354
8657
  if (this.data.TreeviewExpandAll) {
9355
8658
  this.expandAll();
9356
8659
  }
8660
+ // fix text align issue
8661
+ if (this.data.OnAddNode || this.data.OnRemoveNode) {
8662
+ this.absoluteText = true;
8663
+ }
9357
8664
  }
9358
8665
  ngAfterViewInit() {
9359
8666
  // const componentId = ZComponentHelper.getComponentId(this.data);
@@ -9618,8 +8925,8 @@ class ZtreeComponent {
9618
8925
  ZtreeComponent.decorators = [
9619
8926
  { type: Component, args: [{
9620
8927
  selector: "app-ztree",
9621
- 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 <!-- <ion-icon name=\"add\" slot=\"icon-only\"></ion-icon> -->\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 <!-- <ion-icon name=\"close\" slot=\"icon-only\"></ion-icon> -->\r\n <fa-icon [icon]=\"'minus'\"></fa-icon>\r\n </ion-button>\r\n\r\n {{ getTemplate(dataItem, data, group) }}\r\n\r\n </ng-template>\r\n </kendo-treeview>\r\n</div>\r\n",
9622
- 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 .k-treeview .k-in{border-radius:2px;border:1px solid #c8dbf5;background-color:#e3ecf8}:host ::ng-deep .k-treeview .k-in,:host ::ng-deep .k-treeview .k-in.k-state-selected{width:100%;margin:5px;padding:9px 20px 9px 8px;color:#0a45ab;font-size:13px;cursor:pointer}:host ::ng-deep .k-treeview .k-in.k-state-selected{border-radius:2px;background-color:#a9c3e8}:host ::ng-deep .k-treeview .k-in.k-state-hover,:host ::ng-deep .k-treeview .k-in:hover{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:2px;background-color:#c9daf2;color:#0a45ab;font-size:13px;cursor:pointer}"]
8928
+ 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",
8929
+ 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}"]
9623
8930
  },] }
9624
8931
  ];
9625
8932
  ZtreeComponent.ctorParameters = () => [];
@@ -11039,7 +10346,6 @@ class ZComponentService {
11039
10346
  zdiv: ZdivComponent,
11040
10347
  zgauge: ZgaugeComponent,
11041
10348
  zgrid: ZgridComponent,
11042
- zgridcalendar: ZgridcalendarComponent,
11043
10349
  zimg: ZimgComponent,
11044
10350
  zkcard: ZkcardComponent,
11045
10351
  zlabel: ZlabelComponent,
@@ -11198,7 +10504,7 @@ MmhglobalDynamicformModule.decorators = [
11198
10504
  ScrollbarThemeDirective,
11199
10505
  FieldElementDirective,
11200
10506
  ZGridBindingDirective,
11201
- ZGridCalendarBindingDirective,
10507
+ ZGridPopupAnchorDirective,
11202
10508
  OpenOnFocusDirective,
11203
10509
  DateParserFilter,
11204
10510
  EditorFilter,
@@ -11229,7 +10535,6 @@ MmhglobalDynamicformModule.decorators = [
11229
10535
  ZformcontrolComponent,
11230
10536
  ZgaugeComponent,
11231
10537
  ZgridComponent,
11232
- ZgridcalendarComponent,
11233
10538
  ZimgComponent,
11234
10539
  ZkcardComponent,
11235
10540
  ZlabelComponent,
@@ -11298,7 +10603,7 @@ MmhglobalDynamicformModule.decorators = [
11298
10603
  ScrollbarThemeDirective,
11299
10604
  FieldElementDirective,
11300
10605
  ZGridBindingDirective,
11301
- ZGridCalendarBindingDirective,
10606
+ ZGridPopupAnchorDirective,
11302
10607
  OpenOnFocusDirective,
11303
10608
  DateParserFilter,
11304
10609
  EditorFilter,
@@ -11329,7 +10634,6 @@ MmhglobalDynamicformModule.decorators = [
11329
10634
  ZformcontrolComponent,
11330
10635
  ZgaugeComponent,
11331
10636
  ZgridComponent,
11332
- ZgridcalendarComponent,
11333
10637
  ZimgComponent,
11334
10638
  ZkcardComponent,
11335
10639
  ZlabelComponent,
@@ -11379,7 +10683,6 @@ MmhglobalDynamicformModule.decorators = [
11379
10683
  ZformcontrolComponent,
11380
10684
  ZgaugeComponent,
11381
10685
  ZgridComponent,
11382
- ZgridcalendarComponent,
11383
10686
  ZimgComponent,
11384
10687
  ZkcardComponent,
11385
10688
  ZlabelComponent,
@@ -11419,5 +10722,5 @@ MmhglobalDynamicformModule.decorators = [
11419
10722
  * Generated bundle index. Do not edit.
11420
10723
  */
11421
10724
 
11422
- export { DateParserFilter, DateRangeFilterCellComponent, DivzLayout, EditorFilter, ExportOptions, FieldElementDirective, MainService, MmhglobalDynamicformModule, MyFileInfo, OpenOnFocusDirective, ScrollbarThemeDirective, TabFilter, UiactionbuttonComponent, UiappmenucontentComponent, UicontentComponent, UiheaderComponent, UimenubuttonComponent, UimenucontentComponent, UipageComponent, UivalidationmessageComponent, ZBulletComponent, ZChipComponent, ZGridBindingDirective, ZSchedulerToolBarComponent, ZTreeListOptions, ZbuttonsComponent, ZcardComponent, ZchartComponent, ZcheckboxComponent, ZcodeeditorComponent, ZdaterangeComponent, ZdatetimeComponent, ZdivComponent, ZformComponent, ZformcontrolComponent, ZgaugeComponent, ZgridComponent, ZgridcalendarComponent, ZimgComponent, ZkcardComponent, ZlabelComponent, ZmfbComponent, ZmodalComponent, ZmodalMobileComponent, ZnumericComponent, ZpostselectinputComponent, ZquerybuilderComponent, ZreportComponent, ZschedulerComponent, ZselectmultipleComponent, ZtabComponent, ZtextComponent, ZtextareaComponent, ZtexteditorComponent, ZtreeComponent, ZtreelistComponent, ZtrendcardComponent, ZudfComponent, ZunknownComponent, ZuploadComponent, ZworkflowbuttonsComponent, refreshGrid, toQueryRule, ZComponentDebugService as ɵa, ZGridCalendarBindingDirective as ɵb, ZComponentService as ɵc };
10725
+ export { DateParserFilter, DateRangeFilterCellComponent, DivzLayout, EditorFilter, ExportOptions, FieldElementDirective, MainService, MmhglobalDynamicformModule, MyFileInfo, OpenOnFocusDirective, ScrollbarThemeDirective, TabFilter, UiactionbuttonComponent, UiappmenucontentComponent, UicontentComponent, UiheaderComponent, UimenubuttonComponent, UimenucontentComponent, UipageComponent, UivalidationmessageComponent, ZBulletComponent, ZChipComponent, ZGridBindingDirective, ZGridPopupAnchorDirective, ZSchedulerToolBarComponent, ZTreeListOptions, ZbuttonsComponent, ZcardComponent, ZchartComponent, ZcheckboxComponent, ZcodeeditorComponent, ZdaterangeComponent, ZdatetimeComponent, ZdivComponent, ZformComponent, ZformcontrolComponent, ZgaugeComponent, ZgridComponent, ZimgComponent, ZkcardComponent, ZlabelComponent, ZmfbComponent, ZmodalComponent, ZmodalMobileComponent, ZnumericComponent, ZpostselectinputComponent, ZquerybuilderComponent, ZreportComponent, ZschedulerComponent, ZselectmultipleComponent, ZtabComponent, ZtextComponent, ZtextareaComponent, ZtexteditorComponent, ZtreeComponent, ZtreelistComponent, ZtrendcardComponent, ZudfComponent, ZunknownComponent, ZuploadComponent, ZworkflowbuttonsComponent, refreshGrid, toQueryRule, ZComponentDebugService as ɵa, ZComponentService as ɵb };
11423
10726
  //# sourceMappingURL=mmhglobal-dynamicform.js.map