UNPKG

56.1 kBSource Map (JSON)View Raw
1{"version":3,"file":"cee-validate.umd.js","sources":["../src/core/fieldBag.ts","../src/core/ruleContainer.ts","../src/utils/is.ts","../src/utils/fields.ts","../src/core/field.ts","../src/rules/alphanumeric.ts","../src/rules/custom.ts","../node_modules/dayjs-ext/src/plugin/customParseFormat/parseFormattedInput.js","../node_modules/dayjs-ext/src/plugin/customParseFormat/index.js","../src/rules/dateFormat.ts","../src/rules/numeric.ts","../src/rules/regex.ts","../src/rules/required.ts","../src/rules/maxLength.ts","../src/rules/minLength.ts","../src/rules/pis.ts","../src/core/scopedValidator.ts","../src/index.ts"],"sourcesContent":["import Field from './field'\n\n\nexport default class FieldBag {\n private _items: Field[]\n\n constructor (items?: Field[]) {\n this._items = items || []\n }\n\n set items (items: Field | Field[]) {\n this.push(items)\n }\n\n /**\n * Returns the corresping Field instance, or undefined if not found.\n *\n * @param {String} field - The name of the field.\n * @param {String} scope? - Optional scope of the field.\n * @returns {Field | undefined} - The Field instance, or undefined if not found.\n */\n\n get (field: string, scope?: string): Field | undefined {\n return this._items.find((item: Field) => scope\n ? item.name === field && item.scope === scope\n : item.name === field)\n }\n\n /**\n * Returns all fields registered in the FieldBag\n *\n * @param {String} scope? - If present, returns all the fields from that scope\n * @returns {Array<Field>} - Array of field items\n */\n\n all (scope?: string): Array<Field> {\n return scope\n ? this._items.filter(f => f.scope === scope)\n : this._items\n }\n\n /**\n * Check to see if a Field is preseint in the FieldBag, or if a Field\n * exists in a given scope.\n *\n * @param {String} field - The name of the field\n * @param {String} scope? - Optional scope of the field\n * @returns {Boolean}\n */\n\n has (field: string, scope?: string): boolean {\n return !!this._items.find((item: Field) => scope\n ? item.name === field && item.scope === scope\n : item.name === field)\n }\n\n /**\n * Add a new Field or an array of Field instances to the existing _items\n * arrays.\n *\n * @param {Field | Array<Field>} scope? - If present, returns all the fields\n * from that scope.\n * @returns {void}\n */\n\n push (item: Field | Field[]): void {\n // Check if item is already present in the FieldBag instance\n this._items.push.apply(this._items, Array.isArray(item) ? item : [ item ])\n }\n\n\n /**\n * Removes an existing field from the FieldBag instance.\n *\n * @param {String} field - The name of the field\n * @param {String} scope? - Optional scope of the field\n * @returns {void}\n */\n\n remove (field: string, scope?: string): void {\n this._items = this._items.filter((item: Field) => scope && item.scope === scope\n ? item.name !== field\n : item.name !== field)\n }\n}\n","import { ValidationRule } from '../types'\n\n\nconst RULES: { [ruleName: string]: ValidationRule } = {}\n\nexport default class RuleContainer {\n static get rules (): { [ruleName: string]: ValidationRule } {\n return RULES\n }\n\n /**\n * Get a specific rule from the container.\n *\n * @param {String} ruleName - The name of the rule.\n * @returns {ValidationRule} - the respective ValidationRule object.\n */\n static getRule (ruleName: string): ValidationRule {\n return RULES[ruleName]\n }\n\n /**\n * Adds a new rule to the container.\n *\n * @param ruleName - The name of the rule to be added.\n * @param rule - The ValidationRule object.\n * @returns {Void}\n */\n static add (ruleName: string, rule: ValidationRule) {\n RULES[ruleName] = rule\n }\n\n /**\n * Removes a rule from the container.\n *\n * @param ruleName - The name of the rule to be removed.\n * @returns {Void}\n */\n static remove(ruleName: string) {\n delete RULES[ruleName]\n }\n\n /**\n * Checks if a rule exists in the container\n *\n * @param ruleName - The name of the rule.\n * @returns {Boolean}\n */\n static has (ruleName: string) {\n return !!RULES[ruleName]\n }\n}\n","/**\n * Check value's constructor name.\n * @param {*} value\n * @param {String} constructor\n * @returns {Boolean}\n *\n * @author Vitor Luiz Cavalcanti (https://github.com/VitorLuizC)\n */\n\nexport const is = (value: any, constructor: string): boolean => {\n return Object.prototype.toString.call(value) === `[object ${constructor}]`\n}\n\nexport default is\n","import RuleContainer from '../core/ruleContainer'\nimport is from './is'\n\n/**\n * Test to see if an entity of the form `validations` object is an scope\n * and not a FormValidation object.\n *\n * @param {Any} formEntity - The entity to be tested.\n *\n * @author Erik Isidore\n * @version 0.1\n */\n\nexport const isFormScope = (formEntity: any): boolean => {\n if (!is(formEntity, 'Object')) return false\n\n return Object.keys(formEntity)\n .every(name => !RuleContainer.has(name))\n}\n","import FormValidator from '../index'\nimport { is } from '../utils'\n\nimport {\n FieldItem,\n FieldFlags,\n NormalizedRule,\n FieldValidation\n} from '../types'\n\n\nexport default class Field {\n private _vm: FormValidator\n private initialValue: string\n\n private _flags: FieldFlags = {\n pristine: false,\n dirty: false,\n changed: false,\n touched: false,\n valid: false,\n errors: []\n }\n\n public value: any\n public name: string\n public scope?: string\n public el: Element\n public rules: NormalizedRule[]\n\n constructor (options: FieldItem) {\n this.el = options.el\n this._vm = options.vm\n this.name = options.name\n this.value = options.value\n this.scope = options.scope\n this.rules = this.mapRules(options.rules)\n this.initialValue = options.value\n\n this.init(options)\n }\n\n get validate (): any {\n if (!this._vm || !this._vm.$validator) return () => []\n\n const validate = this._vm.$validator.validate\n return validate.bind(this._vm.$validator, this.name, this.scope)\n }\n\n get watch (): any {\n if (!this._vm || !this._vm.$validator) return\n\n return this._vm.$watch.bind(this._vm)\n }\n\n get options (): any {\n if (!this._vm || !this._vm.$validator) return\n\n return this._vm.$validator.options\n }\n\n\n get flags () { return this._flags }\n\n get errors () { return this._flags.errors }\n\n get error () { return this._flags.errors[0] || '' }\n\n /**\n * Sets a new value to one of the instance's FieldFlags.\n *\n * @param {Keyof FieldFlags} flag - The flag name\n * @param {Boolean | Array<String>} value - the new value to assigned to the flag\n * @returns {void}\n * @author Erik Isidore\n */\n\n setFlag (flag: keyof FieldFlags, value: boolean | string[]): void {\n if (!Object.keys(this._flags).includes(flag)) return\n\n this._flags[flag] = value\n }\n\n /**\n * Initializes the Field instance.\n *\n * @param {FieldItem} options\n * @returns {void}\n * @author Erik Isidore\n */\n\n init (options: FieldItem): void {\n if (process.env.NODE_ENV !== 'production' && !this.name)\n console.warn('CeeValidate: A field declaration is missing a \"name\" attribute')\n\n this.initFlags()\n this.addValueListeners()\n }\n\n /**\n * Initializes or resets the Field flags to their default values.\n *\n * @returns {void}\n * @author Erik Isidore\n */\n\n initFlags (): void {\n const flagNames = Object.keys(this._flags) as [keyof FieldFlags]\n const defaultFlags: FieldFlags = {\n pristine: !this.value,\n dirty: !!this.value,\n touched: false,\n changed: false,\n valid: false,\n errors: []\n }\n\n flagNames.forEach((flag: keyof FieldFlags) => {\n this._flags[flag] = defaultFlags[flag]\n })\n }\n\n /**\n * Adds event listener for the blur event on the input, so that we can\n * tell when the input has been `touched` by the user, and attaches a\n * watcher to the input value, validating it's value whenever it changes.\n *\n * @returns {void}\n * @author Erik Isidore\n */\n\n addValueListeners (): void {\n if (!this.watch || !this.el) return\n\n const onBlur = () => {\n if (!this._flags.touched) this._flags.touched = true\n if (!this.options.noListeners) this.validate()\n }\n\n const onInput = (value: any) => {\n this.value = value\n this._flags.changed = this.value !== this.initialValue\n\n if (!this.options.noListeners) this.validate()\n\n if (!this._flags.dirty) {\n this._flags.dirty = true\n this._flags.pristine = false\n }\n }\n\n this.el.addEventListener('focusout', onBlur.bind(this))\n this.watch(this.scope ? `${this.scope}.${this.name}` : this.name, onInput.bind(this))\n }\n\n /**\n * Receives a FieldValidation entity, which can be\n * A string: 'required|dateFormat:DD/MM/YYYY'\n * An array of strings: ['required', 'dateFormat:DD/MM/YYYY']\n * Or an object: { required: true, dateFormat: 'DD/MM/YYYY' }\n *\n * And turns this entity into a array of NormalizedRules, this\n * array will contain an NormalizedRule object for every rule\n * found in FieldValidation. A NormalizedRule is simply an\n * object with the format: { ruleName: <name>, args: [<...>] }\n *\n * @param {FieldValidation} rules - The validation rules defined for the field.\n * @returns {Array<NormalizedRule>} - A array containing a NormalizedRule for\n * every validation rule defined for the field.\n *\n * @author Erik Isidore\n */\n\n mapRules (rules: FieldValidation): Array<NormalizedRule> {\n const stringToRules = (ruleDef: string) => ({\n ruleName: ruleDef.split(':')[0],\n args: ruleDef.split(':')[1] && ruleDef.split(':')[1].split(',')\n })\n\n const objToRules = (rulesObj: { [rule: string]: any }) =>\n Object.keys(rulesObj).map(ruleName => ({\n ruleName,\n args: !Array.isArray(rulesObj[ruleName])\n ? [ rulesObj[ruleName] ]\n : rulesObj[ruleName]\n }))\n\n return typeof rules === 'string' && rules.length\n ? rules.split('|').map(stringToRules)\n : Array.isArray(rules) ? rules.map(stringToRules)\n : rules && is(rules, 'Object') ? objToRules(rules as object)\n : []\n }\n\n /**\n * Resets the field flags and it's value.\n *\n * @returns {void}\n * @author Erik Isidore\n */\n\n reset (): void {\n this.value = this.initialValue\n this.initFlags()\n }\n\n /**\n * Dynamically updates the field's rules and remaps them.\n *\n * @param {FieldValidation} rule - The new rules to be applied\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n setRule (rule: FieldValidation): void {\n this.rules = this.mapRules(rule)\n }\n}\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\n/**\n * Checks if all characters in a given value are alphanumeric (letters\n * and numbers), ignores whitespace.\n *\n * @param {String} value - the input value to be tested.\n * @returns {boolean}\n *\n * @author Viniazvd, Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: string): boolean => {\n if (!value) return true\n\n return !!value.trim() && /^([0-9a-zA-Z\\s]*)?$/.test(value.trim())\n },\n message: 'Deve conter apenas letras e números'\n}\n\nRuleContainer.add('alphanumeric', rule)\nexport default rule\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\n/**\n * Executes a callback or an array of callbacks with `value` as an argument\n * and returns true if every callback passes\n *\n * @param {Any} value - the input value to be validated.\n * @param {Function | Array<Function>} - The callback or array of callbacks\n * to be called on the value.\n * @returns {boolean} - Returns true if every callback passes, false otherwise.\n *\n * @author Viniazvd, Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: any, ...callbacks: Function[]): boolean => {\n return callbacks.every(f => f(value))\n },\n message: 'Campo inválido'\n}\n\nRuleContainer.add('custom', rule)\nexport default rule\n","/* eslint-disable prefer-arrow-callback */\n\nconst formattingTokens = /(\\[[^[]*\\])|([-:/.()\\s]+)|(A|a|YYYY|YY?|MM?|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g\n\nconst match1 = /\\d/ // 0 - 9\nconst match2 = /\\d\\d/ // 00 - 99\nconst match3 = /\\d{3}/ // 000 - 999\nconst match4 = /\\d{4}/ // 0000 - 9999\nconst match1to2 = /\\d\\d?/ // 0 - 99\nconst matchUpperCaseAMPM = /[AP]M/\nconst matchLowerCaseAMPM = /[ap]m/\nconst matchSigned = /[+-]?\\d+/ // -inf - inf\nconst matchOffset = /[+-]\\d\\d:?\\d\\d/ // +00:00 -00:00 +0000 or -0000\nconst matchAbbreviation = /[A-Z]{3,4}/ // CET\n\nconst parseTokenExpressions = {}\nconst parseTokenFunctions = {}\nconst parsers = {}\n\nconst daysInMonths = [\n 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31\n]\n\nfunction isLeapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0\n}\n\nfunction checkDay(time) {\n const { day, month } = time\n let days\n if (month === 2) {\n days = isLeapYear(time.year) ? 29 : 28\n } else {\n days = daysInMonths[month - 1]\n }\n if (!(day >= 1 && day <= days)) {\n throw new Error(`Invalid day: \"${day}\".`)\n }\n}\n\nfunction correctHours(time) {\n const { afternoon } = time\n if (afternoon !== undefined) {\n const { hours } = time\n if (afternoon) {\n if (hours < 12) {\n time.hours += 12\n }\n } else if (hours === 12) {\n time.hours = 0\n }\n delete time.afternoon\n }\n}\n\nfunction makeParser(format) {\n const array = format.match(formattingTokens)\n if (!array) {\n throw new Error(`Invalid format: \"${format}\".`)\n }\n const { length } = array\n for (let i = 0; i < length; i += 1) {\n const token = array[i]\n const regex = parseTokenExpressions[token]\n const parser = parseTokenFunctions[token]\n if (parser) {\n array[i] = { regex, parser }\n } else {\n array[i] = token.replace(/^\\[|\\]$/g, '')\n }\n }\n return function (input) {\n const time = {}\n for (let i = 0, start = 0; i < length; i += 1) {\n const token = array[i]\n if (typeof token === 'string') {\n if (input.indexOf(token, start) !== start) {\n const part = input.substr(start, token.length)\n throw new Error(`Expected \"${token}\" at character ${start}, found \"${part}\".`)\n }\n start += token.length\n } else {\n const { regex, parser } = token\n const part = input.substr(start)\n const match = regex.exec(part)\n if (!match || match.index !== 0) {\n throw new Error(`Matching \"${regex}\" at character ${start} failed with \"${part}\".`)\n }\n const value = match[0]\n parser.call(time, value)\n start += value.length\n }\n }\n checkDay(time)\n correctHours(time)\n return time\n }\n}\n\nfunction addExpressionToken(token, regex) {\n parseTokenExpressions[token] = regex\n}\n\nfunction addParseToken(tokens, property, check) {\n if (typeof tokens === 'string') {\n tokens = [tokens]\n }\n let callback\n if (typeof property === 'string') {\n if (check) {\n callback = function (input) {\n const value = +input\n if (!check(value)) {\n throw new Error(`Invalid ${property}: \"${input}\".`)\n }\n this[property] = value\n }\n } else {\n callback = function (input) {\n this[property] = +input\n }\n }\n } else {\n callback = property\n }\n for (let i = 0, { length } = tokens; i < length; i += 1) {\n parseTokenFunctions[tokens[i]] = callback\n }\n}\n\nfunction offsetFromString(string) {\n const parts = string.match(/([+-]|\\d\\d)/g)\n const minutes = +(parts[1] * 60) + +parts[2]\n const offset = minutes === 0 ? 0 : parts[0] === '+' ? -minutes : minutes // eslint-disable-line no-nested-ternary\n if (!(offset % 15 === 0 && Math.abs(offset) <= 765)) { // 00:00 - 12:45\n throw new Error(`Invalid time zone offset: \"${string}\".`)\n }\n return offset\n}\n\naddExpressionToken('A', matchUpperCaseAMPM)\naddParseToken(['A'], function (input) {\n this.afternoon = input === 'PM'\n})\naddExpressionToken('a', matchLowerCaseAMPM)\naddParseToken(['a'], function (input) {\n this.afternoon = input === 'pm'\n})\n\naddExpressionToken('S', match1)\naddExpressionToken('SS', match2)\naddExpressionToken('SSS', match3)\nfor (let token = 'S', factor = 100; factor >= 1; token += 'S', factor /= 10) {\n addParseToken(token, function (input) {\n this.milliseconds = +input * factor\n })\n}\n\naddExpressionToken('s', match1to2)\naddExpressionToken('ss', match2)\naddParseToken(['s', 'ss'], 'seconds', function (seconds) {\n return seconds <= 59\n})\n\naddExpressionToken('m', match1to2)\naddExpressionToken('mm', match2)\naddParseToken(['m', 'mm'], 'minutes', function (minutes) {\n return minutes <= 59\n})\n\naddExpressionToken('H', match1to2)\naddExpressionToken('h', match1to2)\naddExpressionToken('HH', match2)\naddExpressionToken('hh', match2)\naddParseToken(['H', 'HH'], 'hours', function (hours) {\n return hours <= 23\n})\naddParseToken(['h', 'hh'], 'hours', function (hours) {\n return hours >= 1 && hours <= 12\n})\n\naddExpressionToken('D', match1to2)\naddExpressionToken('DD', match2)\naddParseToken(['D', 'DD'], 'day')\n\naddExpressionToken('M', match1to2)\naddExpressionToken('MM', match2)\naddParseToken(['M', 'MM'], 'month', function (month) {\n return month >= 1 && month <= 12\n})\n\naddExpressionToken('Y', matchSigned)\naddExpressionToken('YY', match2)\naddExpressionToken('YYYY', match4)\naddParseToken(['Y', 'YYYY'], 'year')\naddParseToken('YY', function (input) {\n input = +input\n this.year = input + (input > 68 ? 1900 : 2000)\n})\n\naddExpressionToken('z', matchAbbreviation)\naddParseToken('z', function (input) {\n // istanbul ignore next\n const zone = this.zone || (this.zone = {})\n zone.abbreviation = input\n})\n\naddExpressionToken('Z', matchOffset)\naddExpressionToken('ZZ', matchOffset)\naddParseToken(['Z', 'ZZ'], function (input) {\n const zone = this.zone || (this.zone = {})\n zone.offset = offsetFromString(input)\n})\n\nfunction parseFormattedInput(input, format) {\n let parser = parsers[format]\n if (!parser) {\n parser = makeParser(format)\n parsers[format] = parser\n }\n return parser(input)\n}\n\nexport default parseFormattedInput\n","import parseFormattedInput from './parseFormattedInput'\nimport Utils from '../../utils'\n\nUtils.parseFormattedInput = parseFormattedInput\n\nexport default (o, C) => {\n const proto = C.prototype\n const oldParse = proto.parse\n proto.parse = function (cfg) {\n const { date: input, format } = cfg\n if (format) {\n try {\n const {\n year, month, day, hours, minutes, seconds, milliseconds, zone\n } = parseFormattedInput(input, format)\n let date\n if (zone) {\n const timestamp = Date.UTC(\n year, month - 1, day,\n hours || 0, minutes || 0, seconds || 0, milliseconds || 0\n ) + (zone.offset * 60 * 1000)\n date = new Date(timestamp)\n } else {\n date = new Date(\n year, month - 1, day,\n hours || 0, minutes || 0, seconds || 0, milliseconds || 0\n )\n }\n this.$d = date\n } catch (error) {\n this.$d = new Date(Number.NaN)\n }\n this.init(cfg)\n } else {\n oldParse.call(this, cfg)\n }\n }\n}\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\nimport { is } from '../utils'\n\nimport dayjs from 'dayjs-ext'\nimport customParseFormat from 'dayjs-ext/plugin/customParseFormat'\n\ndayjs.extend(customParseFormat)\n\n\n/**\n * Validate if the input value produces a valid date and optionally if\n * it follows a given date format.\n *\n * @param {String | Number} value - The value of the input to be validated,\n * if `value` is a String, the validator may also receive a format param to\n * check if the string has the correct format.\n * @param {String} format? - Optional parameter to validate whether the the\n * given input value has the correct format. If given, the value must be a\n * string, otherwise this parameter is completely ignored.\n * @returns {boolean} True if the given value is valid or empty, false otherwise.\n * If you want to check for empty value, use the 'required' rule.\n *\n * @author Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: string | number, format: string = 'DD/MM/YYYY'): boolean => {\n if (!value) return true\n\n const options = is(value, 'String') ? { format } : { }\n const date = dayjs(value, <any>options)\n\n return date.isValid()\n },\n message: 'Data inválida.'\n}\n\nRuleContainer.add('dateFormat', rule)\nexport default rule\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\n/**\n * Checks if all characters in a given value are numeric, ignores whitespace.\n *\n * @param {String} value - The input value to be validated.\n * @returns {Boolean}\n *\n * @author Viniazvd, Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: string): boolean => {\n if (!value) return true\n\n return !!value.trim() && /^(\\d+(\\.\\d+)?$)/.test(value.trim())\n },\n message: 'Deve conter apenas números.'\n}\n\nRuleContainer.add('numeric', rule)\nexport default rule\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\nimport { is } from '../utils'\n\n/**\n * Receives a value and a regular expression and returns the result of\n * executing the regex on the value.\n *\n * @param {String} value - Input value.\n * @param {Regex} regex - Regular expression object.\n * @returns {boolean}\n *\n * @author Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: string, regex: RegExp): boolean => {\n if (!value) return true\n\n if (!is(value, 'String') || !is(regex, 'RegExp')) return false\n\n return !!value && regex.test(value)\n },\n message: 'Formato inválido.'\n}\n\nRuleContainer.add('regex', rule)\nexport default rule\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\n/**\n * Validate if the given value is not empty\n *\n * @param {Any} value - The value of the input to be validated.\n * @returns {boolean} - True if the given value is not empty, false otherwise.\n *\n * @author Viniazvd, Erik Isidore\n * @version 0.1\n */\n\nconst rule: ValidationRule = {\n validate: (value: any): boolean => {\n if (Array.isArray(value)) return !!value.length\n if (typeof value === 'object') return !!Object.keys(value).length\n if (typeof value === 'string') return !!value.trim().length\n if (typeof value === 'number') return !!value\n if (typeof value === 'boolean') return true\n\n return !!value\n },\n message: 'Campo obrigatório.'\n}\n\nRuleContainer.add('required', rule)\nexport default rule\n","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\ntype ValueType = Array<any> | string | number\n\n/**\n * Checks to see if a given value is bigger than max length, if value\n * is string/array, checks the string length, if it is a number,\n * checks the value itself.\n *\n * @param {Array<any> | String | Number} value - Then given value\n * @param {Number | String} maxLength - the max length.\n * @returns {Boolean} - False if value exceeds max length.\n *\n * @author Erik Isidore\n * @version 0.1\n */\nconst rule: ValidationRule = {\n validate: (value: ValueType, maxLength: number | string): boolean => {\n if (!value) return true\n\n if (Array.isArray(value) || typeof value === 'string')\n return (value || []).length <= maxLength\n\n return maxLength >= value\n },\n message: 'Valor acima do limite.'\n}\n\nRuleContainer.add('maxLength', rule)\nexport default rule","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\ntype ValueType = Array<any> | string | number\n\n/**\n * Checks to see if a given value is bigger than min length, if value\n * is string/array, checks the string length, if it is a number,\n * checks the value itself.\n *\n * @param {Array<any> | String | Number} value - Then given value\n * @param {Number | String} minLength - the min length.\n * @returns {Boolean} - False if value is smaller than min length.\n *\n * @author Erik Isidore\n * @version 0.1\n */\nconst rule: ValidationRule = {\n validate: (value: ValueType, minLength: number | string): boolean => {\n if (!value) return true\n\n if (Array.isArray(value) || typeof value === 'string')\n return (value || []).length >= minLength\n\n return value >= minLength\n },\n message: 'Valor abaixo do limite.'\n}\n\nRuleContainer.add('minLength', rule)\nexport default rule","import RuleContainer from '../core/ruleContainer'\nimport { ValidationRule } from '../types'\n\nconst rule: ValidationRule = {\n validate: (value: string): boolean => {\n if (!value) return true\n\n const FTAP = '3298765432'\n const numPis = (value + '').replace(/[^\\d]+/g, '')\n\n const total = FTAP\n .split('')\n .reduce((total, digit, index) => total + (+numPis[index] * +digit), 0)\n\n let rest: number | string = (total % 11)\n\n if (rest !== 0) rest = 11 - rest\n\n if (rest === 10 || rest === 11) rest = (rest + '').slice(1, 2)\n\n if (+rest !== +(numPis.slice(10,11))) return false\n\n return true\n },\n message: 'Número de PIS inválido'\n}\n\nRuleContainer.add('pis', rule)\nexport default rule","import { Vue as VueComponent } from 'vue-property-decorator'\n\nimport FieldBag from './fieldBag'\nimport Field from './field'\n\nimport RuleContainer from './ruleContainer'\nimport { isFormScope, is } from '../utils'\nimport '../rules'\n\nimport {\n ValidatorOptionsObject,\n ValidatorOptions,\n NormalizedRule,\n ValidationRule,\n FormValidation,\n FieldValidation,\n FieldFlags,\n ValidatorOptionsFn,\n} from '../types'\n\n\n// ScopedValidor specific types\n\nexport interface VM extends VueComponent { [dataName: string]: any }\nexport type ScopedFormValidation = { [scope: string]: FormValidation }\nexport type FormTemplate = ScopedFormValidation | FormValidation\n\nexport type FormValidationFlags\n = { [scope: string]: { [fieldName: string]: FieldFlags } }\n | { [fieldName: string]: FieldFlags }\n\n\nexport default class ScopedValidator {\n private _vm: VM\n\n public fields: FieldBag\n public scopes: string[] = []\n\n private _options: ValidatorOptionsObject = {}\n public validations: FormValidationFlags = {}\n\n\n constructor (vm: VueComponent) {\n this._vm = vm\n this.fields = new FieldBag()\n\n vm.$nextTick(() => {\n if (this._vm.$options.validatorOptions)\n this.options = this._vm.$options.validatorOptions\n\n if (this._vm.$options.validations)\n this.init(this._vm.$options.validations)\n })\n }\n\n get options () {\n return this._options\n }\n\n set options (options: any) {\n this._options = is(options, 'Function')\n ? options(this._vm)\n : { ...options }\n }\n\n /**\n * This two following functions are responsible for bootstraping\n * the ScopedValidation class with the given validation options.\n * The public init function exists to ensure that whenever we're\n * bootstraping the ScopedValidator class, the DOM will be accessible\n * through the _vm.\n *\n * @param template - The form validations template object.\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n public init (template: FormTemplate): void {\n this._vm.$nextTick(this.__init.bind(this, template))\n }\n\n private __init (template: FormTemplate): void {\n this.scopes = Object.keys(template).filter(key => isFormScope(template[key]))\n this.fields.items = this.initFields(template)\n this.validations = this.mapValidations()\n }\n\n /**\n * Receives a FormTemplate object and maps the fields validation rules\n * in it to populate the `fields` instance property with Field instances.\n *\n * @param {FormTemplate} template - The form or forms validation object.\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n initFields (template: FormTemplate): Field[] {\n const mapField = (name: string, rules: FieldValidation, scope?: string): Field => {\n const fieldOptions = {\n name,\n rules,\n scope,\n vm: this._vm,\n el: this.getFieldEl(name, scope),\n value: scope ? this._vm[scope][name] : this._vm[name],\n }\n\n return new Field(fieldOptions)\n }\n\n // This will map each form scope name to an array of Field instances,\n // producing an Array of Field arrays, crazy rite? Each field will\n // have its respective scope assigned to it.\n const scopes = this.scopes.map((scope: string) => {\n const formScope: FormValidation = template[scope] as FormValidation\n\n return Object.keys(formScope)\n .map(fieldName => mapField(fieldName, formScope[fieldName], scope))\n })\n\n const fields: Field[] = Object.keys(template)\n .filter(key => !isFormScope(template[key]))\n .map(key => mapField(key, template[key]))\n\n return Array.prototype.concat(fields, ...scopes)\n }\n\n /**\n * Generetes the validation flags object based on the form scopes.\n *\n * @returns {FormValidationFlags}\n *\n * @author Erik Isidore\n */\n\n mapValidations (): FormValidationFlags {\n const mapFlags = (scope?: string) => this.fields.all(scope)\n .reduce((acc, field: Field) => ({ ...acc, [field.name]: field.flags }), {})\n\n const mapFormScopes = (acc: object, scope: string) => ({\n ...acc,\n [scope]: mapFlags(scope)\n })\n\n return this.scopes.length > 1\n ? this.scopes.reduce(mapFormScopes, { })\n : mapFlags()\n }\n\n /**\n * Receives a fieldName and optionally it's scope and returns the HTML\n * Element corresponding to that field in the DOM.\n *\n * @param {String} fieldName - The name of the field\n * @param {String} scope? - Optional form scope.\n * @returns {Element} - The first matching element found in the component DOM.\n *\n * @author Erik Isidore\n */\n\n getFieldEl (fieldName: string, scope?: string): Element {\n const fieldQuery = scope\n ? `form[name=\"${scope}\"] [name=\"${fieldName}\"]`\n : `[name=\"${fieldName}\"]`\n\n const fields: NodeList = this._vm.$el.querySelectorAll(fieldQuery)\n\n if (process.env.NODE_ENV !== 'production' && !fields.length)\n console.warn(`CeeValidate: Field \"${fieldName}\" could not be found in the DOM`)\n\n return <Element>fields[0]\n }\n\n /**\n * @param {String} fieldName -\n * @param {String} scope? -\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n validate (fieldName: string, scope?: string): boolean {\n const field = this.fields.get(fieldName, scope)\n\n // Field doesn't exist, return false (invalid field)\n if (!field) return false\n\n const mapErrors = ({ ruleName, args }: NormalizedRule): string => {\n const rule: ValidationRule = RuleContainer.getRule(ruleName)\n const hasError = !rule.validate.apply(null, [field.value, ...(args || [])])\n const errorMessage = rule.message\n\n return hasError ? errorMessage : ''\n }\n\n const fieldErrors: string[] = field.rules\n .map(mapErrors)\n .filter(message => !!message)\n\n field.setFlag('errors', fieldErrors)\n field.setFlag('valid', !fieldErrors.length)\n\n return !fieldErrors.length\n }\n\n /**\n * Executes the validate() method on all Field instances.\n *\n * @param {String} scope? -\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n validateAll (scope?: string): boolean {\n const fieldFlags = this.fields.all(scope)\n .map((field: Field) => field.validate())\n\n const isValid = fieldFlags.every(isValid => !!isValid)\n this.options = { ...(this.options || {}), noListeners: false }\n\n return isValid\n }\n\n /**\n * Resets all of the fields validation flags.\n *\n * @param {String} scope? -\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n reset (scope?: string): void {\n this.fields.all(scope).forEach((field: Field) => field.reset())\n }\n\n /**\n * Attaches a new field to the validator.\n *\n * @param {}\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n attach (field: { name: string, rules: string, scope: string }): void {\n const newField: Field = new Field({\n vm: this._vm,\n name: field.name,\n rules: field.rules,\n scope: field.scope,\n el: this.getFieldEl(field.name, field.scope),\n value: field.scope ? this._vm[field.scope][field.name] : this._vm[field.name]\n })\n\n this.fields.push(newField)\n this.validations = this.mapValidations()\n }\n\n /**\n * Detaches an existing field from the validator.\n *\n * @param {String} field - The name of the field\n * @param {String} scope? - Optional scope of the field\n * @returns {void}\n *\n * @author Erik Isidore\n */\n\n detach (field: string, scope?: string): void {\n this.fields.remove(field, scope)\n this.validations = this.mapValidations()\n }\n\n /**\n * Sets the rule of a field and validate it if it has changed.\n *\n * @param {Object<name: string, scope: string>} field - Object with name\n * and scope of the field.\n * @param {FieldValidation} rules - The rules to be set in the field\n * @returns {void}\n */\n setFieldRule (field: { name: string, scope: string }, rules: FieldValidation): void {\n const fieldInstance : Field | undefined = this.fields.get(field.name, field.scope)\n if (!fieldInstance) return\n\n fieldInstance.setRule(rules)\n\n if (fieldInstance.flags.changed) fieldInstance.validate()\n }\n}\n","import { Component, Vue } from 'vue-property-decorator'\n\nimport ScopedValidator from './core/scopedValidator'\n\n// eslint-disable\n@Component\nexport default class FormValidator extends Vue {\n public $validator: ScopedValidator\n public $validations: object\n\n // In the future we'll use this function to pass mixin options\n // and make some checkings before instantiating the ScopedValidator\n beforeCreate () {\n // Get Vue constructor\n const Vue = this.$options._base\n\n this.$validator = new ScopedValidator(this)\n\n // Setup computed properties on the component\n if (!this.$options.computed) this.$options.computed = {}\n\n Vue.util.defineReactive(this.$validator, 'validations', this.$validator.validations)\n this.$options.computed['$validations'] = () => this.$validator.validations\n }\n\n // Implement beforeDestroy ()\n}\n"],"names":["rule","formattingTokens","match2","match1to2","matchOffset","parseTokenExpressions","parseTokenFunctions","parsers","daysInMonths","makeParser","format","array","match","Error","length","i","token","regex","parser","replace","input","time","start","indexOf","part","substr","exec","index","value","call","days","year","day","month","checkDay","afternoon","undefined","hours","correctHours","addExpressionToken","addParseToken","tokens","property","check","callback","factor","milliseconds","seconds","minutes","this","zone","abbreviation","offset","string","parts","Math","abs","offsetFromString","o","C","proto","prototype","oldParse","parse","cfg","date","timestamp","Date","UTC","$d","error","Number","NaN","init","tslib_1.__extends","Component","Vue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGA;QAGE,kBAAa,KAAe;YAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAA;SAC1B;QAED,sBAAI,2BAAK;iBAAT,UAAW,KAAsB;gBAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACjB;;;WAAA;;;;;;;;QAUD,sBAAG,GAAH,UAAK,KAAa,EAAE,KAAc;YAChC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAC,IAAW,IAAK,OAAA,KAAK;kBAC1C,IAAI,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;kBAC3C,IAAI,CAAC,IAAI,KAAK,KAAK,GAAA,CAAC,CAAA;SACzB;;;;;;;QASD,sBAAG,GAAH,UAAK,KAAc;YACjB,OAAO,KAAK;kBACR,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,KAAK,KAAK,GAAA,CAAC;kBAC1C,IAAI,CAAC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