diff --git a/lib/js/definitions/autosuggest.js b/lib/js/definitions/autosuggest.js index 00d1abe..b7b9c33 100644 --- a/lib/js/definitions/autosuggest.js +++ b/lib/js/definitions/autosuggest.js @@ -23,17 +23,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // don't use for enum fields, they need access to the // list of enums and names -var schema = { - type: 'object', - properties: { - id: { - type: 'any' - }, - label: { - type: 'string' +function schema() { + return { + type: 'object', + properties: { + id: { + type: 'any' + }, + label: { + type: 'string' + } } - } -}; + }; +} /* * Create uiSchema for autosuggest diff --git a/lib/js/definitions/autosuggest.js.map b/lib/js/definitions/autosuggest.js.map index 68ab294..5258d4a 100644 --- a/lib/js/definitions/autosuggest.js.map +++ b/lib/js/definitions/autosuggest.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/autosuggest.js"],"names":["schema","type","properties","id","label","uiSchema","getOptions","options","validations","push","validateAutosuggestOption","AutosuggestField","showFieldLabel","maxOptions","autosuggestConfig"],"mappings":";;;;;;;;;;;;;;;AAEA;;;;AACA;;;;AAEA;AACA;AACA,IAAMA,SAAS;AACbC,QAAM,QADO;AAEbC,cAAY;AACVC,QAAI;AACFF,YAAM;AADJ,KADM;AAIVG,WAAO;AACLH,YAAM;AADD;AAJG;AAFC,CAAf;;AAYA;;;;;;;AAOA,SAASI,QAAT,CAAkBD,KAAlB,EAAyBE,UAAzB,EAAmD;AAAA,MAAdC,OAAc,uEAAJ,EAAI;;AACjD,MAAMC,cAAc,EAApB;AACA,MAAI,CAAC,mBAAM,sBAAN,EAA8BD,OAA9B,CAAL,EAA6C;AAC3CC,gBAAYC,IAAZ,CAAiBC,qCAAjB;AACD;;AAED,SAAO,qBAAQ;AACb,gBAAYN,KADC;AAEb,gBAAYO,0BAFC;AAGb,sBAAkBH,WAHL;AAIb,wBAAoB;AAClBP,YAAM;AADY,KAJP;AAOb,kBAAc;AACZW,sBAAgB,OADJ;AAEZC,kBAAY,EAFA;AAGZP;AAHY;AAPD,GAAR,EAYJC,OAZI,CAAP;AAaD;;AAEM,IAAMO,gDAAoB;AAC/Bd,gBAD+B;AAE/BK;AAF+B,CAA1B","file":"autosuggest.js","sourcesContent":["import _ from 'lodash/fp';\n\nimport AutosuggestField from '../fields/AutosuggestField';\nimport { validateAutosuggestOption } from '../validation';\n\n// don't use for enum fields, they need access to the\n// list of enums and names\nconst schema = {\n type: 'object',\n properties: {\n id: {\n type: 'any'\n },\n label: {\n type: 'string'\n }\n }\n};\n\n/*\n * Create uiSchema for autosuggest\n *\n * @param {string} label - Label for the field\n * @param {function} getOptions - Function that fetchs options to be shown and returns a promise\n * @param {object} options - Any other options to override the uiSchema defaults with\n */\nfunction uiSchema(label, getOptions, options = {}) {\n const validations = [];\n if (!_.get('ui:options.freeInput', options)) {\n validations.push(validateAutosuggestOption);\n }\n\n return _.merge({\n 'ui:title': label,\n 'ui:field': AutosuggestField,\n 'ui:validations': validations,\n 'ui:errorMessages': {\n type: 'Please select an option from the suggestions'\n },\n 'ui:options': {\n showFieldLabel: 'label',\n maxOptions: 20,\n getOptions\n }\n }, options);\n}\n\nexport const autosuggestConfig = {\n schema,\n uiSchema\n};\n\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/autosuggest.js"],"names":["schema","type","properties","id","label","uiSchema","getOptions","options","validations","push","validateAutosuggestOption","AutosuggestField","showFieldLabel","maxOptions","autosuggestConfig"],"mappings":";;;;;;;;;;;;;;;AAEA;;;;AACA;;;;AAEA;AACA;AACA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,QADD;AAELC,gBAAY;AACVC,UAAI;AACFF,cAAM;AADJ,OADM;AAIVG,aAAO;AACLH,cAAM;AADD;AAJG;AAFP,GAAP;AAWD;;AAED;;;;;;;AAOA,SAASI,QAAT,CAAkBD,KAAlB,EAAyBE,UAAzB,EAAmD;AAAA,MAAdC,OAAc,uEAAJ,EAAI;;AACjD,MAAMC,cAAc,EAApB;AACA,MAAI,CAAC,mBAAM,sBAAN,EAA8BD,OAA9B,CAAL,EAA6C;AAC3CC,gBAAYC,IAAZ,CAAiBC,qCAAjB;AACD;;AAED,SAAO,qBAAQ;AACb,gBAAYN,KADC;AAEb,gBAAYO,0BAFC;AAGb,sBAAkBH,WAHL;AAIb,wBAAoB;AAClBP,YAAM;AADY,KAJP;AAOb,kBAAc;AACZW,sBAAgB,OADJ;AAEZC,kBAAY,EAFA;AAGZP;AAHY;AAPD,GAAR,EAYJC,OAZI,CAAP;AAaD;;AAEM,IAAMO,gDAAoB;AAC/Bd,gBAD+B;AAE/BK;AAF+B,CAA1B","file":"autosuggest.js","sourcesContent":["import _ from 'lodash/fp';\n\nimport AutosuggestField from '../fields/AutosuggestField';\nimport { validateAutosuggestOption } from '../validation';\n\n// don't use for enum fields, they need access to the\n// list of enums and names\nfunction schema() {\n return {\n type: 'object',\n properties: {\n id: {\n type: 'any'\n },\n label: {\n type: 'string'\n }\n }\n };\n}\n\n/*\n * Create uiSchema for autosuggest\n *\n * @param {string} label - Label for the field\n * @param {function} getOptions - Function that fetchs options to be shown and returns a promise\n * @param {object} options - Any other options to override the uiSchema defaults with\n */\nfunction uiSchema(label, getOptions, options = {}) {\n const validations = [];\n if (!_.get('ui:options.freeInput', options)) {\n validations.push(validateAutosuggestOption);\n }\n\n return _.merge({\n 'ui:title': label,\n 'ui:field': AutosuggestField,\n 'ui:validations': validations,\n 'ui:errorMessages': {\n type: 'Please select an option from the suggestions'\n },\n 'ui:options': {\n showFieldLabel: 'label',\n maxOptions: 20,\n getOptions\n }\n }, options);\n}\n\nexport const autosuggestConfig = {\n schema,\n uiSchema\n};\n\n"]} \ No newline at end of file diff --git a/lib/js/definitions/currency.js b/lib/js/definitions/currency.js index 6504888..aa14de2 100644 --- a/lib/js/definitions/currency.js +++ b/lib/js/definitions/currency.js @@ -15,9 +15,11 @@ var _CurrencyWidget4 = _interopRequireDefault(_CurrencyWidget3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var schema = { - type: 'number' -}; +function schema() { + return { + type: 'number' + }; +} function uiSchema(title) { return { diff --git a/lib/js/definitions/currency.js.map b/lib/js/definitions/currency.js.map index 666ce48..1ad6979 100644 --- a/lib/js/definitions/currency.js.map +++ b/lib/js/definitions/currency.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/currency.js"],"names":["schema","type","uiSchema","title","CurrencyWidget","CurrencyReviewWidget","classNames","currencyConfig"],"mappings":";;;;;;;AAAA;;;;AACA;;;;;;AAEA,IAAMA,SAAS;AACbC,QAAM;AADO,CAAf;;AAIA,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,SAAO;AACL,iBAAaC,wBADR;AAEL,uBAAmBC,wBAFd;AAGL,gBAAYF,KAHP;AAIL,kBAAc;AACZG,kBAAY;AADA,KAJT;AAOL,wBAAoB;AAClBL,YAAM;AADY;AAPf,GAAP;AAWD;;AAEM,IAAMM,0CAAiB;AAC5BP,gBAD4B;AAE5BE;AAF4B,CAAvB","file":"currency.js","sourcesContent":["import CurrencyWidget from '../widgets/CurrencyWidget';\nimport CurrencyReviewWidget from '../review/CurrencyWidget';\n\nconst schema = {\n type: 'number'\n};\n\nfunction uiSchema(title) {\n return {\n 'ui:widget': CurrencyWidget,\n 'ui:reviewWidget': CurrencyReviewWidget,\n 'ui:title': title,\n 'ui:options': {\n classNames: 'schemaform-currency-input'\n },\n 'ui:errorMessages': {\n type: 'Please enter a valid dollar amount'\n }\n };\n}\n\nexport const currencyConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/currency.js"],"names":["schema","type","uiSchema","title","CurrencyWidget","CurrencyReviewWidget","classNames","currencyConfig"],"mappings":";;;;;;;AAAA;;;;AACA;;;;;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM;AADD,GAAP;AAGD;;AAED,SAASC,QAAT,CAAkBC,KAAlB,EAAyB;AACvB,SAAO;AACL,iBAAaC,wBADR;AAEL,uBAAmBC,wBAFd;AAGL,gBAAYF,KAHP;AAIL,kBAAc;AACZG,kBAAY;AADA,KAJT;AAOL,wBAAoB;AAClBL,YAAM;AADY;AAPf,GAAP;AAWD;;AAEM,IAAMM,0CAAiB;AAC5BP,gBAD4B;AAE5BE;AAF4B,CAAvB","file":"currency.js","sourcesContent":["import CurrencyWidget from '../widgets/CurrencyWidget';\nimport CurrencyReviewWidget from '../review/CurrencyWidget';\n\nfunction schema() {\n return {\n type: 'number'\n };\n}\n\nfunction uiSchema(title) {\n return {\n 'ui:widget': CurrencyWidget,\n 'ui:reviewWidget': CurrencyReviewWidget,\n 'ui:title': title,\n 'ui:options': {\n classNames: 'schemaform-currency-input'\n },\n 'ui:errorMessages': {\n type: 'Please enter a valid dollar amount'\n }\n };\n}\n\nexport const currencyConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/currentOrPastDate.js b/lib/js/definitions/currentOrPastDate.js index 4e7f17f..8963e05 100644 --- a/lib/js/definitions/currentOrPastDate.js +++ b/lib/js/definitions/currentOrPastDate.js @@ -9,7 +9,9 @@ var _validation = require('../validation'); var _date = require('./date'); -var schema = _date.dateConfig.schema; +function schema() { + return _date.dateConfig.schema(); +} function uiSchema() { var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Date'; diff --git a/lib/js/definitions/currentOrPastDate.js.map b/lib/js/definitions/currentOrPastDate.js.map index ae2fe77..9d8ced3 100644 --- a/lib/js/definitions/currentOrPastDate.js.map +++ b/lib/js/definitions/currentOrPastDate.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/currentOrPastDate.js"],"names":["schema","dateConfig","uiSchema","title","validateCurrentOrPastDate","pattern","currentOrPastDateConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,IAAMA,SAASC,iBAAWD,MAA1B;;AAEA,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,sBAAkB,CAChBC,qCADgB,CAHb;AAML,wBAAoB;AAClBC,eAAS;AADS;AANf,GAAP;AAUD;;AAEM,IAAMC,4DAA0B;AACrCN,gBADqC;AAErCE;AAFqC,CAAhC","file":"currentOrPastDate.js","sourcesContent":["import { validateCurrentOrPastDate } from '../validation';\nimport { dateConfig } from './date';\n\nconst schema = dateConfig.schema;\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:validations': [\n validateCurrentOrPastDate\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid current or past date'\n }\n };\n}\n\nexport const currentOrPastDateConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/currentOrPastDate.js"],"names":["schema","dateConfig","uiSchema","title","validateCurrentOrPastDate","pattern","currentOrPastDateConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAOC,iBAAWD,MAAX,EAAP;AACD;;AAED,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,sBAAkB,CAChBC,qCADgB,CAHb;AAML,wBAAoB;AAClBC,eAAS;AADS;AANf,GAAP;AAUD;;AAEM,IAAMC,4DAA0B;AACrCN,gBADqC;AAErCE;AAFqC,CAAhC","file":"currentOrPastDate.js","sourcesContent":["import { validateCurrentOrPastDate } from '../validation';\nimport { dateConfig } from './date';\n\nfunction schema() {\n return dateConfig.schema();\n}\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:validations': [\n validateCurrentOrPastDate\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid current or past date'\n }\n };\n}\n\nexport const currentOrPastDateConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/currentOrPastMonthYear.js b/lib/js/definitions/currentOrPastMonthYear.js index e1de4b3..72548f8 100644 --- a/lib/js/definitions/currentOrPastMonthYear.js +++ b/lib/js/definitions/currentOrPastMonthYear.js @@ -17,7 +17,9 @@ var _monthYear = require('./monthYear'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var schema = _date.dateConfig.schema; +function schema() { + return _date.dateConfig.schema(); +} function uiSchema() { var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Date'; diff --git a/lib/js/definitions/currentOrPastMonthYear.js.map b/lib/js/definitions/currentOrPastMonthYear.js.map index 5a85a6b..e148c2d 100644 --- a/lib/js/definitions/currentOrPastMonthYear.js.map +++ b/lib/js/definitions/currentOrPastMonthYear.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/currentOrPastMonthYear.js"],"names":["schema","dateConfig","uiSchema","title","monthYearConfig","validateCurrentOrPastMonthYear","pattern","currentOrPastMonthYearConfig"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,SAASC,iBAAWD,MAA1B;;AAEA,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO,sBAASC,2BAAgBF,QAAhB,CAAyBC,KAAzB,CAAT,EAA0C;AAC/C,sBAAkB,CAChBE,0CADgB,CAD6B;AAI/C,wBAAoB;AAClBC,eAAS;AADS;AAJ2B,GAA1C,CAAP;AAQD;;AAEM,IAAMC,sEAA+B;AAC1CP,gBAD0C;AAE1CE;AAF0C,CAArC","file":"currentOrPastMonthYear.js","sourcesContent":["import _ from 'lodash/fp';\nimport { validateCurrentOrPastMonthYear } from '../validation';\nimport { dateConfig } from './date';\nimport { monthYearConfig } from './monthYear';\n\nconst schema = dateConfig.schema;\n\nfunction uiSchema(title = 'Date') {\n return _.assign(monthYearConfig.uiSchema(title), {\n 'ui:validations': [\n validateCurrentOrPastMonthYear\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid current or past date'\n }\n });\n}\n\nexport const currentOrPastMonthYearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/currentOrPastMonthYear.js"],"names":["schema","dateConfig","uiSchema","title","monthYearConfig","validateCurrentOrPastMonthYear","pattern","currentOrPastMonthYearConfig"],"mappings":";;;;;;;;;;;AACA;;AACA;;AACA;;;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAOC,iBAAWD,MAAX,EAAP;AACD;;AAED,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO,sBAASC,2BAAgBF,QAAhB,CAAyBC,KAAzB,CAAT,EAA0C;AAC/C,sBAAkB,CAChBE,0CADgB,CAD6B;AAI/C,wBAAoB;AAClBC,eAAS;AADS;AAJ2B,GAA1C,CAAP;AAQD;;AAEM,IAAMC,sEAA+B;AAC1CP,gBAD0C;AAE1CE;AAF0C,CAArC","file":"currentOrPastMonthYear.js","sourcesContent":["import _ from 'lodash/fp';\nimport { validateCurrentOrPastMonthYear } from '../validation';\nimport { dateConfig } from './date';\nimport { monthYearConfig } from './monthYear';\n\nfunction schema() {\n return dateConfig.schema();\n}\n\nfunction uiSchema(title = 'Date') {\n return _.assign(monthYearConfig.uiSchema(title), {\n 'ui:validations': [\n validateCurrentOrPastMonthYear\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid current or past date'\n }\n });\n}\n\nexport const currentOrPastMonthYearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/date.js b/lib/js/definitions/date.js index 01971cf..6e13df7 100644 --- a/lib/js/definitions/date.js +++ b/lib/js/definitions/date.js @@ -3,14 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); -exports.dateConfig = exports.schema = undefined; +exports.dateConfig = undefined; var _validation = require('../validation'); -var schema = exports.schema = { - pattern: '^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$', - type: 'string' -}; +function schema() { + return { + type: 'string', + pattern: '^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$' + }; +} function uiSchema() { var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Date'; diff --git a/lib/js/definitions/date.js.map b/lib/js/definitions/date.js.map index 0c6aa66..7100f7e 100644 --- a/lib/js/definitions/date.js.map +++ b/lib/js/definitions/date.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/date.js"],"names":["schema","pattern","type","uiSchema","title","validateDate","dateConfig"],"mappings":";;;;;;;AAAA;;AAEO,IAAMA,0BAAS;AACpBC,WAAS,kEADW;AAEpBC,QAAM;AAFc,CAAf;;AAKP,SAASC,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,sBAAkB,CAChBC,wBADgB,CAHb;AAML,wBAAoB;AAClBJ,eAAS;AADS;AANf,GAAP;AAUD;;AAEM,IAAMK,kCAAa;AACxBN,gBADwB;AAExBG;AAFwB,CAAnB","file":"date.js","sourcesContent":["import { validateDate } from '../validation';\n\nexport const schema = {\n pattern: '^(\\\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$',\n type: 'string'\n};\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:validations': [\n validateDate\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid date'\n }\n };\n}\n\nexport const dateConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/date.js"],"names":["schema","type","pattern","uiSchema","title","validateDate","dateConfig"],"mappings":";;;;;;;AAAA;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,QADD;AAELC,aAAS;AAFJ,GAAP;AAID;;AAED,SAASC,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,sBAAkB,CAChBC,wBADgB,CAHb;AAML,wBAAoB;AAClBH,eAAS;AADS;AANf,GAAP;AAUD;;AAEM,IAAMI,kCAAa;AACxBN,gBADwB;AAExBG;AAFwB,CAAnB","file":"date.js","sourcesContent":["import { validateDate } from '../validation';\n\nfunction schema() {\n return {\n type: 'string',\n pattern: '^(\\\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$'\n };\n}\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:validations': [\n validateDate\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid date'\n }\n };\n}\n\nexport const dateConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/dateRange.js b/lib/js/definitions/dateRange.js index 9750e52..6d52d0d 100644 --- a/lib/js/definitions/dateRange.js +++ b/lib/js/definitions/dateRange.js @@ -9,13 +9,15 @@ var _validation = require('../validation'); var _date = require('./date'); -var schema = { - type: 'object', - properties: { - from: _date.dateConfig.schema, - to: _date.dateConfig.schema - } -}; +function schema() { + return { + type: 'object', + properties: { + from: _date.dateConfig.schema(), + to: _date.dateConfig.schema() + } + }; +} function uiSchema() { var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'From'; diff --git a/lib/js/definitions/dateRange.js.map b/lib/js/definitions/dateRange.js.map index 06a6ad0..33889c4 100644 --- a/lib/js/definitions/dateRange.js.map +++ b/lib/js/definitions/dateRange.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/dateRange.js"],"names":["schema","type","properties","from","dateConfig","to","uiSchema","rangeError","validateDateRange","pattern","dateRangeConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,IAAMA,SAAS;AACbC,QAAM,QADO;AAEbC,cAAY;AACVC,UAAMC,iBAAWJ,MADP;AAEVK,QAAID,iBAAWJ;AAFL;AAFC,CAAf;;AAQA,SAASM,QAAT,GAA4F;AAAA,MAA1EH,IAA0E,uEAAnE,MAAmE;AAAA,MAA3DE,EAA2D,uEAAtD,IAAsD;AAAA,MAAhDE,UAAgD,uEAAnC,iCAAmC;;AAC1F,SAAO;AACL,sBAAkB,CAChBC,6BADgB,CADb;AAIL,wBAAoB;AAClBC,eAASF;AADS,KAJf;AAOLJ,UAAMC,iBAAWE,QAAX,CAAoBH,IAApB,CAPD;AAQLE,QAAID,iBAAWE,QAAX,CAAoBD,EAApB;AARC,GAAP;AAUD;;AAEM,IAAMK,4CAAkB;AAC7BV,gBAD6B;AAE7BM;AAF6B,CAAxB","file":"dateRange.js","sourcesContent":["import { validateDateRange } from '../validation';\nimport { dateConfig } from './date';\n\nconst schema = {\n type: 'object',\n properties: {\n from: dateConfig.schema,\n to: dateConfig.schema\n }\n};\n\nfunction uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') {\n return {\n 'ui:validations': [\n validateDateRange\n ],\n 'ui:errorMessages': {\n pattern: rangeError,\n },\n from: dateConfig.uiSchema(from),\n to: dateConfig.uiSchema(to)\n };\n}\n\nexport const dateRangeConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/dateRange.js"],"names":["schema","type","properties","from","dateConfig","to","uiSchema","rangeError","validateDateRange","pattern","dateRangeConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,QADD;AAELC,gBAAY;AACVC,YAAMC,iBAAWJ,MAAX,EADI;AAEVK,UAAID,iBAAWJ,MAAX;AAFM;AAFP,GAAP;AAOD;;AAED,SAASM,QAAT,GAA4F;AAAA,MAA1EH,IAA0E,uEAAnE,MAAmE;AAAA,MAA3DE,EAA2D,uEAAtD,IAAsD;AAAA,MAAhDE,UAAgD,uEAAnC,iCAAmC;;AAC1F,SAAO;AACL,sBAAkB,CAChBC,6BADgB,CADb;AAIL,wBAAoB;AAClBC,eAASF;AADS,KAJf;AAOLJ,UAAMC,iBAAWE,QAAX,CAAoBH,IAApB,CAPD;AAQLE,QAAID,iBAAWE,QAAX,CAAoBD,EAApB;AARC,GAAP;AAUD;;AAEM,IAAMK,4CAAkB;AAC7BV,gBAD6B;AAE7BM;AAF6B,CAAxB","file":"dateRange.js","sourcesContent":["import { validateDateRange } from '../validation';\nimport { dateConfig } from './date';\n\nfunction schema() {\n return {\n type: 'object',\n properties: {\n from: dateConfig.schema(),\n to: dateConfig.schema()\n }\n };\n}\n\nfunction uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') {\n return {\n 'ui:validations': [\n validateDateRange\n ],\n 'ui:errorMessages': {\n pattern: rangeError,\n },\n from: dateConfig.uiSchema(from),\n to: dateConfig.uiSchema(to)\n };\n}\n\nexport const dateRangeConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/file.js b/lib/js/definitions/file.js index c6db8ed..f8fb2ff 100644 --- a/lib/js/definitions/file.js +++ b/lib/js/definitions/file.js @@ -17,23 +17,25 @@ var _validation = require('../validation'); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var schema = { - type: 'array', - items: { - type: 'object', - properties: { - name: { - type: 'string' - }, - size: { - type: 'integer' - }, - confirmationCode: { - type: 'string' +function schema() { + return { + type: 'array', + items: { + type: 'object', + properties: { + name: { + type: 'string' + }, + size: { + type: 'integer' + }, + confirmationCode: { + type: 'string' + } } } - } -}; + }; +} function uiSchema(label) { var userOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; diff --git a/lib/js/definitions/file.js.map b/lib/js/definitions/file.js.map index 4c664c0..9a7962b 100644 --- a/lib/js/definitions/file.js.map +++ b/lib/js/definitions/file.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/file.js"],"names":["schema","type","items","properties","name","size","confirmationCode","uiSchema","label","userOptions","FileField","fileTypes","maxSize","minSize","createPayload","file","formId","payload","FormData","append","parseResponse","fileInfo","data","attributes","addAnotherLabel","showFieldLabel","keepInPageOnReview","classNames","required","minItems","validateFileField","fileConfig"],"mappings":";;;;;;;;;;;AAEA;;;;AACA;;;;AAEA,IAAMA,SAAS;AACbC,QAAM,OADO;AAEbC,SAAO;AACLD,UAAM,QADD;AAELE,gBAAY;AACVC,YAAM;AACJH,cAAM;AADF,OADI;AAIVI,YAAM;AACJJ,cAAM;AADF,OAJI;AAOVK,wBAAkB;AAChBL,cAAM;AADU;AAPR;AAFP;AAFM,CAAf;;AAkBA,SAASM,QAAT,CAAkBC,KAAlB,EAA2C;AAAA,MAAlBC,WAAkB,uEAAJ,EAAI;;AACzC,SAAO;AACL,gBAAYD,KADP;AAEL,gBAAYE,mBAFP;AAGL,kBAAc,sBAAS;AACrBC,iBAAW,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,EAAuB,KAAvB,CADU;AAErBC,eAAS,QAFY;AAGrBC,eAAS,IAHY;AAIrBC,qBAAe,uBAACC,IAAD,EAAOC,MAAP,EAAkB;AAC/B,YAAMC,UAAU,IAAIC,QAAJ,EAAhB;AACAD,gBAAQE,MAAR,CAAe,MAAf,EAAuBJ,IAAvB;AACAE,gBAAQE,MAAR,CAAe,SAAf,EAA0BH,MAA1B;;AAEA,eAAOC,OAAP;AACD,OAVoB;AAWrBG,qBAAe,uBAACC,QAAD,EAAc;AAC3B,eAAO;AACLjB,gBAAMiB,SAASC,IAAT,CAAcC,UAAd,CAAyBnB,IAD1B;AAELC,gBAAMgB,SAASC,IAAT,CAAcC,UAAd,CAAyBlB,IAF1B;AAGLC,4BAAkBe,SAASC,IAAT,CAAcC,UAAd,CAAyBjB;AAHtC,SAAP;AAKD,OAjBoB;AAkBrBkB,uBAAiB,aAlBI;AAmBrBC,sBAAgB,IAnBK;AAoBrBC,0BAAoB,IApBC;AAqBrBC,kBAAY;AArBS,KAAT,EAsBXlB,WAtBW,CAHT;AA0BL,wBAAoB;AAClBmB,gBAAU,wBADQ;AAElBC,gBAAU;AAFQ,KA1Bf;AA8BL,sBAAkB,CAChBC,6BADgB;AA9Bb,GAAP;AAkCD;;AAEM,IAAMC,kCAAa;AACxB/B,gBADwB;AAExBO;AAFwB,CAAnB","file":"file.js","sourcesContent":["import _ from 'lodash/fp';\n\nimport FileField from '../fields/FileField';\nimport { validateFileField } from '../validation';\n\nconst schema = {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n size: {\n type: 'integer'\n },\n confirmationCode: {\n type: 'string'\n }\n }\n }\n};\n\nfunction uiSchema(label, userOptions = {}) {\n return {\n 'ui:title': label,\n 'ui:field': FileField,\n 'ui:options': _.assign({\n fileTypes: ['pdf', 'jpg', 'jpeg', 'png'],\n maxSize: 20971520,\n minSize: 1024,\n createPayload: (file, formId) => {\n const payload = new FormData();\n payload.append('file', file);\n payload.append('form_id', formId);\n\n return payload;\n },\n parseResponse: (fileInfo) => {\n return {\n name: fileInfo.data.attributes.name,\n size: fileInfo.data.attributes.size,\n confirmationCode: fileInfo.data.attributes.confirmationCode\n };\n },\n addAnotherLabel: 'Add Another',\n showFieldLabel: true,\n keepInPageOnReview: true,\n classNames: 'schemaform-file-upload'\n }, userOptions),\n 'ui:errorMessages': {\n required: 'You must upload a file',\n minItems: 'You must upload a file'\n },\n 'ui:validations': [\n validateFileField\n ]\n };\n}\n\nexport const fileConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/file.js"],"names":["schema","type","items","properties","name","size","confirmationCode","uiSchema","label","userOptions","FileField","fileTypes","maxSize","minSize","createPayload","file","formId","payload","FormData","append","parseResponse","fileInfo","data","attributes","addAnotherLabel","showFieldLabel","keepInPageOnReview","classNames","required","minItems","validateFileField","fileConfig"],"mappings":";;;;;;;;;;;AAEA;;;;AACA;;;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,OADD;AAELC,WAAO;AACLD,YAAM,QADD;AAELE,kBAAY;AACVC,cAAM;AACJH,gBAAM;AADF,SADI;AAIVI,cAAM;AACJJ,gBAAM;AADF,SAJI;AAOVK,0BAAkB;AAChBL,gBAAM;AADU;AAPR;AAFP;AAFF,GAAP;AAiBD;;AAED,SAASM,QAAT,CAAkBC,KAAlB,EAA2C;AAAA,MAAlBC,WAAkB,uEAAJ,EAAI;;AACzC,SAAO;AACL,gBAAYD,KADP;AAEL,gBAAYE,mBAFP;AAGL,kBAAc,sBAAS;AACrBC,iBAAW,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,EAAuB,KAAvB,CADU;AAErBC,eAAS,QAFY;AAGrBC,eAAS,IAHY;AAIrBC,qBAAe,uBAACC,IAAD,EAAOC,MAAP,EAAkB;AAC/B,YAAMC,UAAU,IAAIC,QAAJ,EAAhB;AACAD,gBAAQE,MAAR,CAAe,MAAf,EAAuBJ,IAAvB;AACAE,gBAAQE,MAAR,CAAe,SAAf,EAA0BH,MAA1B;;AAEA,eAAOC,OAAP;AACD,OAVoB;AAWrBG,qBAAe,uBAACC,QAAD,EAAc;AAC3B,eAAO;AACLjB,gBAAMiB,SAASC,IAAT,CAAcC,UAAd,CAAyBnB,IAD1B;AAELC,gBAAMgB,SAASC,IAAT,CAAcC,UAAd,CAAyBlB,IAF1B;AAGLC,4BAAkBe,SAASC,IAAT,CAAcC,UAAd,CAAyBjB;AAHtC,SAAP;AAKD,OAjBoB;AAkBrBkB,uBAAiB,aAlBI;AAmBrBC,sBAAgB,IAnBK;AAoBrBC,0BAAoB,IApBC;AAqBrBC,kBAAY;AArBS,KAAT,EAsBXlB,WAtBW,CAHT;AA0BL,wBAAoB;AAClBmB,gBAAU,wBADQ;AAElBC,gBAAU;AAFQ,KA1Bf;AA8BL,sBAAkB,CAChBC,6BADgB;AA9Bb,GAAP;AAkCD;;AAEM,IAAMC,kCAAa;AACxB/B,gBADwB;AAExBO;AAFwB,CAAnB","file":"file.js","sourcesContent":["import _ from 'lodash/fp';\n\nimport FileField from '../fields/FileField';\nimport { validateFileField } from '../validation';\n\nfunction schema() {\n return {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string'\n },\n size: {\n type: 'integer'\n },\n confirmationCode: {\n type: 'string'\n }\n }\n }\n };\n}\n\nfunction uiSchema(label, userOptions = {}) {\n return {\n 'ui:title': label,\n 'ui:field': FileField,\n 'ui:options': _.assign({\n fileTypes: ['pdf', 'jpg', 'jpeg', 'png'],\n maxSize: 20971520,\n minSize: 1024,\n createPayload: (file, formId) => {\n const payload = new FormData();\n payload.append('file', file);\n payload.append('form_id', formId);\n\n return payload;\n },\n parseResponse: (fileInfo) => {\n return {\n name: fileInfo.data.attributes.name,\n size: fileInfo.data.attributes.size,\n confirmationCode: fileInfo.data.attributes.confirmationCode\n };\n },\n addAnotherLabel: 'Add Another',\n showFieldLabel: true,\n keepInPageOnReview: true,\n classNames: 'schemaform-file-upload'\n }, userOptions),\n 'ui:errorMessages': {\n required: 'You must upload a file',\n minItems: 'You must upload a file'\n },\n 'ui:validations': [\n validateFileField\n ]\n };\n}\n\nexport const fileConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/monthYear.js b/lib/js/definitions/monthYear.js index 27308d1..735f606 100644 --- a/lib/js/definitions/monthYear.js +++ b/lib/js/definitions/monthYear.js @@ -9,7 +9,9 @@ var _validation = require('../validation'); var _date = require('./date'); -var schema = _date.dateConfig.schema; +function schema() { + return _date.dateConfig.schema(); +} function uiSchema() { var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Date'; diff --git a/lib/js/definitions/monthYear.js.map b/lib/js/definitions/monthYear.js.map index b5490c2..fdfffa8 100644 --- a/lib/js/definitions/monthYear.js.map +++ b/lib/js/definitions/monthYear.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/monthYear.js"],"names":["schema","dateConfig","uiSchema","title","monthYear","validateMonthYear","pattern","monthYearConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,IAAMA,SAASC,iBAAWD,MAA1B;;AAEA,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,kBAAc;AACZC,iBAAW;AADC,KAHT;AAML,sBAAkB,CAChBC,6BADgB,CANb;AASL,wBAAoB;AAClBC,eAAS;AADS;AATf,GAAP;AAaD;;AAEM,IAAMC,4CAAkB;AAC7BP,gBAD6B;AAE7BE;AAF6B,CAAxB","file":"monthYear.js","sourcesContent":["import { validateMonthYear } from '../validation';\nimport { dateConfig } from './date';\n\nconst schema = dateConfig.schema;\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:options': {\n monthYear: true\n },\n 'ui:validations': [\n validateMonthYear\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid date'\n }\n };\n}\n\nexport const monthYearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/monthYear.js"],"names":["schema","dateConfig","uiSchema","title","monthYear","validateMonthYear","pattern","monthYearConfig"],"mappings":";;;;;;;AAAA;;AACA;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAOC,iBAAWD,MAAX,EAAP;AACD;;AAED,SAASE,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,iBAAa,MAFR;AAGL,kBAAc;AACZC,iBAAW;AADC,KAHT;AAML,sBAAkB,CAChBC,6BADgB,CANb;AASL,wBAAoB;AAClBC,eAAS;AADS;AATf,GAAP;AAaD;;AAEM,IAAMC,4CAAkB;AAC7BP,gBAD6B;AAE7BE;AAF6B,CAAxB","file":"monthYear.js","sourcesContent":["import { validateMonthYear } from '../validation';\nimport { dateConfig } from './date';\n\nfunction schema() {\n return dateConfig.schema();\n}\n\nfunction uiSchema(title = 'Date') {\n return {\n 'ui:title': title,\n 'ui:widget': 'date',\n 'ui:options': {\n monthYear: true\n },\n 'ui:validations': [\n validateMonthYear\n ],\n 'ui:errorMessages': {\n pattern: 'Please provide a valid date'\n }\n };\n}\n\nexport const monthYearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/monthYearRange.js b/lib/js/definitions/monthYearRange.js index 028eb49..06e5939 100644 --- a/lib/js/definitions/monthYearRange.js +++ b/lib/js/definitions/monthYearRange.js @@ -11,7 +11,9 @@ var _monthYear = require('./monthYear'); var _dateRange = require('./dateRange'); -var schema = _dateRange.dateRangeConfig.schema; +function schema() { + return _dateRange.dateRangeConfig.schema(); +} function uiSchema() { var from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'From'; diff --git a/lib/js/definitions/monthYearRange.js.map b/lib/js/definitions/monthYearRange.js.map index 3fae049..4810ec9 100644 --- a/lib/js/definitions/monthYearRange.js.map +++ b/lib/js/definitions/monthYearRange.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/monthYearRange.js"],"names":["schema","dateRangeConfig","uiSchema","from","to","rangeError","validateDateRange","pattern","monthYearConfig","monthYearRangeConfig"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA,IAAMA,SAASC,2BAAgBD,MAA/B;;AAEA,SAASE,QAAT,GAA4F;AAAA,MAA1EC,IAA0E,uEAAnE,MAAmE;AAAA,MAA3DC,EAA2D,uEAAtD,IAAsD;AAAA,MAAhDC,UAAgD,uEAAnC,iCAAmC;;AAC1F,SAAO;AACL,sBAAkB,CAChBC,6BADgB,CADb;AAIL,wBAAoB;AAClBC,eAASF;AADS,KAJf;AAOLF,UAAMK,2BAAgBN,QAAhB,CAAyBC,IAAzB,CAPD;AAQLC,QAAII,2BAAgBN,QAAhB,CAAyBE,EAAzB;AARC,GAAP;AAUD;;AAEM,IAAMK,sDAAuB;AAClCT,gBADkC;AAElCE;AAFkC,CAA7B","file":"monthYearRange.js","sourcesContent":["import { validateDateRange } from '../validation';\nimport { monthYearConfig } from './monthYear';\nimport { dateRangeConfig } from './dateRange';\n\nconst schema = dateRangeConfig.schema;\n\nfunction uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') {\n return {\n 'ui:validations': [\n validateDateRange\n ],\n 'ui:errorMessages': {\n pattern: rangeError,\n },\n from: monthYearConfig.uiSchema(from),\n to: monthYearConfig.uiSchema(to)\n };\n}\n\nexport const monthYearRangeConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/monthYearRange.js"],"names":["schema","dateRangeConfig","uiSchema","from","to","rangeError","validateDateRange","pattern","monthYearConfig","monthYearRangeConfig"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAOC,2BAAgBD,MAAhB,EAAP;AACD;;AAED,SAASE,QAAT,GAA4F;AAAA,MAA1EC,IAA0E,uEAAnE,MAAmE;AAAA,MAA3DC,EAA2D,uEAAtD,IAAsD;AAAA,MAAhDC,UAAgD,uEAAnC,iCAAmC;;AAC1F,SAAO;AACL,sBAAkB,CAChBC,6BADgB,CADb;AAIL,wBAAoB;AAClBC,eAASF;AADS,KAJf;AAOLF,UAAMK,2BAAgBN,QAAhB,CAAyBC,IAAzB,CAPD;AAQLC,QAAII,2BAAgBN,QAAhB,CAAyBE,EAAzB;AARC,GAAP;AAUD;;AAEM,IAAMK,sDAAuB;AAClCT,gBADkC;AAElCE;AAFkC,CAA7B","file":"monthYearRange.js","sourcesContent":["import { validateDateRange } from '../validation';\nimport { monthYearConfig } from './monthYear';\nimport { dateRangeConfig } from './dateRange';\n\nfunction schema() {\n return dateRangeConfig.schema();\n}\n\nfunction uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') {\n return {\n 'ui:validations': [\n validateDateRange\n ],\n 'ui:errorMessages': {\n pattern: rangeError,\n },\n from: monthYearConfig.uiSchema(from),\n to: monthYearConfig.uiSchema(to)\n };\n}\n\nexport const monthYearRangeConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/phone.js b/lib/js/definitions/phone.js index 9e7a875..ec138a2 100644 --- a/lib/js/definitions/phone.js +++ b/lib/js/definitions/phone.js @@ -15,10 +15,12 @@ var _PhoneNumberWidget4 = _interopRequireDefault(_PhoneNumberWidget3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var schema = { - type: 'string', - minLength: 10 -}; +function schema() { + return { + type: 'string', + minLength: 10 + }; +} /* * Phone uiSchema diff --git a/lib/js/definitions/phone.js.map b/lib/js/definitions/phone.js.map index a857a18..fc5e77f 100644 --- a/lib/js/definitions/phone.js.map +++ b/lib/js/definitions/phone.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/phone.js"],"names":["schema","type","minLength","uiSchema","title","PhoneNumberWidget","PhoneNumberReviewWidget","pattern","widgetClassNames","inputType","phoneConfig"],"mappings":";;;;;;;AAAA;;;;AACA;;;;;;AAEA,IAAMA,SAAS;AACbC,QAAM,QADO;AAEbC,aAAW;AAFE,CAAf;;AAKA;;;;;AAKA,SAASC,QAAT,GAAmC;AAAA,MAAjBC,KAAiB,uEAAT,OAAS;;AACjC,SAAO;AACL,iBAAaC,2BADR;AAEL,uBAAmBC,2BAFd;AAGL,gBAAYF,KAHP;AAIL,wBAAoB;AAClBG,eAAS;AADS,KAJf;AAOL,kBAAc;AACZC,wBAAkB,kCADN;AAEZC,iBAAW;AAFC;AAPT,GAAP;AAYD;;AAEM,IAAMC,oCAAc;AACzBV,gBADyB;AAEzBG;AAFyB,CAApB","file":"phone.js","sourcesContent":["import PhoneNumberWidget from '../widgets/PhoneNumberWidget';\nimport PhoneNumberReviewWidget from '../review/PhoneNumberWidget';\n\nconst schema = {\n type: 'string',\n minLength: 10\n};\n\n/*\n * Phone uiSchema\n *\n * @param {string} title - The field label, defaults to Phone\n */\nfunction uiSchema(title = 'Phone') {\n return {\n 'ui:widget': PhoneNumberWidget,\n 'ui:reviewWidget': PhoneNumberReviewWidget,\n 'ui:title': title,\n 'ui:errorMessages': {\n pattern: 'Phone numbers must be 10 digits'\n },\n 'ui:options': {\n widgetClassNames: 'home-phone va-input-medium-large',\n inputType: 'tel'\n }\n };\n}\n\nexport const phoneConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/phone.js"],"names":["schema","type","minLength","uiSchema","title","PhoneNumberWidget","PhoneNumberReviewWidget","pattern","widgetClassNames","inputType","phoneConfig"],"mappings":";;;;;;;AAAA;;;;AACA;;;;;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,QADD;AAELC,eAAW;AAFN,GAAP;AAID;;AAED;;;;;AAKA,SAASC,QAAT,GAAmC;AAAA,MAAjBC,KAAiB,uEAAT,OAAS;;AACjC,SAAO;AACL,iBAAaC,2BADR;AAEL,uBAAmBC,2BAFd;AAGL,gBAAYF,KAHP;AAIL,wBAAoB;AAClBG,eAAS;AADS,KAJf;AAOL,kBAAc;AACZC,wBAAkB,kCADN;AAEZC,iBAAW;AAFC;AAPT,GAAP;AAYD;;AAEM,IAAMC,oCAAc;AACzBV,gBADyB;AAEzBG;AAFyB,CAApB","file":"phone.js","sourcesContent":["import PhoneNumberWidget from '../widgets/PhoneNumberWidget';\nimport PhoneNumberReviewWidget from '../review/PhoneNumberWidget';\n\nfunction schema() {\n return {\n type: 'string',\n minLength: 10\n };\n}\n\n/*\n * Phone uiSchema\n *\n * @param {string} title - The field label, defaults to Phone\n */\nfunction uiSchema(title = 'Phone') {\n return {\n 'ui:widget': PhoneNumberWidget,\n 'ui:reviewWidget': PhoneNumberReviewWidget,\n 'ui:title': title,\n 'ui:errorMessages': {\n pattern: 'Phone numbers must be 10 digits'\n },\n 'ui:options': {\n widgetClassNames: 'home-phone va-input-medium-large',\n inputType: 'tel'\n }\n };\n}\n\nexport const phoneConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/ssn.js b/lib/js/definitions/ssn.js index 89aa619..e649c47 100644 --- a/lib/js/definitions/ssn.js +++ b/lib/js/definitions/ssn.js @@ -17,23 +17,29 @@ var _SSNWidget4 = _interopRequireDefault(_SSNWidget3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var schema = { - type: 'string', - pattern: '^[0-9]{9}$' -}; - -var uiSchema = { - 'ui:widget': _SSNWidget2.default, - 'ui:reviewWidget': _SSNWidget4.default, - 'ui:title': 'Social Security number', - 'ui:options': { - widgetClassNames: 'usa-input-medium' - }, - 'ui:validations': [_validation.validateSSN], - 'ui:errorMessages': { - pattern: 'Please enter a valid 9 digit SSN (dashes allowed)' - } -}; +function schema() { + return { + type: 'string', + pattern: '^[0-9]{9}$' + }; +} + +function uiSchema() { + var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Social Security Number'; + + return { + 'ui:widget': _SSNWidget2.default, + 'ui:reviewWidget': _SSNWidget4.default, + 'ui:title': title, + 'ui:options': { + widgetClassNames: 'usa-input-medium' + }, + 'ui:validations': [_validation.validateSSN], + 'ui:errorMessages': { + pattern: 'Please enter a valid 9 digit SSN (dashes allowed)' + } + }; +} var ssnConfig = exports.ssnConfig = { schema: schema, diff --git a/lib/js/definitions/ssn.js.map b/lib/js/definitions/ssn.js.map index 7aa2d25..ef4b2a3 100644 --- a/lib/js/definitions/ssn.js.map +++ b/lib/js/definitions/ssn.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/ssn.js"],"names":["schema","type","pattern","uiSchema","SSNWidget","SSNReviewWidget","widgetClassNames","validateSSN","ssnConfig"],"mappings":";;;;;;;AAAA;;AACA;;;;AACA;;;;;;AAEA,IAAMA,SAAS;AACbC,QAAM,QADO;AAEbC,WAAS;AAFI,CAAf;;AAKA,IAAMC,WAAW;AACf,eAAaC,mBADE;AAEf,qBAAmBC,mBAFJ;AAGf,cAAY,wBAHG;AAIf,gBAAc;AACZC,sBAAkB;AADN,GAJC;AAOf,oBAAkB,CAChBC,uBADgB,CAPH;AAUf,sBAAoB;AAClBL,aAAS;AADS;AAVL,CAAjB;;AAeO,IAAMM,gCAAY;AACvBR,gBADuB;AAEvBG;AAFuB,CAAlB","file":"ssn.js","sourcesContent":["import { validateSSN } from '../validation';\nimport SSNWidget from '../widgets/SSNWidget';\nimport SSNReviewWidget from '../review/SSNWidget';\n\nconst schema = {\n type: 'string',\n pattern: '^[0-9]{9}$'\n};\n\nconst uiSchema = {\n 'ui:widget': SSNWidget,\n 'ui:reviewWidget': SSNReviewWidget,\n 'ui:title': 'Social Security number',\n 'ui:options': {\n widgetClassNames: 'usa-input-medium'\n },\n 'ui:validations': [\n validateSSN\n ],\n 'ui:errorMessages': {\n pattern: 'Please enter a valid 9 digit SSN (dashes allowed)'\n }\n};\n\nexport const ssnConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/ssn.js"],"names":["schema","type","pattern","uiSchema","title","SSNWidget","SSNReviewWidget","widgetClassNames","validateSSN","ssnConfig"],"mappings":";;;;;;;AAAA;;AACA;;;;AACA;;;;;;AAEA,SAASA,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,QADD;AAELC,aAAS;AAFJ,GAAP;AAID;;AAED,SAASC,QAAT,GAAoD;AAAA,MAAlCC,KAAkC,uEAA1B,wBAA0B;;AAClD,SAAO;AACL,iBAAaC,mBADR;AAEL,uBAAmBC,mBAFd;AAGL,gBAAYF,KAHP;AAIL,kBAAc;AACZG,wBAAkB;AADN,KAJT;AAOL,sBAAkB,CAChBC,uBADgB,CAPb;AAUL,wBAAoB;AAClBN,eAAS;AADS;AAVf,GAAP;AAcD;;AAEM,IAAMO,gCAAY;AACvBT,gBADuB;AAEvBG;AAFuB,CAAlB","file":"ssn.js","sourcesContent":["import { validateSSN } from '../validation';\nimport SSNWidget from '../widgets/SSNWidget';\nimport SSNReviewWidget from '../review/SSNWidget';\n\nfunction schema() {\n return {\n type: 'string',\n pattern: '^[0-9]{9}$'\n };\n}\n\nfunction uiSchema(title = 'Social Security Number') {\n return {\n 'ui:widget': SSNWidget,\n 'ui:reviewWidget': SSNReviewWidget,\n 'ui:title': title,\n 'ui:options': {\n widgetClassNames: 'usa-input-medium'\n },\n 'ui:validations': [\n validateSSN\n ],\n 'ui:errorMessages': {\n pattern: 'Please enter a valid 9 digit SSN (dashes allowed)'\n }\n };\n}\n\nexport const ssnConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/lib/js/definitions/year.js b/lib/js/definitions/year.js index 56d09c3..1ed9199 100644 --- a/lib/js/definitions/year.js +++ b/lib/js/definitions/year.js @@ -13,22 +13,28 @@ var ReviewWidget = _interopRequireWildcard(_widgets); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -var schema = { - type: 'integer', - minimum: 1900 -}; - -var uiSchema = { - 'ui:title': 'Year', - 'ui:reviewWidget': ReviewWidget.TextWidget, - 'ui:validations': [_validation.validateCurrentOrPastYear], - 'ui:errorMessages': { - type: 'Please provide a valid year' - }, - 'ui:options': { - widgetClassNames: 'usa-input-medium' - } -}; +function schema() { + return { + type: 'integer', + minimum: 1900 + }; +} + +function uiSchema() { + var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Year'; + + return { + 'ui:title': title, + 'ui:reviewWidget': ReviewWidget.TextWidget, + 'ui:validations': [_validation.validateCurrentOrPastYear], + 'ui:errorMessages': { + type: 'Please provide a valid year' + }, + 'ui:options': { + widgetClassNames: 'usa-input-medium' + } + }; +} var yearConfig = exports.yearConfig = { schema: schema, diff --git a/lib/js/definitions/year.js.map b/lib/js/definitions/year.js.map index 9674a41..4b4a008 100644 --- a/lib/js/definitions/year.js.map +++ b/lib/js/definitions/year.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../../src/js/definitions/year.js"],"names":["ReviewWidget","schema","type","minimum","uiSchema","TextWidget","validateCurrentOrPastYear","widgetClassNames","yearConfig"],"mappings":";;;;;;;AAAA;;AACA;;IAAYA,Y;;;;AAEZ,IAAMC,SAAS;AACbC,QAAM,SADO;AAEbC,WAAS;AAFI,CAAf;;AAKA,IAAMC,WAAW;AACf,cAAY,MADG;AAEf,qBAAmBJ,aAAaK,UAFjB;AAGf,oBAAkB,CAChBC,qCADgB,CAHH;AAMf,sBAAoB;AAClBJ,UAAM;AADY,GANL;AASf,gBAAc;AACZK,sBAAkB;AADN;AATC,CAAjB;;AAcO,IAAMC,kCAAa;AACxBP,gBADwB;AAExBG;AAFwB,CAAnB","file":"year.js","sourcesContent":["import { validateCurrentOrPastYear } from '../validation';\nimport * as ReviewWidget from '../review/widgets';\n\nconst schema = {\n type: 'integer',\n minimum: 1900\n};\n\nconst uiSchema = {\n 'ui:title': 'Year',\n 'ui:reviewWidget': ReviewWidget.TextWidget,\n 'ui:validations': [\n validateCurrentOrPastYear\n ],\n 'ui:errorMessages': {\n type: 'Please provide a valid year'\n },\n 'ui:options': {\n widgetClassNames: 'usa-input-medium'\n }\n};\n\nexport const yearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file +{"version":3,"sources":["../../../src/js/definitions/year.js"],"names":["ReviewWidget","schema","type","minimum","uiSchema","title","TextWidget","validateCurrentOrPastYear","widgetClassNames","yearConfig"],"mappings":";;;;;;;AAAA;;AACA;;IAAYA,Y;;;;AAEZ,SAASC,MAAT,GAAkB;AAChB,SAAO;AACLC,UAAM,SADD;AAELC,aAAS;AAFJ,GAAP;AAID;;AAED,SAASC,QAAT,GAAkC;AAAA,MAAhBC,KAAgB,uEAAR,MAAQ;;AAChC,SAAO;AACL,gBAAYA,KADP;AAEL,uBAAmBL,aAAaM,UAF3B;AAGL,sBAAkB,CAChBC,qCADgB,CAHb;AAML,wBAAoB;AAClBL,YAAM;AADY,KANf;AASL,kBAAc;AACZM,wBAAkB;AADN;AATT,GAAP;AAaD;;AAEM,IAAMC,kCAAa;AACxBR,gBADwB;AAExBG;AAFwB,CAAnB","file":"year.js","sourcesContent":["import { validateCurrentOrPastYear } from '../validation';\nimport * as ReviewWidget from '../review/widgets';\n\nfunction schema() {\n return {\n type: 'integer',\n minimum: 1900\n };\n}\n\nfunction uiSchema(title = 'Year') {\n return {\n 'ui:title': title,\n 'ui:reviewWidget': ReviewWidget.TextWidget,\n 'ui:validations': [\n validateCurrentOrPastYear\n ],\n 'ui:errorMessages': {\n type: 'Please provide a valid year'\n },\n 'ui:options': {\n widgetClassNames: 'usa-input-medium'\n }\n };\n}\n\nexport const yearConfig = {\n schema,\n uiSchema\n};\n"]} \ No newline at end of file diff --git a/src/js/definitions/autosuggest.js b/src/js/definitions/autosuggest.js index e1e627e..33effb3 100644 --- a/src/js/definitions/autosuggest.js +++ b/src/js/definitions/autosuggest.js @@ -5,17 +5,19 @@ import { validateAutosuggestOption } from '../validation'; // don't use for enum fields, they need access to the // list of enums and names -const schema = { - type: 'object', - properties: { - id: { - type: 'any' - }, - label: { - type: 'string' +function schema() { + return { + type: 'object', + properties: { + id: { + type: 'any' + }, + label: { + type: 'string' + } } - } -}; + }; +} /* * Create uiSchema for autosuggest diff --git a/src/js/definitions/currency.js b/src/js/definitions/currency.js index 5501526..7d808d0 100644 --- a/src/js/definitions/currency.js +++ b/src/js/definitions/currency.js @@ -1,9 +1,11 @@ import CurrencyWidget from '../widgets/CurrencyWidget'; import CurrencyReviewWidget from '../review/CurrencyWidget'; -const schema = { - type: 'number' -}; +function schema() { + return { + type: 'number' + }; +} function uiSchema(title) { return { diff --git a/src/js/definitions/currentOrPastDate.js b/src/js/definitions/currentOrPastDate.js index efb6fe5..3f64980 100644 --- a/src/js/definitions/currentOrPastDate.js +++ b/src/js/definitions/currentOrPastDate.js @@ -1,7 +1,9 @@ import { validateCurrentOrPastDate } from '../validation'; import { dateConfig } from './date'; -const schema = dateConfig.schema; +function schema() { + return dateConfig.schema(); +} function uiSchema(title = 'Date') { return { diff --git a/src/js/definitions/currentOrPastMonthYear.js b/src/js/definitions/currentOrPastMonthYear.js index 250e227..85bd38b 100644 --- a/src/js/definitions/currentOrPastMonthYear.js +++ b/src/js/definitions/currentOrPastMonthYear.js @@ -3,7 +3,9 @@ import { validateCurrentOrPastMonthYear } from '../validation'; import { dateConfig } from './date'; import { monthYearConfig } from './monthYear'; -const schema = dateConfig.schema; +function schema() { + return dateConfig.schema(); +} function uiSchema(title = 'Date') { return _.assign(monthYearConfig.uiSchema(title), { diff --git a/src/js/definitions/date.js b/src/js/definitions/date.js index 8cd56a3..a60d8d6 100644 --- a/src/js/definitions/date.js +++ b/src/js/definitions/date.js @@ -1,9 +1,11 @@ import { validateDate } from '../validation'; -export const schema = { - pattern: '^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$', - type: 'string' -}; +function schema() { + return { + type: 'string', + pattern: '^(\\d{4}|XXXX)-(0[1-9]|1[0-2]|XX)-(0[1-9]|[1-2][0-9]|3[0-1]|XX)$' + }; +} function uiSchema(title = 'Date') { return { diff --git a/src/js/definitions/dateRange.js b/src/js/definitions/dateRange.js index 25049a2..443bb5e 100644 --- a/src/js/definitions/dateRange.js +++ b/src/js/definitions/dateRange.js @@ -1,13 +1,15 @@ import { validateDateRange } from '../validation'; import { dateConfig } from './date'; -const schema = { - type: 'object', - properties: { - from: dateConfig.schema, - to: dateConfig.schema - } -}; +function schema() { + return { + type: 'object', + properties: { + from: dateConfig.schema(), + to: dateConfig.schema() + } + }; +} function uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') { return { diff --git a/src/js/definitions/file.js b/src/js/definitions/file.js index e5cff85..9800817 100644 --- a/src/js/definitions/file.js +++ b/src/js/definitions/file.js @@ -3,23 +3,25 @@ import _ from 'lodash/fp'; import FileField from '../fields/FileField'; import { validateFileField } from '../validation'; -const schema = { - type: 'array', - items: { - type: 'object', - properties: { - name: { - type: 'string' - }, - size: { - type: 'integer' - }, - confirmationCode: { - type: 'string' +function schema() { + return { + type: 'array', + items: { + type: 'object', + properties: { + name: { + type: 'string' + }, + size: { + type: 'integer' + }, + confirmationCode: { + type: 'string' + } } } - } -}; + }; +} function uiSchema(label, userOptions = {}) { return { diff --git a/src/js/definitions/monthYear.js b/src/js/definitions/monthYear.js index b8b63a2..0149b9d 100644 --- a/src/js/definitions/monthYear.js +++ b/src/js/definitions/monthYear.js @@ -1,7 +1,9 @@ import { validateMonthYear } from '../validation'; import { dateConfig } from './date'; -const schema = dateConfig.schema; +function schema() { + return dateConfig.schema(); +} function uiSchema(title = 'Date') { return { diff --git a/src/js/definitions/monthYearRange.js b/src/js/definitions/monthYearRange.js index 49a0c1f..b8efcdf 100644 --- a/src/js/definitions/monthYearRange.js +++ b/src/js/definitions/monthYearRange.js @@ -2,7 +2,9 @@ import { validateDateRange } from '../validation'; import { monthYearConfig } from './monthYear'; import { dateRangeConfig } from './dateRange'; -const schema = dateRangeConfig.schema; +function schema() { + return dateRangeConfig.schema(); +} function uiSchema(from = 'From', to = 'To', rangeError = 'To date must be after From date') { return { diff --git a/src/js/definitions/phone.js b/src/js/definitions/phone.js index 1d920ca..0172eec 100644 --- a/src/js/definitions/phone.js +++ b/src/js/definitions/phone.js @@ -1,10 +1,12 @@ import PhoneNumberWidget from '../widgets/PhoneNumberWidget'; import PhoneNumberReviewWidget from '../review/PhoneNumberWidget'; -const schema = { - type: 'string', - minLength: 10 -}; +function schema() { + return { + type: 'string', + minLength: 10 + }; +} /* * Phone uiSchema diff --git a/src/js/definitions/ssn.js b/src/js/definitions/ssn.js index 66c23da..52614ba 100644 --- a/src/js/definitions/ssn.js +++ b/src/js/definitions/ssn.js @@ -2,25 +2,29 @@ import { validateSSN } from '../validation'; import SSNWidget from '../widgets/SSNWidget'; import SSNReviewWidget from '../review/SSNWidget'; -const schema = { - type: 'string', - pattern: '^[0-9]{9}$' -}; +function schema() { + return { + type: 'string', + pattern: '^[0-9]{9}$' + }; +} -const uiSchema = { - 'ui:widget': SSNWidget, - 'ui:reviewWidget': SSNReviewWidget, - 'ui:title': 'Social Security number', - 'ui:options': { - widgetClassNames: 'usa-input-medium' - }, - 'ui:validations': [ - validateSSN - ], - 'ui:errorMessages': { - pattern: 'Please enter a valid 9 digit SSN (dashes allowed)' - } -}; +function uiSchema(title = 'Social Security Number') { + return { + 'ui:widget': SSNWidget, + 'ui:reviewWidget': SSNReviewWidget, + 'ui:title': title, + 'ui:options': { + widgetClassNames: 'usa-input-medium' + }, + 'ui:validations': [ + validateSSN + ], + 'ui:errorMessages': { + pattern: 'Please enter a valid 9 digit SSN (dashes allowed)' + } + }; +} export const ssnConfig = { schema, diff --git a/src/js/definitions/year.js b/src/js/definitions/year.js index 9838ae6..8034438 100644 --- a/src/js/definitions/year.js +++ b/src/js/definitions/year.js @@ -1,24 +1,28 @@ import { validateCurrentOrPastYear } from '../validation'; import * as ReviewWidget from '../review/widgets'; -const schema = { - type: 'integer', - minimum: 1900 -}; +function schema() { + return { + type: 'integer', + minimum: 1900 + }; +} -const uiSchema = { - 'ui:title': 'Year', - 'ui:reviewWidget': ReviewWidget.TextWidget, - 'ui:validations': [ - validateCurrentOrPastYear - ], - 'ui:errorMessages': { - type: 'Please provide a valid year' - }, - 'ui:options': { - widgetClassNames: 'usa-input-medium' - } -}; +function uiSchema(title = 'Year') { + return { + 'ui:title': title, + 'ui:reviewWidget': ReviewWidget.TextWidget, + 'ui:validations': [ + validateCurrentOrPastYear + ], + 'ui:errorMessages': { + type: 'Please provide a valid year' + }, + 'ui:options': { + widgetClassNames: 'usa-input-medium' + } + }; +} export const yearConfig = { schema, diff --git a/test/js/definitions/date.unit.spec.jsx b/test/js/definitions/date.unit.spec.jsx index 64ecbc8..af1fa3f 100644 --- a/test/js/definitions/date.unit.spec.jsx +++ b/test/js/definitions/date.unit.spec.jsx @@ -11,7 +11,7 @@ describe('Schemaform definition date', () => { it('should render date', () => { const form = ReactTestUtils.renderIntoDocument( ); @@ -26,7 +26,7 @@ describe('Schemaform definition date', () => { const dateUISchema = dateConfig.uiSchema(); const form = ReactTestUtils.renderIntoDocument( ); @@ -46,7 +46,7 @@ describe('Schemaform definition date', () => { it('should render date title', () => { const form = ReactTestUtils.renderIntoDocument( ); diff --git a/test/js/definitions/dateRange.unit.spec.jsx b/test/js/definitions/dateRange.unit.spec.jsx index 5809163..4ee614e 100644 --- a/test/js/definitions/dateRange.unit.spec.jsx +++ b/test/js/definitions/dateRange.unit.spec.jsx @@ -30,8 +30,8 @@ describe('Schemaform definition dateRange', () => { it('should render dateRange', () => { const form = ReactTestUtils.renderIntoDocument( ); @@ -45,8 +45,8 @@ describe('Schemaform definition dateRange', () => { const dateRangeUISchema = dateRangeConfig.uiSchema(); const form = ReactTestUtils.renderIntoDocument( ); @@ -64,8 +64,8 @@ describe('Schemaform definition dateRange', () => { it('should render dateRange title and messages', () => { const form = ReactTestUtils.renderIntoDocument( ); diff --git a/test/js/definitions/file.unit.spec.jsx b/test/js/definitions/file.unit.spec.jsx index 5f59dc0..3875dea 100644 --- a/test/js/definitions/file.unit.spec.jsx +++ b/test/js/definitions/file.unit.spec.jsx @@ -10,7 +10,7 @@ describe('Schemaform definition file', () => { it('should render file', () => { const form = ReactTestUtils.renderIntoDocument( ); diff --git a/test/js/definitions/phone.unit.spec.jsx b/test/js/definitions/phone.unit.spec.jsx index 08126f4..9bf5fde 100644 --- a/test/js/definitions/phone.unit.spec.jsx +++ b/test/js/definitions/phone.unit.spec.jsx @@ -12,7 +12,7 @@ describe('Schemaform definition phone', () => { const phoneUiSchema = phoneConfig.uiSchema(); const form = ReactTestUtils.renderIntoDocument( ); @@ -28,7 +28,7 @@ describe('Schemaform definition phone', () => { it('should render phone title', () => { const form = ReactTestUtils.renderIntoDocument( ); @@ -39,7 +39,7 @@ describe('Schemaform definition phone', () => { it('should render phone error', () => { const form = ReactTestUtils.renderIntoDocument( ); diff --git a/test/js/definitions/ssn.unit.spec.jsx b/test/js/definitions/ssn.unit.spec.jsx index 748ae34..71706f4 100644 --- a/test/js/definitions/ssn.unit.spec.jsx +++ b/test/js/definitions/ssn.unit.spec.jsx @@ -10,8 +10,8 @@ describe('Schemaform definition ssn', () => { it('should render ssn with error', () => { const form = ReactTestUtils.renderIntoDocument( + schema={ssnConfig.schema()} + uiSchema={ssnConfig.uiSchema()}/> ); const formDOM = findDOMNode(form); @@ -27,14 +27,14 @@ describe('Schemaform definition ssn', () => { ReactTestUtils.Simulate.blur(node); expect(formDOM.querySelector('.usa-input-error-message').textContent) - .to.equal(`Error ${ssnConfig.uiSchema['ui:errorMessages'].pattern}`); + .to.equal(`Error ${ssnConfig.uiSchema()['ui:errorMessages'].pattern}`); }); it('should render formatted ssn for review', () => { const form = ReactTestUtils.renderIntoDocument( ); diff --git a/test/js/fields/FileField.unit.spec.jsx b/test/js/fields/FileField.unit.spec.jsx index 64dc93e..6259a33 100644 --- a/test/js/fields/FileField.unit.spec.jsx +++ b/test/js/fields/FileField.unit.spec.jsx @@ -287,7 +287,7 @@ describe('Schemaform ', () => { const schema = { type: 'object', properties: { - fileField: fileConfig.schema + fileField: fileConfig.schema() } }; const form = ReactTestUtils.renderIntoDocument( @@ -318,7 +318,7 @@ describe('Schemaform ', () => { const schema = { type: 'object', properties: { - fileField: fileConfig.schema + fileField: fileConfig.schema() } }; const uploadFile = sinon.spy();