@one-paragon/angular-utilities 2.5.3 → 2.5.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -920,6 +920,7 @@ class TableSettings {
|
|
|
920
920
|
this.groupHeaderHeight = undefined;
|
|
921
921
|
this.rowClick = undefined;
|
|
922
922
|
this.exportSettings = undefined;
|
|
923
|
+
this.groupBySettings = [];
|
|
923
924
|
}
|
|
924
925
|
}
|
|
925
926
|
class PersistedTableSettings {
|
|
@@ -959,6 +960,7 @@ class NotPersistedTableSettings {
|
|
|
959
960
|
this.headerHeight = undefined;
|
|
960
961
|
this.rowClick = undefined;
|
|
961
962
|
this.exportSettings = undefined;
|
|
963
|
+
this.groupBySettings = [];
|
|
962
964
|
}
|
|
963
965
|
merge(tableSettings) {
|
|
964
966
|
const newNpts = merge$1(this, new NotPersistedTableSettings());
|
|
@@ -984,6 +986,7 @@ class NotPersistedTableSettings {
|
|
|
984
986
|
newNpts.rowStyles = tableSettings.tableSettings?.rowStyles ?? newNpts.rowStyles;
|
|
985
987
|
newNpts.rowClick = tableSettings.tableSettings?.rowClick ?? newNpts.rowClick;
|
|
986
988
|
newNpts.exportSettings = tableSettings.tableSettings?.exportSettings ?? newNpts.exportSettings;
|
|
989
|
+
newNpts.groupBySettings = tableSettings.tableSettings?.groupBySettings ?? newNpts.groupBySettings ?? [];
|
|
987
990
|
if (tableSettings.tableSettings?.virtualScrollSettings) {
|
|
988
991
|
const currVirt = tableSettings.tableSettings?.virtualScrollSettings || newNpts.virtualSettings;
|
|
989
992
|
if (!currVirt.headerHeight) {
|
|
@@ -2940,6 +2943,28 @@ class TableStore extends ComponentStore {
|
|
|
2940
2943
|
const state = this.state();
|
|
2941
2944
|
return mapSaveableState(state);
|
|
2942
2945
|
});
|
|
2946
|
+
//#region meta order and hidden
|
|
2947
|
+
this.showColumn = this.updater((state, key) => ({
|
|
2948
|
+
...state,
|
|
2949
|
+
hiddenKeys: state.hiddenKeys.filter(k => k !== key),
|
|
2950
|
+
}));
|
|
2951
|
+
this.hideColumn = this.updater((state, key) => ({
|
|
2952
|
+
...state,
|
|
2953
|
+
hiddenKeys: [...state.hiddenKeys.filter(k => k !== key), key],
|
|
2954
|
+
}));
|
|
2955
|
+
this.setHiddenColumns = this.updater((state, displayCols) => {
|
|
2956
|
+
return ({ ...state, hiddenKeys: displayCols.filter(d => !d.visible).map(d => d.key) });
|
|
2957
|
+
});
|
|
2958
|
+
this.setUserDefinedOrder = this.updater((state, moved) => {
|
|
2959
|
+
const { newOrder, oldOrder } = moved;
|
|
2960
|
+
const mdsArr = orderedStateVisibleMetaData(state);
|
|
2961
|
+
moveItemInArray(mdsArr, oldOrder, newOrder);
|
|
2962
|
+
const userDefinedOrder = mdsArr.reduce((aggregate, current, index) => {
|
|
2963
|
+
aggregate[current.key] = index;
|
|
2964
|
+
return aggregate;
|
|
2965
|
+
}, {});
|
|
2966
|
+
return ({ ...state, userDefined: { ...state.userDefined, order: userDefinedOrder } });
|
|
2967
|
+
});
|
|
2943
2968
|
this.$userDefinedOrder = this.selectSignal(state => state.userDefined.order);
|
|
2944
2969
|
this.metaData$ = this.select(state => state.metaData);
|
|
2945
2970
|
this.$metaData = this.selectSignal(state => state.metaData);
|
|
@@ -2953,15 +2978,87 @@ class TableStore extends ComponentStore {
|
|
|
2953
2978
|
});
|
|
2954
2979
|
this.$hiddenKeys = this.selectSignal(state => state.hiddenKeys);
|
|
2955
2980
|
this.$orderedVisibleColumns = this.selectSignal(this.$orderedCodeVisibleMetaDatas, this.$hiddenKeys, (cs, hiddenKeys) => cs.filter(m => !hiddenKeys.includes(m.key)).map(m => m.key));
|
|
2981
|
+
//#endregion meta order and hidden
|
|
2982
|
+
//#region widths
|
|
2983
|
+
this.setUserDefinedWidth = this.updater((state, colWidths) => {
|
|
2984
|
+
const userDefinedWidths = { ...state.userDefined.widths };
|
|
2985
|
+
colWidths.forEach(cw => {
|
|
2986
|
+
userDefinedWidths[cw.key] = cw.widthInPixel;
|
|
2987
|
+
});
|
|
2988
|
+
return { ...state, userDefined: { ...state.userDefined, widths: userDefinedWidths } };
|
|
2989
|
+
});
|
|
2990
|
+
this.setTableWidth = this.updater((state, widthInPixels) => ({ ...state, userDefined: { ...state.userDefined, table: { width: widthInPixels } } }));
|
|
2956
2991
|
this.$getUserDefinedWidths = this.selectSignal(state => state.userDefined.widths);
|
|
2957
2992
|
this.$tableSettingsMinWidth = this.selectSignal(state => parseTbSizeToPixels(state.notPersistedTableSettings.minColumnWidth));
|
|
2958
2993
|
this.$getUserDefinedWidth = (key) => this.selectSignal(this.$getUserDefinedWidths, widths => widths[key]);
|
|
2994
|
+
this.$getUserDefinedTableWidth = this.selectSignal(state => state.userDefined.table.width);
|
|
2995
|
+
this.getUserDefinedTableWidth$ = this.select(state => state.userDefined.table.width);
|
|
2996
|
+
//#endregion widths
|
|
2997
|
+
//#region filter
|
|
2998
|
+
this.addFilter = this.updater((state, filter) => {
|
|
2999
|
+
return this.addFiltersToState(state, [filter]);
|
|
3000
|
+
});
|
|
3001
|
+
this.addFilters = this.updater((state, filters) => {
|
|
3002
|
+
return this.addFiltersToState(state, filters);
|
|
3003
|
+
});
|
|
3004
|
+
this.removeFilter = this.updater((state, filterId) => {
|
|
3005
|
+
const filtersCopy = { ...state.filters };
|
|
3006
|
+
delete filtersCopy[filterId];
|
|
3007
|
+
return ({ ...state, filters: filtersCopy });
|
|
3008
|
+
});
|
|
3009
|
+
this.removeFilters = this.updater((state, filterIds) => {
|
|
3010
|
+
const filtersCopy = { ...state.filters };
|
|
3011
|
+
filterIds.forEach(id => { delete filtersCopy[id]; });
|
|
3012
|
+
return ({ ...state, filters: filtersCopy });
|
|
3013
|
+
});
|
|
3014
|
+
this.clearFilters = this.updater((state) => ({ ...state, filters: {} }));
|
|
3015
|
+
this.addFiltersToState = (state, filters) => {
|
|
3016
|
+
var customFilters = filters.filter(isCustomFilter);
|
|
3017
|
+
var filterInfos = filters.filter(isFilterInfo);
|
|
3018
|
+
const filtersObj = filterInfos
|
|
3019
|
+
.filter(fltr => Object.keys(state.metaData).some(key => key === fltr.key) || console.warn(`Meta data with key ${fltr.key} not found`))
|
|
3020
|
+
.reduce((filtersObj, filter) => {
|
|
3021
|
+
if (!filter.filterId) {
|
|
3022
|
+
filter.filterId = crypto.randomUUID();
|
|
3023
|
+
}
|
|
3024
|
+
filtersObj[filter.filterId] = filter;
|
|
3025
|
+
return filtersObj;
|
|
3026
|
+
}, {});
|
|
3027
|
+
customFilters.forEach(fltr => {
|
|
3028
|
+
if (!fltr.filterId) {
|
|
3029
|
+
fltr.filterId = crypto.randomUUID();
|
|
3030
|
+
}
|
|
3031
|
+
filtersObj[fltr.filterId] = fltr;
|
|
3032
|
+
});
|
|
3033
|
+
return {
|
|
3034
|
+
...state,
|
|
3035
|
+
filters: { ...state.filters, ...filtersObj }
|
|
3036
|
+
};
|
|
3037
|
+
};
|
|
2959
3038
|
this.$filters = this.selectSignal(state => state.filters);
|
|
2960
3039
|
this.$filtersArray = computed(() => Object.values(this.state().filters) || []);
|
|
2961
3040
|
this.filters$ = this.select(state => state.filters);
|
|
2962
3041
|
this.$getFilter = (filterId) => {
|
|
2963
3042
|
return this.selectSignal(this.$filters, filters => filters[filterId]);
|
|
2964
3043
|
};
|
|
3044
|
+
//#endregion filter
|
|
3045
|
+
//#region sort
|
|
3046
|
+
this.setSort = this.updater((state, { key, direction }) => {
|
|
3047
|
+
const sortArray = state.sorted.filter(s => s.active !== key);
|
|
3048
|
+
if (direction) {
|
|
3049
|
+
sortArray.unshift({ active: key, direction });
|
|
3050
|
+
}
|
|
3051
|
+
return {
|
|
3052
|
+
...state,
|
|
3053
|
+
sorted: sortArray,
|
|
3054
|
+
};
|
|
3055
|
+
});
|
|
3056
|
+
this.setAllSort = this.updater((state, sortArray) => {
|
|
3057
|
+
return {
|
|
3058
|
+
...state,
|
|
3059
|
+
sorted: sortArray,
|
|
3060
|
+
};
|
|
3061
|
+
});
|
|
2965
3062
|
this.$preSort = computed(() => createPreSort(this.$metaData()));
|
|
2966
3063
|
this._$selectSorted = this.selectSignal(state => state.sorted, {
|
|
2967
3064
|
equal: sortsAreSame
|
|
@@ -2978,47 +3075,124 @@ class TableStore extends ComponentStore {
|
|
|
2978
3075
|
this.selectSorted$ = this.select(state => state.sorted).pipe(distinctUntilChanged(sortsAreSame));
|
|
2979
3076
|
this.$getSorts = this.selectSignal(() => this.$initializationState() !== InitializationState.Ready ? [] : this.$selectSorted());
|
|
2980
3077
|
this.sort$ = toObservable(this.$getSorts);
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
this
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
this
|
|
2988
|
-
|
|
2989
|
-
|
|
3078
|
+
//#endregion sort
|
|
3079
|
+
//#region groupBy
|
|
3080
|
+
this.addGroupByKey = this.updater((state, metaDataKey) => ({
|
|
3081
|
+
...state,
|
|
3082
|
+
groupBy: [...state.groupBy, { key: metaDataKey, expandedHeaders: [], sort: '' }]
|
|
3083
|
+
}));
|
|
3084
|
+
this.removeGroupByKey = this.updater((state, groupByKey) => {
|
|
3085
|
+
const groupBy = state.groupBy.filter(key => groupByKey !== key.key);
|
|
3086
|
+
return ({
|
|
3087
|
+
...state,
|
|
3088
|
+
groupBy,
|
|
3089
|
+
userDefined: { ...state.userDefined, noGroups: groupBy.length === 0 }
|
|
3090
|
+
});
|
|
3091
|
+
});
|
|
3092
|
+
this.updateExpandedGroups = this.updater((state, data) => {
|
|
3093
|
+
const gbk = replaceInArrayWithClone(state.groupBy, k => k.key === data.key, gk => {
|
|
3094
|
+
if (data.isExpanded) {
|
|
3095
|
+
if (gk.expandedHeaders === 'all' || gk.expandedHeaders.includes(data.groupUniqueName))
|
|
3096
|
+
return;
|
|
3097
|
+
gk.expandedHeaders = [...gk.expandedHeaders, data.groupUniqueName];
|
|
3098
|
+
}
|
|
3099
|
+
else {
|
|
3100
|
+
//we need to make sure it will not = all at this point. See generic table setExpanded
|
|
3101
|
+
if (gk.expandedHeaders !== 'all') {
|
|
3102
|
+
gk.expandedHeaders = gk.expandedHeaders.filter(g => g !== data.groupUniqueName);
|
|
3103
|
+
}
|
|
3104
|
+
}
|
|
3105
|
+
});
|
|
3106
|
+
return ({
|
|
3107
|
+
...state,
|
|
3108
|
+
groupBy: gbk
|
|
3109
|
+
});
|
|
3110
|
+
});
|
|
3111
|
+
this.expandAllOfGroup = this.updater((state, data) => {
|
|
3112
|
+
const newGroupedData = state.groupBy.map(gb => ({
|
|
3113
|
+
key: gb.key,
|
|
3114
|
+
expandedHeaders: data.groupHeadersByKey[gb.key]?.map(g => g.uniqueName) ?? gb.expandedHeaders,
|
|
3115
|
+
sort: gb.sort,
|
|
3116
|
+
}));
|
|
3117
|
+
return ({ ...state, groupBy: newGroupedData });
|
|
3118
|
+
});
|
|
3119
|
+
this.collapseAll = this.updater((state) => ({
|
|
3120
|
+
...state,
|
|
3121
|
+
groupBy: state.groupBy.map(gb => ({ key: gb.key, expandedHeaders: [], sort: gb.sort }))
|
|
3122
|
+
}));
|
|
3123
|
+
this.collapseAllOfKey = this.updater((state, data) => ({
|
|
3124
|
+
...state,
|
|
3125
|
+
groupBy: state.groupBy.map(gb => ({
|
|
3126
|
+
key: gb.key,
|
|
3127
|
+
expandedHeaders: data.keys.includes(gb.key) ? [] : gb.expandedHeaders,
|
|
3128
|
+
sort: gb.sort,
|
|
3129
|
+
}))
|
|
3130
|
+
}));
|
|
3131
|
+
this.updateGroupBySort = this.updater((state, data) => {
|
|
3132
|
+
const newGroupedData = replaceInArrayWithClone(state.groupBy, gb => gb.key === data.key, gb => {
|
|
3133
|
+
gb.sort = data.sort;
|
|
3134
|
+
});
|
|
3135
|
+
return ({ ...state, groupBy: newGroupedData });
|
|
3136
|
+
});
|
|
3137
|
+
this.getGroupBySortDirection = (key) => computed(() => {
|
|
3138
|
+
const groupBy = this.state().groupBy.find(gb => gb.key === key);
|
|
3139
|
+
return groupBy ? groupBy.sort : '';
|
|
3140
|
+
});
|
|
3141
|
+
this.cycleGroupBySortDirection = this.updater((state, key) => {
|
|
3142
|
+
const currentGroupBy = state.groupBy.find(gb => gb.key === key);
|
|
3143
|
+
console.log(currentGroupBy);
|
|
3144
|
+
if (!currentGroupBy)
|
|
3145
|
+
return state;
|
|
3146
|
+
let nextSort;
|
|
3147
|
+
switch (currentGroupBy.sort) {
|
|
3148
|
+
case '':
|
|
3149
|
+
case undefined:
|
|
3150
|
+
nextSort = 'desc';
|
|
3151
|
+
break;
|
|
3152
|
+
case 'desc':
|
|
3153
|
+
nextSort = 'asc';
|
|
3154
|
+
break;
|
|
3155
|
+
case 'asc':
|
|
3156
|
+
nextSort = '';
|
|
3157
|
+
break;
|
|
3158
|
+
}
|
|
3159
|
+
const newGroupedData = replaceInArrayWithClone(state.groupBy, gb => gb.key === key, gb => {
|
|
3160
|
+
gb.sort = nextSort;
|
|
3161
|
+
});
|
|
3162
|
+
return ({ ...state, groupBy: newGroupedData });
|
|
3163
|
+
});
|
|
3164
|
+
this.#$groupBy = this.selectSignal(state => state.groupBy);
|
|
3165
|
+
this.$groupByData = this.selectSignal(this.#$groupBy, this.$metaDataArray, (gb, mds) => gb.filter(bg => mds.some(md => md.key === bg.key)), {
|
|
2990
3166
|
equal: (prev, curr) => prev.length === curr.length && curr.every((k, i) => prev[i].key === k.key)
|
|
2991
3167
|
});
|
|
2992
3168
|
this.groupByKeys$ = this.select(state => state.groupBy.map(gbk => gbk.key))
|
|
2993
3169
|
.pipe(distinctUntilChanged((prev, curr) => prev.length === curr.length && curr.every((k, i) => prev[i] === k)));
|
|
3170
|
+
this.$userDefinedNoGroups = this.selectSignal(state => state.userDefined.noGroups);
|
|
2994
3171
|
this.expandedGroups$ = this.select(state => state.groupBy).pipe(distinctUntilChanged((a, b) => {
|
|
2995
3172
|
const aa = a.flatMap(g => g.expandedHeaders);
|
|
2996
3173
|
const bb = b.flatMap(g => g.expandedHeaders);
|
|
2997
3174
|
return aa.length === bb.length && aa.every((k) => bb.includes(k));
|
|
2998
3175
|
}));
|
|
2999
3176
|
this.$expandGroups = this.selectSignal(state => state.groupBy, { equal: (a, b) => {
|
|
3000
|
-
const aa = a.flatMap(g => g.expandedHeaders);
|
|
3001
|
-
const bb = b.flatMap(g => g.expandedHeaders);
|
|
3177
|
+
const aa = a.flatMap(g => g.expandedHeaders === 'all' ? ['all'] : g.expandedHeaders);
|
|
3178
|
+
const bb = b.flatMap(g => g.expandedHeaders === 'all' ? ['all'] : g.expandedHeaders);
|
|
3002
3179
|
return aa.length === bb.length && aa.every((k) => bb.includes(k));
|
|
3003
3180
|
} });
|
|
3004
3181
|
this.$getIsExpanded = (columnKey, groupUniqueName) => {
|
|
3005
|
-
return this.selectSignal(state => !!state.groupBy.filter(g => g.key === columnKey && g.expandedHeaders.includes(groupUniqueName)).length);
|
|
3182
|
+
return this.selectSignal(state => !!state.groupBy.filter(g => g.key === columnKey && (g.expandedHeaders.includes(groupUniqueName) || g.expandedHeaders === 'all')).length);
|
|
3006
3183
|
};
|
|
3184
|
+
this.$expandAllGroupsOfKey = (columnKey) => this.selectSignal(state => state.groupBy.find(g => g.key === columnKey)?.expandedHeaders === 'all');
|
|
3007
3185
|
this.$sortedGroupsUpdates = this.selectSignal(state => state.groupBy, { equal: (a, b) => sortsAreSame(a.map(g => ({ active: g.key, direction: g.sort })), b.map(g => ({ active: g.key, direction: g.sort }))) });
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
this
|
|
3011
|
-
this
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
});
|
|
3015
|
-
this.$notPersistedTableSettings = this.selectSignal(state => state.notPersistedTableSettings);
|
|
3016
|
-
this.tableSettings$ = toObservable(this.$tableSettings);
|
|
3017
|
-
this.$props = this.selectSignal(s => s.props);
|
|
3018
|
-
this.$getLinkInfo = (md) => this.selectSignal(state => state.linkMaps[md.key]);
|
|
3186
|
+
//#endregion groupBy
|
|
3187
|
+
//#region page paginator and show all
|
|
3188
|
+
this.setCurrentPage = this.updater((state, currentPage) => ({ ...state, currentPage }));
|
|
3189
|
+
this.setPageSize = this.updater((state, pageSize) => ({ ...state, pageSize }));
|
|
3190
|
+
this.setUserDefinedPageSize = this.updater((state, pageSize) => ({ ...state, userDefined: { ...state.userDefined, pageSize } }));
|
|
3191
|
+
this.setUserDefinedShowAll = this.updater((state, showAll) => ({ ...state, showAll, userDefined: { ...state.userDefined, showAll } }));
|
|
3019
3192
|
this.$isVirtual = this.selectSignal(state => state.notPersistedTableSettings.useVirtualScroll
|
|
3020
3193
|
|| state.showAll
|
|
3021
3194
|
|| state.userDefined?.showAll);
|
|
3195
|
+
this.$showAll = this.selectSignal(s => s.userDefined?.showAll ?? s.showAll);
|
|
3022
3196
|
this.$viewType = this.selectSignal(state => {
|
|
3023
3197
|
const usePaginator = state.notPersistedTableSettings.usePaginator;
|
|
3024
3198
|
const showAll = state.showAll || state.userDefined?.showAll;
|
|
@@ -3036,6 +3210,30 @@ class TableStore extends ComponentStore {
|
|
|
3036
3210
|
return 'all';
|
|
3037
3211
|
}
|
|
3038
3212
|
});
|
|
3213
|
+
this.$userDefinedPageSize = this.selectSignal(state => (state.userDefined.pageSize));
|
|
3214
|
+
this.$currentPage = this.selectSignal(state => state.currentPage);
|
|
3215
|
+
this.$pageSize = this.selectSignal(s => s.userDefined?.pageSize || s.pageSize);
|
|
3216
|
+
//#endregion page paginator and show all
|
|
3217
|
+
//#region table settings and props
|
|
3218
|
+
this.$tableSettings = this.selectSignal(state => {
|
|
3219
|
+
const ts = { ...state.persistedTableSettings, ...state.notPersistedTableSettings };
|
|
3220
|
+
return ts;
|
|
3221
|
+
});
|
|
3222
|
+
this.$notPersistedTableSettings = this.selectSignal(state => state.notPersistedTableSettings);
|
|
3223
|
+
this.tableSettings$ = toObservable(this.$tableSettings);
|
|
3224
|
+
this.$props = this.selectSignal(s => s.props);
|
|
3225
|
+
//#endregion table settings and props
|
|
3226
|
+
this.setUserDefinedRowHeight = this.updater((state, rowHeight) => {
|
|
3227
|
+
return ({ ...state, userDefined: { ...state.userDefined, rowHeight } });
|
|
3228
|
+
});
|
|
3229
|
+
this.setUserDefinedHeaderHeight = this.updater((state, headerHeight) => {
|
|
3230
|
+
return ({ ...state, userDefined: { ...state.userDefined, headerHeight } });
|
|
3231
|
+
});
|
|
3232
|
+
this.$userDefinedRowHeight = this.selectSignal(state => (state.userDefined.rowHeight));
|
|
3233
|
+
this.$userDefinedHeaderHeight = this.selectSignal(state => (state.userDefined.headerHeight));
|
|
3234
|
+
this.$footerCollapsed = this.selectSignal(state => state.persistedTableSettings.collapseFooter);
|
|
3235
|
+
this.$headerCollapsed = this.selectSignal(state => state.persistedTableSettings.collapseHeader);
|
|
3236
|
+
this.$getLinkInfo = (md) => this.selectSignal(state => state.linkMaps[md.key]);
|
|
3039
3237
|
this.resetState = this.updater((state) => {
|
|
3040
3238
|
const sorted = this.$preSort();
|
|
3041
3239
|
return ({ ...state, hiddenKeys: [], sorted, filters: {}, groupBy: [], userDefined: { widths: {}, order: {}, table: {} } });
|
|
@@ -3051,6 +3249,7 @@ class TableStore extends ComponentStore {
|
|
|
3051
3249
|
return newState;
|
|
3052
3250
|
case 'Group By':
|
|
3053
3251
|
newState.groupBy = [];
|
|
3252
|
+
newState.userDefined.noGroups = false;
|
|
3054
3253
|
return newState;
|
|
3055
3254
|
case 'Hidden Columns':
|
|
3056
3255
|
newState.hiddenKeys = [];
|
|
@@ -3086,7 +3285,8 @@ class TableStore extends ComponentStore {
|
|
|
3086
3285
|
const metaData = state.metaData;
|
|
3087
3286
|
const sorted = incomingTableState.sorted?.length ? incomingTableState.sorted
|
|
3088
3287
|
: state.initializationState <= InitializationState.Created ? createPreSort(metaData) : state.sorted;
|
|
3089
|
-
|
|
3288
|
+
const groupBy = incomingTableState.groupBy?.length ? incomingTableState.groupBy : incomingTableState.userDefined?.noGroups ? [] : state.groupBy;
|
|
3289
|
+
return { ...state, ...incomingTableState, metaData, sorted, groupBy };
|
|
3090
3290
|
};
|
|
3091
3291
|
this.setTableSettings = this.updater((state, settings) => {
|
|
3092
3292
|
const s = {
|
|
@@ -3097,6 +3297,11 @@ class TableStore extends ComponentStore {
|
|
|
3097
3297
|
};
|
|
3098
3298
|
s.pageSize = settings.tableSettings?.paginatorSettings?.pageSize ?? s.pageSize;
|
|
3099
3299
|
s.showAll = settings.tableSettings?.paginatorSettings?.defaultAll ?? s.showAll;
|
|
3300
|
+
s.groupBy = (settings.tableSettings?.groupBySettings || []).map(g => ({
|
|
3301
|
+
expandedHeaders: g.expanded ? 'all' : [],
|
|
3302
|
+
key: g.key,
|
|
3303
|
+
sort: ''
|
|
3304
|
+
}));
|
|
3100
3305
|
return s;
|
|
3101
3306
|
});
|
|
3102
3307
|
this.setMetaData = this.updater((state, md) => {
|
|
@@ -3116,104 +3321,9 @@ class TableStore extends ComponentStore {
|
|
|
3116
3321
|
const initializationState = state.initializationState == InitializationState.Created ? InitializationState.MetaDataLoaded : state.initializationState;
|
|
3117
3322
|
return { ...state, initializationState, metaData, sorted, userDefined: { ...state.userDefined, order: order } };
|
|
3118
3323
|
});
|
|
3119
|
-
this.showColumn = this.updater((state, key) => ({
|
|
3120
|
-
...state,
|
|
3121
|
-
hiddenKeys: state.hiddenKeys.filter(k => k !== key),
|
|
3122
|
-
}));
|
|
3123
|
-
this.hideColumn = this.updater((state, key) => ({
|
|
3124
|
-
...state,
|
|
3125
|
-
hiddenKeys: [...state.hiddenKeys.filter(k => k !== key), key],
|
|
3126
|
-
}));
|
|
3127
|
-
this.setHiddenColumns = this.updater((state, displayCols) => {
|
|
3128
|
-
return ({ ...state, hiddenKeys: displayCols.filter(d => !d.visible).map(d => d.key) });
|
|
3129
|
-
});
|
|
3130
|
-
this.setUserDefinedWidth = this.updater((state, colWidths) => {
|
|
3131
|
-
const userDefinedWidths = { ...state.userDefined.widths };
|
|
3132
|
-
colWidths.forEach(cw => {
|
|
3133
|
-
userDefinedWidths[cw.key] = cw.widthInPixel;
|
|
3134
|
-
});
|
|
3135
|
-
return { ...state, userDefined: { ...state.userDefined, widths: userDefinedWidths } };
|
|
3136
|
-
});
|
|
3137
|
-
this.setUserDefinedOrder = this.updater((state, moved) => {
|
|
3138
|
-
const { newOrder, oldOrder } = moved;
|
|
3139
|
-
const mdsArr = orderedStateVisibleMetaData(state);
|
|
3140
|
-
moveItemInArray(mdsArr, oldOrder, newOrder);
|
|
3141
|
-
const userDefinedOrder = mdsArr.reduce((aggregate, current, index) => {
|
|
3142
|
-
aggregate[current.key] = index;
|
|
3143
|
-
return aggregate;
|
|
3144
|
-
}, {});
|
|
3145
|
-
return ({ ...state, userDefined: { ...state.userDefined, order: userDefinedOrder } });
|
|
3146
|
-
});
|
|
3147
|
-
this.setUserDefinedRowHeight = this.updater((state, rowHeight) => {
|
|
3148
|
-
return ({ ...state, userDefined: { ...state.userDefined, rowHeight } });
|
|
3149
|
-
});
|
|
3150
|
-
this.setUserDefinedHeaderHeight = this.updater((state, headerHeight) => {
|
|
3151
|
-
return ({ ...state, userDefined: { ...state.userDefined, headerHeight } });
|
|
3152
|
-
});
|
|
3153
|
-
this.addFilter = this.updater((state, filter) => {
|
|
3154
|
-
return this.addFiltersToState(state, [filter]);
|
|
3155
|
-
});
|
|
3156
|
-
this.addFilters = this.updater((state, filters) => {
|
|
3157
|
-
return this.addFiltersToState(state, filters);
|
|
3158
|
-
});
|
|
3159
|
-
this.removeFilter = this.updater((state, filterId) => {
|
|
3160
|
-
const filtersCopy = { ...state.filters };
|
|
3161
|
-
delete filtersCopy[filterId];
|
|
3162
|
-
return ({ ...state, filters: filtersCopy });
|
|
3163
|
-
});
|
|
3164
|
-
this.removeFilters = this.updater((state, filterIds) => {
|
|
3165
|
-
const filtersCopy = { ...state.filters };
|
|
3166
|
-
filterIds.forEach(id => { delete filtersCopy[id]; });
|
|
3167
|
-
return ({ ...state, filters: filtersCopy });
|
|
3168
|
-
});
|
|
3169
|
-
this.clearFilters = this.updater((state) => ({ ...state, filters: {} }));
|
|
3170
|
-
this.addFiltersToState = (state, filters) => {
|
|
3171
|
-
var customFilters = filters.filter(isCustomFilter);
|
|
3172
|
-
var filterInfos = filters.filter(isFilterInfo);
|
|
3173
|
-
const filtersObj = filterInfos
|
|
3174
|
-
.filter(fltr => Object.keys(state.metaData).some(key => key === fltr.key) || console.warn(`Meta data with key ${fltr.key} not found`))
|
|
3175
|
-
.reduce((filtersObj, filter) => {
|
|
3176
|
-
if (!filter.filterId) {
|
|
3177
|
-
filter.filterId = crypto.randomUUID();
|
|
3178
|
-
}
|
|
3179
|
-
filtersObj[filter.filterId] = filter;
|
|
3180
|
-
return filtersObj;
|
|
3181
|
-
}, {});
|
|
3182
|
-
customFilters.forEach(fltr => {
|
|
3183
|
-
if (!fltr.filterId) {
|
|
3184
|
-
fltr.filterId = crypto.randomUUID();
|
|
3185
|
-
}
|
|
3186
|
-
filtersObj[fltr.filterId] = fltr;
|
|
3187
|
-
});
|
|
3188
|
-
return {
|
|
3189
|
-
...state,
|
|
3190
|
-
filters: { ...state.filters, ...filtersObj }
|
|
3191
|
-
};
|
|
3192
|
-
};
|
|
3193
|
-
this.setSort = this.updater((state, { key, direction }) => {
|
|
3194
|
-
const sortArray = state.sorted.filter(s => s.active !== key);
|
|
3195
|
-
if (direction) {
|
|
3196
|
-
sortArray.unshift({ active: key, direction });
|
|
3197
|
-
}
|
|
3198
|
-
return {
|
|
3199
|
-
...state,
|
|
3200
|
-
sorted: sortArray,
|
|
3201
|
-
};
|
|
3202
|
-
});
|
|
3203
|
-
this.setAllSort = this.updater((state, sortArray) => {
|
|
3204
|
-
return {
|
|
3205
|
-
...state,
|
|
3206
|
-
sorted: sortArray,
|
|
3207
|
-
};
|
|
3208
|
-
});
|
|
3209
|
-
this.setCurrentPage = this.updater((state, currentPage) => ({ ...state, currentPage }));
|
|
3210
|
-
this.setPageSize = this.updater((state, pageSize) => ({ ...state, pageSize }));
|
|
3211
|
-
this.setUserDefinedPageSize = this.updater((state, pageSize) => ({ ...state, userDefined: { ...state.userDefined, pageSize } }));
|
|
3212
|
-
this.setUserDefinedShowAll = this.updater((state, showAll) => ({ ...state, showAll, userDefined: { ...state.userDefined, showAll } }));
|
|
3213
3324
|
this.setProps = this.updater((state, props) => {
|
|
3214
3325
|
return ({ ...state, props });
|
|
3215
3326
|
});
|
|
3216
|
-
this.setTableWidth = this.updater((state, widthInPixels) => ({ ...state, userDefined: { ...state.userDefined, table: { width: widthInPixels } } }));
|
|
3217
3327
|
this.setInitializationState = this.updater((state, initializationState) => {
|
|
3218
3328
|
return { ...state, initializationState };
|
|
3219
3329
|
});
|
|
@@ -3227,73 +3337,6 @@ class TableStore extends ComponentStore {
|
|
|
3227
3337
|
tableSettings.collapseFooter = options?.collapseFooter ?? !tableSettings.collapseFooter;
|
|
3228
3338
|
return ({ ...state, persistedTableSettings: new PersistedTableSettings(tableSettings) });
|
|
3229
3339
|
});
|
|
3230
|
-
this.addGroupByKey = this.updater((state, metaDataKey) => ({
|
|
3231
|
-
...state,
|
|
3232
|
-
groupBy: [...state.groupBy, { key: metaDataKey, expandedHeaders: [], sort: '' }]
|
|
3233
|
-
}));
|
|
3234
|
-
this.removeGroupByKey = this.updater((state, groupByKey) => ({
|
|
3235
|
-
...state,
|
|
3236
|
-
groupBy: state.groupBy.filter(key => groupByKey !== key.key)
|
|
3237
|
-
}));
|
|
3238
|
-
this.updateExpandedGroups = this.updater((state, data) => {
|
|
3239
|
-
const gbk = replaceInArrayWithClone(state.groupBy, k => k.key === data.key, gk => {
|
|
3240
|
-
gk.expandedHeaders = data.isExpanded ? [...gk.expandedHeaders, data.groupUniqueName] : gk.expandedHeaders.filter(g => g !== data.groupUniqueName);
|
|
3241
|
-
});
|
|
3242
|
-
return ({
|
|
3243
|
-
...state,
|
|
3244
|
-
groupBy: gbk
|
|
3245
|
-
});
|
|
3246
|
-
});
|
|
3247
|
-
this.expandAllOfGroup = this.updater((state, data) => {
|
|
3248
|
-
const newGroupedData = state.groupBy.map(gb => ({
|
|
3249
|
-
key: gb.key,
|
|
3250
|
-
expandedHeaders: data.groupHeadersByKey[gb.key]?.map(g => g.uniqueName) ?? gb.expandedHeaders
|
|
3251
|
-
}));
|
|
3252
|
-
return ({ ...state, groupBy: newGroupedData });
|
|
3253
|
-
});
|
|
3254
|
-
this.collapseAll = this.updater((state) => ({
|
|
3255
|
-
...state,
|
|
3256
|
-
groupBy: state.groupBy.map(gb => ({ key: gb.key, expandedHeaders: [], sort: gb.sort }))
|
|
3257
|
-
}));
|
|
3258
|
-
this.collapseAllOfKey = this.updater((state, data) => ({
|
|
3259
|
-
...state,
|
|
3260
|
-
groupBy: state.groupBy.map(gb => ({
|
|
3261
|
-
key: gb.key,
|
|
3262
|
-
expandedHeaders: data.keys.includes(gb.key) ? [] : gb.expandedHeaders,
|
|
3263
|
-
sort: gb.sort,
|
|
3264
|
-
}))
|
|
3265
|
-
}));
|
|
3266
|
-
this.updateGroupBySort = this.updater((state, data) => {
|
|
3267
|
-
const newGroupedData = replaceInArrayWithClone(state.groupBy, gb => gb.key === data.key, gb => {
|
|
3268
|
-
gb.sort = data.sort;
|
|
3269
|
-
});
|
|
3270
|
-
return ({ ...state, groupBy: newGroupedData });
|
|
3271
|
-
});
|
|
3272
|
-
this.getGroupBySortDirection = (key) => computed(() => {
|
|
3273
|
-
const groupBy = this.state().groupBy.find(gb => gb.key === key);
|
|
3274
|
-
return groupBy ? groupBy.sort : '';
|
|
3275
|
-
});
|
|
3276
|
-
this.cycleGroupBySortDirection = this.updater((state, key) => {
|
|
3277
|
-
const currentGroupBy = state.groupBy.find(gb => gb.key === key);
|
|
3278
|
-
if (!currentGroupBy)
|
|
3279
|
-
return state;
|
|
3280
|
-
let nextSort;
|
|
3281
|
-
switch (currentGroupBy.sort) {
|
|
3282
|
-
case '':
|
|
3283
|
-
nextSort = 'desc';
|
|
3284
|
-
break;
|
|
3285
|
-
case 'desc':
|
|
3286
|
-
nextSort = 'asc';
|
|
3287
|
-
break;
|
|
3288
|
-
case 'asc':
|
|
3289
|
-
nextSort = '';
|
|
3290
|
-
break;
|
|
3291
|
-
}
|
|
3292
|
-
const newGroupedData = replaceInArrayWithClone(state.groupBy, gb => gb.key === key, gb => {
|
|
3293
|
-
gb.sort = nextSort;
|
|
3294
|
-
});
|
|
3295
|
-
return ({ ...state, groupBy: newGroupedData });
|
|
3296
|
-
});
|
|
3297
3340
|
this.setLinkMaps = this.updater((state, maps) => {
|
|
3298
3341
|
return ({ ...state, linkMaps: maps });
|
|
3299
3342
|
});
|
|
@@ -3312,6 +3355,7 @@ class TableStore extends ComponentStore {
|
|
|
3312
3355
|
return this;
|
|
3313
3356
|
};
|
|
3314
3357
|
}
|
|
3358
|
+
#$groupBy;
|
|
3315
3359
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: TableStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3316
3360
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: TableStore }); }
|
|
3317
3361
|
}
|
|
@@ -3332,19 +3376,36 @@ const resetable = [
|
|
|
3332
3376
|
];
|
|
3333
3377
|
|
|
3334
3378
|
class MultiSortDirective extends MatSort {
|
|
3379
|
+
#onSortChange;
|
|
3380
|
+
#onStateSortUpdate;
|
|
3335
3381
|
constructor() {
|
|
3336
3382
|
super();
|
|
3337
3383
|
this.state = inject(TableStore);
|
|
3338
|
-
this
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
const
|
|
3343
|
-
if (
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
this.sortChange.
|
|
3347
|
-
}
|
|
3384
|
+
this.$sortChange = toSignal(this.sortChange, {
|
|
3385
|
+
equal: (f, s) => f?.active === s?.active && f?.direction === s?.direction
|
|
3386
|
+
});
|
|
3387
|
+
this.#onSortChange = effect(() => {
|
|
3388
|
+
const sortChange = this.$sortChange();
|
|
3389
|
+
if (!sortChange)
|
|
3390
|
+
return;
|
|
3391
|
+
untracked(() => {
|
|
3392
|
+
this.state.setSort({ key: sortChange.active, direction: sortChange.direction });
|
|
3393
|
+
});
|
|
3394
|
+
});
|
|
3395
|
+
this.#onStateSortUpdate = effect(() => {
|
|
3396
|
+
const rules = this.state.$getSorts();
|
|
3397
|
+
if (!rules)
|
|
3398
|
+
return;
|
|
3399
|
+
untracked(() => {
|
|
3400
|
+
const topRule = { active: rules[0]?.active || '', direction: rules[0]?.direction || '' };
|
|
3401
|
+
const topActiveChanged = topRule.active !== this.active || '';
|
|
3402
|
+
const topDirectionChanged = topRule.direction !== this.direction || '';
|
|
3403
|
+
if (topActiveChanged || topDirectionChanged) {
|
|
3404
|
+
this.active = topRule.active;
|
|
3405
|
+
this.direction = topRule.direction;
|
|
3406
|
+
this.sortChange.emit(topRule);
|
|
3407
|
+
}
|
|
3408
|
+
});
|
|
3348
3409
|
});
|
|
3349
3410
|
}
|
|
3350
3411
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: MultiSortDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
@@ -4532,56 +4593,54 @@ function groupData(groupByData, groupData, level = 1, metaData, parentGroupName)
|
|
|
4532
4593
|
};
|
|
4533
4594
|
});
|
|
4534
4595
|
if (groupByData.sort) {
|
|
4535
|
-
groupedDataArr =
|
|
4596
|
+
groupedDataArr = sortGroupsByGroupSortOneLevel(groupByData, groupedDataArr);
|
|
4536
4597
|
}
|
|
4537
4598
|
return groupedDataArr;
|
|
4538
4599
|
}
|
|
4539
4600
|
function setCustomGroupBy(customGroupBy) {
|
|
4540
4601
|
tbGroupBy = customGroupBy;
|
|
4541
4602
|
}
|
|
4542
|
-
function updateGroupByState(groupedData, { data, groups, expanded,
|
|
4603
|
+
function updateGroupByState(groupedData, { data, groups, expanded, groupSorts }, firstRun, metaData) {
|
|
4543
4604
|
if (firstRun
|
|
4544
|
-
|| dataUpdated(data, groups, expanded,
|
|
4545
|
-
|| groupsUpdated(groups, expanded,
|
|
4605
|
+
|| dataUpdated(data, groups, expanded, groupSorts)
|
|
4606
|
+
|| groupsUpdated(groups, expanded, groupSorts)) {
|
|
4546
4607
|
const combinedGroupsAndSorts = groups.value.map(g => {
|
|
4547
|
-
const sortForGroup =
|
|
4608
|
+
const sortForGroup = groupSorts.value.find(s => s.key === g.key);
|
|
4548
4609
|
return { ...g, sort: sortForGroup?.sort || '' };
|
|
4549
4610
|
});
|
|
4550
4611
|
groupedData = groups.value.length ? getGroupedData(data.value, combinedGroupsAndSorts, metaData) : data.value;
|
|
4551
4612
|
}
|
|
4552
4613
|
else {
|
|
4553
|
-
|
|
4554
|
-
groupedData = sort(groupedData);
|
|
4555
|
-
function sort(groups) {
|
|
4556
|
-
const sortData = sorts.value?.find(gs => gs.key === groups[0]?.key);
|
|
4557
|
-
if (sortData?.sort) {
|
|
4558
|
-
groups = sortGroups(sortData, groups);
|
|
4559
|
-
}
|
|
4560
|
-
else {
|
|
4561
|
-
groups = groups.toSorted((a, b) => a[initIndexSymbol] - b[initIndexSymbol]);
|
|
4562
|
-
}
|
|
4563
|
-
curr = curr.filter(c => c.key !== sortData?.key);
|
|
4564
|
-
if (!groups[0]?.hasTheData) {
|
|
4565
|
-
groups.forEach((g, i) => groups[i].groups = sort(g.groups));
|
|
4566
|
-
}
|
|
4567
|
-
return groups;
|
|
4568
|
-
}
|
|
4614
|
+
groupedData = sortGroupsDeep(groupedData, groupSorts.value);
|
|
4569
4615
|
}
|
|
4570
4616
|
const newDisplayData = expanded.value.length === 0
|
|
4571
4617
|
? groupedData
|
|
4572
|
-
: groupedData.map(group => mapGroupHeader(group, expanded.value.flatMap(g => g.expandedHeaders))).flat();
|
|
4618
|
+
: groupedData.map(group => mapGroupHeader(group, expanded.value.flatMap(g => g.expandedHeaders), expanded.value.filter(g => g.expandedHeaders === 'all').map(g => g.key))).flat();
|
|
4573
4619
|
return ({ displayData: newDisplayData, groupedData });
|
|
4574
4620
|
}
|
|
4575
|
-
function
|
|
4621
|
+
function sortGroupsByGroupSortOneLevel(sortData, groups) {
|
|
4576
4622
|
const direction = sortData.sort;
|
|
4577
4623
|
const multiplier = direction === 'asc' ? 1 : -1;
|
|
4578
4624
|
return groups.toSorted((a, b) => a.length === b.length ? 0 : (a.length > b.length ? 1 : -1) * multiplier);
|
|
4579
4625
|
}
|
|
4580
|
-
function
|
|
4581
|
-
const
|
|
4626
|
+
function sortGroupsDeep(groups, sorts) {
|
|
4627
|
+
const sortData = sorts?.find(gs => gs.key === groups[0]?.key);
|
|
4628
|
+
if (sortData?.sort) {
|
|
4629
|
+
groups = sortGroupsByGroupSortOneLevel(sortData, groups);
|
|
4630
|
+
}
|
|
4631
|
+
else {
|
|
4632
|
+
groups = groups.toSorted((a, b) => a[initIndexSymbol] - b[initIndexSymbol]);
|
|
4633
|
+
}
|
|
4634
|
+
if (!groups[0]?.hasTheData) {
|
|
4635
|
+
groups.forEach((g, i) => groups[i].groups = sortGroupsDeep(g.groups, sorts));
|
|
4636
|
+
}
|
|
4637
|
+
return groups;
|
|
4638
|
+
}
|
|
4639
|
+
function mapGroupHeader(obj, expandedHeaders, expandAllGroups = []) {
|
|
4640
|
+
const showChildren = expandedHeaders === true || expandedHeaders.includes(obj.uniqueName) || expandAllGroups.includes(obj.key);
|
|
4582
4641
|
const children = !showChildren ? [] :
|
|
4583
4642
|
obj.hasTheData ? obj.children
|
|
4584
|
-
: obj.groups.map(a => mapGroupHeader(a, expandedHeaders));
|
|
4643
|
+
: obj.groups.map(a => mapGroupHeader(a, expandedHeaders, expandAllGroups));
|
|
4585
4644
|
return [obj, ...children].flat();
|
|
4586
4645
|
}
|
|
4587
4646
|
function dataUpdated(data, groups, expandedGroups, sorts) {
|
|
@@ -4600,12 +4659,18 @@ const getAllGroupHeaderNames = (data) => {
|
|
|
4600
4659
|
}, {});
|
|
4601
4660
|
};
|
|
4602
4661
|
const getAllGroupHeaderNamesByKeys = (data, keys) => {
|
|
4603
|
-
const groups = getGroupHeaders(data, (d) => d.isGroupHeader && keys.includes(d.key));
|
|
4604
|
-
|
|
4662
|
+
const groups = getGroupHeaders(data, (d) => d.isGroupHeader && keys.includes(d.key), [], keys.length === 1);
|
|
4663
|
+
const a = supportsGroupBy ? Object.groupBy(groups, group => group.key) : groupBy(groups, 'key');
|
|
4664
|
+
return Object.entries(a).reduce((names, [key, groups]) => {
|
|
4665
|
+
names[key] = groups.map(g => ({ uniqueName: g.uniqueName, key: g.key }));
|
|
4666
|
+
return names;
|
|
4667
|
+
}, {});
|
|
4605
4668
|
};
|
|
4606
|
-
const getGroupHeaders = (data, filterFunc, arr = []) => {
|
|
4669
|
+
const getGroupHeaders = (data, filterFunc, arr = [], oneLevel = false) => {
|
|
4607
4670
|
const headers = data.filter(filterFunc);
|
|
4608
4671
|
arr.push(...headers);
|
|
4672
|
+
if (oneLevel)
|
|
4673
|
+
return arr;
|
|
4609
4674
|
headers.forEach(h => { if (h.hasTheData === false && !!h.groups.length)
|
|
4610
4675
|
getGroupHeaders(h.groups, filterFunc, arr); });
|
|
4611
4676
|
return arr;
|
|
@@ -4625,7 +4690,8 @@ class GenericTableComponent {
|
|
|
4625
4690
|
this.$table = viewChild(MatTable);
|
|
4626
4691
|
this.$dropList = viewChild(CdkDropList);
|
|
4627
4692
|
this.selection$ = output({ alias: 'selection' });
|
|
4628
|
-
this.$
|
|
4693
|
+
this.$displayData = input.required({ alias: 'displayData' });
|
|
4694
|
+
this.$displayDataLength = computed(() => this.$displayData().length);
|
|
4629
4695
|
this.$data = input.required({ alias: 'data' });
|
|
4630
4696
|
this.$rows = input([], { alias: 'rows' });
|
|
4631
4697
|
this.$columnInfos = input.required({ alias: 'columnInfos' });
|
|
@@ -4981,6 +5047,10 @@ class GenericTableComponent {
|
|
|
4981
5047
|
return row.isGroupHeader;
|
|
4982
5048
|
}
|
|
4983
5049
|
setExpanded(key, groupUniqueName, isExpanded) {
|
|
5050
|
+
if (!isExpanded && this.state.$expandAllGroupsOfKey(key)()) {
|
|
5051
|
+
const groupHeaders = getAllGroupHeaderNamesByKeys(this.$displayData(), [key]);
|
|
5052
|
+
this.state.expandAllOfGroup({ groupHeadersByKey: groupHeaders });
|
|
5053
|
+
}
|
|
4984
5054
|
this.state.updateExpandedGroups({ key, isExpanded, groupUniqueName });
|
|
4985
5055
|
}
|
|
4986
5056
|
buildColumn(column) {
|
|
@@ -5047,7 +5117,7 @@ class GenericTableComponent {
|
|
|
5047
5117
|
});
|
|
5048
5118
|
}
|
|
5049
5119
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5050
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayDataLength: { classPropertyName: "$displayDataLength", publicName: "displayDataLength", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n #table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n class=\"table-drag-list\"\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\"\r\n [matTooltip]=\"$selectAllMessage()\"\r\n (change)=\"$event ? masterToggle() : null\" />\r\n <button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\" >\r\n <button mat-menu-item>\r\n <mat-slide-toggle [checked]=\"$hasSelectFilter()\" (change)=\"addSelectFilter($event.checked)\">\r\n Show Only Selected\r\n </mat-slide-toggle>\r\n </button>\r\n @if(this.$selection().selected.length)\r\n {\r\n <button mat-menu-item (click)=\"$selection().clear()\">\r\n Clear Selection\r\n </button>\r\n }\r\n <button mat-menu-item (click)=\"selectTop(+i.value)\">\r\n Select top \r\n <input #i class=\"input\" stop-propagation type=\"number\" \r\n placeholder=\"Set Size\"\r\n [value]=\"10\"\r\n [min]=\"1\"\r\n [max]=\"dataStore.state().sortedFilteredDataLength\" />\r\n </button>\r\n </mat-menu>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n [checked]=\"selection.isSelected(row)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index; let t\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\" />\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.uniqueName );\r\n @let customTemplate = (getCustomGroupRowTemplate | func : row.key)();\r\n \r\n\r\n\r\n <!-- Default group row template -->\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\" [class]=\"'group-cell'\">\r\n @if($hasSelectColumn())\r\n {\r\n @let contains = (allOfGroupSelected | func : row.uniqueName)();\r\n <mat-checkbox [checked]=\"!!contains.containsAll\"\r\n [indeterminate]=\"!!contains.containsSome && !contains.containsAll\"\r\n [matTooltip]=\"toggleGroupMessage | func : contains.length : contains.containsAll\"\r\n (change)=\"$event ? toggleGroup(row.uniqueName, contains.containsAll) : null\" />\r\n }\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.uniqueName, !expanded());\">\r\n @if (!expanded())\r\n {\r\n <mat-icon>chevron_right</mat-icon>\r\n }\r\n @else\r\n {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ row.custom ? row.groupHeaderDisplay : ((getGroupHeaderTransform | func : row.key : row.groupHeaderDisplay)() + ` (${row.length})`) }}\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n @if(customTemplate)\r\n {\r\n <ng-container *ngTemplateOutlet=\"customTemplate; context: { \r\n $implicit: row, \r\n element: row, \r\n expanded: expanded(), \r\n level: row.level, \r\n key: row.key, \r\n uniqueName: row.uniqueName, \r\n groupHeaderDisplay: row.groupHeaderDisplay, \r\n length: row.length, \r\n padding: row.padding \r\n }\" />\r\n }\r\n @else\r\n {\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\" />\r\n }\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"\r\n [style.height]=\"$rowHeight()\"\r\n [style.min-height]=\"$rowHeight()\"\r\n [styler]=\"$rowStyles()\"\r\n [element]=\"row\"\r\n [conditionalClasses]=\"$rowClasses()\"\r\n (click)=\"rowClicked(row, $event)\"\r\n />\r\n\r\n <!-- group row -->\r\n <mat-row *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\"\r\n style=\"background-color: unset;\"\r\n [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"/>\r\n</mat-table>\r\n\r\n<mat-header-row *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.height]=\"$headerHeight()\"\r\n [style.min-height]=\"$headerHeight()\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \" [style.height]=\"$footerHeight()\"\r\n [style.min-height]=\"$footerHeight()\"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: var(tb-paginator-container-size, initial)}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}.group-cell{display:flex;align-items:center}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$6.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$6.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$6.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$6.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: FunctionPipe, name: "func" }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["element", "styler"] }, { kind: "directive", type: ConditionalClassesDirective, selector: "[conditionalClasses]", inputs: ["element", "conditionalClasses"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: GenericTableComponent, isStandalone: true, selector: "tb-generic-table", inputs: { $displayData: { classPropertyName: "$displayData", publicName: "displayData", isSignal: true, isRequired: true, transformFunction: null }, $data: { classPropertyName: "$data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, $rows: { classPropertyName: "$rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, $columnInfos: { classPropertyName: "$columnInfos", publicName: "columnInfos", isSignal: true, isRequired: true, transformFunction: null }, $dataSource: { classPropertyName: "$dataSource", publicName: "dataSource", isSignal: true, isRequired: true, transformFunction: null }, $trackBy: { classPropertyName: "$trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection" }, viewQueries: [{ propertyName: "$headerRow", first: true, predicate: MatHeaderRowDef, descendants: true, isSignal: true }, { propertyName: "$footerRow", first: true, predicate: MatFooterRowDef, descendants: true, isSignal: true }, { propertyName: "$table", first: true, predicate: MatTable, descendants: true, isSignal: true }, { propertyName: "$dropList", first: true, predicate: CdkDropList, descendants: true, isSignal: true }], ngImport: i0, template: "<mat-table\r\n #table\r\n cdkDropList\r\n cdkDropListLockAxis='x'\r\n cdkDropListOrientation=\"horizontal\"\r\n class=\"table-drag-list\"\r\n [dataSource]=\"$dataSource()\"\r\n [trackBy]=\"$trackByFunction()\"\r\n [style]=\"$tableWidth()\"\r\n (cdkDropListDropped)=\"drop($event)\"\r\n>\r\n\r\n <!-- select column -->\r\n <ng-container matColumnDef=\"select\">\r\n @let selection = $selection();\r\n <mat-header-cell *matHeaderCellDef class=\"select-column\">\r\n <mat-checkbox [checked]=\"!!($masterToggleChecked())\"\r\n [indeterminate]=\"$masterToggleIndeterminate()\"\r\n [matTooltip]=\"$selectAllMessage()\"\r\n (change)=\"$event ? masterToggle() : null\" />\r\n <button mat-icon-button class=\"open-menu-icon-button\" disableRipple [matMenuTriggerFor]=\"menu\" [matMenuTriggerRestoreFocus]=\"false\">\r\n <mat-icon class=\"menu-icon\">more_vert</mat-icon>\r\n </button>\r\n <mat-menu #menu=\"matMenu\" >\r\n <button mat-menu-item>\r\n <mat-slide-toggle [checked]=\"$hasSelectFilter()\" (change)=\"addSelectFilter($event.checked)\">\r\n Show Only Selected\r\n </mat-slide-toggle>\r\n </button>\r\n @if(this.$selection().selected.length)\r\n {\r\n <button mat-menu-item (click)=\"$selection().clear()\">\r\n Clear Selection\r\n </button>\r\n }\r\n <button mat-menu-item (click)=\"selectTop(+i.value)\">\r\n Select top \r\n <input #i class=\"input\" stop-propagation type=\"number\" \r\n placeholder=\"Set Size\"\r\n [value]=\"10\"\r\n [min]=\"1\"\r\n [max]=\"dataStore.state().sortedFilteredDataLength\" />\r\n </button>\r\n </mat-menu>\r\n </mat-header-cell>\r\n\r\n <mat-cell *matCellDef=\"let row\" class=\"select-column\">\r\n <mat-checkbox\r\n [checked]=\"selection.isSelected(row)\"\r\n (click)=\"$event.stopPropagation()\"\r\n (change)=\"$event ? selection.toggle(row) : null\"/>\r\n </mat-cell>\r\n\r\n <mat-footer-cell *matFooterCellDef class=\"select-column\">\r\n {{ selection.selected.length }}\r\n </mat-footer-cell>\r\n </ng-container>\r\n\r\n\r\n <!-- index column -->\r\n <ng-container matColumnDef=\"index\">\r\n <mat-header-cell *matHeaderCellDef class=\"f-mat-header-cell\" class=\"index-column\">#\r\n </mat-header-cell>\r\n <mat-cell *matCellDef=\"let i = index; let t\" class=\"index-column\">\r\n {{ 1 + i + $offsetIndex() }}\r\n </mat-cell>\r\n <mat-footer-cell *matFooterCellDef class=\"index-column\" />\r\n </ng-container>\r\n\r\n <!-- Grouping -->\r\n <ng-container matColumnDef=\"groupHeader\">\r\n <mat-cell *matCellDef=\"let row\">\r\n @let expanded = (state.$getIsExpanded | func : row.key : row.uniqueName );\r\n @let customTemplate = (getCustomGroupRowTemplate | func : row.key)();\r\n \r\n\r\n\r\n <!-- Default group row template -->\r\n <div [style.paddingLeft]=\"row.padding + 'px !important'\" [class]=\"'group-cell'\">\r\n @if($hasSelectColumn())\r\n {\r\n @let contains = (allOfGroupSelected | func : row.uniqueName)();\r\n <mat-checkbox [checked]=\"!!contains.containsAll\"\r\n [indeterminate]=\"!!contains.containsSome && !contains.containsAll\"\r\n [matTooltip]=\"toggleGroupMessage | func : contains.length : contains.containsAll\"\r\n (change)=\"$event ? toggleGroup(row.uniqueName, contains.containsAll) : null\" />\r\n }\r\n <button mat-icon-button (click)=\"setExpanded(row.key, row.uniqueName, !expanded());\">\r\n @if (!expanded())\r\n {\r\n <mat-icon>chevron_right</mat-icon>\r\n }\r\n @else\r\n {\r\n <mat-icon>expand_more</mat-icon>\r\n }\r\n </button>\r\n {{ row.custom ? row.groupHeaderDisplay : ((getGroupHeaderTransform | func : row.key : row.groupHeaderDisplay)() + ` (${row.length})`) }}\r\n </div>\r\n <div style=\"flex-grow: 1\">\r\n @if(customTemplate)\r\n {\r\n <ng-container *ngTemplateOutlet=\"customTemplate; context: { \r\n $implicit: row, \r\n element: row, \r\n expanded: expanded(), \r\n level: row.level, \r\n key: row.key, \r\n uniqueName: row.uniqueName, \r\n groupHeaderDisplay: row.groupHeaderDisplay, \r\n length: row.length, \r\n padding: row.padding \r\n }\" />\r\n }\r\n @else\r\n {\r\n <ng-container *ngTemplateOutlet=\"state.$props().groupHeaderTemplate!; context: { element: row }\" />\r\n }\r\n </div>\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-row\r\n *matRowDef=\"let row; columns: $keys(); let i = index\"\r\n [style.height]=\"$rowHeight()\"\r\n [style.min-height]=\"$rowHeight()\"\r\n [styler]=\"$rowStyles()\"\r\n [element]=\"row\"\r\n [conditionalClasses]=\"$rowClasses()\"\r\n (click)=\"rowClicked(row, $event)\"\r\n />\r\n\r\n <!-- group row -->\r\n <mat-row *matRowDef=\"let row; columns: ['groupHeader']; when: isGroupHeader\"\r\n style=\"background-color: unset;\"\r\n [style.height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"\r\n [style.min-height]=\"state.$props().groupHeaderHeight ? state.$props().groupHeaderHeight + 'px' : $groupHeaderHeight()\"/>\r\n</mat-table>\r\n\r\n<mat-header-row *matHeaderRowDef=\"$keys(); sticky: state.$props().isSticky\" [style.height]=\"$headerHeight()\"\r\n [style.min-height]=\"$headerHeight()\" [style.top.px]=\"($offset()! * -1)\"/>\r\n<mat-footer-row *matFooterRowDef=\"$keys(); sticky: $stickyFooter() \" [style.height]=\"$footerHeight()\"\r\n [style.min-height]=\"$footerHeight()\"\r\n [style.bottom.px]=\"$stickyFooter() ? ($offset()) : undefined\"/>\r\n", styles: [":host{--mat-paginator-container-size: var(tb-paginator-container-size, initial)}.select-column{min-width:var(--tb-min-select-column-width, 42px)}.index-column{min-width:var(--tb-min-index-column-width, 42px)}.page-amounts{color:#0000008a;font-family:Roboto,Helvetica Neue,sans-serif;font-size:12px;margin-right:.2rem}.group-cell{display:flex;align-items:center}:host::ng-deep .table-drag-list.cdk-drop-list-dragging .drag-header:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}:host::ng-deep .mdc-data-table__cell,:host::ng-deep .mdc-data-table__header-cell{padding:var(--tb-cell-padding, 0 0 0 .2rem);line-height:var(--tb-cell-line-height, normal)}::ng-deep .op-date-time-input{line-height:3rem;font-size:.9rem;font-family:Roboto,Helvetica Neue,sans-serif;padding-left:.2rem;width:12rem}\n"], dependencies: [{ kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1$6.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1$6.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i1$6.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1$6.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i1$6.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i1$6.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i1$6.MatFooterCellDef, selector: "[matFooterCellDef]" }, { kind: "directive", type: i1$6.MatFooterRowDef, selector: "[matFooterRowDef]", inputs: ["matFooterRowDef", "matFooterRowDefSticky"] }, { kind: "directive", type: i1$6.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i1$6.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "directive", type: i1$6.MatFooterCell, selector: "mat-footer-cell, td[mat-footer-cell]" }, { kind: "component", type: i1$6.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1$6.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i1$6.MatFooterRow, selector: "mat-footer-row, tr[mat-footer-row]", exportAs: ["matFooterRow"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: FunctionPipe, name: "func" }, { kind: "directive", type: StylerDirective, selector: "[styler]", inputs: ["element", "styler"] }, { kind: "directive", type: ConditionalClassesDirective, selector: "[conditionalClasses]", inputs: ["element", "conditionalClasses"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i1$4.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "directive", type: StopPropagationDirective, selector: "[stop-propagation]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5051
5121
|
}
|
|
5052
5122
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: GenericTableComponent, decorators: [{
|
|
5053
5123
|
type: Component,
|
|
@@ -6022,7 +6092,7 @@ class ResetMenuComponent {
|
|
|
6022
6092
|
return true;
|
|
6023
6093
|
return !sortsAreSame(preSorts, sorts);
|
|
6024
6094
|
});
|
|
6025
|
-
this.$groupBySet = computed(() => this.state.$groupByData().length);
|
|
6095
|
+
this.$groupBySet = computed(() => this.state.$groupByData().length || this.state.$userDefinedNoGroups());
|
|
6026
6096
|
this.$hiddenSet = computed(() => this.state.$hiddenKeys().length);
|
|
6027
6097
|
this.$orderSet = computed(() => Object.keys(this.state.$userDefinedOrder()).length);
|
|
6028
6098
|
this.$widthsSet = computed(() => Object.keys(this.state.$getUserDefinedWidths()).length);
|
|
@@ -6721,14 +6791,14 @@ class TableContainerComponent {
|
|
|
6721
6791
|
const data = this.$sortedAndFilteredData();
|
|
6722
6792
|
const groups = this.$timestampedGroups();
|
|
6723
6793
|
const expanded = this.$timestampedExpanded();
|
|
6724
|
-
const
|
|
6794
|
+
const groupSorts = this.$timestampedGroupSortUpdated();
|
|
6725
6795
|
if (!data)
|
|
6726
6796
|
return undefined;
|
|
6727
6797
|
return ({
|
|
6728
6798
|
data,
|
|
6729
6799
|
groups,
|
|
6730
6800
|
expanded,
|
|
6731
|
-
|
|
6801
|
+
groupSorts,
|
|
6732
6802
|
});
|
|
6733
6803
|
});
|
|
6734
6804
|
this.$filteredSortedAndGrouped = linkedSignal({
|
|
@@ -6766,7 +6836,7 @@ class TableContainerComponent {
|
|
|
6766
6836
|
#setUpAllValuesFilters;
|
|
6767
6837
|
static { this.headerId = 'tb-header-wrapper'; }
|
|
6768
6838
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: TableContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
6769
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableIdInput: { classPropertyName: "$tableIdInput", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackByInput: { classPropertyName: "$trackByInput", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumnInput: { classPropertyName: "$indexColumnInput", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumnInput: { classPropertyName: "$selectionColumnInput", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $stickyHeaderInput: { classPropertyName: "$stickyHeaderInput", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooterInput: { classPropertyName: "$stickyFooterInput", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }, { propertyName: "$customGroupRows", predicate: CustomGroupRowDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }, { propertyName: "$menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)\r\n {\r\n <ng-content select=\".tb-header-title\"/>\r\n @if (tableSettings.title)\r\n {\r\n @switch (tableSettings.title.level)\r\n {\r\n @case (1) { <h1 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h1>}\r\n @case (2) { <h2 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h2>}\r\n @case (4) { <h4 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h4>}\r\n @case (5) { <h5 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h5>}\r\n @case (6) { <h6 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h6>}\r\n @default { <h3 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h3>}\r\n }\r\n }\r\n }\r\n </div>\r\n @if(state.$groupByData().length)\r\n {\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader)\r\n {\r\n @if (!$collapsedHeader())\r\n {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu' [xPosition]=\"'before'\">\r\n <lib-table-header-menu #l/>\r\n </mat-menu>\r\n\r\n }\r\n @else\r\n {\r\n <mat-icon color=\"primary\" class=\"flat-menu-button pointer\" [matMenuTriggerFor]=\"mainMenu\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"collapsed-head-row\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon class=\"collapse-icon header\" [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayDataLength]=\"$displayDataLength()\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon class=\"collapse-icon footer\" [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n</ng-container>\r\n\r\n<ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId && !$collapsedHeader()) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n</ng-template>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-left:auto}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}.collapsed-head-row{display:flex;justify-content:space-evenly}::ng-deep tb-generic-table .mat-mdc-row:nth-child(odd):not(.no-stripe){background-color:var(--tb-odd-row-background-color, #cdeefe)}.tb-container-title{padding-left:var(--tb-container-title-padding-left, 10px);margin:var(--tb-container-title-margin, 0)}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayDataLength", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["tableId", "isMatMenuChild"] }, { kind: "component", type: TableHeaderMenuComponent, selector: "lib-table-header-menu" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: VirtualScrollContainer, selector: "tb-virtual-scroll-container" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6839
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: TableContainerComponent, isStandalone: true, selector: "tb-table-container", inputs: { $tableBuilder: { classPropertyName: "$tableBuilder", publicName: "tableBuilder", isSignal: true, isRequired: true, transformFunction: null }, $tableIdInput: { classPropertyName: "$tableIdInput", publicName: "tableId", isSignal: true, isRequired: false, transformFunction: null }, $trackByInput: { classPropertyName: "$trackByInput", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null }, $inputFilters: { classPropertyName: "$inputFilters", publicName: "inputFilters", isSignal: true, isRequired: false, transformFunction: null }, $indexColumnInput: { classPropertyName: "$indexColumnInput", publicName: "indexColumn", isSignal: true, isRequired: false, transformFunction: null }, $selectionColumnInput: { classPropertyName: "$selectionColumnInput", publicName: "selectionColumn", isSignal: true, isRequired: false, transformFunction: null }, $stickyHeaderInput: { classPropertyName: "$stickyHeaderInput", publicName: "stickyHeader", isSignal: true, isRequired: false, transformFunction: null }, $stickyFooterInput: { classPropertyName: "$stickyFooterInput", publicName: "stickyFooter", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderTemplate: { classPropertyName: "$groupHeaderTemplate", publicName: "groupHeaderTemplate", isSignal: true, isRequired: false, transformFunction: null }, $groupHeaderHeight: { classPropertyName: "$groupHeaderHeight", publicName: "groupHeaderHeight", isSignal: true, isRequired: false, transformFunction: null }, $pageSize: { classPropertyName: "$pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection$: "selection", onStateReset$: "onStateReset", onSaveState$: "onSaveState", state$: "state", data$: "data" }, providers: [TableStore, ExportToCsvService, WrapperFilterStore, DataStore], queries: [{ propertyName: "$filterDirectives", predicate: TableFilterDirective, descendants: true, isSignal: true }, { propertyName: "$customFilterDirectives", predicate: TableCustomFilterDirective, descendants: true, isSignal: true }, { propertyName: "_$customRows", predicate: (MatRowDef), isSignal: true }, { propertyName: "$customCells", predicate: CustomCellDirective, isSignal: true }, { propertyName: "$customGroupRows", predicate: CustomGroupRowDirective, isSignal: true }], viewQueries: [{ propertyName: "$paginatorComponent", first: true, predicate: PaginatorComponent, descendants: true, isSignal: true }, { propertyName: "$genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }, { propertyName: "$menu", first: true, predicate: MatMenu, descendants: true, isSignal: true }], ngImport: i0, template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)\r\n {\r\n <ng-content select=\".tb-header-title\"/>\r\n @if (tableSettings.title)\r\n {\r\n @switch (tableSettings.title.level)\r\n {\r\n @case (1) { <h1 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h1>}\r\n @case (2) { <h2 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h2>}\r\n @case (4) { <h4 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h4>}\r\n @case (5) { <h5 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h5>}\r\n @case (6) { <h6 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h6>}\r\n @default { <h3 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h3>}\r\n }\r\n }\r\n }\r\n </div>\r\n @if(state.$groupByData().length)\r\n {\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader)\r\n {\r\n @if (!$collapsedHeader())\r\n {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu' [xPosition]=\"'before'\">\r\n <lib-table-header-menu #l/>\r\n </mat-menu>\r\n\r\n }\r\n @else\r\n {\r\n <mat-icon color=\"primary\" class=\"flat-menu-button pointer\" [matMenuTriggerFor]=\"mainMenu\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"collapsed-head-row\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon class=\"collapse-icon header\" [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayData]=\"$filteredSortedAndGrouped()?.displayData || []\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayData]=\"$filteredSortedAndGrouped()?.displayData || []\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon class=\"collapse-icon footer\" [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n</ng-container>\r\n\r\n<ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId && !$collapsedHeader()) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n</ng-template>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-left:auto}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}.collapsed-head-row{display:flex;justify-content:space-evenly}::ng-deep tb-generic-table .mat-mdc-row:nth-child(odd):not(.no-stripe){background-color:var(--tb-odd-row-background-color, #cdeefe)}.tb-container-title{padding-left:var(--tb-container-title-padding-left, 10px);margin:var(--tb-container-title-margin, 0)}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PaginatorComponent, selector: "tb-paginator" }, { kind: "directive", type: MultiSortDirective, selector: "[multiSort]", inputs: ["matSortDisabled"], exportAs: ["multiSort"] }, { kind: "component", type: GroupByListComponent, selector: "group-by-list" }, { kind: "component", type: FilterChipsComponent, selector: "lib-filter-list" }, { kind: "component", type: GenFilterDisplayerComponent, selector: "tb-filter-displayer" }, { kind: "component", type: GenColDisplayerComponent, selector: "tb-col-displayer" }, { kind: "component", type: SortMenuComponent, selector: "tb-sort-menu" }, { kind: "component", type: GenericTableComponent, selector: "tb-generic-table", inputs: ["displayData", "data", "rows", "columnInfos", "dataSource", "trackBy"], outputs: ["selection"] }, { kind: "component", type: ProfilesMenuComponent, selector: "tb-profiles-menu", inputs: ["tableId", "isMatMenuChild"] }, { kind: "component", type: TableHeaderMenuComponent, selector: "lib-table-header-menu" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i1$4.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i1$4.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: VirtualScrollContainer, selector: "tb-virtual-scroll-container" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6770
6840
|
}
|
|
6771
6841
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: TableContainerComponent, decorators: [{
|
|
6772
6842
|
type: Component,
|
|
@@ -6776,7 +6846,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
|
|
|
6776
6846
|
MultiSortDirective, GroupByListComponent, FilterChipsComponent, GenFilterDisplayerComponent, GenColDisplayerComponent,
|
|
6777
6847
|
SortMenuComponent, GenericTableComponent, ProfilesMenuComponent, TableHeaderMenuComponent,
|
|
6778
6848
|
MatButtonModule, MatMenuModule, MatIconModule, MatTooltipModule, VirtualScrollContainer,
|
|
6779
|
-
], template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)\r\n {\r\n <ng-content select=\".tb-header-title\"/>\r\n @if (tableSettings.title)\r\n {\r\n @switch (tableSettings.title.level)\r\n {\r\n @case (1) { <h1 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h1>}\r\n @case (2) { <h2 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h2>}\r\n @case (4) { <h4 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h4>}\r\n @case (5) { <h5 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h5>}\r\n @case (6) { <h6 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h6>}\r\n @default { <h3 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h3>}\r\n }\r\n }\r\n }\r\n </div>\r\n @if(state.$groupByData().length)\r\n {\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader)\r\n {\r\n @if (!$collapsedHeader())\r\n {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu' [xPosition]=\"'before'\">\r\n <lib-table-header-menu #l/>\r\n </mat-menu>\r\n\r\n }\r\n @else\r\n {\r\n <mat-icon color=\"primary\" class=\"flat-menu-button pointer\" [matMenuTriggerFor]=\"mainMenu\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"collapsed-head-row\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon class=\"collapse-icon header\" [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [
|
|
6849
|
+
], template: "@let tableId = $tableId();\r\n@let tableSettings = state.$tableSettings();\r\n\r\n<ng-content select=\"[before]\" />\r\n<ng-container multiSort>\r\n <div class=\"tb-header-wrapper\" [id]=\"headerId\">\r\n <div class=\"title\">\r\n @if ((!$collapsedHeader()) || tableSettings.showTitleWhenHeaderCollapsed)\r\n {\r\n <ng-content select=\".tb-header-title\"/>\r\n @if (tableSettings.title)\r\n {\r\n @switch (tableSettings.title.level)\r\n {\r\n @case (1) { <h1 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h1>}\r\n @case (2) { <h2 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h2>}\r\n @case (4) { <h4 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h4>}\r\n @case (5) { <h5 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h5>}\r\n @case (6) { <h6 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h6>}\r\n @default { <h3 class=\"tb-container-title\" [style]=\"tableSettings.title.styles\">{{tableSettings.title.text}}</h3>}\r\n }\r\n }\r\n }\r\n </div>\r\n @if(state.$groupByData().length)\r\n {\r\n <group-by-list />\r\n }\r\n <div class=\"flx-row-end\">\r\n <lib-filter-list />\r\n @if (!tableSettings.hideHeader)\r\n {\r\n @if (!$collapsedHeader())\r\n {\r\n <ng-container *ngTemplateOutlet=\"headerMenu\"/>\r\n <button mat-icon-button color='primary' [matMenuTriggerFor]=\"mainMenu\">\r\n <mat-icon>more_vert</mat-icon>\r\n </button>\r\n <mat-menu #mainMenu='matMenu' [xPosition]=\"'before'\">\r\n <lib-table-header-menu #l/>\r\n </mat-menu>\r\n\r\n }\r\n @else\r\n {\r\n <mat-icon color=\"primary\" class=\"flat-menu-button pointer\" [matMenuTriggerFor]=\"mainMenu\">more_horiz</mat-icon>\r\n <mat-menu #mainMenu='matMenu'>\r\n <div class=\"collapsed-head-row\">\r\n <ng-container *ngTemplateOutlet=\"headerMenu; injector menuInjector\"/>\r\n </div>\r\n <lib-table-header-menu />\r\n </mat-menu>\r\n }\r\n <mat-icon class=\"collapse-icon header\" [matTooltip]=\"$collapsedHeader() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseHeader()\">\r\n {{$collapsedHeader() ? 'expand_less' : 'expand_more'}}\r\n </mat-icon>\r\n }\r\n\r\n </div>\r\n </div>\r\n\r\n @if($useVirtual())\r\n {\r\n <tb-virtual-scroll-container class=\"scrollable\">\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayData]=\"$filteredSortedAndGrouped()?.displayData || []\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n </tb-virtual-scroll-container>\r\n }\r\n @else\r\n {\r\n <tb-generic-table [rows]=\"$customRows()\" [data]=\"$data()!\" [displayData]=\"$filteredSortedAndGrouped()?.displayData || []\"\r\n [columnInfos]='$myColumns()' [trackBy]=\"$trackBy()\" [dataSource]=\"dataSource\" (selection)='_selection$.next($event)' />\r\n }\r\n @if(tableSettings.usePaginator)\r\n {\r\n <div class=\"paginator\">\r\n <tb-paginator #tbPaginator />\r\n\r\n <mat-icon class=\"collapse-icon footer\" [matTooltip]=\"$collapsedFooter() ? 'expand' : 'collapse'\"\r\n (click)=\"state.toggleCollapseFooter()\">\r\n {{$collapsedFooter() ? 'expand_more' : 'expand_less'}}\r\n </mat-icon>\r\n </div>\r\n }\r\n</ng-container>\r\n\r\n<ng-template #headerMenu>\r\n @if (!tableSettings.hideFilter) {<tb-filter-displayer/>}\r\n @if (!tableSettings.hideColumnSettings) {<tb-col-displayer/>}\r\n @if (!tableSettings.hideSort) {<tb-sort-menu/>}\r\n @if (!!tableId && !$collapsedHeader()) {<tb-profiles-menu [tableId]=\"tableId\"/>}\r\n</ng-template>\r\n", styles: [".tb-header-wrapper{display:flex;flex-direction:row;width:100%}.flx-row-end{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-left:auto}.flat-menu{line-height:initial;height:initial}.pointer{cursor:pointer}.add-key{width:90%}.paginator{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;background-color:#fff;bottom:0;position:sticky;border-top:.5px solid rgba(0,0,0,.12)}.profiles-menu{visibility:hidden;width:0px;height:0px;display:block;overflow:hidden;position:absolute;top:50px}.collapsed-head-row{display:flex;justify-content:space-evenly}::ng-deep tb-generic-table .mat-mdc-row:nth-child(odd):not(.no-stripe){background-color:var(--tb-odd-row-background-color, #cdeefe)}.tb-container-title{padding-left:var(--tb-container-title-padding-left, 10px);margin:var(--tb-container-title-margin, 0)}\n", ".collapse-icon{font-size:16px;height:16px;color:#3f51b5;align-self:flex-start}.collapse-icon:hover{cursor:pointer}.hide{display:none}.paginator-row{display:flex;align-items:center}\n"] }]
|
|
6780
6850
|
}] });
|
|
6781
6851
|
function isFunction(a) {
|
|
6782
6852
|
return typeof a === 'function';
|