@visactor/vutils
Advanced tools
Comparing version 0.18.2 to 0.18.3
@@ -14,1 +14,3 @@ import type { IPointLike } from './data-structure'; | ||
export declare function hasParentElement(element: HTMLElement, target: HTMLElement): boolean; | ||
export declare const styleStringToObject: (styleStr?: string) => any; | ||
export declare const lowerCamelCaseToMiddle: (str: string) => string; |
@@ -46,3 +46,3 @@ "use strict"; | ||
value: !0 | ||
}), exports.hasParentElement = exports.getScale = exports.getScaleY = exports.getScaleX = exports.getScrollTop = exports.getScrollLeft = exports.getElementRelativePosition = exports.getElementAbsolutePosition = exports.getContainerSize = void 0, | ||
}), exports.lowerCamelCaseToMiddle = exports.styleStringToObject = exports.hasParentElement = exports.getScale = exports.getScaleY = exports.getScaleX = exports.getScrollTop = exports.getScrollLeft = exports.getElementRelativePosition = exports.getElementAbsolutePosition = exports.getContainerSize = void 0, | ||
exports.getContainerSize = getContainerSize, exports.getElementAbsolutePosition = getElementAbsolutePosition, | ||
@@ -86,2 +86,21 @@ exports.getElementRelativePosition = getElementRelativePosition; | ||
exports.getScale = getScale, exports.hasParentElement = hasParentElement; | ||
const styleStringToObject = (styleStr = "") => { | ||
const res = {}; | ||
return styleStr.split(";").forEach((item => { | ||
if (item) { | ||
const arr = item.split(":"); | ||
if (2 === arr.length) { | ||
const key = arr[0].trim(), value = arr[1].trim(); | ||
key && value && (res[key] = value); | ||
} | ||
} | ||
})), res; | ||
}; | ||
exports.styleStringToObject = styleStringToObject; | ||
const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase(); | ||
exports.lowerCamelCaseToMiddle = lowerCamelCaseToMiddle; | ||
//# sourceMappingURL=dom.js.map |
@@ -6,1 +6,2 @@ export * from './image'; | ||
export * from './text'; | ||
export * from './bounds-util'; |
@@ -22,3 +22,3 @@ "use strict"; | ||
__exportStar(require("./graph-util"), exports), __exportStar(require("./polygon"), exports), | ||
__exportStar(require("./text"), exports); | ||
__exportStar(require("./text"), exports), __exportStar(require("./bounds-util"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -14,1 +14,3 @@ import type { IPointLike } from './data-structure'; | ||
export declare function hasParentElement(element: HTMLElement, target: HTMLElement): boolean; | ||
export declare const styleStringToObject: (styleStr?: string) => any; | ||
export declare const lowerCamelCaseToMiddle: (str: string) => string; |
@@ -66,2 +66,17 @@ export function getContainerSize(el, defaultWidth = 0, defaultHeight = 0) { | ||
} | ||
export const styleStringToObject = (styleStr = "") => { | ||
const res = {}; | ||
return styleStr.split(";").forEach((item => { | ||
if (item) { | ||
const arr = item.split(":"); | ||
if (2 === arr.length) { | ||
const key = arr[0].trim(), value = arr[1].trim(); | ||
key && value && (res[key] = value); | ||
} | ||
} | ||
})), res; | ||
}; | ||
export const lowerCamelCaseToMiddle = str => str.replace(/([A-Z])/g, "-$1").toLowerCase(); | ||
//# sourceMappingURL=dom.js.map |
@@ -6,1 +6,2 @@ export * from './image'; | ||
export * from './text'; | ||
export * from './bounds-util'; |
@@ -10,2 +10,4 @@ export * from "./image"; | ||
export * from "./text"; | ||
export * from "./bounds-util"; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@visactor/vutils", | ||
"version": "0.18.2", | ||
"version": "0.18.3", | ||
"main": "cjs/index.js", | ||
@@ -31,5 +31,5 @@ "module": "es/index.js", | ||
"@internal/bundler": "0.0.1", | ||
"@internal/eslint-config": "0.0.1", | ||
"@internal/ts-config": "0.0.1", | ||
"@internal/jest-config": "0.0.1", | ||
"@internal/eslint-config": "0.0.1" | ||
"@internal/jest-config": "0.0.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1797471
725
17346