Shared:Utils: fix export
This commit is contained in:
parent
cd98b2e79a
commit
2cca1a76e6
@ -14,7 +14,7 @@ export default class DomHelpers {
|
||||
return { width: w, height: h };
|
||||
}
|
||||
|
||||
static getOffset(el: HTMLElement) {
|
||||
static getOffset(el?: HTMLElement | null) {
|
||||
if (el) {
|
||||
const rect = el.getBoundingClientRect();
|
||||
|
||||
@ -40,7 +40,7 @@ export default class DomHelpers {
|
||||
};
|
||||
}
|
||||
|
||||
static getOuterWidth(el: HTMLElement, margin: string) {
|
||||
static getOuterWidth(el: HTMLElement, margin?: string) {
|
||||
if (el) {
|
||||
let width = el.offsetWidth;
|
||||
|
||||
@ -54,7 +54,7 @@ export default class DomHelpers {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static getHiddenElementOuterWidth(element: HTMLElement) {
|
||||
static getHiddenElementOuterWidth(element: HTMLElement | null) {
|
||||
if (element) {
|
||||
element.style.visibility = "hidden";
|
||||
element.style.display = "block";
|
||||
@ -67,7 +67,7 @@ export default class DomHelpers {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static getHiddenElementOuterHeight(element: HTMLElement) {
|
||||
static getHiddenElementOuterHeight(element: HTMLElement | null) {
|
||||
if (element) {
|
||||
element.style.visibility = "hidden";
|
||||
element.style.display = "block";
|
||||
@ -80,7 +80,7 @@ export default class DomHelpers {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static calculateScrollbarWidth(el: HTMLElement) {
|
||||
static calculateScrollbarWidth(el?: HTMLElement) {
|
||||
if (el) {
|
||||
const style = getComputedStyle(el);
|
||||
return (
|
||||
|
@ -9,16 +9,17 @@ import {
|
||||
getCorrectFourValuesStyle,
|
||||
} from "./rtlUtils";
|
||||
import * as useClickOutside from "./useClickOutside";
|
||||
import * as trimSeparator from "./trimSeparator";
|
||||
import { trimSeparator } from "./trimSeparator";
|
||||
import * as getCorrectDate from "./getCorrectDate";
|
||||
import { handleAnyClick } from "./event";
|
||||
import * as DomHelpers from "./domHelpers";
|
||||
import * as ObjectUtils from "./objectUtils";
|
||||
import DomHelpers from "./domHelpers";
|
||||
import ObjectUtils from "./objectUtils";
|
||||
import {
|
||||
size,
|
||||
mobile,
|
||||
mobileMore,
|
||||
tablet,
|
||||
desktop,
|
||||
transitionalScreenSize,
|
||||
isMobile,
|
||||
isTablet,
|
||||
@ -33,6 +34,7 @@ import { classNames } from "./classNames";
|
||||
import { getBannerAttribute, getLanguage } from "./banner";
|
||||
|
||||
export {
|
||||
desktop,
|
||||
checkIsSSR,
|
||||
getLanguage,
|
||||
isArrayEqual,
|
||||
|
@ -42,7 +42,7 @@ export const getCorrectFourValuesStyle = (
|
||||
/* Returns correct border-radius value depending on interface direction (ltr/rtl) */
|
||||
export const getCorrectBorderRadius = (
|
||||
borderRadiusStr: string,
|
||||
interfaceDirection: TInterfaceDirection,
|
||||
interfaceDirection: TInterfaceDirection | string,
|
||||
) => {
|
||||
if (interfaceDirection === "ltr") return borderRadiusStr;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ContextMenuModel } from "../components/context-menu";
|
||||
import type { ContextMenuModel } from "../components";
|
||||
|
||||
export function trimSeparator(array: ContextMenuModel[]) {
|
||||
if (!array || !Array.isArray(array) || array.length === 0) return array;
|
||||
|
Loading…
Reference in New Issue
Block a user