@material/switch
Advanced tools
Comparing version 15.0.0-canary.ef276aa93.0 to 15.0.0-canary.ef754381c.0
@@ -6,4 +6,8 @@ # Change Log | ||
# [15.0.0-canary.ef276aa93.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.ef276aa93.0) (2022-07-07) | ||
# [15.0.0-canary.ef754381c.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.ef754381c.0) (2023-04-24) | ||
**Note:** Version bump only for package @material/switch | ||
### Bug Fixes | ||
* 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)) | ||
* **switch:** Attribute `hidden` now correctly hides the switch. ([6432d8f](https://github.com/material-components/material-components-web/commit/6432d8fd7862fb39258a7970119f8db9eb8fbdb0)) |
@@ -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; |
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
import { __assign, __extends, __read, __spreadArray } from "tslib"; | ||
import { __assign, __extends, __makeTemplateObject, __read, __spreadArray } from "tslib"; | ||
import { MDCComponent } from '@material/base/component'; | ||
@@ -30,3 +30,6 @@ import { applyPassive } from '@material/dom/events'; | ||
import { MDCRippleFoundation } from '@material/ripple/foundation'; | ||
import { safeAttrPrefix } from 'safevalues'; | ||
import { safeElement } from 'safevalues/dom'; | ||
import { MDCSwitchFoundation } from './foundation'; | ||
/** MDC Switch */ | ||
var MDCSwitch = /** @class */ (function (_super) { | ||
@@ -65,7 +68,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 = | ||
@@ -76,3 +84,3 @@ checked; }, | ||
setNativeControlAttr: function (attr, value) { | ||
_this.nativeControl.setAttribute(attr, value); | ||
safeElement.setPrefixedAttribute([safeAttrPrefix(templateObject_1 || (templateObject_1 = __makeTemplateObject(["aria-"], ["aria-"])))], _this.nativeControl, attr, value); | ||
}, | ||
@@ -113,5 +121,8 @@ }; | ||
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) { | ||
// 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 (evtType, handler) { | ||
_this.nativeControl.removeEventListener(evtType, handler, applyPassive()); | ||
@@ -138,2 +149,3 @@ }, isSurfaceActive: function () { return matches(_this.nativeControl, ':active'); }, isUnbounded: function () { return true; }, registerInteractionHandler: function (evtType, handler) { | ||
export { MDCSwitch }; | ||
var templateObject_1; | ||
//# sourceMappingURL=component.js.map |
@@ -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> { | ||
@@ -27,0 +28,0 @@ /** The string constants used by the switch. */ |
@@ -26,2 +26,3 @@ /** | ||
import { cssClasses, strings } from './constants'; | ||
/** MDC Switch Foundation */ | ||
var MDCSwitchFoundation = /** @class */ (function (_super) { | ||
@@ -28,0 +29,0 @@ __extends(MDCSwitchFoundation, _super); |
{ | ||
"name": "@material/switch", | ||
"description": "The Material Components for the web switch component", | ||
"version": "15.0.0-canary.ef276aa93.0", | ||
"version": "15.0.0-canary.ef754381c.0", | ||
"license": "MIT", | ||
@@ -20,14 +20,15 @@ "keywords": [ | ||
"dependencies": { | ||
"@material/animation": "15.0.0-canary.ef276aa93.0", | ||
"@material/base": "15.0.0-canary.ef276aa93.0", | ||
"@material/density": "15.0.0-canary.ef276aa93.0", | ||
"@material/dom": "15.0.0-canary.ef276aa93.0", | ||
"@material/elevation": "15.0.0-canary.ef276aa93.0", | ||
"@material/feature-targeting": "15.0.0-canary.ef276aa93.0", | ||
"@material/focus-ring": "15.0.0-canary.ef276aa93.0", | ||
"@material/ripple": "15.0.0-canary.ef276aa93.0", | ||
"@material/rtl": "15.0.0-canary.ef276aa93.0", | ||
"@material/shape": "15.0.0-canary.ef276aa93.0", | ||
"@material/theme": "15.0.0-canary.ef276aa93.0", | ||
"@material/tokens": "15.0.0-canary.ef276aa93.0", | ||
"@material/animation": "15.0.0-canary.ef754381c.0", | ||
"@material/base": "15.0.0-canary.ef754381c.0", | ||
"@material/density": "15.0.0-canary.ef754381c.0", | ||
"@material/dom": "15.0.0-canary.ef754381c.0", | ||
"@material/elevation": "15.0.0-canary.ef754381c.0", | ||
"@material/feature-targeting": "15.0.0-canary.ef754381c.0", | ||
"@material/focus-ring": "15.0.0-canary.ef754381c.0", | ||
"@material/ripple": "15.0.0-canary.ef754381c.0", | ||
"@material/rtl": "15.0.0-canary.ef754381c.0", | ||
"@material/shape": "15.0.0-canary.ef754381c.0", | ||
"@material/theme": "15.0.0-canary.ef754381c.0", | ||
"@material/tokens": "15.0.0-canary.ef754381c.0", | ||
"safevalues": "^0.3.4", | ||
"tslib": "^2.1.0" | ||
@@ -38,3 +39,3 @@ }, | ||
}, | ||
"gitHead": "502fb9536e29ea5887a9fac4aaf0c9dc2c732e61" | ||
"gitHead": "998bb9432e40056ce6ec836100d9a46f72ace249" | ||
} |
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
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
1072006
8378
14
+ Addedsafevalues@^0.3.4
+ Added@material/animation@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/base@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/density@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/dom@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/elevation@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/feature-targeting@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/focus-ring@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/ripple@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/rtl@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/shape@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/theme@15.0.0-canary.ef754381c.0(transitive)
+ Added@material/tokens@15.0.0-canary.ef754381c.0(transitive)
+ Addedsafevalues@0.3.4(transitive)
- Removed@material/animation@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/base@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/density@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/dom@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/elevation@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/feature-targeting@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/focus-ring@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/ripple@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/rtl@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/shape@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/theme@15.0.0-canary.ef276aa93.0(transitive)
- Removed@material/tokens@15.0.0-canary.ef276aa93.0(transitive)
Updated@material/feature-targeting@15.0.0-canary.ef754381c.0