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