@dotglitch/ngx-common 1.0.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.
Files changed (60) hide show
  1. package/README.md +24 -0
  2. package/components/dynamic-html/dynamic-html.component.d.ts +15 -0
  3. package/components/dynamic-html/dynamic-html.module.d.ts +10 -0
  4. package/components/dynamic-html/dynamic-html.service.d.ts +18 -0
  5. package/components/dynamic-html/types.d.ts +12 -0
  6. package/components/lazy-loader/lazy-loader.component.d.ts +146 -0
  7. package/components/lazy-loader/lazy-loader.module.d.ts +10 -0
  8. package/components/lazy-loader/lazy-loader.service.d.ts +71 -0
  9. package/components/lazy-loader/types.d.ts +142 -0
  10. package/components/menu/menu.component.d.ts +52 -0
  11. package/components/tooltip/tooltip.component.d.ts +35 -0
  12. package/directives/menu.directive.d.ts +27 -0
  13. package/directives/tooltip.directive.d.ts +26 -0
  14. package/directives/utils.d.ts +8 -0
  15. package/esm2020/components/dynamic-html/dynamic-html.component.mjs +43 -0
  16. package/esm2020/components/dynamic-html/dynamic-html.module.mjs +27 -0
  17. package/esm2020/components/dynamic-html/dynamic-html.service.mjs +66 -0
  18. package/esm2020/components/dynamic-html/types.mjs +7 -0
  19. package/esm2020/components/lazy-loader/lazy-loader.component.mjs +360 -0
  20. package/esm2020/components/lazy-loader/lazy-loader.module.mjs +29 -0
  21. package/esm2020/components/lazy-loader/lazy-loader.service.mjs +215 -0
  22. package/esm2020/components/lazy-loader/types.mjs +26 -0
  23. package/esm2020/components/menu/menu.component.mjs +316 -0
  24. package/esm2020/components/tooltip/tooltip.component.mjs +135 -0
  25. package/esm2020/directives/menu.directive.mjs +112 -0
  26. package/esm2020/directives/tooltip.directive.mjs +92 -0
  27. package/esm2020/directives/utils.mjs +120 -0
  28. package/esm2020/dotglitch-ngx-common.mjs +5 -0
  29. package/esm2020/pipes/html-bypass.pipe.mjs +27 -0
  30. package/esm2020/pipes/resource-bypass.pipe.mjs +27 -0
  31. package/esm2020/pipes/script-bypass.pipe.mjs +27 -0
  32. package/esm2020/pipes/style-bypass.pipe.mjs +27 -0
  33. package/esm2020/pipes/url-bypass.pipe.mjs +27 -0
  34. package/esm2020/public-api.mjs +39 -0
  35. package/esm2020/services/dependency.service.mjs +55 -0
  36. package/esm2020/services/dialog.service.mjs +66 -0
  37. package/esm2020/services/fetch.service.mjs +71 -0
  38. package/esm2020/services/keyboard.service.mjs +128 -0
  39. package/esm2020/types/menu.mjs +2 -0
  40. package/esm2020/types/popup.mjs +2 -0
  41. package/esm2020/utils/index.mjs +39 -0
  42. package/fesm2015/dotglitch-ngx-common.mjs +1997 -0
  43. package/fesm2015/dotglitch-ngx-common.mjs.map +1 -0
  44. package/fesm2020/dotglitch-ngx-common.mjs +1977 -0
  45. package/fesm2020/dotglitch-ngx-common.mjs.map +1 -0
  46. package/index.d.ts +5 -0
  47. package/package.json +60 -0
  48. package/pipes/html-bypass.pipe.d.ts +16 -0
  49. package/pipes/resource-bypass.pipe.d.ts +16 -0
  50. package/pipes/script-bypass.pipe.d.ts +16 -0
  51. package/pipes/style-bypass.pipe.d.ts +16 -0
  52. package/pipes/url-bypass.pipe.d.ts +16 -0
  53. package/public-api.d.ts +34 -0
  54. package/services/dependency.service.d.ts +19 -0
  55. package/services/dialog.service.d.ts +41 -0
  56. package/services/fetch.service.d.ts +28 -0
  57. package/services/keyboard.service.d.ts +79 -0
  58. package/types/menu.d.ts +90 -0
  59. package/types/popup.d.ts +27 -0
  60. package/utils/index.d.ts +19 -0
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # Utils
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.1.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project utils` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project utils`.
8
+ > Note: Don't forget to add `--project utils` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build utils` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build utils`, go to the dist folder `cd dist/utils` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test utils` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,15 @@
1
+ import { ElementRef, SimpleChanges, OnChanges, OnDestroy, DoCheck } from '@angular/core';
2
+ import { DynamicHTMLRenderer } from './dynamic-html.service';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DynamicHTMLComponent implements DoCheck, OnChanges, OnDestroy {
5
+ private renderer;
6
+ private elementRef;
7
+ content: string;
8
+ private ref;
9
+ constructor(renderer: DynamicHTMLRenderer, elementRef: ElementRef);
10
+ ngOnChanges(_: SimpleChanges): void;
11
+ ngDoCheck(): void;
12
+ ngOnDestroy(): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicHTMLComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<DynamicHTMLComponent, "dynamic-html", never, { "content": "content"; }, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,10 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { DynamicHTMLOptions } from './types';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./dynamic-html.component";
5
+ export declare class NgxDynamicHTMLModule {
6
+ static forRoot(config: DynamicHTMLOptions): ModuleWithProviders<NgxDynamicHTMLModule>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxDynamicHTMLModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NgxDynamicHTMLModule, never, [typeof i1.DynamicHTMLComponent], [typeof i1.DynamicHTMLComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<NgxDynamicHTMLModule>;
10
+ }
@@ -0,0 +1,18 @@
1
+ import { Injector, ElementRef, ComponentFactoryResolver } from '@angular/core';
2
+ import { DynamicHTMLOptions } from './types';
3
+ import * as i0 from "@angular/core";
4
+ export interface DynamicHTMLRef {
5
+ check: () => void;
6
+ destroy: () => void;
7
+ }
8
+ export declare class DynamicHTMLRenderer {
9
+ private config;
10
+ private cfr;
11
+ private injector;
12
+ private componentFactories;
13
+ private componentRefs;
14
+ constructor(config: DynamicHTMLOptions, cfr: ComponentFactoryResolver, injector: Injector);
15
+ renderInnerHTML(elementRef: ElementRef, html: string): DynamicHTMLRef;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicHTMLRenderer, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<DynamicHTMLRenderer>;
18
+ }
@@ -0,0 +1,12 @@
1
+ import { InjectionToken, Type } from '@angular/core';
2
+ export declare abstract class OnMount {
3
+ abstract dynamicOnMount(attrs?: Map<string, string>, content?: string, element?: Element): void;
4
+ }
5
+ export interface ComponentWithSelector {
6
+ selector: string;
7
+ component: Type<any>;
8
+ }
9
+ export declare class DynamicHTMLOptions {
10
+ components: Array<ComponentWithSelector>;
11
+ }
12
+ export declare const NGX_DYNAMIC_CONFIG: InjectionToken<DynamicHTMLOptions>;
@@ -0,0 +1,146 @@
1
+ import { ViewContainerRef, ComponentRef, EventEmitter, AfterViewInit } from '@angular/core';
2
+ import { DialogRef } from '@angular/cdk/dialog';
3
+ import { LazyLoaderService } from './lazy-loader.service';
4
+ import { NgxLazyLoaderConfig } from './types';
5
+ import * as i0 from "@angular/core";
6
+ export declare class LazyLoaderComponent implements AfterViewInit {
7
+ private service;
8
+ private viewContainerRef;
9
+ dialog: DialogRef;
10
+ dialogArguments: any;
11
+ targetContainer: ViewContainerRef;
12
+ /**
13
+ * ! Here be dragons.
14
+ * Only the bravest of Adventurers can survive the battles below,
15
+ * and they must be trained and ready for the gruelling journey ahead.
16
+ * Many a soul has tried to best these Dragons, yet only one has
17
+ * succeeded since our founding.
18
+ *
19
+ * TL;DR -- Don't mess with this unless you know what you're doing.
20
+ * This is central to a ton of moving parts -- breaking it will
21
+ * cause more collateral damage than you may realize.
22
+ */
23
+ private _id;
24
+ /**
25
+ * The id of the component that will be lazy loaded
26
+ */
27
+ set id(data: string);
28
+ private _group;
29
+ set group(data: string);
30
+ get group(): string;
31
+ private _matchGroups;
32
+ private _inputs;
33
+ /**
34
+ * A map of inputs to bind to the child.
35
+ * Supports change detection. (May fail on deep JSON changes)
36
+ *
37
+ * ```html
38
+ * <lazy-loader component="MyLazyComponent"
39
+ * [inputs]="{
40
+ * prop1: true,
41
+ * prop2: false,
42
+ * complex: {
43
+ * a: true,
44
+ * b: 0
45
+ * }
46
+ * }"
47
+ * >
48
+ * </lazy-loader>
49
+ * ```
50
+ */
51
+ set inputs(data: {
52
+ [key: string]: any;
53
+ });
54
+ private outputSubscriptions;
55
+ private _outputs;
56
+ /**
57
+ * A map of outputs to bind from the child.
58
+ * Should support change detection.
59
+ * ```html
60
+ * <lazy-loader component="MyLazyComponent"
61
+ * [outputs]="{
62
+ * prop3: onOutputFire
63
+ * }"
64
+ * >
65
+ * </lazy-loader>
66
+ * ```
67
+ */
68
+ set outputs(data: {
69
+ [key: string]: Function;
70
+ });
71
+ /**
72
+ * Emits errors encountered when loading components
73
+ */
74
+ componentLoadError: EventEmitter<any>;
75
+ /**
76
+ * Emits when the component is fully constructed
77
+ * and had it's inputs and outputs bound
78
+ * > before `OnInit`
79
+ *
80
+ * Returns the active class instance of the lazy-loaded component
81
+ */
82
+ componentLoaded: EventEmitter<any>;
83
+ /**
84
+ * This is an instance of the component that is currently loaded.
85
+ */
86
+ instance: any;
87
+ /**
88
+ * Container that provides the component data
89
+ */
90
+ private targetModule;
91
+ /**
92
+ * Component definition
93
+ */
94
+ private targetComponentFactory;
95
+ /**
96
+ * Active component container reference
97
+ */
98
+ private targetComponentContainerRef;
99
+ private targetRef;
100
+ /**
101
+ * Reference to the component class instance
102
+ */
103
+ private targetComponentInstance;
104
+ /**
105
+ * Subscription with true/false state on whether the distractor should be
106
+ */
107
+ private distractorSubscription;
108
+ config: NgxLazyLoaderConfig;
109
+ private err;
110
+ private warn;
111
+ private log;
112
+ private loaderEmitter;
113
+ private clearLoader$;
114
+ private loaderSub;
115
+ showLoader: boolean;
116
+ isClearingLoader: boolean;
117
+ constructor(service: LazyLoaderService, viewContainerRef: ViewContainerRef, dialog: DialogRef, dialogArguments: any);
118
+ private initialized;
119
+ ngAfterViewInit(): Promise<void | ComponentRef<any>>;
120
+ ngOnDestroy(clearAll?: boolean): void;
121
+ /**
122
+ * Bind the input values to the child component.
123
+ */
124
+ private bindInputs;
125
+ /**
126
+ * Bind the output handlers to the loaded child component
127
+ */
128
+ private bindOutputs;
129
+ /**
130
+ * Load the "Default" component (404) screen normally.
131
+ * This is shown when the component id isn't in the
132
+ * registry or otherwise doesn't match
133
+ *
134
+ * This
135
+ */
136
+ private loadDefault;
137
+ /**
138
+ * Load the "Error" component.
139
+ * This is shown when we are able to resolve the component
140
+ * in the registry, but have some issue boostrapping the
141
+ * component into the viewContainer
142
+ */
143
+ private loadError;
144
+ static ɵfac: i0.ɵɵFactoryDeclaration<LazyLoaderComponent, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
145
+ static ɵcmp: i0.ɵɵComponentDeclaration<LazyLoaderComponent, "ngx-lazy-loader", never, { "id": "component"; "group": "group"; "inputs": "inputs"; "outputs": "outputs"; }, { "componentLoadError": "componentLoadError"; "componentLoaded": "componentLoaded"; }, never, never, true, never>;
146
+ }
@@ -0,0 +1,10 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import { NgxLazyLoaderConfig } from './types';
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./lazy-loader.component";
5
+ export declare class LazyLoaderModule {
6
+ static forRoot(config: NgxLazyLoaderConfig): ModuleWithProviders<LazyLoaderModule>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<LazyLoaderModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LazyLoaderModule, never, [typeof i1.LazyLoaderComponent], [typeof i1.LazyLoaderComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<LazyLoaderModule>;
10
+ }
@@ -0,0 +1,71 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { CompiledComponent, CompiledModule, ComponentRegistration, ComponentResolveStrategy, DynamicRegistrationArgs, NgxLazyLoaderConfig } from './types';
3
+ import * as i0 from "@angular/core";
4
+ export declare const NGX_LAZY_LOADER_CONFIG: InjectionToken<Partial<{
5
+ entries: ComponentRegistration[];
6
+ notFoundTemplate: import("@angular/core").TemplateRef<any>;
7
+ notFoundComponent: import("@angular/cdk/portal").ComponentType<any>;
8
+ errorTemplate: import("@angular/core").TemplateRef<any>;
9
+ errorComponent: import("@angular/cdk/portal").ComponentType<any>;
10
+ loaderDistractorTemplate: import("@angular/core").TemplateRef<any>;
11
+ loaderDistractorComponent: import("@angular/cdk/portal").ComponentType<any>;
12
+ logger: {
13
+ log: (...args: any) => void;
14
+ warn: (...args: any) => void;
15
+ err: (...args: any) => void;
16
+ };
17
+ componentResolveStrategy: ComponentResolveStrategy;
18
+ customResolver: (registry: (CompiledComponent | CompiledModule)[]) => Object;
19
+ }>>;
20
+ export declare class LazyLoaderService {
21
+ private get err();
22
+ private get log();
23
+ private get warn();
24
+ private static registry;
25
+ static config: NgxLazyLoaderConfig;
26
+ constructor(config?: NgxLazyLoaderConfig);
27
+ private static configure;
28
+ private static addComponentToRegistry;
29
+ /**
30
+ * Register an Angular component
31
+ * @param id identifier that is used to resolve the component
32
+ * @param group
33
+ * @param component Angular Component Class constructor
34
+ */
35
+ registerComponent<T extends {
36
+ new (...args: any[]): InstanceType<T>;
37
+ }>(args: DynamicRegistrationArgs<T>): void;
38
+ /**
39
+ *
40
+ * @param id
41
+ * @param group
42
+ */
43
+ unregisterComponent(id: string, group?: string): void;
44
+ /**
45
+ * Get the registration entry for a component.
46
+ * Returns null if component is not in the registry.
47
+ */
48
+ resolveRegistrationEntry(value: string, group?: string): {
49
+ entry: ComponentRegistration;
50
+ matchGroups: {
51
+ [key: string]: string;
52
+ };
53
+ } | {
54
+ entry: ComponentRegistration;
55
+ matchGroups?: undefined;
56
+ };
57
+ /**
58
+ * Check if a component is currently registered
59
+ * Can be used to validate regex matchers and aliases.
60
+ */
61
+ isComponentRegistered(value: string, group?: string): boolean;
62
+ /**
63
+ *
64
+ * @param bundle
65
+ * @returns The component `Object` if a component was resolved, `null` if no component was found
66
+ * `false` if the specified strategy was an invalid selection
67
+ */
68
+ resolveComponent(id: string, group: string, modules: (CompiledComponent | CompiledModule)[]): Object | null | false;
69
+ static ɵfac: i0.ɵɵFactoryDeclaration<LazyLoaderService, never>;
70
+ static ɵprov: i0.ɵɵInjectableDeclaration<LazyLoaderService>;
71
+ }
@@ -0,0 +1,142 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import { TemplateRef } from '@angular/core';
3
+ export declare enum ComponentResolveStrategy {
4
+ /**
5
+ * Match the fist component we find
6
+ * (best used for standalone components)
7
+ * @default
8
+ */
9
+ PickFirst = 0,
10
+ /**
11
+ * Perform an Exact ID to Classname of the Component
12
+ * case sensitive, zero tolerance.
13
+ */
14
+ MatchIdToClassName = 1,
15
+ /**
16
+ * Perform a fuzzy ID to classname match
17
+ * case insensitive, mutes symbols
18
+ * ignores "Component" and "Module" postfixes on class
19
+ * names
20
+ */
21
+ FuzzyIdClassName = 2,
22
+ /**
23
+ * Use a user-provided component match function
24
+ */
25
+ Custom = 3
26
+ }
27
+ export type NgxLazyLoaderConfig = Partial<{
28
+ entries: ComponentRegistration[];
29
+ notFoundTemplate: TemplateRef<any>;
30
+ notFoundComponent: ComponentType<any>;
31
+ errorTemplate: TemplateRef<any>;
32
+ errorComponent: ComponentType<any>;
33
+ loaderDistractorTemplate: TemplateRef<any>;
34
+ loaderDistractorComponent: ComponentType<any>;
35
+ logger: {
36
+ log: (...args: any) => void;
37
+ warn: (...args: any) => void;
38
+ err: (...args: any) => void;
39
+ };
40
+ /**
41
+ * What strategy should be used to resolve components
42
+ * @default ComponentResolveStrategy.FuzzyIdClassName
43
+ */
44
+ componentResolveStrategy: ComponentResolveStrategy;
45
+ customResolver: (registry: (CompiledComponent | CompiledModule)[]) => Object;
46
+ }>;
47
+ type RegistrationConfig = {
48
+ /**
49
+ * Specify a group to categorize components. If not specified,
50
+ * will default to the `default` group.
51
+ */
52
+ group?: string;
53
+ /**
54
+ * load: () => import('./pages/my-page/my-page.component')
55
+ */
56
+ load: () => any;
57
+ /**
58
+ * Called before a component is loaded.
59
+ * If it returns `false` the component will not be loaded.
60
+ */
61
+ [key: string]: any;
62
+ };
63
+ export type ComponentRegistration = (({
64
+ id: string;
65
+ } & RegistrationConfig) | ({
66
+ matcher: string[] | RegExp | ((value: string) => boolean);
67
+ } & RegistrationConfig));
68
+ export type DynamicRegistrationArgs<T = any> = {
69
+ id: string;
70
+ group?: string;
71
+ matcher?: string[] | RegExp | ((val: string) => boolean);
72
+ component?: T;
73
+ load?: () => any;
74
+ };
75
+ /**
76
+ * This is roughly a compiled component
77
+ */
78
+ export type CompiledComponent = {
79
+ (): CompiledComponent;
80
+ ɵfac: Function;
81
+ ɵcmp: {
82
+ consts: any;
83
+ contentQueries: any;
84
+ data: any;
85
+ declaredInputs: any;
86
+ decls: any;
87
+ dependencies: any;
88
+ directiveDefs: any;
89
+ encapsulation: any;
90
+ exportAs: any;
91
+ factory: any;
92
+ features: any;
93
+ findHostDirectiveDefs: any;
94
+ getStandaloneInjector: any;
95
+ hostAttrs: any;
96
+ hostBindings: any;
97
+ hostDirectives: any;
98
+ hostVars: any;
99
+ id: string;
100
+ inputs: any;
101
+ ngContentSelectors: any;
102
+ onPush: boolean;
103
+ outputs: any;
104
+ pipeDefs: any;
105
+ providersResolver: any;
106
+ schemas: any;
107
+ selectors: string[];
108
+ setInput: any;
109
+ standalone: boolean;
110
+ styles: string[];
111
+ tView: any;
112
+ template: any;
113
+ type: Function;
114
+ vars: number;
115
+ viewQuery: any;
116
+ };
117
+ };
118
+ /**
119
+ * This is roughly a compiled module
120
+ */
121
+ export type CompiledModule = {
122
+ (): CompiledModule;
123
+ ɵfac: Function;
124
+ ɵinj: {
125
+ providers: any[];
126
+ imports: any[];
127
+ };
128
+ ɵmod: {
129
+ bootstrap: any[];
130
+ declarations: Function[];
131
+ exports: any[];
132
+ id: unknown;
133
+ imports: any[];
134
+ schemas: unknown;
135
+ transitiveCompileScopes: unknown;
136
+ type: Function;
137
+ };
138
+ };
139
+ export type CompiledBundle = {
140
+ [key: string]: CompiledComponent | CompiledModule;
141
+ };
142
+ export {};
@@ -0,0 +1,52 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnInit, ViewContainerRef } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
4
+ import { MenuItem, MenuOptions } from '../../types/menu';
5
+ import * as i0 from "@angular/core";
6
+ export declare const calcMenuItemBounds: (menuItems: MenuItem[], dataObj: any) => Promise<DOMRect>;
7
+ export declare class MenuComponent implements OnInit {
8
+ viewContainer: ViewContainerRef;
9
+ sanitizer: DomSanitizer;
10
+ private _data;
11
+ dialog: MatDialog;
12
+ dialogRef: MatDialogRef<any>;
13
+ private changeDetector;
14
+ data: any;
15
+ parentCords: DOMRect;
16
+ items: MenuItem[];
17
+ config: MenuOptions;
18
+ id: string;
19
+ closeSignal: EventEmitter<any>;
20
+ selfCords: DOMRect;
21
+ readonly matIconRx: RegExp;
22
+ showIconColumn: boolean;
23
+ showShortcutColumn: boolean;
24
+ constructor(viewContainer: ViewContainerRef, sanitizer: DomSanitizer, _data: any, dialog: MatDialog, // optional only for the purpose of estimating dimensions
25
+ dialogRef: MatDialogRef<any>, changeDetector: ChangeDetectorRef);
26
+ ngOnInit(): void;
27
+ ngAfterViewInit(): void;
28
+ /**
29
+ *
30
+ * @param item
31
+ * @param evt
32
+ * @returns
33
+ */
34
+ onMenuItemClick(item: MenuItem, row: HTMLTableRowElement, hideBackdrop?: boolean): Promise<MatDialogRef<unknown, any>>;
35
+ /**
36
+ *
37
+ * @param label
38
+ * @returns
39
+ */
40
+ formatLabel(label: string): string;
41
+ /**
42
+ * Close the context menu under these circumstances
43
+ */
44
+ close(): void;
45
+ /**
46
+ * Check if the dialog is clipping offscreen
47
+ * if so, move it back into view.
48
+ */
49
+ private onResize;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuComponent, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuComponent, "ngx-menu", never, { "data": "data"; "parentCords": "parentCords"; "items": "items"; "config": "config"; "id": "id"; }, { "closeSignal": "closeSignal"; }, never, never, true, never>;
52
+ }
@@ -0,0 +1,35 @@
1
+ import { TemplateRef, Type, ViewContainerRef } from '@angular/core';
2
+ import { MatDialog, MatDialogRef } from '@angular/material/dialog';
3
+ import { PopupOptions } from '../../types/popup';
4
+ import * as i0 from "@angular/core";
5
+ export declare const calcTooltipBounds: (template: TemplateRef<any> | Type<any>, data: any) => Promise<DOMRect>;
6
+ export declare class TooltipComponent {
7
+ viewContainer: ViewContainerRef;
8
+ private _data;
9
+ dialog: MatDialog;
10
+ dialogRef: MatDialogRef<any>;
11
+ data: any;
12
+ config: PopupOptions;
13
+ ownerCords: DOMRect;
14
+ selfCords: any;
15
+ template: TemplateRef<any> | Type<any>;
16
+ isTemplate: boolean;
17
+ hasBootstrapped: boolean;
18
+ pointerIsOnVoid: boolean;
19
+ coverRectCords: {
20
+ top: number;
21
+ left: number;
22
+ height: number;
23
+ width: number;
24
+ };
25
+ constructor(viewContainer: ViewContainerRef, _data: any, dialog: MatDialog, // optional only for the purpose of estimating dimensions
26
+ dialogRef: MatDialogRef<any>);
27
+ ngOnInit(): void;
28
+ /**
29
+ * Close the tooltip if these actions occur
30
+ */
31
+ private onClose;
32
+ private onPointerLeave;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipComponent, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<TooltipComponent, "ngx-tooltip", never, { "data": "data"; "config": "config"; "ownerCords": "ownerCords"; "selfCords": "selfCords"; "template": "template"; }, {}, never, never, true, never>;
35
+ }
@@ -0,0 +1,27 @@
1
+ import { ViewContainerRef } from '@angular/core';
2
+ import { MatDialog } from '@angular/material/dialog';
3
+ import { MenuItem, MenuOptions } from '../types/menu';
4
+ import * as i0 from "@angular/core";
5
+ export declare class MenuDirective {
6
+ private dialog;
7
+ private viewContainer;
8
+ /**
9
+ * The data representing the item the menu was opened for.
10
+ */
11
+ data: any;
12
+ /**
13
+ * The items that will be bound to the context menu.
14
+ */
15
+ ctxMenuItems: MenuItem[];
16
+ menuItems: MenuItem[];
17
+ /**
18
+ * Configuration for opening the app menu
19
+ */
20
+ config: MenuOptions;
21
+ constructor(dialog: MatDialog, viewContainer: ViewContainerRef);
22
+ ngAfterViewInit(): void;
23
+ openMenu(evt: PointerEvent): Promise<[value: any]>;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuDirective, never>;
25
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuDirective, "[ngx-ctxmenu],[ngx-menu]", never, { "data": "ngx-menu-context"; "ctxMenuItems": "ngx-ctxmenu"; "menuItems": "ngx-menu"; "config": "ngx-menu-config"; }, {}, never, never, true, never>;
26
+ }
27
+ export declare const openMenu: (dialog: MatDialog, menuItems: MenuItem[], data: any, evt: PointerEvent, config?: MenuOptions) => Promise<any>;
@@ -0,0 +1,26 @@
1
+ import { TemplateRef, Type, ViewContainerRef } from '@angular/core';
2
+ import { MatDialog } from '@angular/material/dialog';
3
+ import { PopupOptions } from '../types/popup';
4
+ import * as i0 from "@angular/core";
5
+ export declare class TooltipDirective {
6
+ private dialog;
7
+ private viewContainer;
8
+ /**
9
+ */
10
+ template: TemplateRef<any> | Type<any>;
11
+ /**
12
+ * Configuration for opening the app menu
13
+ */
14
+ config: PopupOptions;
15
+ /**
16
+ * Arbitrary data to pass into the template
17
+ */
18
+ data: any;
19
+ constructor(dialog: MatDialog, viewContainer: ViewContainerRef);
20
+ ngOnInit(): void;
21
+ private dialogInstance;
22
+ onPointerEnter(evt: PointerEvent): Promise<void>;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
24
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[ngxTooltip],[ngx-tooltip]", never, { "template": "ngx-tooltip"; "config": "ngx-tooltip-config"; "data": "ngx-tooltip-context"; }, {}, never, never, true, never>;
25
+ }
26
+ export declare const openTooltip: (dialog: MatDialog, template: TemplateRef<any> | Type<any>, data: any, el: HTMLElement, config?: PopupOptions) => Promise<any>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This utils file exists outside of the strict angular DI zone
3
+ * This enables opening popups without requiring absolute DI bindings.
4
+ */
5
+ export declare const getPosition: (el: HTMLElement | PointerEvent, config: any, bounds: DOMRect) => {
6
+ top: any;
7
+ left: any;
8
+ };
@@ -0,0 +1,43 @@
1
+ import { Component, Input, } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "./dynamic-html.service";
4
+ export class DynamicHTMLComponent {
5
+ constructor(renderer, elementRef) {
6
+ this.renderer = renderer;
7
+ this.elementRef = elementRef;
8
+ this.ref = null;
9
+ }
10
+ ngOnChanges(_) {
11
+ if (this.ref) {
12
+ this.ref.destroy();
13
+ this.ref = null;
14
+ }
15
+ if (this.content && this.elementRef) {
16
+ this.ref = this.renderer.renderInnerHTML(this.elementRef, this.content);
17
+ }
18
+ }
19
+ ngDoCheck() {
20
+ if (this.ref) {
21
+ this.ref.check();
22
+ }
23
+ }
24
+ ngOnDestroy() {
25
+ if (this.ref) {
26
+ this.ref.destroy();
27
+ this.ref = null;
28
+ }
29
+ }
30
+ }
31
+ DynamicHTMLComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DynamicHTMLComponent, deps: [{ token: i1.DynamicHTMLRenderer }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
32
+ DynamicHTMLComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DynamicHTMLComponent, isStandalone: true, selector: "dynamic-html", inputs: { content: "content" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true });
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DynamicHTMLComponent, decorators: [{
34
+ type: Component,
35
+ args: [{
36
+ selector: 'dynamic-html',
37
+ template: '',
38
+ standalone: true
39
+ }]
40
+ }], ctorParameters: function () { return [{ type: i1.DynamicHTMLRenderer }, { type: i0.ElementRef }]; }, propDecorators: { content: [{
41
+ type: Input
42
+ }] } });
43
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHluYW1pYy1odG1sLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbW1vbi9zcmMvY29tcG9uZW50cy9keW5hbWljLWh0bWwvZHluYW1pYy1odG1sLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0gsU0FBUyxFQUVULEtBQUssR0FLUixNQUFNLGVBQWUsQ0FBQzs7O0FBU3ZCLE1BQU0sT0FBTyxvQkFBb0I7SUFLN0IsWUFDWSxRQUE2QixFQUM3QixVQUFzQjtRQUR0QixhQUFRLEdBQVIsUUFBUSxDQUFxQjtRQUM3QixlQUFVLEdBQVYsVUFBVSxDQUFZO1FBSjFCLFFBQUcsR0FBbUIsSUFBSSxDQUFDO0lBSy9CLENBQUM7SUFFTCxXQUFXLENBQUMsQ0FBZ0I7UUFDeEIsSUFBSSxJQUFJLENBQUMsR0FBRyxFQUFFO1lBQ1YsSUFBSSxDQUFDLEdBQUcsQ0FBQyxPQUFPLEVBQUUsQ0FBQztZQUNuQixJQUFJLENBQUMsR0FBRyxHQUFHLElBQUksQ0FBQztTQUNuQjtRQUNELElBQUksSUFBSSxDQUFDLE9BQU8sSUFBSSxJQUFJLENBQUMsVUFBVSxFQUFFO1lBQ2pDLElBQUksQ0FBQyxHQUFHLEdBQUcsSUFBSSxDQUFDLFFBQVEsQ0FBQyxlQUFlLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7U0FDM0U7SUFDTCxDQUFDO0lBRUQsU0FBUztRQUNMLElBQUksSUFBSSxDQUFDLEdBQUcsRUFBRTtZQUNWLElBQUksQ0FBQyxHQUFHLENBQUMsS0FBSyxFQUFFLENBQUM7U0FDcEI7SUFDTCxDQUFDO0lBRUQsV0FBVztRQUNQLElBQUksSUFBSSxDQUFDLEdBQUcsRUFBRTtZQUNWLElBQUksQ0FBQyxHQUFHLENBQUMsT0FBTyxFQUFFLENBQUM7WUFDbkIsSUFBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLENBQUM7U0FDbkI7SUFDTCxDQUFDOztpSEEvQlEsb0JBQW9CO3FHQUFwQixvQkFBb0IsNkhBSG5CLEVBQUU7MkZBR0gsb0JBQW9CO2tCQUxoQyxTQUFTO21CQUFDO29CQUNQLFFBQVEsRUFBRSxjQUFjO29CQUN4QixRQUFRLEVBQUUsRUFBRTtvQkFDWixVQUFVLEVBQUUsSUFBSTtpQkFDbkI7bUlBRVksT0FBTztzQkFBZixLQUFLIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgICBDb21wb25lbnQsXG4gICAgRWxlbWVudFJlZixcbiAgICBJbnB1dCxcbiAgICBTaW1wbGVDaGFuZ2VzLFxuICAgIE9uQ2hhbmdlcyxcbiAgICBPbkRlc3Ryb3ksXG4gICAgRG9DaGVjayxcbn0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmltcG9ydCB7IER5bmFtaWNIVE1MUmVuZGVyZXIsIER5bmFtaWNIVE1MUmVmIH0gZnJvbSAnLi9keW5hbWljLWh0bWwuc2VydmljZSc7XG5cbkBDb21wb25lbnQoe1xuICAgIHNlbGVjdG9yOiAnZHluYW1pYy1odG1sJyxcbiAgICB0ZW1wbGF0ZTogJycsXG4gICAgc3RhbmRhbG9uZTogdHJ1ZVxufSlcbmV4cG9ydCBjbGFzcyBEeW5hbWljSFRNTENvbXBvbmVudCBpbXBsZW1lbnRzIERvQ2hlY2ssIE9uQ2hhbmdlcywgT25EZXN0cm95IHtcbiAgICBASW5wdXQoKSBjb250ZW50OiBzdHJpbmc7XG5cbiAgICBwcml2YXRlIHJlZjogRHluYW1pY0hUTUxSZWYgPSBudWxsO1xuXG4gICAgY29uc3RydWN0b3IoXG4gICAgICAgIHByaXZhdGUgcmVuZGVyZXI6IER5bmFtaWNIVE1MUmVuZGVyZXIsXG4gICAgICAgIHByaXZhdGUgZWxlbWVudFJlZjogRWxlbWVudFJlZixcbiAgICApIHsgfVxuXG4gICAgbmdPbkNoYW5nZXMoXzogU2ltcGxlQ2hhbmdlcykge1xuICAgICAgICBpZiAodGhpcy5yZWYpIHtcbiAgICAgICAgICAgIHRoaXMucmVmLmRlc3Ryb3koKTtcbiAgICAgICAgICAgIHRoaXMucmVmID0gbnVsbDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5jb250ZW50ICYmIHRoaXMuZWxlbWVudFJlZikge1xuICAgICAgICAgICAgdGhpcy5yZWYgPSB0aGlzLnJlbmRlcmVyLnJlbmRlcklubmVySFRNTCh0aGlzLmVsZW1lbnRSZWYsIHRoaXMuY29udGVudCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBuZ0RvQ2hlY2soKSB7XG4gICAgICAgIGlmICh0aGlzLnJlZikge1xuICAgICAgICAgICAgdGhpcy5yZWYuY2hlY2soKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5nT25EZXN0cm95KCkge1xuICAgICAgICBpZiAodGhpcy5yZWYpIHtcbiAgICAgICAgICAgIHRoaXMucmVmLmRlc3Ryb3koKTtcbiAgICAgICAgICAgIHRoaXMucmVmID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ==