@charpente-ui/vue 2.1.1 → 2.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/dist/components/BaseButton.js +1 -1
- package/dist/components/BaseCheckbox.js +2 -2
- package/dist/components/BaseCheckboxGroup.js +1 -1
- package/dist/components/BaseField.js +20 -10
- package/dist/components/BaseFile.js +1 -1
- package/dist/components/BaseForm.js +1 -1
- package/dist/components/BaseInput.js +1 -1
- package/dist/components/BaseLabel.js +1 -1
- package/dist/components/BaseRadio.js +2 -2
- package/dist/components/BaseRadioGroup.js +1 -1
- package/dist/components/BaseSelect.js +1 -1
- package/dist/components/BaseSupportingText.js +7 -7
- package/dist/components/BaseTextarea.js +1 -1
- package/dist/index.d.ts +1 -13
- package/dist/{components → src/components}/internal/keys.d.ts +3 -1
- package/dist/src/index.d.ts +13 -0
- package/package.json +19 -16
- /package/dist/{components → src/components}/BaseButton.d.ts +0 -0
- /package/dist/{components → src/components}/BaseCheckbox.d.ts +0 -0
- /package/dist/{components → src/components}/BaseCheckboxGroup.d.ts +0 -0
- /package/dist/{components → src/components}/BaseField.d.ts +0 -0
- /package/dist/{components → src/components}/BaseFile.d.ts +0 -0
- /package/dist/{components → src/components}/BaseForm.d.ts +0 -0
- /package/dist/{components → src/components}/BaseInput.d.ts +0 -0
- /package/dist/{components → src/components}/BaseLabel.d.ts +0 -0
- /package/dist/{components → src/components}/BaseRadio.d.ts +0 -0
- /package/dist/{components → src/components}/BaseRadioGroup.d.ts +0 -0
- /package/dist/{components → src/components}/BaseSelect.d.ts +0 -0
- /package/dist/{components → src/components}/BaseSupportingText.d.ts +0 -0
- /package/dist/{components → src/components}/BaseTextarea.d.ts +0 -0
- /package/dist/{components → src/components}/internal/field.d.ts +0 -0
- /package/dist/{components → src/components}/internal/modifiers.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as e, createBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, resolveDynamicComponent as o, useAttrs as s, withCtx as c } from "vue";
|
|
2
2
|
//#region src/components/BaseButton.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var l =
|
|
3
|
+
var l = /*@__PURE__*/ n({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "BaseButton",
|
|
6
6
|
props: { as: { default: "button" } },
|
|
@@ -8,10 +8,10 @@ var _ = [
|
|
|
8
8
|
"aria-invalid",
|
|
9
9
|
"name",
|
|
10
10
|
"value"
|
|
11
|
-
], v =
|
|
11
|
+
], v = /*@__PURE__*/ i({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "BaseCheckbox",
|
|
14
|
-
props:
|
|
14
|
+
props: /*@__PURE__*/ s({
|
|
15
15
|
value: {},
|
|
16
16
|
indeterminate: { type: Boolean }
|
|
17
17
|
}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { checkboxGroupKey as e, fieldKey as t } from "./internal/keys.js";
|
|
2
2
|
import { computed as n, createElementBlock as r, defineComponent as i, guardReactiveProps as a, normalizeProps as o, openBlock as s, provide as c, renderSlot as l, useAttrs as u, useId as d, useModel as f } from "vue";
|
|
3
3
|
//#region src/components/BaseCheckboxGroup.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var p =
|
|
4
|
+
var p = /*@__PURE__*/ i({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BaseCheckboxGroup",
|
|
7
7
|
props: {
|
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
import { fieldKey as e } from "./internal/keys.js";
|
|
2
2
|
import { computed as t, createElementBlock as n, defineComponent as r, mergeProps as i, openBlock as a, provide as o, ref as s, renderSlot as c, useAttrs as l, useId as u } from "vue";
|
|
3
3
|
//#region src/components/BaseField.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var d =
|
|
4
|
+
var d = /*@__PURE__*/ r({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BaseField",
|
|
7
7
|
setup(r) {
|
|
8
|
-
let d = l(), f = u(), p = s(), m = s(""), h = s(!1), g = t(() => typeof d.id == "string" ? d.id : f), _ = t(() =>
|
|
8
|
+
let d = l(), f = u(), p = s([]), m = s(""), h = s(!1), g = t(() => typeof d.id == "string" ? d.id : f), _ = t(() => p.value.at(-1));
|
|
9
|
+
function v(e) {
|
|
10
|
+
p.value.push(e);
|
|
11
|
+
}
|
|
12
|
+
function y(e) {
|
|
13
|
+
let t = p.value.indexOf(e);
|
|
14
|
+
t !== -1 && p.value.splice(t, 1);
|
|
15
|
+
}
|
|
16
|
+
let b = t(() => {
|
|
9
17
|
let e = { ...d };
|
|
10
18
|
return delete e.id, e;
|
|
11
19
|
});
|
|
12
20
|
o(e, {
|
|
13
21
|
id: g,
|
|
14
|
-
supportingTextId:
|
|
15
|
-
validationMessage: m
|
|
22
|
+
supportingTextId: _,
|
|
23
|
+
validationMessage: m,
|
|
24
|
+
registerSupportingText: v,
|
|
25
|
+
unregisterSupportingText: y
|
|
16
26
|
});
|
|
17
|
-
function
|
|
27
|
+
function x(e) {
|
|
18
28
|
h.value = !0, m.value = e.target.validationMessage;
|
|
19
29
|
}
|
|
20
|
-
function
|
|
30
|
+
function S(e) {
|
|
21
31
|
h.value && (m.value = e.target.validationMessage);
|
|
22
32
|
}
|
|
23
|
-
return (e, t) => (a(), n("div", i(
|
|
24
|
-
onInvalidCapture:
|
|
25
|
-
onInputCapture:
|
|
26
|
-
onChangeCapture:
|
|
33
|
+
return (e, t) => (a(), n("div", i(b.value, {
|
|
34
|
+
onInvalidCapture: x,
|
|
35
|
+
onInputCapture: S,
|
|
36
|
+
onChangeCapture: S
|
|
27
37
|
}), [c(e.$slots, "default")], 16));
|
|
28
38
|
}
|
|
29
39
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as e, createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, useAttrs as o, useId as s, withModifiers as c } from "vue";
|
|
2
2
|
//#region src/components/BaseForm.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var l = ["id", "novalidate"], u =
|
|
3
|
+
var l = ["id", "novalidate"], u = /*@__PURE__*/ n({
|
|
4
4
|
inheritAttrs: !1,
|
|
5
5
|
__name: "BaseForm",
|
|
6
6
|
props: { validate: { type: Boolean } },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fieldKey as e } from "./internal/keys.js";
|
|
2
2
|
import { computed as t, createElementBlock as n, defineComponent as r, inject as i, mergeProps as a, openBlock as o, renderSlot as s } from "vue";
|
|
3
3
|
//#region src/components/BaseLabel.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var c = ["for"], l =
|
|
4
|
+
var c = ["for"], l = /*@__PURE__*/ r({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BaseLabel",
|
|
7
7
|
props: { for: {} },
|
|
@@ -8,10 +8,10 @@ var h = [
|
|
|
8
8
|
"aria-invalid",
|
|
9
9
|
"name",
|
|
10
10
|
"value"
|
|
11
|
-
], g =
|
|
11
|
+
], g = /*@__PURE__*/ i({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "BaseRadio",
|
|
14
|
-
props:
|
|
14
|
+
props: /*@__PURE__*/ s({ value: {} }, {
|
|
15
15
|
modelValue: {},
|
|
16
16
|
modelModifiers: {}
|
|
17
17
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fieldKey as e, radioGroupKey as t } from "./internal/keys.js";
|
|
2
2
|
import { computed as n, createElementBlock as r, defineComponent as i, guardReactiveProps as a, normalizeProps as o, openBlock as s, provide as c, renderSlot as l, useAttrs as u, useId as d, useModel as f } from "vue";
|
|
3
3
|
//#region src/components/BaseRadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var p =
|
|
4
|
+
var p = /*@__PURE__*/ i({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BaseRadioGroup",
|
|
7
7
|
props: {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { fieldKey as e } from "./internal/keys.js";
|
|
2
|
-
import { Fragment as t, computed as n, createElementBlock as r, createTextVNode as i, defineComponent as a, inject as o, mergeProps as s, onBeforeUnmount as c, openBlock as l, renderSlot as u, toDisplayString as d, useAttrs as f, useId as p,
|
|
2
|
+
import { Fragment as t, computed as n, createElementBlock as r, createTextVNode as i, defineComponent as a, inject as o, mergeProps as s, onBeforeUnmount as c, openBlock as l, renderSlot as u, toDisplayString as d, useAttrs as f, useId as p, watch as m } from "vue";
|
|
3
3
|
//#region src/components/BaseSupportingText.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var h = ["id"], g =
|
|
4
|
+
var h = ["id"], g = /*@__PURE__*/ a({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BaseSupportingText",
|
|
7
7
|
props: { validation: { type: Boolean } },
|
|
8
8
|
setup(a) {
|
|
9
9
|
let g = a, _ = f(), v = p(), y = o(e, null), b = n(() => typeof _.id == "string" ? _.id : v), x = n(() => g.validation ? y?.validationMessage.value ?? "" : "");
|
|
10
|
-
return m(() => {
|
|
11
|
-
y && (y.
|
|
12
|
-
}), c(() => {
|
|
13
|
-
y
|
|
14
|
-
}), (e, n) => (l(), r("p", s(e.$attrs, { id: b.value }), [x.value ? (l(), r(t, { key: 0 }, [i(d(x.value), 1)], 64)) : u(e.$slots, "default", {
|
|
10
|
+
return m(b, (e, t) => {
|
|
11
|
+
y && (t && y.unregisterSupportingText(t), y.registerSupportingText(e));
|
|
12
|
+
}, { immediate: !0 }), c(() => {
|
|
13
|
+
y?.unregisterSupportingText(b.value);
|
|
14
|
+
}), (e, n) => (l(), r("p", s(e.$attrs, { id: b.value }), [x.value ? (l(), r(t, { key: 0 }, [i(d(x.value), 1)], 64)) : u(e.$slots, "default", {}, void 0, void 0, 1)], 16, h));
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { default as CCheckbox } from './components/BaseCheckbox';
|
|
3
|
-
export { default as CCheckboxGroup } from './components/BaseCheckboxGroup';
|
|
4
|
-
export { default as CField } from './components/BaseField';
|
|
5
|
-
export { default as CFile } from './components/BaseFile';
|
|
6
|
-
export { default as CForm } from './components/BaseForm';
|
|
7
|
-
export { default as CInput } from './components/BaseInput';
|
|
8
|
-
export { default as CLabel } from './components/BaseLabel';
|
|
9
|
-
export { default as CRadio } from './components/BaseRadio';
|
|
10
|
-
export { default as CRadioGroup } from './components/BaseRadioGroup';
|
|
11
|
-
export { default as CSelect } from './components/BaseSelect';
|
|
12
|
-
export { default as CSupportingText } from './components/BaseSupportingText';
|
|
13
|
-
export { default as CTextarea } from './components/BaseTextarea';
|
|
1
|
+
export {}
|
|
@@ -11,7 +11,9 @@ export interface CheckboxGroupContext {
|
|
|
11
11
|
export declare const checkboxGroupKey: InjectionKey<CheckboxGroupContext>;
|
|
12
12
|
export interface FieldContext {
|
|
13
13
|
id: ComputedRef<string>;
|
|
14
|
-
supportingTextId:
|
|
14
|
+
supportingTextId: ComputedRef<string | undefined>;
|
|
15
15
|
validationMessage: Ref<string>;
|
|
16
|
+
registerSupportingText: (id: string) => void;
|
|
17
|
+
unregisterSupportingText: (id: string) => void;
|
|
16
18
|
}
|
|
17
19
|
export declare const fieldKey: InjectionKey<FieldContext | null>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { default as CButton } from './components/BaseButton';
|
|
2
|
+
export { default as CCheckbox } from './components/BaseCheckbox';
|
|
3
|
+
export { default as CCheckboxGroup } from './components/BaseCheckboxGroup';
|
|
4
|
+
export { default as CField } from './components/BaseField';
|
|
5
|
+
export { default as CFile } from './components/BaseFile';
|
|
6
|
+
export { default as CForm } from './components/BaseForm';
|
|
7
|
+
export { default as CInput } from './components/BaseInput';
|
|
8
|
+
export { default as CLabel } from './components/BaseLabel';
|
|
9
|
+
export { default as CRadio } from './components/BaseRadio';
|
|
10
|
+
export { default as CRadioGroup } from './components/BaseRadioGroup';
|
|
11
|
+
export { default as CSelect } from './components/BaseSelect';
|
|
12
|
+
export { default as CSupportingText } from './components/BaseSupportingText';
|
|
13
|
+
export { default as CTextarea } from './components/BaseTextarea';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charpente-ui/vue",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Charpente UI is a headless Vue component library.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"build": "vite build",
|
|
11
11
|
"test": "vitest",
|
|
12
12
|
"test:coverage": "vitest run --coverage",
|
|
13
|
+
"test:e2e": "playwright test",
|
|
14
|
+
"test:all": "run-s test:coverage test:e2e",
|
|
13
15
|
"prepare": "husky",
|
|
14
16
|
"prepack": "npm run build",
|
|
15
17
|
"release": "semantic-release"
|
|
@@ -29,27 +31,28 @@
|
|
|
29
31
|
"./package.json": "./package.json"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
|
-
"@commitlint/cli": "^20.
|
|
33
|
-
"@commitlint/config-conventional": "^20.
|
|
34
|
+
"@commitlint/cli": "^20.5.3",
|
|
35
|
+
"@commitlint/config-conventional": "^20.5.3",
|
|
34
36
|
"@front-factory/eslint-config": "^1.3.1",
|
|
37
|
+
"@playwright/test": "^1.61.1",
|
|
35
38
|
"@semantic-release/changelog": "^6.0.3",
|
|
36
39
|
"@semantic-release/git": "^10.0.1",
|
|
37
|
-
"@semantic-release/github": "^12.0.
|
|
38
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
39
|
-
"@vitest/coverage-v8": "^4.1.
|
|
40
|
-
"@vue/test-utils": "^2.4.
|
|
41
|
-
"conventional-changelog-conventionalcommits": "^9.1
|
|
42
|
-
"eslint": "^10.0
|
|
43
|
-
"eslint-plugin-vue": "^10.
|
|
40
|
+
"@semantic-release/github": "^12.0.9",
|
|
41
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
42
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
43
|
+
"@vue/test-utils": "^2.4.11",
|
|
44
|
+
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
45
|
+
"eslint": "^10.7.0",
|
|
46
|
+
"eslint-plugin-vue": "^10.10.0",
|
|
44
47
|
"husky": "^9.1.7",
|
|
45
|
-
"jsdom": "^29.1.
|
|
48
|
+
"jsdom": "^29.1.1",
|
|
46
49
|
"npm-run-all2": "^8.0.4",
|
|
47
|
-
"semantic-release": "^25.0.
|
|
48
|
-
"typescript-eslint": "^8.
|
|
49
|
-
"vite": "^8.
|
|
50
|
+
"semantic-release": "^25.0.8",
|
|
51
|
+
"typescript-eslint": "^8.65.0",
|
|
52
|
+
"vite": "^8.1.5",
|
|
50
53
|
"vite-plugin-dts": "^4.5.4",
|
|
51
|
-
"vitest": "^4.1.
|
|
52
|
-
"vue": "^3.5.
|
|
54
|
+
"vitest": "^4.1.10",
|
|
55
|
+
"vue": "^3.5.40"
|
|
53
56
|
},
|
|
54
57
|
"peerDependencies": {
|
|
55
58
|
"vue": "^3.5.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|