@charpente-ui/vue 1.1.0 → 1.1.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/dist/charpente.js +68 -52
- package/dist/charpente.umd.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/charpente.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as n, openBlock as u, createBlock as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as n, openBlock as u, createBlock as h, resolveDynamicComponent as V, normalizeProps as B, guardReactiveProps as C, withCtx as b, renderSlot as v, useModel as _, useAttrs as m, computed as c, useId as p, withDirectives as f, createElementBlock as d, mergeProps as i, vModelCheckbox as M, mergeModels as $, withModifiers as A, vModelDynamic as I, vModelRadio as k, vModelSelect as x, vModelText as y } from "vue";
|
|
2
|
+
const L = /* @__PURE__ */ n({
|
|
3
3
|
inheritAttrs: !1,
|
|
4
4
|
__name: "BaseButton",
|
|
5
5
|
props: {
|
|
6
6
|
as: { default: "button" }
|
|
7
7
|
},
|
|
8
8
|
setup(t) {
|
|
9
|
-
return (e, o) => (u(), V(
|
|
10
|
-
default:
|
|
11
|
-
|
|
9
|
+
return (e, o) => (u(), h(V(t.as), B(C(e.$attrs)), {
|
|
10
|
+
default: b(() => [
|
|
11
|
+
v(e.$slots, "default")
|
|
12
12
|
]),
|
|
13
13
|
_: 3
|
|
14
14
|
}, 16));
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), S = ["id", "value"], z = /* @__PURE__ */ n({
|
|
17
17
|
inheritAttrs: !1,
|
|
18
18
|
__name: "BaseCheckbox",
|
|
19
19
|
props: /* @__PURE__ */ $({
|
|
@@ -24,16 +24,31 @@ const T = /* @__PURE__ */ n({
|
|
|
24
24
|
}),
|
|
25
25
|
emits: ["update:modelValue"],
|
|
26
26
|
setup(t) {
|
|
27
|
-
const e =
|
|
28
|
-
return (
|
|
29
|
-
"onUpdate:modelValue":
|
|
30
|
-
id:
|
|
27
|
+
const e = _(t, "modelValue"), o = m(), l = c(() => o.id || p());
|
|
28
|
+
return (r, s) => f((u(), d("input", i({ type: "checkbox" }, r.$attrs, {
|
|
29
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
30
|
+
id: l.value,
|
|
31
31
|
value: t.value
|
|
32
|
-
}), null, 16,
|
|
33
|
-
[
|
|
32
|
+
}), null, 16, S)), [
|
|
33
|
+
[M, e.value]
|
|
34
34
|
]);
|
|
35
35
|
}
|
|
36
|
-
}), U = ["id"],
|
|
36
|
+
}), U = ["id"], E = /* @__PURE__ */ n({
|
|
37
|
+
inheritAttrs: !1,
|
|
38
|
+
__name: "BaseForm",
|
|
39
|
+
emits: ["submit"],
|
|
40
|
+
setup(t, { emit: e }) {
|
|
41
|
+
const o = m(), l = e, r = (a) => {
|
|
42
|
+
l("submit", a);
|
|
43
|
+
}, s = c(() => o.id || p());
|
|
44
|
+
return (a, T) => (u(), d("form", i(a.$attrs, {
|
|
45
|
+
id: s.value,
|
|
46
|
+
onSubmit: A(r, ["prevent"])
|
|
47
|
+
}), [
|
|
48
|
+
v(a.$slots, "default")
|
|
49
|
+
], 16, U));
|
|
50
|
+
}
|
|
51
|
+
}), R = ["id"], j = /* @__PURE__ */ n({
|
|
37
52
|
inheritAttrs: !1,
|
|
38
53
|
__name: "BaseInput",
|
|
39
54
|
props: {
|
|
@@ -42,15 +57,15 @@ const T = /* @__PURE__ */ n({
|
|
|
42
57
|
},
|
|
43
58
|
emits: ["update:modelValue"],
|
|
44
59
|
setup(t) {
|
|
45
|
-
const e =
|
|
46
|
-
return (
|
|
47
|
-
"onUpdate:modelValue":
|
|
48
|
-
id:
|
|
49
|
-
}), null, 16,
|
|
50
|
-
[
|
|
60
|
+
const e = _(t, "modelValue"), o = m(), l = c(() => o.id || p());
|
|
61
|
+
return (r, s) => f((u(), d("input", i(r.$attrs, {
|
|
62
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
63
|
+
id: l.value
|
|
64
|
+
}), null, 16, R)), [
|
|
65
|
+
[I, e.value]
|
|
51
66
|
]);
|
|
52
67
|
}
|
|
53
|
-
}),
|
|
68
|
+
}), g = ["for"], q = /* @__PURE__ */ n({
|
|
54
69
|
inheritAttrs: !1,
|
|
55
70
|
__name: "BaseLabel",
|
|
56
71
|
props: {
|
|
@@ -58,13 +73,13 @@ const T = /* @__PURE__ */ n({
|
|
|
58
73
|
},
|
|
59
74
|
setup(t) {
|
|
60
75
|
const e = t;
|
|
61
|
-
return (o,
|
|
76
|
+
return (o, l) => (u(), d("label", i(o.$attrs, {
|
|
62
77
|
for: e.for
|
|
63
78
|
}), [
|
|
64
|
-
|
|
65
|
-
], 16,
|
|
79
|
+
v(o.$slots, "default")
|
|
80
|
+
], 16, g));
|
|
66
81
|
}
|
|
67
|
-
}),
|
|
82
|
+
}), w = ["id", "value"], G = /* @__PURE__ */ n({
|
|
68
83
|
inheritAttrs: !1,
|
|
69
84
|
__name: "BaseRadio",
|
|
70
85
|
props: /* @__PURE__ */ $({
|
|
@@ -75,16 +90,16 @@ const T = /* @__PURE__ */ n({
|
|
|
75
90
|
}),
|
|
76
91
|
emits: ["update:modelValue"],
|
|
77
92
|
setup(t) {
|
|
78
|
-
const e =
|
|
79
|
-
return (
|
|
80
|
-
"onUpdate:modelValue":
|
|
81
|
-
id:
|
|
93
|
+
const e = _(t, "modelValue"), o = m(), l = c(() => o.id || p());
|
|
94
|
+
return (r, s) => f((u(), d("input", i({ type: "radio" }, r.$attrs, {
|
|
95
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
96
|
+
id: l.value,
|
|
82
97
|
value: t.value
|
|
83
|
-
}), null, 16,
|
|
84
|
-
[
|
|
98
|
+
}), null, 16, w)), [
|
|
99
|
+
[k, e.value]
|
|
85
100
|
]);
|
|
86
101
|
}
|
|
87
|
-
}),
|
|
102
|
+
}), D = ["id"], H = /* @__PURE__ */ n({
|
|
88
103
|
inheritAttrs: !1,
|
|
89
104
|
__name: "BaseSelect",
|
|
90
105
|
props: {
|
|
@@ -93,17 +108,17 @@ const T = /* @__PURE__ */ n({
|
|
|
93
108
|
},
|
|
94
109
|
emits: ["update:modelValue"],
|
|
95
110
|
setup(t) {
|
|
96
|
-
const e =
|
|
97
|
-
return (
|
|
98
|
-
"onUpdate:modelValue":
|
|
99
|
-
id:
|
|
111
|
+
const e = _(t, "modelValue"), o = m(), l = c(() => o.id || p());
|
|
112
|
+
return (r, s) => f((u(), d("select", i(r.$attrs, {
|
|
113
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
114
|
+
id: l.value
|
|
100
115
|
}), [
|
|
101
|
-
|
|
102
|
-
], 16,
|
|
103
|
-
[
|
|
116
|
+
v(r.$slots, "default")
|
|
117
|
+
], 16, D)), [
|
|
118
|
+
[x, e.value]
|
|
104
119
|
]);
|
|
105
120
|
}
|
|
106
|
-
}),
|
|
121
|
+
}), P = ["id"], J = /* @__PURE__ */ n({
|
|
107
122
|
inheritAttrs: !1,
|
|
108
123
|
__name: "BaseTextarea",
|
|
109
124
|
props: {
|
|
@@ -112,21 +127,22 @@ const T = /* @__PURE__ */ n({
|
|
|
112
127
|
},
|
|
113
128
|
emits: ["update:modelValue"],
|
|
114
129
|
setup(t) {
|
|
115
|
-
const e =
|
|
116
|
-
return (
|
|
117
|
-
"onUpdate:modelValue":
|
|
118
|
-
id:
|
|
119
|
-
}), null, 16,
|
|
120
|
-
[
|
|
130
|
+
const e = _(t, "modelValue"), o = m(), l = c(() => o.id || p());
|
|
131
|
+
return (r, s) => f((u(), d("textarea", i(r.$attrs, {
|
|
132
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
133
|
+
id: l.value
|
|
134
|
+
}), null, 16, P)), [
|
|
135
|
+
[y, e.value]
|
|
121
136
|
]);
|
|
122
137
|
}
|
|
123
138
|
});
|
|
124
139
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
140
|
+
L as CButton,
|
|
141
|
+
z as CCheckbox,
|
|
142
|
+
E as CForm,
|
|
143
|
+
j as CInput,
|
|
144
|
+
q as CLabel,
|
|
145
|
+
G as CRadio,
|
|
146
|
+
H as CSelect,
|
|
147
|
+
J as CTextarea
|
|
132
148
|
};
|
package/dist/charpente.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
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.Charpente={},l.Vue))})(this,(function(l,e){"use strict";const i=e.defineComponent({inheritAttrs:!1,__name:"BaseButton",props:{as:{default:"button"}},setup(o){return(t,n)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.as),e.normalizeProps(e.guardReactiveProps(t.$attrs)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16))}}),m=["id","value"],c=e.defineComponent({inheritAttrs:!1,__name:"BaseCheckbox",props:e.mergeModels({value:{}},{modelValue:{type:[Boolean,Array]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),a=e.computed(()=>n.id||e.useId());return(d,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"checkbox"},d.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:a.value,value:o.value}),null,16,m)),[[e.vModelCheckbox,t.value]])}}),p=["id"],u=e.defineComponent({inheritAttrs:!1,__name:"BaseForm",emits:["submit"],setup(o,{emit:t}){const n=e.useAttrs(),a=t,d=r=>{a("submit",r)},s=e.computed(()=>n.id||e.useId());return(r,A)=>(e.openBlock(),e.createElementBlock("form",e.mergeProps(r.$attrs,{id:s.value,onSubmit:e.withModifiers(d,["prevent"])}),[e.renderSlot(r.$slots,"default")],16,p))}}),f=["id"],_=e.defineComponent({inheritAttrs:!1,__name:"BaseInput",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),a=e.computed(()=>n.id||e.useId());return(d,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps(d.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:a.value}),null,16,f)),[[e.vModelDynamic,t.value]])}}),h=["for"],B=e.defineComponent({inheritAttrs:!1,__name:"BaseLabel",props:{for:{}},setup(o){const t=o;return(n,a)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps(n.$attrs,{for:t.for}),[e.renderSlot(n.$slots,"default")],16,h))}}),$=["id","value"],C=e.defineComponent({inheritAttrs:!1,__name:"BaseRadio",props:e.mergeModels({value:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),a=e.computed(()=>n.id||e.useId());return(d,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"radio"},d.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:a.value,value:o.value}),null,16,$)),[[e.vModelRadio,t.value]])}}),k=["id"],V=e.defineComponent({inheritAttrs:!1,__name:"BaseSelect",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),a=e.computed(()=>n.id||e.useId());return(d,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps(d.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:a.value}),[e.renderSlot(d.$slots,"default")],16,k)),[[e.vModelSelect,t.value]])}}),M=["id"],b=e.defineComponent({inheritAttrs:!1,__name:"BaseTextarea",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),a=e.computed(()=>n.id||e.useId());return(d,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps(d.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:a.value}),null,16,M)),[[e.vModelText,t.value]])}});l.CButton=i,l.CCheckbox=c,l.CForm=u,l.CInput=_,l.CLabel=B,l.CRadio=C,l.CSelect=V,l.CTextarea=b,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as CButton } from './components/BaseButton';
|
|
2
2
|
export { default as CCheckbox } from './components/BaseCheckbox';
|
|
3
|
+
export { default as CForm } from './components/BaseForm';
|
|
3
4
|
export { default as CInput } from './components/BaseInput';
|
|
4
5
|
export { default as CLabel } from './components/BaseLabel';
|
|
5
6
|
export { default as CRadio } from './components/BaseRadio';
|