Skip to content

Commit 037a6af

Browse files
author
Zhicheng WANG
committed
docs: 基于其它部分的翻译,自动翻译完全相同的句子
1 parent 8d41918 commit 037a6af

File tree

65 files changed

+707
-206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+707
-206
lines changed

src/cdk/a11y/interactivity-checker/interactivity-checker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ export class InteractivityChecker {
138138
/**
139139
* Gets whether an element can be focused by the user.
140140
*
141+
* 获取用户是否可以给某个元素设置焦点。
142+
*
141143
* @param element Element to be checked.
142144
* @param config The config object with options to customize this method's behavior
143145
* @returns Whether the element is focusable.

src/cdk/a11y/key-manager/list-key-manager.ts

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ import {debounceTime, filter, map, tap} from 'rxjs/operators';
2626

2727
/** This interface is for items that can be passed to a ListKeyManager. */
2828
export interface ListKeyManagerOption {
29-
/** Whether the option is disabled. */
29+
/**
30+
* Whether the option is disabled.
31+
*
32+
* 该选项是否被禁用。
33+
*
34+
*/
3035
disabled?: boolean;
3136

3237
/** Gets the label for this option. */
@@ -190,6 +195,9 @@ export class ListKeyManager<T extends ListKeyManagerOption> {
190195

191196
/**
192197
* Sets the active item to the item at the index specified.
198+
*
199+
* 把激活条目设置为由索引指定的条目。
200+
*
193201
* @param index The index of the item to be set as active.
194202
*/
195203
setActiveItem(index: number): void;
@@ -212,6 +220,9 @@ export class ListKeyManager<T extends ListKeyManagerOption> {
212220

213221
/**
214222
* Sets the active item depending on the key event passed in.
223+
*
224+
* 根据传入的键盘事件设置激活条目。
225+
*
215226
* @param event Keyboard event to be used for determining which element should be active.
216227
*/
217228
onKeydown(event: KeyboardEvent): void {
@@ -309,22 +320,42 @@ export class ListKeyManager<T extends ListKeyManagerOption> {
309320
return this._pressedLetters.length > 0;
310321
}
311322

312-
/** Sets the active item to the first enabled item in the list. */
323+
/**
324+
* Sets the active item to the first enabled item in the list.
325+
*
326+
* 将激活条目设置为列表中第一个可用的(enabled)条目。
327+
*
328+
*/
313329
setFirstItemActive(): void {
314330
this._setActiveItemByIndex(0, 1);
315331
}
316332

317-
/** Sets the active item to the last enabled item in the list. */
333+
/**
334+
* Sets the active item to the last enabled item in the list.
335+
*
336+
* 将激活条目设置为列表中最后一个可用的(enabled)条目。
337+
*
338+
*/
318339
setLastItemActive(): void {
319340
this._setActiveItemByIndex(this._items.length - 1, -1);
320341
}
321342

322-
/** Sets the active item to the next enabled item in the list. */
343+
/**
344+
* Sets the active item to the next enabled item in the list.
345+
*
346+
* 将激活条目设置为列表中的下一个可用的(enabled)条目。
347+
*
348+
*/
323349
setNextItemActive(): void {
324350
this._activeItemIndex < 0 ? this.setFirstItemActive() : this._setActiveItemByDelta(1);
325351
}
326352

327-
/** Sets the active item to a previous enabled item in the list. */
353+
/**
354+
* Sets the active item to a previous enabled item in the list.
355+
*
356+
* 将激活条目设置为列表中的上一个可用的(enabled)条目。
357+
*
358+
*/
328359
setPreviousItemActive(): void {
329360
this._activeItemIndex < 0 && this._wrap ? this.setLastItemActive()
330361
: this._setActiveItemByDelta(-1);

src/cdk/drag-drop/directives/drag.ts

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
115115
*/
116116
@Input('cdkDragFreeDragPosition') freeDragPosition: {x: number, y: number};
117117

118-
/** Whether starting to drag this element is disabled. */
118+
/**
119+
* Whether starting to drag this element is disabled.
120+
*
121+
* 是否已禁止拖动此元素。
122+
*
123+
*/
119124
@Input('cdkDragDisabled')
120125
get disabled(): boolean {
121126
return this._disabled || (this.dropContainer && this.dropContainer.disabled);
@@ -134,28 +139,63 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
134139
*/
135140
@Input('cdkDragConstrainPosition') constrainPosition?: (point: Point, dragRef: DragRef) => Point;
136141

137-
/** Class to be added to the preview element. */
142+
/**
143+
* Class to be added to the preview element.
144+
*
145+
* 要添加到预览元素中的类。
146+
*
147+
*/
138148
@Input('cdkDragPreviewClass') previewClass: string | string[];
139149

140-
/** Emits when the user starts dragging the item. */
150+
/**
151+
* Emits when the user starts dragging the item.
152+
*
153+
* 当用户开始拖动该条目时会触发。
154+
*
155+
*/
141156
@Output('cdkDragStarted') started: EventEmitter<CdkDragStart> = new EventEmitter<CdkDragStart>();
142157

143-
/** Emits when the user has released a drag item, before any animations have started. */
158+
/**
159+
* Emits when the user has released a drag item, before any animations have started.
160+
*
161+
* 当用户释放了一个拖动条目时触发。位于任何动画开始之前。
162+
*
163+
*/
144164
@Output('cdkDragReleased') released: EventEmitter<CdkDragRelease> =
145165
new EventEmitter<CdkDragRelease>();
146166

147-
/** Emits when the user stops dragging an item in the container. */
167+
/**
168+
* Emits when the user stops dragging an item in the container.
169+
*
170+
* 当用户停止拖动容器中的某个条目时,会发出本通知。
171+
*
172+
*/
148173
@Output('cdkDragEnded') ended: EventEmitter<CdkDragEnd> = new EventEmitter<CdkDragEnd>();
149174

150-
/** Emits when the user has moved the item into a new container. */
175+
/**
176+
* Emits when the user has moved the item into a new container.
177+
*
178+
* 当用户把本条目移到新容器中时发出通知。
179+
*
180+
*/
151181
@Output('cdkDragEntered') entered: EventEmitter<CdkDragEnter<any>> =
152182
new EventEmitter<CdkDragEnter<any>>();
153183

154-
/** Emits when the user removes the item its container by dragging it into another container. */
184+
/**
185+
* Emits when the user removes the item its container by dragging it into another container.
186+
*
187+
* 当用户通过把拖动条目从所在的容器移到另一个容器中时,就会触发。
188+
*
189+
*/
155190
@Output('cdkDragExited') exited: EventEmitter<CdkDragExit<any>> =
156191
new EventEmitter<CdkDragExit<any>>();
157192

158-
/** Emits when the user drops the item inside a container. */
193+
/**
194+
* Emits when the user drops the item inside a container.
195+
*
196+
* 当用户把条目放到容器中时,就会触发。
197+
*
198+
*/
159199
@Output('cdkDragDropped') dropped: EventEmitter<CdkDragDrop<any>> =
160200
new EventEmitter<CdkDragDrop<any>>();
161201

@@ -232,12 +272,22 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
232272
return this._dragRef.getPlaceholderElement();
233273
}
234274

235-
/** Returns the root draggable element. */
275+
/**
276+
* Returns the root draggable element.
277+
*
278+
* 返回可拖动条目的根元素。
279+
*
280+
*/
236281
getRootElement(): HTMLElement {
237282
return this._dragRef.getRootElement();
238283
}
239284

240-
/** Resets a standalone drag item to its initial position. */
285+
/**
286+
* Resets a standalone drag item to its initial position.
287+
*
288+
* 将一个独立的拖动条目重置到初始位置。
289+
*
290+
*/
241291
reset(): void {
242292
this._dragRef.reset();
243293
}

src/cdk/drag-drop/directives/drop-list.ts

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,20 @@ export class CdkDropList<T = any> implements OnDestroy {
106106
*/
107107
@Input() id: string = `cdk-drop-list-${_uniqueIdCounter++}`;
108108

109-
/** Locks the position of the draggable elements inside the container along the specified axis. */
109+
/**
110+
* Locks the position of the draggable elements inside the container along the specified axis.
111+
*
112+
* 沿着指定的轴锁定容器内可拖动元素的位置。
113+
*
114+
*/
110115
@Input('cdkDropListLockAxis') lockAxis: DragAxis;
111116

112-
/** Whether starting a dragging sequence from this container is disabled. */
117+
/**
118+
* Whether starting a dragging sequence from this container is disabled.
119+
*
120+
* 是否禁用了从此容器启动拖曳序列的方法。
121+
*
122+
*/
113123
@Input('cdkDropListDisabled')
114124
get disabled(): boolean {
115125
return this._disabled || (!!this._group && this._group.disabled);
@@ -134,24 +144,42 @@ export class CdkDropList<T = any> implements OnDestroy {
134144
@Input('cdkDropListEnterPredicate')
135145
enterPredicate: (drag: CdkDrag, drop: CdkDropList) => boolean = () => true
136146

137-
/** Functions that is used to determine whether an item can be sorted into a particular index. */
147+
/**
148+
* Functions that is used to determine whether an item can be sorted into a particular index.
149+
*
150+
* 一个函数,用来判断某个条目是否可以被排序到特定索引。
151+
*
152+
*/
138153
@Input('cdkDropListSortPredicate')
139154
sortPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean = () => true
140155

141156
/** Whether to auto-scroll the view when the user moves their pointer close to the edges. */
142157
@Input('cdkDropListAutoScrollDisabled')
143158
autoScrollDisabled: boolean;
144159

145-
/** Number of pixels to scroll for each frame when auto-scrolling an element. */
160+
/**
161+
* Number of pixels to scroll for each frame when auto-scrolling an element.
162+
*
163+
* 当自动滚动元素时,这是每一帧滚动的像素数。
164+
*
165+
*/
146166
@Input('cdkDropListAutoScrollStep')
147167
autoScrollStep: number;
148168

149-
/** Emits when the user drops an item inside the container. */
169+
/**
170+
* Emits when the user drops an item inside the container.
171+
*
172+
* 当用户把一个条目投放进该容器时就会触发。
173+
*
174+
*/
150175
@Output('cdkDropListDropped')
151176
dropped: EventEmitter<CdkDragDrop<T, any>> = new EventEmitter<CdkDragDrop<T, any>>();
152177

153178
/**
154179
* Emits when the user has moved a new drag item into this container.
180+
*
181+
* 当用户把一个新的拖动条目移到这个容器中时,就会触发。
182+
*
155183
*/
156184
@Output('cdkDropListEntered')
157185
entered: EventEmitter<CdkDragEnter<T>> = new EventEmitter<CdkDragEnter<T>>();
@@ -163,7 +191,12 @@ export class CdkDropList<T = any> implements OnDestroy {
163191
@Output('cdkDropListExited')
164192
exited: EventEmitter<CdkDragExit<T>> = new EventEmitter<CdkDragExit<T>>();
165193

166-
/** Emits as the user is swapping items while actively dragging. */
194+
/**
195+
* Emits as the user is swapping items while actively dragging.
196+
*
197+
* 当用户正在主动拖动以交换条目时,就会触发。
198+
*
199+
*/
167200
@Output('cdkDropListSorted')
168201
sorted: EventEmitter<CdkDragSortEvent<T>> = new EventEmitter<CdkDragSortEvent<T>>();
169202

src/cdk/overlay/position/connected-position.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export class ConnectionPositionPair {
8080
*
8181
* \-------------------------- | | | | | Scrollable | | | | | | | -------------------------- | Scrollable | | |
8282
*
83-
*
8483
* * * *
8584
* @docs-private
8685
*/

src/cdk/overlay/position/flexible-connected-position-strategy.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
6464
/** Whether the overlay can grow via flexible width/height after the initial open. */
6565
private _growAfterOpen = false;
6666

67-
/** Whether the overlay's width and height can be constrained to fit within the viewport. */
67+
/**
68+
* Whether the overlay's width and height can be constrained to fit within the viewport.
69+
*
70+
* 浮层的宽度和高度是否可以约束在当前视口中。
71+
*
72+
*/
6873
private _hasFlexibleDimensions = true;
6974

7075
/** Whether the overlay position is locked. */

src/cdk/overlay/scroll/block-scroll-strategy.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ describe('BlockScrollStrategy', () => {
171171
* Skips the specified test, if it is being executed on iOS. This is necessary, because
172172
* programmatic scrolling inside the Karma iframe doesn't work on iOS, which renders these
173173
* tests unusable. For example, something as basic as the following won't work:
174+
*
174175
* ```
175176
* window.scroll(0, 100);
176177
* expect(viewport.getViewportScrollPosition().top).toBe(100);

src/cdk/schematics/utils/vendored-ast-utils/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,7 @@ function nodesByPosition(first: ts.Node, second: ts.Node): number {
189189
/**
190190
* Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
191191
* or after the last of occurence of `syntaxKind` if the last occurence is a sub child
192-
* of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
193-
*
192+
* of ts.SyntaxKind\[nodes[i].kind] and save the changes in file.
194193
* @param nodes insert after the last occurence of nodes
195194
* @param toInsert string to insert
196195
* @param file file to insert changes into

0 commit comments

Comments
 (0)