@material/chips
Advanced tools
Comparing version 15.0.0-canary.5490e32e7.0 to 15.0.0-canary.54feb3020.0
@@ -34,3 +34,3 @@ /** | ||
*/ | ||
export declare type MDCChipActionFactory = (el: Element, foundation?: MDCChipActionFoundation) => MDCChipAction; | ||
export declare type MDCChipActionFactory = (el: HTMLElement, foundation?: MDCChipActionFoundation) => MDCChipAction; | ||
/** | ||
@@ -41,3 +41,3 @@ * MDCChipAction provides component encapsulation of the different foundation | ||
export declare class MDCChipAction extends MDCComponent<MDCChipActionFoundation> implements MDCRippleCapableSurface { | ||
static attachTo(root: Element): MDCChipAction; | ||
static attachTo(root: HTMLElement): MDCChipAction; | ||
private readonly rootHTML; | ||
@@ -44,0 +44,0 @@ private rippleInstance; |
@@ -34,3 +34,3 @@ /** | ||
handleClick(): void; | ||
handleKeydown(event: KeyboardEvent): void; | ||
handleKeydown(event: KeyboardEvent): true | undefined; | ||
setDisabled(isDisabled: boolean): void; | ||
@@ -37,0 +37,0 @@ isDisabled(): boolean; |
@@ -74,2 +74,4 @@ /** | ||
} | ||
// signal to propagate the event since this Key isn't handled by chip | ||
return true; | ||
}; | ||
@@ -76,0 +78,0 @@ MDCChipActionFoundation.prototype.setDisabled = function (isDisabled) { |
@@ -6,3 +6,3 @@ # Change Log | ||
# [15.0.0-canary.5490e32e7.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.5490e32e7.0) (2022-12-12) | ||
# [15.0.0-canary.54feb3020.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.54feb3020.0) (2023-09-11) | ||
@@ -12,2 +12,3 @@ | ||
* **chip:** Propagate unhandled keyboard events ([6081d82](https://github.com/material-components/material-components-web/commit/6081d829b081384ff8433a92bf91db364c588e16)) | ||
* **chips:** Add missing tokens for leading icon for validation ([4356e05](https://github.com/material-components/material-components-web/commit/4356e05c5e17a58d0a714e9f087db4b5060085bd)) | ||
@@ -24,1 +25,2 @@ * **chips:** Update elevation resolver function and mixins that apply elevation ([96f4726](https://github.com/material-components/material-components-web/commit/96f472604cd098572f50987262bcab933574f7b2)) | ||
* **chips:** fix HCM chip styles ([86efd56](https://github.com/material-components/material-components-web/commit/86efd56f6a2aa9870a8457900e686bc35d3cb3bc)) | ||
* **chips:** Make light-theme tokens public ([51311e6](https://github.com/material-components/material-components-web/commit/51311e69ec61d62c214e0020fb856c39919ee657)) |
@@ -31,3 +31,3 @@ /** | ||
export declare class MDCChipSet extends MDCComponent<MDCChipSetFoundation> { | ||
static attachTo(root: Element): MDCChipSet; | ||
static attachTo(root: HTMLElement): MDCChipSet; | ||
private handleChipAnimation; | ||
@@ -34,0 +34,0 @@ private handleChipInteraction; |
@@ -75,3 +75,4 @@ /** | ||
} | ||
if (animation === MDCChipAnimation.ENTER && isComplete && addedAnnouncement) { | ||
if (animation === MDCChipAnimation.ENTER && isComplete && | ||
addedAnnouncement) { | ||
this.adapter.announceMessage(addedAnnouncement); | ||
@@ -78,0 +79,0 @@ return; |
@@ -32,3 +32,3 @@ /** | ||
*/ | ||
export declare type MDCChipFactory = (el: Element, foundation?: MDCChipFoundation) => MDCChip; | ||
export declare type MDCChipFactory = (el: HTMLElement, foundation?: MDCChipFoundation) => MDCChip; | ||
/** | ||
@@ -38,4 +38,3 @@ * MDCChip provides component encapsulation of the foundation implementation. | ||
export declare class MDCChip extends MDCComponent<MDCChipFoundation> { | ||
static attachTo(root: Element): MDCChip; | ||
private readonly rootHTML; | ||
static attachTo(root: HTMLElement): MDCChip; | ||
private handleActionInteraction; | ||
@@ -42,0 +41,0 @@ private handleActionNavigation; |
@@ -34,5 +34,3 @@ /** | ||
function MDCChip() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rootHTML = _this.root; | ||
return _this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -98,5 +96,5 @@ MDCChip.attachTo = function (root) { | ||
getAttribute: function (attrName) { return _this.root.getAttribute(attrName); }, | ||
getElementID: function () { return _this.rootHTML.id; }, | ||
getElementID: function () { return _this.root.id; }, | ||
getOffsetWidth: function () { | ||
return _this.rootHTML.offsetWidth; | ||
return _this.root.offsetWidth; | ||
}, | ||
@@ -155,3 +153,3 @@ hasClass: function (className) { return _this.root.classList.contains(className); }, | ||
setStyleProperty: function (prop, value) { | ||
_this.rootHTML.style.setProperty(prop, value); | ||
_this.root.style.setProperty(prop, value); | ||
}, | ||
@@ -158,0 +156,0 @@ }; |
@@ -26,9 +26,10 @@ /** | ||
import { MDCChipSetFoundation } from './foundation'; | ||
/** MDC Chip Set */ | ||
export declare class MDCChipSet extends MDCComponent<MDCChipSetFoundation> { | ||
static attachTo(root: Element): MDCChipSet; | ||
get chips(): ReadonlyArray<MDCChip>; | ||
static attachTo(root: HTMLElement): MDCChipSet; | ||
get chips(): readonly MDCChip[]; | ||
/** | ||
* @return An array of the IDs of all selected chips. | ||
*/ | ||
get selectedChipIds(): ReadonlyArray<string>; | ||
get selectedChipIds(): readonly string[]; | ||
private chipsList; | ||
@@ -49,3 +50,3 @@ private chipFactory; | ||
*/ | ||
addChip(chipEl: Element): void; | ||
addChip(chipEl: HTMLElement): void; | ||
getDefaultFoundation(): MDCChipSetFoundation; | ||
@@ -57,5 +58,6 @@ /** | ||
/** | ||
* Returns the index of the chip with the given id, or -1 if the chip does not exist. | ||
* Returns the index of the chip with the given id, or -1 if the chip does not | ||
* exist. | ||
*/ | ||
private findChipIndex; | ||
} |
@@ -32,2 +32,3 @@ /** | ||
var idCounter = 0; | ||
/** MDC Chip Set */ | ||
var MDCChipSet = /** @class */ (function (_super) { | ||
@@ -85,12 +86,12 @@ __extends(MDCChipSet, _super); | ||
this.handleChipInteraction = function (evt) { | ||
return _this.foundation.handleChipInteraction(evt.detail); | ||
_this.foundation.handleChipInteraction(evt.detail); | ||
}; | ||
this.handleChipSelection = function (evt) { | ||
return _this.foundation.handleChipSelection(evt.detail); | ||
_this.foundation.handleChipSelection(evt.detail); | ||
}; | ||
this.handleChipRemoval = function (evt) { | ||
return _this.foundation.handleChipRemoval(evt.detail); | ||
_this.foundation.handleChipRemoval(evt.detail); | ||
}; | ||
this.handleChipNavigation = function (evt) { | ||
return _this.foundation.handleChipNavigation(evt.detail); | ||
_this.foundation.handleChipNavigation(evt.detail); | ||
}; | ||
@@ -132,4 +133,5 @@ this.listen(INTERACTION_EVENT, this.handleChipInteraction); | ||
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. | ||
var adapter = { | ||
@@ -173,3 +175,3 @@ announceMessage: function (message) { | ||
MDCChipSet.prototype.instantiateChips = function (chipFactory) { | ||
var chipElements = [].slice.call(this.root.querySelectorAll(CHIP_SELECTOR)); | ||
var chipElements = Array.from(this.root.querySelectorAll(CHIP_SELECTOR)); | ||
return chipElements.map(function (el) { | ||
@@ -181,3 +183,4 @@ el.id = el.id || "mdc-chip-" + ++idCounter; | ||
/** | ||
* Returns the index of the chip with the given id, or -1 if the chip does not exist. | ||
* Returns the index of the chip with the given id, or -1 if the chip does not | ||
* exist. | ||
*/ | ||
@@ -184,0 +187,0 @@ MDCChipSet.prototype.findChipIndex = function (chipId) { |
@@ -26,2 +26,3 @@ /** | ||
import { MDCChipSetAdapter } from './adapter'; | ||
/** MDC Chip Set Foundation */ | ||
export declare class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> { | ||
@@ -37,3 +38,4 @@ static get strings(): { | ||
/** | ||
* The ids of the selected chips in the set. Only used for choice chip set or filter chip set. | ||
* The ids of the selected chips in the set. Only used for choice chip set or | ||
* filter chip set. | ||
*/ | ||
@@ -45,6 +47,7 @@ private selectedChipIds; | ||
*/ | ||
getSelectedChipIds(): ReadonlyArray<string>; | ||
getSelectedChipIds(): readonly string[]; | ||
/** | ||
* Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant. | ||
* Does not notify clients of the updated selection state. | ||
* Selects the chip with the given id. Deselects all other chips if the chip | ||
* set is of the choice variant. Does not notify clients of the updated | ||
* selection state. | ||
*/ | ||
@@ -57,3 +60,4 @@ select(chipId: string): void; | ||
/** | ||
* Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip. | ||
* Handles a chip selection event, used to handle discrepancy when selection | ||
* state is set directly on the Chip. | ||
*/ | ||
@@ -60,0 +64,0 @@ handleChipSelection({ chipId, selected, shouldIgnore }: MDCChipSelectionEventDetail): void; |
@@ -27,2 +27,3 @@ /** | ||
import { cssClasses, strings } from './constants'; | ||
/** MDC Chip Set Foundation */ | ||
var MDCChipSetFoundation = /** @class */ (function (_super) { | ||
@@ -33,3 +34,4 @@ __extends(MDCChipSetFoundation, _super); | ||
/** | ||
* The ids of the selected chips in the set. Only used for choice chip set or filter chip set. | ||
* The ids of the selected chips in the set. Only used for choice chip set or | ||
* filter chip set. | ||
*/ | ||
@@ -78,4 +80,5 @@ _this.selectedChipIds = []; | ||
/** | ||
* Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant. | ||
* Does not notify clients of the updated selection state. | ||
* Selects the chip with the given id. Deselects all other chips if the chip | ||
* set is of the choice variant. Does not notify clients of the updated | ||
* selection state. | ||
*/ | ||
@@ -98,3 +101,4 @@ MDCChipSetFoundation.prototype.select = function (chipId) { | ||
/** | ||
* Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip. | ||
* Handles a chip selection event, used to handle discrepancy when selection | ||
* state is set directly on the Chip. | ||
*/ | ||
@@ -132,3 +136,4 @@ MDCChipSetFoundation.prototype.handleChipSelection = function (_a) { | ||
this.removeFocusFromChipsExcept(nextIndex); | ||
// After removing a chip, we should focus the trailing action for the next chip. | ||
// After removing a chip, we should focus the trailing action for the next | ||
// chip. | ||
this.adapter.focusChipTrailingActionAtIndex(nextIndex); | ||
@@ -179,13 +184,17 @@ }; | ||
if (shouldJumpChips && source === EventSource.PRIMARY) { | ||
return this.adapter.focusChipPrimaryActionAtIndex(index); | ||
this.adapter.focusChipPrimaryActionAtIndex(index); | ||
return; | ||
} | ||
if (shouldJumpChips && source === EventSource.TRAILING) { | ||
return this.adapter.focusChipTrailingActionAtIndex(index); | ||
this.adapter.focusChipTrailingActionAtIndex(index); | ||
return; | ||
} | ||
var dir = this.getDirection(key); | ||
if (dir === Direction.LEFT) { | ||
return this.adapter.focusChipTrailingActionAtIndex(index); | ||
this.adapter.focusChipTrailingActionAtIndex(index); | ||
return; | ||
} | ||
if (dir === Direction.RIGHT) { | ||
return this.adapter.focusChipPrimaryActionAtIndex(index); | ||
this.adapter.focusChipPrimaryActionAtIndex(index); | ||
return; | ||
} | ||
@@ -192,0 +201,0 @@ }; |
@@ -66,8 +66,9 @@ /** | ||
/** | ||
* Emits a custom "MDCChip:selection" event denoting the chip has been selected or deselected. | ||
* Emits a custom "MDCChip:selection" event denoting the chip has been | ||
* selected or deselected. | ||
*/ | ||
notifySelection(selected: boolean, chipSetShouldIgnore: boolean): void; | ||
/** | ||
* Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been | ||
* interacted with (typically on click or keydown). | ||
* Emits a custom "MDCChip:trailingIconInteraction" event denoting the | ||
* trailing icon has been interacted with (typically on click or keydown). | ||
*/ | ||
@@ -80,3 +81,4 @@ notifyTrailingIconInteraction(): void; | ||
/** | ||
* Emits a custom event "MDCChip:navigation" denoting a focus navigation event. | ||
* Emits a custom event "MDCChip:navigation" denoting a focus navigation | ||
* event. | ||
*/ | ||
@@ -93,3 +95,4 @@ notifyNavigation(key: string, source: EventSource): void; | ||
/** | ||
* @return The computed property value of the given style property on the root element. | ||
* @return The computed property value of the given style property on the root | ||
* element. | ||
*/ | ||
@@ -110,3 +113,4 @@ getComputedStyleValue(propertyName: string): string; | ||
/** | ||
* @return The bounding client rect of the checkmark element or null if it doesn't exist. | ||
* @return The bounding client rect of the checkmark element or null if it | ||
* doesn't exist. | ||
*/ | ||
@@ -113,0 +117,0 @@ getCheckmarkBoundingClientRect(): DOMRect | null; |
@@ -28,3 +28,5 @@ /** | ||
import { MDCChipFoundation } from './foundation'; | ||
export declare type MDCChipFactory = (el: Element, foundation?: MDCChipFoundation) => MDCChip; | ||
/** MDC Chip Factory */ | ||
export declare type MDCChipFactory = (el: HTMLElement, foundation?: MDCChipFoundation) => MDCChip; | ||
/** MDC Chip */ | ||
export declare class MDCChip extends MDCComponent<MDCChipFoundation> implements MDCRippleCapableSurface { | ||
@@ -40,3 +42,4 @@ /** | ||
/** | ||
* @return Whether a trailing icon click should trigger exit/removal of the chip. | ||
* @return Whether a trailing icon click should trigger exit/removal of the | ||
* chip. | ||
*/ | ||
@@ -54,3 +57,3 @@ get shouldRemoveOnTrailingIconClick(): boolean; | ||
get id(): string; | ||
static attachTo(root: Element): MDCChip; | ||
static attachTo(root: HTMLElement): MDCChip; | ||
private leadingIcon; | ||
@@ -57,0 +60,0 @@ private checkmark; |
@@ -31,2 +31,3 @@ /** | ||
import { MDCChipFoundation } from './foundation'; | ||
/** MDC Chip */ | ||
var MDCChip = /** @class */ (function (_super) { | ||
@@ -55,3 +56,4 @@ __extends(MDCChip, _super); | ||
/** | ||
* @return Whether a trailing icon click should trigger exit/removal of the chip. | ||
* @return Whether a trailing icon click should trigger exit/removal of the | ||
* chip. | ||
*/ | ||
@@ -101,4 +103,6 @@ get: function () { | ||
if (trailingActionFactory === void 0) { trailingActionFactory = function (el) { return new MDCChipTrailingAction(el); }; } | ||
this.leadingIcon = this.root.querySelector(strings.LEADING_ICON_SELECTOR); | ||
this.checkmark = this.root.querySelector(strings.CHECKMARK_SELECTOR); | ||
this.leadingIcon = | ||
this.root.querySelector(strings.LEADING_ICON_SELECTOR); | ||
this.checkmark = | ||
this.root.querySelector(strings.CHECKMARK_SELECTOR); | ||
this.primaryAction = | ||
@@ -110,4 +114,5 @@ this.root.querySelector(strings.PRIMARY_ACTION_SELECTOR); | ||
} | ||
// 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. | ||
var rippleAdapter = __assign(__assign({}, MDCRipple.createAdapter(this)), { computeBoundingRect: function () { return _this.foundation.getDimensions(); } }); | ||
@@ -174,6 +179,9 @@ this.rippleSurface = | ||
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. | ||
var adapter = { | ||
addClass: function (className) { return _this.root.classList.add(className); }, | ||
addClass: function (className) { | ||
_this.root.classList.add(className); | ||
}, | ||
addClassToLeadingIcon: function (className) { | ||
@@ -214,5 +222,7 @@ if (_this.leadingIcon) { | ||
}, | ||
notifyInteraction: function () { return _this.emit(strings.INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); }, | ||
notifyInteraction: function () { | ||
_this.emit(strings.INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); | ||
}, | ||
notifyNavigation: function (key, source) { | ||
return _this.emit(strings.NAVIGATION_EVENT, { chipId: _this.id, key: key, source: source }, true /* shouldBubble */); | ||
_this.emit(strings.NAVIGATION_EVENT, { chipId: _this.id, key: key, source: source }, true /* shouldBubble */); | ||
}, | ||
@@ -223,10 +233,12 @@ notifyRemoval: function (removedAnnouncement) { | ||
notifySelection: function (selected, shouldIgnore) { | ||
return _this.emit(strings.SELECTION_EVENT, { chipId: _this.id, selected: selected, shouldIgnore: shouldIgnore }, true /* shouldBubble */); | ||
_this.emit(strings.SELECTION_EVENT, { chipId: _this.id, selected: selected, shouldIgnore: shouldIgnore }, true /* shouldBubble */); | ||
}, | ||
notifyTrailingIconInteraction: function () { | ||
return _this.emit(strings.TRAILING_ICON_INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); | ||
_this.emit(strings.TRAILING_ICON_INTERACTION_EVENT, { chipId: _this.id }, true /* shouldBubble */); | ||
}, | ||
notifyEditStart: function () { }, | ||
notifyEditFinish: function () { }, | ||
removeClass: function (className) { return _this.root.classList.remove(className); }, | ||
removeClass: function (className) { | ||
_this.root.classList.remove(className); | ||
}, | ||
removeClassFromLeadingIcon: function (className) { | ||
@@ -244,7 +256,7 @@ if (_this.leadingIcon) { | ||
if (_this.primaryAction) { | ||
_this.primaryAction.setAttribute(attr, value); | ||
_this.safeSetAttribute(_this.primaryAction, attr, value); | ||
} | ||
}, | ||
setStyleProperty: function (propertyName, value) { | ||
return _this.root.style.setProperty(propertyName, value); | ||
_this.root.style.setProperty(propertyName, value); | ||
}, | ||
@@ -251,0 +263,0 @@ }; |
@@ -82,3 +82,4 @@ /** | ||
export var navigationKeys = new Set(); | ||
// IE11 has no support for new Set with iterable so we need to initialize this by hand | ||
// IE11 has no support for new Set with iterable so we need to initialize this | ||
// by hand | ||
navigationKeys.add(strings.ARROW_LEFT_KEY); | ||
@@ -95,3 +96,4 @@ navigationKeys.add(strings.ARROW_RIGHT_KEY); | ||
export var jumpChipKeys = new Set(); | ||
// IE11 has no support for new Set with iterable so we need to initialize this by hand | ||
// IE11 has no support for new Set with iterable so we need to initialize this | ||
// by hand | ||
jumpChipKeys.add(strings.ARROW_UP_KEY); | ||
@@ -98,0 +100,0 @@ jumpChipKeys.add(strings.ARROW_DOWN_KEY); |
@@ -26,2 +26,3 @@ /** | ||
import { MDCChipAdapter } from './adapter'; | ||
/** MDC Chip Foundation */ | ||
export declare class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> { | ||
@@ -76,3 +77,6 @@ static get strings(): { | ||
static get defaultAdapter(): MDCChipAdapter; | ||
/** Whether a trailing icon click should immediately trigger exit/removal of the chip. */ | ||
/** | ||
* Whether a trailing icon click should immediately trigger exit/removal of | ||
* the chip. | ||
*/ | ||
private shouldRemoveOnTrailingIconClick; | ||
@@ -79,0 +83,0 @@ /** |
@@ -39,2 +39,3 @@ /** | ||
})(FocusBehavior || (FocusBehavior = {})); | ||
/** MDC Chip Foundation */ | ||
var MDCChipFoundation = /** @class */ (function (_super) { | ||
@@ -44,3 +45,6 @@ __extends(MDCChipFoundation, _super); | ||
var _this = _super.call(this, __assign(__assign({}, MDCChipFoundation.defaultAdapter), adapter)) || this; | ||
/** Whether a trailing icon click should immediately trigger exit/removal of the chip. */ | ||
/** | ||
* Whether a trailing icon click should immediately trigger exit/removal of | ||
* the chip. | ||
*/ | ||
_this.shouldRemoveOnTrailingIconClick = true; | ||
@@ -136,4 +140,4 @@ /** | ||
}; | ||
// When a chip has a checkmark and not a leading icon, the bounding rect changes in size depending on the current | ||
// size of the checkmark. | ||
// When a chip has a checkmark and not a leading icon, the bounding rect | ||
// changes in size depending on the current size of the checkmark. | ||
if (!this.adapter.hasLeadingIcon()) { | ||
@@ -143,6 +147,7 @@ var checkmarkRect = getCheckmarkRect(); | ||
var rootRect = getRootRect(); | ||
// Checkmark is a square, meaning the client rect's width and height are identical once the animation completes. | ||
// However, the checkbox is initially hidden by setting the width to 0. | ||
// To account for an initial width of 0, we use the checkbox's height instead (which equals the end-state width) | ||
// when adding it to the root client rect's width. | ||
// Checkmark is a square, meaning the client rect's width and height are | ||
// identical once the animation completes. However, the checkbox is | ||
// initially hidden by setting the width to 0. To account for an initial | ||
// width of 0, we use the checkbox's height instead (which equals the | ||
// end-state width) when adding it to the root client rect's width. | ||
return { | ||
@@ -185,12 +190,16 @@ bottom: rootRect.bottom, | ||
if (shouldHandle && opacityIsAnimating) { | ||
// See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5 | ||
// See: | ||
// https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5 | ||
var chipWidth_1 = this.adapter.getComputedStyleValue('width'); | ||
// On the next frame (once we get the computed width), explicitly set the chip's width | ||
// to its current pixel width, so we aren't transitioning out of 'auto'. | ||
// On the next frame (once we get the computed width), explicitly set the | ||
// chip's width to its current pixel width, so we aren't transitioning out | ||
// of 'auto'. | ||
requestAnimationFrame(function () { | ||
_this.adapter.setStyleProperty('width', chipWidth_1); | ||
// To mitigate jitter, start transitioning padding and margin before width. | ||
// To mitigate jitter, start transitioning padding and margin before | ||
// width. | ||
_this.adapter.setStyleProperty('padding', '0'); | ||
_this.adapter.setStyleProperty('margin', '0'); | ||
// On the next frame (once width is explicitly set), transition width to 0. | ||
// On the next frame (once width is explicitly set), transition width to | ||
// 0. | ||
requestAnimationFrame(function () { | ||
@@ -207,3 +216,4 @@ _this.adapter.setStyleProperty('width', '0'); | ||
} | ||
// Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles. | ||
// Handle a transition end event on the leading icon or checkmark, since the | ||
// transition end event bubbles. | ||
if (!opacityIsAnimating) { | ||
@@ -210,0 +220,0 @@ return; |
@@ -30,6 +30,7 @@ /** | ||
*/ | ||
export declare type MDCChipTrailingActionFactory = (el: Element, foundation?: MDCChipTrailingActionFoundation) => MDCChipTrailingAction; | ||
export declare type MDCChipTrailingActionFactory = (el: HTMLElement, foundation?: MDCChipTrailingActionFoundation) => MDCChipTrailingAction; | ||
/** MDC Chip Trailing Action */ | ||
export declare class MDCChipTrailingAction extends MDCComponent<MDCChipTrailingActionFoundation> implements MDCRippleCapableSurface { | ||
get ripple(): MDCRipple; | ||
static attachTo(root: Element): MDCChipTrailingAction; | ||
static attachTo(root: HTMLElement): MDCChipTrailingAction; | ||
private rippleSurface; | ||
@@ -36,0 +37,0 @@ private handleClick; |
@@ -29,2 +29,3 @@ /** | ||
import { MDCChipTrailingActionFoundation } from './foundation'; | ||
/** MDC Chip Trailing Action */ | ||
var MDCChipTrailingAction = /** @class */ (function (_super) { | ||
@@ -80,3 +81,2 @@ __extends(MDCChipTrailingAction, _super); | ||
focus: function () { | ||
// TODO(b/157231863): Migate MDCComponent#root to HTMLElement | ||
_this.root.focus(); | ||
@@ -86,3 +86,3 @@ }, | ||
notifyInteraction: function (trigger) { | ||
return _this.emit(strings.INTERACTION_EVENT, { trigger: trigger }, true /* shouldBubble */); | ||
_this.emit(strings.INTERACTION_EVENT, { trigger: trigger }, true /* shouldBubble */); | ||
}, | ||
@@ -93,3 +93,3 @@ notifyNavigation: function (key) { | ||
setAttribute: function (attr, value) { | ||
_this.root.setAttribute(attr, value); | ||
_this.safeSetAttribute(_this.root, attr, value); | ||
}, | ||
@@ -96,0 +96,0 @@ }; |
@@ -25,2 +25,3 @@ /** | ||
import { MDCChipTrailingActionAdapter } from './adapter'; | ||
/** MDC Chip Trailing Action Foundation */ | ||
export declare class MDCChipTrailingActionFoundation extends MDCFoundation<MDCChipTrailingActionAdapter> { | ||
@@ -27,0 +28,0 @@ static get strings(): { |
@@ -27,2 +27,3 @@ /** | ||
import { InteractionTrigger, strings } from './constants'; | ||
/** MDC Chip Trailing Action Foundation */ | ||
var MDCChipTrailingActionFoundation = /** @class */ (function (_super) { | ||
@@ -29,0 +30,0 @@ __extends(MDCChipTrailingActionFoundation, _super); |
{ | ||
"name": "@material/chips", | ||
"description": "The Material Components for the Web chips component", | ||
"version": "15.0.0-canary.5490e32e7.0", | ||
"version": "15.0.0-canary.54feb3020.0", | ||
"license": "MIT", | ||
@@ -23,21 +23,21 @@ "main": "dist/mdc.chips.js", | ||
"dependencies": { | ||
"@material/animation": "15.0.0-canary.5490e32e7.0", | ||
"@material/base": "15.0.0-canary.5490e32e7.0", | ||
"@material/checkbox": "15.0.0-canary.5490e32e7.0", | ||
"@material/density": "15.0.0-canary.5490e32e7.0", | ||
"@material/dom": "15.0.0-canary.5490e32e7.0", | ||
"@material/elevation": "15.0.0-canary.5490e32e7.0", | ||
"@material/feature-targeting": "15.0.0-canary.5490e32e7.0", | ||
"@material/focus-ring": "15.0.0-canary.5490e32e7.0", | ||
"@material/ripple": "15.0.0-canary.5490e32e7.0", | ||
"@material/rtl": "15.0.0-canary.5490e32e7.0", | ||
"@material/shape": "15.0.0-canary.5490e32e7.0", | ||
"@material/theme": "15.0.0-canary.5490e32e7.0", | ||
"@material/tokens": "15.0.0-canary.5490e32e7.0", | ||
"@material/touch-target": "15.0.0-canary.5490e32e7.0", | ||
"@material/typography": "15.0.0-canary.5490e32e7.0", | ||
"@material/animation": "15.0.0-canary.54feb3020.0", | ||
"@material/base": "15.0.0-canary.54feb3020.0", | ||
"@material/checkbox": "15.0.0-canary.54feb3020.0", | ||
"@material/density": "15.0.0-canary.54feb3020.0", | ||
"@material/dom": "15.0.0-canary.54feb3020.0", | ||
"@material/elevation": "15.0.0-canary.54feb3020.0", | ||
"@material/feature-targeting": "15.0.0-canary.54feb3020.0", | ||
"@material/focus-ring": "15.0.0-canary.54feb3020.0", | ||
"@material/ripple": "15.0.0-canary.54feb3020.0", | ||
"@material/rtl": "15.0.0-canary.54feb3020.0", | ||
"@material/shape": "15.0.0-canary.54feb3020.0", | ||
"@material/theme": "15.0.0-canary.54feb3020.0", | ||
"@material/tokens": "15.0.0-canary.54feb3020.0", | ||
"@material/touch-target": "15.0.0-canary.54feb3020.0", | ||
"@material/typography": "15.0.0-canary.54feb3020.0", | ||
"safevalues": "^0.3.4", | ||
"tslib": "^2.1.0" | ||
}, | ||
"gitHead": "968b84204c7a8626355569e2b90063abd574f7a8" | ||
"gitHead": "5dc5cb94463af21f898ddd58cc4d9e4fbf803222" | ||
} |
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 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 not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1950529
16733
161
+ Added@material/animation@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/base@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/checkbox@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/density@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/dom@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/elevation@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/feature-targeting@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/focus-ring@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/ripple@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/rtl@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/shape@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/theme@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/tokens@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/touch-target@15.0.0-canary.54feb3020.0(transitive)
+ Added@material/typography@15.0.0-canary.54feb3020.0(transitive)
- Removed@material/animation@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/base@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/checkbox@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/density@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/dom@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/elevation@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/feature-targeting@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/focus-ring@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/ripple@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/rtl@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/shape@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/theme@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/tokens@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/touch-target@15.0.0-canary.5490e32e7.0(transitive)
- Removed@material/typography@15.0.0-canary.5490e32e7.0(transitive)
Updated@material/feature-targeting@15.0.0-canary.54feb3020.0