vx-vue 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # Vue 3 + Vite
2
+
3
+ This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ ## Recommended IDE Setup
6
+
7
+ - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
@@ -0,0 +1,180 @@
1
+ import { openBlock as s, createElementBlock as l, createElementVNode as n, ref as c, computed as V, useAttrs as _, normalizeClass as k, mergeProps as A, withModifiers as j, createBlock as C, unref as b, renderSlot as h, toDisplayString as v, createCommentVNode as m, Fragment as x, renderList as L, createVNode as M, Transition as z, withCtx as B, createTextVNode as $, nextTick as N } from "vue";
2
+ function O(t, a) {
3
+ return s(), l("svg", {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ fill: "none",
6
+ viewBox: "0 0 24 24",
7
+ "stroke-width": "1.5",
8
+ stroke: "currentColor",
9
+ "aria-hidden": "true"
10
+ }, [
11
+ n("path", {
12
+ "stroke-linecap": "round",
13
+ "stroke-linejoin": "round",
14
+ d: "M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
15
+ })
16
+ ]);
17
+ }
18
+ function E(t, a) {
19
+ return s(), l("svg", {
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ fill: "none",
22
+ viewBox: "0 0 24 24",
23
+ "stroke-width": "1.5",
24
+ stroke: "currentColor",
25
+ "aria-hidden": "true"
26
+ }, [
27
+ n("path", {
28
+ "stroke-linecap": "round",
29
+ "stroke-linejoin": "round",
30
+ d: "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
31
+ }),
32
+ n("path", {
33
+ "stroke-linecap": "round",
34
+ "stroke-linejoin": "round",
35
+ d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
36
+ })
37
+ ]);
38
+ }
39
+ const P = ["value", "type"], te = /* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
40
+ __name: "password-input",
41
+ props: ["modelValue"],
42
+ emits: ["update:modelValue"],
43
+ setup(t, { emit: a }) {
44
+ const r = c(!1), i = V(() => {
45
+ let e = Object.assign({}, _());
46
+ return delete e.class, e;
47
+ });
48
+ return (e, o) => (s(), l("div", {
49
+ class: k("inline-block relative " + _().class)
50
+ }, [
51
+ n("input", A({
52
+ value: t.modelValue,
53
+ type: r.value ? "text" : "password",
54
+ onInput: o[0] || (o[0] = (u) => a("update:modelValue", u.target.value))
55
+ }, i.value, { class: "block pr-10 w-full form-input peer" }), null, 16, P),
56
+ n("button", {
57
+ onClick: o[1] || (o[1] = j((u) => r.value = !r.value, ["stop"])),
58
+ class: "flex absolute inset-y-0 right-0 items-center pr-3 text-brand-700 hover:text-brand"
59
+ }, [
60
+ r.value ? (s(), C(b(O), {
61
+ key: 0,
62
+ class: "w-5 h-5"
63
+ })) : (s(), C(b(E), {
64
+ key: 1,
65
+ class: "w-5 h-5"
66
+ }))
67
+ ]),
68
+ h(e.$slots, "default")
69
+ ], 2));
70
+ }
71
+ }), T = ["value"], F = {
72
+ key: 0,
73
+ disabled: "",
74
+ value: ""
75
+ }, I = ["value", "selected"], se = {
76
+ __name: "form-select",
77
+ props: { options: Array, modelValue: [String, Number], disabledLabel: String },
78
+ emits: ["update:modelValue"],
79
+ setup(t, { emit: a }) {
80
+ return (r, i) => (s(), l("select", A(r.$attrs, {
81
+ value: t.modelValue,
82
+ class: "form-select",
83
+ onChange: i[0] || (i[0] = (e) => a("update:modelValue", e.target.value))
84
+ }), [
85
+ t.disabledLabel ? (s(), l("option", F, v(t.disabledLabel), 1)) : m("", !0),
86
+ (s(!0), l(x, null, L(t.options, (e) => (s(), l("option", {
87
+ value: e.key !== void 0 ? e.key : e.label || e,
88
+ selected: (e.key !== void 0 ? e.key : e.label || e) === t.modelValue
89
+ }, v(e.label || e), 9, I))), 256))
90
+ ], 16, T));
91
+ }
92
+ }, D = {
93
+ key: 0,
94
+ class: "fixed inset-0 z-50 bg-black bg-opacity-50 backdrop-blur-sm",
95
+ "aria-hidden": "true"
96
+ }, q = {
97
+ key: 0,
98
+ class: "overflow-y-auto fixed inset-0 z-50"
99
+ }, G = { class: "flex justify-center items-end px-4 pt-4 pb-20 min-h-screen text-center sm:block sm:p-0" }, H = { key: 0 }, J = /* @__PURE__ */ n("span", {
100
+ class: "hidden sm:inline-block sm:h-screen sm:align-middle",
101
+ "aria-hidden": "true"
102
+ }, "​", -1), K = { class: "inline-block overflow-hidden text-left align-bottom bg-white rounded shadow-xl transition-all transform sm:my-8 sm:w-full sm:max-w-sm sm:align-middle lg:max-w-lg" }, Q = { class: "px-4 pb-4 mt-4 sm:px-6 sm:pb-6 sm:mt-5" }, R = { class: "flex flex-row items-center" }, U = { class: "flex-shrink-0" }, W = { class: "flex-grow text-center" }, X = ["onClick"], le = {
103
+ __name: "confirm",
104
+ props: {
105
+ buttons: {
106
+ type: [Object, Array],
107
+ default: { label: "Ok" },
108
+ validator: (t) => Array.isArray(t) && t.length <= 2 && t.filter((a) => a.label !== "undefined" && a.value !== "undefined").length === t.length || t.label !== void 0 && t.value !== void 0
109
+ },
110
+ headerClass: {
111
+ type: String,
112
+ default: "text-vxvue-alt-900 bg-vxvue-alt-400"
113
+ },
114
+ buttonClass: {
115
+ type: String,
116
+ default: "button"
117
+ }
118
+ },
119
+ setup(t, { expose: a }) {
120
+ const r = t, i = c(""), e = c(""), o = c(!1);
121
+ let u = null, g = null;
122
+ const S = V(() => Array.isArray(r.buttons) ? r.buttons : [r.buttons]), y = c(null);
123
+ return a({ open: (d, w) => (i.value = d, e.value = w, o.value = !0, N(() => y.value.firstElementChild.focus()), new Promise((f, p) => {
124
+ u = f, g = p;
125
+ })) }), (d, w) => (s(), l(x, null, [
126
+ o.value ? (s(), l("div", D)) : m("", !0),
127
+ M(z, { name: "appear" }, {
128
+ default: B(() => [
129
+ o.value ? (s(), l("div", q, [
130
+ n("div", G, [
131
+ o.value ? (s(), l("div", H, [
132
+ J,
133
+ n("div", K, [
134
+ i.value ? (s(), l("h3", {
135
+ key: 0,
136
+ class: k(["py-4 pt-4 text-lg font-medium text-center sm:py-6", t.headerClass])
137
+ }, [
138
+ h(d.$slots, "title", { title: i.value }, () => [
139
+ $(v(i.value), 1)
140
+ ])
141
+ ], 2)) : m("", !0),
142
+ n("div", Q, [
143
+ n("div", R, [
144
+ n("div", U, [
145
+ h(d.$slots, "icon")
146
+ ]),
147
+ n("p", W, [
148
+ h(d.$slots, "default", { message: e.value }, () => [
149
+ $(v(e.value), 1)
150
+ ])
151
+ ])
152
+ ]),
153
+ n("div", {
154
+ class: "flex justify-center mt-5 space-x-2 sm:mt-6",
155
+ ref_key: "buttonsContainer",
156
+ ref: y
157
+ }, [
158
+ (s(!0), l(x, null, L(S.value, (f, p) => (s(), l("button", {
159
+ class: k([t.buttonClass, f.class]),
160
+ onClick: j((Z) => {
161
+ o.value = !1, p === 0 ? b(u)() : b(g)();
162
+ }, ["prevent"])
163
+ }, v(f.label), 11, X))), 256))
164
+ ], 512)
165
+ ])
166
+ ])
167
+ ])) : m("", !0)
168
+ ])
169
+ ])) : m("", !0)
170
+ ]),
171
+ _: 3
172
+ })
173
+ ], 64));
174
+ }
175
+ };
176
+ export {
177
+ le as Confirm,
178
+ se as FormSelect,
179
+ te as PasswordInput
180
+ };
@@ -0,0 +1 @@
1
+ (function(r,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(r=typeof globalThis<"u"?globalThis:r||self,e(r.vxVue={},r.Vue))})(this,function(r,e){"use strict";function u(l,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})])}function h(l,n){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})])}const b=["value","type"],g=Object.assign({inheritAttrs:!1},{__name:"password-input",props:["modelValue"],emits:["update:modelValue"],setup(l,{emit:n}){const o=e.ref(!1),a=e.computed(()=>{let t=Object.assign({},e.useAttrs());return delete t.class,t});return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("inline-block relative "+e.useAttrs().class)},[e.createElementVNode("input",e.mergeProps({value:l.modelValue,type:o.value?"text":"password",onInput:s[0]||(s[0]=c=>n("update:modelValue",c.target.value))},a.value,{class:"block pr-10 w-full form-input peer"}),null,16,b),e.createElementVNode("button",{onClick:s[1]||(s[1]=e.withModifiers(c=>o.value=!o.value,["stop"])),class:"flex absolute inset-y-0 right-0 items-center pr-3 text-brand-700 hover:text-brand"},[o.value?(e.openBlock(),e.createBlock(e.unref(u),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(h),{key:1,class:"w-5 h-5"}))]),e.renderSlot(t.$slots,"default")],2))}}),y=["value"],x={key:0,disabled:"",value:""},B=["value","selected"],w={__name:"form-select",props:{options:Array,modelValue:[String,Number],disabledLabel:String},emits:["update:modelValue"],setup(l,{emit:n}){return(o,a)=>(e.openBlock(),e.createElementBlock("select",e.mergeProps(o.$attrs,{value:l.modelValue,class:"form-select",onChange:a[0]||(a[0]=t=>n("update:modelValue",t.target.value))}),[l.disabledLabel?(e.openBlock(),e.createElementBlock("option",x,e.toDisplayString(l.disabledLabel),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.options,t=>(e.openBlock(),e.createElementBlock("option",{value:t.key!==void 0?t.key:t.label||t,selected:(t.key!==void 0?t.key:t.label||t)===l.modelValue},e.toDisplayString(t.label||t),9,B))),256))],16,y))}},V={key:0,class:"fixed inset-0 z-50 bg-black bg-opacity-50 backdrop-blur-sm","aria-hidden":"true"},_={key:0,class:"overflow-y-auto fixed inset-0 z-50"},E={class:"flex justify-center items-end px-4 pt-4 pb-20 min-h-screen text-center sm:block sm:p-0"},C={key:0},N=e.createElementVNode("span",{class:"hidden sm:inline-block sm:h-screen sm:align-middle","aria-hidden":"true"},"​",-1),S={class:"inline-block overflow-hidden text-left align-bottom bg-white rounded shadow-xl transition-all transform sm:my-8 sm:w-full sm:max-w-sm sm:align-middle lg:max-w-lg"},$={class:"px-4 pb-4 mt-4 sm:px-6 sm:pb-6 sm:mt-5"},A={class:"flex flex-row items-center"},j={class:"flex-shrink-0"},L={class:"flex-grow text-center"},M=["onClick"],z={__name:"confirm",props:{buttons:{type:[Object,Array],default:{label:"Ok"},validator:l=>Array.isArray(l)&&l.length<=2&&l.filter(n=>n.label!=="undefined"&&n.value!=="undefined").length===l.length||l.label!==void 0&&l.value!==void 0},headerClass:{type:String,default:"text-vxvue-alt-900 bg-vxvue-alt-400"},buttonClass:{type:String,default:"button"}},setup(l,{expose:n}){const o=l,a=e.ref(""),t=e.ref(""),s=e.ref(!1);let c=null,f=null;const T=e.computed(()=>Array.isArray(o.buttons)?o.buttons:[o.buttons]),p=e.ref(null);return n({open:(i,k)=>(a.value=i,t.value=k,s.value=!0,e.nextTick(()=>p.value.firstElementChild.focus()),new Promise((d,m)=>{c=d,f=m}))}),(i,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value?(e.openBlock(),e.createElementBlock("div",V)):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:"appear"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",_,[e.createElementVNode("div",E,[s.value?(e.openBlock(),e.createElementBlock("div",C,[N,e.createElementVNode("div",S,[a.value?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(["py-4 pt-4 text-lg font-medium text-center sm:py-6",l.headerClass])},[e.renderSlot(i.$slots,"title",{title:a.value},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",$,[e.createElementVNode("div",A,[e.createElementVNode("div",j,[e.renderSlot(i.$slots,"icon")]),e.createElementVNode("p",L,[e.renderSlot(i.$slots,"default",{message:t.value},()=>[e.createTextVNode(e.toDisplayString(t.value),1)])])]),e.createElementVNode("div",{class:"flex justify-center mt-5 space-x-2 sm:mt-6",ref_key:"buttonsContainer",ref:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(d,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass([l.buttonClass,d.class]),onClick:e.withModifiers(O=>{s.value=!1,m===0?e.unref(c)():e.unref(f)()},["prevent"])},e.toDisplayString(d.label),11,M))),256))],512)])])])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_:3})],64))}};r.Confirm=z,r.FormSelect=w,r.PasswordInput=g,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "vx-vue",
3
+ "files": ["dist"],
4
+ "main": "./dist/vxvue.umd.js",
5
+ "module": "./dist/vxvue.es.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/vxvue.es.js",
9
+ "require": "./dist/vxvue.umd.js"
10
+ }
11
+ },
12
+ "version": "0.0.1",
13
+ "scripts": {
14
+ "dev": "vite",
15
+ "build": "vite build",
16
+ "preview": "vite preview"
17
+ },
18
+ "devDependencies": {
19
+ "vue": "^3.3.4",
20
+ "tailwindcss": "^3.3.3",
21
+ "@tailwindcss/forms": "^0.5.6",
22
+ "@heroicons/vue": "^2.0.18",
23
+ "@vitejs/plugin-vue": "^4.4.0",
24
+ "vite": "^4.4.11"
25
+ }
26
+ }