UNPKG

api-console-assets

Version:

This repo only exists to publish api console components to npm

53 lines (51 loc) 1.7 kB
<!-- @license Copyright 2016 The Advanced REST client authors <arc@mulesoft.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <link rel="import" href="../polymer/polymer.html"> <link rel="import" href="../iron-meta/iron-meta.html"> <script> /** * ** Anypoint version of the component ** * * This element is to be private and used as a replacemenet to any PolymerElements * * Use `Polymer.IronValidatorBehavior` to implement a custom input/form validator. * Element instances implementing this behavior will be registered for use * in elements that implement `Polymer.IronValidatableBehavior`. * * @demo demo/index.html * @polymerBehavior */ Polymer.IronValidatorBehavior = { properties: { /** * Error message to display when the form control did not passed the validation. */ message: String }, ready: function() { new Polymer.IronMeta({ type: 'validator', key: this.is, value: this }); }, /** * Implement custom validation logic in this function. * @param {Object} values The value to validate. May be any type depending * on the validation logic. * @return {Boolean} true if `values` is valid. */ validate: function(values) {} }; </script>