Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-table): adding horizontal column alignment #9639

Merged
merged 50 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
66b74a0
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
a971d03
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
2a4c627
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
55fac39
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
d5e3840
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
9d0f836
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
dc7c7d3
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
a4fdc16
feat(ui5-grid): adding horizontal column alignment
nowakdaniel Jun 12, 2024
4eb0c5b
Merge branch 'main' into feat-grid-horizontal-alignment
nowakdaniel Sep 9, 2024
eabfb94
fix(ui5-table): skip horizontalAlign css variable in case headerRow o…
nowakdaniel Sep 9, 2024
87fb2f4
feat(ui5-table): minor adjustments
nowakdaniel Sep 13, 2024
94b6e02
Merge branch 'main' into feat-grid-horizontal-alignment
nowakdaniel Sep 13, 2024
9bf975f
Merge branch 'main' into feat-grid-horizontal-alignment
nowakdaniel Sep 16, 2024
09a14cf
fix(ui5-table): removed unused imports
nowakdaniel Sep 16, 2024
9b0f25b
feat(ui5-table): added note for horizontalAlign values
nowakdaniel Sep 16, 2024
e938658
chore: migrate more tests to Cypress (#9863)
ilhan007 Sep 16, 2024
bdb339b
fix(ui5-popover): correct opacity (#9839)
kskondov Sep 16, 2024
0373d24
chore: cleanup Cypress tests (#9877)
nnaydenow Sep 16, 2024
9899237
test(ui5-tabcontainer): stabilize test (#9883)
dimovpetar Sep 16, 2024
1473cf5
chore: export InvalidationInfo type (#9881)
vladitasev Sep 17, 2024
44caf0d
docs(ui5-dialog): improve basic sample (#9876)
s-todorova Sep 17, 2024
d4bf614
feat(selectionAssistant): introduce SelectionAssistant (#9797)
ivoplashkov Sep 17, 2024
bedc249
chore(ui5-notification-list): improve popover example (#9847)
TeodorTaushanov Sep 17, 2024
c7c1c40
chore(ui5-notification-list): fix minor styling issues (#9866)
TeodorTaushanov Sep 17, 2024
1b58ee3
fix(ui5-wizard): prevent step selection upon scrolling on Single Step…
MapTo0 Sep 17, 2024
f2a7ea0
chore(ui5-notification-list): add tests for the growing functionality…
TeodorTaushanov Sep 17, 2024
2440ebd
chore: add custom prompt pattern samples (#9882)
plamenivanov91 Sep 17, 2024
8fceb6e
chore: call customElements.define synchronously (#9857)
pskelin Sep 18, 2024
78c62fc
chore: add guided prompt pattern for <ui5-ai-button> (#9854)
kineticjs Sep 18, 2024
936d8c0
chore: add GenAI contribution guidelines in CONTRIBUTING.md (#9892)
petyabegovska Sep 19, 2024
3322e8d
chore(release): publish v2.3.0-rc.2 [ci skip]
ui5-webcomponents-bot Sep 19, 2024
b3ce6f9
fix(ui5-color-picker): add missing hex value to RGBtoHEX method (#9906)
hinzzx Sep 19, 2024
36994b0
fix(ui5-multi-combobox): fix aria-describedby token count (#9888)
Okiana Sep 19, 2024
1dc99b3
fix: patchPopup now correctly handles getContent (#9913)
vladitasev Sep 20, 2024
0ff0b5f
fix(ui5-multi-input): tokens are not deletable when multi-input is re…
nikoletavnv Sep 24, 2024
4456dd2
fix(ui5-input): arrow up scrolls the suggestion items when item is be…
nikoletavnv Sep 24, 2024
c13a4f2
fix(ui5-flexible-column-layout): iframe content no longer hinders res…
kineticjs Sep 24, 2024
376fda6
fix(ui5-file-uploader): remove the cloning of the value state message…
hinzzx Sep 24, 2024
d3f8111
fix(ui5-select): improve selection change handling (#9865)
NakataCode Sep 25, 2024
95048ad
docs(ui5-page): correct noScrolling documentation (#9925)
ivoplashkov Sep 25, 2024
5698c65
fix(ui5-barcode-scanner-dialog): can be imported in server environmen…
pskelin Sep 25, 2024
9a59950
chore: update chromedriver 128 (#9926)
pskelin Sep 25, 2024
df59420
chore: simplify guided prompt sample for dialog (#9903)
kineticjs Sep 25, 2024
e3d4e45
chore(deps): bump rollup from 3.28.1 to 3.29.5 (#9928)
dependabot[bot] Sep 25, 2024
d8bc9ed
chore(deps): bump vite from 4.5.3 to 4.5.5 (#9889)
dependabot[bot] Sep 25, 2024
2810252
docs: enhance Table docs (#9929)
ilhan007 Sep 25, 2024
e901877
fix(ui5-page): fix double footer and adjust animation timing (#9885)
MapTo0 Sep 25, 2024
65a0bde
feat(ui5-table): adjust jsdoc of horizontalAlign property
nowakdaniel Sep 25, 2024
efbc30a
Merge branch 'main' into feat-grid-horizontal-alignment
nowakdaniel Sep 26, 2024
c30871d
feat(ui5-table): moved _individualSlot prop to tableCellCase
nowakdaniel Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)


### Bug Fixes

* **ui5-dynamic-side-content:** fix scrollbar styling ([#9842](https://github.com/SAP/ui5-webcomponents/issues/9842)) ([c5d0249](https://github.com/SAP/ui5-webcomponents/commit/c5d02499a849b09cd076b9419c723a81b642bf17))
* **ui5-illustrated-message:** illustration fixed ([#9739](https://github.com/SAP/ui5-webcomponents/issues/9739)) ([0b57512](https://github.com/SAP/ui5-webcomponents/commit/0b575120c079a3726320046d033aeb1ba4a4dee5))
* **ui5-multi-combobox:** fix aria-describedby token count ([#9792](https://github.com/SAP/ui5-webcomponents/issues/9792)) ([2e0aa03](https://github.com/SAP/ui5-webcomponents/commit/2e0aa039e652534c8d7b667f431306cde1321fab))
* **ui5-popover:** correct opacity ([#9839](https://github.com/SAP/ui5-webcomponents/issues/9839)) ([371c547](https://github.com/SAP/ui5-webcomponents/commit/371c547676ed71582dc6ff64a2a1b1181dd9bf9d)), closes [#9823](https://github.com/SAP/ui5-webcomponents/issues/9823)
* **ui5-wizard:** prevent step selection upon scrolling on Single Step layout ([#9766](https://github.com/SAP/ui5-webcomponents/issues/9766)) ([82f6afc](https://github.com/SAP/ui5-webcomponents/commit/82f6afc2fab521d114ee534c12939b44a9ca69fa)), closes [#9083](https://github.com/SAP/ui5-webcomponents/issues/9083)


### Features

* **selectionAssistant:** introduce SelectionAssistant ([#9797](https://github.com/SAP/ui5-webcomponents/issues/9797)) ([de59eac](https://github.com/SAP/ui5-webcomponents/commit/de59eac1df149caa7541a3bbd3ddad5ae2c298a6))





# [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)


Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ Due to legal reasons, contributors will be asked to accept a DCO before they sub
- Note that the UI5 Web Components developers have many duties. So, depending on the required effort for reviewing, testing, and clarification, this may take a while.
1. Once the change has been approved and merged, we will inform you in a comment.
1. Celebrate!

### Contributing with AI-generated code
As artificial intelligence evolves, AI-generated code is becoming valuable for many software projects, including open-source initiatives. While we recognize the potential benefits of incorporating AI-generated content into our open-source projects there are certain requirements that need to be reflected and adhered to when making contributions.

Please see our [guideline for AI-generated code contributions to SAP Open Source Software Projects](https://github.com/SAP/.github/blob/main/CONTRIBUTING_USING_GENAI.md) for these requirements.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"packages/create-package",
"packages/compat"
],
"version": "2.3.0-rc.1",
"version": "2.3.0-rc.2",
"command": {
"publish": {
"allowBranch": "*",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)

**Note:** Version bump only for package @ui5/webcomponents-ai





# [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)

**Note:** Version bump only for package @ui5/webcomponents-ai
Expand Down
14 changes: 7 additions & 7 deletions packages/ai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-ai",
"version": "2.3.0-rc.1",
"version": "2.3.0-rc.2",
"description": "UI5 Web Components: webcomponents.ai",
"ui5": {
"webComponentsPackage": true
Expand Down Expand Up @@ -45,13 +45,13 @@
"directory": "packages/ai"
},
"dependencies": {
"@ui5/webcomponents": "2.3.0-rc.1",
"@ui5/webcomponents-base": "2.3.0-rc.1",
"@ui5/webcomponents-icons": "2.3.0-rc.1",
"@ui5/webcomponents-theming": "2.3.0-rc.1"
"@ui5/webcomponents": "2.3.0-rc.2",
"@ui5/webcomponents-base": "2.3.0-rc.2",
"@ui5/webcomponents-icons": "2.3.0-rc.2",
"@ui5/webcomponents-theming": "2.3.0-rc.2"
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.3.0-rc.1",
"chromedriver": "^127.0.3"
"@ui5/webcomponents-tools": "2.3.0-rc.2",
"chromedriver": "^128.0.3"
}
}
11 changes: 11 additions & 0 deletions packages/base/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)


### Features

* **selectionAssistant:** introduce SelectionAssistant ([#9797](https://github.com/SAP/ui5-webcomponents/issues/9797)) ([de59eac](https://github.com/SAP/ui5-webcomponents/commit/de59eac1df149caa7541a3bbd3ddad5ae2c298a6))





# [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)


Expand Down
6 changes: 3 additions & 3 deletions packages/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-base",
"version": "2.3.0-rc.1",
"version": "2.3.0-rc.2",
"description": "UI5 Web Components: webcomponents.base",
"author": "SAP SE (https://www.sap.com)",
"license": "Apache-2.0",
Expand Down Expand Up @@ -52,8 +52,8 @@
},
"devDependencies": {
"@openui5/sap.ui.core": "1.120.17",
"@ui5/webcomponents-tools": "2.3.0-rc.1",
"chromedriver": "^127.0.3",
"@ui5/webcomponents-tools": "2.3.0-rc.2",
"chromedriver": "^128.0.3",
"clean-css": "^5.2.2",
"copy-and-watch": "^0.1.5",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/Boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const boot = async (): Promise<void> => {
resolve();

booted = true;
await eventProvider.fireEventAsync("boot");
eventProvider.fireEvent("boot");
};

bootPromise = new Promise(bootExecutor as (resolve: PromiseResolve) => void);
Expand Down
25 changes: 14 additions & 11 deletions packages/base/src/UI5Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ abstract class UI5Element extends HTMLElement {
return;
}

if (!ctor.asyncFinished) {
await ctor.definePromise;
}

renderImmediately(this);
this._domRefReadyPromise._deferredResolve!();
this._fullyConnected = true;
Expand Down Expand Up @@ -1199,13 +1203,6 @@ abstract class UI5Element extends HTMLElement {
return uniqueDependenciesCache.get(this) || [];
}

/**
* Returns a promise that resolves whenever all dependencies for this UI5 Web Component have resolved
*/
static whenDependenciesDefined(): Promise<Array<typeof UI5Element>> {
return Promise.all(this.getUniqueDependencies().map(dep => dep.define()));
}

/**
* Hook that will be called upon custom element definition
*
Expand All @@ -1215,15 +1212,16 @@ abstract class UI5Element extends HTMLElement {
return Promise.resolve();
}

static asyncFinished: boolean;
static definePromise: Promise<[void, void]> | undefined;

/**
* Registers a UI5 Web Component in the browser window object
* @public
*/
static async define(): Promise<typeof UI5Element> {
await boot();

await Promise.all([
this.whenDependenciesDefined(),
this.definePromise = Promise.all([
boot(),
this.onDefine(),
]);

Expand All @@ -1249,6 +1247,10 @@ abstract class UI5Element extends HTMLElement {
registerTag(tag);
customElements.define(tag, this as unknown as CustomElementConstructor);
}

await this.definePromise;
this.asyncFinished = true;

return this;
}

Expand Down Expand Up @@ -1293,6 +1295,7 @@ export {
};
export type {
ChangeInfo,
InvalidationInfo,
Renderer,
RendererOptions,
};
10 changes: 5 additions & 5 deletions packages/base/src/features/patchPopup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// OpenUI5's Element.js subset
type Element = {
// OpenUI5's Control.js subset
type Control = {
getDomRef: () => HTMLElement | null,
}

Expand All @@ -9,7 +9,7 @@ type OpenUI5Popup = {
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)
getContent: () => Control | HTMLElement, // this is the OpenUI5 Element/Control instance that opens the Popup (usually sap.m.Popover/sap.m.Dialog)
onFocusEvent: (e: FocusEvent) => void,
}
};
Expand All @@ -35,7 +35,7 @@ const patchOpen = (Popup: OpenUI5Popup) => {
if (openingInitiated && topLayerAlreadyInUse) {
const element = this.getContent();
if (element) {
const domRef = element.getDomRef();
const domRef = element instanceof HTMLElement ? element : element.getDomRef();
if (domRef) {
openNativePopover(domRef);
}
Expand All @@ -48,7 +48,7 @@ const patchClosed = (Popup: OpenUI5Popup) => {
const _origClosed = Popup.prototype._closed;
Popup.prototype._closed = function _closed(...args: any[]) {
const element = this.getContent();
const domRef = element.getDomRef();
const domRef = element instanceof HTMLElement ? element : 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
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/util/ColorConversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ const HEXToRGB = (hex: string): ColorRGB => {
* @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)
*/
const RGBtoHEX = (color: ColorRGB): string => {
const hexMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E"];
const hexMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
let hexValue = "#";

let divisionNumber = color.r / 16;
Expand Down
112 changes: 112 additions & 0 deletions packages/base/src/util/SelectionAssistant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import getEffectiveScrollbarStyle from "../util/getEffectiveScrollbarStyle.js";

const copyAndApplyStyles = (element: HTMLElement, copiedElement: HTMLElement) => {
const computedStyles = getComputedStyle(element);

for (let i = 0; i < computedStyles.length; i++) {
const propertyName = computedStyles[i];
copiedElement.style.setProperty(propertyName, computedStyles.getPropertyValue(propertyName));
}

element.tagName === "INPUT" && setInputSpecificStyles(copiedElement);

copiedElement.style.position = "absolute";
copiedElement.style.left = `${element.getBoundingClientRect().left}px`;
copiedElement.style.top = `${element.getBoundingClientRect().top}px`;

setUnInteractableStyles(copiedElement);

document.body.appendChild(copiedElement);
};

const setUnInteractableStyles = (element: HTMLElement) => {
element.style.position = "absolute";
element.style.userSelect = "none";
element.style.pointerEvents = "none";
element.style.zIndex = "-1";
element.style.opacity = "0";
};

const setInputSpecificStyles = (element: HTMLElement) => {
element.style.whiteSpace = "nowrap";
element.style.overflowX = "auto";
element.style.overflowY = "hidden";
};

const applyScrollStylings = () => {
const sheet = new CSSStyleSheet();
const styles = getEffectiveScrollbarStyle();

sheet.replaceSync(styles);

document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
};

const createCopy = () => {
const copiedElement = document.createElement("div");

copiedElement.id = "ui5-selection-mirror";
copiedElement.contentEditable = "true";

applyScrollStylings();

document.body.appendChild(copiedElement);
};

const applyScrollPosition = (element: HTMLElement, copiedElement: HTMLElement) => {
copiedElement.scrollTop = element.scrollTop;
copiedElement.scrollLeft = element.scrollLeft;
};

const getSelectionCoordinates = (element: HTMLInputElement | HTMLTextAreaElement, mirror: HTMLDivElement) => {
const { selectionStart, selectionEnd } = element;
const selectedText = element.value.slice(
selectionStart!,
element.selectionEnd!,
);
const range = document.createRange();

range.setStart(mirror.firstChild!, selectionEnd! - 1);
range.setEnd(mirror.firstChild!, selectionEnd!);

applyScrollPosition(element, mirror);

const rangeRect = range.getBoundingClientRect();
const rectObject = {
x: rangeRect.x,
y: rangeRect.y,
width: rangeRect.width,
height: rangeRect.height,
top: rangeRect.top,
right: rangeRect.right,
bottom: rangeRect.bottom,
left: rangeRect.left,
};

document.body.removeChild(mirror);

return { ...rectObject, selectedText };
};

const getElementSelection = (element: HTMLElement) => {
const innerElement = element.shadowRoot!.querySelector("textarea")
|| element.shadowRoot!.querySelector("input");

if (!document.getElementById("ui5-selection-mirror")) {
createCopy();
}

const copiedElement = document.getElementById(
"ui5-selection-mirror",
)!;

copiedElement.textContent = innerElement!.value;

if (innerElement) {
copyAndApplyStyles(innerElement, copiedElement)!;
}

return getSelectionCoordinates(innerElement!, copiedElement as HTMLDivElement);
};

export default getElementSelection;
8 changes: 8 additions & 0 deletions packages/compat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.3.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.1...v2.3.0-rc.2) (2024-09-19)

**Note:** Version bump only for package @ui5/webcomponents-compat





# [2.3.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v2.3.0-rc.0...v2.3.0-rc.1) (2024-09-12)


Expand Down
14 changes: 7 additions & 7 deletions packages/compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui5/webcomponents-compat",
"version": "2.3.0-rc.1",
"version": "2.3.0-rc.2",
"description": "UI5 Web Components: webcomponents.compat",
"ui5": {
"webComponentsPackage": true
Expand Down Expand Up @@ -45,13 +45,13 @@
"directory": "packages/compat"
},
"dependencies": {
"@ui5/webcomponents": "2.3.0-rc.1",
"@ui5/webcomponents-base": "2.3.0-rc.1",
"@ui5/webcomponents-icons": "2.3.0-rc.1",
"@ui5/webcomponents-theming": "2.3.0-rc.1"
"@ui5/webcomponents": "2.3.0-rc.2",
"@ui5/webcomponents-base": "2.3.0-rc.2",
"@ui5/webcomponents-icons": "2.3.0-rc.2",
"@ui5/webcomponents-theming": "2.3.0-rc.2"
},
"devDependencies": {
"@ui5/webcomponents-tools": "2.3.0-rc.1",
"chromedriver": "^127.0.3"
"@ui5/webcomponents-tools": "2.3.0-rc.2",
"chromedriver": "^128.0.3"
}
}
Loading
Loading