@stemy/ngx-utils 19.3.5 → 19.4.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.
@@ -1,4 +1,4 @@
1
- import { EventEmitter, InjectionToken, Injector, NgZone, Provider, TemplateRef, Type } from "@angular/core";
1
+ import { ElementRef, EventEmitter, InjectionToken, Injector, NgZone, Provider, TemplateRef, Type } from "@angular/core";
2
2
  import { HttpClient, HttpErrorResponse, HttpHeaders } from "@angular/common/http";
3
3
  import { ActivatedRouteSnapshot, Data, LoadChildrenCallback, Route, Routes, UrlTree } from "@angular/router";
4
4
  import { Request } from "express";
@@ -189,6 +189,7 @@ export interface IAsyncMessage {
189
189
  context?: any;
190
190
  }
191
191
  export type AsyncMethod = (context?: any) => Promise<IAsyncMessage>;
192
+ export type DropdownAttachTo = "root" | HTMLElement | ElementRef<HTMLElement> | null;
192
193
  export interface UnorderedListTemplate {
193
194
  readonly type: string;
194
195
  readonly selector: string;
@@ -2,6 +2,7 @@ import { AfterViewInit, OnChanges } from "@angular/core";
2
2
  import { Placement } from "@floating-ui/utils";
3
3
  import { Alignment, AutoPlacementOptions } from "@floating-ui/dom";
4
4
  import { DropdownContentDirective } from "../../directives/dropdown-content.directive";
5
+ import { DropdownAttachTo } from "../../common-types";
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class DropdownBoxComponent implements AfterViewInit, OnChanges {
7
8
  /**
@@ -9,9 +10,9 @@ export declare class DropdownBoxComponent implements AfterViewInit, OnChanges {
9
10
  */
10
11
  closeInside: boolean;
11
12
  /**
12
- * Determines if the floating element needs to be placed in the root node or keep where it was before
13
+ * Determines where the floating element needs to be placed
13
14
  */
14
- attachToRoot: boolean;
15
+ attachTo: DropdownAttachTo;
15
16
  /**
16
17
  * Where to place the floating element relative to the reference element.
17
18
  */
@@ -51,5 +52,5 @@ export declare class DropdownBoxComponent implements AfterViewInit, OnChanges {
51
52
  ngAfterViewInit(): void;
52
53
  ngOnChanges(): void;
53
54
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownBoxComponent, never>;
54
- static ɵcmp: i0.ɵɵComponentDeclaration<DropdownBoxComponent, "dropdown-box", never, { "closeInside": { "alias": "closeInside"; "required": false; }; "attachToRoot": { "alias": "attachToRoot"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "crossAxis": { "alias": "crossAxis"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "autoAlignment": { "alias": "autoAlignment"; "required": false; }; "allowedPlacements": { "alias": "allowedPlacements"; "required": false; }; "componentClass": { "alias": "componentClass"; "required": false; }; }, {}, never, ["[toggle-content]", "*"], false, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<DropdownBoxComponent, "dropdown-box", never, { "closeInside": { "alias": "closeInside"; "required": false; }; "attachTo": { "alias": "attachTo"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "crossAxis": { "alias": "crossAxis"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "autoAlignment": { "alias": "autoAlignment"; "required": false; }; "allowedPlacements": { "alias": "allowedPlacements"; "required": false; }; "componentClass": { "alias": "componentClass"; "required": false; }; }, {}, never, ["[toggle-content]", "*"], false, never>;
55
56
  }
@@ -8,6 +8,8 @@ export declare class DropdownContentDirective implements OnInit, OnDestroy {
8
8
  protected dropdown: DropdownDirective;
9
9
  readonly templateRef: TemplateRef<any>;
10
10
  protected subscription: Subscription;
11
+ protected attachTo: HTMLElement;
12
+ protected attachOutside: boolean;
11
13
  protected lastPlacement: string;
12
14
  protected cleanUp: () => void;
13
15
  constructor(vcr: ViewContainerRef, rootElem: HTMLElement, dropdown: DropdownDirective, templateRef: TemplateRef<any>);
@@ -15,7 +17,8 @@ export declare class DropdownContentDirective implements OnInit, OnDestroy {
15
17
  ngOnDestroy(): void;
16
18
  protected createView(init?: boolean): void;
17
19
  protected destroyView(): void;
18
- protected createWrapper(): HTMLDivElement;
20
+ protected whereToAttach(): HTMLElement;
21
+ protected createWrapper(): HTMLDivElement[];
19
22
  initialize(): void;
20
23
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownContentDirective, [null, { optional: true; }, { optional: true; }, { optional: true; }]>;
21
24
  static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownContentDirective, "[dropdownContent]", ["dropdown-content"], {}, {}, never, never, false, never>;
@@ -7,9 +7,10 @@ export declare class DropdownToggleDirective extends AsyncMethodBase {
7
7
  readonly element: ElementRef;
8
8
  readonly dropdown: DropdownDirective;
9
9
  beforeOpen: AsyncMethod;
10
+ switch: boolean;
10
11
  constructor(element: ElementRef, dropdown: DropdownDirective, toaster: IToasterService, cdr: ChangeDetectorRef);
11
12
  protected getMethod(): AsyncMethod;
12
13
  callMethod(): boolean;
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownToggleDirective, never>;
14
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownToggleDirective, "[dropdownToggle]", ["dropdown-toggle"], { "beforeOpen": { "alias": "beforeOpen"; "required": false; }; }, {}, never, never, false, never>;
15
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownToggleDirective, "[dropdownToggle]", ["dropdown-toggle"], { "beforeOpen": { "alias": "beforeOpen"; "required": false; }; "switch": { "alias": "switch"; "required": false; }; }, {}, never, never, false, never>;
15
16
  }
@@ -1,5 +1,6 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy } from "@angular/core";
2
- import { AutoPlacementOptions, Placement } from "@floating-ui/dom";
2
+ import { AutoPlacementOptions, Boundary, Placement } from "@floating-ui/dom";
3
+ import { DropdownAttachTo } from "../common-types";
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DropdownDirective implements OnDestroy {
5
6
  protected element: ElementRef<HTMLElement>;
@@ -11,9 +12,13 @@ export declare class DropdownDirective implements OnDestroy {
11
12
  */
12
13
  closeInside: boolean;
13
14
  /**
14
- * Determines if the floating element needs to be placed in the root node or keep where it was before
15
+ * Determines where the floating element needs to be placed
15
16
  */
16
- attachToRoot: boolean;
17
+ attachTo: DropdownAttachTo;
18
+ /**
19
+ * Determines the boundary element of the floating element when shifting
20
+ */
21
+ boundary: Boundary;
17
22
  /**
18
23
  * Where to place the floating element relative to the reference element.
19
24
  */
@@ -52,5 +57,5 @@ export declare class DropdownDirective implements OnDestroy {
52
57
  show($event?: Event): boolean;
53
58
  hide(): boolean;
54
59
  static ɵfac: i0.ɵɵFactoryDeclaration<DropdownDirective, never>;
55
- static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownDirective, "[dd],[drop-down]", ["dropdown"], { "closeInside": { "alias": "closeInside"; "required": false; }; "attachToRoot": { "alias": "attachToRoot"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; "mobileViewUnder": { "alias": "mobileViewUnder"; "required": false; }; "keyboardHandler": { "alias": "keyboardHandler"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; }, { "onShown": "onShown"; "onHidden": "onHidden"; "onKeyboard": "onKeyboard"; }, never, never, false, never>;
60
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DropdownDirective, "[dd],[drop-down]", ["dropdown"], { "closeInside": { "alias": "closeInside"; "required": false; }; "attachTo": { "alias": "attachTo"; "required": false; }; "boundary": { "alias": "boundary"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "autoPlacement": { "alias": "autoPlacement"; "required": false; }; "mobileViewUnder": { "alias": "mobileViewUnder"; "required": false; }; "keyboardHandler": { "alias": "keyboardHandler"; "required": false; }; "isDisabled": { "alias": "isDisabled"; "required": false; }; }, { "onShown": "onShown"; "onHidden": "onHidden"; "onKeyboard": "onKeyboard"; }, never, never, false, never>;
56
61
  }
@@ -62,7 +62,7 @@ import { UploadComponent } from "./components/upload/upload.component";
62
62
  export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
63
63
  export declare const directives: (typeof AsyncMethodBase | typeof BackgroundDirective | typeof ComponentLoaderDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof DropdownToggleDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
64
64
  export declare const components: (typeof DropListComponent | typeof DynamicTableComponent | typeof FakeModuleComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
65
- export declare const providers: (typeof UniversalService | typeof StateService | typeof AuthGuard | typeof BaseHttpClient | typeof StorageService | typeof BaseHttpService | typeof WasmService | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof BaseToasterService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof PromiseService | typeof SocketService | typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
65
+ export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof BaseHttpClient | typeof BaseHttpService | typeof AuthGuard | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof PromiseService | typeof SocketService | typeof StateService | typeof StorageService | typeof BaseToasterService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof WasmService | typeof DeviceDetectorService | {
66
66
  provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
67
67
  useClass: typeof DragDropEventPlugin;
68
68
  multi: boolean;
@@ -59,6 +59,7 @@ import * as i55 from "@angular/common";
59
59
  import * as i56 from "@angular/forms";
60
60
  export declare function loadBaseUrl(): string;
61
61
  export declare function loadBaseHref(baseUrl: string): string;
62
+ export declare function getRootElement(): HTMLElement;
62
63
  export declare class NgxUtilsModule {
63
64
  private static getProviders;
64
65
  static forRoot(config?: IModuleConfig): ModuleWithProviders<NgxUtilsModule>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.3.5",
3
+ "version": "19.4.0",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
package/public_api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, DIALOG_SERVICE, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, IFileUploadProcess, IFileUploadResult, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
1
+ export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, DIALOG_SERVICE, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, IFileUploadProcess, IFileUploadResult, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
2
2
  export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
3
3
  export { ArrayUtils } from "./ngx-utils/utils/array.utils";
4
4
  export { AuthGuard } from "./ngx-utils/utils/auth.guard";