Socket
Socket
Sign inDemoInstall

@material/tooltip

Package Overview
Dependencies
17
Maintainers
14
Versions
1183
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 15.0.0-canary.eb103d4b5.0 to 15.0.0-canary.ebb636f3d.0

25

adapter.d.ts

@@ -110,7 +110,7 @@ /**

*/
anchorContainsElement(element: HTMLElement): boolean;
anchorContainsElement(element: Element): boolean;
/**
* Checks if element is contained within the tooltip element.
*/
tooltipContainsElement(element: HTMLElement): boolean;
tooltipContainsElement(element: Element): boolean;
/**

@@ -123,31 +123,31 @@ * Sets focus on the anchor element.

*/
registerEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Deregisters an event listener to the root element.
*/
deregisterEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Registers an event listener to the anchor element.
*/
registerAnchorEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerAnchorEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Deregisters an event listener to the anchor element.
*/
deregisterAnchorEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterAnchorEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Registers an event listener to the document body.
*/
registerDocumentEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerDocumentEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Deregisters an event listener to the document body.
*/
deregisterDocumentEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterDocumentEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Registers an event listener to the window.
*/
registerWindowEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerWindowEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**
* Deregisters an event listener to the window.
*/
deregisterWindowEventHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterWindowEventHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
/**

@@ -179,2 +179,7 @@ * Notification that the tooltip element has been fully hidden. Typically used

getActiveElement(): Element | null;
/**
* @return whether the provided object is an Element or not. This is
* required because Elements from iframes are typed differently.
*/
isInstanceOfElement(eventTarget: EventTarget | null): boolean;
}

15

CHANGELOG.md

@@ -6,3 +6,3 @@ # Change Log

# [15.0.0-canary.eb103d4b5.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.eb103d4b5.0) (2022-10-31)
# [15.0.0-canary.ebb636f3d.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.ebb636f3d.0) (2023-09-29)

@@ -12,5 +12,10 @@

* Makes material component to depend on https://github.com/google/safevalues and be Trusted Type compatible. ([a44241e](https://github.com/material-components/material-components-web/commit/a44241e5428e7f83733b2bd8ab7acc851fc2fb85))
* **tooltip:** Fix incorrect measurements of rich tooltip widths on subsequent renders. ([7ab3cd3](https://github.com/material-components/material-components-web/commit/7ab3cd3c82b92e741be2e67ead5c44a0ceabe794))
* **tooltip:** Fixes rich tooltip's theme-styles mixin. ([d584104](https://github.com/material-components/material-components-web/commit/d584104537cafcb624ea14f6b8b9ff6ea937d49a))
* **tooltip:** Fixes rich tooltip's theme-styles mixin. ([697fbde](https://github.com/material-components/material-components-web/commit/697fbdebd4bfaa85e0901855d11c8e7febc9c991))
* **tooltip:** Fixing tooltip's z-index mixin. ([a40e3c7](https://github.com/material-components/material-components-web/commit/a40e3c7684ea43f4a75f6afc75a0b8a34f49b674))
* **tooltip:** Stop keydown event propogation when ESC key is pressed. ([8d2d8d3](https://github.com/material-components/material-components-web/commit/8d2d8d3c4dbe6c2a17a5de099d59f7503101999f))
* **tooltip:** Stop re-calculating the tooltip position if the anchor is scrolled out of view. ([684e33d](https://github.com/material-components/material-components-web/commit/684e33d250337e53e46fec26c97b382ba85f60d0))
* **tooltip:** Uses single quotes when retrieving key value from sass map. ([953e689](https://github.com/material-components/material-components-web/commit/953e689f3bad9b0a2b3c384470fc82a2d4b8df92))
* Makes material component to depend on https://github.com/google/safevalues and be Trusted Type compatible. ([a44241e](https://github.com/material-components/material-components-web/commit/a44241e5428e7f83733b2bd8ab7acc851fc2fb85))

@@ -21,2 +26,8 @@

* **tooltip:** Adding side positioning options for plain tooltips. ([ba9c296](https://github.com/material-components/material-components-web/commit/ba9c29637109e300121c79a902df12310d9cf9fe))
* **tooltip:** Adjust rich tooltip's theme and theme-styles mixins. ([7c73f61](https://github.com/material-components/material-components-web/commit/7c73f6134470aaf1ef7f7ab931ba0c658116cf18))
* **tooltip:** Calls resolvers in theme-mixins to resolve typography tokens. ([66c5cbb](https://github.com/material-components/material-components-web/commit/66c5cbb9446da83a6c48570e12b1ab71cae3c77f))
* **tooltip:** Emit event for tooltip shown. ([31e517c](https://github.com/material-components/material-components-web/commit/31e517cea3002785ad2936ebc6ef12317b9d4133))
* **tooltip:** No longer re-calculate persistent rich tooltip's position on scroll. ([5cb8e21](https://github.com/material-components/material-components-web/commit/5cb8e2174bb381556fc684283748659b322dc158))
* **tooltip:** Updates to accessibility guidance states that we want all rich tooltips to be reachable via screenreader linear navigation. The idea is that the user should always be able to hear the message of a rich tooltip line-by-line regardless of if the tooltip is interactive, non-interactive, persistent, or non-persistent. ([5490e32](https://github.com/material-components/material-components-web/commit/5490e32e718b4357ee6b58c329fdae28f89ea171))
* **tooltip:** Updating `handleDocumentClick` method to utilize a new `isInstanceOfElement` adapter method. ([9af09b9](https://github.com/material-components/material-components-web/commit/9af09b967a7c01c6c45d2afb5cbb00f0e43904ce))
* **tooltip:** When calculating rich tooltip width, we now take the viewport width into account. ([817002c](https://github.com/material-components/material-components-web/commit/817002c296d5a9220c2b940e3383fdd42ca2aa87))

@@ -27,4 +27,5 @@ /**

import { MDCTooltipFoundation } from './foundation';
/** MDC Tooltip */
export declare class MDCTooltip extends MDCComponent<MDCTooltipFoundation> {
static attachTo(root: Element): MDCTooltip;
static attachTo(root: HTMLElement): MDCTooltip;
private anchorElem;

@@ -31,0 +32,0 @@ private isTooltipRich;

@@ -30,2 +30,3 @@ /**

var ARIA_ATTR_PREFIX = [safeAttrPrefix(templateObject_1 || (templateObject_1 = __makeTemplateObject(["aria-"], ["aria-"])))];
/** MDC Tooltip */
var MDCTooltip = /** @class */ (function (_super) {

@@ -58,4 +59,4 @@ __extends(MDCTooltip, _super);

};
this.handleFocus = function (evt) {
_this.foundation.handleAnchorFocus(evt);
this.handleFocus = function (event) {
_this.foundation.handleAnchorFocus(event);
};

@@ -171,6 +172,3 @@ this.handleMouseLeave = function () {

getTooltipSize: function () {
return {
width: _this.root.offsetWidth,
height: _this.root.offsetHeight
};
return { width: _this.root.offsetWidth, height: _this.root.offsetHeight };
},

@@ -204,31 +202,31 @@ getAnchorBoundingRect: function () {

},
registerEventHandler: function (evt, handler) {
registerEventHandler: function (event, handler) {
if (_this.root instanceof HTMLElement) {
_this.root.addEventListener(evt, handler);
_this.root.addEventListener(event, handler);
}
},
deregisterEventHandler: function (evt, handler) {
deregisterEventHandler: function (event, handler) {
if (_this.root instanceof HTMLElement) {
_this.root.removeEventListener(evt, handler);
_this.root.removeEventListener(event, handler);
}
},
registerAnchorEventHandler: function (evt, handler) {
registerAnchorEventHandler: function (event, handler) {
var _a;
(_a = _this.anchorElem) === null || _a === void 0 ? void 0 : _a.addEventListener(evt, handler);
(_a = _this.anchorElem) === null || _a === void 0 ? void 0 : _a.addEventListener(event, handler);
},
deregisterAnchorEventHandler: function (evt, handler) {
deregisterAnchorEventHandler: function (event, handler) {
var _a;
(_a = _this.anchorElem) === null || _a === void 0 ? void 0 : _a.removeEventListener(evt, handler);
(_a = _this.anchorElem) === null || _a === void 0 ? void 0 : _a.removeEventListener(event, handler);
},
registerDocumentEventHandler: function (evt, handler) {
document.body.addEventListener(evt, handler);
registerDocumentEventHandler: function (event, handler) {
document.body.addEventListener(event, handler);
},
deregisterDocumentEventHandler: function (evt, handler) {
document.body.removeEventListener(evt, handler);
deregisterDocumentEventHandler: function (event, handler) {
document.body.removeEventListener(event, handler);
},
registerWindowEventHandler: function (evt, handler) {
window.addEventListener(evt, handler);
registerWindowEventHandler: function (event, handler) {
window.addEventListener(event, handler);
},
deregisterWindowEventHandler: function (evt, handler) {
window.removeEventListener(evt, handler);
deregisterWindowEventHandler: function (event, handler) {
window.removeEventListener(event, handler);
},

@@ -269,2 +267,5 @@ notifyHidden: function () {

},
isInstanceOfElement: function (eventTarget) {
return eventTarget instanceof Element;
},
};

@@ -271,0 +272,0 @@ //tslint:enable:object-literal-sort-keys

@@ -42,2 +42,3 @@ /**

SHOW_DELAY_MS: number;
MIN_WIDTH: number;
MIN_HEIGHT: number;

@@ -44,0 +45,0 @@ MAX_WIDTH: number;

@@ -44,2 +44,3 @@ /**

// LINT.IfChange(tooltip-dimensions)
MIN_WIDTH: 40,
MIN_HEIGHT: 24,

@@ -46,0 +47,0 @@ MAX_WIDTH: 200,

@@ -27,2 +27,3 @@ /**

import { AnchorBoundaryType, PositionWithCaret, XPosition, YPosition } from './constants';
/** MDC Tooltip Foundation */
export declare class MDCTooltipFoundation extends MDCFoundation<MDCTooltipAdapter> {

@@ -66,8 +67,16 @@ static get defaultAdapter(): MDCTooltipAdapter;

private preventContextMenuOnLongTouch;
/**
* Helper methods for determining if the event target or related target
* is contained inside the tooltip or the anchor. These methods are used to
* determing when a tooltip should be closed of left open on blur and click
* events.
*/
private tooltipContainsRelatedTargetElement;
private anchorOrTooltipContainsTargetElement;
handleAnchorTouchend(): void;
handleAnchorFocus(evt: FocusEvent): void;
handleAnchorFocus(event: FocusEvent): void;
handleAnchorMouseLeave(): void;
handleAnchorClick(): void;
handleDocumentClick(evt: MouseEvent): void;
handleKeydown(evt: KeyboardEvent): void;
handleDocumentClick(event: MouseEvent): void;
handleKeydown(event: KeyboardEvent): boolean;
private handleAnchorBlur;

@@ -178,3 +187,3 @@ private handleTooltipMouseEnter;

/**
* Returns the corresponding PositionWithCaret enum for the proivded
* Returns the corresponding PositionWithCaret enum for the provided
* XPositionWithCaret and YPositionWithCaret enums. This mapping exists so our

@@ -181,0 +190,0 @@ * public API accepts only PositionWithCaret enums (as all combinations of

{
"name": "@material/tooltip",
"description": "The Material Components Web tooltip component.",
"version": "15.0.0-canary.eb103d4b5.0",
"version": "15.0.0-canary.ebb636f3d.0",
"license": "MIT",

@@ -20,13 +20,13 @@ "keywords": [

"dependencies": {
"@material/animation": "15.0.0-canary.eb103d4b5.0",
"@material/base": "15.0.0-canary.eb103d4b5.0",
"@material/button": "15.0.0-canary.eb103d4b5.0",
"@material/dom": "15.0.0-canary.eb103d4b5.0",
"@material/elevation": "15.0.0-canary.eb103d4b5.0",
"@material/feature-targeting": "15.0.0-canary.eb103d4b5.0",
"@material/rtl": "15.0.0-canary.eb103d4b5.0",
"@material/shape": "15.0.0-canary.eb103d4b5.0",
"@material/theme": "15.0.0-canary.eb103d4b5.0",
"@material/tokens": "15.0.0-canary.eb103d4b5.0",
"@material/typography": "15.0.0-canary.eb103d4b5.0",
"@material/animation": "15.0.0-canary.ebb636f3d.0",
"@material/base": "15.0.0-canary.ebb636f3d.0",
"@material/button": "15.0.0-canary.ebb636f3d.0",
"@material/dom": "15.0.0-canary.ebb636f3d.0",
"@material/elevation": "15.0.0-canary.ebb636f3d.0",
"@material/feature-targeting": "15.0.0-canary.ebb636f3d.0",
"@material/rtl": "15.0.0-canary.ebb636f3d.0",
"@material/shape": "15.0.0-canary.ebb636f3d.0",
"@material/theme": "15.0.0-canary.ebb636f3d.0",
"@material/tokens": "15.0.0-canary.ebb636f3d.0",
"@material/typography": "15.0.0-canary.ebb636f3d.0",
"safevalues": "^0.3.4",

@@ -38,3 +38,3 @@ "tslib": "^2.1.0"

},
"gitHead": "6fd82c2abdb8567ca00c6847142375ca8ac18b90"
"gitHead": "6f62607a00dd885ebbe422b247dc4acc1ded22cb"
}

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 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 too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc