@material/tab
Advanced tools
Comparing version 15.0.0-canary.f807e793f.0 to 15.0.0-canary.f80ac92b0.0
@@ -54,3 +54,4 @@ /** | ||
* Activates the indicator element. | ||
* @param previousIndicatorClientRect The client rect of the previously activated indicator | ||
* @param previousIndicatorClientRect The client rect of the previously | ||
* activated indicator | ||
*/ | ||
@@ -84,2 +85,6 @@ activateIndicator(previousIndicatorClientRect?: DOMRect): void; | ||
focus(): void; | ||
/** | ||
* Returns whether the root element is focused. | ||
*/ | ||
isFocused(): boolean; | ||
} |
@@ -6,4 +6,10 @@ # Change Log | ||
# [15.0.0-canary.f807e793f.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.f807e793f.0) (2022-05-20) | ||
# [15.0.0-canary.f80ac92b0.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.f80ac92b0.0) (2024-05-02) | ||
**Note:** Version bump only for package @material/tab | ||
### Bug Fixes | ||
* **tabs:** adjust rippple area according to container shape ([8c0786d](https://github.com/material-components/material-components-web/commit/8c0786d6f0dca33f9666912598386a04ca153d97)) | ||
* **tabs:** Attribute hidden now correctly hides tabs. ([110fafa](https://github.com/material-components/material-components-web/commit/110fafa17ac0756adf377e50b51d8551aab8eb54)) | ||
* **tabs:** rolling back style changes due to screenshot breakages. ([5e5c2af](https://github.com/material-components/material-components-web/commit/5e5c2afc06d26a4d091570baf223d8abd79a2f06)) | ||
* **tabs:** rolling back style changes due to screenshot breakages. ([2155064](https://github.com/material-components/material-components-web/commit/215506426df0e309e27ce46898c9e5ea6c51da90)) |
@@ -29,5 +29,7 @@ /** | ||
import { MDCTabDimensions } from './types'; | ||
export declare type MDCTabFactory = (el: Element, foundation?: MDCTabFoundation) => MDCTab; | ||
/** MDC Tab Factory */ | ||
export declare type MDCTabFactory = (el: HTMLElement, foundation?: MDCTabFoundation) => MDCTab; | ||
/** MDC Tab */ | ||
export declare class MDCTab extends MDCComponent<MDCTabFoundation> implements MDCRippleCapableSurface { | ||
static attachTo(root: Element): MDCTab; | ||
static attachTo(root: HTMLElement): MDCTab; | ||
id: string; | ||
@@ -34,0 +36,0 @@ private ripple; |
@@ -29,2 +29,3 @@ /** | ||
import { MDCTabFoundation } from './foundation'; | ||
/** MDC Tab */ | ||
var MDCTab = /** @class */ (function (_super) { | ||
@@ -62,9 +63,16 @@ __extends(MDCTab, _super); | ||
var _this = this; | ||
// DO NOT INLINE this variable. For backward compatibility, foundations take a Partial<MDCFooAdapter>. | ||
// To ensure we don't accidentally omit any methods, we need a separate, strongly typed adapter variable. | ||
// DO NOT INLINE this variable. For backward compatibility, foundations take | ||
// a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any | ||
// methods, we need a separate, strongly typed adapter variable. | ||
// tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. | ||
var adapter = { | ||
setAttr: function (attr, value) { return _this.root.setAttribute(attr, value); }, | ||
addClass: function (className) { return _this.root.classList.add(className); }, | ||
removeClass: function (className) { return _this.root.classList.remove(className); }, | ||
setAttr: function (attr, value) { | ||
_this.safeSetAttribute(_this.root, attr, value); | ||
}, | ||
addClass: function (className) { | ||
_this.root.classList.add(className); | ||
}, | ||
removeClass: function (className) { | ||
_this.root.classList.remove(className); | ||
}, | ||
hasClass: function (className) { return _this.root.classList.contains(className); }, | ||
@@ -77,3 +85,5 @@ activateIndicator: function (previousIndicatorClientRect) { | ||
}, | ||
notifyInteracted: function () { return _this.emit(MDCTabFoundation.strings.INTERACTED_EVENT, { tabId: _this.id }, true /* bubble */); }, | ||
notifyInteracted: function () { | ||
_this.emit(MDCTabFoundation.strings.INTERACTED_EVENT, { tabId: _this.id }, true /* bubble */); | ||
}, | ||
getOffsetLeft: function () { return _this.root.offsetLeft; }, | ||
@@ -83,3 +93,6 @@ getOffsetWidth: function () { return _this.root.offsetWidth; }, | ||
getContentOffsetWidth: function () { return _this.content.offsetWidth; }, | ||
focus: function () { return _this.root.focus(); }, | ||
focus: function () { | ||
_this.root.focus(); | ||
}, | ||
isFocused: function () { return _this.root === document.activeElement; }, | ||
}; | ||
@@ -86,0 +99,0 @@ // tslint:enable:object-literal-sort-keys |
@@ -26,2 +26,3 @@ /** | ||
import { MDCTabDimensions } from './types'; | ||
/** MDC Tab Foundation */ | ||
export declare class MDCTabFoundation extends MDCFoundation<MDCTabAdapter> { | ||
@@ -28,0 +29,0 @@ static get cssClasses(): { |
@@ -26,2 +26,3 @@ /** | ||
import { cssClasses, strings } from './constants'; | ||
/** MDC Tab Foundation */ | ||
var MDCTabFoundation = /** @class */ (function (_super) { | ||
@@ -64,2 +65,3 @@ __extends(MDCTabFoundation, _super); | ||
focus: function () { return undefined; }, | ||
isFocused: function () { return false; }, | ||
}; | ||
@@ -93,3 +95,3 @@ // tslint:enable:object-literal-sort-keys | ||
this.adapter.activateIndicator(previousIndicatorClientRect); | ||
if (this.focusOnActivate) { | ||
if (this.focusOnActivate && !this.adapter.isFocused()) { | ||
this.adapter.focus(); | ||
@@ -96,0 +98,0 @@ } |
{ | ||
"name": "@material/tab", | ||
"description": "The Material Components for the web tab component", | ||
"version": "15.0.0-canary.f807e793f.0", | ||
"version": "15.0.0-canary.f80ac92b0.0", | ||
"license": "MIT", | ||
@@ -20,11 +20,12 @@ "keywords": [ | ||
"dependencies": { | ||
"@material/base": "15.0.0-canary.f807e793f.0", | ||
"@material/elevation": "15.0.0-canary.f807e793f.0", | ||
"@material/feature-targeting": "15.0.0-canary.f807e793f.0", | ||
"@material/focus-ring": "15.0.0-canary.f807e793f.0", | ||
"@material/ripple": "15.0.0-canary.f807e793f.0", | ||
"@material/rtl": "15.0.0-canary.f807e793f.0", | ||
"@material/tab-indicator": "15.0.0-canary.f807e793f.0", | ||
"@material/theme": "15.0.0-canary.f807e793f.0", | ||
"@material/typography": "15.0.0-canary.f807e793f.0", | ||
"@material/base": "15.0.0-canary.f80ac92b0.0", | ||
"@material/elevation": "15.0.0-canary.f80ac92b0.0", | ||
"@material/feature-targeting": "15.0.0-canary.f80ac92b0.0", | ||
"@material/focus-ring": "15.0.0-canary.f80ac92b0.0", | ||
"@material/ripple": "15.0.0-canary.f80ac92b0.0", | ||
"@material/rtl": "15.0.0-canary.f80ac92b0.0", | ||
"@material/tab-indicator": "15.0.0-canary.f80ac92b0.0", | ||
"@material/theme": "15.0.0-canary.f80ac92b0.0", | ||
"@material/tokens": "15.0.0-canary.f80ac92b0.0", | ||
"@material/typography": "15.0.0-canary.f80ac92b0.0", | ||
"tslib": "^2.1.0" | ||
@@ -35,3 +36,3 @@ }, | ||
}, | ||
"gitHead": "b4ac5ff59e90b4770de9f689d9b09381fe2cacd1" | ||
"gitHead": "514a3afe9efc5bcebf1ace1e335357184ee1a9e0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
917849
6935
11
+ Added@material/animation@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/base@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/dom@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/elevation@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/feature-targeting@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/focus-ring@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/ripple@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/rtl@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/shape@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/tab-indicator@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/theme@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/tokens@15.0.0-canary.f80ac92b0.0(transitive)
+ Added@material/typography@15.0.0-canary.f80ac92b0.0(transitive)
- Removed@material/animation@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/base@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/dom@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/elevation@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/feature-targeting@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/focus-ring@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/ripple@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/rtl@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/tab-indicator@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/theme@15.0.0-canary.f807e793f.0(transitive)
- Removed@material/typography@15.0.0-canary.f807e793f.0(transitive)
Updated@material/feature-targeting@15.0.0-canary.f80ac92b0.0