How to use the @ui5/webcomponents-base/src/Configuration.js.getRTL function in @ui5/webcomponents-base

To help you get started, we’ve selected a few @ui5/webcomponents-base examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-webcomponents / packages / main / src / ShellBar.js View on Github external
_handleActionsOverflow() {
		const rightContainerRect = this.shadowRoot.querySelector(".sapWCShellBarOverflowContainerRight").getBoundingClientRect();
		const icons = this.shadowRoot.querySelectorAll(".sapWCShellBarIconButton:not(.sapWCShellBarOverflowIcon):not(.sapWCShellBarUnsetIcon)");
		const isRTL = getRTL();

		let overflowCount = [].filter.call(icons, icon => {
			const iconRect = icon.getBoundingClientRect();

			if (isRTL) {
				return (iconRect.left + iconRect.width) > (rightContainerRect.left + rightContainerRect.width);
			}

			return iconRect.left < rightContainerRect.left;
		});

		overflowCount = overflowCount.length;

		const items = this._getAllItems(!!overflowCount);

		items.map(item => {
github SAP / ui5-webcomponents / packages / main / src / ShellBar.js View on Github external
_handleSearchIconPress(event) {
		const searchField = this.shadowRoot.querySelector(`#${this._id}-searchfield-wrapper`);
		const triggeredByOverflow = event.target.tagName.toLowerCase() === "ui5-li";
		const overflowButton = this.shadowRoot.querySelector(".sapWCShellBarOverflowIcon");
		const overflowButtonRect = overflowButton.getBoundingClientRect();
		const isRTL = getRTL();
		let right = "";

		if (isRTL) {
			right = `${(triggeredByOverflow ? overflowButton.offsetLeft : event.target.offsetLeft) + overflowButtonRect.width}px`;
		} else {
			right = `calc(100% - ${triggeredByOverflow ? overflowButton.offsetLeft : event.target.offsetLeft}px)`;
		}

		this._searchField = Object.assign({}, this._searchField, {
			"right": right,
		});

		this._showBlockLayer = true;

		setTimeout(() => {
			const inputSlot = searchField.children[0];
github SAP / ui5-webcomponents / packages / main / src / ShellBarTemplateContext.js View on Github external
static calculate(state) {
		const hiddenIcons = state._itemsInfo.filter(info => {
			const isHidden = (info.classes.indexOf("sapWCShellBarHiddenIcon") !== -1);
			const isSet = info.classes.indexOf("sapWCShellBarUnsetIcon") === -1;
			const isOverflowIcon = info.classes.indexOf("sapWCShellBarOverflowIcon") !== -1;

			return isHidden && isSet && !isOverflowIcon;
		});

		const isRTL = getRTL();
		const interactiveLogo = state._breakpointSize === "S";

		return {
			ctr: state,
			_hiddenIcons: hiddenIcons,
			popoverHorizontalAlign: isRTL ? "Left" : "Right",
			interactiveLogo,
			showArrowDown: state.primaryTitle || (state.logo && interactiveLogo),
			styles: {
				searchField: {
					[isRTL ? "left" : "right"]: state._searchField.right,
					"top": `${parseInt(state._searchField.top)}px`,
				},
			},
			classes: {
				wrapper: {
github SAP / ui5-webcomponents / packages / main / src / ShellBar.js View on Github external
get popoverHorizontalAlign() {
		return getRTL() ? "Left" : "Right";
	}
github SAP / ui5-webcomponents / packages / main / src / ShellBar.js View on Github external
get styles() {
		return {
			searchField: {
				[getRTL() ? "left" : "right"]: this._searchField.right,
				"top": `${parseInt(this._searchField.top)}px`,
			},
		};
	}

@ui5/webcomponents-base

UI5 Web Components: webcomponents.base

Apache-2.0
Latest version published 5 days ago

Package Health Score

90 / 100
Full package analysis