@dereekb/dbx-web 13.4.0 → 13.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-web",
3
- "version": "13.4.0",
3
+ "version": "13.4.2",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^21.0.0",
6
6
  "@angular/common": "^21.0.0",
@@ -8,11 +8,11 @@
8
8
  "@angular/forms": "^21.0.0",
9
9
  "@angular/material": "^21.0.0",
10
10
  "@angular/platform-browser": "^21.0.0",
11
- "@dereekb/browser": "13.4.0",
12
- "@dereekb/date": "13.4.0",
13
- "@dereekb/dbx-core": "13.4.0",
14
- "@dereekb/rxjs": "13.4.0",
15
- "@dereekb/util": "13.4.0",
11
+ "@dereekb/browser": "13.4.2",
12
+ "@dereekb/date": "13.4.2",
13
+ "@dereekb/dbx-core": "13.4.2",
14
+ "@dereekb/rxjs": "13.4.2",
15
+ "@dereekb/util": "13.4.2",
16
16
  "@ngbracket/ngx-layout": "^21.0.0",
17
17
  "@ngrx/component-store": "^21.0.0",
18
18
  "@ngrx/effects": "^21.0.0",
@@ -2,7 +2,7 @@ import * as _dereekb_dbx_web_calendar from '@dereekb/dbx-web/calendar';
2
2
  import * as rxjs from 'rxjs';
3
3
  import { Observable } from 'rxjs';
4
4
  import * as _angular_core from '@angular/core';
5
- import { EnvironmentProviders } from '@angular/core';
5
+ import { Provider } from '@angular/core';
6
6
  import { CalendarEvent } from 'angular-calendar';
7
7
  import * as _dereekb_util from '@dereekb/util';
8
8
  import { Maybe } from '@dereekb/util';
@@ -29,6 +29,13 @@ interface CalendarViewDateRange {
29
29
  */
30
30
  readonly isMaxDateVisible: boolean;
31
31
  }
32
+ /**
33
+ * Compares two {@link CalendarViewDateRange} values for equality by checking type, start/end dates, distance, and min/max visibility flags.
34
+ *
35
+ * @param a - First calendar view date range to compare.
36
+ * @param b - Second calendar view date range to compare.
37
+ * @returns Whether the two date ranges are considered equal.
38
+ */
32
39
  declare function isCalendarViewDateRangeEqual(a: CalendarViewDateRange, b: CalendarViewDateRange): boolean;
33
40
  interface CalendarState<T = any> {
34
41
  /**
@@ -60,6 +67,13 @@ interface CalendarState<T = any> {
60
67
  */
61
68
  readonly showPageButtons?: boolean;
62
69
  }
70
+ /**
71
+ * Computes the visible date range for the given calendar state based on display type (month, week, or day)
72
+ * and the optional navigation range limit.
73
+ *
74
+ * @param calendarState - The current calendar state containing display type, date, and navigation limits.
75
+ * @returns The computed visible date range including start, end, distance, and min/max visibility flags.
76
+ */
63
77
  declare function visibleDateRangeForCalendarState(calendarState: CalendarState): CalendarViewDateRange;
64
78
  declare class DbxCalendarStore<T = any> extends ComponentStore<CalendarState<T>> {
65
79
  constructor();
@@ -117,7 +131,23 @@ declare class DbxCalendarStore<T = any> extends ComponentStore<CalendarState<T>>
117
131
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DbxCalendarStore<any>, never>;
118
132
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DbxCalendarStore<any>>;
119
133
  }
134
+ /**
135
+ * Returns an updated calendar state after tapping a date. Only updates if the date differs from the current one
136
+ * and falls within the navigation range limit. Toggles `dateTappedTwice` when the same day is tapped again.
137
+ *
138
+ * @param state - The current calendar state.
139
+ * @param date - The date that was tapped.
140
+ * @returns The updated calendar state reflecting the tapped date.
141
+ */
120
142
  declare function updateCalendarStateWithTappedDate(state: CalendarState, date: Date): CalendarState<any>;
143
+ /**
144
+ * Returns an updated calendar state with a new navigation range limit. If the current date falls outside
145
+ * the new range, it is clamped to fit within the limit.
146
+ *
147
+ * @param state - The current calendar state.
148
+ * @param navigationRangeLimit - The new navigation date range limit, or undefined/null to remove the limit.
149
+ * @returns The updated calendar state with the applied navigation range limit.
150
+ */
121
151
  declare function updateCalendarStateWithNavigationRangeLimit(state: CalendarState, navigationRangeLimit: Maybe<Partial<DateRange>>): {
122
152
  navigationRangeLimit: Maybe<Partial<DateRange>>;
123
153
  type: CalendarDisplayType;
@@ -132,6 +162,12 @@ interface DbxCalendarEvent<T> {
132
162
  event: CalendarEvent<T>;
133
163
  action?: string;
134
164
  }
165
+ /**
166
+ * Appends time/duration subtitles to each calendar event's title and sorts the events by start date in ascending order.
167
+ *
168
+ * @param events - The calendar events to prepare and sort.
169
+ * @returns A new array of calendar events with updated titles, sorted by start date.
170
+ */
135
171
  declare function prepareAndSortCalendarEvents(events: CalendarEvent[]): CalendarEvent[];
136
172
 
137
173
  declare class DbxCalendarComponent<T> {
@@ -190,8 +226,10 @@ declare class DbxCalendarBaseComponent<T> {
190
226
 
191
227
  /**
192
228
  * Provides default configuration for the DbxCalendarModule
229
+ *
230
+ * @returns Providers that register the calendar with a date-fns date adapter.
193
231
  */
194
- declare function provideDbxCalendar(): EnvironmentProviders;
232
+ declare function provideDbxCalendar(): Provider[];
195
233
 
196
234
  export { CalendarDisplayType, DbxCalendarBaseComponent, DbxCalendarComponent, DbxCalendarStore, isCalendarViewDateRangeEqual, prepareAndSortCalendarEvents, provideDbxCalendar, updateCalendarStateWithNavigationRangeLimit, updateCalendarStateWithTappedDate, visibleDateRangeForCalendarState };
197
235
  export type { CalendarState, CalendarViewDateRange, DbxCalendarEvent };
@@ -29,6 +29,12 @@ type MapboxZoomLevel = ZoomLevel;
29
29
  type MapboxZoomLevelRange = ZoomLevelRange;
30
30
  declare const MAPBOX_MIN_ZOOM_LEVEL: MapboxZoomLevel;
31
31
  declare const MAPBOX_MAX_ZOOM_LEVEL: MapboxZoomLevel;
32
+ /**
33
+ * Clamps a numeric value to the valid Mapbox zoom level range (0 to 22).
34
+ *
35
+ * @param input - The raw zoom level number to clamp.
36
+ * @returns The zoom level clamped between {@link MAPBOX_MIN_ZOOM_LEVEL} and {@link MAPBOX_MAX_ZOOM_LEVEL}.
37
+ */
32
38
  declare function mapboxZoomLevel(input: number): MapboxZoomLevel;
33
39
  type MapboxPitch = number;
34
40
  type MapboxBearing = number;
@@ -133,6 +139,12 @@ interface MapboxViewportBoundFunctionInput {
133
139
  * Used to calculate the bounds of a view/object given the input MapboxViewportBoundFunctionInput.
134
140
  */
135
141
  type MapboxViewportBoundFunction = (input: MapboxViewportBoundFunctionInput) => LatLngBound;
142
+ /**
143
+ * Creates a function that calculates the geographic bounds of a Mapbox viewport given a center point and zoom level.
144
+ *
145
+ * @param config - Configuration specifying the map canvas size and optional tile size.
146
+ * @returns A function that accepts a center point and zoom level and returns the corresponding {@link LatLngBound}.
147
+ */
136
148
  declare function mapboxViewportBoundFunction(config: MapboxViewportBoundFunctionConfig): MapboxViewportBoundFunction;
137
149
 
138
150
  type FilterMapboxBoundReadItemValueFunction<T> = (value: T) => MapboxViewportBoundFunctionItemValue;
@@ -441,9 +453,23 @@ declare class DbxMapboxInjectionStore extends ComponentStore<DbxMapboxMapInjecti
441
453
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxMapboxInjectionStore, never>;
442
454
  static ɵprov: i0.ɵɵInjectableDeclaration<DbxMapboxInjectionStore>;
443
455
  }
456
+ /**
457
+ * Returns an updated store state with the given injection config added or replaced in the map, keyed by its unique key.
458
+ *
459
+ * @param state - The current mapbox injection store state.
460
+ * @param config - The injection configuration to add or update.
461
+ * @returns The updated store state containing the new or replaced config.
462
+ */
444
463
  declare function updateDbxMapboxMapInjectionStoreStateWithInjectionConfig(state: DbxMapboxMapInjectionStoreState, config: DbxMapboxInjectionConfig): {
445
464
  map: Map<string, DbxMapboxInjectionConfig>;
446
465
  };
466
+ /**
467
+ * Returns an updated store state with the injection config for the given key removed. If the key does not exist, returns the state unchanged.
468
+ *
469
+ * @param state - The current mapbox injection store state.
470
+ * @param key - The injection key to remove from the map.
471
+ * @returns The updated store state with the key removed, or the original state if the key was not present.
472
+ */
447
473
  declare function updateDbxMapboxMapInjectionStoreStateWithRemovedKey(state: DbxMapboxMapInjectionStoreState, key: DbxMapboxInjectionKey): DbxMapboxMapInjectionStoreState;
448
474
 
449
475
  /**
@@ -676,7 +702,7 @@ declare class DbxMapboxMarkerComponent implements OnDestroy {
676
702
  readonly marker: i0.InputSignal<Maybe<DbxMapboxMarker>>;
677
703
  readonly latLngSignal: i0.Signal<_dereekb_util.LatLngPoint | undefined>;
678
704
  readonly presentationSignal: i0.Signal<_dereekb_dbx_web_mapbox.DbxMapboxMarkerPresentation>;
679
- readonly styleSignal: i0.Signal<any>;
705
+ readonly styleSignal: i0.Signal<Record<string, unknown>>;
680
706
  readonly presentationCssClassSignal: i0.Signal<string>;
681
707
  ngOnDestroy(): void;
682
708
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxMapboxMarkerComponent, never>;
@@ -69,6 +69,14 @@ interface DefaultDbxTableItemGroup<T, G = unknown> extends DbxTableItemGroup<T,
69
69
  readonly groupId: typeof NO_GROUPS_ID;
70
70
  readonly default: true;
71
71
  }
72
+ /**
73
+ * Creates a default (ungrouped) table item group that wraps all items under the {@link NO_GROUPS_ID} identifier.
74
+ *
75
+ * Used when no explicit grouping function is provided to the table.
76
+ *
77
+ * @param items - the array of items to include in the default group
78
+ * @returns a default group containing all the provided items
79
+ */
72
80
  declare function defaultDbxTableItemGroup<T, G = unknown>(items: T[]): DefaultDbxTableItemGroup<T, G>;
73
81
  type DbxTableGroupByFunction<T, G = unknown> = (items: T[]) => ObservableOrValue<DbxTableItemGroup<T, G>[]>;
74
82
  /**
@@ -168,6 +176,13 @@ declare class DbxTableDateHeaderComponent {
168
176
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxTableDateHeaderComponent, never>;
169
177
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxTableDateHeaderComponent, "ng-component", never, {}, {}, never, never, true, never>;
170
178
  }
179
+ /**
180
+ * Creates a factory that produces injection component configs for rendering date column headers.
181
+ *
182
+ * The factory initializes each {@link DbxTableDateHeaderComponent} with the column's date metadata.
183
+ *
184
+ * @returns a factory function that maps a date column to its header injection config
185
+ */
171
186
  declare function dbxTableDateHeaderInjectionFactory(): DbxInjectionComponentConfigFactory<DbxTableColumn<Date>, DbxTableDateHeaderComponent>;
172
187
 
173
188
  interface DbxTableStoreState<I, C, T, G> {
@@ -266,6 +281,14 @@ declare class DbxTableDateRangeDayDistanceInputCellInputComponent {
266
281
  static ɵfac: i0.ɵɵFactoryDeclaration<DbxTableDateRangeDayDistanceInputCellInputComponent, never>;
267
282
  static ɵcmp: i0.ɵɵComponentDeclaration<DbxTableDateRangeDayDistanceInputCellInputComponent, "ng-component", never, {}, {}, never, never, true, never>;
268
283
  }
284
+ /**
285
+ * Creates an injection component config for a date-range day-distance input cell.
286
+ *
287
+ * Initializes the component with the provided configuration for day distance, date bounds, and button format.
288
+ *
289
+ * @param componentConfig - optional configuration for the date range input (day distance, min/max dates, button format)
290
+ * @returns an injection component config that renders a {@link DbxTableDateRangeDayDistanceInputCellInputComponent}
291
+ */
269
292
  declare function dbxTableDateRangeDayDistanceInputCellInput(componentConfig?: DbxTableDateRangeDayDistanceInputCellInputComponentConfig): DbxInjectionComponentConfig<DbxTableDateRangeDayDistanceInputCellInputComponent>;
270
293
 
271
294
  declare class DbxTableDateModule {
@@ -378,7 +401,19 @@ interface DbxTableViewItemElement<T, G> {
378
401
  readonly item: T;
379
402
  }
380
403
  type DbxTableViewElement<T, G> = DbxTableViewGroupElement<T, G> | DbxTableViewItemElement<T, G>;
404
+ /**
405
+ * Type guard that checks whether a table view element is a group element (header or footer).
406
+ *
407
+ * @param element - the table view element to check
408
+ * @returns `true` if the element represents a group header or footer row
409
+ */
381
410
  declare function isDbxTableViewGroupElement<T, G>(element: DbxTableViewElement<T, G>): element is DbxTableViewGroupElement<T, G>;
411
+ /**
412
+ * Type guard that checks whether a table view element is an item data element.
413
+ *
414
+ * @param element - the table view element to check
415
+ * @returns `true` if the element represents an item data row
416
+ */
382
417
  declare function isDbxTableViewItemElement<T, G>(element: DbxTableViewElement<T, G>): element is DbxTableViewItemElement<T, G>;
383
418
  /**
384
419
  * A table with fixed content
@@ -386,7 +421,7 @@ declare function isDbxTableViewItemElement<T, G>(element: DbxTableViewElement<T,
386
421
  declare class DbxTableViewComponent<I, C, T, G = unknown> {
387
422
  readonly tableStore: DbxTableStore<I, C, T, G>;
388
423
  readonly table: Signal<MatTable<DbxTableViewElement<T, G>>>;
389
- readonly DEFAULT_TRACK_BY_FUNCTION: TrackByFunction<any>;
424
+ readonly DEFAULT_TRACK_BY_FUNCTION: TrackByFunction<unknown>;
390
425
  readonly scrollDistance: i0.InputSignal<number>;
391
426
  readonly throttleScroll: i0.InputSignal<number>;
392
427
  readonly itemsColumnName = "_items";
@@ -400,7 +435,7 @@ declare class DbxTableViewComponent<I, C, T, G = unknown> {
400
435
  readonly displayedColumns$: Observable<string[]>;
401
436
  readonly displayedColumnsSignal: Signal<string[]>;
402
437
  readonly trackByFunction$: Observable<TrackByFunction<T>>;
403
- readonly inputTrackByFunctionSignal: Signal<TrackByFunction<any> | TrackByFunction<T>>;
438
+ readonly inputTrackByFunctionSignal: Signal<TrackByFunction<unknown> | TrackByFunction<T>>;
404
439
  readonly trackElementByFunctionSignal: Signal<TrackByFunction<DbxTableViewElement<T, G>>>;
405
440
  readonly context: _dereekb_rxjs.MutableLoadingStateContext<unknown, LoadingState<_dereekb_dbx_web_table.DbxTableContextData<I, C, T>>, _dereekb_rxjs.LoadingContextEvent & LoadingState<_dereekb_dbx_web_table.DbxTableContextData<I, C, T>>>;
406
441
  readonly dataLoadingContext: _dereekb_rxjs.MutableLoadingStateContext<unknown, LoadingState<DbxTableViewElement<T, G>[]>, _dereekb_rxjs.LoadingContextEvent & LoadingState<DbxTableViewElement<T, G>[]>>;
@@ -562,7 +597,7 @@ interface DbxTableReaderDelegate<C, T, O> {
562
597
  */
563
598
  trackItem: DbxTableReaderItemTrackByFunction<T>;
564
599
  }
565
- interface DbxTableReaderConfig<C, T, O, G = any> {
600
+ interface DbxTableReaderConfig<C, T, O, G = unknown> {
566
601
  /**
567
602
  * Delegate used for retrieving the data for a specific column and item/row.
568
603
  */
@@ -570,9 +605,9 @@ interface DbxTableReaderConfig<C, T, O, G = any> {
570
605
  /**
571
606
  * The table store used for retrieving the items.
572
607
  */
573
- readonly tableStore: DbxTableStore<any, C, T, G>;
608
+ readonly tableStore: DbxTableStore<unknown, C, T, G>;
574
609
  }
575
- interface DbxTableReader<C, T, O, G = any> extends DbxTableReaderConfig<C, T, O, G> {
610
+ interface DbxTableReader<C, T, O, G = unknown> extends DbxTableReaderConfig<C, T, O, G> {
576
611
  /**
577
612
  * Retrieves all cell data pairs for a specific column.
578
613
  */
@@ -594,7 +629,13 @@ interface DbxTableReader<C, T, O, G = any> extends DbxTableReaderConfig<C, T, O,
594
629
  */
595
630
  cellDataForColumnAndItem(column: DbxTableColumn<C>, item: T): Observable<Maybe<O>>;
596
631
  }
597
- declare function dbxTableReader<C, T, O, G = any>(config: DbxTableReaderConfig<C, T, O, G>): DbxTableReader<C, T, O, G>;
632
+ /**
633
+ * Creates a {@link DbxTableReader} that provides reactive access to cell data across all columns and items in the table.
634
+ *
635
+ * @param config The reader configuration containing the delegate and table store
636
+ * @returns A {@link DbxTableReader} instance with observable accessors for cell data
637
+ */
638
+ declare function dbxTableReader<C, T, O, G = unknown>(config: DbxTableReaderConfig<C, T, O, G>): DbxTableReader<C, T, O, G>;
598
639
 
599
640
  export { AbstractDbxTableColumnDirective, AbstractDbxTableGroupDirective, AbstractDbxTableItemDirective, DBX_TABLE_ACTIONS_COLUMN_NAME, DBX_TABLE_COLUMN_SIZE_PARENT_ELEMENT_REF_TOKEN, DBX_TABLE_ITEMS_COLUMN_NAME, DEFAULT_DBX_TABLE_DATE_RANGE_DAY_BUTTON_FORMAT, DEFAULT_DBX_TABLE_DATE_RANGE_DAY_DISTIANCE_INPUT_CELL_COMPONENT_CONFIG, DEFAULT_DBX_TABLE_READER_COLUMN_TRACK_BY, DbxColumnSizeColumnDirective, DbxTableActionCellComponent, DbxTableColumnFooterComponent, DbxTableColumnHeaderComponent, DbxTableColumnSizeDirective, DbxTableDateHeaderComponent, DbxTableDateModule, DbxTableDateRangeDayDistanceInputCellInputComponent, DbxTableDateRangeDayDistanceInputCellInputRangeSelectionStrategy, DbxTableDirective, DbxTableGroupFooterComponent, DbxTableGroupHeaderComponent, DbxTableInputCellComponent, DbxTableItemActionComponent, DbxTableItemCellComponent, DbxTableItemHeaderComponent, DbxTableModule, DbxTableStore, DbxTableSummaryEndCellComponent, DbxTableSummaryStartCellComponent, DbxTableViewComponent, NO_GROUPS_ID, dbxTableDateHeaderInjectionFactory, dbxTableDateRangeDayDistanceInputCellInput, dbxTableReader, defaultDbxTableItemGroup, isDbxTableViewGroupElement, isDbxTableViewItemElement };
600
641
  export type { DbxColumnSizeColumnValue, DbxTableColumn, DbxTableContextData, DbxTableContextDataDelegate, DbxTableDateRangeDayDistanceInputCellInputComponentConfig, DbxTableGroupByFunction, DbxTableGroupId, DbxTableItemGroup, DbxTableReader, DbxTableReaderCellDataPair, DbxTableReaderCellPair, DbxTableReaderColumnKey, DbxTableReaderColumnTrackByFunction, DbxTableReaderConfig, DbxTableReaderDelegate, DbxTableReaderItemKey, DbxTableReaderItemTrackByFunction, DbxTableStoreState, DbxTableViewDelegate, DbxTableViewElement, DbxTableViewGroupElement, DbxTableViewItemElement, DefaultDbxTableItemGroup };