@angular/cdk 21.0.0-next.9 → 21.0.0-rc.1
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/_adev_assets/cdk_drag_drop.json +13 -12
- package/_adev_assets/cdk_testing.json +9 -9
- package/_adev_assets/cdk_testing_protractor.json +1 -1
- package/_adev_assets/cdk_testing_selenium_webdriver.json +1 -1
- package/_adev_assets/cdk_testing_testbed.json +1 -1
- package/fesm2022/_a11y-module-chunk.mjs +755 -869
- package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
- package/fesm2022/_activedescendant-key-manager-chunk.mjs +8 -8
- package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_array-chunk.mjs +1 -1
- package/fesm2022/_array-chunk.mjs.map +1 -1
- package/fesm2022/_breakpoints-observer-chunk.mjs +149 -152
- package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
- package/fesm2022/_css-pixel-value-chunk.mjs +4 -5
- package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
- package/fesm2022/_data-source-chunk.mjs +2 -8
- package/fesm2022/_data-source-chunk.mjs.map +1 -1
- package/fesm2022/_directionality-chunk.mjs +54 -54
- package/fesm2022/_directionality-chunk.mjs.map +1 -1
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs +25 -36
- package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -17
- package/fesm2022/_element-chunk.mjs.map +1 -1
- package/fesm2022/_fake-event-detection-chunk.mjs +3 -17
- package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
- package/fesm2022/_focus-key-manager-chunk.mjs +10 -14
- package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_focus-monitor-chunk.mjs +376 -566
- package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
- package/fesm2022/_id-generator-chunk.mjs +37 -27
- package/fesm2022/_id-generator-chunk.mjs.map +1 -1
- package/fesm2022/_keycodes-chunk.mjs +9 -9
- package/fesm2022/_keycodes-chunk.mjs.map +1 -1
- package/fesm2022/_list-key-manager-chunk.mjs +248 -336
- package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_overlay-module-chunk.mjs +2535 -2947
- package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
- package/fesm2022/_passive-listeners-chunk.mjs +10 -22
- package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
- package/fesm2022/_platform-chunk.mjs +42 -65
- package/fesm2022/_platform-chunk.mjs.map +1 -1
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs +78 -134
- package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
- package/fesm2022/_scrolling-chunk.mjs +44 -85
- package/fesm2022/_scrolling-chunk.mjs.map +1 -1
- package/fesm2022/_selection-model-chunk.mjs +138 -209
- package/fesm2022/_selection-model-chunk.mjs.map +1 -1
- package/fesm2022/_shadow-dom-chunk.mjs +21 -35
- package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
- package/fesm2022/_style-loader-chunk.mjs +50 -37
- package/fesm2022/_style-loader-chunk.mjs.map +1 -1
- package/fesm2022/_test-environment-chunk.mjs +2 -14
- package/fesm2022/_test-environment-chunk.mjs.map +1 -1
- package/fesm2022/_tree-key-manager-chunk.mjs +229 -308
- package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
- package/fesm2022/_typeahead-chunk.mjs +52 -74
- package/fesm2022/_typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs +43 -40
- package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
- package/fesm2022/a11y.mjs +351 -449
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +254 -192
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +121 -64
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -2
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +208 -186
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/coercion-private.mjs +4 -8
- package/fesm2022/coercion-private.mjs.map +1 -1
- package/fesm2022/coercion.mjs +11 -29
- package/fesm2022/coercion.mjs.map +1 -1
- package/fesm2022/dialog.mjs +660 -808
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +3347 -4286
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/keycodes.mjs +4 -8
- package/fesm2022/keycodes.mjs.map +1 -1
- package/fesm2022/layout.mjs +44 -26
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +841 -895
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +1942 -1858
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers-private.mjs +88 -106
- package/fesm2022/observers-private.mjs.map +1 -1
- package/fesm2022/observers.mjs +262 -184
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +72 -68
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +43 -54
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +402 -560
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +38 -10
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +1323 -1400
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +758 -590
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +2327 -2319
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/testing-selenium-webdriver.mjs +252 -325
- package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
- package/fesm2022/testing-testbed.mjs +592 -709
- package/fesm2022/testing-testbed.mjs.map +1 -1
- package/fesm2022/testing.mjs +368 -889
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/text-field.mjs +459 -388
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +1483 -1731
- package/fesm2022/tree.mjs.map +1 -1
- package/overlay/_index.scss +30 -0
- package/overlay-prebuilt.css +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/types/_overlay-module-chunk.d.ts +69 -7
- package/types/_portal-directives-chunk.d.ts +2 -18
- package/types/a11y.d.ts +3 -1
- package/types/accordion.d.ts +3 -1
- package/types/dialog.d.ts +1 -1
- package/types/overlay.d.ts +1 -1
- package/types/portal.d.ts +1 -1
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
import { _ViewRepeaterOperation } from './_recycle-view-repeater-strategy-chunk.mjs';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* A repeater that destroys views when they are removed from a
|
|
5
|
-
* `ViewContainerRef`. When new items are inserted into the container,
|
|
6
|
-
* the repeater will always construct a new embedded view for each item.
|
|
7
|
-
*
|
|
8
|
-
* @template T The type for the embedded view's $implicit property.
|
|
9
|
-
* @template R The type for the item in each IterableDiffer change record.
|
|
10
|
-
* @template C The type for the context passed to each embedded view.
|
|
11
|
-
*/
|
|
12
3
|
class _DisposeViewRepeaterStrategy {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
operation,
|
|
35
|
-
record,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
4
|
+
applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) {
|
|
5
|
+
changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => {
|
|
6
|
+
let view;
|
|
7
|
+
let operation;
|
|
8
|
+
if (record.previousIndex == null) {
|
|
9
|
+
const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex);
|
|
10
|
+
view = viewContainerRef.createEmbeddedView(insertContext.templateRef, insertContext.context, insertContext.index);
|
|
11
|
+
operation = _ViewRepeaterOperation.INSERTED;
|
|
12
|
+
} else if (currentIndex == null) {
|
|
13
|
+
viewContainerRef.remove(adjustedPreviousIndex);
|
|
14
|
+
operation = _ViewRepeaterOperation.REMOVED;
|
|
15
|
+
} else {
|
|
16
|
+
view = viewContainerRef.get(adjustedPreviousIndex);
|
|
17
|
+
viewContainerRef.move(view, currentIndex);
|
|
18
|
+
operation = _ViewRepeaterOperation.MOVED;
|
|
19
|
+
}
|
|
20
|
+
if (itemViewChanged) {
|
|
21
|
+
itemViewChanged({
|
|
22
|
+
context: view?.context,
|
|
23
|
+
operation,
|
|
24
|
+
record
|
|
38
25
|
});
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
detach() {}
|
|
41
30
|
}
|
|
42
31
|
|
|
43
32
|
export { _DisposeViewRepeaterStrategy };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dispose-view-repeater-strategy-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_dispose-view-repeater-strategy-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/collections/dispose-view-repeater-strategy.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.dev/license\n */\n\nimport {\n EmbeddedViewRef,\n IterableChangeRecord,\n IterableChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n _ViewRepeater,\n _ViewRepeaterItemChanged,\n _ViewRepeaterItemContext,\n _ViewRepeaterItemContextFactory,\n _ViewRepeaterItemValueResolver,\n _ViewRepeaterOperation,\n} from './view-repeater';\n\n/**\n * A repeater that destroys views when they are removed from a\n * `ViewContainerRef`. When new items are inserted into the container,\n * the repeater will always construct a new embedded view for each item.\n *\n * @template T The type for the embedded view's $implicit property.\n * @template R The type for the item in each IterableDiffer change record.\n * @template C The type for the context passed to each embedded view.\n */\nexport class _DisposeViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>>\n implements _ViewRepeater<T, R, C>\n{\n applyChanges(\n changes: IterableChanges<R>,\n viewContainerRef: ViewContainerRef,\n itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>,\n itemValueResolver: _ViewRepeaterItemValueResolver<T, R>,\n itemViewChanged?: _ViewRepeaterItemChanged<R, C>,\n ) {\n changes.forEachOperation(\n (\n record: IterableChangeRecord<R>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null,\n ) => {\n let view: EmbeddedViewRef<C> | undefined;\n let operation: _ViewRepeaterOperation;\n if (record.previousIndex == null) {\n const insertContext = itemContextFactory(record, adjustedPreviousIndex, currentIndex);\n view = viewContainerRef.createEmbeddedView(\n insertContext.templateRef,\n insertContext.context,\n insertContext.index,\n );\n operation = _ViewRepeaterOperation.INSERTED;\n } else if (currentIndex == null) {\n viewContainerRef.remove(adjustedPreviousIndex!);\n operation = _ViewRepeaterOperation.REMOVED;\n } else {\n view = viewContainerRef.get(adjustedPreviousIndex!) as EmbeddedViewRef<C>;\n viewContainerRef.move(view!, currentIndex);\n operation = _ViewRepeaterOperation.MOVED;\n }\n\n if (itemViewChanged) {\n itemViewChanged({\n context: view?.context,\n operation,\n record,\n });\n }\n },\n );\n }\n\n detach() {}\n}\n"],"names":["_DisposeViewRepeaterStrategy","applyChanges","changes","viewContainerRef","itemContextFactory","itemValueResolver","itemViewChanged","forEachOperation","record","adjustedPreviousIndex","currentIndex","view","operation","previousIndex","insertContext","createEmbeddedView","templateRef","context","index","_ViewRepeaterOperation","INSERTED","remove","REMOVED","get","move","MOVED","detach"],"mappings":";;MAgCaA,4BAA4B,CAAA;EAGvCC,YAAYA,CACVC,OAA2B,EAC3BC,gBAAkC,EAClCC,kBAA4D,EAC5DC,iBAAuD,EACvDC,eAAgD,EAAA;IAEhDJ,OAAO,CAACK,gBAAgB,CACtB,CACEC,MAA+B,EAC/BC,qBAAoC,EACpCC,YAA2B,KACzB;AACF,MAAA,IAAIC,IAAoC;AACxC,MAAA,IAAIC,SAAiC;AACrC,MAAA,IAAIJ,MAAM,CAACK,aAAa,IAAI,IAAI,EAAE;QAChC,MAAMC,aAAa,GAAGV,kBAAkB,CAACI,MAAM,EAAEC,qBAAqB,EAAEC,YAAY,CAAC;AACrFC,QAAAA,IAAI,GAAGR,gBAAgB,CAACY,kBAAkB,CACxCD,aAAa,CAACE,WAAW,EACzBF,aAAa,CAACG,OAAO,EACrBH,aAAa,CAACI,KAAK,CACpB;QACDN,SAAS,GAAGO,sBAAsB,CAACC,QAAQ;AAC7C,OAAA,MAAO,IAAIV,YAAY,IAAI,IAAI,EAAE;AAC/BP,QAAAA,gBAAgB,CAACkB,MAAM,CAACZ,qBAAsB,CAAC;QAC/CG,SAAS,GAAGO,sBAAsB,CAACG,OAAO;AAC5C,OAAA,MAAO;AACLX,QAAAA,IAAI,GAAGR,gBAAgB,CAACoB,GAAG,CAACd,qBAAsB,CAAuB;AACzEN,QAAAA,gBAAgB,CAACqB,IAAI,CAACb,IAAK,EAAED,YAAY,CAAC;QAC1CE,SAAS,GAAGO,sBAAsB,CAACM,KAAK;AAC1C;AAEA,MAAA,IAAInB,eAAe,EAAE;AACnBA,QAAAA,eAAe,CAAC;UACdW,OAAO,EAAEN,IAAI,EAAEM,OAAO;UACtBL,SAAS;AACTJ,UAAAA;AACD,SAAA,CAAC;AACJ;AACF,KAAC,CACF;AACH;EAEAkB,MAAMA;AACP;;;;"}
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
|
|
3
3
|
function coerceNumberProperty(value, fallbackValue = 0) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
if (_isNumberValue(value)) {
|
|
5
|
+
return Number(value);
|
|
6
|
+
}
|
|
7
|
+
return arguments.length === 2 ? fallbackValue : 0;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Whether the provided value is considered a number.
|
|
11
|
-
* @docs-private
|
|
12
|
-
*/
|
|
13
9
|
function _isNumberValue(value) {
|
|
14
|
-
|
|
15
|
-
// and other non-number values as NaN, where Number just uses 0) but it considers the string
|
|
16
|
-
// '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.
|
|
17
|
-
return !isNaN(parseFloat(value)) && !isNaN(Number(value));
|
|
10
|
+
return !isNaN(parseFloat(value)) && !isNaN(Number(value));
|
|
18
11
|
}
|
|
19
12
|
|
|
20
|
-
/**
|
|
21
|
-
* Coerces an ElementRef or an Element into an element.
|
|
22
|
-
* Useful for APIs that can accept either a ref or the native element itself.
|
|
23
|
-
*/
|
|
24
13
|
function coerceElement(elementOrRef) {
|
|
25
|
-
|
|
14
|
+
return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;
|
|
26
15
|
}
|
|
27
16
|
|
|
28
17
|
export { _isNumberValue, coerceElement, coerceNumberProperty };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_element-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_element-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/coercion/number-property.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/coercion/element.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.dev/license\n */\n\n/**\n * Type describing the allowed values for a number input\n * @docs-private\n */\nexport type NumberInput = string | number | null | undefined;\n\n/** Coerces a data-bound value (typically a string) to a number. */\nexport function coerceNumberProperty(value: any): number;\nexport function coerceNumberProperty<D>(value: any, fallback: D): number | D;\nexport function coerceNumberProperty(value: any, fallbackValue = 0) {\n if (_isNumberValue(value)) {\n return Number(value);\n }\n return arguments.length === 2 ? fallbackValue : 0;\n}\n\n/**\n * Whether the provided value is considered a number.\n * @docs-private\n */\nexport function _isNumberValue(value: any): boolean {\n // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,\n // and other non-number values as NaN, where Number just uses 0) but it considers the string\n // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.\n return !isNaN(parseFloat(value as any)) && !isNaN(Number(value));\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.dev/license\n */\n\nimport {ElementRef} from '@angular/core';\n\n/**\n * Coerces an ElementRef or an Element into an element.\n * Useful for APIs that can accept either a ref or the native element itself.\n */\nexport function coerceElement<T>(elementOrRef: ElementRef<T> | T): T {\n return elementOrRef instanceof ElementRef ? elementOrRef.nativeElement : elementOrRef;\n}\n"],"names":["coerceNumberProperty","value","fallbackValue","_isNumberValue","Number","arguments","length","isNaN","parseFloat","coerceElement","elementOrRef","ElementRef","nativeElement"],"mappings":";;SAiBgBA,oBAAoBA,CAACC,KAAU,EAAEC,aAAa,GAAG,CAAC,EAAA;AAChE,EAAA,IAAIC,cAAc,CAACF,KAAK,CAAC,EAAE;IACzB,OAAOG,MAAM,CAACH,KAAK,CAAC;AACtB;EACA,OAAOI,SAAS,CAACC,MAAM,KAAK,CAAC,GAAGJ,aAAa,GAAG,CAAC;AACnD;AAMM,SAAUC,cAAcA,CAACF,KAAU,EAAA;AAIvC,EAAA,OAAO,CAACM,KAAK,CAACC,UAAU,CAACP,KAAY,CAAC,CAAC,IAAI,CAACM,KAAK,CAACH,MAAM,CAACH,KAAK,CAAC,CAAC;AAClE;;ACnBM,SAAUQ,aAAaA,CAAIC,YAA+B,EAAA;EAC9D,OAAOA,YAAY,YAAYC,UAAU,GAAGD,YAAY,CAACE,aAAa,GAAGF,YAAY;AACvF;;;;"}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
/** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */
|
|
2
1
|
function isFakeMousedownFromScreenReader(event) {
|
|
3
|
-
|
|
4
|
-
// a clickable element. We can distinguish these events when `event.buttons` is zero, or
|
|
5
|
-
// `event.detail` is zero depending on the browser:
|
|
6
|
-
// - `event.buttons` works on Firefox, but fails on Chrome.
|
|
7
|
-
// - `detail` works on Chrome, but fails on Firefox.
|
|
8
|
-
return event.buttons === 0 || event.detail === 0;
|
|
2
|
+
return event.buttons === 0 || event.detail === 0;
|
|
9
3
|
}
|
|
10
|
-
/** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
|
|
11
4
|
function isFakeTouchstartFromScreenReader(event) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// which is typically >= 0 on a real device versus -1 from a screen reader. Just to be safe,
|
|
15
|
-
// we can also look at `radiusX` and `radiusY`. This behavior was observed against a Windows 10
|
|
16
|
-
// device with a touch screen running NVDA v2020.4 and Firefox 85 or Chrome 88.
|
|
17
|
-
return (!!touch &&
|
|
18
|
-
touch.identifier === -1 &&
|
|
19
|
-
(touch.radiusX == null || touch.radiusX === 1) &&
|
|
20
|
-
(touch.radiusY == null || touch.radiusY === 1));
|
|
5
|
+
const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0];
|
|
6
|
+
return !!touch && touch.identifier === -1 && (touch.radiusX == null || touch.radiusX === 1) && (touch.radiusY == null || touch.radiusY === 1);
|
|
21
7
|
}
|
|
22
8
|
|
|
23
9
|
export { isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_fake-event-detection-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_fake-event-detection-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/fake-event-detection.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.dev/license\n */\n\n/** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */\nexport function isFakeMousedownFromScreenReader(event: MouseEvent): boolean {\n // Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on\n // a clickable element. We can distinguish these events when `event.buttons` is zero, or\n // `event.detail` is zero depending on the browser:\n // - `event.buttons` works on Firefox, but fails on Chrome.\n // - `detail` works on Chrome, but fails on Firefox.\n return event.buttons === 0 || event.detail === 0;\n}\n\n/** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */\nexport function isFakeTouchstartFromScreenReader(event: TouchEvent): boolean {\n const touch: Touch | undefined =\n (event.touches && event.touches[0]) || (event.changedTouches && event.changedTouches[0]);\n\n // A fake `touchstart` can be distinguished from a real one by looking at the `identifier`\n // which is typically >= 0 on a real device versus -1 from a screen reader. Just to be safe,\n // we can also look at `radiusX` and `radiusY`. This behavior was observed against a Windows 10\n // device with a touch screen running NVDA v2020.4 and Firefox 85 or Chrome 88.\n return (\n !!touch &&\n touch.identifier === -1 &&\n (touch.radiusX == null || touch.radiusX === 1) &&\n (touch.radiusY == null || touch.radiusY === 1)\n );\n}\n"],"names":["isFakeMousedownFromScreenReader","event","buttons","detail","isFakeTouchstartFromScreenReader","touch","touches","changedTouches","identifier","radiusX","radiusY"],"mappings":"AASM,SAAUA,+BAA+BA,CAACC,KAAiB,EAAA;EAM/D,OAAOA,KAAK,CAACC,OAAO,KAAK,CAAC,IAAID,KAAK,CAACE,MAAM,KAAK,CAAC;AAClD;AAGM,SAAUC,gCAAgCA,CAACH,KAAiB,EAAA;EAChE,MAAMI,KAAK,GACRJ,KAAK,CAACK,OAAO,IAAIL,KAAK,CAACK,OAAO,CAAC,CAAC,CAAC,IAAML,KAAK,CAACM,cAAc,IAAIN,KAAK,CAACM,cAAc,CAAC,CAAC,CAAE;AAM1F,EAAA,OACE,CAAC,CAACF,KAAK,IACPA,KAAK,CAACG,UAAU,KAAK,CAAC,CAAC,KACtBH,KAAK,CAACI,OAAO,IAAI,IAAI,IAAIJ,KAAK,CAACI,OAAO,KAAK,CAAC,CAAC,KAC7CJ,KAAK,CAACK,OAAO,IAAI,IAAI,IAAIL,KAAK,CAACK,OAAO,KAAK,CAAC,CAAC;AAElD;;;;"}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { ListKeyManager } from './_list-key-manager-chunk.mjs';
|
|
2
2
|
|
|
3
3
|
class FocusKeyManager extends ListKeyManager {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
setActiveItem(item) {
|
|
14
|
-
super.setActiveItem(item);
|
|
15
|
-
if (this.activeItem) {
|
|
16
|
-
this.activeItem.focus(this._origin);
|
|
17
|
-
}
|
|
4
|
+
_origin = 'program';
|
|
5
|
+
setFocusOrigin(origin) {
|
|
6
|
+
this._origin = origin;
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
setActiveItem(item) {
|
|
10
|
+
super.setActiveItem(item);
|
|
11
|
+
if (this.activeItem) {
|
|
12
|
+
this.activeItem.focus(this._origin);
|
|
18
13
|
}
|
|
14
|
+
}
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
export { FocusKeyManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_focus-key-manager-chunk.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"_focus-key-manager-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/a11y/key-manager/focus-key-manager.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.dev/license\n */\n\nimport {ListKeyManager, ListKeyManagerOption} from './list-key-manager';\nimport {FocusOrigin} from '../focus-monitor/focus-monitor';\n\n/**\n * This is the interface for focusable items (used by the FocusKeyManager).\n * Each item must know how to focus itself, whether or not it is currently disabled\n * and be able to supply its label.\n */\nexport interface FocusableOption extends ListKeyManagerOption {\n /** Focuses the `FocusableOption`. */\n focus(origin?: FocusOrigin): void;\n}\n\nexport class FocusKeyManager<T> extends ListKeyManager<FocusableOption & T> {\n private _origin: FocusOrigin = 'program';\n\n /**\n * Sets the focus origin that will be passed in to the items for any subsequent `focus` calls.\n * @param origin Focus origin to be used when focusing items.\n */\n setFocusOrigin(origin: FocusOrigin): this {\n this._origin = origin;\n return this;\n }\n\n /**\n * Sets the active item to the item at the specified\n * index and focuses the newly active item.\n * @param index Index of the item to be set as active.\n */\n override setActiveItem(index: number): void;\n\n /**\n * Sets the active item to the item that is specified and focuses it.\n * @param item Item to be set as active.\n */\n override setActiveItem(item: T): void;\n\n /**\n * Sets the active item to the item that is specified and focuses it.\n * @param item Item to be set as active.\n */\n override setActiveItem(item: T | number): void;\n\n override setActiveItem(item: any): void {\n super.setActiveItem(item);\n\n if (this.activeItem) {\n this.activeItem.focus(this._origin);\n }\n }\n}\n"],"names":["FocusKeyManager","ListKeyManager","_origin","setFocusOrigin","origin","setActiveItem","item","activeItem","focus"],"mappings":";;AAqBM,MAAOA,eAAmB,SAAQC,cAAmC,CAAA;AACjEC,EAAAA,OAAO,GAAgB,SAAS;EAMxCC,cAAcA,CAACC,MAAmB,EAAA;IAChC,IAAI,CAACF,OAAO,GAAGE,MAAM;AACrB,IAAA,OAAO,IAAI;AACb;EAqBSC,aAAaA,CAACC,IAAS,EAAA;AAC9B,IAAA,KAAK,CAACD,aAAa,CAACC,IAAI,CAAC;IAEzB,IAAI,IAAI,CAACC,UAAU,EAAE;MACnB,IAAI,CAACA,UAAU,CAACC,KAAK,CAAC,IAAI,CAACN,OAAO,CAAC;AACrC;AACF;AACD;;;;"}
|