formvuelatte
Advanced tools
Comparing version 0.2.1 to 0.2.3
@@ -90,2 +90,45 @@ module.exports = | ||
/***/ "f6fd": | ||
/***/ (function(module, exports) { | ||
// document.currentScript polyfill by Adam Miller | ||
// MIT license | ||
(function(document){ | ||
var currentScript = "currentScript", | ||
scripts = document.getElementsByTagName('script'); // Live NodeList collection | ||
// If browser needs currentScript polyfill, add get currentScript() to the document object | ||
if (!(currentScript in document)) { | ||
Object.defineProperty(document, currentScript, { | ||
get: function(){ | ||
// IE 6-10 supports script readyState | ||
// IE 10+ support stack trace | ||
try { throw new Error(); } | ||
catch (err) { | ||
// Find the second match for the "at" string to get file src url from stack. | ||
// Specifically works with the format of stack traces in IE. | ||
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1]; | ||
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag | ||
for(i in scripts){ | ||
if(scripts[i].src == res || scripts[i].readyState == "interactive"){ | ||
return scripts[i]; | ||
} | ||
} | ||
// If no match, return null | ||
return null; | ||
} | ||
} | ||
}); | ||
} | ||
})(document); | ||
/***/ }), | ||
/***/ "fb15": | ||
@@ -101,2 +144,6 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
if (typeof window !== 'undefined') { | ||
if (true) { | ||
__webpack_require__("f6fd") | ||
} | ||
var i | ||
@@ -111,3 +158,3 @@ if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) { | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"553e40dc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=template&id=46804838& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7801c13a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=template&id=0e12d6ff& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._t("beforeForm"),_c('form',{staticClass:"schema-form"},[_vm._l((_vm.parsedSchema),function(field){return _c(field.component,_vm._b({key:field.model,tag:"component",attrs:{"value":_vm.val(field)},on:{"input":function($event){return _vm.update(field.model, $event)},"update-batch":function($event){return _vm.updateBatch(field.model, $event)}}},'component',_vm.binds(field),false))}),_vm._t("default")],2),_vm._t("afterForm")],2)} | ||
@@ -117,7 +164,9 @@ var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=46804838& | ||
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=0e12d6ff& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=script&lang=js& | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -159,2 +208,6 @@ | ||
required: true | ||
}, | ||
sharedConfig: { | ||
type: Object, | ||
required: false | ||
} | ||
@@ -181,3 +234,3 @@ }, | ||
updateBatch: function updateBatch(property, values) { | ||
this.$emit('input', _objectSpread({}, this.value, values)); | ||
this.$emit('input', _objectSpread({}, this.value, {}, values)); | ||
}, | ||
@@ -187,3 +240,3 @@ binds: function binds(field) { | ||
schema: field.schema | ||
} : field; | ||
} : _objectSpread({}, this.sharedConfig, {}, field); | ||
}, | ||
@@ -316,3 +369,3 @@ val: function val(field) { | ||
/* harmony default export */ var SchemaForm = (component.exports); | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"553e40dc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaWizard.vue?vue&type=template&id=e92b45c6& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7801c13a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaWizard.vue?vue&type=template&id=e92b45c6& | ||
var SchemaWizardvue_type_template_id_e92b45c6_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('SchemaForm',{attrs:{"schema":_vm.currentSchema,"value":_vm.value[_vm.step] || {}},on:{"input":_vm.update}}),_vm._t("default")],2)} | ||
@@ -319,0 +372,0 @@ var SchemaWizardvue_type_template_id_e92b45c6_staticRenderFns = [] |
@@ -99,2 +99,45 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ "f6fd": | ||
/***/ (function(module, exports) { | ||
// document.currentScript polyfill by Adam Miller | ||
// MIT license | ||
(function(document){ | ||
var currentScript = "currentScript", | ||
scripts = document.getElementsByTagName('script'); // Live NodeList collection | ||
// If browser needs currentScript polyfill, add get currentScript() to the document object | ||
if (!(currentScript in document)) { | ||
Object.defineProperty(document, currentScript, { | ||
get: function(){ | ||
// IE 6-10 supports script readyState | ||
// IE 10+ support stack trace | ||
try { throw new Error(); } | ||
catch (err) { | ||
// Find the second match for the "at" string to get file src url from stack. | ||
// Specifically works with the format of stack traces in IE. | ||
var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1]; | ||
// For all scripts on the page, if src matches or if ready state is interactive, return the script tag | ||
for(i in scripts){ | ||
if(scripts[i].src == res || scripts[i].readyState == "interactive"){ | ||
return scripts[i]; | ||
} | ||
} | ||
// If no match, return null | ||
return null; | ||
} | ||
} | ||
}); | ||
} | ||
})(document); | ||
/***/ }), | ||
/***/ "fb15": | ||
@@ -110,2 +153,6 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
if (typeof window !== 'undefined') { | ||
if (true) { | ||
__webpack_require__("f6fd") | ||
} | ||
var i | ||
@@ -120,3 +167,3 @@ if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) { | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"553e40dc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=template&id=46804838& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7801c13a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=template&id=0e12d6ff& | ||
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._t("beforeForm"),_c('form',{staticClass:"schema-form"},[_vm._l((_vm.parsedSchema),function(field){return _c(field.component,_vm._b({key:field.model,tag:"component",attrs:{"value":_vm.val(field)},on:{"input":function($event){return _vm.update(field.model, $event)},"update-batch":function($event){return _vm.updateBatch(field.model, $event)}}},'component',_vm.binds(field),false))}),_vm._t("default")],2),_vm._t("afterForm")],2)} | ||
@@ -126,7 +173,9 @@ var staticRenderFns = [] | ||
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=46804838& | ||
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=0e12d6ff& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaForm.vue?vue&type=script&lang=js& | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
@@ -168,2 +217,6 @@ | ||
required: true | ||
}, | ||
sharedConfig: { | ||
type: Object, | ||
required: false | ||
} | ||
@@ -190,3 +243,3 @@ }, | ||
updateBatch: function updateBatch(property, values) { | ||
this.$emit('input', _objectSpread({}, this.value, values)); | ||
this.$emit('input', _objectSpread({}, this.value, {}, values)); | ||
}, | ||
@@ -196,3 +249,3 @@ binds: function binds(field) { | ||
schema: field.schema | ||
} : field; | ||
} : _objectSpread({}, this.sharedConfig, {}, field); | ||
}, | ||
@@ -325,3 +378,3 @@ val: function val(field) { | ||
/* harmony default export */ var SchemaForm = (component.exports); | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"553e40dc-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaWizard.vue?vue&type=template&id=e92b45c6& | ||
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"7801c13a-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/SchemaWizard.vue?vue&type=template&id=e92b45c6& | ||
var SchemaWizardvue_type_template_id_e92b45c6_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('SchemaForm',{attrs:{"schema":_vm.currentSchema,"value":_vm.value[_vm.step] || {}},on:{"input":_vm.update}}),_vm._t("default")],2)} | ||
@@ -328,0 +381,0 @@ var SchemaWizardvue_type_template_id_e92b45c6_staticRenderFns = [] |
@@ -1,2 +0,2 @@ | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["formvuelatte"]=t():e["formvuelatte"]=t()})("undefined"!==typeof self?self:this,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({fb15:function(e,t,r){"use strict";var n;(r.r(t),"undefined"!==typeof window)&&((n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(r.p=n[1]));var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e._t("beforeForm"),r("form",{staticClass:"schema-form"},[e._l(e.parsedSchema,function(t){return r(t.component,e._b({key:t.model,tag:"component",attrs:{value:e.val(t)},on:{input:function(r){return e.update(t.model,r)},"update-batch":function(r){return e.updateBatch(t.model,r)}}},"component",e.binds(t),!1))}),e._t("default")],2),e._t("afterForm")],2)},u=[];function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"===typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c={props:{schema:{type:[Object,Array],required:!0,validator:function(e){return!Array.isArray(e)||0===e.filter(function(e){return!e.model&&!e.schema}).length}},value:{type:Object,required:!0}},computed:{parsedSchema:function(){if(Array.isArray(this.schema))return this.schema;var e=[];for(var t in this.schema)e.push(i({},this.schema[t],{model:t}));return e}},methods:{update:function(e,t){this.$emit("input",i({},this.value,a({},e,t)))},updateBatch:function(e,t){this.$emit("input",i({},this.value,t))},binds:function(e){return e.schema?{schema:e.schema}:e},val:function(e){return e.schema&&!this.value[e.model]?{}:this.value[e.model]}}},s=c;function f(e,t,r,n,o,u,i,a){var c,s="function"===typeof e?e.options:e;if(t&&(s.render=t,s.staticRenderFns=r,s._compiled=!0),n&&(s.functional=!0),u&&(s._scopeId="data-v-"+u),i?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(i)},s._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(s.functional){s._injectStyles=c;var f=s.render;s.render=function(e,t){return c.call(t),f(e,t)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,c):[c]}return{exports:e,options:s}}var l=f(s,o,u,!1,null,null,null),d=l.exports,p=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("SchemaForm",{attrs:{schema:e.currentSchema,value:e.value[e.step]||{}},on:{input:e.update}}),e._t("default")],2)},m=[];function h(e){return b(e)||v(e)||y()}function y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function v(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function b(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}var _={components:{SchemaForm:d},props:{schema:{type:Array,required:!0},step:{type:Number,required:!0,default:0},value:{type:Array,required:!0}},computed:{currentSchema:function(){return this.schema[this.step]}},methods:{update:function(e){var t=h(this.value);t[this.step]=e,this.$emit("input",t)}}},j=_,S=f(j,p,m,!1,null,null,null),O=S.exports,g={props:{value:{required:!0},required:{type:Boolean,default:!1},config:{type:Object,default:function(){}}},methods:{update:function(e){this.$emit("input",e)}}},x=d;r.d(t,"SchemaForm",function(){return d}),r.d(t,"SchemaWizard",function(){return O}),r.d(t,"FormMixin",function(){return g});t["default"]=x}})}); | ||
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["formvuelatte"]=t():e["formvuelatte"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fb15")}({f6fd:function(e,t){(function(e){var t="currentScript",r=e.getElementsByTagName("script");t in e||Object.defineProperty(e,t,{get:function(){try{throw new Error}catch(n){var e,t=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(e in r)if(r[e].src==t||"interactive"==r[e].readyState)return r[e];return null}}})})(document)},fb15:function(e,t,r){"use strict";var n;(r.r(t),"undefined"!==typeof window)&&(r("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(r.p=n[1]));var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e._t("beforeForm"),r("form",{staticClass:"schema-form"},[e._l(e.parsedSchema,(function(t){return r(t.component,e._b({key:t.model,tag:"component",attrs:{value:e.val(t)},on:{input:function(r){return e.update(t.model,r)},"update-batch":function(r){return e.updateBatch(t.model,r)}}},"component",e.binds(t),!1))})),e._t("default")],2),e._t("afterForm")],2)},i=[];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(r,!0).forEach((function(t){c(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s={props:{schema:{type:[Object,Array],required:!0,validator:function(e){return!Array.isArray(e)||0===e.filter((function(e){return!e.model&&!e.schema})).length}},value:{type:Object,required:!0},sharedConfig:{type:Object,required:!1}},computed:{parsedSchema:function(){if(Array.isArray(this.schema))return this.schema;var e=[];for(var t in this.schema)e.push(a({},this.schema[t],{model:t}));return e}},methods:{update:function(e,t){this.$emit("input",a({},this.value,c({},e,t)))},updateBatch:function(e,t){this.$emit("input",a({},this.value,{},t))},binds:function(e){return e.schema?{schema:e.schema}:a({},this.sharedConfig,{},e)},val:function(e){return e.schema&&!this.value[e.model]?{}:this.value[e.model]}}},f=s;function l(e,t,r,n,o,i,u,a){var c,s="function"===typeof e?e.options:e;if(t&&(s.render=t,s.staticRenderFns=r,s._compiled=!0),n&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),u?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(u)},s._ssrRegister=c):o&&(c=a?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(s.functional){s._injectStyles=c;var f=s.render;s.render=function(e,t){return c.call(t),f(e,t)}}else{var l=s.beforeCreate;s.beforeCreate=l?[].concat(l,c):[c]}return{exports:e,options:s}}var p=l(f,o,i,!1,null,null,null),d=p.exports,m=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[r("SchemaForm",{attrs:{schema:e.currentSchema,value:e.value[e.step]||{}},on:{input:e.update}}),e._t("default")],2)},h=[];function y(e){return _(e)||b(e)||v()}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function b(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}var O={components:{SchemaForm:d},props:{schema:{type:Array,required:!0},step:{type:Number,required:!0,default:0},value:{type:Array,required:!0}},computed:{currentSchema:function(){return this.schema[this.step]}},methods:{update:function(e){var t=y(this.value);t[this.step]=e,this.$emit("input",t)}}},g=O,j=l(g,m,h,!1,null,null,null),S=j.exports,w={props:{value:{required:!0},required:{type:Boolean,default:!1},config:{type:Object,default:function(){}}},methods:{update:function(e){this.$emit("input",e)}}},x=d;r.d(t,"SchemaForm",(function(){return d})),r.d(t,"SchemaWizard",(function(){return S})),r.d(t,"FormMixin",(function(){return w}));t["default"]=x}})})); | ||
//# sourceMappingURL=formvuelatte.umd.min.js.map |
@@ -199,3 +199,3 @@ --- | ||
The SchemaForm can handle custom components that wrap two or more child inputs. | ||
The `SchemaForm` can handle custom components that wrap two or more child inputs. | ||
They must emit the `update-batch` event with an object payload that has the values for each of the inputs. | ||
@@ -207,2 +207,13 @@ | ||
<<< @/docs/.vuepress/components/MultiElementExample.vue | ||
</SplitTab> | ||
### Shared Config | ||
The `SchemaForm` includes a prop `sharedConfig` that applies a configuration object to all the elements in the form. | ||
In the following example, the prop `readOnly` is being globally applied to all the child components in the form, the `FormText` component disables and changes the color of the background when `readOnly` is set to true internally. | ||
<SplitTab> | ||
<SharedConfigExample slot="example" /> | ||
<<< @/docs/.vuepress/components/SharedConfigExample.vue | ||
</SplitTab> |
@@ -12,3 +12,3 @@ --- | ||
details: dependencies <= 0 | ||
footer: MIT Licensed | Copyright © 2019-present Damian Dulisz | ||
--- | ||
footer: MIT Licensed | Copyright © 2019-present Marina Mosti | ||
--- |
{ | ||
"name": "formvuelatte", | ||
"version": "0.2.1", | ||
"version": "0.2.3", | ||
"description": "Schema Form Generator", | ||
@@ -38,6 +38,6 @@ "author": "Marina Mosti <marina@mosti.com.mx>", | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "^3.5.0", | ||
"@vue/cli-plugin-babel": "^3.11.0", | ||
"@vue/cli-plugin-e2e-cypress": "^3.5.0", | ||
"@vue/cli-plugin-eslint": "^3.5.0", | ||
"@vue/cli-plugin-unit-jest": "^3.5.0", | ||
"@vue/cli-plugin-eslint": "^3.11.0", | ||
"@vue/cli-plugin-unit-jest": "^3.11.0", | ||
"@vue/cli-service": "^3.5.0", | ||
@@ -47,3 +47,3 @@ "@vue/eslint-config-standard": "^4.0.0", | ||
"babel-core": "7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-eslint": "^10.0.3", | ||
"babel-jest": "^23.6.0", | ||
@@ -50,0 +50,0 @@ "eslint": "^5.8.0", |
@@ -5,4 +5,2 @@ # FormVueLatte | ||
## ⚠️ WORK IN PROGRESS. DO NOT USE ⚠ | ||
## Getting Started | ||
@@ -123,2 +121,2 @@ | ||
The `update` method `$emit`s the `input` event with whatever value you pass to it. | ||
The `update` method `$emit`s the `input` event with whatever value you pass to it. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132777
45
1088
121
1