@saydar/table-builder 1.0.15 → 1.0.16-beta.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saydar/table-builder",
3
- "version": "1.0.15",
3
+ "version": "1.0.16-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Yitzchak-Holtzberg/OodleTableBuilder.git"
@@ -5,7 +5,7 @@ import { Observable, Subscription, Subject, Unsubscribable, ReplaySubject, Behav
5
5
  import { ComponentStore } from '@ngrx/component-store';
6
6
  import { HttpErrorResponse } from '@angular/common/http';
7
7
  import * as _saydar_table_builder from '@saydar/table-builder';
8
- import * as i36 from '@angular/router';
8
+ import * as i37 from '@angular/router';
9
9
  import { QueryParamsHandling } from '@angular/router';
10
10
  import * as i23 from '@angular/material/sort';
11
11
  import { Sort, SortDirection as SortDirection$1, MatSort } from '@angular/material/sort';
@@ -19,22 +19,22 @@ import { MatRadioButton } from '@angular/material/radio';
19
19
  import { MatButtonToggle } from '@angular/material/button-toggle';
20
20
  import * as i19 from '@angular/material/checkbox';
21
21
  import { MatCheckbox } from '@angular/material/checkbox';
22
- import * as i35 from '@angular/forms';
22
+ import * as i36 from '@angular/forms';
23
23
  import { NgControl, ControlValueAccessor } from '@angular/forms';
24
24
  import * as i12 from '@angular/material/core';
25
25
  import { MatOption } from '@angular/material/core';
26
- import * as i31 from '@angular/common';
26
+ import * as i32 from '@angular/common';
27
27
  import { DatePipe, CurrencyPipe } from '@angular/common';
28
28
  import * as _ngrx_store from '@ngrx/store';
29
29
  import { Store, Action, MemoizedSelector } from '@ngrx/store';
30
30
  import { SelectionModel } from '@angular/cdk/collections';
31
31
  import * as _ngrx_entity from '@ngrx/entity';
32
32
  import { Dictionary as Dictionary$1, Predicate as Predicate$1, EntityState } from '@ngrx/entity';
33
- import * as i38 from '@angular/cdk/drag-drop';
33
+ import * as i39 from '@angular/cdk/drag-drop';
34
34
  import { CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop';
35
35
  import * as i25 from '@angular/material/paginator';
36
36
  import { MatPaginator } from '@angular/material/paginator';
37
- import * as i41 from 'ng-table-virtual-scroll';
37
+ import * as i42 from 'ng-table-virtual-scroll';
38
38
  import { TableVirtualScrollDataSource } from 'ng-table-virtual-scroll';
39
39
  import * as i20 from '@angular/material/menu';
40
40
  import { MatMenuTrigger } from '@angular/material/menu';
@@ -57,9 +57,9 @@ import * as i21 from '@angular/material/icon';
57
57
  import * as i22 from '@angular/material/badge';
58
58
  import * as i24 from '@angular/material/autocomplete';
59
59
  import * as i26 from '@angular/material/chips';
60
- import * as i34 from '@ngrx/effects';
61
- import * as i37 from '@ngrx/component';
62
- import * as i40 from '@angular/cdk/scrolling';
60
+ import * as i35 from '@ngrx/effects';
61
+ import * as i38 from '@ngrx/component';
62
+ import * as i41 from '@angular/cdk/scrolling';
63
63
 
64
64
  declare enum HttpRequestStatus {
65
65
  notStarted = 0,
@@ -640,6 +640,21 @@ declare class TableStore extends ComponentStore<TableState> {
640
640
  private displayedColumns;
641
641
  readonly displayedColumns$: Observable<string[]>;
642
642
  readonly hideColumn: (observableOrValue: string | Observable<string>) => rxjs.Subscription;
643
+ readonly showColumnAt: (observableOrValue: {
644
+ key: string;
645
+ newOrder: number;
646
+ } | Observable<{
647
+ key: string;
648
+ newOrder: number;
649
+ }>) => rxjs.Subscription;
650
+ readonly cycleColumnSort: (observableOrValue: string | Observable<string>) => rxjs.Subscription;
651
+ readonly reorderVisibleColumn: (observableOrValue: {
652
+ previousVisibleIndex: number;
653
+ currentVisibleIndex: number;
654
+ } | Observable<{
655
+ previousVisibleIndex: number;
656
+ currentVisibleIndex: number;
657
+ }>) => rxjs.Subscription;
643
658
  readonly resetState: () => void;
644
659
  readonly showColumn: (observableOrValue: string | Observable<string>) => rxjs.Subscription;
645
660
  readonly setHiddenColumns: (observableOrValue: {
@@ -1366,16 +1381,110 @@ declare class WrapperFilterStore extends ComponentStore<{
1366
1381
  static ɵprov: i0.ɵɵInjectableDeclaration<WrapperFilterStore>;
1367
1382
  }
1368
1383
 
1384
+ interface FilterChipVm {
1385
+ filterId: string;
1386
+ columnName: string;
1387
+ columnKey: string;
1388
+ filterType: FilterType | undefined;
1389
+ fieldType: FieldType;
1390
+ operatorLabel: string;
1391
+ /** Display string of the filter value. Arrays are joined with ", " so the user can edit them as text. */
1392
+ valueDisplay: string;
1393
+ /** Raw filterValue (used for type-aware inputs in expanded form). */
1394
+ rawValue: any;
1395
+ isCustom: boolean;
1396
+ isHidden: boolean;
1397
+ }
1398
+ /** Editing draft state for the currently-expanded chip. Edits don't commit until Apply. */
1399
+ interface ChipDraft {
1400
+ filterId: string;
1401
+ filterType: FilterType | undefined;
1402
+ value: any;
1403
+ /** True if this draft was just created from "+ Add filter" — Cancel removes the chip entirely. */
1404
+ isNew: boolean;
1405
+ }
1369
1406
  declare class GenFilterDisplayerComponent {
1370
1407
  tableState: TableStore;
1371
1408
  filterStore: WrapperFilterStore;
1372
- constructor(tableState: TableStore, filterStore: WrapperFilterStore);
1409
+ chips$: Observable<FilterChipVm[]>;
1373
1410
  filterCols$: Observable<MetaData[]>;
1411
+ count$: Observable<number>;
1412
+ /** Which chip is currently in expanded form. Drives compact vs expanded rendering. */
1413
+ draft: i0.WritableSignal<ChipDraft | null>;
1414
+ /** Whether the inline column picker is open (replaces the nested mat-menu so the
1415
+ * parent panel stays open after a column is selected). */
1416
+ pickerOpen: i0.WritableSignal<boolean>;
1417
+ constructor(tableState: TableStore, filterStore: WrapperFilterStore);
1418
+ /** Operators compatible with a chip's column fieldType, for the operator dropdown. */
1419
+ operatorsFor(fieldType: FieldType): {
1420
+ value: FilterType;
1421
+ label: string;
1422
+ }[];
1423
+ /** Maps fieldType to the input style the expanded form should render. */
1424
+ inputKindFor(fieldType: FieldType): 'date' | 'datetime' | 'number' | 'boolean' | 'text';
1425
+ /**
1426
+ * Add a new filter from the column picker.
1427
+ * Combo 4: the chip is born expanded with no value yet. The user fills in value + Apply
1428
+ * to commit. Commits to TableStore happen on Apply, not on every keystroke, so the
1429
+ * table doesn't re-filter mid-edit.
1430
+ */
1431
+ /** Toggle the inline column picker. */
1432
+ togglePicker(event?: Event): void;
1433
+ closePicker(): void;
1374
1434
  addFilter(metaData: MetaData): void;
1435
+ /** Open the expanded form for an existing chip. Initializes the draft from current values. */
1436
+ expand(chip: FilterChipVm): void;
1437
+ /** Update the operator in the draft (without committing). */
1438
+ draftSetOperator(filterType: FilterType): void;
1439
+ /** Update the value in the draft (without committing). */
1440
+ draftSetValue(value: any): void;
1441
+ /** Apply: commit the draft to TableStore, collapse. */
1442
+ apply(chip: FilterChipVm): void;
1443
+ /** Cancel: collapse without committing. For new chips, also remove the placeholder. */
1444
+ cancel(chip: FilterChipVm): void;
1445
+ removeFilter(filterId: string): void;
1446
+ clearAll(): void;
1447
+ trackByFilterId(_: number, chip: FilterChipVm): string;
1448
+ trackByKey(_: number, md: MetaData): string;
1449
+ /** True when the chip is currently the one being edited (expanded). */
1450
+ isExpanded(filterId: string): boolean;
1451
+ private defaultDraftValue;
1452
+ /** Parse the draft's loosely-typed value into something filterValue-compatible. */
1453
+ private parseDraftValue;
1454
+ private formatValue;
1455
+ /** Approximate the SpaceCase pipe locally so chip labels match the rest of the UI. */
1456
+ private spaceCase;
1375
1457
  static ɵfac: i0.ɵɵFactoryDeclaration<GenFilterDisplayerComponent, never>;
1376
1458
  static ɵcmp: i0.ɵɵComponentDeclaration<GenFilterDisplayerComponent, "tb-filter-displayer", never, {}, {}, never, never, false, never>;
1377
1459
  }
1378
1460
 
1461
+ interface VisibleRow {
1462
+ key: string;
1463
+ displayName: string;
1464
+ sortDirection: 'asc' | 'desc' | null;
1465
+ sortPriority: number | null;
1466
+ }
1467
+ interface HiddenRow {
1468
+ key: string;
1469
+ displayName: string;
1470
+ }
1471
+ declare class ColumnsPanelComponent {
1472
+ private store;
1473
+ visibleRows$: Observable<VisibleRow[]>;
1474
+ hiddenRows$: Observable<HiddenRow[]>;
1475
+ visibleCount$: Observable<number>;
1476
+ totalCount$: Observable<number>;
1477
+ constructor(store: TableStore);
1478
+ cycleSort(key: string, ev: Event): void;
1479
+ onVisibleDrop(event: CdkDragDrop<VisibleRow[]>): void;
1480
+ onHiddenDrop(event: CdkDragDrop<HiddenRow[]>): void;
1481
+ trackByKey(_: number, row: {
1482
+ key: string;
1483
+ }): string;
1484
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnsPanelComponent, never>;
1485
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnsPanelComponent, "tb-columns-panel", never, {}, {}, never, never, false, never>;
1486
+ }
1487
+
1379
1488
  declare class DateFilterComponent {
1380
1489
  FilterType: typeof FilterType;
1381
1490
  info: PartialFilter;
@@ -1952,7 +2061,7 @@ declare class MaterialModule {
1952
2061
  declare class TableBuilderModule {
1953
2062
  static forRoot(config: TableBuilderConfig): ModuleWithProviders<TableBuilderModule>;
1954
2063
  static ɵfac: i0.ɵɵFactoryDeclaration<TableBuilderModule, never>;
1955
- static ɵmod: i0.ɵɵNgModuleDeclaration<TableBuilderModule, [typeof ColumnTotalPipe, typeof TableContainerComponent, typeof GenericTableComponent, typeof GenericTableVsComponent, typeof PaginatorComponent, typeof CustomCellDirective, typeof GenColDisplayerComponent, typeof GenFilterDisplayerComponent, typeof DateFilterComponent, typeof FilterComponent, typeof MultiSortDirective, typeof NumberFilterComponent, typeof ColumnBuilderComponent, typeof ArrayColumnComponent, typeof LinkColumnComponent, typeof HeaderMenuComponent, typeof KeyDisplayPipe, typeof FormatFilterValuePipe, typeof AsFilterPillsPipe, typeof FormatFilterTypePipe, typeof ResizeColumnDirective, typeof InFilterComponent, typeof InitializationComponent, typeof InListFilterComponent, typeof SortMenuComponent, typeof FilterChipsComponent, typeof MatSlideToggleTbFilterDirective, typeof MatRadioButtonTbFilterDirective, typeof MatOptionTbFilterDirective, typeof MatCheckboxTbFilterDirective, typeof MatButtonToggleFilterDirective, typeof TableFilterDirective, typeof TableFilterStringContainsDirective, typeof TableWrapperDirective, typeof GroupByListComponent, typeof DateTimeFilterComponent, typeof PreservePasteDelimitersDirective], [typeof i31.CommonModule, typeof MaterialModule, typeof _ngrx_store.StoreFeatureModule, typeof i34.EffectsFeatureModule, typeof i35.FormsModule, typeof i36.RouterModule, typeof i37.LetDirective, typeof i38.DragDropModule, typeof UtilitiesModule, typeof i40.ScrollingModule, typeof i41.TableVirtualScrollModule], [typeof GenericTableComponent, typeof GenericTableVsComponent, typeof PaginatorComponent, typeof TableContainerComponent, typeof CustomCellDirective, typeof GenColDisplayerComponent, typeof GenFilterDisplayerComponent, typeof FilterComponent, typeof MultiSortDirective, typeof ResizeColumnDirective, typeof MatSlideToggleTbFilterDirective, typeof MatRadioButtonTbFilterDirective, typeof MatOptionTbFilterDirective, typeof MatCheckboxTbFilterDirective, typeof MatButtonToggleFilterDirective, typeof TableFilterDirective, typeof TableFilterStringContainsDirective, typeof TableWrapperDirective, typeof GroupByListComponent, typeof PreservePasteDelimitersDirective]>;
2064
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TableBuilderModule, [typeof ColumnTotalPipe, typeof TableContainerComponent, typeof GenericTableComponent, typeof GenericTableVsComponent, typeof PaginatorComponent, typeof CustomCellDirective, typeof GenColDisplayerComponent, typeof GenFilterDisplayerComponent, typeof ColumnsPanelComponent, typeof DateFilterComponent, typeof FilterComponent, typeof MultiSortDirective, typeof NumberFilterComponent, typeof ColumnBuilderComponent, typeof ArrayColumnComponent, typeof LinkColumnComponent, typeof HeaderMenuComponent, typeof KeyDisplayPipe, typeof FormatFilterValuePipe, typeof AsFilterPillsPipe, typeof FormatFilterTypePipe, typeof ResizeColumnDirective, typeof InFilterComponent, typeof InitializationComponent, typeof InListFilterComponent, typeof SortMenuComponent, typeof FilterChipsComponent, typeof MatSlideToggleTbFilterDirective, typeof MatRadioButtonTbFilterDirective, typeof MatOptionTbFilterDirective, typeof MatCheckboxTbFilterDirective, typeof MatButtonToggleFilterDirective, typeof TableFilterDirective, typeof TableFilterStringContainsDirective, typeof TableWrapperDirective, typeof GroupByListComponent, typeof DateTimeFilterComponent, typeof PreservePasteDelimitersDirective], [typeof i32.CommonModule, typeof MaterialModule, typeof _ngrx_store.StoreFeatureModule, typeof i35.EffectsFeatureModule, typeof i36.FormsModule, typeof i37.RouterModule, typeof i38.LetDirective, typeof i39.DragDropModule, typeof UtilitiesModule, typeof i41.ScrollingModule, typeof i42.TableVirtualScrollModule], [typeof GenericTableComponent, typeof GenericTableVsComponent, typeof PaginatorComponent, typeof TableContainerComponent, typeof CustomCellDirective, typeof GenColDisplayerComponent, typeof GenFilterDisplayerComponent, typeof ColumnsPanelComponent, typeof FilterComponent, typeof MultiSortDirective, typeof ResizeColumnDirective, typeof MatSlideToggleTbFilterDirective, typeof MatRadioButtonTbFilterDirective, typeof MatOptionTbFilterDirective, typeof MatCheckboxTbFilterDirective, typeof MatButtonToggleFilterDirective, typeof TableFilterDirective, typeof TableFilterStringContainsDirective, typeof TableWrapperDirective, typeof GroupByListComponent, typeof PreservePasteDelimitersDirective]>;
1956
2065
  static ɵinj: i0.ɵɵInjectorDeclaration<TableBuilderModule>;
1957
2066
  }
1958
2067
 
@@ -2036,7 +2145,7 @@ declare function actionStatusReducer(state: StatusState | undefined, action: Act
2036
2145
 
2037
2146
  declare class NgrxExtModule {
2038
2147
  static ɵfac: i0.ɵɵFactoryDeclaration<NgrxExtModule, never>;
2039
- static ɵmod: i0.ɵɵNgModuleDeclaration<NgrxExtModule, never, [typeof i31.CommonModule, typeof _ngrx_store.StoreFeatureModule], never>;
2148
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgrxExtModule, never, [typeof i32.CommonModule, typeof _ngrx_store.StoreFeatureModule], never>;
2040
2149
  static ɵinj: i0.ɵɵInjectorDeclaration<NgrxExtModule>;
2041
2150
  }
2042
2151
 
@@ -2070,5 +2179,5 @@ type ActionableMemoizedSelector<State, Result> = MemoizedSelector<State, Result>
2070
2179
  type ActionReturner<Props> = (props: Props) => Action;
2071
2180
  declare function defaultFilter(data: any): boolean;
2072
2181
 
2073
- export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GenericTableVsComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, InitializationState, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersisitedTableSettings, PaginatorComponent, PesrsistedTableSettings, PhoneNumberPipe, PreservePasteDelimitersDirective, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, TableBuilder, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableStore, TableVirtualScrollObservableDataSource, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollViewportDirective, actionStatusReducer, chainRequest, combineArrays, createActionableSelector, createFailure, createFilterFunc, createSuccess, defaultFilter, defaultShareReplay, defaultTableState, delayOn, filterArray, filterTypeMap, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isCustomFilter, isErrorState, isFilterInfo, isSuccessOrErrorState, isSuccessState, keysToDelete, mapArray, mapError, notNull, notStarted, onWait, onceWhen, orderMetaData, orderViewableMetaData, previousAndCurrent, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, spaceCase, stateIs, statusAdapter, statusIsSuccessOrInProgress, switchOff, tapError, tapSuccess };
2182
+ export { ActionStateSpinnerComponent, ActionStateUiModule, ActionStatus, AppStatusState, ArrayStyle, AutoFocusDirective, CancellationToken, ClickEmitterDirective, ClickSubjectDirective, ColumnsPanelComponent, ConditionalClassesDirective, CreateTableBuilder, CustomCellDirective, DateFilterComponent, DialogDirective, DialogService, DialogWrapper, FieldType, FilterChipsComponent, FilterComponent, FilterType, FunctionPipe, GenColDisplayerComponent, GenFilterDisplayerComponent, GeneralTableSettings, GenericTableComponent, GenericTableVsComponent, GroupByListComponent, HttpErrorStateDirective, HttpInProgressStateDirective, HttpNotStartedStateDirective, HttpRequestModule, HttpRequestStateDirective, HttpRequestStateFactory, HttpRequestStateStore, HttpRequestStatus, HttpRequestStrategy, HttpSuccessStateDirective, InitializationState, MatButtonToggleFilterDirective, MatCheckboxTbFilterDirective, MatOptionTbFilterDirective, MatRadioButtonTbFilterDirective, MatSlideToggleGroupDirective, MatSlideToggleTbFilterDirective, MatTableObservableDataSource, MultiSortDirective, NgrxExtModule, NotPersisitedTableSettings, PaginatorComponent, PesrsistedTableSettings, PhoneNumberPipe, PreservePasteDelimitersDirective, PreventEnterDirective, ResizeColumnDirective, SortDirection, SpaceCasePipe, StopPropagationDirective, StylerDirective, Subjectifier, TableBuilder, TableBuilderModule, TableColumnHeaderSettings, TableContainerComponent, TableCustomFilterDirective, TableCustomFilterDirectiveBase, TableFilterDirective, TableFilterStringContainsDirective, TableStore, TableVirtualScrollObservableDataSource, TableWrapperDirective, TableWrapperFooterSettings, TableWrapperHeaderSettings, Target, TbSelectedFilterDirective, TrimWhitespaceDirective, UtilitiesModule, VirtualScrollViewportDirective, actionStatusReducer, chainRequest, combineArrays, createActionableSelector, createFailure, createFilterFunc, createSuccess, defaultFilter, defaultShareReplay, defaultTableState, delayOn, filterArray, filterTypeMap, getRequestorBody, getRequestorStatus, getStatusState, httpRequest, httpRequestor, inProgress, initialState, isCustomFilter, isErrorState, isFilterInfo, isSuccessOrErrorState, isSuccessState, keysToDelete, mapArray, mapError, notNull, notStarted, onWait, onceWhen, orderMetaData, orderViewableMetaData, previousAndCurrent, selectAll, selectEntities, selectEntity, selectIds, selectTotal, serverStatusTypes, setUpStoreFactory, skipOneWhen, spaceCase, stateIs, statusAdapter, statusIsSuccessOrInProgress, switchOff, tapError, tapSuccess };
2074
2183
  export type { ActionReturner, Additional, ArrayAdditional, CustomFilter, DateTimeOptions, FilterFunc, FilterInfo, FilterOptions, FilterState, Group, HttpRequestFactory, HttpRequestState, HttpRequestState$, HttpRequestStateAny, HttpRequestStateCancelled, HttpRequestStateError, HttpRequestStateInProgress, HttpRequestStateNotStarted, HttpRequestStateSuccess, HttpRequestStateViewContext, HttpRequestor, HttpSuccessStateViewContext, MetaData, PartialFilter, PersistedTableState, Range, ReportDef, RequestResponse, RequestStateOptions, SortDef, State, StatusState, TableBuilderSettings, TableState, UnmappedTypes, mappedFieldTypes };