Socket
Socket
Sign inDemoInstall

@material/list

Package Overview
Dependencies
Maintainers
14
Versions
1698
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material/list - npm Package Compare versions

Comparing version 15.0.0-canary.8175d5eff.0 to 15.0.0-canary.819498d8c.0

8

CHANGELOG.md

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

# [15.0.0-canary.8175d5eff.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.8175d5eff.0) (2022-12-28)
# [15.0.0-canary.819498d8c.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.819498d8c.0) (2024-03-15)

@@ -12,7 +12,13 @@

* **list:** Allow alt + enter to select index for lists. ([113b1a3](https://github.com/material-components/material-components-web/commit/113b1a38e87337fdd00c7495fda3299df2dbc317))
* **list:** behavior in case of changing focus from -1 to -1 with forceUpdate: true ([ae278a2](https://github.com/material-components/material-components-web/commit/ae278a2fe94fdb8c5d0716fb34cbe84a691d6146))
* **list:** Fix list leading/trailing icon theming ([36a4cba](https://github.com/material-components/material-components-web/commit/36a4cba9944392b391b86d41405ee21fb97f4c22))
* **list:** Fixes how list handles `CTRL-A` keyboard interactions for multi-selection lists when there are disabled list items. ([a911b38](https://github.com/material-components/material-components-web/commit/a911b386b2fded69e3468ef42e7ef25eb33fcd70))
* **list:** Fixing css for calculating `$mdc-list-subheader-margin` param. ([357f2e5](https://github.com/material-components/material-components-web/commit/357f2e5f15f6374c9d93da135a8b070239ba7464))
* **list:** Initialize selectedIndex as an array for checkbox list ([0347671](https://github.com/material-components/material-components-web/commit/034767110778aab3e5f0a3240937d8a07c21197e))
* **list:** only set overflow hidden on mdc-list-item--with-leading-image ([033ae08](https://github.com/material-components/material-components-web/commit/033ae083aad9ad4376e64aa328df936c7adb5a32))
* **list:** Remove ripple styles for disabled items in deprecated list. ([f52358d](https://github.com/material-components/material-components-web/commit/f52358dd0796308919bb78deffc573d0d933c7de))
* **list:** rolling back update of list styles since this is causing failures. ([eb103d4](https://github.com/material-components/material-components-web/commit/eb103d4b5d33e0d1535ea28ca0089d2c7002fab6))
* **select:** <fix inherited ellipsis color for list items in selects> ([c43b343](https://github.com/material-components/material-components-web/commit/c43b3438b4b7eeb777072525f9ae07c97d27c0bb))
* correct behavior of checkboxes/radios in a list. ([f771b09](https://github.com/material-components/material-components-web/commit/f771b091ce1e5b1b97b3a508f1459e4665008a80))

@@ -19,0 +25,0 @@

8

component.d.ts

@@ -27,7 +27,7 @@ /**

/** MDC List Factory */
export declare type MDCListFactory = (el: Element, foundation?: MDCListFoundation) => MDCList;
export declare type MDCListFactory = (el: HTMLElement, foundation?: MDCListFoundation) => MDCList;
/** MDC List */
export declare class MDCList extends MDCComponent<MDCListFoundation> {
set vertical(value: boolean);
get listElements(): Element[];
get listElements(): HTMLElement[];
set wrapFocus(value: boolean);

@@ -47,3 +47,3 @@ /**

set selectedIndex(index: MDCListIndex);
static attachTo(root: Element): MDCList;
static attachTo(root: HTMLElement): MDCList;
private handleKeydown;

@@ -94,3 +94,3 @@ private handleClick;

/**
* Used to figure out which list item this event is targetting. Or returns -1
* Used to figure out which list item this event is targeting. Or returns -1
* if there is no list item

@@ -97,0 +97,0 @@ */

@@ -104,4 +104,3 @@ /**

MDCList.prototype.initialSyncWithDOM = function () {
this.isEvolutionEnabled =
evolutionAttribute in this.root.dataset;
this.isEvolutionEnabled = evolutionAttribute in this.root.dataset;
if (this.isEvolutionEnabled) {

@@ -238,6 +237,4 @@ this.classNameMap = evolutionClassNameMap;

focusItemAtIndex: function (index) {
var element = _this.listElements[index];
if (element) {
element.focus();
}
var _a;
(_a = _this.listElements[index]) === null || _a === void 0 ? void 0 : _a.focus();
},

@@ -291,3 +288,3 @@ getAttributeForElementIndex: function (index, attr) {

if (element) {
element.setAttribute(attr, value);
_this.safeSetAttribute(element, attr, value);
}

@@ -307,3 +304,3 @@ },

Array.prototype.forEach.call(element.querySelectorAll(selector), function (el) {
el.setAttribute('tabindex', tabIndexValue);
el.tabIndex = Number(tabIndexValue);
});

@@ -343,3 +340,3 @@ },

/**
* Used to figure out which list item this event is targetting. Or returns -1
* Used to figure out which list item this event is targeting. Or returns -1
* if there is no list item

@@ -360,4 +357,4 @@ */

*/
MDCList.prototype.handleFocusInEvent = function (evt) {
var index = this.getListItemIndex(evt.target);
MDCList.prototype.handleFocusInEvent = function (event) {
var index = this.getListItemIndex(event.target);
this.foundation.handleFocusIn(index);

@@ -369,4 +366,4 @@ };

*/
MDCList.prototype.handleFocusOutEvent = function (evt) {
var index = this.getListItemIndex(evt.target);
MDCList.prototype.handleFocusOutEvent = function (event) {
var index = this.getListItemIndex(event.target);
this.foundation.handleFocusOut(index);

@@ -378,6 +375,6 @@ };

*/
MDCList.prototype.handleKeydownEvent = function (evt) {
var index = this.getListItemIndex(evt.target);
var target = evt.target;
this.foundation.handleKeydown(evt, target.classList.contains(this.classNameMap[cssClasses.LIST_ITEM_CLASS]), index);
MDCList.prototype.handleKeydownEvent = function (event) {
var index = this.getListItemIndex(event.target);
var target = event.target;
this.foundation.handleKeydown(event, target.classList.contains(this.classNameMap[cssClasses.LIST_ITEM_CLASS]), index);
};

@@ -388,9 +385,6 @@ /**

*/
MDCList.prototype.handleClickEvent = function (evt) {
var index = this.getListItemIndex(evt.target);
var target = evt.target;
// Toggle the checkbox only if it's not the target of the event, or the
// checkbox will have 2 change events.
var toggleCheckbox = !matches(target, strings.CHECKBOX_RADIO_SELECTOR);
this.foundation.handleClick(index, toggleCheckbox, evt);
MDCList.prototype.handleClickEvent = function (event) {
var index = this.getListItemIndex(event.target);
var target = event.target;
this.foundation.handleClick(index, matches(target, strings.CHECKBOX_RADIO_SELECTOR), event);
};

@@ -397,0 +391,0 @@ return MDCList;

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

*
* @param evt keyboard event to be prevented.
* @param event keyboard event to be prevented.
*/
export declare const preventDefaultEvent: (evt: KeyboardEvent) => void;
export declare const preventDefaultEvent: (event: KeyboardEvent) => void;

@@ -28,6 +28,6 @@ /**

*
* @param evt keyboard event to be prevented.
* @param event keyboard event to be prevented.
*/
export var preventDefaultEvent = function (evt) {
var target = evt.target;
export var preventDefaultEvent = function (event) {
var target = event.target;
if (!target) {

@@ -38,5 +38,5 @@ return;

if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
evt.preventDefault();
event.preventDefault();
}
};
//# sourceMappingURL=events.js.map

@@ -193,3 +193,3 @@ /**

/**
* Helper method for ensuring that the list of selected indicies remains
* Helper method for ensuring that the list of selected indices remains
* accurate when calling setCheckboxAtIndex with omitDisabledItems set to

@@ -196,0 +196,0 @@ * true.

@@ -387,3 +387,4 @@ /**

}
else if ((isEnter || isSpace) && eventHasModifiers([])) {
else if ((isEnter || isSpace) &&
(eventHasModifiers([]) || eventHasModifiers(['Alt']))) {
if (isRootListItem) {

@@ -664,3 +665,3 @@ // Return early if enter key is pressed on anchor element which triggers

/**
* Helper method for ensuring that the list of selected indicies remains
* Helper method for ensuring that the list of selected indices remains
* accurate when calling setCheckboxAtIndex with omitDisabledItems set to

@@ -667,0 +668,0 @@ * true.

{
"name": "@material/list",
"description": "The Material Components for the web list component",
"version": "15.0.0-canary.8175d5eff.0",
"version": "15.0.0-canary.819498d8c.0",
"license": "MIT",

@@ -20,15 +20,15 @@ "main": "dist/mdc.list.js",

"dependencies": {
"@material/base": "15.0.0-canary.8175d5eff.0",
"@material/density": "15.0.0-canary.8175d5eff.0",
"@material/dom": "15.0.0-canary.8175d5eff.0",
"@material/feature-targeting": "15.0.0-canary.8175d5eff.0",
"@material/ripple": "15.0.0-canary.8175d5eff.0",
"@material/rtl": "15.0.0-canary.8175d5eff.0",
"@material/shape": "15.0.0-canary.8175d5eff.0",
"@material/theme": "15.0.0-canary.8175d5eff.0",
"@material/tokens": "15.0.0-canary.8175d5eff.0",
"@material/typography": "15.0.0-canary.8175d5eff.0",
"@material/base": "15.0.0-canary.819498d8c.0",
"@material/density": "15.0.0-canary.819498d8c.0",
"@material/dom": "15.0.0-canary.819498d8c.0",
"@material/feature-targeting": "15.0.0-canary.819498d8c.0",
"@material/ripple": "15.0.0-canary.819498d8c.0",
"@material/rtl": "15.0.0-canary.819498d8c.0",
"@material/shape": "15.0.0-canary.819498d8c.0",
"@material/theme": "15.0.0-canary.819498d8c.0",
"@material/tokens": "15.0.0-canary.819498d8c.0",
"@material/typography": "15.0.0-canary.819498d8c.0",
"tslib": "^2.1.0"
},
"gitHead": "c3bb551a6b32480853dcc8e29f7f8513d62154a2"
"gitHead": "886876a8252aacefe1942b13ba9251af9204bcdd"
}

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

`setUseActivatedClass(useActivated: boolean) => void` | Sets the selection logic to apply/remove the `mdc-deprecated-list-item--activated` class.
`handleFocusIn(evt: Event) => void` | Handles the changing of `tabindex` to `0` for all button and anchor elements when a list item receives focus.
`handleFocusOut(evt: Event) => void` | Handles the changing of `tabindex` to `-1` for all button and anchor elements when a list item loses focus.
`handleKeydown(evt: Event) => void` | Handles determining if a focus action should occur when a key event is triggered.
`handleClick(evt: Event) => void` | Handles toggling the selected/deselected state for a list item when clicked. This method is only used by the single selection list.
`handleFocusIn(event: Event) => void` | Handles the changing of `tabindex` to `0` for all button and anchor elements when a list item receives focus.
`handleFocusOut(event: Event) => void` | Handles the changing of `tabindex` to `-1` for all button and anchor elements when a list item loses focus.
`handleKeydown(event: Event) => void` | Handles determining if a focus action should occur when a key event is triggered.
`handleClick(event: Event) => void` | Handles toggling the selected/deselected state for a list item when clicked. This method is only used by the single selection list.
`focusNextElement(index: number) => number` | Handles focusing the next element using the current `index`. Returns focused element index.

@@ -682,0 +682,0 @@ `focusPrevElement(index: number) => number` | Handles focusing the previous element using the current `index`. Returns focused element index.

@@ -51,3 +51,3 @@ /**

* @return Map that maps the first character of the primary text to the full
* list text and it's index
* list text and its index
*/

@@ -109,4 +109,4 @@ export declare function initSortedIndex(listItemCount: number, getPrimaryTextByItemIndex: (index: number) => string): Map<string, MDCListTextAndIndex[]>;

* Given a keydown event, it calculates whether or not to automatically focus a
* list item depending on what was typed mimicing the typeahead functionality of
* a standard <select> element that is open.
* list item depending on what was typed mimicking the typeahead functionality
* of a standard <select> element that is open.
*

@@ -123,4 +123,4 @@ * @param opts Options and accessors

*
* @returns index of the item matched by the keydown. -1 if not matched.
* @return index of the item matched by the keydown. -1 if not matched.
*/
export declare function handleKeydown(opts: HandleKeydownOpts, state: TypeaheadState): number;

@@ -52,3 +52,3 @@ /**

* @return Map that maps the first character of the primary text to the full
* list text and it's index
* list text and its index
*/

@@ -222,4 +222,4 @@ export function initSortedIndex(listItemCount, getPrimaryTextByItemIndex) {

* Given a keydown event, it calculates whether or not to automatically focus a
* list item depending on what was typed mimicing the typeahead functionality of
* a standard <select> element that is open.
* list item depending on what was typed mimicking the typeahead functionality
* of a standard <select> element that is open.
*

@@ -236,3 +236,3 @@ * @param opts Options and accessors

*
* @returns index of the item matched by the keydown. -1 if not matched.
* @return index of the item matched by the keydown. -1 if not matched.
*/

@@ -239,0 +239,0 @@ export function handleKeydown(opts, state) {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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