-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65f75eb
commit 1f29d23
Showing
94 changed files
with
299 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type UI5Element from "../UI5Element.js"; | ||
|
||
type i18nDecorator = (target: typeof UI5Element, propertyName: string) => void; | ||
|
||
/** | ||
* A decorator that converts a static class member into an accessor for the i18n bundle with a specified name | ||
* | ||
* @param { string } bundleName name of the i18n bundle to load | ||
* @returns { i18nDecorator } | ||
* | ||
* ```ts | ||
* class MyComponnet extends UI5Element { | ||
* @i18n('@ui5/webcomponents') | ||
* i18nBundle: I18nBundle; | ||
* } | ||
* ``` | ||
*/ | ||
const i18n = (bundleName: string): i18nDecorator => { | ||
return (target: typeof UI5Element, propertyName: string) => { | ||
if (!target.metadata.i18n) { | ||
target.metadata.i18n = {}; | ||
} | ||
target.metadata.i18n[propertyName] = { | ||
bundleName, | ||
target, | ||
}; | ||
}; | ||
}; | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { isIOS, isSafari } from "../Device.js"; | ||
|
||
let listenerAttached = false; | ||
|
||
const fixSafariActiveState = () => { | ||
if (isSafari() && isIOS() && !listenerAttached) { | ||
// Safari on iOS does not use the :active state unless there is a touchstart event handler on the <body> element | ||
document.body.addEventListener("touchstart", () => {}); | ||
listenerAttached = true; | ||
} | ||
}; | ||
|
||
export default fixSafariActiveState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.