@charpente-ui/vue 1.2.1 → 1.2.2
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 +4 -0
- package/dist/charpente.js +77 -77
- package/dist/charpente.umd.cjs +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
A logic-first, headless UI library for Vue 3. The logic you need, without the CSS you don't.
|
|
10
10
|
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src=".github/banner.svg" alt="Charpente UI" width="700"/>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
11
15
|
## Philosophy: Don't Reinvent the Wheel
|
|
12
16
|
|
|
13
17
|
**Charpente UI** is built on a simple promise: We handle the boring stuff, you handle the design.
|
package/dist/charpente.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as i, openBlock as d, createBlock as B, resolveDynamicComponent as y, normalizeProps as M, guardReactiveProps as b, withCtx as A, renderSlot as h, useModel as _, useAttrs as c, useId as p, useTemplateRef as V, computed as f, watch as g, withDirectives as $, createElementBlock as u, mergeProps as m, vModelCheckbox as k, mergeModels as C, withModifiers as x, vModelDynamic as R, vModelRadio as S, vModelSelect as U, vModelText as w } from "vue";
|
|
2
|
+
const G = /* @__PURE__ */ i({
|
|
3
3
|
inheritAttrs: !1,
|
|
4
4
|
__name: "BaseButton",
|
|
5
5
|
props: {
|
|
6
6
|
as: { default: "button" }
|
|
7
7
|
},
|
|
8
|
-
setup(
|
|
9
|
-
return (e,
|
|
8
|
+
setup(s) {
|
|
9
|
+
return (e, t) => (d(), B(y(s.as), M(b(e.$attrs)), {
|
|
10
10
|
default: A(() => [
|
|
11
11
|
h(e.$slots, "default")
|
|
12
12
|
]),
|
|
13
13
|
_: 3
|
|
14
14
|
}, 16));
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), F = ["id", "value"], H = /* @__PURE__ */ i({
|
|
17
17
|
inheritAttrs: !1,
|
|
18
18
|
__name: "BaseCheckbox",
|
|
19
19
|
props: /* @__PURE__ */ C({
|
|
@@ -24,22 +24,22 @@ const H = /* @__PURE__ */ u({
|
|
|
24
24
|
modelModifiers: {}
|
|
25
25
|
}),
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
|
-
setup(
|
|
28
|
-
const e =
|
|
29
|
-
return
|
|
27
|
+
setup(s) {
|
|
28
|
+
const e = s, t = _(s, "modelValue"), r = c(), l = p(), n = V("input"), o = f(() => typeof r.id == "string" ? r.id : l);
|
|
29
|
+
return g([n, () => e.indeterminate], () => {
|
|
30
30
|
n.value && (n.value.indeterminate = !!e.indeterminate);
|
|
31
|
-
}), (
|
|
31
|
+
}, { immediate: !0 }), (a, v) => $((d(), u("input", m({
|
|
32
32
|
ref: "input",
|
|
33
33
|
type: "checkbox"
|
|
34
|
-
},
|
|
35
|
-
"onUpdate:modelValue": v[0] || (v[0] = (I) =>
|
|
36
|
-
id:
|
|
37
|
-
value:
|
|
38
|
-
}), null, 16,
|
|
39
|
-
[
|
|
34
|
+
}, a.$attrs, {
|
|
35
|
+
"onUpdate:modelValue": v[0] || (v[0] = (I) => t.value = I),
|
|
36
|
+
id: o.value,
|
|
37
|
+
value: s.value
|
|
38
|
+
}), null, 16, F)), [
|
|
39
|
+
[k, t.value]
|
|
40
40
|
]);
|
|
41
41
|
}
|
|
42
|
-
}),
|
|
42
|
+
}), T = ["id"], J = /* @__PURE__ */ i({
|
|
43
43
|
inheritAttrs: !1,
|
|
44
44
|
__name: "BaseFile",
|
|
45
45
|
props: {
|
|
@@ -47,35 +47,35 @@ const H = /* @__PURE__ */ u({
|
|
|
47
47
|
modelModifiers: {}
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:modelValue"],
|
|
50
|
-
setup(
|
|
51
|
-
const e = _(
|
|
52
|
-
function a
|
|
53
|
-
e.value =
|
|
50
|
+
setup(s) {
|
|
51
|
+
const e = _(s, "modelValue"), t = c(), r = p(), l = V("input"), n = f(() => typeof t.id == "string" ? t.id : r);
|
|
52
|
+
function o(a) {
|
|
53
|
+
e.value = a.target.files;
|
|
54
54
|
}
|
|
55
|
-
return
|
|
56
|
-
!
|
|
57
|
-
}), (
|
|
55
|
+
return g(e, (a) => {
|
|
56
|
+
!a && l.value && (l.value.value = "");
|
|
57
|
+
}), (a, v) => (d(), u("input", m({
|
|
58
58
|
type: "file",
|
|
59
59
|
ref: "input"
|
|
60
|
-
},
|
|
60
|
+
}, a.$attrs, {
|
|
61
61
|
id: n.value,
|
|
62
|
-
onChange:
|
|
63
|
-
}), null, 16,
|
|
62
|
+
onChange: o
|
|
63
|
+
}), null, 16, T));
|
|
64
64
|
}
|
|
65
|
-
}),
|
|
65
|
+
}), D = ["id"], K = /* @__PURE__ */ i({
|
|
66
66
|
inheritAttrs: !1,
|
|
67
67
|
__name: "BaseForm",
|
|
68
68
|
emits: ["submit"],
|
|
69
|
-
setup(
|
|
70
|
-
const
|
|
71
|
-
return (
|
|
69
|
+
setup(s, { emit: e }) {
|
|
70
|
+
const t = c(), r = p(), l = e, n = f(() => typeof t.id == "string" ? t.id : r);
|
|
71
|
+
return (o, a) => (d(), u("form", m(o.$attrs, {
|
|
72
72
|
id: n.value,
|
|
73
|
-
onSubmit:
|
|
73
|
+
onSubmit: a[0] || (a[0] = x((v) => l("submit", v), ["prevent"]))
|
|
74
74
|
}), [
|
|
75
|
-
h(
|
|
76
|
-
], 16,
|
|
75
|
+
h(o.$slots, "default")
|
|
76
|
+
], 16, D));
|
|
77
77
|
}
|
|
78
|
-
}),
|
|
78
|
+
}), P = ["id"], N = /* @__PURE__ */ i({
|
|
79
79
|
inheritAttrs: !1,
|
|
80
80
|
__name: "BaseInput",
|
|
81
81
|
props: {
|
|
@@ -83,30 +83,30 @@ const H = /* @__PURE__ */ u({
|
|
|
83
83
|
modelModifiers: {}
|
|
84
84
|
},
|
|
85
85
|
emits: ["update:modelValue"],
|
|
86
|
-
setup(
|
|
87
|
-
const e = _(
|
|
88
|
-
return (n,
|
|
89
|
-
"onUpdate:modelValue":
|
|
90
|
-
id:
|
|
91
|
-
}), null, 16,
|
|
92
|
-
[
|
|
86
|
+
setup(s) {
|
|
87
|
+
const e = _(s, "modelValue"), t = c(), r = p(), l = f(() => typeof t.id == "string" ? t.id : r);
|
|
88
|
+
return (n, o) => $((d(), u("input", m(n.$attrs, {
|
|
89
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => e.value = a),
|
|
90
|
+
id: l.value
|
|
91
|
+
}), null, 16, P)), [
|
|
92
|
+
[R, e.value]
|
|
93
93
|
]);
|
|
94
94
|
}
|
|
95
|
-
}), L = ["for"],
|
|
95
|
+
}), L = ["for"], O = /* @__PURE__ */ i({
|
|
96
96
|
inheritAttrs: !1,
|
|
97
97
|
__name: "BaseLabel",
|
|
98
98
|
props: {
|
|
99
99
|
for: {}
|
|
100
100
|
},
|
|
101
|
-
setup(
|
|
102
|
-
const e =
|
|
103
|
-
return (
|
|
101
|
+
setup(s) {
|
|
102
|
+
const e = s;
|
|
103
|
+
return (t, r) => (d(), u("label", m(t.$attrs, {
|
|
104
104
|
for: e.for
|
|
105
105
|
}), [
|
|
106
|
-
h(
|
|
106
|
+
h(t.$slots, "default")
|
|
107
107
|
], 16, L));
|
|
108
108
|
}
|
|
109
|
-
}), z = ["id", "value"],
|
|
109
|
+
}), z = ["id", "value"], Q = /* @__PURE__ */ i({
|
|
110
110
|
inheritAttrs: !1,
|
|
111
111
|
__name: "BaseRadio",
|
|
112
112
|
props: /* @__PURE__ */ C({
|
|
@@ -116,17 +116,17 @@ const H = /* @__PURE__ */ u({
|
|
|
116
116
|
modelModifiers: {}
|
|
117
117
|
}),
|
|
118
118
|
emits: ["update:modelValue"],
|
|
119
|
-
setup(
|
|
120
|
-
const e = _(
|
|
121
|
-
return (n,
|
|
122
|
-
"onUpdate:modelValue":
|
|
123
|
-
id:
|
|
124
|
-
value:
|
|
119
|
+
setup(s) {
|
|
120
|
+
const e = _(s, "modelValue"), t = c(), r = p(), l = f(() => typeof t.id == "string" ? t.id : r);
|
|
121
|
+
return (n, o) => $((d(), u("input", m({ type: "radio" }, n.$attrs, {
|
|
122
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => e.value = a),
|
|
123
|
+
id: l.value,
|
|
124
|
+
value: s.value
|
|
125
125
|
}), null, 16, z)), [
|
|
126
126
|
[S, e.value]
|
|
127
127
|
]);
|
|
128
128
|
}
|
|
129
|
-
}),
|
|
129
|
+
}), E = ["id"], W = /* @__PURE__ */ i({
|
|
130
130
|
inheritAttrs: !1,
|
|
131
131
|
__name: "BaseSelect",
|
|
132
132
|
props: {
|
|
@@ -134,18 +134,18 @@ const H = /* @__PURE__ */ u({
|
|
|
134
134
|
modelModifiers: {}
|
|
135
135
|
},
|
|
136
136
|
emits: ["update:modelValue"],
|
|
137
|
-
setup(
|
|
138
|
-
const e = _(
|
|
139
|
-
return (n,
|
|
140
|
-
"onUpdate:modelValue":
|
|
141
|
-
id:
|
|
137
|
+
setup(s) {
|
|
138
|
+
const e = _(s, "modelValue"), t = c(), r = p(), l = f(() => typeof t.id == "string" ? t.id : r);
|
|
139
|
+
return (n, o) => $((d(), u("select", m(n.$attrs, {
|
|
140
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => e.value = a),
|
|
141
|
+
id: l.value
|
|
142
142
|
}), [
|
|
143
143
|
h(n.$slots, "default")
|
|
144
|
-
], 16,
|
|
144
|
+
], 16, E)), [
|
|
145
145
|
[U, e.value]
|
|
146
146
|
]);
|
|
147
147
|
}
|
|
148
|
-
}),
|
|
148
|
+
}), j = ["id"], X = /* @__PURE__ */ i({
|
|
149
149
|
inheritAttrs: !1,
|
|
150
150
|
__name: "BaseTextarea",
|
|
151
151
|
props: {
|
|
@@ -153,24 +153,24 @@ const H = /* @__PURE__ */ u({
|
|
|
153
153
|
modelModifiers: {}
|
|
154
154
|
},
|
|
155
155
|
emits: ["update:modelValue"],
|
|
156
|
-
setup(
|
|
157
|
-
const e = _(
|
|
158
|
-
return (n,
|
|
159
|
-
"onUpdate:modelValue":
|
|
160
|
-
id:
|
|
161
|
-
}), null, 16,
|
|
162
|
-
[
|
|
156
|
+
setup(s) {
|
|
157
|
+
const e = _(s, "modelValue"), t = c(), r = p(), l = f(() => typeof t.id == "string" ? t.id : r);
|
|
158
|
+
return (n, o) => $((d(), u("textarea", m(n.$attrs, {
|
|
159
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => e.value = a),
|
|
160
|
+
id: l.value
|
|
161
|
+
}), null, 16, j)), [
|
|
162
|
+
[w, e.value]
|
|
163
163
|
]);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
167
|
+
G as CButton,
|
|
168
|
+
H as CCheckbox,
|
|
169
|
+
J as CFile,
|
|
170
|
+
K as CForm,
|
|
171
|
+
N as CInput,
|
|
172
|
+
O as CLabel,
|
|
173
|
+
Q as CRadio,
|
|
174
|
+
W as CSelect,
|
|
175
|
+
X as CTextarea
|
|
176
176
|
};
|
package/dist/charpente.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.Charpente={},d.Vue))})(this,(function(d,e){"use strict";const c=e.defineComponent({inheritAttrs:!1,__name:"BaseButton",props:{as:{default:"button"}},setup(n){return(t,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.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(n){const t=n,o=e.useModel(n,"modelValue"),a=e.useAttrs(),i=e.useId(),l=e.useTemplateRef("input"),s=e.computed(()=>typeof a.id=="string"?a.id:i);return e.watch([l,()=>t.indeterminate],()=>{l.value&&(l.value.indeterminate=!!t.indeterminate)},{immediate:!0}),(r,m)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({ref:"input",type:"checkbox"},r.$attrs,{"onUpdate:modelValue":m[0]||(m[0]=P=>o.value=P),id:s.value,value:n.value}),null,16,p)),[[e.vModelCheckbox,o.value]])}}),f=["id"],_=e.defineComponent({inheritAttrs:!1,__name:"BaseFile",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const t=e.useModel(n,"modelValue"),o=e.useAttrs(),a=e.useId(),i=e.useTemplateRef("input"),l=e.computed(()=>typeof o.id=="string"?o.id:a);function s(r){t.value=r.target.files}return e.watch(t,r=>{!r&&i.value&&(i.value.value="")}),(r,m)=>(e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"file",ref:"input"},r.$attrs,{id:l.value,onChange:s}),null,16,f))}}),h=["id"],B=e.defineComponent({inheritAttrs:!1,__name:"BaseForm",emits:["submit"],setup(n,{emit:t}){const o=e.useAttrs(),a=e.useId(),i=t,l=e.computed(()=>typeof o.id=="string"?o.id:a);return(s,r)=>(e.openBlock(),e.createElementBlock("form",e.mergeProps(s.$attrs,{id:l.value,onSubmit:r[0]||(r[0]=e.withModifiers(m=>i("submit",m),["prevent"]))}),[e.renderSlot(s.$slots,"default")],16,h))}}),g=["id"],$=e.defineComponent({inheritAttrs:!1,__name:"BaseInput",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const t=e.useModel(n,"modelValue"),o=e.useAttrs(),a=e.useId(),i=e.computed(()=>typeof o.id=="string"?o.id:a);return(l,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps(l.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:i.value}),null,16,g)),[[e.vModelDynamic,t.value]])}}),C=["for"],V=e.defineComponent({inheritAttrs:!1,__name:"BaseLabel",props:{for:{}},setup(n){const t=n;return(o,a)=>(e.openBlock(),e.createElementBlock("label",e.mergeProps(o.$attrs,{for:t.for}),[e.renderSlot(o.$slots,"default")],16,C))}}),k=["id","value"],I=e.defineComponent({inheritAttrs:!1,__name:"BaseRadio",props:e.mergeModels({value:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const t=e.useModel(n,"modelValue"),o=e.useAttrs(),a=e.useId(),i=e.computed(()=>typeof o.id=="string"?o.id:a);return(l,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({type:"radio"},l.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:i.value,value:n.value}),null,16,k)),[[e.vModelRadio,t.value]])}}),M=["id"],y=e.defineComponent({inheritAttrs:!1,__name:"BaseSelect",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const t=e.useModel(n,"modelValue"),o=e.useAttrs(),a=e.useId(),i=e.computed(()=>typeof o.id=="string"?o.id:a);return(l,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("select",e.mergeProps(l.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:i.value}),[e.renderSlot(l.$slots,"default")],16,M)),[[e.vModelSelect,t.value]])}}),A=["id"],b=e.defineComponent({inheritAttrs:!1,__name:"BaseTextarea",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const t=e.useModel(n,"modelValue"),o=e.useAttrs(),a=e.useId(),i=e.computed(()=>typeof o.id=="string"?o.id:a);return(l,s)=>e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps(l.$attrs,{"onUpdate:modelValue":s[0]||(s[0]=r=>t.value=r),id:i.value}),null,16,A)),[[e.vModelText,t.value]])}});d.CButton=c,d.CCheckbox=u,d.CFile=_,d.CForm=B,d.CInput=$,d.CLabel=V,d.CRadio=I,d.CSelect=y,d.CTextarea=b,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charpente-ui/vue",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Charpente UI is a headless CSS Vue component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
"vitest": "^4.0.18",
|
|
49
49
|
"vue": "^3.5.29"
|
|
50
50
|
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"vue": "^3.0.0"
|
|
53
|
+
},
|
|
51
54
|
"keywords": [
|
|
52
55
|
"vue",
|
|
53
56
|
"components",
|