@enigmatry/entry-components 19.0.1-preview.5 → 20.0.1-preview.1

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 (139) hide show
  1. package/README.md +1 -0
  2. package/button/index.d.ts +54 -3
  3. package/common/index.d.ts +243 -3
  4. package/date-time-picker/index.d.ts +100 -3
  5. package/dialog/index.d.ts +197 -3
  6. package/fesm2022/enigmatry-entry-components-button.mjs +19 -30
  7. package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
  8. package/fesm2022/enigmatry-entry-components-common.mjs +129 -133
  9. package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
  10. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +53 -50
  11. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
  12. package/fesm2022/enigmatry-entry-components-dialog.mjs +53 -78
  13. package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
  14. package/fesm2022/enigmatry-entry-components-file-input.mjs +55 -51
  15. package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
  16. package/fesm2022/enigmatry-entry-components-permissions.mjs +28 -23
  17. package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
  18. package/fesm2022/enigmatry-entry-components-search-filter.mjs +55 -59
  19. package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
  20. package/fesm2022/enigmatry-entry-components-spinner.mjs +21 -21
  21. package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
  22. package/fesm2022/enigmatry-entry-components-table.mjs +77 -86
  23. package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
  24. package/fesm2022/enigmatry-entry-components-validation.mjs +43 -47
  25. package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
  26. package/fesm2022/enigmatry-entry-components.mjs +6 -6
  27. package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
  28. package/file-input/index.d.ts +87 -5
  29. package/index.d.ts +37 -3
  30. package/package.json +10 -8
  31. package/permissions/index.d.ts +40 -5
  32. package/search-filter/index.d.ts +228 -3
  33. package/spinner/index.d.ts +34 -5
  34. package/table/README.md +6 -3
  35. package/table/index.d.ts +260 -4
  36. package/validation/index.d.ts +123 -3
  37. package/button/entry-button-config.d.ts +0 -30
  38. package/button/entry-button.directive.d.ts +0 -18
  39. package/button/entry-button.module.d.ts +0 -9
  40. package/button/public-api.d.ts +0 -3
  41. package/common/common.module.d.ts +0 -14
  42. package/common/constants.d.ts +0 -2
  43. package/common/date-time/entry-date-time-adapter.d.ts +0 -41
  44. package/common/date-time/entry-date-time-formats.d.ts +0 -25
  45. package/common/date-time/entry-time-adapter.d.ts +0 -9
  46. package/common/date-time/index.d.ts +0 -4
  47. package/common/date-time/native-time-adapter.d.ts +0 -13
  48. package/common/directives/auto-disable-button.directive.d.ts +0 -26
  49. package/common/directives/index.d.ts +0 -4
  50. package/common/directives/ng-control-accessor.directive.d.ts +0 -12
  51. package/common/directives/noop-control-value-accessor.d.ts +0 -10
  52. package/common/directives/scroll-to-invalid-control.directive.d.ts +0 -18
  53. package/common/event-plugins/abstract.plugin.d.ts +0 -40
  54. package/common/event-plugins/debounce.plugin.d.ts +0 -15
  55. package/common/event-plugins/index.d.ts +0 -2
  56. package/common/event-plugins/throttle.plugin.d.ts +0 -15
  57. package/common/interceptors/accept-language.interceptor.d.ts +0 -16
  58. package/common/interceptors/index.d.ts +0 -1
  59. package/common/public-api.d.ts +0 -6
  60. package/common/utils/index.d.ts +0 -1
  61. package/common/utils/provide-config.d.ts +0 -3
  62. package/date-time-picker/date-time-picker-config.model.d.ts +0 -20
  63. package/date-time-picker/date-time-picker.component.d.ts +0 -38
  64. package/date-time-picker/date-time-picker.module.d.ts +0 -17
  65. package/date-time-picker/public-api.d.ts +0 -3
  66. package/date-time-picker/time-picker.component.d.ts +0 -26
  67. package/dialog/dialogs/alert/entry-alert-dialog-data.interface.d.ts +0 -18
  68. package/dialog/dialogs/alert/entry-alert-dialog.component.d.ts +0 -13
  69. package/dialog/dialogs/confirm/entry-confirm-dialog-data.interface.d.ts +0 -8
  70. package/dialog/dialogs/confirm/entry-confirm-dialog.component.d.ts +0 -13
  71. package/dialog/dialogs/entry-dialog.component.d.ts +0 -43
  72. package/dialog/dialogs/error/entry-error-dialog-data.interface.d.ts +0 -9
  73. package/dialog/dialogs/error/entry-error-dialog.component.d.ts +0 -15
  74. package/dialog/entry-dialog-buttons-alignment.type.d.ts +0 -2
  75. package/dialog/entry-dialog-config.model.d.ts +0 -33
  76. package/dialog/entry-dialog.module.d.ts +0 -15
  77. package/dialog/entry-dialog.service.d.ts +0 -55
  78. package/dialog/public-api.d.ts +0 -11
  79. package/file-input/entry-file-input.component.d.ts +0 -74
  80. package/file-input/entry-file-input.module.d.ts +0 -12
  81. package/file-input/public-api.d.ts +0 -2
  82. package/modules/entry-components.module.d.ts +0 -28
  83. package/permissions/permission-type.d.ts +0 -3
  84. package/permissions/permission.directive.d.ts +0 -11
  85. package/permissions/permission.guard.d.ts +0 -2
  86. package/permissions/permission.module.d.ts +0 -9
  87. package/permissions/permission.pipe.d.ts +0 -11
  88. package/permissions/permission.service.d.ts +0 -4
  89. package/permissions/public-api.d.ts +0 -5
  90. package/public-api.d.ts +0 -10
  91. package/search-filter/autocomplete/autocomplete-search-filter.component.d.ts +0 -22
  92. package/search-filter/autocomplete/autocomplete-search-filter.model.d.ts +0 -19
  93. package/search-filter/control-type.d.ts +0 -7
  94. package/search-filter/date/date-search-filter.component.d.ts +0 -10
  95. package/search-filter/date/date-search-filter.model.d.ts +0 -8
  96. package/search-filter/date-time/date-time-search-filter.component.d.ts +0 -10
  97. package/search-filter/date-time/date-time-search-filter.model.d.ts +0 -8
  98. package/search-filter/entry-search-filter.component.d.ts +0 -38
  99. package/search-filter/entry-search-filter.module.d.ts +0 -22
  100. package/search-filter/public-api.d.ts +0 -11
  101. package/search-filter/search-filter-base.model.d.ts +0 -29
  102. package/search-filter/search-filter-config.model.d.ts +0 -16
  103. package/search-filter/search-filter-params.type.d.ts +0 -7
  104. package/search-filter/select/select-search-filter.component.d.ts +0 -14
  105. package/search-filter/select/select-search-filter.model.d.ts +0 -22
  106. package/search-filter/select-option.model.d.ts +0 -12
  107. package/search-filter/text/text-search-filter.component.d.ts +0 -10
  108. package/search-filter/text/text-search-filter.model.d.ts +0 -8
  109. package/spinner/entry-spinner/spinner.component.d.ts +0 -24
  110. package/spinner/public-api.d.ts +0 -2
  111. package/spinner/spinner-overlay-container.d.ts +0 -17
  112. package/spinner/spinner.module.d.ts +0 -10
  113. package/table/components/entry-cell/entry-cell.component.d.ts +0 -10
  114. package/table/components/entry-cell-context-menu/entry-cell-context-menu.component.d.ts +0 -18
  115. package/table/components/entry-cell-formatted-value/entry-cell-formatted-value.component.d.ts +0 -10
  116. package/table/components/entry-table/entry-table.component.d.ts +0 -82
  117. package/table/components/index.d.ts +0 -4
  118. package/table/entry-table.module.d.ts +0 -20
  119. package/table/interfaces/cell-template.d.ts +0 -4
  120. package/table/interfaces/column-def.d.ts +0 -20
  121. package/table/interfaces/column-sort-prop.d.ts +0 -5
  122. package/table/interfaces/column-type-parameter.d.ts +0 -9
  123. package/table/interfaces/column-type.d.ts +0 -1
  124. package/table/interfaces/context-menu-item.d.ts +0 -7
  125. package/table/interfaces/entry-table-config.d.ts +0 -33
  126. package/table/interfaces/index.d.ts +0 -12
  127. package/table/interfaces/paged-query.d.ts +0 -15
  128. package/table/interfaces/pagination.d.ts +0 -19
  129. package/table/interfaces/row-class-formatter.d.ts +0 -3
  130. package/table/interfaces/row-context-menu-formatter.d.ts +0 -4
  131. package/table/interfaces/row-selection-formatter.d.ts +0 -4
  132. package/table/public-api.d.ts +0 -3
  133. package/validation/entry-display-control-validation.directive.d.ts +0 -27
  134. package/validation/entry-form-errors.component.d.ts +0 -18
  135. package/validation/entry-validation-config.model.d.ts +0 -48
  136. package/validation/entry-validation.d.ts +0 -15
  137. package/validation/entry-validation.module.d.ts +0 -11
  138. package/validation/public-api.d.ts +0 -6
  139. package/validation/validation-problem-details.interface.d.ts +0 -9
package/README.md CHANGED
@@ -29,6 +29,7 @@ These guides provides detailed steps for setting up and configuring theming with
29
29
  |17.x| = 17
30
30
  |18.x| = 18
31
31
  |19.x| = 19
32
+ |20.x| = 20
32
33
 
33
34
  ## License
34
35
 
package/button/index.d.ts CHANGED
@@ -1,5 +1,56 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, Provider } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import * as i3 from '@angular/material/button';
5
+ import { ThemePalette } from '@angular/material/core';
6
+
7
+ declare class EntryButtonDirective implements OnInit {
8
+ matClasses: {
9
+ [key: string]: string[];
10
+ };
11
+ private readonly _elementRef;
12
+ private readonly _config;
13
+ private readonly _matButton;
14
+ private readonly _matAnchor;
15
+ ngOnInit(): void;
16
+ private readonly getEntryType;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryButtonDirective, never>;
18
+ static ɵdir: i0.ɵɵDirectiveDeclaration<EntryButtonDirective, "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]", never, {}, {}, never, never, false, never>;
19
+ }
20
+
21
+ declare class EntryButtonModule {
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryButtonModule, never>;
23
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntryButtonModule, [typeof EntryButtonDirective], [typeof i2.CommonModule, typeof i3.MatButtonModule], [typeof EntryButtonDirective]>;
24
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntryButtonModule>;
25
+ }
26
+
27
+ /** Possible mat button variants */
28
+ declare type MatButtonVariants = 'basic' | 'flat' | 'raised' | 'stroked';
29
+ interface MatButtonConfig {
30
+ type: MatButtonVariants;
31
+ color?: ThemePalette;
32
+ }
1
33
  /**
2
- * Generated bundle index. Do not edit.
34
+ * Used to provide button configuration on module or application level.
3
35
  */
4
- /// <amd-module name="@enigmatry/entry-components/button" />
5
- export * from './public-api';
36
+ declare class EntryButtonConfig {
37
+ /** Submit button configuration */
38
+ submit: MatButtonConfig;
39
+ /** Cancel button configuration */
40
+ cancel: MatButtonConfig;
41
+ constructor(config?: Partial<EntryButtonConfig>);
42
+ }
43
+ /**
44
+ * Entry button config injection token.
45
+ *
46
+ * Defaults:
47
+ * - submit: type: 'flat', color: 'primary'
48
+ * - cancel: type: 'basic', color: 'accent'
49
+ */
50
+ declare const ENTRY_BUTTON_CONFIG: i0.InjectionToken<EntryButtonConfig>;
51
+ /**
52
+ * Can be used to provide custom button configuration.
53
+ */
54
+ declare const provideEntryButtonConfig: (config: Partial<EntryButtonConfig>) => Provider;
55
+
56
+ export { ENTRY_BUTTON_CONFIG, EntryButtonConfig, EntryButtonDirective, EntryButtonModule, provideEntryButtonConfig };
package/common/index.d.ts CHANGED
@@ -1,5 +1,245 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, OnDestroy, ModuleWithProviders, Provider, InjectionToken } from '@angular/core';
3
+ import * as i1 from '@angular/common';
4
+ import { NumberInput } from '@angular/cdk/coercion';
5
+ import { ControlValueAccessor, UntypedFormControl, NgControl } from '@angular/forms';
6
+ import { EventManager } from '@angular/platform-browser';
7
+ import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent, HttpInterceptorFn } from '@angular/common/http';
8
+ import { Observable } from 'rxjs';
9
+ import { DateAdapter, MatDateFormats } from '@angular/material/core';
10
+
1
11
  /**
2
- * Generated bundle index. Do not edit.
12
+ * Auto disable button after click or submit with entry-auto-disable directive.
13
+ * Directive is applied to 'button[entry-auto-disable]:not([disabled])'
14
+ * Default auto disable interval is 2000ms (2sec)
15
+ *
16
+ * Usage
17
+ * <button mat-button entry-submit-button entry-auto-disable type="submit">Submit</button>
18
+ * or with auto disabled interval in milliseconds
19
+ * <button mat-button entry-submit-button entry-auto-disable="5000" type="submit">Submit</button>
3
20
  */
4
- /// <amd-module name="@enigmatry/entry-components/common" />
5
- export * from './public-api';
21
+ declare class AutoDisableButtonDirective implements OnInit, OnDestroy {
22
+ private _destroy$;
23
+ private _disableIntervalInMs;
24
+ private readonly elementRef;
25
+ get disableIntervalInMs(): NumberInput;
26
+ set disableIntervalInMs(value: NumberInput);
27
+ ngOnInit(): void;
28
+ ngOnDestroy(): void;
29
+ private disableButton;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<AutoDisableButtonDirective, never>;
31
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AutoDisableButtonDirective, "button[entry-auto-disable]:not([disabled])", never, { "disableIntervalInMs": { "alias": "entry-auto-disable"; "required": false; }; }, {}, never, never, true, never>;
32
+ }
33
+
34
+ /**
35
+ * Scroll to first invalid control when form is submitted.
36
+ * Directive is applied to 'form[formGroup],form[ngForm]' (reactive or template driven forms)
37
+ */
38
+ declare class ScrollToInvalidControlDirective implements OnInit, OnDestroy {
39
+ private destroy$;
40
+ private readonly form;
41
+ private readonly elementRef;
42
+ ngOnInit(): void;
43
+ ngOnDestroy(): void;
44
+ private scrollToInvalidControl;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScrollToInvalidControlDirective, never>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ScrollToInvalidControlDirective, "form[formGroup],form[ngForm]", never, {}, {}, never, never, true, never>;
47
+ }
48
+
49
+ declare class NoopControlValueAccessorDirective implements ControlValueAccessor {
50
+ writeValue: (_obj: any) => void;
51
+ registerOnChange: (_fn: any) => void;
52
+ registerOnTouched: (_fn: any) => void;
53
+ setDisabledState: (_isDisabled: boolean) => void;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<NoopControlValueAccessorDirective, never>;
55
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NoopControlValueAccessorDirective, never, never, {}, {}, never, never, true, never>;
56
+ }
57
+
58
+ declare class NgControlAccessorDirective implements OnDestroy, OnInit {
59
+ control: UntypedFormControl;
60
+ ngControl: NgControl | null;
61
+ private destroy$;
62
+ ngOnInit(): void;
63
+ ngOnDestroy(): void;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgControlAccessorDirective, never>;
65
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgControlAccessorDirective, never, never, {}, {}, never, never, true, never>;
66
+ }
67
+
68
+ declare const NG_EVENT_PLUGINS: Provider[];
69
+ declare class EntryCommonModule {
70
+ static forRoot(): ModuleWithProviders<EntryCommonModule>;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryCommonModule, never>;
72
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntryCommonModule, never, [typeof i1.CommonModule, typeof AutoDisableButtonDirective, typeof ScrollToInvalidControlDirective, typeof NoopControlValueAccessorDirective, typeof NgControlAccessorDirective], [typeof AutoDisableButtonDirective, typeof ScrollToInvalidControlDirective, typeof NoopControlValueAccessorDirective, typeof NgControlAccessorDirective]>;
73
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntryCommonModule>;
74
+ }
75
+
76
+ declare const createInjectionToken: <T>(defaultValue: T) => InjectionToken<T>;
77
+ declare const provideConfig: <T>(token: InjectionToken<T>, factory: () => T) => Provider;
78
+
79
+ /**
80
+ * abstract class EventManagerPlugin will be exposed in the public api
81
+ * https://github.com/angular/angular/pull/49969
82
+ *
83
+ * Until then creating it from reference
84
+ * https://github.com/angular/angular/blob/main/packages/platform-browser/src/dom/events/event_manager.ts#L93
85
+ *
86
+ * How to create custom event modifiers
87
+ * https://github.com/Tinkoff/ng-event-plugins,
88
+ * https://github.com/angular/angular/blob/main/packages/platform-browser/src/dom/events/key_events.ts
89
+ * https://netbasal.com/lifting-the-veil-insights-into-angulars-eventmanagerplugin-ed9d14cbb31a
90
+ */
91
+ declare abstract class EventManagerPlugin {
92
+ manager: EventManager;
93
+ /** Should return `true` for every event name that should be supported by this plugin */
94
+ abstract supports(eventName: string): boolean;
95
+ /**
96
+ * Registers a handler for a specific element and event.
97
+ *
98
+ * @param element The HTML element to receive event notifications.
99
+ * @param eventName The name of the event to listen for.
100
+ * @param handler A function to call when the notification occurs. Receives the
101
+ * event object as an argument.
102
+ * @returns A callback function that can be used to remove the handler.
103
+ */
104
+ abstract addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
105
+ }
106
+
107
+ /**
108
+ * Entry event plugin base class
109
+ */
110
+ declare abstract class EntryEventManagerPlugin extends EventManagerPlugin {
111
+ abstract modifier: string;
112
+ /** return `true` for every event name that has specified modifier */
113
+ supports(eventName: string): boolean;
114
+ /** unwrap params e.g. (click.debounce.500) => ['debounce', 500] */
115
+ unwrapParams(eventName: string): string[];
116
+ /** get event name e.g. (click.debounce.500) => click */
117
+ unwrapEventName(eventName: string): string;
118
+ }
119
+
120
+ /**
121
+ * Provides event plugin for throttling events.
122
+ *
123
+ * How to use:
124
+ * <button (click.throttle)="doSomething($event)">
125
+ * <input (keyup.throttle.500)="doSomething($event)">
126
+ */
127
+ declare class ThrottleEventPlugin extends EntryEventManagerPlugin {
128
+ modifier: string;
129
+ addEventListener(element: HTMLElement, eventName: string, originalHandler: Function): Function;
130
+ static ɵfac: i0.ɵɵFactoryDeclaration<ThrottleEventPlugin, never>;
131
+ static ɵprov: i0.ɵɵInjectableDeclaration<ThrottleEventPlugin>;
132
+ }
133
+
134
+ /**
135
+ * Provides event plugin for debouncing events.
136
+ *
137
+ * How to use:
138
+ * <button (click.debounce)="doSomething($event)">
139
+ * <input (keyup.debounce.500)="doSomething($event)">
140
+ */
141
+ declare class DebounceEventPlugin extends EntryEventManagerPlugin {
142
+ modifier: string;
143
+ addEventListener(element: HTMLElement, eventName: string, originalHandler: Function): Function;
144
+ static ɵfac: i0.ɵɵFactoryDeclaration<DebounceEventPlugin, never>;
145
+ static ɵprov: i0.ɵɵInjectableDeclaration<DebounceEventPlugin>;
146
+ }
147
+
148
+ /**
149
+ * @deprecated switch to acceptLanguageInterceptor function (See: https://angular.dev/guide/http/interceptors#configuring-interceptors)
150
+ */
151
+ declare class AcceptLanguageInterceptor implements HttpInterceptor {
152
+ private localeId;
153
+ intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
154
+ static ɵfac: i0.ɵɵFactoryDeclaration<AcceptLanguageInterceptor, never>;
155
+ static ɵprov: i0.ɵɵInjectableDeclaration<AcceptLanguageInterceptor>;
156
+ }
157
+ /**
158
+ * Sets the Accept-Language HTTP request header using the value from LOCALE_ID.
159
+ */
160
+ declare const acceptLanguageInterceptor: HttpInterceptorFn;
161
+
162
+ declare abstract class EntryTimeAdapter<D> {
163
+ abstract getHours(date: D): number;
164
+ abstract getMinutes(date: D): number;
165
+ abstract getSeconds(date: D): number;
166
+ abstract setTime(date: D, hours: number, minutes: number, seconds: number): D;
167
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryTimeAdapter<any>, never>;
168
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntryTimeAdapter<any>>;
169
+ }
170
+
171
+ /**
172
+ * Extends DateAdapter with time support. Used by EntryDateTimePicker component.
173
+ */
174
+ declare class EntryDateTimeAdapter<D, L> extends DateAdapter<D, L> implements EntryTimeAdapter<D> {
175
+ private readonly dateAdapter;
176
+ private readonly timeAdapter;
177
+ constructor(matDateLocale: L, dateAdapter: DateAdapter<D, L>, timeAdapter: EntryTimeAdapter<D>);
178
+ getYear(date: D): number;
179
+ getMonth(date: D): number;
180
+ getDate(date: D): number;
181
+ getDayOfWeek(date: D): number;
182
+ getMonthNames(style: 'long' | 'short' | 'narrow'): string[];
183
+ getDateNames(): string[];
184
+ getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[];
185
+ getYearName(date: D): string;
186
+ getFirstDayOfWeek(): number;
187
+ getNumDaysInMonth(date: D): number;
188
+ clone(date: D): D;
189
+ createDate(year: number, month: number, date: number): D;
190
+ today(): D;
191
+ parse(value: any, parseFormat: any): D;
192
+ format(date: D, displayFormat: any): string;
193
+ addCalendarYears(date: D, years: number): D;
194
+ addCalendarMonths(date: D, months: number): D;
195
+ addCalendarDays(date: D, days: number): D;
196
+ toIso8601(date: D): string;
197
+ isDateInstance(obj: any): boolean;
198
+ isValid(date: D): boolean;
199
+ invalid(): D;
200
+ getHours(date: D): number;
201
+ getMinutes(date: D): number;
202
+ getSeconds(date: D): number;
203
+ setTime(date: D, hours: number, minutes: number, seconds: number): D;
204
+ is12HoursClock(displayFormat: any): boolean;
205
+ compareDate(first: D, second: D): number;
206
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDateTimeAdapter<any, any>, [{ optional: true; }, { skipSelf: true; }, null]>;
207
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntryDateTimeAdapter<any, any>>;
208
+ }
209
+
210
+ type EntryDateTimeFormats = MatDateFormats;
211
+ declare const defaultDateTimeFormats: {
212
+ parse: {
213
+ dateInput: string[];
214
+ };
215
+ display: {
216
+ dateInput: string;
217
+ monthYearLabel: {
218
+ year: string;
219
+ month: string;
220
+ };
221
+ dateA11yLabel: {
222
+ year: string;
223
+ month: string;
224
+ day: string;
225
+ };
226
+ monthYearA11yLabel: {
227
+ year: string;
228
+ month: string;
229
+ };
230
+ };
231
+ };
232
+ declare const ENTRY_MAT_DATE_TIME_FORMATS: InjectionToken<MatDateFormats>;
233
+
234
+ declare class EntryNativeTimeAdapter extends EntryTimeAdapter<Date> {
235
+ getHours: (date: Date) => number;
236
+ getMinutes: (date: Date) => number;
237
+ getSeconds: (date: Date) => number;
238
+ setTime: (date: Date, hours: number, minutes: number, seconds: number) => Date;
239
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryNativeTimeAdapter, never>;
240
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntryNativeTimeAdapter>;
241
+ }
242
+ declare const provideEntryNativeTimeAdapter: (dateTimeFormats?: EntryDateTimeFormats) => Provider[];
243
+
244
+ export { AcceptLanguageInterceptor, AutoDisableButtonDirective, DebounceEventPlugin, ENTRY_MAT_DATE_TIME_FORMATS, EntryCommonModule, EntryDateTimeAdapter, EntryNativeTimeAdapter, EntryTimeAdapter, NG_EVENT_PLUGINS, NgControlAccessorDirective, NoopControlValueAccessorDirective, ScrollToInvalidControlDirective, ThrottleEventPlugin, acceptLanguageInterceptor, createInjectionToken, defaultDateTimeFormats, provideConfig, provideEntryNativeTimeAdapter };
245
+ export type { EntryDateTimeFormats };
@@ -1,5 +1,102 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Provider, OnChanges, SimpleChanges, OnInit, OnDestroy } from '@angular/core';
3
+ import * as i4 from '@angular/forms';
4
+ import { FormControl } from '@angular/forms';
5
+ import { Subject } from 'rxjs';
6
+ import * as i1 from '@enigmatry/entry-components/common';
7
+ import { EntryDateTimeAdapter } from '@enigmatry/entry-components/common';
8
+ import * as i3 from '@angular/common';
9
+ import * as i5 from '@angular/material/form-field';
10
+ import * as i6 from '@angular/material/datepicker';
11
+ import * as i7 from '@angular/material/input';
12
+ import * as i8 from '@angular/material/select';
13
+ import * as i9 from '@angular/material/button';
14
+ import * as i10 from '@angular/material/icon';
15
+ import * as i11 from '@enigmatry/entry-components/validation';
16
+
1
17
  /**
2
- * Generated bundle index. Do not edit.
18
+ * Used to provide default configurations on module level.
3
19
  */
4
- /// <amd-module name="@enigmatry/entry-components/date-time-picker" />
5
- export * from './public-api';
20
+ declare class EntryDateTimePickerConfig {
21
+ /** Shows seconds selector in date-time-picker pop-up (default false) */
22
+ showSeconds: boolean;
23
+ constructor(config?: Partial<EntryDateTimePickerConfig>);
24
+ }
25
+ /**
26
+ * Entry date-time-picker injection token of EntryDateTimePickerConfig type containing dialog default configurations.
27
+ *
28
+ * Defaults:
29
+ * - showSeconds: false
30
+ */
31
+ declare const ENTRY_DATE_TIME_PICKER_CONFIG: i0.InjectionToken<EntryDateTimePickerConfig>;
32
+ /**
33
+ * Can be used to provide entry date-time-picker configuration.
34
+ */
35
+ declare const provideEntryDateTimePickerConfig: (config: Partial<EntryDateTimePickerConfig>) => Provider;
36
+
37
+ type meridiem = 'am' | 'pm';
38
+ declare class EntryTimePickerComponent<D> implements OnChanges {
39
+ class: string;
40
+ readonly timeAdapter: EntryDateTimeAdapter<D, unknown>;
41
+ private readonly hoursInDay;
42
+ private readonly halfADay;
43
+ private readonly minutesInHour;
44
+ date: D | undefined;
45
+ showSeconds: boolean;
46
+ is12HourClock: boolean;
47
+ defaultTime: D | undefined;
48
+ hours: number;
49
+ minutes: number;
50
+ seconds: number;
51
+ meridiem: meridiem;
52
+ readonly hours12: number[];
53
+ readonly hours24: number[];
54
+ readonly sixty: number[];
55
+ get possibleHours(): number[];
56
+ ngOnChanges(_changes: SimpleChanges): void;
57
+ update(): void;
58
+ to12HourClock(): void;
59
+ to24HourClock(): void;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryTimePickerComponent<any>, never>;
61
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryTimePickerComponent<any>, "entry-time-picker", never, { "date": { "alias": "date"; "required": false; }; "showSeconds": { "alias": "showSeconds"; "required": false; }; "is12HourClock": { "alias": "is12HourClock"; "required": false; }; "defaultTime": { "alias": "defaultTime"; "required": false; }; }, {}, never, never, false, never>;
62
+ }
63
+
64
+ declare class EntryDateTimePickerComponent<D> implements OnInit, OnDestroy {
65
+ class: string;
66
+ label: string;
67
+ showSeconds: boolean | undefined;
68
+ min: D;
69
+ max: D;
70
+ placeholder: string | undefined;
71
+ hint: string | undefined;
72
+ defaultTime: D | undefined;
73
+ dateTimeChanged: Subject<D>;
74
+ _disabled: boolean;
75
+ get disabled(): boolean;
76
+ set disabled(value: boolean);
77
+ private ngControlAccessor;
78
+ private dateTimeAdapter;
79
+ private format;
80
+ private changeDetectorRef;
81
+ config: EntryDateTimePickerConfig;
82
+ get formControl(): FormControl<D>;
83
+ calendarControl: FormControl<D | null | undefined>;
84
+ is12HourClock: boolean;
85
+ timePicker: EntryTimePickerComponent<D>;
86
+ private $destroy;
87
+ get minDate(): D | undefined;
88
+ get maxDate(): D | undefined;
89
+ ngOnInit(): void;
90
+ ngOnDestroy(): void;
91
+ private setDisabled;
92
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDateTimePickerComponent<any>, never>;
93
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryDateTimePickerComponent<any>, "entry-date-time-picker", never, { "label": { "alias": "label"; "required": false; }; "showSeconds": { "alias": "showSeconds"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "defaultTime": { "alias": "defaultTime"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "dateTimeChanged": "dateTimeChanged"; }, never, never, false, [{ directive: typeof i1.NoopControlValueAccessorDirective; inputs: {}; outputs: {}; }, { directive: typeof i1.NgControlAccessorDirective; inputs: {}; outputs: {}; }]>;
94
+ }
95
+
96
+ declare class EntryDateTimePickerModule {
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDateTimePickerModule, never>;
98
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntryDateTimePickerModule, [typeof EntryDateTimePickerComponent, typeof EntryTimePickerComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.MatFormFieldModule, typeof i6.MatDatepickerModule, typeof i7.MatInputModule, typeof i8.MatSelectModule, typeof i9.MatButtonModule, typeof i10.MatIconModule, typeof i11.EntryValidationModule], [typeof EntryDateTimePickerComponent]>;
99
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntryDateTimePickerModule>;
100
+ }
101
+
102
+ export { ENTRY_DATE_TIME_PICKER_CONFIG, EntryDateTimePickerComponent, EntryDateTimePickerConfig, EntryDateTimePickerModule, provideEntryDateTimePickerConfig };
package/dialog/index.d.ts CHANGED
@@ -1,5 +1,199 @@
1
+ import * as i6 from '@angular/material/dialog';
2
+ import { MatDialogRef } from '@angular/material/dialog';
3
+ import * as i0 from '@angular/core';
4
+ import { Provider, TemplateRef, Type } from '@angular/core';
5
+ import * as rxjs from 'rxjs';
6
+ import { Observable } from 'rxjs';
7
+ import { IValidationProblemDetails } from '@enigmatry/entry-components/validation';
8
+ import * as i5 from '@angular/common';
9
+ import * as i7 from '@angular/material/icon';
10
+ import * as i8 from '@angular/material/button';
11
+ import * as i9 from '@enigmatry/entry-components/button';
12
+
13
+ /** Defines horizontal alignment of dialog buttons. */
14
+ type EntryDialogButtonsAlignment = 'start' | 'center' | 'end';
15
+
1
16
  /**
2
- * Generated bundle index. Do not edit.
17
+ * Used to provide default configurations on module level.
3
18
  */
4
- /// <amd-module name="@enigmatry/entry-components/dialog" />
5
- export * from './public-api';
19
+ declare class EntryDialogConfig {
20
+ /** Confirm button label (default 'Ok') */
21
+ confirmButtonText: string;
22
+ /** Cancel button label (default 'Cancel') */
23
+ cancelButtonText: string;
24
+ /** Dialog buttons horizontal alignment (default 'align-right') */
25
+ buttonsAlignment: EntryDialogButtonsAlignment;
26
+ /** Determines if close button is visible (default is true) */
27
+ hideClose: boolean;
28
+ /** Disable closing dialog when pressing escape or clicking on backdrop (default false) */
29
+ disableClose: boolean;
30
+ constructor(config?: Partial<EntryDialogConfig>);
31
+ }
32
+ /**
33
+ * Entry dialog injection token of EntryDialogConfig type containing dialog default configurations.
34
+ *
35
+ * Defaults:
36
+ * - confirmButtonText: 'Ok'
37
+ * - cancelButtonText: 'Cancel'
38
+ * - buttonsAlignment: 'end'
39
+ * - hideClose: true
40
+ * - disableClose: false
41
+ */
42
+ declare const ENTRY_DIALOG_CONFIG: i0.InjectionToken<EntryDialogConfig>;
43
+ /**
44
+ * Can be used to provide entry dialog configuration.
45
+ */
46
+ declare const provideEntryDialogConfig: (config: Partial<EntryDialogConfig>) => Provider;
47
+
48
+ /**
49
+ * Base Entry dialog component. Must be extended when building custom dialogs.
50
+ *
51
+ * @example
52
+ * ```html
53
+ * <entry-dialog title="TITLE"><p>Dialog content</p></entry-dialog>
54
+ * ```
55
+ */
56
+ declare class EntryDialogComponent {
57
+ protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>;
58
+ protected readonly config: EntryDialogConfig;
59
+ /** Dialog header title */
60
+ title: string;
61
+ /** Dialog buttons horizontal alignment */
62
+ buttonsAlignment: EntryDialogButtonsAlignment;
63
+ /** Confirm button label */
64
+ confirmButtonText: string;
65
+ /** Cancel button label */
66
+ cancelButtonText: string;
67
+ /** Show or hide dialog buttons */
68
+ hideButtons: boolean;
69
+ /** Show or hide dialog cancel button */
70
+ hideCancel: boolean;
71
+ /** Show or hide dialog close button */
72
+ hideClose: boolean;
73
+ /** Enable or disable dialog confirm button */
74
+ disableConfirm: boolean;
75
+ /** Provide custom buttons template */
76
+ buttonsTemplate: TemplateRef<any> | null | undefined;
77
+ confirm: () => Observable<unknown>;
78
+ cancel: () => void;
79
+ onSubmit: () => rxjs.Subscription;
80
+ close: (value?: unknown) => void;
81
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDialogComponent, never>;
82
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryDialogComponent, "entry-dialog", never, { "title": { "alias": "title"; "required": false; }; "buttonsAlignment": { "alias": "buttonsAlignment"; "required": false; }; "confirmButtonText": { "alias": "confirmButtonText"; "required": false; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; }; "hideButtons": { "alias": "hideButtons"; "required": false; }; "hideCancel": { "alias": "hideCancel"; "required": false; }; "hideClose": { "alias": "hideClose"; "required": false; }; "disableConfirm": { "alias": "disableConfirm"; "required": false; }; "buttonsTemplate": { "alias": "buttonsTemplate"; "required": false; }; "confirm": { "alias": "confirm"; "required": false; }; "cancel": { "alias": "cancel"; "required": false; }; }, {}, never, ["*"], false, never>;
83
+ }
84
+
85
+ /**
86
+ * Alert dialog data.
87
+ */
88
+ interface IEntryAlertDialogData {
89
+ /** Dialog header title */
90
+ title: string;
91
+ /** Dialog content message */
92
+ message: string;
93
+ /** Optional dialog buttons horizontal alignment */
94
+ buttonsAlignment: EntryDialogButtonsAlignment | undefined;
95
+ /** Optional dialog confirm text label */
96
+ confirmText?: string | undefined;
97
+ /** Optionally show or hide dialog close button */
98
+ hideClose: boolean | undefined;
99
+ /** Optionally disable closing dialog when pressing escape or clicking on backdrop */
100
+ disableClose?: boolean | undefined;
101
+ }
102
+
103
+ declare class EntryAlertDialogComponent extends EntryDialogComponent {
104
+ protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>;
105
+ readonly config: EntryDialogConfig;
106
+ readonly data: IEntryAlertDialogData;
107
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryAlertDialogComponent, never>;
108
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryAlertDialogComponent, "entry-alert-dialog", never, {}, {}, never, never, false, never>;
109
+ }
110
+
111
+ /**
112
+ * Confirm dialog data. Extends IEntryAlertDialogData.
113
+ */
114
+ interface IEntryConfirmDialogData extends IEntryAlertDialogData {
115
+ /** Optional dialog cancel text label */
116
+ cancelText?: string | undefined;
117
+ }
118
+
119
+ declare class EntryConfirmDialogComponent extends EntryDialogComponent {
120
+ protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>;
121
+ readonly config: EntryDialogConfig;
122
+ readonly data: IEntryConfirmDialogData;
123
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryConfirmDialogComponent, never>;
124
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryConfirmDialogComponent, "entry-confirm-dialog", never, {}, {}, never, never, false, never>;
125
+ }
126
+
127
+ /**
128
+ * Error dialog data.
129
+ */
130
+ interface IEntryErrorDialogData extends IEntryAlertDialogData {
131
+ /** Errors to display */
132
+ errors: string[] | IValidationProblemDetails;
133
+ }
134
+
135
+ declare class EntryErrorDialogComponent extends EntryDialogComponent {
136
+ errors: string[];
137
+ protected readonly mdDialogRef: MatDialogRef<EntryDialogComponent>;
138
+ readonly config: EntryDialogConfig;
139
+ readonly data: IEntryErrorDialogData;
140
+ constructor();
141
+ private extractValidationErrors;
142
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryErrorDialogComponent, never>;
143
+ static ɵcmp: i0.ɵɵComponentDeclaration<EntryErrorDialogComponent, "entry-error-dialog", never, {}, {}, never, never, false, never>;
144
+ }
145
+
146
+ /**
147
+ * Used to open built-in and custom entry dialogs.
148
+ */
149
+ declare class EntryDialogService {
150
+ protected readonly config: EntryDialogConfig;
151
+ private readonly matDialog;
152
+ /**
153
+ * Opens alert dialog.
154
+ *
155
+ * @param data - Contains title, message and optional confirm button text
156
+ * @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape
157
+ */
158
+ openAlert: (data: Partial<IEntryAlertDialogData>) => Observable<true | undefined>;
159
+ /**
160
+ * Opens confirm dialog.
161
+ *
162
+ * @param data - Contains title, message and optional confirm/cancel buttons text
163
+ * @returns `true` if confirmed, `false` if canceled or closed, `undefined` if closed by clicking on backdrop or pressing escape
164
+ */
165
+ openConfirm: (data: Partial<IEntryConfirmDialogData>) => Observable<boolean | undefined>;
166
+ /**
167
+ * Opens error dialog.
168
+ *
169
+ * @param data - Contains title, errors and optional confirm button text
170
+ * @returns `true` if confirmed, `undefined` if closed by clicking on backdrop or pressing escape
171
+ */
172
+ openError: (data: Partial<IEntryErrorDialogData>) => Observable<true | undefined>;
173
+ /**
174
+ * Opens dialog with custom component.
175
+ *
176
+ * @param component - Dialog custom component implementation
177
+ * @param data - Optional parameter used to supply component with input parameters
178
+ * @param disableClose - Optional parameter that disable closing dialog when pressing escape or clicking on backdrop
179
+ * @param cssClass - Optional parameter used to set custom class to Material overlay pane
180
+ * @returns Any result custom implementation provides
181
+ */
182
+ open: (component: Type<EntryDialogComponent>, data?: unknown, disableClose?: boolean | undefined, cssClass?: string) => Observable<any>;
183
+ /**
184
+ * Closes all opened dialogs.
185
+ */
186
+ closeAll: () => void;
187
+ private setPanelClassFor;
188
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDialogService, never>;
189
+ static ɵprov: i0.ɵɵInjectableDeclaration<EntryDialogService>;
190
+ }
191
+
192
+ declare class EntryDialogModule {
193
+ static ɵfac: i0.ɵɵFactoryDeclaration<EntryDialogModule, never>;
194
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntryDialogModule, [typeof EntryDialogComponent, typeof EntryAlertDialogComponent, typeof EntryConfirmDialogComponent, typeof EntryErrorDialogComponent], [typeof i5.CommonModule, typeof i6.MatDialogModule, typeof i7.MatIconModule, typeof i8.MatButtonModule, typeof i9.EntryButtonModule], [typeof EntryDialogComponent, typeof EntryAlertDialogComponent, typeof EntryConfirmDialogComponent, typeof EntryErrorDialogComponent]>;
195
+ static ɵinj: i0.ɵɵInjectorDeclaration<EntryDialogModule>;
196
+ }
197
+
198
+ export { ENTRY_DIALOG_CONFIG, EntryAlertDialogComponent, EntryConfirmDialogComponent, EntryDialogComponent, EntryDialogConfig, EntryDialogModule, EntryDialogService, EntryErrorDialogComponent, provideEntryDialogConfig };
199
+ export type { EntryDialogButtonsAlignment, IEntryAlertDialogData, IEntryConfirmDialogData, IEntryErrorDialogData };