{"_id":"@degjs/form-field-appender","_rev":"8-182a45863c056a0bfcf3e09ce1920bde","name":"@degjs/form-field-appender","dist-tags":{"latest":"2.0.0"},"versions":{"1.1.0":{"name":"@degjs/form-field-appender","version":"1.1.0","description":"A module for adding and saving an infinite number of form fields.","keywords":["form","field","DEGJS"],"author":{"name":"Aaron Ladage","email":"aladage@degdigital.com","url":"http://aaronladage.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DEGJS/formFieldAppender.git"},"bugs":{"url":"https://github.com/DEGJS/formFieldAppender/issues"},"devDependencies":{"babel-core":"^6.26.3","babel-env":"^2.4.1","es6-module-loader":"^0.17.11","grunt":"^0.4.5","grunt-contrib-copy":"~0.5.0","jest":"^23.4.1","systemjs":"^0.19.22"},"scripts":{"build-demo":"./build-demo.sh","test":"jest"},"jspm":{"registry":"jspm","format":"es6","main":"formFieldAppender.js","directories":{"lib":"src"}},"jest":{"testPathIgnorePatterns":["/node_modules/"]},"babel":{"presets":["env"]},"publishConfig":{"access":"public"},"gitHead":"d38f81f6fc7d9dacba6c1529f9aec5c79806f6dc","homepage":"https://github.com/DEGJS/formFieldAppender#readme","_id":"@degjs/form-field-appender@1.1.0","_npmVersion":"6.1.0","_nodeVersion":"10.7.0","_npmUser":{"name":"scheul93","email":"scheul93@gmail.com"},"dist":{"integrity":"sha512-s579iDgHGWtCSgvZhIOZSSjOXqvj5iwycFemj1DN5bgQNKcCxLP9QrC/D4vWXkMnYBfiDud6LVowDeI0qKB6qg==","shasum":"70f9806d5bcc2ea556ba5bed6eca40a713c88615","tarball":"https://registry.npmjs.org/@degjs/form-field-appender/-/form-field-appender-1.1.0.tgz","fileCount":15,"unpackedSize":100906,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX1OlCRA9TVsSAnZWagAAZo8P/0S03Nl/Cnz32+nY78Mo\nMh5KWofJ5YvQr8lTaTx0mcYuevujF14Z0A7gJ9WpKBlf9TQcVc8rM8KWZPqM\nZwp1qg8nIwwy4U7ZKVe/cwAnTI7CLvPPWir16/6cJJ8jOqD1Y80SEabCedd0\neHgPcfjuWnEs1lxzr+gyvoBLQJ1pkyUmWC2k0j4Jx9NJ8QulVeJAmo4StwG7\ntoWHz/HM/1cj1hg7ll0ga2I56cKCrAYoOT5tzLtfW9F0/Z9SmutREABBCpXX\nBD/C7o13P17dT7cer08NZIiVsDT4WwzZgqg9hrRR8tLc2ZgtkUpRr/kS9NKJ\nXx0wblCPMT3GeNzRMaiFYP3VXWN5Be5wYBqPIfoLdGl5zdXngh6uF/zFjayQ\nbUuWKaN4qi3YN/4WFeLcNldldBu2eUdAHUQ/Ni3vtZ7A9UAvNPYWtUIbCQeU\n3uPwoqhTji9pDtMjnmrJCrDyLQi14II+pWFR3YD+aqLlU+VP82GeloV+Mwa9\nvOwsPtUWdBchoffnaFx9QzQKMWzcR3LNvhNlyBE9QlCxlernuXJi3GcgbPqx\nzlsV3wpQVDkasYgltjo6LejFZDYjNrKTW7ChnZvlCZPXfNx872+Jb/OgI5UY\nE+Z4vdVZR5Zu0sfzT5WWpwVTEskmlpBGmEebvt6m1DcqGWnCxs5s6rMOwUzt\nGNfv\r\n=pkJe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcB7DP5T00NgNR2bSaudAI0kta4yqD1CKXWpLREVt84AiEAhTL082oR/PAj4NMrCTmwARJaJ+pSb5qrs9n2wtQSt+s="}]},"maintainers":[{"name":"aladage","email":"aladage@gmail.com"},{"name":"briangraves","email":"mail@brianleegraves.com"},{"name":"designbykhalid","email":"khalid@designbykhalid.com"},{"name":"heaper","email":"heaper@gmail.com"},{"name":"jlawhorn","email":"jlawhorn@degdigital.com"},{"name":"jsmapr1","email":"jsmapr1@gmail.com"},{"name":"scheul93","email":"scheul93@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/form-field-appender_1.1.0_1532973989426_0.6081601241355796"},"_hasShrinkwrap":false},"2.0.0":{"name":"@degjs/form-field-appender","version":"2.0.0","description":"A module for adding and saving an infinite number of form fields.","keywords":["form","field","DEGJS"],"author":{"name":"Aaron Ladage","email":"aladage@degdigital.com","url":"http://aaronladage.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/DEGJS/formFieldAppender.git"},"main":"src/formFieldAppender.js","bugs":{"url":"https://github.com/DEGJS/formFieldAppender/issues"},"devDependencies":{"babel-core":"^6.26.3","babel-env":"^2.4.1","es6-module-loader":"^0.17.11","grunt":"^0.4.5","grunt-contrib-copy":"~0.5.0","jest":"^23.4.1"},"scripts":{"build-demo":"cd demo/src && npm install && rollup --config ../rollup.config.js","deploy-demo":"./deploy-demo.sh","test":"jest"},"jest":{"testPathIgnorePatterns":["/node_modules/"]},"babel":{"presets":["env"]},"publishConfig":{"access":"public"},"dependencies":{"@degjs/dom-utils":"^3.0.0"},"gitHead":"bb031a01ad9873778f2788b21a3a86fec6645bcf","homepage":"https://github.com/DEGJS/formFieldAppender#readme","_id":"@degjs/form-field-appender@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.10.0","_npmUser":{"name":"scheul93","email":"scheul93@gmail.com"},"dist":{"integrity":"sha512-nNvnqGKGG1NcGDJcc4yMfI6EZ70yJ9Yg8sjEegoXOm7nQqOLkgIG5f/aOdj2JLI2/Q2w7P/gKRHAJZJgLg5Iiw==","shasum":"87e480b8f7f27e918ae018f40d254f0777168d44","tarball":"https://registry.npmjs.org/@degjs/form-field-appender/-/form-field-appender-2.0.0.tgz","fileCount":6,"unpackedSize":16636,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJboXHTCRA9TVsSAnZWagAAGecP/j/EgbkAHIbCeNKEGXUP\nFL42lM+eNBT13L4SUWms823g+Ug2lVj8GSebwb8sKLs5u+RLIsWINsmkojlg\n44WvZbX/16t75Y9+2Za1a2lxX3v6K3jvnsBqWZrPRR/T7/+Y8aiwCYldqlRi\nAwnzke3KjecmsZN7e0FZtBYp3q0FGDtxGQ0IFVcO+eU/fQtChzRf1h6pQzwl\nY4+GOONZBCM4nw0qSpfQ587E7SBCDREHnuz//hJ9N2ptPMlkOhVHm0rGSbpV\naiJAvVVpznE9PPzB+SAGzI9asWqnGa/iUIEGKdhLOHeKZeyt7kuUtfM1zLkr\n7LBP5DT3dM1Hir94awknzZXkH6AaJ6rairEGXhnbQNW9u7PtF6hkgrrNV3u7\nRJJaRjGL+m5fvJhg25bEd4mwM2S+AEvXB9AHb64JJqrME9wAG32sA6u4OB+k\n/OQ6QCNNo7REpav/nY0PluKXESOxnJc6NHj9Ni4C9+K7RJAfYNMuIdDYELiC\n2eF+4FYCbCGCEqCgYkmKtFQv+MOoa1QgxWFmGa7cJQrLGS3tYSGEkohJTOBv\nQu2TK7GxzWOVgTMnw/xgVO6CeKuhFvo8xxoWvulJ1R39KS5eJzxK48WG3YfV\ncXfodvmF3yZmyXxymMRpMU1J+Lx3DiTPpKXXVOfpZV+pRQclRKlH8r62jVVK\njpBw\r\n=pf9B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1pdpdn/EsKCcOv0FSedSuXzmGujyMRCBpR1m6xsObJwIgMkHiskT9g+Tt+kk/4CU/IA12LEyqCvlKx5xC6rYDYXU="}]},"maintainers":[{"email":"aladage@gmail.com","name":"aladage"},{"email":"mail@brianleegraves.com","name":"briangraves"},{"email":"khalid@designbykhalid.com","name":"designbykhalid"},{"email":"heaper@gmail.com","name":"heaper"},{"email":"jlawhorn@degdigital.com","name":"jlawhorn"},{"email":"jsmapr1@gmail.com","name":"jsmapr1"},{"email":"kgeary09@gmail.com","name":"kylegeary"},{"email":"scheul93@gmail.com","name":"scheul93"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/form-field-appender_2.0.0_1537307091146_0.0626228729829279"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-30T18:06:29.337Z","1.1.0":"2018-07-30T18:06:29.511Z","modified":"2022-04-05T03:39:27.219Z","2.0.0":"2018-09-18T21:44:51.330Z"},"maintainers":[{"email":"heaper@gmail.com","name":"heaper"},{"email":"mail@brianleegraves.com","name":"briangraves"},{"email":"aladage@gmail.com","name":"aladage"},{"email":"jlawhorn@degdigital.com","name":"jlawhorn"},{"email":"khalid@designbykhalid.com","name":"designbykhalid"},{"email":"alejcerro@gmail.com","name":"alejcerro"},{"email":"vequanclark@yahoo.com","name":"vequanc"}],"description":"A module for adding and saving an infinite number of form fields.","homepage":"https://github.com/DEGJS/formFieldAppender#readme","keywords":["form","field","DEGJS"],"repository":{"type":"git","url":"git+https://github.com/DEGJS/formFieldAppender.git"},"author":{"name":"Aaron Ladage","email":"aladage@degdigital.com","url":"http://aaronladage.com"},"bugs":{"url":"https://github.com/DEGJS/formFieldAppender/issues"},"license":"MIT","readme":"# formFieldAppender\n[![Build Status](https://travis-ci.org/DEGJS/formFieldAppender.svg?branch=master)](https://travis-ci.org/DEGJS/formFieldAppender)\n\nformFieldAppender is a Javascript module that allows you to add and remove an infinite number of similar form fields to a form.\n\n## Install\nformFieldAppender is an ES6 module. Consequently, you'll need an ES6 transpiler ([Babel](https://babeljs.io) is a nice one) as part of your Javascript workflow.\n\nIf you're already using NPM for your project, you can install formFieldAppender with the following command:\n\n```\n$ npm install @degjs/form-field-appender\n```\n\n## Usage\nImport formFieldAppender and create a new instance of it.\n```js\nimport formFieldAppender from '@degjs/form-field-appender';\n\nlet element = document.querySelector('div');\n\nlet instance = formFieldAppender(element);\n```\n\nBy default, formFieldAppender will search the supplied `element` for an item that matches the `itemClass` parameter to use as its blueprint.\n\nHowever, you can optionally provide either an HTML element or string representation of an HTML element as the item blueprint.\n\n#### As an HTML element:\n```js\nimport formFieldAppender from '@degjs/form-field-appender';\n\nlet element = document.querySelector('div');\nlet itemBlueprint = document.createElement('div');\n\nitemBlueprint.classList.add('phone-field__wrapper');\nitemBlueprint.insertAdjacentHTML('afterbegin', `\n    <label for=\"phone-field\">Field</label>\n    <input class=\"phone-field\" name=\"phone-field\" id=\"phone-field\" type=\"tel\">\n`);\n\nlet instance = formFieldAppender(element, {\n    blueprint: itemBlueprint\n});\n```\n\n#### As a string representation of an HTML element:\n```js\nimport formFieldAppender from '@degjs/form-field-appender';\n\nlet element = document.querySelector('div');\nlet itemBlueprint = `\n    <div class=\"phone-field__wrapper\">\n        <label for=\"phone-field\">Field</label>\n        <input class=\"phone-field\" name=\"phone-field\" id=\"phone-field\" type=\"tel\">\n    </div>\n`;\n\nlet instance = formFieldAppender(element, {\n    blueprint: itemBlueprint\n});\n```\n\n## Parameters\n\n### blueprint\nType: `HTMLElement` or `string`  \nAn HTML element or string representation of an HTML element that will be used as the blueprint for the repeating field.  \nDefault: null\n\n### itemClass\nType: `string`  \nThe class applied to each appended item.  \nDefault: `js-ffa-item`\n\n### addTriggerSelector\nType: `string`  \nThe selector for each item's add trigger.  \nDefault: `.js-ffa-add-trigger`\n\n### removeTriggerSelector\nType: `string`  \nThe selector for each item's remove trigger.  \nDefault: `.js-ffa-remove-trigger`\n\n### idPatternAttr\nType: `string`  \nThe attribute that contains the pattern that will be used to create each appended item's ID. A token of `[[itemIndex]]` in the pattern will be dynamically replaced by the item's current index, a token of `[[itemElIndex]]` will be replaced by the index of the element within the item, and a token of `[[index]]` will be replaced by a hyphenated combination of item and element index (i.e., `ffa-id-3-2` for the third element inside the fourth item).  \nDefault: `data-ffa-id-pattern`\n\n### namePatternAttr\nType: `string`  \nThe attribute that contains the pattern that will be used to create each appended item's `name` attribute. See `idPatternAttr` description for available token values.\nDefault: `data-ffa-name-pattern`\n\n### forPatternAttr\nType: `string`  \nThe attribute that contains the pattern that will be used to create each appended item's `for` attribute. See `idPatternAttr` description for available token values.  \nDefault: `data-ffa-for-pattern`\n\n### disabledClass\nType: `string`  \nThe class applied to an item when it's hidden/disabled. This class can be used to visibly hide disabled items with CSS.  \nDefault: `is-disabled`\n\n### initialReindex\nType: `number`  \nThe first index value applied to added items.  \nDefault: `1`\n\n### firstItemIsRemovable\nType: `boolean`  \nDetermines whether the first item can be removed.  \nDefault: `true`\n\n### onlyLastItemIsRemovable\nType: `boolean`  \nDetermines whether a \"remove\" trigger is added to all items, or only the last item.  \nDefault: `false`\n\n### onItemAddCallback\nType: `function` or `null`  \nAn optional callback that's fired whenever an item is added.  \nDefault: `null`\n\n### onItemRemoveCallback\nType: `function` or `null`  \nAn optional callback that's fired whenever an item is removed.  \nDefault: `null`\n\n### resetNewItemFormVals\nType: `boolean`  \nDetermines whether the fields in added items contain the values of the original item/template.  \nDefault: `true`\n\n\n## Methods\n\n### .destroy()\nParameters: none  \nDestroys the formFieldAppender instance.\n\n### .getItems()\nParameters: none  \nReturns an array of the items currently added to the formFieldAppender instance.\n\n\n\n## Browser Support\n\nformFieldAppender depends on the following browser APIs:\n+ Object.assign: [Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) | [Polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign#Polyfill)\n+ Array.from: [Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) | [Polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from#Polyfill)\n+ Element.closest: [Documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest) | [Polyfill](https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill)\n\nTo support legacy browsers, you'll need to include polyfills for the above APIs.\n","readmeFilename":"README.md"}