-
Notifications
You must be signed in to change notification settings - Fork 6.8k
chore: expand and polish cdk docs #7675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
tools/gulp/tasks/docs.ts
Outdated
}); | ||
|
||
/** Generates html files from the markdown overviews and guides. */ | ||
task('markdown-docs-cdk', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crisbeto or @devversion I know this is wrong but I don't know the right way to fix it
(disambiguating material and cdk output)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I see. Would have been nice to name the other task markdown-docs-material
or something, but this is not really a priority right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure a better way to resolve this right now, left a TODO
src/cdk/bidi/dir.ts
Outdated
@@ -27,7 +28,7 @@ import {Direction, Directionality} from './directionality'; | |||
exportAs: 'dir', | |||
}) | |||
export class Dir implements Directionality { | |||
/** Layout direction of the element. */ | |||
/** @docs-private */ | |||
_dir: Direction = 'ltr'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be needed since its prefixed with an underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/layout/layout.md
Outdated
|
||
#### React to changes to the viewport | ||
The `observe` method is used to get an observable stream that will emit whenever one of the given | ||
media queries would have a different results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure, would have different results
(dropping the a
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (dropped the "s")
@@ -21,7 +21,7 @@ | |||
|
|||
<div class="docs-api"> | |||
<h2> | |||
API reference for Angular Material {$ doc.name $} | |||
API reference for Angular {$ doc.packageDisplayName $} {$ doc.displayName $} | |||
</h2> | |||
|
|||
<p class="docs-api-module-import"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should fix the import statement here as well. We can just use doc.packageName
for the imports package name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,90 @@ | |||
The `a11y` package provides a number of tools to improve accessibility, described below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FocusMonitor
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add that in a follow-up PR
src/cdk/a11y/a11y.md
Outdated
* Create a `@ViewChildren` query for the options being managed. | ||
* Initialize the `ListKeyManager`, passing in the options. | ||
* Forward keyboard events from the managed component to the `ListKeyManager` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .
at end of sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* supported. | ||
*/ | ||
|
||
// The InteractivityChecker leans heavily on the ally.js accessibility utilities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a11y.ts
instead of .js
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With ally.js
is a library meant, not a source file inside of Material. https://allyjs.io/
The built-in breakpoints based on [Google's Material Design | ||
specification](https://material.io/guidelines/layout/responsive-ui.html#responsive-ui-breakpoints). | ||
The available values are: | ||
* Handset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be styled as code? i.e. Handset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine without the code style
src/cdk/layout/layout.md
Outdated
|
||
|
||
### MediaMatcher | ||
`MediaMatcher` is a lower-level utility that wraps the native `matcheMedia`. This service normalizes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchMedia
, extra e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
attach(overlayRef: OverlayRef): void { | ||
this._overlayRef = overlayRef; | ||
this._pane = overlayRef.overlayElement; | ||
this._resizeSubscription.unsubscribe(); | ||
this._resizeSubscription = this._viewportRuler.change().subscribe(() => this.apply()); | ||
} | ||
|
||
/** Performs any cleanup after the element is destroyed. */ | ||
/** Disposes all resources used by the posiiton strategy. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
constructor( | ||
/** The position used as a result of this change. */ | ||
public connectionPair: ConnectionPositionPair, | ||
/** @docs-private */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is @docs-private
should it be _scrollableViewProperties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't rename b/c someone in google is using it
@@ -12,5 +12,5 @@ import {Directive, TemplateRef} from '@angular/core'; | |||
selector: '[cdkStepLabel]', | |||
}) | |||
export class CdkStepLabel { | |||
constructor(public template: TemplateRef<any>) { } | |||
constructor(/** @docs-private */ public template: TemplateRef<any>) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_template
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoiding rename in case someone is using it
} | ||
``` | ||
|
||
#### Wrapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a short paragraph like this for typeahead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add in a follow-up PR.
src/cdk/a11y/a11y.md
Outdated
``` | ||
|
||
#### Types of key managers | ||
There are two varieties of `ListKeyManager`: `FocusKeyManager` and `ActiveDescendantKeyManager`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comma instead of colon after the ListKeyManager
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/a11y/a11y.md
Outdated
There are two varieties of `ListKeyManager`: `FocusKeyManager` and `ActiveDescendantKeyManager`. | ||
|
||
##### FocusKeyManager | ||
Used when options will directly recieve browser focus. Each item managed must implement the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recieve -> receive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/a11y/a11y.md
Outdated
##### ActiveDescendantKeyManager | ||
Used when options will be marked as active via `aria-activedescendant`. | ||
Each item managed must implement the | ||
`FocusableOption` interface: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be Highlightable
. Also might be worth noting that each item requires an id and that id should be bound to the host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/bidi/directionality.ts
Outdated
readonly value: Direction = 'ltr'; | ||
|
||
/** Steam that emits whenever the 'ltr' / 'rtl' state changes. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steam -> Stream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/** | ||
* 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 matches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matches -> matched
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ("match")
src/cdk/stepper/stepper.md
Outdated
@@ -0,0 +1,59 @@ | |||
CDK stepper provides a foundation upon which more concrete stepper varities can be built upon. A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence has one too many "upon"-s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/stepper/stepper.md
Outdated
|
||
### Behavior captured by CdkStepper | ||
The base CDK version of the stepper primarily manages which step is active. This includes handling | ||
keyboard interactions and exposing an API for advancing or rewinding through th workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
th -> the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/cdk/stepper/stepper.md
Outdated
|
||
#### Linear stepper | ||
A stepper marked as `linear` requires the user to complete previous steps before proceeding | ||
to following steps. For each step, the `stepControl` attribute can be set to the top level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the to following steps
is redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
### Types of steps | ||
|
||
#### Optional step | ||
If completion of a step in linear stepper is not required, then the `optional` attribute can be set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...in a linear stepper
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* Add JsDocs where missing * Adds and polishes overviews for main cdk subpackages * Tweaks dgeni to disambiguate between material and cdk output (e.g. with "table"). * Tweaks markdown process to disambiguate between material and cdk output * Fix an issue where method return types were missing from _all_ api docs * Correct some `any` property types in cdk/stepper * Correct table trackBy JsDoc being omitted because it was on the setter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
any
property types in cdk/stepper