Socket
Socket
Sign inDemoInstall

@material/chips

Package Overview
Dependencies
Maintainers
14
Versions
1672
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/chips - npm Package Compare versions

Comparing version 15.0.0-canary.446734f27.0 to 15.0.0-canary.453a6248a.0

2

action/foundation.d.ts

@@ -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.446734f27.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.446734f27.0) (2023-05-30)
# [15.0.0-canary.453a6248a.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.453a6248a.0) (2024-03-25)

@@ -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))

@@ -14,0 +15,0 @@ * **chips:** Update elevation resolver function and mixins that apply elevation ([96f4726](https://github.com/material-components/material-components-web/commit/96f472604cd098572f50987262bcab933574f7b2))

@@ -84,13 +84,13 @@ /**

}
this.handleChipInteraction = function (evt) {
_this.foundation.handleChipInteraction(evt.detail);
this.handleChipInteraction = function (event) {
_this.foundation.handleChipInteraction(event.detail);
};
this.handleChipSelection = function (evt) {
_this.foundation.handleChipSelection(evt.detail);
this.handleChipSelection = function (event) {
_this.foundation.handleChipSelection(event.detail);
};
this.handleChipRemoval = function (evt) {
_this.foundation.handleChipRemoval(evt.detail);
this.handleChipRemoval = function (event) {
_this.foundation.handleChipRemoval(event.detail);
};
this.handleChipNavigation = function (evt) {
_this.foundation.handleChipNavigation(evt.detail);
this.handleChipNavigation = function (event) {
_this.foundation.handleChipNavigation(event.detail);
};

@@ -97,0 +97,0 @@ this.listen(INTERACTION_EVENT, this.handleChipInteraction);

@@ -125,4 +125,4 @@ /**

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

@@ -133,13 +133,13 @@ // Native events

};
this.handleKeydown = function (evt) {
_this.foundation.handleKeydown(evt);
this.handleKeydown = function (event) {
_this.foundation.handleKeydown(event);
};
this.handleTransitionEnd = function (evt) {
_this.foundation.handleTransitionEnd(evt);
this.handleTransitionEnd = function (event) {
_this.foundation.handleTransitionEnd(event);
};
this.handleFocusIn = function (evt) {
_this.foundation.handleFocusIn(evt);
this.handleFocusIn = function (event) {
_this.foundation.handleFocusIn(event);
};
this.handleFocusOut = function (evt) {
_this.foundation.handleFocusOut(evt);
this.handleFocusOut = function (event) {
_this.foundation.handleFocusOut(event);
};

@@ -146,0 +146,0 @@ this.listen('transitionend', this.handleTransitionEnd);

@@ -106,5 +106,5 @@ /**

*/
handleTransitionEnd(evt: TransitionEvent): void;
handleFocusIn(evt: FocusEvent): void;
handleFocusOut(evt: FocusEvent): void;
handleTransitionEnd(event: TransitionEvent): void;
handleFocusIn(event: FocusEvent): void;
handleFocusOut(event: FocusEvent): void;
/**

@@ -118,4 +118,4 @@ * Handles an interaction event on the trailing icon element. This is used to

*/
handleKeydown(evt: KeyboardEvent): void;
handleTrailingActionNavigation(evt: MDCChipTrailingActionNavigationEvent): void;
handleKeydown(event: KeyboardEvent): void;
handleTrailingActionNavigation(event: MDCChipTrailingActionNavigationEvent): void;
/**

@@ -122,0 +122,0 @@ * Called by the chip set to remove focus from the chip actions.

@@ -179,8 +179,8 @@ /**

*/
MDCChipFoundation.prototype.handleTransitionEnd = function (evt) {
MDCChipFoundation.prototype.handleTransitionEnd = function (event) {
var _this = this;
// Handle transition end event on the chip when it is about to be removed.
var shouldHandle = this.adapter.eventTargetHasClass(evt.target, cssClasses.CHIP_EXIT);
var widthIsAnimating = evt.propertyName === 'width';
var opacityIsAnimating = evt.propertyName === 'opacity';
var shouldHandle = this.adapter.eventTargetHasClass(event.target, cssClasses.CHIP_EXIT);
var widthIsAnimating = event.propertyName === 'width';
var opacityIsAnimating = event.propertyName === 'opacity';
if (shouldHandle && opacityIsAnimating) {

@@ -217,5 +217,5 @@ // See:

}
var shouldHideLeadingIcon = this.adapter.eventTargetHasClass(evt.target, cssClasses.LEADING_ICON) &&
var shouldHideLeadingIcon = this.adapter.eventTargetHasClass(event.target, cssClasses.LEADING_ICON) &&
this.adapter.hasClass(cssClasses.SELECTED);
var shouldShowLeadingIcon = this.adapter.eventTargetHasClass(evt.target, cssClasses.CHECKMARK) &&
var shouldShowLeadingIcon = this.adapter.eventTargetHasClass(event.target, cssClasses.CHECKMARK) &&
!this.adapter.hasClass(cssClasses.SELECTED);

@@ -231,5 +231,5 @@ if (shouldHideLeadingIcon) {

};
MDCChipFoundation.prototype.handleFocusIn = function (evt) {
MDCChipFoundation.prototype.handleFocusIn = function (event) {
// Early exit if the event doesn't come from the primary action
if (!this.eventFromPrimaryAction(evt)) {
if (!this.eventFromPrimaryAction(event)) {
return;

@@ -239,5 +239,5 @@ }

};
MDCChipFoundation.prototype.handleFocusOut = function (evt) {
MDCChipFoundation.prototype.handleFocusOut = function (event) {
// Early exit if the event doesn't come from the primary action
if (!this.eventFromPrimaryAction(evt)) {
if (!this.eventFromPrimaryAction(event)) {
return;

@@ -261,6 +261,6 @@ }

*/
MDCChipFoundation.prototype.handleKeydown = function (evt) {
MDCChipFoundation.prototype.handleKeydown = function (event) {
if (this.isEditing()) {
if (this.shouldFinishEditing(evt)) {
evt.preventDefault();
if (this.shouldFinishEditing(event)) {
event.preventDefault();
this.finishEditing();

@@ -273,8 +273,8 @@ }

if (this.isEditable()) {
if (this.shouldStartEditing(evt)) {
evt.preventDefault();
if (this.shouldStartEditing(event)) {
event.preventDefault();
this.startEditing();
}
}
if (this.shouldNotifyInteraction(evt)) {
if (this.shouldNotifyInteraction(event)) {
this.adapter.notifyInteraction();

@@ -284,4 +284,4 @@ this.setPrimaryActionFocusable(this.getFocusBehavior());

}
if (this.isDeleteAction(evt)) {
evt.preventDefault();
if (this.isDeleteAction(event)) {
event.preventDefault();
this.removeChip();

@@ -291,11 +291,11 @@ return;

// Early exit if the key is not usable
if (!navigationKeys.has(evt.key)) {
if (!navigationKeys.has(event.key)) {
return;
}
// Prevent default behavior for movement keys which could include scrolling
evt.preventDefault();
this.focusNextAction(evt.key, EventSource.PRIMARY);
event.preventDefault();
this.focusNextAction(event.key, EventSource.PRIMARY);
};
MDCChipFoundation.prototype.handleTrailingActionNavigation = function (evt) {
this.focusNextAction(evt.detail.key, EventSource.TRAILING);
MDCChipFoundation.prototype.handleTrailingActionNavigation = function (event) {
this.focusNextAction(event.detail.key, EventSource.TRAILING);
};

@@ -374,16 +374,16 @@ /**

};
MDCChipFoundation.prototype.shouldStartEditing = function (evt) {
return this.eventFromPrimaryAction(evt) && evt.key === strings.ENTER_KEY;
MDCChipFoundation.prototype.shouldStartEditing = function (event) {
return this.eventFromPrimaryAction(event) && event.key === strings.ENTER_KEY;
};
MDCChipFoundation.prototype.shouldFinishEditing = function (evt) {
return evt.key === strings.ENTER_KEY;
MDCChipFoundation.prototype.shouldFinishEditing = function (event) {
return event.key === strings.ENTER_KEY;
};
MDCChipFoundation.prototype.shouldNotifyInteraction = function (evt) {
return evt.key === strings.ENTER_KEY || evt.key === strings.SPACEBAR_KEY;
MDCChipFoundation.prototype.shouldNotifyInteraction = function (event) {
return event.key === strings.ENTER_KEY || event.key === strings.SPACEBAR_KEY;
};
MDCChipFoundation.prototype.isDeleteAction = function (evt) {
MDCChipFoundation.prototype.isDeleteAction = function (event) {
var isDeletable = this.adapter.hasClass(cssClasses.DELETABLE);
return isDeletable &&
(evt.key === strings.BACKSPACE_KEY || evt.key === strings.DELETE_KEY ||
evt.key === strings.IE_DELETE_KEY);
(event.key === strings.BACKSPACE_KEY || event.key === strings.DELETE_KEY ||
event.key === strings.IE_DELETE_KEY);
};

@@ -406,4 +406,4 @@ MDCChipFoundation.prototype.setSelectedImpl = function (selected) {

};
MDCChipFoundation.prototype.eventFromPrimaryAction = function (evt) {
return this.adapter.eventTargetHasClass(evt.target, cssClasses.PRIMARY_ACTION);
MDCChipFoundation.prototype.eventFromPrimaryAction = function (event) {
return this.adapter.eventTargetHasClass(event.target, cssClasses.PRIMARY_ACTION);
};

@@ -410,0 +410,0 @@ MDCChipFoundation.prototype.startEditing = function () {

@@ -461,6 +461,6 @@ <!--docs:

`beginExit() => void` | Begins the exit animation which leads to removal of the chip
`handleInteraction(evt: Event) => void` | Handles an interaction event on the root element
`handleTransitionEnd(evt: Event) => void` | Handles a transition end event on the root element
`handleTrailingIconInteraction(evt: Event) => void` | Handles an interaction event on the trailing icon element
`handleKeydown(evt: Event) => void` | Handles a keydown event on the root element
`handleInteraction(event: Event) => void` | Handles an interaction event on the root element
`handleTransitionEnd(event: Event) => void` | Handles a transition end event on the root element
`handleTrailingIconInteraction(event: Event) => void` | Handles an interaction event on the trailing icon element
`handleKeydown(event: Event) => void` | Handles a keydown event on the root element
`removeFocus() => void` | Removes focusability from the chip

@@ -467,0 +467,0 @@

@@ -58,7 +58,7 @@ /**

var _this = this;
this.handleClick = function (evt) {
_this.foundation.handleClick(evt);
this.handleClick = function (event) {
_this.foundation.handleClick(event);
};
this.handleKeydown = function (evt) {
_this.foundation.handleKeydown(evt);
this.handleKeydown = function (event) {
_this.foundation.handleKeydown(event);
};

@@ -65,0 +65,0 @@ this.listen('click', this.handleClick);

@@ -35,4 +35,4 @@ /**

constructor(adapter?: Partial<MDCChipTrailingActionAdapter>);
handleClick(evt: MouseEvent): void;
handleKeydown(evt: KeyboardEvent): void;
handleClick(event: MouseEvent): void;
handleKeydown(event: KeyboardEvent): void;
removeFocus(): void;

@@ -39,0 +39,0 @@ focus(): void;

@@ -53,9 +53,9 @@ /**

});
MDCChipTrailingActionFoundation.prototype.handleClick = function (evt) {
evt.stopPropagation();
MDCChipTrailingActionFoundation.prototype.handleClick = function (event) {
event.stopPropagation();
this.adapter.notifyInteraction(InteractionTrigger.CLICK);
};
MDCChipTrailingActionFoundation.prototype.handleKeydown = function (evt) {
evt.stopPropagation();
var key = normalizeKey(evt);
MDCChipTrailingActionFoundation.prototype.handleKeydown = function (event) {
event.stopPropagation();
var key = normalizeKey(event);
if (this.shouldNotifyInteractionFromKey(key)) {

@@ -66,3 +66,3 @@ var trigger = this.getTriggerFromKey(key);

}
if (isNavigationEvent(evt)) {
if (isNavigationEvent(event)) {
this.adapter.notifyNavigation(key);

@@ -69,0 +69,0 @@ return;

@@ -114,4 +114,4 @@ # Trailing Action (deprecated)

`isNavigable() => boolean` | Returns the navigability of the trailing action
`handleClick(evt: MouseEvent) => void` | Handles a click event on the root element
`handleKeydown(evt: KeyboardEvent) => void` | Handles a keydown event on the root element
`handleClick(event: MouseEvent) => void` | Handles a click event on the root element
`handleKeydown(event: KeyboardEvent) => void` | Handles a keydown event on the root element

@@ -118,0 +118,0 @@ #### `MDCChipTrailingActionFoundation` Event Handlers

{
"name": "@material/chips",
"description": "The Material Components for the Web chips component",
"version": "15.0.0-canary.446734f27.0",
"version": "15.0.0-canary.453a6248a.0",
"license": "MIT",

@@ -23,21 +23,21 @@ "main": "dist/mdc.chips.js",

"dependencies": {
"@material/animation": "15.0.0-canary.446734f27.0",
"@material/base": "15.0.0-canary.446734f27.0",
"@material/checkbox": "15.0.0-canary.446734f27.0",
"@material/density": "15.0.0-canary.446734f27.0",
"@material/dom": "15.0.0-canary.446734f27.0",
"@material/elevation": "15.0.0-canary.446734f27.0",
"@material/feature-targeting": "15.0.0-canary.446734f27.0",
"@material/focus-ring": "15.0.0-canary.446734f27.0",
"@material/ripple": "15.0.0-canary.446734f27.0",
"@material/rtl": "15.0.0-canary.446734f27.0",
"@material/shape": "15.0.0-canary.446734f27.0",
"@material/theme": "15.0.0-canary.446734f27.0",
"@material/tokens": "15.0.0-canary.446734f27.0",
"@material/touch-target": "15.0.0-canary.446734f27.0",
"@material/typography": "15.0.0-canary.446734f27.0",
"@material/animation": "15.0.0-canary.453a6248a.0",
"@material/base": "15.0.0-canary.453a6248a.0",
"@material/checkbox": "15.0.0-canary.453a6248a.0",
"@material/density": "15.0.0-canary.453a6248a.0",
"@material/dom": "15.0.0-canary.453a6248a.0",
"@material/elevation": "15.0.0-canary.453a6248a.0",
"@material/feature-targeting": "15.0.0-canary.453a6248a.0",
"@material/focus-ring": "15.0.0-canary.453a6248a.0",
"@material/ripple": "15.0.0-canary.453a6248a.0",
"@material/rtl": "15.0.0-canary.453a6248a.0",
"@material/shape": "15.0.0-canary.453a6248a.0",
"@material/theme": "15.0.0-canary.453a6248a.0",
"@material/tokens": "15.0.0-canary.453a6248a.0",
"@material/touch-target": "15.0.0-canary.453a6248a.0",
"@material/typography": "15.0.0-canary.453a6248a.0",
"safevalues": "^0.3.4",
"tslib": "^2.1.0"
},
"gitHead": "a2536a849aada5f06aa85deaa7be06f44f620023"
"gitHead": "1eea6443d63f2bc64fe8f6f86664b54266c41244"
}

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc