@firestitch/list 18.0.39 → 18.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/classes/actions-controller.d.ts +1 -1
- package/app/classes/data-controller.d.ts +1 -1
- package/app/components/body/row/cell/cell.component.d.ts +6 -5
- package/app/components/body/row/row.component.d.ts +9 -10
- package/app/components/head/head.component.d.ts +2 -1
- package/app/models/row/_base-row.d.ts +30 -0
- package/app/models/row/child-row.d.ts +18 -7
- package/app/models/row/group-footer-row.d.ts +14 -7
- package/app/models/row/group-row.d.ts +21 -11
- package/app/models/row/simple-row.d.ts +8 -3
- package/app/models/row.d.ts +13 -33
- package/esm2022/app/classes/actions-controller.mjs +3 -3
- package/esm2022/app/classes/data-controller.mjs +25 -31
- package/esm2022/app/classes/index.mjs +1 -1
- package/esm2022/app/classes/list-controller.mjs +1 -4
- package/esm2022/app/classes/selection-controller.mjs +8 -7
- package/esm2022/app/components/body/row/actions/actions.component.mjs +1 -2
- package/esm2022/app/components/body/row/cell/cell.component.mjs +45 -39
- package/esm2022/app/components/body/row/inline-action/inline-action.component.mjs +1 -2
- package/esm2022/app/components/body/row/menu-action/menu-action.component.mjs +1 -2
- package/esm2022/app/components/body/row/row.component.mjs +54 -59
- package/esm2022/app/components/footer/footer-row/footer-cell/footer-cell.component.mjs +3 -3
- package/esm2022/app/components/footer/footer-row/footer-row.component.mjs +3 -3
- package/esm2022/app/components/head/head-cell/head-cell.component.mjs +1 -1
- package/esm2022/app/components/head/head.component.mjs +4 -3
- package/esm2022/app/components/list/list.component.mjs +3 -3
- package/esm2022/app/components/loader/loader.component.mjs +3 -3
- package/esm2022/app/directives/draggable-list/draggable-list.directive.mjs +5 -4
- package/esm2022/app/directives/draggable-row/draggable-row.directive.mjs +4 -4
- package/esm2022/app/directives/empty-state/empty-state.directive.mjs +1 -1
- package/esm2022/app/directives/footer/footer.directive.mjs +1 -1
- package/esm2022/app/directives/group-expand-trigger/group-expand-trigger.directive.mjs +1 -1
- package/esm2022/app/directives/header/header.directive.mjs +1 -1
- package/esm2022/app/directives/heading/heading.directive.mjs +1 -1
- package/esm2022/app/directives/heading-container/heading-container.directive.mjs +1 -1
- package/esm2022/app/directives/index.mjs +1 -1
- package/esm2022/app/directives/subheading/subheading.directive.mjs +1 -1
- package/esm2022/app/enums/page-change-type.enum.mjs +1 -1
- package/esm2022/app/enums/pagination-strategy.enum.mjs +1 -1
- package/esm2022/app/enums/state.enum.mjs +1 -1
- package/esm2022/app/interfaces/cellconfig.interface.mjs +1 -1
- package/esm2022/app/interfaces/draggable-list.interface.mjs +1 -1
- package/esm2022/app/interfaces/external-params.interface.mjs +1 -1
- package/esm2022/app/interfaces/sorting-change-event.interface.mjs +1 -1
- package/esm2022/app/models/row/_base-row.mjs +43 -0
- package/esm2022/app/models/row/child-row.mjs +14 -10
- package/esm2022/app/models/row/group-footer-row.mjs +11 -7
- package/esm2022/app/models/row/group-row.mjs +16 -20
- package/esm2022/app/models/row/simple-row.mjs +5 -5
- package/esm2022/app/models/row.mjs +26 -82
- package/fesm2022/firestitch-list.mjs +529 -559
- package/fesm2022/firestitch-list.mjs.map +1 -1
- package/package.json +1 -1
- package/app/models/row/base-row.d.ts +0 -13
- package/esm2022/app/models/row/base-row.mjs +0 -25
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Directive, Input, Component, ChangeDetectionStrategy, HostBinding, EventEmitter, Output, Pipe,
|
|
2
|
+
import { Injectable, Directive, Input, input, effect, Component, ChangeDetectionStrategy, HostBinding, EventEmitter, Output, Pipe, computed, TemplateRef, ViewContainerRef, ViewChild, ContentChild, inject, HostListener, ContentChildren, InjectionToken, ChangeDetectorRef, Injector, Optional, Inject, NgModule } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Subject, Observable, of, merge, from, combineLatest, EMPTY } from 'rxjs';
|
|
4
4
|
import { takeUntil, take, filter, tap, skip, distinctUntilChanged, map, shareReplay, delay, switchMap, debounceTime, mapTo, catchError } from 'rxjs/operators';
|
|
5
5
|
import { get, isString, isObject, isBoolean, isNumber, isFunction, cloneDeep, random, mergeWith } from 'lodash-es';
|
|
6
|
-
import { MatCheckbox } from '@angular/material/checkbox';
|
|
7
6
|
import { NgTemplateOutlet, NgIf, NgSwitch, NgSwitchCase, NgClass, NgFor, AsyncPipe, Location, DecimalPipe } from '@angular/common';
|
|
7
|
+
import { MatCheckbox } from '@angular/material/checkbox';
|
|
8
|
+
import { MatIcon } from '@angular/material/icon';
|
|
8
9
|
import * as i1$2 from '@firestitch/prompt';
|
|
9
10
|
import * as i1 from '@firestitch/file';
|
|
10
11
|
import { FsFileModule } from '@firestitch/file';
|
|
11
12
|
import { MatButton, MatAnchor, MatIconButton, MatIconAnchor, MatFabButton, MatFabAnchor, MatMiniFabButton, MatMiniFabAnchor } from '@angular/material/button';
|
|
12
13
|
import * as i5 from '@angular/router';
|
|
13
14
|
import { RouterLink } from '@angular/router';
|
|
14
|
-
import { MatIcon } from '@angular/material/icon';
|
|
15
15
|
import * as i1$1 from '@firestitch/menu';
|
|
16
16
|
import { FsMenuModule } from '@firestitch/menu';
|
|
17
17
|
import * as i3 from '@angular/material/dialog';
|
|
@@ -214,6 +214,186 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
214
214
|
type: Injectable
|
|
215
215
|
}] });
|
|
216
216
|
|
|
217
|
+
var RowType;
|
|
218
|
+
(function (RowType) {
|
|
219
|
+
RowType["Simple"] = "simple";
|
|
220
|
+
RowType["Group"] = "group";
|
|
221
|
+
RowType["GroupFooter"] = "groupFooter";
|
|
222
|
+
RowType["GroupChild"] = "groupChild";
|
|
223
|
+
})(RowType || (RowType = {}));
|
|
224
|
+
|
|
225
|
+
class BaseRow {
|
|
226
|
+
_rowType;
|
|
227
|
+
_index;
|
|
228
|
+
_readyToSwap = true;
|
|
229
|
+
_actionsUpdated$ = new Subject();
|
|
230
|
+
_data = {};
|
|
231
|
+
constructor(data = {}) {
|
|
232
|
+
this._data = data;
|
|
233
|
+
}
|
|
234
|
+
get data() {
|
|
235
|
+
return this._data;
|
|
236
|
+
}
|
|
237
|
+
get type() {
|
|
238
|
+
return this._rowType;
|
|
239
|
+
}
|
|
240
|
+
get index() {
|
|
241
|
+
return this._index;
|
|
242
|
+
}
|
|
243
|
+
set index(value) {
|
|
244
|
+
this._index = value;
|
|
245
|
+
}
|
|
246
|
+
get readyToSwap() {
|
|
247
|
+
return this._readyToSwap;
|
|
248
|
+
}
|
|
249
|
+
set readyToSwap(value) {
|
|
250
|
+
this._readyToSwap = value;
|
|
251
|
+
}
|
|
252
|
+
get actionsUpdated$() {
|
|
253
|
+
return this._actionsUpdated$.asObservable();
|
|
254
|
+
}
|
|
255
|
+
updateActions() {
|
|
256
|
+
return this._actionsUpdated$.next();
|
|
257
|
+
}
|
|
258
|
+
reorderData() {
|
|
259
|
+
return {
|
|
260
|
+
type: this._rowType,
|
|
261
|
+
data: this.data,
|
|
262
|
+
parent: null,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
class ChildRow extends BaseRow {
|
|
268
|
+
_rowType = RowType.GroupChild;
|
|
269
|
+
_visible = true;
|
|
270
|
+
_parent;
|
|
271
|
+
constructor(data = {}, parent = null) {
|
|
272
|
+
super(data);
|
|
273
|
+
this._parent = parent;
|
|
274
|
+
if (this.parent) {
|
|
275
|
+
this._visible = this._parent.expanded;
|
|
276
|
+
this.index = this.parent.children.length;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
get visible() {
|
|
280
|
+
return this._visible;
|
|
281
|
+
}
|
|
282
|
+
set visible(value) {
|
|
283
|
+
this._visible = value;
|
|
284
|
+
}
|
|
285
|
+
get parent() {
|
|
286
|
+
return this._parent;
|
|
287
|
+
}
|
|
288
|
+
reorderData() {
|
|
289
|
+
return {
|
|
290
|
+
type: this._rowType,
|
|
291
|
+
data: this.data,
|
|
292
|
+
parent: this.parent.reorderData(),
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
destroy() { }
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
class GroupFooterRow extends BaseRow {
|
|
299
|
+
_rowType = RowType.GroupFooter;
|
|
300
|
+
_visible = true;
|
|
301
|
+
_parent;
|
|
302
|
+
constructor(data = {}, parent = null) {
|
|
303
|
+
super(data);
|
|
304
|
+
this._parent = parent;
|
|
305
|
+
if (this.parent) {
|
|
306
|
+
this.visible = this._parent.expanded;
|
|
307
|
+
this.index = this.parent.children.length;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
get visible() {
|
|
311
|
+
return this._visible;
|
|
312
|
+
}
|
|
313
|
+
set visible(value) {
|
|
314
|
+
this._visible = value;
|
|
315
|
+
}
|
|
316
|
+
get parent() {
|
|
317
|
+
return this._parent;
|
|
318
|
+
}
|
|
319
|
+
destroy() { }
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
class GroupRow extends BaseRow {
|
|
323
|
+
_rowType = RowType.Group;
|
|
324
|
+
_children = [];
|
|
325
|
+
_expanded = new BehaviorSubject(false);
|
|
326
|
+
constructor(data = {}, initialExpand = false) {
|
|
327
|
+
super(data);
|
|
328
|
+
if (initialExpand) {
|
|
329
|
+
this._expanded.next(initialExpand);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
get children() {
|
|
333
|
+
return this._children;
|
|
334
|
+
}
|
|
335
|
+
get childrenData() {
|
|
336
|
+
return this._children
|
|
337
|
+
.map((child) => child.data);
|
|
338
|
+
}
|
|
339
|
+
get expanded() {
|
|
340
|
+
return this._expanded.getValue();
|
|
341
|
+
}
|
|
342
|
+
get expanded$() {
|
|
343
|
+
return this._expanded.asObservable();
|
|
344
|
+
}
|
|
345
|
+
toggleRowExpandStatus() {
|
|
346
|
+
this._expanded.next(!this.expanded);
|
|
347
|
+
this._updateChildrenVisibility();
|
|
348
|
+
}
|
|
349
|
+
destroy() {
|
|
350
|
+
this._children.forEach((child) => child.destroy());
|
|
351
|
+
this._expanded.complete();
|
|
352
|
+
}
|
|
353
|
+
_updateChildrenVisibility() {
|
|
354
|
+
this._children.forEach((row) => {
|
|
355
|
+
row.visible = this.expanded;
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
class SimpleRow extends BaseRow {
|
|
361
|
+
_rowType = RowType.Simple;
|
|
362
|
+
constructor(data = {}) {
|
|
363
|
+
super(data);
|
|
364
|
+
}
|
|
365
|
+
destroy() { }
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function isGroupRow(row) {
|
|
369
|
+
return row.type === RowType.Group;
|
|
370
|
+
}
|
|
371
|
+
function isChildRow(row) {
|
|
372
|
+
return row.type === RowType.GroupChild;
|
|
373
|
+
}
|
|
374
|
+
function isGroupFooterRow(row) {
|
|
375
|
+
return row.type === RowType.GroupFooter;
|
|
376
|
+
}
|
|
377
|
+
function isChildTypeRow(row) {
|
|
378
|
+
return row.type === RowType.GroupChild || row.type === RowType.GroupFooter;
|
|
379
|
+
}
|
|
380
|
+
function makeRowFactory(data, rowType, opts = {}) {
|
|
381
|
+
switch (rowType) {
|
|
382
|
+
case RowType.Simple: {
|
|
383
|
+
return new SimpleRow(data);
|
|
384
|
+
}
|
|
385
|
+
case RowType.Group: {
|
|
386
|
+
return new GroupRow(data, opts.initialExpand);
|
|
387
|
+
}
|
|
388
|
+
case RowType.GroupChild: {
|
|
389
|
+
return new ChildRow(data, opts.parent);
|
|
390
|
+
}
|
|
391
|
+
case RowType.GroupFooter: {
|
|
392
|
+
return new GroupFooterRow(data, opts.parent);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
217
397
|
var SelectionChangeType;
|
|
218
398
|
(function (SelectionChangeType) {
|
|
219
399
|
SelectionChangeType["AllVisibleSelectionChange"] = "AllVisibleSelectionChange";
|
|
@@ -308,7 +488,7 @@ class SelectionController {
|
|
|
308
488
|
if (checked) {
|
|
309
489
|
rows.forEach((row) => {
|
|
310
490
|
const identifier = this._rowIdentifier(row.data);
|
|
311
|
-
if (row
|
|
491
|
+
if (isGroupRow(row)) {
|
|
312
492
|
this._setNumberOfSelectedChildrenInGroup(identifier, row.children.length);
|
|
313
493
|
}
|
|
314
494
|
else {
|
|
@@ -320,7 +500,7 @@ class SelectionController {
|
|
|
320
500
|
else {
|
|
321
501
|
rows.forEach((row) => {
|
|
322
502
|
const identifier = this._rowIdentifier(row.data);
|
|
323
|
-
if (row
|
|
503
|
+
if (isGroupRow(row)) {
|
|
324
504
|
this._setNumberOfSelectedChildrenInGroup(identifier, 0);
|
|
325
505
|
}
|
|
326
506
|
else {
|
|
@@ -618,13 +798,13 @@ class SelectionController {
|
|
|
618
798
|
}
|
|
619
799
|
_selectRow(row) {
|
|
620
800
|
const identifier = this._rowIdentifier(row.data);
|
|
621
|
-
if (row
|
|
801
|
+
if (isGroupRow(row)) {
|
|
622
802
|
row.children.forEach((childRow) => {
|
|
623
803
|
this._selectRow(childRow);
|
|
624
804
|
});
|
|
625
805
|
}
|
|
626
806
|
else {
|
|
627
|
-
if (row
|
|
807
|
+
if (isChildRow(row)) {
|
|
628
808
|
this._selectChildRow(row);
|
|
629
809
|
}
|
|
630
810
|
this.selectedRows.set(identifier, row.data);
|
|
@@ -633,14 +813,14 @@ class SelectionController {
|
|
|
633
813
|
}
|
|
634
814
|
_deselectRow(row) {
|
|
635
815
|
const identifier = this._rowIdentifier(row.data);
|
|
636
|
-
if (row
|
|
816
|
+
if (isGroupRow(row)) {
|
|
637
817
|
this.selectedGroups.delete(identifier);
|
|
638
818
|
row.children.forEach((childRow) => {
|
|
639
819
|
this._deselectRow(childRow);
|
|
640
820
|
});
|
|
641
821
|
}
|
|
642
822
|
else {
|
|
643
|
-
if (row
|
|
823
|
+
if (isChildRow(row) && this.selectedRows.has(identifier)) {
|
|
644
824
|
this._deselectChildRow(row);
|
|
645
825
|
}
|
|
646
826
|
this.selectedRows.delete(identifier);
|
|
@@ -782,9 +962,9 @@ class FsListDraggableListDirective {
|
|
|
782
962
|
}
|
|
783
963
|
// Can not drag before first group and after last group
|
|
784
964
|
const swapWithBoundaryGroupElement = (elemIndex === 0 || elemIndex === this._rows.length - 1)
|
|
785
|
-
&& targetRow
|
|
965
|
+
&& isGroupRow(targetRow)
|
|
786
966
|
// TODO fix isChild & all
|
|
787
|
-
&& this.draggableItem
|
|
967
|
+
&& (isChildRow(this.draggableItem));
|
|
788
968
|
if (!swapWithBoundaryGroupElement) {
|
|
789
969
|
if (elemIndex !== null) {
|
|
790
970
|
if (targetRow.readyToSwap) {
|
|
@@ -989,7 +1169,7 @@ class FsListDraggableListDirective {
|
|
|
989
1169
|
this._draggableChildrenDirectives
|
|
990
1170
|
.forEach((dir) => {
|
|
991
1171
|
const isRowSelected = this._reorderController.selectionController?.isRowSelected(dir.row.data);
|
|
992
|
-
if (isRowSelected && !dir.row
|
|
1172
|
+
if (isRowSelected && !isGroupRow(dir.row)) {
|
|
993
1173
|
this._selectedRowsDirectives.push(dir);
|
|
994
1174
|
}
|
|
995
1175
|
});
|
|
@@ -1023,219 +1203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1023
1203
|
args: ['rows']
|
|
1024
1204
|
}] } });
|
|
1025
1205
|
|
|
1026
|
-
var RowType;
|
|
1027
|
-
(function (RowType) {
|
|
1028
|
-
RowType["Simple"] = "simple";
|
|
1029
|
-
RowType["Group"] = "group";
|
|
1030
|
-
RowType["GroupFooter"] = "groupFooter";
|
|
1031
|
-
RowType["GroupChild"] = "groupChild";
|
|
1032
|
-
})(RowType || (RowType = {}));
|
|
1033
|
-
|
|
1034
|
-
class BaseRow {
|
|
1035
|
-
index;
|
|
1036
|
-
readyToSwap = true;
|
|
1037
|
-
_rowType;
|
|
1038
|
-
_data = {};
|
|
1039
|
-
constructor(data = {}, rowType = RowType.Simple) {
|
|
1040
|
-
this._data = data;
|
|
1041
|
-
this._rowType = rowType;
|
|
1042
|
-
}
|
|
1043
|
-
get data() {
|
|
1044
|
-
return this._data;
|
|
1045
|
-
}
|
|
1046
|
-
get type() {
|
|
1047
|
-
return this._rowType;
|
|
1048
|
-
}
|
|
1049
|
-
getReorderData() {
|
|
1050
|
-
return {
|
|
1051
|
-
type: this._rowType,
|
|
1052
|
-
data: this.data,
|
|
1053
|
-
parent: null,
|
|
1054
|
-
};
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
class ChildRow extends BaseRow {
|
|
1059
|
-
visible = true;
|
|
1060
|
-
_parent;
|
|
1061
|
-
constructor(data = {}, parent = null) {
|
|
1062
|
-
super(data, RowType.GroupChild);
|
|
1063
|
-
this._parent = parent;
|
|
1064
|
-
if (this.parent) {
|
|
1065
|
-
this.visible = this._parent.expanded;
|
|
1066
|
-
this.index = this.parent.children.length;
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
get parent() {
|
|
1070
|
-
return this._parent;
|
|
1071
|
-
}
|
|
1072
|
-
get isChild() {
|
|
1073
|
-
return true;
|
|
1074
|
-
}
|
|
1075
|
-
getReorderData() {
|
|
1076
|
-
return {
|
|
1077
|
-
type: this._rowType,
|
|
1078
|
-
data: this.data,
|
|
1079
|
-
parent: this.parent.getReorderData(),
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
destroy() { }
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
class GroupFooterRow extends BaseRow {
|
|
1086
|
-
visible = true;
|
|
1087
|
-
_parent;
|
|
1088
|
-
constructor(data = {}, parent = null) {
|
|
1089
|
-
super(data, RowType.GroupFooter);
|
|
1090
|
-
this._parent = parent;
|
|
1091
|
-
if (this.parent) {
|
|
1092
|
-
this.visible = this._parent.expanded;
|
|
1093
|
-
this.index = this.parent.children.length;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
get parent() {
|
|
1097
|
-
return this._parent;
|
|
1098
|
-
}
|
|
1099
|
-
get isGroupFooter() {
|
|
1100
|
-
return true;
|
|
1101
|
-
}
|
|
1102
|
-
destroy() { }
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
class GroupRow extends BaseRow {
|
|
1106
|
-
children = [];
|
|
1107
|
-
_expanded = new BehaviorSubject(false);
|
|
1108
|
-
constructor(data = {}, initialExpand = false) {
|
|
1109
|
-
super(data, RowType.Group);
|
|
1110
|
-
if (initialExpand) {
|
|
1111
|
-
this._expanded.next(initialExpand);
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
get childrenData() {
|
|
1115
|
-
return this.children
|
|
1116
|
-
.map((child) => child.data);
|
|
1117
|
-
}
|
|
1118
|
-
get isGroup() {
|
|
1119
|
-
return true;
|
|
1120
|
-
}
|
|
1121
|
-
get expanded() {
|
|
1122
|
-
return this._expanded.getValue();
|
|
1123
|
-
}
|
|
1124
|
-
get expanded$() {
|
|
1125
|
-
return this._expanded.asObservable();
|
|
1126
|
-
}
|
|
1127
|
-
updateChildrenIndexes() {
|
|
1128
|
-
this.children.forEach((row, index) => {
|
|
1129
|
-
row.index = index;
|
|
1130
|
-
});
|
|
1131
|
-
}
|
|
1132
|
-
updateChildrenVisibility() {
|
|
1133
|
-
this.children.forEach((row) => {
|
|
1134
|
-
row.visible = this.expanded;
|
|
1135
|
-
});
|
|
1136
|
-
}
|
|
1137
|
-
toggleRowExpandStatus() {
|
|
1138
|
-
this._expanded.next(!this.expanded);
|
|
1139
|
-
this.updateChildrenVisibility();
|
|
1140
|
-
}
|
|
1141
|
-
destroy() {
|
|
1142
|
-
this.children.forEach((child) => child.destroy());
|
|
1143
|
-
this._expanded.complete();
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
class SimpleRow extends BaseRow {
|
|
1148
|
-
constructor(data = {}) {
|
|
1149
|
-
super(data, RowType.Simple);
|
|
1150
|
-
}
|
|
1151
|
-
destroy() {
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
class Row {
|
|
1156
|
-
_row;
|
|
1157
|
-
_actionsUpdate$ = new Subject();
|
|
1158
|
-
constructor(data = {}, rowType = RowType.Simple, { parent, initialExpand } = {}) {
|
|
1159
|
-
switch (rowType) {
|
|
1160
|
-
case RowType.Simple:
|
|
1161
|
-
{
|
|
1162
|
-
this._row = new SimpleRow(data);
|
|
1163
|
-
}
|
|
1164
|
-
break;
|
|
1165
|
-
case RowType.Group:
|
|
1166
|
-
{
|
|
1167
|
-
this._row = new GroupRow(data, initialExpand);
|
|
1168
|
-
}
|
|
1169
|
-
break;
|
|
1170
|
-
case RowType.GroupChild:
|
|
1171
|
-
{
|
|
1172
|
-
this._row = new ChildRow(data, parent);
|
|
1173
|
-
}
|
|
1174
|
-
break;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
get index() {
|
|
1178
|
-
return this._row.index;
|
|
1179
|
-
}
|
|
1180
|
-
get actionsUpdate$() {
|
|
1181
|
-
return this._actionsUpdate$.asObservable();
|
|
1182
|
-
}
|
|
1183
|
-
actionsUpdate() {
|
|
1184
|
-
return this._actionsUpdate$.next(null);
|
|
1185
|
-
}
|
|
1186
|
-
set index(value) {
|
|
1187
|
-
this._row.index = value;
|
|
1188
|
-
}
|
|
1189
|
-
get readyToSwap() {
|
|
1190
|
-
return this._row.readyToSwap;
|
|
1191
|
-
}
|
|
1192
|
-
get visible() {
|
|
1193
|
-
return this._row.visible;
|
|
1194
|
-
}
|
|
1195
|
-
set readyToSwap(value) {
|
|
1196
|
-
this._row.readyToSwap = value;
|
|
1197
|
-
}
|
|
1198
|
-
get data() {
|
|
1199
|
-
return this._row.data;
|
|
1200
|
-
}
|
|
1201
|
-
get type() {
|
|
1202
|
-
return this._row.type;
|
|
1203
|
-
}
|
|
1204
|
-
get isGroup() {
|
|
1205
|
-
return this._row instanceof GroupRow;
|
|
1206
|
-
}
|
|
1207
|
-
get isGroupChild() {
|
|
1208
|
-
return this._row instanceof ChildRow;
|
|
1209
|
-
}
|
|
1210
|
-
get isGroupFooter() {
|
|
1211
|
-
return this._row instanceof GroupFooterRow;
|
|
1212
|
-
}
|
|
1213
|
-
get parent() {
|
|
1214
|
-
return this._row.parent;
|
|
1215
|
-
}
|
|
1216
|
-
get children() {
|
|
1217
|
-
return this._row.children;
|
|
1218
|
-
}
|
|
1219
|
-
get expanded() {
|
|
1220
|
-
return this._row.expanded;
|
|
1221
|
-
}
|
|
1222
|
-
get expanded$() {
|
|
1223
|
-
return this._row.expanded$;
|
|
1224
|
-
}
|
|
1225
|
-
updateChildrenIndexes() {
|
|
1226
|
-
this._row.updateChildrenIndexes();
|
|
1227
|
-
}
|
|
1228
|
-
toggleRowExpandStatus() {
|
|
1229
|
-
this._row.toggleRowExpandStatus();
|
|
1230
|
-
}
|
|
1231
|
-
getReorderData() {
|
|
1232
|
-
return this._row.getReorderData();
|
|
1233
|
-
}
|
|
1234
|
-
destroy() {
|
|
1235
|
-
this._row.destroy();
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
1206
|
var ActionType;
|
|
1240
1207
|
(function (ActionType) {
|
|
1241
1208
|
ActionType["Basic"] = "basic";
|
|
@@ -1533,95 +1500,256 @@ class Column {
|
|
|
1533
1500
|
switch (key) {
|
|
1534
1501
|
case 'title':
|
|
1535
1502
|
{
|
|
1536
|
-
this.title = this.title || defaults.title;
|
|
1503
|
+
this.title = this.title || defaults.title;
|
|
1504
|
+
}
|
|
1505
|
+
break;
|
|
1506
|
+
case 'sortable':
|
|
1507
|
+
{
|
|
1508
|
+
if (isBoolean(defaults.sortable)) {
|
|
1509
|
+
if (this.sortable === undefined) {
|
|
1510
|
+
this.sortable = defaults.sortable;
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
break;
|
|
1515
|
+
case 'class':
|
|
1516
|
+
{
|
|
1517
|
+
this.headerConfigs.mergeClassByPriority(this.colStyles, defaults.header);
|
|
1518
|
+
this.groupHeaderConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1519
|
+
this.groupFooterConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1520
|
+
this.cellConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1521
|
+
this.footerConfigs.mergeClassByPriority(this.colStyles, defaults.footer);
|
|
1522
|
+
}
|
|
1523
|
+
break;
|
|
1524
|
+
case 'align':
|
|
1525
|
+
{
|
|
1526
|
+
this.headerConfigs.mergeAlignByPriority(this.colStyles, defaults.header);
|
|
1527
|
+
this.groupHeaderConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1528
|
+
this.groupFooterConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1529
|
+
this.cellConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1530
|
+
this.footerConfigs.mergeAlignByPriority(this.colStyles, defaults.footer);
|
|
1531
|
+
}
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
this.headerConfigs.updateClasesArray();
|
|
1536
|
+
this.groupHeaderConfigs.updateClasesArray();
|
|
1537
|
+
this.groupFooterConfigs.updateClasesArray();
|
|
1538
|
+
this.cellConfigs.updateClasesArray();
|
|
1539
|
+
this.footerConfigs.updateClasesArray();
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* Change sorting direction
|
|
1543
|
+
*/
|
|
1544
|
+
changeDirection() {
|
|
1545
|
+
this.sortingDirection = this.sortingDirection === SortingDirection.asc ? SortingDirection.desc : SortingDirection.asc;
|
|
1546
|
+
}
|
|
1547
|
+
updateVisibility(value) {
|
|
1548
|
+
this._attributes.visible = value;
|
|
1549
|
+
}
|
|
1550
|
+
updateCustomizable(value) {
|
|
1551
|
+
this._attributes.customizable = value;
|
|
1552
|
+
}
|
|
1553
|
+
_parseConfig(config) {
|
|
1554
|
+
this._attributes = config.attributes;
|
|
1555
|
+
this.headerTemplate = config.headerTemplate;
|
|
1556
|
+
this.groupHeaderTemplate = config.groupHeaderTemplate;
|
|
1557
|
+
this.groupFooterTemplate = config.groupFooterTemplate;
|
|
1558
|
+
this.cellTemplate = config.cellTemplate;
|
|
1559
|
+
this.footerTemplate = config.footerTemplate;
|
|
1560
|
+
this.headerConfigs = new StyleConfig(config.headerConfigs);
|
|
1561
|
+
this.groupHeaderConfigs = new StyleConfig(config.groupHeaderConfigs);
|
|
1562
|
+
this.groupFooterConfigs = new StyleConfig(config.groupFooterConfigs);
|
|
1563
|
+
this.cellConfigs = new StyleConfig(config.cellConfigs);
|
|
1564
|
+
this.footerConfigs = new StyleConfig(config.footerConfigs);
|
|
1565
|
+
this.expandTrigger = config.expandTrigger;
|
|
1566
|
+
this._defaultDirection = config.attributes.direction;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
class ColumnAsyncAttribute extends BehaviorSubject {
|
|
1571
|
+
constructor(value) {
|
|
1572
|
+
super(Object.freeze(value));
|
|
1573
|
+
}
|
|
1574
|
+
next(value) {
|
|
1575
|
+
const newValue = value;
|
|
1576
|
+
const oldValue = this.getValue();
|
|
1577
|
+
if (newValue !== oldValue) {
|
|
1578
|
+
super.next(Object.freeze(value));
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
class ColumnAttributes {
|
|
1584
|
+
_title;
|
|
1585
|
+
_name;
|
|
1586
|
+
_customizable = true;
|
|
1587
|
+
_sortable;
|
|
1588
|
+
_sortableDefault;
|
|
1589
|
+
_direction$ = new ColumnAsyncAttribute(null);
|
|
1590
|
+
_align;
|
|
1591
|
+
_width;
|
|
1592
|
+
_className;
|
|
1593
|
+
_visible$ = new ColumnAsyncAttribute(true);
|
|
1594
|
+
constructor(attrs = {}) {
|
|
1595
|
+
this._init(attrs);
|
|
1596
|
+
}
|
|
1597
|
+
// title
|
|
1598
|
+
set title(value) {
|
|
1599
|
+
this._title = value;
|
|
1600
|
+
}
|
|
1601
|
+
get title() {
|
|
1602
|
+
return this._title;
|
|
1603
|
+
}
|
|
1604
|
+
// name
|
|
1605
|
+
set name(value) {
|
|
1606
|
+
this._name = value;
|
|
1607
|
+
}
|
|
1608
|
+
get name() {
|
|
1609
|
+
return this._name;
|
|
1610
|
+
}
|
|
1611
|
+
// customize
|
|
1612
|
+
set customizable(value) {
|
|
1613
|
+
this._customizable = value;
|
|
1614
|
+
}
|
|
1615
|
+
get customizable() {
|
|
1616
|
+
return this._customizable;
|
|
1617
|
+
}
|
|
1618
|
+
// sortable
|
|
1619
|
+
set sortable(value) {
|
|
1620
|
+
this._sortable = value;
|
|
1621
|
+
}
|
|
1622
|
+
get sortable() {
|
|
1623
|
+
return this._sortable;
|
|
1624
|
+
}
|
|
1625
|
+
// sortableDefault
|
|
1626
|
+
set sortableDefault(value) {
|
|
1627
|
+
this._sortableDefault = value;
|
|
1628
|
+
if (this.sortableDefault) {
|
|
1629
|
+
this.sortable = true;
|
|
1630
|
+
}
|
|
1631
|
+
}
|
|
1632
|
+
get sortableDefault() {
|
|
1633
|
+
return this._sortableDefault;
|
|
1634
|
+
}
|
|
1635
|
+
// direction
|
|
1636
|
+
set direction(value) {
|
|
1637
|
+
this.sortable = true;
|
|
1638
|
+
this._direction$.next(value);
|
|
1639
|
+
}
|
|
1640
|
+
get direction() {
|
|
1641
|
+
return this._direction$.value;
|
|
1642
|
+
}
|
|
1643
|
+
get direction$() {
|
|
1644
|
+
return this._direction$.asObservable();
|
|
1645
|
+
}
|
|
1646
|
+
// align
|
|
1647
|
+
set align(value) {
|
|
1648
|
+
this._align = value;
|
|
1649
|
+
}
|
|
1650
|
+
get align() {
|
|
1651
|
+
return this._align;
|
|
1652
|
+
}
|
|
1653
|
+
// width
|
|
1654
|
+
set width(value) {
|
|
1655
|
+
this._width = value;
|
|
1656
|
+
}
|
|
1657
|
+
get width() {
|
|
1658
|
+
return this._width;
|
|
1659
|
+
}
|
|
1660
|
+
// className
|
|
1661
|
+
set className(value) {
|
|
1662
|
+
this._className = value;
|
|
1663
|
+
}
|
|
1664
|
+
get className() {
|
|
1665
|
+
return this._className;
|
|
1666
|
+
}
|
|
1667
|
+
// visibility
|
|
1668
|
+
set visible(value) {
|
|
1669
|
+
this._visible$.next(value);
|
|
1670
|
+
}
|
|
1671
|
+
get visible() {
|
|
1672
|
+
return this._visible$.getValue();
|
|
1673
|
+
}
|
|
1674
|
+
get visible$() {
|
|
1675
|
+
return this._visible$.asObservable();
|
|
1676
|
+
}
|
|
1677
|
+
_init(attrs) {
|
|
1678
|
+
Object.keys(attrs)
|
|
1679
|
+
.forEach((key) => {
|
|
1680
|
+
switch (key) {
|
|
1681
|
+
case 'title':
|
|
1682
|
+
{
|
|
1683
|
+
this.title = attrs[key];
|
|
1684
|
+
}
|
|
1685
|
+
break;
|
|
1686
|
+
case 'name':
|
|
1687
|
+
{
|
|
1688
|
+
this.name = attrs[key];
|
|
1689
|
+
}
|
|
1690
|
+
break;
|
|
1691
|
+
case 'align':
|
|
1692
|
+
{
|
|
1693
|
+
this.align = attrs[key];
|
|
1694
|
+
}
|
|
1695
|
+
break;
|
|
1696
|
+
case 'direction':
|
|
1697
|
+
{
|
|
1698
|
+
this.direction = attrs[key];
|
|
1537
1699
|
}
|
|
1538
1700
|
break;
|
|
1539
1701
|
case 'sortable':
|
|
1540
1702
|
{
|
|
1541
|
-
|
|
1542
|
-
if (this.sortable === undefined) {
|
|
1543
|
-
this.sortable = defaults.sortable;
|
|
1544
|
-
}
|
|
1545
|
-
}
|
|
1703
|
+
this.sortable = attrs[key];
|
|
1546
1704
|
}
|
|
1547
1705
|
break;
|
|
1548
|
-
case '
|
|
1706
|
+
case 'show':
|
|
1549
1707
|
{
|
|
1550
|
-
this.
|
|
1551
|
-
this.groupHeaderConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1552
|
-
this.groupFooterConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1553
|
-
this.cellConfigs.mergeClassByPriority(this.colStyles, defaults.cell);
|
|
1554
|
-
this.footerConfigs.mergeClassByPriority(this.colStyles, defaults.footer);
|
|
1708
|
+
this.visible = attrs[key];
|
|
1555
1709
|
}
|
|
1556
1710
|
break;
|
|
1557
|
-
case '
|
|
1711
|
+
case 'visible':
|
|
1558
1712
|
{
|
|
1559
|
-
this.
|
|
1560
|
-
this.groupHeaderConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1561
|
-
this.groupFooterConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1562
|
-
this.cellConfigs.mergeAlignByPriority(this.colStyles, defaults.cell);
|
|
1563
|
-
this.footerConfigs.mergeAlignByPriority(this.colStyles, defaults.footer);
|
|
1713
|
+
this.visible = attrs[key];
|
|
1564
1714
|
}
|
|
1565
1715
|
break;
|
|
1566
1716
|
}
|
|
1567
1717
|
});
|
|
1568
|
-
this.headerConfigs.updateClasesArray();
|
|
1569
|
-
this.groupHeaderConfigs.updateClasesArray();
|
|
1570
|
-
this.groupFooterConfigs.updateClasesArray();
|
|
1571
|
-
this.cellConfigs.updateClasesArray();
|
|
1572
|
-
this.footerConfigs.updateClasesArray();
|
|
1573
|
-
}
|
|
1574
|
-
/**
|
|
1575
|
-
* Change sorting direction
|
|
1576
|
-
*/
|
|
1577
|
-
changeDirection() {
|
|
1578
|
-
this.sortingDirection = this.sortingDirection === SortingDirection.asc ? SortingDirection.desc : SortingDirection.asc;
|
|
1579
|
-
}
|
|
1580
|
-
updateVisibility(value) {
|
|
1581
|
-
this._attributes.visible = value;
|
|
1582
|
-
}
|
|
1583
|
-
updateCustomizable(value) {
|
|
1584
|
-
this._attributes.customizable = value;
|
|
1585
|
-
}
|
|
1586
|
-
_parseConfig(config) {
|
|
1587
|
-
this._attributes = config.attributes;
|
|
1588
|
-
this.headerTemplate = config.headerTemplate;
|
|
1589
|
-
this.groupHeaderTemplate = config.groupHeaderTemplate;
|
|
1590
|
-
this.groupFooterTemplate = config.groupFooterTemplate;
|
|
1591
|
-
this.cellTemplate = config.cellTemplate;
|
|
1592
|
-
this.footerTemplate = config.footerTemplate;
|
|
1593
|
-
this.headerConfigs = new StyleConfig(config.headerConfigs);
|
|
1594
|
-
this.groupHeaderConfigs = new StyleConfig(config.groupHeaderConfigs);
|
|
1595
|
-
this.groupFooterConfigs = new StyleConfig(config.groupFooterConfigs);
|
|
1596
|
-
this.cellConfigs = new StyleConfig(config.cellConfigs);
|
|
1597
|
-
this.footerConfigs = new StyleConfig(config.footerConfigs);
|
|
1598
|
-
this.expandTrigger = config.expandTrigger;
|
|
1599
|
-
this._defaultDirection = config.attributes.direction;
|
|
1600
1718
|
}
|
|
1601
1719
|
}
|
|
1602
1720
|
|
|
1721
|
+
class ColumnsColumn {
|
|
1722
|
+
template;
|
|
1723
|
+
name;
|
|
1724
|
+
show;
|
|
1725
|
+
title;
|
|
1726
|
+
disabled;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1603
1729
|
class FsCellComponent {
|
|
1604
1730
|
isColl = true;
|
|
1605
1731
|
role = 'gridcell';
|
|
1606
1732
|
column;
|
|
1607
|
-
row; // tmp
|
|
1608
1733
|
rowIndex;
|
|
1734
|
+
row = input();
|
|
1609
1735
|
cellContext = {};
|
|
1610
1736
|
cellTemplate;
|
|
1611
1737
|
_destroy$ = new Subject();
|
|
1738
|
+
constructor() {
|
|
1739
|
+
effect(() => {
|
|
1740
|
+
const currentRow = this.row();
|
|
1741
|
+
if (currentRow) {
|
|
1742
|
+
this.cellContext.groupIndex = currentRow.index;
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1612
1746
|
ngOnInit() {
|
|
1613
1747
|
this._listenGroupOpen();
|
|
1614
1748
|
}
|
|
1615
|
-
ngDoCheck() {
|
|
1616
|
-
// TODO fixme remove or improve
|
|
1617
|
-
if (this.row) {
|
|
1618
|
-
this.cellContext.groupIndex = this.row.index;
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
1749
|
ngOnChanges(changes) {
|
|
1622
1750
|
if (changes.rowIndex?.currentValue !== changes.rowIndex?.previousValue) {
|
|
1623
1751
|
this.cellContext.index = this.rowIndex;
|
|
1624
|
-
this.cellContext.groupIndex = this.row.index;
|
|
1752
|
+
this.cellContext.groupIndex = this.row().index;
|
|
1625
1753
|
}
|
|
1626
1754
|
if (changes.column?.currentValue !== changes.column?.previousValue) {
|
|
1627
1755
|
this._initCellContext();
|
|
@@ -1633,41 +1761,45 @@ class FsCellComponent {
|
|
|
1633
1761
|
this._destroy$.complete();
|
|
1634
1762
|
}
|
|
1635
1763
|
_initCellContext() {
|
|
1764
|
+
const currentRow = this.row();
|
|
1636
1765
|
this.cellContext.index = this.rowIndex;
|
|
1637
|
-
if (
|
|
1638
|
-
if (
|
|
1639
|
-
this.cellContext.groupIndex =
|
|
1766
|
+
if (currentRow) {
|
|
1767
|
+
if (isGroupRow(currentRow)) {
|
|
1768
|
+
this.cellContext.groupIndex = currentRow.index;
|
|
1640
1769
|
}
|
|
1641
|
-
else if (
|
|
1642
|
-
this.cellContext.groupIndex =
|
|
1643
|
-
this.cellContext.groupRow =
|
|
1644
|
-
this.cellContext.group =
|
|
1770
|
+
else if (isChildTypeRow(currentRow)) {
|
|
1771
|
+
this.cellContext.groupIndex = currentRow.index;
|
|
1772
|
+
this.cellContext.groupRow = currentRow.parent.data;
|
|
1773
|
+
this.cellContext.group = currentRow.parent.data;
|
|
1645
1774
|
}
|
|
1646
|
-
if (
|
|
1647
|
-
this.cellContext.group =
|
|
1648
|
-
this.cellContext.groupChildren =
|
|
1775
|
+
if (isGroupRow(currentRow)) {
|
|
1776
|
+
this.cellContext.group = currentRow.data;
|
|
1777
|
+
this.cellContext.groupChildren = currentRow.children
|
|
1649
1778
|
.map((child) => child.data);
|
|
1650
1779
|
}
|
|
1651
|
-
else if (
|
|
1652
|
-
this.cellContext.group =
|
|
1653
|
-
this.cellContext.groupIndex =
|
|
1654
|
-
this.cellContext.groupChildren =
|
|
1780
|
+
else if (isGroupFooterRow(currentRow)) {
|
|
1781
|
+
this.cellContext.group = currentRow.parent.data;
|
|
1782
|
+
this.cellContext.groupIndex = currentRow.index;
|
|
1783
|
+
this.cellContext.groupChildren = currentRow.parent.children
|
|
1655
1784
|
.map((child) => child.data);
|
|
1656
1785
|
}
|
|
1657
1786
|
}
|
|
1658
1787
|
this.cellContext.column = this.column;
|
|
1659
|
-
if (
|
|
1660
|
-
this.cellContext.$implicit =
|
|
1661
|
-
this.cellContext.row =
|
|
1662
|
-
this.cellContext.value =
|
|
1663
|
-
|
|
1788
|
+
if (currentRow) {
|
|
1789
|
+
this.cellContext.$implicit = currentRow.data;
|
|
1790
|
+
this.cellContext.row = currentRow.data;
|
|
1791
|
+
this.cellContext.value = currentRow.data[this.column.name];
|
|
1792
|
+
if (isGroupRow(currentRow)) {
|
|
1793
|
+
this.cellContext.expanded = currentRow.expanded;
|
|
1794
|
+
}
|
|
1664
1795
|
}
|
|
1665
1796
|
}
|
|
1666
1797
|
_initCellTemplate() {
|
|
1667
|
-
|
|
1798
|
+
const currentRow = this.row();
|
|
1799
|
+
if (currentRow && isGroupRow(currentRow)) {
|
|
1668
1800
|
this.cellTemplate = this.column.groupHeaderTemplate || this.column.cellTemplate;
|
|
1669
1801
|
}
|
|
1670
|
-
else if (
|
|
1802
|
+
else if (currentRow && isGroupFooterRow(currentRow)) {
|
|
1671
1803
|
this.cellTemplate = this.column.groupFooterTemplate || this.column.cellTemplate;
|
|
1672
1804
|
}
|
|
1673
1805
|
else {
|
|
@@ -1675,8 +1807,9 @@ class FsCellComponent {
|
|
|
1675
1807
|
}
|
|
1676
1808
|
}
|
|
1677
1809
|
_listenGroupOpen() {
|
|
1678
|
-
|
|
1679
|
-
|
|
1810
|
+
const currentRow = this.row();
|
|
1811
|
+
if (currentRow && isGroupRow(currentRow)) {
|
|
1812
|
+
currentRow.expanded$
|
|
1680
1813
|
.pipe(takeUntil(this._destroy$))
|
|
1681
1814
|
.subscribe((status) => {
|
|
1682
1815
|
this.cellContext.expanded = status;
|
|
@@ -1684,12 +1817,12 @@ class FsCellComponent {
|
|
|
1684
1817
|
}
|
|
1685
1818
|
}
|
|
1686
1819
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1687
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1820
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.7", type: FsCellComponent, isStandalone: true, selector: "[fs-cell]", inputs: { column: { classPropertyName: "column", publicName: "column", isSignal: false, isRequired: false, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: false, isRequired: false, transformFunction: null }, row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.fs-list-col": "this.isColl", "attr.role": "this.role" } }, usesOnChanges: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #defaultCellTemplate let-value=\"value\">\n {{value}}\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1688
1821
|
}
|
|
1689
1822
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsCellComponent, decorators: [{
|
|
1690
1823
|
type: Component,
|
|
1691
|
-
args: [{ selector: '[fs-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\
|
|
1692
|
-
}], propDecorators: { isColl: [{
|
|
1824
|
+
args: [{ selector: '[fs-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"cellTemplate || defaultCellTemplate\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #defaultCellTemplate let-value=\"value\">\n {{value}}\n</ng-template>\n" }]
|
|
1825
|
+
}], ctorParameters: () => [], propDecorators: { isColl: [{
|
|
1693
1826
|
type: HostBinding,
|
|
1694
1827
|
args: ['class.fs-list-col']
|
|
1695
1828
|
}], role: [{
|
|
@@ -1697,8 +1830,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
1697
1830
|
args: ['attr.role']
|
|
1698
1831
|
}], column: [{
|
|
1699
1832
|
type: Input
|
|
1700
|
-
}], row: [{
|
|
1701
|
-
type: Input
|
|
1702
1833
|
}], rowIndex: [{
|
|
1703
1834
|
type: Input
|
|
1704
1835
|
}] } });
|
|
@@ -1936,7 +2067,7 @@ class FsRowComponent {
|
|
|
1936
2067
|
_renderer;
|
|
1937
2068
|
_draggableList;
|
|
1938
2069
|
role = 'row';
|
|
1939
|
-
row;
|
|
2070
|
+
row = input();
|
|
1940
2071
|
rowActionsRaw = [];
|
|
1941
2072
|
groupActionsRaw = [];
|
|
1942
2073
|
hasRowActions = false;
|
|
@@ -1952,7 +2083,6 @@ class FsRowComponent {
|
|
|
1952
2083
|
reorderPosition;
|
|
1953
2084
|
reorderStrategy;
|
|
1954
2085
|
reorderMultiple;
|
|
1955
|
-
cellRefs;
|
|
1956
2086
|
ReorderPosition = ReorderPosition;
|
|
1957
2087
|
ReorderStrategy = ReorderStrategy;
|
|
1958
2088
|
rowActions = [];
|
|
@@ -1972,15 +2102,6 @@ class FsRowComponent {
|
|
|
1972
2102
|
this._draggableList = _draggableList;
|
|
1973
2103
|
this._rowDiffer = _differs.find({}).create();
|
|
1974
2104
|
}
|
|
1975
|
-
get isGroupRow() {
|
|
1976
|
-
return this.row.isGroup;
|
|
1977
|
-
}
|
|
1978
|
-
get isGroupChildRow() {
|
|
1979
|
-
return this.row.isGroupChild;
|
|
1980
|
-
}
|
|
1981
|
-
get isGroupFooterRow() {
|
|
1982
|
-
return this.row.isGroupFooter;
|
|
1983
|
-
}
|
|
1984
2105
|
get isDragDisabled() {
|
|
1985
2106
|
return !this.selected && this.reorderMultiple && !!this.selection.selectedRows.size;
|
|
1986
2107
|
}
|
|
@@ -1988,7 +2109,10 @@ class FsRowComponent {
|
|
|
1988
2109
|
const multiple = this.reorderMultiple;
|
|
1989
2110
|
return multiple && this.selected;
|
|
1990
2111
|
}
|
|
1991
|
-
|
|
2112
|
+
rowCustomClass = computed(() => {
|
|
2113
|
+
if (!this.row()) {
|
|
2114
|
+
return;
|
|
2115
|
+
}
|
|
1992
2116
|
let classes = ['fs-list-row'];
|
|
1993
2117
|
if (this.rowIndex % 2 !== 0) {
|
|
1994
2118
|
classes.push('fs-list-row-odd');
|
|
@@ -1996,13 +2120,13 @@ class FsRowComponent {
|
|
|
1996
2120
|
if (this.rowIndex % 2 === 0) {
|
|
1997
2121
|
classes.push('fs-list-row-even');
|
|
1998
2122
|
}
|
|
1999
|
-
if (this.row
|
|
2123
|
+
if (isGroupRow(this.row())) {
|
|
2000
2124
|
classes.push('fs-list-row-group');
|
|
2001
2125
|
}
|
|
2002
|
-
else if (this.row
|
|
2126
|
+
else if (isChildRow(this.row())) {
|
|
2003
2127
|
classes.push('fs-list-row-group-child');
|
|
2004
2128
|
}
|
|
2005
|
-
else if (this.row
|
|
2129
|
+
else if (isGroupFooterRow(this.row())) {
|
|
2006
2130
|
classes.push('fs-list-row-group-footer');
|
|
2007
2131
|
}
|
|
2008
2132
|
else {
|
|
@@ -2018,10 +2142,7 @@ class FsRowComponent {
|
|
|
2018
2142
|
];
|
|
2019
2143
|
}
|
|
2020
2144
|
return classes.join(' ');
|
|
2021
|
-
}
|
|
2022
|
-
get dragCellVisible() {
|
|
2023
|
-
return !this.row.isGroup;
|
|
2024
|
-
}
|
|
2145
|
+
});
|
|
2025
2146
|
get leftDragDropEnabled() {
|
|
2026
2147
|
return this.reorderEnabled
|
|
2027
2148
|
&& this.reorderPosition === ReorderPosition.Left
|
|
@@ -2034,15 +2155,12 @@ class FsRowComponent {
|
|
|
2034
2155
|
}
|
|
2035
2156
|
ngOnInit() {
|
|
2036
2157
|
this._initRowEvents();
|
|
2037
|
-
this.
|
|
2038
|
-
if (this.row) {
|
|
2158
|
+
if (this.row()) {
|
|
2039
2159
|
this._initRowActionsUpdate();
|
|
2040
2160
|
}
|
|
2041
|
-
if (this.row && this.row.
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
this._filterActionsByCategories();
|
|
2045
|
-
}
|
|
2161
|
+
if (this.row() && isGroupRow(this.row()) && this.groupActionsRaw) {
|
|
2162
|
+
this.rowActions = this.groupActionsRaw.map((action) => new RowAction(action));
|
|
2163
|
+
this._filterActionsByCategories();
|
|
2046
2164
|
}
|
|
2047
2165
|
else if (this.rowActionsRaw) {
|
|
2048
2166
|
this.rowActions = this.rowActionsRaw.map((action) => new RowAction(action));
|
|
@@ -2054,11 +2172,23 @@ class FsRowComponent {
|
|
|
2054
2172
|
this.updateRowActions();
|
|
2055
2173
|
}
|
|
2056
2174
|
}
|
|
2175
|
+
ngAfterViewInit() {
|
|
2176
|
+
this._initSelection();
|
|
2177
|
+
}
|
|
2178
|
+
isGroupRow = computed(() => {
|
|
2179
|
+
return isGroupRow(this.row());
|
|
2180
|
+
});
|
|
2181
|
+
isGroupFooterRow = computed(() => {
|
|
2182
|
+
return isGroupFooterRow(this.row());
|
|
2183
|
+
});
|
|
2184
|
+
dragCellVisible = computed(() => {
|
|
2185
|
+
return !isGroupRow(this.row());
|
|
2186
|
+
});
|
|
2057
2187
|
updateRowActions() {
|
|
2058
2188
|
if (this.rowActions) {
|
|
2059
2189
|
this.rowActions.forEach((action) => {
|
|
2060
|
-
action.checkShowStatus(this.row.data, this.rowIndex);
|
|
2061
|
-
action.updateLink(this.row.data);
|
|
2190
|
+
action.checkShowStatus(this.row().data, this.rowIndex);
|
|
2191
|
+
action.updateLink(this.row().data);
|
|
2062
2192
|
});
|
|
2063
2193
|
this._filterActionsByCategories();
|
|
2064
2194
|
}
|
|
@@ -2077,7 +2207,7 @@ class FsRowComponent {
|
|
|
2077
2207
|
* @param event
|
|
2078
2208
|
*/
|
|
2079
2209
|
selectRow(event) {
|
|
2080
|
-
this.selection.rowSelectionChange(this.row, event.checked);
|
|
2210
|
+
this.selection.rowSelectionChange(this.row(), event.checked);
|
|
2081
2211
|
this._cdRef.markForCheck();
|
|
2082
2212
|
}
|
|
2083
2213
|
/**
|
|
@@ -2105,7 +2235,7 @@ class FsRowComponent {
|
|
|
2105
2235
|
.listen(this.el.nativeElement, event, (evt) => {
|
|
2106
2236
|
this.rowEvents[event]({
|
|
2107
2237
|
event: evt,
|
|
2108
|
-
row: this.row.data,
|
|
2238
|
+
row: this.row().data,
|
|
2109
2239
|
rowIndex: this.rowIndex,
|
|
2110
2240
|
});
|
|
2111
2241
|
});
|
|
@@ -2113,8 +2243,8 @@ class FsRowComponent {
|
|
|
2113
2243
|
});
|
|
2114
2244
|
}
|
|
2115
2245
|
_initRowActionsUpdate() {
|
|
2116
|
-
if (this.row.
|
|
2117
|
-
this.row.
|
|
2246
|
+
if (this.row().actionsUpdated$) {
|
|
2247
|
+
this.row().actionsUpdated$
|
|
2118
2248
|
.pipe(takeUntil(this._destroy$))
|
|
2119
2249
|
.subscribe(() => {
|
|
2120
2250
|
this.updateRowActions();
|
|
@@ -2123,17 +2253,18 @@ class FsRowComponent {
|
|
|
2123
2253
|
}
|
|
2124
2254
|
_getRowClasses(rowClass) {
|
|
2125
2255
|
const classes = [];
|
|
2256
|
+
const currentRow = this.row();
|
|
2126
2257
|
const options = {
|
|
2127
2258
|
index: this.rowIndex,
|
|
2128
|
-
type:
|
|
2259
|
+
type: currentRow.type,
|
|
2129
2260
|
};
|
|
2130
|
-
if (
|
|
2131
|
-
options.groupIndex =
|
|
2261
|
+
if (isGroupRow(currentRow)) {
|
|
2262
|
+
options.groupIndex = currentRow.index;
|
|
2132
2263
|
}
|
|
2133
|
-
else if (
|
|
2134
|
-
options.groupIndex =
|
|
2264
|
+
else if (isChildTypeRow(currentRow)) {
|
|
2265
|
+
options.groupIndex = currentRow.parent.index;
|
|
2135
2266
|
}
|
|
2136
|
-
const resultClass = rowClass(this.row.data, options);
|
|
2267
|
+
const resultClass = rowClass(this.row().data, options);
|
|
2137
2268
|
if (resultClass) {
|
|
2138
2269
|
if (typeof resultClass === 'string') {
|
|
2139
2270
|
classes.push(resultClass);
|
|
@@ -2153,8 +2284,8 @@ class FsRowComponent {
|
|
|
2153
2284
|
* Subscribe to selection change events
|
|
2154
2285
|
*/
|
|
2155
2286
|
_initSelection() {
|
|
2156
|
-
if (this.selection) {
|
|
2157
|
-
this.selected = this.
|
|
2287
|
+
if (this.selection && this.row()) {
|
|
2288
|
+
this.selected = this.selection.isRowSelected(this.row().data);
|
|
2158
2289
|
this.selection.selectionChange$
|
|
2159
2290
|
.pipe(
|
|
2160
2291
|
// // Would like to respond only when checkbox on top is changed
|
|
@@ -2165,9 +2296,10 @@ class FsRowComponent {
|
|
|
2165
2296
|
// }),
|
|
2166
2297
|
takeUntil(this._destroy$))
|
|
2167
2298
|
.subscribe(() => {
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2299
|
+
const currentRow = this.row();
|
|
2300
|
+
this.selected = currentRow && this.selection.isRowSelected(currentRow.data);
|
|
2301
|
+
if (isGroupRow(currentRow)) {
|
|
2302
|
+
const groupSelection = this.selection.isGroupSelected(currentRow);
|
|
2171
2303
|
if (groupSelection === 'indeterminate') {
|
|
2172
2304
|
this.selected = true;
|
|
2173
2305
|
this.indeterminateSelected = true;
|
|
@@ -2201,11 +2333,13 @@ class FsRowComponent {
|
|
|
2201
2333
|
});
|
|
2202
2334
|
}
|
|
2203
2335
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsRowComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }, { token: FsListDraggableListDirective }], target: i0.ɵɵFactoryTarget.Component });
|
|
2204
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2336
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.7", type: FsRowComponent, isStandalone: true, selector: "[fs-list-row]", inputs: { row: { classPropertyName: "row", publicName: "row", isSignal: true, isRequired: false, transformFunction: null }, rowActionsRaw: { classPropertyName: "rowActionsRaw", publicName: "rowActionsRaw", isSignal: false, isRequired: false, transformFunction: null }, groupActionsRaw: { classPropertyName: "groupActionsRaw", publicName: "groupActionsRaw", isSignal: false, isRequired: false, transformFunction: null }, hasRowActions: { classPropertyName: "hasRowActions", publicName: "hasRowActions", isSignal: false, isRequired: false, transformFunction: null }, rowEvents: { classPropertyName: "rowEvents", publicName: "rowEvents", isSignal: false, isRequired: false, transformFunction: null }, rowClass: { classPropertyName: "rowClass", publicName: "rowClass", isSignal: false, isRequired: false, transformFunction: null }, restoreMode: { classPropertyName: "restoreMode", publicName: "restoreMode", isSignal: false, isRequired: false, transformFunction: null }, rowIndex: { classPropertyName: "rowIndex", publicName: "rowIndex", isSignal: false, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: false, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: false, isRequired: false, transformFunction: null }, rowRemoved: { classPropertyName: "rowRemoved", publicName: "rowRemoved", isSignal: false, isRequired: false, transformFunction: null }, activeFiltersCount: { classPropertyName: "activeFiltersCount", publicName: "activeFiltersCount", isSignal: false, isRequired: false, transformFunction: null }, reorderEnabled: { classPropertyName: "reorderEnabled", publicName: "reorderEnabled", isSignal: false, isRequired: false, transformFunction: null }, reorderPosition: { classPropertyName: "reorderPosition", publicName: "reorderPosition", isSignal: false, isRequired: false, transformFunction: null }, reorderStrategy: { classPropertyName: "reorderStrategy", publicName: "reorderStrategy", isSignal: false, isRequired: false, transformFunction: null }, reorderMultiple: { classPropertyName: "reorderMultiple", publicName: "reorderMultiple", isSignal: false, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.rowCustomClass()", "attr.role": "this.role", "class.drag-row": "this.reorderEnabled", "class.multiple-selection": "this.isMultipleSelection" } }, ngImport: i0, template: "<!-- Drag -->\n<ng-container *ngIf=\"leftDragDropEnabled\">\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n</ng-container>\n<!-- Selection -->\n<ng-container *ngIf=\"selection && !(selection.disabled$ | async)\">\n <td class=\"fs-list-col fs-list-col-selection\">\n <ng-container *ngIf=\"!isGroupFooterRow()\">\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n </ng-container>\n </td>\n</ng-container>\n<!-- Content -->\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn; let isFirst = first\">\n <td\n fs-cell\n *ngIf=\"(isGroupRow() && !column.groupHeaderColspanned)\n || (isGroupFooterRow() && !column.groupFooterColspanned)\n || (!isGroupRow() && !isGroupFooterRow() && !column.cellColspanned)\"\n [column]=\"column\"\n [row]=\"row()\"\n [rowIndex]=\"rowIndex\"\n [class]=\"(isGroupRow() && column.groupHeaderConfigs.classesString)\n || (isGroupFooterRow() && column.groupFooterConfigs.classesString)\n || (!isGroupFooterRow() && column.cellConfigs.classesString)\"\n [ngClass]=\"{ 'primary-col': isFirst }\"\n [attr.colspan]=\"(isGroupRow() && column.groupHeaderConfigs.colspan)\n || (isGroupFooterRow() && column.groupFooterConfigs.colspan)\n || column.cellConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<ng-container *ngIf=\"rightDragDropEnabled\">\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n</ng-container>\n<!-- Row Actions -->\n<td\n *ngIf=\"hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategy.Manual)\"\n class=\"fs-list-col actions-col\">\n <ng-container *ngIf=\"!isGroupFooterRow()\">\n <fs-list-row-actions\n [row]=\"row()\"\n [index]=\"rowIndex\"\n [rowActions]=\"rowActions\"\n [menuRowActions]=\"menuRowActions\"\n [inlineRowActions]=\"inlineRowActions\"\n [restoreAction]=\"restoreAction\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\">\n </fs-list-row-actions>\n </ng-container>\n</td>\n<ng-template #dragCell>\n <ng-container *ngIf=\"dragCellVisible() && !isGroupFooterRow(); else emptyCell\">\n <td\n class=\"fs-list-col drag-col\"\n [class.drag-disabled]=\"isDragDisabled\"\n (mousedown)=\"dragStart($event)\"\n (touchstart)=\"dragStart($event)\">\n <mat-icon>\n drag_handle\n </mat-icon>\n </td>\n </ng-container>\n <ng-template #emptyCell>\n <td class=\"fs-list-col drag-col\"></td>\n </ng-template>\n</ng-template>\n", styles: [":host.drag-hidden{display:none}:host.draggable{opacity:.8;position:fixed;z-index:9999;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:5px}:host.draggable td{border:none;background-color:#fff}:host.draggable-elem td{background-color:#c3c3c3}:host.fs-list-row-clickable{cursor:pointer}td.drag-col{width:1%!important;white-space:nowrap;text-align:center;cursor:grab}td.drag-col.drag-disabled{opacity:.4;cursor:no-drop}td.drag-col mat-icon{display:flex}td.fs-list-col-selection{padding:10px;width:1%!important}td.actions-col{width:1%;white-space:nowrap;overflow:hidden}td.actions-col .row-inline-action{margin-left:12px;display:inline-block}td.actions-col .row-inline-action:first-child{margin-left:0}td.actions-col .row-inline-action-icon,td.actions-col .row-inline-action-fab,td.actions-col .row-inline-action-mini-fab,td.actions-col .row-menu-action{width:35px;justify-content:center;align-items:center}td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FsCellComponent, selector: "[fs-cell]", inputs: ["column", "rowIndex", "row"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: FsRowActionsComponent, selector: "fs-list-row-actions", inputs: ["row", "index", "restoreMode", "rowActions", "rowRemoved", "menuRowActions", "inlineRowActions", "restoreAction"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2205
2337
|
}
|
|
2206
2338
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsRowComponent, decorators: [{
|
|
2207
2339
|
type: Component,
|
|
2208
|
-
args: [{ selector: '[fs-list-row]', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2340
|
+
args: [{ selector: '[fs-list-row]', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
2341
|
+
'[class]': "this.rowCustomClass()",
|
|
2342
|
+
}, standalone: true, imports: [
|
|
2209
2343
|
NgIf,
|
|
2210
2344
|
NgTemplateOutlet,
|
|
2211
2345
|
MatCheckbox,
|
|
@@ -2215,12 +2349,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2215
2349
|
FsRowActionsComponent,
|
|
2216
2350
|
MatIcon,
|
|
2217
2351
|
AsyncPipe,
|
|
2218
|
-
], template: "<!-- Drag -->\n<ng-container *ngIf=\"leftDragDropEnabled\">\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n</ng-container>\n<!-- Selection -->\n<ng-container *ngIf=\"selection && !(selection.disabled$ | async)\">\n <td class=\"fs-list-col fs-list-col-selection\">\n <ng-container *ngIf=\"!
|
|
2352
|
+
], template: "<!-- Drag -->\n<ng-container *ngIf=\"leftDragDropEnabled\">\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n</ng-container>\n<!-- Selection -->\n<ng-container *ngIf=\"selection && !(selection.disabled$ | async)\">\n <td class=\"fs-list-col fs-list-col-selection\">\n <ng-container *ngIf=\"!isGroupFooterRow()\">\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n </ng-container>\n </td>\n</ng-container>\n<!-- Content -->\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn; let isFirst = first\">\n <td\n fs-cell\n *ngIf=\"(isGroupRow() && !column.groupHeaderColspanned)\n || (isGroupFooterRow() && !column.groupFooterColspanned)\n || (!isGroupRow() && !isGroupFooterRow() && !column.cellColspanned)\"\n [column]=\"column\"\n [row]=\"row()\"\n [rowIndex]=\"rowIndex\"\n [class]=\"(isGroupRow() && column.groupHeaderConfigs.classesString)\n || (isGroupFooterRow() && column.groupFooterConfigs.classesString)\n || (!isGroupFooterRow() && column.cellConfigs.classesString)\"\n [ngClass]=\"{ 'primary-col': isFirst }\"\n [attr.colspan]=\"(isGroupRow() && column.groupHeaderConfigs.colspan)\n || (isGroupFooterRow() && column.groupFooterConfigs.colspan)\n || column.cellConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<ng-container *ngIf=\"rightDragDropEnabled\">\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n</ng-container>\n<!-- Row Actions -->\n<td\n *ngIf=\"hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategy.Manual)\"\n class=\"fs-list-col actions-col\">\n <ng-container *ngIf=\"!isGroupFooterRow()\">\n <fs-list-row-actions\n [row]=\"row()\"\n [index]=\"rowIndex\"\n [rowActions]=\"rowActions\"\n [menuRowActions]=\"menuRowActions\"\n [inlineRowActions]=\"inlineRowActions\"\n [restoreAction]=\"restoreAction\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\">\n </fs-list-row-actions>\n </ng-container>\n</td>\n<ng-template #dragCell>\n <ng-container *ngIf=\"dragCellVisible() && !isGroupFooterRow(); else emptyCell\">\n <td\n class=\"fs-list-col drag-col\"\n [class.drag-disabled]=\"isDragDisabled\"\n (mousedown)=\"dragStart($event)\"\n (touchstart)=\"dragStart($event)\">\n <mat-icon>\n drag_handle\n </mat-icon>\n </td>\n </ng-container>\n <ng-template #emptyCell>\n <td class=\"fs-list-col drag-col\"></td>\n </ng-template>\n</ng-template>\n", styles: [":host.drag-hidden{display:none}:host.draggable{opacity:.8;position:fixed;z-index:9999;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:5px}:host.draggable td{border:none;background-color:#fff}:host.draggable-elem td{background-color:#c3c3c3}:host.fs-list-row-clickable{cursor:pointer}td.drag-col{width:1%!important;white-space:nowrap;text-align:center;cursor:grab}td.drag-col.drag-disabled{opacity:.4;cursor:no-drop}td.drag-col mat-icon{display:flex}td.fs-list-col-selection{padding:10px;width:1%!important}td.actions-col{width:1%;white-space:nowrap;overflow:hidden}td.actions-col .row-inline-action{margin-left:12px;display:inline-block}td.actions-col .row-inline-action:first-child{margin-left:0}td.actions-col .row-inline-action-icon,td.actions-col .row-inline-action-fab,td.actions-col .row-inline-action-mini-fab,td.actions-col .row-menu-action{width:35px;justify-content:center;align-items:center}td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"] }]
|
|
2219
2353
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.KeyValueDiffers }, { type: i0.Renderer2 }, { type: FsListDraggableListDirective }], propDecorators: { role: [{
|
|
2220
2354
|
type: HostBinding,
|
|
2221
2355
|
args: ['attr.role']
|
|
2222
|
-
}], row: [{
|
|
2223
|
-
type: Input
|
|
2224
2356
|
}], rowActionsRaw: [{
|
|
2225
2357
|
type: Input
|
|
2226
2358
|
}], groupActionsRaw: [{
|
|
@@ -2254,15 +2386,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2254
2386
|
type: Input
|
|
2255
2387
|
}], reorderMultiple: [{
|
|
2256
2388
|
type: Input
|
|
2257
|
-
}], cellRefs: [{
|
|
2258
|
-
type: ViewChildren,
|
|
2259
|
-
args: ['td']
|
|
2260
2389
|
}], isMultipleSelection: [{
|
|
2261
2390
|
type: HostBinding,
|
|
2262
2391
|
args: ['class.multiple-selection']
|
|
2263
|
-
}], rowCssClass: [{
|
|
2264
|
-
type: HostBinding,
|
|
2265
|
-
args: ['class']
|
|
2266
2392
|
}] } });
|
|
2267
2393
|
|
|
2268
2394
|
class FsListDraggableRowDirective {
|
|
@@ -2315,8 +2441,8 @@ class FsListDraggableRowDirective {
|
|
|
2315
2441
|
this.row.readyToSwap = this._reorderController.moveDropCallback({
|
|
2316
2442
|
row1: currentEl?.data,
|
|
2317
2443
|
row2: targetEl?.data,
|
|
2318
|
-
group1: currentEl
|
|
2319
|
-
group2: targetEl
|
|
2444
|
+
group1: isChildTypeRow(currentEl) ? currentEl.parent?.data : null,
|
|
2445
|
+
group2: isChildTypeRow(targetEl) ? targetEl.parent?.data : null,
|
|
2320
2446
|
});
|
|
2321
2447
|
if (!this.row.readyToSwap) {
|
|
2322
2448
|
this._renderer.addClass(this._el.nativeElement, 'fs-list-swap-restricted');
|
|
@@ -2569,11 +2695,11 @@ class FsFooterCellComponent extends FsCellComponent {
|
|
|
2569
2695
|
super();
|
|
2570
2696
|
}
|
|
2571
2697
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2572
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterCellComponent, isStandalone: true, selector: "[fs-list-footer-cell]", usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\
|
|
2698
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterCellComponent, isStandalone: true, selector: "[fs-list-footer-cell]", usesInheritance: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #cell let-value=\"value\">\n {{value}}\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2573
2699
|
}
|
|
2574
2700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterCellComponent, decorators: [{
|
|
2575
2701
|
type: Component,
|
|
2576
|
-
args: [{ selector: '[fs-list-footer-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\
|
|
2702
|
+
args: [{ selector: '[fs-list-footer-cell]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgTemplateOutlet], template: "<ng-template [ngTemplateOutlet]=\"column.footerTemplate || cell\" [ngTemplateOutletContext]=\"cellContext\"></ng-template>\n\n<ng-template #cell let-value=\"value\">\n {{value}}\n</ng-template>\n" }]
|
|
2577
2703
|
}], ctorParameters: () => [] });
|
|
2578
2704
|
|
|
2579
2705
|
class FsFooterRowComponent extends FsRowComponent {
|
|
@@ -2581,7 +2707,7 @@ class FsFooterRowComponent extends FsRowComponent {
|
|
|
2581
2707
|
super(el, cdRef, differs, renderer, null);
|
|
2582
2708
|
}
|
|
2583
2709
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterRowComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.KeyValueDiffers }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
2584
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterRowComponent, isStandalone: true, selector: "[fs-list-footer-row]", usesInheritance: true, ngImport: i0, template: "<td\n *ngIf=\"leftDragDropEnabled\"\n class=\"fs-list-col drag-col\">\n</td>\n<td\n *ngIf=\"selection\"\n class=\"fs-list-col fs-list-col-selection\">\n</td>\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn\">\n <td\n *ngIf=\"!column.footerColspanned\"\n fs-list-footer-cell\n [column]=\"column\"\n [row]=\"row\"\n [rowIndex]=\"rowIndex\"\n [ngClass]=\"column.footerConfigs.classesArray\"\n [attr.colspan]=\"column.footerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<td\n *ngIf=\"rightDragDropEnabled\"\n class=\"fs-list-col actions-col\">\n</td>\n<!-- Row Actions
|
|
2710
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsFooterRowComponent, isStandalone: true, selector: "[fs-list-footer-row]", usesInheritance: true, ngImport: i0, template: "<td\n *ngIf=\"leftDragDropEnabled\"\n class=\"fs-list-col drag-col\">\n</td>\n<td\n *ngIf=\"selection\"\n class=\"fs-list-col fs-list-col-selection\">\n</td>\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn\">\n <td\n *ngIf=\"!column.footerColspanned\"\n fs-list-footer-cell\n [column]=\"column\"\n [row]=\"row()\"\n [rowIndex]=\"rowIndex\"\n [ngClass]=\"column.footerConfigs.classesArray\"\n [attr.colspan]=\"column.footerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<td\n *ngIf=\"rightDragDropEnabled\"\n class=\"fs-list-col actions-col\">\n</td>\n<!-- Row Actions -->\n", styles: ["td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"], dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: FsFooterCellComponent, selector: "[fs-list-footer-cell]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2585
2711
|
}
|
|
2586
2712
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterRowComponent, decorators: [{
|
|
2587
2713
|
type: Component,
|
|
@@ -2590,7 +2716,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2590
2716
|
NgFor,
|
|
2591
2717
|
FsFooterCellComponent,
|
|
2592
2718
|
NgClass,
|
|
2593
|
-
], template: "<td\n *ngIf=\"leftDragDropEnabled\"\n class=\"fs-list-col drag-col\">\n</td>\n<td\n *ngIf=\"selection\"\n class=\"fs-list-col fs-list-col-selection\">\n</td>\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn\">\n <td\n *ngIf=\"!column.footerColspanned\"\n fs-list-footer-cell\n [column]=\"column\"\n [row]=\"row\"\n [rowIndex]=\"rowIndex\"\n [ngClass]=\"column.footerConfigs.classesArray\"\n [attr.colspan]=\"column.footerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<td\n *ngIf=\"rightDragDropEnabled\"\n class=\"fs-list-col actions-col\">\n</td>\n<!-- Row Actions
|
|
2719
|
+
], template: "<td\n *ngIf=\"leftDragDropEnabled\"\n class=\"fs-list-col drag-col\">\n</td>\n<td\n *ngIf=\"selection\"\n class=\"fs-list-col fs-list-col-selection\">\n</td>\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn\">\n <td\n *ngIf=\"!column.footerColspanned\"\n fs-list-footer-cell\n [column]=\"column\"\n [row]=\"row()\"\n [rowIndex]=\"rowIndex\"\n [ngClass]=\"column.footerConfigs.classesArray\"\n [attr.colspan]=\"column.footerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </td>\n</ng-container>\n<!-- Drag -->\n<td\n *ngIf=\"rightDragDropEnabled\"\n class=\"fs-list-col actions-col\">\n</td>\n<!-- Row Actions -->\n", styles: ["td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"] }]
|
|
2594
2720
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.KeyValueDiffers }, { type: i0.Renderer2 }] });
|
|
2595
2721
|
|
|
2596
2722
|
class FsFooterComponent {
|
|
@@ -2657,157 +2783,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2657
2783
|
], template: "<div class=\"wrap\">\n <span class=\"title\">\n <ng-template [ngIf]=\"!column.headerTemplate\">\n {{ column.title }}\n </ng-template>\n <ng-template\n [ngIf]=\"column.headerTemplate\"\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n </span>\n <div\n class=\"direction\"\n *ngIf=\"column.ordered\"\n [ngSwitch]=\"column.sortingDirection$ | async\">\n <mat-icon *ngSwitchCase=\"'asc'\">\n arrow_downward\n </mat-icon>\n <mat-icon *ngSwitchCase=\"'desc'\">\n arrow_upward\n </mat-icon>\n </div>\n</div>", styles: [".wrap{display:inline-flex;align-items:center}.wrap mat-icon{font-size:14px;display:block;height:14px;width:14px}.wrap .direction{margin-left:5px}\n"] }]
|
|
2658
2784
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.KeyValueDiffers }] });
|
|
2659
2785
|
|
|
2660
|
-
class ColumnAsyncAttribute extends BehaviorSubject {
|
|
2661
|
-
constructor(value) {
|
|
2662
|
-
super(Object.freeze(value));
|
|
2663
|
-
}
|
|
2664
|
-
next(value) {
|
|
2665
|
-
const newValue = value;
|
|
2666
|
-
const oldValue = this.getValue();
|
|
2667
|
-
if (newValue !== oldValue) {
|
|
2668
|
-
super.next(Object.freeze(value));
|
|
2669
|
-
}
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
class ColumnAttributes {
|
|
2674
|
-
_title;
|
|
2675
|
-
_name;
|
|
2676
|
-
_customizable = true;
|
|
2677
|
-
_sortable;
|
|
2678
|
-
_sortableDefault;
|
|
2679
|
-
_direction$ = new ColumnAsyncAttribute(null);
|
|
2680
|
-
_align;
|
|
2681
|
-
_width;
|
|
2682
|
-
_className;
|
|
2683
|
-
_visible$ = new ColumnAsyncAttribute(true);
|
|
2684
|
-
constructor(attrs = {}) {
|
|
2685
|
-
this._init(attrs);
|
|
2686
|
-
}
|
|
2687
|
-
// title
|
|
2688
|
-
set title(value) {
|
|
2689
|
-
this._title = value;
|
|
2690
|
-
}
|
|
2691
|
-
get title() {
|
|
2692
|
-
return this._title;
|
|
2693
|
-
}
|
|
2694
|
-
// name
|
|
2695
|
-
set name(value) {
|
|
2696
|
-
this._name = value;
|
|
2697
|
-
}
|
|
2698
|
-
get name() {
|
|
2699
|
-
return this._name;
|
|
2700
|
-
}
|
|
2701
|
-
// customize
|
|
2702
|
-
set customizable(value) {
|
|
2703
|
-
this._customizable = value;
|
|
2704
|
-
}
|
|
2705
|
-
get customizable() {
|
|
2706
|
-
return this._customizable;
|
|
2707
|
-
}
|
|
2708
|
-
// sortable
|
|
2709
|
-
set sortable(value) {
|
|
2710
|
-
this._sortable = value;
|
|
2711
|
-
}
|
|
2712
|
-
get sortable() {
|
|
2713
|
-
return this._sortable;
|
|
2714
|
-
}
|
|
2715
|
-
// sortableDefault
|
|
2716
|
-
set sortableDefault(value) {
|
|
2717
|
-
this._sortableDefault = value;
|
|
2718
|
-
if (this.sortableDefault) {
|
|
2719
|
-
this.sortable = true;
|
|
2720
|
-
}
|
|
2721
|
-
}
|
|
2722
|
-
get sortableDefault() {
|
|
2723
|
-
return this._sortableDefault;
|
|
2724
|
-
}
|
|
2725
|
-
// direction
|
|
2726
|
-
set direction(value) {
|
|
2727
|
-
this.sortable = true;
|
|
2728
|
-
this._direction$.next(value);
|
|
2729
|
-
}
|
|
2730
|
-
get direction() {
|
|
2731
|
-
return this._direction$.value;
|
|
2732
|
-
}
|
|
2733
|
-
get direction$() {
|
|
2734
|
-
return this._direction$.asObservable();
|
|
2735
|
-
}
|
|
2736
|
-
// align
|
|
2737
|
-
set align(value) {
|
|
2738
|
-
this._align = value;
|
|
2739
|
-
}
|
|
2740
|
-
get align() {
|
|
2741
|
-
return this._align;
|
|
2742
|
-
}
|
|
2743
|
-
// width
|
|
2744
|
-
set width(value) {
|
|
2745
|
-
this._width = value;
|
|
2746
|
-
}
|
|
2747
|
-
get width() {
|
|
2748
|
-
return this._width;
|
|
2749
|
-
}
|
|
2750
|
-
// className
|
|
2751
|
-
set className(value) {
|
|
2752
|
-
this._className = value;
|
|
2753
|
-
}
|
|
2754
|
-
get className() {
|
|
2755
|
-
return this._className;
|
|
2756
|
-
}
|
|
2757
|
-
// visibility
|
|
2758
|
-
set visible(value) {
|
|
2759
|
-
this._visible$.next(value);
|
|
2760
|
-
}
|
|
2761
|
-
get visible() {
|
|
2762
|
-
return this._visible$.getValue();
|
|
2763
|
-
}
|
|
2764
|
-
get visible$() {
|
|
2765
|
-
return this._visible$.asObservable();
|
|
2766
|
-
}
|
|
2767
|
-
_init(attrs) {
|
|
2768
|
-
Object.keys(attrs)
|
|
2769
|
-
.forEach((key) => {
|
|
2770
|
-
switch (key) {
|
|
2771
|
-
case 'title':
|
|
2772
|
-
{
|
|
2773
|
-
this.title = attrs[key];
|
|
2774
|
-
}
|
|
2775
|
-
break;
|
|
2776
|
-
case 'name':
|
|
2777
|
-
{
|
|
2778
|
-
this.name = attrs[key];
|
|
2779
|
-
}
|
|
2780
|
-
break;
|
|
2781
|
-
case 'align':
|
|
2782
|
-
{
|
|
2783
|
-
this.align = attrs[key];
|
|
2784
|
-
}
|
|
2785
|
-
break;
|
|
2786
|
-
case 'direction':
|
|
2787
|
-
{
|
|
2788
|
-
this.direction = attrs[key];
|
|
2789
|
-
}
|
|
2790
|
-
break;
|
|
2791
|
-
case 'sortable':
|
|
2792
|
-
{
|
|
2793
|
-
this.sortable = attrs[key];
|
|
2794
|
-
}
|
|
2795
|
-
break;
|
|
2796
|
-
case 'show':
|
|
2797
|
-
{
|
|
2798
|
-
this.visible = attrs[key];
|
|
2799
|
-
}
|
|
2800
|
-
break;
|
|
2801
|
-
case 'visible':
|
|
2802
|
-
{
|
|
2803
|
-
this.visible = attrs[key];
|
|
2804
|
-
}
|
|
2805
|
-
break;
|
|
2806
|
-
}
|
|
2807
|
-
});
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
|
|
2811
2786
|
class SortingController {
|
|
2812
2787
|
config;
|
|
2813
2788
|
sortingColumns = [];
|
|
@@ -3058,9 +3033,10 @@ class FsHeadComponent {
|
|
|
3058
3033
|
* Track By for improve change detection
|
|
3059
3034
|
*
|
|
3060
3035
|
* @param index
|
|
3036
|
+
* @param column
|
|
3061
3037
|
*/
|
|
3062
|
-
trackByFn(index) {
|
|
3063
|
-
return index;
|
|
3038
|
+
trackByFn(index, column) {
|
|
3039
|
+
return column.name || column.title || index;
|
|
3064
3040
|
}
|
|
3065
3041
|
/**
|
|
3066
3042
|
* Subscribe to sorting change
|
|
@@ -3389,7 +3365,7 @@ class DataController {
|
|
|
3389
3365
|
}
|
|
3390
3366
|
get reorderData() {
|
|
3391
3367
|
return this._rowsStack
|
|
3392
|
-
.map((row) => row.
|
|
3368
|
+
.map((row) => row.reorderData());
|
|
3393
3369
|
}
|
|
3394
3370
|
setGroupConfig(group) {
|
|
3395
3371
|
if (group) {
|
|
@@ -3443,12 +3419,12 @@ class DataController {
|
|
|
3443
3419
|
const rowIndex = this._rowsStack.findIndex((listRow) => {
|
|
3444
3420
|
return trackBy(listRow.data, targetRow);
|
|
3445
3421
|
});
|
|
3446
|
-
if (rowIndex
|
|
3447
|
-
|
|
3448
|
-
this._updateVisibleRows();
|
|
3449
|
-
return true;
|
|
3422
|
+
if (rowIndex === -1) {
|
|
3423
|
+
return false;
|
|
3450
3424
|
}
|
|
3451
|
-
|
|
3425
|
+
this._rowsStack[rowIndex] = makeRowFactory(targetRow, RowType.Simple);
|
|
3426
|
+
this._updateVisibleRows();
|
|
3427
|
+
return true;
|
|
3452
3428
|
}
|
|
3453
3429
|
/**
|
|
3454
3430
|
* Update data for specified row
|
|
@@ -3532,7 +3508,7 @@ class DataController {
|
|
|
3532
3508
|
}
|
|
3533
3509
|
toggleRowGroup(rowData) {
|
|
3534
3510
|
const row = this.visibleRows.find((visibleRow) => visibleRow.data === rowData);
|
|
3535
|
-
row
|
|
3511
|
+
row?.toggleRowExpandStatus();
|
|
3536
3512
|
this._updateVisibleRows();
|
|
3537
3513
|
}
|
|
3538
3514
|
finishReorder() {
|
|
@@ -3541,7 +3517,7 @@ class DataController {
|
|
|
3541
3517
|
let group;
|
|
3542
3518
|
this._rowsStack
|
|
3543
3519
|
.forEach((row, index) => {
|
|
3544
|
-
if (row
|
|
3520
|
+
if (isGroupRow(row) && row !== group) {
|
|
3545
3521
|
group = row;
|
|
3546
3522
|
}
|
|
3547
3523
|
else {
|
|
@@ -3559,7 +3535,7 @@ class DataController {
|
|
|
3559
3535
|
}
|
|
3560
3536
|
else {
|
|
3561
3537
|
rows = rows.map((row) => {
|
|
3562
|
-
return
|
|
3538
|
+
return makeRowFactory(row, RowType.Simple);
|
|
3563
3539
|
});
|
|
3564
3540
|
this._rowsStack = [...rows];
|
|
3565
3541
|
}
|
|
@@ -3570,7 +3546,7 @@ class DataController {
|
|
|
3570
3546
|
}
|
|
3571
3547
|
else {
|
|
3572
3548
|
rows = rows.map((row) => {
|
|
3573
|
-
return
|
|
3549
|
+
return makeRowFactory(row, RowType.Simple);
|
|
3574
3550
|
});
|
|
3575
3551
|
this._rowsStack = [...this._rowsStack, ...rows];
|
|
3576
3552
|
}
|
|
@@ -3581,7 +3557,7 @@ class DataController {
|
|
|
3581
3557
|
_updateVisibleRows() {
|
|
3582
3558
|
this.visibleRows = this._rowsStack
|
|
3583
3559
|
.filter((row) => {
|
|
3584
|
-
return (
|
|
3560
|
+
return !isChildTypeRow(row) || row.visible;
|
|
3585
3561
|
});
|
|
3586
3562
|
}
|
|
3587
3563
|
_updateRow(targetRow, trackBy) {
|
|
@@ -3594,7 +3570,7 @@ class DataController {
|
|
|
3594
3570
|
if (targetIndex !== -1) {
|
|
3595
3571
|
const updateTarget = this._rowsStack[targetIndex];
|
|
3596
3572
|
const updatedData = { ...updateTarget.data, ...targetRow };
|
|
3597
|
-
this._rowsStack[targetIndex] =
|
|
3573
|
+
this._rowsStack[targetIndex] = makeRowFactory(updatedData, updateTarget.type, {
|
|
3598
3574
|
parent: updateTarget.parent,
|
|
3599
3575
|
initialExpand: updateTarget.expanded,
|
|
3600
3576
|
});
|
|
@@ -3627,21 +3603,17 @@ class DataController {
|
|
|
3627
3603
|
}
|
|
3628
3604
|
const groupRows = [];
|
|
3629
3605
|
rows.forEach((row) => {
|
|
3630
|
-
const
|
|
3631
|
-
const
|
|
3632
|
-
|
|
3633
|
-
|
|
3606
|
+
const groupData = this._groupByFn(row);
|
|
3607
|
+
const groupKey = this._compareByFn(groupData);
|
|
3608
|
+
let group = this._store.get(groupKey);
|
|
3609
|
+
if (!group) {
|
|
3610
|
+
group = makeRowFactory(groupData, RowType.Group, { initialExpand: this._initialExpand });
|
|
3634
3611
|
group.index = groupRows.length;
|
|
3635
3612
|
groupRows.push(group);
|
|
3636
|
-
|
|
3637
|
-
this._store.set(mainGroupKey, group);
|
|
3638
|
-
group.children.push(childRow);
|
|
3639
|
-
}
|
|
3640
|
-
else {
|
|
3641
|
-
const group = this._store.get(mainGroupKey);
|
|
3642
|
-
const childRow = new ChildRow(row, group);
|
|
3643
|
-
group.children.push(childRow);
|
|
3613
|
+
this._store.set(groupKey, group);
|
|
3644
3614
|
}
|
|
3615
|
+
const childRow = makeRowFactory(row, RowType.GroupChild, { parent: group });
|
|
3616
|
+
group.children.push(childRow);
|
|
3645
3617
|
});
|
|
3646
3618
|
groupRows.forEach((groupRow) => {
|
|
3647
3619
|
const footerIndex = groupRow.children
|
|
@@ -3653,12 +3625,13 @@ class DataController {
|
|
|
3653
3625
|
});
|
|
3654
3626
|
if (footerIndex !== -1) {
|
|
3655
3627
|
const footerRow = groupRow.children.splice(footerIndex, footerIndex + 1)[0];
|
|
3656
|
-
|
|
3628
|
+
const newRow = makeRowFactory(footerRow.data, RowType.GroupFooter, { parent: groupRow });
|
|
3629
|
+
groupRow.children.push(newRow);
|
|
3657
3630
|
}
|
|
3658
3631
|
});
|
|
3659
3632
|
return Array.from(this._store.values())
|
|
3660
3633
|
.reduce((acc, item) => {
|
|
3661
|
-
if (item
|
|
3634
|
+
if (isGroupRow(item)) {
|
|
3662
3635
|
acc.push(item, ...item.children);
|
|
3663
3636
|
}
|
|
3664
3637
|
else {
|
|
@@ -3852,7 +3825,7 @@ class ActionsController {
|
|
|
3852
3825
|
action.click = () => {
|
|
3853
3826
|
this._filterRef.updateActions([this._doneAction]);
|
|
3854
3827
|
this._filterRef.hideKeywordField();
|
|
3855
|
-
this._filterRef.
|
|
3828
|
+
this._filterRef.hideFilters();
|
|
3856
3829
|
actionClickFn(null);
|
|
3857
3830
|
};
|
|
3858
3831
|
this._reorderAction = action;
|
|
@@ -3863,7 +3836,7 @@ class ActionsController {
|
|
|
3863
3836
|
this._doneAction.click = () => {
|
|
3864
3837
|
this._filterRef.updateActions(this._actions);
|
|
3865
3838
|
this._filterRef.showKeywordField();
|
|
3866
|
-
this._filterRef.
|
|
3839
|
+
this._filterRef.showFilters();
|
|
3867
3840
|
actionClickFn(null);
|
|
3868
3841
|
};
|
|
3869
3842
|
}
|
|
@@ -4945,7 +4918,6 @@ class List {
|
|
|
4945
4918
|
if (this.filterConfig) {
|
|
4946
4919
|
return;
|
|
4947
4920
|
}
|
|
4948
|
-
const sortValues = this.sorting.makeSortingList();
|
|
4949
4921
|
const sortConfig = this.sorting.sortingColumn
|
|
4950
4922
|
? { value: this.sorting.sortingColumn.name, direction: this.sorting.sortingColumn.direction }
|
|
4951
4923
|
: null;
|
|
@@ -4956,7 +4928,6 @@ class List {
|
|
|
4956
4928
|
actions: this.actions.actions,
|
|
4957
4929
|
queryParam: this.queryParam,
|
|
4958
4930
|
autofocus: this.autoFocus,
|
|
4959
|
-
sorts: sortValues,
|
|
4960
4931
|
sort: sortConfig,
|
|
4961
4932
|
chips: this.chips,
|
|
4962
4933
|
autoReload: this.autoReload,
|
|
@@ -4970,7 +4941,6 @@ class List {
|
|
|
4970
4941
|
if (this._persistance.queryEnabled) {
|
|
4971
4942
|
this.filterConfig.persist = {
|
|
4972
4943
|
name: this._persistance.name,
|
|
4973
|
-
persistQuery: true,
|
|
4974
4944
|
};
|
|
4975
4945
|
}
|
|
4976
4946
|
}
|
|
@@ -5502,11 +5472,11 @@ class FsListLoaderComponent {
|
|
|
5502
5472
|
}
|
|
5503
5473
|
}
|
|
5504
5474
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5505
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsListLoaderComponent, isStandalone: true, selector: "fs-list-loader", inputs: { columns: "columns", loaderLines: "loaderLines" }, usesOnChanges: true, ngImport: i0, template: "<table>\
|
|
5475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.7", type: FsListLoaderComponent, isStandalone: true, selector: "fs-list-loader", inputs: { columns: "columns", loaderLines: "loaderLines" }, usesOnChanges: true, ngImport: i0, template: "<table>\n <thead>\n <tr>\n <th *ngFor=\"let col of cols; let column = index\" [width]=\"widths[column] + '%'\">\n <div class=\"fs-skeleton-placeholder\" [style.width]=\"(placeholderWidths[0][column]/2) + '%'\"></div>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of rows; let index=index\">\n <td *ngFor=\"let col of cols; let column = index\">\n <div class=\"fs-skeleton-placeholder\" [style.width]=\"placeholderWidths[index][column] + '%'\"></div>\n </td>\n </tr>\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0}.fs-skeleton-placeholder{opacity:.5}:host ::ng-deep tbody tr:hover td{background:transparent}\n"], dependencies: [{ kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5506
5476
|
}
|
|
5507
5477
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListLoaderComponent, decorators: [{
|
|
5508
5478
|
type: Component,
|
|
5509
|
-
args: [{ selector: 'fs-list-loader', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgFor], template: "<table>\
|
|
5479
|
+
args: [{ selector: 'fs-list-loader', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [NgFor], template: "<table>\n <thead>\n <tr>\n <th *ngFor=\"let col of cols; let column = index\" [width]=\"widths[column] + '%'\">\n <div class=\"fs-skeleton-placeholder\" [style.width]=\"(placeholderWidths[0][column]/2) + '%'\"></div>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of rows; let index=index\">\n <td *ngFor=\"let col of cols; let column = index\">\n <div class=\"fs-skeleton-placeholder\" [style.width]=\"placeholderWidths[index][column] + '%'\"></div>\n </td>\n </tr>\n </tbody>\n</table>\n", styles: ["table{width:100%;border-spacing:0}.fs-skeleton-placeholder{opacity:.5}:host ::ng-deep tbody tr:hover td{background:transparent}\n"] }]
|
|
5510
5480
|
}], propDecorators: { columns: [{
|
|
5511
5481
|
type: Input
|
|
5512
5482
|
}], loaderLines: [{
|
|
@@ -5923,8 +5893,8 @@ class FsListComponent {
|
|
|
5923
5893
|
.pipe(takeUntil(this._destroy))
|
|
5924
5894
|
.subscribe((row) => {
|
|
5925
5895
|
this.list.dataController.removeData(row);
|
|
5926
|
-
this.
|
|
5927
|
-
.forEach((
|
|
5896
|
+
this.list.dataController.visibleRows
|
|
5897
|
+
.forEach((row) => row.updateActions());
|
|
5928
5898
|
});
|
|
5929
5899
|
}
|
|
5930
5900
|
_subscribeToGroupExpandStatusChange() {
|