{"_id":"@deot/helper-dom","_rev":"6-c9643397176ad8f49d21e95253171469","name":"@deot/helper-dom","dist-tags":{"latest":"1.1.5"},"versions":{"1.0.1":{"name":"@deot/helper-dom","version":"1.0.1","license":"MIT","_id":"@deot/helper-dom@1.0.1","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"dist":{"shasum":"54ea1bb74f1db8f2b9dd12836293a5518a7bebf3","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.0.1.tgz","fileCount":7,"integrity":"sha512-AJKGrIu9xn67jiC0EiSQH9QKr2JPa0x/124gPfFKeaRcNASKCAtkJinjXy157DT6XzDW8wUGnvEElaHVb476nQ==","signatures":[{"sig":"MEUCIQCZF8WHimYMvSU18vEUC29I1Q9epF7Sx/UdAPOwnFzPIQIgL2CiPeXqh3UI4jwdEYo9Pt6zEuSGyzv/J5hOlAcKKQs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31187},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.es.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.cjs.js"}},"gitHead":"1715846b4800a29e490550d12e2bc12daac1361e","_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"_npmVersion":"9.5.1","description":"考虑到`tree-shaking`, 不支持链式调用","directories":{},"_nodeVersion":"18.16.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/helper-dom_1.0.1_1689263259778_0.8567565390071912","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@deot/helper-dom","version":"1.1.0","license":"MIT","_id":"@deot/helper-dom@1.1.0","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"dist":{"shasum":"8e3641310c4bbe15484cf3cae7f5530279ce696f","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.1.0.tgz","fileCount":7,"integrity":"sha512-+eqnceknMA9fWkMeZI4ANV0GxsoG/ipN4vx4njyjD4sk2q2yIdzlUisrPn+PBXav9JYqN632+ujmJJgkB89O2g==","signatures":[{"sig":"MEUCIQCEtRm7vT6QZ0e6JhVH/zFnFxtdpJ9YX8nPvne14RxIZgIgNgSVJ3wpDDgdLacjDLQsySLzDB+lfYnfldb3y9d9y4Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31174},"main":"dist/index.es.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.cjs.js"}},"gitHead":"aa9e40ce9edfdf36ab99d6a77571d691acaf03f9","_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"_npmVersion":"9.8.0","description":"考虑到`tree-shaking`, 不支持链式调用","directories":{},"_nodeVersion":"20.5.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/helper-dom_1.1.0_1692857145377_0.5539460654049297","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@deot/helper-dom","version":"1.1.1","license":"MIT","_id":"@deot/helper-dom@1.1.1","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"dist":{"shasum":"af8fa16b9e196e98f041778fa55b405871079b62","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.1.1.tgz","fileCount":7,"integrity":"sha512-f8RqHY/bI2DHjWuvJcO/y7SIUIt0g4X/IgxoSJvRuL7BzmgqCtRX2QwPjKmTs9vd8dzRNI8XSu0I+4AHCjfUyw==","signatures":[{"sig":"MEUCIFR3EzkOFgyuQRi3tmEMIGQzyADtM01hyfvFBGPOqtN/AiEAkJj0lhJMgxY3AskJWKf2cacuaGDYQRafR839r7PKU0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31171},"main":"dist/index.es.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.es.js","require":"./dist/index.cjs"}},"gitHead":"cb85757afa34ff538c72073a6799f866fc40509c","_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"_npmVersion":"9.8.0","description":"考虑到`tree-shaking`, 不支持链式调用","directories":{},"_nodeVersion":"20.5.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/helper-dom_1.1.1_1692930946997_0.47179211756041894","host":"s3://npm-registry-packages"}},"1.1.3":{"name":"@deot/helper-dom","version":"1.1.3","license":"MIT","_id":"@deot/helper-dom@1.1.3","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"dist":{"shasum":"0b8947841f4b985ec08e91ad3f835c50e9aa7532","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.1.3.tgz","fileCount":7,"integrity":"sha512-Zze1dKC9Nzwg/LLx5lrYZdf7tUz0qrjb5sd7kaJnFca/Z4aVFGHgXh59YXRM55fG0Sd9YnuD6gRjeA/hTUsXIA==","signatures":[{"sig":"MEUCIQDIqNbvfiXK9wS6QK6Ipd0mAsa/8TIaMyohR45bKWP3zgIgQB3VQsy0Za5MWJRUzYdrOUxQ3HSw1ipUBlnQbcE1Frk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31141},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"980a65f7e7e40322974c1719f22e4011687b78c1","_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"_npmVersion":"10.2.3","description":"考虑到`tree-shaking`, 不支持链式调用","directories":{},"_nodeVersion":"21.2.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/helper-dom_1.1.3_1700642947684_0.4444495368956256","host":"s3://npm-registry-packages"}},"1.1.4":{"name":"@deot/helper-dom","version":"1.1.4","license":"MIT","_id":"@deot/helper-dom@1.1.4","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"dist":{"shasum":"be048e3cf156a6ce9f9fdbafa99c67f3c873719a","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.1.4.tgz","fileCount":7,"integrity":"sha512-v1B4/lXnhl5iOqPR8bKPV9l7VqOOSVgF/cndji3TLcXMLa5BsZQnLi2vCoxoomBFCWcbJp7FAPDTUi42SzjHMQ==","signatures":[{"sig":"MEQCIFSDo9E6bX8f/O7G8QkxGjLgyOeuf+E2nqCvyFz1DiebAiBjiJRVZm7PC3LZYxF45jNXdx/ZFxRxr5VHphp00B2Jtg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31448},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"4ab42dc7b4a76bf9c355c98aa26492306011c375","_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"_npmVersion":"11.6.0","description":"考虑到`tree-shaking`, 不支持链式调用","directories":{},"_nodeVersion":"24.9.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/helper-dom_1.1.4_1759911216063_0.7217714555481263","host":"s3://npm-registry-packages-npm-production"}},"1.1.5":{"name":"@deot/helper-dom","version":"1.1.5","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"license":"MIT","publishConfig":{"access":"public"},"gitHead":"07a3aa182caa229bead57866d25e88683d7abcfc","_id":"@deot/helper-dom@1.1.5","description":"考虑到`tree-shaking`, 不支持链式调用","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-C/Ph4L13cF0Uf0FF4I1lJEehsBe/bJydM90VxleOpByiiF6vz6ZursoNA948oSq4iCuuu5LFm28AmRZSaHEmrw==","shasum":"d72c5c26f5115001e14ef4a83f73f09a0c486646","tarball":"https://registry.npmjs.org/@deot/helper-dom/-/helper-dom-1.1.5.tgz","fileCount":7,"unpackedSize":34533,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCID1ZNY1RwtJxiP4lgc6fdTs8hxdFB5yInvVVZdGgTknzAiBHFJ9q3OasZODPqau7XlVXXmeXWglOcIHJCnJzGcTwAg=="}]},"_npmUser":{"name":"deot","email":"zrd0921@qq.com"},"directories":{},"maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/helper-dom_1.1.5_1775549760398_0.5867892135171695"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-13T15:47:39.721Z","modified":"2026-04-07T08:16:00.666Z","1.0.1":"2023-07-13T15:47:39.971Z","1.1.0":"2023-08-24T06:05:45.631Z","1.1.1":"2023-08-25T02:35:47.255Z","1.1.3":"2023-11-22T08:49:07.848Z","1.1.4":"2025-10-08T08:13:36.268Z","1.1.5":"2026-04-07T08:16:00.547Z"},"license":"MIT","description":"考虑到`tree-shaking`, 不支持链式调用","maintainers":[{"name":"deot","email":"zrd0921@qq.com"}],"readme":"# @deot/helper-dom\n\n考虑到`tree-shaking`, 不支持链式调用\n\n### `DOM/$` \n\n\n```js\nimport * as $ from '@deot/helper-dom';\n```\n\n```js\n// or\nimport { $, DOM } from '@deot/helper';\n```\n\n---\n\n#### `prefixStyle`\n\n`prefixStyle(key: string)`\n\n样式兼容前缀\n\n+ **key**: 样式的名字\n\n**示例**\n```javascript\nprefixStyle('transform');\n```\n\n---\n\n#### `composedPath`\n\n`$.composedPath(event: object)`\n\ne.taget父层相关path兼容\n\n+ **event**: 当前触发的事件\n\n**示例**\n```javascript\ncomposedPath(event);\n```\n\n---\n\n#### `on`\n\n`on(el: string | object, eventName: string, handler: Function)`\n\n注册当前事件\n\n+ **event**: 当前触发的事件\n\n**示例**\n```javascript\nlet off = on(el, 'click', handler);\noff();\n```\n\n---\n\n#### `off`\n\n`off(el: string | object, eventName: string, handler: Function)`\n\n卸载当前事件\n\n+ **event**: 当前触发的事件\n\n**示例**\n```javascript\noff(el, 'click', handler);\n```\n\n---\n\n#### `once`\n\n`once(el: string | object, eventName: string, handler: Function)`\n\n一次执行当前事件\n\n+ **event**: 当前触发的事件\n\n**示例**\n```javascript\nonce(el, 'click', handler);\n```\n\n---\n\n#### `addClass`\n\n`addClass(el: string | object, className: string)`\n\n添加样式\n\n+ **className**: 样式名\n\n**示例**\n```javascript\naddClass(el, 'g-fs-12');\n```\n\n---\n\n#### `removeClass`\n\n`removeClass(el: string | object, className: string)`\n\n移除样式\n\n+ **className**: 样式名\n\n**示例**\n```javascript\nremoveClass(el, 'g-fs-12');\n```\n\n---\n\n#### `hasClass`\n\n`hasClass(el: string | object, className: string)`\n\n是否包含当前样式\n\n+ **className**: 样式名\n\n**示例**\n```javascript\nhasClass(el, 'g-fs-12');\n```\n\n---\n\n#### `getStyle`\n\n`getStyle(el: string | object, key: string)`\n\n计算当前元素的样式对应的值（计算属性，css/style）\n\n+ **key**: 样式的名字\n\n**示例**\n```javascript\ngetStyle(el, 'height');\n```\n\n---\n\n#### `setStyle`\n\n`setStyle(el: string | object, key: string)`\n\n设置样式\n\n+ **key**: 样式的名字\n\n**示例**\n```javascript\nsetStyle(el, 'height', '100px');\n```\n\n\n---\n\n#### `isScroll`\n\n`isScroll(el: string | object, vertical: boolean)`\n\n是否含有滚动条\n\n+ **vertical**: 是否垂直方向\n\n**示例**\n```javascript\nisScroll(el);\n```\n\n---\n\n#### `getScroller`\n\n`getScroller(el: string | object, vertical: boolean)`\n\n获取最近的滚动条元素\n\n**示例**\n```javascript\ngetScroller(el);\n```\n\n---\n\n#### `contains`\n\n`contains(el: string | object, children: object)`\n\n父层是否包含子层（计算的是x,y,w,h）\n\n+ **children**: 子元素\n\n**示例**\n```javascript\ncontains(el, children);\n```\n\n\n---\n\n#### `scrollIntoView`\n\n`scrollIntoView(el: string | object, options: object)`\n\n父层是否包含子层（计算的是x,y,w,h）\n\n+ **options**: 可配置参数\n\n*options:* 规则:\n+ **from**: *number* 开始\n+ **to**: *number* 结束\n+ **duration**: *number* 持续时间\n+ **scroller**: *object* 滚动条\n\n**示例**\n```javascript\nscrollIntoView(el, { });\n```\n\n","readmeFilename":"README.md"}