Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formvuelatte

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formvuelatte - npm Package Compare versions

Comparing version 2.0.0-alpha.4 to 2.0.0-beta.1

76

dist/formvuelatte.common.js

@@ -208,3 +208,3 @@ module.exports =

// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaForm.vue?vue&type=template&id=c736429e
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaForm.vue?vue&type=template&id=a5ed3b42

@@ -237,13 +237,25 @@ function render(_ctx, _cache) {

}
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=c736429e
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=a5ed3b42
// CONCATENATED MODULE: ./src/features/UniqueID.js
/* harmony default export */ var UniqueID = (function () {
function useUniqueID() {
var UUID = Math.floor(Math.random() * 1000000000);
var UUIDBindings = new Set();
var UUIDBindings = new Map();
function getID(model) {
if (UUIDBindings.has(model)) {
return UUIDBindings.get(model);
} else {
UUID++;
UUIDBindings.set(model, UUID);
return UUID;
}
}
return {
UUID: UUID,
UUIDBindings: UUIDBindings
UUIDBindings: UUIDBindings,
getID: getID
};
});
}
// 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/dist??ref--0-1!./src/SchemaForm.vue?vue&type=script&lang=js

@@ -265,3 +277,2 @@ function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }

/* harmony default export */ var SchemaFormvue_type_script_lang_js = ({
emits: ['submit'],
props: {

@@ -293,5 +304,5 @@ schema: {

},
emits: ['submit', 'update:modelValue'],
setup: function setup(props, _ref) {
var emit = _ref.emit,
attrs = _ref.attrs;
var emit = _ref.emit;
var hasParentSchema = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["inject"])('parentSchemaExists', false);

@@ -303,23 +314,16 @@

var _useUniqueID = UniqueID(),
UUID = _useUniqueID.UUID,
UUIDBindings = _useUniqueID.UUIDBindings;
var _useUniqueID = useUniqueID(),
getID = _useUniqueID.getID;
var parsedSchema = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
if (Array.isArray(props.schema)) return props.schema;
var arraySchema = [];
for (var model in props.schema) {
if (!UUIDBindings[model]) {
UUIDBindings[model] = UUID;
UUID++;
}
arraySchema.push(_objectSpread(_objectSpread({}, props.schema[model]), {}, {
model: model,
uuid: UUIDBindings[model]
}));
}
return arraySchema;
var arraySchema = Array.isArray(props.schema) ? props.schema : Object.keys(props.schema).map(function (model) {
return _objectSpread(_objectSpread({}, props.schema[model]), {}, {
model: model
});
});
return arraySchema.map(function (field) {
return _objectSpread(_objectSpread({}, field), {}, {
uuid: getID(field.model)
});
});
});

@@ -382,3 +386,3 @@ Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(parsedSchema, function (schema, oldSchema) {

return {
'onSubmit': function onSubmit(event) {
onSubmit: function onSubmit(event) {
event.preventDefault();

@@ -409,5 +413,5 @@ emit('submit', event);

/* harmony default export */ var SchemaForm = (SchemaFormvue_type_script_lang_js);
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=template&id=65a11896
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=template&id=7dae742e
function SchemaWizardvue_type_template_id_65a11896_render(_ctx, _cache) {
function SchemaWizardvue_type_template_id_7dae742e_render(_ctx, _cache) {
var _component_SchemaForm = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SchemaForm");

@@ -421,9 +425,9 @@

schema: _ctx.currentSchema,
value: _ctx.modelValue[_ctx.step] || {},
onInput: _cache[1] || (_cache[1] = function ($event) {
modelValue: _ctx.modelValue[_ctx.step] || {},
"onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
return _ctx.update($event);
})
}, null, 8, ["schema", "value"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "afterForm")], 32);
}, null, 8, ["schema", "modelValue"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "afterForm")], 32);
}
// CONCATENATED MODULE: ./src/SchemaWizard.vue?vue&type=template&id=65a11896
// CONCATENATED MODULE: ./src/SchemaWizard.vue?vue&type=template&id=7dae742e

@@ -489,3 +493,3 @@ // 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/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=script&lang=js

SchemaWizardvue_type_script_lang_js.render = SchemaWizardvue_type_template_id_65a11896_render
SchemaWizardvue_type_script_lang_js.render = SchemaWizardvue_type_template_id_7dae742e_render

@@ -492,0 +496,0 @@ /* harmony default export */ var SchemaWizard = (SchemaWizardvue_type_script_lang_js);

@@ -217,3 +217,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaForm.vue?vue&type=template&id=c736429e
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaForm.vue?vue&type=template&id=a5ed3b42

@@ -246,13 +246,25 @@ function render(_ctx, _cache) {

}
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=c736429e
// CONCATENATED MODULE: ./src/SchemaForm.vue?vue&type=template&id=a5ed3b42
// CONCATENATED MODULE: ./src/features/UniqueID.js
/* harmony default export */ var UniqueID = (function () {
function useUniqueID() {
var UUID = Math.floor(Math.random() * 1000000000);
var UUIDBindings = new Set();
var UUIDBindings = new Map();
function getID(model) {
if (UUIDBindings.has(model)) {
return UUIDBindings.get(model);
} else {
UUID++;
UUIDBindings.set(model, UUID);
return UUID;
}
}
return {
UUID: UUID,
UUIDBindings: UUIDBindings
UUIDBindings: UUIDBindings,
getID: getID
};
});
}
// 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/dist??ref--0-1!./src/SchemaForm.vue?vue&type=script&lang=js

@@ -274,3 +286,2 @@ function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }

/* harmony default export */ var SchemaFormvue_type_script_lang_js = ({
emits: ['submit'],
props: {

@@ -302,5 +313,5 @@ schema: {

},
emits: ['submit', 'update:modelValue'],
setup: function setup(props, _ref) {
var emit = _ref.emit,
attrs = _ref.attrs;
var emit = _ref.emit;
var hasParentSchema = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["inject"])('parentSchemaExists', false);

@@ -312,23 +323,16 @@

var _useUniqueID = UniqueID(),
UUID = _useUniqueID.UUID,
UUIDBindings = _useUniqueID.UUIDBindings;
var _useUniqueID = useUniqueID(),
getID = _useUniqueID.getID;
var parsedSchema = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
if (Array.isArray(props.schema)) return props.schema;
var arraySchema = [];
for (var model in props.schema) {
if (!UUIDBindings[model]) {
UUIDBindings[model] = UUID;
UUID++;
}
arraySchema.push(_objectSpread(_objectSpread({}, props.schema[model]), {}, {
model: model,
uuid: UUIDBindings[model]
}));
}
return arraySchema;
var arraySchema = Array.isArray(props.schema) ? props.schema : Object.keys(props.schema).map(function (model) {
return _objectSpread(_objectSpread({}, props.schema[model]), {}, {
model: model
});
});
return arraySchema.map(function (field) {
return _objectSpread(_objectSpread({}, field), {}, {
uuid: getID(field.model)
});
});
});

@@ -391,3 +395,3 @@ Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(parsedSchema, function (schema, oldSchema) {

return {
'onSubmit': function onSubmit(event) {
onSubmit: function onSubmit(event) {
event.preventDefault();

@@ -418,5 +422,5 @@ emit('submit', event);

/* harmony default export */ var SchemaForm = (SchemaFormvue_type_script_lang_js);
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=template&id=65a11896
// 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/vue-loader/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=template&id=7dae742e
function SchemaWizardvue_type_template_id_65a11896_render(_ctx, _cache) {
function SchemaWizardvue_type_template_id_7dae742e_render(_ctx, _cache) {
var _component_SchemaForm = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SchemaForm");

@@ -430,9 +434,9 @@

schema: _ctx.currentSchema,
value: _ctx.modelValue[_ctx.step] || {},
onInput: _cache[1] || (_cache[1] = function ($event) {
modelValue: _ctx.modelValue[_ctx.step] || {},
"onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
return _ctx.update($event);
})
}, null, 8, ["schema", "value"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "afterForm")], 32);
}, null, 8, ["schema", "modelValue"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "afterForm")], 32);
}
// CONCATENATED MODULE: ./src/SchemaWizard.vue?vue&type=template&id=65a11896
// CONCATENATED MODULE: ./src/SchemaWizard.vue?vue&type=template&id=7dae742e

@@ -498,3 +502,3 @@ // 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/dist??ref--0-1!./src/SchemaWizard.vue?vue&type=script&lang=js

SchemaWizardvue_type_script_lang_js.render = SchemaWizardvue_type_template_id_65a11896_render
SchemaWizardvue_type_script_lang_js.render = SchemaWizardvue_type_template_id_7dae742e_render

@@ -501,0 +505,0 @@ /* harmony default export */ var SchemaWizard = (SchemaWizardvue_type_script_lang_js);

@@ -1,2 +0,2 @@

(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["formvuelatte"]=t(require("vue")):e["formvuelatte"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){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")}({8875:function(e,t,r){var n,o,c;(function(r,u){o=[],n=u,c="function"===typeof n?n.apply(t,o):n,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(d){var e,t,r,n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,c=n.exec(d.stack)||o.exec(d.stack),u=c&&c[1]||!1,a=c&&c[2]||!1,i=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");u===i&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),r=e.replace(t,"$1").trim());for(var f=0;f<l.length;f++){if("interactive"===l[f].readyState)return l[f];if(l[f].src===u)return l[f];if(u===i&&l[f].innerHTML&&l[f].innerHTML.trim()===r)return l[f]}return null}}return e}))},"8bbf":function(t,r){t.exports=e},fb15:function(e,t,r){"use strict";if(r.r(t),"undefined"!==typeof window){var n=window.document.currentScript,o=r("8875");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(r.p=c[1])}var u=r("8bbf");function a(e,t){return Object(u["openBlock"])(),Object(u["createBlock"])(Object(u["resolveDynamicComponent"])(e.hasParentSchema?"div":"form"),e.formBinds,{default:Object(u["withCtx"])((function(){return[e.hasParentSchema?Object(u["createCommentVNode"])("",!0):Object(u["renderSlot"])(e.$slots,"beforeForm",{key:0}),(Object(u["openBlock"])(!0),Object(u["createBlock"])(u["Fragment"],null,Object(u["renderList"])(e.parsedSchema,(function(t){return Object(u["openBlock"])(),Object(u["createBlock"])(Object(u["resolveDynamicComponent"])(t.component),Object(u["mergeProps"])({key:t.model},e.binds(t),{modelValue:e.val(t),"onUpdate:modelValue":function(r){return e.update(t.model,r)},"onUpdate-batch":function(r){return e.updateBatch(t.model,r)}}),null,16,["modelValue","onUpdate:modelValue","onUpdate-batch"])})),128)),e.hasParentSchema?Object(u["createCommentVNode"])("",!0):Object(u["renderSlot"])(e.$slots,"afterForm",{key:0})]})),_:1},16)}var i=function(){var e=Math.floor(1e9*Math.random()),t=new Set;return{UUID:e,UUIDBindings:t}};function l(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=f(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o,c=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){u=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw o}}}}function f(e,t){if(e){if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(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 m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b={emits:["submit"],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}},modelValue:{type:Object,required:!0},sharedConfig:{type:Object,default:function(){return{}}},preventModelCleanupOnSchemaChange:{type:Boolean,default:!1}},setup:function(e,t){var r=t.emit,n=(t.attrs,Object(u["inject"])("parentSchemaExists",!1));n||Object(u["provide"])("parentSchemaExists",!0);var o=i(),c=o.UUID,a=o.UUIDBindings,f=Object(u["computed"])((function(){if(Array.isArray(e.schema))return e.schema;var t=[];for(var r in e.schema)a[r]||(a[r]=c,c++),t.push(m(m({},e.schema[r]),{},{model:r,uuid:a[r]}));return t}));Object(u["watch"])(f,(function(t,n){if(!e.preventModelCleanupOnSchemaChange){var o=t.map((function(e){return e.model})),c=n.map((function(e){return e.model})).filter((function(e){return!o.includes(e)}));if(c.length){var u,a=m({},e.modelValue),i=l(c);try{for(i.s();!(u=i.n()).done;){var f=u.value;delete a[f]}}catch(d){i.e(d)}finally{i.f()}r("update:modelValue",a)}}}));var d=function(t,n){r("update:modelValue",m(m({},e.modelValue),{},s({},t,n)))},p=function(t,n){r("update:modelValue",m(m({},e.modelValue),n))},b=function(t){return t.schema?{schema:t.schema}:m(m({},e.sharedConfig),t)},y=function(t){return t.schema&&!e.modelValue[t.model]?{}:e.modelValue[t.model]},h=Object(u["computed"])((function(){return n?{}:{onSubmit:function(e){e.preventDefault(),r("submit",e)}}}));return{parsedSchema:f,val:y,binds:b,update:d,updateBatch:p,hasParentSchema:n,formBinds:h}}};b.render=a;var y=b;function h(e,t){var r=Object(u["resolveComponent"])("SchemaForm");return Object(u["openBlock"])(),Object(u["createBlock"])("form",{onSubmit:t[2]||(t[2]=Object(u["withModifiers"])((function(t){return e.$emit("submit",t)}),["prevent"]))},[Object(u["renderSlot"])(e.$slots,"beforeForm"),Object(u["createVNode"])(r,{schema:e.currentSchema,value:e.modelValue[e.step]||{},onInput:t[1]||(t[1]=function(t){return e.update(t)})},null,8,["schema","value"]),Object(u["renderSlot"])(e.$slots,"afterForm")],32)}function O(e){return S(e)||g(e)||j(e)||v()}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){if(e){if("string"===typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function g(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function S(e){if(Array.isArray(e))return w(e)}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var P={components:{SchemaForm:y},props:{schema:{type:Array,required:!0},step:{type:Number,required:!0,default:0},modelValue:{type:Array,required:!0}},setup:function(e,t){Object(u["provide"])("parentSchemaExists",!0);var r=Object(u["computed"])((function(){return e.schema[e.step]})),n=function(r){var n=O(e.modelValue);n[e.step]=r,t.emit("update:modelValue",n)};return{currentSchema:r,update:n}}};P.render=h;var V=P;function A(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 x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=y.setup;function r(r,n){var o=t(r,n);return e.length?e.reduce((function(e,t){return t(e,r,n)}),o):o}return x(x({},y),{},{setup:r})}var k=y;r.d(t,"SchemaForm",(function(){return y})),r.d(t,"SchemaWizard",(function(){return V})),r.d(t,"SchemaFormFactory",(function(){return B}));t["default"]=k}})}));
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["formvuelatte"]=t(require("vue")):e["formvuelatte"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){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")}({8875:function(e,t,r){var n,o,c;(function(r,u){o=[],n=u,c="function"===typeof n?n.apply(t,o):n,void 0===c||(e.exports=c)})("undefined"!==typeof self&&self,(function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(d){var e,t,r,n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,o=/@([^@]*):(\d+):(\d+)\s*$/gi,c=n.exec(d.stack)||o.exec(d.stack),u=c&&c[1]||!1,a=c&&c[2]||!1,i=document.location.href.replace(document.location.hash,""),l=document.getElementsByTagName("script");u===i&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(a-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),r=e.replace(t,"$1").trim());for(var f=0;f<l.length;f++){if("interactive"===l[f].readyState)return l[f];if(l[f].src===u)return l[f];if(u===i&&l[f].innerHTML&&l[f].innerHTML.trim()===r)return l[f]}return null}}return e}))},"8bbf":function(t,r){t.exports=e},fb15:function(e,t,r){"use strict";if(r.r(t),"undefined"!==typeof window){var n=window.document.currentScript,o=r("8875");n=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var c=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);c&&(r.p=c[1])}var u=r("8bbf");function a(e,t){return Object(u["openBlock"])(),Object(u["createBlock"])(Object(u["resolveDynamicComponent"])(e.hasParentSchema?"div":"form"),e.formBinds,{default:Object(u["withCtx"])((function(){return[e.hasParentSchema?Object(u["createCommentVNode"])("",!0):Object(u["renderSlot"])(e.$slots,"beforeForm",{key:0}),(Object(u["openBlock"])(!0),Object(u["createBlock"])(u["Fragment"],null,Object(u["renderList"])(e.parsedSchema,(function(t){return Object(u["openBlock"])(),Object(u["createBlock"])(Object(u["resolveDynamicComponent"])(t.component),Object(u["mergeProps"])({key:t.model},e.binds(t),{modelValue:e.val(t),"onUpdate:modelValue":function(r){return e.update(t.model,r)},"onUpdate-batch":function(r){return e.updateBatch(t.model,r)}}),null,16,["modelValue","onUpdate:modelValue","onUpdate-batch"])})),128)),e.hasParentSchema?Object(u["createCommentVNode"])("",!0):Object(u["renderSlot"])(e.$slots,"afterForm",{key:0})]})),_:1},16)}function i(){var e=Math.floor(1e9*Math.random()),t=new Map;function r(r){return t.has(r)?t.get(r):(e++,t.set(r,e),e)}return{UUID:e,UUIDBindings:t,getID:r}}function l(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=f(e))){var t=0,r=function(){};return{s:r,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o,c=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){u=!0,o=e},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw o}}}}function f(e,t){if(e){if("string"===typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function m(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 p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b={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}},modelValue:{type:Object,required:!0},sharedConfig:{type:Object,default:function(){return{}}},preventModelCleanupOnSchemaChange:{type:Boolean,default:!1}},emits:["submit","update:modelValue"],setup:function(e,t){var r=t.emit,n=Object(u["inject"])("parentSchemaExists",!1);n||Object(u["provide"])("parentSchemaExists",!0);var o=i(),c=o.getID,a=Object(u["computed"])((function(){var t=Array.isArray(e.schema)?e.schema:Object.keys(e.schema).map((function(t){return p(p({},e.schema[t]),{},{model:t})}));return t.map((function(e){return p(p({},e),{},{uuid:c(e.model)})}))}));Object(u["watch"])(a,(function(t,n){if(!e.preventModelCleanupOnSchemaChange){var o=t.map((function(e){return e.model})),c=n.map((function(e){return e.model})).filter((function(e){return!o.includes(e)}));if(c.length){var u,a=p({},e.modelValue),i=l(c);try{for(i.s();!(u=i.n()).done;){var f=u.value;delete a[f]}}catch(d){i.e(d)}finally{i.f()}r("update:modelValue",a)}}}));var f=function(t,n){r("update:modelValue",p(p({},e.modelValue),{},s({},t,n)))},d=function(t,n){r("update:modelValue",p(p({},e.modelValue),n))},m=function(t){return t.schema?{schema:t.schema}:p(p({},e.sharedConfig),t)},b=function(t){return t.schema&&!e.modelValue[t.model]?{}:e.modelValue[t.model]},y=Object(u["computed"])((function(){return n?{}:{onSubmit:function(e){e.preventDefault(),r("submit",e)}}}));return{parsedSchema:a,val:b,binds:m,update:f,updateBatch:d,hasParentSchema:n,formBinds:y}}};b.render=a;var y=b;function h(e,t){var r=Object(u["resolveComponent"])("SchemaForm");return Object(u["openBlock"])(),Object(u["createBlock"])("form",{onSubmit:t[2]||(t[2]=Object(u["withModifiers"])((function(t){return e.$emit("submit",t)}),["prevent"]))},[Object(u["renderSlot"])(e.$slots,"beforeForm"),Object(u["createVNode"])(r,{schema:e.currentSchema,modelValue:e.modelValue[e.step]||{},"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.update(t)})},null,8,["schema","modelValue"]),Object(u["renderSlot"])(e.$slots,"afterForm")],32)}function O(e){return S(e)||g(e)||v(e)||j()}function j(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(e,t){if(e){if("string"===typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}function g(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function S(e){if(Array.isArray(e))return w(e)}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var P={components:{SchemaForm:y},props:{schema:{type:Array,required:!0},step:{type:Number,required:!0,default:0},modelValue:{type:Array,required:!0}},setup:function(e,t){Object(u["provide"])("parentSchemaExists",!0);var r=Object(u["computed"])((function(){return e.schema[e.step]})),n=function(r){var n=O(e.modelValue);n[e.step]=r,t.emit("update:modelValue",n)};return{currentSchema:r,update:n}}};P.render=h;var V=P;function A(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 x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){D(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=y.setup;function r(r,n){var o=t(r,n);return e.length?e.reduce((function(e,t){return t(e,r,n)}),o):o}return x(x({},y),{},{setup:r})}var B=y;r.d(t,"SchemaForm",(function(){return y})),r.d(t,"SchemaWizard",(function(){return V})),r.d(t,"SchemaFormFactory",(function(){return k}));t["default"]=B}})}));
//# sourceMappingURL=formvuelatte.umd.min.js.map
{
"name": "formvuelatte",
"version": "v2.0.0-alpha.4",
"version": "v2.0.0-beta.1",
"description": "Schema Form Generator",

@@ -8,2 +8,6 @@ "author": "Marina Mosti <marina@mosti.com.mx>",

{
"name": "Marina Mosti",
"email": "marina@mosti.com.mx"
},
{
"name": "Damian Dulisz",

@@ -13,29 +17,19 @@ "email": "damian.dulisz@gmail.com"

{
"name": "Marina Mosti",
"email": "marina@mosti.com.mx"
"name": "Tonina Zhelyazkova",
"email": "zhelyazkova.tonina@gmail.com"
}
],
"engines": {
"node": ">=12.17.0"
},
"main": "dist/formvuelatte.common.js",
"unpkg": "dist/formvuelatte.umd.js",
"browser": "dist/formvuelatte.umd.js",
"homepage": "https://formvuelatte.netlify.com/",
"bugs": {
"url": "https://github.com/vuelidate/formvuelatte"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuelidate/formvuelatte.git"
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --target lib --name formvuelatte src/index.js",
"test:unit": "vue-cli-service test:unit --coverage",
"test:unit:watch": "yarn test:unit --watch",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint",
"docs:build": "vitepress build",
"docs:dev": "vitepress",
"test:e2e": "vue-cli-service test:e2e",
"test:unit": "vue-cli-service test:unit"
"docs:dev": "vitepress"
},
"main": "dist/formvuelatte.common.js",
"browser": "dist/formvuelatte.umd.js",
"unpkg": "dist/formvuelatte.umd.js",
"files": [

@@ -45,18 +39,51 @@ "dist",

],
"keywords": [
"vue",
"form",
"schema",
"plugin",
"dynamic form"
],
"devDependencies": {
"@babel/node": "^7.8.7",
"@babel/preset-env": "^7.9.0",
"@types/jest": "^25.2.1",
"@vue/cli-plugin-babel": "^4.2.0",
"@vue/cli-plugin-eslint": "^4.2.0",
"@vue/cli-plugin-unit-jest": "^4.4.1",
"@vue/cli-service": "^4.2.0",
"@vue/compiler-sfc": "^3.0.0-beta.12",
"@vue/eslint-config-standard": "^5.1.0",
"@vue/test-utils": "^2.0.0-alpha.1",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-jest": "^23.6.0",
"babel-jest": "^25.2.6",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "next",
"jest": "^25.2.7",
"stylus": "^0.54.7",
"vitepress": "^0.1.1",
"ts-jest": "^25.3.1",
"ts-loader": "^6.2.2",
"typescript": "^3.8.3",
"vitepress": "^0.3.1",
"vue": "v3.0.0-beta.12",
"vue-cli-plugin-vue-next": "^0.1.2"
"vue-cli-plugin-vue-next": "^0.1.2",
"vue-jest": "^5.0.0-alpha.0",
"vue-loader": "^16.0.0-alpha.3"
},
"bugs": {
"url": "https://github.com/vuelidate/formvuelatte"
},
"engines": {
"node": ">=12.17.0"
},
"homepage": "https://formvuelatte.netlify.com/",
"repository": {
"type": "git",
"url": "git+https://github.com/vuelidate/formvuelatte.git"
}
}
# FormVueLatte 2.x
**Important:**
Visit [FormVueLatte 2.0's full documentation](https://formvuelatte-next.netlify.app/#getting-started) for more detailed information and examples.
For the full 2.0.0 alpha guide, please check out for now the `index.md` file
## Getting Started

@@ -8,0 +6,0 @@

@@ -1,9 +0,20 @@

export default () => {
export default function useUniqueID () {
let UUID = Math.floor(Math.random() * 1000000000)
const UUIDBindings = new Set()
const UUIDBindings = new Map()
function getID (model) {
if (UUIDBindings.has(model)) {
return UUIDBindings.get(model)
} else {
UUID++
UUIDBindings.set(model, UUID)
return UUID
}
}
return {
UUID,
UUIDBindings
UUIDBindings,
getID
}
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc