@acorex/data-grid 3.0.63 → 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 +8 -1
  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 -2249
  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 -722
  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 -780
  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 -1927
  85. package/fesm2015/acorex-data-grid.js.map +0 -1
  86. package/fesm5/acorex-data-grid.js +0 -2005
  87. package/fesm5/acorex-data-grid.js.map +0 -1
@@ -1,2249 +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
- this.autoGroupColumnDef = {};
1084
- this.selectionMode = 'single';
1085
- // @Input()
1086
- // allowFiltering: boolean = false;
1087
- this.selectRow = [];
1088
- this.rowGroupPanelShow = 'never';
1089
- this.loadOnInit = true;
1090
- // @Input()
1091
- // groupDefaultExpanded: number = 0;
1092
- this.keyField = 'null';
1093
- this.hasChildField = 'null';
1094
- this.columnsChange = new core.EventEmitter();
1095
- this._columns = [];
1096
- this.defaultColDef = {
1097
- filter: true,
1098
- floatingFilter: true
1099
- };
1100
- this.groupHideOpenParents = false;
1101
- this.cellClick = new core.EventEmitter();
1102
- this.cellDbClick = new core.EventEmitter();
1103
- this.cellFocuse = new core.EventEmitter();
1104
- this.rowClick = new core.EventEmitter();
1105
- this.rowDbClick = new core.EventEmitter();
1106
- this.selectionChanged = new core.EventEmitter();
1107
- this.rowSelectionChange = new core.EventEmitter();
1108
- this.onRowSelectionChanged = new core.EventEmitter();
1109
- this.rtl = core$1.AXConfig.get('layout.rtl');
1110
- this.isServerSideGroup = function (e) {
1111
- return e[_this.hasChildField];
1112
- };
1113
- this.getColumnDefs = function () {
1114
- return _this.gridApi.getColumnDefs();
1115
- };
1116
- this.getServerSideGroupKey = function (e) {
1117
- return e[_this.keyField];
1118
- };
1119
- this.internalGetRowClass = function (p) {
1120
- if (_this.rowClass) {
1121
- if (_this.rowClass instanceof Function) {
1122
- return _this.rowClass({
1123
- rowIndex: p.node.rowIndex,
1124
- rowLevel: p.node.level,
1125
- data: p.data
1126
- });
1127
- }
1128
- else {
1129
- return _this.rowClass;
1130
- }
1131
- }
1132
- };
1133
- this.localeText = core$1.AXTranslator.get('dataGrid');
1134
- }
1135
- Object.defineProperty(AXDataGridComponent.prototype, "searchText", {
1136
- get: function () {
1137
- return this._searchText;
1138
- },
1139
- set: function (v) {
1140
- if (v !== this._searchText) {
1141
- this._searchText = v;
1142
- if (this.gridApi) {
1143
- this.refresh();
1144
- this.gridApi.setQuickFilter(this.searchText);
1145
- }
1146
- }
1147
- },
1148
- enumerable: true,
1149
- configurable: true
1150
- });
1151
- Object.defineProperty(AXDataGridComponent.prototype, "filter", {
1152
- get: function () {
1153
- return this._filter;
1154
- },
1155
- set: function (v) {
1156
- var _this = this;
1157
- if (v !== this._filter) {
1158
- this._filter = v;
1159
- this._filter.forEach(function (f) {
1160
- var fc = _this.gridApi.getFilterInstance(f.field);
1161
- if (fc) {
1162
- var ff = fc.getFrameworkComponentInstance();
1163
- ff.setModel(f);
1164
- }
1165
- });
1166
- }
1167
- },
1168
- enumerable: true,
1169
- configurable: true
1170
- });
1171
- Object.defineProperty(AXDataGridComponent.prototype, "columns", {
1172
- get: function () {
1173
- return this._inlineColumns ? __spread(this._columns, this._inlineColumns.toArray()) : this._columns;
1174
- },
1175
- set: function (val) {
1176
- if (val && val.length) {
1177
- var old = this._columns;
1178
- this._columns = val;
1179
- this.columnsChange.emit({ component: this, value: val, oldValue: old, htmlElement: this.ref.nativeElement });
1180
- }
1181
- },
1182
- enumerable: true,
1183
- configurable: true
1184
- });
1185
- Object.defineProperty(AXDataGridComponent.prototype, "dataSource", {
1186
- get: function () {
1187
- return this._dataSource ? this._dataSource : this._contentDataSource;
1188
- },
1189
- set: function (v) {
1190
- this._dataSource = v;
1191
- },
1192
- enumerable: true,
1193
- configurable: true
1194
- });
1195
- AXDataGridComponent.prototype.getRowHeight = function (param) {
1196
- if (param.data && param.data.rowHeight && param.node.level == 0) {
1197
- return param.data.rowHeight;
1198
- }
1199
- else if (this.masterDetail == true && param.node.level == 1) {
1200
- return this.detailRowHeight;
1201
- }
1202
- else if (this.masterDetail == false && param.data && param.data.rowHeight) {
1203
- return param.data.rowHeight;
1204
- }
1205
- else {
1206
- return null;
1207
- }
1208
- };
1209
- AXDataGridComponent.prototype.calcHeight = function () {
1210
- if (this.toolbar) {
1211
- this.internalHeight = "calc(100% - " + 40 + "px)";
1212
- }
1213
- else {
1214
- this.internalHeight = '100%';
1215
- }
1216
- };
1217
- Object.defineProperty(AXDataGridComponent.prototype, "intenalGridDataSource", {
1218
- get: function () {
1219
- var that = this;
1220
- return {
1221
- rowCount: null,
1222
- getRows: function (params) {
1223
- // that.gridApi.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount ? this.takeCount : params.api.paginationGetPageSize());
1224
- that.dataSourceSuccessCallback = params.successCallback;
1225
- var loadParams = {};
1226
- loadParams.searchText = that.searchText;
1227
- loadParams.skip = params.request.startRow;
1228
- // loadParams.take = params.request.endRow - params.request.startRow;
1229
- loadParams.take = that.takeCount ? that.takeCount : params.api.paginationGetPageSize() * 2;
1230
- loadParams.sort = params.request.sortModel.map(function (c) {
1231
- return {
1232
- field: c.colId,
1233
- dir: c.sort
1234
- };
1235
- });
1236
- // loadParams.groups = params.request.rowGroupCols.map(r => r.field);
1237
- // loadParams.groupKeys = params.request.groupKeys;
1238
- // loadParams.data = params.parentNode.data;
1239
- loadParams.group = {
1240
- fields: params.request.rowGroupCols.map(function (r) { return r.field; }),
1241
- keys: params.request.groupKeys,
1242
- parentData: params.parentNode.data
1243
- };
1244
- loadParams.filter = params.request.filterModel;
1245
- that.dataSource.fetch(loadParams);
1246
- }
1247
- };
1248
- },
1249
- enumerable: true,
1250
- configurable: true
1251
- });
1252
- AXDataGridComponent.prototype.getMainMenuItems = function (e) {
1253
- return ['pinSubMenu', 'separator'];
1254
- };
1255
- AXDataGridComponent.prototype.ngOnDestroy = function () {
1256
- this.gridApi.destroy();
1257
- };
1258
- // todo gridOptions: GridOptions
1259
- AXDataGridComponent.prototype.internalGridReady = function (gridOptions) {
1260
- gridOptions.api.checkGridSize();
1261
- this.takeCount = this.takeCount ? this.takeCount : gridOptions.api.paginationGetPageSize() * 2;
1262
- // this.takeCount = this.takeCount < 20 ? 20 : this.takeCount;
1263
- gridOptions.api.gridOptionsWrapper.setProperty('cacheBlockSize', this.takeCount);
1264
- this.gridApi = gridOptions.api;
1265
- this.mapColumns();
1266
- this.calcHeight();
1267
- if (!this.loadOnInit) {
1268
- this.loadOnInit = true;
1269
- return;
1270
- }
1271
- if (this.remoteOperation) {
1272
- this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
1273
- }
1274
- if (!this.remoteOperation) {
1275
- this.refresh();
1276
- }
1277
- };
1278
- AXDataGridComponent.prototype.ngAfterContentInit = function () {
1279
- var that = this;
1280
- if (this.rowTemplate) {
1281
- this.fullWidthCellRendererFramework = this.rowTemplate.renderer;
1282
- this.fullWidthCellRendererParams = this.rowTemplate.params;
1283
- }
1284
- this.frameworkComponents.agDateInput = AXDatePickerFilterComponent;
1285
- if (this.gridDetailTemplate) {
1286
- this.masterDetail = true;
1287
- this.detailCellRendererParams = this.gridDetailTemplate.params;
1288
- this.detailCellRenderer = 'detailRendererFramework';
1289
- this.frameworkComponents.detailRendererFramework = this.gridDetailTemplate.renderer;
1290
- this.detailRowHeight = this.gridDetailTemplate.height;
1291
- }
1292
- this.isFullWidthCell = function () {
1293
- return that.rowTemplate != null;
1294
- };
1295
- //this.cdr
1296
- };
1297
- AXDataGridComponent.prototype.ngOnInit = function () {
1298
- if (this.takeCount && this.takeCount > 0) {
1299
- this.paginationPageSize = this.takeCount;
1300
- this.paginationAutoPageSize = false;
1301
- this.cacheBlockSize = this.takeCount;
1302
- }
1303
- if (this.selectionMode === 'single') {
1304
- this.groupSelectsChildren = false;
1305
- }
1306
- if (this.keyField !== 'null' && this.hasChildField !== 'null') {
1307
- this.rowGroupPanelShow = 'never';
1308
- this.treeData = true;
1309
- }
1310
- if (this.remoteOperation) {
1311
- this.rowModelType = 'serverSide';
1312
- }
1313
- //
1314
- if (this.rtl == null) {
1315
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
1316
- }
1317
- //
1318
- };
1319
- AXDataGridComponent.prototype.gridSelectRow = function () {
1320
- var _this = this;
1321
- if (this.gridApi) {
1322
- if (this.selectRow && this.selectRow.length > 0 && this.gridApi !== undefined && typeof this.selectRow[0] != 'object') {
1323
- this.gridApi.forEachNode(function (node) {
1324
- if (node.data !== undefined) {
1325
- var select_1 = false;
1326
- _this.selectRow.forEach(function (id) {
1327
- if (node.data[_this.keyField] === id) {
1328
- select_1 = true;
1329
- node.setSelected(select_1);
1330
- }
1331
- });
1332
- }
1333
- });
1334
- }
1335
- else {
1336
- this.gridApi.forEachNode(function (node) {
1337
- if (node.data !== undefined) {
1338
- var select_2 = false;
1339
- _this.selectRow.forEach(function (item) {
1340
- if (item.rowIndex != undefined && item.rowLevel != undefined) {
1341
- if (node.data[_this.keyField] === item.data[_this.keyField]) {
1342
- select_2 = true;
1343
- }
1344
- }
1345
- else {
1346
- if (node.data[_this.keyField] === item[_this.keyField]) {
1347
- select_2 = true;
1348
- }
1349
- }
1350
- });
1351
- node.setSelected(select_2);
1352
- }
1353
- });
1354
- }
1355
- }
1356
- };
1357
- // ngAfterViewChecked(): void {
1358
- // //Called after every check of the component's view. Applies to components only.
1359
- // //Add 'implements AfterViewChecked' to the class.
1360
- // // this.selectByValues();
1361
- // this.enabelSelect = false;
1362
- // }
1363
- AXDataGridComponent.prototype.rebuildGrid = function () {
1364
- var _this = this;
1365
- this.mapColumns();
1366
- setTimeout(function () {
1367
- if (_this.sizeColumnsToFit) {
1368
- _this.gridApi.sizeColumnsToFit();
1369
- }
1370
- }, 10);
1371
- };
1372
- AXDataGridComponent.prototype.ngAfterViewInit = function () {
1373
- var _this = this;
1374
- if (this.treeData === true) {
1375
- this.columnDefs = this.columns.map(function (c) { return c.render(); });
1376
- var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex == '0' && c.field !== ''; });
1377
- this.autoGroupColumnDef = {
1378
- headerName: groupColumn.headerName,
1379
- width: groupColumn.width,
1380
- cellRendererParams: { checkbox: this.showCheckBox },
1381
- field: groupColumn.field
1382
- };
1383
- this.columnDefs.forEach(function (elm) {
1384
- if (elm.rowGroupIndex > -1) {
1385
- elm.hide = true;
1386
- }
1387
- });
1388
- }
1389
- //setTimeout(() => {
1390
- this.gridView = true;
1391
- //});
1392
- this.enabelSelect = true;
1393
- this.dataSource.onDataReceived.subscribe(function (_data) {
1394
- var result = _data.data.result;
1395
- _this.hideLoading();
1396
- var items;
1397
- var totalCount;
1398
- if (Array.isArray(result)) {
1399
- items = result;
1400
- totalCount = result.length;
1401
- }
1402
- else {
1403
- items = result.items;
1404
- totalCount = result.totalCount;
1405
- }
1406
- if (_this.dataSourceSuccessCallback) {
1407
- if (!_this.loadOnInit) {
1408
- _this.dataSourceSuccessCallback([], 0);
1409
- }
1410
- else {
1411
- _this.dataSourceSuccessCallback(items, totalCount);
1412
- }
1413
- }
1414
- else {
1415
- if (!_this.loadOnInit && _this.gridApi !== undefined) {
1416
- _this.gridApi.setRowData([]);
1417
- }
1418
- else if (_this.gridApi !== undefined) {
1419
- _this.gridApi.setRowData(items);
1420
- }
1421
- }
1422
- _this.gridSelectRow();
1423
- });
1424
- this.dataSource.onFetchStart.subscribe(function () {
1425
- _this.showLoading();
1426
- });
1427
- if (this.searchInput) {
1428
- this.searchInput.onValueChanged.subscribe(function (c) {
1429
- _this.searchText = c.value;
1430
- });
1431
- }
1432
- //
1433
- this.cdr.detectChanges();
1434
- };
1435
- AXDataGridComponent.prototype.mapColumns = function () {
1436
- this.columnDefs = this.columns.map(function (c) { return c.render(); });
1437
- // if (this.showRowNumber) {
1438
- // this.columnDefs.push({
1439
- // headerName: AXConfig.get('layout.rtl') ? 'ردیف' : 'Row',
1440
- // valueGetter: 'node.rowIndex + 1',
1441
- // pinned: AXConfig.get('layout.rtl') ? 'right' : 'left'
1442
- // });
1443
- // }
1444
- if (this.gridDetailTemplate) {
1445
- if (this.columnDefs[0].checkboxSelection === true && this.columnDefs[0].field === '') {
1446
- this.columnDefs[1].cellRenderer = 'agGroupCellRenderer';
1447
- }
1448
- else {
1449
- this.columnDefs[0].cellRenderer = 'agGroupCellRenderer';
1450
- }
1451
- }
1452
- if (this.hasChildField === 'null') {
1453
- var groupColumn = this.columnDefs.find(function (c) { return c.rowGroupIndex === undefined && c.field !== ''; });
1454
- if (groupColumn && this.groupHideOpenParents == false) {
1455
- this.autoGroupColumnDef = {
1456
- headerName: groupColumn.headerName,
1457
- width: groupColumn.width,
1458
- cellRendererParams: { checkbox: this.showCheckBox },
1459
- field: groupColumn.field
1460
- };
1461
- // groupColumn.hide = true;
1462
- }
1463
- }
1464
- this.columnDefs.forEach(function (elm) {
1465
- if (elm.rowGroupIndex > -1) {
1466
- elm.hide = true;
1467
- }
1468
- });
1469
- };
1470
- AXDataGridComponent.prototype.displayedColumnsChanged = function (e) {
1471
- if (this.hasChildField === 'null') {
1472
- var ee = e.columnApi.getAllDisplayedColumnGroups();
1473
- var eee = ee.find(function (c) { return c.colId !== 'ag-Grid-AutoColumn' && c.colId !== '0'; });
1474
- if (eee && eee.colId) {
1475
- this.autoGroupColumnDef = {
1476
- headerName: eee.colDef.headerName,
1477
- width: eee.colDef.width,
1478
- cellRendererParams: { checkbox: this.showCheckBox },
1479
- field: eee.colDef.field
1480
- };
1481
- }
1482
- // eee.hide = true;
1483
- }
1484
- };
1485
- AXDataGridComponent.prototype.refresh = function (route) {
1486
- if (route === void 0) { route = []; }
1487
- if (this.remoteOperation && this.gridApi !== undefined) {
1488
- // this.gridApi.purgeServerSideCache(route);
1489
- this.gridApi.setServerSideDatasource(this.intenalGridDataSource);
1490
- }
1491
- else {
1492
- // TODO : check fetch param
1493
- this.dataSource.fetch(null);
1494
- }
1495
- };
1496
- AXDataGridComponent.prototype.internalGridCellClicked = function (e) {
1497
- this.cellClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
1498
- };
1499
- AXDataGridComponent.prototype.internalGridCellDoubleClicked = function (e) {
1500
- this.cellDbClick.emit({ data: this.mapCellEvent(e), component: this, htmlElement: this.ref.nativeElement });
1501
- };
1502
- AXDataGridComponent.prototype.internalGridCellFocused = function (e) {
1503
- this.cellFocuse.emit({ data: this.mapCellEvent(e), htmlElement: this.ref.nativeElement, component: this });
1504
- };
1505
- AXDataGridComponent.prototype.internalGridRowClicked = function (e) {
1506
- if (!e.node.group) {
1507
- this.rowClick.emit({ data: this.mapRowEvent(e), component: this, htmlElement: this.ref.nativeElement });
1508
- }
1509
- };
1510
- AXDataGridComponent.prototype.internalGridRowDoubleClicked = function (e) {
1511
- if (!e.node.group) {
1512
- this.rowDbClick.emit({ data: this.mapRowEvent(e), htmlElement: this.ref.nativeElement, component: this });
1513
- }
1514
- };
1515
- AXDataGridComponent.prototype.differenceOf2Arrays = function (array1, array2) {
1516
- var temp = [];
1517
- for (var i in array1) {
1518
- if (array2.indexOf(array1[i]) === -1) {
1519
- temp.push(array1[i]);
1520
- }
1521
- }
1522
- for (var i in array2) {
1523
- if (array1.indexOf(array2[i]) === -1) {
1524
- temp.push(array2[i]);
1525
- }
1526
- }
1527
- return temp.sort(function (a, b) { return a - b; });
1528
- };
1529
- AXDataGridComponent.prototype.rowSelectionChanged = function (e) {
1530
- var _this = this;
1531
- // this.gridApi.forEachNode((node) => {
1532
- // if (node.data[this.keyField] == e.node.data[this.keyField]) {
1533
- // node.setSelected(e.node.selected);
1534
- // }
1535
- // });
1536
- if (e.node.selected == true) {
1537
- this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
1538
- this.selectRow.push(e.data);
1539
- }
1540
- else {
1541
- this.selectRow = this.selectRow.filter(function (c) { return c[_this.keyField] != e.data[_this.keyField]; });
1542
- }
1543
- this.rowSelectionChange.emit({ component: this, data: e, htmlElement: this.ref.nativeElement });
1544
- // console.log('e', e);
1545
- // console.log('select', e.node.selected);
1546
- // console.log('index', e.rowIndex);
1547
- };
1548
- AXDataGridComponent.prototype.internalGridSelectionChanged = function (e) {
1549
- var args = { items: [] };
1550
- var oldNodes = this.oldSelectionNodes;
1551
- var nodes = this.gridApi.getSelectedNodes();
1552
- nodes.forEach(function (i) {
1553
- args.items.push({
1554
- rowLevel: i.level,
1555
- rowIndex: i.rowIndex,
1556
- data: i.data
1557
- });
1558
- });
1559
- this.selectionChanged.emit({ data: args, component: this, htmlElement: this.ref.nativeElement });
1560
- var action = nodes.length > oldNodes.length ? true : false;
1561
- var node = this.differenceOf2Arrays(nodes, oldNodes);
1562
- this.onRowSelectionChanged.emit({ component: this, selected: action, data: node, htmlElement: this.ref.nativeElement });
1563
- this.oldSelectionNodes = nodes;
1564
- };
1565
- AXDataGridComponent.prototype.mapCellEvent = function (e) {
1566
- return {
1567
- rowLevel: 0,
1568
- column: e.column,
1569
- data: e.data,
1570
- rowIndex: e.rowIndex,
1571
- value: e.value
1572
- };
1573
- };
1574
- AXDataGridComponent.prototype.mapRowEvent = function (e) {
1575
- return {
1576
- rowLevel: 0,
1577
- data: e.data,
1578
- rowIndex: e.rowIndex
1579
- };
1580
- };
1581
- AXDataGridComponent.prototype.deselectAll = function () {
1582
- this.gridApi.deselectAll();
1583
- };
1584
- AXDataGridComponent.prototype.showLoading = function () {
1585
- if (this.gridApi) {
1586
- this.gridApi.showLoadingOverlay();
1587
- }
1588
- };
1589
- AXDataGridComponent.prototype.hideLoading = function () {
1590
- if (this.gridApi) {
1591
- this.gridApi.hideOverlay();
1592
- }
1593
- };
1594
- AXDataGridComponent.prototype.internalGridSizeChanged = function (e) {
1595
- if (e.clientWidth > 0 && e.clientHeight > 0) {
1596
- this.performSizeColumnsToFit(e.api);
1597
- }
1598
- // this.refresh();
1599
- // this.gridApi.paginationGoToFirstPage();
1600
- };
1601
- AXDataGridComponent.prototype.internalGridFirstDataRendered = function (e) {
1602
- this.performSizeColumnsToFit(e.api);
1603
- };
1604
- AXDataGridComponent.prototype.performSizeColumnsToFit = function (api) {
1605
- if (this.sizeColumnsToFit) {
1606
- api.sizeColumnsToFit();
1607
- }
1608
- };
1609
- AXDataGridComponent.ctorParameters = function () { return [
1610
- { type: core.ElementRef },
1611
- { type: core.ChangeDetectorRef }
1612
- ]; };
1613
- __decorate([
1614
- core.Input(),
1615
- __metadata("design:type", Boolean)
1616
- ], AXDataGridComponent.prototype, "remoteOperation", void 0);
1617
- __decorate([
1618
- core.Input(),
1619
- __metadata("design:type", Boolean)
1620
- ], AXDataGridComponent.prototype, "rowMultiSelectWithClick", void 0);
1621
- __decorate([
1622
- core.Input(),
1623
- __metadata("design:type", Boolean)
1624
- ], AXDataGridComponent.prototype, "suppressRowClickSelection", void 0);
1625
- __decorate([
1626
- core.Input(),
1627
- __metadata("design:type", Boolean)
1628
- ], AXDataGridComponent.prototype, "suppressCellSelection", void 0);
1629
- __decorate([
1630
- core.Input(),
1631
- __metadata("design:type", Boolean)
1632
- ], AXDataGridComponent.prototype, "sizeColumnsToFit", void 0);
1633
- __decorate([
1634
- core.Input(),
1635
- __metadata("design:type", Boolean)
1636
- ], AXDataGridComponent.prototype, "showCheckBox", void 0);
1637
- __decorate([
1638
- core.Input(),
1639
- __metadata("design:type", Boolean)
1640
- ], AXDataGridComponent.prototype, "floatingFilter", void 0);
1641
- __decorate([
1642
- core.Input(),
1643
- __metadata("design:type", Number)
1644
- ], AXDataGridComponent.prototype, "takeCount", void 0);
1645
- __decorate([
1646
- core.Input(),
1647
- __metadata("design:type", String)
1648
- ], AXDataGridComponent.prototype, "selectionMode", void 0);
1649
- __decorate([
1650
- core.Input(),
1651
- __metadata("design:type", Array)
1652
- ], AXDataGridComponent.prototype, "selectRow", void 0);
1653
- __decorate([
1654
- core.Input(),
1655
- __metadata("design:type", String)
1656
- ], AXDataGridComponent.prototype, "rowGroupPanelShow", void 0);
1657
- __decorate([
1658
- core.Input(),
1659
- __metadata("design:type", Boolean)
1660
- ], AXDataGridComponent.prototype, "loadOnInit", void 0);
1661
- __decorate([
1662
- core.Input(),
1663
- __metadata("design:type", String)
1664
- ], AXDataGridComponent.prototype, "keyField", void 0);
1665
- __decorate([
1666
- core.Input(),
1667
- __metadata("design:type", String)
1668
- ], AXDataGridComponent.prototype, "hasChildField", void 0);
1669
- __decorate([
1670
- core.Input(),
1671
- __metadata("design:type", String),
1672
- __metadata("design:paramtypes", [String])
1673
- ], AXDataGridComponent.prototype, "searchText", null);
1674
- __decorate([
1675
- core.Input(),
1676
- __metadata("design:type", Array),
1677
- __metadata("design:paramtypes", [Array])
1678
- ], AXDataGridComponent.prototype, "filter", null);
1679
- __decorate([
1680
- core.ContentChildren(AXGridDataColumn),
1681
- __metadata("design:type", core.QueryList)
1682
- ], AXDataGridComponent.prototype, "_inlineColumns", void 0);
1683
- __decorate([
1684
- core.Output(),
1685
- __metadata("design:type", core.EventEmitter)
1686
- ], AXDataGridComponent.prototype, "columnsChange", void 0);
1687
- __decorate([
1688
- core.Input(),
1689
- __metadata("design:type", Array),
1690
- __metadata("design:paramtypes", [Array])
1691
- ], AXDataGridComponent.prototype, "columns", null);
1692
- __decorate([
1693
- core.Input(),
1694
- __metadata("design:type", Object)
1695
- ], AXDataGridComponent.prototype, "rowHeight", void 0);
1696
- __decorate([
1697
- core.ContentChild(components.AXToolbarSearchComponent, { static: true }),
1698
- __metadata("design:type", components.AXToolbarSearchComponent)
1699
- ], AXDataGridComponent.prototype, "searchInput", void 0);
1700
- __decorate([
1701
- core.ContentChild(components.AXToolbarComponent, { static: true }),
1702
- __metadata("design:type", components.AXToolbarComponent)
1703
- ], AXDataGridComponent.prototype, "toolbar", void 0);
1704
- __decorate([
1705
- core.ContentChild(AXDataGridRowTemplateComponent, { static: true }),
1706
- __metadata("design:type", AXDataGridRowTemplateComponent)
1707
- ], AXDataGridComponent.prototype, "rowTemplate", void 0);
1708
- __decorate([
1709
- core.ContentChild(AXDataGridDetailTemplateComponent, { static: true }),
1710
- __metadata("design:type", AXDataGridDetailTemplateComponent)
1711
- ], AXDataGridComponent.prototype, "gridDetailTemplate", void 0);
1712
- __decorate([
1713
- core.ContentChild(components.AXDataSourceComponent, { static: true }),
1714
- __metadata("design:type", components.AXDataSourceComponent)
1715
- ], AXDataGridComponent.prototype, "_contentDataSource", void 0);
1716
- __decorate([
1717
- core.Input(),
1718
- __metadata("design:type", components.AXDataSourceComponent),
1719
- __metadata("design:paramtypes", [components.AXDataSourceComponent])
1720
- ], AXDataGridComponent.prototype, "dataSource", null);
1721
- __decorate([
1722
- core.Input(),
1723
- __metadata("design:type", Boolean)
1724
- ], AXDataGridComponent.prototype, "groupHideOpenParents", void 0);
1725
- __decorate([
1726
- core.Output(),
1727
- __metadata("design:type", core.EventEmitter)
1728
- ], AXDataGridComponent.prototype, "cellClick", void 0);
1729
- __decorate([
1730
- core.Output(),
1731
- __metadata("design:type", core.EventEmitter)
1732
- ], AXDataGridComponent.prototype, "cellDbClick", void 0);
1733
- __decorate([
1734
- core.Output(),
1735
- __metadata("design:type", core.EventEmitter)
1736
- ], AXDataGridComponent.prototype, "cellFocuse", void 0);
1737
- __decorate([
1738
- core.Output(),
1739
- __metadata("design:type", core.EventEmitter)
1740
- ], AXDataGridComponent.prototype, "rowClick", void 0);
1741
- __decorate([
1742
- core.Output(),
1743
- __metadata("design:type", core.EventEmitter)
1744
- ], AXDataGridComponent.prototype, "rowDbClick", void 0);
1745
- __decorate([
1746
- core.Output(),
1747
- __metadata("design:type", core.EventEmitter)
1748
- ], AXDataGridComponent.prototype, "selectionChanged", void 0);
1749
- __decorate([
1750
- core.Output(),
1751
- __metadata("design:type", core.EventEmitter)
1752
- ], AXDataGridComponent.prototype, "rowSelectionChange", void 0);
1753
- __decorate([
1754
- core.Output(),
1755
- __metadata("design:type", core.EventEmitter)
1756
- ], AXDataGridComponent.prototype, "onRowSelectionChanged", void 0);
1757
- __decorate([
1758
- core.Input(),
1759
- __metadata("design:type", Function)
1760
- ], AXDataGridComponent.prototype, "rowClass", void 0);
1761
- __decorate([
1762
- core.Input(),
1763
- __metadata("design:type", Boolean)
1764
- ], AXDataGridComponent.prototype, "rtl", void 0);
1765
- AXDataGridComponent = __decorate([
1766
- core.Component({
1767
- selector: 'ax-data-grid',
1768
- 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)\" -->",
1769
- encapsulation: core.ViewEncapsulation.None
1770
- // changeDetection: ChangeDetectionStrategy.OnPush
1771
- }),
1772
- __metadata("design:paramtypes", [core.ElementRef, core.ChangeDetectorRef])
1773
- ], AXDataGridComponent);
1774
- return AXDataGridComponent;
1775
- }());
1776
-
1777
- var AXDataGridFilterComponent = /** @class */ (function () {
1778
- function AXDataGridFilterComponent() {
1779
- }
1780
- AXDataGridFilterComponent = __decorate([
1781
- core.Component({
1782
- selector: 'ax-data-grid-filter',
1783
- 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 ",
1784
- encapsulation: core.ViewEncapsulation.None
1785
- })
1786
- ], AXDataGridFilterComponent);
1787
- return AXDataGridFilterComponent;
1788
- }());
1789
-
1790
- var AXDataGridModule = /** @class */ (function () {
1791
- function AXDataGridModule() {
1792
- }
1793
- AXDataGridModule = __decorate([
1794
- core.NgModule({
1795
- declarations: [
1796
- AXDataGridComponent,
1797
- AXGridTextColumn,
1798
- AXGridCheckColumn,
1799
- AXGridSelectionColumn,
1800
- AXGridDateColumn,
1801
- AXGridRowNumberColumn,
1802
- AXGridCommandColumn,
1803
- BooleanRenderer,
1804
- BooleanFilterRenderer,
1805
- TextFilterRenderer,
1806
- AXDataGridFilterComponent,
1807
- AXDataGridRowTemplateComponent,
1808
- AXDataGridDetailTemplateComponent,
1809
- AXDataGridRowTemplateRenderer,
1810
- AXDataGridDetailTemplateRenderer,
1811
- AXDataGridCellTemplateComponent,
1812
- AXDataGridCellTemplateRenderer,
1813
- AXDatePickerFilterComponent,
1814
- CommandRenderer
1815
- ],
1816
- imports: [
1817
- common.CommonModule,
1818
- core$1.AXCoreModule,
1819
- forms.FormsModule,
1820
- //AgGridModule,
1821
- components.AXTextBoxModule,
1822
- components.AXCheckBoxModule,
1823
- components.AXSelectBoxModule,
1824
- components.AXDataSourceModule,
1825
- components.AXButtonModule,
1826
- components.AXDatePickerModule,
1827
- agGridAngular.AgGridModule.withComponents([AXDatePickerFilterComponent])
1828
- ],
1829
- exports: [
1830
- AXDataGridComponent,
1831
- AXDataGridFilterComponent,
1832
- AXDataGridRowTemplateComponent,
1833
- AXDataGridDetailTemplateComponent,
1834
- AXDataGridRowTemplateRenderer,
1835
- AXDataGridDetailTemplateRenderer,
1836
- AXDataGridCellTemplateComponent,
1837
- AXDataGridCellTemplateRenderer,
1838
- AXGridTextColumn,
1839
- AXGridRowNumberColumn,
1840
- AXGridCheckColumn,
1841
- AXGridDateColumn,
1842
- AXGridSelectionColumn,
1843
- AXGridCommandColumn,
1844
- BooleanRenderer,
1845
- BooleanFilterRenderer,
1846
- CommandRenderer
1847
- ],
1848
- entryComponents: [
1849
- BooleanRenderer,
1850
- BooleanFilterRenderer,
1851
- CommandRenderer,
1852
- TextFilterRenderer,
1853
- AXDataGridRowTemplateComponent,
1854
- AXDataGridDetailTemplateComponent,
1855
- AXDataGridRowTemplateRenderer,
1856
- AXDataGridDetailTemplateRenderer,
1857
- AXDataGridCellTemplateComponent,
1858
- AXDataGridCellTemplateRenderer
1859
- ],
1860
- providers: []
1861
- })
1862
- ], AXDataGridModule);
1863
- return AXDataGridModule;
1864
- }());
1865
-
1866
- var AXDataLovPopupComponent = /** @class */ (function (_super) {
1867
- __extends(AXDataLovPopupComponent, _super);
1868
- function AXDataLovPopupComponent(cdr, ref) {
1869
- var _this = _super.call(this) || this;
1870
- _this.cdr = cdr;
1871
- _this.ref = ref;
1872
- _this.columns = [];
1873
- _this.selectedItems = [];
1874
- _this.keyField = '';
1875
- _this.allowNull = true;
1876
- _this.rtl = core$1.AXConfig.get('layout.rtl');
1877
- _this.selectedRows = [];
1878
- return _this;
1879
- }
1880
- AXDataLovPopupComponent.prototype.ngOnInit = function () {
1881
- if (this.rtl == null) {
1882
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
1883
- }
1884
- };
1885
- AXDataLovPopupComponent.prototype.onDoneClick = function () {
1886
- if (this.selectedItems) {
1887
- this.close(this.selectedItems);
1888
- }
1889
- else {
1890
- this.close();
1891
- }
1892
- };
1893
- AXDataLovPopupComponent.prototype.rowDoubleClicked = function (e) {
1894
- var _this = this;
1895
- console.log('s', e.data.data);
1896
- if (this.selectionMode == 'single') {
1897
- this.selectedItems = [];
1898
- }
1899
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.data[_this.keyField]; });
1900
- this.selectedItems.push(e.data.data);
1901
- this.onDoneClick();
1902
- };
1903
- AXDataLovPopupComponent.prototype.onCancelClick = function () {
1904
- this.close();
1905
- };
1906
- AXDataLovPopupComponent.prototype.rowSelectionChange = function (e) {
1907
- var _this = this;
1908
- if (e.data.node.selected == true) {
1909
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
1910
- this.selectedItems.push(e.data.node.data);
1911
- }
1912
- else {
1913
- if (this.allowNull == true || (this.allowNull == false && this.selectedItems.length > 1)) {
1914
- this.selectedItems = this.selectedItems.filter(function (c) { return c[_this.keyField] != e.data.node.data[_this.keyField]; });
1915
- }
1916
- }
1917
- // console.log('ee', e)
1918
- // // console.log('e', e);
1919
- // console.log('select', e.data.node.selected);
1920
- // console.log('index', e.data.rowIndex);
1921
- };
1922
- AXDataLovPopupComponent.prototype.ngAfterViewInit = function () {
1923
- var _this = this;
1924
- this.selectedItems.forEach(function (ele) {
1925
- _this.selectedRows.push(ele);
1926
- });
1927
- this.searchBox.focus();
1928
- if (this.dataSource.onDataReceived) {
1929
- this.dataSource.onDataReceived.subscribe(function (arg) {
1930
- _this.cdr.markForCheck();
1931
- _this.cdr.detectChanges();
1932
- });
1933
- }
1934
- };
1935
- // onValueSearchChanged(e) {
1936
- // const params: AXDataSourceReadParams = {}
1937
- // params.searchText = e.value;
1938
- // // params.take = 100;
1939
- // // params.skip = 0
1940
- // this.dataSource.fetch(params);
1941
- // }
1942
- AXDataLovPopupComponent.prototype.getFooterButtons = function () {
1943
- return [
1944
- {
1945
- text: core$1.AXTranslator.get('common.confirm'),
1946
- name: 'confirm',
1947
- style: 'ax primary',
1948
- icon: 'far fa-check-circle'
1949
- },
1950
- {
1951
- text: core$1.AXTranslator.get('common.cancel'),
1952
- name: 'cancel',
1953
- style: 'ax light',
1954
- icon: 'far fa-times-circle'
1955
- }
1956
- ];
1957
- };
1958
- AXDataLovPopupComponent.prototype.onFooterButtonClick = function (e) {
1959
- if (e.name === 'confirm') {
1960
- this.onDoneClick();
1961
- }
1962
- if (e.name === 'cancel') {
1963
- this.onCancelClick();
1964
- }
1965
- };
1966
- AXDataLovPopupComponent.ctorParameters = function () { return [
1967
- { type: core.ChangeDetectorRef },
1968
- { type: core.ElementRef }
1969
- ]; };
1970
- __decorate([
1971
- core.ViewChild('grid', { static: true }),
1972
- __metadata("design:type", AXDataGridComponent)
1973
- ], AXDataLovPopupComponent.prototype, "grid", void 0);
1974
- __decorate([
1975
- core.ViewChild('searchBox'),
1976
- __metadata("design:type", components.AXToolbarSearchComponent)
1977
- ], AXDataLovPopupComponent.prototype, "searchBox", void 0);
1978
- AXDataLovPopupComponent = __decorate([
1979
- core.Component({
1980
- 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>"
1981
- }),
1982
- __metadata("design:paramtypes", [core.ChangeDetectorRef, core.ElementRef])
1983
- ], AXDataLovPopupComponent);
1984
- return AXDataLovPopupComponent;
1985
- }(components.AXBasePopupPageComponent));
1986
-
1987
- var AXLOVComponent = /** @class */ (function (_super) {
1988
- __extends(AXLOVComponent, _super);
1989
- function AXLOVComponent(popup, ref) {
1990
- var _this = _super.call(this) || this;
1991
- _this.popup = popup;
1992
- _this.ref = ref;
1993
- _this.textField = '';
1994
- _this.allowSearch = true;
1995
- _this.valueField = '';
1996
- _this.hasChildField = 'null';
1997
- _this.allowNull = true;
1998
- _this.popupSize = 'md';
1999
- _this.selectedItems = [];
2000
- // @Input()
2001
- // selectedValues: any[] = [];
2002
- _this.readonly = false;
2003
- _this.disabled = false;
2004
- _this.chipsWidth = '';
2005
- _this.size = 'md';
2006
- _this.mode = 'single';
2007
- _this.onSelectionChange = new core.EventEmitter();
2008
- _this.rtl = core$1.AXConfig.get('layout.rtl');
2009
- return _this;
2010
- }
2011
- AXLOVComponent_1 = AXLOVComponent;
2012
- Object.defineProperty(AXLOVComponent.prototype, "validation", {
2013
- get: function () {
2014
- return this._validation ? this._validation : this._contentValidation;
2015
- },
2016
- set: function (v) {
2017
- this._validation = v;
2018
- },
2019
- enumerable: true,
2020
- configurable: true
2021
- });
2022
- AXLOVComponent.prototype.focus = function () {
2023
- this.selectBox.focus();
2024
- };
2025
- AXLOVComponent.prototype.refresh = function () {
2026
- this.selectBox.refresh();
2027
- };
2028
- AXLOVComponent.prototype.handleButtonClick = function () {
2029
- this.open();
2030
- };
2031
- AXLOVComponent.prototype.ngOnInit = function () {
2032
- var _this = this;
2033
- if (this.rtl == null) {
2034
- this.rtl = window.getComputedStyle(this.ref.nativeElement, null).getPropertyValue('direction') === 'rtl';
2035
- }
2036
- // this.selectVal = this.selectedValues;
2037
- this.onSelectionChange.subscribe(function (c) {
2038
- _this.clearValidationStyle(_this.ref.nativeElement);
2039
- });
2040
- };
2041
- AXLOVComponent.prototype.ngAfterContentInit = function () {
2042
- this.initValidation(this.ref, 'selectedItems', this.validation);
2043
- };
2044
- AXLOVComponent.prototype.handleSelectChange = function (e) {
2045
- // console.log('se' + JSON.stringify(e));
2046
- this.onSelectionChange.emit({ data: this.selectedItems, component: this, htmlElement: this.ref.nativeElement });
2047
- };
2048
- AXLOVComponent.prototype.open = function () {
2049
- var _this = this;
2050
- return new Promise(function (resolve) {
2051
- _this.selectBox.dropdown.close();
2052
- _this.popup
2053
- .open(AXDataLovPopupComponent, {
2054
- size: _this.popupSize,
2055
- // closable: false,
2056
- data: {
2057
- dataSource: _this.dataSource,
2058
- selectionMode: _this.mode,
2059
- columns: _this.columns.toArray(),
2060
- // selectedItems: this.selectedValues,
2061
- selectedItems: _this.selectedItems,
2062
- keyField: _this.valueField,
2063
- allowNull: _this.allowNull,
2064
- hasChildField: _this.hasChildField,
2065
- rtl: _this.rtl
2066
- },
2067
- title: _this.caption
2068
- // size: this.size,
2069
- })
2070
- .then(function (c) {
2071
- if (c.data) {
2072
- // this.selectedValues = [];
2073
- _this.selectedItems = [];
2074
- c.data.forEach(function (elm) {
2075
- _this.selectedItems.push(elm);
2076
- });
2077
- // this.selectedItems = c.data;
2078
- // this.selectBox.refresh();
2079
- // console.log('se' + JSON.stringify(this.selectedItems));
2080
- _this.onSelectionChange.emit({ data: _this.selectedItems, component: _this, htmlElement: _this.ref.nativeElement });
2081
- if (resolve) {
2082
- resolve(c.data);
2083
- }
2084
- }
2085
- else {
2086
- if (resolve) {
2087
- resolve(_this.selectedItems);
2088
- }
2089
- }
2090
- _this.selectBox.refresh();
2091
- });
2092
- });
2093
- };
2094
- var AXLOVComponent_1;
2095
- AXLOVComponent.ctorParameters = function () { return [
2096
- { type: components.AXPopupService },
2097
- { type: core.ElementRef }
2098
- ]; };
2099
- __decorate([
2100
- core.ContentChild(components.AXValidation, { static: true }),
2101
- __metadata("design:type", components.AXValidation)
2102
- ], AXLOVComponent.prototype, "_contentValidation", void 0);
2103
- __decorate([
2104
- core.Input(),
2105
- __metadata("design:type", components.AXValidation),
2106
- __metadata("design:paramtypes", [components.AXValidation])
2107
- ], AXLOVComponent.prototype, "validation", null);
2108
- __decorate([
2109
- core.ViewChild('selectBox', { static: true }),
2110
- __metadata("design:type", components.AXSelectBoxComponent)
2111
- ], AXLOVComponent.prototype, "selectBox", void 0);
2112
- __decorate([
2113
- core.ContentChild(components.AXDataSourceComponent, { static: true }),
2114
- __metadata("design:type", components.AXDataSourceComponent)
2115
- ], AXLOVComponent.prototype, "dataSource", void 0);
2116
- __decorate([
2117
- core.ContentChildren(AXGridDataColumn),
2118
- __metadata("design:type", core.QueryList)
2119
- ], AXLOVComponent.prototype, "columns", void 0);
2120
- __decorate([
2121
- core.ContentChild('itemTemplate', { static: true }),
2122
- __metadata("design:type", core.TemplateRef)
2123
- ], AXLOVComponent.prototype, "rowTemplate", void 0);
2124
- __decorate([
2125
- core.Input(),
2126
- __metadata("design:type", String)
2127
- ], AXLOVComponent.prototype, "textField", void 0);
2128
- __decorate([
2129
- core.Input(),
2130
- __metadata("design:type", Boolean)
2131
- ], AXLOVComponent.prototype, "allowSearch", void 0);
2132
- __decorate([
2133
- core.Input(),
2134
- __metadata("design:type", String)
2135
- ], AXLOVComponent.prototype, "valueField", void 0);
2136
- __decorate([
2137
- core.Input(),
2138
- __metadata("design:type", String)
2139
- ], AXLOVComponent.prototype, "hasChildField", void 0);
2140
- __decorate([
2141
- core.Input(),
2142
- __metadata("design:type", Boolean)
2143
- ], AXLOVComponent.prototype, "allowNull", void 0);
2144
- __decorate([
2145
- core.Input(),
2146
- __metadata("design:type", String)
2147
- ], AXLOVComponent.prototype, "popupSize", void 0);
2148
- __decorate([
2149
- core.Input(),
2150
- __metadata("design:type", Array)
2151
- ], AXLOVComponent.prototype, "selectedItems", void 0);
2152
- __decorate([
2153
- core.Input(),
2154
- __metadata("design:type", Boolean)
2155
- ], AXLOVComponent.prototype, "readonly", void 0);
2156
- __decorate([
2157
- core.Input(),
2158
- __metadata("design:type", Boolean)
2159
- ], AXLOVComponent.prototype, "disabled", void 0);
2160
- __decorate([
2161
- core.Input(),
2162
- __metadata("design:type", String)
2163
- ], AXLOVComponent.prototype, "chipsWidth", void 0);
2164
- __decorate([
2165
- core.Input(),
2166
- __metadata("design:type", String)
2167
- ], AXLOVComponent.prototype, "size", void 0);
2168
- __decorate([
2169
- core.Input(),
2170
- __metadata("design:type", String)
2171
- ], AXLOVComponent.prototype, "caption", void 0);
2172
- __decorate([
2173
- core.Input(),
2174
- __metadata("design:type", String)
2175
- ], AXLOVComponent.prototype, "mode", void 0);
2176
- __decorate([
2177
- core.Input(),
2178
- __metadata("design:type", String)
2179
- ], AXLOVComponent.prototype, "placeholder", void 0);
2180
- __decorate([
2181
- core.Output(),
2182
- __metadata("design:type", core.EventEmitter)
2183
- ], AXLOVComponent.prototype, "onSelectionChange", void 0);
2184
- __decorate([
2185
- core.Input(),
2186
- __metadata("design:type", Boolean)
2187
- ], AXLOVComponent.prototype, "rtl", void 0);
2188
- AXLOVComponent = AXLOVComponent_1 = __decorate([
2189
- core.Component({
2190
- selector: 'ax-lov',
2191
- 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> -->",
2192
- encapsulation: core.ViewEncapsulation.None,
2193
- host: { style: 'width: 100%' },
2194
- providers: [{ provide: components.AXValidatableComponent, useExisting: AXLOVComponent_1 }]
2195
- }),
2196
- __metadata("design:paramtypes", [components.AXPopupService, core.ElementRef])
2197
- ], AXLOVComponent);
2198
- return AXLOVComponent;
2199
- }(components.AXValidatableComponent));
2200
-
2201
- var AXLOVModule = /** @class */ (function () {
2202
- function AXLOVModule() {
2203
- }
2204
- AXLOVModule = __decorate([
2205
- core.NgModule({
2206
- declarations: [AXLOVComponent, AXDataLovPopupComponent],
2207
- imports: [common.CommonModule, forms.FormsModule, AXDataGridModule, components.AXDataSourceModule, components.AXButtonModule, components.AXToolbarModule, components.AXSelectBoxModule, components.AXSearchBoxModule],
2208
- exports: [AXLOVComponent, AXDataLovPopupComponent],
2209
- providers: [],
2210
- entryComponents: [AXDataLovPopupComponent]
2211
- })
2212
- ], AXLOVModule);
2213
- return AXLOVModule;
2214
- }());
2215
-
2216
- exports.AXDaagridRowClickEvent = AXDaagridRowClickEvent;
2217
- exports.AXDataGridCellEvent = AXDataGridCellEvent;
2218
- exports.AXDataGridCellTemplateComponent = AXDataGridCellTemplateComponent;
2219
- exports.AXDataGridCellTemplateRenderer = AXDataGridCellTemplateRenderer;
2220
- exports.AXDataGridColumnsChangeEvent = AXDataGridColumnsChangeEvent;
2221
- exports.AXDataGridComponent = AXDataGridComponent;
2222
- exports.AXDataGridDetailTemplateComponent = AXDataGridDetailTemplateComponent;
2223
- exports.AXDataGridDetailTemplateRenderer = AXDataGridDetailTemplateRenderer;
2224
- exports.AXDataGridFilterComponent = AXDataGridFilterComponent;
2225
- exports.AXDataGridModule = AXDataGridModule;
2226
- exports.AXDataGridRowSelectionChangeEvent = AXDataGridRowSelectionChangeEvent;
2227
- exports.AXDataGridRowTemplateComponent = AXDataGridRowTemplateComponent;
2228
- exports.AXDataGridRowTemplateRenderer = AXDataGridRowTemplateRenderer;
2229
- exports.AXDataGridSelectionChangeEvent = AXDataGridSelectionChangeEvent;
2230
- exports.AXDataLovPopupComponent = AXDataLovPopupComponent;
2231
- exports.AXDatePickerFilterComponent = AXDatePickerFilterComponent;
2232
- exports.AXGridCheckColumn = AXGridCheckColumn;
2233
- exports.AXGridCommandColumn = AXGridCommandColumn;
2234
- exports.AXGridDataColumn = AXGridDataColumn;
2235
- exports.AXGridDateColumn = AXGridDateColumn;
2236
- exports.AXGridRowNumberColumn = AXGridRowNumberColumn;
2237
- exports.AXGridSelectionColumn = AXGridSelectionColumn;
2238
- exports.AXGridTextColumn = AXGridTextColumn;
2239
- exports.AXLOVComponent = AXLOVComponent;
2240
- exports.AXLOVModule = AXLOVModule;
2241
- exports.BooleanFilterRenderer = BooleanFilterRenderer;
2242
- exports.BooleanRenderer = BooleanRenderer;
2243
- exports.CommandRenderer = CommandRenderer;
2244
- exports.TextFilterRenderer = TextFilterRenderer;
2245
-
2246
- Object.defineProperty(exports, '__esModule', { value: true });
2247
-
2248
- })));
2249
- //# sourceMappingURL=acorex-data-grid.umd.js.map