@dereekb/dbx-core 9.22.2 → 9.22.4

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.
@@ -12,7 +12,20 @@ export interface DbxButtonInterceptor {
12
12
  */
13
13
  interceptButtonClick: () => Observable<boolean>;
14
14
  }
15
- export declare abstract class DbxButton {
15
+ /**
16
+ * Text and icon display content for a button.
17
+ */
18
+ export interface DbxButtonDisplayContent {
19
+ /**
20
+ * button Icon, if applicable
21
+ */
22
+ icon?: Maybe<string>;
23
+ /**
24
+ * button text, if applicable
25
+ */
26
+ text?: Maybe<string>;
27
+ }
28
+ export declare abstract class DbxButton implements DbxButtonDisplayContent {
16
29
  abstract readonly disabled$: Observable<boolean>;
17
30
  abstract readonly working$: Observable<boolean>;
18
31
  abstract disabled: Maybe<boolean>;
@@ -24,3 +37,22 @@ export declare abstract class DbxButton {
24
37
  abstract clickButton(): void;
25
38
  }
26
39
  export declare function provideDbxButton<S extends DbxButton>(sourceType: Type<S>): Provider[];
40
+ export declare type DbxButtonDisplayContentType = 'text_button' | 'icon_button';
41
+ /**
42
+ * Delegate class used for retrieving the DbxButtonDisplayContent given an input value.
43
+ */
44
+ export interface DbxButtonDisplayDelegate<T> {
45
+ /**
46
+ * Returns the DbxButtonDisplayContent for the input value.
47
+ *
48
+ * @param value
49
+ */
50
+ buttonDisplayContentForValue(value: T): DbxButtonDisplayContent;
51
+ }
52
+ /**
53
+ * Returns the DbxButtonDisplayContentType given the input content.
54
+ *
55
+ * @param content
56
+ * @returns
57
+ */
58
+ export declare function dbxButtonDisplayContentType(content: DbxButtonDisplayContent): DbxButtonDisplayContentType;
@@ -2,7 +2,7 @@ import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { Maybe } from '@dereekb/util';
3
3
  import { BehaviorSubject, Subject } from 'rxjs';
4
4
  import { AbstractSubscriptionDirective } from '../subscription';
5
- import { DbxButton, DbxButtonInterceptor } from './button';
5
+ import { DbxButton, DbxButtonDisplayContent, DbxButtonInterceptor } from './button';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Abstract button component.
@@ -18,6 +18,8 @@ export declare abstract class AbstractDbxButtonDirective extends AbstractSubscri
18
18
  set working(working: boolean);
19
19
  icon?: Maybe<string>;
20
20
  text?: Maybe<string>;
21
+ get buttonDisplay(): DbxButtonDisplayContent;
22
+ set buttonDisplay(buttonDisplay: Maybe<DbxButtonDisplayContent>);
21
23
  readonly buttonClick: EventEmitter<any>;
22
24
  readonly clicked$: import("rxjs").Observable<any>;
23
25
  constructor();
@@ -41,7 +43,7 @@ export declare abstract class AbstractDbxButtonDirective extends AbstractSubscri
41
43
  */
42
44
  protected _forceButtonClicked(): void;
43
45
  static ɵfac: i0.ɵɵFactoryDeclaration<AbstractDbxButtonDirective, never>;
44
- static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxButtonDirective, never, never, { "disabled": "disabled"; "working": "working"; "icon": "icon"; "text": "text"; }, { "buttonClick": "buttonClick"; }, never, never, false>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractDbxButtonDirective, never, never, { "disabled": "disabled"; "working": "working"; "icon": "icon"; "text": "text"; "buttonDisplay": "buttonDisplay"; }, { "buttonClick": "buttonClick"; }, never, never, false>;
45
47
  }
46
48
  /**
47
49
  * Provides an DbxButton directive.
@@ -1,7 +1,7 @@
1
1
  import { FilterPresetStringRef, FilterWithPreset, FilterWithPresetOptional } from '@dereekb/rxjs';
2
2
  import { EmptyObject, GetterOrValue } from '@dereekb/util';
3
3
  import { ClickableAnchorLink } from '../router/anchor/anchor';
4
- export interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef {
4
+ export interface ClickableFilterPreset<F extends FilterWithPreset<P>, P extends string = string> extends Pick<ClickableAnchorLink, 'title' | 'icon' | 'disabled'>, FilterPresetStringRef<P> {
5
5
  /**
6
6
  * GetterOrValue that retrieves the filter for this preset.
7
7
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dereekb/dbx-core",
3
- "version": "9.22.2",
3
+ "version": "9.22.4",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^14.0.0",
6
6
  "@angular/core": "^14.0.0",
@@ -9,12 +9,12 @@
9
9
  "@ngrx/effects": "^14.0.0",
10
10
  "@ngrx/entity": "^14.0.0",
11
11
  "@ngrx/store": "^14.0.0",
12
- "@dereekb/util": "9.22.2",
13
- "@dereekb/rxjs": "9.22.2",
12
+ "@dereekb/util": "9.22.4",
13
+ "@dereekb/rxjs": "9.22.4",
14
14
  "@angular/platform-browser": "^14.2.0",
15
15
  "@uirouter/core": "^6.0.8",
16
16
  "date-fns": "^2.29.0",
17
- "@dereekb/date": "9.22.2",
17
+ "@dereekb/date": "9.22.4",
18
18
  "@angular/router": "^14.2.0"
19
19
  },
20
20
  "dependencies": {