@angular/cdk 6.4.6 → 6.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/typings/focus-monitor/focus-monitor.d.ts +1 -1
- package/a11y/typings/focus-trap/focus-trap.d.ts +1 -1
- package/a11y/typings/index.metadata.json +1 -1
- package/accordion/typings/accordion.d.ts +6 -1
- package/accordion/typings/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +9 -7
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +28 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +9 -3
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +5 -10
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +1 -1
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +36 -6
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +29 -9
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +12 -23
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/collections/typings/index.metadata.json +1 -1
- package/collections/typings/selection.d.ts +6 -0
- package/esm2015/a11y.js +10 -4
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +18 -1
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/collections.js +9 -3
- package/esm2015/collections.js.map +1 -1
- package/esm2015/observers.js +4 -4
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/scrolling.js +1 -1
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +32 -4
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +30 -8
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +9 -9
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +9 -7
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +25 -1
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/cdk.es5.js +1 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/collections.es5.js +9 -3
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/observers.es5.js +5 -10
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +1 -1
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +34 -4
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +28 -7
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +12 -23
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js.map +1 -1
- package/observers/typings/index.metadata.json +1 -1
- package/observers/typings/observe-content.d.ts +6 -1
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/position/connected-position-strategy.d.ts +1 -1
- package/package.json +3 -3
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/stepper.d.ts +10 -2
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/sticky-styler.d.ts +3 -1
- package/table/typings/table.d.ts +10 -1
- package/text-field/typings/autofill.d.ts +13 -2
- package/text-field/typings/autosize.d.ts +1 -1
- package/text-field/typings/index.metadata.json +1 -1
- package/tree/typings/index.metadata.json +1 -1
- package/tree/typings/nested-node.d.ts +2 -2
- package/tree/typings/padding.d.ts +1 -1
- package/tree/typings/tree.d.ts +2 -2
- package/typings/a11y/focus-monitor/focus-monitor.d.ts +1 -1
- package/typings/a11y/focus-trap/focus-trap.d.ts +1 -1
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/accordion/accordion.d.ts +6 -1
- package/typings/accordion/index.metadata.json +1 -1
- package/typings/collections/index.metadata.json +1 -1
- package/typings/collections/selection.d.ts +6 -0
- package/typings/esm5/a11y/focus-monitor/focus-monitor.d.ts +1 -1
- package/typings/esm5/a11y/focus-trap/focus-trap.d.ts +1 -1
- package/typings/esm5/a11y/index.metadata.json +1 -1
- package/typings/esm5/accordion/accordion.d.ts +6 -1
- package/typings/esm5/accordion/index.metadata.json +1 -1
- package/typings/esm5/collections/index.metadata.json +1 -1
- package/typings/esm5/collections/selection.d.ts +6 -0
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/observers/index.metadata.json +1 -1
- package/typings/esm5/observers/observe-content.d.ts +6 -1
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/esm5/stepper/index.metadata.json +1 -1
- package/typings/esm5/stepper/stepper.d.ts +10 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/sticky-styler.d.ts +3 -1
- package/typings/esm5/table/table.d.ts +10 -1
- package/typings/esm5/text-field/autofill.d.ts +13 -2
- package/typings/esm5/text-field/autosize.d.ts +1 -1
- package/typings/esm5/text-field/index.metadata.json +1 -1
- package/typings/esm5/tree/index.metadata.json +1 -1
- package/typings/esm5/tree/nested-node.d.ts +2 -2
- package/typings/esm5/tree/padding.d.ts +1 -1
- package/typings/esm5/tree/tree.d.ts +2 -2
- package/typings/index.metadata.json +1 -1
- package/typings/observers/index.metadata.json +1 -1
- package/typings/observers/observe-content.d.ts +6 -1
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/position/connected-position-strategy.d.ts +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/stepper.d.ts +10 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/sticky-styler.d.ts +3 -1
- package/typings/table/table.d.ts +10 -1
- package/typings/text-field/autofill.d.ts +13 -2
- package/typings/text-field/autosize.d.ts +1 -1
- package/typings/text-field/index.metadata.json +1 -1
- package/typings/tree/index.metadata.json +1 -1
- package/typings/tree/nested-node.d.ts +2 -2
- package/typings/tree/padding.d.ts +1 -1
- package/typings/tree/tree.d.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk-stepper.umd.min.js","sources":["../../src/cdk/stepper/step-label.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper-module.ts"],"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 */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n","/**\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 */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._defaultCompleted : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private get _defaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n constructor(@Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper) { }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /** The list of step headers of the steps in the stepper. */\n _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 7.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef) {\n this._groupId = nextId++;\n }\n\n ngAfterViewInit() {\n this._keyManager = new FocusKeyManager(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number): 'number' | 'edit' | 'done' {\n const step = this._steps.toArray()[index];\n if (!step.completed || this._selectedIndex == index) {\n return 'number';\n } else {\n return step.editable ? 'edit' : 'done';\n }\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n this._keyManager.updateActiveItemIndex(newIndex);\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const keyCode = event.keyCode;\n\n if (this._keyManager.activeItemIndex != null && (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = this._keyManager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n this._keyManager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n this._keyManager.setLastItemActive();\n event.preventDefault();\n } else {\n this._keyManager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n}\n","/**\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 */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\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 */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],\n declarations: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]\n})\nexport class CdkStepperModule {}\n"],"names":["CdkStepLabel","template","this","type","Directive","args","selector","TemplateRef","nextId","StepperSelectionEvent","CdkStep","_stepper","interacted","_editable","_optional","_customCompleted","Object","defineProperty","prototype","value","coerceBooleanProperty","_defaultCompleted","stepControl","valid","select","selected","reset","ngOnChanges","_stateChanged","Component","exportAs","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","label","ariaLabel","ariaLabelledby","editable","optional","completed","CdkStepper","_changeDetectorRef","_selectedIndex","_groupId","get","configurable","index","_steps","length","_anyControlsInvalidOrPending","toArray","_updateSelectedItemIndex","enumerable","set","_keyManager","FocusKeyManager","_stepHeader","withWrap","withVerticalOrientation","_orientation","_dir","obaservableOf","pipe","startWith","_layoutDirection","takeUntil","_destroyed","subscribe","direction","_this","withHorizontalOrientation","updateActiveItemIndex","complete","forEach","step","position","selectionChange","emit","selectedIndex","newIndex","previouslySelectedIndex","selectedStep","stepsArray","previouslySelectedStep","activeItemIndex","keyCode","SPACE","ENTER","HOME","setFirstItemActive","event","preventDefault","END","setLastItemActive","onKeydown","steps","_linear","slice","some","control","invalid","pending","decorators","Output","CdkStepperNext","host","(click)","[type]","CdkStepperPrevious","NgModule","imports","BidiModule","CommonModule","exports","declarations","CdkStepperModule"],"mappings":";;;;;;;izBAcE,QAAFA,GAA0CC,GAAAC,KAA1CD,SAA0CA,EAd1C,sBAUAE,KAACC,EAAAA,UAADC,OACEC,SAAU,yDAHZH,KAAmBI,EAAAA,eARnBP,KCuCIQ,EAAS,EA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Bd7G,KAAQ0C,uBA2BR1C,OAAAA,KAAGmC,EAAAA,SApCH2E,gCCAA,sBAeA9G,KAAC+G,EAAAA,SAAD7G,OACE8G,SAAUC,EAAAA,WAAYC,EAAAA,cACtBC,SAAU5G,EAASmC,EAAY7C,EAAc6G,EAAgBI,GAC7DM,cAAe7G,EAASmC,EAAY7C,EAAc6G,EAAgBI,OAlBpEO"}
|
|
1
|
+
{"version":3,"file":"cdk-stepper.umd.min.js","sources":["../../src/cdk/stepper/step-label.ts","../../src/cdk/stepper/stepper.ts","../../src/cdk/stepper/stepper-button.ts","../../src/cdk/stepper/stepper-module.ts"],"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 */\n\nimport {Directive, TemplateRef} from '@angular/core';\n\n@Directive({\n selector: '[cdkStepLabel]',\n})\nexport class CdkStepLabel {\n constructor(/** @docs-private */ public template: TemplateRef<any>) { }\n}\n","/**\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 */\n\nimport {FocusableOption, FocusKeyManager} from '@angular/cdk/a11y';\nimport {Direction, Directionality} from '@angular/cdk/bidi';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {END, ENTER, HOME, SPACE} from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ContentChildren,\n Directive,\n EventEmitter,\n ElementRef,\n forwardRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {DOCUMENT} from '@angular/common';\nimport {AbstractControl} from '@angular/forms';\nimport {CdkStepLabel} from './step-label';\nimport {Observable, Subject, of as obaservableOf} from 'rxjs';\nimport {startWith, takeUntil} from 'rxjs/operators';\n\n/** Used to generate unique ID for each stepper component. */\nlet nextId = 0;\n\n/**\n * Position state of the content of each step in stepper that is used for transitioning\n * the content into correct position upon step selection change.\n */\nexport type StepContentPositionState = 'previous' | 'current' | 'next';\n\n/** Possible orientation of a stepper. */\nexport type StepperOrientation = 'horizontal' | 'vertical';\n\n/** Change event emitted on selection changes. */\nexport class StepperSelectionEvent {\n /** Index of the step now selected. */\n selectedIndex: number;\n\n /** Index of the step previously selected. */\n previouslySelectedIndex: number;\n\n /** The step instance now selected. */\n selectedStep: CdkStep;\n\n /** The step instance previously selected. */\n previouslySelectedStep: CdkStep;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'cdk-step',\n exportAs: 'cdkStep',\n template: '<ng-template><ng-content></ng-content></ng-template>',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class CdkStep implements OnChanges {\n /** Template for step label if it exists. */\n @ContentChild(CdkStepLabel) stepLabel: CdkStepLabel;\n\n /** Template for step content. */\n @ViewChild(TemplateRef) content: TemplateRef<any>;\n\n /** The top level abstract control of the step. */\n @Input() stepControl: AbstractControl;\n\n /** Whether user has seen the expanded step content or not. */\n interacted = false;\n\n /** Plain text label of the step. */\n @Input() label: string;\n\n /** Aria label for the tab. */\n @Input('aria-label') ariaLabel: string;\n\n /**\n * Reference to the element that the tab is labelled by.\n * Will be cleared if `aria-label` is set at the same time.\n */\n @Input('aria-labelledby') ariaLabelledby: string;\n\n /** Whether the user can return to this step once it has been marked as complted. */\n @Input()\n get editable(): boolean { return this._editable; }\n set editable(value: boolean) {\n this._editable = coerceBooleanProperty(value);\n }\n private _editable = true;\n\n /** Whether the completion of step is optional. */\n @Input()\n get optional(): boolean { return this._optional; }\n set optional(value: boolean) {\n this._optional = coerceBooleanProperty(value);\n }\n private _optional = false;\n\n /** Whether step is marked as completed. */\n @Input()\n get completed(): boolean {\n return this._customCompleted == null ? this._defaultCompleted : this._customCompleted;\n }\n set completed(value: boolean) {\n this._customCompleted = coerceBooleanProperty(value);\n }\n private _customCompleted: boolean | null = null;\n\n private get _defaultCompleted() {\n return this.stepControl ? this.stepControl.valid && this.interacted : this.interacted;\n }\n\n constructor(@Inject(forwardRef(() => CdkStepper)) private _stepper: CdkStepper) { }\n\n /** Selects this step component. */\n select(): void {\n this._stepper.selected = this;\n }\n\n /** Resets the step to its initial state. Note that this includes resetting form data. */\n reset(): void {\n this.interacted = false;\n\n if (this._customCompleted != null) {\n this._customCompleted = false;\n }\n\n if (this.stepControl) {\n this.stepControl.reset();\n }\n }\n\n ngOnChanges() {\n // Since basically all inputs of the MatStep get proxied through the view down to the\n // underlying MatStepHeader, we have to make sure that change detection runs correctly.\n this._stepper._stateChanged();\n }\n}\n\n@Directive({\n selector: '[cdkStepper]',\n exportAs: 'cdkStepper',\n})\nexport class CdkStepper implements AfterViewInit, OnDestroy {\n /** Emits when the component is destroyed. */\n protected _destroyed = new Subject<void>();\n\n /** Used for managing keyboard focus. */\n private _keyManager: FocusKeyManager<FocusableOption>;\n\n /**\n * @breaking-change 8.0.0 Remove `| undefined` once the `_document`\n * constructor param is required.\n */\n private _document: Document | undefined;\n\n /** The list of step components that the stepper is holding. */\n @ContentChildren(CdkStep) _steps: QueryList<CdkStep>;\n\n /** The list of step headers of the steps in the stepper. */\n _stepHeader: QueryList<FocusableOption>;\n\n /** Whether the validity of previous steps should be checked or not. */\n @Input()\n get linear(): boolean { return this._linear; }\n set linear(value: boolean) { this._linear = coerceBooleanProperty(value); }\n private _linear = false;\n\n /** The index of the selected step. */\n @Input()\n get selectedIndex() { return this._selectedIndex; }\n set selectedIndex(index: number) {\n if (this._steps) {\n // Ensure that the index can't be out of bounds.\n if (index < 0 || index > this._steps.length - 1) {\n throw Error('cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.');\n }\n\n if (this._selectedIndex != index &&\n !this._anyControlsInvalidOrPending(index) &&\n (index >= this._selectedIndex || this._steps.toArray()[index].editable)) {\n this._updateSelectedItemIndex(index);\n }\n } else {\n this._selectedIndex = index;\n }\n }\n private _selectedIndex = 0;\n\n /** The step that is selected. */\n @Input()\n get selected(): CdkStep {\n // @breaking-change 7.0.0 Change return type to `CdkStep | undefined`.\n return this._steps ? this._steps.toArray()[this.selectedIndex] : undefined!;\n }\n set selected(step: CdkStep) {\n this.selectedIndex = this._steps ? this._steps.toArray().indexOf(step) : -1;\n }\n\n /** Event emitted when the selected step has changed. */\n @Output() selectionChange: EventEmitter<StepperSelectionEvent>\n = new EventEmitter<StepperSelectionEvent>();\n\n /** Used to track unique ID for each stepper component. */\n _groupId: number;\n\n protected _orientation: StepperOrientation = 'horizontal';\n\n constructor(\n @Optional() private _dir: Directionality,\n private _changeDetectorRef: ChangeDetectorRef,\n // @breaking-change 8.0.0 `_elementRef` and `_document` parameters to become required.\n private _elementRef?: ElementRef<HTMLElement>,\n @Inject(DOCUMENT) _document?: any) {\n this._groupId = nextId++;\n this._document = _document;\n }\n\n ngAfterViewInit() {\n this._keyManager = new FocusKeyManager(this._stepHeader)\n .withWrap()\n .withVerticalOrientation(this._orientation === 'vertical');\n\n (this._dir ? this._dir.change as Observable<Direction> : obaservableOf())\n .pipe(startWith(this._layoutDirection()), takeUntil(this._destroyed))\n .subscribe(direction => this._keyManager.withHorizontalOrientation(direction));\n\n this._keyManager.updateActiveItemIndex(this._selectedIndex);\n\n this._steps.changes.pipe(takeUntil(this._destroyed)).subscribe(() => {\n if (!this.selected) {\n this._selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n });\n }\n\n ngOnDestroy() {\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Selects and focuses the next step in list. */\n next(): void {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this._steps.length - 1);\n }\n\n /** Selects and focuses the previous step in list. */\n previous(): void {\n this.selectedIndex = Math.max(this._selectedIndex - 1, 0);\n }\n\n /** Resets the stepper to its initial state. Note that this includes clearing form data. */\n reset(): void {\n this._updateSelectedItemIndex(0);\n this._steps.forEach(step => step.reset());\n this._stateChanged();\n }\n\n /** Returns a unique id for each step label element. */\n _getStepLabelId(i: number): string {\n return `cdk-step-label-${this._groupId}-${i}`;\n }\n\n /** Returns unique id for each step content element. */\n _getStepContentId(i: number): string {\n return `cdk-step-content-${this._groupId}-${i}`;\n }\n\n /** Marks the component to be change detected. */\n _stateChanged() {\n this._changeDetectorRef.markForCheck();\n }\n\n /** Returns position state of the step with the given index. */\n _getAnimationDirection(index: number): StepContentPositionState {\n const position = index - this._selectedIndex;\n if (position < 0) {\n return this._layoutDirection() === 'rtl' ? 'next' : 'previous';\n } else if (position > 0) {\n return this._layoutDirection() === 'rtl' ? 'previous' : 'next';\n }\n return 'current';\n }\n\n /** Returns the type of icon to be displayed. */\n _getIndicatorType(index: number): 'number' | 'edit' | 'done' {\n const step = this._steps.toArray()[index];\n if (!step.completed || this._selectedIndex == index) {\n return 'number';\n } else {\n return step.editable ? 'edit' : 'done';\n }\n }\n\n /** Returns the index of the currently-focused step header. */\n _getFocusIndex() {\n return this._keyManager ? this._keyManager.activeItemIndex : this._selectedIndex;\n }\n\n private _updateSelectedItemIndex(newIndex: number): void {\n const stepsArray = this._steps.toArray();\n this.selectionChange.emit({\n selectedIndex: newIndex,\n previouslySelectedIndex: this._selectedIndex,\n selectedStep: stepsArray[newIndex],\n previouslySelectedStep: stepsArray[this._selectedIndex],\n });\n\n // If focus is inside the stepper, move it to the next header, otherwise it may become\n // lost when the active step content is hidden. We can't be more granular with the check\n // (e.g. checking whether focus is inside the active step), because we don't have a\n // reference to the elements that are rendering out the content.\n this._containsFocus() ? this._keyManager.setActiveItem(newIndex) :\n this._keyManager.updateActiveItemIndex(newIndex);\n\n this._selectedIndex = newIndex;\n this._stateChanged();\n }\n\n _onKeydown(event: KeyboardEvent) {\n const keyCode = event.keyCode;\n\n if (this._keyManager.activeItemIndex != null && (keyCode === SPACE || keyCode === ENTER)) {\n this.selectedIndex = this._keyManager.activeItemIndex;\n event.preventDefault();\n } else if (keyCode === HOME) {\n this._keyManager.setFirstItemActive();\n event.preventDefault();\n } else if (keyCode === END) {\n this._keyManager.setLastItemActive();\n event.preventDefault();\n } else {\n this._keyManager.onKeydown(event);\n }\n }\n\n private _anyControlsInvalidOrPending(index: number): boolean {\n const steps = this._steps.toArray();\n\n steps[this._selectedIndex].interacted = true;\n\n if (this._linear && index >= 0) {\n return steps.slice(0, index).some(step => {\n const control = step.stepControl;\n const isIncomplete = control ?\n (control.invalid || control.pending || !step.interacted) :\n !step.completed;\n return isIncomplete && !step.optional;\n });\n }\n\n return false;\n }\n\n private _layoutDirection(): Direction {\n return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Checks whether the stepper contains the focused element. */\n private _containsFocus(): boolean {\n if (!this._document || !this._elementRef) {\n return false;\n }\n\n const stepperElement = this._elementRef.nativeElement;\n const focusedElement = this._document.activeElement;\n return stepperElement === focusedElement || stepperElement.contains(focusedElement);\n }\n}\n","/**\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 */\n\nimport {Directive, Input} from '@angular/core';\nimport {CdkStepper} from './stepper';\n\n/** Button that moves to the next step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperNext]',\n host: {\n '(click)': '_stepper.next()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperNext {\n /** Type of the next button. Defaults to \"submit\" if not specified. */\n @Input() type: string = 'submit';\n\n constructor(public _stepper: CdkStepper) {}\n}\n\n/** Button that moves to the previous step in a stepper workflow. */\n@Directive({\n selector: 'button[cdkStepperPrevious]',\n host: {\n '(click)': '_stepper.previous()',\n '[type]': 'type',\n }\n})\nexport class CdkStepperPrevious {\n /** Type of the previous button. Defaults to \"button\" if not specified. */\n @Input() type: string = 'button';\n\n constructor(public _stepper: CdkStepper) {}\n}\n","/**\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 */\n\nimport {NgModule} from '@angular/core';\nimport {CdkStepper, CdkStep} from './stepper';\nimport {CommonModule} from '@angular/common';\nimport {CdkStepLabel} from './step-label';\nimport {CdkStepperNext, CdkStepperPrevious} from './stepper-button';\nimport {BidiModule} from '@angular/cdk/bidi';\n\n@NgModule({\n imports: [BidiModule, CommonModule],\n exports: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious],\n declarations: [CdkStep, CdkStepper, CdkStepLabel, CdkStepperNext, CdkStepperPrevious]\n})\nexport class CdkStepperModule {}\n"],"names":["CdkStepLabel","template","this","type","Directive","args","selector","TemplateRef","nextId","StepperSelectionEvent","CdkStep","_stepper","interacted","_editable","_optional","_customCompleted","Object","defineProperty","prototype","value","coerceBooleanProperty","_defaultCompleted","stepControl","valid","select","selected","reset","ngOnChanges","_stateChanged","Component","exportAs","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","propDecorators","Input","label","ariaLabel","ariaLabelledby","editable","optional","completed","CdkStepper","_changeDetectorRef","_elementRef","_selectedIndex","_groupId","_document","get","configurable","index","_steps","length","_anyControlsInvalidOrPending","toArray","_updateSelectedItemIndex","enumerable","set","_keyManager","FocusKeyManager","_stepHeader","withWrap","withVerticalOrientation","_orientation","_dir","obaservableOf","pipe","startWith","_layoutDirection","takeUntil","_destroyed","subscribe","direction","_this","withHorizontalOrientation","updateActiveItemIndex","changes","Math","max","complete","forEach","step","position","selectionChange","emit","selectedIndex","newIndex","previouslySelectedIndex","selectedStep","stepsArray","previouslySelectedStep","activeItemIndex","keyCode","SPACE","ENTER","HOME","setFirstItemActive","event","preventDefault","END","setLastItemActive","onKeydown","steps","_linear","slice","some","control","invalid","pending","stepperElement","nativeElement","focusedElement","activeElement","contains","decorators","ElementRef","undefined","Inject","DOCUMENT","Output","CdkStepperNext","host","(click)","[type]","CdkStepperPrevious","NgModule","imports","BidiModule","CommonModule","exports","declarations","CdkStepperModule"],"mappings":";;;;;;;izBAcE,QAAF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AA,OAAAnH,MAAAoH,EAAAA,eAwNA5E,EAAAR,mFAxDAmD,gBAAArF,KAAAmC,EAAAA,QAMAb,WAAAtB,KAAAmC,EAAAA,QAMAgD,kBAAAnF,KAAAuH,EAAAA,UA+BA7E,kBCnME,QAAF8E,GAAqBhH,GAAAT,KAArBS,SAAqBA,EAFrBT,KAAAC,KAA0B,SArB1B,sBAYAA,KAACC,EAAAA,UAADC,OACEC,SAAU,yBACVsH,MACEC,UAAW,kBACXC,SAAU,gDAPd3H,KAAQ0C,uBAYR1C,OAAAA,KAAGmC,EAAAA,SArBHqF,kBAsCE,QAAFI,GAAqBpH,GAAAT,KAArBS,SAAqBA,EAFrBT,KAAAC,KAA0B,SApC1B,sBA2BAA,KAACC,EAAAA,UAADC,OACEC,SAAU,6BACVsH,MACEC,UAAW,sBACXC,SAAU,gDAtBd3H,KAAQ0C,uBA2BR1C,OAAAA,KAAGmC,EAAAA,SApCHyF,gCCAA,sBAeA5H,KAAC6H,EAAAA,SAAD3H,OACE4H,SAAUC,EAAAA,WAAYC,EAAAA,cACtBC,SAAU1H,EAASmC,EAAY7C,EAAc2H,EAAgBI,GAC7DM,cAAe3H,EAASmC,EAAY7C,EAAc2H,EAAgBI,OAlBpEO"}
|
package/bundles/cdk-table.umd.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
(function (global, factory) {
|
|
9
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/core'), require('@angular/cdk/collections'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/bidi'), require('@angular/
|
|
10
|
-
typeof define === 'function' && define.amd ? define('@angular/cdk/table', ['exports', '@angular/cdk/coercion', '@angular/core', '@angular/cdk/collections', 'rxjs', 'rxjs/operators', '@angular/cdk/bidi', '@angular/
|
|
11
|
-
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = {}),global.ng.cdk.coercion,global.ng.core,global.ng.cdk.collections,global.rxjs,global.rxjs.operators,global.ng.cdk.bidi,global.ng.
|
|
12
|
-
}(this, (function (exports,coercion,core,collections,rxjs,operators,bidi,
|
|
9
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/coercion'), require('@angular/core'), require('@angular/cdk/collections'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/bidi'), require('@angular/cdk/platform')) :
|
|
10
|
+
typeof define === 'function' && define.amd ? define('@angular/cdk/table', ['exports', '@angular/cdk/coercion', '@angular/core', '@angular/cdk/collections', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/cdk/bidi', '@angular/cdk/platform'], factory) :
|
|
11
|
+
(factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.table = {}),global.ng.cdk.coercion,global.ng.core,global.ng.cdk.collections,global.ng.common,global.rxjs,global.rxjs.operators,global.ng.cdk.bidi,global.ng.cdk.platform));
|
|
12
|
+
}(this, (function (exports,coercion,core,collections,common,rxjs,operators,bidi,platform) { 'use strict';
|
|
13
13
|
|
|
14
14
|
/*! *****************************************************************************
|
|
15
15
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -727,11 +727,14 @@ StickyStyler = /** @class */ (function () {
|
|
|
727
727
|
* sticky positioning applied.
|
|
728
728
|
* @param direction The directionality context of the table (ltr/rtl); affects column positioning
|
|
729
729
|
* by reversing left/right positions.
|
|
730
|
+
* @param _isBrowser Whether the table is currently being rendered on the server or the client.
|
|
730
731
|
*/
|
|
731
|
-
function StickyStyler(isNativeHtmlTable, stickCellCss, direction) {
|
|
732
|
+
function StickyStyler(isNativeHtmlTable, stickCellCss, direction, _isBrowser) {
|
|
733
|
+
if (_isBrowser === void 0) { _isBrowser = true; }
|
|
732
734
|
this.isNativeHtmlTable = isNativeHtmlTable;
|
|
733
735
|
this.stickCellCss = stickCellCss;
|
|
734
736
|
this.direction = direction;
|
|
737
|
+
this._isBrowser = _isBrowser;
|
|
735
738
|
}
|
|
736
739
|
/**
|
|
737
740
|
* Clears the sticky positioning styles from the row and its cells by resetting the `position`
|
|
@@ -799,7 +802,7 @@ StickyStyler = /** @class */ (function () {
|
|
|
799
802
|
*/
|
|
800
803
|
function (rows, stickyStartStates, stickyEndStates) {
|
|
801
804
|
var /** @type {?} */ hasStickyColumns = stickyStartStates.some(function (state) { return state; }) || stickyEndStates.some(function (state) { return state; });
|
|
802
|
-
if (!rows.length || !hasStickyColumns) {
|
|
805
|
+
if (!rows.length || !hasStickyColumns || !this._isBrowser) {
|
|
803
806
|
return;
|
|
804
807
|
}
|
|
805
808
|
var /** @type {?} */ firstRow = rows[0];
|
|
@@ -857,6 +860,10 @@ StickyStyler = /** @class */ (function () {
|
|
|
857
860
|
* @return {?}
|
|
858
861
|
*/
|
|
859
862
|
function (rowsToStick, stickyStates, position) {
|
|
863
|
+
// Since we can't measure the rows on the server, we can't stick the rows properly.
|
|
864
|
+
if (!this._isBrowser) {
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
860
867
|
// If positioning the rows to the bottom, reverse their order when evaluating the sticky
|
|
861
868
|
// position such that the last row stuck will be "bottom: 0px" and so on.
|
|
862
869
|
var /** @type {?} */ rows = position === 'bottom' ? rowsToStick.reverse() : rowsToStick;
|
|
@@ -1214,11 +1221,17 @@ RowViewRef = /** @class */ (function (_super) {
|
|
|
1214
1221
|
* @template T
|
|
1215
1222
|
*/
|
|
1216
1223
|
var CdkTable = /** @class */ (function () {
|
|
1217
|
-
function CdkTable(_differs, _changeDetectorRef, _elementRef, role, _dir
|
|
1224
|
+
function CdkTable(_differs, _changeDetectorRef, _elementRef, role, _dir, /**
|
|
1225
|
+
* @deprecated
|
|
1226
|
+
* @breaking-change 8.0.0 `_document` and `_platform` to
|
|
1227
|
+
* be made into a required parameters.
|
|
1228
|
+
*/
|
|
1229
|
+
_document, _platform) {
|
|
1218
1230
|
this._differs = _differs;
|
|
1219
1231
|
this._changeDetectorRef = _changeDetectorRef;
|
|
1220
1232
|
this._elementRef = _elementRef;
|
|
1221
1233
|
this._dir = _dir;
|
|
1234
|
+
this._platform = _platform;
|
|
1222
1235
|
/**
|
|
1223
1236
|
* Subject that emits when the component has been destroyed.
|
|
1224
1237
|
*/
|
|
@@ -1291,6 +1304,7 @@ var CdkTable = /** @class */ (function () {
|
|
|
1291
1304
|
if (!role) {
|
|
1292
1305
|
this._elementRef.nativeElement.setAttribute('role', 'grid');
|
|
1293
1306
|
}
|
|
1307
|
+
this._document = _document;
|
|
1294
1308
|
this._isNativeHtmlTable = this._elementRef.nativeElement.nodeName === 'TABLE';
|
|
1295
1309
|
}
|
|
1296
1310
|
Object.defineProperty(CdkTable.prototype, "trackBy", {
|
|
@@ -2249,7 +2263,9 @@ var CdkTable = /** @class */ (function () {
|
|
|
2249
2263
|
];
|
|
2250
2264
|
for (var _a = 0, sections_1 = sections; _a < sections_1.length; _a++) {
|
|
2251
2265
|
var section = sections_1[_a];
|
|
2252
|
-
|
|
2266
|
+
// @breaking-change 8.0.0 remove the `|| document` once the `_document` is a required param.
|
|
2267
|
+
var /** @type {?} */ documentRef = this._document || document;
|
|
2268
|
+
var /** @type {?} */ element = documentRef.createElement(section.tag);
|
|
2253
2269
|
element.appendChild(section.outlet.elementRef.nativeElement);
|
|
2254
2270
|
this._elementRef.nativeElement.appendChild(element);
|
|
2255
2271
|
}
|
|
@@ -2316,7 +2332,9 @@ var CdkTable = /** @class */ (function () {
|
|
|
2316
2332
|
function () {
|
|
2317
2333
|
var _this = this;
|
|
2318
2334
|
var /** @type {?} */ direction = this._dir ? this._dir.value : 'ltr';
|
|
2319
|
-
this._stickyStyler = new StickyStyler(this._isNativeHtmlTable,
|
|
2335
|
+
this._stickyStyler = new StickyStyler(this._isNativeHtmlTable,
|
|
2336
|
+
// @breaking-change 8.0.0 remove the null check for `this._platform`.
|
|
2337
|
+
this.stickyCssClass, direction, this._platform ? this._platform.isBrowser : true);
|
|
2320
2338
|
(this._dir ? this._dir.change : rxjs.of())
|
|
2321
2339
|
.pipe(operators.takeUntil(this._onDestroy))
|
|
2322
2340
|
.subscribe(function (value) {
|
|
@@ -2342,6 +2360,8 @@ var CdkTable = /** @class */ (function () {
|
|
|
2342
2360
|
{ type: core.ElementRef, },
|
|
2343
2361
|
{ type: undefined, decorators: [{ type: core.Attribute, args: ['role',] },] },
|
|
2344
2362
|
{ type: bidi.Directionality, decorators: [{ type: core.Optional },] },
|
|
2363
|
+
{ type: undefined, decorators: [{ type: core.Inject, args: [common.DOCUMENT,] },] },
|
|
2364
|
+
{ type: platform.Platform, },
|
|
2345
2365
|
]; };
|
|
2346
2366
|
CdkTable.propDecorators = {
|
|
2347
2367
|
"trackBy": [{ type: core.Input },],
|