@pluginjs/dom
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -10,5 +10,5 @@ { | ||
"dependencies": { | ||
"@pluginjs/utils": "*" | ||
"@pluginjs/utils": "^0.2.9" | ||
}, | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A flexible modern date-picker js plugin.", | ||
@@ -15,0 +15,0 @@ "author": "Creation Studio Limited", |
@@ -58,2 +58,3 @@ import { parent } from '@pluginjs/dom/html' | ||
} | ||
// nodeTreeCheck(target).map(e => console.log(e.handler.toString())) | ||
nodeTreeCheck(target).reduce( | ||
@@ -60,0 +61,0 @@ (result, { handler }) => result !== false && handler(event), |
@@ -146,3 +146,6 @@ import { curry, compose, camelize } from '@pluginjs/utils' | ||
// 解析 HTML/SVG/XML 字符串 | ||
export const parseHTML = htmlString => { | ||
export const parseHTML = (...args) => { | ||
const htmlString = Array.isArray(args[0]) | ||
? args[0].reduce((result, str, index) => result + args[index] + str) | ||
: args[0] | ||
const childNodes = compose(children, html(htmlString))( | ||
@@ -266,2 +269,8 @@ document.createElement('div') | ||
export const wrapAll = (wrapElement, elementList) => { | ||
insertBefore(wrapElement, elementList[0]) | ||
wrapElement.append(...elementList) | ||
return wrapElement | ||
} | ||
export const unwrap = el => { | ||
@@ -305,1 +314,9 @@ const parentEl = parent(el) | ||
}) | ||
export const nextElementWith = curry((fn, el) => { | ||
const nextElement = next(el) | ||
if (fn(nextElement)) { | ||
return nextElement | ||
} | ||
return nextElementWith(fn, nextElement) | ||
}) |
@@ -60,5 +60,6 @@ import { curry } from '@pluginjs/utils' | ||
export const contentWidth = el => { | ||
const { paddingLeft, paddingRight } = window.getComputedStyle(el) | ||
const { paddingLeft, paddingRight, width } = window.getComputedStyle(el) | ||
return ( | ||
el.clientWidth - sum([paddingLeft, paddingRight].map(i => parseInt(i, 10))) | ||
parseInt(width, 10) - | ||
sum([paddingLeft, paddingRight].map(i => parseInt(i, 10))) | ||
) | ||
@@ -68,5 +69,6 @@ } | ||
export const contentHeight = el => { | ||
const { paddingTop, paddingBottom } = window.getComputedStyle(el) | ||
const { paddingTop, paddingBottom, height } = window.getComputedStyle(el) | ||
return ( | ||
el.clientHeight - sum([paddingTop, paddingBottom].map(i => parseInt(i, 10))) | ||
parseInt(height, 10) - | ||
sum([paddingTop, paddingBottom].map(i => parseInt(i, 10))) | ||
) | ||
@@ -95,3 +97,5 @@ } | ||
if (value) { | ||
const mergedStyleObj = { attr: value } | ||
const mergedStyleObj = {} | ||
mergedStyleObj[attr] = value | ||
return setStyle(mergedStyleObj, el) | ||
@@ -98,0 +102,0 @@ } else if (is.object(attr)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
23776
799
2
+ Added@pluginjs/feature@0.2.19(transitive)
+ Added@pluginjs/utils@0.2.20(transitive)
- Removed@pluginjs/is@0.8.9(transitive)
- Removed@pluginjs/utils@0.8.10(transitive)
Updated@pluginjs/utils@^0.2.9