Socket
Socket
Sign inDemoInstall

@pluginjs/dom

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/dom - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

4

package.json

@@ -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)) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc