@smallpearl/ngx-helper 0.33.50 → 20.0.3

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 (119) hide show
  1. package/core/index.d.ts +3 -1
  2. package/entities/index.d.ts +313 -2
  3. package/entity-field/index.d.ts +101 -2
  4. package/fesm2022/smallpearl-ngx-helper-entities.mjs +18 -18
  5. package/fesm2022/smallpearl-ngx-helper-entities.mjs.map +1 -1
  6. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +5 -4
  7. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -1
  8. package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -1
  9. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +6 -6
  10. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -1
  11. package/fesm2022/smallpearl-ngx-helper-locale.mjs +6 -6
  12. package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -1
  13. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +57 -31
  14. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -1
  15. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +15 -15
  16. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -1
  17. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +346 -334
  18. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
  19. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +152 -146
  20. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
  21. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +5 -5
  22. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -1
  23. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +19 -19
  24. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -1
  25. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +25 -26
  26. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -1
  27. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs +7 -7
  28. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs.map +1 -1
  29. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +24 -24
  30. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -1
  31. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +8 -9
  32. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -1
  33. package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -1
  34. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +35 -35
  35. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -1
  36. package/forms/index.d.ts +55 -1
  37. package/hover-dropdown/index.d.ts +44 -1
  38. package/index.d.ts +4 -5
  39. package/locale/index.d.ts +55 -5
  40. package/mat-busy-wheel/index.d.ts +165 -4
  41. package/mat-context-menu/index.d.ts +65 -1
  42. package/mat-entity-crud/index.d.ts +1075 -6
  43. package/mat-entity-list/index.d.ts +394 -3
  44. package/mat-file-input/index.d.ts +61 -1
  45. package/mat-form-error/index.d.ts +184 -6
  46. package/mat-select-entity/index.d.ts +194 -1
  47. package/mat-select-infinite-scroll/index.d.ts +45 -2
  48. package/mat-side-menu-layout/index.d.ts +180 -6
  49. package/mat-tel-input/index.d.ts +169 -2
  50. package/package.json +18 -13
  51. package/sideload/index.d.ts +20 -1
  52. package/stationary-with-line-items/index.d.ts +78 -1
  53. package/core/src/version.d.ts +0 -1
  54. package/entities/src/paged-loader.d.ts +0 -219
  55. package/entities/src/paginator.d.ts +0 -87
  56. package/entity-field/src/entity-field.d.ts +0 -70
  57. package/entity-field/src/provider.d.ts +0 -27
  58. package/forms/src/validation-error-handler.d.ts +0 -52
  59. package/hover-dropdown/src/hover-dropdown.directive.d.ts +0 -41
  60. package/locale/src/currency.pipe.d.ts +0 -14
  61. package/locale/src/date.pipe.d.ts +0 -14
  62. package/locale/src/format-currency.d.ts +0 -1
  63. package/locale/src/format-date.d.ts +0 -2
  64. package/locale/src/is-empty.d.ts +0 -1
  65. package/locale/src/providers.d.ts +0 -20
  66. package/mat-busy-wheel/src/busy-wheel-op.d.ts +0 -65
  67. package/mat-busy-wheel/src/busy-wheel.component.d.ts +0 -12
  68. package/mat-busy-wheel/src/busy-wheel.service.d.ts +0 -42
  69. package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +0 -35
  70. package/mat-context-menu/src/mat-context-menu.component.d.ts +0 -61
  71. package/mat-entity-crud/src/convert-context-input-to-http-context.d.ts +0 -11
  72. package/mat-entity-crud/src/default-config.d.ts +0 -9
  73. package/mat-entity-crud/src/form-view-host.component.d.ts +0 -41
  74. package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +0 -277
  75. package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +0 -131
  76. package/mat-entity-crud/src/mat-entity-crud-item-action.d.ts +0 -68
  77. package/mat-entity-crud/src/mat-entity-crud-types.d.ts +0 -149
  78. package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -366
  79. package/mat-entity-crud/src/preview-host.component.d.ts +0 -21
  80. package/mat-entity-crud/src/preview-pane.component.d.ts +0 -31
  81. package/mat-entity-crud/src/providers.d.ts +0 -3
  82. package/mat-entity-list/src/config.d.ts +0 -6
  83. package/mat-entity-list/src/mat-entity-list-types.d.ts +0 -128
  84. package/mat-entity-list/src/mat-entity-list.component.d.ts +0 -259
  85. package/mat-entity-list/src/providers.d.ts +0 -3
  86. package/mat-file-input/src/mat-file-input.component.d.ts +0 -58
  87. package/mat-form-error/src/locales/en.d.ts +0 -4
  88. package/mat-form-error/src/locales/hu.d.ts +0 -4
  89. package/mat-form-error/src/locales/index.d.ts +0 -5
  90. package/mat-form-error/src/locales/pt-br.d.ts +0 -4
  91. package/mat-form-error/src/locales/zh-hans.d.ts +0 -4
  92. package/mat-form-error/src/locales/zh-hant.d.ts +0 -4
  93. package/mat-form-error/src/ngx-error-list.component.d.ts +0 -9
  94. package/mat-form-error/src/ngx-mat-error-control.d.ts +0 -17
  95. package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +0 -30
  96. package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +0 -8
  97. package/mat-form-error/src/ngx-mat-errors.component.d.ts +0 -44
  98. package/mat-form-error/src/types.d.ts +0 -68
  99. package/mat-form-error/src/utils/coerce-to-observable.d.ts +0 -3
  100. package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +0 -2
  101. package/mat-form-error/src/utils/find-error-for-control.d.ts +0 -9
  102. package/mat-form-error/src/utils/get-abstract-controls.d.ts +0 -3
  103. package/mat-form-error/src/utils/get-control-with-error.d.ts +0 -3
  104. package/mat-select-entity/src/mat-select-entity.component.d.ts +0 -190
  105. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.directive.d.ts +0 -19
  106. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.service.d.ts +0 -25
  107. package/mat-side-menu-layout/src/layout.service.d.ts +0 -23
  108. package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +0 -39
  109. package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +0 -18
  110. package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +0 -36
  111. package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +0 -66
  112. package/mat-side-menu-layout/src/nav-item.d.ts +0 -10
  113. package/mat-tel-input/src/country-codes.d.ts +0 -5
  114. package/mat-tel-input/src/mat-telephone.component.d.ts +0 -129
  115. package/mat-tel-input/src/providers.d.ts +0 -38
  116. package/ngx-helper.d.ts +0 -2
  117. package/public-api.d.ts +0 -1
  118. package/sideload/src/sideload.d.ts +0 -18
  119. package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +0 -74
@@ -1,190 +0,0 @@
1
- import { BooleanInput } from '@angular/cdk/coercion';
2
- import { HttpContextToken } from '@angular/common/http';
3
- import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, TemplateRef } from '@angular/core';
4
- import { ControlValueAccessor, NgControl } from '@angular/forms';
5
- import { MatFormFieldControl } from '@angular/material/form-field';
6
- import { MatSelect, MatSelectChange } from '@angular/material/select';
7
- import { TranslocoService } from '@jsverse/transloco';
8
- import { SPPagedEntityLoader } from '@smallpearl/ngx-helper/entities';
9
- import { Subject } from 'rxjs';
10
- import * as i0 from "@angular/core";
11
- export interface SPMatSelectEntityHttpContext {
12
- entityName: string;
13
- entityNamePlural: string;
14
- endpoint: string;
15
- }
16
- export declare const SP_MAT_SELECT_ENTITY_HTTP_CONTEXT: HttpContextToken<SPMatSelectEntityHttpContext>;
17
- type EntityGroup<TEntity> = {
18
- label: string;
19
- entities: TEntity[];
20
- };
21
- export type SPMatSelectEntityResponseParser = <TEntity extends {
22
- [P in IdKey]: PropertyKey;
23
- }, IdKey extends string = 'id'>(response: any) => Array<TEntity>;
24
- /**
25
- * This is a generic component to display a <mat-select> for a FK field
26
- * where the select's options are dynamically loaded from the server using
27
- * the given url (or URL). The objects thus retrieved should have a
28
- * unique 'id' field that will be used as the value of each `option` element.
29
- * Therefore upon selection of an `option` element, the `select` value will
30
- * be set to the object's `id` property. By default 'id' is used as its id,
31
- * but this can be customized by specifying the `idKey' property value.
32
- */
33
- export declare class SPMatSelectEntityComponent<TEntity extends {
34
- [P in IdKey]: PropertyKey;
35
- }, IdKey extends string = 'id'> extends SPPagedEntityLoader<TEntity, IdKey> implements OnInit, OnDestroy, AfterViewInit, ControlValueAccessor, MatFormFieldControl<string | number | string[] | number[]> {
36
- labelFn: import("@angular/core").InputSignal<((entity: TEntity) => string) | undefined>;
37
- filterFn: import("@angular/core").InputSignal<((entity: TEntity, search: string) => boolean) | undefined>;
38
- inlineNew: import("@angular/core").InputSignal<boolean>;
39
- multiple: import("@angular/core").InputSignal<boolean>;
40
- readonly: import("@angular/core").InputSignal<boolean>;
41
- /**
42
- * The entity key name that is used to classify entities into groups or
43
- * a function that takes a TEntity and returns the group id (string).
44
- * Entities with the same key value will be grouped together. If this is
45
- * specified, grouping will be enabled.
46
- * @see groupByFn
47
- */
48
- groupOptionsKey: import("@angular/core").InputSignal<string | ((entity: TEntity) => string) | undefined>;
49
- /**
50
- * A function that a group id (string/number) and returns the label (string).
51
- * Defaults to a function that returns the group id as string.
52
- */
53
- groupLabelFn: import("@angular/core").InputSignal<(groupId: string | number) => string>;
54
- selectionChange: EventEmitter<TEntity | TEntity[]>;
55
- createNewItemSelected: EventEmitter<void>;
56
- readonly searchText: import("@angular/core").InputSignal<string | undefined>;
57
- readonly notFoundText: import("@angular/core").InputSignal<string | undefined>;
58
- readonly createNewText: import("@angular/core").InputSignal<string | undefined>;
59
- controlType: string;
60
- /**
61
- * Template for the option label. If not provided, the default label
62
- * function will be used. Option label is what is placed inside the
63
- * <mat-option> tag. The template gets an implicit 'entity' variable
64
- * in the context, value for which is the entity object.
65
- *
66
- * For example:
67
- * ```
68
- * <sp-mat-select-entity
69
- * [url]="'/api/v1/customers/'"
70
- * [labelFn]="entity => entity.name"
71
- * [optionLabelTemplate]="optionLabelTemplate"
72
- * ></sp-mat-select-entity>
73
- * <ng-template #optionLabelTemplate let-entity>
74
- * {{ entity.name }} - {{ entity.description }}
75
- * </ng-template>
76
- * ```
77
- */
78
- optionLabelTemplate: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
79
- protected _entityLabelFn: import("@angular/core").Signal<(entity: TEntity) => string>;
80
- protected _group: import("@angular/core").Signal<boolean>;
81
- stateChanges: Subject<void>;
82
- focused: boolean;
83
- touched: boolean;
84
- selectValue: string | number | string[] | number[];
85
- _initialValue: string | number | string[] | number[] | undefined;
86
- lastSelectValue: string | number | string[] | number[];
87
- searching: boolean;
88
- filterStr: string;
89
- filter$: Subject<string>;
90
- onChanged: (_: any) => void;
91
- onTouched: () => void;
92
- matSelect: import("@angular/core").Signal<MatSelect | undefined>;
93
- filteredValues: Subject<TEntity[]>;
94
- filteredGroupedValues: Subject<EntityGroup<TEntity>[]>;
95
- destroy: Subject<void>;
96
- static nextId: number;
97
- id: string;
98
- private _placeholder;
99
- protected cdr: ChangeDetectorRef;
100
- protected _elementRef: ElementRef<any>;
101
- protected _formField: import("@angular/material/form-field").MatFormField | null;
102
- ngControl: NgControl | null;
103
- transloco: TranslocoService;
104
- constructor();
105
- /**
106
- * Conditions for loading entities:
107
- *
108
- * 1. When the select is opened, if entities have not already been loaded.
109
- * 2. When the search string changes.
110
- * 3. When the scroll reaches the bottom and more entities are available
111
- * to be loaded.
112
- *
113
- * We need to create an 'observer-loop' that can handle the above.
114
- */
115
- ngOnInit(): void;
116
- ngOnDestroy(): void;
117
- ngAfterViewInit(): void;
118
- addEntity(entity: TEntity): void;
119
- get selectTriggerValue(): string;
120
- get selectTriggerValueAsArray(): (string | number)[];
121
- entityId(entity: TEntity): any;
122
- writeValue(entityId: string | number | string[] | number[]): void;
123
- registerOnChange(fn: any): void;
124
- registerOnTouched(fn: any): void;
125
- get entities(): TEntity[];
126
- set entities(items: TEntity[]);
127
- get value(): string | number | string[] | number[];
128
- set value(val: string | number | string[] | number[]);
129
- get shouldLabelFloat(): boolean;
130
- userAriaDescribedBy: string;
131
- get placeholder(): string;
132
- set placeholder(value: string);
133
- get required(): boolean;
134
- set required(req: boolean);
135
- private _required;
136
- get disabled(): boolean;
137
- set disabled(value: BooleanInput);
138
- private _disabled;
139
- get empty(): boolean;
140
- get errorState(): boolean;
141
- onFocusIn(event: FocusEvent): void;
142
- onFocusOut(event: FocusEvent): void;
143
- setDescribedByIds(ids: string[]): void;
144
- onContainerClick(event: MouseEvent): void;
145
- setDisabledState(isDisabled: boolean): void;
146
- onSelectOpened(ev: any): void;
147
- onSelectionChange(ev: MatSelectChange): void;
148
- /**
149
- * Wrapper to filter entities based on whether grouping is enabled or not.
150
- * Calls one of the two filtering methods -- filterGroupedEntities() or
151
- * filterNonGroupedEntities().
152
- * @param entities
153
- * @param filterStr
154
- * @returns
155
- */
156
- filterEntities(entities: TEntity[], filterStr: string): void;
157
- /**
158
- * Filters the entities based on the search string.
159
- * @param search The search string to filter entities.
160
- * @returns The number of entities in the filtered result set or undefined.
161
- */
162
- filterNonGroupedEntities(entities: TEntity[], search: string): void;
163
- /**
164
- * Filtering grouped entities logic works like this. If the search string
165
- * matches a group label, the entire group is to be included in the results.
166
- * However, if the search string only matches certain entities, only those
167
- * groups are to be included and within those groups, only entities whose
168
- * label matches the search string are to be included in the result set.
169
- * @param search
170
- * @returns number of groups in the filtered result set.
171
- */
172
- filterGroupedEntities(entities: TEntity[], search: string): void;
173
- /**
174
- * Helper to arrange the given array of entities into groups based on the
175
- * value for `groupOptionsKey`.
176
- * @param entities
177
- * @returns EntityGroup<TEntity>[]
178
- */
179
- protected groupEntities(entities: TEntity[]): EntityGroup<TEntity>[];
180
- private getHttpReqContext;
181
- /**
182
- * If more entities are available, load the next page of entities.
183
- * This method is triggered when user scrolls to the bottom of the options
184
- * list. Well almost to the bottom of the options list. :)
185
- */
186
- onInfiniteScroll(): void;
187
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatSelectEntityComponent<any, any>, never>;
188
- static ɵcmp: i0.ɵɵComponentDeclaration<SPMatSelectEntityComponent<any, any>, "sp-mat-select-entity", never, { "labelFn": { "alias": "labelFn"; "required": false; "isSignal": true; }; "filterFn": { "alias": "filterFn"; "required": false; "isSignal": true; }; "inlineNew": { "alias": "inlineNew"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "groupOptionsKey": { "alias": "groupOptionsKey"; "required": false; "isSignal": true; }; "groupLabelFn": { "alias": "groupLabelFn"; "required": false; "isSignal": true; }; "searchText": { "alias": "searchText"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "createNewText": { "alias": "createNewText"; "required": false; "isSignal": true; }; "optionLabelTemplate": { "alias": "optionLabelTemplate"; "required": false; "isSignal": true; }; "entities": { "alias": "entities"; "required": false; }; "value": { "alias": "value"; "required": false; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; "createNewItemSelected": "createNewItemSelected"; }, never, never, true, never>;
189
- }
190
- export {};
@@ -1,19 +0,0 @@
1
- import { AfterViewInit, EventEmitter, OnDestroy } from '@angular/core';
2
- import { MatSelect } from '@angular/material/select';
3
- import { MatSelectInfiniteScrollService } from './mat-select-infinite-scroll.service';
4
- import * as i0 from "@angular/core";
5
- export declare class MatSelectInfiniteScrollDirective implements OnDestroy, AfterViewInit {
6
- protected matSelect: MatSelect;
7
- private infiniteScrollService;
8
- threshold: string;
9
- debounceTime: number;
10
- complete: boolean;
11
- infiniteScroll: EventEmitter<void>;
12
- private destroyed$;
13
- constructor(matSelect: MatSelect, infiniteScrollService: MatSelectInfiniteScrollService);
14
- ngAfterViewInit(): void;
15
- getSelectItemHeightPx(panel: Element): number;
16
- ngOnDestroy(): void;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<MatSelectInfiniteScrollDirective, never>;
18
- static ɵdir: i0.ɵɵDirectiveDeclaration<MatSelectInfiniteScrollDirective, "[msInfiniteScroll]", never, { "threshold": { "alias": "threshold"; "required": false; }; "debounceTime": { "alias": "debounceTime"; "required": false; }; "complete": { "alias": "complete"; "required": false; }; }, { "infiniteScroll": "infiniteScroll"; }, never, never, true, never>;
19
- }
@@ -1,25 +0,0 @@
1
- import { NgZone } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class MatSelectInfiniteScrollService {
4
- private ngZone;
5
- private threshold;
6
- private debounceTime;
7
- private complete;
8
- private thrPx;
9
- private thrPc;
10
- private destroyed$;
11
- private selectItemHeightPx;
12
- private panel;
13
- constructor(ngZone: NgZone);
14
- initialize(panel: Element, selectItemHeightPx: number, config: {
15
- threshold: string;
16
- debounceTime: number;
17
- complete: boolean;
18
- }): void;
19
- evaluateThreshold(): void;
20
- registerScrollListener(infiniteScrollCallback: () => void): void;
21
- handleScrollEvent(event: Event, infiniteScrollCallback: () => void): void;
22
- destroy(): void;
23
- static ɵfac: i0.ɵɵFactoryDeclaration<MatSelectInfiniteScrollService, never>;
24
- static ɵprov: i0.ɵɵInjectableDeclaration<MatSelectInfiniteScrollService>;
25
- }
@@ -1,23 +0,0 @@
1
- import { BreakpointObserver } from '@angular/cdk/layout';
2
- import { OnDestroy } from '@angular/core';
3
- import { Router } from '@angular/router';
4
- import { BehaviorSubject, Subject } from 'rxjs';
5
- import * as i0 from "@angular/core";
6
- export interface SideMenuLayoutProps {
7
- smallScreen: boolean;
8
- toolbarHeight: number;
9
- }
10
- export declare class LayoutService implements OnDestroy {
11
- breakpointObserver: BreakpointObserver;
12
- marginTop: number;
13
- toolbarHeight: number;
14
- smallScreen: boolean;
15
- destroy: Subject<void>;
16
- _previousUrl: string;
17
- layoutChanged: BehaviorSubject<SideMenuLayoutProps>;
18
- constructor(breakpointObserver: BreakpointObserver, router: Router);
19
- ngOnDestroy(): void;
20
- get previousUrl(): string;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<LayoutService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<LayoutService>;
23
- }
@@ -1,39 +0,0 @@
1
- import { ChangeDetectorRef, OnDestroy, OnInit, TemplateRef } from '@angular/core';
2
- import { MatSidenav } from '@angular/material/sidenav';
3
- import { Subject } from 'rxjs';
4
- import { LayoutService, SideMenuLayoutProps } from './layout.service';
5
- import { NavItem } from './nav-item';
6
- import * as i0 from "@angular/core";
7
- export declare class SPMatMenuLayoutComponent implements OnInit, OnDestroy {
8
- private layoutService;
9
- private cdr;
10
- menuNav: MatSidenav;
11
- layout: SideMenuLayoutProps;
12
- destroy: Subject<void>;
13
- containerHeight: number;
14
- topBottomPadding: number;
15
- baseUrl: string;
16
- showBackButton: boolean;
17
- defaultBackButtonHref: string;
18
- backButtonText: string;
19
- brandingImage: string;
20
- brandingText: string;
21
- appTitle: string;
22
- menuTitle: string;
23
- menuItems: NavItem[];
24
- menuPaneFooterContent: TemplateRef<any>;
25
- toolbarEndContent: TemplateRef<any>;
26
- infoPaneContent: TemplateRef<any>;
27
- toolbarTitleContent: TemplateRef<any>;
28
- infoPaneMinWidth: number;
29
- infoPaneMaxWidth: number;
30
- contentContainerClass: string;
31
- showIcons: boolean;
32
- readonly infoPane: MatSidenav;
33
- constructor(layoutService: LayoutService, cdr: ChangeDetectorRef);
34
- ngOnInit(): void;
35
- ngOnDestroy(): void;
36
- onToggleMenuPane(): void;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatMenuLayoutComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<SPMatMenuLayoutComponent, "sp-mat-menu-layout", never, { "baseUrl": { "alias": "baseUrl"; "required": false; }; "showBackButton": { "alias": "showBackButton"; "required": false; }; "defaultBackButtonHref": { "alias": "defaultBackButtonHref"; "required": false; }; "backButtonText": { "alias": "backButtonText"; "required": false; }; "brandingImage": { "alias": "brandingImage"; "required": false; }; "brandingText": { "alias": "brandingText"; "required": false; }; "appTitle": { "alias": "appTitle"; "required": false; }; "menuTitle": { "alias": "menuTitle"; "required": false; }; "menuItems": { "alias": "menuItems"; "required": false; }; "menuPaneFooterContent": { "alias": "menuPaneFooterContent"; "required": false; }; "toolbarEndContent": { "alias": "toolbarEndContent"; "required": false; }; "infoPaneContent": { "alias": "infoPaneContent"; "required": false; }; "toolbarTitleContent": { "alias": "toolbarTitleContent"; "required": false; }; "infoPaneMinWidth": { "alias": "infoPaneMinWidth"; "required": false; }; "infoPaneMaxWidth": { "alias": "infoPaneMaxWidth"; "required": false; }; "contentContainerClass": { "alias": "contentContainerClass"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; }, {}, never, never, false, never>;
39
- }
@@ -1,18 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./mat-menu-pane.component";
3
- import * as i2 from "./mat-menu-list-item.component";
4
- import * as i3 from "./mat-menu-layout.component";
5
- import * as i4 from "@angular/common";
6
- import * as i5 from "@angular/router";
7
- import * as i6 from "@angular/material/sidenav";
8
- import * as i7 from "@angular/material/toolbar";
9
- import * as i8 from "@angular/material/icon";
10
- import * as i9 from "@angular/material/button";
11
- import * as i10 from "@angular/material/menu";
12
- import * as i11 from "@angular/material/dialog";
13
- import * as i12 from "@angular/material/list";
14
- export declare class SPMatMenuLayoutModule {
15
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatMenuLayoutModule, never>;
16
- static ɵmod: i0.ɵɵNgModuleDeclaration<SPMatMenuLayoutModule, [typeof i1.SPMatMenuPaneComponent, typeof i2.SPMatMenuListItemComponent, typeof i3.SPMatMenuLayoutComponent], [typeof i4.CommonModule, typeof i5.RouterOutlet, typeof i6.MatSidenavModule, typeof i7.MatToolbarModule, typeof i8.MatIconModule, typeof i9.MatButtonModule, typeof i10.MatMenuModule, typeof i11.MatDialogModule, typeof i12.MatListModule], [typeof i1.SPMatMenuPaneComponent, typeof i2.SPMatMenuListItemComponent, typeof i3.SPMatMenuLayoutComponent]>;
17
- static ɵinj: i0.ɵɵInjectorDeclaration<SPMatMenuLayoutModule>;
18
- }
@@ -1,36 +0,0 @@
1
- import { ChangeDetectorRef, OnDestroy, OnInit, QueryList } from '@angular/core';
2
- import { MatDialog } from '@angular/material/dialog';
3
- import { ActivatedRoute, Router } from '@angular/router';
4
- import { NavItem } from './nav-item';
5
- import * as i0 from "@angular/core";
6
- export declare class SPMatMenuListItemComponent implements OnInit, OnDestroy {
7
- route: ActivatedRoute;
8
- router: Router;
9
- private dialog;
10
- private cdr;
11
- expanded: boolean;
12
- highlighted: boolean;
13
- ariaExpanded: boolean;
14
- item: NavItem;
15
- depth: number;
16
- parent: SPMatMenuListItemComponent;
17
- showIcon: boolean;
18
- children: QueryList<SPMatMenuListItemComponent>;
19
- constructor(route: ActivatedRoute, router: Router, dialog: MatDialog, cdr: ChangeDetectorRef);
20
- ngOnInit(): void;
21
- ngOnDestroy(): void;
22
- get isHighlighted(): boolean;
23
- toggleHighlight(highlight: boolean): void;
24
- /**
25
- * Expand a parent container menu item.
26
- */
27
- expand(): void;
28
- /**
29
- * Collapse an expanded parent container menu item.
30
- */
31
- collapse(): void;
32
- checkChildrenForHighlight(lastUrlSegment: string): boolean;
33
- onItemSelected(ev: Event, item: NavItem): void;
34
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatMenuListItemComponent, never>;
35
- static ɵcmp: i0.ɵɵComponentDeclaration<SPMatMenuListItemComponent, "ngx-mat-menu-list-item", never, { "highlighted": { "alias": "highlighted"; "required": false; }; "item": { "alias": "item"; "required": false; }; "depth": { "alias": "depth"; "required": false; }; "parent": { "alias": "parent"; "required": false; }; "showIcon": { "alias": "showIcon"; "required": false; }; }, {}, never, never, false, never>;
36
- }
@@ -1,66 +0,0 @@
1
- import { AfterViewInit, ChangeDetectorRef, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from '@angular/core';
2
- import { MatSidenav } from '@angular/material/sidenav';
3
- import { Router } from '@angular/router';
4
- import { Subject } from 'rxjs';
5
- import { LayoutService, SideMenuLayoutProps } from './layout.service';
6
- import { SPMatMenuListItemComponent } from './mat-menu-list-item.component';
7
- import { NavItem } from './nav-item';
8
- import * as i0 from "@angular/core";
9
- export declare class SPMatMenuPaneComponent implements OnInit, OnDestroy, AfterViewInit, OnChanges {
10
- cdr: ChangeDetectorRef;
11
- private layoutService;
12
- private router;
13
- private injector;
14
- menuTitle: string;
15
- showBackButton: boolean;
16
- defaultBackButtonHref: string;
17
- backButtonText: string;
18
- menuItems: NavItem[];
19
- brandingText: string;
20
- brandingImage: string;
21
- matSideNav: MatSidenav | undefined;
22
- appVersion: string;
23
- menuPaneFooterContent: TemplateRef<any>;
24
- showIcons: boolean;
25
- baseUrl: string;
26
- layout: SideMenuLayoutProps;
27
- backButtonNavItem: NavItem | undefined;
28
- destroy: Subject<void>;
29
- menuItemComps: import("@angular/core").Signal<readonly SPMatMenuListItemComponent[]>;
30
- menuItemComps$: import("@angular/core").EffectRef;
31
- constructor(cdr: ChangeDetectorRef, layoutService: LayoutService, router: Router, injector: Injector);
32
- ngOnInit(): void;
33
- ngOnDestroy(): void;
34
- ngOnChanges(changes: SimpleChanges): void;
35
- ngAfterViewInit(): void;
36
- /**
37
- * Highlights the menu item for the specified URL.
38
- *
39
- * @param url the full url of the current navigation
40
- *
41
- * The way this function works is like this.
42
- *
43
- * It first finds the NavItem matching the given URL in url arg. It does
44
- * this by removing the baseUrl from the url and then comparing the
45
- * NavItem.route attached to each SPMatMenuListItemComponent. This is done
46
- * recursively covering all NavItem.children. When a matching NavItem is
47
- * found, the function goes on to find the SPMatMenuListItemComponent which
48
- * has this NavItem attached to it. This too is done recursively to find
49
- * the innermost NavItem with matching URL.
50
- *
51
- * When a matching SPMatMenuListItemComponent is found, it first deselects
52
- * the previous SPMatMenuListItemComponent selection and then goes on to
53
- * select the newly matched SPMatMenuListItemComponent. If the
54
- * SPMatMenuListItemComponent is a child of a parent NavItem, the parent
55
- * NavItem is expanded. Similarly when deselecting the current selection,
56
- * if it belongs to a parent NavItem and the parent is not shared by the
57
- * currently matched SPMatMenuListItemComponent, it collapses the parent
58
- * of the previously selected SPMatMenuListItemComponent. (Quite a mouthful
59
- * of a sentence, but it's exactly how it works.)
60
- */
61
- highlightUrlMenuItem(url: string): void;
62
- private _curHighlitedMenuItemComp;
63
- highlightMenuItemComp(menuItemComp: SPMatMenuListItemComponent): void;
64
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatMenuPaneComponent, never>;
65
- static ɵcmp: i0.ɵɵComponentDeclaration<SPMatMenuPaneComponent, "ngx-mat-menu-pane", never, { "menuTitle": { "alias": "menuTitle"; "required": false; }; "showBackButton": { "alias": "showBackButton"; "required": false; }; "defaultBackButtonHref": { "alias": "defaultBackButtonHref"; "required": false; }; "backButtonText": { "alias": "backButtonText"; "required": false; }; "menuItems": { "alias": "menuItems"; "required": false; }; "brandingText": { "alias": "brandingText"; "required": false; }; "brandingImage": { "alias": "brandingImage"; "required": false; }; "matSideNav": { "alias": "matSideNav"; "required": false; }; "appVersion": { "alias": "appVersion"; "required": false; }; "menuPaneFooterContent": { "alias": "menuPaneFooterContent"; "required": false; }; "showIcons": { "alias": "showIcons"; "required": false; }; "baseUrl": { "alias": "baseUrl"; "required": false; }; }, {}, never, never, false, never>;
66
- }
@@ -1,10 +0,0 @@
1
- export interface NavItem {
2
- text: string;
3
- disabled?: boolean;
4
- icon?: string;
5
- iconType?: 'mat' | 'bi' | 'fa';
6
- route?: string;
7
- children?: NavItem[];
8
- backButton?: boolean;
9
- backHref?: string;
10
- }
@@ -1,5 +0,0 @@
1
- export declare const COUNTRY_CODES: {
2
- name: string;
3
- code: string;
4
- callingCode: number;
5
- }[];
@@ -1,129 +0,0 @@
1
- import { FocusMonitor } from '@angular/cdk/a11y';
2
- import { BooleanInput } from '@angular/cdk/coercion';
3
- import { HttpClient } from '@angular/common/http';
4
- import { ChangeDetectorRef, ElementRef, Injector, OnDestroy, OnInit } from '@angular/core';
5
- import { AbstractControl, ControlValueAccessor, FormBuilder, FormControl, FormGroup, NgControl } from '@angular/forms';
6
- import { MatFormField, MatFormFieldControl } from '@angular/material/form-field';
7
- import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
8
- import { MatSelect, MatSelectChange } from '@angular/material/select';
9
- import * as i0 from "@angular/core";
10
- interface CountryInfo {
11
- name: string;
12
- code: string;
13
- callingCode: number;
14
- }
15
- /** Data structure for holding telephone number. */
16
- export declare class ISOTelNumber {
17
- country: string;
18
- national: string;
19
- constructor(country: string, national: string);
20
- }
21
- export declare class SPMatTelephoneInputComponent implements OnInit, OnDestroy, ControlValueAccessor, MatFormFieldControl<ISOTelNumber> {
22
- private injector;
23
- private cdr;
24
- private http;
25
- private _focusMonitor;
26
- private _elementRef;
27
- _formField: MatFormField;
28
- ngControl: NgControl;
29
- static nextId: number;
30
- countrySelect: MatSelect;
31
- nationalInput: ElementRef;
32
- mobile: boolean;
33
- allowedCountries: string;
34
- defaultCountry: string;
35
- filter$: BehaviorSubject<string>;
36
- countries$: import("rxjs").Observable<CountryInfo[]>;
37
- countries: Array<CountryInfo>;
38
- filteredCountries: ReplaySubject<CountryInfo[]>;
39
- isDisabled: boolean;
40
- private _onChange;
41
- private control;
42
- private onCountrySelectFocus;
43
- private onCountrySelectBlur;
44
- phoneUtil: any;
45
- parts: FormGroup<{
46
- country: FormControl<CountryInfo | null>;
47
- national: FormControl<string | null>;
48
- }>;
49
- stateChanges: Subject<void>;
50
- focused: boolean;
51
- touched: boolean;
52
- controlType: string;
53
- id: string;
54
- onChange: (_: any) => void;
55
- onTouched: () => void;
56
- telForm: FormGroup<{}>;
57
- /** control for the MatSelect filter keyword */
58
- countryFilterCtrl: FormControl<string | null>;
59
- get empty(): boolean;
60
- get shouldLabelFloat(): boolean;
61
- userAriaDescribedBy: string;
62
- get placeholder(): string;
63
- set placeholder(value: string);
64
- private _placeholder;
65
- get required(): boolean;
66
- set required(value: BooleanInput);
67
- private _required;
68
- searchText: string;
69
- noEntriesFoundLabel: string;
70
- get disabled(): boolean;
71
- set disabled(value: BooleanInput);
72
- private _disabled;
73
- destroy: Subject<void>;
74
- get value(): ISOTelNumber | null;
75
- set value(tel: ISOTelNumber | null);
76
- get errorState(): boolean;
77
- onFocusIn(event: FocusEvent): void;
78
- onFocusOut(event: FocusEvent): void;
79
- autoFocusNext(control: AbstractControl, nextElement?: HTMLInputElement): void;
80
- autoFocusPrev(control: AbstractControl, prevElement: HTMLInputElement): void;
81
- setDescribedByIds(ids: string[]): void;
82
- onContainerClick(): void;
83
- constructor(injector: Injector, cdr: ChangeDetectorRef, http: HttpClient, _focusMonitor: FocusMonitor, _elementRef: ElementRef<HTMLElement>, _formField: MatFormField, ngControl: NgControl, formBuilder: FormBuilder);
84
- ngOnInit(): void;
85
- protected setInitialValue(): void;
86
- private filterCountries;
87
- ngAfterViewInit(): void;
88
- ngOnDestroy(): void;
89
- /**
90
- * Set the country code to the given code.
91
- *
92
- * @param code Numeric country code to set the value of the country
93
- * ion-select to. Will validate the code against a built-in country
94
- * code list.
95
- */
96
- setCountryCode(code: string): void;
97
- writeValue(telNumber: string): void;
98
- registerOnChange(fn: any): void;
99
- registerOnTouched(fn: any): void;
100
- setDisabledState(isDisabled: boolean): void;
101
- onCountryChange(ev: MatSelectChange): void;
102
- onNationalNumberChange(ev: Event): void;
103
- /**
104
- * Returns the telephone number in ISO8601 format.
105
- * @param numberParts
106
- * @returns
107
- */
108
- private ISOTelephoneNumber;
109
- private notifyChange;
110
- get placeholderText(): string;
111
- get hasErrors(): boolean;
112
- private disableComponents;
113
- /**
114
- * Returns the full telephone number, combining the selected
115
- * country code with the national number.
116
- *
117
- * Leading zeros in the national number are removed.
118
- *
119
- * Validates the entered number using google-libphonenumber and if
120
- * invalid, returns an empty string.
121
- */
122
- private getTelephoneNumberParts;
123
- private getAllowedCountries;
124
- private detectCountry;
125
- private initCountries;
126
- static ɵfac: i0.ɵɵFactoryDeclaration<SPMatTelephoneInputComponent, [null, null, null, null, null, { optional: true; }, { optional: true; self: true; }, null]>;
127
- static ɵcmp: i0.ɵɵComponentDeclaration<SPMatTelephoneInputComponent, "sp-mat-telephone-input", never, { "mobile": { "alias": "mobile"; "required": false; }; "allowedCountries": { "alias": "allowedCountries"; "required": false; }; "defaultCountry": { "alias": "defaultCountry"; "required": false; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "searchText": { "alias": "searchText"; "required": false; }; "noEntriesFoundLabel": { "alias": "noEntriesFoundLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>;
128
- }
129
- export {};
@@ -1,38 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { InjectionToken } from '@angular/core';
3
- import { Observable } from 'rxjs';
4
- export interface QQMatTelephoneInputConfig {
5
- /**
6
- * Provider function to detect geographi location and return it
7
- * to the control. If implemented, the control would call this
8
- * function during initialization and auto-select the
9
- * country returned.
10
- * @param http
11
- * @returns
12
- */
13
- getCountryCode?: (http: HttpClient) => Observable<{
14
- ip: string;
15
- countryCode: string;
16
- regionCode: string;
17
- city: string;
18
- }>;
19
- /**
20
- * When user explicitly selects a country from the country
21
- * drop down, this function will be called giving the client a chance
22
- * to save it either to a persistent storage or a session variable.
23
- */
24
- saveCountrySelection?: (countryInfo: {
25
- code: string;
26
- name: string;
27
- callingCode: number;
28
- }) => Promise<void>;
29
- /**
30
- * Countries supported by the telephone control. The string is a
31
- * regex pattern that will be used to filter supported countries.
32
- * So if you specify ".*", it'll list all countries of the world.
33
- * "TW|SG|MY" restricts the coutries list to Taiwan, Singapore &
34
- * Malaysia.
35
- */
36
- countries?: string;
37
- }
38
- export declare const QQMAT_TELEPHONE_INPUT_CONFIG_PROVIDER: InjectionToken<QQMatTelephoneInputConfig>;
package/ngx-helper.d.ts DELETED
@@ -1,2 +0,0 @@
1
- /** Version of the ngx-helper library */
2
- export declare const VERSION = "0.1.0";
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './ngx-helper';
@@ -1,18 +0,0 @@
1
- /**
2
- * A function to merge sideloaded content into the main object thereby returning
3
- * a composite object.
4
- *
5
- * @param resp - the JSON response object, typically received from remote for
6
- * an HTTP request.
7
- * @param targetObjKey - the key name of the target object into which the
8
- * sideloaded data are to be merged.
9
- * @param idKey - idKey. Function assumes that all the objects use the same
10
- * key name as the unique object identifier.
11
- * @param sideloadDataMap: An array of [string, string], where the first
12
- * element specifies the property name of the target object and the second
13
- * element the sideload data element's key. This is useful when the the
14
- * target objet's property name that is to be merged with sideload data do not
15
- * match.
16
- * @returns Object with sideloaded data merged into the target object.
17
- */
18
- export declare function sideloadToComposite(resp: any, targetObjKey: string, idKey?: string, mergeStrategy?: 'inplace' | 'append', appendObjSuffix?: string, sideloadDataMap?: Array<[string, string, string?]>): any;