@spartan-ng/brain 0.0.1-alpha.380 → 0.0.1-alpha.386

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.
Files changed (101) hide show
  1. package/accordion/lib/brn-accordion-content.component.d.ts +1 -1
  2. package/accordion/lib/brn-accordion.directive.d.ts +2 -2
  3. package/core/README.md +3 -0
  4. package/core/helpers/create-injection-token.d.ts +20 -0
  5. package/core/helpers/custom-element-class-settable.d.ts +12 -0
  6. package/core/helpers/dev-mode.d.ts +5 -0
  7. package/core/helpers/exposes-side.d.ts +13 -0
  8. package/core/helpers/exposes-state.d.ts +13 -0
  9. package/core/helpers/hlm.d.ts +2 -0
  10. package/core/helpers/table-classes-settable.d.ts +16 -0
  11. package/core/helpers/zone-free.d.ts +10 -0
  12. package/core/index.d.ts +7 -0
  13. package/esm2022/accordion/lib/brn-accordion-content.component.mjs +1 -1
  14. package/esm2022/accordion/lib/brn-accordion.directive.mjs +8 -3
  15. package/esm2022/alert-dialog/lib/brn-alert-dialog-content.directive.mjs +2 -2
  16. package/esm2022/alert-dialog/lib/brn-alert-dialog-overlay.component.mjs +2 -2
  17. package/esm2022/core/helpers/create-injection-token.mjs +15 -0
  18. package/esm2022/core/helpers/custom-element-class-settable.mjs +3 -0
  19. package/esm2022/core/helpers/dev-mode.mjs +6 -0
  20. package/esm2022/core/helpers/exposes-side.mjs +3 -0
  21. package/esm2022/core/helpers/exposes-state.mjs +3 -0
  22. package/esm2022/core/helpers/hlm.mjs +6 -0
  23. package/esm2022/core/helpers/table-classes-settable.mjs +3 -0
  24. package/esm2022/core/helpers/zone-free.mjs +15 -0
  25. package/esm2022/core/index.mjs +8 -0
  26. package/esm2022/core/spartan-ng-brain-core.mjs +5 -0
  27. package/esm2022/dialog/lib/brn-dialog-content.directive.mjs +2 -2
  28. package/esm2022/dialog/lib/brn-dialog-overlay.component.mjs +2 -2
  29. package/esm2022/dialog/lib/brn-dialog-ref.mjs +3 -2
  30. package/esm2022/dialog/lib/brn-dialog.component.mjs +2 -2
  31. package/esm2022/dialog/lib/brn-dialog.service.mjs +3 -2
  32. package/esm2022/hover-card/lib/brn-hover-card-content.service.mjs +26 -36
  33. package/esm2022/hover-card/lib/brn-hover-card.component.mjs +8 -14
  34. package/esm2022/hover-card/lib/createHoverObservable.mjs +4 -3
  35. package/esm2022/menu/lib/brn-menu-trigger.directive.mjs +9 -3
  36. package/esm2022/popover/lib/brn-popover-content.directive.mjs +2 -2
  37. package/esm2022/radio-group/index.mjs +5 -5
  38. package/esm2022/radio-group/lib/{brn-radio-group.component.mjs → brn-radio-group.directive.mjs} +12 -12
  39. package/esm2022/radio-group/lib/brn-radio-group.token.mjs +3 -3
  40. package/esm2022/select/lib/brn-select-content.component.mjs +3 -2
  41. package/esm2022/select/lib/brn-select.component.mjs +4 -3
  42. package/esm2022/select/lib/brn-select.service.mjs +3 -2
  43. package/esm2022/sheet/lib/brn-sheet-content.directive.mjs +2 -2
  44. package/esm2022/sheet/lib/brn-sheet-overlay.component.mjs +2 -2
  45. package/esm2022/slider/lib/brn-slider-track.directive.mjs +3 -2
  46. package/esm2022/table/lib/brn-table.component.mjs +2 -2
  47. package/esm2022/tabs/lib/brn-tabs-list.directive.mjs +3 -2
  48. package/esm2022/toggle/lib/brn-toggle.directive.mjs +3 -3
  49. package/esm2022/tooltip/index.mjs +2 -1
  50. package/esm2022/tooltip/lib/brn-tooltip-content.component.mjs +8 -15
  51. package/esm2022/tooltip/lib/brn-tooltip-trigger.directive.mjs +136 -200
  52. package/esm2022/tooltip/lib/brn-tooltip.token.mjs +18 -0
  53. package/esm2022/tooltip/lib/computed-previous.mjs +46 -0
  54. package/fesm2022/spartan-ng-brain-accordion.mjs +7 -2
  55. package/fesm2022/spartan-ng-brain-accordion.mjs.map +1 -1
  56. package/fesm2022/spartan-ng-brain-alert-dialog.mjs +1 -1
  57. package/fesm2022/spartan-ng-brain-alert-dialog.mjs.map +1 -1
  58. package/fesm2022/spartan-ng-brain-core.mjs +57 -0
  59. package/fesm2022/spartan-ng-brain-core.mjs.map +1 -0
  60. package/fesm2022/spartan-ng-brain-dialog.mjs +3 -2
  61. package/fesm2022/spartan-ng-brain-dialog.mjs.map +1 -1
  62. package/fesm2022/spartan-ng-brain-hover-card.mjs +31 -40
  63. package/fesm2022/spartan-ng-brain-hover-card.mjs.map +1 -1
  64. package/fesm2022/spartan-ng-brain-menu.mjs +8 -2
  65. package/fesm2022/spartan-ng-brain-menu.mjs.map +1 -1
  66. package/fesm2022/spartan-ng-brain-popover.mjs +1 -1
  67. package/fesm2022/spartan-ng-brain-popover.mjs.map +1 -1
  68. package/fesm2022/spartan-ng-brain-radio-group.mjs +16 -16
  69. package/fesm2022/spartan-ng-brain-radio-group.mjs.map +1 -1
  70. package/fesm2022/spartan-ng-brain-select.mjs +3 -2
  71. package/fesm2022/spartan-ng-brain-select.mjs.map +1 -1
  72. package/fesm2022/spartan-ng-brain-sheet.mjs +1 -1
  73. package/fesm2022/spartan-ng-brain-sheet.mjs.map +1 -1
  74. package/fesm2022/spartan-ng-brain-slider.mjs +2 -1
  75. package/fesm2022/spartan-ng-brain-slider.mjs.map +1 -1
  76. package/fesm2022/spartan-ng-brain-table.mjs +1 -1
  77. package/fesm2022/spartan-ng-brain-table.mjs.map +1 -1
  78. package/fesm2022/spartan-ng-brain-tabs.mjs +2 -2
  79. package/fesm2022/spartan-ng-brain-tabs.mjs.map +1 -1
  80. package/fesm2022/spartan-ng-brain-toggle.mjs +2 -2
  81. package/fesm2022/spartan-ng-brain-toggle.mjs.map +1 -1
  82. package/fesm2022/spartan-ng-brain-tooltip.mjs +200 -211
  83. package/fesm2022/spartan-ng-brain-tooltip.mjs.map +1 -1
  84. package/hlm-tailwind-preset.js +73 -0
  85. package/hover-card/lib/brn-hover-card-content.service.d.ts +18 -11
  86. package/hover-card/lib/brn-hover-card.component.d.ts +2 -2
  87. package/hover-card/lib/createHoverObservable.d.ts +1 -1
  88. package/menu/lib/brn-menu-trigger.directive.d.ts +1 -1
  89. package/package.json +57 -46
  90. package/radio-group/index.d.ts +5 -5
  91. package/radio-group/lib/{brn-radio-group.component.d.ts → brn-radio-group.directive.d.ts} +3 -3
  92. package/radio-group/lib/brn-radio-group.token.d.ts +3 -3
  93. package/radio-group/lib/brn-radio.component.d.ts +1 -1
  94. package/select/lib/brn-select.component.d.ts +1 -1
  95. package/sheet/lib/brn-sheet-content.directive.d.ts +1 -1
  96. package/table/lib/brn-table.component.d.ts +1 -1
  97. package/tooltip/index.d.ts +1 -0
  98. package/tooltip/lib/brn-tooltip-content.component.d.ts +2 -2
  99. package/tooltip/lib/brn-tooltip-trigger.directive.d.ts +24 -64
  100. package/tooltip/lib/brn-tooltip.token.d.ts +28 -0
  101. package/tooltip/lib/computed-previous.d.ts +36 -0
package/package.json CHANGED
@@ -1,37 +1,11 @@
1
1
  {
2
2
  "name": "@spartan-ng/brain",
3
- "version": "0.0.1-alpha.380",
3
+ "version": "0.0.1-alpha.386",
4
4
  "sideEffects": false,
5
- "peerDependencies": {
6
- "@angular/cdk": ">=18.0.0",
7
- "@angular/common": ">=18.0.0",
8
- "@angular/core": ">=18.0.0",
9
- "@angular/forms": ">=18.0.0",
10
- "@ngneat/overview": "^5.1.1",
11
- "@ngneat/until-destroy": "^10.0.0",
12
- "@ngxpert/cmdk": "^1.0.0",
13
- "@spartan-ng/ui-core": "0.0.1-alpha.380",
14
- "clsx": ">=2.0.0",
15
- "luxon": ">=3.0.0",
16
- "rxjs": ">=6.6.0"
17
- },
18
- "peerDependenciesMeta": {
19
- "@ngneat/overview": {
20
- "optional": true
21
- },
22
- "@ngneat/until-destroy": {
23
- "optional": true
24
- },
25
- "@ngxpert/cmdk": {
26
- "optional": true
27
- },
28
- "luxon": {
29
- "optional": true
30
- }
31
- },
32
- "module": "fesm2022/spartan-ng-brain.mjs",
33
- "typings": "index.d.ts",
34
5
  "exports": {
6
+ "./hlm-tailwind-preset": {
7
+ "default": "./hlm-tailwind-preset.js"
8
+ },
35
9
  "./package.json": {
36
10
  "default": "./package.json"
37
11
  },
@@ -53,23 +27,17 @@
53
27
  "esm": "./esm2022/alert-dialog/spartan-ng-brain-alert-dialog.mjs",
54
28
  "default": "./fesm2022/spartan-ng-brain-alert-dialog.mjs"
55
29
  },
56
- "./calendar": {
57
- "types": "./calendar/index.d.ts",
58
- "esm2022": "./esm2022/calendar/spartan-ng-brain-calendar.mjs",
59
- "esm": "./esm2022/calendar/spartan-ng-brain-calendar.mjs",
60
- "default": "./fesm2022/spartan-ng-brain-calendar.mjs"
61
- },
62
30
  "./avatar": {
63
31
  "types": "./avatar/index.d.ts",
64
32
  "esm2022": "./esm2022/avatar/spartan-ng-brain-avatar.mjs",
65
33
  "esm": "./esm2022/avatar/spartan-ng-brain-avatar.mjs",
66
34
  "default": "./fesm2022/spartan-ng-brain-avatar.mjs"
67
35
  },
68
- "./collapsible": {
69
- "types": "./collapsible/index.d.ts",
70
- "esm2022": "./esm2022/collapsible/spartan-ng-brain-collapsible.mjs",
71
- "esm": "./esm2022/collapsible/spartan-ng-brain-collapsible.mjs",
72
- "default": "./fesm2022/spartan-ng-brain-collapsible.mjs"
36
+ "./calendar": {
37
+ "types": "./calendar/index.d.ts",
38
+ "esm2022": "./esm2022/calendar/spartan-ng-brain-calendar.mjs",
39
+ "esm": "./esm2022/calendar/spartan-ng-brain-calendar.mjs",
40
+ "default": "./fesm2022/spartan-ng-brain-calendar.mjs"
73
41
  },
74
42
  "./checkbox": {
75
43
  "types": "./checkbox/index.d.ts",
@@ -77,11 +45,11 @@
77
45
  "esm": "./esm2022/checkbox/spartan-ng-brain-checkbox.mjs",
78
46
  "default": "./fesm2022/spartan-ng-brain-checkbox.mjs"
79
47
  },
80
- "./date-time": {
81
- "types": "./date-time/index.d.ts",
82
- "esm2022": "./esm2022/date-time/spartan-ng-brain-date-time.mjs",
83
- "esm": "./esm2022/date-time/spartan-ng-brain-date-time.mjs",
84
- "default": "./fesm2022/spartan-ng-brain-date-time.mjs"
48
+ "./collapsible": {
49
+ "types": "./collapsible/index.d.ts",
50
+ "esm2022": "./esm2022/collapsible/spartan-ng-brain-collapsible.mjs",
51
+ "esm": "./esm2022/collapsible/spartan-ng-brain-collapsible.mjs",
52
+ "default": "./fesm2022/spartan-ng-brain-collapsible.mjs"
85
53
  },
86
54
  "./command": {
87
55
  "types": "./command/index.d.ts",
@@ -89,6 +57,18 @@
89
57
  "esm": "./esm2022/command/spartan-ng-brain-command.mjs",
90
58
  "default": "./fesm2022/spartan-ng-brain-command.mjs"
91
59
  },
60
+ "./core": {
61
+ "types": "./core/index.d.ts",
62
+ "esm2022": "./esm2022/core/spartan-ng-brain-core.mjs",
63
+ "esm": "./esm2022/core/spartan-ng-brain-core.mjs",
64
+ "default": "./fesm2022/spartan-ng-brain-core.mjs"
65
+ },
66
+ "./date-time": {
67
+ "types": "./date-time/index.d.ts",
68
+ "esm2022": "./esm2022/date-time/spartan-ng-brain-date-time.mjs",
69
+ "esm": "./esm2022/date-time/spartan-ng-brain-date-time.mjs",
70
+ "default": "./fesm2022/spartan-ng-brain-date-time.mjs"
71
+ },
92
72
  "./date-time-luxon": {
93
73
  "types": "./date-time-luxon/index.d.ts",
94
74
  "esm2022": "./esm2022/date-time-luxon/spartan-ng-brain-date-time-luxon.mjs",
@@ -204,6 +184,37 @@
204
184
  "default": "./fesm2022/spartan-ng-brain-tooltip.mjs"
205
185
  }
206
186
  },
187
+ "peerDependencies": {
188
+ "@angular/cdk": ">=18.0.0",
189
+ "@angular/common": ">=18.0.0",
190
+ "@angular/core": ">=18.0.0",
191
+ "@angular/forms": ">=18.0.0",
192
+ "@ngneat/overview": "^5.1.1",
193
+ "@ngneat/until-destroy": "^10.0.0",
194
+ "@ngxpert/cmdk": "^1.0.0",
195
+ "clsx": ">=2.0.0",
196
+ "luxon": ">=3.0.0",
197
+ "rxjs": ">=6.6.0",
198
+ "tailwind-merge": ">=2.5.0",
199
+ "tailwindcss": ">=3.3.0",
200
+ "tailwindcss-animate": ">=1.0.7"
201
+ },
202
+ "peerDependenciesMeta": {
203
+ "@ngneat/overview": {
204
+ "optional": true
205
+ },
206
+ "@ngneat/until-destroy": {
207
+ "optional": true
208
+ },
209
+ "@ngxpert/cmdk": {
210
+ "optional": true
211
+ },
212
+ "luxon": {
213
+ "optional": true
214
+ }
215
+ },
216
+ "module": "fesm2022/spartan-ng-brain.mjs",
217
+ "typings": "index.d.ts",
207
218
  "dependencies": {
208
219
  "tslib": "^2.3.0"
209
220
  }
@@ -1,13 +1,13 @@
1
- import { BrnRadioGroupComponent } from './lib/brn-radio-group.component';
1
+ import { BrnRadioGroupDirective } from './lib/brn-radio-group.directive';
2
2
  import { BrnRadioComponent } from './lib/brn-radio.component';
3
3
  import * as i0 from "@angular/core";
4
- import * as i1 from "./lib/brn-radio-group.component";
4
+ import * as i1 from "./lib/brn-radio-group.directive";
5
5
  import * as i2 from "./lib/brn-radio.component";
6
- export * from './lib/brn-radio-group.component';
6
+ export * from './lib/brn-radio-group.directive';
7
7
  export * from './lib/brn-radio.component';
8
- export declare const BrnRadioGroupImports: readonly [typeof BrnRadioGroupComponent, typeof BrnRadioComponent];
8
+ export declare const BrnRadioGroupImports: readonly [typeof BrnRadioGroupDirective, typeof BrnRadioComponent];
9
9
  export declare class BrnRadioGroupModule {
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnRadioGroupModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<BrnRadioGroupModule, never, [typeof i1.BrnRadioGroupComponent, typeof i2.BrnRadioComponent], [typeof i1.BrnRadioGroupComponent, typeof i2.BrnRadioComponent]>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BrnRadioGroupModule, never, [typeof i1.BrnRadioGroupDirective, typeof i2.BrnRadioComponent], [typeof i1.BrnRadioGroupDirective, typeof i2.BrnRadioComponent]>;
12
12
  static ɵinj: i0.ɵɵInjectorDeclaration<BrnRadioGroupModule>;
13
13
  }
@@ -8,7 +8,7 @@ export declare const BRN_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: {
8
8
  useExisting: import("@angular/core").Type<any>;
9
9
  multi: boolean;
10
10
  };
11
- export declare class BrnRadioGroupComponent<T = unknown> implements ControlValueAccessor {
11
+ export declare class BrnRadioGroupDirective<T = unknown> implements ControlValueAccessor {
12
12
  private static _nextUniqueId;
13
13
  protected onChange: ChangeFn<T>;
14
14
  protected onTouched: TouchFn;
@@ -52,6 +52,6 @@ export declare class BrnRadioGroupComponent<T = unknown> implements ControlValue
52
52
  * @internal
53
53
  */
54
54
  select(radioButton: BrnRadioComponent<T>, value: T): void;
55
- static ɵfac: i0.ɵɵFactoryDeclaration<BrnRadioGroupComponent<any>, never>;
56
- static ɵcmp: i0.ɵɵComponentDeclaration<BrnRadioGroupComponent<any>, "brn-radio-group", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "change": "change"; }, ["radioButtons"], ["*"], true, never>;
55
+ static ɵfac: i0.ɵɵFactoryDeclaration<BrnRadioGroupDirective<any>, never>;
56
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BrnRadioGroupDirective<any>, "[brnRadioGroup]", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "direction": { "alias": "direction"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "change": "change"; }, ["radioButtons"], never, true, never>;
57
57
  }
@@ -1,4 +1,4 @@
1
1
  import { ExistingProvider, Type } from '@angular/core';
2
- import type { BrnRadioGroupComponent } from './brn-radio-group.component';
3
- export declare function provideBrnRadioGroupToken<T>(component: Type<BrnRadioGroupComponent<T>>): ExistingProvider;
4
- export declare function injectBrnRadioGroup<T = unknown>(): BrnRadioGroupComponent<T>;
2
+ import type { BrnRadioGroupDirective } from './brn-radio-group.directive';
3
+ export declare function provideBrnRadioGroupToken<T>(directive: Type<BrnRadioGroupDirective<T>>): ExistingProvider;
4
+ export declare function injectBrnRadioGroup<T = unknown>(): BrnRadioGroupDirective<T>;
@@ -10,7 +10,7 @@ export declare class BrnRadioComponent<T = unknown> implements OnDestroy {
10
10
  private static _nextUniqueId;
11
11
  private readonly _focusMonitor;
12
12
  private readonly _elementRef;
13
- protected readonly radioGroup: import("@spartan-ng/brain/radio-group").BrnRadioGroupComponent<T>;
13
+ protected readonly radioGroup: import("@spartan-ng/brain/radio-group").BrnRadioGroupDirective<T>;
14
14
  /**
15
15
  * Whether the radio button is disabled.
16
16
  */
@@ -2,10 +2,10 @@ import { CdkOption } from '@angular/cdk/listbox';
2
2
  import { CdkConnectedOverlay, type ConnectedOverlayPositionChange, type ConnectedPosition } from '@angular/cdk/overlay';
3
3
  import { AfterContentInit, type DoCheck, type Signal } from '@angular/core';
4
4
  import { type ControlValueAccessor, NgControl } from '@angular/forms';
5
+ import { type ExposesSide, type ExposesState } from '@spartan-ng/brain/core';
5
6
  import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
6
7
  import { ChangeFn, ErrorStateTracker, TouchFn } from '@spartan-ng/brain/forms';
7
8
  import { BrnLabelDirective } from '@spartan-ng/brain/label';
8
- import { type ExposesSide, type ExposesState } from '@spartan-ng/ui-core';
9
9
  import { Subject } from 'rxjs';
10
10
  import { BrnSelectContentComponent } from './brn-select-content.component';
11
11
  import * as i0 from "@angular/core";
@@ -1,5 +1,5 @@
1
+ import { type ExposesSide } from '@spartan-ng/brain/core';
1
2
  import { BrnDialogContentDirective } from '@spartan-ng/brain/dialog';
2
- import { type ExposesSide } from '@spartan-ng/ui-core';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class BrnSheetContentDirective<T> extends BrnDialogContentDirective<T> implements ExposesSide {
5
5
  readonly side: import("@angular/core").Signal<"top" | "bottom" | "left" | "right">;
@@ -1,6 +1,6 @@
1
1
  import { CdkRowDef, type CdkTableDataSourceInput } from '@angular/cdk/table';
2
2
  import { type AfterContentInit, EventEmitter, type QueryList, type TrackByFunction } from '@angular/core';
3
- import { type TableClassesSettable } from '@spartan-ng/ui-core';
3
+ import { type TableClassesSettable } from '@spartan-ng/brain/core';
4
4
  import { BrnColumnDefComponent } from './brn-column-def.component';
5
5
  import * as i0 from "@angular/core";
6
6
  export type BrnTableDataSourceInput<T> = CdkTableDataSourceInput<T>;
@@ -11,6 +11,7 @@ export * from './lib/brn-tooltip-content.component';
11
11
  export * from './lib/brn-tooltip-content.directive';
12
12
  export * from './lib/brn-tooltip-trigger.directive';
13
13
  export * from './lib/brn-tooltip.directive';
14
+ export * from './lib/brn-tooltip.token';
14
15
  export declare const BrnTooltipImports: readonly [typeof BrnTooltipDirective, typeof BrnTooltipContentDirective, typeof BrnTooltipTriggerDirective, typeof BrnTooltipContentComponent];
15
16
  export declare class BrnTooltipModule {
16
17
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnTooltipModule, never>;
@@ -1,4 +1,4 @@
1
- import { type ElementRef, type OnDestroy, type TemplateRef } from '@angular/core';
1
+ import { ElementRef, type OnDestroy, type TemplateRef } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Internal component that wraps the tooltip's content.
@@ -26,7 +26,7 @@ export declare class BrnTooltipContentComponent implements OnDestroy {
26
26
  /** Amount of milliseconds of closing animation. */
27
27
  _exitAnimationDuration: number;
28
28
  /** Reference to the internal tooltip element. */
29
- _tooltip?: ElementRef<HTMLElement>;
29
+ _tooltip: import("@angular/core").Signal<ElementRef<any> | undefined>;
30
30
  /** Whether interactions on the page should close the tooltip */
31
31
  private _closeOnInteraction;
32
32
  /** Whether the tooltip is currently visible. */
@@ -1,5 +1,5 @@
1
- import { type ConnectedPosition, type OriginConnectionPosition, Overlay, type OverlayConnectionPosition, type ScrollStrategy } from '@angular/cdk/overlay';
2
- import { type AfterViewInit, InjectionToken, type OnDestroy, type TemplateRef } from '@angular/core';
1
+ import { type ConnectedPosition, type OriginConnectionPosition, type OverlayConnectionPosition, type ScrollStrategy } from '@angular/cdk/overlay';
2
+ import { type AfterViewInit, InjectionToken, type OnDestroy, type Provider, type TemplateRef } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
4
  export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';
5
5
  export type TooltipTouchGestures = 'auto' | 'on' | 'off';
@@ -8,32 +8,7 @@ export declare const SCROLL_THROTTLE_MS = 20;
8
8
  export declare function getBrnTooltipInvalidPositionError(position: string): Error;
9
9
  /** Injection token that determines the scroll handling while a tooltip is visible. */
10
10
  export declare const BRN_TOOLTIP_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
11
- export declare const BRN_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER: {
12
- provide: InjectionToken<() => ScrollStrategy>;
13
- deps: (typeof Overlay)[];
14
- useFactory: (overlay: Overlay) => (() => ScrollStrategy);
15
- };
16
- export declare function BRN_TOOLTIP_DEFAULT_OPTIONS_FACTORY(): BrnTooltipOptions;
17
- export declare const BRN_TOOLTIP_DEFAULT_OPTIONS: InjectionToken<BrnTooltipOptions>;
18
- export interface BrnTooltipOptions {
19
- /** Default delay when the tooltip is shown. */
20
- showDelay: number;
21
- /** Default delay when the tooltip is hidden. */
22
- hideDelay: number;
23
- /** Default delay when hiding the tooltip on a touch device. */
24
- touchendHideDelay: number;
25
- /** Default touch gesture handling for tooltips. */
26
- touchGestures?: TooltipTouchGestures;
27
- /** Default position for tooltips. */
28
- position?: TooltipPosition;
29
- /**
30
- * Default value for whether tooltips should be positioned near the click or touch origin
31
- * instead of outside the element bounding box.
32
- */
33
- positionAtOrigin?: boolean;
34
- /** Disables the ability for the user to interact with the tooltip element. */
35
- disableTooltipInteractivity?: boolean;
36
- }
11
+ export declare const BRN_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER: Provider;
37
12
  export declare class BrnTooltipTriggerDirective implements OnDestroy, AfterViewInit {
38
13
  private readonly _tooltipDirective;
39
14
  private readonly _tooltipComponent;
@@ -61,36 +36,22 @@ export declare class BrnTooltipTriggerDirective implements OnDestroy, AfterViewI
61
36
  private _overlayRef;
62
37
  private _tooltipInstance;
63
38
  /** Allows the user to define the position of the tooltip relative to the parent element */
64
- private readonly _position;
65
- get position(): TooltipPosition;
66
- set position(value: TooltipPosition);
39
+ readonly position: import("@angular/core").InputSignal<TooltipPosition>;
67
40
  /**
68
41
  * Whether tooltip should be relative to the click or touch origin
69
42
  * instead of outside the element bounding box.
70
43
  */
71
- private readonly _positionAtOrigin;
72
- get positionAtOrigin(): boolean;
73
- set positionAtOrigin(value: boolean);
44
+ readonly positionAtOrigin: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
74
45
  /** Disables the display of the tooltip. */
75
- private readonly _disabled;
76
- get disabled(): boolean;
77
- set disabled(value: boolean);
46
+ readonly brnTooltipDisabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
78
47
  /** The default delay in ms before showing the tooltip after show is called */
79
- private readonly _showDelay;
80
- get showDelay(): number;
81
- set showDelay(value: number);
48
+ readonly showDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
82
49
  /** The default delay in ms before hiding the tooltip after hide is called */
83
- private readonly _hideDelay;
84
- get hideDelay(): number;
85
- set hideDelay(value: number);
50
+ readonly hideDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
86
51
  /** The default duration in ms that exit animation takes before hiding */
87
- private readonly _exitAnimationDuration;
88
- get exitAnimationDuration(): number;
89
- set exitAnimationDuration(value: number);
52
+ readonly exitAnimationDuration: import("@angular/core").InputSignalWithTransform<number, unknown>;
90
53
  /** The default delay in ms before hiding the tooltip after hide is called */
91
- private readonly _tooltipContentClasses;
92
- get tooltipContentClasses(): string;
93
- set tooltipContentClasses(value: string | null | undefined);
54
+ readonly tooltipContentClasses: import("@angular/core").InputSignal<string>;
94
55
  /**
95
56
  * How touch gestures should be handled by the tooltip. On touch devices the tooltip directive
96
57
  * uses a long press gesture to show and hide, however it can conflict with the native browser
@@ -105,18 +66,22 @@ export declare class BrnTooltipTriggerDirective implements OnDestroy, AfterViewI
105
66
  * - `off` - Disables touch gestures. Note that this will prevent the tooltip from
106
67
  * showing on touch devices.
107
68
  */
108
- private readonly _touchGestures;
109
- set touchGestures(value: TooltipTouchGestures);
110
- get touchGestures(): TooltipTouchGestures;
69
+ readonly touchGestures: import("@angular/core").InputSignal<TooltipTouchGestures>;
111
70
  /** The message to be used to describe the aria in the tooltip */
112
- private _ariaDescribedBy;
113
- get ariaDescribedBy(): string;
114
- set ariaDescribedBy(value: string);
71
+ readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
72
+ readonly ariaDescribedByPrevious: import("@angular/core").Signal<string>;
115
73
  /** The content to be displayed in the tooltip */
116
- private _content;
117
- get content(): string | TemplateRef<unknown> | null;
118
- set content(value: string | TemplateRef<unknown> | null);
74
+ readonly brnTooltipTrigger: import("@angular/core").InputSignal<string | TemplateRef<unknown> | null>;
75
+ readonly brnTooltipTriggerState: import("@angular/core").Signal<string | TemplateRef<unknown> | null>;
119
76
  constructor();
77
+ private _initPositionEffect;
78
+ private _initBrnTooltipDisabledEffect;
79
+ private _initPositionAtOriginEffect;
80
+ private _initTooltipContentClassesEffect;
81
+ private _initAriaDescribedByPreviousEffect;
82
+ private _initBrnTooltipTriggerEffect;
83
+ private _initExitAnimationDurationEffect;
84
+ private _initHideDelayEffect;
120
85
  ngAfterViewInit(): void;
121
86
  /**
122
87
  * Dispose the tooltip when destroyed.
@@ -168,10 +133,5 @@ export declare class BrnTooltipTriggerDirective implements OnDestroy, AfterViewI
168
133
  /** Disables the native browser gestures, based on how the tooltip has been configured. */
169
134
  private _disableNativeGesturesIfNecessary;
170
135
  static ɵfac: i0.ɵɵFactoryDeclaration<BrnTooltipTriggerDirective, never>;
171
- static ɵdir: i0.ɵɵDirectiveDeclaration<BrnTooltipTriggerDirective, "[brnTooltipTrigger]", ["brnTooltipTrigger"], { "position": { "alias": "position"; "required": false; }; "positionAtOrigin": { "alias": "positionAtOrigin"; "required": false; }; "disabled": { "alias": "brnTooltipDisabled"; "required": false; }; "showDelay": { "alias": "showDelay"; "required": false; }; "hideDelay": { "alias": "hideDelay"; "required": false; }; "exitAnimationDuration": { "alias": "exitAnimationDuration"; "required": false; }; "tooltipContentClasses": { "alias": "tooltipContentClasses"; "required": false; }; "touchGestures": { "alias": "touchGestures"; "required": false; }; "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "content": { "alias": "brnTooltipTrigger"; "required": false; }; }, {}, never, never, true, never>;
172
- static ngAcceptInputType_positionAtOrigin: unknown;
173
- static ngAcceptInputType_disabled: unknown;
174
- static ngAcceptInputType_showDelay: unknown;
175
- static ngAcceptInputType_hideDelay: unknown;
176
- static ngAcceptInputType_exitAnimationDuration: unknown;
136
+ static ɵdir: i0.ɵɵDirectiveDeclaration<BrnTooltipTriggerDirective, "[brnTooltipTrigger]", ["brnTooltipTrigger"], { "position": { "alias": "position"; "required": false; "isSignal": true; }; "positionAtOrigin": { "alias": "positionAtOrigin"; "required": false; "isSignal": true; }; "brnTooltipDisabled": { "alias": "brnTooltipDisabled"; "required": false; "isSignal": true; }; "showDelay": { "alias": "showDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "hideDelay"; "required": false; "isSignal": true; }; "exitAnimationDuration": { "alias": "exitAnimationDuration"; "required": false; "isSignal": true; }; "tooltipContentClasses": { "alias": "tooltipContentClasses"; "required": false; "isSignal": true; }; "touchGestures": { "alias": "touchGestures"; "required": false; "isSignal": true; }; "ariaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "brnTooltipTrigger": { "alias": "brnTooltipTrigger"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
177
137
  }
@@ -0,0 +1,28 @@
1
+ import { ValueProvider } from '@angular/core';
2
+ import { TooltipPosition, TooltipTouchGestures } from './brn-tooltip-trigger.directive';
3
+ export interface BrnTooltipOptions {
4
+ /** Default delay when the tooltip is shown. */
5
+ showDelay: number;
6
+ /** Default delay when the tooltip is hidden. */
7
+ hideDelay: number;
8
+ /** Default delay when hiding the tooltip on a touch device. */
9
+ touchendHideDelay: number;
10
+ /** Default exit animation duration for the tooltip. */
11
+ exitAnimationDuration: number;
12
+ /** Default touch gesture handling for tooltips. */
13
+ touchGestures?: TooltipTouchGestures;
14
+ /** Default position for tooltips. */
15
+ position?: TooltipPosition;
16
+ /**
17
+ * Default value for whether tooltips should be positioned near the click or touch origin
18
+ * instead of outside the element bounding box.
19
+ */
20
+ positionAtOrigin?: boolean;
21
+ /** Disables the ability for the user to interact with the tooltip element. */
22
+ disableTooltipInteractivity?: boolean;
23
+ /** Default classes for the tooltip content. */
24
+ tooltipContentClasses?: string;
25
+ }
26
+ export declare const defaultOptions: BrnTooltipOptions;
27
+ export declare function provideBrnTooltipDefaultOptions(options: Partial<BrnTooltipOptions>): ValueProvider;
28
+ export declare function injectBrnTooltipDefaultOptions(): BrnTooltipOptions;
@@ -0,0 +1,36 @@
1
+ import { type Signal } from '@angular/core';
2
+ /**
3
+ * Returns a signal that emits the previous value of the given signal.
4
+ * The first time the signal is emitted, the previous value will be the same as the current value.
5
+ *
6
+ * @example
7
+ * ```ts
8
+ * const value = signal(0);
9
+ * const previous = computedPrevious(value);
10
+ *
11
+ * effect(() => {
12
+ * console.log('Current value:', value());
13
+ * console.log('Previous value:', previous());
14
+ * });
15
+ *
16
+ * Logs:
17
+ * // Current value: 0
18
+ * // Previous value: 0
19
+ *
20
+ * value.set(1);
21
+ *
22
+ * Logs:
23
+ * // Current value: 1
24
+ * // Previous value: 0
25
+ *
26
+ * value.set(2);
27
+ *
28
+ * Logs:
29
+ * // Current value: 2
30
+ * // Previous value: 1
31
+ *```
32
+ *
33
+ * @param computation Signal to compute previous value for
34
+ * @returns Signal that emits previous value of `s`
35
+ */
36
+ export declare function computedPrevious<T>(computation: Signal<T>): Signal<T>;