-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tokenizer-standalone-feat
- Loading branch information
Showing
501 changed files
with
20,840 additions
and
4,943 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
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
test/ | ||
src/**/*.ts | ||
node_modules/ | ||
.eslintignore | ||
.eslintrc.cjs | ||
used-modules.txt | ||
bundle.esm.js | ||
lib/ |
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,19 @@ | ||
type OpenUI5Patcher = { | ||
prototype: { | ||
_mAttributes: { [key: string]: string }, | ||
openEnd: () => OpenUI5Patcher, | ||
} | ||
}; | ||
|
||
const patchPatcher = (Patcher: OpenUI5Patcher) => { | ||
const origOpenEnd = Patcher.prototype.openEnd; | ||
Patcher.prototype.openEnd = function openEnd() { | ||
if (this._mAttributes.popover) { | ||
delete this._mAttributes.popover; // The "popover" attribute will be managed externally, don't let Patcher remove it | ||
} | ||
return origOpenEnd.apply(this); | ||
}; | ||
}; | ||
|
||
export default patchPatcher; | ||
export type { OpenUI5Patcher }; |
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,71 @@ | ||
// OpenUI5's Element.js subset | ||
type Element = { | ||
getDomRef: () => HTMLElement | null, | ||
} | ||
|
||
// The lifecycle of Popup.js is open -> _opened -> close -> _closed, we're interested in the first (open) and last (_closed) | ||
type OpenUI5Popup = { | ||
prototype: { | ||
open: (...args: any[]) => void, | ||
_closed: (...args: any[]) => void, | ||
getOpenState: () => "CLOSED" | "CLOSING" | "OPEN" | "OPENING", | ||
getContent: () => Element, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog) | ||
} | ||
}; | ||
|
||
const openNativePopover = (domRef: HTMLElement) => { | ||
domRef.setAttribute("popover", "manual"); | ||
domRef.showPopover(); | ||
}; | ||
|
||
const closeNativePopover = (domRef: HTMLElement) => { | ||
if (domRef.hasAttribute("popover")) { | ||
domRef.hidePopover(); | ||
domRef.removeAttribute("popover"); | ||
} | ||
}; | ||
|
||
const patchOpen = (Popup: OpenUI5Popup) => { | ||
const origOpen = Popup.prototype.open; | ||
Popup.prototype.open = function open(...args: any[]) { | ||
origOpen.apply(this, args); // call open first to initiate opening | ||
const topLayerAlreadyInUse = !!document.body.querySelector(":popover-open"); // check if there is already something in the top layer | ||
const openingInitiated = ["OPENING", "OPEN"].includes(this.getOpenState()); | ||
if (openingInitiated && topLayerAlreadyInUse) { | ||
const element = this.getContent(); | ||
if (element) { | ||
const domRef = element.getDomRef(); | ||
if (domRef) { | ||
openNativePopover(domRef); | ||
} | ||
} | ||
} | ||
}; | ||
}; | ||
|
||
const patchClosed = (Popup: OpenUI5Popup) => { | ||
const _origClosed = Popup.prototype._closed; | ||
Popup.prototype._closed = function _closed(...args: any[]) { | ||
const element = this.getContent(); | ||
const domRef = element.getDomRef(); | ||
_origClosed.apply(this, args); // only then call _close | ||
if (domRef) { | ||
closeNativePopover(domRef); // unset the popover attribute and close the native popover, but only if still in DOM | ||
} | ||
}; | ||
}; | ||
|
||
const createGlobalStyles = () => { | ||
const stylesheet = new CSSStyleSheet(); | ||
stylesheet.replaceSync(`.sapMPopup-CTX:popover-open { inset: unset; }`); | ||
document.adoptedStyleSheets = [...document.adoptedStyleSheets, stylesheet]; | ||
}; | ||
|
||
const patchPopup = (Popup: OpenUI5Popup) => { | ||
patchOpen(Popup); // Popup.prototype.open | ||
patchClosed(Popup); // Popup.prototype._closed | ||
createGlobalStyles(); // Ensures correct popover positioning by OpenUI5 (otherwise 0,0 is the center of the screen) | ||
}; | ||
|
||
export default patchPopup; | ||
export type { OpenUI5Popup }; |
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 @@ | ||
VITE_BUNDLE_PATH="../../dist/bundle.esm.js" |
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,12 @@ | ||
# Note: Changes to this file also must be applied to the top level .eslintignore file. | ||
target | ||
dist | ||
src/generated | ||
lib | ||
test | ||
bundle.*.js | ||
rollup.config*.js | ||
wdio.conf.cjs | ||
postcss.config.cjs | ||
package-scripts.cjs | ||
.eslintrc.cjs |
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,3 @@ | ||
const config = require("@ui5/webcomponents-tools/components-package/eslint.js"); | ||
|
||
module.exports = config; |
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,8 @@ | ||
src/generated | ||
src/**/*.ts | ||
node_modules/ | ||
test/ | ||
.eslintrc.cjs | ||
.eslintignore | ||
main.*js | ||
config/ |
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,2 @@ | ||
# Enforce public npm registry | ||
registry = https://registry.npmjs.org/ |
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,3 @@ | ||
{ | ||
"config": "./package-scripts.cjs" | ||
} |
Empty file.
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,45 @@ | ||
![UI5 icon](https://raw.githubusercontent.com/SAP/ui5-webcomponents/main/docs/images/UI5_logo_wide.png) | ||
|
||
|
||
# UI5 Web Components - Compatibility | ||
|
||
[![npm Package Version](https://badge.fury.io/js/%40ui5%2Fwebcomponents.svg)](https://www.npmjs.com/package/@ui5/webcomponents) | ||
|
||
Provides Table web component for compatibility (previously part of the "@ui5/webcomponents" package), while brand new Table web component is being developed and will replace it in the "@ui5/webcomponents" package. | ||
|
||
|
||
**Note:** The package is available since 2.0 and will be available until the next major release (3.0) when it will be removed as the Table "@ui5/webcomponents" will finally replace it. | ||
|
||
|
||
## Provided components | ||
|
||
| Web Component | Tag name | Module import | | ||
|--------------------------|-----------------------------|------------------------------------------------------------| | ||
| Table | `ui5-table` | `import "@ui5/webcomponents-compat/dist/Table.js";` | | ||
| Table Column | `ui5-table-column` | `import "@ui5/webcomponents-compat/dist/TableColumn.js";` | | ||
| Table Row | `ui5-table-row` | `import "@ui5/webcomponents-compat/dist/TableRow.js";` | | ||
| Table Group Row | `ui5-table-group-row` | `import "@ui5/webcomponents-compat/dist/TableGroupRow.js";` | | ||
| Table Cell | `ui5-table-cell` | `import "@ui5/webcomponents-compat/dist/TableCell.js";` | | ||
|
||
|
||
## Provided assets | ||
|
||
|
||
| Assets | Module | Notes | ||
|------------|-----------|----------- | ||
| `i18n`, `themes` | `@ui5/webcomponents-compat/dist/Assets.js` | Theming parameters and translations for the components | ||
|
||
|
||
## Resources | ||
- [UI5 Web Components - README.md](https://github.com/SAP/ui5-webcomponents/blob/main/README.md) | ||
- [UI5 Web Components - Playground and API Reference](https://sap.github.io/ui5-webcomponents/) | ||
|
||
## Support | ||
We welcome all comments, suggestions, questions, and bug reports. Please follow our [Support Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/SUPPORT.md#-content) on how to report an issue, or chat with us in the `#webcomponents` channel of the [OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/). | ||
|
||
## Contribute | ||
Please check our [Contribution Guidelines](https://github.com/SAP/ui5-webcomponents/blob/main/docs/6-contributing/02-conventions-and-guidelines.md). | ||
|
||
## License | ||
Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. | ||
This file is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the [LICENSE](https://github.com/SAP/ui5-webcomponents/blob/main/LICENSE.txt) file. |
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,3 @@ | ||
const wdio = require("@ui5/webcomponents-tools/components-package/wdio.js"); | ||
wdio.config.services.push("devtools"); | ||
module.exports = wdio; |
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,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es2017", | ||
"allowSyntheticDefaultImports": false, | ||
"baseUrl": "./", | ||
"paths": { | ||
"@ui5/webcomponents-base/dist/*": ["../base/src/*"] | ||
} | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
} |
Oops, something went wrong.