Skip to content

Commit

Permalink
added compiled version
Browse files Browse the repository at this point in the history
  • Loading branch information
scratchuz4k committed Jun 9, 2024
1 parent 8b099b1 commit 7cb4717
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
Expand Down
Binary file added dist/favicon.ico
Binary file not shown.
199 changes: 199 additions & 0 deletions dist/lib.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
import { resolveComponent as m, openBlock as s, createElementBlock as l, Fragment as b, renderList as g, createBlock as d, resolveDynamicComponent as y, mergeProps as f, withCtx as h, createCommentVNode as p, normalizeClass as v, withModifiers as j, renderSlot as a, createElementVNode as i, toDisplayString as x } from "vue";
const $ = {
__name: "Builder",
props: {
object: {
required: !1,
default: null
},
design: {
required: !0
},
endpoint: {
required: !1,
default: !1
}
},
setup(e) {
return (o, r) => {
const n = m("builder", !0);
return s(!0), l(b, null, g(e.design, (t, c) => (s(), d(y(t.component), f({
key: t,
ref_for: !0
}, {
endpoint: e.endpoint,
object: e.object,
class: t.class,
configs: t.configs
}), {
default: h(() => [
t.children && t.children.length ? (s(), d(n, f({
key: 0,
ref_for: !0
}, {
endpoint: e.endpoint,
object: e.object,
design: t.children
}), null, 16)) : p("", !0)
]),
_: 2
}, 1040))), 128);
};
}
}, w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: $
}, Symbol.toStringTag, { value: "Module" })), O = {
__name: "Form",
props: {
object: {
required: !1,
default: null
},
endpoint: {
required: !1,
default: !1
},
class: {
required: !1,
default: {}
}
},
setup(e) {
const o = e, r = async () => {
const n = document.getElementById("website-form"), t = new FormData(n);
try {
let c;
const _ = { headers: { "Content-Type": "multipart/form-data" } };
Object.keys(object).length ? (t.append("_method", "put"), c = await axios.post(o.endpoint, t, _)) : c = await axios.post(o.endpoint, t, _), location.assign(c.data.redirect);
} catch (c) {
window.notyf.error(c.response.data);
}
return !1;
};
return (n, t) => {
const c = m("form-buttons");
return s(), l("form", {
id: "website-form",
class: v(o.class),
onSubmit: j(r, ["prevent"])
}, [
a(n.$slots, "default"),
o.endpoint ? (s(), d(c, { key: 0 })) : p("", !0)
], 34);
};
}
}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: O
}, Symbol.toStringTag, { value: "Module" })), u = (e, o) => {
const r = e.__vccOpts || e;
for (const [n, t] of o)
r[n] = t;
return r;
}, k = {}, C = { class: "mt-6 flex items-center justify-end gap-x-6" }, q = /* @__PURE__ */ i("button", {
type: "button",
class: "text-sm font-semibold leading-6 text-gray-900"
}, "Cancel", -1), T = /* @__PURE__ */ i("button", {
type: "submit",
class: "rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
}, "Save", -1), z = [
q,
T
];
function B(e, o) {
return s(), l("div", C, z);
}
const M = /* @__PURE__ */ u(k, [["render", B]]), P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: M
}, Symbol.toStringTag, { value: "Module" })), F = { class: "mt-5" }, D = {
for: "username",
class: "block text-sm font-medium leading-6 text-gray-900"
}, E = /* @__PURE__ */ i("div", { class: "mt-2" }, [
/* @__PURE__ */ i("div", { class: "flex rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-600" }, [
/* @__PURE__ */ i("input", {
type: "text",
name: "username",
id: "username",
autocomplete: "username",
class: "block flex-1 border-0 bg-transparent py-1.5 pl-1 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm sm:leading-6",
placeholder: "janesmith"
})
])
], -1), I = {
__name: "InputText",
props: {
object: {
required: !1,
default: null
},
endpoint: {
required: !1,
default: !1
},
class: {
required: !1,
default: {}
},
configs: {
required: !1,
default: {}
}
},
setup(e) {
const o = e;
return (r, n) => (s(), l("div", F, [
i("label", D, x(o.configs.title), 1),
E
]));
}
}, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: I
}, Symbol.toStringTag, { value: "Module" })), R = {}, V = { class: "col" };
function L(e, o) {
return s(), l("div", V, [
a(e.$slots, "default")
]);
}
const A = /* @__PURE__ */ u(R, [["render", L]]), G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: A
}, Symbol.toStringTag, { value: "Module" })), H = {}, J = { class: "container mx-auto mt-5" };
function K(e, o) {
return s(), l("div", J, [
a(e.$slots, "default")
]);
}
const Q = /* @__PURE__ */ u(H, [["render", K]]), U = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Q
}, Symbol.toStringTag, { value: "Module" })), W = {}, X = { class: "row" };
function Y(e, o) {
return s(), l("div", X, [
a(e.$slots, "default")
]);
}
const Z = /* @__PURE__ */ u(W, [["render", Y]]), ee = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Z
}, Symbol.toStringTag, { value: "Module" })), oe = {
install: (e) => {
Object.entries(/* @__PURE__ */ Object.assign({
"./components/Builder.vue": w,
"./components/forms/Form.vue": S,
"./components/forms/FormButtons.vue": P,
"./components/forms/InputText.vue": N,
"./components/layout/Column.vue": G,
"./components/layout/Content.vue": U,
"./components/layout/Row.vue": ee
})).forEach(([r, n]) => {
const t = r.split("/").pop().replace(/\.\w+$/, "");
e.component(t, n.default);
});
}
};
export {
oe as components
};
1 change: 1 addition & 0 deletions dist/lib.umd.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(function(l,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis<"u"?globalThis:l||self,e(l.lib={},l.Vue))})(this,function(l,e){"use strict";const d=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"Builder",props:{object:{required:!1,default:null},design:{required:!0},endpoint:{required:!1,default:!1}},setup(t){return(n,r)=>{const s=e.resolveComponent("builder",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.design,(o,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),e.mergeProps({key:o,ref_for:!0},{endpoint:t.endpoint,object:t.object,class:o.class,configs:o.configs}),{default:e.withCtx(()=>[o.children&&o.children.length?(e.openBlock(),e.createBlock(s,e.mergeProps({key:0,ref_for:!0},{endpoint:t.endpoint,object:t.object,design:o.children}),null,16)):e.createCommentVNode("",!0)]),_:2},1040))),128)}}}},Symbol.toStringTag,{value:"Module"})),_=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"Form",props:{object:{required:!1,default:null},endpoint:{required:!1,default:!1},class:{required:!1,default:{}}},setup(t){const n=t,r=async()=>{const s=document.getElementById("website-form"),o=new FormData(s);try{let c;const a={headers:{"Content-Type":"multipart/form-data"}};Object.keys(object).length?(o.append("_method","put"),c=await axios.post(n.endpoint,o,a)):c=await axios.post(n.endpoint,o,a),location.assign(c.data.redirect)}catch(c){window.notyf.error(c.response.data)}return!1};return(s,o)=>{const c=e.resolveComponent("form-buttons");return e.openBlock(),e.createElementBlock("form",{id:"website-form",class:e.normalizeClass(n.class),onSubmit:e.withModifiers(r,["prevent"])},[e.renderSlot(s.$slots,"default"),n.endpoint?(e.openBlock(),e.createBlock(c,{key:0})):e.createCommentVNode("",!0)],34)}}}},Symbol.toStringTag,{value:"Module"})),i=(t,n)=>{const r=t.__vccOpts||t;for(const[s,o]of n)r[s]=o;return r},f={},m={class:"mt-6 flex items-center justify-end gap-x-6"},u=[e.createElementVNode("button",{type:"button",class:"text-sm font-semibold leading-6 text-gray-900"},"Cancel",-1),e.createElementVNode("button",{type:"submit",class:"rounded-md bg-indigo-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"},"Save",-1)];function p(t,n){return e.openBlock(),e.createElementBlock("div",m,u)}const b=Object.freeze(Object.defineProperty({__proto__:null,default:i(f,[["render",p]])},Symbol.toStringTag,{value:"Module"})),g={class:"mt-5"},y={for:"username",class:"block text-sm font-medium leading-6 text-gray-900"},h=e.createElementVNode("div",{class:"mt-2"},[e.createElementVNode("div",{class:"flex rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-inset focus-within:ring-indigo-600"},[e.createElementVNode("input",{type:"text",name:"username",id:"username",autocomplete:"username",class:"block flex-1 border-0 bg-transparent py-1.5 pl-1 text-gray-900 placeholder:text-gray-400 focus:ring-0 sm:text-sm sm:leading-6",placeholder:"janesmith"})])],-1),j=Object.freeze(Object.defineProperty({__proto__:null,default:{__name:"InputText",props:{object:{required:!1,default:null},endpoint:{required:!1,default:!1},class:{required:!1,default:{}},configs:{required:!1,default:{}}},setup(t){const n=t;return(r,s)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("label",y,e.toDisplayString(n.configs.title),1),h]))}}},Symbol.toStringTag,{value:"Module"})),k={},x={class:"col"};function B(t,n){return e.openBlock(),e.createElementBlock("div",x,[e.renderSlot(t.$slots,"default")])}const $=Object.freeze(Object.defineProperty({__proto__:null,default:i(k,[["render",B]])},Symbol.toStringTag,{value:"Module"})),S={},w={class:"container mx-auto mt-5"};function O(t,n){return e.openBlock(),e.createElementBlock("div",w,[e.renderSlot(t.$slots,"default")])}const C=Object.freeze(Object.defineProperty({__proto__:null,default:i(S,[["render",O]])},Symbol.toStringTag,{value:"Module"})),E={},T={class:"row"};function q(t,n){return e.openBlock(),e.createElementBlock("div",T,[e.renderSlot(t.$slots,"default")])}const P=Object.freeze(Object.defineProperty({__proto__:null,default:i(E,[["render",q]])},Symbol.toStringTag,{value:"Module"})),M={install:t=>{Object.entries(Object.assign({"./components/Builder.vue":d,"./components/forms/Form.vue":_,"./components/forms/FormButtons.vue":b,"./components/forms/InputText.vue":j,"./components/layout/Column.vue":$,"./components/layout/Content.vue":C,"./components/layout/Row.vue":P})).forEach(([r,s])=>{const o=r.split("/").pop().replace(/\.\w+$/,"");t.component(o,s.default)})}};l.components=M,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
Loading

0 comments on commit 7cb4717

Please sign in to comment.