@smui/common
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -6,2 +6,24 @@ # Change Log | ||
# [4.1.0](https://github.com/hperrin/svelte-material-ui/compare/v4.0.0...v4.1.0) (2021-04-28) | ||
### Bug Fixes | ||
* warnings about unexpected slot in Img and Hr ([98a555f](https://github.com/hperrin/svelte-material-ui/commit/98a555f19273176099b8aa60b9e23028bb46e6e0)) | ||
### Features | ||
* change event modifier syntax to allow use on all events ([1fe4f82](https://github.com/hperrin/svelte-material-ui/commit/1fe4f82ef29f88567a81a24a746ef7f82389e7dc)) | ||
### Reverts | ||
* Revert "v4.1.0" ([54dfd48](https://github.com/hperrin/svelte-material-ui/commit/54dfd48fc0560843ccef9cb9821b12e251977c67)) | ||
* Revert "v4.1.0" ([3e683d9](https://github.com/hperrin/svelte-material-ui/commit/3e683d9166e7df9eaab2756c9ace64c4dd547758)) | ||
# [4.0.0](https://github.com/hperrin/svelte-material-ui/compare/v3.1.0...v4.0.0) (2021-04-24) | ||
@@ -8,0 +30,0 @@ |
@@ -9,3 +9,5 @@ import { | ||
// Match modifiers on DOM events. | ||
const modifierRegex = /^[a-z]+(?::(?:preventDefault|stopPropagation|passive|nonpassive|capture|once|self))+$/; | ||
const oldModifierRegex = /^[a-z]+(?::(?:preventDefault|stopPropagation|passive|nonpassive|capture|once|self))+$/; | ||
// Match modifiers on other events. | ||
const newModifierRegex = /^[^$]+(?:\$(?:preventDefault|stopPropagation|passive|nonpassive|capture|once|self))+$/; | ||
@@ -31,7 +33,16 @@ export function forwardEventsBuilder(component) { | ||
} | ||
const modifierMatch = eventType.match(modifierRegex); | ||
const oldModifierMatch = eventType.match(oldModifierRegex); | ||
const newModifierMatch = eventType.match(newModifierRegex); | ||
const modifierMatch = oldModifierMatch || newModifierMatch; | ||
if (oldModifierMatch && console) { | ||
console.warn( | ||
'Event modifiers in SMUI now use "$" instead of ":", so that all events can be bound with modifiers. Please update your event binding: ', | ||
eventType | ||
); | ||
} | ||
if (modifierMatch) { | ||
// Remove modifiers from the real event. | ||
const parts = eventType.split(':'); | ||
const parts = eventType.split(oldModifierMatch ? ':' : '$'); | ||
eventType = parts[0]; | ||
@@ -63,3 +74,5 @@ } | ||
let options = false; | ||
const modifierMatch = eventType.match(modifierRegex); | ||
const oldModifierMatch = eventType.match(oldModifierRegex); | ||
const newModifierMatch = eventType.match(newModifierRegex); | ||
const modifierMatch = oldModifierMatch || newModifierMatch; | ||
if (modifierMatch) { | ||
@@ -74,3 +87,3 @@ // Parse the event modifiers. | ||
// - once | ||
const parts = eventType.split(':'); | ||
const parts = eventType.split(oldModifierMatch ? ':' : '$'); | ||
eventType = parts[0]; | ||
@@ -77,0 +90,0 @@ options = Object.fromEntries(parts.slice(1).map((mod) => [mod, true])); |
{ | ||
"name": "@smui/common", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Svelte Material UI - Common", | ||
@@ -35,3 +35,3 @@ "type": "module", | ||
}, | ||
"gitHead": "2d9baa6fc5fea4c23813adc07956211a6f51caa7" | ||
"gitHead": "0ea65674bf0764cd7a6e1ef7f3621e21267ccc81" | ||
} |
Sorry, the diff of this file is not supported yet
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
47685
243