llnet-vue-floating-form
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -1,80 +0,4 @@ | ||
import { ref as i, onMounted as f, watch as h, openBlock as T, createElementBlock as v, createElementVNode as u } from "vue"; | ||
import _ from "quill"; | ||
const b = { class: "floating-default" }, g = { class: "editor" }, y = { | ||
__name: "Editor", | ||
props: { | ||
label: { | ||
type: String, | ||
default: "Floating standard" | ||
}, | ||
modelValue: { | ||
type: String, | ||
default: "" | ||
}, | ||
contentType: { | ||
type: String, | ||
default: "html" | ||
} | ||
}, | ||
emits: ["update:modelValue"], | ||
setup(a, { emit: s }) { | ||
const r = i(null), t = i(null); | ||
let l = null; | ||
const c = s, o = a; | ||
function d(e) { | ||
o.contentType === "html" ? m(e) : p(e); | ||
} | ||
function m(e) { | ||
t.value.root.innerHTML = e; | ||
} | ||
function p(e) { | ||
t.value.root.innerText = e; | ||
} | ||
return f(() => { | ||
var e; | ||
t.value = new _(r.value, { | ||
theme: "snow", | ||
modules: { | ||
toolbar: [ | ||
["bold", "italic", "underline", "strike"], | ||
["blockquote", "code-block"], | ||
[{ header: 1 }, { header: 2 }], | ||
[{ list: "ordered" }, { list: "bullet" }], | ||
[{ script: "sub" }, { script: "super" }], | ||
[{ indent: "-1" }, { indent: "+1" }], | ||
[{ direction: "rtl" }], | ||
[{ size: ["small", !1, "large", "huge"] }] | ||
] | ||
} | ||
}), d(o.modelValue), (e = t.value) == null || e.on("text-change", () => { | ||
let n = null; | ||
switch (o.contentType) { | ||
case "text": | ||
n = t.value.root.innerText; | ||
break; | ||
case "html": | ||
default: | ||
n = t.value.getSemanticHTML(); | ||
break; | ||
} | ||
l && clearTimeout(l), l = setTimeout(() => { | ||
c("update:modelValue", n); | ||
}, 500); | ||
}); | ||
}), h(() => o.modelValue, (e) => { | ||
t.value.root.innerHTML !== e && (t.value.hasFocus() || (l && clearTimeout(l), l = setTimeout(() => { | ||
t.value.root.innerHTML = e; | ||
}, 500))); | ||
}, { deep: !0 }), (e, n) => (T(), v("div", b, [ | ||
u("div", g, [ | ||
u("div", { | ||
ref_key: "editor", | ||
ref: r | ||
}, null, 512) | ||
]) | ||
])); | ||
} | ||
}; | ||
import { _ as f } from "./Number-DQ-e4oFP.js"; | ||
export { | ||
y as Editor | ||
f as default | ||
}; |
@@ -1,58 +0,4 @@ | ||
import { computed as d, openBlock as s, createElementBlock as p, normalizeClass as f, withDirectives as c, createElementVNode as g, mergeProps as b, vModelText as N, createVNode as V } from "vue"; | ||
import { _ as v } from "./Label-eedKib_X.js"; | ||
const x = { | ||
__name: "Number", | ||
props: { | ||
label: { | ||
type: String, | ||
default: "Floating standard" | ||
}, | ||
modelValue: { | ||
type: [String, Number], | ||
default: null | ||
}, | ||
modelModifiers: { | ||
type: Object, | ||
default: () => ({}) | ||
}, | ||
format: { | ||
type: String, | ||
default: "int", | ||
validator: (a) => ["int", "float"].includes(a) | ||
} | ||
}, | ||
emits: ["update:modelValue"], | ||
setup(a, { emit: u }) { | ||
const t = a, i = u, o = d({ | ||
get: () => typeof t.modelValue == "number" || t.modelValue !== null ? Number(t.modelValue) : null, | ||
set: (e) => { | ||
t.format === "int" ? e = parseInt(e) : t.format === "float" && (e = parseFloat(e)), isNaN(e) && (e = null), i("update:modelValue", e); | ||
} | ||
}), m = (e) => { | ||
var l; | ||
t.modelModifiers && ((l = t.modelModifiers) != null && l.float) ? e.target.value = e.target.value.replace(/[^0-9\.\,]/g, "") : e.target.value = e.target.value.replace(/[^0-9]/g, ""), o.value = e.target.value; | ||
}; | ||
return (e, l) => { | ||
var n; | ||
return s(), p("div", { | ||
class: f(["floating-default", ((n = o.value) == null ? void 0 : n.length) === 0 ? "empty" : "has-content"]) | ||
}, [ | ||
c(g("input", b({ | ||
type: "text", | ||
class: "input", | ||
placeholder: " ", | ||
"onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r) | ||
}, a.modelModifiers, { | ||
onInput: l[1] || (l[1] = (r) => m(r)), | ||
inputmode: "numeric" | ||
}), null, 16), [ | ||
[N, o.value] | ||
]), | ||
V(v, { label: a.label }, null, 8, ["label"]) | ||
], 2); | ||
}; | ||
} | ||
}; | ||
import { _ as f } from "./Number-DQ-e4oFP.js"; | ||
export { | ||
x as Number | ||
f as default | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { ref as L, computed as S, openBlock as n, createElementBlock as s, normalizeClass as x, unref as u, withDirectives as _, createElementVNode as m, isRef as C, createVNode as p, withCtx as A, Fragment as b, renderList as v, toDisplayString as M, createCommentVNode as h, vModelSelect as O } from "vue"; | ||
import { ref as L, computed as x, openBlock as n, createElementBlock as s, normalizeClass as S, unref as u, withDirectives as _, createElementVNode as m, isRef as C, createVNode as p, withCtx as A, Fragment as b, renderList as v, toDisplayString as M, createCommentVNode as h, vModelSelect as O } from "vue"; | ||
import { a as B, u as E, c as D } from "./index-Ci4F7pjy.js"; | ||
@@ -51,3 +51,3 @@ import { _ as G } from "./Label-eedKib_X.js"; | ||
B(); | ||
const i = o, r = E(i, "modelValue", k), [V, f] = D(), c = S(() => { | ||
const i = o, r = E(i, "modelValue", k), [V, f] = D(), c = x(() => { | ||
let d = [], l = [], t = Array.isArray(i.options); | ||
@@ -65,3 +65,3 @@ return typeof i.options == "object" ? ((t ? i.options : Object.entries(i.options)).forEach((g, j) => { | ||
return (d, l) => (n(), s("div", { | ||
class: x(["floating-default", o.emptyValue === u(r) ? "empty" : "selected"]) | ||
class: S(["floating-default", o.emptyValue === u(r) ? "empty" : "selected"]) | ||
}, [ | ||
@@ -118,3 +118,3 @@ _(m("select", { | ||
export { | ||
J as Select | ||
J as default | ||
}; |
@@ -1,4 +0,4 @@ | ||
import { openBlock as r, createElementBlock as i, normalizeClass as m, unref as o, withDirectives as u, createElementVNode as d, isRef as p, vModelText as c, createVNode as f } from "vue"; | ||
import { openBlock as r, createElementBlock as i, normalizeClass as u, unref as o, withDirectives as m, createElementVNode as d, isRef as p, vModelText as c, createVNode as f } from "vue"; | ||
import { u as V } from "./index-Ci4F7pjy.js"; | ||
import { _ as x } from "./Label-eedKib_X.js"; | ||
import { _ as b } from "./Label-eedKib_X.js"; | ||
const M = { | ||
@@ -23,8 +23,8 @@ __name: "Text", | ||
const e = V(t, "modelValue", n); | ||
return (v, l) => { | ||
return (x, l) => { | ||
var a; | ||
return r(), i("div", { | ||
class: m(["floating-default", ((a = o(e)) == null ? void 0 : a.length) === 0 ? "empty" : "has-content"]) | ||
class: u(["floating-default", ((a = o(e)) == null ? void 0 : a.length) === 0 ? "empty" : "has-content"]) | ||
}, [ | ||
u(d("input", { | ||
m(d("input", { | ||
type: "text", | ||
@@ -37,3 +37,3 @@ class: "input", | ||
]), | ||
f(x, { label: t.label }, null, 8, ["label"]) | ||
f(b, { label: t.label }, null, 8, ["label"]) | ||
], 2); | ||
@@ -44,3 +44,3 @@ }; | ||
export { | ||
M as Text | ||
M as default | ||
}; |
import { openBlock as s, createElementBlock as i, normalizeClass as m, unref as o, withDirectives as u, createElementVNode as d, isRef as p, vModelText as c, createVNode as f } from "vue"; | ||
import { _ as V } from "./Label-eedKib_X.js"; | ||
import { u as x } from "./index-Ci4F7pjy.js"; | ||
import { u as b } from "./index-Ci4F7pjy.js"; | ||
const M = { | ||
@@ -22,4 +22,4 @@ __name: "Textarea", | ||
setup(t, { emit: n }) { | ||
const e = x(t, "modelValue", n); | ||
return (v, l) => { | ||
const e = b(t, "modelValue", n); | ||
return (x, l) => { | ||
var a; | ||
@@ -42,3 +42,3 @@ return s(), i("div", { | ||
export { | ||
M as Textarea | ||
M as default | ||
}; |
{ | ||
"name": "llnet-vue-floating-form", | ||
"private": false, | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"type": "module", | ||
@@ -31,3 +31,8 @@ "author": "LLNet", | ||
"require": "./dist/main.cjs" | ||
} | ||
}, | ||
"./*": { | ||
"import": "./dist/*.js", | ||
"require": "./dist/*.cjs" | ||
}, | ||
"./css/style.css": "./dist/style.css" | ||
}, | ||
@@ -34,0 +39,0 @@ "scripts": { |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
23
7
0
41762
685