8384 changed files with 1541744 additions and 551 deletions
-
7angular.json
-
1node_modules/.bin/brfs
-
1node_modules/.bin/btoa
-
1node_modules/.bin/escodegen
-
1node_modules/.bin/esgenerate
-
1node_modules/.bin/esparse
-
1node_modules/.bin/esvalidate
-
1node_modules/.bin/quote-stream
-
1node_modules/.cache/babel-webpack/12eb38684097592617c31cb4b5d306f0.json
-
1node_modules/.cache/babel-webpack/2924b9bcfe1ae31f6ab2a2d7cf525469.json
-
1node_modules/.cache/babel-webpack/321f51b996250409926b92746843807a.json
-
1node_modules/.cache/babel-webpack/411af6567e38e109bd0667c519a5f074.json
-
1node_modules/.cache/babel-webpack/42742c0690c949e2c2bb1c45e802eb98.json
-
1node_modules/.cache/babel-webpack/442ba579388acd4eca0a71be1f800f7f.json
-
1node_modules/.cache/babel-webpack/44f47701cc0e14db97d1d5a9e63cd2d3.json
-
1node_modules/.cache/babel-webpack/85cfec20cff16749d5a3193fd8f2e502.json
-
1node_modules/.cache/babel-webpack/8b0c6295918eb0fb4571ed7b712adb11.json
-
1node_modules/.cache/babel-webpack/97b718fcbb369dd69904ac9a0fb63379.json
-
1node_modules/.cache/babel-webpack/a95dc7b0f1df8045203a5f3fc9a2c183.json
-
1node_modules/.cache/babel-webpack/ab19cc2672a909ebac976209acca1d66.json
-
1node_modules/.cache/babel-webpack/bf7ec97f9113bf0e3273b7585abcac19.json
-
1node_modules/.cache/babel-webpack/c591d9b81c7934eed733f5e5669f5557.json
-
1node_modules/.cache/babel-webpack/c6c3bb0c4e00e59efe9fe2b12250e3eb.json
-
1node_modules/.cache/babel-webpack/d16b38b0a38b43a3148f074dfaa26b2f.json
-
1node_modules/.cache/babel-webpack/d397b3bbc4220b5e1693038794dd3400.json
-
1node_modules/.cache/babel-webpack/d42943c018539bc1d33242c12771f244.json
-
1node_modules/.cache/babel-webpack/ebb3fdab137683e99b733405c1b1536a.json
-
1node_modules/.cache/babel-webpack/f4105c00756c47d1b67d6786e1991778.json
-
0node_modules/.cli-ngcc/3dcbd9b5acdde7bbb2bd13c0eb56ce4e9f90cff7775a94e6f352ad14cb4fe7c0.lock
-
0node_modules/.cli-ngcc/82424244f88acffd90e2e57bedee9f77cf0ad3ac8b09bec4b0ebc06027f22515.lock
-
0node_modules/.cli-ngcc/855825fba4e096d72395f0b16861429d62e6c2633bcbba4fcba25089259ec03b.lock
-
0node_modules/.cli-ngcc/8eae5b474492c184160a1dd97c3530c762d3d26387388bfc550e23e91368ae23.lock
-
0node_modules/.cli-ngcc/9ce3eb19cd3b39072f3d5b3c7dd9577c5bc5537778d5d278893ac1fb6f6c1ee8.lock
-
0node_modules/.cli-ngcc/d22a204b35e7ab2c4f82f4efec1300f1c20ca75db8f0bf96889546d2eb5cf6d1.lock
-
1205node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js
-
1node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js.map
-
4699node_modules/@angular/animations/__ivy_ngcc__/fesm2015/browser.js
-
1node_modules/@angular/animations/__ivy_ngcc__/fesm2015/browser.js.map
-
2node_modules/@angular/animations/animations.d.ts
-
1601node_modules/@angular/animations/animations.d.ts.__ivy_ngcc_bak
-
1node_modules/@angular/animations/animations.d.ts.map
-
5node_modules/@angular/animations/browser/browser.d.ts
-
305node_modules/@angular/animations/browser/browser.d.ts.__ivy_ngcc_bak
-
1node_modules/@angular/animations/browser/browser.d.ts.map
-
14node_modules/@angular/animations/browser/package.json
-
14node_modules/@angular/animations/package.json
-
21node_modules/@angular/cdk/LICENSE
-
6node_modules/@angular/cdk/README.md
-
2476node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/a11y.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/a11y.js.map
-
274node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/accordion.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/accordion.js.map
-
185node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/bidi.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/bidi.js.map
-
274node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/clipboard.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/clipboard.js.map
-
472node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/collections.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/collections.js.map
-
3801node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/drag-drop.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/drag-drop.js.map
-
160node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/keycodes.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/keycodes.js.map
-
255node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/layout.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/layout.js.map
-
216node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/observers.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/observers.js.map
-
3243node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/overlay.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/overlay.js.map
-
373node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/platform.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/platform.js.map
-
656node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/portal.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/portal.js.map
-
1481node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/scrolling.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/scrolling.js.map
-
732node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/stepper.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/stepper.js.map
-
2458node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/table.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/table.js.map
-
482node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/text-field.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/text-field.js.map
-
1019node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/tree.js
-
1node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/tree.js.map
-
8node_modules/@angular/cdk/_index.scss
-
1node_modules/@angular/cdk/a11y-prebuilt.css
-
2node_modules/@angular/cdk/a11y/_index.import.scss
-
91node_modules/@angular/cdk/a11y/_index.scss
-
22node_modules/@angular/cdk/a11y/a11y-module.d.ts
-
11node_modules/@angular/cdk/a11y/a11y-module.d.ts.__ivy_ngcc_bak
-
1node_modules/@angular/cdk/a11y/a11y-module.d.ts.map
-
82node_modules/@angular/cdk/a11y/aria-describer/aria-describer.d.ts
-
78node_modules/@angular/cdk/a11y/aria-describer/aria-describer.d.ts.__ivy_ngcc_bak
-
1node_modules/@angular/cdk/a11y/aria-describer/aria-describer.d.ts.map
-
22node_modules/@angular/cdk/a11y/aria-describer/aria-reference.d.ts
-
11node_modules/@angular/cdk/a11y/fake-event-detection.d.ts
-
211node_modules/@angular/cdk/a11y/focus-monitor/focus-monitor.d.ts
-
205node_modules/@angular/cdk/a11y/focus-monitor/focus-monitor.d.ts.__ivy_ngcc_bak
-
1node_modules/@angular/cdk/a11y/focus-monitor/focus-monitor.d.ts.map
-
16node_modules/@angular/cdk/a11y/focus-trap/configurable-focus-trap-config.d.ts
-
38node_modules/@angular/cdk/a11y/focus-trap/configurable-focus-trap-factory.d.ts
-
34node_modules/@angular/cdk/a11y/focus-trap/configurable-focus-trap-factory.d.ts.__ivy_ngcc_bak
@ -0,0 +1 @@ |
|||||
|
../brfs/bin/cmd.js |
@ -0,0 +1 @@ |
|||||
|
../btoa/bin/btoa.js |
@ -0,0 +1 @@ |
|||||
|
../escodegen/bin/escodegen.js |
@ -0,0 +1 @@ |
|||||
|
../escodegen/bin/esgenerate.js |
@ -0,0 +1 @@ |
|||||
|
../esprima/bin/esparse.js |
@ -0,0 +1 @@ |
|||||
|
../esprima/bin/esvalidate.js |
@ -0,0 +1 @@ |
|||||
|
../quote-stream/bin/cmd.js |
1
node_modules/.cache/babel-webpack/12eb38684097592617c31cb4b5d306f0.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/2924b9bcfe1ae31f6ab2a2d7cf525469.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/321f51b996250409926b92746843807a.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/411af6567e38e109bd0667c519a5f074.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/42742c0690c949e2c2bb1c45e802eb98.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/442ba579388acd4eca0a71be1f800f7f.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/44f47701cc0e14db97d1d5a9e63cd2d3.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/85cfec20cff16749d5a3193fd8f2e502.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/8b0c6295918eb0fb4571ed7b712adb11.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/97b718fcbb369dd69904ac9a0fb63379.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/a95dc7b0f1df8045203a5f3fc9a2c183.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/ab19cc2672a909ebac976209acca1d66.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/bf7ec97f9113bf0e3273b7585abcac19.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/c591d9b81c7934eed733f5e5669f5557.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/c6c3bb0c4e00e59efe9fe2b12250e3eb.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/d16b38b0a38b43a3148f074dfaa26b2f.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/d397b3bbc4220b5e1693038794dd3400.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/d42943c018539bc1d33242c12771f244.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/.cache/babel-webpack/ebb3fdab137683e99b733405c1b1536a.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1 @@ |
|||||
|
{"ast":null,"code":"import { RouterModule } from '@angular/router';\nimport { AppComponent } from './app.component';\nimport { ApplyLeaveComponent } from './apply-leave/apply-leave.component';\nimport { AttendanceComponent } from './attendance/attendance.component';\nimport { CurrentScreenComponent } from './current-screen/current-screen.component';\nimport { DashboardComponent } from './dashboard/dashboard.component';\nimport { EthicsComponent } from './ethics/ethics.component';\nimport { FlexiLeaveComponent } from './flexi-leave/flexi-leave.component';\nimport { HomeComponent } from './home/home.component';\nimport { NoticesComponent } from './notices/notices.component';\nimport { OdpnrComponent } from './odpnr/odpnr.component';\nimport { PoliciesComponent } from './policies/policies.component';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/router\";\nconst routes = [{\n path: '',\n component: DashboardComponent\n}, {\n path: 'home',\n component: HomeComponent\n}, {\n path: 'screen',\n component: CurrentScreenComponent\n}, {\n path: 'dashboard',\n component: DashboardComponent\n}, {\n path: 'applyLeave',\n component: ApplyLeaveComponent\n}, {\n path: 'flexiLeave',\n component: FlexiLeaveComponent\n}, {\n path: 'attendance',\n component: AttendanceComponent\n}, {\n path: 'odpnr',\n component: OdpnrComponent\n}, {\n path: 'notices',\n component: NoticesComponent\n}, {\n path: 'policies',\n component: PoliciesComponent\n}, {\n path: 'ethics',\n component: EthicsComponent\n}];\nexport let AppRoutingModule = /*#__PURE__*/(() => {\n class AppRoutingModule {}\n\n AppRoutingModule.ɵfac = function AppRoutingModule_Factory(t) {\n return new (t || AppRoutingModule)();\n };\n\n AppRoutingModule.ɵmod = /*@__PURE__*/i0.ɵɵdefineNgModule({\n type: AppRoutingModule,\n bootstrap: [AppComponent]\n });\n AppRoutingModule.ɵinj = /*@__PURE__*/i0.ɵɵdefineInjector({\n imports: [[RouterModule.forRoot(routes)], RouterModule]\n });\n return AppRoutingModule;\n})();","map":null,"metadata":{},"sourceType":"module"} |
1205
node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
4699
node_modules/@angular/animations/__ivy_ngcc__/fesm2015/browser.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/animations/__ivy_ngcc__/fesm2015/browser.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1601
node_modules/@angular/animations/animations.d.ts.__ivy_ngcc_bak
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/animations/animations.d.ts.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,305 @@ |
|||||
|
/** |
||||
|
* @license Angular v12.2.15 |
||||
|
* (c) 2010-2021 Google LLC. https://angular.io/ |
||||
|
* License: MIT |
||||
|
*/ |
||||
|
|
||||
|
import { AnimationMetadata } from '@angular/animations'; |
||||
|
import { AnimationOptions } from '@angular/animations'; |
||||
|
import { AnimationPlayer } from '@angular/animations'; |
||||
|
import { AnimationTriggerMetadata } from '@angular/animations'; |
||||
|
import { ɵStyleData } from '@angular/animations'; |
||||
|
|
||||
|
/** |
||||
|
* @publicApi |
||||
|
*/ |
||||
|
export declare abstract class AnimationDriver { |
||||
|
static NOOP: AnimationDriver; |
||||
|
abstract validateStyleProperty(prop: string): boolean; |
||||
|
abstract matchesElement(element: any, selector: string): boolean; |
||||
|
abstract containsElement(elm1: any, elm2: any): boolean; |
||||
|
abstract query(element: any, selector: string, multi: boolean): any[]; |
||||
|
abstract computeStyle(element: any, prop: string, defaultValue?: string): string; |
||||
|
abstract animate(element: any, keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[], duration: number, delay: number, easing?: string | null, previousPlayers?: any[], scrubberAccessRequested?: boolean): any; |
||||
|
} |
||||
|
|
||||
|
declare interface AnimationEngineInstruction { |
||||
|
type: AnimationTransitionInstructionType; |
||||
|
} |
||||
|
|
||||
|
declare interface AnimationTimelineInstruction extends AnimationEngineInstruction { |
||||
|
element: any; |
||||
|
keyframes: ɵStyleData[]; |
||||
|
preStyleProps: string[]; |
||||
|
postStyleProps: string[]; |
||||
|
duration: number; |
||||
|
delay: number; |
||||
|
totalTime: number; |
||||
|
easing: string | null; |
||||
|
stretchStartingKeyframe?: boolean; |
||||
|
subTimeline: boolean; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
declare const enum AnimationTransitionInstructionType { |
||||
|
TransitionAnimation = 0, |
||||
|
TimelineAnimation = 1 |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* DOMAnimation represents the Animation Web API. |
||||
|
* |
||||
|
* It is an external API by the browser, and must thus use "declare interface", |
||||
|
* to prevent renaming by Closure Compiler. |
||||
|
* |
||||
|
* @see https://developer.mozilla.org/de/docs/Web/API/Animation |
||||
|
*/ |
||||
|
declare interface DOMAnimation { |
||||
|
cancel(): void; |
||||
|
play(): void; |
||||
|
pause(): void; |
||||
|
finish(): void; |
||||
|
onfinish: Function; |
||||
|
position: number; |
||||
|
currentTime: number; |
||||
|
addEventListener(eventName: string, handler: (event: any) => any): any; |
||||
|
dispatchEvent(eventName: string): any; |
||||
|
} |
||||
|
|
||||
|
declare class ElementInstructionMap { |
||||
|
private _map; |
||||
|
consume(element: any): AnimationTimelineInstruction[]; |
||||
|
append(element: any, instructions: AnimationTimelineInstruction[]): void; |
||||
|
has(element: any): boolean; |
||||
|
clear(): void; |
||||
|
} |
||||
|
|
||||
|
export declare function ɵallowPreviousPlayerStylesMerge(duration: number, delay: number): boolean; |
||||
|
|
||||
|
/** |
||||
|
* Designed to be executed during a keyframe-based animation to apply any special-cased styles. |
||||
|
* |
||||
|
* When started (when the `start()` method is run) then the provided `startStyles` |
||||
|
* will be applied. When finished (when the `finish()` method is called) the |
||||
|
* `endStyles` will be applied as well any any starting styles. Finally when |
||||
|
* `destroy()` is called then all styles will be removed. |
||||
|
*/ |
||||
|
export declare class ɵangular_packages_animations_browser_browser_a { |
||||
|
private _element; |
||||
|
private _startStyles; |
||||
|
private _endStyles; |
||||
|
static initialStylesByElement: WeakMap<any, { |
||||
|
[key: string]: any; |
||||
|
}>; |
||||
|
private _state; |
||||
|
private _initialStyles; |
||||
|
constructor(_element: any, _startStyles: { |
||||
|
[key: string]: any; |
||||
|
} | null, _endStyles: { |
||||
|
[key: string]: any; |
||||
|
} | null); |
||||
|
start(): void; |
||||
|
finish(): void; |
||||
|
destroy(): void; |
||||
|
} |
||||
|
|
||||
|
export declare class ɵAnimation { |
||||
|
private _driver; |
||||
|
private _animationAst; |
||||
|
constructor(_driver: AnimationDriver, input: AnimationMetadata | AnimationMetadata[]); |
||||
|
buildTimelines(element: any, startingStyles: ɵStyleData | ɵStyleData[], destinationStyles: ɵStyleData | ɵStyleData[], options: AnimationOptions, subInstructions?: ElementInstructionMap): AnimationTimelineInstruction[]; |
||||
|
} |
||||
|
|
||||
|
export declare class ɵAnimationEngine { |
||||
|
private bodyNode; |
||||
|
private _driver; |
||||
|
private _normalizer; |
||||
|
private _transitionEngine; |
||||
|
private _timelineEngine; |
||||
|
private _triggerCache; |
||||
|
onRemovalComplete: (element: any, context: any) => void; |
||||
|
constructor(bodyNode: any, _driver: AnimationDriver, _normalizer: ɵAnimationStyleNormalizer); |
||||
|
registerTrigger(componentId: string, namespaceId: string, hostElement: any, name: string, metadata: AnimationTriggerMetadata): void; |
||||
|
register(namespaceId: string, hostElement: any): void; |
||||
|
destroy(namespaceId: string, context: any): void; |
||||
|
onInsert(namespaceId: string, element: any, parent: any, insertBefore: boolean): void; |
||||
|
onRemove(namespaceId: string, element: any, context: any, isHostElement?: boolean): void; |
||||
|
disableAnimations(element: any, disable: boolean): void; |
||||
|
process(namespaceId: string, element: any, property: string, value: any): void; |
||||
|
listen(namespaceId: string, element: any, eventName: string, eventPhase: string, callback: (event: any) => any): () => any; |
||||
|
flush(microtaskId?: number): void; |
||||
|
get players(): AnimationPlayer[]; |
||||
|
whenRenderingDone(): Promise<any>; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @publicApi |
||||
|
*/ |
||||
|
export declare abstract class ɵAnimationStyleNormalizer { |
||||
|
abstract normalizePropertyName(propertyName: string, errors: string[]): string; |
||||
|
abstract normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: string[]): string; |
||||
|
} |
||||
|
|
||||
|
export declare const ɵcontainsElement: (elm1: any, elm2: any) => boolean; |
||||
|
|
||||
|
export declare class ɵCssKeyframesDriver implements AnimationDriver { |
||||
|
private _count; |
||||
|
validateStyleProperty(prop: string): boolean; |
||||
|
matchesElement(element: any, selector: string): boolean; |
||||
|
containsElement(elm1: any, elm2: any): boolean; |
||||
|
query(element: any, selector: string, multi: boolean): any[]; |
||||
|
computeStyle(element: any, prop: string, defaultValue?: string): string; |
||||
|
buildKeyframeElement(element: any, name: string, keyframes: { |
||||
|
[key: string]: any; |
||||
|
}[]): any; |
||||
|
animate(element: any, keyframes: ɵStyleData[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[], scrubberAccessRequested?: boolean): AnimationPlayer; |
||||
|
} |
||||
|
|
||||
|
export declare class ɵCssKeyframesPlayer implements AnimationPlayer { |
||||
|
readonly element: any; |
||||
|
readonly keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[]; |
||||
|
readonly animationName: string; |
||||
|
private readonly _duration; |
||||
|
private readonly _delay; |
||||
|
private readonly _finalStyles; |
||||
|
private readonly _specialStyles?; |
||||
|
private _onDoneFns; |
||||
|
private _onStartFns; |
||||
|
private _onDestroyFns; |
||||
|
private _styler; |
||||
|
parentPlayer: AnimationPlayer; |
||||
|
readonly totalTime: number; |
||||
|
readonly easing: string; |
||||
|
currentSnapshot: { |
||||
|
[key: string]: string; |
||||
|
}; |
||||
|
private _state; |
||||
|
constructor(element: any, keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[], animationName: string, _duration: number, _delay: number, easing: string, _finalStyles: { |
||||
|
[key: string]: any; |
||||
|
}, _specialStyles?: ɵangular_packages_animations_browser_browser_a | null | undefined); |
||||
|
onStart(fn: () => void): void; |
||||
|
onDone(fn: () => void): void; |
||||
|
onDestroy(fn: () => void): void; |
||||
|
destroy(): void; |
||||
|
private _flushDoneFns; |
||||
|
private _flushStartFns; |
||||
|
finish(): void; |
||||
|
setPosition(value: number): void; |
||||
|
getPosition(): number; |
||||
|
hasStarted(): boolean; |
||||
|
init(): void; |
||||
|
play(): void; |
||||
|
pause(): void; |
||||
|
restart(): void; |
||||
|
reset(): void; |
||||
|
private _buildStyler; |
||||
|
beforeDestroy(): void; |
||||
|
} |
||||
|
|
||||
|
export declare const ɵinvokeQuery: (element: any, selector: string, multi: boolean) => any[]; |
||||
|
|
||||
|
export declare const ɵmatchesElement: (element: any, selector: string) => boolean; |
||||
|
|
||||
|
/** |
||||
|
* @publicApi |
||||
|
*/ |
||||
|
export declare class ɵNoopAnimationDriver implements AnimationDriver { |
||||
|
validateStyleProperty(prop: string): boolean; |
||||
|
matchesElement(element: any, selector: string): boolean; |
||||
|
containsElement(elm1: any, elm2: any): boolean; |
||||
|
query(element: any, selector: string, multi: boolean): any[]; |
||||
|
computeStyle(element: any, prop: string, defaultValue?: string): string; |
||||
|
animate(element: any, keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[], duration: number, delay: number, easing: string, previousPlayers?: any[], scrubberAccessRequested?: boolean): AnimationPlayer; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @publicApi |
||||
|
*/ |
||||
|
export declare class ɵNoopAnimationStyleNormalizer { |
||||
|
normalizePropertyName(propertyName: string, errors: string[]): string; |
||||
|
normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: string[]): string; |
||||
|
} |
||||
|
|
||||
|
export declare function ɵsupportsWebAnimations(): boolean; |
||||
|
|
||||
|
export declare function ɵvalidateStyleProperty(prop: string): boolean; |
||||
|
|
||||
|
export declare class ɵWebAnimationsDriver implements AnimationDriver { |
||||
|
private _isNativeImpl; |
||||
|
private _cssKeyframesDriver; |
||||
|
validateStyleProperty(prop: string): boolean; |
||||
|
matchesElement(element: any, selector: string): boolean; |
||||
|
containsElement(elm1: any, elm2: any): boolean; |
||||
|
query(element: any, selector: string, multi: boolean): any[]; |
||||
|
computeStyle(element: any, prop: string, defaultValue?: string): string; |
||||
|
overrideWebAnimationsSupport(supported: boolean): void; |
||||
|
animate(element: any, keyframes: ɵStyleData[], duration: number, delay: number, easing: string, previousPlayers?: AnimationPlayer[], scrubberAccessRequested?: boolean): AnimationPlayer; |
||||
|
} |
||||
|
|
||||
|
export declare class ɵWebAnimationsPlayer implements AnimationPlayer { |
||||
|
element: any; |
||||
|
keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[]; |
||||
|
options: { |
||||
|
[key: string]: string | number; |
||||
|
}; |
||||
|
private _specialStyles?; |
||||
|
private _onDoneFns; |
||||
|
private _onStartFns; |
||||
|
private _onDestroyFns; |
||||
|
private _duration; |
||||
|
private _delay; |
||||
|
private _initialized; |
||||
|
private _finished; |
||||
|
private _started; |
||||
|
private _destroyed; |
||||
|
private _finalKeyframe; |
||||
|
readonly domPlayer: DOMAnimation; |
||||
|
time: number; |
||||
|
parentPlayer: AnimationPlayer | null; |
||||
|
currentSnapshot: { |
||||
|
[styleName: string]: string | number; |
||||
|
}; |
||||
|
constructor(element: any, keyframes: { |
||||
|
[key: string]: string | number; |
||||
|
}[], options: { |
||||
|
[key: string]: string | number; |
||||
|
}, _specialStyles?: ɵangular_packages_animations_browser_browser_a | null | undefined); |
||||
|
private _onFinish; |
||||
|
init(): void; |
||||
|
private _buildPlayer; |
||||
|
private _preparePlayerBeforeStart; |
||||
|
onStart(fn: () => void): void; |
||||
|
onDone(fn: () => void): void; |
||||
|
onDestroy(fn: () => void): void; |
||||
|
play(): void; |
||||
|
pause(): void; |
||||
|
finish(): void; |
||||
|
reset(): void; |
||||
|
private _resetDomPlayerState; |
||||
|
restart(): void; |
||||
|
hasStarted(): boolean; |
||||
|
destroy(): void; |
||||
|
setPosition(p: number): void; |
||||
|
getPosition(): number; |
||||
|
get totalTime(): number; |
||||
|
beforeDestroy(): void; |
||||
|
} |
||||
|
|
||||
|
export declare class ɵWebAnimationsStyleNormalizer extends ɵAnimationStyleNormalizer { |
||||
|
normalizePropertyName(propertyName: string, errors: string[]): string; |
||||
|
normalizeStyleValue(userProvidedProperty: string, normalizedProperty: string, value: string | number, errors: string[]): string; |
||||
|
} |
||||
|
|
||||
|
export { } |
1
node_modules/@angular/animations/browser/browser.d.ts.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,21 @@ |
|||||
|
The MIT License |
||||
|
|
||||
|
Copyright (c) 2021 Google LLC. |
||||
|
|
||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
of this software and associated documentation files (the "Software"), to deal |
||||
|
in the Software without restriction, including without limitation the rights |
||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
copies of the Software, and to permit persons to whom the Software is |
||||
|
furnished to do so, subject to the following conditions: |
||||
|
|
||||
|
The above copyright notice and this permission notice shall be included in |
||||
|
all copies or substantial portions of the Software. |
||||
|
|
||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
|
THE SOFTWARE. |
@ -0,0 +1,6 @@ |
|||||
|
Angular Material |
||||
|
======= |
||||
|
|
||||
|
The sources for this package are in the main [Angular Material](https://github.com/angular/components) repo. Please file issues and pull requests against that repo. |
||||
|
|
||||
|
License: MIT |
2476
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/a11y.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/a11y.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,274 @@ |
|||||
|
import { InjectionToken, Directive, Input, EventEmitter, Optional, Inject, SkipSelf, ChangeDetectorRef, Output, NgModule } from '@angular/core'; |
||||
|
import { UniqueSelectionDispatcher } from '@angular/cdk/collections'; |
||||
|
import { coerceBooleanProperty } from '@angular/cdk/coercion'; |
||||
|
import { Subject, Subscription } from 'rxjs'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Used to generate unique ID for each accordion. */ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
import * as ɵngcc1 from '@angular/cdk/collections'; |
||||
|
let nextId$1 = 0; |
||||
|
/** |
||||
|
* Injection token that can be used to reference instances of `CdkAccordion`. It serves |
||||
|
* as alternative token to the actual `CdkAccordion` class which could cause unnecessary |
||||
|
* retention of the class and its directive metadata. |
||||
|
*/ |
||||
|
const CDK_ACCORDION = new InjectionToken('CdkAccordion'); |
||||
|
/** |
||||
|
* Directive whose purpose is to manage the expanded state of CdkAccordionItem children. |
||||
|
*/ |
||||
|
class CdkAccordion { |
||||
|
constructor() { |
||||
|
/** Emits when the state of the accordion changes */ |
||||
|
this._stateChanges = new Subject(); |
||||
|
/** Stream that emits true/false when openAll/closeAll is triggered. */ |
||||
|
this._openCloseAllActions = new Subject(); |
||||
|
/** A readonly id value to use for unique selection coordination. */ |
||||
|
this.id = `cdk-accordion-${nextId$1++}`; |
||||
|
this._multi = false; |
||||
|
} |
||||
|
/** Whether the accordion should allow multiple expanded accordion items simultaneously. */ |
||||
|
get multi() { return this._multi; } |
||||
|
set multi(multi) { this._multi = coerceBooleanProperty(multi); } |
||||
|
/** Opens all enabled accordion items in an accordion where multi is enabled. */ |
||||
|
openAll() { |
||||
|
if (this._multi) { |
||||
|
this._openCloseAllActions.next(true); |
||||
|
} |
||||
|
} |
||||
|
/** Closes all enabled accordion items in an accordion where multi is enabled. */ |
||||
|
closeAll() { |
||||
|
this._openCloseAllActions.next(false); |
||||
|
} |
||||
|
ngOnChanges(changes) { |
||||
|
this._stateChanges.next(changes); |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._stateChanges.complete(); |
||||
|
this._openCloseAllActions.complete(); |
||||
|
} |
||||
|
} |
||||
|
CdkAccordion.ɵfac = function CdkAccordion_Factory(t) { return new (t || CdkAccordion)(); }; |
||||
|
CdkAccordion.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkAccordion, selectors: [["cdk-accordion"], ["", "cdkAccordion", ""]], inputs: { multi: "multi" }, exportAs: ["cdkAccordion"], features: [ɵngcc0.ɵɵProvidersFeature([{ provide: CDK_ACCORDION, useExisting: CdkAccordion }]), ɵngcc0.ɵɵNgOnChangesFeature] }); |
||||
|
CdkAccordion.propDecorators = { |
||||
|
multi: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkAccordion, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: 'cdk-accordion, [cdkAccordion]', |
||||
|
exportAs: 'cdkAccordion', |
||||
|
providers: [{ provide: CDK_ACCORDION, useExisting: CdkAccordion }] |
||||
|
}] |
||||
|
}], function () { return []; }, { multi: [{ |
||||
|
type: Input |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Used to generate unique ID for each accordion item. */ |
||||
|
let nextId = 0; |
||||
|
const ɵ0 = undefined; |
||||
|
/** |
||||
|
* An basic directive expected to be extended and decorated as a component. Sets up all |
||||
|
* events and attributes needed to be managed by a CdkAccordion parent. |
||||
|
*/ |
||||
|
class CdkAccordionItem { |
||||
|
constructor(accordion, _changeDetectorRef, _expansionDispatcher) { |
||||
|
this.accordion = accordion; |
||||
|
this._changeDetectorRef = _changeDetectorRef; |
||||
|
this._expansionDispatcher = _expansionDispatcher; |
||||
|
/** Subscription to openAll/closeAll events. */ |
||||
|
this._openCloseAllSubscription = Subscription.EMPTY; |
||||
|
/** Event emitted every time the AccordionItem is closed. */ |
||||
|
this.closed = new EventEmitter(); |
||||
|
/** Event emitted every time the AccordionItem is opened. */ |
||||
|
this.opened = new EventEmitter(); |
||||
|
/** Event emitted when the AccordionItem is destroyed. */ |
||||
|
this.destroyed = new EventEmitter(); |
||||
|
/** |
||||
|
* Emits whenever the expanded state of the accordion changes. |
||||
|
* Primarily used to facilitate two-way binding. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
this.expandedChange = new EventEmitter(); |
||||
|
/** The unique AccordionItem id. */ |
||||
|
this.id = `cdk-accordion-child-${nextId++}`; |
||||
|
this._expanded = false; |
||||
|
this._disabled = false; |
||||
|
/** Unregister function for _expansionDispatcher. */ |
||||
|
this._removeUniqueSelectionListener = () => { }; |
||||
|
this._removeUniqueSelectionListener = |
||||
|
_expansionDispatcher.listen((id, accordionId) => { |
||||
|
if (this.accordion && !this.accordion.multi && |
||||
|
this.accordion.id === accordionId && this.id !== id) { |
||||
|
this.expanded = false; |
||||
|
} |
||||
|
}); |
||||
|
// When an accordion item is hosted in an accordion, subscribe to open/close events.
|
||||
|
if (this.accordion) { |
||||
|
this._openCloseAllSubscription = this._subscribeToOpenCloseAllActions(); |
||||
|
} |
||||
|
} |
||||
|
/** Whether the AccordionItem is expanded. */ |
||||
|
get expanded() { return this._expanded; } |
||||
|
set expanded(expanded) { |
||||
|
expanded = coerceBooleanProperty(expanded); |
||||
|
// Only emit events and update the internal value if the value changes.
|
||||
|
if (this._expanded !== expanded) { |
||||
|
this._expanded = expanded; |
||||
|
this.expandedChange.emit(expanded); |
||||
|
if (expanded) { |
||||
|
this.opened.emit(); |
||||
|
/** |
||||
|
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem, |
||||
|
* the name value is the id of the accordion. |
||||
|
*/ |
||||
|
const accordionId = this.accordion ? this.accordion.id : this.id; |
||||
|
this._expansionDispatcher.notify(this.id, accordionId); |
||||
|
} |
||||
|
else { |
||||
|
this.closed.emit(); |
||||
|
} |
||||
|
// Ensures that the animation will run when the value is set outside of an `@Input`.
|
||||
|
// This includes cases like the open, close and toggle methods.
|
||||
|
this._changeDetectorRef.markForCheck(); |
||||
|
} |
||||
|
} |
||||
|
/** Whether the AccordionItem is disabled. */ |
||||
|
get disabled() { return this._disabled; } |
||||
|
set disabled(disabled) { this._disabled = coerceBooleanProperty(disabled); } |
||||
|
/** Emits an event for the accordion item being destroyed. */ |
||||
|
ngOnDestroy() { |
||||
|
this.opened.complete(); |
||||
|
this.closed.complete(); |
||||
|
this.destroyed.emit(); |
||||
|
this.destroyed.complete(); |
||||
|
this._removeUniqueSelectionListener(); |
||||
|
this._openCloseAllSubscription.unsubscribe(); |
||||
|
} |
||||
|
/** Toggles the expanded state of the accordion item. */ |
||||
|
toggle() { |
||||
|
if (!this.disabled) { |
||||
|
this.expanded = !this.expanded; |
||||
|
} |
||||
|
} |
||||
|
/** Sets the expanded state of the accordion item to false. */ |
||||
|
close() { |
||||
|
if (!this.disabled) { |
||||
|
this.expanded = false; |
||||
|
} |
||||
|
} |
||||
|
/** Sets the expanded state of the accordion item to true. */ |
||||
|
open() { |
||||
|
if (!this.disabled) { |
||||
|
this.expanded = true; |
||||
|
} |
||||
|
} |
||||
|
_subscribeToOpenCloseAllActions() { |
||||
|
return this.accordion._openCloseAllActions.subscribe(expanded => { |
||||
|
// Only change expanded state if item is enabled
|
||||
|
if (!this.disabled) { |
||||
|
this.expanded = expanded; |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
CdkAccordionItem.ɵfac = function CdkAccordionItem_Factory(t) { return new (t || CdkAccordionItem)(ɵngcc0.ɵɵdirectiveInject(CDK_ACCORDION, 12), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc1.UniqueSelectionDispatcher)); }; |
||||
|
CdkAccordionItem.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkAccordionItem, selectors: [["cdk-accordion-item"], ["", "cdkAccordionItem", ""]], inputs: { expanded: "expanded", disabled: "disabled" }, outputs: { closed: "closed", opened: "opened", destroyed: "destroyed", expandedChange: "expandedChange" }, exportAs: ["cdkAccordionItem"], features: [ɵngcc0.ɵɵProvidersFeature([ |
||||
|
// Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from
|
||||
|
// registering to the same accordion.
|
||||
|
{ provide: CDK_ACCORDION, useValue: ɵ0 }, |
||||
|
])] }); |
||||
|
CdkAccordionItem.ctorParameters = () => [ |
||||
|
{ type: CdkAccordion, decorators: [{ type: Optional }, { type: Inject, args: [CDK_ACCORDION,] }, { type: SkipSelf }] }, |
||||
|
{ type: ChangeDetectorRef }, |
||||
|
{ type: UniqueSelectionDispatcher } |
||||
|
]; |
||||
|
CdkAccordionItem.propDecorators = { |
||||
|
closed: [{ type: Output }], |
||||
|
opened: [{ type: Output }], |
||||
|
destroyed: [{ type: Output }], |
||||
|
expandedChange: [{ type: Output }], |
||||
|
expanded: [{ type: Input }], |
||||
|
disabled: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkAccordionItem, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: 'cdk-accordion-item, [cdkAccordionItem]', |
||||
|
exportAs: 'cdkAccordionItem', |
||||
|
providers: [ |
||||
|
// Provide `CDK_ACCORDION` as undefined to prevent nested accordion items from
|
||||
|
// registering to the same accordion.
|
||||
|
{ provide: CDK_ACCORDION, useValue: ɵ0 }, |
||||
|
] |
||||
|
}] |
||||
|
}], function () { return [{ type: CdkAccordion, decorators: [{ |
||||
|
type: Optional |
||||
|
}, { |
||||
|
type: Inject, |
||||
|
args: [CDK_ACCORDION] |
||||
|
}, { |
||||
|
type: SkipSelf |
||||
|
}] }, { type: ɵngcc0.ChangeDetectorRef }, { type: ɵngcc1.UniqueSelectionDispatcher }]; }, { closed: [{ |
||||
|
type: Output |
||||
|
}], opened: [{ |
||||
|
type: Output |
||||
|
}], destroyed: [{ |
||||
|
type: Output |
||||
|
}], expandedChange: [{ |
||||
|
type: Output |
||||
|
}], expanded: [{ |
||||
|
type: Input |
||||
|
}], disabled: [{ |
||||
|
type: Input |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class CdkAccordionModule { |
||||
|
} |
||||
|
CdkAccordionModule.ɵfac = function CdkAccordionModule_Factory(t) { return new (t || CdkAccordionModule)(); }; |
||||
|
CdkAccordionModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: CdkAccordionModule }); |
||||
|
CdkAccordionModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkAccordionModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
exports: [CdkAccordion, CdkAccordionItem], |
||||
|
declarations: [CdkAccordion, CdkAccordionItem] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(CdkAccordionModule, { declarations: [CdkAccordion, CdkAccordionItem], exports: [CdkAccordion, CdkAccordionItem] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { CdkAccordion, CdkAccordionItem, CdkAccordionModule, CDK_ACCORDION as ɵangular_material_src_cdk_accordion_accordion_a }; |
||||
|
|
||||
|
//# sourceMappingURL=accordion.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/accordion.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,185 @@ |
|||||
|
import * as i0 from '@angular/core'; |
||||
|
import { InjectionToken, inject, EventEmitter, Injectable, Optional, Inject, Directive, Output, Input, NgModule } from '@angular/core'; |
||||
|
import { DOCUMENT } from '@angular/common'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Injection token used to inject the document into Directionality. |
||||
|
* This is used so that the value can be faked in tests. |
||||
|
* |
||||
|
* We can't use the real document in tests because changing the real `dir` causes geometry-based |
||||
|
* tests in Safari to fail. |
||||
|
* |
||||
|
* We also can't re-provide the DOCUMENT token from platform-brower because the unit tests |
||||
|
* themselves use things like `querySelector` in test code. |
||||
|
* |
||||
|
* This token is defined in a separate file from Directionality as a workaround for |
||||
|
* https://github.com/angular/angular/issues/22559
|
||||
|
* |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
const DIR_DOCUMENT = new InjectionToken('cdk-dir-doc', { |
||||
|
providedIn: 'root', |
||||
|
factory: DIR_DOCUMENT_FACTORY, |
||||
|
}); |
||||
|
/** @docs-private */ |
||||
|
function DIR_DOCUMENT_FACTORY() { |
||||
|
return inject(DOCUMENT); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* The directionality (LTR / RTL) context for the application (or a subtree of it). |
||||
|
* Exposes the current direction and a stream of direction changes. |
||||
|
*/ |
||||
|
class Directionality { |
||||
|
constructor(_document) { |
||||
|
/** The current 'ltr' or 'rtl' value. */ |
||||
|
this.value = 'ltr'; |
||||
|
/** Stream that emits whenever the 'ltr' / 'rtl' state changes. */ |
||||
|
this.change = new EventEmitter(); |
||||
|
if (_document) { |
||||
|
// TODO: handle 'auto' value -
|
||||
|
// We still need to account for dir="auto".
|
||||
|
// It looks like HTMLElemenet.dir is also "auto" when that's set to the attribute,
|
||||
|
// but getComputedStyle return either "ltr" or "rtl". avoiding getComputedStyle for now
|
||||
|
const bodyDir = _document.body ? _document.body.dir : null; |
||||
|
const htmlDir = _document.documentElement ? _document.documentElement.dir : null; |
||||
|
const value = bodyDir || htmlDir; |
||||
|
this.value = (value === 'ltr' || value === 'rtl') ? value : 'ltr'; |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this.change.complete(); |
||||
|
} |
||||
|
} |
||||
|
Directionality.ɵfac = function Directionality_Factory(t) { return new (t || Directionality)(ɵngcc0.ɵɵinject(DIR_DOCUMENT, 8)); }; |
||||
|
Directionality.ɵprov = i0.ɵɵdefineInjectable({ factory: function Directionality_Factory() { return new Directionality(i0.ɵɵinject(DIR_DOCUMENT, 8)); }, token: Directionality, providedIn: "root" }); |
||||
|
Directionality.ctorParameters = () => [ |
||||
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DIR_DOCUMENT,] }] } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(Directionality, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: undefined, decorators: [{ |
||||
|
type: Optional |
||||
|
}, { |
||||
|
type: Inject, |
||||
|
args: [DIR_DOCUMENT] |
||||
|
}] }]; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Directive to listen for changes of direction of part of the DOM. |
||||
|
* |
||||
|
* Provides itself as Directionality such that descendant directives only need to ever inject |
||||
|
* Directionality to get the closest direction. |
||||
|
*/ |
||||
|
class Dir { |
||||
|
constructor() { |
||||
|
/** Normalized direction that accounts for invalid/unsupported values. */ |
||||
|
this._dir = 'ltr'; |
||||
|
/** Whether the `value` has been set to its initial value. */ |
||||
|
this._isInitialized = false; |
||||
|
/** Event emitted when the direction changes. */ |
||||
|
this.change = new EventEmitter(); |
||||
|
} |
||||
|
/** @docs-private */ |
||||
|
get dir() { return this._dir; } |
||||
|
set dir(value) { |
||||
|
const old = this._dir; |
||||
|
const normalizedValue = value ? value.toLowerCase() : value; |
||||
|
this._rawDir = value; |
||||
|
this._dir = (normalizedValue === 'ltr' || normalizedValue === 'rtl') ? normalizedValue : 'ltr'; |
||||
|
if (old !== this._dir && this._isInitialized) { |
||||
|
this.change.emit(this._dir); |
||||
|
} |
||||
|
} |
||||
|
/** Current layout direction of the element. */ |
||||
|
get value() { return this.dir; } |
||||
|
/** Initialize once default value has been set. */ |
||||
|
ngAfterContentInit() { |
||||
|
this._isInitialized = true; |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this.change.complete(); |
||||
|
} |
||||
|
} |
||||
|
Dir.ɵfac = function Dir_Factory(t) { return new (t || Dir)(); }; |
||||
|
Dir.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: Dir, selectors: [["", "dir", ""]], hostVars: 1, hostBindings: function Dir_HostBindings(rf, ctx) { if (rf & 2) { |
||||
|
ɵngcc0.ɵɵattribute("dir", ctx._rawDir); |
||||
|
} }, inputs: { dir: "dir" }, outputs: { change: "dirChange" }, exportAs: ["dir"], features: [ɵngcc0.ɵɵProvidersFeature([{ provide: Directionality, useExisting: Dir }])] }); |
||||
|
Dir.propDecorators = { |
||||
|
change: [{ type: Output, args: ['dirChange',] }], |
||||
|
dir: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(Dir, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[dir]', |
||||
|
providers: [{ provide: Directionality, useExisting: Dir }], |
||||
|
host: { '[attr.dir]': '_rawDir' }, |
||||
|
exportAs: 'dir' |
||||
|
}] |
||||
|
}], function () { return []; }, { change: [{ |
||||
|
type: Output, |
||||
|
args: ['dirChange'] |
||||
|
}], dir: [{ |
||||
|
type: Input |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class BidiModule { |
||||
|
} |
||||
|
BidiModule.ɵfac = function BidiModule_Factory(t) { return new (t || BidiModule)(); }; |
||||
|
BidiModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: BidiModule }); |
||||
|
BidiModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(BidiModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
exports: [Dir], |
||||
|
declarations: [Dir] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(BidiModule, { declarations: [Dir], exports: [Dir] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { BidiModule, DIR_DOCUMENT, Dir, Directionality, DIR_DOCUMENT_FACTORY as ɵangular_material_src_cdk_bidi_bidi_a }; |
||||
|
|
||||
|
//# sourceMappingURL=bidi.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/bidi.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,274 @@ |
|||||
|
import * as i1 from '@angular/common'; |
||||
|
import { DOCUMENT } from '@angular/common'; |
||||
|
import * as i0 from '@angular/core'; |
||||
|
import { Injectable, Inject, InjectionToken, EventEmitter, Directive, NgZone, Optional, Input, Output, NgModule } from '@angular/core'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A pending copy-to-clipboard operation. |
||||
|
* |
||||
|
* The implementation of copying text to the clipboard modifies the DOM and |
||||
|
* forces a relayout. This relayout can take too long if the string is large, |
||||
|
* causing the execCommand('copy') to happen too long after the user clicked. |
||||
|
* This results in the browser refusing to copy. This object lets the |
||||
|
* relayout happen in a separate tick from copying by providing a copy function |
||||
|
* that can be called later. |
||||
|
* |
||||
|
* Destroy must be called when no longer in use, regardless of whether `copy` is |
||||
|
* called. |
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
class PendingCopy { |
||||
|
constructor(text, _document) { |
||||
|
this._document = _document; |
||||
|
const textarea = this._textarea = this._document.createElement('textarea'); |
||||
|
const styles = textarea.style; |
||||
|
// Hide the element for display and accessibility. Set a fixed position so the page layout
|
||||
|
// isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
|
||||
|
// for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
|
||||
|
styles.position = 'fixed'; |
||||
|
styles.top = styles.opacity = '0'; |
||||
|
styles.left = '-999em'; |
||||
|
textarea.setAttribute('aria-hidden', 'true'); |
||||
|
textarea.value = text; |
||||
|
this._document.body.appendChild(textarea); |
||||
|
} |
||||
|
/** Finishes copying the text. */ |
||||
|
copy() { |
||||
|
const textarea = this._textarea; |
||||
|
let successful = false; |
||||
|
try { // Older browsers could throw if copy is not supported.
|
||||
|
if (textarea) { |
||||
|
const currentFocus = this._document.activeElement; |
||||
|
textarea.select(); |
||||
|
textarea.setSelectionRange(0, textarea.value.length); |
||||
|
successful = this._document.execCommand('copy'); |
||||
|
if (currentFocus) { |
||||
|
currentFocus.focus(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
catch (_a) { |
||||
|
// Discard error.
|
||||
|
// Initial setting of {@code successful} will represent failure here.
|
||||
|
} |
||||
|
return successful; |
||||
|
} |
||||
|
/** Cleans up DOM changes used to perform the copy operation. */ |
||||
|
destroy() { |
||||
|
const textarea = this._textarea; |
||||
|
if (textarea) { |
||||
|
if (textarea.parentNode) { |
||||
|
textarea.parentNode.removeChild(textarea); |
||||
|
} |
||||
|
this._textarea = undefined; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A service for copying text to the clipboard. |
||||
|
*/ |
||||
|
class Clipboard { |
||||
|
constructor(document) { |
||||
|
this._document = document; |
||||
|
} |
||||
|
/** |
||||
|
* Copies the provided text into the user's clipboard. |
||||
|
* |
||||
|
* @param text The string to copy. |
||||
|
* @returns Whether the operation was successful. |
||||
|
*/ |
||||
|
copy(text) { |
||||
|
const pendingCopy = this.beginCopy(text); |
||||
|
const successful = pendingCopy.copy(); |
||||
|
pendingCopy.destroy(); |
||||
|
return successful; |
||||
|
} |
||||
|
/** |
||||
|
* Prepares a string to be copied later. This is useful for large strings |
||||
|
* which take too long to successfully render and be copied in the same tick. |
||||
|
* |
||||
|
* The caller must call `destroy` on the returned `PendingCopy`. |
||||
|
* |
||||
|
* @param text The string to copy. |
||||
|
* @returns the pending copy operation. |
||||
|
*/ |
||||
|
beginCopy(text) { |
||||
|
return new PendingCopy(text, this._document); |
||||
|
} |
||||
|
} |
||||
|
Clipboard.ɵfac = function Clipboard_Factory(t) { return new (t || Clipboard)(ɵngcc0.ɵɵinject(DOCUMENT)); }; |
||||
|
Clipboard.ɵprov = i0.ɵɵdefineInjectable({ factory: function Clipboard_Factory() { return new Clipboard(i0.ɵɵinject(i1.DOCUMENT)); }, token: Clipboard, providedIn: "root" }); |
||||
|
Clipboard.ctorParameters = () => [ |
||||
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(Clipboard, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: undefined, decorators: [{ |
||||
|
type: Inject, |
||||
|
args: [DOCUMENT] |
||||
|
}] }]; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */ |
||||
|
const CDK_COPY_TO_CLIPBOARD_CONFIG = new InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG'); |
||||
|
/** |
||||
|
* @deprecated Use `CDK_COPY_TO_CLIPBOARD_CONFIG` instead. |
||||
|
* @breaking-change 13.0.0 |
||||
|
*/ |
||||
|
const CKD_COPY_TO_CLIPBOARD_CONFIG = CDK_COPY_TO_CLIPBOARD_CONFIG; |
||||
|
/** |
||||
|
* Provides behavior for a button that when clicked copies content into user's |
||||
|
* clipboard. |
||||
|
*/ |
||||
|
class CdkCopyToClipboard { |
||||
|
constructor(_clipboard, _ngZone, config) { |
||||
|
this._clipboard = _clipboard; |
||||
|
this._ngZone = _ngZone; |
||||
|
/** Content to be copied. */ |
||||
|
this.text = ''; |
||||
|
/** |
||||
|
* How many times to attempt to copy the text. This may be necessary for longer text, because |
||||
|
* the browser needs time to fill an intermediate textarea element and copy the content. |
||||
|
*/ |
||||
|
this.attempts = 1; |
||||
|
/** |
||||
|
* Emits when some text is copied to the clipboard. The |
||||
|
* emitted value indicates whether copying was successful. |
||||
|
*/ |
||||
|
this.copied = new EventEmitter(); |
||||
|
/** Copies that are currently being attempted. */ |
||||
|
this._pending = new Set(); |
||||
|
if (config && config.attempts != null) { |
||||
|
this.attempts = config.attempts; |
||||
|
} |
||||
|
} |
||||
|
/** Copies the current text to the clipboard. */ |
||||
|
copy(attempts = this.attempts) { |
||||
|
if (attempts > 1) { |
||||
|
let remainingAttempts = attempts; |
||||
|
const pending = this._clipboard.beginCopy(this.text); |
||||
|
this._pending.add(pending); |
||||
|
const attempt = () => { |
||||
|
const successful = pending.copy(); |
||||
|
if (!successful && --remainingAttempts && !this._destroyed) { |
||||
|
// We use 1 for the timeout since it's more predictable when flushing in unit tests.
|
||||
|
this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1)); |
||||
|
} |
||||
|
else { |
||||
|
this._currentTimeout = null; |
||||
|
this._pending.delete(pending); |
||||
|
pending.destroy(); |
||||
|
this.copied.emit(successful); |
||||
|
} |
||||
|
}; |
||||
|
attempt(); |
||||
|
} |
||||
|
else { |
||||
|
this.copied.emit(this._clipboard.copy(this.text)); |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
if (this._currentTimeout) { |
||||
|
clearTimeout(this._currentTimeout); |
||||
|
} |
||||
|
this._pending.forEach(copy => copy.destroy()); |
||||
|
this._pending.clear(); |
||||
|
this._destroyed = true; |
||||
|
} |
||||
|
} |
||||
|
CdkCopyToClipboard.ɵfac = function CdkCopyToClipboard_Factory(t) { return new (t || CdkCopyToClipboard)(ɵngcc0.ɵɵdirectiveInject(Clipboard), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.NgZone), ɵngcc0.ɵɵdirectiveInject(CKD_COPY_TO_CLIPBOARD_CONFIG, 8)); }; |
||||
|
CdkCopyToClipboard.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkCopyToClipboard, selectors: [["", "cdkCopyToClipboard", ""]], hostBindings: function CdkCopyToClipboard_HostBindings(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵlistener("click", function CdkCopyToClipboard_click_HostBindingHandler() { return ctx.copy(); }); |
||||
|
} }, inputs: { text: ["cdkCopyToClipboard", "text"], attempts: ["cdkCopyToClipboardAttempts", "attempts"] }, outputs: { copied: "cdkCopyToClipboardCopied" } }); |
||||
|
CdkCopyToClipboard.ctorParameters = () => [ |
||||
|
{ type: Clipboard }, |
||||
|
{ type: NgZone }, |
||||
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [CKD_COPY_TO_CLIPBOARD_CONFIG,] }] } |
||||
|
]; |
||||
|
CdkCopyToClipboard.propDecorators = { |
||||
|
text: [{ type: Input, args: ['cdkCopyToClipboard',] }], |
||||
|
attempts: [{ type: Input, args: ['cdkCopyToClipboardAttempts',] }], |
||||
|
copied: [{ type: Output, args: ['cdkCopyToClipboardCopied',] }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkCopyToClipboard, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkCopyToClipboard]', |
||||
|
host: { |
||||
|
'(click)': 'copy()' |
||||
|
} |
||||
|
}] |
||||
|
}], function () { return [{ type: Clipboard }, { type: ɵngcc0.NgZone }, { type: undefined, decorators: [{ |
||||
|
type: Optional |
||||
|
}, { |
||||
|
type: Inject, |
||||
|
args: [CKD_COPY_TO_CLIPBOARD_CONFIG] |
||||
|
}] }]; }, { text: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkCopyToClipboard'] |
||||
|
}], attempts: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkCopyToClipboardAttempts'] |
||||
|
}], copied: [{ |
||||
|
type: Output, |
||||
|
args: ['cdkCopyToClipboardCopied'] |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class ClipboardModule { |
||||
|
} |
||||
|
ClipboardModule.ɵfac = function ClipboardModule_Factory(t) { return new (t || ClipboardModule)(); }; |
||||
|
ClipboardModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: ClipboardModule }); |
||||
|
ClipboardModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(ClipboardModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
declarations: [CdkCopyToClipboard], |
||||
|
exports: [CdkCopyToClipboard] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(ClipboardModule, { declarations: [CdkCopyToClipboard], exports: [CdkCopyToClipboard] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { CDK_COPY_TO_CLIPBOARD_CONFIG, CKD_COPY_TO_CLIPBOARD_CONFIG, CdkCopyToClipboard, Clipboard, ClipboardModule, PendingCopy }; |
||||
|
|
||||
|
//# sourceMappingURL=clipboard.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/clipboard.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,472 @@ |
|||||
|
import { isObservable, of, Subject } from 'rxjs'; |
||||
|
import * as i0 from '@angular/core'; |
||||
|
import { Injectable, InjectionToken } from '@angular/core'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
class DataSource { |
||||
|
} |
||||
|
/** Checks whether an object is a data source. */ |
||||
|
function isDataSource(value) { |
||||
|
// Check if the value is a DataSource by observing if it has a connect function. Cannot
|
||||
|
// be checked as an `instanceof DataSource` since people could create their own sources
|
||||
|
// that match the interface, but don't extend DataSource.
|
||||
|
return value && typeof value.connect === 'function'; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** DataSource wrapper for a native array. */ |
||||
|
class ArrayDataSource extends DataSource { |
||||
|
constructor(_data) { |
||||
|
super(); |
||||
|
this._data = _data; |
||||
|
} |
||||
|
connect() { |
||||
|
return isObservable(this._data) ? this._data : of(this._data); |
||||
|
} |
||||
|
disconnect() { } |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A repeater that destroys views when they are removed from a |
||||
|
* {@link ViewContainerRef}. When new items are inserted into the container, |
||||
|
* the repeater will always construct a new embedded view for each item. |
||||
|
* |
||||
|
* @template T The type for the embedded view's $implicit property. |
||||
|
* @template R The type for the item in each IterableDiffer change record. |
||||
|
* @template C The type for the context passed to each embedded view. |
||||
|
*/ |
||||
|
class _DisposeViewRepeaterStrategy { |
||||
|
applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { |
||||
|
changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { |
||||
|
let view; |
||||
|
let operation; |
||||
|
if (record.previousIndex == null) { |
||||
|
const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex); |
||||
|
view = viewContainerRef.createEmbeddedView(insertContext.templateRef, insertContext.context, insertContext.index); |
||||
|
operation = 1 /* INSERTED */; |
||||
|
} |
||||
|
else if (currentIndex == null) { |
||||
|
viewContainerRef.remove(adjustedPreviousIndex); |
||||
|
operation = 3 /* REMOVED */; |
||||
|
} |
||||
|
else { |
||||
|
view = viewContainerRef.get(adjustedPreviousIndex); |
||||
|
viewContainerRef.move(view, currentIndex); |
||||
|
operation = 2 /* MOVED */; |
||||
|
} |
||||
|
if (itemViewChanged) { |
||||
|
itemViewChanged({ |
||||
|
context: view === null || view === void 0 ? void 0 : view.context, |
||||
|
operation, |
||||
|
record, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
detach() { |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A repeater that caches views when they are removed from a |
||||
|
* {@link ViewContainerRef}. When new items are inserted into the container, |
||||
|
* the repeater will reuse one of the cached views instead of creating a new |
||||
|
* embedded view. Recycling cached views reduces the quantity of expensive DOM |
||||
|
* inserts. |
||||
|
* |
||||
|
* @template T The type for the embedded view's $implicit property. |
||||
|
* @template R The type for the item in each IterableDiffer change record. |
||||
|
* @template C The type for the context passed to each embedded view. |
||||
|
*/ |
||||
|
class _RecycleViewRepeaterStrategy { |
||||
|
constructor() { |
||||
|
/** |
||||
|
* The size of the cache used to store unused views. |
||||
|
* Setting the cache size to `0` will disable caching. Defaults to 20 views. |
||||
|
*/ |
||||
|
this.viewCacheSize = 20; |
||||
|
/** |
||||
|
* View cache that stores embedded view instances that have been previously stamped out, |
||||
|
* but don't are not currently rendered. The view repeater will reuse these views rather than |
||||
|
* creating brand new ones. |
||||
|
* |
||||
|
* TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance. |
||||
|
*/ |
||||
|
this._viewCache = []; |
||||
|
} |
||||
|
/** Apply changes to the DOM. */ |
||||
|
applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { |
||||
|
// Rearrange the views to put them in the right location.
|
||||
|
changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { |
||||
|
let view; |
||||
|
let operation; |
||||
|
if (record.previousIndex == null) { // Item added.
|
||||
|
const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex); |
||||
|
view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record)); |
||||
|
operation = view ? 1 /* INSERTED */ : 0 /* REPLACED */; |
||||
|
} |
||||
|
else if (currentIndex == null) { // Item removed.
|
||||
|
this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef); |
||||
|
operation = 3 /* REMOVED */; |
||||
|
} |
||||
|
else { // Item moved.
|
||||
|
view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record)); |
||||
|
operation = 2 /* MOVED */; |
||||
|
} |
||||
|
if (itemViewChanged) { |
||||
|
itemViewChanged({ |
||||
|
context: view === null || view === void 0 ? void 0 : view.context, |
||||
|
operation, |
||||
|
record, |
||||
|
}); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
detach() { |
||||
|
for (const view of this._viewCache) { |
||||
|
view.destroy(); |
||||
|
} |
||||
|
this._viewCache = []; |
||||
|
} |
||||
|
/** |
||||
|
* Inserts a view for a new item, either from the cache or by creating a new |
||||
|
* one. Returns `undefined` if the item was inserted into a cached view. |
||||
|
*/ |
||||
|
_insertView(viewArgsFactory, currentIndex, viewContainerRef, value) { |
||||
|
const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef); |
||||
|
if (cachedView) { |
||||
|
cachedView.context.$implicit = value; |
||||
|
return undefined; |
||||
|
} |
||||
|
const viewArgs = viewArgsFactory(); |
||||
|
return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index); |
||||
|
} |
||||
|
/** Detaches the view at the given index and inserts into the view cache. */ |
||||
|
_detachAndCacheView(index, viewContainerRef) { |
||||
|
const detachedView = viewContainerRef.detach(index); |
||||
|
this._maybeCacheView(detachedView, viewContainerRef); |
||||
|
} |
||||
|
/** Moves view at the previous index to the current index. */ |
||||
|
_moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) { |
||||
|
const view = viewContainerRef.get(adjustedPreviousIndex); |
||||
|
viewContainerRef.move(view, currentIndex); |
||||
|
view.context.$implicit = value; |
||||
|
return view; |
||||
|
} |
||||
|
/** |
||||
|
* Cache the given detached view. If the cache is full, the view will be |
||||
|
* destroyed. |
||||
|
*/ |
||||
|
_maybeCacheView(view, viewContainerRef) { |
||||
|
if (this._viewCache.length < this.viewCacheSize) { |
||||
|
this._viewCache.push(view); |
||||
|
} |
||||
|
else { |
||||
|
const index = viewContainerRef.indexOf(view); |
||||
|
// The host component could remove views from the container outside of
|
||||
|
// the view repeater. It's unlikely this will occur, but just in case,
|
||||
|
// destroy the view on its own, otherwise destroy it through the
|
||||
|
// container to ensure that all the references are removed.
|
||||
|
if (index === -1) { |
||||
|
view.destroy(); |
||||
|
} |
||||
|
else { |
||||
|
viewContainerRef.remove(index); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** Inserts a recycled view from the cache at the given index. */ |
||||
|
_insertViewFromCache(index, viewContainerRef) { |
||||
|
const cachedView = this._viewCache.pop(); |
||||
|
if (cachedView) { |
||||
|
viewContainerRef.insert(cachedView, index); |
||||
|
} |
||||
|
return cachedView || null; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Class to be used to power selecting one or more options from a list. |
||||
|
*/ |
||||
|
class SelectionModel { |
||||
|
constructor(_multiple = false, initiallySelectedValues, _emitChanges = true) { |
||||
|
this._multiple = _multiple; |
||||
|
this._emitChanges = _emitChanges; |
||||
|
/** Currently-selected values. */ |
||||
|
this._selection = new Set(); |
||||
|
/** Keeps track of the deselected options that haven't been emitted by the change event. */ |
||||
|
this._deselectedToEmit = []; |
||||
|
/** Keeps track of the selected options that haven't been emitted by the change event. */ |
||||
|
this._selectedToEmit = []; |
||||
|
/** Event emitted when the value has changed. */ |
||||
|
this.changed = new Subject(); |
||||
|
if (initiallySelectedValues && initiallySelectedValues.length) { |
||||
|
if (_multiple) { |
||||
|
initiallySelectedValues.forEach(value => this._markSelected(value)); |
||||
|
} |
||||
|
else { |
||||
|
this._markSelected(initiallySelectedValues[0]); |
||||
|
} |
||||
|
// Clear the array in order to avoid firing the change event for preselected values.
|
||||
|
this._selectedToEmit.length = 0; |
||||
|
} |
||||
|
} |
||||
|
/** Selected values. */ |
||||
|
get selected() { |
||||
|
if (!this._selected) { |
||||
|
this._selected = Array.from(this._selection.values()); |
||||
|
} |
||||
|
return this._selected; |
||||
|
} |
||||
|
/** |
||||
|
* Selects a value or an array of values. |
||||
|
*/ |
||||
|
select(...values) { |
||||
|
this._verifyValueAssignment(values); |
||||
|
values.forEach(value => this._markSelected(value)); |
||||
|
this._emitChangeEvent(); |
||||
|
} |
||||
|
/** |
||||
|
* Deselects a value or an array of values. |
||||
|
*/ |
||||
|
deselect(...values) { |
||||
|
this._verifyValueAssignment(values); |
||||
|
values.forEach(value => this._unmarkSelected(value)); |
||||
|
this._emitChangeEvent(); |
||||
|
} |
||||
|
/** |
||||
|
* Toggles a value between selected and deselected. |
||||
|
*/ |
||||
|
toggle(value) { |
||||
|
this.isSelected(value) ? this.deselect(value) : this.select(value); |
||||
|
} |
||||
|
/** |
||||
|
* Clears all of the selected values. |
||||
|
*/ |
||||
|
clear() { |
||||
|
this._unmarkAll(); |
||||
|
this._emitChangeEvent(); |
||||
|
} |
||||
|
/** |
||||
|
* Determines whether a value is selected. |
||||
|
*/ |
||||
|
isSelected(value) { |
||||
|
return this._selection.has(value); |
||||
|
} |
||||
|
/** |
||||
|
* Determines whether the model does not have a value. |
||||
|
*/ |
||||
|
isEmpty() { |
||||
|
return this._selection.size === 0; |
||||
|
} |
||||
|
/** |
||||
|
* Determines whether the model has a value. |
||||
|
*/ |
||||
|
hasValue() { |
||||
|
return !this.isEmpty(); |
||||
|
} |
||||
|
/** |
||||
|
* Sorts the selected values based on a predicate function. |
||||
|
*/ |
||||
|
sort(predicate) { |
||||
|
if (this._multiple && this.selected) { |
||||
|
this._selected.sort(predicate); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Gets whether multiple values can be selected. |
||||
|
*/ |
||||
|
isMultipleSelection() { |
||||
|
return this._multiple; |
||||
|
} |
||||
|
/** Emits a change event and clears the records of selected and deselected values. */ |
||||
|
_emitChangeEvent() { |
||||
|
// Clear the selected values so they can be re-cached.
|
||||
|
this._selected = null; |
||||
|
if (this._selectedToEmit.length || this._deselectedToEmit.length) { |
||||
|
this.changed.next({ |
||||
|
source: this, |
||||
|
added: this._selectedToEmit, |
||||
|
removed: this._deselectedToEmit |
||||
|
}); |
||||
|
this._deselectedToEmit = []; |
||||
|
this._selectedToEmit = []; |
||||
|
} |
||||
|
} |
||||
|
/** Selects a value. */ |
||||
|
_markSelected(value) { |
||||
|
if (!this.isSelected(value)) { |
||||
|
if (!this._multiple) { |
||||
|
this._unmarkAll(); |
||||
|
} |
||||
|
this._selection.add(value); |
||||
|
if (this._emitChanges) { |
||||
|
this._selectedToEmit.push(value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** Deselects a value. */ |
||||
|
_unmarkSelected(value) { |
||||
|
if (this.isSelected(value)) { |
||||
|
this._selection.delete(value); |
||||
|
if (this._emitChanges) { |
||||
|
this._deselectedToEmit.push(value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** Clears out the selected values. */ |
||||
|
_unmarkAll() { |
||||
|
if (!this.isEmpty()) { |
||||
|
this._selection.forEach(value => this._unmarkSelected(value)); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Verifies the value assignment and throws an error if the specified value array is |
||||
|
* including multiple values while the selection model is not supporting multiple values. |
||||
|
*/ |
||||
|
_verifyValueAssignment(values) { |
||||
|
if (values.length > 1 && !this._multiple && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw getMultipleValuesInSingleSelectionError(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Returns an error that reports that multiple values are passed into a selection model |
||||
|
* with a single value. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function getMultipleValuesInSingleSelectionError() { |
||||
|
return Error('Cannot pass multiple values into SelectionModel with single-value mode.'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Class to coordinate unique selection based on name. |
||||
|
* Intended to be consumed as an Angular service. |
||||
|
* This service is needed because native radio change events are only fired on the item currently |
||||
|
* being selected, and we still need to uncheck the previous selection. |
||||
|
* |
||||
|
* This service does not *store* any IDs and names because they may change at any time, so it is |
||||
|
* less error-prone if they are simply passed through when the events occur. |
||||
|
*/ |
||||
|
class UniqueSelectionDispatcher { |
||||
|
constructor() { |
||||
|
this._listeners = []; |
||||
|
} |
||||
|
/** |
||||
|
* Notify other items that selection for the given name has been set. |
||||
|
* @param id ID of the item. |
||||
|
* @param name Name of the item. |
||||
|
*/ |
||||
|
notify(id, name) { |
||||
|
for (let listener of this._listeners) { |
||||
|
listener(id, name); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Listen for future changes to item selection. |
||||
|
* @return Function used to deregister listener |
||||
|
*/ |
||||
|
listen(listener) { |
||||
|
this._listeners.push(listener); |
||||
|
return () => { |
||||
|
this._listeners = this._listeners.filter((registered) => { |
||||
|
return listener !== registered; |
||||
|
}); |
||||
|
}; |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._listeners = []; |
||||
|
} |
||||
|
} |
||||
|
UniqueSelectionDispatcher.ɵfac = function UniqueSelectionDispatcher_Factory(t) { return new (t || UniqueSelectionDispatcher)(); }; |
||||
|
UniqueSelectionDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function UniqueSelectionDispatcher_Factory() { return new UniqueSelectionDispatcher(); }, token: UniqueSelectionDispatcher, providedIn: "root" }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(UniqueSelectionDispatcher, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return []; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
const _VIEW_REPEATER_STRATEGY = new InjectionToken('_ViewRepeater'); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { ArrayDataSource, DataSource, SelectionModel, UniqueSelectionDispatcher, _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY, getMultipleValuesInSingleSelectionError, isDataSource }; |
||||
|
|
||||
|
//# sourceMappingURL=collections.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/collections.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3801
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/drag-drop.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/drag-drop.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,160 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
const MAC_ENTER = 3; |
||||
|
const BACKSPACE = 8; |
||||
|
const TAB = 9; |
||||
|
const NUM_CENTER = 12; |
||||
|
const ENTER = 13; |
||||
|
const SHIFT = 16; |
||||
|
const CONTROL = 17; |
||||
|
const ALT = 18; |
||||
|
const PAUSE = 19; |
||||
|
const CAPS_LOCK = 20; |
||||
|
const ESCAPE = 27; |
||||
|
const SPACE = 32; |
||||
|
const PAGE_UP = 33; |
||||
|
const PAGE_DOWN = 34; |
||||
|
const END = 35; |
||||
|
const HOME = 36; |
||||
|
const LEFT_ARROW = 37; |
||||
|
const UP_ARROW = 38; |
||||
|
const RIGHT_ARROW = 39; |
||||
|
const DOWN_ARROW = 40; |
||||
|
const PLUS_SIGN = 43; |
||||
|
const PRINT_SCREEN = 44; |
||||
|
const INSERT = 45; |
||||
|
const DELETE = 46; |
||||
|
const ZERO = 48; |
||||
|
const ONE = 49; |
||||
|
const TWO = 50; |
||||
|
const THREE = 51; |
||||
|
const FOUR = 52; |
||||
|
const FIVE = 53; |
||||
|
const SIX = 54; |
||||
|
const SEVEN = 55; |
||||
|
const EIGHT = 56; |
||||
|
const NINE = 57; |
||||
|
const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186
|
||||
|
const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187
|
||||
|
const QUESTION_MARK = 63; |
||||
|
const AT_SIGN = 64; |
||||
|
const A = 65; |
||||
|
const B = 66; |
||||
|
const C = 67; |
||||
|
const D = 68; |
||||
|
const E = 69; |
||||
|
const F = 70; |
||||
|
const G = 71; |
||||
|
const H = 72; |
||||
|
const I = 73; |
||||
|
const J = 74; |
||||
|
const K = 75; |
||||
|
const L = 76; |
||||
|
const M = 77; |
||||
|
const N = 78; |
||||
|
const O = 79; |
||||
|
const P = 80; |
||||
|
const Q = 81; |
||||
|
const R = 82; |
||||
|
const S = 83; |
||||
|
const T = 84; |
||||
|
const U = 85; |
||||
|
const V = 86; |
||||
|
const W = 87; |
||||
|
const X = 88; |
||||
|
const Y = 89; |
||||
|
const Z = 90; |
||||
|
const META = 91; // WIN_KEY_LEFT
|
||||
|
const MAC_WK_CMD_LEFT = 91; |
||||
|
const MAC_WK_CMD_RIGHT = 93; |
||||
|
const CONTEXT_MENU = 93; |
||||
|
const NUMPAD_ZERO = 96; |
||||
|
const NUMPAD_ONE = 97; |
||||
|
const NUMPAD_TWO = 98; |
||||
|
const NUMPAD_THREE = 99; |
||||
|
const NUMPAD_FOUR = 100; |
||||
|
const NUMPAD_FIVE = 101; |
||||
|
const NUMPAD_SIX = 102; |
||||
|
const NUMPAD_SEVEN = 103; |
||||
|
const NUMPAD_EIGHT = 104; |
||||
|
const NUMPAD_NINE = 105; |
||||
|
const NUMPAD_MULTIPLY = 106; |
||||
|
const NUMPAD_PLUS = 107; |
||||
|
const NUMPAD_MINUS = 109; |
||||
|
const NUMPAD_PERIOD = 110; |
||||
|
const NUMPAD_DIVIDE = 111; |
||||
|
const F1 = 112; |
||||
|
const F2 = 113; |
||||
|
const F3 = 114; |
||||
|
const F4 = 115; |
||||
|
const F5 = 116; |
||||
|
const F6 = 117; |
||||
|
const F7 = 118; |
||||
|
const F8 = 119; |
||||
|
const F9 = 120; |
||||
|
const F10 = 121; |
||||
|
const F11 = 122; |
||||
|
const F12 = 123; |
||||
|
const NUM_LOCK = 144; |
||||
|
const SCROLL_LOCK = 145; |
||||
|
const FIRST_MEDIA = 166; |
||||
|
const FF_MINUS = 173; |
||||
|
const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE
|
||||
|
const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN
|
||||
|
const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP
|
||||
|
const FF_MUTE = 181; |
||||
|
const FF_VOLUME_DOWN = 182; |
||||
|
const LAST_MEDIA = 183; |
||||
|
const FF_VOLUME_UP = 183; |
||||
|
const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON
|
||||
|
const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS
|
||||
|
const COMMA = 188; |
||||
|
const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS
|
||||
|
const PERIOD = 190; |
||||
|
const SLASH = 191; |
||||
|
const APOSTROPHE = 192; |
||||
|
const TILDE = 192; |
||||
|
const OPEN_SQUARE_BRACKET = 219; |
||||
|
const BACKSLASH = 220; |
||||
|
const CLOSE_SQUARE_BRACKET = 221; |
||||
|
const SINGLE_QUOTE = 222; |
||||
|
const MAC_META = 224; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Checks whether a modifier key is pressed. |
||||
|
* @param event Event to be checked. |
||||
|
*/ |
||||
|
function hasModifierKey(event, ...modifiers) { |
||||
|
if (modifiers.length) { |
||||
|
return modifiers.some(modifier => event[modifier]); |
||||
|
} |
||||
|
return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { A, ALT, APOSTROPHE, AT_SIGN, B, BACKSLASH, BACKSPACE, C, CAPS_LOCK, CLOSE_SQUARE_BRACKET, COMMA, CONTEXT_MENU, CONTROL, D, DASH, DELETE, DOWN_ARROW, E, EIGHT, END, ENTER, EQUALS, ESCAPE, F, F1, F10, F11, F12, F2, F3, F4, F5, F6, F7, F8, F9, FF_EQUALS, FF_MINUS, FF_MUTE, FF_SEMICOLON, FF_VOLUME_DOWN, FF_VOLUME_UP, FIRST_MEDIA, FIVE, FOUR, G, H, HOME, I, INSERT, J, K, L, LAST_MEDIA, LEFT_ARROW, M, MAC_ENTER, MAC_META, MAC_WK_CMD_LEFT, MAC_WK_CMD_RIGHT, META, MUTE, N, NINE, NUMPAD_DIVIDE, NUMPAD_EIGHT, NUMPAD_FIVE, NUMPAD_FOUR, NUMPAD_MINUS, NUMPAD_MULTIPLY, NUMPAD_NINE, NUMPAD_ONE, NUMPAD_PERIOD, NUMPAD_PLUS, NUMPAD_SEVEN, NUMPAD_SIX, NUMPAD_THREE, NUMPAD_TWO, NUMPAD_ZERO, NUM_CENTER, NUM_LOCK, O, ONE, OPEN_SQUARE_BRACKET, P, PAGE_DOWN, PAGE_UP, PAUSE, PERIOD, PLUS_SIGN, PRINT_SCREEN, Q, QUESTION_MARK, R, RIGHT_ARROW, S, SCROLL_LOCK, SEMICOLON, SEVEN, SHIFT, SINGLE_QUOTE, SIX, SLASH, SPACE, T, TAB, THREE, TILDE, TWO, U, UP_ARROW, V, VOLUME_DOWN, VOLUME_UP, W, X, Y, Z, ZERO, hasModifierKey }; |
||||
|
|
||||
|
//# sourceMappingURL=keycodes.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/keycodes.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,255 @@ |
|||||
|
import * as i0 from '@angular/core'; |
||||
|
import { NgModule, Injectable, NgZone } from '@angular/core'; |
||||
|
import { coerceArray } from '@angular/cdk/coercion'; |
||||
|
import { Subject, combineLatest, concat, Observable } from 'rxjs'; |
||||
|
import { take, skip, debounceTime, map, startWith, takeUntil } from 'rxjs/operators'; |
||||
|
import * as i1 from '@angular/cdk/platform'; |
||||
|
import { Platform } from '@angular/cdk/platform'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
import * as ɵngcc1 from '@angular/cdk/platform'; |
||||
|
class LayoutModule { |
||||
|
} |
||||
|
LayoutModule.ɵfac = function LayoutModule_Factory(t) { return new (t || LayoutModule)(); }; |
||||
|
LayoutModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: LayoutModule }); |
||||
|
LayoutModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(LayoutModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{}] |
||||
|
}], null, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Global registry for all dynamically-created, injected media queries. */ |
||||
|
const mediaQueriesForWebkitCompatibility = new Set(); |
||||
|
/** Style tag that holds all of the dynamically-created media queries. */ |
||||
|
let mediaQueryStyleNode; |
||||
|
/** A utility for calling matchMedia queries. */ |
||||
|
class MediaMatcher { |
||||
|
constructor(_platform) { |
||||
|
this._platform = _platform; |
||||
|
this._matchMedia = this._platform.isBrowser && window.matchMedia ? |
||||
|
// matchMedia is bound to the window scope intentionally as it is an illegal invocation to
|
||||
|
// call it from a different scope.
|
||||
|
window.matchMedia.bind(window) : |
||||
|
noopMatchMedia; |
||||
|
} |
||||
|
/** |
||||
|
* Evaluates the given media query and returns the native MediaQueryList from which results |
||||
|
* can be retrieved. |
||||
|
* Confirms the layout engine will trigger for the selector query provided and returns the |
||||
|
* MediaQueryList for the query provided. |
||||
|
*/ |
||||
|
matchMedia(query) { |
||||
|
if (this._platform.WEBKIT || this._platform.BLINK) { |
||||
|
createEmptyStyleRule(query); |
||||
|
} |
||||
|
return this._matchMedia(query); |
||||
|
} |
||||
|
} |
||||
|
MediaMatcher.ɵfac = function MediaMatcher_Factory(t) { return new (t || MediaMatcher)(ɵngcc0.ɵɵinject(ɵngcc1.Platform)); }; |
||||
|
MediaMatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function MediaMatcher_Factory() { return new MediaMatcher(i0.ɵɵinject(i1.Platform)); }, token: MediaMatcher, providedIn: "root" }); |
||||
|
MediaMatcher.ctorParameters = () => [ |
||||
|
{ type: Platform } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(MediaMatcher, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: ɵngcc1.Platform }]; }, null); })(); |
||||
|
/** |
||||
|
* Creates an empty stylesheet that is used to work around browser inconsistencies related to |
||||
|
* `matchMedia`. At the time of writing, it handles the following cases: |
||||
|
* 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia` |
||||
|
* to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration. |
||||
|
* 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules |
||||
|
* inside the `@media` match existing elements on the page. We work around it by having one rule |
||||
|
* targeting the `body`. See https://github.com/angular/components/issues/23546.
|
||||
|
*/ |
||||
|
function createEmptyStyleRule(query) { |
||||
|
if (mediaQueriesForWebkitCompatibility.has(query)) { |
||||
|
return; |
||||
|
} |
||||
|
try { |
||||
|
if (!mediaQueryStyleNode) { |
||||
|
mediaQueryStyleNode = document.createElement('style'); |
||||
|
mediaQueryStyleNode.setAttribute('type', 'text/css'); |
||||
|
document.head.appendChild(mediaQueryStyleNode); |
||||
|
} |
||||
|
if (mediaQueryStyleNode.sheet) { |
||||
|
mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0); |
||||
|
mediaQueriesForWebkitCompatibility.add(query); |
||||
|
} |
||||
|
} |
||||
|
catch (e) { |
||||
|
console.error(e); |
||||
|
} |
||||
|
} |
||||
|
/** No-op matchMedia replacement for non-browser platforms. */ |
||||
|
function noopMatchMedia(query) { |
||||
|
// Use `as any` here to avoid adding additional necessary properties for
|
||||
|
// the noop matcher.
|
||||
|
return { |
||||
|
matches: query === 'all' || query === '', |
||||
|
media: query, |
||||
|
addListener: () => { }, |
||||
|
removeListener: () => { } |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Utility for checking the matching state of @media queries. */ |
||||
|
class BreakpointObserver { |
||||
|
constructor(_mediaMatcher, _zone) { |
||||
|
this._mediaMatcher = _mediaMatcher; |
||||
|
this._zone = _zone; |
||||
|
/** A map of all media queries currently being listened for. */ |
||||
|
this._queries = new Map(); |
||||
|
/** A subject for all other observables to takeUntil based on. */ |
||||
|
this._destroySubject = new Subject(); |
||||
|
} |
||||
|
/** Completes the active subject, signalling to all other observables to complete. */ |
||||
|
ngOnDestroy() { |
||||
|
this._destroySubject.next(); |
||||
|
this._destroySubject.complete(); |
||||
|
} |
||||
|
/** |
||||
|
* Whether one or more media queries match the current viewport size. |
||||
|
* @param value One or more media queries to check. |
||||
|
* @returns Whether any of the media queries match. |
||||
|
*/ |
||||
|
isMatched(value) { |
||||
|
const queries = splitQueries(coerceArray(value)); |
||||
|
return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches); |
||||
|
} |
||||
|
/** |
||||
|
* Gets an observable of results for the given queries that will emit new results for any changes |
||||
|
* in matching of the given queries. |
||||
|
* @param value One or more media queries to check. |
||||
|
* @returns A stream of matches for the given queries. |
||||
|
*/ |
||||
|
observe(value) { |
||||
|
const queries = splitQueries(coerceArray(value)); |
||||
|
const observables = queries.map(query => this._registerQuery(query).observable); |
||||
|
let stateObservable = combineLatest(observables); |
||||
|
// Emit the first state immediately, and then debounce the subsequent emissions.
|
||||
|
stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0))); |
||||
|
return stateObservable.pipe(map(breakpointStates => { |
||||
|
const response = { |
||||
|
matches: false, |
||||
|
breakpoints: {}, |
||||
|
}; |
||||
|
breakpointStates.forEach(({ matches, query }) => { |
||||
|
response.matches = response.matches || matches; |
||||
|
response.breakpoints[query] = matches; |
||||
|
}); |
||||
|
return response; |
||||
|
})); |
||||
|
} |
||||
|
/** Registers a specific query to be listened for. */ |
||||
|
_registerQuery(query) { |
||||
|
// Only set up a new MediaQueryList if it is not already being listened for.
|
||||
|
if (this._queries.has(query)) { |
||||
|
return this._queries.get(query); |
||||
|
} |
||||
|
const mql = this._mediaMatcher.matchMedia(query); |
||||
|
// Create callback for match changes and add it is as a listener.
|
||||
|
const queryObservable = new Observable((observer) => { |
||||
|
// Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed
|
||||
|
// back into the zone because matchMedia is only included in Zone.js by loading the
|
||||
|
// webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not
|
||||
|
// have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js
|
||||
|
// patches it.
|
||||
|
const handler = (e) => this._zone.run(() => observer.next(e)); |
||||
|
mql.addListener(handler); |
||||
|
return () => { |
||||
|
mql.removeListener(handler); |
||||
|
}; |
||||
|
}).pipe(startWith(mql), map(({ matches }) => ({ query, matches })), takeUntil(this._destroySubject)); |
||||
|
// Add the MediaQueryList to the set of queries.
|
||||
|
const output = { observable: queryObservable, mql }; |
||||
|
this._queries.set(query, output); |
||||
|
return output; |
||||
|
} |
||||
|
} |
||||
|
BreakpointObserver.ɵfac = function BreakpointObserver_Factory(t) { return new (t || BreakpointObserver)(ɵngcc0.ɵɵinject(MediaMatcher), ɵngcc0.ɵɵinject(ɵngcc0.NgZone)); }; |
||||
|
BreakpointObserver.ɵprov = i0.ɵɵdefineInjectable({ factory: function BreakpointObserver_Factory() { return new BreakpointObserver(i0.ɵɵinject(MediaMatcher), i0.ɵɵinject(i0.NgZone)); }, token: BreakpointObserver, providedIn: "root" }); |
||||
|
BreakpointObserver.ctorParameters = () => [ |
||||
|
{ type: MediaMatcher }, |
||||
|
{ type: NgZone } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(BreakpointObserver, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: MediaMatcher }, { type: ɵngcc0.NgZone }]; }, null); })(); |
||||
|
/** |
||||
|
* Split each query string into separate query strings if two queries are provided as comma |
||||
|
* separated. |
||||
|
*/ |
||||
|
function splitQueries(queries) { |
||||
|
return queries.map(query => query.split(',')) |
||||
|
.reduce((a1, a2) => a1.concat(a2)) |
||||
|
.map(query => query.trim()); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
// PascalCase is being used as Breakpoints is used like an enum.
|
||||
|
// tslint:disable-next-line:variable-name
|
||||
|
const Breakpoints = { |
||||
|
XSmall: '(max-width: 599.98px)', |
||||
|
Small: '(min-width: 600px) and (max-width: 959.98px)', |
||||
|
Medium: '(min-width: 960px) and (max-width: 1279.98px)', |
||||
|
Large: '(min-width: 1280px) and (max-width: 1919.98px)', |
||||
|
XLarge: '(min-width: 1920px)', |
||||
|
Handset: '(max-width: 599.98px) and (orientation: portrait), ' + |
||||
|
'(max-width: 959.98px) and (orientation: landscape)', |
||||
|
Tablet: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait), ' + |
||||
|
'(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)', |
||||
|
Web: '(min-width: 840px) and (orientation: portrait), ' + |
||||
|
'(min-width: 1280px) and (orientation: landscape)', |
||||
|
HandsetPortrait: '(max-width: 599.98px) and (orientation: portrait)', |
||||
|
TabletPortrait: '(min-width: 600px) and (max-width: 839.98px) and (orientation: portrait)', |
||||
|
WebPortrait: '(min-width: 840px) and (orientation: portrait)', |
||||
|
HandsetLandscape: '(max-width: 959.98px) and (orientation: landscape)', |
||||
|
TabletLandscape: '(min-width: 960px) and (max-width: 1279.98px) and (orientation: landscape)', |
||||
|
WebLandscape: '(min-width: 1280px) and (orientation: landscape)', |
||||
|
}; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { BreakpointObserver, Breakpoints, LayoutModule, MediaMatcher }; |
||||
|
|
||||
|
//# sourceMappingURL=layout.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/layout.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,216 @@ |
|||||
|
import { coerceElement, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion'; |
||||
|
import * as i0 from '@angular/core'; |
||||
|
import { Injectable, EventEmitter, Directive, ElementRef, NgZone, Output, Input, NgModule } from '@angular/core'; |
||||
|
import { Observable, Subject } from 'rxjs'; |
||||
|
import { debounceTime } from 'rxjs/operators'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
class MutationObserverFactory { |
||||
|
create(callback) { |
||||
|
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback); |
||||
|
} |
||||
|
} |
||||
|
MutationObserverFactory.ɵfac = function MutationObserverFactory_Factory(t) { return new (t || MutationObserverFactory)(); }; |
||||
|
MutationObserverFactory.ɵprov = i0.ɵɵdefineInjectable({ factory: function MutationObserverFactory_Factory() { return new MutationObserverFactory(); }, token: MutationObserverFactory, providedIn: "root" }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(MutationObserverFactory, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], null, null); })(); |
||||
|
/** An injectable service that allows watching elements for changes to their content. */ |
||||
|
class ContentObserver { |
||||
|
constructor(_mutationObserverFactory) { |
||||
|
this._mutationObserverFactory = _mutationObserverFactory; |
||||
|
/** Keeps track of the existing MutationObservers so they can be reused. */ |
||||
|
this._observedElements = new Map(); |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._observedElements.forEach((_, element) => this._cleanupObserver(element)); |
||||
|
} |
||||
|
observe(elementOrRef) { |
||||
|
const element = coerceElement(elementOrRef); |
||||
|
return new Observable((observer) => { |
||||
|
const stream = this._observeElement(element); |
||||
|
const subscription = stream.subscribe(observer); |
||||
|
return () => { |
||||
|
subscription.unsubscribe(); |
||||
|
this._unobserveElement(element); |
||||
|
}; |
||||
|
}); |
||||
|
} |
||||
|
/** |
||||
|
* Observes the given element by using the existing MutationObserver if available, or creating a |
||||
|
* new one if not. |
||||
|
*/ |
||||
|
_observeElement(element) { |
||||
|
if (!this._observedElements.has(element)) { |
||||
|
const stream = new Subject(); |
||||
|
const observer = this._mutationObserverFactory.create(mutations => stream.next(mutations)); |
||||
|
if (observer) { |
||||
|
observer.observe(element, { |
||||
|
characterData: true, |
||||
|
childList: true, |
||||
|
subtree: true |
||||
|
}); |
||||
|
} |
||||
|
this._observedElements.set(element, { observer, stream, count: 1 }); |
||||
|
} |
||||
|
else { |
||||
|
this._observedElements.get(element).count++; |
||||
|
} |
||||
|
return this._observedElements.get(element).stream; |
||||
|
} |
||||
|
/** |
||||
|
* Un-observes the given element and cleans up the underlying MutationObserver if nobody else is |
||||
|
* observing this element. |
||||
|
*/ |
||||
|
_unobserveElement(element) { |
||||
|
if (this._observedElements.has(element)) { |
||||
|
this._observedElements.get(element).count--; |
||||
|
if (!this._observedElements.get(element).count) { |
||||
|
this._cleanupObserver(element); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** Clean up the underlying MutationObserver for the specified element. */ |
||||
|
_cleanupObserver(element) { |
||||
|
if (this._observedElements.has(element)) { |
||||
|
const { observer, stream } = this._observedElements.get(element); |
||||
|
if (observer) { |
||||
|
observer.disconnect(); |
||||
|
} |
||||
|
stream.complete(); |
||||
|
this._observedElements.delete(element); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
ContentObserver.ɵfac = function ContentObserver_Factory(t) { return new (t || ContentObserver)(ɵngcc0.ɵɵinject(MutationObserverFactory)); }; |
||||
|
ContentObserver.ɵprov = i0.ɵɵdefineInjectable({ factory: function ContentObserver_Factory() { return new ContentObserver(i0.ɵɵinject(MutationObserverFactory)); }, token: ContentObserver, providedIn: "root" }); |
||||
|
ContentObserver.ctorParameters = () => [ |
||||
|
{ type: MutationObserverFactory } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(ContentObserver, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: MutationObserverFactory }]; }, null); })(); |
||||
|
/** |
||||
|
* Directive that triggers a callback whenever the content of |
||||
|
* its associated element has changed. |
||||
|
*/ |
||||
|
class CdkObserveContent { |
||||
|
constructor(_contentObserver, _elementRef, _ngZone) { |
||||
|
this._contentObserver = _contentObserver; |
||||
|
this._elementRef = _elementRef; |
||||
|
this._ngZone = _ngZone; |
||||
|
/** Event emitted for each change in the element's content. */ |
||||
|
this.event = new EventEmitter(); |
||||
|
this._disabled = false; |
||||
|
this._currentSubscription = null; |
||||
|
} |
||||
|
/** |
||||
|
* Whether observing content is disabled. This option can be used |
||||
|
* to disconnect the underlying MutationObserver until it is needed. |
||||
|
*/ |
||||
|
get disabled() { return this._disabled; } |
||||
|
set disabled(value) { |
||||
|
this._disabled = coerceBooleanProperty(value); |
||||
|
this._disabled ? this._unsubscribe() : this._subscribe(); |
||||
|
} |
||||
|
/** Debounce interval for emitting the changes. */ |
||||
|
get debounce() { return this._debounce; } |
||||
|
set debounce(value) { |
||||
|
this._debounce = coerceNumberProperty(value); |
||||
|
this._subscribe(); |
||||
|
} |
||||
|
ngAfterContentInit() { |
||||
|
if (!this._currentSubscription && !this.disabled) { |
||||
|
this._subscribe(); |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._unsubscribe(); |
||||
|
} |
||||
|
_subscribe() { |
||||
|
this._unsubscribe(); |
||||
|
const stream = this._contentObserver.observe(this._elementRef); |
||||
|
// TODO(mmalerba): We shouldn't be emitting on this @Output() outside the zone.
|
||||
|
// Consider brining it back inside the zone next time we're making breaking changes.
|
||||
|
// Bringing it back inside can cause things like infinite change detection loops and changed
|
||||
|
// after checked errors if people's code isn't handling it properly.
|
||||
|
this._ngZone.runOutsideAngular(() => { |
||||
|
this._currentSubscription = |
||||
|
(this.debounce ? stream.pipe(debounceTime(this.debounce)) : stream).subscribe(this.event); |
||||
|
}); |
||||
|
} |
||||
|
_unsubscribe() { |
||||
|
var _a; |
||||
|
(_a = this._currentSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe(); |
||||
|
} |
||||
|
} |
||||
|
CdkObserveContent.ɵfac = function CdkObserveContent_Factory(t) { return new (t || CdkObserveContent)(ɵngcc0.ɵɵdirectiveInject(ContentObserver), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.NgZone)); }; |
||||
|
CdkObserveContent.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkObserveContent, selectors: [["", "cdkObserveContent", ""]], inputs: { disabled: ["cdkObserveContentDisabled", "disabled"], debounce: "debounce" }, outputs: { event: "cdkObserveContent" }, exportAs: ["cdkObserveContent"] }); |
||||
|
CdkObserveContent.ctorParameters = () => [ |
||||
|
{ type: ContentObserver }, |
||||
|
{ type: ElementRef }, |
||||
|
{ type: NgZone } |
||||
|
]; |
||||
|
CdkObserveContent.propDecorators = { |
||||
|
event: [{ type: Output, args: ['cdkObserveContent',] }], |
||||
|
disabled: [{ type: Input, args: ['cdkObserveContentDisabled',] }], |
||||
|
debounce: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkObserveContent, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkObserveContent]', |
||||
|
exportAs: 'cdkObserveContent' |
||||
|
}] |
||||
|
}], function () { return [{ type: ContentObserver }, { type: ɵngcc0.ElementRef }, { type: ɵngcc0.NgZone }]; }, { event: [{ |
||||
|
type: Output, |
||||
|
args: ['cdkObserveContent'] |
||||
|
}], disabled: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkObserveContentDisabled'] |
||||
|
}], debounce: [{ |
||||
|
type: Input |
||||
|
}] }); })(); |
||||
|
class ObserversModule { |
||||
|
} |
||||
|
ObserversModule.ɵfac = function ObserversModule_Factory(t) { return new (t || ObserversModule)(); }; |
||||
|
ObserversModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: ObserversModule }); |
||||
|
ObserversModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({ providers: [MutationObserverFactory] }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(ObserversModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
exports: [CdkObserveContent], |
||||
|
declarations: [CdkObserveContent], |
||||
|
providers: [MutationObserverFactory] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(ObserversModule, { declarations: [CdkObserveContent], exports: [CdkObserveContent] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { CdkObserveContent, ContentObserver, MutationObserverFactory, ObserversModule }; |
||||
|
|
||||
|
//# sourceMappingURL=observers.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/observers.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3243
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/overlay.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/overlay.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,373 @@ |
|||||
|
import * as i0 from '@angular/core'; |
||||
|
import { Injectable, Inject, PLATFORM_ID, NgModule } from '@angular/core'; |
||||
|
import { isPlatformBrowser } from '@angular/common'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
// Whether the current platform supports the V8 Break Iterator. The V8 check
|
||||
|
// is necessary to detect all Blink based browsers.
|
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
let hasV8BreakIterator; |
||||
|
// We need a try/catch around the reference to `Intl`, because accessing it in some cases can
|
||||
|
// cause IE to throw. These cases are tied to particular versions of Windows and can happen if
|
||||
|
// the consumer is providing a polyfilled `Map`. See:
|
||||
|
// https://github.com/Microsoft/ChakraCore/issues/3189
|
||||
|
// https://github.com/angular/components/issues/15687
|
||||
|
try { |
||||
|
hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator); |
||||
|
} |
||||
|
catch (_a) { |
||||
|
hasV8BreakIterator = false; |
||||
|
} |
||||
|
/** |
||||
|
* Service to detect the current platform by comparing the userAgent strings and |
||||
|
* checking browser-specific global properties. |
||||
|
*/ |
||||
|
class Platform { |
||||
|
constructor(_platformId) { |
||||
|
this._platformId = _platformId; |
||||
|
// We want to use the Angular platform check because if the Document is shimmed
|
||||
|
// without the navigator, the following checks will fail. This is preferred because
|
||||
|
// sometimes the Document may be shimmed without the user's knowledge or intention
|
||||
|
/** Whether the Angular application is being rendered in the browser. */ |
||||
|
this.isBrowser = this._platformId ? |
||||
|
isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document; |
||||
|
/** Whether the current browser is Microsoft Edge. */ |
||||
|
this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent); |
||||
|
/** Whether the current rendering engine is Microsoft Trident. */ |
||||
|
this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent); |
||||
|
// EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.
|
||||
|
/** Whether the current rendering engine is Blink. */ |
||||
|
this.BLINK = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && |
||||
|
typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT); |
||||
|
// Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to
|
||||
|
// ensure that Webkit runs standalone and is not used as another engine's base.
|
||||
|
/** Whether the current rendering engine is WebKit. */ |
||||
|
this.WEBKIT = this.isBrowser && |
||||
|
/AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT; |
||||
|
/** Whether the current platform is Apple iOS. */ |
||||
|
this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && |
||||
|
!('MSStream' in window); |
||||
|
// It's difficult to detect the plain Gecko engine, because most of the browsers identify
|
||||
|
// them self as Gecko-like browsers and modify the userAgent's according to that.
|
||||
|
// Since we only cover one explicit Firefox case, we can simply check for Firefox
|
||||
|
// instead of having an unstable check for Gecko.
|
||||
|
/** Whether the current browser is Firefox. */ |
||||
|
this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent); |
||||
|
/** Whether the current platform is Android. */ |
||||
|
// Trident on mobile adds the android platform to the userAgent to trick detections.
|
||||
|
this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT; |
||||
|
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
|
||||
|
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
|
||||
|
// Safari browser should also use Webkit as its layout engine.
|
||||
|
/** Whether the current browser is Safari. */ |
||||
|
this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT; |
||||
|
} |
||||
|
} |
||||
|
Platform.ɵfac = function Platform_Factory(t) { return new (t || Platform)(ɵngcc0.ɵɵinject(PLATFORM_ID)); }; |
||||
|
Platform.ɵprov = i0.ɵɵdefineInjectable({ factory: function Platform_Factory() { return new Platform(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: Platform, providedIn: "root" }); |
||||
|
Platform.ctorParameters = () => [ |
||||
|
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(Platform, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: Object, decorators: [{ |
||||
|
type: Inject, |
||||
|
args: [PLATFORM_ID] |
||||
|
}] }]; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class PlatformModule { |
||||
|
} |
||||
|
PlatformModule.ɵfac = function PlatformModule_Factory(t) { return new (t || PlatformModule)(); }; |
||||
|
PlatformModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: PlatformModule }); |
||||
|
PlatformModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(PlatformModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{}] |
||||
|
}], null, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Cached result Set of input types support by the current browser. */ |
||||
|
let supportedInputTypes; |
||||
|
/** Types of `<input>` that *might* be supported. */ |
||||
|
const candidateInputTypes = [ |
||||
|
// `color` must come first. Chrome 56 shows a warning if we change the type to `color` after
|
||||
|
// first changing it to something else:
|
||||
|
// The specified value "" does not conform to the required format.
|
||||
|
// The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
|
||||
|
'color', |
||||
|
'button', |
||||
|
'checkbox', |
||||
|
'date', |
||||
|
'datetime-local', |
||||
|
'email', |
||||
|
'file', |
||||
|
'hidden', |
||||
|
'image', |
||||
|
'month', |
||||
|
'number', |
||||
|
'password', |
||||
|
'radio', |
||||
|
'range', |
||||
|
'reset', |
||||
|
'search', |
||||
|
'submit', |
||||
|
'tel', |
||||
|
'text', |
||||
|
'time', |
||||
|
'url', |
||||
|
'week', |
||||
|
]; |
||||
|
/** @returns The input types supported by this browser. */ |
||||
|
function getSupportedInputTypes() { |
||||
|
// Result is cached.
|
||||
|
if (supportedInputTypes) { |
||||
|
return supportedInputTypes; |
||||
|
} |
||||
|
// We can't check if an input type is not supported until we're on the browser, so say that
|
||||
|
// everything is supported when not on the browser. We don't use `Platform` here since it's
|
||||
|
// just a helper function and can't inject it.
|
||||
|
if (typeof document !== 'object' || !document) { |
||||
|
supportedInputTypes = new Set(candidateInputTypes); |
||||
|
return supportedInputTypes; |
||||
|
} |
||||
|
let featureTestInput = document.createElement('input'); |
||||
|
supportedInputTypes = new Set(candidateInputTypes.filter(value => { |
||||
|
featureTestInput.setAttribute('type', value); |
||||
|
return featureTestInput.type === value; |
||||
|
})); |
||||
|
return supportedInputTypes; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Cached result of whether the user's browser supports passive event listeners. */ |
||||
|
let supportsPassiveEvents; |
||||
|
/** |
||||
|
* Checks whether the user's browser supports passive event listeners. |
||||
|
* See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
|
||||
|
*/ |
||||
|
function supportsPassiveEventListeners() { |
||||
|
if (supportsPassiveEvents == null && typeof window !== 'undefined') { |
||||
|
try { |
||||
|
window.addEventListener('test', null, Object.defineProperty({}, 'passive', { |
||||
|
get: () => supportsPassiveEvents = true |
||||
|
})); |
||||
|
} |
||||
|
finally { |
||||
|
supportsPassiveEvents = supportsPassiveEvents || false; |
||||
|
} |
||||
|
} |
||||
|
return supportsPassiveEvents; |
||||
|
} |
||||
|
/** |
||||
|
* Normalizes an `AddEventListener` object to something that can be passed |
||||
|
* to `addEventListener` on any browser, no matter whether it supports the |
||||
|
* `options` parameter. |
||||
|
* @param options Object to be normalized. |
||||
|
*/ |
||||
|
function normalizePassiveListenerOptions(options) { |
||||
|
return supportsPassiveEventListeners() ? options : !!options.capture; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */ |
||||
|
let rtlScrollAxisType; |
||||
|
/** Cached result of the check that indicates whether the browser supports scroll behaviors. */ |
||||
|
let scrollBehaviorSupported; |
||||
|
/** Check whether the browser supports scroll behaviors. */ |
||||
|
function supportsScrollBehavior() { |
||||
|
if (scrollBehaviorSupported == null) { |
||||
|
// If we're not in the browser, it can't be supported. Also check for `Element`, because
|
||||
|
// some projects stub out the global `document` during SSR which can throw us off.
|
||||
|
if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) { |
||||
|
scrollBehaviorSupported = false; |
||||
|
return scrollBehaviorSupported; |
||||
|
} |
||||
|
// If the element can have a `scrollBehavior` style, we can be sure that it's supported.
|
||||
|
if ('scrollBehavior' in document.documentElement.style) { |
||||
|
scrollBehaviorSupported = true; |
||||
|
} |
||||
|
else { |
||||
|
// At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's
|
||||
|
// supported but it doesn't handle scroll behavior, or it has been polyfilled.
|
||||
|
const scrollToFunction = Element.prototype.scrollTo; |
||||
|
if (scrollToFunction) { |
||||
|
// We can detect if the function has been polyfilled by calling `toString` on it. Native
|
||||
|
// functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get
|
||||
|
// the actual function source. Via https://davidwalsh.name/detect-native-function. Consider
|
||||
|
// polyfilled functions as supporting scroll behavior.
|
||||
|
scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString()); |
||||
|
} |
||||
|
else { |
||||
|
scrollBehaviorSupported = false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
return scrollBehaviorSupported; |
||||
|
} |
||||
|
/** |
||||
|
* Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL, |
||||
|
* Firefox & Safari are NEGATED, and IE & Edge are INVERTED. |
||||
|
*/ |
||||
|
function getRtlScrollAxisType() { |
||||
|
// We can't check unless we're on the browser. Just assume 'normal' if we're not.
|
||||
|
if (typeof document !== 'object' || !document) { |
||||
|
return 0 /* NORMAL */; |
||||
|
} |
||||
|
if (rtlScrollAxisType == null) { |
||||
|
// Create a 1px wide scrolling container and a 2px wide content element.
|
||||
|
const scrollContainer = document.createElement('div'); |
||||
|
const containerStyle = scrollContainer.style; |
||||
|
scrollContainer.dir = 'rtl'; |
||||
|
containerStyle.width = '1px'; |
||||
|
containerStyle.overflow = 'auto'; |
||||
|
containerStyle.visibility = 'hidden'; |
||||
|
containerStyle.pointerEvents = 'none'; |
||||
|
containerStyle.position = 'absolute'; |
||||
|
const content = document.createElement('div'); |
||||
|
const contentStyle = content.style; |
||||
|
contentStyle.width = '2px'; |
||||
|
contentStyle.height = '1px'; |
||||
|
scrollContainer.appendChild(content); |
||||
|
document.body.appendChild(scrollContainer); |
||||
|
rtlScrollAxisType = 0 /* NORMAL */; |
||||
|
// The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL
|
||||
|
// browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're
|
||||
|
// dealing with one of the other two types of browsers.
|
||||
|
if (scrollContainer.scrollLeft === 0) { |
||||
|
// In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an
|
||||
|
// INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by
|
||||
|
// setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will
|
||||
|
// return 0 when we read it again.
|
||||
|
scrollContainer.scrollLeft = 1; |
||||
|
rtlScrollAxisType = |
||||
|
scrollContainer.scrollLeft === 0 ? 1 /* NEGATED */ : 2 /* INVERTED */; |
||||
|
} |
||||
|
scrollContainer.parentNode.removeChild(scrollContainer); |
||||
|
} |
||||
|
return rtlScrollAxisType; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
let shadowDomIsSupported; |
||||
|
/** Checks whether the user's browser support Shadow DOM. */ |
||||
|
function _supportsShadowDom() { |
||||
|
if (shadowDomIsSupported == null) { |
||||
|
const head = typeof document !== 'undefined' ? document.head : null; |
||||
|
shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow)); |
||||
|
} |
||||
|
return shadowDomIsSupported; |
||||
|
} |
||||
|
/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */ |
||||
|
function _getShadowRoot(element) { |
||||
|
if (_supportsShadowDom()) { |
||||
|
const rootNode = element.getRootNode ? element.getRootNode() : null; |
||||
|
// Note that this should be caught by `_supportsShadowDom`, but some
|
||||
|
// teams have been able to hit this code path on unsupported browsers.
|
||||
|
if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) { |
||||
|
return rootNode; |
||||
|
} |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
/** |
||||
|
* Gets the currently-focused element on the page while |
||||
|
* also piercing through Shadow DOM boundaries. |
||||
|
*/ |
||||
|
function _getFocusedElementPierceShadowDom() { |
||||
|
let activeElement = typeof document !== 'undefined' && document ? |
||||
|
document.activeElement : null; |
||||
|
while (activeElement && activeElement.shadowRoot) { |
||||
|
const newActiveElement = activeElement.shadowRoot.activeElement; |
||||
|
if (newActiveElement === activeElement) { |
||||
|
break; |
||||
|
} |
||||
|
else { |
||||
|
activeElement = newActiveElement; |
||||
|
} |
||||
|
} |
||||
|
return activeElement; |
||||
|
} |
||||
|
/** Gets the target of an event while accounting for Shadow DOM. */ |
||||
|
function _getEventTarget(event) { |
||||
|
// If an event is bound outside the Shadow DOM, the `event.target` will
|
||||
|
// point to the shadow root so we have to use `composedPath` instead.
|
||||
|
return (event.composedPath ? event.composedPath()[0] : event.target); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Gets whether the code is currently running in a test environment. */ |
||||
|
function _isTestEnvironment() { |
||||
|
// We can't use `declare const` because it causes conflicts inside Google with the real typings
|
||||
|
// for these symbols and we can't read them off the global object, because they don't appear to
|
||||
|
// be attached there for some runners like Jest.
|
||||
|
// (see: https://github.com/angular/components/issues/23365#issuecomment-938146643)
|
||||
|
return ( |
||||
|
// @ts-ignore
|
||||
|
(typeof __karma__ !== 'undefined' && !!__karma__) || |
||||
|
// @ts-ignore
|
||||
|
(typeof jasmine !== 'undefined' && !!jasmine) || |
||||
|
// @ts-ignore
|
||||
|
(typeof jest !== 'undefined' && !!jest) || |
||||
|
// @ts-ignore
|
||||
|
(typeof Mocha !== 'undefined' && !!Mocha)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { Platform, PlatformModule, _getEventTarget, _getFocusedElementPierceShadowDom, _getShadowRoot, _isTestEnvironment, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior }; |
||||
|
|
||||
|
//# sourceMappingURL=platform.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/platform.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,656 @@ |
|||||
|
import { ElementRef, Directive, TemplateRef, ViewContainerRef, EventEmitter, ComponentFactoryResolver, Inject, Output, NgModule } from '@angular/core'; |
||||
|
import { DOCUMENT } from '@angular/common'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Throws an exception when attempting to attach a null portal to a host. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
function throwNullPortalError() { |
||||
|
throw Error('Must provide a portal to attach'); |
||||
|
} |
||||
|
/** |
||||
|
* Throws an exception when attempting to attach a portal to a host that is already attached. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function throwPortalAlreadyAttachedError() { |
||||
|
throw Error('Host already has a portal attached'); |
||||
|
} |
||||
|
/** |
||||
|
* Throws an exception when attempting to attach a portal to an already-disposed host. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function throwPortalOutletAlreadyDisposedError() { |
||||
|
throw Error('This PortalOutlet has already been disposed'); |
||||
|
} |
||||
|
/** |
||||
|
* Throws an exception when attempting to attach an unknown portal type. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function throwUnknownPortalTypeError() { |
||||
|
throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' + |
||||
|
'a ComponentPortal or a TemplatePortal.'); |
||||
|
} |
||||
|
/** |
||||
|
* Throws an exception when attempting to attach a portal to a null host. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function throwNullPortalOutletError() { |
||||
|
throw Error('Attempting to attach a portal to a null PortalOutlet'); |
||||
|
} |
||||
|
/** |
||||
|
* Throws an exception when attempting to detach a portal that is not attached. |
||||
|
* @docs-private |
||||
|
*/ |
||||
|
function throwNoPortalAttachedError() { |
||||
|
throw Error('Attempting to detach a portal that is not attached to a host'); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A `Portal` is something that you want to render somewhere else. |
||||
|
* It can be attach to / detached from a `PortalOutlet`. |
||||
|
*/ |
||||
|
class Portal { |
||||
|
/** Attach this portal to a host. */ |
||||
|
attach(host) { |
||||
|
if (typeof ngDevMode === 'undefined' || ngDevMode) { |
||||
|
if (host == null) { |
||||
|
throwNullPortalOutletError(); |
||||
|
} |
||||
|
if (host.hasAttached()) { |
||||
|
throwPortalAlreadyAttachedError(); |
||||
|
} |
||||
|
} |
||||
|
this._attachedHost = host; |
||||
|
return host.attach(this); |
||||
|
} |
||||
|
/** Detach this portal from its host */ |
||||
|
detach() { |
||||
|
let host = this._attachedHost; |
||||
|
if (host != null) { |
||||
|
this._attachedHost = null; |
||||
|
host.detach(); |
||||
|
} |
||||
|
else if (typeof ngDevMode === 'undefined' || ngDevMode) { |
||||
|
throwNoPortalAttachedError(); |
||||
|
} |
||||
|
} |
||||
|
/** Whether this portal is attached to a host. */ |
||||
|
get isAttached() { |
||||
|
return this._attachedHost != null; |
||||
|
} |
||||
|
/** |
||||
|
* Sets the PortalOutlet reference without performing `attach()`. This is used directly by |
||||
|
* the PortalOutlet when it is performing an `attach()` or `detach()`. |
||||
|
*/ |
||||
|
setAttachedHost(host) { |
||||
|
this._attachedHost = host; |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* A `ComponentPortal` is a portal that instantiates some Component upon attachment. |
||||
|
*/ |
||||
|
class ComponentPortal extends Portal { |
||||
|
constructor(component, viewContainerRef, injector, componentFactoryResolver) { |
||||
|
super(); |
||||
|
this.component = component; |
||||
|
this.viewContainerRef = viewContainerRef; |
||||
|
this.injector = injector; |
||||
|
this.componentFactoryResolver = componentFactoryResolver; |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* A `TemplatePortal` is a portal that represents some embedded template (TemplateRef). |
||||
|
*/ |
||||
|
class TemplatePortal extends Portal { |
||||
|
constructor(template, viewContainerRef, context) { |
||||
|
super(); |
||||
|
this.templateRef = template; |
||||
|
this.viewContainerRef = viewContainerRef; |
||||
|
this.context = context; |
||||
|
} |
||||
|
get origin() { |
||||
|
return this.templateRef.elementRef; |
||||
|
} |
||||
|
/** |
||||
|
* Attach the portal to the provided `PortalOutlet`. |
||||
|
* When a context is provided it will override the `context` property of the `TemplatePortal` |
||||
|
* instance. |
||||
|
*/ |
||||
|
attach(host, context = this.context) { |
||||
|
this.context = context; |
||||
|
return super.attach(host); |
||||
|
} |
||||
|
detach() { |
||||
|
this.context = undefined; |
||||
|
return super.detach(); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* A `DomPortal` is a portal whose DOM element will be taken from its current position |
||||
|
* in the DOM and moved into a portal outlet, when it is attached. On detach, the content |
||||
|
* will be restored to its original position. |
||||
|
*/ |
||||
|
class DomPortal extends Portal { |
||||
|
constructor(element) { |
||||
|
super(); |
||||
|
this.element = element instanceof ElementRef ? element.nativeElement : element; |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Partial implementation of PortalOutlet that handles attaching |
||||
|
* ComponentPortal and TemplatePortal. |
||||
|
*/ |
||||
|
class BasePortalOutlet { |
||||
|
constructor() { |
||||
|
/** Whether this host has already been permanently disposed. */ |
||||
|
this._isDisposed = false; |
||||
|
// @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.
|
||||
|
this.attachDomPortal = null; |
||||
|
} |
||||
|
/** Whether this host has an attached portal. */ |
||||
|
hasAttached() { |
||||
|
return !!this._attachedPortal; |
||||
|
} |
||||
|
/** Attaches a portal. */ |
||||
|
attach(portal) { |
||||
|
if (typeof ngDevMode === 'undefined' || ngDevMode) { |
||||
|
if (!portal) { |
||||
|
throwNullPortalError(); |
||||
|
} |
||||
|
if (this.hasAttached()) { |
||||
|
throwPortalAlreadyAttachedError(); |
||||
|
} |
||||
|
if (this._isDisposed) { |
||||
|
throwPortalOutletAlreadyDisposedError(); |
||||
|
} |
||||
|
} |
||||
|
if (portal instanceof ComponentPortal) { |
||||
|
this._attachedPortal = portal; |
||||
|
return this.attachComponentPortal(portal); |
||||
|
} |
||||
|
else if (portal instanceof TemplatePortal) { |
||||
|
this._attachedPortal = portal; |
||||
|
return this.attachTemplatePortal(portal); |
||||
|
// @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.
|
||||
|
} |
||||
|
else if (this.attachDomPortal && portal instanceof DomPortal) { |
||||
|
this._attachedPortal = portal; |
||||
|
return this.attachDomPortal(portal); |
||||
|
} |
||||
|
if (typeof ngDevMode === 'undefined' || ngDevMode) { |
||||
|
throwUnknownPortalTypeError(); |
||||
|
} |
||||
|
} |
||||
|
/** Detaches a previously attached portal. */ |
||||
|
detach() { |
||||
|
if (this._attachedPortal) { |
||||
|
this._attachedPortal.setAttachedHost(null); |
||||
|
this._attachedPortal = null; |
||||
|
} |
||||
|
this._invokeDisposeFn(); |
||||
|
} |
||||
|
/** Permanently dispose of this portal host. */ |
||||
|
dispose() { |
||||
|
if (this.hasAttached()) { |
||||
|
this.detach(); |
||||
|
} |
||||
|
this._invokeDisposeFn(); |
||||
|
this._isDisposed = true; |
||||
|
} |
||||
|
/** @docs-private */ |
||||
|
setDisposeFn(fn) { |
||||
|
this._disposeFn = fn; |
||||
|
} |
||||
|
_invokeDisposeFn() { |
||||
|
if (this._disposeFn) { |
||||
|
this._disposeFn(); |
||||
|
this._disposeFn = null; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* @deprecated Use `BasePortalOutlet` instead. |
||||
|
* @breaking-change 9.0.0 |
||||
|
*/ |
||||
|
class BasePortalHost extends BasePortalOutlet { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular |
||||
|
* application context. |
||||
|
*/ |
||||
|
class DomPortalOutlet extends BasePortalOutlet { |
||||
|
constructor( |
||||
|
/** Element into which the content is projected. */ |
||||
|
outletElement, _componentFactoryResolver, _appRef, _defaultInjector, |
||||
|
/** |
||||
|
* @deprecated `_document` Parameter to be made required. |
||||
|
* @breaking-change 10.0.0 |
||||
|
*/ |
||||
|
_document) { |
||||
|
super(); |
||||
|
this.outletElement = outletElement; |
||||
|
this._componentFactoryResolver = _componentFactoryResolver; |
||||
|
this._appRef = _appRef; |
||||
|
this._defaultInjector = _defaultInjector; |
||||
|
/** |
||||
|
* Attaches a DOM portal by transferring its content into the outlet. |
||||
|
* @param portal Portal to be attached. |
||||
|
* @deprecated To be turned into a method. |
||||
|
* @breaking-change 10.0.0 |
||||
|
*/ |
||||
|
this.attachDomPortal = (portal) => { |
||||
|
// @breaking-change 10.0.0 Remove check and error once the
|
||||
|
// `_document` constructor parameter is required.
|
||||
|
if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw Error('Cannot attach DOM portal without _document constructor parameter'); |
||||
|
} |
||||
|
const element = portal.element; |
||||
|
if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw Error('DOM portal content must be attached to a parent node.'); |
||||
|
} |
||||
|
// Anchor used to save the element's previous position so
|
||||
|
// that we can restore it when the portal is detached.
|
||||
|
const anchorNode = this._document.createComment('dom-portal'); |
||||
|
element.parentNode.insertBefore(anchorNode, element); |
||||
|
this.outletElement.appendChild(element); |
||||
|
this._attachedPortal = portal; |
||||
|
super.setDisposeFn(() => { |
||||
|
// We can't use `replaceWith` here because IE doesn't support it.
|
||||
|
if (anchorNode.parentNode) { |
||||
|
anchorNode.parentNode.replaceChild(element, anchorNode); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
this._document = _document; |
||||
|
} |
||||
|
/** |
||||
|
* Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver. |
||||
|
* @param portal Portal to be attached |
||||
|
* @returns Reference to the created component. |
||||
|
*/ |
||||
|
attachComponentPortal(portal) { |
||||
|
const resolver = portal.componentFactoryResolver || this._componentFactoryResolver; |
||||
|
const componentFactory = resolver.resolveComponentFactory(portal.component); |
||||
|
let componentRef; |
||||
|
// If the portal specifies a ViewContainerRef, we will use that as the attachment point
|
||||
|
// for the component (in terms of Angular's component tree, not rendering).
|
||||
|
// When the ViewContainerRef is missing, we use the factory to create the component directly
|
||||
|
// and then manually attach the view to the application.
|
||||
|
if (portal.viewContainerRef) { |
||||
|
componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.injector); |
||||
|
this.setDisposeFn(() => componentRef.destroy()); |
||||
|
} |
||||
|
else { |
||||
|
componentRef = componentFactory.create(portal.injector || this._defaultInjector); |
||||
|
this._appRef.attachView(componentRef.hostView); |
||||
|
this.setDisposeFn(() => { |
||||
|
this._appRef.detachView(componentRef.hostView); |
||||
|
componentRef.destroy(); |
||||
|
}); |
||||
|
} |
||||
|
// At this point the component has been instantiated, so we move it to the location in the DOM
|
||||
|
// where we want it to be rendered.
|
||||
|
this.outletElement.appendChild(this._getComponentRootNode(componentRef)); |
||||
|
this._attachedPortal = portal; |
||||
|
return componentRef; |
||||
|
} |
||||
|
/** |
||||
|
* Attaches a template portal to the DOM as an embedded view. |
||||
|
* @param portal Portal to be attached. |
||||
|
* @returns Reference to the created embedded view. |
||||
|
*/ |
||||
|
attachTemplatePortal(portal) { |
||||
|
let viewContainer = portal.viewContainerRef; |
||||
|
let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context); |
||||
|
// The method `createEmbeddedView` will add the view as a child of the viewContainer.
|
||||
|
// But for the DomPortalOutlet the view can be added everywhere in the DOM
|
||||
|
// (e.g Overlay Container) To move the view to the specified host element. We just
|
||||
|
// re-append the existing root nodes.
|
||||
|
viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode)); |
||||
|
// Note that we want to detect changes after the nodes have been moved so that
|
||||
|
// any directives inside the portal that are looking at the DOM inside a lifecycle
|
||||
|
// hook won't be invoked too early.
|
||||
|
viewRef.detectChanges(); |
||||
|
this.setDisposeFn((() => { |
||||
|
let index = viewContainer.indexOf(viewRef); |
||||
|
if (index !== -1) { |
||||
|
viewContainer.remove(index); |
||||
|
} |
||||
|
})); |
||||
|
this._attachedPortal = portal; |
||||
|
// TODO(jelbourn): Return locals from view.
|
||||
|
return viewRef; |
||||
|
} |
||||
|
/** |
||||
|
* Clears out a portal from the DOM. |
||||
|
*/ |
||||
|
dispose() { |
||||
|
super.dispose(); |
||||
|
if (this.outletElement.parentNode != null) { |
||||
|
this.outletElement.parentNode.removeChild(this.outletElement); |
||||
|
} |
||||
|
} |
||||
|
/** Gets the root HTMLElement for an instantiated component. */ |
||||
|
_getComponentRootNode(componentRef) { |
||||
|
return componentRef.hostView.rootNodes[0]; |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* @deprecated Use `DomPortalOutlet` instead. |
||||
|
* @breaking-change 9.0.0 |
||||
|
*/ |
||||
|
class DomPortalHost extends DomPortalOutlet { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal, |
||||
|
* the directive instance itself can be attached to a host, enabling declarative use of portals. |
||||
|
*/ |
||||
|
class CdkPortal extends TemplatePortal { |
||||
|
constructor(templateRef, viewContainerRef) { |
||||
|
super(templateRef, viewContainerRef); |
||||
|
} |
||||
|
} |
||||
|
CdkPortal.ɵfac = function CdkPortal_Factory(t) { return new (t || CdkPortal)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.TemplateRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ViewContainerRef)); }; |
||||
|
CdkPortal.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkPortal, selectors: [["", "cdkPortal", ""]], exportAs: ["cdkPortal"], features: [ɵngcc0.ɵɵInheritDefinitionFeature] }); |
||||
|
CdkPortal.ctorParameters = () => [ |
||||
|
{ type: TemplateRef }, |
||||
|
{ type: ViewContainerRef } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkPortal, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkPortal]', |
||||
|
exportAs: 'cdkPortal' |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.TemplateRef }, { type: ɵngcc0.ViewContainerRef }]; }, null); })(); |
||||
|
/** |
||||
|
* @deprecated Use `CdkPortal` instead. |
||||
|
* @breaking-change 9.0.0 |
||||
|
*/ |
||||
|
class TemplatePortalDirective extends CdkPortal { |
||||
|
} |
||||
|
TemplatePortalDirective.ɵfac = /*@__PURE__*/ function () { let ɵTemplatePortalDirective_BaseFactory; return function TemplatePortalDirective_Factory(t) { return (ɵTemplatePortalDirective_BaseFactory || (ɵTemplatePortalDirective_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(TemplatePortalDirective)))(t || TemplatePortalDirective); }; }(); |
||||
|
TemplatePortalDirective.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: TemplatePortalDirective, selectors: [["", "cdk-portal", ""], ["", "portal", ""]], exportAs: ["cdkPortal"], features: [ɵngcc0.ɵɵProvidersFeature([{ |
||||
|
provide: CdkPortal, |
||||
|
useExisting: TemplatePortalDirective |
||||
|
}]), ɵngcc0.ɵɵInheritDefinitionFeature] }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TemplatePortalDirective, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdk-portal], [portal]', |
||||
|
exportAs: 'cdkPortal', |
||||
|
providers: [{ |
||||
|
provide: CdkPortal, |
||||
|
useExisting: TemplatePortalDirective |
||||
|
}] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
/** |
||||
|
* Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be |
||||
|
* directly attached to it, enabling declarative use. |
||||
|
* |
||||
|
* Usage: |
||||
|
* `<ng-template [cdkPortalOutlet]="greeting"></ng-template>` |
||||
|
*/ |
||||
|
class CdkPortalOutlet extends BasePortalOutlet { |
||||
|
constructor(_componentFactoryResolver, _viewContainerRef, |
||||
|
/** |
||||
|
* @deprecated `_document` parameter to be made required. |
||||
|
* @breaking-change 9.0.0 |
||||
|
*/ |
||||
|
_document) { |
||||
|
super(); |
||||
|
this._componentFactoryResolver = _componentFactoryResolver; |
||||
|
this._viewContainerRef = _viewContainerRef; |
||||
|
/** Whether the portal component is initialized. */ |
||||
|
this._isInitialized = false; |
||||
|
/** Emits when a portal is attached to the outlet. */ |
||||
|
this.attached = new EventEmitter(); |
||||
|
/** |
||||
|
* Attaches the given DomPortal to this PortalHost by moving all of the portal content into it. |
||||
|
* @param portal Portal to be attached. |
||||
|
* @deprecated To be turned into a method. |
||||
|
* @breaking-change 10.0.0 |
||||
|
*/ |
||||
|
this.attachDomPortal = (portal) => { |
||||
|
// @breaking-change 9.0.0 Remove check and error once the
|
||||
|
// `_document` constructor parameter is required.
|
||||
|
if (!this._document && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw Error('Cannot attach DOM portal without _document constructor parameter'); |
||||
|
} |
||||
|
const element = portal.element; |
||||
|
if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw Error('DOM portal content must be attached to a parent node.'); |
||||
|
} |
||||
|
// Anchor used to save the element's previous position so
|
||||
|
// that we can restore it when the portal is detached.
|
||||
|
const anchorNode = this._document.createComment('dom-portal'); |
||||
|
portal.setAttachedHost(this); |
||||
|
element.parentNode.insertBefore(anchorNode, element); |
||||
|
this._getRootNode().appendChild(element); |
||||
|
this._attachedPortal = portal; |
||||
|
super.setDisposeFn(() => { |
||||
|
if (anchorNode.parentNode) { |
||||
|
anchorNode.parentNode.replaceChild(element, anchorNode); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
this._document = _document; |
||||
|
} |
||||
|
/** Portal associated with the Portal outlet. */ |
||||
|
get portal() { |
||||
|
return this._attachedPortal; |
||||
|
} |
||||
|
set portal(portal) { |
||||
|
// Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have
|
||||
|
// run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`
|
||||
|
// and attach a portal programmatically in the parent component. When Angular does the first CD
|
||||
|
// round, it will fire the setter with empty string, causing the user's content to be cleared.
|
||||
|
if (this.hasAttached() && !portal && !this._isInitialized) { |
||||
|
return; |
||||
|
} |
||||
|
if (this.hasAttached()) { |
||||
|
super.detach(); |
||||
|
} |
||||
|
if (portal) { |
||||
|
super.attach(portal); |
||||
|
} |
||||
|
this._attachedPortal = portal; |
||||
|
} |
||||
|
/** Component or view reference that is attached to the portal. */ |
||||
|
get attachedRef() { |
||||
|
return this._attachedRef; |
||||
|
} |
||||
|
ngOnInit() { |
||||
|
this._isInitialized = true; |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
super.dispose(); |
||||
|
this._attachedPortal = null; |
||||
|
this._attachedRef = null; |
||||
|
} |
||||
|
/** |
||||
|
* Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver. |
||||
|
* |
||||
|
* @param portal Portal to be attached to the portal outlet. |
||||
|
* @returns Reference to the created component. |
||||
|
*/ |
||||
|
attachComponentPortal(portal) { |
||||
|
portal.setAttachedHost(this); |
||||
|
// If the portal specifies an origin, use that as the logical location of the component
|
||||
|
// in the application tree. Otherwise use the location of this PortalOutlet.
|
||||
|
const viewContainerRef = portal.viewContainerRef != null ? |
||||
|
portal.viewContainerRef : |
||||
|
this._viewContainerRef; |
||||
|
const resolver = portal.componentFactoryResolver || this._componentFactoryResolver; |
||||
|
const componentFactory = resolver.resolveComponentFactory(portal.component); |
||||
|
const ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.injector); |
||||
|
// If we're using a view container that's different from the injected one (e.g. when the portal
|
||||
|
// specifies its own) we need to move the component into the outlet, otherwise it'll be rendered
|
||||
|
// inside of the alternate view container.
|
||||
|
if (viewContainerRef !== this._viewContainerRef) { |
||||
|
this._getRootNode().appendChild(ref.hostView.rootNodes[0]); |
||||
|
} |
||||
|
super.setDisposeFn(() => ref.destroy()); |
||||
|
this._attachedPortal = portal; |
||||
|
this._attachedRef = ref; |
||||
|
this.attached.emit(ref); |
||||
|
return ref; |
||||
|
} |
||||
|
/** |
||||
|
* Attach the given TemplatePortal to this PortalHost as an embedded View. |
||||
|
* @param portal Portal to be attached. |
||||
|
* @returns Reference to the created embedded view. |
||||
|
*/ |
||||
|
attachTemplatePortal(portal) { |
||||
|
portal.setAttachedHost(this); |
||||
|
const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context); |
||||
|
super.setDisposeFn(() => this._viewContainerRef.clear()); |
||||
|
this._attachedPortal = portal; |
||||
|
this._attachedRef = viewRef; |
||||
|
this.attached.emit(viewRef); |
||||
|
return viewRef; |
||||
|
} |
||||
|
/** Gets the root node of the portal outlet. */ |
||||
|
_getRootNode() { |
||||
|
const nativeElement = this._viewContainerRef.element.nativeElement; |
||||
|
// The directive could be set on a template which will result in a comment
|
||||
|
// node being the root. Use the comment's parent node if that is the case.
|
||||
|
return (nativeElement.nodeType === nativeElement.ELEMENT_NODE ? |
||||
|
nativeElement : nativeElement.parentNode); |
||||
|
} |
||||
|
} |
||||
|
CdkPortalOutlet.ɵfac = function CdkPortalOutlet_Factory(t) { return new (t || CdkPortalOutlet)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ComponentFactoryResolver), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ViewContainerRef), ɵngcc0.ɵɵdirectiveInject(DOCUMENT)); }; |
||||
|
CdkPortalOutlet.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkPortalOutlet, selectors: [["", "cdkPortalOutlet", ""]], inputs: { portal: ["cdkPortalOutlet", "portal"] }, outputs: { attached: "attached" }, exportAs: ["cdkPortalOutlet"], features: [ɵngcc0.ɵɵInheritDefinitionFeature] }); |
||||
|
CdkPortalOutlet.ctorParameters = () => [ |
||||
|
{ type: ComponentFactoryResolver }, |
||||
|
{ type: ViewContainerRef }, |
||||
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] } |
||||
|
]; |
||||
|
CdkPortalOutlet.propDecorators = { |
||||
|
attached: [{ type: Output }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkPortalOutlet, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkPortalOutlet]', |
||||
|
exportAs: 'cdkPortalOutlet', |
||||
|
inputs: ['portal: cdkPortalOutlet'] |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.ComponentFactoryResolver }, { type: ɵngcc0.ViewContainerRef }, { type: undefined, decorators: [{ |
||||
|
type: Inject, |
||||
|
args: [DOCUMENT] |
||||
|
}] }]; }, { attached: [{ |
||||
|
type: Output |
||||
|
}] }); })(); |
||||
|
/** |
||||
|
* @deprecated Use `CdkPortalOutlet` instead. |
||||
|
* @breaking-change 9.0.0 |
||||
|
*/ |
||||
|
class PortalHostDirective extends CdkPortalOutlet { |
||||
|
} |
||||
|
PortalHostDirective.ɵfac = /*@__PURE__*/ function () { let ɵPortalHostDirective_BaseFactory; return function PortalHostDirective_Factory(t) { return (ɵPortalHostDirective_BaseFactory || (ɵPortalHostDirective_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(PortalHostDirective)))(t || PortalHostDirective); }; }(); |
||||
|
PortalHostDirective.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: PortalHostDirective, selectors: [["", "cdkPortalHost", ""], ["", "portalHost", ""]], inputs: { portal: ["cdkPortalHost", "portal"] }, exportAs: ["cdkPortalHost"], features: [ɵngcc0.ɵɵProvidersFeature([{ |
||||
|
provide: CdkPortalOutlet, |
||||
|
useExisting: PortalHostDirective |
||||
|
}]), ɵngcc0.ɵɵInheritDefinitionFeature] }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(PortalHostDirective, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkPortalHost], [portalHost]', |
||||
|
exportAs: 'cdkPortalHost', |
||||
|
inputs: ['portal: cdkPortalHost'], |
||||
|
providers: [{ |
||||
|
provide: CdkPortalOutlet, |
||||
|
useExisting: PortalHostDirective |
||||
|
}] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
class PortalModule { |
||||
|
} |
||||
|
PortalModule.ɵfac = function PortalModule_Factory(t) { return new (t || PortalModule)(); }; |
||||
|
PortalModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: PortalModule }); |
||||
|
PortalModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({}); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(PortalModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective], |
||||
|
declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(PortalModule, { declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective], exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Custom injector to be used when providing custom |
||||
|
* injection tokens to components inside a portal. |
||||
|
* @docs-private |
||||
|
* @deprecated Use `Injector.create` instead. |
||||
|
* @breaking-change 11.0.0 |
||||
|
*/ |
||||
|
class PortalInjector { |
||||
|
constructor(_parentInjector, _customTokens) { |
||||
|
this._parentInjector = _parentInjector; |
||||
|
this._customTokens = _customTokens; |
||||
|
} |
||||
|
get(token, notFoundValue) { |
||||
|
const value = this._customTokens.get(token); |
||||
|
if (typeof value !== 'undefined') { |
||||
|
return value; |
||||
|
} |
||||
|
return this._parentInjector.get(token, notFoundValue); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { BasePortalHost, BasePortalOutlet, CdkPortal, CdkPortalOutlet, ComponentPortal, DomPortal, DomPortalHost, DomPortalOutlet, Portal, PortalHostDirective, PortalInjector, PortalModule, TemplatePortal, TemplatePortalDirective }; |
||||
|
|
||||
|
//# sourceMappingURL=portal.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/portal.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1481
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/scrolling.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/scrolling.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,732 @@ |
|||||
|
import { FocusKeyManager } from '@angular/cdk/a11y'; |
||||
|
import { Directionality, BidiModule } from '@angular/cdk/bidi'; |
||||
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion'; |
||||
|
import { hasModifierKey, SPACE, ENTER } from '@angular/cdk/keycodes'; |
||||
|
import { DOCUMENT } from '@angular/common'; |
||||
|
import { Directive, ElementRef, TemplateRef, InjectionToken, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Inject, forwardRef, Optional, ContentChild, ViewChild, Input, Output, QueryList, ChangeDetectorRef, ContentChildren, HostListener, NgModule } from '@angular/core'; |
||||
|
import { _getFocusedElementPierceShadowDom } from '@angular/cdk/platform'; |
||||
|
import { Subject, of } from 'rxjs'; |
||||
|
import { startWith, takeUntil } from 'rxjs/operators'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
import * as ɵngcc1 from '@angular/cdk/bidi'; |
||||
|
|
||||
|
function CdkStep_ng_template_0_Template(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵprojection(0); |
||||
|
} } |
||||
|
const _c0 = ["*"]; |
||||
|
class CdkStepHeader { |
||||
|
constructor(_elementRef) { |
||||
|
this._elementRef = _elementRef; |
||||
|
} |
||||
|
/** Focuses the step header. */ |
||||
|
focus() { |
||||
|
this._elementRef.nativeElement.focus(); |
||||
|
} |
||||
|
} |
||||
|
CdkStepHeader.ɵfac = function CdkStepHeader_Factory(t) { return new (t || CdkStepHeader)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef)); }; |
||||
|
CdkStepHeader.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkStepHeader, selectors: [["", "cdkStepHeader", ""]], hostAttrs: ["role", "tab"] }); |
||||
|
CdkStepHeader.ctorParameters = () => [ |
||||
|
{ type: ElementRef } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepHeader, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkStepHeader]', |
||||
|
host: { |
||||
|
'role': 'tab' |
||||
|
} |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.ElementRef }]; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class CdkStepLabel { |
||||
|
constructor(/** @docs-private */ template) { |
||||
|
this.template = template; |
||||
|
} |
||||
|
} |
||||
|
CdkStepLabel.ɵfac = function CdkStepLabel_Factory(t) { return new (t || CdkStepLabel)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.TemplateRef)); }; |
||||
|
CdkStepLabel.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkStepLabel, selectors: [["", "cdkStepLabel", ""]] }); |
||||
|
CdkStepLabel.ctorParameters = () => [ |
||||
|
{ type: TemplateRef } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepLabel, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkStepLabel]' |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.TemplateRef }]; }, null); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Used to generate unique ID for each stepper component. */ |
||||
|
let nextId = 0; |
||||
|
/** Change event emitted on selection changes. */ |
||||
|
class StepperSelectionEvent { |
||||
|
} |
||||
|
/** Enum to represent the different states of the steps. */ |
||||
|
const STEP_STATE = { |
||||
|
NUMBER: 'number', |
||||
|
EDIT: 'edit', |
||||
|
DONE: 'done', |
||||
|
ERROR: 'error' |
||||
|
}; |
||||
|
/** InjectionToken that can be used to specify the global stepper options. */ |
||||
|
const STEPPER_GLOBAL_OPTIONS = new InjectionToken('STEPPER_GLOBAL_OPTIONS'); |
||||
|
class CdkStep { |
||||
|
constructor(_stepper, stepperOptions) { |
||||
|
this._stepper = _stepper; |
||||
|
/** Whether user has attempted to move away from the step. */ |
||||
|
this.interacted = false; |
||||
|
/** Emits when the user has attempted to move away from the step. */ |
||||
|
this.interactedStream = new EventEmitter(); |
||||
|
this._editable = true; |
||||
|
this._optional = false; |
||||
|
this._completedOverride = null; |
||||
|
this._customError = null; |
||||
|
this._stepperOptions = stepperOptions ? stepperOptions : {}; |
||||
|
this._displayDefaultIndicatorType = this._stepperOptions.displayDefaultIndicatorType !== false; |
||||
|
} |
||||
|
/** Whether the user can return to this step once it has been marked as completed. */ |
||||
|
get editable() { |
||||
|
return this._editable; |
||||
|
} |
||||
|
set editable(value) { |
||||
|
this._editable = coerceBooleanProperty(value); |
||||
|
} |
||||
|
/** Whether the completion of step is optional. */ |
||||
|
get optional() { |
||||
|
return this._optional; |
||||
|
} |
||||
|
set optional(value) { |
||||
|
this._optional = coerceBooleanProperty(value); |
||||
|
} |
||||
|
/** Whether step is marked as completed. */ |
||||
|
get completed() { |
||||
|
return this._completedOverride == null ? this._getDefaultCompleted() : this._completedOverride; |
||||
|
} |
||||
|
set completed(value) { |
||||
|
this._completedOverride = coerceBooleanProperty(value); |
||||
|
} |
||||
|
_getDefaultCompleted() { |
||||
|
return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted; |
||||
|
} |
||||
|
/** Whether step has an error. */ |
||||
|
get hasError() { |
||||
|
return this._customError == null ? this._getDefaultError() : this._customError; |
||||
|
} |
||||
|
set hasError(value) { |
||||
|
this._customError = coerceBooleanProperty(value); |
||||
|
} |
||||
|
_getDefaultError() { |
||||
|
return this.stepControl && this.stepControl.invalid && this.interacted; |
||||
|
} |
||||
|
/** Selects this step component. */ |
||||
|
select() { |
||||
|
this._stepper.selected = this; |
||||
|
} |
||||
|
/** Resets the step to its initial state. Note that this includes resetting form data. */ |
||||
|
reset() { |
||||
|
this.interacted = false; |
||||
|
if (this._completedOverride != null) { |
||||
|
this._completedOverride = false; |
||||
|
} |
||||
|
if (this._customError != null) { |
||||
|
this._customError = false; |
||||
|
} |
||||
|
if (this.stepControl) { |
||||
|
this.stepControl.reset(); |
||||
|
} |
||||
|
} |
||||
|
ngOnChanges() { |
||||
|
// Since basically all inputs of the MatStep get proxied through the view down to the
|
||||
|
// underlying MatStepHeader, we have to make sure that change detection runs correctly.
|
||||
|
this._stepper._stateChanged(); |
||||
|
} |
||||
|
_markAsInteracted() { |
||||
|
if (!this.interacted) { |
||||
|
this.interacted = true; |
||||
|
this.interactedStream.emit(this); |
||||
|
} |
||||
|
} |
||||
|
/** Determines whether the error state can be shown. */ |
||||
|
_showError() { |
||||
|
var _a; |
||||
|
// We want to show the error state either if the user opted into/out of it using the
|
||||
|
// global options, or if they've explicitly set it through the `hasError` input.
|
||||
|
return (_a = this._stepperOptions.showError) !== null && _a !== void 0 ? _a : this._customError != null; |
||||
|
} |
||||
|
} |
||||
|
CdkStep.ɵfac = function CdkStep_Factory(t) { return new (t || CdkStep)(ɵngcc0.ɵɵdirectiveInject(forwardRef(() => CdkStepper)), ɵngcc0.ɵɵdirectiveInject(STEPPER_GLOBAL_OPTIONS, 8)); }; |
||||
|
CdkStep.ɵcmp = /*@__PURE__*/ ɵngcc0.ɵɵdefineComponent({ type: CdkStep, selectors: [["cdk-step"]], contentQueries: function CdkStep_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵcontentQuery(dirIndex, CdkStepLabel, 5); |
||||
|
} if (rf & 2) { |
||||
|
let _t; |
||||
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.stepLabel = _t.first); |
||||
|
} }, viewQuery: function CdkStep_Query(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵviewQuery(TemplateRef, 7); |
||||
|
} if (rf & 2) { |
||||
|
let _t; |
||||
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.content = _t.first); |
||||
|
} }, inputs: { editable: "editable", optional: "optional", completed: "completed", hasError: "hasError", stepControl: "stepControl", label: "label", errorMessage: "errorMessage", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], state: "state" }, outputs: { interactedStream: "interacted" }, exportAs: ["cdkStep"], features: [ɵngcc0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0, decls: 1, vars: 0, template: function CdkStep_Template(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵprojectionDef(); |
||||
|
ɵngcc0.ɵɵtemplate(0, CdkStep_ng_template_0_Template, 1, 0, "ng-template"); |
||||
|
} }, encapsulation: 2, changeDetection: 0 }); |
||||
|
CdkStep.ctorParameters = () => [ |
||||
|
{ type: CdkStepper, decorators: [{ type: Inject, args: [forwardRef(() => CdkStepper),] }] }, |
||||
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [STEPPER_GLOBAL_OPTIONS,] }] } |
||||
|
]; |
||||
|
CdkStep.propDecorators = { |
||||
|
stepLabel: [{ type: ContentChild, args: [CdkStepLabel,] }], |
||||
|
content: [{ type: ViewChild, args: [TemplateRef, { static: true },] }], |
||||
|
stepControl: [{ type: Input }], |
||||
|
interactedStream: [{ type: Output, args: ['interacted',] }], |
||||
|
label: [{ type: Input }], |
||||
|
errorMessage: [{ type: Input }], |
||||
|
ariaLabel: [{ type: Input, args: ['aria-label',] }], |
||||
|
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }], |
||||
|
state: [{ type: Input }], |
||||
|
editable: [{ type: Input }], |
||||
|
optional: [{ type: Input }], |
||||
|
completed: [{ type: Input }], |
||||
|
hasError: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStep, [{ |
||||
|
type: Component, |
||||
|
args: [{ |
||||
|
selector: 'cdk-step', |
||||
|
exportAs: 'cdkStep', |
||||
|
template: '<ng-template><ng-content></ng-content></ng-template>', |
||||
|
encapsulation: ViewEncapsulation.None, |
||||
|
changeDetection: ChangeDetectionStrategy.OnPush |
||||
|
}] |
||||
|
}], function () { return [{ type: CdkStepper, decorators: [{ |
||||
|
type: Inject, |
||||
|
args: [forwardRef(() => CdkStepper)] |
||||
|
}] }, { type: undefined, decorators: [{ |
||||
|
type: Optional |
||||
|
}, { |
||||
|
type: Inject, |
||||
|
args: [STEPPER_GLOBAL_OPTIONS] |
||||
|
}] }]; }, { interactedStream: [{ |
||||
|
type: Output, |
||||
|
args: ['interacted'] |
||||
|
}], editable: [{ |
||||
|
type: Input |
||||
|
}], optional: [{ |
||||
|
type: Input |
||||
|
}], completed: [{ |
||||
|
type: Input |
||||
|
}], hasError: [{ |
||||
|
type: Input |
||||
|
}], stepLabel: [{ |
||||
|
type: ContentChild, |
||||
|
args: [CdkStepLabel] |
||||
|
}], content: [{ |
||||
|
type: ViewChild, |
||||
|
args: [TemplateRef, { static: true }] |
||||
|
}], stepControl: [{ |
||||
|
type: Input |
||||
|
}], label: [{ |
||||
|
type: Input |
||||
|
}], errorMessage: [{ |
||||
|
type: Input |
||||
|
}], ariaLabel: [{ |
||||
|
type: Input, |
||||
|
args: ['aria-label'] |
||||
|
}], ariaLabelledby: [{ |
||||
|
type: Input, |
||||
|
args: ['aria-labelledby'] |
||||
|
}], state: [{ |
||||
|
type: Input |
||||
|
}] }); })(); |
||||
|
class CdkStepper { |
||||
|
constructor(_dir, _changeDetectorRef, _elementRef, |
||||
|
/** |
||||
|
* @deprecated No longer in use, to be removed. |
||||
|
* @breaking-change 13.0.0 |
||||
|
*/ |
||||
|
_document) { |
||||
|
this._dir = _dir; |
||||
|
this._changeDetectorRef = _changeDetectorRef; |
||||
|
this._elementRef = _elementRef; |
||||
|
/** Emits when the component is destroyed. */ |
||||
|
this._destroyed = new Subject(); |
||||
|
/** Steps that belong to the current stepper, excluding ones from nested steppers. */ |
||||
|
this.steps = new QueryList(); |
||||
|
/** List of step headers sorted based on their DOM order. */ |
||||
|
this._sortedHeaders = new QueryList(); |
||||
|
this._linear = false; |
||||
|
this._selectedIndex = 0; |
||||
|
/** Event emitted when the selected step has changed. */ |
||||
|
this.selectionChange = new EventEmitter(); |
||||
|
/** |
||||
|
* @deprecated To be turned into a private property. Use `orientation` instead. |
||||
|
* @breaking-change 13.0.0 |
||||
|
*/ |
||||
|
this._orientation = 'horizontal'; |
||||
|
this._groupId = nextId++; |
||||
|
} |
||||
|
/** Whether the validity of previous steps should be checked or not. */ |
||||
|
get linear() { |
||||
|
return this._linear; |
||||
|
} |
||||
|
set linear(value) { |
||||
|
this._linear = coerceBooleanProperty(value); |
||||
|
} |
||||
|
/** The index of the selected step. */ |
||||
|
get selectedIndex() { |
||||
|
return this._selectedIndex; |
||||
|
} |
||||
|
set selectedIndex(index) { |
||||
|
var _a; |
||||
|
const newIndex = coerceNumberProperty(index); |
||||
|
if (this.steps && this._steps) { |
||||
|
// Ensure that the index can't be out of bounds.
|
||||
|
if (!this._isValidIndex(index) && (typeof ngDevMode === 'undefined' || ngDevMode)) { |
||||
|
throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.'); |
||||
|
} |
||||
|
(_a = this.selected) === null || _a === void 0 ? void 0 : _a._markAsInteracted(); |
||||
|
if (this._selectedIndex !== newIndex && !this._anyControlsInvalidOrPending(newIndex) && |
||||
|
(newIndex >= this._selectedIndex || this.steps.toArray()[newIndex].editable)) { |
||||
|
this._updateSelectedItemIndex(index); |
||||
|
} |
||||
|
} |
||||
|
else { |
||||
|
this._selectedIndex = newIndex; |
||||
|
} |
||||
|
} |
||||
|
/** The step that is selected. */ |
||||
|
get selected() { |
||||
|
return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined; |
||||
|
} |
||||
|
set selected(step) { |
||||
|
this.selectedIndex = (step && this.steps) ? this.steps.toArray().indexOf(step) : -1; |
||||
|
} |
||||
|
/** Orientation of the stepper. */ |
||||
|
get orientation() { return this._orientation; } |
||||
|
set orientation(value) { |
||||
|
// This is a protected method so that `MatSteppter` can hook into it.
|
||||
|
this._orientation = value; |
||||
|
if (this._keyManager) { |
||||
|
this._keyManager.withVerticalOrientation(value === 'vertical'); |
||||
|
} |
||||
|
} |
||||
|
ngAfterContentInit() { |
||||
|
this._steps.changes |
||||
|
.pipe(startWith(this._steps), takeUntil(this._destroyed)) |
||||
|
.subscribe((steps) => { |
||||
|
this.steps.reset(steps.filter(step => step._stepper === this)); |
||||
|
this.steps.notifyOnChanges(); |
||||
|
}); |
||||
|
} |
||||
|
ngAfterViewInit() { |
||||
|
// If the step headers are defined outside of the `ngFor` that renders the steps, like in the
|
||||
|
// Material stepper, they won't appear in the `QueryList` in the same order as they're
|
||||
|
// rendered in the DOM which will lead to incorrect keyboard navigation. We need to sort
|
||||
|
// them manually to ensure that they're correct. Alternatively, we can change the Material
|
||||
|
// template to inline the headers in the `ngFor`, but that'll result in a lot of
|
||||
|
// code duplciation. See #23539.
|
||||
|
this._stepHeader.changes |
||||
|
.pipe(startWith(this._stepHeader), takeUntil(this._destroyed)) |
||||
|
.subscribe((headers) => { |
||||
|
this._sortedHeaders.reset(headers.toArray().sort((a, b) => { |
||||
|
const documentPosition = a._elementRef.nativeElement.compareDocumentPosition(b._elementRef.nativeElement); |
||||
|
// `compareDocumentPosition` returns a bitmask so we have to use a bitwise operator.
|
||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
|
||||
|
// tslint:disable-next-line:no-bitwise
|
||||
|
return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; |
||||
|
})); |
||||
|
this._sortedHeaders.notifyOnChanges(); |
||||
|
}); |
||||
|
// Note that while the step headers are content children by default, any components that
|
||||
|
// extend this one might have them as view children. We initialize the keyboard handling in
|
||||
|
// AfterViewInit so we're guaranteed for both view and content children to be defined.
|
||||
|
this._keyManager = new FocusKeyManager(this._sortedHeaders) |
||||
|
.withWrap() |
||||
|
.withHomeAndEnd() |
||||
|
.withVerticalOrientation(this._orientation === 'vertical'); |
||||
|
(this._dir ? this._dir.change : of()) |
||||
|
.pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed)) |
||||
|
.subscribe(direction => this._keyManager.withHorizontalOrientation(direction)); |
||||
|
this._keyManager.updateActiveItem(this._selectedIndex); |
||||
|
// No need to `takeUntil` here, because we're the ones destroying `steps`.
|
||||
|
this.steps.changes.subscribe(() => { |
||||
|
if (!this.selected) { |
||||
|
this._selectedIndex = Math.max(this._selectedIndex - 1, 0); |
||||
|
} |
||||
|
}); |
||||
|
// The logic which asserts that the selected index is within bounds doesn't run before the
|
||||
|
// steps are initialized, because we don't how many steps there are yet so we may have an
|
||||
|
// invalid index on init. If that's the case, auto-correct to the default so we don't throw.
|
||||
|
if (!this._isValidIndex(this._selectedIndex)) { |
||||
|
this._selectedIndex = 0; |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this.steps.destroy(); |
||||
|
this._sortedHeaders.destroy(); |
||||
|
this._destroyed.next(); |
||||
|
this._destroyed.complete(); |
||||
|
} |
||||
|
/** Selects and focuses the next step in list. */ |
||||
|
next() { |
||||
|
this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1); |
||||
|
} |
||||
|
/** Selects and focuses the previous step in list. */ |
||||
|
previous() { |
||||
|
this.selectedIndex = Math.max(this._selectedIndex - 1, 0); |
||||
|
} |
||||
|
/** Resets the stepper to its initial state. Note that this includes clearing form data. */ |
||||
|
reset() { |
||||
|
this._updateSelectedItemIndex(0); |
||||
|
this.steps.forEach(step => step.reset()); |
||||
|
this._stateChanged(); |
||||
|
} |
||||
|
/** Returns a unique id for each step label element. */ |
||||
|
_getStepLabelId(i) { |
||||
|
return `cdk-step-label-${this._groupId}-${i}`; |
||||
|
} |
||||
|
/** Returns unique id for each step content element. */ |
||||
|
_getStepContentId(i) { |
||||
|
return `cdk-step-content-${this._groupId}-${i}`; |
||||
|
} |
||||
|
/** Marks the component to be change detected. */ |
||||
|
_stateChanged() { |
||||
|
this._changeDetectorRef.markForCheck(); |
||||
|
} |
||||
|
/** Returns position state of the step with the given index. */ |
||||
|
_getAnimationDirection(index) { |
||||
|
const position = index - this._selectedIndex; |
||||
|
if (position < 0) { |
||||
|
return this._layoutDirection() === 'rtl' ? 'next' : 'previous'; |
||||
|
} |
||||
|
else if (position > 0) { |
||||
|
return this._layoutDirection() === 'rtl' ? 'previous' : 'next'; |
||||
|
} |
||||
|
return 'current'; |
||||
|
} |
||||
|
/** Returns the type of icon to be displayed. */ |
||||
|
_getIndicatorType(index, state = STEP_STATE.NUMBER) { |
||||
|
const step = this.steps.toArray()[index]; |
||||
|
const isCurrentStep = this._isCurrentStep(index); |
||||
|
return step._displayDefaultIndicatorType ? this._getDefaultIndicatorLogic(step, isCurrentStep) : |
||||
|
this._getGuidelineLogic(step, isCurrentStep, state); |
||||
|
} |
||||
|
_getDefaultIndicatorLogic(step, isCurrentStep) { |
||||
|
if (step._showError() && step.hasError && !isCurrentStep) { |
||||
|
return STEP_STATE.ERROR; |
||||
|
} |
||||
|
else if (!step.completed || isCurrentStep) { |
||||
|
return STEP_STATE.NUMBER; |
||||
|
} |
||||
|
else { |
||||
|
return step.editable ? STEP_STATE.EDIT : STEP_STATE.DONE; |
||||
|
} |
||||
|
} |
||||
|
_getGuidelineLogic(step, isCurrentStep, state = STEP_STATE.NUMBER) { |
||||
|
if (step._showError() && step.hasError && !isCurrentStep) { |
||||
|
return STEP_STATE.ERROR; |
||||
|
} |
||||
|
else if (step.completed && !isCurrentStep) { |
||||
|
return STEP_STATE.DONE; |
||||
|
} |
||||
|
else if (step.completed && isCurrentStep) { |
||||
|
return state; |
||||
|
} |
||||
|
else if (step.editable && isCurrentStep) { |
||||
|
return STEP_STATE.EDIT; |
||||
|
} |
||||
|
else { |
||||
|
return state; |
||||
|
} |
||||
|
} |
||||
|
_isCurrentStep(index) { |
||||
|
return this._selectedIndex === index; |
||||
|
} |
||||
|
/** Returns the index of the currently-focused step header. */ |
||||
|
_getFocusIndex() { |
||||
|
return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex; |
||||
|
} |
||||
|
_updateSelectedItemIndex(newIndex) { |
||||
|
const stepsArray = this.steps.toArray(); |
||||
|
this.selectionChange.emit({ |
||||
|
selectedIndex: newIndex, |
||||
|
previouslySelectedIndex: this._selectedIndex, |
||||
|
selectedStep: stepsArray[newIndex], |
||||
|
previouslySelectedStep: stepsArray[this._selectedIndex], |
||||
|
}); |
||||
|
// If focus is inside the stepper, move it to the next header, otherwise it may become
|
||||
|
// lost when the active step content is hidden. We can't be more granular with the check
|
||||
|
// (e.g. checking whether focus is inside the active step), because we don't have a
|
||||
|
// reference to the elements that are rendering out the content.
|
||||
|
this._containsFocus() ? this._keyManager.setActiveItem(newIndex) : |
||||
|
this._keyManager.updateActiveItem(newIndex); |
||||
|
this._selectedIndex = newIndex; |
||||
|
this._stateChanged(); |
||||
|
} |
||||
|
_onKeydown(event) { |
||||
|
const hasModifier = hasModifierKey(event); |
||||
|
const keyCode = event.keyCode; |
||||
|
const manager = this._keyManager; |
||||
|
if (manager.activeItemIndex != null && !hasModifier && |
||||
|
(keyCode === SPACE || keyCode === ENTER)) { |
||||
|
this.selectedIndex = manager.activeItemIndex; |
||||
|
event.preventDefault(); |
||||
|
} |
||||
|
else { |
||||
|
manager.onKeydown(event); |
||||
|
} |
||||
|
} |
||||
|
_anyControlsInvalidOrPending(index) { |
||||
|
if (this._linear && index >= 0) { |
||||
|
return this.steps.toArray().slice(0, index).some(step => { |
||||
|
const control = step.stepControl; |
||||
|
const isIncomplete = control ? (control.invalid || control.pending || !step.interacted) : !step.completed; |
||||
|
return isIncomplete && !step.optional && !step._completedOverride; |
||||
|
}); |
||||
|
} |
||||
|
return false; |
||||
|
} |
||||
|
_layoutDirection() { |
||||
|
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr'; |
||||
|
} |
||||
|
/** Checks whether the stepper contains the focused element. */ |
||||
|
_containsFocus() { |
||||
|
const stepperElement = this._elementRef.nativeElement; |
||||
|
const focusedElement = _getFocusedElementPierceShadowDom(); |
||||
|
return stepperElement === focusedElement || stepperElement.contains(focusedElement); |
||||
|
} |
||||
|
/** Checks whether the passed-in index is a valid step index. */ |
||||
|
_isValidIndex(index) { |
||||
|
return index > -1 && (!this.steps || index < this.steps.length); |
||||
|
} |
||||
|
} |
||||
|
CdkStepper.ɵfac = function CdkStepper_Factory(t) { return new (t || CdkStepper)(ɵngcc0.ɵɵdirectiveInject(ɵngcc1.Directionality, 8), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(DOCUMENT)); }; |
||||
|
CdkStepper.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkStepper, selectors: [["", "cdkStepper", ""]], contentQueries: function CdkStepper_ContentQueries(rf, ctx, dirIndex) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵcontentQuery(dirIndex, CdkStep, 5); |
||||
|
ɵngcc0.ɵɵcontentQuery(dirIndex, CdkStepHeader, 5); |
||||
|
} if (rf & 2) { |
||||
|
let _t; |
||||
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._steps = _t); |
||||
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._stepHeader = _t); |
||||
|
} }, inputs: { linear: "linear", selectedIndex: "selectedIndex", selected: "selected", orientation: "orientation" }, outputs: { selectionChange: "selectionChange" }, exportAs: ["cdkStepper"] }); |
||||
|
CdkStepper.ctorParameters = () => [ |
||||
|
{ type: Directionality, decorators: [{ type: Optional }] }, |
||||
|
{ type: ChangeDetectorRef }, |
||||
|
{ type: ElementRef }, |
||||
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] } |
||||
|
]; |
||||
|
CdkStepper.propDecorators = { |
||||
|
_steps: [{ type: ContentChildren, args: [CdkStep, { descendants: true },] }], |
||||
|
_stepHeader: [{ type: ContentChildren, args: [CdkStepHeader, { descendants: true },] }], |
||||
|
linear: [{ type: Input }], |
||||
|
selectedIndex: [{ type: Input }], |
||||
|
selected: [{ type: Input }], |
||||
|
selectionChange: [{ type: Output }], |
||||
|
orientation: [{ type: Input }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepper, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkStepper]', |
||||
|
exportAs: 'cdkStepper' |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc1.Directionality, decorators: [{ |
||||
|
type: Optional |
||||
|
}] }, { type: ɵngcc0.ChangeDetectorRef }, { type: ɵngcc0.ElementRef }, { type: undefined, decorators: [{ |
||||
|
type: Inject, |
||||
|
args: [DOCUMENT] |
||||
|
}] }]; }, { selectionChange: [{ |
||||
|
type: Output |
||||
|
}], linear: [{ |
||||
|
type: Input |
||||
|
}], selectedIndex: [{ |
||||
|
type: Input |
||||
|
}], selected: [{ |
||||
|
type: Input |
||||
|
}], orientation: [{ |
||||
|
type: Input |
||||
|
}], _steps: [{ |
||||
|
type: ContentChildren, |
||||
|
args: [CdkStep, { descendants: true }] |
||||
|
}], _stepHeader: [{ |
||||
|
type: ContentChildren, |
||||
|
args: [CdkStepHeader, { descendants: true }] |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Button that moves to the next step in a stepper workflow. */ |
||||
|
class CdkStepperNext { |
||||
|
constructor(_stepper) { |
||||
|
this._stepper = _stepper; |
||||
|
/** Type of the next button. Defaults to "submit" if not specified. */ |
||||
|
this.type = 'submit'; |
||||
|
} |
||||
|
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
||||
|
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
||||
|
// ViewEngine they're overwritten.
|
||||
|
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
||||
|
// tslint:disable-next-line:no-host-decorator-in-concrete
|
||||
|
_handleClick() { |
||||
|
this._stepper.next(); |
||||
|
} |
||||
|
} |
||||
|
CdkStepperNext.ɵfac = function CdkStepperNext_Factory(t) { return new (t || CdkStepperNext)(ɵngcc0.ɵɵdirectiveInject(CdkStepper)); }; |
||||
|
CdkStepperNext.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkStepperNext, selectors: [["button", "cdkStepperNext", ""]], hostVars: 1, hostBindings: function CdkStepperNext_HostBindings(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵlistener("click", function CdkStepperNext_click_HostBindingHandler() { return ctx._handleClick(); }); |
||||
|
} if (rf & 2) { |
||||
|
ɵngcc0.ɵɵhostProperty("type", ctx.type); |
||||
|
} }, inputs: { type: "type" } }); |
||||
|
CdkStepperNext.ctorParameters = () => [ |
||||
|
{ type: CdkStepper } |
||||
|
]; |
||||
|
CdkStepperNext.propDecorators = { |
||||
|
type: [{ type: Input }], |
||||
|
_handleClick: [{ type: HostListener, args: ['click',] }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepperNext, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: 'button[cdkStepperNext]', |
||||
|
host: { |
||||
|
'[type]': 'type' |
||||
|
} |
||||
|
}] |
||||
|
}], function () { return [{ type: CdkStepper }]; }, { type: [{ |
||||
|
type: Input |
||||
|
}], |
||||
|
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
||||
|
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
||||
|
// ViewEngine they're overwritten.
|
||||
|
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
||||
|
// tslint:disable-next-line:no-host-decorator-in-concrete
|
||||
|
_handleClick: [{ |
||||
|
type: HostListener, |
||||
|
args: ['click'] |
||||
|
}] }); })(); |
||||
|
/** Button that moves to the previous step in a stepper workflow. */ |
||||
|
class CdkStepperPrevious { |
||||
|
constructor(_stepper) { |
||||
|
this._stepper = _stepper; |
||||
|
/** Type of the previous button. Defaults to "button" if not specified. */ |
||||
|
this.type = 'button'; |
||||
|
} |
||||
|
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
||||
|
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
||||
|
// ViewEngine they're overwritten.
|
||||
|
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
||||
|
// tslint:disable-next-line:no-host-decorator-in-concrete
|
||||
|
_handleClick() { |
||||
|
this._stepper.previous(); |
||||
|
} |
||||
|
} |
||||
|
CdkStepperPrevious.ɵfac = function CdkStepperPrevious_Factory(t) { return new (t || CdkStepperPrevious)(ɵngcc0.ɵɵdirectiveInject(CdkStepper)); }; |
||||
|
CdkStepperPrevious.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkStepperPrevious, selectors: [["button", "cdkStepperPrevious", ""]], hostVars: 1, hostBindings: function CdkStepperPrevious_HostBindings(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵlistener("click", function CdkStepperPrevious_click_HostBindingHandler() { return ctx._handleClick(); }); |
||||
|
} if (rf & 2) { |
||||
|
ɵngcc0.ɵɵhostProperty("type", ctx.type); |
||||
|
} }, inputs: { type: "type" } }); |
||||
|
CdkStepperPrevious.ctorParameters = () => [ |
||||
|
{ type: CdkStepper } |
||||
|
]; |
||||
|
CdkStepperPrevious.propDecorators = { |
||||
|
type: [{ type: Input }], |
||||
|
_handleClick: [{ type: HostListener, args: ['click',] }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepperPrevious, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: 'button[cdkStepperPrevious]', |
||||
|
host: { |
||||
|
'[type]': 'type' |
||||
|
} |
||||
|
}] |
||||
|
}], function () { return [{ type: CdkStepper }]; }, { type: [{ |
||||
|
type: Input |
||||
|
}], |
||||
|
// We have to use a `HostListener` here in order to support both Ivy and ViewEngine.
|
||||
|
// In Ivy the `host` bindings will be merged when this class is extended, whereas in
|
||||
|
// ViewEngine they're overwritten.
|
||||
|
// TODO(crisbeto): we move this back into `host` once Ivy is turned on by default.
|
||||
|
// tslint:disable-next-line:no-host-decorator-in-concrete
|
||||
|
_handleClick: [{ |
||||
|
type: HostListener, |
||||
|
args: ['click'] |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class CdkStepperModule { |
||||
|
} |
||||
|
CdkStepperModule.ɵfac = function CdkStepperModule_Factory(t) { return new (t || CdkStepperModule)(); }; |
||||
|
CdkStepperModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: CdkStepperModule }); |
||||
|
CdkStepperModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({ imports: [[BidiModule]] }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkStepperModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
imports: [BidiModule], |
||||
|
exports: [ |
||||
|
CdkStep, |
||||
|
CdkStepper, |
||||
|
CdkStepHeader, |
||||
|
CdkStepLabel, |
||||
|
CdkStepperNext, |
||||
|
CdkStepperPrevious, |
||||
|
], |
||||
|
declarations: [ |
||||
|
CdkStep, |
||||
|
CdkStepper, |
||||
|
CdkStepHeader, |
||||
|
CdkStepLabel, |
||||
|
CdkStepperNext, |
||||
|
CdkStepperPrevious, |
||||
|
] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(CdkStepperModule, { declarations: function () { return [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]; }, imports: function () { return [BidiModule]; }, exports: function () { return [CdkStep, CdkStepper, CdkStepHeader, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]; } }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { CdkStep, CdkStepHeader, CdkStepLabel, CdkStepper, CdkStepperModule, CdkStepperNext, CdkStepperPrevious, STEPPER_GLOBAL_OPTIONS, STEP_STATE, StepperSelectionEvent }; |
||||
|
|
||||
|
//# sourceMappingURL=stepper.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/stepper.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2458
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/table.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/table.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,482 @@ |
|||||
|
import * as i1 from '@angular/cdk/platform'; |
||||
|
import { normalizePassiveListenerOptions, Platform, PlatformModule } from '@angular/cdk/platform'; |
||||
|
import * as i0 from '@angular/core'; |
||||
|
import { Injectable, NgZone, EventEmitter, Directive, ElementRef, Output, Optional, Inject, Input, HostListener, NgModule } from '@angular/core'; |
||||
|
import { coerceElement, coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion'; |
||||
|
import { EMPTY, Subject, fromEvent } from 'rxjs'; |
||||
|
import { auditTime, takeUntil } from 'rxjs/operators'; |
||||
|
import { DOCUMENT } from '@angular/common'; |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Options to pass to the animationstart listener. */ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
import * as ɵngcc1 from '@angular/cdk/platform'; |
||||
|
const listenerOptions = normalizePassiveListenerOptions({ passive: true }); |
||||
|
/** |
||||
|
* An injectable service that can be used to monitor the autofill state of an input. |
||||
|
* Based on the following blog post: |
||||
|
* https://medium.com/@brunn/detecting-autofilled-fields-in-javascript-aed598d25da7
|
||||
|
*/ |
||||
|
class AutofillMonitor { |
||||
|
constructor(_platform, _ngZone) { |
||||
|
this._platform = _platform; |
||||
|
this._ngZone = _ngZone; |
||||
|
this._monitoredElements = new Map(); |
||||
|
} |
||||
|
monitor(elementOrRef) { |
||||
|
if (!this._platform.isBrowser) { |
||||
|
return EMPTY; |
||||
|
} |
||||
|
const element = coerceElement(elementOrRef); |
||||
|
const info = this._monitoredElements.get(element); |
||||
|
if (info) { |
||||
|
return info.subject; |
||||
|
} |
||||
|
const result = new Subject(); |
||||
|
const cssClass = 'cdk-text-field-autofilled'; |
||||
|
const listener = ((event) => { |
||||
|
// Animation events fire on initial element render, we check for the presence of the autofill
|
||||
|
// CSS class to make sure this is a real change in state, not just the initial render before
|
||||
|
// we fire off events.
|
||||
|
if (event.animationName === 'cdk-text-field-autofill-start' && |
||||
|
!element.classList.contains(cssClass)) { |
||||
|
element.classList.add(cssClass); |
||||
|
this._ngZone.run(() => result.next({ target: event.target, isAutofilled: true })); |
||||
|
} |
||||
|
else if (event.animationName === 'cdk-text-field-autofill-end' && |
||||
|
element.classList.contains(cssClass)) { |
||||
|
element.classList.remove(cssClass); |
||||
|
this._ngZone.run(() => result.next({ target: event.target, isAutofilled: false })); |
||||
|
} |
||||
|
}); |
||||
|
this._ngZone.runOutsideAngular(() => { |
||||
|
element.addEventListener('animationstart', listener, listenerOptions); |
||||
|
element.classList.add('cdk-text-field-autofill-monitored'); |
||||
|
}); |
||||
|
this._monitoredElements.set(element, { |
||||
|
subject: result, |
||||
|
unlisten: () => { |
||||
|
element.removeEventListener('animationstart', listener, listenerOptions); |
||||
|
} |
||||
|
}); |
||||
|
return result; |
||||
|
} |
||||
|
stopMonitoring(elementOrRef) { |
||||
|
const element = coerceElement(elementOrRef); |
||||
|
const info = this._monitoredElements.get(element); |
||||
|
if (info) { |
||||
|
info.unlisten(); |
||||
|
info.subject.complete(); |
||||
|
element.classList.remove('cdk-text-field-autofill-monitored'); |
||||
|
element.classList.remove('cdk-text-field-autofilled'); |
||||
|
this._monitoredElements.delete(element); |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._monitoredElements.forEach((_info, element) => this.stopMonitoring(element)); |
||||
|
} |
||||
|
} |
||||
|
AutofillMonitor.ɵfac = function AutofillMonitor_Factory(t) { return new (t || AutofillMonitor)(ɵngcc0.ɵɵinject(ɵngcc1.Platform), ɵngcc0.ɵɵinject(ɵngcc0.NgZone)); }; |
||||
|
AutofillMonitor.ɵprov = i0.ɵɵdefineInjectable({ factory: function AutofillMonitor_Factory() { return new AutofillMonitor(i0.ɵɵinject(i1.Platform), i0.ɵɵinject(i0.NgZone)); }, token: AutofillMonitor, providedIn: "root" }); |
||||
|
AutofillMonitor.ctorParameters = () => [ |
||||
|
{ type: Platform }, |
||||
|
{ type: NgZone } |
||||
|
]; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(AutofillMonitor, [{ |
||||
|
type: Injectable, |
||||
|
args: [{ providedIn: 'root' }] |
||||
|
}], function () { return [{ type: ɵngcc1.Platform }, { type: ɵngcc0.NgZone }]; }, null); })(); |
||||
|
/** A directive that can be used to monitor the autofill state of an input. */ |
||||
|
class CdkAutofill { |
||||
|
constructor(_elementRef, _autofillMonitor) { |
||||
|
this._elementRef = _elementRef; |
||||
|
this._autofillMonitor = _autofillMonitor; |
||||
|
/** Emits when the autofill state of the element changes. */ |
||||
|
this.cdkAutofill = new EventEmitter(); |
||||
|
} |
||||
|
ngOnInit() { |
||||
|
this._autofillMonitor |
||||
|
.monitor(this._elementRef) |
||||
|
.subscribe(event => this.cdkAutofill.emit(event)); |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._autofillMonitor.stopMonitoring(this._elementRef); |
||||
|
} |
||||
|
} |
||||
|
CdkAutofill.ɵfac = function CdkAutofill_Factory(t) { return new (t || CdkAutofill)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(AutofillMonitor)); }; |
||||
|
CdkAutofill.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkAutofill, selectors: [["", "cdkAutofill", ""]], outputs: { cdkAutofill: "cdkAutofill" } }); |
||||
|
CdkAutofill.ctorParameters = () => [ |
||||
|
{ type: ElementRef }, |
||||
|
{ type: AutofillMonitor } |
||||
|
]; |
||||
|
CdkAutofill.propDecorators = { |
||||
|
cdkAutofill: [{ type: Output }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkAutofill, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: '[cdkAutofill]' |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.ElementRef }, { type: AutofillMonitor }]; }, { cdkAutofill: [{ |
||||
|
type: Output |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Directive to automatically resize a textarea to fit its content. */ |
||||
|
class CdkTextareaAutosize { |
||||
|
constructor(_elementRef, _platform, _ngZone, |
||||
|
/** @breaking-change 11.0.0 make document required */ |
||||
|
document) { |
||||
|
this._elementRef = _elementRef; |
||||
|
this._platform = _platform; |
||||
|
this._ngZone = _ngZone; |
||||
|
this._destroyed = new Subject(); |
||||
|
this._enabled = true; |
||||
|
/** |
||||
|
* Value of minRows as of last resize. If the minRows has decreased, the |
||||
|
* height of the textarea needs to be recomputed to reflect the new minimum. The maxHeight |
||||
|
* does not have the same problem because it does not affect the textarea's scrollHeight. |
||||
|
*/ |
||||
|
this._previousMinRows = -1; |
||||
|
this._isViewInited = false; |
||||
|
/** Handles `focus` and `blur` events. */ |
||||
|
this._handleFocusEvent = (event) => { |
||||
|
this._hasFocus = event.type === 'focus'; |
||||
|
}; |
||||
|
this._document = document; |
||||
|
this._textareaElement = this._elementRef.nativeElement; |
||||
|
} |
||||
|
/** Minimum amount of rows in the textarea. */ |
||||
|
get minRows() { return this._minRows; } |
||||
|
set minRows(value) { |
||||
|
this._minRows = coerceNumberProperty(value); |
||||
|
this._setMinHeight(); |
||||
|
} |
||||
|
/** Maximum amount of rows in the textarea. */ |
||||
|
get maxRows() { return this._maxRows; } |
||||
|
set maxRows(value) { |
||||
|
this._maxRows = coerceNumberProperty(value); |
||||
|
this._setMaxHeight(); |
||||
|
} |
||||
|
/** Whether autosizing is enabled or not */ |
||||
|
get enabled() { return this._enabled; } |
||||
|
set enabled(value) { |
||||
|
value = coerceBooleanProperty(value); |
||||
|
// Only act if the actual value changed. This specifically helps to not run
|
||||
|
// resizeToFitContent too early (i.e. before ngAfterViewInit)
|
||||
|
if (this._enabled !== value) { |
||||
|
(this._enabled = value) ? this.resizeToFitContent(true) : this.reset(); |
||||
|
} |
||||
|
} |
||||
|
get placeholder() { return this._textareaElement.placeholder; } |
||||
|
set placeholder(value) { |
||||
|
this._cachedPlaceholderHeight = undefined; |
||||
|
this._textareaElement.placeholder = value; |
||||
|
this._cacheTextareaPlaceholderHeight(); |
||||
|
} |
||||
|
/** Sets the minimum height of the textarea as determined by minRows. */ |
||||
|
_setMinHeight() { |
||||
|
const minHeight = this.minRows && this._cachedLineHeight ? |
||||
|
`${this.minRows * this._cachedLineHeight}px` : null; |
||||
|
if (minHeight) { |
||||
|
this._textareaElement.style.minHeight = minHeight; |
||||
|
} |
||||
|
} |
||||
|
/** Sets the maximum height of the textarea as determined by maxRows. */ |
||||
|
_setMaxHeight() { |
||||
|
const maxHeight = this.maxRows && this._cachedLineHeight ? |
||||
|
`${this.maxRows * this._cachedLineHeight}px` : null; |
||||
|
if (maxHeight) { |
||||
|
this._textareaElement.style.maxHeight = maxHeight; |
||||
|
} |
||||
|
} |
||||
|
ngAfterViewInit() { |
||||
|
if (this._platform.isBrowser) { |
||||
|
// Remember the height which we started with in case autosizing is disabled
|
||||
|
this._initialHeight = this._textareaElement.style.height; |
||||
|
this.resizeToFitContent(); |
||||
|
this._ngZone.runOutsideAngular(() => { |
||||
|
const window = this._getWindow(); |
||||
|
fromEvent(window, 'resize') |
||||
|
.pipe(auditTime(16), takeUntil(this._destroyed)) |
||||
|
.subscribe(() => this.resizeToFitContent(true)); |
||||
|
this._textareaElement.addEventListener('focus', this._handleFocusEvent); |
||||
|
this._textareaElement.addEventListener('blur', this._handleFocusEvent); |
||||
|
}); |
||||
|
this._isViewInited = true; |
||||
|
this.resizeToFitContent(true); |
||||
|
} |
||||
|
} |
||||
|
ngOnDestroy() { |
||||
|
this._textareaElement.removeEventListener('focus', this._handleFocusEvent); |
||||
|
this._textareaElement.removeEventListener('blur', this._handleFocusEvent); |
||||
|
this._destroyed.next(); |
||||
|
this._destroyed.complete(); |
||||
|
} |
||||
|
/** |
||||
|
* Cache the height of a single-row textarea if it has not already been cached. |
||||
|
* |
||||
|
* We need to know how large a single "row" of a textarea is in order to apply minRows and |
||||
|
* maxRows. For the initial version, we will assume that the height of a single line in the |
||||
|
* textarea does not ever change. |
||||
|
*/ |
||||
|
_cacheTextareaLineHeight() { |
||||
|
if (this._cachedLineHeight) { |
||||
|
return; |
||||
|
} |
||||
|
// Use a clone element because we have to override some styles.
|
||||
|
let textareaClone = this._textareaElement.cloneNode(false); |
||||
|
textareaClone.rows = 1; |
||||
|
// Use `position: absolute` so that this doesn't cause a browser layout and use
|
||||
|
// `visibility: hidden` so that nothing is rendered. Clear any other styles that
|
||||
|
// would affect the height.
|
||||
|
textareaClone.style.position = 'absolute'; |
||||
|
textareaClone.style.visibility = 'hidden'; |
||||
|
textareaClone.style.border = 'none'; |
||||
|
textareaClone.style.padding = '0'; |
||||
|
textareaClone.style.height = ''; |
||||
|
textareaClone.style.minHeight = ''; |
||||
|
textareaClone.style.maxHeight = ''; |
||||
|
// In Firefox it happens that textarea elements are always bigger than the specified amount
|
||||
|
// of rows. This is because Firefox tries to add extra space for the horizontal scrollbar.
|
||||
|
// As a workaround that removes the extra space for the scrollbar, we can just set overflow
|
||||
|
// to hidden. This ensures that there is no invalid calculation of the line height.
|
||||
|
// See Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=33654
|
||||
|
textareaClone.style.overflow = 'hidden'; |
||||
|
this._textareaElement.parentNode.appendChild(textareaClone); |
||||
|
this._cachedLineHeight = textareaClone.clientHeight; |
||||
|
this._textareaElement.parentNode.removeChild(textareaClone); |
||||
|
// Min and max heights have to be re-calculated if the cached line height changes
|
||||
|
this._setMinHeight(); |
||||
|
this._setMaxHeight(); |
||||
|
} |
||||
|
_measureScrollHeight() { |
||||
|
const element = this._textareaElement; |
||||
|
const previousMargin = element.style.marginBottom || ''; |
||||
|
const isFirefox = this._platform.FIREFOX; |
||||
|
const needsMarginFiller = isFirefox && this._hasFocus; |
||||
|
const measuringClass = isFirefox ? |
||||
|
'cdk-textarea-autosize-measuring-firefox' : |
||||
|
'cdk-textarea-autosize-measuring'; |
||||
|
// In some cases the page might move around while we're measuring the `textarea` on Firefox. We
|
||||
|
// work around it by assigning a temporary margin with the same height as the `textarea` so that
|
||||
|
// it occupies the same amount of space. See #23233.
|
||||
|
if (needsMarginFiller) { |
||||
|
element.style.marginBottom = `${element.clientHeight}px`; |
||||
|
} |
||||
|
// Reset the textarea height to auto in order to shrink back to its default size.
|
||||
|
// Also temporarily force overflow:hidden, so scroll bars do not interfere with calculations.
|
||||
|
element.classList.add(measuringClass); |
||||
|
// The measuring class includes a 2px padding to workaround an issue with Chrome,
|
||||
|
// so we account for that extra space here by subtracting 4 (2px top + 2px bottom).
|
||||
|
const scrollHeight = element.scrollHeight - 4; |
||||
|
element.classList.remove(measuringClass); |
||||
|
if (needsMarginFiller) { |
||||
|
element.style.marginBottom = previousMargin; |
||||
|
} |
||||
|
return scrollHeight; |
||||
|
} |
||||
|
_cacheTextareaPlaceholderHeight() { |
||||
|
if (!this._isViewInited || this._cachedPlaceholderHeight != undefined) { |
||||
|
return; |
||||
|
} |
||||
|
if (!this.placeholder) { |
||||
|
this._cachedPlaceholderHeight = 0; |
||||
|
return; |
||||
|
} |
||||
|
const value = this._textareaElement.value; |
||||
|
this._textareaElement.value = this._textareaElement.placeholder; |
||||
|
this._cachedPlaceholderHeight = this._measureScrollHeight(); |
||||
|
this._textareaElement.value = value; |
||||
|
} |
||||
|
ngDoCheck() { |
||||
|
if (this._platform.isBrowser) { |
||||
|
this.resizeToFitContent(); |
||||
|
} |
||||
|
} |
||||
|
/** |
||||
|
* Resize the textarea to fit its content. |
||||
|
* @param force Whether to force a height recalculation. By default the height will be |
||||
|
* recalculated only if the value changed since the last call. |
||||
|
*/ |
||||
|
resizeToFitContent(force = false) { |
||||
|
// If autosizing is disabled, just skip everything else
|
||||
|
if (!this._enabled) { |
||||
|
return; |
||||
|
} |
||||
|
this._cacheTextareaLineHeight(); |
||||
|
this._cacheTextareaPlaceholderHeight(); |
||||
|
// If we haven't determined the line-height yet, we know we're still hidden and there's no point
|
||||
|
// in checking the height of the textarea.
|
||||
|
if (!this._cachedLineHeight) { |
||||
|
return; |
||||
|
} |
||||
|
const textarea = this._elementRef.nativeElement; |
||||
|
const value = textarea.value; |
||||
|
// Only resize if the value or minRows have changed since these calculations can be expensive.
|
||||
|
if (!force && this._minRows === this._previousMinRows && value === this._previousValue) { |
||||
|
return; |
||||
|
} |
||||
|
const scrollHeight = this._measureScrollHeight(); |
||||
|
const height = Math.max(scrollHeight, this._cachedPlaceholderHeight || 0); |
||||
|
// Use the scrollHeight to know how large the textarea *would* be if fit its entire value.
|
||||
|
textarea.style.height = `${height}px`; |
||||
|
this._ngZone.runOutsideAngular(() => { |
||||
|
if (typeof requestAnimationFrame !== 'undefined') { |
||||
|
requestAnimationFrame(() => this._scrollToCaretPosition(textarea)); |
||||
|
} |
||||
|
else { |
||||
|
setTimeout(() => this._scrollToCaretPosition(textarea)); |
||||
|
} |
||||
|
}); |
||||
|
this._previousValue = value; |
||||
|
this._previousMinRows = this._minRows; |
||||
|
} |
||||
|
/** |
||||
|
* Resets the textarea to its original size |
||||
|
*/ |
||||
|
reset() { |
||||
|
// Do not try to change the textarea, if the initialHeight has not been determined yet
|
||||
|
// This might potentially remove styles when reset() is called before ngAfterViewInit
|
||||
|
if (this._initialHeight !== undefined) { |
||||
|
this._textareaElement.style.height = this._initialHeight; |
||||
|
} |
||||
|
} |
||||
|
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
||||
|
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
||||
|
// can move this back into `host`.
|
||||
|
// tslint:disable:no-host-decorator-in-concrete
|
||||
|
_noopInputHandler() { |
||||
|
// no-op handler that ensures we're running change detection on input events.
|
||||
|
} |
||||
|
/** Access injected document if available or fallback to global document reference */ |
||||
|
_getDocument() { |
||||
|
return this._document || document; |
||||
|
} |
||||
|
/** Use defaultView of injected document if available or fallback to global window reference */ |
||||
|
_getWindow() { |
||||
|
const doc = this._getDocument(); |
||||
|
return doc.defaultView || window; |
||||
|
} |
||||
|
/** |
||||
|
* Scrolls a textarea to the caret position. On Firefox resizing the textarea will |
||||
|
* prevent it from scrolling to the caret position. We need to re-set the selection |
||||
|
* in order for it to scroll to the proper position. |
||||
|
*/ |
||||
|
_scrollToCaretPosition(textarea) { |
||||
|
const { selectionStart, selectionEnd } = textarea; |
||||
|
// IE will throw an "Unspecified error" if we try to set the selection range after the
|
||||
|
// element has been removed from the DOM. Assert that the directive hasn't been destroyed
|
||||
|
// between the time we requested the animation frame and when it was executed.
|
||||
|
// Also note that we have to assert that the textarea is focused before we set the
|
||||
|
// selection range. Setting the selection range on a non-focused textarea will cause
|
||||
|
// it to receive focus on IE and Edge.
|
||||
|
if (!this._destroyed.isStopped && this._hasFocus) { |
||||
|
textarea.setSelectionRange(selectionStart, selectionEnd); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
CdkTextareaAutosize.ɵfac = function CdkTextareaAutosize_Factory(t) { return new (t || CdkTextareaAutosize)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc1.Platform), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.NgZone), ɵngcc0.ɵɵdirectiveInject(DOCUMENT, 8)); }; |
||||
|
CdkTextareaAutosize.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: CdkTextareaAutosize, selectors: [["textarea", "cdkTextareaAutosize", ""]], hostAttrs: ["rows", "1", 1, "cdk-textarea-autosize"], hostBindings: function CdkTextareaAutosize_HostBindings(rf, ctx) { if (rf & 1) { |
||||
|
ɵngcc0.ɵɵlistener("input", function CdkTextareaAutosize_input_HostBindingHandler() { return ctx._noopInputHandler(); }); |
||||
|
} }, inputs: { minRows: ["cdkAutosizeMinRows", "minRows"], maxRows: ["cdkAutosizeMaxRows", "maxRows"], enabled: ["cdkTextareaAutosize", "enabled"], placeholder: "placeholder" }, exportAs: ["cdkTextareaAutosize"] }); |
||||
|
CdkTextareaAutosize.ctorParameters = () => [ |
||||
|
{ type: ElementRef }, |
||||
|
{ type: Platform }, |
||||
|
{ type: NgZone }, |
||||
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] } |
||||
|
]; |
||||
|
CdkTextareaAutosize.propDecorators = { |
||||
|
minRows: [{ type: Input, args: ['cdkAutosizeMinRows',] }], |
||||
|
maxRows: [{ type: Input, args: ['cdkAutosizeMaxRows',] }], |
||||
|
enabled: [{ type: Input, args: ['cdkTextareaAutosize',] }], |
||||
|
placeholder: [{ type: Input }], |
||||
|
_noopInputHandler: [{ type: HostListener, args: ['input',] }] |
||||
|
}; |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(CdkTextareaAutosize, [{ |
||||
|
type: Directive, |
||||
|
args: [{ |
||||
|
selector: 'textarea[cdkTextareaAutosize]', |
||||
|
exportAs: 'cdkTextareaAutosize', |
||||
|
host: { |
||||
|
'class': 'cdk-textarea-autosize', |
||||
|
// Textarea elements that have the directive applied should have a single row by default.
|
||||
|
// Browsers normally show two rows by default and therefore this limits the minRows binding.
|
||||
|
'rows': '1' |
||||
|
} |
||||
|
}] |
||||
|
}], function () { return [{ type: ɵngcc0.ElementRef }, { type: ɵngcc1.Platform }, { type: ɵngcc0.NgZone }, { type: undefined, decorators: [{ |
||||
|
type: Optional |
||||
|
}, { |
||||
|
type: Inject, |
||||
|
args: [DOCUMENT] |
||||
|
}] }]; }, { minRows: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkAutosizeMinRows'] |
||||
|
}], maxRows: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkAutosizeMaxRows'] |
||||
|
}], enabled: [{ |
||||
|
type: Input, |
||||
|
args: ['cdkTextareaAutosize'] |
||||
|
}], placeholder: [{ |
||||
|
type: Input |
||||
|
}], |
||||
|
// In Ivy the `host` metadata will be merged, whereas in ViewEngine it is overridden. In order
|
||||
|
// to avoid double event listeners, we need to use `HostListener`. Once Ivy is the default, we
|
||||
|
// can move this back into `host`.
|
||||
|
// tslint:disable:no-host-decorator-in-concrete
|
||||
|
_noopInputHandler: [{ |
||||
|
type: HostListener, |
||||
|
args: ['input'] |
||||
|
}] }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
class TextFieldModule { |
||||
|
} |
||||
|
TextFieldModule.ɵfac = function TextFieldModule_Factory(t) { return new (t || TextFieldModule)(); }; |
||||
|
TextFieldModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: TextFieldModule }); |
||||
|
TextFieldModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({ imports: [[PlatformModule]] }); |
||||
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(TextFieldModule, [{ |
||||
|
type: NgModule, |
||||
|
args: [{ |
||||
|
declarations: [CdkAutofill, CdkTextareaAutosize], |
||||
|
imports: [PlatformModule], |
||||
|
exports: [CdkAutofill, CdkTextareaAutosize] |
||||
|
}] |
||||
|
}], null, null); })(); |
||||
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(TextFieldModule, { declarations: function () { return [CdkAutofill, CdkTextareaAutosize]; }, imports: function () { return [PlatformModule]; }, exports: function () { return [CdkAutofill, CdkTextareaAutosize]; } }); })(); |
||||
|
|
||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
|
||||
|
/** |
||||
|
* Generated bundle index. Do not edit. |
||||
|
*/ |
||||
|
|
||||
|
export { AutofillMonitor, CdkAutofill, CdkTextareaAutosize, TextFieldModule }; |
||||
|
|
||||
|
//# sourceMappingURL=text-field.js.map
|
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/text-field.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1019
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/tree.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
node_modules/@angular/cdk/__ivy_ngcc__/fesm2015/tree.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,8 @@ |
|||||
|
@forward './overlay' show overlay, $overlay-container-z-index, $overlay-z-index, |
||||
|
$overlay-backdrop-z-index, $overlay-backdrop-color; |
||||
|
@forward './a11y' show a11y-visually-hidden, high-contrast; |
||||
|
@forward './text-field' show text-field-autosize, text-field-autofill, |
||||
|
text-field-autofill-color, |
||||
|
// `text-field` is deprecated, but we have to export it |
||||
|
// here in order for the theming API schematic to work. |
||||
|
text-field; |
@ -0,0 +1 @@ |
|||||
|
.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none} |
@ -0,0 +1,2 @@ |
|||||
|
@forward 'index' hide a11y, high-contrast; |
||||
|
@forward 'index' as cdk-* hide cdk-optionally-nest-content; |
@ -0,0 +1,91 @@ |
|||||
|
/// Emits a CSS class, `.cdk-visually-hidden`. This class can be applied to an element |
||||
|
/// to make that element visually hidden while remaining available to assistive technology. |
||||
|
@mixin a11y-visually-hidden() { |
||||
|
.cdk-visually-hidden { |
||||
|
border: 0; |
||||
|
clip: rect(0 0 0 0); |
||||
|
height: 1px; |
||||
|
margin: -1px; |
||||
|
overflow: hidden; |
||||
|
padding: 0; |
||||
|
position: absolute; |
||||
|
width: 1px; |
||||
|
|
||||
|
// This works around a Chrome bug that can cause the tab to crash when large amounts of |
||||
|
// non-English text get wrapped: https://bugs.chromium.org/p/chromium/issues/detail?id=1201444 |
||||
|
white-space: nowrap; |
||||
|
|
||||
|
// Avoid browsers rendering the focus ring in some cases. |
||||
|
outline: 0; |
||||
|
|
||||
|
// Avoid some cases where the browser will still render the native controls (see #9049). |
||||
|
-webkit-appearance: none; |
||||
|
-moz-appearance: none; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// @deprecated Use `a11y-visually-hidden`. |
||||
|
@mixin a11y() { |
||||
|
@include a11y-visually-hidden; |
||||
|
} |
||||
|
|
||||
|
/// Emits the mixin's content nested under `$selector-context` if `$selector-context` |
||||
|
/// is non-empty. |
||||
|
/// @param {String} selector-context The selector under which to nest the mixin's content. |
||||
|
@mixin _optionally-nest-content($selector-context) { |
||||
|
@if ($selector-context == '') { |
||||
|
@content; |
||||
|
} |
||||
|
@else { |
||||
|
#{$selector-context} { |
||||
|
@content; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// Applies styles for users in high contrast mode. Note that this only applies |
||||
|
/// to Microsoft browsers. Chrome can be included by checking for the `html[hc]` |
||||
|
/// attribute, however Chrome handles high contrast differently. |
||||
|
/// |
||||
|
/// @param {String} target Type of high contrast setting to target. Defaults to `active`, can be |
||||
|
/// `white-on-black` or `black-on-white`. |
||||
|
/// @param {String} encapsulation Whether to emit styles for view encapsulation. Values are: |
||||
|
/// * `on` - works for `Emulated`, `Native`, and `ShadowDom` |
||||
|
/// * `off` - works for `None` |
||||
|
/// * `any` - works for all encapsulation modes by emitting the CSS twice (default). |
||||
|
@mixin high-contrast($target: active, $encapsulation: 'any') { |
||||
|
@if ($target != 'active' and $target != 'black-on-white' and $target != 'white-on-black') { |
||||
|
@error 'Unknown cdk-high-contrast value "#{$target}" provided. ' + |
||||
|
'Allowed values are "active", "black-on-white", and "white-on-black"'; |
||||
|
} |
||||
|
|
||||
|
@if ($encapsulation != 'on' and $encapsulation != 'off' and $encapsulation != 'any') { |
||||
|
@error 'Unknown cdk-high-contrast encapsulation "#{$encapsulation}" provided. ' + |
||||
|
'Allowed values are "on", "off", and "any"'; |
||||
|
} |
||||
|
|
||||
|
// If the selector context has multiple parts, such as `.section, .region`, just doing |
||||
|
// `.cdk-high-contrast-xxx #{&}` will only apply the parent selector to the first part of the |
||||
|
// context. We address this by nesting the selector context under .cdk-high-contrast. |
||||
|
@at-root { |
||||
|
$selector-context: #{&}; |
||||
|
|
||||
|
@if ($encapsulation != 'on') { |
||||
|
// Note that if this selector is updated, the same change has to be made inside |
||||
|
// `_overlay.scss` which can't depend on this mixin due to some infrastructure limitations. |
||||
|
.cdk-high-contrast-#{$target} { |
||||
|
@include _optionally-nest-content($selector-context) { |
||||
|
@content; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@if ($encapsulation != 'off') { |
||||
|
.cdk-high-contrast-#{$target} :host { |
||||
|
@include _optionally-nest-content($selector-context) { |
||||
|
@content; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import { HighContrastModeDetector } from './high-contrast-mode/high-contrast-mode-detector'; |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
import * as ɵngcc1 from './live-announcer/live-announcer'; |
||||
|
import * as ɵngcc2 from './focus-trap/focus-trap'; |
||||
|
import * as ɵngcc3 from './focus-monitor/focus-monitor'; |
||||
|
import * as ɵngcc4 from '@angular/cdk/platform'; |
||||
|
import * as ɵngcc5 from '@angular/cdk/observers'; |
||||
|
export declare class A11yModule { |
||||
|
constructor(highContrastModeDetector: HighContrastModeDetector); |
||||
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<A11yModule, never>; |
||||
|
static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<A11yModule, [typeof ɵngcc1.CdkAriaLive, typeof ɵngcc2.CdkTrapFocus, typeof ɵngcc3.CdkMonitorFocus], [typeof ɵngcc4.PlatformModule, typeof ɵngcc5.ObserversModule], [typeof ɵngcc1.CdkAriaLive, typeof ɵngcc2.CdkTrapFocus, typeof ɵngcc3.CdkMonitorFocus]>; |
||||
|
static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<A11yModule>; |
||||
|
} |
||||
|
|
||||
|
//# sourceMappingURL=a11y-module.d.ts.map
|
@ -0,0 +1,11 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license |
||||
|
*/ |
||||
|
import { HighContrastModeDetector } from './high-contrast-mode/high-contrast-mode-detector'; |
||||
|
export declare class A11yModule { |
||||
|
constructor(highContrastModeDetector: HighContrastModeDetector); |
||||
|
} |
@ -0,0 +1 @@ |
|||||
|
{"version":3,"file":"a11y-module.d.ts","sources":["a11y-module.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AACA;AACA;;;;AACA","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { HighContrastModeDetector } from './high-contrast-mode/high-contrast-mode-detector';\nexport declare class A11yModule {\n constructor(highContrastModeDetector: HighContrastModeDetector);\n}\n"]} |
@ -0,0 +1,82 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import { OnDestroy } from '@angular/core'; |
||||
|
/** |
||||
|
* Interface used to register message elements and keep a count of how many registrations have |
||||
|
* the same message and the reference to the message element used for the `aria-describedby`. |
||||
|
*/ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
export interface RegisteredMessage { |
||||
|
/** The element containing the message. */ |
||||
|
messageElement: Element; |
||||
|
/** The number of elements that reference this message element via `aria-describedby`. */ |
||||
|
referenceCount: number; |
||||
|
} |
||||
|
/** ID used for the body container where all messages are appended. */ |
||||
|
export declare const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container"; |
||||
|
/** ID prefix used for each created message element. */ |
||||
|
export declare const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message"; |
||||
|
/** Attribute given to each host element that is described by a message element. */ |
||||
|
export declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host"; |
||||
|
/** |
||||
|
* Utility that creates visually hidden elements with a message content. Useful for elements that |
||||
|
* want to use aria-describedby to further describe themselves without adding additional visual |
||||
|
* content. |
||||
|
*/ |
||||
|
export declare class AriaDescriber implements OnDestroy { |
||||
|
private _document; |
||||
|
constructor(_document: any); |
||||
|
/** |
||||
|
* Adds to the host element an aria-describedby reference to a hidden element that contains |
||||
|
* the message. If the same message has already been registered, then it will reuse the created |
||||
|
* message element. |
||||
|
*/ |
||||
|
describe(hostElement: Element, message: string, role?: string): void; |
||||
|
/** |
||||
|
* Adds to the host element an aria-describedby reference to an already-existing message element. |
||||
|
*/ |
||||
|
describe(hostElement: Element, message: HTMLElement): void; |
||||
|
/** Removes the host element's aria-describedby reference to the message. */ |
||||
|
removeDescription(hostElement: Element, message: string, role?: string): void; |
||||
|
/** Removes the host element's aria-describedby reference to the message element. */ |
||||
|
removeDescription(hostElement: Element, message: HTMLElement): void; |
||||
|
/** Unregisters all created message elements and removes the message container. */ |
||||
|
ngOnDestroy(): void; |
||||
|
/** |
||||
|
* Creates a new element in the visually hidden message container element with the message |
||||
|
* as its content and adds it to the message registry. |
||||
|
*/ |
||||
|
private _createMessageElement; |
||||
|
/** Deletes the message element from the global messages container. */ |
||||
|
private _deleteMessageElement; |
||||
|
/** Creates the global container for all aria-describedby messages. */ |
||||
|
private _createMessagesContainer; |
||||
|
/** Deletes the global messages container. */ |
||||
|
private _deleteMessagesContainer; |
||||
|
/** Removes all cdk-describedby messages that are hosted through the element. */ |
||||
|
private _removeCdkDescribedByReferenceIds; |
||||
|
/** |
||||
|
* Adds a message reference to the element using aria-describedby and increments the registered |
||||
|
* message's reference count. |
||||
|
*/ |
||||
|
private _addMessageReference; |
||||
|
/** |
||||
|
* Removes a message reference from the element using aria-describedby |
||||
|
* and decrements the registered message's reference count. |
||||
|
*/ |
||||
|
private _removeMessageReference; |
||||
|
/** Returns true if the element has been described by the provided message ID. */ |
||||
|
private _isElementDescribedByMessage; |
||||
|
/** Determines whether a message can be described on a particular element. */ |
||||
|
private _canBeDescribed; |
||||
|
/** Checks whether a node is an Element node. */ |
||||
|
private _isElementNode; |
||||
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<AriaDescriber, never>; |
||||
|
} |
||||
|
|
||||
|
//# sourceMappingURL=aria-describer.d.ts.map
|
@ -0,0 +1,78 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license |
||||
|
*/ |
||||
|
import { OnDestroy } from '@angular/core'; |
||||
|
/** |
||||
|
* Interface used to register message elements and keep a count of how many registrations have |
||||
|
* the same message and the reference to the message element used for the `aria-describedby`. |
||||
|
*/ |
||||
|
export interface RegisteredMessage { |
||||
|
/** The element containing the message. */ |
||||
|
messageElement: Element; |
||||
|
/** The number of elements that reference this message element via `aria-describedby`. */ |
||||
|
referenceCount: number; |
||||
|
} |
||||
|
/** ID used for the body container where all messages are appended. */ |
||||
|
export declare const MESSAGES_CONTAINER_ID = "cdk-describedby-message-container"; |
||||
|
/** ID prefix used for each created message element. */ |
||||
|
export declare const CDK_DESCRIBEDBY_ID_PREFIX = "cdk-describedby-message"; |
||||
|
/** Attribute given to each host element that is described by a message element. */ |
||||
|
export declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = "cdk-describedby-host"; |
||||
|
/** |
||||
|
* Utility that creates visually hidden elements with a message content. Useful for elements that |
||||
|
* want to use aria-describedby to further describe themselves without adding additional visual |
||||
|
* content. |
||||
|
*/ |
||||
|
export declare class AriaDescriber implements OnDestroy { |
||||
|
private _document; |
||||
|
constructor(_document: any); |
||||
|
/** |
||||
|
* Adds to the host element an aria-describedby reference to a hidden element that contains |
||||
|
* the message. If the same message has already been registered, then it will reuse the created |
||||
|
* message element. |
||||
|
*/ |
||||
|
describe(hostElement: Element, message: string, role?: string): void; |
||||
|
/** |
||||
|
* Adds to the host element an aria-describedby reference to an already-existing message element. |
||||
|
*/ |
||||
|
describe(hostElement: Element, message: HTMLElement): void; |
||||
|
/** Removes the host element's aria-describedby reference to the message. */ |
||||
|
removeDescription(hostElement: Element, message: string, role?: string): void; |
||||
|
/** Removes the host element's aria-describedby reference to the message element. */ |
||||
|
removeDescription(hostElement: Element, message: HTMLElement): void; |
||||
|
/** Unregisters all created message elements and removes the message container. */ |
||||
|
ngOnDestroy(): void; |
||||
|
/** |
||||
|
* Creates a new element in the visually hidden message container element with the message |
||||
|
* as its content and adds it to the message registry. |
||||
|
*/ |
||||
|
private _createMessageElement; |
||||
|
/** Deletes the message element from the global messages container. */ |
||||
|
private _deleteMessageElement; |
||||
|
/** Creates the global container for all aria-describedby messages. */ |
||||
|
private _createMessagesContainer; |
||||
|
/** Deletes the global messages container. */ |
||||
|
private _deleteMessagesContainer; |
||||
|
/** Removes all cdk-describedby messages that are hosted through the element. */ |
||||
|
private _removeCdkDescribedByReferenceIds; |
||||
|
/** |
||||
|
* Adds a message reference to the element using aria-describedby and increments the registered |
||||
|
* message's reference count. |
||||
|
*/ |
||||
|
private _addMessageReference; |
||||
|
/** |
||||
|
* Removes a message reference from the element using aria-describedby |
||||
|
* and decrements the registered message's reference count. |
||||
|
*/ |
||||
|
private _removeMessageReference; |
||||
|
/** Returns true if the element has been described by the provided message ID. */ |
||||
|
private _isElementDescribedByMessage; |
||||
|
/** Determines whether a message can be described on a particular element. */ |
||||
|
private _canBeDescribed; |
||||
|
/** Checks whether a node is an Element node. */ |
||||
|
private _isElementNode; |
||||
|
} |
@ -0,0 +1 @@ |
|||||
|
{"version":3,"file":"aria-describer.d.ts","sources":["aria-describer.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { OnDestroy } from '@angular/core';\n/**\n * Interface used to register message elements and keep a count of how many registrations have\n * the same message and the reference to the message element used for the `aria-describedby`.\n */\nexport interface RegisteredMessage {\n /** The element containing the message. */\n messageElement: Element;\n /** The number of elements that reference this message element via `aria-describedby`. */\n referenceCount: number;\n}\n/** ID used for the body container where all messages are appended. */\nexport declare const MESSAGES_CONTAINER_ID = \"cdk-describedby-message-container\";\n/** ID prefix used for each created message element. */\nexport declare const CDK_DESCRIBEDBY_ID_PREFIX = \"cdk-describedby-message\";\n/** Attribute given to each host element that is described by a message element. */\nexport declare const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = \"cdk-describedby-host\";\n/**\n * Utility that creates visually hidden elements with a message content. Useful for elements that\n * want to use aria-describedby to further describe themselves without adding additional visual\n * content.\n */\nexport declare class AriaDescriber implements OnDestroy {\n private _document;\n constructor(_document: any);\n /**\n * Adds to the host element an aria-describedby reference to a hidden element that contains\n * the message. If the same message has already been registered, then it will reuse the created\n * message element.\n */\n describe(hostElement: Element, message: string, role?: string): void;\n /**\n * Adds to the host element an aria-describedby reference to an already-existing message element.\n */\n describe(hostElement: Element, message: HTMLElement): void;\n /** Removes the host element's aria-describedby reference to the message. */\n removeDescription(hostElement: Element, message: string, role?: string): void;\n /** Removes the host element's aria-describedby reference to the message element. */\n removeDescription(hostElement: Element, message: HTMLElement): void;\n /** Unregisters all created message elements and removes the message container. */\n ngOnDestroy(): void;\n /**\n * Creates a new element in the visually hidden message container element with the message\n * as its content and adds it to the message registry.\n */\n private _createMessageElement;\n /** Deletes the message element from the global messages container. */\n private _deleteMessageElement;\n /** Creates the global container for all aria-describedby messages. */\n private _createMessagesContainer;\n /** Deletes the global messages container. */\n private _deleteMessagesContainer;\n /** Removes all cdk-describedby messages that are hosted through the element. */\n private _removeCdkDescribedByReferenceIds;\n /**\n * Adds a message reference to the element using aria-describedby and increments the registered\n * message's reference count.\n */\n private _addMessageReference;\n /**\n * Removes a message reference from the element using aria-describedby\n * and decrements the registered message's reference count.\n */\n private _removeMessageReference;\n /** Returns true if the element has been described by the provided message ID. */\n private _isElementDescribedByMessage;\n /** Determines whether a message can be described on a particular element. */\n private _canBeDescribed;\n /** Checks whether a node is an Element node. */\n private _isElementNode;\n}\n"]} |
@ -0,0 +1,22 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Adds the given ID to the specified ARIA attribute on an element. |
||||
|
* Used for attributes such as aria-labelledby, aria-owns, etc. |
||||
|
*/ |
||||
|
export declare function addAriaReferencedId(el: Element, attr: string, id: string): void; |
||||
|
/** |
||||
|
* Removes the given ID from the specified ARIA attribute on an element. |
||||
|
* Used for attributes such as aria-labelledby, aria-owns, etc. |
||||
|
*/ |
||||
|
export declare function removeAriaReferencedId(el: Element, attr: string, id: string): void; |
||||
|
/** |
||||
|
* Gets the list of IDs referenced by the given ARIA attribute on an element. |
||||
|
* Used for attributes such as aria-labelledby, aria-owns, etc. |
||||
|
*/ |
||||
|
export declare function getAriaReferenceIds(el: Element, attr: string): string[]; |
@ -0,0 +1,11 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */ |
||||
|
export declare function isFakeMousedownFromScreenReader(event: MouseEvent): boolean; |
||||
|
/** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */ |
||||
|
export declare function isFakeTouchstartFromScreenReader(event: TouchEvent): boolean; |
@ -0,0 +1,211 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import { Platform } from '@angular/cdk/platform'; |
||||
|
import { ElementRef, EventEmitter, InjectionToken, NgZone, OnDestroy, AfterViewInit } from '@angular/core'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
import { InputModalityDetector } from '../input-modality/input-modality-detector'; |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
export declare type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null; |
||||
|
/** |
||||
|
* Corresponds to the options that can be passed to the native `focus` event. |
||||
|
* via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus
|
||||
|
*/ |
||||
|
export interface FocusOptions { |
||||
|
/** Whether the browser should scroll to the element when it is focused. */ |
||||
|
preventScroll?: boolean; |
||||
|
} |
||||
|
/** Detection mode used for attributing the origin of a focus event. */ |
||||
|
export declare const enum FocusMonitorDetectionMode { |
||||
|
/** |
||||
|
* Any mousedown, keydown, or touchstart event that happened in the previous |
||||
|
* tick or the current tick will be used to assign a focus event's origin (to |
||||
|
* either mouse, keyboard, or touch). This is the default option. |
||||
|
*/ |
||||
|
IMMEDIATE = 0, |
||||
|
/** |
||||
|
* A focus event's origin is always attributed to the last corresponding |
||||
|
* mousedown, keydown, or touchstart event, no matter how long ago it occurred. |
||||
|
*/ |
||||
|
EVENTUAL = 1 |
||||
|
} |
||||
|
/** Injectable service-level options for FocusMonitor. */ |
||||
|
export interface FocusMonitorOptions { |
||||
|
detectionMode?: FocusMonitorDetectionMode; |
||||
|
} |
||||
|
/** InjectionToken for FocusMonitorOptions. */ |
||||
|
export declare const FOCUS_MONITOR_DEFAULT_OPTIONS: InjectionToken<FocusMonitorOptions>; |
||||
|
/** Monitors mouse and keyboard events to determine the cause of focus events. */ |
||||
|
export declare class FocusMonitor implements OnDestroy { |
||||
|
private _ngZone; |
||||
|
private _platform; |
||||
|
private readonly _inputModalityDetector; |
||||
|
/** The focus origin that the next focus event is a result of. */ |
||||
|
private _origin; |
||||
|
/** The FocusOrigin of the last focus event tracked by the FocusMonitor. */ |
||||
|
private _lastFocusOrigin; |
||||
|
/** Whether the window has just been focused. */ |
||||
|
private _windowFocused; |
||||
|
/** The timeout id of the window focus timeout. */ |
||||
|
private _windowFocusTimeoutId; |
||||
|
/** The timeout id of the origin clearing timeout. */ |
||||
|
private _originTimeoutId; |
||||
|
/** |
||||
|
* Whether the origin was determined via a touch interaction. Necessary as properly attributing |
||||
|
* focus events to touch interactions requires special logic. |
||||
|
*/ |
||||
|
private _originFromTouchInteraction; |
||||
|
/** Map of elements being monitored to their info. */ |
||||
|
private _elementInfo; |
||||
|
/** The number of elements currently being monitored. */ |
||||
|
private _monitoredElementCount; |
||||
|
/** |
||||
|
* Keeps track of the root nodes to which we've currently bound a focus/blur handler, |
||||
|
* as well as the number of monitored elements that they contain. We have to treat focus/blur |
||||
|
* handlers differently from the rest of the events, because the browser won't emit events |
||||
|
* to the document when focus moves inside of a shadow root. |
||||
|
*/ |
||||
|
private _rootNodeFocusListenerCount; |
||||
|
/** |
||||
|
* The specified detection mode, used for attributing the origin of a focus |
||||
|
* event. |
||||
|
*/ |
||||
|
private readonly _detectionMode; |
||||
|
/** |
||||
|
* Event listener for `focus` events on the window. |
||||
|
* Needs to be an arrow function in order to preserve the context when it gets bound. |
||||
|
*/ |
||||
|
private _windowFocusListener; |
||||
|
/** Used to reference correct document/window */ |
||||
|
protected _document?: Document; |
||||
|
/** Subject for stopping our InputModalityDetector subscription. */ |
||||
|
private readonly _stopInputModalityDetector; |
||||
|
constructor(_ngZone: NgZone, _platform: Platform, _inputModalityDetector: InputModalityDetector, |
||||
|
/** @breaking-change 11.0.0 make document required */ |
||||
|
document: any | null, options: FocusMonitorOptions | null); |
||||
|
/** |
||||
|
* Event listener for `focus` and 'blur' events on the document. |
||||
|
* Needs to be an arrow function in order to preserve the context when it gets bound. |
||||
|
*/ |
||||
|
private _rootNodeFocusAndBlurListener; |
||||
|
/** |
||||
|
* Monitors focus on an element and applies appropriate CSS classes. |
||||
|
* @param element The element to monitor |
||||
|
* @param checkChildren Whether to count the element as focused when its children are focused. |
||||
|
* @returns An observable that emits when the focus state of the element changes. |
||||
|
* When the element is blurred, null will be emitted. |
||||
|
*/ |
||||
|
monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>; |
||||
|
/** |
||||
|
* Monitors focus on an element and applies appropriate CSS classes. |
||||
|
* @param element The element to monitor |
||||
|
* @param checkChildren Whether to count the element as focused when its children are focused. |
||||
|
* @returns An observable that emits when the focus state of the element changes. |
||||
|
* When the element is blurred, null will be emitted. |
||||
|
*/ |
||||
|
monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>; |
||||
|
/** |
||||
|
* Stops monitoring an element and removes all focus classes. |
||||
|
* @param element The element to stop monitoring. |
||||
|
*/ |
||||
|
stopMonitoring(element: HTMLElement): void; |
||||
|
/** |
||||
|
* Stops monitoring an element and removes all focus classes. |
||||
|
* @param element The element to stop monitoring. |
||||
|
*/ |
||||
|
stopMonitoring(element: ElementRef<HTMLElement>): void; |
||||
|
/** |
||||
|
* Focuses the element via the specified focus origin. |
||||
|
* @param element Element to focus. |
||||
|
* @param origin Focus origin. |
||||
|
* @param options Options that can be used to configure the focus behavior. |
||||
|
*/ |
||||
|
focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void; |
||||
|
/** |
||||
|
* Focuses the element via the specified focus origin. |
||||
|
* @param element Element to focus. |
||||
|
* @param origin Focus origin. |
||||
|
* @param options Options that can be used to configure the focus behavior. |
||||
|
*/ |
||||
|
focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void; |
||||
|
ngOnDestroy(): void; |
||||
|
/** Access injected document if available or fallback to global document reference */ |
||||
|
private _getDocument; |
||||
|
/** Use defaultView of injected document if available or fallback to global window reference */ |
||||
|
private _getWindow; |
||||
|
private _toggleClass; |
||||
|
private _getFocusOrigin; |
||||
|
/** |
||||
|
* Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a |
||||
|
* touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we |
||||
|
* handle a focus event following a touch interaction, we need to determine whether (1) the focus |
||||
|
* event was directly caused by the touch interaction or (2) the focus event was caused by a |
||||
|
* subsequent programmatic focus call triggered by the touch interaction. |
||||
|
* @param focusEventTarget The target of the focus event under examination. |
||||
|
*/ |
||||
|
private _shouldBeAttributedToTouch; |
||||
|
/** |
||||
|
* Sets the focus classes on the element based on the given focus origin. |
||||
|
* @param element The element to update the classes on. |
||||
|
* @param origin The focus origin. |
||||
|
*/ |
||||
|
private _setClasses; |
||||
|
/** |
||||
|
* Updates the focus origin. If we're using immediate detection mode, we schedule an async |
||||
|
* function to clear the origin at the end of a timeout. The duration of the timeout depends on |
||||
|
* the origin being set. |
||||
|
* @param origin The origin to set. |
||||
|
* @param isFromInteraction Whether we are setting the origin from an interaction event. |
||||
|
*/ |
||||
|
private _setOrigin; |
||||
|
/** |
||||
|
* Handles focus events on a registered element. |
||||
|
* @param event The focus event. |
||||
|
* @param element The monitored element. |
||||
|
*/ |
||||
|
private _onFocus; |
||||
|
/** |
||||
|
* Handles blur events on a registered element. |
||||
|
* @param event The blur event. |
||||
|
* @param element The monitored element. |
||||
|
*/ |
||||
|
_onBlur(event: FocusEvent, element: HTMLElement): void; |
||||
|
private _emitOrigin; |
||||
|
private _registerGlobalListeners; |
||||
|
private _removeGlobalListeners; |
||||
|
/** Updates all the state on an element once its focus origin has changed. */ |
||||
|
private _originChanged; |
||||
|
/** |
||||
|
* Collects the `MonitoredElementInfo` of a particular element and |
||||
|
* all of its ancestors that have enabled `checkChildren`. |
||||
|
* @param element Element from which to start the search. |
||||
|
*/ |
||||
|
private _getClosestElementsInfo; |
||||
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<FocusMonitor, [null, null, null, { optional: true; }, { optional: true; }]>; |
||||
|
} |
||||
|
/** |
||||
|
* Directive that determines how a particular element was focused (via keyboard, mouse, touch, or |
||||
|
* programmatically) and adds corresponding classes to the element. |
||||
|
* |
||||
|
* There are two variants of this directive: |
||||
|
* 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is |
||||
|
* focused. |
||||
|
* 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused. |
||||
|
*/ |
||||
|
export declare class CdkMonitorFocus implements AfterViewInit, OnDestroy { |
||||
|
private _elementRef; |
||||
|
private _focusMonitor; |
||||
|
private _monitorSubscription; |
||||
|
readonly cdkFocusChange: EventEmitter<FocusOrigin>; |
||||
|
constructor(_elementRef: ElementRef<HTMLElement>, _focusMonitor: FocusMonitor); |
||||
|
ngAfterViewInit(): void; |
||||
|
ngOnDestroy(): void; |
||||
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkMonitorFocus, never>; |
||||
|
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkMonitorFocus, "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", never, {}, { "cdkFocusChange": "cdkFocusChange"; }, never>; |
||||
|
} |
||||
|
|
||||
|
//# sourceMappingURL=focus-monitor.d.ts.map
|
@ -0,0 +1,205 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license |
||||
|
*/ |
||||
|
import { Platform } from '@angular/cdk/platform'; |
||||
|
import { ElementRef, EventEmitter, InjectionToken, NgZone, OnDestroy, AfterViewInit } from '@angular/core'; |
||||
|
import { Observable } from 'rxjs'; |
||||
|
import { InputModalityDetector } from '../input-modality/input-modality-detector'; |
||||
|
export declare type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null; |
||||
|
/** |
||||
|
* Corresponds to the options that can be passed to the native `focus` event. |
||||
|
* via https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus |
||||
|
*/ |
||||
|
export interface FocusOptions { |
||||
|
/** Whether the browser should scroll to the element when it is focused. */ |
||||
|
preventScroll?: boolean; |
||||
|
} |
||||
|
/** Detection mode used for attributing the origin of a focus event. */ |
||||
|
export declare const enum FocusMonitorDetectionMode { |
||||
|
/** |
||||
|
* Any mousedown, keydown, or touchstart event that happened in the previous |
||||
|
* tick or the current tick will be used to assign a focus event's origin (to |
||||
|
* either mouse, keyboard, or touch). This is the default option. |
||||
|
*/ |
||||
|
IMMEDIATE = 0, |
||||
|
/** |
||||
|
* A focus event's origin is always attributed to the last corresponding |
||||
|
* mousedown, keydown, or touchstart event, no matter how long ago it occurred. |
||||
|
*/ |
||||
|
EVENTUAL = 1 |
||||
|
} |
||||
|
/** Injectable service-level options for FocusMonitor. */ |
||||
|
export interface FocusMonitorOptions { |
||||
|
detectionMode?: FocusMonitorDetectionMode; |
||||
|
} |
||||
|
/** InjectionToken for FocusMonitorOptions. */ |
||||
|
export declare const FOCUS_MONITOR_DEFAULT_OPTIONS: InjectionToken<FocusMonitorOptions>; |
||||
|
/** Monitors mouse and keyboard events to determine the cause of focus events. */ |
||||
|
export declare class FocusMonitor implements OnDestroy { |
||||
|
private _ngZone; |
||||
|
private _platform; |
||||
|
private readonly _inputModalityDetector; |
||||
|
/** The focus origin that the next focus event is a result of. */ |
||||
|
private _origin; |
||||
|
/** The FocusOrigin of the last focus event tracked by the FocusMonitor. */ |
||||
|
private _lastFocusOrigin; |
||||
|
/** Whether the window has just been focused. */ |
||||
|
private _windowFocused; |
||||
|
/** The timeout id of the window focus timeout. */ |
||||
|
private _windowFocusTimeoutId; |
||||
|
/** The timeout id of the origin clearing timeout. */ |
||||
|
private _originTimeoutId; |
||||
|
/** |
||||
|
* Whether the origin was determined via a touch interaction. Necessary as properly attributing |
||||
|
* focus events to touch interactions requires special logic. |
||||
|
*/ |
||||
|
private _originFromTouchInteraction; |
||||
|
/** Map of elements being monitored to their info. */ |
||||
|
private _elementInfo; |
||||
|
/** The number of elements currently being monitored. */ |
||||
|
private _monitoredElementCount; |
||||
|
/** |
||||
|
* Keeps track of the root nodes to which we've currently bound a focus/blur handler, |
||||
|
* as well as the number of monitored elements that they contain. We have to treat focus/blur |
||||
|
* handlers differently from the rest of the events, because the browser won't emit events |
||||
|
* to the document when focus moves inside of a shadow root. |
||||
|
*/ |
||||
|
private _rootNodeFocusListenerCount; |
||||
|
/** |
||||
|
* The specified detection mode, used for attributing the origin of a focus |
||||
|
* event. |
||||
|
*/ |
||||
|
private readonly _detectionMode; |
||||
|
/** |
||||
|
* Event listener for `focus` events on the window. |
||||
|
* Needs to be an arrow function in order to preserve the context when it gets bound. |
||||
|
*/ |
||||
|
private _windowFocusListener; |
||||
|
/** Used to reference correct document/window */ |
||||
|
protected _document?: Document; |
||||
|
/** Subject for stopping our InputModalityDetector subscription. */ |
||||
|
private readonly _stopInputModalityDetector; |
||||
|
constructor(_ngZone: NgZone, _platform: Platform, _inputModalityDetector: InputModalityDetector, |
||||
|
/** @breaking-change 11.0.0 make document required */ |
||||
|
document: any | null, options: FocusMonitorOptions | null); |
||||
|
/** |
||||
|
* Event listener for `focus` and 'blur' events on the document. |
||||
|
* Needs to be an arrow function in order to preserve the context when it gets bound. |
||||
|
*/ |
||||
|
private _rootNodeFocusAndBlurListener; |
||||
|
/** |
||||
|
* Monitors focus on an element and applies appropriate CSS classes. |
||||
|
* @param element The element to monitor |
||||
|
* @param checkChildren Whether to count the element as focused when its children are focused. |
||||
|
* @returns An observable that emits when the focus state of the element changes. |
||||
|
* When the element is blurred, null will be emitted. |
||||
|
*/ |
||||
|
monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>; |
||||
|
/** |
||||
|
* Monitors focus on an element and applies appropriate CSS classes. |
||||
|
* @param element The element to monitor |
||||
|
* @param checkChildren Whether to count the element as focused when its children are focused. |
||||
|
* @returns An observable that emits when the focus state of the element changes. |
||||
|
* When the element is blurred, null will be emitted. |
||||
|
*/ |
||||
|
monitor(element: ElementRef<HTMLElement>, checkChildren?: boolean): Observable<FocusOrigin>; |
||||
|
/** |
||||
|
* Stops monitoring an element and removes all focus classes. |
||||
|
* @param element The element to stop monitoring. |
||||
|
*/ |
||||
|
stopMonitoring(element: HTMLElement): void; |
||||
|
/** |
||||
|
* Stops monitoring an element and removes all focus classes. |
||||
|
* @param element The element to stop monitoring. |
||||
|
*/ |
||||
|
stopMonitoring(element: ElementRef<HTMLElement>): void; |
||||
|
/** |
||||
|
* Focuses the element via the specified focus origin. |
||||
|
* @param element Element to focus. |
||||
|
* @param origin Focus origin. |
||||
|
* @param options Options that can be used to configure the focus behavior. |
||||
|
*/ |
||||
|
focusVia(element: HTMLElement, origin: FocusOrigin, options?: FocusOptions): void; |
||||
|
/** |
||||
|
* Focuses the element via the specified focus origin. |
||||
|
* @param element Element to focus. |
||||
|
* @param origin Focus origin. |
||||
|
* @param options Options that can be used to configure the focus behavior. |
||||
|
*/ |
||||
|
focusVia(element: ElementRef<HTMLElement>, origin: FocusOrigin, options?: FocusOptions): void; |
||||
|
ngOnDestroy(): void; |
||||
|
/** Access injected document if available or fallback to global document reference */ |
||||
|
private _getDocument; |
||||
|
/** Use defaultView of injected document if available or fallback to global window reference */ |
||||
|
private _getWindow; |
||||
|
private _toggleClass; |
||||
|
private _getFocusOrigin; |
||||
|
/** |
||||
|
* Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a |
||||
|
* touch origin isn't immediately reset at the next tick (see _setOrigin). This means that when we |
||||
|
* handle a focus event following a touch interaction, we need to determine whether (1) the focus |
||||
|
* event was directly caused by the touch interaction or (2) the focus event was caused by a |
||||
|
* subsequent programmatic focus call triggered by the touch interaction. |
||||
|
* @param focusEventTarget The target of the focus event under examination. |
||||
|
*/ |
||||
|
private _shouldBeAttributedToTouch; |
||||
|
/** |
||||
|
* Sets the focus classes on the element based on the given focus origin. |
||||
|
* @param element The element to update the classes on. |
||||
|
* @param origin The focus origin. |
||||
|
*/ |
||||
|
private _setClasses; |
||||
|
/** |
||||
|
* Updates the focus origin. If we're using immediate detection mode, we schedule an async |
||||
|
* function to clear the origin at the end of a timeout. The duration of the timeout depends on |
||||
|
* the origin being set. |
||||
|
* @param origin The origin to set. |
||||
|
* @param isFromInteraction Whether we are setting the origin from an interaction event. |
||||
|
*/ |
||||
|
private _setOrigin; |
||||
|
/** |
||||
|
* Handles focus events on a registered element. |
||||
|
* @param event The focus event. |
||||
|
* @param element The monitored element. |
||||
|
*/ |
||||
|
private _onFocus; |
||||
|
/** |
||||
|
* Handles blur events on a registered element. |
||||
|
* @param event The blur event. |
||||
|
* @param element The monitored element. |
||||
|
*/ |
||||
|
_onBlur(event: FocusEvent, element: HTMLElement): void; |
||||
|
private _emitOrigin; |
||||
|
private _registerGlobalListeners; |
||||
|
private _removeGlobalListeners; |
||||
|
/** Updates all the state on an element once its focus origin has changed. */ |
||||
|
private _originChanged; |
||||
|
/** |
||||
|
* Collects the `MonitoredElementInfo` of a particular element and |
||||
|
* all of its ancestors that have enabled `checkChildren`. |
||||
|
* @param element Element from which to start the search. |
||||
|
*/ |
||||
|
private _getClosestElementsInfo; |
||||
|
} |
||||
|
/** |
||||
|
* Directive that determines how a particular element was focused (via keyboard, mouse, touch, or |
||||
|
* programmatically) and adds corresponding classes to the element. |
||||
|
* |
||||
|
* There are two variants of this directive: |
||||
|
* 1) cdkMonitorElementFocus: does not consider an element to be focused if one of its children is |
||||
|
* focused. |
||||
|
* 2) cdkMonitorSubtreeFocus: considers an element focused if it or any of its children are focused. |
||||
|
*/ |
||||
|
export declare class CdkMonitorFocus implements AfterViewInit, OnDestroy { |
||||
|
private _elementRef; |
||||
|
private _focusMonitor; |
||||
|
private _monitorSubscription; |
||||
|
readonly cdkFocusChange: EventEmitter<FocusOrigin>; |
||||
|
constructor(_elementRef: ElementRef<HTMLElement>, _focusMonitor: FocusMonitor); |
||||
|
ngAfterViewInit(): void; |
||||
|
ngOnDestroy(): void; |
||||
|
} |
1
node_modules/@angular/cdk/a11y/focus-monitor/focus-monitor.d.ts.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,16 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
/** |
||||
|
* Options for creating a ConfigurableFocusTrap. |
||||
|
*/ |
||||
|
export interface ConfigurableFocusTrapConfig { |
||||
|
/** |
||||
|
* Whether to defer the creation of FocusTrap elements to be done manually by the user. |
||||
|
*/ |
||||
|
defer: boolean; |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license
|
||||
|
*/ |
||||
|
import { NgZone } from '@angular/core'; |
||||
|
import { InteractivityChecker } from '../interactivity-checker/interactivity-checker'; |
||||
|
import { ConfigurableFocusTrap } from './configurable-focus-trap'; |
||||
|
import { ConfigurableFocusTrapConfig } from './configurable-focus-trap-config'; |
||||
|
import { FocusTrapInertStrategy } from './focus-trap-inert-strategy'; |
||||
|
import { FocusTrapManager } from './focus-trap-manager'; |
||||
|
/** Factory that allows easy instantiation of configurable focus traps. */ |
||||
|
import * as ɵngcc0 from '@angular/core'; |
||||
|
export declare class ConfigurableFocusTrapFactory { |
||||
|
private _checker; |
||||
|
private _ngZone; |
||||
|
private _focusTrapManager; |
||||
|
private _document; |
||||
|
private _inertStrategy; |
||||
|
constructor(_checker: InteractivityChecker, _ngZone: NgZone, _focusTrapManager: FocusTrapManager, _document: any, _inertStrategy?: FocusTrapInertStrategy); |
||||
|
/** |
||||
|
* Creates a focus-trapped region around the given element. |
||||
|
* @param element The element around which focus will be trapped. |
||||
|
* @param config The focus trap configuration. |
||||
|
* @returns The created focus trap instance. |
||||
|
*/ |
||||
|
create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap; |
||||
|
/** |
||||
|
* @deprecated Pass a config object instead of the `deferCaptureElements` flag. |
||||
|
* @breaking-change 11.0.0 |
||||
|
*/ |
||||
|
create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap; |
||||
|
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ConfigurableFocusTrapFactory, [null, null, null, null, { optional: true; }]>; |
||||
|
} |
||||
|
|
||||
|
//# sourceMappingURL=configurable-focus-trap-factory.d.ts.map
|
@ -0,0 +1,34 @@ |
|||||
|
/** |
||||
|
* @license |
||||
|
* Copyright Google LLC All Rights Reserved. |
||||
|
* |
||||
|
* Use of this source code is governed by an MIT-style license that can be |
||||
|
* found in the LICENSE file at https://angular.io/license |
||||
|
*/ |
||||
|
import { NgZone } from '@angular/core'; |
||||
|
import { InteractivityChecker } from '../interactivity-checker/interactivity-checker'; |
||||
|
import { ConfigurableFocusTrap } from './configurable-focus-trap'; |
||||
|
import { ConfigurableFocusTrapConfig } from './configurable-focus-trap-config'; |
||||
|
import { FocusTrapInertStrategy } from './focus-trap-inert-strategy'; |
||||
|
import { FocusTrapManager } from './focus-trap-manager'; |
||||
|
/** Factory that allows easy instantiation of configurable focus traps. */ |
||||
|
export declare class ConfigurableFocusTrapFactory { |
||||
|
private _checker; |
||||
|
private _ngZone; |
||||
|
private _focusTrapManager; |
||||
|
private _document; |
||||
|
private _inertStrategy; |
||||
|
constructor(_checker: InteractivityChecker, _ngZone: NgZone, _focusTrapManager: FocusTrapManager, _document: any, _inertStrategy?: FocusTrapInertStrategy); |
||||
|
/** |
||||
|
* Creates a focus-trapped region around the given element. |
||||
|
* @param element The element around which focus will be trapped. |
||||
|
* @param config The focus trap configuration. |
||||
|
* @returns The created focus trap instance. |
||||
|
*/ |
||||
|
create(element: HTMLElement, config?: ConfigurableFocusTrapConfig): ConfigurableFocusTrap; |
||||
|
/** |
||||
|
* @deprecated Pass a config object instead of the `deferCaptureElements` flag. |
||||
|
* @breaking-change 11.0.0 |
||||
|
*/ |
||||
|
create(element: HTMLElement, deferCaptureElements: boolean): ConfigurableFocusTrap; |
||||
|
} |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue