{"name":"dom-align","description":"Align DOM Node Flexibly ","version":"1.11.0","license":"MIT","pika":true,"sideEffects":false,"keywords":["dom","align"],"homepage":"http://github.com/yiminghe/dom-align","bugs":{"url":"http://github.com/yiminghe/dom-align/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/yiminghe/dom-align.git"},"dependencies":{},"devDependencies":{"@pika/plugin-build-node":"^0.6.0","@pika/plugin-build-types":"^0.6.0","@pika/plugin-standard-pkg":"^0.6.0","@pika/types":"^0.6.0","babel-preset-env":"^1.7.0","create-react-class":"^15.6.3","expect.js":"^0.3.1","jquery":"^3.4.1","lint-staged":"^9.2.1","pika-plugin-build-web-babel":"^0.6.0","pika-plugin-clean-dist-src":"^0.1.1","pre-commit":"1.x","prettier":"^1.18.2","rc-test":"6.x","rc-tools":"6.x","react":"16.x","react-dom":"16.x"},"module":"dist-web/index.js","main":"dist-node/index.js","types":"dist-types/index.d.ts","_id":"dom-align@1.11.0","_nodeVersion":"10.15.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-c5xlri+XyxfgIGjJfayVIXo6j8aYh1jMlNlONh1UPTeGMW8T2kRVDcJMm2SryyPQ9i6FtjWyEnpDxT9SENXZBQ==","shasum":"209c6f50bf8140b89311574389e5cf9283a0c0c0","tarball":"http://registry-npm.ywwl.com/dom-align/download/dom-align-1.11.0.tgz","fileCount":8,"unpackedSize":240933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJea4kjCRA9TVsSAnZWagAA//kQAI8qmRc5wmKNCus/z3tO\nc3MBm/Jmuj4MRwg3l0b5j+IxbzpYE9c3z8Sf2v1JHlY29laJWb2a81CwOay6\nCKNVNhQ/YMYh6U4w8HRw9o2+6g9rMHDV4Bvj05UOCIijRem9c6WxtapOKSWw\ncqckJi7UmulyR+Ug2vKeDXvXdIbVu5AKXElYS1LRGP7J86UtTHwjxaCdKejj\nOHlL2FX5yWPVm6kr6tQq3eaoStq1wFxuYAKoSEOLlxDQuQc0yBoNwKPAxcUW\napQc2lKChXnZIz6q028ACmQ5aa5HNk8LHGUf7+j6WcSaHBGHEqAZSN2ge7y7\nDLbHoriLbDkDKh0kZSRDfu21CZ7njgrWIY2o41Gra/q3gWP0g+LYAiV5ssXk\nNYWkqIyQb9pE++0V5/h2EIxNtSwb8dp402CR+FhalKiSBORgIFGOUIpmKXZV\nmao53htbseKhQ1TACucP0UUbhtCICy0Syxo9FbNUYDwz7+u0Kb62b0A7WvHf\nt0iI3GOm5SPcjaLEGynFBQe9uVfB1MCieXrIekoCzEA485yHRgE/+/3ngj13\n5qDKvEE+bjLpC+JPezQOOjDtgZQk1rTQF5rN1VkJY9jPcmMCqBz2NxFGBz9r\nD3qBEDPmReChvFUt/qSZqvA+HTssfaAloHshk8Fn5NxX18ENBvEjwmc+XQNa\nSphI\r\n=XCBe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFvU63NfKoXFsy2cNyEOQy3P0JMJ1/VPgoiSFxxdqG+NAiEAyhdNlgtNZhE0NFG2Iq/xvxKgJFVu6PsvP2zVOYebAI8="}],"size":72129,"noattachment":false,"key":"/dom-align/-/dom-align-1.11.0.tgz"},"maintainers":[{"email":"afc163@gmail.com","name":"afc163"},{"email":"benjytrys@gmail.com","name":"benjycui"},{"email":"yiminghe@gmail.com","name":"yiminghe"},{"email":"smith3816@gmail.com","name":"zombiej"}],"_npmUser":{"name":"yiminghe","email":"yiminghe@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dom-align_1.11.0_1584105762814_0.1174683298031951"},"_hasShrinkwrap":false,"readme":"# dom-align\n---\n\nalign source html element with target html element flexibly.\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][coveralls-image]][coveralls-url]\n[![gemnasium deps][gemnasium-image]][gemnasium-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: http://img.shields.io/npm/v/dom-align.svg?style=flat-square\n[npm-url]: http://npmjs.org/package/dom-align\n[travis-image]: https://img.shields.io/travis/yiminghe/dom-align.svg?style=flat-square\n[travis-url]: https://travis-ci.org/yiminghe/dom-align\n[coveralls-image]: https://img.shields.io/coveralls/yiminghe/dom-align.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/yiminghe/dom-align?branch=master\n[gemnasium-image]: http://img.shields.io/gemnasium/yiminghe/dom-align.svg?style=flat-square\n[gemnasium-url]: https://gemnasium.com/yiminghe/dom-align\n[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square\n[node-url]: http://nodejs.org/download/\n[download-image]: https://img.shields.io/npm/dm/dom-align.svg?style=flat-square\n[download-url]: https://npmjs.org/package/dom-align\n\n## Screenshot\n\n<img height=444 src=\"http://gtms02.alicdn.com/tps/i2/TB1XIp2HXXXXXajaXXXgJfr8XXX-548-888.png\">\n\n## Install\n\n[![dom-align](https://nodei.co/npm/dom-align.png)](https://npmjs.org/package/dom-align)\n\n## Feature\n\n* support IE9+ chrome firefox\n* support align points and offset\n* support auto adjust according to visible area\n\n## Online Demo\n\n* http://yiminghe.github.io/dom-align/\n\n## Usage\n\n```js\nimport domAlign from 'dom-align';\n\n// use domAlign\n// sourceNode's initial style should be position:absolute;left:-9999px;top:-9999px;\n\nconst alignConfig = {\n  points: ['tl', 'tr'],        // align top left point of sourceNode with top right point of targetNode\n  offset: [10, 20],            // the offset sourceNode by 10px in x and 20px in y,\n  targetOffset: ['30%','40%'], // the offset targetNode by 30% of targetNode width in x and 40% of targetNode height in y,\n  overflow: { adjustX: true, adjustY: true }, // auto adjust position when sourceNode is overflowed\n};\n\ndomAlign(sourceNode, targetNode, alignConfig);\n```\n\n## API\n\n### void domAlign(source: HTMLElement, target: HTMLElement, alignConfig: Object):Function\n\n#### alignConfig object details\n\n<table class=\"table table-bordered table-striped\">\n    <thead>\n    <tr>\n        <th style=\"width: 100px;\">name</th>\n        <th style=\"width: 50px;\">type</th>\n        <th>description</th>\n    </tr>\n    </thead>\n    <tbody>\n      <tr>\n          <td>points</td>\n          <td>String[2]</td>\n          <td>move point of source node to align with point of target node, such as ['tr','cc'],\n          align top right point of source node with center point of target node.\n          point can be 't'(top), 'b'(bottom), 'c'(center), 'l'(left), 'r'(right)\n      </td>\n      </tr>\n      <tr>\n          <td>offset</td>\n          <td>Number[2]</td>\n          <td>offset source node by offset[0] in x and offset[1] in y. \n          If offset contains percentage string value, it is relative to sourceNode region.</td>\n      </tr>\n      <tr>\n          <td>targetOffset</td>\n          <td>Number[2]</td>\n          <td>offset target node by offset[0] in x and offset[1] in y. \n          If targetOffset contains percentage string value, it is relative to targetNode region.</td>\n      </tr>\n      <tr>\n          <td>overflow</td>\n          <td>Object: `{ adjustX: boolean, adjustY: boolean, alwaysByViewport:boolean }`</td>\n          <td>\n          if adjustX field is true, then will adjust source node in x direction if source node is invisible.\n          if adjustY field is true, then will adjust source node in y direction if source node is invisible.\n          if alwaysByViewport is true, the it will adjust if node is not inside viewport\n          </td>\n      </tr>\n      <tr>\n          <td>useCssRight</td>\n          <td>Boolean</td>\n          <td>whether use css right instead of left to position</td>\n      </tr>\n      <tr>\n          <td>useCssBottom</td>\n          <td>Boolean</td>\n          <td>whether use css bottom instead of top to position</td>\n      </tr>\n      <tr>\n          <td>useCssTransform</td>\n          <td>Boolean</td>\n          <td>whether use css transform instead of left/top/right/bottom to position if browser supports.\n          Defaults to false.</td>\n      </tr>\n    </tbody>\n</table>\n\n## Development\n\n```\nnpm install\nnpm start\n```\n\n## Example\n\nhttp://localhost:8020/examples/\n\n## Test Case\n\n```\nnpm test\nnpm run chrome-test\n```\n\n## Coverage\n\n```\nnpm run coverage\n```\n\nopen coverage/ dir\n\n\n## License\n\ndom-align is released under the MIT license.\n","publish_time":1584105762926,"_cnpm_publish_time":1584105762926,"dist-tags":{"latest":"1.12.4"}}