@charpente-ui/vue 1.1.0 → 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 +70 -54
- 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/dist/index.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(), V(
|
|
10
|
-
default:
|
|
11
|
-
|
|
9
|
+
return (e, o) => (u(), V(I(t.as), B(C(e.$attrs)), {
|
|
10
|
+
default: b(() => [
|
|
11
|
+
$(e.$slots, "default")
|
|
12
12
|
]),
|
|
13
13
|
_: 3
|
|
14
14
|
}, 16));
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
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,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 = 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
|
+
"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"], j = /* @__PURE__ */ d({
|
|
37
|
+
inheritAttrs: !1,
|
|
38
|
+
__name: "BaseForm",
|
|
39
|
+
emits: ["submit"],
|
|
40
|
+
setup(t, { emit: e }) {
|
|
41
|
+
const o = c(), r = p(), l = e, n = (a) => {
|
|
42
|
+
l("submit", a);
|
|
43
|
+
}, s = _(() => o.id || r);
|
|
44
|
+
return (a, F) => (u(), i("form", m(a.$attrs, {
|
|
45
|
+
id: s.value,
|
|
46
|
+
onSubmit: A(n, ["prevent"])
|
|
47
|
+
}), [
|
|
48
|
+
$(a.$slots, "default")
|
|
49
|
+
], 16, U));
|
|
50
|
+
}
|
|
51
|
+
}), R = ["id"], q = /* @__PURE__ */ d({
|
|
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 = f(t, "modelValue"), o = c(), r = p(), l = _(() => o.id || r);
|
|
61
|
+
return (n, s) => v((u(), i("input", m(n.$attrs, {
|
|
62
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
63
|
+
id: l.value
|
|
64
|
+
}), null, 16, R)), [
|
|
65
|
+
[g, e.value]
|
|
51
66
|
]);
|
|
52
67
|
}
|
|
53
|
-
}),
|
|
68
|
+
}), w = ["for"], G = /* @__PURE__ */ d({
|
|
54
69
|
inheritAttrs: !1,
|
|
55
70
|
__name: "BaseLabel",
|
|
56
71
|
props: {
|
|
@@ -58,16 +73,16 @@ const T = /* @__PURE__ */ n({
|
|
|
58
73
|
},
|
|
59
74
|
setup(t) {
|
|
60
75
|
const e = t;
|
|
61
|
-
return (o,
|
|
76
|
+
return (o, r) => (u(), i("label", m(o.$attrs, {
|
|
62
77
|
for: e.for
|
|
63
78
|
}), [
|
|
64
|
-
|
|
65
|
-
], 16,
|
|
79
|
+
$(o.$slots, "default")
|
|
80
|
+
], 16, w));
|
|
66
81
|
}
|
|
67
|
-
}),
|
|
82
|
+
}), D = ["id", "value"], H = /* @__PURE__ */ d({
|
|
68
83
|
inheritAttrs: !1,
|
|
69
84
|
__name: "BaseRadio",
|
|
70
|
-
props: /* @__PURE__ */
|
|
85
|
+
props: /* @__PURE__ */ h({
|
|
71
86
|
value: {}
|
|
72
87
|
}, {
|
|
73
88
|
modelValue: {},
|
|
@@ -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 = 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
|
+
"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, D)), [
|
|
99
|
+
[k, e.value]
|
|
85
100
|
]);
|
|
86
101
|
}
|
|
87
|
-
}),
|
|
102
|
+
}), P = ["id"], J = /* @__PURE__ */ d({
|
|
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 = f(t, "modelValue"), o = c(), r = p(), l = _(() => o.id || r);
|
|
112
|
+
return (n, s) => v((u(), i("select", m(n.$attrs, {
|
|
113
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
114
|
+
id: l.value
|
|
100
115
|
}), [
|
|
101
|
-
|
|
102
|
-
], 16,
|
|
103
|
-
[
|
|
116
|
+
$(n.$slots, "default")
|
|
117
|
+
], 16, P)), [
|
|
118
|
+
[x, e.value]
|
|
104
119
|
]);
|
|
105
120
|
}
|
|
106
|
-
}),
|
|
121
|
+
}), T = ["id"], K = /* @__PURE__ */ d({
|
|
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 = f(t, "modelValue"), o = c(), r = p(), l = _(() => o.id || r);
|
|
131
|
+
return (n, s) => v((u(), i("textarea", m(n.$attrs, {
|
|
132
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => e.value = a),
|
|
133
|
+
id: l.value
|
|
134
|
+
}), null, 16, T)), [
|
|
135
|
+
[y, e.value]
|
|
121
136
|
]);
|
|
122
137
|
}
|
|
123
138
|
});
|
|
124
139
|
export {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
|
132
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 {};
|
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';
|