@charpente-ui/vue 1.2.0 → 1.2.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
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as u, openBlock as d, createBlock as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as u, openBlock as d, createBlock as B, resolveDynamicComponent as M, normalizeProps as g, guardReactiveProps as b, withCtx as A, renderSlot as h, useModel as _, useAttrs as c, useId as p, useTemplateRef as V, computed as f, watchEffect as k, withDirectives as $, createElementBlock as i, mergeProps as m, vModelCheckbox as x, mergeModels as C, watch as y, withModifiers as R, vModelDynamic as w, vModelRadio as S, vModelSelect as U, vModelText as F } from "vue";
|
|
2
|
+
const H = /* @__PURE__ */ u({
|
|
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, s) => (d(),
|
|
10
|
-
default:
|
|
9
|
+
return (e, s) => (d(), B(M(t.as), g(b(e.$attrs)), {
|
|
10
|
+
default: A(() => [
|
|
11
11
|
h(e.$slots, "default")
|
|
12
12
|
]),
|
|
13
13
|
_: 3
|
|
14
14
|
}, 16));
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), T = ["id", "value"], J = /* @__PURE__ */ u({
|
|
17
17
|
inheritAttrs: !1,
|
|
18
18
|
__name: "BaseCheckbox",
|
|
19
|
-
props: /* @__PURE__ */
|
|
19
|
+
props: /* @__PURE__ */ C({
|
|
20
20
|
value: {},
|
|
21
21
|
indeterminate: { type: Boolean }
|
|
22
22
|
}, {
|
|
@@ -25,21 +25,21 @@ const J = /* @__PURE__ */ u({
|
|
|
25
25
|
}),
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
27
|
setup(t) {
|
|
28
|
-
const e = t, s = _(t, "modelValue"),
|
|
28
|
+
const e = t, s = _(t, "modelValue"), l = c(), r = p(), n = V("input"), a = f(() => l.id || r);
|
|
29
29
|
return k(() => {
|
|
30
|
-
|
|
30
|
+
n.value && (n.value.indeterminate = !!e.indeterminate);
|
|
31
31
|
}), (o, v) => $((d(), i("input", m({
|
|
32
32
|
ref: "input",
|
|
33
33
|
type: "checkbox"
|
|
34
34
|
}, o.$attrs, {
|
|
35
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
35
|
+
"onUpdate:modelValue": v[0] || (v[0] = (I) => s.value = I),
|
|
36
36
|
id: a.value,
|
|
37
37
|
value: t.value
|
|
38
|
-
}), null, 16,
|
|
39
|
-
[
|
|
38
|
+
}), null, 16, T)), [
|
|
39
|
+
[x, s.value]
|
|
40
40
|
]);
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
42
|
+
}), D = ["id"], K = /* @__PURE__ */ u({
|
|
43
43
|
inheritAttrs: !1,
|
|
44
44
|
__name: "BaseFile",
|
|
45
45
|
props: {
|
|
@@ -48,35 +48,34 @@ const J = /* @__PURE__ */ u({
|
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:modelValue"],
|
|
50
50
|
setup(t) {
|
|
51
|
-
const e = _(t, "modelValue"), s = c(),
|
|
51
|
+
const e = _(t, "modelValue"), s = c(), l = p(), r = V("input"), n = f(() => s.id || l);
|
|
52
52
|
function a(o) {
|
|
53
53
|
e.value = o.target.files;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
56
|
-
!o &&
|
|
55
|
+
return y(e, (o) => {
|
|
56
|
+
!o && r.value && (r.value.value = "");
|
|
57
57
|
}), (o, v) => (d(), i("input", m({
|
|
58
58
|
type: "file",
|
|
59
|
-
|
|
60
|
-
ref: n
|
|
59
|
+
ref: "input"
|
|
61
60
|
}, o.$attrs, {
|
|
62
|
-
id:
|
|
61
|
+
id: n.value,
|
|
63
62
|
onChange: a
|
|
64
|
-
}), null, 16,
|
|
63
|
+
}), null, 16, D));
|
|
65
64
|
}
|
|
66
|
-
}),
|
|
65
|
+
}), P = ["id"], N = /* @__PURE__ */ u({
|
|
67
66
|
inheritAttrs: !1,
|
|
68
67
|
__name: "BaseForm",
|
|
69
68
|
emits: ["submit"],
|
|
70
69
|
setup(t, { emit: e }) {
|
|
71
|
-
const s = c(),
|
|
70
|
+
const s = c(), l = p(), r = e, n = f(() => s.id || l);
|
|
72
71
|
return (a, o) => (d(), i("form", m(a.$attrs, {
|
|
73
|
-
id:
|
|
74
|
-
onSubmit: o[0] || (o[0] =
|
|
72
|
+
id: n.value,
|
|
73
|
+
onSubmit: o[0] || (o[0] = R((v) => r("submit", v), ["prevent"]))
|
|
75
74
|
}), [
|
|
76
75
|
h(a.$slots, "default")
|
|
77
|
-
], 16,
|
|
76
|
+
], 16, P));
|
|
78
77
|
}
|
|
79
|
-
}),
|
|
78
|
+
}), E = ["id"], O = /* @__PURE__ */ u({
|
|
80
79
|
inheritAttrs: !1,
|
|
81
80
|
__name: "BaseInput",
|
|
82
81
|
props: {
|
|
@@ -85,15 +84,15 @@ const J = /* @__PURE__ */ u({
|
|
|
85
84
|
},
|
|
86
85
|
emits: ["update:modelValue"],
|
|
87
86
|
setup(t) {
|
|
88
|
-
const e = _(t, "modelValue"), s = c(),
|
|
89
|
-
return (
|
|
87
|
+
const e = _(t, "modelValue"), s = c(), l = p(), r = f(() => s.id || l);
|
|
88
|
+
return (n, a) => $((d(), i("input", m(n.$attrs, {
|
|
90
89
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => e.value = o),
|
|
91
|
-
id:
|
|
92
|
-
}), null, 16,
|
|
93
|
-
[
|
|
90
|
+
id: r.value
|
|
91
|
+
}), null, 16, E)), [
|
|
92
|
+
[w, e.value]
|
|
94
93
|
]);
|
|
95
94
|
}
|
|
96
|
-
}),
|
|
95
|
+
}), L = ["for"], Q = /* @__PURE__ */ u({
|
|
97
96
|
inheritAttrs: !1,
|
|
98
97
|
__name: "BaseLabel",
|
|
99
98
|
props: {
|
|
@@ -101,16 +100,16 @@ const J = /* @__PURE__ */ u({
|
|
|
101
100
|
},
|
|
102
101
|
setup(t) {
|
|
103
102
|
const e = t;
|
|
104
|
-
return (s,
|
|
103
|
+
return (s, l) => (d(), i("label", m(s.$attrs, {
|
|
105
104
|
for: e.for
|
|
106
105
|
}), [
|
|
107
106
|
h(s.$slots, "default")
|
|
108
|
-
], 16,
|
|
107
|
+
], 16, L));
|
|
109
108
|
}
|
|
110
|
-
}),
|
|
109
|
+
}), z = ["id", "value"], W = /* @__PURE__ */ u({
|
|
111
110
|
inheritAttrs: !1,
|
|
112
111
|
__name: "BaseRadio",
|
|
113
|
-
props: /* @__PURE__ */
|
|
112
|
+
props: /* @__PURE__ */ C({
|
|
114
113
|
value: {}
|
|
115
114
|
}, {
|
|
116
115
|
modelValue: {},
|
|
@@ -118,16 +117,16 @@ const J = /* @__PURE__ */ u({
|
|
|
118
117
|
}),
|
|
119
118
|
emits: ["update:modelValue"],
|
|
120
119
|
setup(t) {
|
|
121
|
-
const e = _(t, "modelValue"), s = c(),
|
|
122
|
-
return (
|
|
120
|
+
const e = _(t, "modelValue"), s = c(), l = p(), r = f(() => s.id || l);
|
|
121
|
+
return (n, a) => $((d(), i("input", m({ type: "radio" }, n.$attrs, {
|
|
123
122
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => e.value = o),
|
|
124
|
-
id:
|
|
123
|
+
id: r.value,
|
|
125
124
|
value: t.value
|
|
126
|
-
}), null, 16,
|
|
127
|
-
[
|
|
125
|
+
}), null, 16, z)), [
|
|
126
|
+
[S, e.value]
|
|
128
127
|
]);
|
|
129
128
|
}
|
|
130
|
-
}),
|
|
129
|
+
}), j = ["id"], X = /* @__PURE__ */ u({
|
|
131
130
|
inheritAttrs: !1,
|
|
132
131
|
__name: "BaseSelect",
|
|
133
132
|
props: {
|
|
@@ -136,17 +135,17 @@ const J = /* @__PURE__ */ u({
|
|
|
136
135
|
},
|
|
137
136
|
emits: ["update:modelValue"],
|
|
138
137
|
setup(t) {
|
|
139
|
-
const e = _(t, "modelValue"), s = c(),
|
|
140
|
-
return (
|
|
138
|
+
const e = _(t, "modelValue"), s = c(), l = p(), r = f(() => s.id || l);
|
|
139
|
+
return (n, a) => $((d(), i("select", m(n.$attrs, {
|
|
141
140
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => e.value = o),
|
|
142
|
-
id:
|
|
141
|
+
id: r.value
|
|
143
142
|
}), [
|
|
144
|
-
h(
|
|
145
|
-
], 16,
|
|
146
|
-
[
|
|
143
|
+
h(n.$slots, "default")
|
|
144
|
+
], 16, j)), [
|
|
145
|
+
[U, e.value]
|
|
147
146
|
]);
|
|
148
147
|
}
|
|
149
|
-
}),
|
|
148
|
+
}), q = ["id"], Y = /* @__PURE__ */ u({
|
|
150
149
|
inheritAttrs: !1,
|
|
151
150
|
__name: "BaseTextarea",
|
|
152
151
|
props: {
|
|
@@ -155,23 +154,23 @@ const J = /* @__PURE__ */ u({
|
|
|
155
154
|
},
|
|
156
155
|
emits: ["update:modelValue"],
|
|
157
156
|
setup(t) {
|
|
158
|
-
const e = _(t, "modelValue"), s = c(),
|
|
159
|
-
return (
|
|
157
|
+
const e = _(t, "modelValue"), s = c(), l = p(), r = f(() => s.id || l);
|
|
158
|
+
return (n, a) => $((d(), i("textarea", m(n.$attrs, {
|
|
160
159
|
"onUpdate:modelValue": a[0] || (a[0] = (o) => e.value = o),
|
|
161
|
-
id:
|
|
162
|
-
}), null, 16,
|
|
163
|
-
[
|
|
160
|
+
id: r.value
|
|
161
|
+
}), null, 16, q)), [
|
|
162
|
+
[F, e.value]
|
|
164
163
|
]);
|
|
165
164
|
}
|
|
166
165
|
});
|
|
167
166
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
H as CButton,
|
|
168
|
+
J as CCheckbox,
|
|
169
|
+
K as CFile,
|
|
170
|
+
N as CForm,
|
|
171
|
+
O as CInput,
|
|
172
|
+
Q as CLabel,
|
|
173
|
+
W as CRadio,
|
|
174
|
+
X as CSelect,
|
|
175
|
+
Y as CTextarea
|
|
177
176
|
};
|
package/dist/charpente.umd.cjs
CHANGED
|
@@ -1 +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.Charpente={},r.Vue))})(this,(function(r,e){"use strict";const c=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))}}),p=["id","value"],u=e.defineComponent({inheritAttrs:!1,__name:"BaseCheckbox",props:e.mergeModels({value:{},indeterminate:{type:Boolean}},{modelValue:{type:[Boolean,Array]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),
|
|
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.Charpente={},r.Vue))})(this,(function(r,e){"use strict";const c=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))}}),p=["id","value"],u=e.defineComponent({inheritAttrs:!1,__name:"BaseCheckbox",props:e.mergeModels({value:{},indeterminate:{type:Boolean}},{modelValue:{type:[Boolean,Array]},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,n=e.useModel(o,"modelValue"),d=e.useAttrs(),i=e.useId(),a=e.useTemplateRef("input"),s=e.computed(()=>d.id||i);return e.watchEffect(()=>{a.value&&(a.value.indeterminate=!!t.indeterminate)}),(l,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({ref:"input",type:"checkbox"},l.$attrs,{"onUpdate:modelValue":m[0]||(m[0]=P=>n.value=P),id:s.value,value:o.value}),null,16,p)),[[e.vModelCheckbox,n.value]])}}),f=["id"],_=e.defineComponent({inheritAttrs:!1,__name:"BaseFile",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),d=e.useId(),i=e.useTemplateRef("input"),a=e.computed(()=>n.id||d);function s(l){t.value=l.target.files}return e.watch(t,l=>{!l&&i.value&&(i.value.value="")}),(l,m)=>(e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"file",ref:"input"},l.$attrs,{id:a.value,onChange:s}),null,16,f))}}),h=["id"],B=e.defineComponent({inheritAttrs:!1,__name:"BaseForm",emits:["submit"],setup(o,{emit:t}){const n=e.useAttrs(),d=e.useId(),i=t,a=e.computed(()=>n.id||d);return(s,l)=>(e.openBlock(),e.createElementBlock("form",e.mergeProps(s.$attrs,{id:a.value,onSubmit:l[0]||(l[0]=e.withModifiers(m=>i("submit",m),["prevent"]))}),[e.renderSlot(s.$slots,"default")],16,h))}}),$=["id"],C=e.defineComponent({inheritAttrs:!1,__name:"BaseInput",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),d=e.useId(),i=e.computed(()=>n.id||d);return(a,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps(a.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),id:i.value}),null,16,$)),[[e.vModelDynamic,t.value]])}}),V=["for"],k=e.defineComponent({inheritAttrs:!1,__name:"BaseLabel",props:{for:{}},setup(o){const t=o;return(n,d)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps(n.$attrs,{for:t.for}),[e.renderSlot(n.$slots,"default")],16,V))}}),I=["id","value"],g=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(),d=e.useId(),i=e.computed(()=>n.id||d);return(a,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"radio"},a.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),id:i.value,value:o.value}),null,16,I)),[[e.vModelRadio,t.value]])}}),M=["id"],A=e.defineComponent({inheritAttrs:!1,__name:"BaseSelect",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),d=e.useId(),i=e.computed(()=>n.id||d);return(a,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps(a.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),id:i.value}),[e.renderSlot(a.$slots,"default")],16,M)),[[e.vModelSelect,t.value]])}}),b=["id"],y=e.defineComponent({inheritAttrs:!1,__name:"BaseTextarea",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(o){const t=e.useModel(o,"modelValue"),n=e.useAttrs(),d=e.useId(),i=e.computed(()=>n.id||d);return(a,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps(a.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=l=>t.value=l),id:i.value}),null,16,b)),[[e.vModelText,t.value]])}});r.CButton=c,r.CCheckbox=u,r.CFile=_,r.CForm=B,r.CInput=C,r.CLabel=k,r.CRadio=g,r.CSelect=A,r.CTextarea=y,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
as?: Component;
|
|
3
|
+
as?: Component | string;
|
|
4
4
|
};
|
|
5
5
|
declare function __VLS_template(): {
|
|
6
6
|
attrs: Partial<{}>;
|
|
@@ -12,7 +12,7 @@ declare function __VLS_template(): {
|
|
|
12
12
|
};
|
|
13
13
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
14
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
-
as: Component;
|
|
15
|
+
as: Component | string;
|
|
16
16
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
18
18
|
export default _default;
|
|
@@ -6,6 +6,6 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
6
6
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
7
|
"onUpdate:modelValue"?: ((value: FileList | null) => any) | undefined;
|
|
8
8
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
9
|
-
|
|
9
|
+
input: HTMLInputElement;
|
|
10
10
|
}, any>;
|
|
11
11
|
export default _default;
|