@charpente-ui/vue 1.3.1 → 1.4.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 +1 -1
- package/dist/charpente.js +180 -213
- package/dist/charpente.umd.cjs +1 -1
- package/dist/components/BaseCheckbox.d.ts +4 -4
- package/dist/components/BaseRadio.d.ts +4 -4
- package/dist/components/BaseTextarea.d.ts +3 -3
- package/dist/components/internal/keys.d.ts +2 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
A logic-first, headless UI library for Vue 3. The logic you need, without the CSS you don't.
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
|
-
<img src=".github/banner.svg" alt="Charpente UI"
|
|
12
|
+
<img src=".github/banner.svg" alt="Charpente UI"/>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
## Philosophy: Don't Reinvent the Wheel
|
package/dist/charpente.js
CHANGED
|
@@ -1,214 +1,181 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
h(s.$slots, "default")
|
|
180
|
-
], 16, W)), [
|
|
181
|
-
[L, t.value]
|
|
182
|
-
]);
|
|
183
|
-
}
|
|
184
|
-
}), X = ["id"], de = /* @__PURE__ */ d({
|
|
185
|
-
inheritAttrs: !1,
|
|
186
|
-
__name: "BaseTextarea",
|
|
187
|
-
props: {
|
|
188
|
-
modelValue: {},
|
|
189
|
-
modelModifiers: {}
|
|
190
|
-
},
|
|
191
|
-
emits: ["update:modelValue"],
|
|
192
|
-
setup(o) {
|
|
193
|
-
const t = f(o, "modelValue"), e = c(), n = p(), a = u(() => typeof e.id == "string" ? e.id : n);
|
|
194
|
-
return (s, r) => $((i(), m("textarea", _(s.$attrs, {
|
|
195
|
-
id: a.value,
|
|
196
|
-
"onUpdate:modelValue": r[0] || (r[0] = (l) => t.value = l)
|
|
197
|
-
}), null, 16, X)), [
|
|
198
|
-
[j, t.value]
|
|
199
|
-
]);
|
|
200
|
-
}
|
|
1
|
+
import { computed as e, createBlock as t, createElementBlock as n, defineComponent as r, guardReactiveProps as i, inject as a, isRef as o, mergeModels as s, mergeProps as c, normalizeProps as l, openBlock as u, provide as d, renderSlot as f, resolveDynamicComponent as p, unref as m, useAttrs as h, useId as g, useModel as _, useTemplateRef as v, vModelCheckbox as y, vModelDynamic as b, vModelRadio as x, vModelSelect as S, vModelText as C, watch as w, watchPostEffect as T, withCtx as E, withDirectives as D, withModifiers as O } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region src/components/BaseButton.vue
|
|
4
|
+
var k = /* @__PURE__ */ r({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "BaseButton",
|
|
7
|
+
props: { as: { default: "button" } },
|
|
8
|
+
setup(e) {
|
|
9
|
+
return (n, r) => (u(), t(p(e.as), l(i(n.$attrs)), {
|
|
10
|
+
default: E(() => [f(n.$slots, "default")]),
|
|
11
|
+
_: 3
|
|
12
|
+
}, 16));
|
|
13
|
+
}
|
|
14
|
+
}), A = Symbol("CRadioGroup"), j = Symbol("CCheckboxGroup"), M = [
|
|
15
|
+
"id",
|
|
16
|
+
"name",
|
|
17
|
+
"value"
|
|
18
|
+
], N = /* @__PURE__ */ r({
|
|
19
|
+
inheritAttrs: !1,
|
|
20
|
+
__name: "BaseCheckbox",
|
|
21
|
+
props: /* @__PURE__ */ s({
|
|
22
|
+
value: {},
|
|
23
|
+
indeterminate: { type: Boolean }
|
|
24
|
+
}, {
|
|
25
|
+
modelValue: { type: [Boolean, Array] },
|
|
26
|
+
modelModifiers: {}
|
|
27
|
+
}),
|
|
28
|
+
emits: ["update:modelValue"],
|
|
29
|
+
setup(t) {
|
|
30
|
+
let r = t, i = _(t, "modelValue"), s = a(j, null), l = s ? s.model : i, d = h(), f = g(), p = v("input"), b = e(() => typeof d.id == "string" ? d.id : f), x = e(() => typeof d.name == "string" ? d.name : s?.name.value);
|
|
31
|
+
return T(() => {
|
|
32
|
+
p.value && (p.value.indeterminate = !!r.indeterminate);
|
|
33
|
+
}), (e, r) => D((u(), n("input", c(e.$attrs, {
|
|
34
|
+
id: b.value,
|
|
35
|
+
ref: "input",
|
|
36
|
+
"onUpdate:modelValue": r[0] ||= (e) => o(l) ? l.value = e : null,
|
|
37
|
+
name: x.value,
|
|
38
|
+
type: "checkbox",
|
|
39
|
+
value: t.value
|
|
40
|
+
}), null, 16, M)), [[y, m(l)]]);
|
|
41
|
+
}
|
|
42
|
+
}), P = /* @__PURE__ */ r({
|
|
43
|
+
inheritAttrs: !1,
|
|
44
|
+
__name: "BaseCheckboxGroup",
|
|
45
|
+
props: {
|
|
46
|
+
modelValue: { default: () => [] },
|
|
47
|
+
modelModifiers: {}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue"],
|
|
50
|
+
setup(t) {
|
|
51
|
+
let r = _(t, "modelValue"), a = h(), o = g();
|
|
52
|
+
return d(j, {
|
|
53
|
+
model: r,
|
|
54
|
+
name: e(() => typeof a.name == "string" ? a.name : o)
|
|
55
|
+
}), (e, t) => (u(), n("fieldset", l(i(e.$attrs)), [f(e.$slots, "default")], 16));
|
|
56
|
+
}
|
|
57
|
+
}), F = ["id"], I = /* @__PURE__ */ r({
|
|
58
|
+
inheritAttrs: !1,
|
|
59
|
+
__name: "BaseFile",
|
|
60
|
+
props: {
|
|
61
|
+
modelValue: {},
|
|
62
|
+
modelModifiers: {}
|
|
63
|
+
},
|
|
64
|
+
emits: ["update:modelValue"],
|
|
65
|
+
setup(t) {
|
|
66
|
+
let r = _(t, "modelValue"), i = h(), a = g(), o = v("input"), s = e(() => typeof i.id == "string" ? i.id : a);
|
|
67
|
+
function l(e) {
|
|
68
|
+
r.value = e.target.files;
|
|
69
|
+
}
|
|
70
|
+
return w(r, (e) => {
|
|
71
|
+
!e && o.value && (o.value.value = "");
|
|
72
|
+
}), (e, t) => (u(), n("input", c(e.$attrs, {
|
|
73
|
+
id: s.value,
|
|
74
|
+
ref: "input",
|
|
75
|
+
type: "file",
|
|
76
|
+
onChange: l
|
|
77
|
+
}), null, 16, F));
|
|
78
|
+
}
|
|
79
|
+
}), L = ["id"], R = /* @__PURE__ */ r({
|
|
80
|
+
inheritAttrs: !1,
|
|
81
|
+
__name: "BaseForm",
|
|
82
|
+
emits: ["submit"],
|
|
83
|
+
setup(t, { emit: r }) {
|
|
84
|
+
let i = h(), a = g(), o = r, s = e(() => typeof i.id == "string" ? i.id : a);
|
|
85
|
+
return (e, t) => (u(), n("form", c(e.$attrs, {
|
|
86
|
+
id: s.value,
|
|
87
|
+
onSubmit: t[0] ||= O((e) => o("submit", e), ["prevent"])
|
|
88
|
+
}), [f(e.$slots, "default")], 16, L));
|
|
89
|
+
}
|
|
90
|
+
}), z = ["id"], B = /* @__PURE__ */ r({
|
|
91
|
+
inheritAttrs: !1,
|
|
92
|
+
__name: "BaseInput",
|
|
93
|
+
props: {
|
|
94
|
+
modelValue: {},
|
|
95
|
+
modelModifiers: {}
|
|
96
|
+
},
|
|
97
|
+
emits: ["update:modelValue"],
|
|
98
|
+
setup(t) {
|
|
99
|
+
let r = _(t, "modelValue"), i = h(), a = g(), o = e(() => typeof i.id == "string" ? i.id : a);
|
|
100
|
+
return (e, t) => D((u(), n("input", c(e.$attrs, {
|
|
101
|
+
id: o.value,
|
|
102
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.value = e
|
|
103
|
+
}), null, 16, z)), [[b, r.value]]);
|
|
104
|
+
}
|
|
105
|
+
}), V = ["for"], H = /* @__PURE__ */ r({
|
|
106
|
+
inheritAttrs: !1,
|
|
107
|
+
__name: "BaseLabel",
|
|
108
|
+
props: { for: {} },
|
|
109
|
+
setup(e) {
|
|
110
|
+
let t = e;
|
|
111
|
+
return (e, r) => (u(), n("label", c(e.$attrs, { for: t.for }), [f(e.$slots, "default")], 16, V));
|
|
112
|
+
}
|
|
113
|
+
}), U = [
|
|
114
|
+
"id",
|
|
115
|
+
"name",
|
|
116
|
+
"value"
|
|
117
|
+
], W = /* @__PURE__ */ r({
|
|
118
|
+
inheritAttrs: !1,
|
|
119
|
+
__name: "BaseRadio",
|
|
120
|
+
props: /* @__PURE__ */ s({ value: {} }, {
|
|
121
|
+
modelValue: {},
|
|
122
|
+
modelModifiers: {}
|
|
123
|
+
}),
|
|
124
|
+
emits: ["update:modelValue"],
|
|
125
|
+
setup(t) {
|
|
126
|
+
let r = _(t, "modelValue"), i = a(A, null), s = i ? i.model : r, l = h(), d = g(), f = e(() => typeof l.id == "string" ? l.id : d), p = e(() => typeof l.name == "string" ? l.name : i?.name.value);
|
|
127
|
+
return (e, r) => D((u(), n("input", c({
|
|
128
|
+
id: f.value,
|
|
129
|
+
"onUpdate:modelValue": r[0] ||= (e) => o(s) ? s.value = e : null,
|
|
130
|
+
name: p.value,
|
|
131
|
+
value: t.value
|
|
132
|
+
}, e.$attrs, { type: "radio" }), null, 16, U)), [[x, m(s)]]);
|
|
133
|
+
}
|
|
134
|
+
}), G = /* @__PURE__ */ r({
|
|
135
|
+
inheritAttrs: !1,
|
|
136
|
+
__name: "BaseRadioGroup",
|
|
137
|
+
props: {
|
|
138
|
+
modelValue: {},
|
|
139
|
+
modelModifiers: {}
|
|
140
|
+
},
|
|
141
|
+
emits: ["update:modelValue"],
|
|
142
|
+
setup(t) {
|
|
143
|
+
let r = _(t, "modelValue"), a = h(), o = g();
|
|
144
|
+
return d(A, {
|
|
145
|
+
model: r,
|
|
146
|
+
name: e(() => typeof a.name == "string" ? a.name : o)
|
|
147
|
+
}), (e, t) => (u(), n("fieldset", l(i(e.$attrs)), [f(e.$slots, "default")], 16));
|
|
148
|
+
}
|
|
149
|
+
}), K = ["id"], q = /* @__PURE__ */ r({
|
|
150
|
+
inheritAttrs: !1,
|
|
151
|
+
__name: "BaseSelect",
|
|
152
|
+
props: {
|
|
153
|
+
modelValue: {},
|
|
154
|
+
modelModifiers: {}
|
|
155
|
+
},
|
|
156
|
+
emits: ["update:modelValue"],
|
|
157
|
+
setup(t) {
|
|
158
|
+
let r = _(t, "modelValue"), i = h(), a = g(), o = e(() => typeof i.id == "string" ? i.id : a);
|
|
159
|
+
return (e, t) => D((u(), n("select", c(e.$attrs, {
|
|
160
|
+
id: o.value,
|
|
161
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.value = e
|
|
162
|
+
}), [f(e.$slots, "default")], 16, K)), [[S, r.value]]);
|
|
163
|
+
}
|
|
164
|
+
}), J = ["id"], Y = /* @__PURE__ */ r({
|
|
165
|
+
inheritAttrs: !1,
|
|
166
|
+
__name: "BaseTextarea",
|
|
167
|
+
props: {
|
|
168
|
+
modelValue: {},
|
|
169
|
+
modelModifiers: {}
|
|
170
|
+
},
|
|
171
|
+
emits: ["update:modelValue"],
|
|
172
|
+
setup(t) {
|
|
173
|
+
let r = _(t, "modelValue"), i = h(), a = g(), o = e(() => typeof i.id == "string" ? i.id : a);
|
|
174
|
+
return (e, t) => D((u(), n("textarea", c(e.$attrs, {
|
|
175
|
+
id: o.value,
|
|
176
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.value = e
|
|
177
|
+
}), null, 16, J)), [[C, r.value]]);
|
|
178
|
+
}
|
|
201
179
|
});
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
ee as CCheckbox,
|
|
205
|
-
te as CCheckboxGroup,
|
|
206
|
-
oe as CFile,
|
|
207
|
-
ae as CForm,
|
|
208
|
-
se as CInput,
|
|
209
|
-
ne as CLabel,
|
|
210
|
-
re as CRadio,
|
|
211
|
-
le as CRadioGroup,
|
|
212
|
-
ue as CSelect,
|
|
213
|
-
de as CTextarea
|
|
214
|
-
};
|
|
180
|
+
//#endregion
|
|
181
|
+
export { k as CButton, N as CCheckbox, P as CCheckboxGroup, I as CFile, R as CForm, B as CInput, H as CLabel, W as CRadio, G as CRadioGroup, q as CSelect, Y as CTextarea };
|
package/dist/charpente.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Charpente={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseButton`,props:{as:{default:`button`}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(e.as),(0,t.normalizeProps)((0,t.guardReactiveProps)(n.$attrs)),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(n.$slots,`default`)]),_:3},16))}}),r=Symbol(`CRadioGroup`),i=Symbol(`CCheckboxGroup`),a=[`id`,`name`,`value`],o=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseCheckbox`,props:(0,t.mergeModels)({value:{},indeterminate:{type:Boolean}},{modelValue:{type:[Boolean,Array]},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=e,r=(0,t.useModel)(e,`modelValue`),o=(0,t.inject)(i,null),s=o?o.model:r,c=(0,t.useAttrs)(),l=(0,t.useId)(),u=(0,t.useTemplateRef)(`input`),d=(0,t.computed)(()=>typeof c.id==`string`?c.id:l),f=(0,t.computed)(()=>typeof c.name==`string`?c.name:o?.name.value);return(0,t.watchPostEffect)(()=>{u.value&&(u.value.indeterminate=!!n.indeterminate)}),(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,(0,t.mergeProps)(n.$attrs,{id:d.value,ref:`input`,"onUpdate:modelValue":r[0]||=e=>(0,t.isRef)(s)?s.value=e:null,name:f.value,type:`checkbox`,value:e.value}),null,16,a)),[[t.vModelCheckbox,(0,t.unref)(s)]])}}),s=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseCheckboxGroup`,props:{modelValue:{default:()=>[]},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useAttrs)(),a=(0,t.useId)();return(0,t.provide)(i,{model:n,name:(0,t.computed)(()=>typeof r.name==`string`?r.name:a)}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`fieldset`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e.$attrs)),[(0,t.renderSlot)(e.$slots,`default`)],16))}}),c=[`id`],l=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseFile`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useAttrs)(),i=(0,t.useId)(),a=(0,t.useTemplateRef)(`input`),o=(0,t.computed)(()=>typeof r.id==`string`?r.id:i);function s(e){n.value=e.target.files}return(0,t.watch)(n,e=>{!e&&a.value&&(a.value.value=``)}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`input`,(0,t.mergeProps)(e.$attrs,{id:o.value,ref:`input`,type:`file`,onChange:s}),null,16,c))}}),u=[`id`],d=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseForm`,emits:[`submit`],setup(e,{emit:n}){let r=(0,t.useAttrs)(),i=(0,t.useId)(),a=n,o=(0,t.computed)(()=>typeof r.id==`string`?r.id:i);return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`form`,(0,t.mergeProps)(e.$attrs,{id:o.value,onSubmit:n[0]||=(0,t.withModifiers)(e=>a(`submit`,e),[`prevent`])}),[(0,t.renderSlot)(e.$slots,`default`)],16,u))}}),f=[`id`],p=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseInput`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useAttrs)(),i=(0,t.useId)(),a=(0,t.computed)(()=>typeof r.id==`string`?r.id:i);return(e,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,(0,t.mergeProps)(e.$attrs,{id:a.value,"onUpdate:modelValue":r[0]||=e=>n.value=e}),null,16,f)),[[t.vModelDynamic,n.value]])}}),m=[`for`],h=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseLabel`,props:{for:{}},setup(e){let n=e;return(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,(0,t.mergeProps)(e.$attrs,{for:n.for}),[(0,t.renderSlot)(e.$slots,`default`)],16,m))}}),g=[`id`,`name`,`value`],_=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseRadio`,props:(0,t.mergeModels)({value:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),i=(0,t.inject)(r,null),a=i?i.model:n,o=(0,t.useAttrs)(),s=(0,t.useId)(),c=(0,t.computed)(()=>typeof o.id==`string`?o.id:s),l=(0,t.computed)(()=>typeof o.name==`string`?o.name:i?.name.value);return(n,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,(0,t.mergeProps)({id:c.value,"onUpdate:modelValue":r[0]||=e=>(0,t.isRef)(a)?a.value=e:null,name:l.value,value:e.value},n.$attrs,{type:`radio`}),null,16,g)),[[t.vModelRadio,(0,t.unref)(a)]])}}),v=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseRadioGroup`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),i=(0,t.useAttrs)(),a=(0,t.useId)();return(0,t.provide)(r,{model:n,name:(0,t.computed)(()=>typeof i.name==`string`?i.name:a)}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`fieldset`,(0,t.normalizeProps)((0,t.guardReactiveProps)(e.$attrs)),[(0,t.renderSlot)(e.$slots,`default`)],16))}}),y=[`id`],b=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseSelect`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useAttrs)(),i=(0,t.useId)(),a=(0,t.computed)(()=>typeof r.id==`string`?r.id:i);return(e,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`select`,(0,t.mergeProps)(e.$attrs,{id:a.value,"onUpdate:modelValue":r[0]||=e=>n.value=e}),[(0,t.renderSlot)(e.$slots,`default`)],16,y)),[[t.vModelSelect,n.value]])}}),x=[`id`],S=(0,t.defineComponent)({inheritAttrs:!1,__name:`BaseTextarea`,props:{modelValue:{},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let n=(0,t.useModel)(e,`modelValue`),r=(0,t.useAttrs)(),i=(0,t.useId)(),a=(0,t.computed)(()=>typeof r.id==`string`?r.id:i);return(e,r)=>(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`textarea`,(0,t.mergeProps)(e.$attrs,{id:a.value,"onUpdate:modelValue":r[0]||=e=>n.value=e}),null,16,x)),[[t.vModelText,n.value]])}});e.CButton=n,e.CCheckbox=o,e.CCheckboxGroup=s,e.CFile=l,e.CForm=d,e.CInput=p,e.CLabel=h,e.CRadio=_,e.CRadioGroup=v,e.CSelect=b,e.CTextarea=S});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
value?:
|
|
2
|
+
value?: unknown;
|
|
3
3
|
indeterminate?: boolean;
|
|
4
4
|
};
|
|
5
5
|
type __VLS_PublicProps = {
|
|
6
|
-
modelValue?: boolean |
|
|
6
|
+
modelValue?: boolean | unknown[];
|
|
7
7
|
} & __VLS_Props;
|
|
8
8
|
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
-
"update:modelValue": (value: boolean |
|
|
9
|
+
"update:modelValue": (value: boolean | unknown[]) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
11
|
-
"onUpdate:modelValue"?: ((value: boolean |
|
|
11
|
+
"onUpdate:modelValue"?: ((value: boolean | unknown[]) => any) | undefined;
|
|
12
12
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
13
13
|
input: HTMLInputElement;
|
|
14
14
|
}, any>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
value:
|
|
2
|
+
value: unknown;
|
|
3
3
|
};
|
|
4
4
|
type __VLS_PublicProps = {
|
|
5
|
-
modelValue?:
|
|
5
|
+
modelValue?: unknown;
|
|
6
6
|
} & __VLS_Props;
|
|
7
7
|
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
-
"update:modelValue": (value:
|
|
8
|
+
"update:modelValue": (value: unknown) => any;
|
|
9
9
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
-
"onUpdate:modelValue"?: ((value:
|
|
10
|
+
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
11
11
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
12
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type __VLS_PublicProps = {
|
|
2
|
-
modelValue?: string;
|
|
2
|
+
modelValue?: string | number;
|
|
3
3
|
};
|
|
4
4
|
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
"update:modelValue": (value: string) => any;
|
|
5
|
+
"update:modelValue": (value: string | number) => any;
|
|
6
6
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
7
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
8
8
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
9
|
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { InjectionKey, ModelRef, ComputedRef } from 'vue';
|
|
2
2
|
export interface RadioGroupContext {
|
|
3
|
-
model: ModelRef<
|
|
3
|
+
model: ModelRef<unknown>;
|
|
4
4
|
name: ComputedRef<string>;
|
|
5
5
|
}
|
|
6
6
|
export declare const radioGroupKey: InjectionKey<RadioGroupContext>;
|
|
7
7
|
export interface CheckboxGroupContext {
|
|
8
|
-
model: ModelRef<
|
|
8
|
+
model: ModelRef<unknown[]>;
|
|
9
9
|
name: ComputedRef<string>;
|
|
10
10
|
}
|
|
11
11
|
export declare const checkboxGroupKey: InjectionKey<CheckboxGroupContext>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charpente-ui/vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Charpente UI is a headless CSS Vue component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"@semantic-release/git": "^10.0.1",
|
|
35
35
|
"@semantic-release/github": "^12.0.6",
|
|
36
36
|
"@vitejs/plugin-vue": "^6.0.4",
|
|
37
|
-
"@vitest/coverage-v8": "^4.
|
|
38
|
-
"@vue/test-utils": "^2.4.
|
|
37
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
38
|
+
"@vue/test-utils": "^2.4.9",
|
|
39
39
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
40
40
|
"eslint": "^10.0.2",
|
|
41
41
|
"eslint-plugin-vue": "^10.8.0",
|
|
42
42
|
"husky": "^9.1.7",
|
|
43
|
-
"jsdom": "^
|
|
43
|
+
"jsdom": "^29.1.0",
|
|
44
44
|
"npm-run-all2": "^8.0.4",
|
|
45
45
|
"semantic-release": "^25.0.3",
|
|
46
46
|
"typescript-eslint": "^8.56.1",
|
|
47
|
-
"vite": "^
|
|
47
|
+
"vite": "^8.0.10",
|
|
48
48
|
"vite-plugin-dts": "^4.5.4",
|
|
49
|
-
"vitest": "^4.
|
|
49
|
+
"vitest": "^4.1.5",
|
|
50
50
|
"vue": "^3.5.29"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|