@firestitch/list 18.0.80 → 18.0.82
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/breakpoint-controller.d.ts +66 -0
- package/app/classes/columns-controller.d.ts +52 -10
- package/app/classes/list-controller.d.ts +4 -2
- package/app/classes/selection-controller.d.ts +6 -0
- package/app/components/body/body.component.d.ts +6 -3
- package/app/components/body/row/cell/cell.component.d.ts +1 -0
- package/app/components/body/row/row.component.d.ts +4 -1
- package/app/components/footer/footer.component.d.ts +1 -1
- package/app/components/head/head.component.d.ts +11 -1
- package/app/components/list/list.component.d.ts +50 -5
- package/app/directives/breakpoint/breakpoint.directive.d.ts +58 -0
- package/app/directives/draggable-list/draggable-list.directive.d.ts +1 -0
- package/app/fs-list.module.d.ts +17 -16
- package/app/interfaces/listconfig.interface.d.ts +21 -0
- package/app/models/column-set.model.d.ts +50 -0
- package/app/models/column.model.d.ts +42 -0
- package/app/models/index.d.ts +1 -0
- package/esm2022/app/classes/breakpoint-controller.mjs +200 -0
- package/esm2022/app/classes/columns-controller.mjs +171 -66
- package/esm2022/app/classes/list-controller.mjs +7 -5
- package/esm2022/app/classes/selection-controller.mjs +9 -1
- package/esm2022/app/components/body/body.component.mjs +9 -4
- package/esm2022/app/components/body/row/cell/cell.component.mjs +28 -6
- package/esm2022/app/components/body/row/row.component.mjs +39 -7
- package/esm2022/app/components/footer/footer-row/footer-row.component.mjs +3 -3
- package/esm2022/app/components/footer/footer.component.mjs +1 -1
- package/esm2022/app/components/head/head-cell/head-cell.component.mjs +3 -3
- package/esm2022/app/components/head/head.component.mjs +18 -3
- package/esm2022/app/components/list/list.component.mjs +111 -19
- package/esm2022/app/components/pagination/pagination.component.mjs +3 -3
- package/esm2022/app/directives/breakpoint/breakpoint.directive.mjs +88 -0
- package/esm2022/app/directives/draggable-list/draggable-list.directive.mjs +8 -1
- package/esm2022/app/fs-list.module.mjs +7 -2
- package/esm2022/app/interfaces/listconfig.interface.mjs +1 -1
- package/esm2022/app/models/column-set.model.mjs +93 -0
- package/esm2022/app/models/column.model.mjs +56 -1
- package/esm2022/app/models/index.mjs +2 -1
- package/esm2022/public_api.mjs +5 -2
- package/fesm2022/firestitch-list.mjs +829 -112
- package/fesm2022/firestitch-list.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +5 -2
- package/styles.scss +22 -8
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, inject,
|
|
2
|
+
import { Injectable, inject, NgZone, ChangeDetectorRef, ElementRef, Renderer2, Directive, Input, Pipe, EventEmitter, Component, ChangeDetectionStrategy, Output, input, effect, HostBinding, computed, TemplateRef, ViewContainerRef, ViewChild, ContentChild, isDevMode, HostListener, ContentChildren, InjectionToken, Injector, NgModule } from '@angular/core';
|
|
3
3
|
import { BehaviorSubject, Subject, Observable, map as map$1, merge, of, from, combineLatest, EMPTY } from 'rxjs';
|
|
4
|
-
import { takeUntil, map, take, skip, filter, tap,
|
|
5
|
-
import { get, isString, isObject, isBoolean,
|
|
4
|
+
import { takeUntil, map, take, distinctUntilChanged, skip, filter, tap, shareReplay, delay, switchMap, debounceTime, mapTo, catchError } from 'rxjs/operators';
|
|
5
|
+
import { get, isString, isObject, isBoolean, isFunction, cloneDeep, random, mergeWith } from 'lodash-es';
|
|
6
|
+
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
6
7
|
import { NgClass, AsyncPipe, NgTemplateOutlet, Location, DecimalPipe } from '@angular/common';
|
|
7
8
|
import { MatCheckbox } from '@angular/material/checkbox';
|
|
8
9
|
import { MatIcon } from '@angular/material/icon';
|
|
@@ -463,6 +464,14 @@ class SelectionController {
|
|
|
463
464
|
get selectedAll() {
|
|
464
465
|
return this._selectedAll;
|
|
465
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* Whether every currently visible row is selected -- the state of the select-all checkbox
|
|
469
|
+
* in `<thead>`. Exposed so a head band created after the fact (a breakpoint switch back to
|
|
470
|
+
* a set that declares headers) can seed itself instead of starting unchecked.
|
|
471
|
+
*/
|
|
472
|
+
get selectedAllVisible() {
|
|
473
|
+
return this._selectedAllVisible;
|
|
474
|
+
}
|
|
466
475
|
get selectionChange$() {
|
|
467
476
|
return this._selectionChange.pipe(takeUntil(this._destroy$));
|
|
468
477
|
}
|
|
@@ -880,12 +889,208 @@ class SelectionController {
|
|
|
880
889
|
}
|
|
881
890
|
}
|
|
882
891
|
|
|
892
|
+
const DEFAULT_HYSTERESIS = 24;
|
|
893
|
+
/**
|
|
894
|
+
* Decides which breakpoint column set is active for one list.
|
|
895
|
+
*
|
|
896
|
+
* Measures the list's own container by default -- a list rendered inside a dialog, drawer
|
|
897
|
+
* or narrow flex column has a viewport width that lies about how much room it actually has.
|
|
898
|
+
* `breakpoints: { container: false }` switches to viewport media queries via the CDK, which
|
|
899
|
+
* costs no JS at all between thresholds.
|
|
900
|
+
*
|
|
901
|
+
* Emits the `maxWidth` of the narrowest matching set, or `null` when the base set applies.
|
|
902
|
+
*/
|
|
903
|
+
class BreakpointController {
|
|
904
|
+
_zone = inject(NgZone);
|
|
905
|
+
_breakpointObserver = inject(BreakpointObserver);
|
|
906
|
+
_active$ = new BehaviorSubject(null);
|
|
907
|
+
_breakpoints = [];
|
|
908
|
+
_container = true;
|
|
909
|
+
_hysteresis = DEFAULT_HYSTERESIS;
|
|
910
|
+
_resizeObserver = null;
|
|
911
|
+
_element = null;
|
|
912
|
+
_lastWidth = null;
|
|
913
|
+
/** Refcount of in-flight drags. While > 0 swaps are held, not dropped. */
|
|
914
|
+
_suspended = 0;
|
|
915
|
+
_pending = null;
|
|
916
|
+
_hasPending = false;
|
|
917
|
+
_observing$ = new Subject();
|
|
918
|
+
_destroy$ = new Subject();
|
|
919
|
+
/** The `maxWidth` of the active set, or null for the base set. */
|
|
920
|
+
get active() {
|
|
921
|
+
return this._active$.getValue();
|
|
922
|
+
}
|
|
923
|
+
get active$() {
|
|
924
|
+
return this._active$
|
|
925
|
+
.pipe(distinctUntilChanged());
|
|
926
|
+
}
|
|
927
|
+
get container() {
|
|
928
|
+
return this._container;
|
|
929
|
+
}
|
|
930
|
+
initConfig(config = {}) {
|
|
931
|
+
this._container = config?.container ?? true;
|
|
932
|
+
this._hysteresis = config?.hysteresis ?? DEFAULT_HYSTERESIS;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Declare the breakpoints to watch, as `maxWidth` values in px.
|
|
936
|
+
* Re-registering tears down the previous observation.
|
|
937
|
+
*/
|
|
938
|
+
setBreakpoints(breakpoints) {
|
|
939
|
+
this._breakpoints = [...breakpoints]
|
|
940
|
+
.filter((value) => Number.isFinite(value))
|
|
941
|
+
.sort((a, b) => a - b);
|
|
942
|
+
this._restart();
|
|
943
|
+
}
|
|
944
|
+
/** Supply the element to measure in container mode. Ignored in viewport mode. */
|
|
945
|
+
observe(element) {
|
|
946
|
+
this._element = element;
|
|
947
|
+
this._restart();
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Hold breakpoint swaps. Refcounted, and the latest value is applied on the final
|
|
951
|
+
* `resume()` -- a crossing during a drag is deferred, never lost.
|
|
952
|
+
*
|
|
953
|
+
* Mandatory during a drag: the draggable directive snapshots every row's top/height once
|
|
954
|
+
* at drag start and hit-tests against that frozen cache, so a mid-drag reflow silently
|
|
955
|
+
* produces the wrong drop target.
|
|
956
|
+
*/
|
|
957
|
+
suspend() {
|
|
958
|
+
this._suspended++;
|
|
959
|
+
}
|
|
960
|
+
resume() {
|
|
961
|
+
if (this._suspended === 0) {
|
|
962
|
+
return;
|
|
963
|
+
}
|
|
964
|
+
this._suspended--;
|
|
965
|
+
if (this._suspended === 0 && this._hasPending) {
|
|
966
|
+
this._hasPending = false;
|
|
967
|
+
this._emit(this._pending);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
ngOnDestroy() {
|
|
971
|
+
this._teardown();
|
|
972
|
+
this._suspended = 0;
|
|
973
|
+
this._observing$.next();
|
|
974
|
+
this._observing$.complete();
|
|
975
|
+
this._destroy$.next();
|
|
976
|
+
this._destroy$.complete();
|
|
977
|
+
this._active$.complete();
|
|
978
|
+
}
|
|
979
|
+
_restart() {
|
|
980
|
+
this._teardown();
|
|
981
|
+
if (!this._breakpoints.length) {
|
|
982
|
+
this._emit(null);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
if (this._container) {
|
|
986
|
+
this._observeContainer();
|
|
987
|
+
}
|
|
988
|
+
else {
|
|
989
|
+
this._observeViewport();
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
_observeViewport() {
|
|
993
|
+
const queries = this._breakpoints
|
|
994
|
+
.map((maxWidth) => `(max-width: ${maxWidth}px)`);
|
|
995
|
+
this._breakpointObserver
|
|
996
|
+
.observe(queries)
|
|
997
|
+
.pipe(takeUntil(this._observing$), takeUntil(this._destroy$))
|
|
998
|
+
.subscribe((state) => {
|
|
999
|
+
// _breakpoints is ascending, so the first match is the narrowest one.
|
|
1000
|
+
const match = this._breakpoints
|
|
1001
|
+
.find((maxWidth) => state.breakpoints[`(max-width: ${maxWidth}px)`]);
|
|
1002
|
+
this._emit(match ?? null);
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
_observeContainer() {
|
|
1006
|
+
if (!this._element || typeof ResizeObserver === 'undefined') {
|
|
1007
|
+
this._emit(null);
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
// Seed synchronously so the first render already has the right set and we never
|
|
1011
|
+
// paint the desktop columns before flipping to compact.
|
|
1012
|
+
this._applyWidth(this._element.getBoundingClientRect().width, true);
|
|
1013
|
+
// Outside Angular: ResizeObserver fires on every frame of a drag-resize and we only
|
|
1014
|
+
// want a CD pass on the frames that actually cross a threshold.
|
|
1015
|
+
this._zone.runOutsideAngular(() => {
|
|
1016
|
+
this._resizeObserver = new ResizeObserver((entries) => {
|
|
1017
|
+
const width = entries[0]?.contentRect?.width;
|
|
1018
|
+
if (width === undefined) {
|
|
1019
|
+
return;
|
|
1020
|
+
}
|
|
1021
|
+
this._applyWidth(width, false);
|
|
1022
|
+
});
|
|
1023
|
+
this._resizeObserver.observe(this._element);
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Map a measured width onto a set, with a hysteresis band so a container parked exactly
|
|
1028
|
+
* on a threshold cannot oscillate between two sets on sub-pixel reflows.
|
|
1029
|
+
*/
|
|
1030
|
+
_applyWidth(width, initial) {
|
|
1031
|
+
// A detached or display:none container measures 0. Treat it as "no information" and
|
|
1032
|
+
// keep whatever set is active, otherwise a hidden tab would flip to the narrowest set.
|
|
1033
|
+
if (!width) {
|
|
1034
|
+
return;
|
|
1035
|
+
}
|
|
1036
|
+
if (!initial && this._lastWidth !== null) {
|
|
1037
|
+
const crossed = this._breakpoints
|
|
1038
|
+
.some((maxWidth) => (this._lastWidth <= maxWidth) !== (width <= maxWidth));
|
|
1039
|
+
if (!crossed) {
|
|
1040
|
+
this._lastWidth = width;
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
const nearThreshold = this._breakpoints
|
|
1044
|
+
.some((maxWidth) => Math.abs(width - maxWidth) < this._hysteresis);
|
|
1045
|
+
if (nearThreshold && Math.abs(width - this._lastWidth) < this._hysteresis) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
this._lastWidth = width;
|
|
1050
|
+
const match = this._breakpoints
|
|
1051
|
+
.find((maxWidth) => width <= maxWidth);
|
|
1052
|
+
const next = match ?? null;
|
|
1053
|
+
if (next === this.active) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
if (initial) {
|
|
1057
|
+
this._emit(next);
|
|
1058
|
+
}
|
|
1059
|
+
else {
|
|
1060
|
+
// Back into the zone only when the set actually changes.
|
|
1061
|
+
this._zone.run(() => this._emit(next));
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
_emit(value) {
|
|
1065
|
+
if (this._suspended > 0) {
|
|
1066
|
+
this._pending = value;
|
|
1067
|
+
this._hasPending = true;
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
this._active$.next(value);
|
|
1071
|
+
}
|
|
1072
|
+
_teardown() {
|
|
1073
|
+
this._observing$.next();
|
|
1074
|
+
if (this._resizeObserver) {
|
|
1075
|
+
this._resizeObserver.disconnect();
|
|
1076
|
+
this._resizeObserver = null;
|
|
1077
|
+
}
|
|
1078
|
+
this._lastWidth = null;
|
|
1079
|
+
}
|
|
1080
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BreakpointController, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1081
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BreakpointController });
|
|
1082
|
+
}
|
|
1083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: BreakpointController, decorators: [{
|
|
1084
|
+
type: Injectable
|
|
1085
|
+
}] });
|
|
1086
|
+
|
|
883
1087
|
class FsListDraggableListDirective {
|
|
884
1088
|
_cdRef = inject(ChangeDetectorRef);
|
|
885
1089
|
_zone = inject(NgZone);
|
|
886
1090
|
_containerElement = inject(ElementRef);
|
|
887
1091
|
_reorderController = inject(ReorderController);
|
|
888
1092
|
_renderer = inject(Renderer2);
|
|
1093
|
+
_breakpoints = inject(BreakpointController, { optional: true });
|
|
889
1094
|
// Draggable Element
|
|
890
1095
|
_draggableElement;
|
|
891
1096
|
_draggableElementPreview;
|
|
@@ -939,6 +1144,10 @@ class FsListDraggableListDirective {
|
|
|
939
1144
|
this._reorderController.startCallback();
|
|
940
1145
|
}
|
|
941
1146
|
this._dragInProgress = true;
|
|
1147
|
+
// Row top/height are snapshotted once here and hit-tested against for the whole drag,
|
|
1148
|
+
// with no invalidation path -- a breakpoint swap mid-drag would reflow the table and
|
|
1149
|
+
// silently produce the wrong drop target. Held, not dropped: the swap applies on drop.
|
|
1150
|
+
this._breakpoints?.suspend();
|
|
942
1151
|
window.document.body.classList.add('reorder-in-progress');
|
|
943
1152
|
this._draggableElement = draggableElement;
|
|
944
1153
|
this._detectSelectedRows();
|
|
@@ -1000,6 +1209,7 @@ class FsListDraggableListDirective {
|
|
|
1000
1209
|
*/
|
|
1001
1210
|
dragEnd() {
|
|
1002
1211
|
this._dragInProgress = false;
|
|
1212
|
+
this._breakpoints?.resume();
|
|
1003
1213
|
this._reorderController.dataController.finishReorder();
|
|
1004
1214
|
if (this._reorderController.movedCallback
|
|
1005
1215
|
&& this._draggableElementStartIndex !== this._draggableElementIndex) {
|
|
@@ -1841,6 +2051,99 @@ class ColumnAttributes {
|
|
|
1841
2051
|
}
|
|
1842
2052
|
}
|
|
1843
2053
|
|
|
2054
|
+
/**
|
|
2055
|
+
* One complete set of columns.
|
|
2056
|
+
*
|
|
2057
|
+
* A list always has a base set (`maxWidth === null`, the desktop markup) and zero or more
|
|
2058
|
+
* breakpoint sets declared inside `<fs-list-breakpoint [maxWidth]="n">`. Exactly one set is
|
|
2059
|
+
* active at a time; the active set's `rendered` array is what `<thead>`/`<tbody>`/`<tfoot>`
|
|
2060
|
+
* iterate.
|
|
2061
|
+
*
|
|
2062
|
+
* Every set owns its own `Column` instances, so per-set colspan flags, templates and titles
|
|
2063
|
+
* can never leak across sets.
|
|
2064
|
+
*/
|
|
2065
|
+
class ColumnSet {
|
|
2066
|
+
maxWidth;
|
|
2067
|
+
columns = [];
|
|
2068
|
+
/** `columns` filtered by visibility -- the array the three bands iterate. */
|
|
2069
|
+
rendered = [];
|
|
2070
|
+
hasHeader = false;
|
|
2071
|
+
hasFooter = false;
|
|
2072
|
+
/**
|
|
2073
|
+
* Structural cell overrides. `null` means "inherit whatever the list is configured to do";
|
|
2074
|
+
* `false` suppresses that structural cell while this set is active. Only ever set from
|
|
2075
|
+
* `<fs-list-breakpoint>` inputs -- the base set always inherits.
|
|
2076
|
+
*/
|
|
2077
|
+
selection = null;
|
|
2078
|
+
rowActions = null;
|
|
2079
|
+
reorder = null;
|
|
2080
|
+
/**
|
|
2081
|
+
* @param maxWidth Upper bound in px this set applies at (inclusive). `null` for the base set.
|
|
2082
|
+
*/
|
|
2083
|
+
constructor(maxWidth) {
|
|
2084
|
+
this.maxWidth = maxWidth;
|
|
2085
|
+
}
|
|
2086
|
+
get isBase() {
|
|
2087
|
+
return this.maxWidth === null;
|
|
2088
|
+
}
|
|
2089
|
+
/** The media query this set activates at, or null for the base set. */
|
|
2090
|
+
get media() {
|
|
2091
|
+
return this.maxWidth === null
|
|
2092
|
+
? null
|
|
2093
|
+
: `(max-width: ${this.maxWidth}px)`;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Resolve everything that depends only on the declared columns, not on visibility.
|
|
2097
|
+
* Called once, when the set is built.
|
|
2098
|
+
*/
|
|
2099
|
+
resolve() {
|
|
2100
|
+
resolveColspans(this.columns);
|
|
2101
|
+
this.hasHeader = this.columns
|
|
2102
|
+
.some((column) => !!column.headerTemplate || !!column.title);
|
|
2103
|
+
this.hasFooter = this.columns
|
|
2104
|
+
.some((column) => !!column.footerTemplate);
|
|
2105
|
+
this.update();
|
|
2106
|
+
}
|
|
2107
|
+
/** Refresh the rendered array. Called whenever column visibility changes. */
|
|
2108
|
+
update() {
|
|
2109
|
+
this.rendered = this.columns.filter((column) => column.visible);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
const COLSPAN_SLOTS = [
|
|
2113
|
+
{ config: 'headerConfigs', flag: 'headerColspanned' },
|
|
2114
|
+
{ config: 'groupHeaderConfigs', flag: 'groupHeaderColspanned' },
|
|
2115
|
+
{ config: 'groupFooterConfigs', flag: 'groupFooterColspanned' },
|
|
2116
|
+
{ config: 'cellConfigs', flag: 'cellColspanned' },
|
|
2117
|
+
{ config: 'footerConfigs', flag: 'footerColspanned' },
|
|
2118
|
+
];
|
|
2119
|
+
/**
|
|
2120
|
+
* Mark which columns are spanned over by an earlier column's `colspan`.
|
|
2121
|
+
*
|
|
2122
|
+
* Resolved over the full declared column list (not the visible subset), which is the
|
|
2123
|
+
* behaviour the single-set implementation has always had. Every flag is reset first so
|
|
2124
|
+
* the pass is idempotent and a set can be re-resolved safely.
|
|
2125
|
+
*/
|
|
2126
|
+
function resolveColspans(columns) {
|
|
2127
|
+
COLSPAN_SLOTS.forEach(({ config, flag }) => {
|
|
2128
|
+
columns.forEach((column) => {
|
|
2129
|
+
column[flag] = false;
|
|
2130
|
+
});
|
|
2131
|
+
columns.forEach((column, index) => {
|
|
2132
|
+
const colspan = column[config]?.colspan;
|
|
2133
|
+
if (colspan === undefined || colspan === null) {
|
|
2134
|
+
return;
|
|
2135
|
+
}
|
|
2136
|
+
const spanTo = Math.min(index + Number(colspan), columns.length);
|
|
2137
|
+
if (!Number.isFinite(spanTo)) {
|
|
2138
|
+
return;
|
|
2139
|
+
}
|
|
2140
|
+
for (let i = index + 1; i < spanTo; i++) {
|
|
2141
|
+
columns[i][flag] = true;
|
|
2142
|
+
}
|
|
2143
|
+
});
|
|
2144
|
+
});
|
|
2145
|
+
}
|
|
2146
|
+
|
|
1844
2147
|
class StyleConfig {
|
|
1845
2148
|
colspan;
|
|
1846
2149
|
align; // Can't be used in tempaltes!
|
|
@@ -1947,6 +2250,17 @@ class Column {
|
|
|
1947
2250
|
groupFooterColspanned = false;
|
|
1948
2251
|
cellColspanned = false;
|
|
1949
2252
|
footerColspanned = false;
|
|
2253
|
+
/**
|
|
2254
|
+
* Stable identity for `@for (... ; track column.uid)` in the head/body/footer bands.
|
|
2255
|
+
* Assigned by ColumnsController as `<setIndex>:<columnIndex>`, so columns from two
|
|
2256
|
+
* different sets never collide and a breakpoint swap replaces every cell view.
|
|
2257
|
+
*/
|
|
2258
|
+
uid = '';
|
|
2259
|
+
/**
|
|
2260
|
+
* For a column declared inside `<fs-list-breakpoint>`, the same-named column in the
|
|
2261
|
+
* base (desktop) set, or null. Base columns leave this null.
|
|
2262
|
+
*/
|
|
2263
|
+
baseColumn = null;
|
|
1950
2264
|
_attributes;
|
|
1951
2265
|
_defaultDirection;
|
|
1952
2266
|
_ordered$ = new BehaviorSubject(false);
|
|
@@ -2015,6 +2329,50 @@ class Column {
|
|
|
2015
2329
|
}
|
|
2016
2330
|
this._ordered$.next(value);
|
|
2017
2331
|
}
|
|
2332
|
+
/**
|
|
2333
|
+
* The column that owns sort state for this one. A breakpoint column delegates to its
|
|
2334
|
+
* same-named base column so `sorting.sortingColumn` is always a base Column -> the
|
|
2335
|
+
* `order=<name>,<dir>` query param and the URL stay invariant across a resize.
|
|
2336
|
+
* Base columns return themselves, so behaviour is unchanged without breakpoints.
|
|
2337
|
+
*/
|
|
2338
|
+
get sortSource() {
|
|
2339
|
+
return this.baseColumn ?? this;
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Whether this column's head cell offers sorting -- the arrow and the click target.
|
|
2343
|
+
*
|
|
2344
|
+
* Sort *state* delegates to {@link sortSource}, but the affordance must not: a breakpoint
|
|
2345
|
+
* column that stacks several base columns into one cell has no honest sort label, and
|
|
2346
|
+
* `[sortable]="false"` on a breakpoint column has to be able to drop the control at that
|
|
2347
|
+
* width. So a breakpoint column has to declare `sortable` itself, while a base column --
|
|
2348
|
+
* whose `sortSource` is itself -- is unaffected.
|
|
2349
|
+
*/
|
|
2350
|
+
get sortIndicated() {
|
|
2351
|
+
return this.baseColumn ? !!this.sortable : true;
|
|
2352
|
+
}
|
|
2353
|
+
/**
|
|
2354
|
+
* Copy the TemplateRefs of slots this column left undeclared from `base`.
|
|
2355
|
+
*
|
|
2356
|
+
* Templates only -- never the StyleConfigs. A base `colspan="4"` copied into a
|
|
2357
|
+
* 2-column breakpoint set would be bound straight to [attr.colspan] and overflow the
|
|
2358
|
+
* row, and sharing a StyleConfig would alias one mutable object across two sets.
|
|
2359
|
+
*
|
|
2360
|
+
* The header slot is deliberately excluded, template and `title` both. A header labels
|
|
2361
|
+
* the column as that set renders it, and a set that stacks five base columns into one
|
|
2362
|
+
* cell has no honest label to borrow -- inheriting would print the base column's name
|
|
2363
|
+
* over a cell that no longer holds only that value. So the header row is exactly what
|
|
2364
|
+
* the active set declares: a set that declares none renders none.
|
|
2365
|
+
*/
|
|
2366
|
+
inheritTemplatesFrom(base) {
|
|
2367
|
+
if (!base) {
|
|
2368
|
+
return;
|
|
2369
|
+
}
|
|
2370
|
+
this.groupHeaderTemplate = this.groupHeaderTemplate ?? base.groupHeaderTemplate;
|
|
2371
|
+
this.groupFooterTemplate = this.groupFooterTemplate ?? base.groupFooterTemplate;
|
|
2372
|
+
this.cellTemplate = this.cellTemplate ?? base.cellTemplate;
|
|
2373
|
+
this.footerTemplate = this.footerTemplate ?? base.footerTemplate;
|
|
2374
|
+
this.expandTrigger = this.expandTrigger ?? base.expandTrigger;
|
|
2375
|
+
}
|
|
2018
2376
|
/**
|
|
2019
2377
|
* Merge with defaults with existing config
|
|
2020
2378
|
*
|
|
@@ -2113,17 +2471,29 @@ class FsCellComponent {
|
|
|
2113
2471
|
cellContext = {};
|
|
2114
2472
|
cellTemplate;
|
|
2115
2473
|
_destroy$ = new Subject();
|
|
2474
|
+
// Torn down and recreated every time the row() wrapper swaps, so the
|
|
2475
|
+
// per-wrapper data$/expanded$ subscriptions below never leak or keep
|
|
2476
|
+
// firing for a wrapper this cell no longer renders.
|
|
2477
|
+
_rowDestroy$ = new Subject();
|
|
2116
2478
|
constructor() {
|
|
2479
|
+
// React whenever the row() input swaps to a new wrapper. With row-level
|
|
2480
|
+
// trackBy (track row.data.id) a reload reuses this DOM cell but points it
|
|
2481
|
+
// at a brand-new Row wrapper holding fresh data, so we must rebuild the
|
|
2482
|
+
// cell context and re-subscribe to the new wrapper's data$ here -> without
|
|
2483
|
+
// this the cell stays frozen on the old wrapper's data (IEB-T117).
|
|
2117
2484
|
effect(() => {
|
|
2118
2485
|
const currentRow = this.row();
|
|
2486
|
+
this._rowDestroy$.next();
|
|
2119
2487
|
if (currentRow) {
|
|
2120
|
-
this.
|
|
2488
|
+
this._initCellTemplate();
|
|
2489
|
+
this._initCellContext();
|
|
2490
|
+
this._listenRowDataChange();
|
|
2491
|
+
this._listenGroupOpen();
|
|
2121
2492
|
}
|
|
2122
2493
|
});
|
|
2123
2494
|
}
|
|
2124
2495
|
ngOnInit() {
|
|
2125
|
-
|
|
2126
|
-
this._listenGroupOpen();
|
|
2496
|
+
// Context/subscriptions are wired reactively from the row() effect above.
|
|
2127
2497
|
}
|
|
2128
2498
|
ngOnChanges(changes) {
|
|
2129
2499
|
if (changes.rowIndex?.currentValue !== changes.rowIndex?.previousValue) {
|
|
@@ -2136,10 +2506,17 @@ class FsCellComponent {
|
|
|
2136
2506
|
}
|
|
2137
2507
|
}
|
|
2138
2508
|
ngOnDestroy() {
|
|
2509
|
+
this._rowDestroy$.next();
|
|
2510
|
+
this._rowDestroy$.complete();
|
|
2139
2511
|
this._destroy$.next(null);
|
|
2140
2512
|
this._destroy$.complete();
|
|
2141
2513
|
}
|
|
2142
2514
|
_initCellContext() {
|
|
2515
|
+
// The row() effect can fire before the column @Input is bound; bail until
|
|
2516
|
+
// it is, ngOnChanges(column) re-runs this once column arrives.
|
|
2517
|
+
if (!this.column) {
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2143
2520
|
const currentRow = this.row();
|
|
2144
2521
|
this.cellContext.index = this.rowIndex;
|
|
2145
2522
|
if (currentRow) {
|
|
@@ -2177,13 +2554,16 @@ class FsCellComponent {
|
|
|
2177
2554
|
const currentRow = this.row();
|
|
2178
2555
|
if (currentRow instanceof BaseRow) {
|
|
2179
2556
|
currentRow.data$
|
|
2180
|
-
.pipe(skip(1), takeUntil(this._destroy$))
|
|
2557
|
+
.pipe(skip(1), takeUntil(this._rowDestroy$), takeUntil(this._destroy$))
|
|
2181
2558
|
.subscribe(() => {
|
|
2182
2559
|
this._initCellContext();
|
|
2183
2560
|
});
|
|
2184
2561
|
}
|
|
2185
2562
|
}
|
|
2186
2563
|
_initCellTemplate() {
|
|
2564
|
+
if (!this.column) {
|
|
2565
|
+
return;
|
|
2566
|
+
}
|
|
2187
2567
|
const currentRow = this.row();
|
|
2188
2568
|
if (currentRow && isGroupRow(currentRow)) {
|
|
2189
2569
|
this.cellTemplate = this.column.groupHeaderTemplate || this.column.cellTemplate;
|
|
@@ -2199,7 +2579,7 @@ class FsCellComponent {
|
|
|
2199
2579
|
const currentRow = this.row();
|
|
2200
2580
|
if (currentRow && isGroupRow(currentRow)) {
|
|
2201
2581
|
currentRow.expanded$
|
|
2202
|
-
.pipe(takeUntil(this._destroy$))
|
|
2582
|
+
.pipe(takeUntil(this._rowDestroy$), takeUntil(this._destroy$))
|
|
2203
2583
|
.subscribe((status) => {
|
|
2204
2584
|
this.cellContext.expanded = status;
|
|
2205
2585
|
});
|
|
@@ -2294,10 +2674,37 @@ class FsRowComponent {
|
|
|
2294
2674
|
});
|
|
2295
2675
|
_eventListeners = [];
|
|
2296
2676
|
_destroy$ = new Subject();
|
|
2677
|
+
// Torn down and recreated every time the row() wrapper swaps so the
|
|
2678
|
+
// per-wrapper data$/selection subscriptions don't keep firing for a wrapper
|
|
2679
|
+
// this DOM row no longer renders.
|
|
2680
|
+
_rowDestroy$ = new Subject();
|
|
2681
|
+
// The wrapper the imperative lifecycle wiring (ngOnInit/ngAfterViewInit)
|
|
2682
|
+
// subscribed to. The row() effect re-wires only when the wrapper differs
|
|
2683
|
+
// from this, so the first effect run (same wrapper) doesn't double-subscribe.
|
|
2684
|
+
_wiredRow;
|
|
2297
2685
|
_el = inject(ElementRef);
|
|
2298
2686
|
_cdRef = inject(ChangeDetectorRef);
|
|
2299
2687
|
_renderer = inject(Renderer2);
|
|
2300
2688
|
_draggableList = inject(FsListDraggableListDirective, { optional: true });
|
|
2689
|
+
constructor() {
|
|
2690
|
+
// With row-level trackBy (track row.data.id) a reload reuses this DOM row
|
|
2691
|
+
// but binds it to a brand-new Row wrapper holding fresh data. Re-wire the
|
|
2692
|
+
// wrapper-scoped subscriptions (actions refresh via data$, selection) so
|
|
2693
|
+
// row actions and selection reflect the new data instead of freezing on
|
|
2694
|
+
// the previous wrapper (IEB-T117).
|
|
2695
|
+
effect(() => {
|
|
2696
|
+
const currentRow = this.row();
|
|
2697
|
+
// Skip until lifecycle has done the first wiring, and skip the run where
|
|
2698
|
+
// the wrapper is the one lifecycle already wired (avoids double-subscribe).
|
|
2699
|
+
if (!currentRow || currentRow === this._wiredRow || !this._wiredRow) {
|
|
2700
|
+
return;
|
|
2701
|
+
}
|
|
2702
|
+
this._rowDestroy$.next();
|
|
2703
|
+
this._wiredRow = currentRow;
|
|
2704
|
+
this._initRowActions();
|
|
2705
|
+
this._initSelection();
|
|
2706
|
+
});
|
|
2707
|
+
}
|
|
2301
2708
|
get isDragDisabled() {
|
|
2302
2709
|
return !this.selected && this.reorderMultiple && !!this.selection.selectedRows.size;
|
|
2303
2710
|
}
|
|
@@ -2323,6 +2730,9 @@ class FsRowComponent {
|
|
|
2323
2730
|
}
|
|
2324
2731
|
ngAfterViewInit() {
|
|
2325
2732
|
this._initSelection();
|
|
2733
|
+
// Record the wrapper lifecycle just wired; from here the row() effect
|
|
2734
|
+
// re-wires the wrapper-scoped subscriptions whenever the wrapper swaps.
|
|
2735
|
+
this._wiredRow = this.row();
|
|
2326
2736
|
}
|
|
2327
2737
|
updateRowActions() {
|
|
2328
2738
|
this.rowActions
|
|
@@ -2336,6 +2746,8 @@ class FsRowComponent {
|
|
|
2336
2746
|
this._eventListeners.forEach((listener) => {
|
|
2337
2747
|
listener();
|
|
2338
2748
|
});
|
|
2749
|
+
this._rowDestroy$.next();
|
|
2750
|
+
this._rowDestroy$.complete();
|
|
2339
2751
|
this._destroy$.next(null);
|
|
2340
2752
|
this._destroy$.complete();
|
|
2341
2753
|
}
|
|
@@ -2389,7 +2801,7 @@ class FsRowComponent {
|
|
|
2389
2801
|
this._filterActionsByCategories();
|
|
2390
2802
|
}
|
|
2391
2803
|
merge(this.row().data$, this.row().actionsUpdated$)
|
|
2392
|
-
.pipe(takeUntil(this._destroy$))
|
|
2804
|
+
.pipe(takeUntil(this._rowDestroy$), takeUntil(this._destroy$))
|
|
2393
2805
|
.subscribe(() => {
|
|
2394
2806
|
this.updateRowActions();
|
|
2395
2807
|
this._cdRef.markForCheck();
|
|
@@ -2438,7 +2850,7 @@ class FsRowComponent {
|
|
|
2438
2850
|
// return type === SelectionChangeType.AllVisibleSelectionChange
|
|
2439
2851
|
// || type === SelectionChangeType.SelectedAll;
|
|
2440
2852
|
// }),
|
|
2441
|
-
takeUntil(this._destroy$))
|
|
2853
|
+
takeUntil(this._rowDestroy$), takeUntil(this._destroy$))
|
|
2442
2854
|
.subscribe(() => {
|
|
2443
2855
|
const currentRow = this.row();
|
|
2444
2856
|
this.selected = currentRow && this.selection.isRowSelected(currentRow.data);
|
|
@@ -2477,7 +2889,7 @@ class FsRowComponent {
|
|
|
2477
2889
|
});
|
|
2478
2890
|
}
|
|
2479
2891
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2480
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.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@if (leftDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Selection -->\n@if (selection && (selection.enabled$ | async)) {\n <td class=\"fs-list-col fs-list-col-selection\">\n @if (!isGroupFooterRow()) {\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [disabled]=\"!selection.selectable(row(), rowIndex)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n }\n </td>\n}\n<!-- Content -->\n@for (column of columns; track
|
|
2892
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.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@if (leftDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Selection -->\n@if (selection && (selection.enabled$ | async)) {\n <td class=\"fs-list-col fs-list-col-selection\">\n @if (!isGroupFooterRow()) {\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [disabled]=\"!selection.selectable(row(), rowIndex)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n }\n </td>\n}\n<!-- Content -->\n@for (column of columns; track column.uid; let isFirst = $first) {\n @if ((isGroupRow() && !column.groupHeaderColspanned) || (isGroupFooterRow() && !column.groupFooterColspanned) || (!isGroupRow() && !isGroupFooterRow() && !column.cellColspanned)) {\n <td\n fs-cell\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 }\n}\n<!-- Drag -->\n@if (rightDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Row Actions -->\n@if (hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategy.Manual)) {\n <td class=\"fs-list-col actions-col\">\n @if (!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 }\n </td>\n}\n<ng-template #dragCell>\n @if (dragCellVisible() && !isGroupFooterRow()) {\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 } @else {\n <td class=\"fs-list-col drag-col\"></td>\n }\n</ng-template>", 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: 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: "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 });
|
|
2481
2893
|
}
|
|
2482
2894
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsRowComponent, decorators: [{
|
|
2483
2895
|
type: Component,
|
|
@@ -2491,8 +2903,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2491
2903
|
FsRowActionsComponent,
|
|
2492
2904
|
MatIcon,
|
|
2493
2905
|
AsyncPipe,
|
|
2494
|
-
], template: "<!-- Drag -->\n@if (leftDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Selection -->\n@if (selection && (selection.enabled$ | async)) {\n <td class=\"fs-list-col fs-list-col-selection\">\n @if (!isGroupFooterRow()) {\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [disabled]=\"!selection.selectable(row(), rowIndex)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n }\n </td>\n}\n<!-- Content -->\n@for (column of columns; track
|
|
2495
|
-
}], propDecorators: { role: [{
|
|
2906
|
+
], template: "<!-- Drag -->\n@if (leftDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Selection -->\n@if (selection && (selection.enabled$ | async)) {\n <td class=\"fs-list-col fs-list-col-selection\">\n @if (!isGroupFooterRow()) {\n <mat-checkbox\n (change)=\"selectRow($event)\"\n [disabled]=\"!selection.selectable(row(), rowIndex)\"\n [checked]=\"selected\"\n [indeterminate]=\"indeterminateSelected\">\n </mat-checkbox>\n }\n </td>\n}\n<!-- Content -->\n@for (column of columns; track column.uid; let isFirst = $first) {\n @if ((isGroupRow() && !column.groupHeaderColspanned) || (isGroupFooterRow() && !column.groupFooterColspanned) || (!isGroupRow() && !isGroupFooterRow() && !column.cellColspanned)) {\n <td\n fs-cell\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 }\n}\n<!-- Drag -->\n@if (rightDragDropEnabled) {\n <ng-container *ngTemplateOutlet=\"dragCell\"></ng-container>\n}\n<!-- Row Actions -->\n@if (hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategy.Manual)) {\n <td class=\"fs-list-col actions-col\">\n @if (!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 }\n </td>\n}\n<ng-template #dragCell>\n @if (dragCellVisible() && !isGroupFooterRow()) {\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 } @else {\n <td class=\"fs-list-col drag-col\"></td>\n }\n</ng-template>", 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"] }]
|
|
2907
|
+
}], ctorParameters: () => [], propDecorators: { role: [{
|
|
2496
2908
|
type: HostBinding,
|
|
2497
2909
|
args: ['attr.role']
|
|
2498
2910
|
}], rowActionsRaw: [{
|
|
@@ -2555,12 +2967,17 @@ class FsBodyComponent {
|
|
|
2555
2967
|
/**
|
|
2556
2968
|
* Track rows by their underlying record id so that a reload (which creates
|
|
2557
2969
|
* fresh Row wrapper objects) reuses the existing DOM instead of destroying
|
|
2558
|
-
* and recreating every row.
|
|
2559
|
-
*
|
|
2970
|
+
* and recreating every row. Only a genuine, non-empty id counts as a stable
|
|
2971
|
+
* identity: empty string / null / undefined (group & footer rows, id-less
|
|
2972
|
+
* records) fall back to the row index, namespaced so it can never collide
|
|
2973
|
+
* with a real id. Without the fallback every id-less row keys to the same
|
|
2974
|
+
* value and Angular throws NG0955 (duplicate track keys) -> scrambled rows.
|
|
2560
2975
|
*/
|
|
2561
2976
|
trackByFn(index, row) {
|
|
2562
2977
|
const id = row?.data?.id;
|
|
2563
|
-
return id
|
|
2978
|
+
return id === undefined || id === null || id === ''
|
|
2979
|
+
? `__row_index_${index}`
|
|
2980
|
+
: id;
|
|
2564
2981
|
}
|
|
2565
2982
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2566
2983
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsBodyComponent, isStandalone: true, selector: "[fs-list-body]", inputs: { rows: "rows", columns: "columns", hasFooter: "hasFooter", rowActionsRaw: "rowActionsRaw", groupActionsRaw: "groupActionsRaw", rowEvents: "rowEvents", rowClass: "rowClass", hasRowActions: "hasRowActions", selection: "selection", restoreMode: "restoreMode", rowRemoved: "rowRemoved", activeFiltersCount: "activeFiltersCount", reorderEnabled: "reorderEnabled", reorderPosition: "reorderPosition", reorderStrategy: "reorderStrategy", reorderMultiple: "reorderMultiple" }, queries: [{ propertyName: "headerTemplate", first: true, predicate: FsRowComponent, descendants: true, read: TemplateRef, static: true }], viewQueries: [{ propertyName: "rowsContainer", first: true, predicate: ["rowsContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "@for (row of rows; track trackByFn(i, row); let i = $index) {\n <tr\n fs-list-row\n fsListDraggableRow\n [row]=\"row\"\n [rowIndex]=\"i\"\n [columns]=\"columns\"\n [rowActionsRaw]=\"rowActionsRaw\"\n [groupActionsRaw]=\"groupActionsRaw\"\n [hasRowActions]=\"hasRowActions\"\n [rowEvents]=\"rowEvents\"\n [rowClass]=\"rowClass\"\n [selection]=\"selection\"\n [restoreMode]=\"restoreMode\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"activeFiltersCount\"\n [reorderEnabled]=\"reorderEnabled\"\n [reorderPosition]=\"reorderPosition\"\n [reorderStrategy]=\"reorderStrategy\"\n [reorderMultiple]=\"reorderMultiple\">\n </tr>\n}", styles: [":host.drag-hidden .drag-col{opacity:0!important;cursor:default}:host.disabled{opacity:.4;pointer-events:none}\n"], dependencies: [{ kind: "component", type: FsRowComponent, selector: "[fs-list-row]", inputs: ["row", "rowActionsRaw", "groupActionsRaw", "hasRowActions", "rowEvents", "rowClass", "restoreMode", "rowIndex", "columns", "selection", "rowRemoved", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy", "reorderMultiple"] }, { kind: "directive", type: FsListDraggableRowDirective, selector: "[fsListDraggableRow]", inputs: ["row"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -2779,14 +3196,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2779
3196
|
|
|
2780
3197
|
class FsFooterRowComponent extends FsRowComponent {
|
|
2781
3198
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterRowComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2782
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsFooterRowComponent, isStandalone: true, selector: "[fs-list-footer-row]", usesInheritance: true, ngImport: i0, template: "@if (leftDragDropEnabled) {\n <td class=\"fs-list-col drag-col\"></td>\n}\n@if (selection) {\n <td class=\"fs-list-col fs-list-col-selection\"></td>\n}\n@for (column of columns; track
|
|
3199
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsFooterRowComponent, isStandalone: true, selector: "[fs-list-footer-row]", usesInheritance: true, ngImport: i0, template: "@if (leftDragDropEnabled) {\n <td class=\"fs-list-col drag-col\"></td>\n}\n@if (selection) {\n <td class=\"fs-list-col fs-list-col-selection\"></td>\n}\n@for (column of columns; track column.uid) {\n @if (!column.footerColspanned) {\n <td\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 }\n}\n<!-- Drag -->\n@if (rightDragDropEnabled) {\n <td class=\"fs-list-col actions-col\"></td>\n}\n<!-- Row Actions -->", styles: ["td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"], dependencies: [{ kind: "component", type: FsFooterCellComponent, selector: "[fs-list-footer-cell]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2783
3200
|
}
|
|
2784
3201
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsFooterRowComponent, decorators: [{
|
|
2785
3202
|
type: Component,
|
|
2786
3203
|
args: [{ selector: '[fs-list-footer-row]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
2787
3204
|
FsFooterCellComponent,
|
|
2788
3205
|
NgClass,
|
|
2789
|
-
], template: "@if (leftDragDropEnabled) {\n <td class=\"fs-list-col drag-col\"></td>\n}\n@if (selection) {\n <td class=\"fs-list-col fs-list-col-selection\"></td>\n}\n@for (column of columns; track
|
|
3206
|
+
], template: "@if (leftDragDropEnabled) {\n <td class=\"fs-list-col drag-col\"></td>\n}\n@if (selection) {\n <td class=\"fs-list-col fs-list-col-selection\"></td>\n}\n@for (column of columns; track column.uid) {\n @if (!column.footerColspanned) {\n <td\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 }\n}\n<!-- Drag -->\n@if (rightDragDropEnabled) {\n <td class=\"fs-list-col actions-col\"></td>\n}\n<!-- Row Actions -->", styles: ["td.left{text-align:left}td.center{text-align:center}td.right{text-align:right}\n"] }]
|
|
2790
3207
|
}] });
|
|
2791
3208
|
|
|
2792
3209
|
class FsFooterComponent {
|
|
@@ -2825,7 +3242,7 @@ class FsHeadCellComponent extends FsCellComponent {
|
|
|
2825
3242
|
this.cellContext.value = this.column.title;
|
|
2826
3243
|
}
|
|
2827
3244
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsHeadCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2828
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsHeadCellComponent, isStandalone: true, selector: "[fs-head-cell]", usesInheritance: true, ngImport: i0, template: "<div class=\"wrap\">\n <span class=\"title\">\n @if (!column.headerTemplate) {\n {{ column.title }}\n }\n @if (column.headerTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n }\n </span>\n @if (column.ordered$ | async) {\n
|
|
3245
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsHeadCellComponent, isStandalone: true, selector: "[fs-head-cell]", usesInheritance: true, ngImport: i0, template: "<div class=\"wrap\">\n <span class=\"title\">\n @if (!column.headerTemplate) {\n {{ column.title }}\n }\n @if (column.headerTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n }\n </span>\n @if (column.sortIndicated) {\n @if (column.sortSource.ordered$ | async) {\n @switch (column.sortSource.sortingDirection$ | async) {\n @case ('asc') {\n <mat-icon>\n arrow_downward\n </mat-icon>\n }\n @case ('desc') {\n <mat-icon>\n arrow_upward\n </mat-icon>\n }\n }\n } @else if (column.sortSource.sortable) {\n <mat-icon>\n unfold_more\n </mat-icon>\n }\n }\n</div>", styles: [".wrap{display:inline-flex;align-items:center}.wrap mat-icon{font-size:13px;display:block;height:13px;width:13px;margin-left:4px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { 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 });
|
|
2829
3246
|
}
|
|
2830
3247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsHeadCellComponent, decorators: [{
|
|
2831
3248
|
type: Component,
|
|
@@ -2833,7 +3250,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
2833
3250
|
NgTemplateOutlet,
|
|
2834
3251
|
MatIcon,
|
|
2835
3252
|
AsyncPipe,
|
|
2836
|
-
], template: "<div class=\"wrap\">\n <span class=\"title\">\n @if (!column.headerTemplate) {\n {{ column.title }}\n }\n @if (column.headerTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n }\n </span>\n @if (column.ordered$ | async) {\n
|
|
3253
|
+
], template: "<div class=\"wrap\">\n <span class=\"title\">\n @if (!column.headerTemplate) {\n {{ column.title }}\n }\n @if (column.headerTemplate) {\n <ng-template\n [ngTemplateOutlet]=\"column.headerTemplate\"\n [ngTemplateOutletContext]=\"cellContext\">\n </ng-template>\n }\n </span>\n @if (column.sortIndicated) {\n @if (column.sortSource.ordered$ | async) {\n @switch (column.sortSource.sortingDirection$ | async) {\n @case ('asc') {\n <mat-icon>\n arrow_downward\n </mat-icon>\n }\n @case ('desc') {\n <mat-icon>\n arrow_upward\n </mat-icon>\n }\n }\n } @else if (column.sortSource.sortable) {\n <mat-icon>\n unfold_more\n </mat-icon>\n }\n }\n</div>", styles: [".wrap{display:inline-flex;align-items:center}.wrap mat-icon{font-size:13px;display:block;height:13px;width:13px;margin-left:4px}\n"] }]
|
|
2837
3254
|
}] });
|
|
2838
3255
|
|
|
2839
3256
|
class SortingController {
|
|
@@ -3079,6 +3496,20 @@ class FsHeadComponent {
|
|
|
3079
3496
|
selectAll(event) {
|
|
3080
3497
|
this.selection.selectAllVisibleRows(event.checked);
|
|
3081
3498
|
}
|
|
3499
|
+
/**
|
|
3500
|
+
* Sort by the clicked column.
|
|
3501
|
+
*
|
|
3502
|
+
* Sorting always acts on `sortSource` -- the base column -- so the emitted `order` param
|
|
3503
|
+
* is the same at every width. But a breakpoint column that shows no sort control must
|
|
3504
|
+
* not sort when clicked either, hence the `sortIndicated` gate.
|
|
3505
|
+
*
|
|
3506
|
+
* @param column
|
|
3507
|
+
*/
|
|
3508
|
+
sortBy(column) {
|
|
3509
|
+
if (column.sortIndicated) {
|
|
3510
|
+
this.sorting.sortBy(column.sortSource);
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3082
3513
|
/**
|
|
3083
3514
|
* Track By for improve change detection
|
|
3084
3515
|
*
|
|
@@ -3103,6 +3534,7 @@ class FsHeadComponent {
|
|
|
3103
3534
|
*/
|
|
3104
3535
|
_initSelection() {
|
|
3105
3536
|
if (this.selection) {
|
|
3537
|
+
this.selectedAll = this.selection.selectedAllVisible;
|
|
3106
3538
|
this.selection.selectionChange$
|
|
3107
3539
|
.pipe(filter(({ type }) => (type === SelectionChangeType.AllVisibleSelectionChange
|
|
3108
3540
|
|| type === SelectionChangeType.SelectedAll
|
|
@@ -3114,7 +3546,7 @@ class FsHeadComponent {
|
|
|
3114
3546
|
}
|
|
3115
3547
|
}
|
|
3116
3548
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsHeadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3117
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsHeadComponent, isStandalone: true, selector: "[fs-list-head]", inputs: { sorting: "sorting", columns: "columns", hasRowActions: "hasRowActions", selection: "selection", activeFiltersCount: "activeFiltersCount", reorderEnabled: "reorderEnabled", reorderPosition: "reorderPosition", reorderStrategy: "reorderStrategy" }, viewQueries: [{ propertyName: "rowsContainer", first: true, predicate: ["rowsContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<tr class=\"fs-list-row\">\n <!-- Drag -->\n @if (leftDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Selection -->\n @if (selection && !(selection.disabled$ | async)) {\n <th class=\"fs-list-col fs-list-col-selection\">\n <mat-checkbox\n (change)=\"selectAll($event)\"\n [checked]=\"selectedAll\">\n </mat-checkbox>\n </th>\n }\n <!-- Content -->\n @for (column of columns; track
|
|
3549
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsHeadComponent, isStandalone: true, selector: "[fs-list-head]", inputs: { sorting: "sorting", columns: "columns", hasRowActions: "hasRowActions", selection: "selection", activeFiltersCount: "activeFiltersCount", reorderEnabled: "reorderEnabled", reorderPosition: "reorderPosition", reorderStrategy: "reorderStrategy" }, viewQueries: [{ propertyName: "rowsContainer", first: true, predicate: ["rowsContainer"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<tr class=\"fs-list-row\">\n <!-- Drag -->\n @if (leftDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Selection -->\n @if (selection && !(selection.disabled$ | async)) {\n <th class=\"fs-list-col fs-list-col-selection\">\n <mat-checkbox\n (change)=\"selectAll($event)\"\n [checked]=\"selectedAll\">\n </mat-checkbox>\n </th>\n }\n <!-- Content -->\n @for (column of columns; track column.uid) {\n <th\n fs-head-cell\n (click)=\"$event.stopPropagation(); sortBy(column)\"\n [column]=\"column\"\n [class.sorting]=\"column.sortIndicated && column.sortSource.sortable\"\n [ngClass]=\"column.headerConfigs.classesArray\"\n [attr.colspan]=\"column.headerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </th>\n }\n <!-- Drag -->\n @if (rightDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Row Actions -->\n @if (hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategyEnum.Manual)) {\n <th class=\"fs-list-col actions-col\"></th>\n }\n</tr>", styles: ["th.fs-list-col-selection{width:1%!important;text-align:left}th.sorting{cursor:pointer}th.sorting:hover{background-color:#f6f6f6}th.sorting{background-image:none}th.left{text-align:left}th.center{text-align:center}th.right{text-align:right}\n"], dependencies: [{ 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: "component", type: FsHeadCellComponent, selector: "[fs-head-cell]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3118
3550
|
}
|
|
3119
3551
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsHeadComponent, decorators: [{
|
|
3120
3552
|
type: Component,
|
|
@@ -3123,7 +3555,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
3123
3555
|
FsHeadCellComponent,
|
|
3124
3556
|
NgClass,
|
|
3125
3557
|
AsyncPipe,
|
|
3126
|
-
], template: "<tr class=\"fs-list-row\">\n <!-- Drag -->\n @if (leftDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Selection -->\n @if (selection && !(selection.disabled$ | async)) {\n <th class=\"fs-list-col fs-list-col-selection\">\n <mat-checkbox\n (change)=\"selectAll($event)\"\n [checked]=\"selectedAll\">\n </mat-checkbox>\n </th>\n }\n <!-- Content -->\n @for (column of columns; track
|
|
3558
|
+
], template: "<tr class=\"fs-list-row\">\n <!-- Drag -->\n @if (leftDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Selection -->\n @if (selection && !(selection.disabled$ | async)) {\n <th class=\"fs-list-col fs-list-col-selection\">\n <mat-checkbox\n (change)=\"selectAll($event)\"\n [checked]=\"selectedAll\">\n </mat-checkbox>\n </th>\n }\n <!-- Content -->\n @for (column of columns; track column.uid) {\n <th\n fs-head-cell\n (click)=\"$event.stopPropagation(); sortBy(column)\"\n [column]=\"column\"\n [class.sorting]=\"column.sortIndicated && column.sortSource.sortable\"\n [ngClass]=\"column.headerConfigs.classesArray\"\n [attr.colspan]=\"column.headerConfigs.colspan\"\n [attr.width]=\"column.width\">\n </th>\n }\n <!-- Drag -->\n @if (rightDragDropEnabled) {\n <th class=\"fs-list-col drag-col\"></th>\n }\n <!-- Row Actions -->\n @if (hasRowActions && !(reorderEnabled && reorderStrategy === ReorderStrategyEnum.Manual)) {\n <th class=\"fs-list-col actions-col\"></th>\n }\n</tr>", styles: ["th.fs-list-col-selection{width:1%!important;text-align:left}th.sorting{cursor:pointer}th.sorting:hover{background-color:#f6f6f6}th.sorting{background-image:none}th.left{text-align:left}th.center{text-align:center}th.right{text-align:right}\n"] }]
|
|
3127
3559
|
}], propDecorators: { sorting: [{
|
|
3128
3560
|
type: Input
|
|
3129
3561
|
}], columns: [{
|
|
@@ -3164,34 +3596,68 @@ var FsListState;
|
|
|
3164
3596
|
|
|
3165
3597
|
class ColumnsController {
|
|
3166
3598
|
_persistance;
|
|
3599
|
+
_breakpoints;
|
|
3167
3600
|
_visibleColumns$ = new BehaviorSubject([]);
|
|
3168
|
-
_visibleColumnsShared$ = this._visibleColumns$.
|
|
3169
|
-
|
|
3601
|
+
_visibleColumnsShared$ = this._visibleColumns$.asObservable();
|
|
3602
|
+
/**
|
|
3603
|
+
* The columns the three bands actually render -- the active set's visible columns.
|
|
3604
|
+
* Cached in a field, never a getter: AsyncPipe re-subscribes whenever the observable
|
|
3605
|
+
* identity changes, and `asObservable()` returns a new instance per call.
|
|
3606
|
+
*/
|
|
3607
|
+
_renderedColumns$ = new BehaviorSubject([]);
|
|
3608
|
+
_renderedColumnsShared$ = this._renderedColumns$.asObservable();
|
|
3609
|
+
_activeSet$ = new BehaviorSubject(null);
|
|
3610
|
+
_activeSetShared$ = this._activeSet$.asObservable();
|
|
3611
|
+
_sets = [];
|
|
3612
|
+
_base = new ColumnSet(null);
|
|
3613
|
+
_active = this._base;
|
|
3170
3614
|
_loadFn;
|
|
3171
3615
|
_changeFn;
|
|
3172
3616
|
_initFn;
|
|
3173
3617
|
_isConfigured = false;
|
|
3174
3618
|
_columnsFetched = false;
|
|
3175
|
-
_hasHeader = false;
|
|
3176
|
-
_hasFooter = false;
|
|
3177
|
-
_columns = [];
|
|
3178
3619
|
_defaultConfigs;
|
|
3620
|
+
_batching = false;
|
|
3179
3621
|
_columnsUpdated$ = new Subject();
|
|
3180
3622
|
_destroy$ = new Subject();
|
|
3181
|
-
constructor(_persistance) {
|
|
3623
|
+
constructor(_persistance, _breakpoints) {
|
|
3182
3624
|
this._persistance = _persistance;
|
|
3625
|
+
this._breakpoints = _breakpoints;
|
|
3183
3626
|
}
|
|
3627
|
+
/**
|
|
3628
|
+
* The base (desktop) set. Unchanged meaning: persistence, the customize dialog and the
|
|
3629
|
+
* `columns` fetch param all stay viewport-independent because they read this.
|
|
3630
|
+
*/
|
|
3184
3631
|
get columns() {
|
|
3185
|
-
return this.
|
|
3632
|
+
return this._base.columns.slice();
|
|
3186
3633
|
}
|
|
3187
3634
|
get visibleColumns() {
|
|
3188
|
-
return this.
|
|
3635
|
+
return this._base.rendered;
|
|
3189
3636
|
}
|
|
3190
3637
|
get visibleColumns$() {
|
|
3191
3638
|
return this._visibleColumnsShared$;
|
|
3192
3639
|
}
|
|
3640
|
+
/** The active set's visible columns -- what `<thead>`/`<tbody>`/`<tfoot>` iterate. */
|
|
3641
|
+
get renderedColumns() {
|
|
3642
|
+
return this._active.rendered;
|
|
3643
|
+
}
|
|
3644
|
+
get renderedColumns$() {
|
|
3645
|
+
return this._renderedColumnsShared$;
|
|
3646
|
+
}
|
|
3647
|
+
get activeSet() {
|
|
3648
|
+
return this._active;
|
|
3649
|
+
}
|
|
3650
|
+
get activeSet$() {
|
|
3651
|
+
return this._activeSetShared$;
|
|
3652
|
+
}
|
|
3653
|
+
/** The `maxWidth` of every declared breakpoint set, ascending. */
|
|
3654
|
+
get breakpoints() {
|
|
3655
|
+
return this._sets
|
|
3656
|
+
.filter((set) => !set.isBase)
|
|
3657
|
+
.map((set) => set.maxWidth);
|
|
3658
|
+
}
|
|
3193
3659
|
get columnsForDialog() {
|
|
3194
|
-
return this.
|
|
3660
|
+
return this._base.columns
|
|
3195
3661
|
.filter((column) => column.customizable && !!column.name)
|
|
3196
3662
|
.map((column) => {
|
|
3197
3663
|
return {
|
|
@@ -3206,13 +3672,14 @@ class ColumnsController {
|
|
|
3206
3672
|
return this._columnsFetched;
|
|
3207
3673
|
}
|
|
3208
3674
|
get hasHeader() {
|
|
3209
|
-
return this.
|
|
3675
|
+
return this._active.hasHeader;
|
|
3210
3676
|
}
|
|
3211
3677
|
get hasFooter() {
|
|
3212
|
-
return this.
|
|
3678
|
+
return this._active.hasFooter;
|
|
3213
3679
|
}
|
|
3680
|
+
/** Follows the active set: a breakpoint set that declares no headers is not `has-header`. */
|
|
3214
3681
|
get theadClass() {
|
|
3215
|
-
return this.
|
|
3682
|
+
return this._active?.hasHeader ? 'has-header' : '';
|
|
3216
3683
|
}
|
|
3217
3684
|
get configured() {
|
|
3218
3685
|
return this._isConfigured;
|
|
@@ -3246,26 +3713,36 @@ class ColumnsController {
|
|
|
3246
3713
|
}
|
|
3247
3714
|
/**
|
|
3248
3715
|
* Base initialization for columns
|
|
3249
|
-
*
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3716
|
+
*
|
|
3717
|
+
* @param templates base (desktop) column directives
|
|
3718
|
+
* @param breakpointDirectives `<fs-list-breakpoint>` directives, each declaring one set
|
|
3719
|
+
*/
|
|
3720
|
+
initializeColumns(templates, breakpointDirectives = []) {
|
|
3721
|
+
this._base = this._buildSet(new ColumnSet(null), templates);
|
|
3722
|
+
const breakpointSets = (breakpointDirectives || [])
|
|
3723
|
+
.filter((directive) => Number.isFinite(directive?.maxWidth))
|
|
3724
|
+
.map((directive) => {
|
|
3725
|
+
const set = new ColumnSet(directive.maxWidth);
|
|
3726
|
+
set.selection = directive.selection;
|
|
3727
|
+
set.rowActions = directive.rowActions;
|
|
3728
|
+
set.reorder = directive.reorder;
|
|
3729
|
+
return this._buildSet(set, directive.columnDirectives?.toArray() ?? []);
|
|
3730
|
+
})
|
|
3731
|
+
.sort((a, b) => a.maxWidth - b.maxWidth);
|
|
3732
|
+
this._sets = [...breakpointSets, this._base];
|
|
3733
|
+
this._sets.forEach((set, setIndex) => {
|
|
3734
|
+
set.columns.forEach((column, index) => {
|
|
3735
|
+
column.uid = `${setIndex}:${index}`;
|
|
3736
|
+
});
|
|
3737
|
+
set.resolve();
|
|
3262
3738
|
});
|
|
3263
|
-
|
|
3264
|
-
this.
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
this.
|
|
3268
|
-
this.
|
|
3739
|
+
// Tear down subscriptions from a previous initializeColumns before re-subscribing.
|
|
3740
|
+
this._columnsUpdated$.next(null);
|
|
3741
|
+
// Apply whatever breakpoint is already active before the first emission, so the
|
|
3742
|
+
// initial paint uses the right set rather than flashing the desktop columns.
|
|
3743
|
+
this._active = this._base;
|
|
3744
|
+
this._listenBreakpointChanges();
|
|
3745
|
+
this._applyActiveSet(this._breakpoints?.active ?? null);
|
|
3269
3746
|
this.updateVisibleColumns();
|
|
3270
3747
|
this._listenColumnVisibilityUpdates();
|
|
3271
3748
|
}
|
|
@@ -3278,7 +3755,7 @@ class ColumnsController {
|
|
|
3278
3755
|
this._columnsFetched = true;
|
|
3279
3756
|
this.updateVisibilityForCols(columns);
|
|
3280
3757
|
this.updateCustomizableForCols(columns);
|
|
3281
|
-
this._initFn(this.
|
|
3758
|
+
this._initFn(this._base.columns
|
|
3282
3759
|
.filter((column) => column.customizable && !!column.name)
|
|
3283
3760
|
.map((column) => {
|
|
3284
3761
|
return {
|
|
@@ -3292,45 +3769,120 @@ class ColumnsController {
|
|
|
3292
3769
|
* Set visible columns based on current columns show status
|
|
3293
3770
|
*/
|
|
3294
3771
|
updateVisibleColumns() {
|
|
3295
|
-
|
|
3772
|
+
if (this._batching) {
|
|
3773
|
+
return;
|
|
3774
|
+
}
|
|
3775
|
+
this._sets.forEach((set) => set.update());
|
|
3776
|
+
this._visibleColumns$.next(this._base.rendered);
|
|
3777
|
+
this._renderedColumns$.next(this._active.rendered);
|
|
3296
3778
|
}
|
|
3297
3779
|
/**
|
|
3298
|
-
*
|
|
3780
|
+
* Switch to the set registered for `maxWidth`, or the base set when null.
|
|
3781
|
+
*/
|
|
3782
|
+
setActiveBreakpoint(maxWidth) {
|
|
3783
|
+
if (this._applyActiveSet(maxWidth)) {
|
|
3784
|
+
this.updateVisibleColumns();
|
|
3785
|
+
}
|
|
3786
|
+
}
|
|
3787
|
+
/**
|
|
3788
|
+
* Update visibility based on passed config.
|
|
3789
|
+
*
|
|
3790
|
+
* Applies to every set that declares a column of that name, so hiding a column in the
|
|
3791
|
+
* customize dialog hides it at every width.
|
|
3792
|
+
*
|
|
3299
3793
|
* @param columnsConfig
|
|
3300
3794
|
*/
|
|
3301
3795
|
updateVisibilityForCols(columnsConfig) {
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
}
|
|
3308
|
-
}
|
|
3796
|
+
this._batching = true;
|
|
3797
|
+
try {
|
|
3798
|
+
columnsConfig.forEach((columnConfig) => {
|
|
3799
|
+
this._columnsNamed(columnConfig.name)
|
|
3800
|
+
.forEach((column) => column.updateVisibility(columnConfig.show ?? true));
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
finally {
|
|
3804
|
+
this._batching = false;
|
|
3805
|
+
}
|
|
3309
3806
|
this.updateVisibleColumns();
|
|
3310
3807
|
}
|
|
3311
3808
|
updateCustomizableForCols(columnsConfig) {
|
|
3312
3809
|
columnsConfig.forEach((columnConfig) => {
|
|
3313
|
-
|
|
3314
|
-
.
|
|
3315
|
-
if (col) {
|
|
3316
|
-
col.updateCustomizable(columnConfig.customizable ?? true);
|
|
3317
|
-
}
|
|
3810
|
+
this._columnsNamed(columnConfig.name)
|
|
3811
|
+
.forEach((column) => column.updateCustomizable(columnConfig.customizable ?? true));
|
|
3318
3812
|
});
|
|
3319
3813
|
}
|
|
3320
3814
|
destroy() {
|
|
3321
3815
|
this._destroy$.next(null);
|
|
3322
3816
|
this._destroy$.complete();
|
|
3323
3817
|
this._columnsUpdated$.complete();
|
|
3324
|
-
this.
|
|
3818
|
+
this._renderedColumns$.complete();
|
|
3819
|
+
this._activeSet$.complete();
|
|
3820
|
+
this._sets = undefined;
|
|
3821
|
+
this._base = undefined;
|
|
3822
|
+
this._active = undefined;
|
|
3325
3823
|
this._visibleColumns$ = undefined;
|
|
3326
3824
|
this._defaultConfigs = undefined;
|
|
3327
3825
|
this._loadFn = undefined;
|
|
3328
3826
|
this._changeFn = undefined;
|
|
3329
3827
|
this._initFn = undefined;
|
|
3330
3828
|
}
|
|
3829
|
+
_buildSet(set, templates) {
|
|
3830
|
+
(templates || []).forEach((template) => {
|
|
3831
|
+
const column = new Column(template, this._defaultConfigs);
|
|
3832
|
+
if (!set.isBase) {
|
|
3833
|
+
column.baseColumn = column.name
|
|
3834
|
+
? this._base.columns.find((base) => base.name === column.name) ?? null
|
|
3835
|
+
: null;
|
|
3836
|
+
if (isDevMode() && column.name && !column.baseColumn) {
|
|
3837
|
+
console.warn(`[fs-list-breakpoint] Column "${column.name}" has no column of that name in ` +
|
|
3838
|
+
'the base set, so it cannot inherit templates or sorting from one.');
|
|
3839
|
+
}
|
|
3840
|
+
column.inheritTemplatesFrom(column.baseColumn);
|
|
3841
|
+
}
|
|
3842
|
+
set.columns.push(column);
|
|
3843
|
+
});
|
|
3844
|
+
return set;
|
|
3845
|
+
}
|
|
3846
|
+
/** Every column of a given name, across every set. */
|
|
3847
|
+
_columnsNamed(name) {
|
|
3848
|
+
return this._sets
|
|
3849
|
+
.reduce((acc, set) => {
|
|
3850
|
+
const column = set.columns.find((item) => item.name === name);
|
|
3851
|
+
return column ? [...acc, column] : acc;
|
|
3852
|
+
}, []);
|
|
3853
|
+
}
|
|
3854
|
+
/**
|
|
3855
|
+
* @returns whether the active set actually changed
|
|
3856
|
+
*/
|
|
3857
|
+
_applyActiveSet(maxWidth) {
|
|
3858
|
+
let next = this._sets.find((set) => set.maxWidth === maxWidth) ?? this._base;
|
|
3859
|
+
next.update();
|
|
3860
|
+
// A set that renders nothing would produce an empty table. Fall back to base.
|
|
3861
|
+
if (!next.isBase && !next.rendered.length) {
|
|
3862
|
+
next = this._base;
|
|
3863
|
+
}
|
|
3864
|
+
if (next === this._active) {
|
|
3865
|
+
return false;
|
|
3866
|
+
}
|
|
3867
|
+
this._active = next;
|
|
3868
|
+
this._activeSet$.next(next);
|
|
3869
|
+
return true;
|
|
3870
|
+
}
|
|
3871
|
+
_listenBreakpointChanges() {
|
|
3872
|
+
if (!this._breakpoints) {
|
|
3873
|
+
return;
|
|
3874
|
+
}
|
|
3875
|
+
this._breakpoints.setBreakpoints(this.breakpoints);
|
|
3876
|
+
this._breakpoints.active$
|
|
3877
|
+
.pipe(skip(1), takeUntil(this._columnsUpdated$), takeUntil(this._destroy$))
|
|
3878
|
+
.subscribe((maxWidth) => {
|
|
3879
|
+
this.setActiveBreakpoint(maxWidth);
|
|
3880
|
+
});
|
|
3881
|
+
}
|
|
3331
3882
|
_listenColumnVisibilityUpdates() {
|
|
3332
|
-
this.
|
|
3333
|
-
|
|
3883
|
+
const columnsVisibility = this._sets
|
|
3884
|
+
.reduce((acc, set) => [...acc, ...set.columns], [])
|
|
3885
|
+
.map((column) => {
|
|
3334
3886
|
return column.visible$.pipe(skip(1));
|
|
3335
3887
|
});
|
|
3336
3888
|
merge(...columnsVisibility)
|
|
@@ -3339,22 +3891,6 @@ class ColumnsController {
|
|
|
3339
3891
|
this.updateVisibleColumns();
|
|
3340
3892
|
});
|
|
3341
3893
|
}
|
|
3342
|
-
_updateColspans(config, updateFlag) {
|
|
3343
|
-
this._columns.forEach((col, index) => {
|
|
3344
|
-
if (col[config].colspan !== undefined) {
|
|
3345
|
-
const spanTo = index + +col[config].colspan;
|
|
3346
|
-
if (!isNumber(spanTo)) {
|
|
3347
|
-
return;
|
|
3348
|
-
}
|
|
3349
|
-
this._columns[index][updateFlag] = false;
|
|
3350
|
-
for (let i = index + 1; i < spanTo; i++) {
|
|
3351
|
-
if (this._columns[i]) {
|
|
3352
|
-
this._columns[i][updateFlag] = true;
|
|
3353
|
-
}
|
|
3354
|
-
}
|
|
3355
|
-
}
|
|
3356
|
-
});
|
|
3357
|
-
}
|
|
3358
3894
|
}
|
|
3359
3895
|
|
|
3360
3896
|
class DataController {
|
|
@@ -4419,6 +4955,7 @@ class List {
|
|
|
4419
4955
|
_route;
|
|
4420
4956
|
_persistance;
|
|
4421
4957
|
_inDialog;
|
|
4958
|
+
_breakpoints;
|
|
4422
4959
|
heading;
|
|
4423
4960
|
trackBy;
|
|
4424
4961
|
subheading;
|
|
@@ -4472,14 +5009,15 @@ class List {
|
|
|
4472
5009
|
_groupCellConfig;
|
|
4473
5010
|
_cellConfig;
|
|
4474
5011
|
_footerConfig;
|
|
4475
|
-
constructor(_el, _config = {}, _selectionDialog, _route, _persistance, _inDialog) {
|
|
5012
|
+
constructor(_el, _config = {}, _selectionDialog, _route, _persistance, _inDialog, _breakpoints) {
|
|
4476
5013
|
this._el = _el;
|
|
4477
5014
|
this._config = _config;
|
|
4478
5015
|
this._selectionDialog = _selectionDialog;
|
|
4479
5016
|
this._route = _route;
|
|
4480
5017
|
this._persistance = _persistance;
|
|
4481
5018
|
this._inDialog = _inDialog;
|
|
4482
|
-
this.
|
|
5019
|
+
this._breakpoints = _breakpoints;
|
|
5020
|
+
this.columns = new ColumnsController(this._persistance, this._breakpoints);
|
|
4483
5021
|
this.actions = new ActionsController();
|
|
4484
5022
|
this.paging = new PaginationController();
|
|
4485
5023
|
this.dataController = new DataController();
|
|
@@ -4553,7 +5091,7 @@ class List {
|
|
|
4553
5091
|
*
|
|
4554
5092
|
* @param templates
|
|
4555
5093
|
*/
|
|
4556
|
-
tranformTemplatesToColumns(templates) {
|
|
5094
|
+
tranformTemplatesToColumns(templates, breakpointDirectives = []) {
|
|
4557
5095
|
const defaultConfigs = {
|
|
4558
5096
|
header: this._headerConfig,
|
|
4559
5097
|
groupCell: this._groupCellConfig,
|
|
@@ -4561,7 +5099,7 @@ class List {
|
|
|
4561
5099
|
footer: this._footerConfig,
|
|
4562
5100
|
};
|
|
4563
5101
|
this.columns.setDefaults(defaultConfigs);
|
|
4564
|
-
this.columns.initializeColumns(templates);
|
|
5102
|
+
this.columns.initializeColumns(templates, breakpointDirectives);
|
|
4565
5103
|
// Set sortBy default column
|
|
4566
5104
|
this._updateSortingColumns();
|
|
4567
5105
|
// Default sort by
|
|
@@ -5470,6 +6008,91 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5470
6008
|
args: ['class']
|
|
5471
6009
|
}] } });
|
|
5472
6010
|
|
|
6011
|
+
/**
|
|
6012
|
+
* Declares an alternate set of columns that replaces the desktop columns at `maxWidth`
|
|
6013
|
+
* and below.
|
|
6014
|
+
*
|
|
6015
|
+
* ```html
|
|
6016
|
+
* <fs-list-breakpoint [maxWidth]="1000">
|
|
6017
|
+
* <fs-list-column name="name">
|
|
6018
|
+
* <ng-template fs-list-header>Record</ng-template>
|
|
6019
|
+
* <ng-template fs-list-cell let-row="row">{{ row.name }}</ng-template>
|
|
6020
|
+
* </fs-list-column>
|
|
6021
|
+
* </fs-list-breakpoint>
|
|
6022
|
+
* ```
|
|
6023
|
+
*
|
|
6024
|
+
* Children are ordinary `<fs-list-column>` elements supporting every slot -- header, cell,
|
|
6025
|
+
* footer, group-header and group-footer. A column whose `name` matches one in the base set
|
|
6026
|
+
* inherits that column's templates for any slot it leaves undeclared, so a breakpoint set
|
|
6027
|
+
* only has to declare what differs.
|
|
6028
|
+
*
|
|
6029
|
+
* The header slot is the exception: it is never inherited. The header row is exactly what
|
|
6030
|
+
* the active set declares -- an `<ng-template fs-list-header>` or a `title` attribute on
|
|
6031
|
+
* that set's own columns -- so a set that declares neither renders an empty header row
|
|
6032
|
+
* (kept only for the select-all checkbox and the other structural cells).
|
|
6033
|
+
*
|
|
6034
|
+
* Several sets can be stacked; the narrowest matching one wins.
|
|
6035
|
+
*
|
|
6036
|
+
* This is a real element rather than an attribute so that its columns are excluded from
|
|
6037
|
+
* `FsListComponent`'s `@ContentChildren(FsListColumnDirective)` for free -- Angular's
|
|
6038
|
+
* `descendants: false` query walks up through `<ng-container>` but stops at an element.
|
|
6039
|
+
* It renders no DOM: `<fs-list>` only projects `[fs-list-content]`.
|
|
6040
|
+
*/
|
|
6041
|
+
class FsListBreakpointDirective {
|
|
6042
|
+
columnDirectives;
|
|
6043
|
+
_maxWidth = null;
|
|
6044
|
+
/** Upper bound in px, inclusive. Accepts `1000`, `'1000'` or `'1000px'`. */
|
|
6045
|
+
set maxWidth(value) {
|
|
6046
|
+
const parsed = typeof value === 'number'
|
|
6047
|
+
? value
|
|
6048
|
+
: Number.parseInt(value, 10);
|
|
6049
|
+
this._maxWidth = Number.isFinite(parsed) ? parsed : null;
|
|
6050
|
+
if (isDevMode() && this._maxWidth === null) {
|
|
6051
|
+
console.warn(`[fs-list-breakpoint] Ignoring invalid maxWidth "${value}". ` +
|
|
6052
|
+
'Expected a pixel value, e.g. [maxWidth]="1000".');
|
|
6053
|
+
}
|
|
6054
|
+
}
|
|
6055
|
+
get maxWidth() {
|
|
6056
|
+
return this._maxWidth;
|
|
6057
|
+
}
|
|
6058
|
+
/**
|
|
6059
|
+
* Suppress the selection checkbox cell while this set is active.
|
|
6060
|
+
* Leave unset to inherit the list's selection config.
|
|
6061
|
+
*/
|
|
6062
|
+
selection = null;
|
|
6063
|
+
/**
|
|
6064
|
+
* Suppress the row-actions cell while this set is active.
|
|
6065
|
+
* Leave unset to inherit the list's row actions.
|
|
6066
|
+
*/
|
|
6067
|
+
rowActions = null;
|
|
6068
|
+
/**
|
|
6069
|
+
* Suppress the drag handle cell while this set is active. Dragging a row is an awkward
|
|
6070
|
+
* gesture on a narrow touch device, so `[reorder]="false"` is the common case here.
|
|
6071
|
+
* Leave unset to inherit the list's reorder config.
|
|
6072
|
+
*/
|
|
6073
|
+
reorder = null;
|
|
6074
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListBreakpointDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
6075
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.7", type: FsListBreakpointDirective, isStandalone: true, selector: "fs-list-breakpoint", inputs: { maxWidth: "maxWidth", selection: "selection", rowActions: "rowActions", reorder: "reorder" }, queries: [{ propertyName: "columnDirectives", predicate: FsListColumnDirective }], ngImport: i0 });
|
|
6076
|
+
}
|
|
6077
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListBreakpointDirective, decorators: [{
|
|
6078
|
+
type: Directive,
|
|
6079
|
+
args: [{
|
|
6080
|
+
selector: 'fs-list-breakpoint',
|
|
6081
|
+
standalone: true,
|
|
6082
|
+
}]
|
|
6083
|
+
}], propDecorators: { columnDirectives: [{
|
|
6084
|
+
type: ContentChildren,
|
|
6085
|
+
args: [FsListColumnDirective]
|
|
6086
|
+
}], maxWidth: [{
|
|
6087
|
+
type: Input
|
|
6088
|
+
}], selection: [{
|
|
6089
|
+
type: Input
|
|
6090
|
+
}], rowActions: [{
|
|
6091
|
+
type: Input
|
|
6092
|
+
}], reorder: [{
|
|
6093
|
+
type: Input
|
|
6094
|
+
}] } });
|
|
6095
|
+
|
|
5473
6096
|
class FsListContentInitDirective {
|
|
5474
6097
|
contentInitCallback;
|
|
5475
6098
|
constructor() { }
|
|
@@ -5558,7 +6181,7 @@ class FsPaginationComponent {
|
|
|
5558
6181
|
this.pagination.goLast();
|
|
5559
6182
|
}
|
|
5560
6183
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPaginationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5561
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsPaginationComponent, isStandalone: true, selector: "fs-list-pagination", inputs: { pagination: "pagination", rows: "rows" }, ngImport: i0, template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n
|
|
6184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.7", type: FsPaginationComponent, isStandalone: true, selector: "fs-list-pagination", inputs: { pagination: "pagination", rows: "rows" }, ngImport: i0, template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-stroked-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"next()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n }\n</ng-template>\n<ng-template #strategyOffsetPage>\n @if (pagination.records > pagination.limit) {\n @if (pagination?.pages) {\n }\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n }\n</ng-template>\n<ng-template #strategyMany>\n @if (!(pagination.pageRecords ===0 && pagination.page === 1)) {\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: true }\">\n </ng-container>\n }\n</ng-template>\n<ng-template\n #firstPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"disabled\"\n (click)=\"first()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #prevPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"disabled\"\n (click)=\"prev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #nextPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"disabled\"\n (click)=\"next()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #lastPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"disabled\"\n (click)=\"last()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n</ng-template>", styles: [".pagination-container{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: FsCommonModule }, { kind: "pipe", type: i1$2.FsFormatNumberPipe, name: "fsFormatNumber" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5562
6185
|
}
|
|
5563
6186
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsPaginationComponent, decorators: [{
|
|
5564
6187
|
type: Component,
|
|
@@ -5568,7 +6191,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
5568
6191
|
MatRipple,
|
|
5569
6192
|
MatIcon,
|
|
5570
6193
|
FsCommonModule
|
|
5571
|
-
], template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n
|
|
6194
|
+
], template: "<div class=\"pagination-container\">\n @if (pagination.hasManyStrategy) {\n <ng-container *ngTemplateOutlet=\"strategyMany\"></ng-container>\n } @else if (pagination.loadMoreEnabled) {\n <ng-container *ngTemplateOutlet=\"strategyLoadMore\"></ng-container>\n } @else {\n <ng-container *ngTemplateOutlet=\"strategyOffsetPage\"></ng-container>\n }\n</div>\n<ng-template #strategyLoadMore>\n @if (pagination.hasNextPage) {\n <div class=\"fs-list-load-more\">\n <button\n mat-stroked-button\n type=\"button\"\n [class]=\"pagination.loadMoreButtonClass\"\n [color]=\"pagination.loadMoreButtonColor\"\n (click)=\"next()\">\n {{ pagination.loadMoreLabel }}\n </button>\n </div>\n }\n</ng-template>\n<ng-template #strategyOffsetPage>\n @if (pagination.records > pagination.limit) {\n @if (pagination?.pages) {\n }\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page | fsFormatNumber }} of {{ pagination.pages | fsFormatNumber }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n }\n</ng-template>\n<ng-template #strategyMany>\n @if (!(pagination.pageRecords ===0 && pagination.page === 1)) {\n <ng-container\n [ngTemplateOutlet]=\"firstPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"prevPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasPrevPage }\">\n </ng-container>\n <div class=\"number\">\n {{ pagination.page }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"nextPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: !pagination.hasNextPage }\">\n </ng-container>\n <ng-container\n [ngTemplateOutlet]=\"lastPageButton\"\n [ngTemplateOutletContext]=\"{ disabled: true }\">\n </ng-container>\n }\n</ng-template>\n<ng-template\n #firstPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"first\"\n [class.disabled]=\"disabled\"\n (click)=\"first()\">\n <mat-icon>\n first_page\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #prevPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"previous\"\n [class.disabled]=\"disabled\"\n (click)=\"prev()\">\n <mat-icon>\n keyboard_arrow_left\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #nextPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"next\"\n [class.disabled]=\"disabled\"\n (click)=\"next()\">\n <mat-icon>\n keyboard_arrow_right\n </mat-icon>\n </a>\n</ng-template>\n<ng-template\n #lastPageButton\n let-disabled=\"disabled\">\n <a\n matRipple\n [matRippleRadius]=\"15\"\n [matRippleCentered]=\"true\"\n class=\"last\"\n [class.disabled]=\"disabled\"\n (click)=\"last()\">\n <mat-icon>\n last_page\n </mat-icon>\n </a>\n</ng-template>", styles: [".pagination-container{display:flex;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;width:100%}a{text-align:center;color:#000000de;text-decoration:none;font-size:15px;cursor:pointer;display:flex}a:not(.page){padding:10px}a.disabled{pointer-events:none;cursor:default;color:#d8d8d8}.number{font-size:90%}.fs-list-load-more button{width:100%;margin-top:10px}\n"] }]
|
|
5572
6195
|
}], propDecorators: { pagination: [{
|
|
5573
6196
|
type: Input
|
|
5574
6197
|
}], rows: [{
|
|
@@ -5701,7 +6324,7 @@ class FsListComponent {
|
|
|
5701
6324
|
// Event will fired if action remove: true will clicked
|
|
5702
6325
|
rowRemoved = new EventEmitter();
|
|
5703
6326
|
firstLoad = true;
|
|
5704
|
-
|
|
6327
|
+
_contentInitialized = false;
|
|
5705
6328
|
/** Merged list config (after defaults); used to populate cell `configTyping` when cells omit it. */
|
|
5706
6329
|
_mergedListConfig;
|
|
5707
6330
|
_filterRef;
|
|
@@ -5716,22 +6339,24 @@ class FsListComponent {
|
|
|
5716
6339
|
_groupExpandNotifier = inject(GroupExpandNotifierService);
|
|
5717
6340
|
_route = inject(ActivatedRoute);
|
|
5718
6341
|
_persistance = inject(PersistanceController);
|
|
6342
|
+
_breakpoints = inject(BreakpointController);
|
|
5719
6343
|
set filterReference(component) {
|
|
5720
6344
|
this._filterRef = component;
|
|
5721
6345
|
this.list.actions.setFilterRef(component);
|
|
5722
6346
|
this._emitFiltersReadyEvent();
|
|
5723
6347
|
}
|
|
5724
6348
|
/**
|
|
5725
|
-
*
|
|
5726
|
-
*
|
|
6349
|
+
* Base (desktop) columns. Columns declared inside `<fs-list-breakpoint>` are excluded
|
|
6350
|
+
* automatically: this query is `descendants: false`, and Angular only walks up through
|
|
6351
|
+
* `<ng-container>` nodes, so a real `<fs-list-breakpoint>` element blocks it.
|
|
6352
|
+
*
|
|
6353
|
+
* Consumed from `_rebuildColumns()`, never from a setter -- `refreshContentQueries`
|
|
6354
|
+
* populates queries in directive-creation order, so `<fs-list>`'s query resolves before
|
|
6355
|
+
* `<fs-list-breakpoint>`'s and the breakpoint sets would still be undefined here.
|
|
5727
6356
|
*/
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
this.list.tranformTemplatesToColumns(listColumnDirectives);
|
|
5732
|
-
}
|
|
5733
|
-
this._propagateCellRowTypeAnchors();
|
|
5734
|
-
}
|
|
6357
|
+
columnTemplates;
|
|
6358
|
+
/** Alternate column sets, each active at its own `maxWidth` and below. */
|
|
6359
|
+
breakpointDirectives;
|
|
5735
6360
|
set _emptyStateTemplate(template) {
|
|
5736
6361
|
if (this.list) {
|
|
5737
6362
|
this.list.emptyStateTemplate = template;
|
|
@@ -5771,10 +6396,30 @@ class FsListComponent {
|
|
|
5771
6396
|
return this.list.paging.state;
|
|
5772
6397
|
}
|
|
5773
6398
|
ngAfterContentInit() {
|
|
6399
|
+
this._contentInitialized = true;
|
|
6400
|
+
this._rebuildColumns();
|
|
6401
|
+
this.columnTemplates.changes
|
|
6402
|
+
.pipe(takeUntil(this._destroy))
|
|
6403
|
+
.subscribe(() => this._rebuildColumns());
|
|
6404
|
+
this.breakpointDirectives.changes
|
|
6405
|
+
.pipe(takeUntil(this._destroy))
|
|
6406
|
+
.subscribe(() => this._rebuildColumns());
|
|
5774
6407
|
if (this.list.afterInit) {
|
|
5775
6408
|
this.list.afterInit(this);
|
|
5776
6409
|
}
|
|
5777
6410
|
}
|
|
6411
|
+
/**
|
|
6412
|
+
* Build every column set from the content queries. Safe to call repeatedly; the only
|
|
6413
|
+
* entry point that touches columns.
|
|
6414
|
+
*/
|
|
6415
|
+
_rebuildColumns() {
|
|
6416
|
+
if (!this.list || !this._contentInitialized || !this.columnTemplates) {
|
|
6417
|
+
return;
|
|
6418
|
+
}
|
|
6419
|
+
this.list.tranformTemplatesToColumns(this.columnTemplates, this.breakpointDirectives?.toArray() ?? []);
|
|
6420
|
+
this._propagateCellRowTypeAnchors();
|
|
6421
|
+
this._cdRef.markForCheck();
|
|
6422
|
+
}
|
|
5778
6423
|
ngOnInit() {
|
|
5779
6424
|
this._subscribeToRemoveRow();
|
|
5780
6425
|
this._subscribeToGroupExpandStatusChange();
|
|
@@ -5865,6 +6510,49 @@ class FsListComponent {
|
|
|
5865
6510
|
get visibleColumns$() {
|
|
5866
6511
|
return this.list.columns.visibleColumns$;
|
|
5867
6512
|
}
|
|
6513
|
+
/**
|
|
6514
|
+
* The columns actually being rendered -- the active breakpoint set's visible columns.
|
|
6515
|
+
* Equal to {@link visibleColumns$} when no `<fs-list-breakpoint>` is declared.
|
|
6516
|
+
*/
|
|
6517
|
+
get renderedColumns$() {
|
|
6518
|
+
return this.list.columns.renderedColumns$;
|
|
6519
|
+
}
|
|
6520
|
+
/** `maxWidth` of the active breakpoint set, or null when the base set is active. */
|
|
6521
|
+
get activeBreakpoint() {
|
|
6522
|
+
return this.list.columns.activeSet?.maxWidth ?? null;
|
|
6523
|
+
}
|
|
6524
|
+
/**
|
|
6525
|
+
* Structural cells (selection checkbox, row actions, drag handle) render outside the
|
|
6526
|
+
* column loop and must agree across `<thead>`, `<tbody>` and `<tfoot>`, so the active
|
|
6527
|
+
* set's overrides are resolved here once and bound to all three bands.
|
|
6528
|
+
*/
|
|
6529
|
+
get selectionEnabled() {
|
|
6530
|
+
return this.list.columns.activeSet?.selection === false
|
|
6531
|
+
? null
|
|
6532
|
+
: this.list.selection;
|
|
6533
|
+
}
|
|
6534
|
+
get rowActionsEnabled() {
|
|
6535
|
+
return this.list.columns.activeSet?.rowActions === false
|
|
6536
|
+
? false
|
|
6537
|
+
: this.list.hasRowActions;
|
|
6538
|
+
}
|
|
6539
|
+
reorderEnabledFor(enabled) {
|
|
6540
|
+
return this.list.columns.activeSet?.reorder === false
|
|
6541
|
+
? false
|
|
6542
|
+
: !!enabled;
|
|
6543
|
+
}
|
|
6544
|
+
/**
|
|
6545
|
+
* The head band follows the active set's declared headers and nothing else: a set whose
|
|
6546
|
+
* columns declare no header template and no title renders no `<thead>` at all, matching
|
|
6547
|
+
* how `<tfoot>` follows `hasFooter`. An empty header row is worse than none -- it draws a
|
|
6548
|
+
* rule and reserves height for labels that do not exist.
|
|
6549
|
+
*
|
|
6550
|
+
* Structural cells do not keep the band alive. The select-all checkbox lives in the head,
|
|
6551
|
+
* so it goes with it; a set that wants select-all has to declare at least one header.
|
|
6552
|
+
*/
|
|
6553
|
+
get showHead() {
|
|
6554
|
+
return this.list.columns.hasHeader;
|
|
6555
|
+
}
|
|
5868
6556
|
_emitFiltersReadyEvent() {
|
|
5869
6557
|
if (!!this.filterRef && this._filterParamsReady) {
|
|
5870
6558
|
this.filtersReady.emit();
|
|
@@ -5902,15 +6590,29 @@ class FsListComponent {
|
|
|
5902
6590
|
this._restorePersistance(listConfig.persist);
|
|
5903
6591
|
}
|
|
5904
6592
|
this._updateCustomizeAction(listConfig.actions);
|
|
5905
|
-
|
|
6593
|
+
// Before the List is built: initializeColumns reads the already-active breakpoint so
|
|
6594
|
+
// the first paint uses the right set instead of flashing the desktop columns.
|
|
6595
|
+
this._breakpoints.initConfig(listConfig.breakpoints);
|
|
6596
|
+
this._breakpoints.observe(this._el.nativeElement);
|
|
6597
|
+
this.list = new List(this._el, listConfig, this._selectionDialog, this._route, this._persistance, this.inDialog, this._breakpoints);
|
|
5906
6598
|
this.rowHoverHighlight = this.list.rowHoverHighlight;
|
|
5907
6599
|
this._waitFirstLoad();
|
|
5908
6600
|
this.reorderController.initWithConfig(config.reorder, this.list.dataController, this.list.actions, this.list.selection);
|
|
5909
|
-
|
|
5910
|
-
this.list.tranformTemplatesToColumns(this._listColumnDirectives);
|
|
5911
|
-
}
|
|
6601
|
+
this._rebuildColumns();
|
|
5912
6602
|
this._listenSortingChange();
|
|
5913
6603
|
this._propagateCellRowTypeAnchors();
|
|
6604
|
+
this._listenBreakpointChange();
|
|
6605
|
+
}
|
|
6606
|
+
/**
|
|
6607
|
+
* The active set changes which structural cells render and whether `<thead>` has content,
|
|
6608
|
+
* and this component is OnPush, so a swap has to mark it.
|
|
6609
|
+
*/
|
|
6610
|
+
_listenBreakpointChange() {
|
|
6611
|
+
this.list.columns.activeSet$
|
|
6612
|
+
.pipe(takeUntil(this.list.destroy$), takeUntil(this._destroy))
|
|
6613
|
+
.subscribe(() => {
|
|
6614
|
+
this._cdRef.markForCheck();
|
|
6615
|
+
});
|
|
5914
6616
|
}
|
|
5915
6617
|
/**
|
|
5916
6618
|
* Find action with customize flag and re-declare click function for CustomizeColsDialog
|
|
@@ -5991,14 +6693,20 @@ class FsListComponent {
|
|
|
5991
6693
|
this._persistance.init(persistConfig, this.inDialog);
|
|
5992
6694
|
}
|
|
5993
6695
|
_propagateCellRowTypeAnchors() {
|
|
5994
|
-
if (!this.
|
|
6696
|
+
if (!this.columnTemplates || !this._mergedListConfig) {
|
|
5995
6697
|
return;
|
|
5996
6698
|
}
|
|
5997
6699
|
const anchor = this.cellRowType;
|
|
5998
|
-
|
|
6700
|
+
const applyTo = (col) => {
|
|
5999
6701
|
this._maybeApplyCellTyping(col.cellConfigs, anchor, this._mergedListConfig);
|
|
6000
6702
|
this._maybeApplyCellTyping(col.groupHeaderConfigs, anchor, this._mergedListConfig);
|
|
6001
6703
|
this._maybeApplyCellTyping(col.groupFooterConfigs, anchor, this._mergedListConfig);
|
|
6704
|
+
};
|
|
6705
|
+
this.columnTemplates.forEach(applyTo);
|
|
6706
|
+
// Breakpoint columns are a separate query, so they need the same anchor or their
|
|
6707
|
+
// cell templates lose `let-row` typing under strictTemplates.
|
|
6708
|
+
this.breakpointDirectives?.forEach((breakpoint) => {
|
|
6709
|
+
breakpoint.columnDirectives?.forEach(applyTo);
|
|
6002
6710
|
});
|
|
6003
6711
|
}
|
|
6004
6712
|
_maybeApplyCellTyping(dir, anchor, listConfig) {
|
|
@@ -6020,7 +6728,8 @@ class FsListComponent {
|
|
|
6020
6728
|
GroupExpandNotifierService,
|
|
6021
6729
|
PersistanceController,
|
|
6022
6730
|
ReorderController,
|
|
6023
|
-
], queries: [{ propertyName: "headingTemplate", first: true, predicate: FsListHeadingDirective, descendants: true, read: TemplateRef }, { propertyName: "_emptyStateTemplate", first: true, predicate: FsListEmptyStateDirective, descendants: true, read: TemplateRef }, { propertyName: "columnTemplates", predicate: FsListColumnDirective }], viewQueries: [{ propertyName: "body", first: true, predicate: FsBodyComponent, descendants: true }, { propertyName: "filterReference", first: true, predicate: FilterComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"fs-list-container\"\n [ngClass]=\"{\n 'has-filters': list.filterConfig?.items.length,\n 'has-status': hasStatus,\n 'has-chips': list.chips,\n 'has-actions': list.actions.hasActions,\n 'has-row-actions-hover': list.rowActionsHover,\n 'first-load': firstLoad,\n 'loading': list.loading$ | async\n }\">\n <ng-template [ngTemplateOutlet]=\"listContainerContent\"></ng-template>\n</div>\n<ng-template #listContainerContent>\n @if (list.dataController.visibleRows$ | async; as listData) {\n <div class=\"fs-list-header-container\">\n <div\n class=\"fs-list-header\"\n [ngClass]=\"{ 'no-wrap': reorderController.manualReorderActivated || !list.filterConfig?.items.length }\">\n @if (list.filterConfig) {\n <fs-filter\n class=\"fs-list-filter\"\n [config]=\"list.filterConfig\">\n @if (hasStatus) {\n <ng-template fsFilterStatusBar>\n <fs-list-status\n class=\"fs-list-status\"\n [ngClass]=\"{ 'hidden-mobile': !list.status }\"\n [rows]=\"listData\"\n [list]=\"list\"\n [firstLoad]=\"firstLoad\">\n </fs-list-status>\n </ng-template>\n }\n @if (headingTemplate) {\n <ng-template fsFilterHeading>\n <ng-template [ngTemplateOutlet]=\"headingTemplate\"></ng-template>\n </ng-template>\n }\n </fs-filter>\n }\n </div>\n </div>\n <ng-content select=\"[fs-list-content]\"></ng-content>\n <!-- Table implementation -->\n <div class=\"fs-list-table-container\">\n @if (!firstLoad && listData.length > 0 && !list.emptyStateEnabled) {\n <table\n class=\"fs-list-table\"\n role=\"grid\"\n [fsListContentInit]=\"list.afterContentInit\"\n [ngClass]=\"{\n 'style-card': list.style === 'card',\n 'style-basic': list.style === 'basic',\n 'style-line': (list.style || 'line') === 'line'\n }\">\n @if (list.columns.hasHeader) {\n <thead\n fs-list-head\n class=\"fs-list-head\"\n role=\"rowgroup\"\n [ngClass]=\"list.columns.theadClass\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [sorting]=\"list.sorting\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </thead>\n }\n <tbody\n fs-list-body\n fsListDraggableList\n class=\"fs-list-body\"\n role=\"rowgroup\"\n [class.disabled]=\"!!(reorderController.reorderDisabled$ | async)\"\n [rows]=\"listData\"\n [rowActionsRaw]=\"list.rowActionsRaw\"\n [groupActionsRaw]=\"list.groupActionsRaw\"\n [hasRowActions]=\"list.hasRowActions\"\n [rowEvents]=\"list.rowEvents\"\n [rowClass]=\"list.rowClass\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [restoreMode]=\"list.restoreMode\"\n [selection]=\"list.selection\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\"\n [reorderMultiple]=\"reorderController.multiple\">\n </tbody>\n @if (list.columns.hasFooter) {\n <tfoot\n fs-list-footer\n class=\"fs-list-footer\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </tfoot>\n }\n </table>\n }\n @if (firstLoad) {\n <fs-list-loader\n [columns]=\"list.columns.columns\"\n [loaderLines]=\"loaderLines\">\n </fs-list-loader>\n }\n </div>\n <fs-list-pagination\n class=\"fs-list-pagination\"\n [rows]=\"listData\"\n [pagination]=\"list.paging\">\n </fs-list-pagination>\n @if (!firstLoad) {\n @if (listData.length === 0) {\n <div\n class=\"fs-list-no-results-container\">\n @if (list.noResults?.message && !list.emptyStateEnabled) {\n <div\n class=\"fs-list-no-results\">\n {{ list.noResults?.message }}\n </div>\n }\n @if (list.emptyStateEnabled) {\n <ng-template [ngTemplateOutlet]=\"list.emptyStateTemplate\"></ng-template>\n }\n </div>\n }\n }\n }\n</ng-template>", styles: ["::ng-deep .fs-list-table{border-spacing:0;display:table;width:100%;border-collapse:collapse}::ng-deep .fs-list-table thead{display:table-header-group}::ng-deep .fs-list-table thead th{color:#999;padding:8px;font-weight:400;color:#8f8f8f;font-size:85%;text-align:left}::ng-deep .fs-list-table tbody{display:table-row-group;position:relative}::ng-deep .fs-list-table tbody tr,::ng-deep .fs-list-table thead tr,::ng-deep .fs-list-table tfoot tr{display:table-row}::ng-deep .fs-list-table tbody tr td,::ng-deep .fs-list-table thead tr td,::ng-deep .fs-list-table tfoot tr td{display:table-cell;padding:8px;vertical-align:middle;outline:none;text-align:left}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group){clip-path:xywh(0 3px 100% calc(100% - 6px) round 10px)}::ng-deep .fs-list-table.style-card tbody tr td{border:none!important;background-color:#fafafa;padding:8px 16px}::ng-deep .fs-list-table.style-line tbody td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody td{box-sizing:border-box;border-top:1px solid #e7e7e7}::ng-deep .fs-list-table.style-line tbody tr:first-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:first-child td{border-color:#c4c4c4}::ng-deep .fs-list-table.style-line tbody tr:last-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:last-child td{border-bottom:1px solid #c4c4c4}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging thead th,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging thead th{border-color:#e7e7e7}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging tbody tr:nth-child(2) td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging tbody tr:nth-child(2) td{border-top:none}:host{display:block;width:100%}:host ::ng-deep .fs-list-swap-restricted{opacity:.5}:host ::ng-deep .fs-list-no-drop{cursor:no-drop}:host ::ng-deep .hidden{display:none}:host ::ng-deep .multiple-selection{background-color:#2196f380}:host ::ng-deep .multiple-selection ::ng-deep .fs-list-col{background-color:#2196f380}@media print{:host ::ng-deep .fs-list-row-group{page-break-after:avoid}:host ::ng-deep .fs-list-row-group-child{page-break-before:avoid}:host ::ng-deep .fs-list-row-group-footer{page-break-before:avoid}}.fs-list-container{width:100%}.fs-list-container.has-filters .heading-container{margin-bottom:4px}.fs-list-container.loading .fs-list-status,.fs-list-container.loading .fs-list-body,.fs-list-container.loading .fs-list-head,.fs-list-container.loading .fs-list-footer,.fs-list-container.loading fs-list-pagination,.fs-list-container.loading ::ng-deep fs-filter-chips,.fs-list-container.loading .fs-list-no-results-container,.fs-list-container.first-load .fs-list-status,.fs-list-container.first-load .fs-list-body,.fs-list-container.first-load .fs-list-head,.fs-list-container.first-load .fs-list-footer,.fs-list-container.first-load fs-list-pagination,.fs-list-container.first-load ::ng-deep fs-filter-chips,.fs-list-container.first-load .fs-list-no-results-container{opacity:.4;pointer-events:none}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip{color:transparent}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip .remove{visibility:hidden}.fs-list-container.has-actions .fs-list-actions{margin-left:5px}@media screen and (min-width: 800px){.fs-list-container.has-row-actions-hover ::ng-deep .actions-col{width:0px;position:relative;overflow:visible;padding:0}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions{display:none;position:absolute;border-radius:5px;top:50%;right:5px;transform:translateY(-50%)}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions .mat-mdc-button-base{background:#fefefe;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.fs-list-container.has-row-actions-hover ::ng-deep tr:hover fs-list-row-actions{display:flex}}.fs-list-container .fs-list-header .heading-container{display:flex;flex-direction:column;justify-content:center}.fs-list-container .fs-list-header .heading{margin:0}.fs-list-container .fs-list-header h2+.subheading{margin:2px 0 0}.fs-list-container .fs-list-filter{margin-bottom:0;position:initial!important;display:block;width:100%}.fs-list-container .fs-list-no-results-container .fs-list-no-results{text-align:center;color:#999;padding:10px 0}.fs-list-container .fs-list-table-container{width:100%;overflow-x:auto;overflow-y:hidden;margin-top:7px}::ng-deep .fs-list-preview-block{position:fixed;height:30px;width:200px;background:gray;display:flex;justify-content:center;align-items:center;z-index:1000;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:6px}::ng-deep .reorder-in-progress{-webkit-user-select:none;user-select:none}@media only screen and (max-width: 600px){::ng-deep .fs-list-filter .inline-actions{top:initial!important;position:initial!important}::ng-deep .fs-list-filter .inline-actions .action-filter{margin-bottom:0!important}::ng-deep .fs-list-header .filter-input-field .mat-form-field-wrapper{padding:0!important}::ng-deep .fs-list-header.has-filters{flex-flow:row wrap}}@media only screen and (max-width: 768px){::ng-deep .show-mobile{display:inline-block!important}::ng-deep .fs-list-actions .action-button{display:none}::ng-deep .row-inline-action.mobile-hide{display:none}::ng-deep .hidden-mobile-menu-action{display:block!important}}:host(.fs-list-row-highlight) ::ng-deep tbody .fs-list-row:hover .fs-list-col{background-color:#f6f6f6}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FilterComponent, selector: "fs-filter", inputs: ["config"], outputs: ["closed", "opened", "ready"] }, { kind: "directive", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]" }, { kind: "directive", type: FilterHeadingDirective, selector: "[fsFilterHeading]" }, { kind: "component", type: FsStatusComponent, selector: "fs-list-status", inputs: ["list", "rows", "firstLoad"] }, { kind: "directive", type: FsListContentInitDirective, selector: "[fsListContentInit]", inputs: ["fsListContentInit"] }, { kind: "component", type: FsHeadComponent, selector: "[fs-list-head]", inputs: ["sorting", "columns", "hasRowActions", "selection", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy"] }, { kind: "component", type: FsBodyComponent, selector: "[fs-list-body]", inputs: ["rows", "columns", "hasFooter", "rowActionsRaw", "groupActionsRaw", "rowEvents", "rowClass", "hasRowActions", "selection", "restoreMode", "rowRemoved", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy", "reorderMultiple"] }, { kind: "directive", type: FsListDraggableListDirective, selector: "[fsListDraggableList]", inputs: ["rows"] }, { kind: "component", type: FsFooterComponent, selector: "[fs-list-footer]", inputs: ["hasRowActions", "columns", "selection", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy"] }, { kind: "directive", type: FsListFooterDirective, selector: "[fs-list-footer]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: FsListLoaderComponent, selector: "fs-list-loader", inputs: ["columns", "loaderLines"] }, { kind: "component", type: FsPaginationComponent, selector: "fs-list-pagination", inputs: ["pagination", "rows"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6731
|
+
BreakpointController,
|
|
6732
|
+
], queries: [{ propertyName: "headingTemplate", first: true, predicate: FsListHeadingDirective, descendants: true, read: TemplateRef }, { propertyName: "_emptyStateTemplate", first: true, predicate: FsListEmptyStateDirective, descendants: true, read: TemplateRef }, { propertyName: "columnTemplates", predicate: FsListColumnDirective }, { propertyName: "breakpointDirectives", predicate: FsListBreakpointDirective }], viewQueries: [{ propertyName: "body", first: true, predicate: FsBodyComponent, descendants: true }, { propertyName: "filterReference", first: true, predicate: FilterComponent, descendants: true }], ngImport: i0, template: "<div\n class=\"fs-list-container\"\n [ngClass]=\"{\n 'has-filters': list.filterConfig?.items.length,\n 'has-status': hasStatus,\n 'has-chips': list.chips,\n 'has-actions': list.actions.hasActions,\n 'has-row-actions-hover': list.rowActionsHover,\n 'first-load': firstLoad,\n 'loading': list.loading$ | async\n }\">\n <ng-template [ngTemplateOutlet]=\"listContainerContent\"></ng-template>\n</div>\n<ng-template #listContainerContent>\n @if (list.dataController.visibleRows$ | async; as listData) {\n <div class=\"fs-list-header-container\">\n <div\n class=\"fs-list-header\"\n [ngClass]=\"{ 'no-wrap': reorderController.manualReorderActivated || !list.filterConfig?.items.length }\">\n @if (list.filterConfig) {\n <fs-filter\n class=\"fs-list-filter\"\n [config]=\"list.filterConfig\">\n @if (hasStatus) {\n <ng-template fsFilterStatusBar>\n <fs-list-status\n class=\"fs-list-status\"\n [ngClass]=\"{ 'hidden-mobile': !list.status }\"\n [rows]=\"listData\"\n [list]=\"list\"\n [firstLoad]=\"firstLoad\">\n </fs-list-status>\n </ng-template>\n }\n @if (headingTemplate) {\n <ng-template fsFilterHeading>\n <ng-template [ngTemplateOutlet]=\"headingTemplate\"></ng-template>\n </ng-template>\n }\n </fs-filter>\n }\n </div>\n </div>\n <ng-content select=\"[fs-list-content]\"></ng-content>\n <!-- Table implementation -->\n <div class=\"fs-list-table-container\">\n @if (!firstLoad && listData.length > 0 && !list.emptyStateEnabled) {\n <table\n class=\"fs-list-table\"\n role=\"grid\"\n [fsListContentInit]=\"list.afterContentInit\"\n [ngClass]=\"{\n 'style-card': list.style === 'card',\n 'style-basic': list.style === 'basic',\n 'style-line': (list.style || 'line') === 'line'\n }\">\n @if (showHead) {\n <thead\n fs-list-head\n class=\"fs-list-head\"\n role=\"rowgroup\"\n [ngClass]=\"list.columns.theadClass\"\n [columns]=\"renderedColumns$ | async\"\n [sorting]=\"list.sorting\"\n [selection]=\"selectionEnabled\"\n [hasRowActions]=\"rowActionsEnabled\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </thead>\n }\n <tbody\n fs-list-body\n fsListDraggableList\n class=\"fs-list-body\"\n role=\"rowgroup\"\n [class.disabled]=\"!!(reorderController.reorderDisabled$ | async)\"\n [rows]=\"listData\"\n [rowActionsRaw]=\"list.rowActionsRaw\"\n [groupActionsRaw]=\"list.groupActionsRaw\"\n [hasRowActions]=\"rowActionsEnabled\"\n [rowEvents]=\"list.rowEvents\"\n [rowClass]=\"list.rowClass\"\n [columns]=\"renderedColumns$ | async\"\n [restoreMode]=\"list.restoreMode\"\n [selection]=\"selectionEnabled\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\"\n [reorderMultiple]=\"reorderController.multiple\">\n </tbody>\n @if (list.columns.hasFooter) {\n <tfoot\n fs-list-footer\n class=\"fs-list-footer\"\n [columns]=\"renderedColumns$ | async\"\n [selection]=\"selectionEnabled\"\n [hasRowActions]=\"rowActionsEnabled\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </tfoot>\n }\n </table>\n }\n @if (firstLoad) {\n <fs-list-loader\n [columns]=\"list.columns.columns\"\n [loaderLines]=\"loaderLines\">\n </fs-list-loader>\n }\n </div>\n <fs-list-pagination\n class=\"fs-list-pagination\"\n [rows]=\"listData\"\n [pagination]=\"list.paging\">\n </fs-list-pagination>\n @if (!firstLoad) {\n @if (listData.length === 0) {\n <div\n class=\"fs-list-no-results-container\">\n @if (list.noResults?.message && !list.emptyStateEnabled) {\n <div\n class=\"fs-list-no-results\">\n {{ list.noResults?.message }}\n </div>\n }\n @if (list.emptyStateEnabled) {\n <ng-template [ngTemplateOutlet]=\"list.emptyStateTemplate\"></ng-template>\n }\n </div>\n }\n }\n }\n</ng-template>", styles: ["::ng-deep .fs-list-table{border-spacing:0;display:table;width:100%;border-collapse:collapse}::ng-deep .fs-list-table thead{display:table-header-group}::ng-deep .fs-list-table thead th{color:#999;padding:8px;font-weight:400;color:#8f8f8f;font-size:85%;text-align:left}::ng-deep .fs-list-table tbody{display:table-row-group;position:relative}::ng-deep .fs-list-table tbody tr,::ng-deep .fs-list-table thead tr,::ng-deep .fs-list-table tfoot tr{display:table-row}::ng-deep .fs-list-table tbody tr td,::ng-deep .fs-list-table thead tr td,::ng-deep .fs-list-table tfoot tr td{display:table-cell;padding:8px;vertical-align:middle;outline:none;text-align:left}::ng-deep .fs-list-table.style-card thead th,::ng-deep .fs-list-table.style-card tbody td,::ng-deep .fs-list-table.style-card tfoot td{padding:8px 16px}::ng-deep .fs-list-table.style-card tbody tr td{border:none!important}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group){clip-path:xywh(0 3px 100% calc(100% - 6px) round 10px)}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group) td{background-color:#fafafa}::ng-deep .fs-list-table.style-line tbody td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody td{box-sizing:border-box;border-top:1px solid #e7e7e7}::ng-deep .fs-list-table.style-line tbody tr:first-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:first-child td{border-color:#c4c4c4}::ng-deep .fs-list-table.style-line tbody tr:last-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:last-child td{border-bottom:1px solid #c4c4c4}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging thead th,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging thead th{border-color:#e7e7e7}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging tbody tr:nth-child(2) td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging tbody tr:nth-child(2) td{border-top:none}:host{display:block;width:100%}:host ::ng-deep .fs-list-swap-restricted{opacity:.5}:host ::ng-deep .fs-list-no-drop{cursor:no-drop}:host ::ng-deep .hidden{display:none}:host ::ng-deep .multiple-selection{background-color:#2196f380}:host ::ng-deep .multiple-selection ::ng-deep .fs-list-col{background-color:#2196f380}@media print{:host ::ng-deep .fs-list-row-group{page-break-after:avoid}:host ::ng-deep .fs-list-row-group-child{page-break-before:avoid}:host ::ng-deep .fs-list-row-group-footer{page-break-before:avoid}}.fs-list-container{width:100%}.fs-list-container.has-filters .heading-container{margin-bottom:4px}.fs-list-container.loading .fs-list-status,.fs-list-container.loading .fs-list-body,.fs-list-container.loading .fs-list-head,.fs-list-container.loading .fs-list-footer,.fs-list-container.loading fs-list-pagination,.fs-list-container.loading ::ng-deep fs-filter-chips,.fs-list-container.loading .fs-list-no-results-container,.fs-list-container.first-load .fs-list-status,.fs-list-container.first-load .fs-list-body,.fs-list-container.first-load .fs-list-head,.fs-list-container.first-load .fs-list-footer,.fs-list-container.first-load fs-list-pagination,.fs-list-container.first-load ::ng-deep fs-filter-chips,.fs-list-container.first-load .fs-list-no-results-container{opacity:.4;pointer-events:none}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip{color:transparent}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip .remove{visibility:hidden}.fs-list-container.has-actions .fs-list-actions{margin-left:5px}@media screen and (min-width: 800px){.fs-list-container.has-row-actions-hover ::ng-deep .actions-col{width:0px;position:relative;overflow:visible;padding:0}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions{display:none;position:absolute;border-radius:5px;top:50%;right:5px;transform:translateY(-50%)}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions .mat-mdc-button-base{background:#fefefe;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.fs-list-container.has-row-actions-hover ::ng-deep tr:hover fs-list-row-actions{display:flex}}.fs-list-container .fs-list-header .heading-container{display:flex;flex-direction:column;justify-content:center}.fs-list-container .fs-list-header .heading{margin:0}.fs-list-container .fs-list-header h2+.subheading{margin:2px 0 0}.fs-list-container .fs-list-filter{margin-bottom:0;position:initial!important;display:block;width:100%}.fs-list-container .fs-list-no-results-container .fs-list-no-results{text-align:center;color:#999;padding:10px 0}.fs-list-container .fs-list-table-container{width:100%;overflow-x:auto;overflow-y:hidden;margin-top:7px}::ng-deep .fs-list-preview-block{position:fixed;height:30px;width:200px;background:gray;display:flex;justify-content:center;align-items:center;z-index:1000;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:6px}::ng-deep .reorder-in-progress{-webkit-user-select:none;user-select:none}@media only screen and (max-width: 600px){::ng-deep .fs-list-filter .inline-actions{top:initial!important;position:initial!important}::ng-deep .fs-list-filter .inline-actions .action-filter{margin-bottom:0!important}::ng-deep .fs-list-header .filter-input-field .mat-form-field-wrapper{padding:0!important}::ng-deep .fs-list-header.has-filters{flex-flow:row wrap}}@media only screen and (max-width: 768px){::ng-deep .show-mobile{display:inline-block!important}::ng-deep .fs-list-actions .action-button{display:none}::ng-deep .row-inline-action.mobile-hide{display:none}::ng-deep .hidden-mobile-menu-action{display:block!important}}:host(.fs-list-row-highlight) ::ng-deep tbody .fs-list-row:not(.fs-list-row-group):not(.fs-list-row-group-footer):hover .fs-list-col{background-color:#f6f6f6}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: FilterComponent, selector: "fs-filter", inputs: ["config"], outputs: ["closed", "opened", "ready"] }, { kind: "directive", type: FilterStatusBarDirective, selector: "[fsFilterStatusBar]" }, { kind: "directive", type: FilterHeadingDirective, selector: "[fsFilterHeading]" }, { kind: "component", type: FsStatusComponent, selector: "fs-list-status", inputs: ["list", "rows", "firstLoad"] }, { kind: "directive", type: FsListContentInitDirective, selector: "[fsListContentInit]", inputs: ["fsListContentInit"] }, { kind: "component", type: FsHeadComponent, selector: "[fs-list-head]", inputs: ["sorting", "columns", "hasRowActions", "selection", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy"] }, { kind: "component", type: FsBodyComponent, selector: "[fs-list-body]", inputs: ["rows", "columns", "hasFooter", "rowActionsRaw", "groupActionsRaw", "rowEvents", "rowClass", "hasRowActions", "selection", "restoreMode", "rowRemoved", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy", "reorderMultiple"] }, { kind: "directive", type: FsListDraggableListDirective, selector: "[fsListDraggableList]", inputs: ["rows"] }, { kind: "component", type: FsFooterComponent, selector: "[fs-list-footer]", inputs: ["hasRowActions", "columns", "selection", "activeFiltersCount", "reorderEnabled", "reorderPosition", "reorderStrategy"] }, { kind: "directive", type: FsListFooterDirective, selector: "[fs-list-footer]", inputs: ["colspan", "align", "class"] }, { kind: "component", type: FsListLoaderComponent, selector: "fs-list-loader", inputs: ["columns", "loaderLines"] }, { kind: "component", type: FsPaginationComponent, selector: "fs-list-pagination", inputs: ["pagination", "rows"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6024
6733
|
}
|
|
6025
6734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: FsListComponent, decorators: [{
|
|
6026
6735
|
type: Component,
|
|
@@ -6028,6 +6737,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6028
6737
|
GroupExpandNotifierService,
|
|
6029
6738
|
PersistanceController,
|
|
6030
6739
|
ReorderController,
|
|
6740
|
+
BreakpointController,
|
|
6031
6741
|
], standalone: true, imports: [
|
|
6032
6742
|
NgClass,
|
|
6033
6743
|
NgTemplateOutlet,
|
|
@@ -6044,7 +6754,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6044
6754
|
FsListLoaderComponent,
|
|
6045
6755
|
FsPaginationComponent,
|
|
6046
6756
|
AsyncPipe,
|
|
6047
|
-
], template: "<div\n class=\"fs-list-container\"\n [ngClass]=\"{\n 'has-filters': list.filterConfig?.items.length,\n 'has-status': hasStatus,\n 'has-chips': list.chips,\n 'has-actions': list.actions.hasActions,\n 'has-row-actions-hover': list.rowActionsHover,\n 'first-load': firstLoad,\n 'loading': list.loading$ | async\n }\">\n <ng-template [ngTemplateOutlet]=\"listContainerContent\"></ng-template>\n</div>\n<ng-template #listContainerContent>\n @if (list.dataController.visibleRows$ | async; as listData) {\n <div class=\"fs-list-header-container\">\n <div\n class=\"fs-list-header\"\n [ngClass]=\"{ 'no-wrap': reorderController.manualReorderActivated || !list.filterConfig?.items.length }\">\n @if (list.filterConfig) {\n <fs-filter\n class=\"fs-list-filter\"\n [config]=\"list.filterConfig\">\n @if (hasStatus) {\n <ng-template fsFilterStatusBar>\n <fs-list-status\n class=\"fs-list-status\"\n [ngClass]=\"{ 'hidden-mobile': !list.status }\"\n [rows]=\"listData\"\n [list]=\"list\"\n [firstLoad]=\"firstLoad\">\n </fs-list-status>\n </ng-template>\n }\n @if (headingTemplate) {\n <ng-template fsFilterHeading>\n <ng-template [ngTemplateOutlet]=\"headingTemplate\"></ng-template>\n </ng-template>\n }\n </fs-filter>\n }\n </div>\n </div>\n <ng-content select=\"[fs-list-content]\"></ng-content>\n <!-- Table implementation -->\n <div class=\"fs-list-table-container\">\n @if (!firstLoad && listData.length > 0 && !list.emptyStateEnabled) {\n <table\n class=\"fs-list-table\"\n role=\"grid\"\n [fsListContentInit]=\"list.afterContentInit\"\n [ngClass]=\"{\n 'style-card': list.style === 'card',\n 'style-basic': list.style === 'basic',\n 'style-line': (list.style || 'line') === 'line'\n }\">\n @if (list.columns.hasHeader) {\n <thead\n fs-list-head\n class=\"fs-list-head\"\n role=\"rowgroup\"\n [ngClass]=\"list.columns.theadClass\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [sorting]=\"list.sorting\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </thead>\n }\n <tbody\n fs-list-body\n fsListDraggableList\n class=\"fs-list-body\"\n role=\"rowgroup\"\n [class.disabled]=\"!!(reorderController.reorderDisabled$ | async)\"\n [rows]=\"listData\"\n [rowActionsRaw]=\"list.rowActionsRaw\"\n [groupActionsRaw]=\"list.groupActionsRaw\"\n [hasRowActions]=\"list.hasRowActions\"\n [rowEvents]=\"list.rowEvents\"\n [rowClass]=\"list.rowClass\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [restoreMode]=\"list.restoreMode\"\n [selection]=\"list.selection\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\"\n [reorderMultiple]=\"reorderController.multiple\">\n </tbody>\n @if (list.columns.hasFooter) {\n <tfoot\n fs-list-footer\n class=\"fs-list-footer\"\n [columns]=\"list.columns.visibleColumns$ | async\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderController.enabled$ | async\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </tfoot>\n }\n </table>\n }\n @if (firstLoad) {\n <fs-list-loader\n [columns]=\"list.columns.columns\"\n [loaderLines]=\"loaderLines\">\n </fs-list-loader>\n }\n </div>\n <fs-list-pagination\n class=\"fs-list-pagination\"\n [rows]=\"listData\"\n [pagination]=\"list.paging\">\n </fs-list-pagination>\n @if (!firstLoad) {\n @if (listData.length === 0) {\n <div\n class=\"fs-list-no-results-container\">\n @if (list.noResults?.message && !list.emptyStateEnabled) {\n <div\n class=\"fs-list-no-results\">\n {{ list.noResults?.message }}\n </div>\n }\n @if (list.emptyStateEnabled) {\n <ng-template [ngTemplateOutlet]=\"list.emptyStateTemplate\"></ng-template>\n }\n </div>\n }\n }\n }\n</ng-template>", styles: ["::ng-deep .fs-list-table{border-spacing:0;display:table;width:100%;border-collapse:collapse}::ng-deep .fs-list-table thead{display:table-header-group}::ng-deep .fs-list-table thead th{color:#999;padding:8px;font-weight:400;color:#8f8f8f;font-size:85%;text-align:left}::ng-deep .fs-list-table tbody{display:table-row-group;position:relative}::ng-deep .fs-list-table tbody tr,::ng-deep .fs-list-table thead tr,::ng-deep .fs-list-table tfoot tr{display:table-row}::ng-deep .fs-list-table tbody tr td,::ng-deep .fs-list-table thead tr td,::ng-deep .fs-list-table tfoot tr td{display:table-cell;padding:8px;vertical-align:middle;outline:none;text-align:left}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group){clip-path:xywh(0 3px 100% calc(100% - 6px) round 10px)}::ng-deep .fs-list-table.style-card tbody tr td{border:none!important;background-color:#fafafa;padding:8px 16px}::ng-deep .fs-list-table.style-line tbody td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody td{box-sizing:border-box;border-top:1px solid #e7e7e7}::ng-deep .fs-list-table.style-line tbody tr:first-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:first-child td{border-color:#c4c4c4}::ng-deep .fs-list-table.style-line tbody tr:last-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:last-child td{border-bottom:1px solid #c4c4c4}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging thead th,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging thead th{border-color:#e7e7e7}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging tbody tr:nth-child(2) td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging tbody tr:nth-child(2) td{border-top:none}:host{display:block;width:100%}:host ::ng-deep .fs-list-swap-restricted{opacity:.5}:host ::ng-deep .fs-list-no-drop{cursor:no-drop}:host ::ng-deep .hidden{display:none}:host ::ng-deep .multiple-selection{background-color:#2196f380}:host ::ng-deep .multiple-selection ::ng-deep .fs-list-col{background-color:#2196f380}@media print{:host ::ng-deep .fs-list-row-group{page-break-after:avoid}:host ::ng-deep .fs-list-row-group-child{page-break-before:avoid}:host ::ng-deep .fs-list-row-group-footer{page-break-before:avoid}}.fs-list-container{width:100%}.fs-list-container.has-filters .heading-container{margin-bottom:4px}.fs-list-container.loading .fs-list-status,.fs-list-container.loading .fs-list-body,.fs-list-container.loading .fs-list-head,.fs-list-container.loading .fs-list-footer,.fs-list-container.loading fs-list-pagination,.fs-list-container.loading ::ng-deep fs-filter-chips,.fs-list-container.loading .fs-list-no-results-container,.fs-list-container.first-load .fs-list-status,.fs-list-container.first-load .fs-list-body,.fs-list-container.first-load .fs-list-head,.fs-list-container.first-load .fs-list-footer,.fs-list-container.first-load fs-list-pagination,.fs-list-container.first-load ::ng-deep fs-filter-chips,.fs-list-container.first-load .fs-list-no-results-container{opacity:.4;pointer-events:none}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip{color:transparent}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip .remove{visibility:hidden}.fs-list-container.has-actions .fs-list-actions{margin-left:5px}@media screen and (min-width: 800px){.fs-list-container.has-row-actions-hover ::ng-deep .actions-col{width:0px;position:relative;overflow:visible;padding:0}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions{display:none;position:absolute;border-radius:5px;top:50%;right:5px;transform:translateY(-50%)}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions .mat-mdc-button-base{background:#fefefe;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.fs-list-container.has-row-actions-hover ::ng-deep tr:hover fs-list-row-actions{display:flex}}.fs-list-container .fs-list-header .heading-container{display:flex;flex-direction:column;justify-content:center}.fs-list-container .fs-list-header .heading{margin:0}.fs-list-container .fs-list-header h2+.subheading{margin:2px 0 0}.fs-list-container .fs-list-filter{margin-bottom:0;position:initial!important;display:block;width:100%}.fs-list-container .fs-list-no-results-container .fs-list-no-results{text-align:center;color:#999;padding:10px 0}.fs-list-container .fs-list-table-container{width:100%;overflow-x:auto;overflow-y:hidden;margin-top:7px}::ng-deep .fs-list-preview-block{position:fixed;height:30px;width:200px;background:gray;display:flex;justify-content:center;align-items:center;z-index:1000;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:6px}::ng-deep .reorder-in-progress{-webkit-user-select:none;user-select:none}@media only screen and (max-width: 600px){::ng-deep .fs-list-filter .inline-actions{top:initial!important;position:initial!important}::ng-deep .fs-list-filter .inline-actions .action-filter{margin-bottom:0!important}::ng-deep .fs-list-header .filter-input-field .mat-form-field-wrapper{padding:0!important}::ng-deep .fs-list-header.has-filters{flex-flow:row wrap}}@media only screen and (max-width: 768px){::ng-deep .show-mobile{display:inline-block!important}::ng-deep .fs-list-actions .action-button{display:none}::ng-deep .row-inline-action.mobile-hide{display:none}::ng-deep .hidden-mobile-menu-action{display:block!important}}:host(.fs-list-row-highlight) ::ng-deep tbody .fs-list-row:hover .fs-list-col{background-color:#f6f6f6}\n"] }]
|
|
6757
|
+
], template: "<div\n class=\"fs-list-container\"\n [ngClass]=\"{\n 'has-filters': list.filterConfig?.items.length,\n 'has-status': hasStatus,\n 'has-chips': list.chips,\n 'has-actions': list.actions.hasActions,\n 'has-row-actions-hover': list.rowActionsHover,\n 'first-load': firstLoad,\n 'loading': list.loading$ | async\n }\">\n <ng-template [ngTemplateOutlet]=\"listContainerContent\"></ng-template>\n</div>\n<ng-template #listContainerContent>\n @if (list.dataController.visibleRows$ | async; as listData) {\n <div class=\"fs-list-header-container\">\n <div\n class=\"fs-list-header\"\n [ngClass]=\"{ 'no-wrap': reorderController.manualReorderActivated || !list.filterConfig?.items.length }\">\n @if (list.filterConfig) {\n <fs-filter\n class=\"fs-list-filter\"\n [config]=\"list.filterConfig\">\n @if (hasStatus) {\n <ng-template fsFilterStatusBar>\n <fs-list-status\n class=\"fs-list-status\"\n [ngClass]=\"{ 'hidden-mobile': !list.status }\"\n [rows]=\"listData\"\n [list]=\"list\"\n [firstLoad]=\"firstLoad\">\n </fs-list-status>\n </ng-template>\n }\n @if (headingTemplate) {\n <ng-template fsFilterHeading>\n <ng-template [ngTemplateOutlet]=\"headingTemplate\"></ng-template>\n </ng-template>\n }\n </fs-filter>\n }\n </div>\n </div>\n <ng-content select=\"[fs-list-content]\"></ng-content>\n <!-- Table implementation -->\n <div class=\"fs-list-table-container\">\n @if (!firstLoad && listData.length > 0 && !list.emptyStateEnabled) {\n <table\n class=\"fs-list-table\"\n role=\"grid\"\n [fsListContentInit]=\"list.afterContentInit\"\n [ngClass]=\"{\n 'style-card': list.style === 'card',\n 'style-basic': list.style === 'basic',\n 'style-line': (list.style || 'line') === 'line'\n }\">\n @if (showHead) {\n <thead\n fs-list-head\n class=\"fs-list-head\"\n role=\"rowgroup\"\n [ngClass]=\"list.columns.theadClass\"\n [columns]=\"renderedColumns$ | async\"\n [sorting]=\"list.sorting\"\n [selection]=\"selectionEnabled\"\n [hasRowActions]=\"rowActionsEnabled\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </thead>\n }\n <tbody\n fs-list-body\n fsListDraggableList\n class=\"fs-list-body\"\n role=\"rowgroup\"\n [class.disabled]=\"!!(reorderController.reorderDisabled$ | async)\"\n [rows]=\"listData\"\n [rowActionsRaw]=\"list.rowActionsRaw\"\n [groupActionsRaw]=\"list.groupActionsRaw\"\n [hasRowActions]=\"rowActionsEnabled\"\n [rowEvents]=\"list.rowEvents\"\n [rowClass]=\"list.rowClass\"\n [columns]=\"renderedColumns$ | async\"\n [restoreMode]=\"list.restoreMode\"\n [selection]=\"selectionEnabled\"\n [rowRemoved]=\"rowRemoved\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\"\n [reorderMultiple]=\"reorderController.multiple\">\n </tbody>\n @if (list.columns.hasFooter) {\n <tfoot\n fs-list-footer\n class=\"fs-list-footer\"\n [columns]=\"renderedColumns$ | async\"\n [selection]=\"selectionEnabled\"\n [hasRowActions]=\"rowActionsEnabled\"\n [activeFiltersCount]=\"list.activeFiltersCount$ | async\"\n [reorderEnabled]=\"reorderEnabledFor(reorderController.enabled$ | async)\"\n [reorderPosition]=\"reorderController.position$ | async\"\n [reorderStrategy]=\"reorderController.strategy$ | async\">\n </tfoot>\n }\n </table>\n }\n @if (firstLoad) {\n <fs-list-loader\n [columns]=\"list.columns.columns\"\n [loaderLines]=\"loaderLines\">\n </fs-list-loader>\n }\n </div>\n <fs-list-pagination\n class=\"fs-list-pagination\"\n [rows]=\"listData\"\n [pagination]=\"list.paging\">\n </fs-list-pagination>\n @if (!firstLoad) {\n @if (listData.length === 0) {\n <div\n class=\"fs-list-no-results-container\">\n @if (list.noResults?.message && !list.emptyStateEnabled) {\n <div\n class=\"fs-list-no-results\">\n {{ list.noResults?.message }}\n </div>\n }\n @if (list.emptyStateEnabled) {\n <ng-template [ngTemplateOutlet]=\"list.emptyStateTemplate\"></ng-template>\n }\n </div>\n }\n }\n }\n</ng-template>", styles: ["::ng-deep .fs-list-table{border-spacing:0;display:table;width:100%;border-collapse:collapse}::ng-deep .fs-list-table thead{display:table-header-group}::ng-deep .fs-list-table thead th{color:#999;padding:8px;font-weight:400;color:#8f8f8f;font-size:85%;text-align:left}::ng-deep .fs-list-table tbody{display:table-row-group;position:relative}::ng-deep .fs-list-table tbody tr,::ng-deep .fs-list-table thead tr,::ng-deep .fs-list-table tfoot tr{display:table-row}::ng-deep .fs-list-table tbody tr td,::ng-deep .fs-list-table thead tr td,::ng-deep .fs-list-table tfoot tr td{display:table-cell;padding:8px;vertical-align:middle;outline:none;text-align:left}::ng-deep .fs-list-table.style-card thead th,::ng-deep .fs-list-table.style-card tbody td,::ng-deep .fs-list-table.style-card tfoot td{padding:8px 16px}::ng-deep .fs-list-table.style-card tbody tr td{border:none!important}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group){clip-path:xywh(0 3px 100% calc(100% - 6px) round 10px)}::ng-deep .fs-list-table.style-card tbody tr:not(.fs-list-row-group-footer):not(.fs-list-row-group) td{background-color:#fafafa}::ng-deep .fs-list-table.style-line tbody td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody td{box-sizing:border-box;border-top:1px solid #e7e7e7}::ng-deep .fs-list-table.style-line tbody tr:first-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:first-child td{border-color:#c4c4c4}::ng-deep .fs-list-table.style-line tbody tr:last-child td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) tbody tr:last-child td{border-bottom:1px solid #c4c4c4}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging thead th,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging thead th{border-color:#e7e7e7}::ng-deep .fs-list-table.style-line .fs-list-container.has-dragging tbody tr:nth-child(2) td,::ng-deep .fs-list-table:not(.style-card):not(.style-basic) .fs-list-container.has-dragging tbody tr:nth-child(2) td{border-top:none}:host{display:block;width:100%}:host ::ng-deep .fs-list-swap-restricted{opacity:.5}:host ::ng-deep .fs-list-no-drop{cursor:no-drop}:host ::ng-deep .hidden{display:none}:host ::ng-deep .multiple-selection{background-color:#2196f380}:host ::ng-deep .multiple-selection ::ng-deep .fs-list-col{background-color:#2196f380}@media print{:host ::ng-deep .fs-list-row-group{page-break-after:avoid}:host ::ng-deep .fs-list-row-group-child{page-break-before:avoid}:host ::ng-deep .fs-list-row-group-footer{page-break-before:avoid}}.fs-list-container{width:100%}.fs-list-container.has-filters .heading-container{margin-bottom:4px}.fs-list-container.loading .fs-list-status,.fs-list-container.loading .fs-list-body,.fs-list-container.loading .fs-list-head,.fs-list-container.loading .fs-list-footer,.fs-list-container.loading fs-list-pagination,.fs-list-container.loading ::ng-deep fs-filter-chips,.fs-list-container.loading .fs-list-no-results-container,.fs-list-container.first-load .fs-list-status,.fs-list-container.first-load .fs-list-body,.fs-list-container.first-load .fs-list-head,.fs-list-container.first-load .fs-list-footer,.fs-list-container.first-load fs-list-pagination,.fs-list-container.first-load ::ng-deep fs-filter-chips,.fs-list-container.first-load .fs-list-no-results-container{opacity:.4;pointer-events:none}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip{color:transparent}.fs-list-container.first-load ::ng-deep fs-filter-chips .fs-chip .remove{visibility:hidden}.fs-list-container.has-actions .fs-list-actions{margin-left:5px}@media screen and (min-width: 800px){.fs-list-container.has-row-actions-hover ::ng-deep .actions-col{width:0px;position:relative;overflow:visible;padding:0}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions{display:none;position:absolute;border-radius:5px;top:50%;right:5px;transform:translateY(-50%)}.fs-list-container.has-row-actions-hover ::ng-deep .actions-col fs-list-row-actions .mat-mdc-button-base{background:#fefefe;box-shadow:0 2px 1px -1px #0003,0 1px 1px #00000024,0 1px 3px #0000001f}.fs-list-container.has-row-actions-hover ::ng-deep tr:hover fs-list-row-actions{display:flex}}.fs-list-container .fs-list-header .heading-container{display:flex;flex-direction:column;justify-content:center}.fs-list-container .fs-list-header .heading{margin:0}.fs-list-container .fs-list-header h2+.subheading{margin:2px 0 0}.fs-list-container .fs-list-filter{margin-bottom:0;position:initial!important;display:block;width:100%}.fs-list-container .fs-list-no-results-container .fs-list-no-results{text-align:center;color:#999;padding:10px 0}.fs-list-container .fs-list-table-container{width:100%;overflow-x:auto;overflow-y:hidden;margin-top:7px}::ng-deep .fs-list-preview-block{position:fixed;height:30px;width:200px;background:gray;display:flex;justify-content:center;align-items:center;z-index:1000;box-shadow:2px 2px 2px #9e9e9ea6;border-radius:6px}::ng-deep .reorder-in-progress{-webkit-user-select:none;user-select:none}@media only screen and (max-width: 600px){::ng-deep .fs-list-filter .inline-actions{top:initial!important;position:initial!important}::ng-deep .fs-list-filter .inline-actions .action-filter{margin-bottom:0!important}::ng-deep .fs-list-header .filter-input-field .mat-form-field-wrapper{padding:0!important}::ng-deep .fs-list-header.has-filters{flex-flow:row wrap}}@media only screen and (max-width: 768px){::ng-deep .show-mobile{display:inline-block!important}::ng-deep .fs-list-actions .action-button{display:none}::ng-deep .row-inline-action.mobile-hide{display:none}::ng-deep .hidden-mobile-menu-action{display:block!important}}:host(.fs-list-row-highlight) ::ng-deep tbody .fs-list-row:not(.fs-list-row-group):not(.fs-list-row-group-footer):hover .fs-list-col{background-color:#f6f6f6}\n"] }]
|
|
6048
6758
|
}], propDecorators: { classFsList: [{
|
|
6049
6759
|
type: HostBinding,
|
|
6050
6760
|
args: ['class.fs-list']
|
|
@@ -6072,6 +6782,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6072
6782
|
}], columnTemplates: [{
|
|
6073
6783
|
type: ContentChildren,
|
|
6074
6784
|
args: [FsListColumnDirective]
|
|
6785
|
+
}], breakpointDirectives: [{
|
|
6786
|
+
type: ContentChildren,
|
|
6787
|
+
args: [FsListBreakpointDirective]
|
|
6075
6788
|
}], _emptyStateTemplate: [{
|
|
6076
6789
|
type: ContentChild,
|
|
6077
6790
|
args: [FsListEmptyStateDirective, { read: TemplateRef }]
|
|
@@ -6136,6 +6849,7 @@ class FsListModule {
|
|
|
6136
6849
|
FsFooterComponent,
|
|
6137
6850
|
FsPaginationComponent,
|
|
6138
6851
|
FsListColumnDirective,
|
|
6852
|
+
FsListBreakpointDirective,
|
|
6139
6853
|
FsListCellDirective,
|
|
6140
6854
|
FsListCellRowTypeScopeDirective,
|
|
6141
6855
|
FsListHeaderDirective,
|
|
@@ -6155,6 +6869,7 @@ class FsListModule {
|
|
|
6155
6869
|
FsCellComponent,
|
|
6156
6870
|
FsListLoaderComponent,
|
|
6157
6871
|
FsListColumnDirective,
|
|
6872
|
+
FsListBreakpointDirective,
|
|
6158
6873
|
FsListCellDirective,
|
|
6159
6874
|
FsListCellRowTypeScopeDirective,
|
|
6160
6875
|
FsListHeaderDirective,
|
|
@@ -6198,6 +6913,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6198
6913
|
FsFooterComponent,
|
|
6199
6914
|
FsPaginationComponent,
|
|
6200
6915
|
FsListColumnDirective,
|
|
6916
|
+
FsListBreakpointDirective,
|
|
6201
6917
|
FsListCellDirective,
|
|
6202
6918
|
FsListCellRowTypeScopeDirective,
|
|
6203
6919
|
FsListHeaderDirective,
|
|
@@ -6220,6 +6936,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6220
6936
|
FsCellComponent,
|
|
6221
6937
|
FsListLoaderComponent,
|
|
6222
6938
|
FsListColumnDirective,
|
|
6939
|
+
FsListBreakpointDirective,
|
|
6223
6940
|
FsListCellDirective,
|
|
6224
6941
|
FsListCellRowTypeScopeDirective,
|
|
6225
6942
|
FsListHeaderDirective,
|
|
@@ -6256,5 +6973,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
6256
6973
|
* Generated bundle index. Do not edit.
|
|
6257
6974
|
*/
|
|
6258
6975
|
|
|
6259
|
-
export { ActionType, Column, FS_LIST_CONFIG, FsBodyComponent, FsCellComponent, FsFooterCellComponent, FsFooterComponent, FsFooterRowComponent, FsHeadCellComponent, FsHeadComponent, FsListCellDirective, FsListCellRowTypeScopeDirective, FsListColumnDirective, FsListComponent, FsListContentDirective, FsListDraggableListDirective, FsListEmptyStateDirective, FsListFooterDirective, FsListGroupExpandTriggerDirective, FsListGroupFooterDirective, FsListGroupHeaderDirective, FsListHeaderDirective, FsListHeadingDirective, FsListLoaderComponent, FsListModule, FsListState, FsPaginationComponent, FsRowComponent, FsStatusComponent, FsTypedListCellDirective, List, PaginationController, PaginationStrategy, ReorderController, ReorderPosition, RowAction, RowType, SelectionChangeType, SelectionController, SortingController, SortingDirection, StyleConfig };
|
|
6976
|
+
export { ActionType, BreakpointController, Column, ColumnSet, FS_LIST_CONFIG, FsBodyComponent, FsCellComponent, FsFooterCellComponent, FsFooterComponent, FsFooterRowComponent, FsHeadCellComponent, FsHeadComponent, FsListBreakpointDirective, FsListCellDirective, FsListCellRowTypeScopeDirective, FsListColumnDirective, FsListComponent, FsListContentDirective, FsListDraggableListDirective, FsListEmptyStateDirective, FsListFooterDirective, FsListGroupExpandTriggerDirective, FsListGroupFooterDirective, FsListGroupHeaderDirective, FsListHeaderDirective, FsListHeadingDirective, FsListLoaderComponent, FsListModule, FsListState, FsPaginationComponent, FsRowComponent, FsStatusComponent, FsTypedListCellDirective, List, PaginationController, PaginationStrategy, ReorderController, ReorderPosition, ReorderStrategy, RowAction, RowType, SelectionChangeType, SelectionController, SortingController, SortingDirection, StyleConfig };
|
|
6260
6977
|
//# sourceMappingURL=firestitch-list.mjs.map
|