{"_id":"attrs-observe","_rev":"5-7786f1c2c2e4e48520af8a97f7eb2b4e","name":"attrs-observe","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.0":{"name":"attrs-observe","version":"0.0.0","description":"Observe presence of list of attributes","repository":{"type":"git","url":"https://github.com/bahrus/attrs-observe"},"author":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"license":"MIT","main":"attrs-observe.js","dependencies":{"xtal-latx":"0.0.17"},"devDependencies":{"@polymer/polymer":"^3.0.0","@polymer/iron-demo-helpers":"^3.0.0-pre.19","@webcomponents/webcomponentsjs":"^2.0.0","wct-browser-legacy":"^1.0.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Bruce B. Anderson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"attrs-observe@0.0.0","dist":{"shasum":"cada24e5c94e7a42d02574bffe0e7bf570189111","tarball":"https://registry.npmjs.org/attrs-observe/-/attrs-observe-0.0.0.tgz","fileCount":18,"unpackedSize":30022,"integrity":"sha512-OTbDbBCHF3ma6q4zUACcFJhbejl4LExnPgJDMj2pQ7UVf8Cmb21HFLnVYJns2N05gVE0wmF6VpGIpfIr053TjA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyemPIgQr3t0hnX3smLb7zT8YN0qrFhP/Ne4nkfeqrUQIhAPxwHywkD3eMfJXiinLYsYfqa6RD/8jXwvqx1mokOs2K"}]},"maintainers":[{"name":"bahrus","email":"anderson.bruce.b@gmail.com"}],"_npmUser":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attrs-observe_0.0.0_1532082574518_0.9971805160890448"},"_hasShrinkwrap":false},"0.0.2":{"name":"attrs-observe","version":"0.0.2","description":"Observe presence of list of attributes","repository":{"type":"git","url":"https://github.com/bahrus/attrs-observe"},"author":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"license":"MIT","main":"attrs-observe.js","dependencies":{"xtal-latx":"0.0.17"},"devDependencies":{"@polymer/polymer":"^3.0.0","@polymer/iron-demo-helpers":"^3.0.0-pre.19","@webcomponents/webcomponentsjs":"^2.0.0","wct-browser-legacy":"^1.0.0","jiife":"^0.0.3"},"licenseText":"MIT License\n\nCopyright (c) 2018 Bruce B. Anderson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"attrs-observe@0.0.2","dist":{"shasum":"8bf1abc545eb7d566dbf84c0da564415f28cd72b","tarball":"https://registry.npmjs.org/attrs-observe/-/attrs-observe-0.0.2.tgz","fileCount":36,"unpackedSize":108537,"integrity":"sha512-Kkrowr11zaGXomvp1k3X8Zb8foSD/uCIk6TWhOLv0b91Q0i5WJM1YHX4zSuLKpDpAzsCIf7W5VnkrUfH207cJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBttTm2ET1jp2jxqqgK7LnxOEPIBRyeRyYJIgpGI2DuEAiEA+pcAtJtYM7A8y3wXyv+dpT0yP40WNpjRRrbxSnifOcw="}]},"maintainers":[{"name":"bahrus","email":"anderson.bruce.b@gmail.com"}],"_npmUser":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attrs-observe_0.0.2_1532190478336_0.8645721268202906"},"_hasShrinkwrap":false},"0.0.3":{"name":"attrs-observe","version":"0.0.3","description":"Observe presence of list of attributes","repository":{"type":"git","url":"https://github.com/bahrus/attrs-observe"},"author":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"license":"MIT","main":"attrs-observe.js","dependencies":{"xtal-latx":"0.0.17"},"devDependencies":{"@polymer/polymer":"^3.0.0","@polymer/iron-demo-helpers":"^3.0.0-pre.19","@webcomponents/webcomponentsjs":"^2.0.0","wct-browser-legacy":"^1.0.0","jiife":"^0.0.3"},"licenseText":"MIT License\n\nCopyright (c) 2018 Bruce B. Anderson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"attrs-observe@0.0.3","dist":{"shasum":"eb5ddc0c5e2a2e52b1f833ac5a1274b59a20b54b","tarball":"https://registry.npmjs.org/attrs-observe/-/attrs-observe-0.0.3.tgz","fileCount":36,"unpackedSize":112107,"integrity":"sha512-6myY9buGnFZ9sM6cCZEf6DBs5XAtwEkakMwGbKxZF3mnv8/ohZPsDdSVDE4iiT/+BRv8ysc2YcDpLyVQJRUotQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxcrNSBCy6O1qJM6EfhP/Yya/5an1V3PMRryIoXJ+WMQIgJakd9HJ1W1QY5N2v/9T+TZ1/5Bg+1ud4KRSz3EMhkYc="}]},"maintainers":[{"name":"bahrus","email":"anderson.bruce.b@gmail.com"}],"_npmUser":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attrs-observe_0.0.3_1532210396517_0.9537362297268246"},"_hasShrinkwrap":false},"0.0.4":{"name":"attrs-observe","version":"0.0.4","description":"Observe presence of list of attributes","repository":{"type":"git","url":"https://github.com/bahrus/attrs-observe"},"author":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"license":"MIT","main":"attrs-observe.js","dependencies":{"xtal-latx":"0.0.17"},"devDependencies":{"@polymer/polymer":"^3.0.0","@polymer/iron-demo-helpers":"^3.0.0-pre.19","@webcomponents/webcomponentsjs":"^2.0.0","wct-browser-legacy":"^1.0.0","jiife":"^0.0.3"},"licenseText":"MIT License\n\nCopyright (c) 2018 Bruce B. Anderson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"attrs-observe@0.0.4","dist":{"shasum":"d110b9717e655805b9f34b4c677e2ec092208ebb","tarball":"https://registry.npmjs.org/attrs-observe/-/attrs-observe-0.0.4.tgz","fileCount":36,"unpackedSize":114913,"integrity":"sha512-NldpS7m9RH2Q/GL1nEANETDZqTHAe4KYI1Xe9HeCrtd4qA0vHBCUBBTTqMw4sI9Uju9aVCGISHBa2BMjzITsIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAv41xuwtX1Fl1ObfZA9eT+qkXZzM3l1kcK8GEKtIlvMAiEAlEgV4vrXbGGZAa8NjQyrVQ0IDB3L+Cozqk/nWSvknTk="}]},"maintainers":[{"name":"bahrus","email":"anderson.bruce.b@gmail.com"}],"_npmUser":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/attrs-observe_0.0.4_1532211029168_0.766365778142232"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-20T10:29:34.517Z","0.0.0":"2018-07-20T10:29:34.582Z","modified":"2022-06-13T03:43:17.433Z","0.0.2":"2018-07-21T16:27:58.499Z","0.0.3":"2018-07-21T21:59:56.658Z","0.0.4":"2018-07-21T22:10:29.249Z"},"maintainers":[{"name":"bahrus","email":"anderson.bruce.b@gmail.com"}],"description":"Observe presence of list of attributes","repository":{"type":"git","url":"https://github.com/bahrus/attrs-observe"},"author":{"name":"bahrus","email":"anderson.bruce.b@gmail.com"},"license":"MIT","readme":"# \\<attrs-observe\\>\n\nObserve and act on the presence of an attribute\n\nattrs-observe is a vanilla-ish web component whose primary purpose is to populate DOM with dynamic data.  You may be shocked to learn that this isn't the first such library that does this.  The size of this one is ~1.4kb minified and gzipped.  \n\nFrom the point of view of using what's built into the browser, as far as dynamically populating DOM from data, skipping an early Microsoft expiriment, there's:\n\n1)  [XSLT](https://www.w3schools.com/xml/xsl_intro.asp), supported by all browsers (including Chrome, Version 1!).\n2)  The slot mechanism that comes with Shadow DOM.\n3)  Hopefully soon, [template instantiation](https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Template-Instantiation.md), which would likely diminish the benifit of this web component.\n\nUnlike many existing alternatives, this one just populates an existing DOM node tree.\n\nEach time populating finishes, an event, \"nodes-populated-changed\" is emitted.\n\n## Simple data populating:\n\n```html\n<div>\nI am <span c=\"whatAmI\"></span>\n</div>\n<attrs-observe observe=\"c\" input='{\"whatAmI\": \"the walrus\"}'></attrs-observe>\n```\n\nproduces:\n\n```html\nI am <span c=\"whatAmI\">the walrus</span>\n```\n\n\n## Property setting\n\n```html\n    <div>\n        <label for=\"joker\">Don't you think the joker laughs at you</label><input id=\"joker\" type=\"checkbox\" c=\"well?\">\n    </div>\n    <attrs-observe observe=\"c\" input='{\"well?\": {\"checked\": true}}'></attrs-observe>\n```\n\nThe input attribute / property of attrs-observe does not need to be set via an inline attribute as shown in the two previous examples.  It can be set via a framework or by some other web component.\n\nIf the input property changes, it will be reapplied to all the elements with the observed attribute.\n\nproduces a checked input.\n\n##  Functional \n\n```html\n<div>\nI am the <span c=\"whatAmI\"></span>\n</div>\n<script nomodule>\n({\n    whatAmI: s =>{\n        s.style.color = 'yellow';\n        s.innerText = 'Eggman';\n    }\n})\n</script>\n<p-d-x on=\"eval\" to=\"{input.whatAmI:whatAmI\"></p-d-x>\n<attrs-observe observe=\"c\"></attrs-observe>\n```\n\nProduces  \n\n```html\n<div>\n    I am the <span c=\"whatAmI\" style=\"color: yellow;\">Eggman</span>\n</div>\n```\n\nOne can specify whether to monitor for new nodes recursively thoughout the DOM tree by specifying deeply:\n\n```html\n<attrs-observe observe=\"c\" deeply></attrs-observe>\n```\n\n## Install the Polymer-CLI\n\nFirst, make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) and npm (packaged with [Node.js](https://nodejs.org)) installed. Run `npm install` to install your element's dependencies, then run `polymer serve` to serve your element locally.\n\n## Viewing Your Element\n\n```\n$ polymer serve\n```\n\n## Running Tests\n\n```\n$ polymer test\n```\n\nYour application is already set up to be tested via [web-component-tester](https://github.com/Polymer/web-component-tester). Run `polymer test` to run your application's test suite locally.\n","readmeFilename":"README.md"}