@one-paragon/angular-utilities 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/one-paragon-angular-utilities.mjs +29 -5
- package/fesm2022/one-paragon-angular-utilities.mjs.map +1 -1
- package/ngrx/actionable-selector.d.ts +3 -2
- package/package.json +1 -1
- package/table-builder/classes/table-builder-general-settings.d.ts +4 -0
- package/table-builder/components/table-container/virtual-scroll-container.d.ts +1 -0
|
@@ -887,6 +887,10 @@ class VirtualScrollOptions {
|
|
|
887
887
|
* If `maxViewPortHeight` is set that will be the max table size
|
|
888
888
|
*/
|
|
889
889
|
dynamicHeight = false;
|
|
890
|
+
/**
|
|
891
|
+
* If `dynamicHeight` is set to true, we will try to add this amount of space from the bottom of view port
|
|
892
|
+
*/
|
|
893
|
+
dynamicalHeightBuffer = 0;
|
|
890
894
|
}
|
|
891
895
|
class PaginatorOptions {
|
|
892
896
|
pageSize = undefined;
|
|
@@ -5264,22 +5268,28 @@ class VirtualScrollContainer {
|
|
|
5264
5268
|
const virtualScrollOptions = this.$virtualScrollOptions();
|
|
5265
5269
|
const t = this.tableContainer.elementRef.nativeElement.querySelector(`#${TableContainerComponent.headerId}`);
|
|
5266
5270
|
const rect = t?.getBoundingClientRect();
|
|
5267
|
-
const
|
|
5268
|
-
const distanceFromBottom =
|
|
5271
|
+
const windowHeight = window.innerHeight;
|
|
5272
|
+
const distanceFromBottom = windowHeight - rect.bottom;
|
|
5269
5273
|
const rowHeight = this.computedRowHeight();
|
|
5270
5274
|
const footerHeight = this.computedFooterHeight();
|
|
5271
5275
|
const headerHeight = this.computedHeaderHeight();
|
|
5276
|
+
const buffer = this.computedBuffer();
|
|
5277
|
+
const horizontalScrollPadding = el.nativeElement.scrollWidth > el.nativeElement.clientWidth ? 17 : 0;
|
|
5272
5278
|
const maxViewPortHeightPx = parseTbSizeToPixels(virtualScrollOptions.maxViewPortHeight) || 0;
|
|
5273
5279
|
let tableSize = distanceFromBottom;
|
|
5274
5280
|
if (virtualScrollOptions?.maxViewPortHeight && maxViewPortHeightPx < tableSize) {
|
|
5275
5281
|
tableSize = maxViewPortHeightPx;
|
|
5276
5282
|
}
|
|
5277
|
-
const available = (distanceFromBottom - footerHeight)
|
|
5283
|
+
const available = (distanceFromBottom - footerHeight)
|
|
5284
|
+
- headerHeight
|
|
5285
|
+
- (this.$usePaginator() ? 20 : 0)
|
|
5286
|
+
- buffer
|
|
5287
|
+
- horizontalScrollPadding;
|
|
5278
5288
|
const amountOfRowsThatWillFit = Math.floor(available / rowHeight);
|
|
5279
5289
|
const minAmountOfRows = virtualScrollOptions?.amountOfVisibleItems || this.defaultOptions.amountOfVisibleItems;
|
|
5280
5290
|
const amountOfVisibleItems = Math.min(Math.max(amountOfRowsThatWillFit, minAmountOfRows), this.$dataLength());
|
|
5281
5291
|
let height = (rowHeight * amountOfVisibleItems);
|
|
5282
|
-
height += (footerHeight + headerHeight);
|
|
5292
|
+
height += (footerHeight + headerHeight + horizontalScrollPadding);
|
|
5283
5293
|
this.setHeight(height, el);
|
|
5284
5294
|
}
|
|
5285
5295
|
setHeight(height, el) {
|
|
@@ -5309,6 +5319,12 @@ class VirtualScrollContainer {
|
|
|
5309
5319
|
computedFooterHeight = computed(() => {
|
|
5310
5320
|
return parseFloat(this.genericTable()?.$footerHeight()?.replace('px', '') || '0');
|
|
5311
5321
|
});
|
|
5322
|
+
computedBuffer = computed(() => {
|
|
5323
|
+
const virtualScrollOptions = this.state.$tableSettings().virtualSettings;
|
|
5324
|
+
if (!virtualScrollOptions.dynamicalHeightBuffer)
|
|
5325
|
+
return 0;
|
|
5326
|
+
return parseTbSizeToPixels(virtualScrollOptions.dynamicalHeightBuffer) || 0;
|
|
5327
|
+
});
|
|
5312
5328
|
scrollStrategy = new TableVirtualScrollStrategy(this);
|
|
5313
5329
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: VirtualScrollContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5314
5330
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.0", type: VirtualScrollContainer, isStandalone: true, selector: "tb-virtual-scroll-container", queries: [{ propertyName: "genericTable", first: true, predicate: GenericTableComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
@@ -5968,6 +5984,14 @@ const setUpStoreFactory = () => {
|
|
|
5968
5984
|
setStore(store);
|
|
5969
5985
|
setEnvironmentInjector(env);
|
|
5970
5986
|
};
|
|
5987
|
+
function setUpStoreFactoryOld(store, env) {
|
|
5988
|
+
_cache ??= new AppStoreCache();
|
|
5989
|
+
return () => new Promise((resolve, reject) => {
|
|
5990
|
+
setStore(store);
|
|
5991
|
+
setEnvironmentInjector(env);
|
|
5992
|
+
resolve(null);
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5971
5995
|
|
|
5972
5996
|
/*
|
|
5973
5997
|
* Public API Surface of http-request-state
|
|
@@ -5977,5 +6001,5 @@ const setUpStoreFactory = () => {
|
|
|
5977
6001
|
* Generated bundle index. Do not edit.
|
|
5978
6002
|
*/
|
|
5979
6003
|
|
|
5980
|
-
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, parseTbSizeToPixels, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
6004
|
+
export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DefaultVirtualScrollOptions, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersistedTableSettings, PaginatorComponent, PaginatorOptions, PersistedTableSettings, PhoneNumberPipe, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, Subscriber, TableBuilder, TableBuilderConfigToken, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableSettings, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollOptions, actionStatusReducer, chainRequest, clearActionableSelectorRequestCache, combineArrays, createActionResultSelector, createActionSelector, createActionableResultSelector, createActionableSelector, createFailure, createRequestor, createSuccess, defaultFilter, defaultShareReplay, delayOn, filterArray, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isErrorState, isSuccessOrErrorState, isSuccessState, mapArray, mapError, metaDataArrToDict, notNull, notStarted, onWait, onceWhen, parseTbSizeToPixels, previousAndCurrent, provideActionableSelector, provideTableBuilder, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, setUpStoreFactoryOld, skipOneWhen, sortsAreSame, spaceCase, startWithIfEmpty, statusAdapter, statusIsSuccessOrInProgress, subscriber, switchOff, tapError, tapSuccess, wrapInArr };
|
|
5981
6005
|
//# sourceMappingURL=one-paragon-angular-utilities.mjs.map
|