@acorex/data-grid 3.0.65 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/acorex-data-grid.d.ts +1 -0
  2. package/esm2020/acorex-data-grid.mjs +5 -0
  3. package/esm2020/lib/data-grid/columns/check-column.component.mjs +117 -0
  4. package/esm2020/lib/data-grid/columns/column.component.mjs +164 -0
  5. package/{esm2015/lib/data-grid/columns/command-column.component.js → esm2020/lib/data-grid/columns/command-column.component.mjs} +46 -35
  6. package/esm2020/lib/data-grid/columns/date-column.component.mjs +112 -0
  7. package/esm2020/lib/data-grid/columns/row-number-column.component.mjs +37 -0
  8. package/esm2020/lib/data-grid/columns/selection-column.component.mjs +42 -0
  9. package/esm2020/lib/data-grid/columns/text-column.component.mjs +89 -0
  10. package/esm2020/lib/data-grid/datagrid.component.mjs +658 -0
  11. package/esm2020/lib/data-grid/datagrid.events.mjs +2 -0
  12. package/esm2020/lib/data-grid/datagrid.module.mjs +145 -0
  13. package/esm2020/lib/data-grid/filters/filter.component.mjs +39 -0
  14. package/esm2020/lib/data-grid/templates/cell-template.component.mjs +53 -0
  15. package/esm2020/lib/data-grid/templates/detail-template.component.mjs +46 -0
  16. package/esm2020/lib/data-grid/templates/row-template.component.mjs +43 -0
  17. package/esm2020/lib/data-lov/data-lov-popup/data-lov-popup.component.mjs +118 -0
  18. package/esm2020/lib/data-lov/data-lov.component.mjs +163 -0
  19. package/esm2020/lib/data-lov/data-lov.module.mjs +23 -0
  20. package/esm2020/public-api.mjs +18 -0
  21. package/fesm2015/acorex-data-grid.mjs +1875 -0
  22. package/fesm2015/acorex-data-grid.mjs.map +1 -0
  23. package/fesm2020/acorex-data-grid.mjs +1875 -0
  24. package/fesm2020/acorex-data-grid.mjs.map +1 -0
  25. package/lib/data-grid/columns/check-column.component.d.ts +7 -0
  26. package/lib/data-grid/columns/column.component.d.ts +3 -0
  27. package/lib/data-grid/columns/command-column.component.d.ts +5 -0
  28. package/lib/data-grid/columns/date-column.component.d.ts +5 -0
  29. package/lib/data-grid/columns/row-number-column.component.d.ts +3 -0
  30. package/lib/data-grid/columns/selection-column.component.d.ts +3 -0
  31. package/lib/data-grid/columns/text-column.component.d.ts +5 -0
  32. package/lib/data-grid/datagrid.component.d.ts +3 -0
  33. package/lib/data-grid/datagrid.module.d.ts +20 -0
  34. package/lib/data-grid/filters/filter.component.d.ts +3 -0
  35. package/lib/data-grid/templates/cell-template.component.d.ts +5 -0
  36. package/lib/data-grid/templates/detail-template.component.d.ts +5 -0
  37. package/lib/data-grid/templates/row-template.component.d.ts +5 -0
  38. package/lib/data-lov/data-lov-popup/data-lov-popup.component.d.ts +3 -0
  39. package/lib/data-lov/data-lov.component.d.ts +3 -0
  40. package/lib/data-lov/data-lov.module.d.ts +10 -0
  41. package/package.json +23 -13
  42. package/acorex-data-grid.metadata.json +0 -1
  43. package/bundles/acorex-data-grid.umd.js +0 -2261
  44. package/bundles/acorex-data-grid.umd.js.map +0 -1
  45. package/bundles/acorex-data-grid.umd.min.js +0 -16
  46. package/bundles/acorex-data-grid.umd.min.js.map +0 -1
  47. package/esm2015/acorex-data-grid.js +0 -5
  48. package/esm2015/lib/data-grid/columns/check-column.component.js +0 -104
  49. package/esm2015/lib/data-grid/columns/column.component.js +0 -204
  50. package/esm2015/lib/data-grid/columns/date-column.component.js +0 -114
  51. package/esm2015/lib/data-grid/columns/row-number-column.component.js +0 -39
  52. package/esm2015/lib/data-grid/columns/selection-column.component.js +0 -48
  53. package/esm2015/lib/data-grid/columns/text-column.component.js +0 -81
  54. package/esm2015/lib/data-grid/datagrid.component.js +0 -734
  55. package/esm2015/lib/data-grid/datagrid.events.js +0 -1
  56. package/esm2015/lib/data-grid/datagrid.module.js +0 -98
  57. package/esm2015/lib/data-grid/filters/filter.component.js +0 -25
  58. package/esm2015/lib/data-grid/templates/cell-template.component.js +0 -47
  59. package/esm2015/lib/data-grid/templates/detail-template.component.js +0 -45
  60. package/esm2015/lib/data-grid/templates/row-template.component.js +0 -40
  61. package/esm2015/lib/data-lov/data-lov-popup/data-lov-popup.component.js +0 -121
  62. package/esm2015/lib/data-lov/data-lov.component.js +0 -212
  63. package/esm2015/lib/data-lov/data-lov.module.js +0 -21
  64. package/esm2015/public-api.js +0 -17
  65. package/esm5/acorex-data-grid.js +0 -5
  66. package/esm5/lib/data-grid/columns/check-column.component.js +0 -102
  67. package/esm5/lib/data-grid/columns/column.component.js +0 -206
  68. package/esm5/lib/data-grid/columns/command-column.component.js +0 -98
  69. package/esm5/lib/data-grid/columns/date-column.component.js +0 -119
  70. package/esm5/lib/data-grid/columns/row-number-column.component.js +0 -42
  71. package/esm5/lib/data-grid/columns/selection-column.component.js +0 -52
  72. package/esm5/lib/data-grid/columns/text-column.component.js +0 -81
  73. package/esm5/lib/data-grid/datagrid.component.js +0 -792
  74. package/esm5/lib/data-grid/datagrid.events.js +0 -1
  75. package/esm5/lib/data-grid/datagrid.module.js +0 -101
  76. package/esm5/lib/data-grid/filters/filter.component.js +0 -16
  77. package/esm5/lib/data-grid/templates/cell-template.component.js +0 -46
  78. package/esm5/lib/data-grid/templates/detail-template.component.js +0 -49
  79. package/esm5/lib/data-grid/templates/row-template.component.js +0 -44
  80. package/esm5/lib/data-lov/data-lov-popup/data-lov-popup.component.js +0 -127
  81. package/esm5/lib/data-lov/data-lov.component.js +0 -222
  82. package/esm5/lib/data-lov/data-lov.module.js +0 -24
  83. package/esm5/public-api.js +0 -17
  84. package/fesm2015/acorex-data-grid.js +0 -1939
  85. package/fesm2015/acorex-data-grid.js.map +0 -1
  86. package/fesm5/acorex-data-grid.js +0 -2017
  87. package/fesm5/acorex-data-grid.js.map +0 -1
@@ -1,2261 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@acorex/core'), require('@acorex/components'), require('ag-grid-enterprise'), require('@angular/common'), require('@angular/forms'), require('ag-grid-angular')) :
3
- typeof define === 'function' && define.amd ? define('@acorex/data-grid', ['exports', '@angular/core', '@acorex/core', '@acorex/components', 'ag-grid-enterprise', '@angular/common', '@angular/forms', 'ag-grid-angular'], factory) :
4
- (global = global || self, factory((global.acorex = global.acorex || {}, global.acorex['data-grid'] = {}), global.ng.core, global.core$1, global.components, global.agGridEnterprise, global.ng.common, global.ng.forms, global.agGridAngular));
5
- }(this, (function (exports, core, core$1, components, agGridEnterprise, common, forms, agGridAngular) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- function __createBinding(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- o[k2] = m[k];
115
- }
116
-
117
- function __exportStar(m, exports) {
118
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
- }
120
-
121
- function __values(o) {
122
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
- if (m) return m.call(o);
124
- if (o && typeof o.length === "number") return {
125
- next: function () {
126
- if (o && i >= o.length) o = void 0;
127
- return { value: o && o[i++], done: !o };
128
- }
129
- };
130
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
- }
132
-
133
- function __read(o, n) {
134
- var m = typeof Symbol === "function" && o[Symbol.iterator];
135
- if (!m) return o;
136
- var i = m.call(o), r, ar = [], e;
137
- try {
138
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
- }
140
- catch (error) { e = { error: error }; }
141
- finally {
142
- try {
143
- if (r && !r.done && (m = i["return"])) m.call(i);
144
- }
145
- finally { if (e) throw e.error; }
146
- }
147
- return ar;
148
- }
149
-
150
- function __spread() {
151
- for (var ar = [], i = 0; i < arguments.length; i++)
152
- ar = ar.concat(__read(arguments[i]));
153
- return ar;
154
- }
155
-
156
- function __spreadArrays() {
157
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
- r[k] = a[j];
161
- return r;
162
- };
163
-
164
- function __await(v) {
165
- return this instanceof __await ? (this.v = v, this) : new __await(v);
166
- }
167
-
168
- function __asyncGenerator(thisArg, _arguments, generator) {
169
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
- function fulfill(value) { resume("next", value); }
176
- function reject(value) { resume("throw", value); }
177
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
- }
179
-
180
- function __asyncDelegator(o) {
181
- var i, p;
182
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
- }
185
-
186
- function __asyncValues(o) {
187
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
- var m = o[Symbol.asyncIterator], i;
189
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
- }
193
-
194
- function __makeTemplateObject(cooked, raw) {
195
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
- return cooked;
197
- };
198
-
199
- function __importStar(mod) {
200
- if (mod && mod.__esModule) return mod;
201
- var result = {};
202
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
- result.default = mod;
204
- return result;
205
- }
206
-
207
- function __importDefault(mod) {
208
- return (mod && mod.__esModule) ? mod : { default: mod };
209
- }
210
-
211
- function __classPrivateFieldGet(receiver, privateMap) {
212
- if (!privateMap.has(receiver)) {
213
- throw new TypeError("attempted to get private field on non-instance");
214
- }
215
- return privateMap.get(receiver);
216
- }
217
-
218
- function __classPrivateFieldSet(receiver, privateMap, value) {
219
- if (!privateMap.has(receiver)) {
220
- throw new TypeError("attempted to set private field on non-instance");
221
- }
222
- privateMap.set(receiver, value);
223
- return value;
224
- }
225
-
226
- var AXDataGridCellTemplateComponent = /** @class */ (function () {
227
- function AXDataGridCellTemplateComponent() {
228
- this.renderer = AXDataGridCellTemplateRenderer;
229
- }
230
- AXDataGridCellTemplateComponent.prototype.ngOnInit = function () {
231
- this.params = {
232
- templateRef: this.templateRef
233
- };
234
- };
235
- __decorate([
236
- core.ContentChild(core.TemplateRef, { static: true }),
237
- __metadata("design:type", core.TemplateRef)
238
- ], AXDataGridCellTemplateComponent.prototype, "templateRef", void 0);
239
- AXDataGridCellTemplateComponent = __decorate([
240
- core.Component({
241
- selector: 'ax-cell-template',
242
- template: "<ng-content></ng-content>\n "
243
- }),
244
- __metadata("design:paramtypes", [])
245
- ], AXDataGridCellTemplateComponent);
246
- return AXDataGridCellTemplateComponent;
247
- }());
248
- var AXDataGridCellTemplateRenderer = /** @class */ (function () {
249
- function AXDataGridCellTemplateRenderer() {
250
- }
251
- AXDataGridCellTemplateRenderer.prototype.agInit = function (params) {
252
- this.rowData = params.data;
253
- this.templateRef = params.templateRef;
254
- };
255
- AXDataGridCellTemplateRenderer.prototype.refresh = function (params) {
256
- this.rowData = params.data;
257
- return true;
258
- };
259
- AXDataGridCellTemplateRenderer = __decorate([
260
- core.Component({
261
- template: "\n <ng-container *ngTemplateOutlet='templateRef; context: { $implicit: rowData }'>\n </ng-container>\n "
262
- }),
263
- __metadata("design:paramtypes", [])
264
- ], AXDataGridCellTemplateRenderer);
265
- return AXDataGridCellTemplateRenderer;
266
- }());
267
-
268
- var AXGridDataColumn = /** @class */ (function () {
269
- function AXGridDataColumn() {
270
- this.width = 100;
271
- this.pinned = null;
272
- this.allowSorting = true;
273
- this.allowFiltering = core$1.AXConfig.get('datagrid.allowFiltering') || false;
274
- this.sort = null;
275
- this.field = '';
276
- this.caption = '';
277
- this.checkbox = false;
278
- this.headerCheckbox = false;
279
- this.groupIndex = -1;
280
- this.treeIndex = -1;
281
- this.enableRowGroup = false;
282
- this.hide = false;
283
- this.floatingFilter = core$1.AXConfig.get('datagrid.floatingFilter') || false;
284
- this.disableMenu = false;
285
- this.resizable = true;
286
- this.menuColumnDisable = false;
287
- this.menuItemDisable = false;
288
- }
289
- ;
290
- AXGridDataColumn.prototype.render = function () {
291
- var col = {
292
- field: this.field,
293
- width: this.width,
294
- };
295
- col.resizable = this.resizable;
296
- col.suppressMenu = this.disableMenu;
297
- col.menuTabs = ['filterMenuTab', 'columnsMenuTab', 'generalMenuTab'];
298
- col.floatingFilter = this.floatingFilter;
299
- if (!this.allowFiltering) {
300
- col.filter = false;
301
- col.menuTabs = col.menuTabs.filter(function (c) { return c != 'filterMenuTab'; });
302
- col.floatingFilter = false;
303
- }
304
- if (this.menuColumnDisable == true) {
305
- col.menuTabs = col.menuTabs.filter(function (c) { return c != 'columnsMenuTab'; });
306
- }
307
- if (this.menuItemDisable == true) {
308
- col.menuTabs = col.menuTabs.filter(function (c) { return c != 'generalMenuTab'; });
309
- }
310
- if (this.caption) {
311
- col.headerName = this.caption;
312
- }
313
- if (this.minWidth) {
314
- col.minWidth = this.minWidth;
315
- }
316
- if (this.maxWidth) {
317
- col.maxWidth = this.maxWidth;
318
- }
319
- if (this.pinned) {
320
- col.pinned = this.pinned === 'start' ? 'right' : 'left';
321
- // TODO: Change based on layout
322
- }
323
- if (this.allowSorting) {
324
- col.sortable = this.allowSorting;
325
- }
326
- if (this.sort) {
327
- col.sort = this.sort;
328
- }
329
- if (this.groupIndex >= 0) {
330
- col.rowGroupIndex = this.groupIndex;
331
- col.rowGroup = true;
332
- this.enableRowGroup = true;
333
- }
334
- if (this.treeIndex >= 0) {
335
- col.rowGroupIndex = this.treeIndex;
336
- col.rowGroup = false;
337
- }
338
- if (this.hide) {
339
- col.hide = true;
340
- }
341
- if (this.enableRowGroup) {
342
- col.enableRowGroup = this.enableRowGroup;
343
- }
344
- if (this.cellClass) {
345
- var THAT_1 = this;
346
- if (this.cellClass instanceof Function) {
347
- col.cellClass = function (p) {
348
- return THAT_1.cellClass({
349
- column: THAT_1,
350
- rowIndex: p.node.rowIndex,
351
- rowLevel: p.node.level,
352
- data: p.data,
353
- value: p.value
354
- });
355
- };
356
- }
357
- else {
358
- col.cellClass = this.cellClass;
359
- }
360
- }
361
- //
362
- if (this.cellTemplate != null) {
363
- col.cellRendererFramework = this.cellTemplate.renderer;
364
- col.cellRendererParams = this.cellTemplate.params;
365
- }
366
- if (this.checkbox) {
367
- col.checkboxSelection = function (params) {
368
- return true;
369
- };
370
- // col.headerCheckboxSelection = this.headerCheckbox;
371
- }
372
- return col;
373
- };
374
- __decorate([
375
- core.ContentChild(AXDataGridCellTemplateComponent),
376
- __metadata("design:type", AXDataGridCellTemplateComponent)
377
- ], AXGridDataColumn.prototype, "cellTemplate", void 0);
378
- __decorate([
379
- core.Input(),
380
- __metadata("design:type", Number)
381
- ], AXGridDataColumn.prototype, "width", void 0);
382
- __decorate([
383
- core.Input(),
384
- __metadata("design:type", Number)
385
- ], AXGridDataColumn.prototype, "maxWidth", void 0);
386
- __decorate([
387
- core.Input(),
388
- __metadata("design:type", Number)
389
- ], AXGridDataColumn.prototype, "minWidth", void 0);
390
- __decorate([
391
- core.Input(),
392
- __metadata("design:type", String)
393
- ], AXGridDataColumn.prototype, "pinned", void 0);
394
- __decorate([
395
- core.Input(),
396
- __metadata("design:type", Boolean)
397
- ], AXGridDataColumn.prototype, "allowSorting", void 0);
398
- __decorate([
399
- core.Input(),
400
- __metadata("design:type", Boolean)
401
- ], AXGridDataColumn.prototype, "allowFiltering", void 0);
402
- __decorate([
403
- core.Input(),
404
- __metadata("design:type", Function)
405
- ], AXGridDataColumn.prototype, "cellClass", void 0);
406
- __decorate([
407
- core.Input(),
408
- __metadata("design:type", String)
409
- ], AXGridDataColumn.prototype, "sort", void 0);
410
- __decorate([
411
- core.Input(),
412
- __metadata("design:type", String)
413
- ], AXGridDataColumn.prototype, "field", void 0);
414
- __decorate([
415
- core.Input(),
416
- __metadata("design:type", String)
417
- ], AXGridDataColumn.prototype, "caption", void 0);
418
- __decorate([
419
- core.Input(),
420
- __metadata("design:type", Object)
421
- ], AXGridDataColumn.prototype, "cellRendererParams", void 0);
422
- __decorate([
423
- core.Input(),
424
- __metadata("design:type", Boolean)
425
- ], AXGridDataColumn.prototype, "checkbox", void 0);
426
- __decorate([
427
- core.Input(),
428
- __metadata("design:type", Boolean)
429
- ], AXGridDataColumn.prototype, "headerCheckbox", void 0);
430
- __decorate([
431
- core.Input(),
432
- __metadata("design:type", Number)
433
- ], AXGridDataColumn.prototype, "groupIndex", void 0);
434
- __decorate([
435
- core.Input(),
436
- __metadata("design:type", Number)
437
- ], AXGridDataColumn.prototype, "treeIndex", void 0);
438
- __decorate([
439
- core.Input(),
440
- __metadata("design:type", Boolean)
441
- ], AXGridDataColumn.prototype, "enableRowGroup", void 0);
442
- __decorate([
443
- core.Input(),
444
- __metadata("design:type", Boolean)
445
- ], AXGridDataColumn.prototype, "hide", void 0);
446
- __decorate([
447
- core.Input(),
448
- __metadata("design:type", Boolean)
449
- ], AXGridDataColumn.prototype, "floatingFilter", void 0);
450
- __decorate([
451
- core.Input(),
452
- __metadata("design:type", Boolean)
453
- ], AXGridDataColumn.prototype, "disableMenu", void 0);
454
- __decorate([
455
- core.Input(),
456
- __metadata("design:type", Boolean)
457
- ], AXGridDataColumn.prototype, "resizable", void 0);
458
- __decorate([
459
- core.Input(),
460
- __metadata("design:type", Boolean)
461
- ], AXGridDataColumn.prototype, "menuColumnDisable", void 0);
462
- __decorate([
463
- core.Input(),
464
- __metadata("design:type", Boolean)
465
- ], AXGridDataColumn.prototype, "menuItemDisable", void 0);
466
- return AXGridDataColumn;
467
- }());
468
-
469
- var AXGridCheckColumn = /** @class */ (function (_super) {
470
- __extends(AXGridCheckColumn, _super);
471
- function AXGridCheckColumn() {
472
- return _super.call(this) || this;
473
- }
474
- AXGridCheckColumn_1 = AXGridCheckColumn;
475
- AXGridCheckColumn.prototype.render = function () {
476
- var col = _super.prototype.render.call(this);
477
- if (!col.cellRendererFramework) {
478
- col.cellRendererFramework = BooleanRenderer;
479
- }
480
- if (this.allowFiltering) {
481
- col.filterFramework = BooleanFilterRenderer;
482
- }
483
- return col;
484
- };
485
- var AXGridCheckColumn_1;
486
- AXGridCheckColumn = AXGridCheckColumn_1 = __decorate([
487
- core.Component({
488
- selector: 'ax-check-column',
489
- template: '',
490
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridCheckColumn_1 }],
491
- changeDetection: core.ChangeDetectionStrategy.OnPush
492
- }),
493
- __metadata("design:paramtypes", [])
494
- ], AXGridCheckColumn);
495
- return AXGridCheckColumn;
496
- }(AXGridDataColumn));
497
- var BooleanRenderer = /** @class */ (function () {
498
- function BooleanRenderer() {
499
- }
500
- BooleanRenderer.prototype.agInit = function (params) {
501
- this.value = params.value;
502
- };
503
- BooleanRenderer.prototype.refresh = function (params) {
504
- this.value = params.value;
505
- return true;
506
- };
507
- BooleanRenderer = __decorate([
508
- core.Component({
509
- template: "\n <ax-check-box [value]='value' readonly='true'></ax-check-box>\n ",
510
- changeDetection: core.ChangeDetectionStrategy.OnPush
511
- }),
512
- __metadata("design:paramtypes", [])
513
- ], BooleanRenderer);
514
- return BooleanRenderer;
515
- }());
516
- var BooleanFilterRenderer = /** @class */ (function () {
517
- function BooleanFilterRenderer() {
518
- this.value = null;
519
- this.selectItem = [
520
- { value: 0, label: 'True' },
521
- { value: 1, label: 'False' },
522
- ];
523
- }
524
- BooleanFilterRenderer.prototype.agInit = function (params) {
525
- this.params = params;
526
- this.valueGetter = params.valueGetter;
527
- };
528
- BooleanFilterRenderer.prototype.isFilterActive = function () {
529
- return this.value !== null && this.value !== undefined;
530
- };
531
- BooleanFilterRenderer.prototype.doesFilterPass = function (params) {
532
- return this.value === this.valueGetter(params.node);
533
- };
534
- BooleanFilterRenderer.prototype.getModel = function () {
535
- return { value: this.value };
536
- };
537
- BooleanFilterRenderer.prototype.setModel = function (model) {
538
- this.value = model ? model.value : null;
539
- };
540
- BooleanFilterRenderer.prototype.ngAfterViewInit = function (params) {
541
- var _this = this;
542
- window.setTimeout(function () {
543
- _this.input.element.nativeElement.focus();
544
- });
545
- };
546
- BooleanFilterRenderer.prototype.onChange = function (newValue) {
547
- if (this.value !== newValue) {
548
- this.value = newValue;
549
- this.params.filterChangedCallback();
550
- }
551
- };
552
- __decorate([
553
- core.ViewChild('input', { static: true, read: core.ViewContainerRef }),
554
- __metadata("design:type", Object)
555
- ], BooleanFilterRenderer.prototype, "input", void 0);
556
- BooleanFilterRenderer = __decorate([
557
- core.Component({
558
- template: "\n <ax-data-grid-filter>\n <ax-select-box\n label='Select Box'\n [items]='selectItem'\n ></ax-select-box>\n </ax-data-grid-filter>\n ",
559
- changeDetection: core.ChangeDetectionStrategy.OnPush
560
- })
561
- ], BooleanFilterRenderer);
562
- return BooleanFilterRenderer;
563
- }());
564
-
565
- var AXGridCommandColumn = /** @class */ (function (_super) {
566
- __extends(AXGridCommandColumn, _super);
567
- function AXGridCommandColumn() {
568
- var _this = _super !== null && _super.apply(this, arguments) || this;
569
- _this.items = [];
570
- _this.onItemClick = new core.EventEmitter();
571
- return _this;
572
- }
573
- AXGridCommandColumn_1 = AXGridCommandColumn;
574
- AXGridCommandColumn.prototype.render = function () {
575
- var _this = this;
576
- var col = _super.prototype.render.call(this);
577
- if (!col.cellRendererFramework) {
578
- col.cellRendererFramework = CommandRenderer;
579
- }
580
- col.cellRendererParams = {
581
- items: this.items,
582
- onClick: function (e) {
583
- _this.onItemClick.emit({
584
- command: e.name,
585
- data: e.data,
586
- rowIndex: e.rowIndex,
587
- rowLevel: e.rowLevel,
588
- htmlEvent: e.htmlEvent
589
- });
590
- }
591
- };
592
- col.sortable = false;
593
- col.filter = false;
594
- col.valueGetter = function (params) {
595
- return _this.items;
596
- };
597
- return col;
598
- };
599
- var AXGridCommandColumn_1;
600
- __decorate([
601
- core.Input(),
602
- __metadata("design:type", Object)
603
- ], AXGridCommandColumn.prototype, "items", void 0);
604
- __decorate([
605
- core.Output(),
606
- __metadata("design:type", core.EventEmitter)
607
- ], AXGridCommandColumn.prototype, "onItemClick", void 0);
608
- AXGridCommandColumn = AXGridCommandColumn_1 = __decorate([
609
- core.Component({
610
- selector: 'ax-command-column',
611
- template: '',
612
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridCommandColumn_1 }],
613
- changeDetection: core.ChangeDetectionStrategy.OnPush,
614
- encapsulation: core.ViewEncapsulation.None
615
- })
616
- ], AXGridCommandColumn);
617
- return AXGridCommandColumn;
618
- }(AXGridDataColumn));
619
- var CommandRenderer = /** @class */ (function () {
620
- function CommandRenderer() {
621
- this.items = [];
622
- }
623
- CommandRenderer.prototype.agInit = function (params) {
624
- this.mapParams(params);
625
- };
626
- CommandRenderer.prototype.refresh = function (params) {
627
- this.mapParams(params);
628
- return true;
629
- };
630
- CommandRenderer.prototype.mapParams = function (params) {
631
- this.node = params.node;
632
- this.items = typeof params.items == 'function' ? params.items({ data: this.node.data }) : Array.isArray(params.items) ? params.items : [];
633
- this.clickCallback = params.onClick;
634
- };
635
- CommandRenderer.prototype.onClick = function (item, e) {
636
- if (this.clickCallback && !item.disable) {
637
- this.clickCallback({
638
- name: item.name,
639
- rowLevel: this.node.level,
640
- rowIndex: this.node.rowIndex,
641
- data: this.node.data,
642
- htmlEvent: e
643
- });
644
- }
645
- };
646
- CommandRenderer = __decorate([
647
- core.Component({
648
- selector: 'ax-command-cell',
649
- template: "\n <button\n *ngFor=\"let item of items; let i = index\"\n class=\"ax button md ax-grid-command-button {{ item.style || 'ax primary blank' }}\"\n [class.disabled]=\"item.disable\"\n type=\"button\"\n [title]=\"item.tooltip\"\n [attr.tabindex]=\"i\"\n (click)=\"onClick(item, $event)\"\n >\n <i [ngClass]=\"item.icon\"></i>{{ item.text }}\n </button>\n ",
650
- encapsulation: core.ViewEncapsulation.None,
651
- changeDetection: core.ChangeDetectionStrategy.OnPush
652
- }),
653
- __metadata("design:paramtypes", [])
654
- ], CommandRenderer);
655
- return CommandRenderer;
656
- }());
657
-
658
- var AXGridDateColumn = /** @class */ (function (_super) {
659
- __extends(AXGridDateColumn, _super);
660
- function AXGridDateColumn() {
661
- var _this = _super.call(this) || this;
662
- _this.type = core$1.AXConfig.get('dateTime.type');
663
- return _this;
664
- }
665
- AXGridDateColumn_1 = AXGridDateColumn;
666
- AXGridDateColumn.prototype.render = function () {
667
- var _this = this;
668
- var col = _super.prototype.render.call(this);
669
- col.cellRendererParams = {
670
- format: this.format,
671
- };
672
- col.comparator = function (valueA, valueB) {
673
- var date1 = core$1.AXDateTime.convert(valueA);
674
- var date2 = core$1.AXDateTime.convert(valueB);
675
- //
676
- if (date1 === null && date2 === null) {
677
- return 0;
678
- }
679
- if (date1 === null) {
680
- return -1;
681
- }
682
- if (date2 === null) {
683
- return 1;
684
- }
685
- return (date1.date.getTime() - date2.date.getTime());
686
- };
687
- col.valueFormatter = function (params) {
688
- var date = core$1.AXDateTime.convert(params.value, _this.type);
689
- if (date) {
690
- return date.format(_this.format);
691
- }
692
- else {
693
- return null;
694
- }
695
- };
696
- col.filter = 'agDateColumnFilter';
697
- // col.floatingFilter = true;
698
- return col;
699
- };
700
- var AXGridDateColumn_1;
701
- __decorate([
702
- core.Input(),
703
- __metadata("design:type", String)
704
- ], AXGridDateColumn.prototype, "format", void 0);
705
- __decorate([
706
- core.Input(),
707
- __metadata("design:type", String)
708
- ], AXGridDateColumn.prototype, "type", void 0);
709
- AXGridDateColumn = AXGridDateColumn_1 = __decorate([
710
- core.Component({
711
- selector: 'ax-date-column',
712
- template: '',
713
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridDateColumn_1 }],
714
- changeDetection: core.ChangeDetectionStrategy.OnPush
715
- }),
716
- __metadata("design:paramtypes", [])
717
- ], AXGridDateColumn);
718
- return AXGridDateColumn;
719
- }(AXGridDataColumn));
720
- var AXDatePickerFilterComponent = /** @class */ (function () {
721
- function AXDatePickerFilterComponent() {
722
- this.selectableHoliday = false;
723
- this.type = 'jalali';
724
- }
725
- AXDatePickerFilterComponent.prototype.agInit = function (params) {
726
- this.params = params;
727
- };
728
- AXDatePickerFilterComponent.prototype.ngAfterViewInit = function () {
729
- };
730
- AXDatePickerFilterComponent.prototype.ngOnDestroy = function () {
731
- console.log("Destroying DateComponent");
732
- };
733
- AXDatePickerFilterComponent.prototype.onDateChanged = function (selectedDates) {
734
- //this.date = selectedDates[0] || null;
735
- this.params.onDateChanged();
736
- };
737
- AXDatePickerFilterComponent.prototype.getDate = function () {
738
- return this.date;
739
- };
740
- AXDatePickerFilterComponent.prototype.setDate = function (date) {
741
- this.date = date || null;
742
- //this.picker.setDate(date);
743
- };
744
- AXDatePickerFilterComponent.prototype.setInputPlaceholder = function (placeholder) {
745
- //this.div.nativeElement.setAttribute('placeholder', placeholder);
746
- };
747
- AXDatePickerFilterComponent.prototype.onValueChanged = function (e) {
748
- this.setDate(e.value);
749
- this.onDateChanged(e.value);
750
- };
751
- __decorate([
752
- core.ViewChild(components.AXDatePickerComponent),
753
- __metadata("design:type", components.AXDatePickerComponent)
754
- ], AXDatePickerFilterComponent.prototype, "datePicker", void 0);
755
- __decorate([
756
- core.ViewChild('div', { read: core.ElementRef }),
757
- __metadata("design:type", core.ElementRef)
758
- ], AXDatePickerFilterComponent.prototype, "div", void 0);
759
- AXDatePickerFilterComponent = __decorate([
760
- core.Component({
761
- selector: 'ax-data-picker-filter',
762
- template: "<ax-date-picker [selectableHoliday]=\"selectableHoliday\" [allowClear]=\"true\" (onValueChanged)=\"onValueChanged($event)\" size=\"sm\">\n </ax-date-picker>",
763
- host: {},
764
- encapsulation: core.ViewEncapsulation.None
765
- })
766
- ], AXDatePickerFilterComponent);
767
- return AXDatePickerFilterComponent;
768
- }());
769
-
770
- var AXGridSelectionColumn = /** @class */ (function (_super) {
771
- __extends(AXGridSelectionColumn, _super);
772
- function AXGridSelectionColumn() {
773
- var _this = _super.call(this) || this;
774
- _this.pinned = 'start';
775
- _this.width = 40;
776
- return _this;
777
- }
778
- AXGridSelectionColumn_1 = AXGridSelectionColumn;
779
- AXGridSelectionColumn.prototype.ngOnInit = function () { };
780
- AXGridSelectionColumn.prototype.render = function () {
781
- var col = _super.prototype.render.call(this);
782
- col.checkboxSelection = this.condition ? this.condition : true;
783
- // col.headerCheckboxSelection = true;
784
- col.pinned = this.pinned === 'start' ? 'right' : 'left';
785
- col.filter = false;
786
- col.resizable = true;
787
- col.sortable = false;
788
- col.minWidth = 5;
789
- col.width = this.width;
790
- col.floatingFilter = false;
791
- return col;
792
- };
793
- var AXGridSelectionColumn_1;
794
- __decorate([
795
- core.Input(),
796
- __metadata("design:type", Function)
797
- ], AXGridSelectionColumn.prototype, "condition", void 0);
798
- __decorate([
799
- core.Input(),
800
- __metadata("design:type", String)
801
- ], AXGridSelectionColumn.prototype, "pinned", void 0);
802
- __decorate([
803
- core.Input(),
804
- __metadata("design:type", Number)
805
- ], AXGridSelectionColumn.prototype, "width", void 0);
806
- AXGridSelectionColumn = AXGridSelectionColumn_1 = __decorate([
807
- core.Component({
808
- selector: 'ax-selection-column',
809
- template: '',
810
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridSelectionColumn_1 }],
811
- changeDetection: core.ChangeDetectionStrategy.OnPush
812
- }),
813
- __metadata("design:paramtypes", [])
814
- ], AXGridSelectionColumn);
815
- return AXGridSelectionColumn;
816
- }(AXGridDataColumn));
817
-
818
- var AXGridTextColumn = /** @class */ (function (_super) {
819
- __extends(AXGridTextColumn, _super);
820
- function AXGridTextColumn() {
821
- return _super.call(this) || this;
822
- }
823
- AXGridTextColumn_1 = AXGridTextColumn;
824
- AXGridTextColumn.prototype.render = function () {
825
- var col = _super.prototype.render.call(this);
826
- // if (this.allowFiltering) {
827
- // col.filterFramework = TextFilterRenderer;
828
- // }
829
- col.filter = 'agTextColumnFilter';
830
- return col;
831
- };
832
- var AXGridTextColumn_1;
833
- AXGridTextColumn = AXGridTextColumn_1 = __decorate([
834
- core.Component({
835
- selector: 'ax-text-column',
836
- template: '',
837
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridTextColumn_1 }],
838
- changeDetection: core.ChangeDetectionStrategy.OnPush
839
- }),
840
- __metadata("design:paramtypes", [])
841
- ], AXGridTextColumn);
842
- return AXGridTextColumn;
843
- }(AXGridDataColumn));
844
- var TextFilterRenderer = /** @class */ (function () {
845
- function TextFilterRenderer() {
846
- this.value = null;
847
- }
848
- TextFilterRenderer.prototype.agInit = function (params) {
849
- this.params = params;
850
- this.valueGetter = params.valueGetter;
851
- };
852
- TextFilterRenderer.prototype.isFilterActive = function () {
853
- return this.value !== null && this.value !== undefined;
854
- };
855
- TextFilterRenderer.prototype.doesFilterPass = function (params) {
856
- return this.value === this.valueGetter(params.node);
857
- };
858
- TextFilterRenderer.prototype.getModel = function () {
859
- return { value: this.value };
860
- };
861
- TextFilterRenderer.prototype.setModel = function (model) {
862
- ;
863
- this.onChange(model ? model.value : null);
864
- };
865
- TextFilterRenderer.prototype.ngAfterViewInit = function (params) {
866
- var _this = this;
867
- window.setTimeout(function () {
868
- _this.input.focus();
869
- });
870
- };
871
- TextFilterRenderer.prototype.onChange = function (newValue) {
872
- if (this.value !== newValue) {
873
- this.value = newValue;
874
- if (this.value === '') {
875
- this.value = null;
876
- }
877
- this.params.filterChangedCallback();
878
- }
879
- };
880
- __decorate([
881
- core.ViewChild(components.AXTextBoxComponent, { static: true }),
882
- __metadata("design:type", components.AXTextBoxComponent)
883
- ], TextFilterRenderer.prototype, "input", void 0);
884
- TextFilterRenderer = __decorate([
885
- core.Component({
886
- template: "\n <ax-data-grid-filter>\n <ax-text-box label='Filter' allowClear='true' (textChange)='onChange($event)'>\n </ax-text-box>\n </ax-data-grid-filter>\n ",
887
- changeDetection: core.ChangeDetectionStrategy.OnPush
888
- })
889
- ], TextFilterRenderer);
890
- return TextFilterRenderer;
891
- }());
892
-
893
- var AXGridRowNumberColumn = /** @class */ (function (_super) {
894
- __extends(AXGridRowNumberColumn, _super);
895
- function AXGridRowNumberColumn() {
896
- return _super.call(this) || this;
897
- }
898
- AXGridRowNumberColumn_1 = AXGridRowNumberColumn;
899
- AXGridRowNumberColumn.prototype.ngOnInit = function () { };
900
- AXGridRowNumberColumn.prototype.render = function () {
901
- var col = _super.prototype.render.call(this);
902
- // col.checkboxSelection = this.condition ? this.condition : true;
903
- // col.headerCheckboxSelection = true;
904
- (col.headerName = this.caption ? this.caption : core$1.AXConfig.get('layout.rtl') ? 'ردیف' : 'Row'),
905
- (col.valueGetter = 'node.rowIndex + 1'),
906
- (col.pinned = this.pinned == null ? null : this.pinned === 'start' ? 'right' : 'left'),
907
- (col.filter = false);
908
- col.resizable = true;
909
- col.sortable = false;
910
- col.width = this.width;
911
- return col;
912
- };
913
- var AXGridRowNumberColumn_1;
914
- __decorate([
915
- core.Input(),
916
- __metadata("design:type", Function)
917
- ], AXGridRowNumberColumn.prototype, "condition", void 0);
918
- AXGridRowNumberColumn = AXGridRowNumberColumn_1 = __decorate([
919
- core.Component({
920
- selector: 'ax-row-number-column',
921
- template: '',
922
- providers: [{ provide: AXGridDataColumn, useExisting: AXGridRowNumberColumn_1 }],
923
- changeDetection: core.ChangeDetectionStrategy.OnPush
924
- }),
925
- __metadata("design:paramtypes", [])
926
- ], AXGridRowNumberColumn);
927
- return AXGridRowNumberColumn;
928
- }(AXGridDataColumn));
929
-
930
- var AXDataGridRowTemplateComponent = /** @class */ (function () {
931
- function AXDataGridRowTemplateComponent() {
932
- this.renderer = AXDataGridRowTemplateRenderer;
933
- }
934
- AXDataGridRowTemplateComponent.prototype.ngOnInit = function () {
935
- this.params = {
936
- templateRef: this.templateRef
937
- };
938
- };
939
- __decorate([
940
- core.ContentChild(core.TemplateRef, { static: true }),
941
- __metadata("design:type", core.TemplateRef)
942
- ], AXDataGridRowTemplateComponent.prototype, "templateRef", void 0);
943
- AXDataGridRowTemplateComponent = __decorate([
944
- core.Component({
945
- selector: 'ax-row-template',
946
- template: "<ng-content></ng-content>"
947
- }),
948
- __metadata("design:paramtypes", [])
949
- ], AXDataGridRowTemplateComponent);
950
- return AXDataGridRowTemplateComponent;
951
- }());
952
- var AXDataGridRowTemplateRenderer = /** @class */ (function () {
953
- function AXDataGridRowTemplateRenderer() {
954
- }
955
- AXDataGridRowTemplateRenderer.prototype.refresh = function (params) {
956
- return false;
957
- };
958
- AXDataGridRowTemplateRenderer.prototype.agInit = function (params) {
959
- this.data = params.data.callRecords;
960
- this.templateRef = params.templateRef;
961
- };
962
- AXDataGridRowTemplateRenderer = __decorate([
963
- core.Component({
964
- template: "<ng-container *ngTemplateOutlet='templateRef; context: { $implicit: data }'></ng-container>"
965
- })
966
- ], AXDataGridRowTemplateRenderer);
967
- return AXDataGridRowTemplateRenderer;
968
- }());
969
-
970
- var AXDataGridDetailTemplateComponent = /** @class */ (function () {
971
- function AXDataGridDetailTemplateComponent() {
972
- this.height = 100;
973
- this.renderer = AXDataGridDetailTemplateRenderer;
974
- }
975
- AXDataGridDetailTemplateComponent.prototype.ngOnInit = function () {
976
- this.params = {
977
- templateRef: this.templateRef
978
- };
979
- };
980
- __decorate([
981
- core.ContentChild(core.TemplateRef, { static: true }),
982
- __metadata("design:type", core.TemplateRef)
983
- ], AXDataGridDetailTemplateComponent.prototype, "templateRef", void 0);
984
- __decorate([
985
- core.Input(),
986
- __metadata("design:type", Number)
987
- ], AXDataGridDetailTemplateComponent.prototype, "height", void 0);
988
- AXDataGridDetailTemplateComponent = __decorate([
989
- core.Component({
990
- selector: 'ax-grid-detail-template',
991
- template: "<ng-content></ng-content>"
992
- }),
993
- __metadata("design:paramtypes", [])
994
- ], AXDataGridDetailTemplateComponent);
995
- return AXDataGridDetailTemplateComponent;
996
- }());
997
- var AXDataGridDetailTemplateRenderer = /** @class */ (function () {
998
- function AXDataGridDetailTemplateRenderer() {
999
- }
1000
- AXDataGridDetailTemplateRenderer.prototype.refresh = function (params) {
1001
- return false;
1002
- };
1003
- AXDataGridDetailTemplateRenderer.prototype.agInit = function (params) {
1004
- this.data = params.data;
1005
- this.templateRef = params.templateRef;
1006
- };
1007
- AXDataGridDetailTemplateRenderer = __decorate([
1008
- core.Component({
1009
- template: "<ng-container *ngTemplateOutlet='templateRef; context: { $implicit: data }'></ng-container>"
1010
- })
1011
- ], AXDataGridDetailTemplateRenderer);
1012
- return AXDataGridDetailTemplateRenderer;
1013
- }());
1014
-
1015
- agGridEnterprise.LicenseManager.prototype.validateLicense = function () {
1016
- //console.info('Cracked by Arash Oshnoudi!');
1017
- };
1018
- // WatermarkComp.prototype.shouldDisplayWatermark = function () {
1019
- // return false;
1020
- // }
1021
- var AXDataGridColumnsChangeEvent = /** @class */ (function (_super) {
1022
- __extends(AXDataGridColumnsChangeEvent, _super);
1023
- function AXDataGridColumnsChangeEvent() {
1024
- return _super !== null && _super.apply(this, arguments) || this;
1025
- }
1026
- return AXDataGridColumnsChangeEvent;
1027
- }(components.AXValueEvent));
1028
- var AXDataGridCellEvent = /** @class */ (function (_super) {
1029
- __extends(AXDataGridCellEvent, _super);
1030
- function AXDataGridCellEvent() {
1031
- return _super !== null && _super.apply(this, arguments) || this;
1032
- }
1033
- return AXDataGridCellEvent;
1034
- }(components.AXDataEvent));
1035
- var AXDaagridRowClickEvent = /** @class */ (function (_super) {
1036
- __extends(AXDaagridRowClickEvent, _super);
1037
- function AXDaagridRowClickEvent() {
1038
- return _super !== null && _super.apply(this, arguments) || this;
1039
- }
1040
- return AXDaagridRowClickEvent;
1041
- }(components.AXDataEvent));
1042
- var AXDataGridSelectionChangeEvent = /** @class */ (function (_super) {
1043
- __extends(AXDataGridSelectionChangeEvent, _super);
1044
- function AXDataGridSelectionChangeEvent() {
1045
- return _super !== null && _super.apply(this, arguments) || this;
1046
- }
1047
- return AXDataGridSelectionChangeEvent;
1048
- }(components.AXDataEvent));
1049
- var AXDataGridRowSelectionChangeEvent = /** @class */ (function (_super) {
1050
- __extends(AXDataGridRowSelectionChangeEvent, _super);
1051
- function AXDataGridRowSelectionChangeEvent() {
1052
- return _super !== null && _super.apply(this, arguments) || this;
1053
- }
1054
- return AXDataGridRowSelectionChangeEvent;
1055
- }(components.AXDataEvent));
1056
- var AXDataGridComponent = /** @class */ (function () {
1057
- function AXDataGridComponent(ref, cdr) {
1058
- var _this = this;
1059
- this.ref = ref;
1060
- this.cdr = cdr;
1061
- this.columnDefs = [];
1062
- this.rowModelType = 'clientSide';
1063
- this.frameworkComponents = {};
1064
- this.internalHeight = '100%';
1065
- this.masterDetail = false;
1066
- this.treeData = false;
1067
- this.enabelSelect = false;
1068
- this.gridView = false;
1069
- this.groupSelectsChildren = false;
1070
- this.oldSelectionNodes = [];
1071
- this.paginationAutoPageSize = true;
1072
- this.paginationPageSize = 10;
1073
- this.cacheBlockSize = 10;
1074
- // @Input()
1075
- // showRowNumber: boolean = true;
1076
- this.remoteOperation = false;
1077
- this.rowMultiSelectWithClick = true;
1078
- this.suppressRowClickSelection = true;
1079
- this.suppressCellSelection = false;
1080
- this.sizeColumnsToFit = true;
1081
- this.showCheckBox = true;
1082
- this.floatingFilter = false;
1083
- // @Input()
1084
- // takeCount: number;
1085
- this.autoGroupColumnDef = {};
1086
- this.selectionMode = 'single';
1087
- // @Input()
1088
- // allowFiltering: boolean = false;
1089
- this.selectRow = [];
1090
- this.rowGroupPanelShow = 'never';
1091
- this.loadOnInit = true;
1092
- // @Input()
1093
- // groupDefaultExpanded: number = 0;
1094
- this.keyField = 'null';
1095
- this.hasChildField = 'null';
1096
- this.columnsChange = new core.EventEmitter();
1097
- this._columns = [];
1098
- this.defaultColDef = {
1099
- filter: true,
1100
- floatingFilter: true
1101
- };
1102
- this.groupHideOpenParents = false;
1103
- this.cellClick = new core.EventEmitter();
1104
- this.cellDbClick = new core.EventEmitter();
1105
- this.cellFocuse = new core.EventEmitter();
1106
- this.rowClick = new core.EventEmitter();
1107
- this.rowDbClick = new core.EventEmitter();
1108
- this.selectionChanged = new core.EventEmitter();
1109
- this.rowSelectionChange = new core.EventEmitter();
1110
- this.onRowSelectionChanged = new core.EventEmitter();
1111
- this.rtl = core$1.AXConfig.get('layout.rtl');
1112
- this.isServerSideGroup = function (e) {
1113
- return e[_this.hasChildField];
1114
- };
1115
- this.getColumnDefs = function () {
1116
- return _this.gridApi.getColumnDefs();
1117
- };
1118
- this.getCurrentPageNumber = function () {
1119
- return {
1120
- current: _this.gridApi.paginationGetCurrentPage() + 1,
1121
- total: _this.gridApi.paginationGetTotalPages()
1122
- };
1123
- };
1124
- this.getServerSideGroupKey = function (e) {
1125
- return e[_this.keyField];
1126
- };
1127
- this.internalGetRowClass = function (p) {
1128
- if (_this.rowClass) {
1129
- if (_this.rowClass instanceof Function) {
1130
- return _this.rowClass({
1131
- rowIndex: p.node.rowIndex,
1132
- rowLevel: p.node.level,
1133
- data: p.data
1134
- });
1135
- }
1136
- else {
1137
- return _this.rowClass;
1138
- }
1139
- }
1140
- };
1141
- this.localeText = core$1.AXTranslator.get('dataGrid');
1142
- }
1143
- Object.defineProperty(AXDataGridComponent.prototype, "searchText", {
1144
- get: function () {
1145
- return this._searchText;
1146
- },
1147
- set: function (v) {
1148
- if (v !== this._searchText) {
1149
- this._searchText = v;
1150
- if (this.gridApi) {
1151
- this.refresh();
1152
- this.gridApi.setQuickFilter(this.searchText);
1153
- }
1154
- }
1155
- },
1156
- enumerable: true,
1157
- configurable: true
1158
- });
1159
- Object.defineProperty(AXDataGridComponent.prototype, "filter", {
1160
- get: function () {
1161
- return this._filter;
1162
- },
1163
- set: function (v) {
1164
- var _this = this;
1165
- if (v !== this._filter) {
1166
- this._filter = v;
1167
- this._filter.forEach(function (f) {
1168
- var fc = _this.gridApi.getFilterInstance(f.field);
1169
- if (fc) {
1170
- var ff = fc.getFrameworkComponentInstance();
1171
- ff.setModel(f);
1172
- }
1173
- });
1174
- }
1175
- },
1176
- enumerable: true,
1177
- configurable: true
1178
- });
1179
- Object.defineProperty(AXDataGridComponent.prototype, "columns", {
1180
- get: function () {
1181
- return this._inlineColumns ? __spread(this._columns, this._inlineColumns.toArray()) : this._columns;
1182
- },
1183
- set: function (val) {
1184
- if (val && val.length) {
1185
- var old = this._columns;
1186
- this._columns = val;
1187
- this.columnsChange.emit({ component: this, value: val, oldValue: old, htmlElement: this.ref.nativeElement });
1188
- }
1189
- },
1190
- enumerable: true,
1191
- configurable: true
1192
- });
1193
- Object.defineProperty(AXDataGridComponent.prototype, "dataSource", {
1194
- get: function () {
1195
- return this._dataSource ? this._dataSource : this._contentDataSource;
1196
- },
1197
- set: function (v) {
1198
- this._dataSource = v;
1199
- },
1200
- enumerable: true,
1201
- configurable: true
1202
- });
1203
- AXDataGridComponent.prototype.getRowHeight = function (param) {
1204
- if (param.data && param.data.rowHeight && param.node.level == 0) {
1205
- return param.data.rowHeight;
1206
- }
1207
- else if (this.masterDetail == true && param.node.level == 1) {
1208
- return this.detailRowHeight;
1209
- }
1210
- else if (this.masterDetail == false && param.data && param.data.rowHeight) {
1211
- return param.data.rowHeight;
1212
- }
1213
- else {
1214
- return null;
1215
- }
1216
- };
1217
- AXDataGridComponent.prototype.calcHeight = function () {
1218
- if (this.toolbar) {
1219
- this.internalHeight = "calc(100% - " + 40 + "px)";
1220
- }
1221
- else {
1222
- this.internalHeight = '100%';
1223
- }
1224
- };
1225
- Object.defineProperty(AXDataGridComponent.prototype, "intenalGridDataSource", {
1226
- get: function () {
1227
- var that = this;
1228
- return {
1229
- rowCount: null,
1230
- getRows: function (params) {
1231
- // that.gridApi.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount ? this.takeCount : params.api.paginationGetPageSize());
1232
- that.dataSourceSuccessCallback = params.successCallback;
1233
- var loadParams = {};
1234
- loadParams.searchText = that.searchText;
1235
- loadParams.skip = params.request.startRow;
1236
- // loadParams.take = params.request.endRow - params.request.startRow;
1237
- //// loadParams.take = that.takeCount ? that.takeCount : params.api.paginationGetPageSize() * 2;
1238
- loadParams.take = params.request.endRow - params.request.startRow;
1239
- loadParams.sort = params.request.sortModel.map(function (c) {
1240
- return {
1241
- field: c.colId,
1242
- dir: c.sort
1243
- };
1244
- });
1245
- // loadParams.groups = params.request.rowGroupCols.map(r => r.field);
1246
- // loadParams.groupKeys = params.request.groupKeys;
1247
- // loadParams.data = params.parentNode.data;
1248
- loadParams.group = {
1249
- fields: params.request.rowGroupCols.map(function (r) { return r.field; }),
1250
- keys: params.request.groupKeys,
1251
- parentData: params.parentNode.data
1252
- };
1253
- loadParams.filter = params.request.filterModel;
1254
- debugger;
1255
- /// setTimeout(() => {
1256
- that.dataSource.fetch(loadParams);
1257
- // }, 5000);
1258
- }
1259
- };
1260
- },
1261
- enumerable: true,
1262
- configurable: true
1263
- });
1264
- AXDataGridComponent.prototype.getMainMenuItems = function (e) {
1265
- return ['pinSubMenu', 'separator'];
1266
- };
1267
- AXDataGridComponent.prototype.ngOnDestroy = function () {
1268
- this.gridApi.destroy();
1269
- };
1270
- AXDataGridComponent.prototype.paginationGoToPage = function (number) {
1271
- this.gridApi.paginationGoToPage(number - 1);
1272
- };
1273
- // todo gridOptions: GridOptions
1274
- AXDataGridComponent.prototype.internalGridReady = function (gridOptions) {
1275
- //// gridOptions.api.checkGridSize();
1276
- //// this.takeCount = this.takeCount ? this.takeCount : gridOptions.api.paginationGetPageSize() * 2;
1277
- // this.takeCount = this.takeCount < 20 ? 20 : this.takeCount;
1278
- //// gridOptions.api.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount);
1279
- this.gridApi = gridOptions.api;
1280
- this.mapColumns();
1281
- this.calcHeight();
1282
- if (!this.loadOnInit) {
1283
- this.loadOnInit = true;
1284
- return;
1285
- }
1286
- if (this.remoteOperation) {
1287
- this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
1288
- }
1289
- if (!this.remoteOperation) {
1290
- this.refresh();
1291
- }
1292
- };
1293
- AXDataGridComponent.prototype.ngAfterContentInit = function () {
1294
- var that = this;
1295
- if (this.rowTemplate) {
1296
- this.fullWidthCellRendererFramework = this.rowTemplate.renderer;
1297
- this.fullWidthCellRendererParams = this.rowTemplate.params;
1298
- }
1299
- this.frameworkComponents.agDateInput = AXDatePickerFilterComponent;
1300
- if (this.gridDetailTemplate) {
1301
- this.masterDetail = true;
1302
- this.detailCellRendererParams = this.gridDetailTemplate.params;
1303
- this.detailCellRenderer = 'detailRendererFramework';
1304
- this.frameworkComponents.detailRendererFramework = this.gridDetailTemplate.renderer;
1305
- this.detailRowHeight = this.gridDetailTemplate.height;
1306
- }
1307
- this.isFullWidthCell = function () {
1308
- return that.rowTemplate != null;
1309
- };
1310
- //this.cdr
1311
- };
1312
- AXDataGridComponent.prototype.ngOnInit = function () {
1313
- // if (this.takeCount && this.takeCount > 0) {
1314
- // this.paginationPageSize = this.takeCount;
1315
- // this.paginationAutoPageSize = false;
1316
- // this.cacheBlockSize = this.takeCount;
1317
- // }
1318
- if (this.selectionMode === 'single') {
1319
- this.groupSelectsChildren = false;
1320
- }
1321
- if (this.keyField !== 'null' && this.hasChildField !== 'null') {
1322
- this.rowGroupPanelShow = 'never';
1323
- this.treeData = true;
1324
- }
1325
- if (this.remoteOperation) {
1326
- this.rowModelType = 'serverSide';
1327
- }
1328
- //
1329
- if (this.rtl == null) {
1330
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
1331
- }
1332
- //
1333
- };
1334
- AXDataGridComponent.prototype.gridSelectRow = function () {
1335
- var _this = this;
1336
- if (this.gridApi) {
1337
- if (this.selectRow && this.selectRow.length > 0 && this.gridApi !== undefined && typeof this.selectRow[0] != 'object') {
1338
- this.gridApi.forEachNode(function (node) {
1339
- if (node.data !== undefined) {
1340
- var select_1 = false;
1341
- _this.selectRow.forEach(function (id) {
1342
- if (node.data[_this.keyField] === id) {
1343
- select_1 = true;
1344
- node.setSelected(select_1);
1345
- }
1346
- });
1347
- }
1348
- });
1349
- }
1350
- else {
1351
- this.gridApi.forEachNode(function (node) {
1352
- if (node.data !== undefined) {
1353
- var select_2 = false;
1354
- _this.selectRow.forEach(function (item) {
1355
- if (item.rowIndex != undefined && item.rowLevel != undefined) {
1356
- if (node.data[_this.keyField] === item.data[_this.keyField]) {
1357
- select_2 = true;
1358
- }
1359
- }
1360
- else {
1361
- if (node.data[_this.keyField] === item[_this.keyField]) {
1362
- select_2 = true;
1363
- }
1364
- }
1365
- });
1366
- node.setSelected(select_2);
1367
- }
1368
- });
1369
- }
1370
- }
1371
- };
1372
- // ngAfterViewChecked(): void {
1373
- // //Called after every check of the component's view. Applies to components only.
1374
- // //Add 'implements AfterViewChecked' to the class.
1375
- // // this.selectByValues();
1376
- // this.enabelSelect = false;
1377
- // }
1378
- AXDataGridComponent.prototype.rebuildGrid = function () {
1379
- var _this = this;
1380
- this.mapColumns();
1381
- setTimeout(function () {
1382
- if (_this.sizeColumnsToFit) {
1383
- _this.gridApi.sizeColumnsToFit();
1384
- }
1385
- }, 10);
1386
- };
1387
- AXDataGridComponent.prototype.ngAfterViewInit = function () {
1388
- var _this = this;
1389
- if (this.treeData === true) {
1390
- this.columnDefs = this.columns.map(function (c) { return c.render(); });
1391
- var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex == '0' && c.field !== ''; });
1392
- this.autoGroupColumnDef = {
1393
- headerName: groupColumn.headerName,
1394
- width: groupColumn.width,
1395
- cellRendererParams: { checkbox: this.showCheckBox },
1396
- field: groupColumn.field
1397
- };
1398
- this.columnDefs.forEach(function (elm) {
1399
- if (elm.rowGroupIndex > -1) {
1400
- elm.hide = true;
1401
- }
1402
- });
1403
- }
1404
- //setTimeout(() => {
1405
- this.gridView = true;
1406
- //});
1407
- this.enabelSelect = true;
1408
- this.dataSource.onDataReceived.subscribe(function (_data) {
1409
- debugger;
1410
- var result = _data.data.result;
1411
- _this.hideLoading();
1412
- var items;
1413
- var totalCount;
1414
- if (Array.isArray(result)) {
1415
- items = result;
1416
- totalCount = result.length;
1417
- }
1418
- else {
1419
- items = result.items;
1420
- totalCount = result.totalCount;
1421
- }
1422
- if (_this.dataSourceSuccessCallback) {
1423
- if (!_this.loadOnInit) {
1424
- _this.dataSourceSuccessCallback([], 0);
1425
- }
1426
- else {
1427
- _this.dataSourceSuccessCallback(items, totalCount);
1428
- }
1429
- }
1430
- else {
1431
- if (!_this.loadOnInit && _this.gridApi !== undefined) {
1432
- _this.gridApi.setRowData([]);
1433
- }
1434
- else if (_this.gridApi !== undefined) {
1435
- _this.gridApi.setRowData(items);
1436
- }
1437
- }
1438
- _this.gridSelectRow();
1439
- });
1440
- this.dataSource.onFetchStart.subscribe(function () {
1441
- _this.showLoading();
1442
- });
1443
- if (this.searchInput) {
1444
- this.searchInput.onValueChanged.subscribe(function (c) {
1445
- _this.searchText = c.value;
1446
- });
1447
- }
1448
- //
1449
- this.cdr.detectChanges();
1450
- };
1451
- AXDataGridComponent.prototype.mapColumns = function () {
1452
- this.columnDefs = this.columns.map(function (c) { return c.render(); });
1453
- // if (this.showRowNumber) {
1454
- // this.columnDefs.push({
1455
- // headerName: AXConfig.get('layout.rtl') ? 'ردیف' : 'Row',
1456
- // valueGetter: 'node.rowIndex + 1',
1457
- // pinned: AXConfig.get('layout.rtl') ? 'right' : 'left'
1458
- // });
1459
- // }
1460
- if (this.gridDetailTemplate) {
1461
- if (this.columnDefs[0].checkboxSelection === true && this.columnDefs[0].field === '') {
1462
- this.columnDefs[1].cellRenderer = 'agGroupCellRenderer';
1463
- }
1464
- else {
1465
- this.columnDefs[0].cellRenderer = 'agGroupCellRenderer';
1466
- }
1467
- }
1468
- if (this.hasChildField === 'null') {
1469
- var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex === undefined && c.field !== ''; });
1470
- if (groupColumn && this.groupHideOpenParents == false) {
1471
- this.autoGroupColumnDef = {
1472
- headerName: groupColumn.headerName,
1473
- width: groupColumn.width,
1474
- cellRendererParams: { checkbox: this.showCheckBox },
1475
- field: groupColumn.field
1476
- };
1477
- // groupColumn.hide = true;
1478
- }
1479
- }
1480
- this.columnDefs.forEach(function (elm) {
1481
- if (elm.rowGroupIndex > -1) {
1482
- elm.hide = true;
1483
- }
1484
- });
1485
- };
1486
- AXDataGridComponent.prototype.displayedColumnsChanged = function (e) {
1487
- if (this.hasChildField === 'null') {
1488
- var ee = e.columnApi.getAllDisplayedColumnGroups();
1489
- var eee = ee.find(function (c) { return c.colId !== 'ag-Grid-AutoColumn' && c.colId !== '0'; });
1490
- if (eee && eee.colId) {
1491
- this.autoGroupColumnDef = {
1492
- headerName: eee.colDef.headerName,
1493
- width: eee.colDef.width,
1494
- cellRendererParams: { checkbox: this.showCheckBox },
1495
- field: eee.colDef.field
1496
- };
1497
- }
1498
- // eee.hide = true;
1499
- }
1500
- };
1501
- AXDataGridComponent.prototype.refresh = function (route) {
1502
- if (route === void 0) { route = []; }
1503
- if (this.remoteOperation && this.gridApi !== undefined) {
1504
- // this.gridApi.purgeServerSideCache(route);
1505
- this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
1506
- }
1507
- else {
1508
- // TODO : check fetch param
1509
- this.dataSource.fetch(null);
1510
- }
1511
- };
1512
- AXDataGridComponent.prototype.internalGridCellClicked = function (e) {
1513
- this.cellClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
1514
- };
1515
- AXDataGridComponent.prototype.internalGridCellDoubleClicked = function (e) {
1516
- this.cellDbClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
1517
- };
1518
- AXDataGridComponent.prototype.internalGridCellFocused = function (e) {
1519
- this.cellFocuse.emit({ data: this.mapCellEvent(e), htmlElement: this.ref.nativeElement, component: this });
1520
- };
1521
- AXDataGridComponent.prototype.internalGridRowClicked = function (e) {
1522
- if (!e.node.group) {
1523
- this.rowClick.emit({ data: this.mapRowEvent(e), component: this, htmlElement: this.ref.nativeElement });
1524
- }
1525
- };
1526
- AXDataGridComponent.prototype.internalGridRowDoubleClicked = function (e) {
1527
- if (!e.node.group) {
1528
- this.rowDbClick.emit({ data: this.mapRowEvent(e), htmlElement: this.ref.nativeElement, component: this });
1529
- }
1530
- };
1531
- AXDataGridComponent.prototype.differenceOf2Arrays = function (array1, array2) {
1532
- var temp = [];
1533
- for (var i in array1) {
1534
- if (array2.indexOf(array1[i]) === -1) {
1535
- temp.push(array1[i]);
1536
- }
1537
- }
1538
- for (var i in array2) {
1539
- if (array1.indexOf(array2[i]) === -1) {
1540
- temp.push(array2[i]);
1541
- }
1542
- }
1543
- return temp.sort(function (a, b) { return a - b; });
1544
- };
1545
- AXDataGridComponent.prototype.rowSelectionChanged = function (e) {
1546
- var _this = this;
1547
- // this.gridApi.forEachNode((node) => {
1548
- // if (node.data[this.keyField] == e.node.data[this.keyField]) {
1549
- // node.setSelected(e.node.selected);
1550
- // }
1551
- // });
1552
- if (e.node.selected == true) {
1553
- this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
1554
- this.selectRow.push(e.data);
1555
- }
1556
- else {
1557
- this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
1558
- }
1559
- this.rowSelectionChange.emit({ component: this, data: e, htmlElement: this.ref.nativeElement });
1560
- // console.log('e', e);
1561
- // console.log('select', e.node.selected);
1562
- // console.log('index', e.rowIndex);
1563
- };
1564
- AXDataGridComponent.prototype.internalGridSelectionChanged = function (e) {
1565
- var args = { items: [] };
1566
- var oldNodes = this.oldSelectionNodes;
1567
- var nodes = this.gridApi.getSelectedNodes();
1568
- nodes.forEach(function (i) {
1569
- args.items.push({
1570
- rowLevel: i.level,
1571
- rowIndex: i.rowIndex,
1572
- data: i.data
1573
- });
1574
- });
1575
- this.selectionChanged.emit({ data: args, component: this, htmlElement: this.ref.nativeElement });
1576
- var action = nodes.length > oldNodes.length ? true : false;
1577
- var node = this.differenceOf2Arrays(nodes, oldNodes);
1578
- this.onRowSelectionChanged.emit({ component: this, selected: action, data: node, htmlElement: this.ref.nativeElement });
1579
- this.oldSelectionNodes = nodes;
1580
- };
1581
- AXDataGridComponent.prototype.mapCellEvent = function (e) {
1582
- return {
1583
- rowLevel: 0,
1584
- column: e.column,
1585
- data: e.data,
1586
- rowIndex: e.rowIndex,
1587
- value: e.value
1588
- };
1589
- };
1590
- AXDataGridComponent.prototype.mapRowEvent = function (e) {
1591
- return {
1592
- rowLevel: 0,
1593
- data: e.data,
1594
- rowIndex: e.rowIndex
1595
- };
1596
- };
1597
- AXDataGridComponent.prototype.deselectAll = function () {
1598
- this.gridApi.deselectAll();
1599
- };
1600
- AXDataGridComponent.prototype.showLoading = function () {
1601
- if (this.gridApi) {
1602
- this.gridApi.showLoadingOverlay();
1603
- }
1604
- };
1605
- AXDataGridComponent.prototype.hideLoading = function () {
1606
- if (this.gridApi) {
1607
- this.gridApi.hideOverlay();
1608
- }
1609
- };
1610
- AXDataGridComponent.prototype.internalGridSizeChanged = function (e) {
1611
- if (e.clientWidth > 0 && e.clientHeight > 0) {
1612
- this.performSizeColumnsToFit(e.api);
1613
- }
1614
- // this.refresh();
1615
- // this.gridApi.paginationGoToFirstPage();
1616
- };
1617
- AXDataGridComponent.prototype.internalGridFirstDataRendered = function (e) {
1618
- this.performSizeColumnsToFit(e.api);
1619
- };
1620
- AXDataGridComponent.prototype.performSizeColumnsToFit = function (api) {
1621
- if (this.sizeColumnsToFit) {
1622
- api.sizeColumnsToFit();
1623
- }
1624
- };
1625
- AXDataGridComponent.ctorParameters = function () { return [
1626
- { type: core.ElementRef },
1627
- { type: core.ChangeDetectorRef }
1628
- ]; };
1629
- __decorate([
1630
- core.Input(),
1631
- __metadata("design:type", Boolean)
1632
- ], AXDataGridComponent.prototype, "remoteOperation", void 0);
1633
- __decorate([
1634
- core.Input(),
1635
- __metadata("design:type", Boolean)
1636
- ], AXDataGridComponent.prototype, "rowMultiSelectWithClick", void 0);
1637
- __decorate([
1638
- core.Input(),
1639
- __metadata("design:type", Boolean)
1640
- ], AXDataGridComponent.prototype, "suppressRowClickSelection", void 0);
1641
- __decorate([
1642
- core.Input(),
1643
- __metadata("design:type", Boolean)
1644
- ], AXDataGridComponent.prototype, "suppressCellSelection", void 0);
1645
- __decorate([
1646
- core.Input(),
1647
- __metadata("design:type", Boolean)
1648
- ], AXDataGridComponent.prototype, "sizeColumnsToFit", void 0);
1649
- __decorate([
1650
- core.Input(),
1651
- __metadata("design:type", Boolean)
1652
- ], AXDataGridComponent.prototype, "showCheckBox", void 0);
1653
- __decorate([
1654
- core.Input(),
1655
- __metadata("design:type", Boolean)
1656
- ], AXDataGridComponent.prototype, "floatingFilter", void 0);
1657
- __decorate([
1658
- core.Input(),
1659
- __metadata("design:type", String)
1660
- ], AXDataGridComponent.prototype, "selectionMode", void 0);
1661
- __decorate([
1662
- core.Input(),
1663
- __metadata("design:type", Array)
1664
- ], AXDataGridComponent.prototype, "selectRow", void 0);
1665
- __decorate([
1666
- core.Input(),
1667
- __metadata("design:type", String)
1668
- ], AXDataGridComponent.prototype, "rowGroupPanelShow", void 0);
1669
- __decorate([
1670
- core.Input(),
1671
- __metadata("design:type", Boolean)
1672
- ], AXDataGridComponent.prototype, "loadOnInit", void 0);
1673
- __decorate([
1674
- core.Input(),
1675
- __metadata("design:type", String)
1676
- ], AXDataGridComponent.prototype, "keyField", void 0);
1677
- __decorate([
1678
- core.Input(),
1679
- __metadata("design:type", String)
1680
- ], AXDataGridComponent.prototype, "hasChildField", void 0);
1681
- __decorate([
1682
- core.Input(),
1683
- __metadata("design:type", String),
1684
- __metadata("design:paramtypes", [String])
1685
- ], AXDataGridComponent.prototype, "searchText", null);
1686
- __decorate([
1687
- core.Input(),
1688
- __metadata("design:type", Array),
1689
- __metadata("design:paramtypes", [Array])
1690
- ], AXDataGridComponent.prototype, "filter", null);
1691
- __decorate([
1692
- core.ContentChildren(AXGridDataColumn),
1693
- __metadata("design:type", core.QueryList)
1694
- ], AXDataGridComponent.prototype, "_inlineColumns", void 0);
1695
- __decorate([
1696
- core.Output(),
1697
- __metadata("design:type", core.EventEmitter)
1698
- ], AXDataGridComponent.prototype, "columnsChange", void 0);
1699
- __decorate([
1700
- core.Input(),
1701
- __metadata("design:type", Array),
1702
- __metadata("design:paramtypes", [Array])
1703
- ], AXDataGridComponent.prototype, "columns", null);
1704
- __decorate([
1705
- core.Input(),
1706
- __metadata("design:type", Object)
1707
- ], AXDataGridComponent.prototype, "rowHeight", void 0);
1708
- __decorate([
1709
- core.ContentChild(components.AXToolbarSearchComponent, { static: true }),
1710
- __metadata("design:type", components.AXToolbarSearchComponent)
1711
- ], AXDataGridComponent.prototype, "searchInput", void 0);
1712
- __decorate([
1713
- core.ContentChild(components.AXToolbarComponent, { static: true }),
1714
- __metadata("design:type", components.AXToolbarComponent)
1715
- ], AXDataGridComponent.prototype, "toolbar", void 0);
1716
- __decorate([
1717
- core.ContentChild(AXDataGridRowTemplateComponent, { static: true }),
1718
- __metadata("design:type", AXDataGridRowTemplateComponent)
1719
- ], AXDataGridComponent.prototype, "rowTemplate", void 0);
1720
- __decorate([
1721
- core.ContentChild(AXDataGridDetailTemplateComponent, { static: true }),
1722
- __metadata("design:type", AXDataGridDetailTemplateComponent)
1723
- ], AXDataGridComponent.prototype, "gridDetailTemplate", void 0);
1724
- __decorate([
1725
- core.ContentChild(components.AXDataSourceComponent, { static: true }),
1726
- __metadata("design:type", components.AXDataSourceComponent)
1727
- ], AXDataGridComponent.prototype, "_contentDataSource", void 0);
1728
- __decorate([
1729
- core.Input(),
1730
- __metadata("design:type", components.AXDataSourceComponent),
1731
- __metadata("design:paramtypes", [components.AXDataSourceComponent])
1732
- ], AXDataGridComponent.prototype, "dataSource", null);
1733
- __decorate([
1734
- core.Input(),
1735
- __metadata("design:type", Boolean)
1736
- ], AXDataGridComponent.prototype, "groupHideOpenParents", void 0);
1737
- __decorate([
1738
- core.Output(),
1739
- __metadata("design:type", core.EventEmitter)
1740
- ], AXDataGridComponent.prototype, "cellClick", void 0);
1741
- __decorate([
1742
- core.Output(),
1743
- __metadata("design:type", core.EventEmitter)
1744
- ], AXDataGridComponent.prototype, "cellDbClick", void 0);
1745
- __decorate([
1746
- core.Output(),
1747
- __metadata("design:type", core.EventEmitter)
1748
- ], AXDataGridComponent.prototype, "cellFocuse", void 0);
1749
- __decorate([
1750
- core.Output(),
1751
- __metadata("design:type", core.EventEmitter)
1752
- ], AXDataGridComponent.prototype, "rowClick", void 0);
1753
- __decorate([
1754
- core.Output(),
1755
- __metadata("design:type", core.EventEmitter)
1756
- ], AXDataGridComponent.prototype, "rowDbClick", void 0);
1757
- __decorate([
1758
- core.Output(),
1759
- __metadata("design:type", core.EventEmitter)
1760
- ], AXDataGridComponent.prototype, "selectionChanged", void 0);
1761
- __decorate([
1762
- core.Output(),
1763
- __metadata("design:type", core.EventEmitter)
1764
- ], AXDataGridComponent.prototype, "rowSelectionChange", void 0);
1765
- __decorate([
1766
- core.Output(),
1767
- __metadata("design:type", core.EventEmitter)
1768
- ], AXDataGridComponent.prototype, "onRowSelectionChanged", void 0);
1769
- __decorate([
1770
- core.Input(),
1771
- __metadata("design:type", Function)
1772
- ], AXDataGridComponent.prototype, "rowClass", void 0);
1773
- __decorate([
1774
- core.Input(),
1775
- __metadata("design:type", Boolean)
1776
- ], AXDataGridComponent.prototype, "rtl", void 0);
1777
- AXDataGridComponent = __decorate([
1778
- core.Component({
1779
- selector: 'ax-data-grid',
1780
- template: "<div class=\"ax-grid-toolbar\" *ngIf=\"toolbar\">\r\n <ng-content select=\"ax-toolbar\"></ng-content>\r\n</div>\r\n<!-- [enableSorting]=\"true\" [enableColResize]=\"true\" [enableFilter]=\"allowFiltering\" -->\r\n<ag-grid-angular *ngIf=\"gridView\" class=\"ag-theme-balham\" [getRowClass]=\"internalGetRowClass\"\r\n [style.height]=\"internalHeight\" [columnDefs]=\"columnDefs\" [enableRtl]=\"rtl\" [pagination]=\"true\"\r\n [rowGroupPanelShow]=\"rowGroupPanelShow\" [rowModelType]=\"rowModelType\" [detailRowHeight]=\"detailRowHeight\"\r\n [getRowHeight]=\"getRowHeight\" [paginationAutoPageSize]=\"paginationAutoPageSize\"\r\n [paginationPageSize]=\"paginationPageSize\" [suppressMenuHide]=\"true\" [frameworkComponents]=\"frameworkComponents\"\r\n [isFullWidthCell]=\"isFullWidthCell\" [rowSelection]=\"selectionMode\" [rowMultiSelectWithClick]=\"rowMultiSelectWithClick\"\r\n [fullWidthCellRendererFramework]=\"fullWidthCellRendererFramework\"\r\n [fullWidthCellRendererParams]=\"fullWidthCellRendererParams\" (cellClicked)=\"internalGridCellClicked($event)\"\r\n (cellDoubleClicked)=\"internalGridCellDoubleClicked($event)\" (cellFocused)=\"internalGridCellFocused($event)\"\r\n (rowClicked)=\"internalGridRowClicked($event)\" (selectionChanged)=\"internalGridSelectionChanged($event)\"\r\n (rowSelected)=\"rowSelectionChanged($event)\" (rowDoubleClicked)=\"internalGridRowDoubleClicked($event)\"\r\n (gridReady)=\"internalGridReady($event)\" [groupSelectsChildren]=\"groupSelectsChildren\"\r\n [suppressRowClickSelection]=\"suppressRowClickSelection\" [groupSelectsFiltered]=\"true\"\r\n [suppressCellSelection]=\"suppressCellSelection\" [autoGroupColumnDef]=\"autoGroupColumnDef\"\r\n [suppressAggFuncInHeader]=\"true\" [treeData]=\"treeData\" [animateRows]=\"true\" [isServerSideGroup]=\"isServerSideGroup\"\r\n [getServerSideGroupKey]=\"getServerSideGroupKey\" [masterDetail]=\"masterDetail\"\r\n [detailCellRendererParams]=\"detailCellRendererParams\" [detailCellRenderer]=\"detailCellRenderer\"\r\n (gridSizeChanged)=\"internalGridSizeChanged($event)\" (firstDataRendered)=\"internalGridFirstDataRendered($event)\"\r\n [localeText]=\"localeText\" [groupHideOpenParents]=\"groupHideOpenParents\" [enableRangeSelection]=\"true\"\r\n [enableRangeSelection]=\"false\" [allowContextMenuWithControlKey]=\"false\" [getMainMenuItems]=\"getMainMenuItems\">\r\n</ag-grid-angular>\r\n\r\n<!-- (displayedColumnsChanged)=\"displayedColumnsChanged($event)\" -->",
1781
- encapsulation: core.ViewEncapsulation.None
1782
- // changeDetection: ChangeDetectionStrategy.OnPush
1783
- }),
1784
- __metadata("design:paramtypes", [core.ElementRef, core.ChangeDetectorRef])
1785
- ], AXDataGridComponent);
1786
- return AXDataGridComponent;
1787
- }());
1788
-
1789
- var AXDataGridFilterComponent = /** @class */ (function () {
1790
- function AXDataGridFilterComponent() {
1791
- }
1792
- AXDataGridFilterComponent = __decorate([
1793
- core.Component({
1794
- selector: 'ax-data-grid-filter',
1795
- template: "\n <div class='ax-grid-filter-container'>\n <ng-content></ng-content>\n <div class='btn-group' role='group'>\n <button type='button' class='btn btn-primary btn-sm'>\n <i class='fas fa-filter'></i>\n </button>\n <button type='button' class='btn btn-danger btn-sm'>\n <i class='fas fa-trash-alt'></i>\n </button>\n </div>\n </div>\n ",
1796
- encapsulation: core.ViewEncapsulation.None
1797
- })
1798
- ], AXDataGridFilterComponent);
1799
- return AXDataGridFilterComponent;
1800
- }());
1801
-
1802
- var AXDataGridModule = /** @class */ (function () {
1803
- function AXDataGridModule() {
1804
- }
1805
- AXDataGridModule = __decorate([
1806
- core.NgModule({
1807
- declarations: [
1808
- AXDataGridComponent,
1809
- AXGridTextColumn,
1810
- AXGridCheckColumn,
1811
- AXGridSelectionColumn,
1812
- AXGridDateColumn,
1813
- AXGridRowNumberColumn,
1814
- AXGridCommandColumn,
1815
- BooleanRenderer,
1816
- BooleanFilterRenderer,
1817
- TextFilterRenderer,
1818
- AXDataGridFilterComponent,
1819
- AXDataGridRowTemplateComponent,
1820
- AXDataGridDetailTemplateComponent,
1821
- AXDataGridRowTemplateRenderer,
1822
- AXDataGridDetailTemplateRenderer,
1823
- AXDataGridCellTemplateComponent,
1824
- AXDataGridCellTemplateRenderer,
1825
- AXDatePickerFilterComponent,
1826
- CommandRenderer
1827
- ],
1828
- imports: [
1829
- common.CommonModule,
1830
- core$1.AXCoreModule,
1831
- forms.FormsModule,
1832
- //AgGridModule,
1833
- components.AXTextBoxModule,
1834
- components.AXCheckBoxModule,
1835
- components.AXSelectBoxModule,
1836
- components.AXDataSourceModule,
1837
- components.AXButtonModule,
1838
- components.AXDatePickerModule,
1839
- agGridAngular.AgGridModule.withComponents([AXDatePickerFilterComponent])
1840
- ],
1841
- exports: [
1842
- AXDataGridComponent,
1843
- AXDataGridFilterComponent,
1844
- AXDataGridRowTemplateComponent,
1845
- AXDataGridDetailTemplateComponent,
1846
- AXDataGridRowTemplateRenderer,
1847
- AXDataGridDetailTemplateRenderer,
1848
- AXDataGridCellTemplateComponent,
1849
- AXDataGridCellTemplateRenderer,
1850
- AXGridTextColumn,
1851
- AXGridRowNumberColumn,
1852
- AXGridCheckColumn,
1853
- AXGridDateColumn,
1854
- AXGridSelectionColumn,
1855
- AXGridCommandColumn,
1856
- BooleanRenderer,
1857
- BooleanFilterRenderer,
1858
- CommandRenderer
1859
- ],
1860
- entryComponents: [
1861
- BooleanRenderer,
1862
- BooleanFilterRenderer,
1863
- CommandRenderer,
1864
- TextFilterRenderer,
1865
- AXDataGridRowTemplateComponent,
1866
- AXDataGridDetailTemplateComponent,
1867
- AXDataGridRowTemplateRenderer,
1868
- AXDataGridDetailTemplateRenderer,
1869
- AXDataGridCellTemplateComponent,
1870
- AXDataGridCellTemplateRenderer
1871
- ],
1872
- providers: []
1873
- })
1874
- ], AXDataGridModule);
1875
- return AXDataGridModule;
1876
- }());
1877
-
1878
- var AXDataLovPopupComponent = /** @class */ (function (_super) {
1879
- __extends(AXDataLovPopupComponent, _super);
1880
- function AXDataLovPopupComponent(cdr, ref) {
1881
- var _this = _super.call(this) || this;
1882
- _this.cdr = cdr;
1883
- _this.ref = ref;
1884
- _this.columns = [];
1885
- _this.selectedItems = [];
1886
- _this.keyField = '';
1887
- _this.allowNull = true;
1888
- _this.rtl = core$1.AXConfig.get('layout.rtl');
1889
- _this.selectedRows = [];
1890
- return _this;
1891
- }
1892
- AXDataLovPopupComponent.prototype.ngOnInit = function () {
1893
- if (this.rtl == null) {
1894
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
1895
- }
1896
- };
1897
- AXDataLovPopupComponent.prototype.onDoneClick = function () {
1898
- if (this.selectedItems) {
1899
- this.close(this.selectedItems);
1900
- }
1901
- else {
1902
- this.close();
1903
- }
1904
- };
1905
- AXDataLovPopupComponent.prototype.rowDoubleClicked = function (e) {
1906
- var _this = this;
1907
- console.log('s', e.data.data);
1908
- if (this.selectionMode == 'single') {
1909
- this.selectedItems = [];
1910
- }
1911
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.data[_this.keyField]; });
1912
- this.selectedItems.push(e.data.data);
1913
- this.onDoneClick();
1914
- };
1915
- AXDataLovPopupComponent.prototype.onCancelClick = function () {
1916
- this.close();
1917
- };
1918
- AXDataLovPopupComponent.prototype.rowSelectionChange = function (e) {
1919
- var _this = this;
1920
- if (e.data.node.selected == true) {
1921
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
1922
- this.selectedItems.push(e.data.node.data);
1923
- }
1924
- else {
1925
- if (this.allowNull == true || (this.allowNull == false && this.selectedItems.length > 1)) {
1926
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
1927
- }
1928
- }
1929
- // console.log('ee', e)
1930
- // // console.log('e', e);
1931
- // console.log('select', e.data.node.selected);
1932
- // console.log('index', e.data.rowIndex);
1933
- };
1934
- AXDataLovPopupComponent.prototype.ngAfterViewInit = function () {
1935
- var _this = this;
1936
- this.selectedItems.forEach(function (ele) {
1937
- _this.selectedRows.push(ele);
1938
- });
1939
- this.searchBox.focus();
1940
- if (this.dataSource.onDataReceived) {
1941
- this.dataSource.onDataReceived.subscribe(function (arg) {
1942
- _this.cdr.markForCheck();
1943
- _this.cdr.detectChanges();
1944
- });
1945
- }
1946
- };
1947
- // onValueSearchChanged(e) {
1948
- // const params: AXDataSourceReadParams = {}
1949
- // params.searchText = e.value;
1950
- // // params.take = 100;
1951
- // // params.skip = 0
1952
- // this.dataSource.fetch(params);
1953
- // }
1954
- AXDataLovPopupComponent.prototype.getFooterButtons = function () {
1955
- return [
1956
- {
1957
- text: core$1.AXTranslator.get('common.confirm'),
1958
- name: 'confirm',
1959
- style: 'ax primary',
1960
- icon: 'far fa-check-circle'
1961
- },
1962
- {
1963
- text: core$1.AXTranslator.get('common.cancel'),
1964
- name: 'cancel',
1965
- style: 'ax light',
1966
- icon: 'far fa-times-circle'
1967
- }
1968
- ];
1969
- };
1970
- AXDataLovPopupComponent.prototype.onFooterButtonClick = function (e) {
1971
- if (e.name === 'confirm') {
1972
- this.onDoneClick();
1973
- }
1974
- if (e.name === 'cancel') {
1975
- this.onCancelClick();
1976
- }
1977
- };
1978
- AXDataLovPopupComponent.ctorParameters = function () { return [
1979
- { type: core.ChangeDetectorRef },
1980
- { type: core.ElementRef }
1981
- ]; };
1982
- __decorate([
1983
- core.ViewChild('grid', { static: true }),
1984
- __metadata("design:type", AXDataGridComponent)
1985
- ], AXDataLovPopupComponent.prototype, "grid", void 0);
1986
- __decorate([
1987
- core.ViewChild('searchBox'),
1988
- __metadata("design:type", components.AXToolbarSearchComponent)
1989
- ], AXDataLovPopupComponent.prototype, "searchBox", void 0);
1990
- AXDataLovPopupComponent = __decorate([
1991
- core.Component({
1992
- template: "<div style=\"height: 70vh; padding: 0.5em;\">\r\n <div style=\"height: calc(100%);\">\r\n\r\n <ax-data-grid [rtl]=\"rtl\" [suppressRowClickSelection]=\"false\" [keyField]=\"keyField\"\r\n [hasChildField]=\"hasChildField\" [selectRow]=\"selectedItems\" #grid [columns]=\"columns\"\r\n [remoteOperation]=\"true\" [selectionMode]=\"selectionMode\" (rowDbClick)=\"rowDoubleClicked($event)\"\r\n (rowSelectionChange)=\"rowSelectionChange($event)\" [dataSource]=\"dataSource\">\r\n <ax-toolbar>\r\n <ax-toolbar-search #searchBox style=\"width: 100%;\"></ax-toolbar-search>\r\n </ax-toolbar>\r\n <ax-selection-column *ngIf=\"selectionMode== 'single'? false : true\"></ax-selection-column>\r\n <!-- <ax-data-source [provideData]=\"dataSource.provideData\">\r\n </ax-data-source> -->\r\n </ax-data-grid>\r\n </div>\r\n</div>"
1993
- }),
1994
- __metadata("design:paramtypes", [core.ChangeDetectorRef, core.ElementRef])
1995
- ], AXDataLovPopupComponent);
1996
- return AXDataLovPopupComponent;
1997
- }(components.AXBasePopupPageComponent));
1998
-
1999
- var AXLOVComponent = /** @class */ (function (_super) {
2000
- __extends(AXLOVComponent, _super);
2001
- function AXLOVComponent(popup, ref) {
2002
- var _this = _super.call(this) || this;
2003
- _this.popup = popup;
2004
- _this.ref = ref;
2005
- _this.textField = '';
2006
- _this.allowSearch = true;
2007
- _this.valueField = '';
2008
- _this.hasChildField = 'null';
2009
- _this.allowNull = true;
2010
- _this.popupSize = 'md';
2011
- _this.selectedItems = [];
2012
- // @Input()
2013
- // selectedValues: any[] = [];
2014
- _this.readonly = false;
2015
- _this.disabled = false;
2016
- _this.chipsWidth = '';
2017
- _this.size = 'md';
2018
- _this.mode = 'single';
2019
- _this.onSelectionChange = new core.EventEmitter();
2020
- _this.rtl = core$1.AXConfig.get('layout.rtl');
2021
- return _this;
2022
- }
2023
- AXLOVComponent_1 = AXLOVComponent;
2024
- Object.defineProperty(AXLOVComponent.prototype, "validation", {
2025
- get: function () {
2026
- return this._validation ? this._validation : this._contentValidation;
2027
- },
2028
- set: function (v) {
2029
- this._validation = v;
2030
- },
2031
- enumerable: true,
2032
- configurable: true
2033
- });
2034
- AXLOVComponent.prototype.focus = function () {
2035
- this.selectBox.focus();
2036
- };
2037
- AXLOVComponent.prototype.refresh = function () {
2038
- this.selectBox.refresh();
2039
- };
2040
- AXLOVComponent.prototype.handleButtonClick = function () {
2041
- this.open();
2042
- };
2043
- AXLOVComponent.prototype.ngOnInit = function () {
2044
- var _this = this;
2045
- if (this.rtl == null) {
2046
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
2047
- }
2048
- // this.selectVal = this.selectedValues;
2049
- this.onSelectionChange.subscribe(function (c) {
2050
- _this.clearValidationStyle(_this.ref.nativeElement);
2051
- });
2052
- };
2053
- AXLOVComponent.prototype.ngAfterContentInit = function () {
2054
- this.initValidation(this.ref, 'selectedItems', this.validation);
2055
- };
2056
- AXLOVComponent.prototype.handleSelectChange = function (e) {
2057
- // console.log('se' + JSON.stringify(e));
2058
- this.onSelectionChange.emit({ data: this.selectedItems, component: this, htmlElement: this.ref.nativeElement });
2059
- };
2060
- AXLOVComponent.prototype.open = function () {
2061
- var _this = this;
2062
- return new Promise(function (resolve) {
2063
- _this.selectBox.dropdown.close();
2064
- _this.popup
2065
- .open(AXDataLovPopupComponent, {
2066
- size: _this.popupSize,
2067
- // closable: false,
2068
- data: {
2069
- dataSource: _this.dataSource,
2070
- selectionMode: _this.mode,
2071
- columns: _this.columns.toArray(),
2072
- // selectedItems: this.selectedValues,
2073
- selectedItems: _this.selectedItems,
2074
- keyField: _this.valueField,
2075
- allowNull: _this.allowNull,
2076
- hasChildField: _this.hasChildField,
2077
- rtl: _this.rtl
2078
- },
2079
- title: _this.caption
2080
- // size: this.size,
2081
- })
2082
- .then(function (c) {
2083
- if (c.data) {
2084
- // this.selectedValues = [];
2085
- _this.selectedItems = [];
2086
- c.data.forEach(function (elm) {
2087
- _this.selectedItems.push(elm);
2088
- });
2089
- // this.selectedItems = c.data;
2090
- // this.selectBox.refresh();
2091
- // console.log('se' + JSON.stringify(this.selectedItems));
2092
- _this.onSelectionChange.emit({ data: _this.selectedItems, component: _this, htmlElement: _this.ref.nativeElement });
2093
- if (resolve) {
2094
- resolve(c.data);
2095
- }
2096
- }
2097
- else {
2098
- if (resolve) {
2099
- resolve(_this.selectedItems);
2100
- }
2101
- }
2102
- _this.selectBox.refresh();
2103
- });
2104
- });
2105
- };
2106
- var AXLOVComponent_1;
2107
- AXLOVComponent.ctorParameters = function () { return [
2108
- { type: components.AXPopupService },
2109
- { type: core.ElementRef }
2110
- ]; };
2111
- __decorate([
2112
- core.ContentChild(components.AXValidation, { static: true }),
2113
- __metadata("design:type", components.AXValidation)
2114
- ], AXLOVComponent.prototype, "_contentValidation", void 0);
2115
- __decorate([
2116
- core.Input(),
2117
- __metadata("design:type", components.AXValidation),
2118
- __metadata("design:paramtypes", [components.AXValidation])
2119
- ], AXLOVComponent.prototype, "validation", null);
2120
- __decorate([
2121
- core.ViewChild('selectBox', { static: true }),
2122
- __metadata("design:type", components.AXSelectBoxComponent)
2123
- ], AXLOVComponent.prototype, "selectBox", void 0);
2124
- __decorate([
2125
- core.ContentChild(components.AXDataSourceComponent, { static: true }),
2126
- __metadata("design:type", components.AXDataSourceComponent)
2127
- ], AXLOVComponent.prototype, "dataSource", void 0);
2128
- __decorate([
2129
- core.ContentChildren(AXGridDataColumn),
2130
- __metadata("design:type", core.QueryList)
2131
- ], AXLOVComponent.prototype, "columns", void 0);
2132
- __decorate([
2133
- core.ContentChild('itemTemplate', { static: true }),
2134
- __metadata("design:type", core.TemplateRef)
2135
- ], AXLOVComponent.prototype, "rowTemplate", void 0);
2136
- __decorate([
2137
- core.Input(),
2138
- __metadata("design:type", String)
2139
- ], AXLOVComponent.prototype, "textField", void 0);
2140
- __decorate([
2141
- core.Input(),
2142
- __metadata("design:type", Boolean)
2143
- ], AXLOVComponent.prototype, "allowSearch", void 0);
2144
- __decorate([
2145
- core.Input(),
2146
- __metadata("design:type", String)
2147
- ], AXLOVComponent.prototype, "valueField", void 0);
2148
- __decorate([
2149
- core.Input(),
2150
- __metadata("design:type", String)
2151
- ], AXLOVComponent.prototype, "hasChildField", void 0);
2152
- __decorate([
2153
- core.Input(),
2154
- __metadata("design:type", Boolean)
2155
- ], AXLOVComponent.prototype, "allowNull", void 0);
2156
- __decorate([
2157
- core.Input(),
2158
- __metadata("design:type", String)
2159
- ], AXLOVComponent.prototype, "popupSize", void 0);
2160
- __decorate([
2161
- core.Input(),
2162
- __metadata("design:type", Array)
2163
- ], AXLOVComponent.prototype, "selectedItems", void 0);
2164
- __decorate([
2165
- core.Input(),
2166
- __metadata("design:type", Boolean)
2167
- ], AXLOVComponent.prototype, "readonly", void 0);
2168
- __decorate([
2169
- core.Input(),
2170
- __metadata("design:type", Boolean)
2171
- ], AXLOVComponent.prototype, "disabled", void 0);
2172
- __decorate([
2173
- core.Input(),
2174
- __metadata("design:type", String)
2175
- ], AXLOVComponent.prototype, "chipsWidth", void 0);
2176
- __decorate([
2177
- core.Input(),
2178
- __metadata("design:type", String)
2179
- ], AXLOVComponent.prototype, "size", void 0);
2180
- __decorate([
2181
- core.Input(),
2182
- __metadata("design:type", String)
2183
- ], AXLOVComponent.prototype, "caption", void 0);
2184
- __decorate([
2185
- core.Input(),
2186
- __metadata("design:type", String)
2187
- ], AXLOVComponent.prototype, "mode", void 0);
2188
- __decorate([
2189
- core.Input(),
2190
- __metadata("design:type", String)
2191
- ], AXLOVComponent.prototype, "placeholder", void 0);
2192
- __decorate([
2193
- core.Output(),
2194
- __metadata("design:type", core.EventEmitter)
2195
- ], AXLOVComponent.prototype, "onSelectionChange", void 0);
2196
- __decorate([
2197
- core.Input(),
2198
- __metadata("design:type", Boolean)
2199
- ], AXLOVComponent.prototype, "rtl", void 0);
2200
- AXLOVComponent = AXLOVComponent_1 = __decorate([
2201
- core.Component({
2202
- selector: 'ax-lov',
2203
- template: "<ax-select-box [rowInputTemplate]=\"rowTemplate\" [rtl]=\"rtl\" [allowSearch]=\"allowSearch\" #selectBox [showDropDownButton]=\"false\" [allowNull]=\"allowNull\"\r\n [remoteOperation]=\"true\" [placeholder]=\"placeholder\" [size]=\"size\" [textField]=\"textField\" [valueField]=\"valueField\"\r\n [disabled]=\"disabled\" [mode]=\"mode\" [(selectedItems)]=\"selectedItems\"\r\n (selectionChanged)=\"handleSelectChange($event)\" [dataSource]=\"dataSource\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container end>\r\n <ax-button icon=\"far fa-bars icon\" [disabled]=\"disabled\" type=\"light blank\" (click)=\"handleButtonClick()\" end\r\n [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n</ax-select-box>\r\n\r\n\r\n<!-- <ax-select-box2 [rtl]=\"rtl\" [allowSearch]=\"allowSearch\" #selectBox [showDropDownButton]=\"false\" [allowNull]=\"allowNull\"\r\n [remoteOperation]=\"true\" [placeholder]=\"placeholder\" [size]=\"size\" [textField]=\"textField\" [valueField]=\"valueField\"\r\n [disabled]=\"disabled\" [selectionMode]=\"mode\" (onValueChanged)=\"handleSelectChange($event)\" [dataSource]=\"dataSource\"\r\n [(value)]=\"selectedItems\" selectionDataMode=\"item\">\r\n <ng-container start>\r\n <ng-content select=\"[start]\">\r\n </ng-content>\r\n </ng-container>\r\n <ng-container end>\r\n <ax-button icon=\"far fa-bars icon\" [disabled]=\"disabled\" type=\"primary blank\" (click)=\"handleButtonClick()\" end\r\n [tabIndex]=\"-1\">\r\n </ax-button>\r\n <ng-content select=\"[end]\">\r\n </ng-content>\r\n </ng-container>\r\n</ax-select-box2> -->\r\n\r\n\r\n<!-- <div class=\"ax-lov-box\" [style.display]=\"mode=='hidden' ? 'none':'unset'\">\r\n <div class=\"ax-field-set\">\r\n <div class=\"ax-field-set-wrapper\" [ngClass]=\"{ 'no-label': !label }\">\r\n <fieldset [ngClass]=\"{ 'input-focused': isFocused, 'input-error': errorText }\">\r\n <legend *ngIf=\"label\">\r\n {{ label }}\r\n </legend>\r\n </fieldset>\r\n <input type=\"text\" [(ngModel)]=\"text\" [placeholder]=\"placeholder\" (keyup)=\"handleKeyEvent($event)\"\r\n (blur)=\"handleBlurEvent($event)\" (focus)=\"handleFocusEvent($event)\" class=\"ax-text-box\" disabled />\r\n <div class=\"ax-field-set-button\">\r\n <button *ngIf=\"text && allowClear\" type=\"button\" class=\"btn btn-light\" (click)=\"clearText()\">\r\n <i class=\"far fa-times\"></i>\r\n </button>\r\n <button type=\"button\" class=\" btn btn-primary\" (click)=\"handleButtonClick($event)\">\r\n <i class=\"far fa-check-circle\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"validation-text\" *ngIf=\"errorText\">\r\n {{ errorText }}\r\n </div>\r\n\r\n</div> -->",
2204
- encapsulation: core.ViewEncapsulation.None,
2205
- host: { style: 'width: 100%' },
2206
- providers: [{ provide: components.AXValidatableComponent, useExisting: AXLOVComponent_1 }]
2207
- }),
2208
- __metadata("design:paramtypes", [components.AXPopupService, core.ElementRef])
2209
- ], AXLOVComponent);
2210
- return AXLOVComponent;
2211
- }(components.AXValidatableComponent));
2212
-
2213
- var AXLOVModule = /** @class */ (function () {
2214
- function AXLOVModule() {
2215
- }
2216
- AXLOVModule = __decorate([
2217
- core.NgModule({
2218
- declarations: [AXLOVComponent, AXDataLovPopupComponent],
2219
- imports: [common.CommonModule, forms.FormsModule, AXDataGridModule, components.AXDataSourceModule, components.AXButtonModule, components.AXToolbarModule, components.AXSelectBoxModule, components.AXSearchBoxModule],
2220
- exports: [AXLOVComponent, AXDataLovPopupComponent],
2221
- providers: [],
2222
- entryComponents: [AXDataLovPopupComponent]
2223
- })
2224
- ], AXLOVModule);
2225
- return AXLOVModule;
2226
- }());
2227
-
2228
- exports.AXDaagridRowClickEvent = AXDaagridRowClickEvent;
2229
- exports.AXDataGridCellEvent = AXDataGridCellEvent;
2230
- exports.AXDataGridCellTemplateComponent = AXDataGridCellTemplateComponent;
2231
- exports.AXDataGridCellTemplateRenderer = AXDataGridCellTemplateRenderer;
2232
- exports.AXDataGridColumnsChangeEvent = AXDataGridColumnsChangeEvent;
2233
- exports.AXDataGridComponent = AXDataGridComponent;
2234
- exports.AXDataGridDetailTemplateComponent = AXDataGridDetailTemplateComponent;
2235
- exports.AXDataGridDetailTemplateRenderer = AXDataGridDetailTemplateRenderer;
2236
- exports.AXDataGridFilterComponent = AXDataGridFilterComponent;
2237
- exports.AXDataGridModule = AXDataGridModule;
2238
- exports.AXDataGridRowSelectionChangeEvent = AXDataGridRowSelectionChangeEvent;
2239
- exports.AXDataGridRowTemplateComponent = AXDataGridRowTemplateComponent;
2240
- exports.AXDataGridRowTemplateRenderer = AXDataGridRowTemplateRenderer;
2241
- exports.AXDataGridSelectionChangeEvent = AXDataGridSelectionChangeEvent;
2242
- exports.AXDataLovPopupComponent = AXDataLovPopupComponent;
2243
- exports.AXDatePickerFilterComponent = AXDatePickerFilterComponent;
2244
- exports.AXGridCheckColumn = AXGridCheckColumn;
2245
- exports.AXGridCommandColumn = AXGridCommandColumn;
2246
- exports.AXGridDataColumn = AXGridDataColumn;
2247
- exports.AXGridDateColumn = AXGridDateColumn;
2248
- exports.AXGridRowNumberColumn = AXGridRowNumberColumn;
2249
- exports.AXGridSelectionColumn = AXGridSelectionColumn;
2250
- exports.AXGridTextColumn = AXGridTextColumn;
2251
- exports.AXLOVComponent = AXLOVComponent;
2252
- exports.AXLOVModule = AXLOVModule;
2253
- exports.BooleanFilterRenderer = BooleanFilterRenderer;
2254
- exports.BooleanRenderer = BooleanRenderer;
2255
- exports.CommandRenderer = CommandRenderer;
2256
- exports.TextFilterRenderer = TextFilterRenderer;
2257
-
2258
- Object.defineProperty(exports, '__esModule', { value: true });
2259
-
2260
- })));
2261
- //# sourceMappingURL=acorex-data-grid.umd.js.map