@nstudio/nativescript-compiler-angular 0.0.0-stage → 9.2.0-alpha.11
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.
- package/LICENSE +19 -0
- package/README.md +27 -2
- package/dist/angular-libraries.js +386 -0
- package/dist/angular.js +4189 -0
- package/dist/component-bases.js +853 -0
- package/dist/core-api.js +8 -0
- package/dist/entry.js +150 -0
- package/dist/index.js +233 -0
- package/dist/kotlin.js +295 -0
- package/dist/modules.js +780 -0
- package/dist/ng-modules.js +66 -0
- package/dist/package.js +15 -0
- package/dist/refusals.js +4 -0
- package/dist/semantics.js +274 -0
- package/dist/swift.js +352 -0
- package/kit-android/fromcore/AngularAPI.kt +177 -0
- package/kit-android/fromcore/AngularRouter.kt +720 -0
- package/kit-android/main/AngularChangeDetection.kt +530 -0
- package/kit-android/main/AngularCore.kt +798 -0
- package/kit-android/main/AngularHttp.kt +431 -0
- package/kit-android/main/AngularRouterValues.kt +154 -0
- package/kit-android/main/AngularRx.kt +228 -0
- package/kit-apple/AngularAPI.swift +228 -0
- package/kit-apple/AngularChangeDetection.swift +510 -0
- package/kit-apple/AngularCore.swift +878 -0
- package/kit-apple/AngularHttp.swift +467 -0
- package/kit-apple/AngularRouter.swift +760 -0
- package/kit-apple/AngularRouterValues.swift +285 -0
- package/kit-apple/AngularRx.swift +250 -0
- package/kit-apple/kit-index.json +861 -0
- package/package.json +56 -4
- package/runtime/angular-cdk.ts +673 -0
- package/runtime/angular-forms.ts +3099 -0
- package/runtime/angular-rx.ts +586 -0
- package/runtime/angular.ts +826 -0
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
// @angular/cdk runtime shims for compiled NativeScript Angular apps.
|
|
2
|
+
// Provides real compiled TypeScript classes for @angular/cdk/* services, directives and types so apps
|
|
3
|
+
// importing Angular CDK / Spartan Brain / Spartan Helm compile natively on Swift and Kotlin without
|
|
4
|
+
// browser DOM dependencies.
|
|
5
|
+
|
|
6
|
+
import { EventEmitter, InjectionToken, signal } from '@angular/core';
|
|
7
|
+
import { Observable, Subject } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
const EMPTY_OBSERVABLE: Observable<any> = new Subject<any>().asObservable();
|
|
10
|
+
|
|
11
|
+
// ---- @angular/cdk/bidi ----
|
|
12
|
+
|
|
13
|
+
export type Direction = 'ltr' | 'rtl';
|
|
14
|
+
|
|
15
|
+
export class Directionality {
|
|
16
|
+
static shared = new Directionality();
|
|
17
|
+
readonly value: Direction = 'ltr';
|
|
18
|
+
readonly valueSignal = signal<Direction>('ltr');
|
|
19
|
+
readonly change = new EventEmitter<Direction>();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ---- @angular/cdk/coercion ----
|
|
23
|
+
|
|
24
|
+
export type BooleanInput = string | boolean | null | undefined;
|
|
25
|
+
export type NumberInput = string | number | null | undefined;
|
|
26
|
+
|
|
27
|
+
export function coerceBooleanProperty(value: any): boolean {
|
|
28
|
+
return value != null && `${value}` !== 'false';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function coerceNumberProperty(value: any, fallbackValue: any = 0): any {
|
|
32
|
+
if (value === null || value === undefined || value === '') return fallbackValue;
|
|
33
|
+
const n = Number(value);
|
|
34
|
+
return isNaN(n) ? fallbackValue : n;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// ---- @angular/cdk/keycodes ----
|
|
38
|
+
|
|
39
|
+
export const ENTER = 13;
|
|
40
|
+
export const SPACE = 32;
|
|
41
|
+
|
|
42
|
+
export function hasModifierKey(event: any, ...modifiers: string[]): boolean {
|
|
43
|
+
if (!event) return false;
|
|
44
|
+
if (modifiers.length) {
|
|
45
|
+
return modifiers.some((m) => !!event[m]);
|
|
46
|
+
}
|
|
47
|
+
return !!(event.altKey || event.shiftKey || event.ctrlKey || event.metaKey);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ---- @angular/cdk/platform ----
|
|
51
|
+
|
|
52
|
+
export class Platform {
|
|
53
|
+
static shared = new Platform();
|
|
54
|
+
isBrowser = false;
|
|
55
|
+
EDGE = false;
|
|
56
|
+
TRIDENT = false;
|
|
57
|
+
BLINK = false;
|
|
58
|
+
WEBKIT = false;
|
|
59
|
+
IOS = false;
|
|
60
|
+
FIREFOX = false;
|
|
61
|
+
ANDROID = false;
|
|
62
|
+
SAFARI = false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function normalizePassiveListenerOptions(options: any): any {
|
|
66
|
+
return options;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ---- @angular/cdk/portal ----
|
|
70
|
+
|
|
71
|
+
export type ComponentType<T> = new (...args: any[]) => T;
|
|
72
|
+
|
|
73
|
+
export class ComponentPortal<T = any> {
|
|
74
|
+
component: any;
|
|
75
|
+
viewContainerRef: any;
|
|
76
|
+
injector: any;
|
|
77
|
+
componentFactoryResolver: any;
|
|
78
|
+
projectableNodes: any;
|
|
79
|
+
constructor(component: any, viewContainerRef?: any, injector?: any, componentFactoryResolver?: any, projectableNodes?: any) {
|
|
80
|
+
this.component = component;
|
|
81
|
+
this.viewContainerRef = viewContainerRef;
|
|
82
|
+
this.injector = injector;
|
|
83
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
84
|
+
this.projectableNodes = projectableNodes;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export class TemplatePortal<C = any> {
|
|
89
|
+
templateRef: any;
|
|
90
|
+
viewContainerRef: any;
|
|
91
|
+
context: any;
|
|
92
|
+
injector: any;
|
|
93
|
+
constructor(templateRef: any, viewContainerRef: any, context?: C, injector?: any) {
|
|
94
|
+
this.templateRef = templateRef;
|
|
95
|
+
this.viewContainerRef = viewContainerRef;
|
|
96
|
+
this.context = context;
|
|
97
|
+
this.injector = injector;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ---- @angular/cdk/scrolling ----
|
|
102
|
+
|
|
103
|
+
export class ViewportRuler {
|
|
104
|
+
static shared = new ViewportRuler();
|
|
105
|
+
getViewportSize(): { width: number; height: number } {
|
|
106
|
+
return { width: 0, height: 0 };
|
|
107
|
+
}
|
|
108
|
+
getViewportRect(): { top: number; left: number; bottom: number; right: number; height: number; width: number } {
|
|
109
|
+
return { top: 0, left: 0, bottom: 0, right: 0, height: 0, width: 0 };
|
|
110
|
+
}
|
|
111
|
+
getViewportScrollPosition(): { top: number; left: number } {
|
|
112
|
+
return { top: 0, left: 0 };
|
|
113
|
+
}
|
|
114
|
+
change(_throttleTime?: number): Observable<any> {
|
|
115
|
+
return EMPTY_OBSERVABLE;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ---- @angular/cdk/observers & @angular/cdk/observers/private ----
|
|
120
|
+
|
|
121
|
+
export class CdkObserveContent {
|
|
122
|
+
readonly cdkObserveContent = new EventEmitter<any>();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export class SharedResizeObserver {
|
|
126
|
+
static shared = new SharedResizeObserver();
|
|
127
|
+
observe(_target: any, _options?: any): Observable<any[]> {
|
|
128
|
+
return EMPTY_OBSERVABLE;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---- @angular/cdk/a11y ----
|
|
133
|
+
|
|
134
|
+
export type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;
|
|
135
|
+
|
|
136
|
+
export interface FocusableOption {
|
|
137
|
+
disabled?: boolean;
|
|
138
|
+
focus(origin?: FocusOrigin): void;
|
|
139
|
+
getLabel?(): string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface Highlightable {
|
|
143
|
+
disabled?: boolean;
|
|
144
|
+
setActiveStyles(): void;
|
|
145
|
+
setInactiveStyles(): void;
|
|
146
|
+
getLabel?(): string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export class FocusMonitor {
|
|
150
|
+
static shared = new FocusMonitor();
|
|
151
|
+
monitor(_element: any, _checkChildren?: boolean): Observable<FocusOrigin> {
|
|
152
|
+
return EMPTY_OBSERVABLE;
|
|
153
|
+
}
|
|
154
|
+
stopMonitoring(_element: any): void {}
|
|
155
|
+
focusVia(_element: any, _origin: FocusOrigin, _options?: any): void {}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export class InteractivityChecker {
|
|
159
|
+
static shared = new InteractivityChecker();
|
|
160
|
+
isDisabled(_element: any): boolean {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
isVisible(_element: any): boolean {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
isTabbable(_element: any): boolean {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
isFocusable(_element: any): boolean {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export class InputModalityDetector {
|
|
175
|
+
static shared = new InputModalityDetector();
|
|
176
|
+
readonly modalityDetected: Observable<any> = EMPTY_OBSERVABLE;
|
|
177
|
+
readonly modalityChanged: Observable<any> = EMPTY_OBSERVABLE;
|
|
178
|
+
mostRecentModality: any = null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export class FocusKeyManager<T = any> {
|
|
182
|
+
activeItem: any = null;
|
|
183
|
+
activeItemIndex: number | null = null;
|
|
184
|
+
readonly change = new Subject<number>();
|
|
185
|
+
readonly tabOut = new Subject<void>();
|
|
186
|
+
private _items: any;
|
|
187
|
+
constructor(items?: any, _injector?: any) {
|
|
188
|
+
this._items = items;
|
|
189
|
+
}
|
|
190
|
+
withWrap(_shouldWrap?: boolean): this {
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
193
|
+
withVerticalOrientation(_enabled?: boolean): this {
|
|
194
|
+
return this;
|
|
195
|
+
}
|
|
196
|
+
withHorizontalOrientation(_dir?: any): this {
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
withTypeAhead(_debounceInterval?: number): this {
|
|
200
|
+
return this;
|
|
201
|
+
}
|
|
202
|
+
withHomeAndEnd(_enabled?: boolean): this {
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
withPageUpDown(_enabled?: boolean): this {
|
|
206
|
+
return this;
|
|
207
|
+
}
|
|
208
|
+
withAllowedModifierKeys(_keys?: any): this {
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
skipPredicate(_predicate: (item: T) => boolean): this {
|
|
212
|
+
return this;
|
|
213
|
+
}
|
|
214
|
+
setActiveItem(item: any): void {
|
|
215
|
+
if (typeof item === 'number') {
|
|
216
|
+
this.activeItemIndex = item;
|
|
217
|
+
} else {
|
|
218
|
+
this.activeItem = item;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
updateActiveItem(item: any): void {
|
|
222
|
+
this.setActiveItem(item);
|
|
223
|
+
}
|
|
224
|
+
setFirstItemActive(): void {
|
|
225
|
+
this.activeItemIndex = 0;
|
|
226
|
+
}
|
|
227
|
+
setLastItemActive(): void {}
|
|
228
|
+
setNextItemActive(): void {}
|
|
229
|
+
setPreviousItemActive(): void {}
|
|
230
|
+
setFocusOrigin(_origin: FocusOrigin): this {
|
|
231
|
+
return this;
|
|
232
|
+
}
|
|
233
|
+
onKeydown(_event: any): void {}
|
|
234
|
+
destroy(): void {
|
|
235
|
+
this.change.complete();
|
|
236
|
+
this.tabOut.complete();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export class ActiveDescendantKeyManager<T = any> extends FocusKeyManager<T> {}
|
|
241
|
+
|
|
242
|
+
// ---- @angular/cdk/overlay ----
|
|
243
|
+
|
|
244
|
+
export interface ConnectedPosition {
|
|
245
|
+
originX: 'start' | 'center' | 'end';
|
|
246
|
+
originY: 'top' | 'center' | 'bottom';
|
|
247
|
+
overlayX: 'start' | 'center' | 'end';
|
|
248
|
+
overlayY: 'top' | 'center' | 'bottom';
|
|
249
|
+
weight?: number;
|
|
250
|
+
offsetX?: number;
|
|
251
|
+
offsetY?: number;
|
|
252
|
+
panelClass?: string | string[];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export type FlexibleConnectedPositionStrategyOrigin = any;
|
|
256
|
+
|
|
257
|
+
export interface PositionStrategy {
|
|
258
|
+
attach(overlayRef: any): void;
|
|
259
|
+
apply(): void;
|
|
260
|
+
detach?(): void;
|
|
261
|
+
dispose(): void;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface ScrollStrategy {
|
|
265
|
+
attach(overlayRef: any): void;
|
|
266
|
+
enable(): void;
|
|
267
|
+
disable(): void;
|
|
268
|
+
detach?(): void;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface ConnectedOverlayPositionChange {
|
|
272
|
+
connectionPair: ConnectedPosition;
|
|
273
|
+
scrollableViewProperties: any;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export class FlexibleConnectedPositionStrategy implements PositionStrategy {
|
|
277
|
+
_origin: any = null;
|
|
278
|
+
readonly positionChanges = new Subject<ConnectedOverlayPositionChange>();
|
|
279
|
+
constructor(origin?: any) {
|
|
280
|
+
this._origin = origin;
|
|
281
|
+
}
|
|
282
|
+
withPositions(_positions: ConnectedPosition[]): this {
|
|
283
|
+
return this;
|
|
284
|
+
}
|
|
285
|
+
withFlexibleDimensions(_flexibleDimensions?: boolean): this {
|
|
286
|
+
return this;
|
|
287
|
+
}
|
|
288
|
+
withPush(_canPush?: boolean): this {
|
|
289
|
+
return this;
|
|
290
|
+
}
|
|
291
|
+
withGrowAfterOpen(_growAfterOpen?: boolean): this {
|
|
292
|
+
return this;
|
|
293
|
+
}
|
|
294
|
+
withViewportMargin(_margin: number): this {
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
withLockedPosition(_isLocked?: boolean): this {
|
|
298
|
+
return this;
|
|
299
|
+
}
|
|
300
|
+
withDefaultOffsetX(_offset: number): this {
|
|
301
|
+
return this;
|
|
302
|
+
}
|
|
303
|
+
withDefaultOffsetY(_offset: number): this {
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
withTransformOriginOn(_selector: string): this {
|
|
307
|
+
return this;
|
|
308
|
+
}
|
|
309
|
+
setOrigin(origin: any): this {
|
|
310
|
+
this._origin = origin;
|
|
311
|
+
return this;
|
|
312
|
+
}
|
|
313
|
+
attach(_overlayRef: any): void {}
|
|
314
|
+
apply(): void {}
|
|
315
|
+
detach(): void {}
|
|
316
|
+
reapplyLastPosition(): void {}
|
|
317
|
+
dispose(): void {
|
|
318
|
+
this.positionChanges.complete();
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export class GlobalPositionStrategy implements PositionStrategy {
|
|
323
|
+
top(_value?: string): this {
|
|
324
|
+
return this;
|
|
325
|
+
}
|
|
326
|
+
bottom(_value?: string): this {
|
|
327
|
+
return this;
|
|
328
|
+
}
|
|
329
|
+
left(_value?: string): this {
|
|
330
|
+
return this;
|
|
331
|
+
}
|
|
332
|
+
right(_value?: string): this {
|
|
333
|
+
return this;
|
|
334
|
+
}
|
|
335
|
+
centerHorizontally(_offset?: string): this {
|
|
336
|
+
return this;
|
|
337
|
+
}
|
|
338
|
+
centerVertically(_offset?: string): this {
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
attach(_overlayRef: any): void {}
|
|
342
|
+
apply(): void {}
|
|
343
|
+
detach(): void {}
|
|
344
|
+
dispose(): void {}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export class OverlayConfig {
|
|
348
|
+
positionStrategy: any;
|
|
349
|
+
scrollStrategy: any;
|
|
350
|
+
panelClass: any;
|
|
351
|
+
hasBackdrop?: boolean;
|
|
352
|
+
backdropClass: any;
|
|
353
|
+
width: any;
|
|
354
|
+
height: any;
|
|
355
|
+
minWidth: any;
|
|
356
|
+
minHeight: any;
|
|
357
|
+
maxWidth: any;
|
|
358
|
+
maxHeight: any;
|
|
359
|
+
direction: any;
|
|
360
|
+
disposeOnNavigation?: boolean;
|
|
361
|
+
constructor(config?: any) {
|
|
362
|
+
if (config) {
|
|
363
|
+
this.positionStrategy = config.positionStrategy;
|
|
364
|
+
this.scrollStrategy = config.scrollStrategy;
|
|
365
|
+
this.panelClass = config.panelClass;
|
|
366
|
+
this.hasBackdrop = config.hasBackdrop;
|
|
367
|
+
this.backdropClass = config.backdropClass;
|
|
368
|
+
this.width = config.width;
|
|
369
|
+
this.height = config.height;
|
|
370
|
+
this.minWidth = config.minWidth;
|
|
371
|
+
this.minHeight = config.minHeight;
|
|
372
|
+
this.maxWidth = config.maxWidth;
|
|
373
|
+
this.maxHeight = config.maxHeight;
|
|
374
|
+
this.direction = config.direction;
|
|
375
|
+
this.disposeOnNavigation = config.disposeOnNavigation;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
class NoopScrollStrategy implements ScrollStrategy {
|
|
381
|
+
attach(_overlayRef: any): void {}
|
|
382
|
+
enable(): void {}
|
|
383
|
+
disable(): void {}
|
|
384
|
+
detach(): void {}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export class ScrollStrategyOptions {
|
|
388
|
+
static shared = new ScrollStrategyOptions();
|
|
389
|
+
noop(): ScrollStrategy {
|
|
390
|
+
return new NoopScrollStrategy();
|
|
391
|
+
}
|
|
392
|
+
close(_config?: any): ScrollStrategy {
|
|
393
|
+
return new NoopScrollStrategy();
|
|
394
|
+
}
|
|
395
|
+
block(): ScrollStrategy {
|
|
396
|
+
return new NoopScrollStrategy();
|
|
397
|
+
}
|
|
398
|
+
reposition(_config?: any): ScrollStrategy {
|
|
399
|
+
return new NoopScrollStrategy();
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export class OverlayPositionBuilder {
|
|
404
|
+
static shared = new OverlayPositionBuilder();
|
|
405
|
+
global(): GlobalPositionStrategy {
|
|
406
|
+
return new GlobalPositionStrategy();
|
|
407
|
+
}
|
|
408
|
+
flexibleConnectedTo(origin: any): FlexibleConnectedPositionStrategy {
|
|
409
|
+
return new FlexibleConnectedPositionStrategy(origin);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export class OverlayRef {
|
|
414
|
+
hostElement: any = {};
|
|
415
|
+
overlayElement: any = {};
|
|
416
|
+
backdropElement: any = null;
|
|
417
|
+
private _config: OverlayConfig;
|
|
418
|
+
private _attached = false;
|
|
419
|
+
private _direction: Direction = 'ltr';
|
|
420
|
+
private readonly _attachments = new Subject<void>();
|
|
421
|
+
private readonly _detachments = new Subject<void>();
|
|
422
|
+
private readonly _backdropClick = new Subject<any>();
|
|
423
|
+
private readonly _keydownEvents = new Subject<any>();
|
|
424
|
+
private readonly _outsidePointerEvents = new Subject<any>();
|
|
425
|
+
constructor(config?: any) {
|
|
426
|
+
this._config = config instanceof OverlayConfig ? config : new OverlayConfig(config);
|
|
427
|
+
}
|
|
428
|
+
attach(_portal: any): any {
|
|
429
|
+
this._attached = true;
|
|
430
|
+
this._attachments.next();
|
|
431
|
+
return null;
|
|
432
|
+
}
|
|
433
|
+
detach(): any {
|
|
434
|
+
if (this._attached) {
|
|
435
|
+
this._attached = false;
|
|
436
|
+
this._detachments.next();
|
|
437
|
+
}
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
dispose(): void {
|
|
441
|
+
this.detach();
|
|
442
|
+
this._attachments.complete();
|
|
443
|
+
this._detachments.complete();
|
|
444
|
+
this._backdropClick.complete();
|
|
445
|
+
this._keydownEvents.complete();
|
|
446
|
+
this._outsidePointerEvents.complete();
|
|
447
|
+
}
|
|
448
|
+
hasAttached(): boolean {
|
|
449
|
+
return this._attached;
|
|
450
|
+
}
|
|
451
|
+
backdropClick(): Observable<any> {
|
|
452
|
+
return this._backdropClick.asObservable();
|
|
453
|
+
}
|
|
454
|
+
attachments(): Observable<void> {
|
|
455
|
+
return this._attachments.asObservable();
|
|
456
|
+
}
|
|
457
|
+
detachments(): Observable<void> {
|
|
458
|
+
return this._detachments.asObservable();
|
|
459
|
+
}
|
|
460
|
+
keydownEvents(): Observable<any> {
|
|
461
|
+
return this._keydownEvents.asObservable();
|
|
462
|
+
}
|
|
463
|
+
outsidePointerEvents(): Observable<any> {
|
|
464
|
+
return this._outsidePointerEvents.asObservable();
|
|
465
|
+
}
|
|
466
|
+
updatePosition(): void {}
|
|
467
|
+
updatePositionStrategy(strategy: any): void {
|
|
468
|
+
this._config.positionStrategy = strategy;
|
|
469
|
+
}
|
|
470
|
+
updateSize(_sizeConfig: any): void {}
|
|
471
|
+
setDirection(dir: any): void {
|
|
472
|
+
this._direction = dir === 'rtl' ? 'rtl' : 'ltr';
|
|
473
|
+
}
|
|
474
|
+
getDirection(): Direction {
|
|
475
|
+
return this._direction;
|
|
476
|
+
}
|
|
477
|
+
getConfig(): OverlayConfig {
|
|
478
|
+
return this._config;
|
|
479
|
+
}
|
|
480
|
+
addPanelClass(_classes: any): void {}
|
|
481
|
+
removePanelClass(_classes: any): void {}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
export class OverlayOutsideClickDispatcher {
|
|
485
|
+
static shared = new OverlayOutsideClickDispatcher();
|
|
486
|
+
_attachedOverlays: OverlayRef[] = [];
|
|
487
|
+
add(overlayRef: OverlayRef): void {
|
|
488
|
+
if (!this._attachedOverlays.includes(overlayRef)) this._attachedOverlays.push(overlayRef);
|
|
489
|
+
}
|
|
490
|
+
remove(overlayRef: OverlayRef): void {
|
|
491
|
+
const i = this._attachedOverlays.indexOf(overlayRef);
|
|
492
|
+
if (i >= 0) this._attachedOverlays.splice(i, 1);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export class Overlay {
|
|
497
|
+
static shared = new Overlay();
|
|
498
|
+
readonly scrollStrategies = ScrollStrategyOptions.shared;
|
|
499
|
+
position(): OverlayPositionBuilder {
|
|
500
|
+
return OverlayPositionBuilder.shared;
|
|
501
|
+
}
|
|
502
|
+
create(config?: any): OverlayRef {
|
|
503
|
+
return new OverlayRef(config);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
export const OVERLAY_DEFAULT_CONFIG = new InjectionToken<any>('OVERLAY_DEFAULT_CONFIG');
|
|
508
|
+
|
|
509
|
+
// ---- @angular/cdk/dialog ----
|
|
510
|
+
|
|
511
|
+
export type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading' | string | boolean;
|
|
512
|
+
export type RestoreFocusValue = boolean | string | HTMLElement;
|
|
513
|
+
|
|
514
|
+
export const DIALOG_DATA = new InjectionToken<any>('DialogData');
|
|
515
|
+
|
|
516
|
+
export class DialogRef<R = unknown, C = unknown> {
|
|
517
|
+
id = '';
|
|
518
|
+
componentInstance: any = null;
|
|
519
|
+
readonly config: any;
|
|
520
|
+
readonly overlayRef: OverlayRef;
|
|
521
|
+
readonly closed = new Subject<any>();
|
|
522
|
+
readonly backdropClick = new Subject<any>();
|
|
523
|
+
readonly keydownEvents = new Subject<any>();
|
|
524
|
+
readonly outsidePointerEvents = new Subject<any>();
|
|
525
|
+
disableClose?: boolean;
|
|
526
|
+
constructor(overlayRef?: OverlayRef, config?: any) {
|
|
527
|
+
this.overlayRef = overlayRef ?? new OverlayRef();
|
|
528
|
+
this.config = config ?? {};
|
|
529
|
+
}
|
|
530
|
+
close(result?: any, _options?: any): void {
|
|
531
|
+
this.closed.next(result);
|
|
532
|
+
this.closed.complete();
|
|
533
|
+
this.overlayRef.dispose();
|
|
534
|
+
}
|
|
535
|
+
updatePosition(_position?: any): this {
|
|
536
|
+
return this;
|
|
537
|
+
}
|
|
538
|
+
updateSize(_width?: any, _height?: any): this {
|
|
539
|
+
return this;
|
|
540
|
+
}
|
|
541
|
+
addPanelClass(_classes: any): this {
|
|
542
|
+
return this;
|
|
543
|
+
}
|
|
544
|
+
removePanelClass(_classes: any): this {
|
|
545
|
+
return this;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
export class Dialog {
|
|
550
|
+
static shared = new Dialog();
|
|
551
|
+
openDialogs: DialogRef<any, any>[] = [];
|
|
552
|
+
open<R = unknown, D = unknown, C = unknown>(
|
|
553
|
+
_componentOrTemplateRef: any,
|
|
554
|
+
config?: { providers?: (dialogRef: DialogRef<R, C>, config: any) => any; [key: string]: any },
|
|
555
|
+
): DialogRef<R, C> {
|
|
556
|
+
const ref = new DialogRef<R, C>(new OverlayRef(config), config);
|
|
557
|
+
this.openDialogs.push(ref);
|
|
558
|
+
return ref;
|
|
559
|
+
}
|
|
560
|
+
closeAll(): void {
|
|
561
|
+
for (const ref of this.openDialogs.slice()) ref.close();
|
|
562
|
+
this.openDialogs = [];
|
|
563
|
+
}
|
|
564
|
+
getDialogById(id: string): DialogRef<any, any> | undefined {
|
|
565
|
+
return this.openDialogs.find((d) => d.id === id);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
// ---- @angular/cdk/menu ----
|
|
570
|
+
|
|
571
|
+
export interface Menu {
|
|
572
|
+
id: string;
|
|
573
|
+
orientation: 'horizontal' | 'vertical';
|
|
574
|
+
nativeElement: any;
|
|
575
|
+
focusFirstItem(focusOrigin: any): void;
|
|
576
|
+
focusLastItem(focusOrigin: any): void;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
export class CdkMenuBase implements Menu {
|
|
580
|
+
id = '';
|
|
581
|
+
orientation: 'horizontal' | 'vertical' = 'vertical';
|
|
582
|
+
nativeElement: any = null;
|
|
583
|
+
readonly items: readonly CdkMenuItem[] = [];
|
|
584
|
+
readonly closed = new EventEmitter<void>();
|
|
585
|
+
focusFirstItem(_focusOrigin?: any): void {}
|
|
586
|
+
focusLastItem(_focusOrigin?: any): void {}
|
|
587
|
+
setActiveMenuItem(_item: CdkMenuItem): void {}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export class CdkMenu extends CdkMenuBase {
|
|
591
|
+
static shared = new CdkMenu();
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export class CdkMenuBar extends CdkMenuBase {}
|
|
595
|
+
|
|
596
|
+
export class CdkMenuGroup {}
|
|
597
|
+
|
|
598
|
+
export class CdkMenuItem {
|
|
599
|
+
static shared = new CdkMenuItem();
|
|
600
|
+
readonly _elementRef: any = { nativeElement: null };
|
|
601
|
+
disabled = false;
|
|
602
|
+
typeaheadLabel: string | null = null;
|
|
603
|
+
readonly hasMenu = false;
|
|
604
|
+
readonly triggered = new EventEmitter<void>();
|
|
605
|
+
trigger(_options?: { keepOpen?: boolean }): void {
|
|
606
|
+
if (!this.disabled) this.triggered.emit();
|
|
607
|
+
}
|
|
608
|
+
isMenuOpen(): boolean {
|
|
609
|
+
return false;
|
|
610
|
+
}
|
|
611
|
+
getMenuTrigger(): CdkMenuTrigger | null {
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
focus(): void {}
|
|
615
|
+
getLabel(): string {
|
|
616
|
+
return this.typeaheadLabel ?? '';
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
export class CdkMenuItemSelectable extends CdkMenuItem {
|
|
621
|
+
checked = false;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export class CdkMenuItemCheckbox extends CdkMenuItemSelectable {
|
|
625
|
+
override trigger(options?: { keepOpen?: boolean }): void {
|
|
626
|
+
if (!this.disabled) {
|
|
627
|
+
this.checked = !this.checked;
|
|
628
|
+
super.trigger(options);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export class CdkMenuItemRadio extends CdkMenuItemSelectable {
|
|
634
|
+
override trigger(options?: { keepOpen?: boolean }): void {
|
|
635
|
+
if (!this.disabled) {
|
|
636
|
+
this.checked = true;
|
|
637
|
+
super.trigger(options);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export class CdkMenuTrigger {
|
|
643
|
+
static shared = new CdkMenuTrigger();
|
|
644
|
+
readonly injector: any = null;
|
|
645
|
+
menuTemplateRef: any = null;
|
|
646
|
+
menuPosition: ConnectedPosition[] = [];
|
|
647
|
+
menuData: any = null;
|
|
648
|
+
readonly opened = new EventEmitter<void>();
|
|
649
|
+
readonly closed = new EventEmitter<void>();
|
|
650
|
+
private _open = false;
|
|
651
|
+
isOpen(): boolean {
|
|
652
|
+
return this._open;
|
|
653
|
+
}
|
|
654
|
+
open(): void {
|
|
655
|
+
this._open = true;
|
|
656
|
+
this.opened.emit();
|
|
657
|
+
}
|
|
658
|
+
close(): void {
|
|
659
|
+
if (this._open) {
|
|
660
|
+
this._open = false;
|
|
661
|
+
this.closed.emit();
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
toggle(): void {
|
|
665
|
+
if (this._open) this.close();
|
|
666
|
+
else this.open();
|
|
667
|
+
}
|
|
668
|
+
getMenu(): Menu | undefined {
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
export class CdkContextMenuTrigger extends CdkMenuTrigger {}
|