@material/switch
Advanced tools
Comparing version 15.0.0-canary.a0ae73b0e.0 to 15.0.0-canary.a0b8a90c0.0
@@ -6,3 +6,3 @@ # Change Log | ||
# [15.0.0-canary.a0ae73b0e.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.a0ae73b0e.0) (2022-11-21) | ||
# [15.0.0-canary.a0b8a90c0.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.a0b8a90c0.0) (2024-02-07) | ||
@@ -9,0 +9,0 @@ |
@@ -79,3 +79,3 @@ /** | ||
setAriaChecked: function (ariaChecked) { | ||
return _this.root.setAttribute('aria-checked', ariaChecked); | ||
_this.root.setAttribute('aria-checked', ariaChecked); | ||
}, | ||
@@ -82,0 +82,0 @@ setDisabled: function (disabled) { |
@@ -27,2 +27,3 @@ /** | ||
import { MDCSwitchFoundation } from './foundation'; | ||
/** MDC Switch */ | ||
export declare class MDCSwitch extends MDCComponent<MDCSwitchFoundation> implements MDCRippleCapableSurface { | ||
@@ -29,0 +30,0 @@ static attachTo(root: HTMLElement): MDCSwitch; |
@@ -32,2 +32,3 @@ /** | ||
import { MDCSwitchFoundation } from './foundation'; | ||
/** MDC Switch */ | ||
var MDCSwitch = /** @class */ (function (_super) { | ||
@@ -66,7 +67,12 @@ __extends(MDCSwitch, _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. | ||
var adapter = { | ||
addClass: function (className) { return _this.root.classList.add(className); }, | ||
removeClass: function (className) { return _this.root.classList.remove(className); }, | ||
addClass: function (className) { | ||
_this.root.classList.add(className); | ||
}, | ||
removeClass: function (className) { | ||
_this.root.classList.remove(className); | ||
}, | ||
setNativeControlChecked: function (checked) { return _this.nativeControl.checked = | ||
@@ -113,8 +119,11 @@ checked; }, | ||
var rippleSurface = this.root.querySelector(RIPPLE_SURFACE_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. | ||
var adapter = __assign(__assign({}, MDCRipple.createAdapter(this)), { addClass: function (className) { return rippleSurface.classList.add(className); }, computeBoundingRect: function () { return rippleSurface.getBoundingClientRect(); }, deregisterInteractionHandler: function (evtType, handler) { | ||
_this.nativeControl.removeEventListener(evtType, handler, applyPassive()); | ||
}, isSurfaceActive: function () { return matches(_this.nativeControl, ':active'); }, isUnbounded: function () { return true; }, registerInteractionHandler: function (evtType, handler) { | ||
_this.nativeControl.addEventListener(evtType, handler, applyPassive()); | ||
// 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 = __assign(__assign({}, MDCRipple.createAdapter(this)), { addClass: function (className) { | ||
rippleSurface.classList.add(className); | ||
}, computeBoundingRect: function () { return rippleSurface.getBoundingClientRect(); }, deregisterInteractionHandler: function (eventType, handler) { | ||
_this.nativeControl.removeEventListener(eventType, handler, applyPassive()); | ||
}, isSurfaceActive: function () { return matches(_this.nativeControl, ':active'); }, isUnbounded: function () { return true; }, registerInteractionHandler: function (eventType, handler) { | ||
_this.nativeControl.addEventListener(eventType, handler, applyPassive()); | ||
}, removeClass: function (className) { | ||
@@ -121,0 +130,0 @@ rippleSurface.classList.remove(className); |
@@ -36,5 +36,7 @@ /** | ||
NATIVE_CONTROL_SELECTOR: string; | ||
/** A CSS selector used to locate the ripple surface element for the switch. */ | ||
/** | ||
* A CSS selector used to locate the ripple surface element for the switch. | ||
*/ | ||
RIPPLE_SURFACE_SELECTOR: string; | ||
}; | ||
export { cssClasses, strings }; |
@@ -36,3 +36,5 @@ /** | ||
NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control', | ||
/** A CSS selector used to locate the ripple surface element for the switch. */ | ||
/** | ||
* A CSS selector used to locate the ripple surface element for the switch. | ||
*/ | ||
RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay', | ||
@@ -39,0 +41,0 @@ }; |
@@ -25,2 +25,3 @@ /** | ||
import { MDCSwitchAdapter } from './adapter'; | ||
/** MDC Switch Foundation */ | ||
export declare class MDCSwitchFoundation extends MDCFoundation<MDCSwitchAdapter> { | ||
@@ -46,3 +47,3 @@ /** The string constants used by the switch. */ | ||
/** Handles the change event for the switch native control. */ | ||
handleChange(evt: Event): void; | ||
handleChange(event: Event): void; | ||
/** Updates the styling of the switch based on its checked state. */ | ||
@@ -49,0 +50,0 @@ private updateCheckedStyling; |
@@ -26,2 +26,3 @@ /** | ||
import { cssClasses, strings } from './constants'; | ||
/** MDC Switch Foundation */ | ||
var MDCSwitchFoundation = /** @class */ (function (_super) { | ||
@@ -79,4 +80,4 @@ __extends(MDCSwitchFoundation, _super); | ||
/** Handles the change event for the switch native control. */ | ||
MDCSwitchFoundation.prototype.handleChange = function (evt) { | ||
var nativeControl = evt.target; | ||
MDCSwitchFoundation.prototype.handleChange = function (event) { | ||
var nativeControl = event.target; | ||
this.updateAriaChecked(nativeControl.checked); | ||
@@ -83,0 +84,0 @@ this.updateCheckedStyling(nativeControl.checked); |
{ | ||
"name": "@material/switch", | ||
"description": "The Material Components for the web switch component", | ||
"version": "15.0.0-canary.a0ae73b0e.0", | ||
"version": "15.0.0-canary.a0b8a90c0.0", | ||
"license": "MIT", | ||
@@ -20,14 +20,14 @@ "keywords": [ | ||
"dependencies": { | ||
"@material/animation": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/base": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/density": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/dom": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/elevation": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/feature-targeting": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/focus-ring": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/ripple": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/rtl": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/shape": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/theme": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/tokens": "15.0.0-canary.a0ae73b0e.0", | ||
"@material/animation": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/base": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/density": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/dom": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/elevation": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/feature-targeting": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/focus-ring": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/ripple": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/rtl": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/shape": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/theme": "15.0.0-canary.a0b8a90c0.0", | ||
"@material/tokens": "15.0.0-canary.a0b8a90c0.0", | ||
"safevalues": "^0.3.4", | ||
@@ -39,3 +39,3 @@ "tslib": "^2.1.0" | ||
}, | ||
"gitHead": "92b496120a9385203165ec42657a2edf41099000" | ||
"gitHead": "85d5965379b080c9f852ecbbd95031e363636dfd" | ||
} |
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
Sorry, the diff of this file is not supported yet
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
1079061
8395
+ Added@material/animation@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/base@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/density@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/dom@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/elevation@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/feature-targeting@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/focus-ring@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/ripple@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/rtl@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/shape@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/theme@15.0.0-canary.a0b8a90c0.0(transitive)
+ Added@material/tokens@15.0.0-canary.a0b8a90c0.0(transitive)
- Removed@material/animation@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/base@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/density@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/dom@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/elevation@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/feature-targeting@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/focus-ring@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/ripple@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/rtl@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/shape@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/theme@15.0.0-canary.a0ae73b0e.0(transitive)
- Removed@material/tokens@15.0.0-canary.a0ae73b0e.0(transitive)
Updated@material/feature-targeting@15.0.0-canary.a0b8a90c0.0