{"_id":"@anypoint-web-components/validator-mixin","_rev":"11-dc491f1fa6a162222fd8b6c055737932","name":"@anypoint-web-components/validator-mixin","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0":{"name":"@anypoint-web-components/validator-mixin","version":"1.0.0","keywords":["api-components","arc-components","forms","validation","web-components"],"license":"Apache-2.0","_id":"@anypoint-web-components/validator-mixin@1.0.0","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"}],"contributors":[{"name":"Pawel Psztyc"},{"name":"The Advanced REST client authors","email":"arc@mulesoft.com"}],"homepage":"https://github.com/anypoint-web-components/validator-mixin#readme","bugs":{"url":"https://github.com/anypoint-web-components/validator-mixin/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"2aeb5309d90b150b9764604fde48484649d7a352","tarball":"https://registry.npmjs.org/@anypoint-web-components/validator-mixin/-/validator-mixin-1.0.0.tgz","fileCount":7,"integrity":"sha512-InwvORMzVFB5+rIhEDvVLdywdAca+caUR4yGk6ZJHE1wLpuwgnXnI+E4xa5X1Y4mdSi/v2prrFomqTwJnW1Y9Q==","signatures":[{"sig":"MEUCIQDu0VvSpu5/146zTjh3HCSy4TE8sPRiwx6plKCtEUrlUwIgUCCBGQvMjKDD4kLu9ShDGqfh6jDqj/wsbASKX+Mm9Dk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEBMvCRA9TVsSAnZWagAA8/MP/2dJUJph5OYgwfd67eN7\nP35TRqZNjidJSMbkbarEUIVXlD6DzZOdZR6hvVhPJqmKoOAYpqwottr52BiY\nV54kFU2gC49aOEQGi95BZFmMdW1cAQieDhQROCkVdPJ2LxWTkEDfluDgC2wS\neRPQjvLZKgsOguvoiMhFjTx4xkP9D1sh1BkDpZn1/NcR1rBiHZoDQTW0rW3a\ni3QvfHnvXeyDWMmusDBG54iIF6HDBR0U2aSAbfar4YsCPH9rI8emuwDzWbaf\nthcoyvzKt7paJiFYT+yAcvRVjETmSQgOakq6Ibtszd2h0f3Ex9mPJLhEf/Nt\nPE+8+S7mCId4iaMCRt4B5xGyGYLCFdvDKZsN7x92o5431k59I5b8BEJdXw26\nr5FWgiGmt53LCfqCPDpRolvI2J40oU/ASsBls3GubtKZx7M0B71hK0YsjY9A\n7lMcmetWbHOMUyfjgmJ/sWnNN7cqvnfPHDReLyWVVU7kNZhTOBqUdRGc1Zzb\nm9OHTksB+gUR9lnliubN/kp2DE/I0lC2jil/d/ZYtgD6up0CXKyybkuSB7CG\nxvFz6+547u/CdSFG0xt9hPZRMHh1Y0dPYZo0rz58IrgDwNqHJuCIcT2YrBU6\nn6CUcNKQad4KoJwmcQxc8OrzWUELOLyHFsyl96mYEcEQYsh1NGfhbCojJuXs\nFRyN\r\n=Pi3n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"validator-mixin.js","authors":["Pawel Psztyc","The Advanced REST client authors <arc@mulesoft.com>"],"gitHead":"ee4794be2197dbbe42d48c799ff4b75d68e45954","scripts":{"lint":"npm run lint:eslint && npm run lint:prettier","test":"karma start --coverage","start":"owc-dev-server --open","format":"npm run format:eslint && npm run format:prettier","test:sl":"karma start karma.sl.config.js --legacy --coverage","test:watch":"karma start --auto-watch=true --single-run=false","lint:eslint":"eslint --ext .js,.html .","test:legacy":"karma start --legacy --coverage","update-types":"gen-typescript-declarations --deleteExisting --outDir .","format:eslint":"eslint --ext .js,.html . --fix","lint:prettier":"prettier \"**/*.js\" --list-different || (echo '↑↑ these files are not prettier formatted ↑↑' && exit 1)","format:prettier":"prettier \"**/*.js\" --write","test:legacy:watch":"karma start --legacy --auto-watch=true --single-run=false"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/anypoint-web-components/validator-mixin.git","type":"git"},"_npmVersion":"6.9.0","description":"A mixin to implement custom input validator","directories":{},"lint-staged":{"*.js":["eslint --ext .js,.html . --fix","git add"]},"_nodeVersion":"10.15.3","dependencies":{"@polymer/iron-meta":"^3.0.1"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^1.0.0","lit-html":"^1.0.0","lint-staged":"^8.0.0","lit-element":"^2.0.1","webpack-merge":"^4.1.5","owc-dev-server":"^1.0.0","@commitlint/cli":"^7.0.0","@open-wc/testing":"^0.11.1","@open-wc/eslint-config":"^0.4.1","@open-wc/testing-karma":"^2.0.0","@open-wc/prettier-config":"^0.1.0","@commitlint/config-conventional":"^7.0.0","@advanced-rest-client/arc-demo-helper":"^1.0.3","@advanced-rest-client/testing-karma-sl":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/validator-mixin_1.0.0_1561334574674_0.4365562950886728","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@anypoint-web-components/validator-mixin","version":"1.1.0","keywords":["api-components","arc-components","forms","validation","web-components"],"license":"Apache-2.0","_id":"@anypoint-web-components/validator-mixin@1.1.0","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"}],"contributors":[{"name":"Pawel Psztyc"},{"name":"The Advanced REST client authors","email":"arc@mulesoft.com"}],"homepage":"https://github.com/anypoint-web-components/validator-mixin#readme","bugs":{"url":"https://github.com/anypoint-web-components/validator-mixin/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"f0c76d52d9c6945d454024a0b0a0bf9a8b6d0031","tarball":"https://registry.npmjs.org/@anypoint-web-components/validator-mixin/-/validator-mixin-1.1.0.tgz","fileCount":12,"integrity":"sha512-L4TN3aijx9Ya1EBhBsc0/u5P4VX1jlSA2jJKWHt6vX5VKHwdKCcjCqeBgrYu7WhPQbKwfcihqkD3iv6Z7QupUQ==","signatures":[{"sig":"MEUCIQD7DsVbzlthv1DHAfxw3FAtA4DdFqeJXpAl1MSFUh6imgIgFoStsdRfo2MfBUXpEH8yz6+7ebEJt6zANqFQJ10n3oU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":15389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevc5cCRA9TVsSAnZWagAAFbcP/2+SZaXdh2PlxVovhDtU\nE6wbqHi5v9PU12c+yhRNrz8LHIXFyuf4Hi6BVgMnZHfpafA3I7tgR1Zfhu1t\nVljoNLPsxJWX1xyaH3I8VI2fBncUXeb7Ofz71XmQjBVpAMYjrRwEskyPMbaH\nFWD2gcrNnHB6rxGpY20OS4ALadTOqmNVq9n5esS0UTEVcWrzAes3rViO4xkz\nNZHmlBZVqdg0U/b8E5ocXiiJvO2tzJ2wrlfO6rZcg2zbDK+zCXccIYHszcvj\ndZexaYX2nOtGz2NJ9PYY+YkTzk1YH95cVhHLTyetFkDvGaaq8kk8cACg/Y8e\nIJTLxIrIG8n9VBhkv7HPjg1eWBtGAYjmxvBJciFOMofRNfvnj0I3Exbx+2JW\nxhyfG0aNzlU/igs2Yl3EOYD4eo9e6drAcbi4bVSR1R9oDAHIM5mfu1SZoI5o\nv0025auo7qxaQpfWrQ13Fp72RexRlkA4brM3qJq5xJnAjENkVmvHvcnJ80nn\nRm9ixwYikTt99r/Y0JzkEPlA/g9pgRN/dexwNO2KDvolr5Q4VML6JcQQjoqb\nYB4BSE2rLy0NRzBDsofpPlrg0uDYeVmMuieGQEsZC7uxjFxR2ehI07eK22et\n9k1M24AnsIAXZbJVK3crf4+IcrrcCcGwFdWnprmMAI2bhqF1a1op+USocXA1\nplD8\r\n=/rl/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc","The Advanced REST client authors <arc@mulesoft.com>"],"gitHead":"6caab35660f74aefea02e8d5af85f1192a953a46","scripts":{"lint":"npm run lint:eslint && npm run lint:prettier","test":"karma start --coverage","start":"es-dev-server --app-index demo/index.html --node-resolve --open --watch","format":"npm run format:eslint && npm run format:prettier","test:sl":"karma start karma.sl.config.js --compatibility auto --coverage","test:watch":"karma start --auto-watch=true --single-run=false","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore","lint:prettier":"prettier \"**/*.js\" --check --ignore-path .gitignore","format:prettier":"prettier \"**/*.js\" --write --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"prettier":{"arrowParens":"avoid","singleQuote":true},"repository":{"url":"git://github.com/anypoint-web-components/validator-mixin.git","type":"git"},"_npmVersion":"6.14.4","description":"A mixin to implement custom input validator","directories":{},"lint-staged":{"*.js":["eslint --fix","prettier --write","git add"]},"_nodeVersion":"13.13.0","dependencies":{"@open-wc/dedupe-mixin":"^1.2.17"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["**/demo/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.5","sinon":"^9.0.1","eslint":"^7.0.0","lit-html":"^1.2.1","prettier":"^2.0.4","deepmerge":"^4.2.2","typescript":"^3.9.2","lint-staged":"^10.2.2","lit-element":"^2.3.1","es-dev-server":"^1.50.0","@open-wc/testing":"^2.5.16","@open-wc/eslint-config":"^2.0.0","@open-wc/testing-karma":"^3.3.22","eslint-config-prettier":"^6.11.0","typescript-lit-html-plugin":"^0.9.0","@advanced-rest-client/arc-demo-helper":"^1.0.17","@advanced-rest-client/testing-karma-sl":"^1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/validator-mixin_1.1.0_1589497435402_0.12552520700536363","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@anypoint-web-components/validator-mixin","version":"1.1.1","keywords":["api-components","arc-components","forms","validation","web-components"],"license":"Apache-2.0","_id":"@anypoint-web-components/validator-mixin@1.1.1","maintainers":[{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"}],"contributors":[{"name":"Pawel Psztyc"},{"name":"The Advanced REST client authors","email":"arc@mulesoft.com"}],"homepage":"https://github.com/anypoint-web-components/validator-mixin#readme","bugs":{"url":"https://github.com/anypoint-web-components/validator-mixin/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"3ca3089583d44445a5c9e6c15ccaa5f1b0a94077","tarball":"https://registry.npmjs.org/@anypoint-web-components/validator-mixin/-/validator-mixin-1.1.1.tgz","fileCount":12,"integrity":"sha512-SHBFXn/uHP5ptQY/ZV/DzEb0dBYldQF1Rti1q+3lfbUcYiA59QdfsPvOmre6a64NeaHagV/aMd4zj3FNH5hAXg==","signatures":[{"sig":"MEUCIQDQfZ8ZXrf2EcMMY0UNFIXtS2Zluy/sn+bF95jMk1GigwIgNnqGDXeSM0iznaxsUHIFQEtywDySf5XFRWGxssANyLM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17568,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevdN/CRA9TVsSAnZWagAAQn0QAJaaIU4zgMPYCWGHhQn8\ncNB4L9FWhHyrRQFxBHcSLauscQZjSHapG+UmHQnalLwaMMwrHZyTOxGbVQgJ\n0lxy7pNC6jjItS58H/20QJoIdEUtPFHDU1NFZC8Q8REino3+PzNITPexW0O5\nePEpit+nL4/TI8ETNnQykYbbuxyEN4YkqxcSfX7DaKgJEzquNmO2VE8OtRXO\nFN4VUuDmx+/70Wk/tyHP3CHQIeFTlYhmcsVBcGLYzy0JQCdWUtSVlc4bAi4t\nswTKIhwIzAc5WTEZPxS1YOjnk76lafx+YFsG1aHPYGgsqBqEGYfOMgpJW392\nCI0XAuSJUpqm3D9JPZBpVYBkxT8jTmenOEZ7eTyIQxILCPNonIwvMWGBMKV9\naZfg/FEMafhckD7ODDJVWfjQJJ3UEQ/XEnftU3YfH/EZfTY1g9JQDGbRoOpU\nv/RxJuTQgBYAbDeFpMwRgySTputzLjky07dLsSKuk143GujsU+1QxeE2fYRz\nmMvpVJDh2g/R8YBrvl86PugbpGVRW+QaHtPTxZpEyl24wmLA20yP4EBbR7WZ\nFyFS3eZ6s6KgH1aFjRaxn4Ga57L3aSMyxlgrZ0NCCZrLZWGW9lIzPpXFxZzZ\nFOrRa4fRsB5LAwb2qjQDnrv8Xu4EXnXgSIy6wKxnTu10YGIrB5Xbc9wlg7/q\nNAHU\r\n=3ZLg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc","The Advanced REST client authors <arc@mulesoft.com>"],"gitHead":"3e5a661a82f4045ff347609c36e39b4d455974fa","scripts":{"lint":"npm run lint:eslint && npm run lint:prettier","test":"karma start --coverage","start":"es-dev-server --app-index demo/index.html --node-resolve --open --watch","format":"npm run format:eslint && npm run format:prettier","test:sl":"karma start karma.sl.config.js --compatibility auto --coverage","test:watch":"karma start --auto-watch=true --single-run=false","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore","lint:prettier":"prettier \"**/*.js\" --check --ignore-path .gitignore","format:prettier":"prettier \"**/*.js\" --write --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"prettier":{"arrowParens":"avoid","singleQuote":true},"repository":{"url":"git://github.com/anypoint-web-components/validator-mixin.git","type":"git"},"_npmVersion":"6.14.4","description":"A mixin to implement custom input validator","directories":{},"lint-staged":{"*.js":["eslint --fix","prettier --write","git add"]},"_nodeVersion":"13.13.0","dependencies":{"@open-wc/dedupe-mixin":"^1.2.17"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["**/demo/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.2.5","sinon":"^9.0.1","eslint":"^7.0.0","lit-html":"^1.2.1","prettier":"^2.0.4","deepmerge":"^4.2.2","typescript":"^3.9.2","lint-staged":"^10.2.2","lit-element":"^2.3.1","es-dev-server":"^1.50.0","@open-wc/testing":"^2.5.16","@open-wc/eslint-config":"^2.0.0","@open-wc/testing-karma":"^3.3.22","eslint-config-prettier":"^6.11.0","typescript-lit-html-plugin":"^0.9.0","@advanced-rest-client/arc-demo-helper":"^1.0.17","@advanced-rest-client/testing-karma-sl":"^1.3.1"},"_npmOperationalInternal":{"tmp":"tmp/validator-mixin_1.1.1_1589498751267_0.04314029927118046","host":"s3://npm-registry-packages"}},"1.1.2":{"name":"@anypoint-web-components/validator-mixin","version":"1.1.2","keywords":["api-components","arc-components","forms","validation","web-components"],"license":"Apache-2.0","_id":"@anypoint-web-components/validator-mixin@1.1.2","maintainers":[{"name":"carowright","email":"carolina.wright@mulesoft.com"},{"name":"jarrodek","email":"jarrodek@gmail.com"},{"name":"twoplustwoone","email":"francisco.digiandomenico@gmail.com"},{"name":"lbauret","email":"leandro.bauret@mulesoft.com"}],"contributors":[{"name":"Your name can be here!"}],"homepage":"https://github.com/anypoint-web-components/validator-mixin#readme","bugs":{"url":"https://github.com/anypoint-web-components/validator-mixin/issues","email":"arc@mulesoft.com"},"dist":{"shasum":"5be6750b23f38e8d7a2c1ae75be6dd43478bc4fc","tarball":"https://registry.npmjs.org/@anypoint-web-components/validator-mixin/-/validator-mixin-1.1.2.tgz","fileCount":12,"integrity":"sha512-J5dqcdwW47W+7B10stowMsaQclV2VEe2vZ3SD6lVnQS63MWEZeCa2jTdaJ3RuE5+vSBoKoUfBiHqOdcpnGLL2w==","signatures":[{"sig":"MEUCIQDFt1Pnmpx5Hn4NFHaFXEgJ3nODFaGt66NkqNMs5K9XPAIgceAf8KByJNWw69AS/Kk3AWYr11jJekkPmkUsWTE7rIk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPobHCRA9TVsSAnZWagAAJEoP/2xnUUuZpki9M+8+dOg5\nypuLbXOpzwUXE7f/QLz/yAutCGp2GWuVtM5Z8kiH+50xF0YwICBLS9HkoMo8\nrezPo0aeJrC5hDcos0tswd5gRv2XlqnlS1dnGA5ACvisQcfM0ifmLkPDzlOi\ncYMzbV+sBAVwb391l+uQsRVMYrLchQCF01w69XZfTunSuft94Wjxz3QIB0GO\n6c7IDKOvf2q6k/gls4OLJcZXuhoXxPDzC9wHMe2AbMqo7LfbTRuO9A3K4/XL\nTPfp0YLJbMjQgA+nLcfOYTVMvt0vfXUEdR044OEnMoiKzGAIgeYnMQ5gk7+c\nZZzOp0OAclfBhbvDfgTNF4P2HpgATYhcW1auJKIzI/ajDtErQkizR7TtCKGH\nvHrSbP5NPpdztU2n5IfFKlzcdB1lWj5ywUOtXbwPXR1fIh4C3mxlanLNjWh/\nnhR8YAQO7IHJbiYFoTcDNP9vKmYLGxX5pRlKH4OGKb7vthXcrYm17K+TRUf2\nRbSxE6w6o935SvZVq0MZY7stYtRPqnamsDap81VE2dddREyAw4OIlr6mKlpY\njfskwOomeDe7QF+d5Mu2Ct9igHc26lSKSyU/Yw3MluYn8k9lGQ+tCwjm70L9\nSa25NEtzaFwruydEF7czu0J9aFJHAsz7hJIKk95+xVWiL/6FSiFdiWT2NwS0\nDrKM\r\n=ym2y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","husky":{"hooks":{"pre-commit":"lint-staged"}},"module":"index.js","authors":["Pawel Psztyc"],"gitHead":"db995ba0e94bd8fe4ef43d855ea022b2adf45e68","scripts":{"lint":"npm run lint:eslint","test":"web-test-runner test/**/*.test.js --coverage --node-resolve --playwright --browsers chromium firefox webkit","start":"web-dev-server --app-index demo/index.html --node-resolve --open --watch --root-dir .","format":"npm run format:eslint","lint:types":"tsc","test:watch":"web-test-runner test/**/*.test.js --node-resolve --watch --playwright --browsers chromium","lint:eslint":"eslint --ext .js,.html . --ignore-path .gitignore","format:eslint":"eslint --ext .js,.html . --fix --ignore-path .gitignore"},"_npmUser":{"name":"jarrodek","email":"jarrodek@gmail.com"},"repository":{"url":"git://github.com/anypoint-web-components/validator-mixin.git","type":"git"},"_npmVersion":"6.14.11","description":"A mixin to implement custom input validator","directories":{},"lint-staged":{"*.js":["eslint --fix"]},"_nodeVersion":"14.16.0","dependencies":{"@open-wc/dedupe-mixin":"^1.3.0"},"eslintConfig":{"extends":["@open-wc/eslint-config","eslint-config-prettier"],"overrides":[{"files":["**/demo/**/*.js","**/demo/**/*.html"],"rules":{"no-console":"off","no-unused-expressions":"off","class-methods-use-this":"off","import/no-extraneous-dependencies":"off"}}]},"_hasShrinkwrap":false,"devDependencies":{"husky":"^4.3.8","sinon":"^9.2.4","eslint":"^7.21.0","lit-html":"^1.3.0","typescript":"^4.2.2","lint-staged":"^10.5.4","lit-element":"^2.4.0","@web/dev-server":"^0.1.8","@open-wc/testing":"^2.5.32","@web/test-runner":"^0.12.15","@open-wc/eslint-config":"^2.1.0","eslint-config-prettier":"^8.1.0","typescript-lit-html-plugin":"^0.9.0","@web/test-runner-playwright":"^0.8.4","@advanced-rest-client/arc-demo-helper":"^1.0.17"},"_npmOperationalInternal":{"tmp":"tmp/validator-mixin_1.1.2_1614710470647_0.9449194476323222","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-06-24T00:02:54.450Z","modified":"2026-04-07T19:25:28.946Z","1.0.0":"2019-06-24T00:02:54.784Z","1.1.0":"2020-05-14T23:03:55.552Z","1.1.1":"2020-05-14T23:25:51.371Z","1.1.2":"2021-03-02T18:41:10.847Z"},"bugs":{"url":"https://github.com/anypoint-web-components/validator-mixin/issues","email":"arc@mulesoft.com"},"license":"Apache-2.0","homepage":"https://github.com/anypoint-web-components/validator-mixin#readme","keywords":["api-components","arc-components","forms","validation","web-components"],"repository":{"url":"git://github.com/anypoint-web-components/validator-mixin.git","type":"git"},"description":"A mixin to implement custom input validator","contributors":[{"name":"Your name can be here!"}],"maintainers":[{"email":"jarrodek@gmail.com","name":"jarrodek"},{"email":"alexperez@mulesoft.com","name":"alexperez_march_2024"},{"email":"elmellidiego@gmail.com","name":"dmacias"}],"readme":"# ValidatorMixin\n\nUse `ValidatorMixin` to implement a custom input/form validator. Element instances implementing this mixin will be registered for use in elements that implement `ValidatableMixin`.\n\n[![Published on NPM](https://img.shields.io/npm/v/@anypoint-web-components/validator-mixin.svg)](https://www.npmjs.com/package/@anypoint-web-components/validator-mixin)\n\n[![tests](https://github.com/anypoint-web-components/validator-mixin/actions/workflows/tests.yml/badge.svg)](https://github.com/anypoint-web-components/validator-mixin/actions/workflows/tests.yml)\n\n## Installation\n\n```bash\nnpm i @anypoint-web-components/validator-mixin --save\n```\n\n## Usage\n\n### Validator name\n\nBy default it takes lower case name of current HTML element. If this class\nis used outside custom elements environment then it uses static `is` property\nto get the name of the mixin.\n\n```javascript\nstatic get is() {\n return 'my-validator';\n}\n```\n\n### Deregistering validator\n\nWhen an instance of a validator is created it is being stored in a global validators cache\ncontrolled by the `ValidatorStore` module.\n\nAfter registering the validator in the global store it is not tied to component's life cycle methods (it can extend an Object instead of HTMLElement). Also, usually validator stays in the document for the entire life cycle of the web app. But if you need to un-register the validator then call `instance.unregister()` function\nand detach this element from the DOM or remove references to the object so it can be GC'd.\n\nYou can also do this by calling `ValidatorStore.unregister(instance)`.\n\n\n### In a LitElement\n\n```javascript\nimport { LitElement } from 'lit-element';\nimport { ValidatorMixin } from '@anypoint-web-components/validator-mixin';\n\nclass CatsOnly extends ValidatorMixin(LitElement) {\n  validateObject(obj) {\n    return !Object.keys(obj).some((key) => obj[key].match(/^(c|ca|cat|cats)?$/) === null);\n  }\n\n  validateArray(value) {\n    return !value.some((value) => value.match(/^(c|ca|cat|cats)?$/) === null);\n  }\n\n  validate(values) {\n    if (Array.isArray(values)) {\n      return this.validateArray(values);\n    }\n    if (typeof values === 'object') {\n      return this.validateObject(values);\n    }\n    return values.match(/^(c|ca|cat|cats)?$/) !== null;\n  }\n}\nwindow.customElements.define('cats-only', CatsOnly);\n```\n\n## Development\n\n```sh\ngit clone https://github.com/anypoint-web-components/validator-mixin\ncd validator-mixin\nnpm install\n```\n\n### Testing\n\n```sh\nnpm test\n```\n\n### Demo\n\n```sh\nnpm start\n```\n","readmeFilename":"README.md"}