@charpente-ui/vue 2.1.0 → 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.
Files changed (59) hide show
  1. package/dist/components/BaseButton.js +15 -4
  2. package/dist/components/BaseButton2.js +5 -0
  3. package/dist/components/BaseCheckbox.js +39 -4
  4. package/dist/components/BaseCheckbox2.js +5 -0
  5. package/dist/components/BaseCheckboxGroup.js +20 -4
  6. package/dist/components/BaseCheckboxGroup2.js +5 -0
  7. package/dist/components/BaseField.js +40 -4
  8. package/dist/components/BaseField2.js +5 -0
  9. package/dist/components/BaseFile.js +33 -4
  10. package/dist/components/BaseFile2.js +5 -0
  11. package/dist/components/BaseForm.js +34 -4
  12. package/dist/components/BaseForm2.js +5 -0
  13. package/dist/components/BaseInput.js +41 -4
  14. package/dist/components/BaseInput2.js +5 -0
  15. package/dist/components/BaseLabel.js +13 -4
  16. package/dist/components/BaseLabel2.js +5 -0
  17. package/dist/components/BaseRadio.js +32 -4
  18. package/dist/components/BaseRadio2.js +5 -0
  19. package/dist/components/BaseRadioGroup.js +20 -4
  20. package/dist/components/BaseRadioGroup2.js +5 -0
  21. package/dist/components/BaseSelect.js +26 -4
  22. package/dist/components/BaseSelect2.js +5 -0
  23. package/dist/components/BaseSupportingText.js +17 -4
  24. package/dist/components/BaseSupportingText2.js +5 -0
  25. package/dist/components/BaseTextarea.js +41 -4
  26. package/dist/components/BaseTextarea2.js +5 -0
  27. package/dist/index.d.ts +1 -13
  28. package/dist/index.js +13 -13
  29. package/dist/{components → src/components}/internal/keys.d.ts +3 -1
  30. package/dist/src/index.d.ts +13 -0
  31. package/package.json +19 -16
  32. package/dist/components/BaseButton.vue?vue&type=script&setup=true&lang.js +0 -16
  33. package/dist/components/BaseCheckbox.vue?vue&type=script&setup=true&lang.js +0 -40
  34. package/dist/components/BaseCheckboxGroup.vue?vue&type=script&setup=true&lang.js +0 -21
  35. package/dist/components/BaseField.vue?vue&type=script&setup=true&lang.js +0 -31
  36. package/dist/components/BaseFile.vue?vue&type=script&setup=true&lang.js +0 -34
  37. package/dist/components/BaseForm.vue?vue&type=script&setup=true&lang.js +0 -35
  38. package/dist/components/BaseInput.vue?vue&type=script&setup=true&lang.js +0 -42
  39. package/dist/components/BaseLabel.vue?vue&type=script&setup=true&lang.js +0 -14
  40. package/dist/components/BaseRadio.vue?vue&type=script&setup=true&lang.js +0 -33
  41. package/dist/components/BaseRadioGroup.vue?vue&type=script&setup=true&lang.js +0 -21
  42. package/dist/components/BaseSelect.vue?vue&type=script&setup=true&lang.js +0 -27
  43. package/dist/components/BaseSupportingText.vue?vue&type=script&setup=true&lang.js +0 -18
  44. package/dist/components/BaseTextarea.vue?vue&type=script&setup=true&lang.js +0 -42
  45. /package/dist/{components → src/components}/BaseButton.d.ts +0 -0
  46. /package/dist/{components → src/components}/BaseCheckbox.d.ts +0 -0
  47. /package/dist/{components → src/components}/BaseCheckboxGroup.d.ts +0 -0
  48. /package/dist/{components → src/components}/BaseField.d.ts +0 -0
  49. /package/dist/{components → src/components}/BaseFile.d.ts +0 -0
  50. /package/dist/{components → src/components}/BaseForm.d.ts +0 -0
  51. /package/dist/{components → src/components}/BaseInput.d.ts +0 -0
  52. /package/dist/{components → src/components}/BaseLabel.d.ts +0 -0
  53. /package/dist/{components → src/components}/BaseRadio.d.ts +0 -0
  54. /package/dist/{components → src/components}/BaseRadioGroup.d.ts +0 -0
  55. /package/dist/{components → src/components}/BaseSelect.d.ts +0 -0
  56. /package/dist/{components → src/components}/BaseSupportingText.d.ts +0 -0
  57. /package/dist/{components → src/components}/BaseTextarea.d.ts +0 -0
  58. /package/dist/{components → src/components}/internal/field.d.ts +0 -0
  59. /package/dist/{components → src/components}/internal/modifiers.d.ts +0 -0
@@ -1,5 +1,16 @@
1
- import e from "./BaseButton.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseButton.vue
3
- var t = e;
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
+ //#region src/components/BaseButton.vue?vue&type=script&setup=true&lang.ts
3
+ var l = /*@__PURE__*/ n({
4
+ inheritAttrs: !1,
5
+ __name: "BaseButton",
6
+ props: { as: { default: "button" } },
7
+ setup(n) {
8
+ let l = n, u = s(), d = e(() => typeof u.type == "string" ? u.type : l.as === "button" ? "button" : void 0);
9
+ return (e, s) => (i(), t(o(n.as), r(e.$attrs, { type: d.value }), {
10
+ default: c(() => [a(e.$slots, "default")]),
11
+ _: 3
12
+ }, 16, ["type"]));
13
+ }
14
+ });
4
15
  //#endregion
5
- export { t as default };
16
+ export { l as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseButton.js";
2
+ //#region src/components/BaseButton.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,40 @@
1
- import e from "./BaseCheckbox.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseCheckbox.vue
3
- var t = e;
1
+ import { checkboxGroupKey as e } from "./internal/keys.js";
2
+ import { useFieldControl as t } from "./internal/field.js";
3
+ import { computed as n, createElementBlock as r, defineComponent as i, inject as a, isRef as o, mergeModels as s, mergeProps as c, openBlock as l, unref as u, useAttrs as d, useModel as f, useTemplateRef as p, vModelCheckbox as m, watchPostEffect as h, withDirectives as g } from "vue";
4
+ //#region src/components/BaseCheckbox.vue?vue&type=script&setup=true&lang.ts
5
+ var _ = [
6
+ "id",
7
+ "aria-describedby",
8
+ "aria-invalid",
9
+ "name",
10
+ "value"
11
+ ], v = /*@__PURE__*/ i({
12
+ inheritAttrs: !1,
13
+ __name: "BaseCheckbox",
14
+ props: /*@__PURE__*/ s({
15
+ value: {},
16
+ indeterminate: { type: Boolean }
17
+ }, {
18
+ modelValue: { type: [Boolean, Array] },
19
+ modelModifiers: {}
20
+ }),
21
+ emits: ["update:modelValue"],
22
+ setup(i) {
23
+ let s = i, v = f(i, "modelValue"), y = a(e, null), b = y ? y.model : v, x = d(), S = p("input"), { controlId: C, describedBy: w, ariaInvalid: T } = t(), E = n(() => typeof x.name == "string" ? x.name : y?.name.value);
24
+ return h(() => {
25
+ /* v8 ignore next 2 */
26
+ S.value && (S.value.indeterminate = !!s.indeterminate);
27
+ }), (e, t) => g((l(), r("input", c(e.$attrs, {
28
+ id: u(C),
29
+ ref: "input",
30
+ "onUpdate:modelValue": t[0] ||= (e) => o(b) ? b.value = e : null,
31
+ "aria-describedby": u(w),
32
+ "aria-invalid": u(T),
33
+ name: E.value,
34
+ type: "checkbox",
35
+ value: i.value
36
+ }), null, 16, _)), [[m, u(b)]]);
37
+ }
38
+ });
4
39
  //#endregion
5
- export { t as default };
40
+ export { v as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseCheckbox.js";
2
+ //#region src/components/BaseCheckbox.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,21 @@
1
- import e from "./BaseCheckboxGroup.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseCheckboxGroup.vue
3
- var t = e;
1
+ import { checkboxGroupKey as e, fieldKey as t } from "./internal/keys.js";
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
+ //#region src/components/BaseCheckboxGroup.vue?vue&type=script&setup=true&lang.ts
4
+ var p = /*@__PURE__*/ i({
5
+ inheritAttrs: !1,
6
+ __name: "BaseCheckboxGroup",
7
+ props: {
8
+ modelValue: { default: () => [] },
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(i) {
13
+ let p = f(i, "modelValue"), m = u(), h = d();
14
+ return c(e, {
15
+ model: p,
16
+ name: n(() => typeof m.name == "string" ? m.name : h)
17
+ }), c(t, null), (e, t) => (s(), r("fieldset", o(a(e.$attrs)), [l(e.$slots, "default")], 16));
18
+ }
19
+ });
4
20
  //#endregion
5
- export { t as default };
21
+ export { p as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseCheckboxGroup.js";
2
+ //#region src/components/BaseCheckboxGroup.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,41 @@
1
- import e from "./BaseField.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseField.vue
3
- var t = e;
1
+ import { fieldKey as e } from "./internal/keys.js";
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
+ //#region src/components/BaseField.vue?vue&type=script&setup=true&lang.ts
4
+ var d = /*@__PURE__*/ r({
5
+ inheritAttrs: !1,
6
+ __name: "BaseField",
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(() => 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(() => {
17
+ let e = { ...d };
18
+ return delete e.id, e;
19
+ });
20
+ o(e, {
21
+ id: g,
22
+ supportingTextId: _,
23
+ validationMessage: m,
24
+ registerSupportingText: v,
25
+ unregisterSupportingText: y
26
+ });
27
+ function x(e) {
28
+ h.value = !0, m.value = e.target.validationMessage;
29
+ }
30
+ function S(e) {
31
+ h.value && (m.value = e.target.validationMessage);
32
+ }
33
+ return (e, t) => (a(), n("div", i(b.value, {
34
+ onInvalidCapture: x,
35
+ onInputCapture: S,
36
+ onChangeCapture: S
37
+ }), [c(e.$slots, "default")], 16));
38
+ }
39
+ });
4
40
  //#endregion
5
- export { t as default };
41
+ export { d as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseField.js";
2
+ //#region src/components/BaseField.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,34 @@
1
- import e from "./BaseFile.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseFile.vue
3
- var t = e;
1
+ import { useFieldControl as e } from "./internal/field.js";
2
+ import { createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, unref as a, useModel as o, useTemplateRef as s, watch as c } from "vue";
3
+ //#region src/components/BaseFile.vue?vue&type=script&setup=true&lang.ts
4
+ var l = [
5
+ "id",
6
+ "aria-describedby",
7
+ "aria-invalid"
8
+ ], u = /*@__PURE__*/ n({
9
+ inheritAttrs: !1,
10
+ __name: "BaseFile",
11
+ props: {
12
+ modelValue: {},
13
+ modelModifiers: {}
14
+ },
15
+ emits: ["update:modelValue"],
16
+ setup(n) {
17
+ let u = o(n, "modelValue"), d = s("input"), { controlId: f, describedBy: p, ariaInvalid: m } = e();
18
+ function h(e) {
19
+ u.value = e.target.files;
20
+ }
21
+ return c(u, (e) => {
22
+ !e && d.value && (d.value.value = "");
23
+ }), (e, n) => (i(), t("input", r(e.$attrs, {
24
+ id: a(f),
25
+ ref: "input",
26
+ "aria-describedby": a(p),
27
+ "aria-invalid": a(m),
28
+ type: "file",
29
+ onChange: h
30
+ }), null, 16, l));
31
+ }
32
+ });
4
33
  //#endregion
5
- export { t as default };
34
+ export { u as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseFile.js";
2
+ //#region src/components/BaseFile.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,35 @@
1
- import e from "./BaseForm.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseForm.vue
3
- var t = e;
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
+ //#region src/components/BaseForm.vue?vue&type=script&setup=true&lang.ts
3
+ var l = ["id", "novalidate"], u = /*@__PURE__*/ n({
4
+ inheritAttrs: !1,
5
+ __name: "BaseForm",
6
+ props: { validate: { type: Boolean } },
7
+ emits: ["submit"],
8
+ setup(n, { emit: u }) {
9
+ let d = n, f = o(), p = s(), m = u, h = e(() => typeof f.id == "string" ? f.id : p);
10
+ function g(e) {
11
+ let t = e.target;
12
+ if (d.validate && !t.checkValidity()) {
13
+ _(t);
14
+ return;
15
+ }
16
+ m("submit", e);
17
+ }
18
+ function _(e) {
19
+ for (let t of Array.from(e.elements)) {
20
+ let e = t;
21
+ if (e.willValidate && !e.validity.valid) {
22
+ e.focus();
23
+ break;
24
+ }
25
+ }
26
+ }
27
+ return (e, o) => (i(), t("form", r(e.$attrs, {
28
+ id: h.value,
29
+ novalidate: n.validate || void 0,
30
+ onSubmit: c(g, ["prevent"])
31
+ }), [a(e.$slots, "default")], 16, l));
32
+ }
33
+ });
4
34
  //#endregion
5
- export { t as default };
35
+ export { u as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseForm.js";
2
+ //#region src/components/BaseForm.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,42 @@
1
- import e from "./BaseInput.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseInput.vue
3
- var t = e;
1
+ import { useFieldControl as e } from "./internal/field.js";
2
+ import { applyModelModifiers as t } from "./internal/modifiers.js";
3
+ import { createElementBlock as n, defineComponent as r, isRef as i, mergeProps as a, openBlock as o, unref as s, useModel as c, vModelDynamic as l, withDirectives as u } from "vue";
4
+ //#region src/components/BaseInput.vue?vue&type=script&setup=true&lang.ts
5
+ var d = [
6
+ "id",
7
+ "aria-describedby",
8
+ "aria-invalid"
9
+ ], f = [
10
+ "id",
11
+ "aria-describedby",
12
+ "aria-invalid"
13
+ ], p = /*@__PURE__*/ r({
14
+ inheritAttrs: !1,
15
+ __name: "BaseInput",
16
+ props: {
17
+ modelValue: {},
18
+ modelModifiers: {}
19
+ },
20
+ emits: ["update:modelValue"],
21
+ setup(r) {
22
+ let [p, m] = c(r, "modelValue", { set: (e) => t(e, m) }), { controlId: h, describedBy: g, ariaInvalid: _ } = e();
23
+ return (e, t) => s(m).lazy ? u((o(), n("input", a({ key: 0 }, e.$attrs, {
24
+ id: s(h),
25
+ "onUpdate:modelValue": t[0] ||= (e) => i(p) ? p.value = e : null,
26
+ "aria-describedby": s(g),
27
+ "aria-invalid": s(_)
28
+ }), null, 16, d)), [[
29
+ l,
30
+ s(p),
31
+ void 0,
32
+ { lazy: !0 }
33
+ ]]) : u((o(), n("input", a({ key: 1 }, e.$attrs, {
34
+ id: s(h),
35
+ "onUpdate:modelValue": t[1] ||= (e) => i(p) ? p.value = e : null,
36
+ "aria-describedby": s(g),
37
+ "aria-invalid": s(_)
38
+ }), null, 16, f)), [[l, s(p)]]);
39
+ }
40
+ });
4
41
  //#endregion
5
- export { t as default };
42
+ export { p as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseInput.js";
2
+ //#region src/components/BaseInput.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,14 @@
1
- import e from "./BaseLabel.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseLabel.vue
3
- var t = e;
1
+ import { fieldKey as e } from "./internal/keys.js";
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
+ //#region src/components/BaseLabel.vue?vue&type=script&setup=true&lang.ts
4
+ var c = ["for"], l = /*@__PURE__*/ r({
5
+ inheritAttrs: !1,
6
+ __name: "BaseLabel",
7
+ props: { for: {} },
8
+ setup(r) {
9
+ let l = r, u = i(e, null), d = t(() => l.for ?? u?.id.value);
10
+ return (e, t) => (o(), n("label", a(e.$attrs, { for: d.value }), [s(e.$slots, "default")], 16, c));
11
+ }
12
+ });
4
13
  //#endregion
5
- export { t as default };
14
+ export { l as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseLabel.js";
2
+ //#region src/components/BaseLabel.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,33 @@
1
- import e from "./BaseRadio.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseRadio.vue
3
- var t = e;
1
+ import { radioGroupKey as e } from "./internal/keys.js";
2
+ import { useFieldControl as t } from "./internal/field.js";
3
+ import { computed as n, createElementBlock as r, defineComponent as i, inject as a, isRef as o, mergeModels as s, mergeProps as c, openBlock as l, unref as u, useAttrs as d, useModel as f, vModelRadio as p, withDirectives as m } from "vue";
4
+ //#region src/components/BaseRadio.vue?vue&type=script&setup=true&lang.ts
5
+ var h = [
6
+ "id",
7
+ "aria-describedby",
8
+ "aria-invalid",
9
+ "name",
10
+ "value"
11
+ ], g = /*@__PURE__*/ i({
12
+ inheritAttrs: !1,
13
+ __name: "BaseRadio",
14
+ props: /*@__PURE__*/ s({ value: {} }, {
15
+ modelValue: {},
16
+ modelModifiers: {}
17
+ }),
18
+ emits: ["update:modelValue"],
19
+ setup(i) {
20
+ let s = f(i, "modelValue"), g = a(e, null), _ = g ? g.model : s, v = d(), { controlId: y, describedBy: b, ariaInvalid: x } = t(), S = n(() => typeof v.name == "string" ? v.name : g?.name.value);
21
+ return (e, t) => m((l(), r("input", c(e.$attrs, {
22
+ id: u(y),
23
+ "onUpdate:modelValue": t[0] ||= (e) => o(_) ? _.value = e : null,
24
+ "aria-describedby": u(b),
25
+ "aria-invalid": u(x),
26
+ name: S.value,
27
+ value: i.value,
28
+ type: "radio"
29
+ }), null, 16, h)), [[p, u(_)]]);
30
+ }
31
+ });
4
32
  //#endregion
5
- export { t as default };
33
+ export { g as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseRadio.js";
2
+ //#region src/components/BaseRadio.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,21 @@
1
- import e from "./BaseRadioGroup.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseRadioGroup.vue
3
- var t = e;
1
+ import { fieldKey as e, radioGroupKey as t } from "./internal/keys.js";
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
+ //#region src/components/BaseRadioGroup.vue?vue&type=script&setup=true&lang.ts
4
+ var p = /*@__PURE__*/ i({
5
+ inheritAttrs: !1,
6
+ __name: "BaseRadioGroup",
7
+ props: {
8
+ modelValue: {},
9
+ modelModifiers: {}
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(i) {
13
+ let p = f(i, "modelValue"), m = u(), h = d();
14
+ return c(t, {
15
+ model: p,
16
+ name: n(() => typeof m.name == "string" ? m.name : h)
17
+ }), c(e, null), (e, t) => (s(), r("fieldset", o(a(e.$attrs)), [l(e.$slots, "default")], 16));
18
+ }
19
+ });
4
20
  //#endregion
5
- export { t as default };
21
+ export { p as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseRadioGroup.js";
2
+ //#region src/components/BaseRadioGroup.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,27 @@
1
- import e from "./BaseSelect.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseSelect.vue
3
- var t = e;
1
+ import { useFieldControl as e } from "./internal/field.js";
2
+ import { createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, unref as o, useModel as s, vModelSelect as c, withDirectives as l } from "vue";
3
+ //#region src/components/BaseSelect.vue?vue&type=script&setup=true&lang.ts
4
+ var u = [
5
+ "id",
6
+ "aria-describedby",
7
+ "aria-invalid"
8
+ ], d = /*@__PURE__*/ n({
9
+ inheritAttrs: !1,
10
+ __name: "BaseSelect",
11
+ props: {
12
+ modelValue: {},
13
+ modelModifiers: {}
14
+ },
15
+ emits: ["update:modelValue"],
16
+ setup(n) {
17
+ let d = s(n, "modelValue"), { controlId: f, describedBy: p, ariaInvalid: m } = e();
18
+ return (e, n) => l((i(), t("select", r(e.$attrs, {
19
+ id: o(f),
20
+ "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
21
+ "aria-describedby": o(p),
22
+ "aria-invalid": o(m)
23
+ }), [a(e.$slots, "default")], 16, u)), [[c, d.value]]);
24
+ }
25
+ });
4
26
  //#endregion
5
- export { t as default };
27
+ export { d as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseSelect.js";
2
+ //#region src/components/BaseSelect.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,18 @@
1
- import e from "./BaseSupportingText.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseSupportingText.vue
3
- var t = e;
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, watch as m } from "vue";
3
+ //#region src/components/BaseSupportingText.vue?vue&type=script&setup=true&lang.ts
4
+ var h = ["id"], g = /*@__PURE__*/ a({
5
+ inheritAttrs: !1,
6
+ __name: "BaseSupportingText",
7
+ props: { validation: { type: Boolean } },
8
+ setup(a) {
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(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
+ }
16
+ });
4
17
  //#endregion
5
- export { t as default };
18
+ export { g as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseSupportingText.js";
2
+ //#region src/components/BaseSupportingText.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -1,5 +1,42 @@
1
- import e from "./BaseTextarea.vue?vue&type=script&setup=true&lang.js";
2
- //#region src/components/BaseTextarea.vue
3
- var t = e;
1
+ import { useFieldControl as e } from "./internal/field.js";
2
+ import { applyModelModifiers as t } from "./internal/modifiers.js";
3
+ import { createElementBlock as n, defineComponent as r, isRef as i, mergeProps as a, openBlock as o, unref as s, useModel as c, vModelText as l, withDirectives as u } from "vue";
4
+ //#region src/components/BaseTextarea.vue?vue&type=script&setup=true&lang.ts
5
+ var d = [
6
+ "id",
7
+ "aria-describedby",
8
+ "aria-invalid"
9
+ ], f = [
10
+ "id",
11
+ "aria-describedby",
12
+ "aria-invalid"
13
+ ], p = /*@__PURE__*/ r({
14
+ inheritAttrs: !1,
15
+ __name: "BaseTextarea",
16
+ props: {
17
+ modelValue: {},
18
+ modelModifiers: {}
19
+ },
20
+ emits: ["update:modelValue"],
21
+ setup(r) {
22
+ let [p, m] = c(r, "modelValue", { set: (e) => t(e, m) }), { controlId: h, describedBy: g, ariaInvalid: _ } = e();
23
+ return (e, t) => s(m).lazy ? u((o(), n("textarea", a({ key: 0 }, e.$attrs, {
24
+ id: s(h),
25
+ "onUpdate:modelValue": t[0] ||= (e) => i(p) ? p.value = e : null,
26
+ "aria-describedby": s(g),
27
+ "aria-invalid": s(_)
28
+ }), null, 16, d)), [[
29
+ l,
30
+ s(p),
31
+ void 0,
32
+ { lazy: !0 }
33
+ ]]) : u((o(), n("textarea", a({ key: 1 }, e.$attrs, {
34
+ id: s(h),
35
+ "onUpdate:modelValue": t[1] ||= (e) => i(p) ? p.value = e : null,
36
+ "aria-describedby": s(g),
37
+ "aria-invalid": s(_)
38
+ }), null, 16, f)), [[l, s(p)]]);
39
+ }
40
+ });
4
41
  //#endregion
5
- export { t as default };
42
+ export { p as default };
@@ -0,0 +1,5 @@
1
+ import e from "./BaseTextarea.js";
2
+ //#region src/components/BaseTextarea.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
package/dist/index.d.ts CHANGED
@@ -1,13 +1 @@
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';
1
+ export {}
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import e from "./components/BaseButton.js";
2
- import t from "./components/BaseCheckbox.js";
3
- import n from "./components/BaseCheckboxGroup.js";
4
- import r from "./components/BaseField.js";
5
- import i from "./components/BaseFile.js";
6
- import a from "./components/BaseForm.js";
7
- import o from "./components/BaseInput.js";
8
- import s from "./components/BaseLabel.js";
9
- import c from "./components/BaseRadio.js";
10
- import l from "./components/BaseRadioGroup.js";
11
- import u from "./components/BaseSelect.js";
12
- import d from "./components/BaseSupportingText.js";
13
- import f from "./components/BaseTextarea.js";
1
+ import e from "./components/BaseButton2.js";
2
+ import t from "./components/BaseCheckbox2.js";
3
+ import n from "./components/BaseCheckboxGroup2.js";
4
+ import r from "./components/BaseField2.js";
5
+ import i from "./components/BaseFile2.js";
6
+ import a from "./components/BaseForm2.js";
7
+ import o from "./components/BaseInput2.js";
8
+ import s from "./components/BaseLabel2.js";
9
+ import c from "./components/BaseRadio2.js";
10
+ import l from "./components/BaseRadioGroup2.js";
11
+ import u from "./components/BaseSelect2.js";
12
+ import d from "./components/BaseSupportingText2.js";
13
+ import f from "./components/BaseTextarea2.js";
14
14
  export { e as CButton, t as CCheckbox, n as CCheckboxGroup, r as CField, i as CFile, a as CForm, o as CInput, s as CLabel, c as CRadio, l as CRadioGroup, u as CSelect, d as CSupportingText, f as CTextarea };
@@ -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: Ref<string | undefined>;
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.0",
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.4.2",
33
- "@commitlint/config-conventional": "^20.4.2",
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.6",
38
- "@vitejs/plugin-vue": "^6.0.4",
39
- "@vitest/coverage-v8": "^4.1.5",
40
- "@vue/test-utils": "^2.4.9",
41
- "conventional-changelog-conventionalcommits": "^9.1.0",
42
- "eslint": "^10.0.2",
43
- "eslint-plugin-vue": "^10.8.0",
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.0",
48
+ "jsdom": "^29.1.1",
46
49
  "npm-run-all2": "^8.0.4",
47
- "semantic-release": "^25.0.3",
48
- "typescript-eslint": "^8.56.1",
49
- "vite": "^8.0.10",
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.5",
52
- "vue": "^3.5.29"
54
+ "vitest": "^4.1.10",
55
+ "vue": "^3.5.40"
53
56
  },
54
57
  "peerDependencies": {
55
58
  "vue": "^3.5.0"
@@ -1,16 +0,0 @@
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
- //#region src/components/BaseButton.vue?vue&type=script&setup=true&lang.ts
3
- var l = /* @__PURE__ */ n({
4
- inheritAttrs: !1,
5
- __name: "BaseButton",
6
- props: { as: { default: "button" } },
7
- setup(n) {
8
- let l = n, u = s(), d = e(() => typeof u.type == "string" ? u.type : l.as === "button" ? "button" : void 0);
9
- return (e, s) => (i(), t(o(n.as), r(e.$attrs, { type: d.value }), {
10
- default: c(() => [a(e.$slots, "default")]),
11
- _: 3
12
- }, 16, ["type"]));
13
- }
14
- });
15
- //#endregion
16
- export { l as default };
@@ -1,40 +0,0 @@
1
- import { checkboxGroupKey as e } from "./internal/keys.js";
2
- import { useFieldControl as t } from "./internal/field.js";
3
- import { computed as n, createElementBlock as r, defineComponent as i, inject as a, isRef as o, mergeModels as s, mergeProps as c, openBlock as l, unref as u, useAttrs as d, useModel as f, useTemplateRef as p, vModelCheckbox as m, watchPostEffect as h, withDirectives as g } from "vue";
4
- //#region src/components/BaseCheckbox.vue?vue&type=script&setup=true&lang.ts
5
- var _ = [
6
- "id",
7
- "aria-describedby",
8
- "aria-invalid",
9
- "name",
10
- "value"
11
- ], v = /* @__PURE__ */ i({
12
- inheritAttrs: !1,
13
- __name: "BaseCheckbox",
14
- props: /* @__PURE__ */ s({
15
- value: {},
16
- indeterminate: { type: Boolean }
17
- }, {
18
- modelValue: { type: [Boolean, Array] },
19
- modelModifiers: {}
20
- }),
21
- emits: ["update:modelValue"],
22
- setup(i) {
23
- let s = i, v = f(i, "modelValue"), y = a(e, null), b = y ? y.model : v, x = d(), S = p("input"), { controlId: C, describedBy: w, ariaInvalid: T } = t(), E = n(() => typeof x.name == "string" ? x.name : y?.name.value);
24
- return h(() => {
25
- /* v8 ignore next 2 */
26
- S.value && (S.value.indeterminate = !!s.indeterminate);
27
- }), (e, t) => g((l(), r("input", c(e.$attrs, {
28
- id: u(C),
29
- ref: "input",
30
- "onUpdate:modelValue": t[0] ||= (e) => o(b) ? b.value = e : null,
31
- "aria-describedby": u(w),
32
- "aria-invalid": u(T),
33
- name: E.value,
34
- type: "checkbox",
35
- value: i.value
36
- }), null, 16, _)), [[m, u(b)]]);
37
- }
38
- });
39
- //#endregion
40
- export { v as default };
@@ -1,21 +0,0 @@
1
- import { checkboxGroupKey as e, fieldKey as t } from "./internal/keys.js";
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
- //#region src/components/BaseCheckboxGroup.vue?vue&type=script&setup=true&lang.ts
4
- var p = /* @__PURE__ */ i({
5
- inheritAttrs: !1,
6
- __name: "BaseCheckboxGroup",
7
- props: {
8
- modelValue: { default: () => [] },
9
- modelModifiers: {}
10
- },
11
- emits: ["update:modelValue"],
12
- setup(i) {
13
- let p = f(i, "modelValue"), m = u(), h = d();
14
- return c(e, {
15
- model: p,
16
- name: n(() => typeof m.name == "string" ? m.name : h)
17
- }), c(t, null), (e, t) => (s(), r("fieldset", o(a(e.$attrs)), [l(e.$slots, "default")], 16));
18
- }
19
- });
20
- //#endregion
21
- export { p as default };
@@ -1,31 +0,0 @@
1
- import { fieldKey as e } from "./internal/keys.js";
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
- //#region src/components/BaseField.vue?vue&type=script&setup=true&lang.ts
4
- var d = /* @__PURE__ */ r({
5
- inheritAttrs: !1,
6
- __name: "BaseField",
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(() => {
9
- let e = { ...d };
10
- return delete e.id, e;
11
- });
12
- o(e, {
13
- id: g,
14
- supportingTextId: p,
15
- validationMessage: m
16
- });
17
- function v(e) {
18
- h.value = !0, m.value = e.target.validationMessage;
19
- }
20
- function y(e) {
21
- h.value && (m.value = e.target.validationMessage);
22
- }
23
- return (e, t) => (a(), n("div", i(_.value, {
24
- onInvalidCapture: v,
25
- onInputCapture: y,
26
- onChangeCapture: y
27
- }), [c(e.$slots, "default")], 16));
28
- }
29
- });
30
- //#endregion
31
- export { d as default };
@@ -1,34 +0,0 @@
1
- import { useFieldControl as e } from "./internal/field.js";
2
- import { createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, unref as a, useModel as o, useTemplateRef as s, watch as c } from "vue";
3
- //#region src/components/BaseFile.vue?vue&type=script&setup=true&lang.ts
4
- var l = [
5
- "id",
6
- "aria-describedby",
7
- "aria-invalid"
8
- ], u = /* @__PURE__ */ n({
9
- inheritAttrs: !1,
10
- __name: "BaseFile",
11
- props: {
12
- modelValue: {},
13
- modelModifiers: {}
14
- },
15
- emits: ["update:modelValue"],
16
- setup(n) {
17
- let u = o(n, "modelValue"), d = s("input"), { controlId: f, describedBy: p, ariaInvalid: m } = e();
18
- function h(e) {
19
- u.value = e.target.files;
20
- }
21
- return c(u, (e) => {
22
- !e && d.value && (d.value.value = "");
23
- }), (e, n) => (i(), t("input", r(e.$attrs, {
24
- id: a(f),
25
- ref: "input",
26
- "aria-describedby": a(p),
27
- "aria-invalid": a(m),
28
- type: "file",
29
- onChange: h
30
- }), null, 16, l));
31
- }
32
- });
33
- //#endregion
34
- export { u as default };
@@ -1,35 +0,0 @@
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
- //#region src/components/BaseForm.vue?vue&type=script&setup=true&lang.ts
3
- var l = ["id", "novalidate"], u = /* @__PURE__ */ n({
4
- inheritAttrs: !1,
5
- __name: "BaseForm",
6
- props: { validate: { type: Boolean } },
7
- emits: ["submit"],
8
- setup(n, { emit: u }) {
9
- let d = n, f = o(), p = s(), m = u, h = e(() => typeof f.id == "string" ? f.id : p);
10
- function g(e) {
11
- let t = e.target;
12
- if (d.validate && !t.checkValidity()) {
13
- _(t);
14
- return;
15
- }
16
- m("submit", e);
17
- }
18
- function _(e) {
19
- for (let t of Array.from(e.elements)) {
20
- let e = t;
21
- if (e.willValidate && !e.validity.valid) {
22
- e.focus();
23
- break;
24
- }
25
- }
26
- }
27
- return (e, o) => (i(), t("form", r(e.$attrs, {
28
- id: h.value,
29
- novalidate: n.validate || void 0,
30
- onSubmit: c(g, ["prevent"])
31
- }), [a(e.$slots, "default")], 16, l));
32
- }
33
- });
34
- //#endregion
35
- export { u as default };
@@ -1,42 +0,0 @@
1
- import { useFieldControl as e } from "./internal/field.js";
2
- import { applyModelModifiers as t } from "./internal/modifiers.js";
3
- import { createElementBlock as n, defineComponent as r, isRef as i, mergeProps as a, openBlock as o, unref as s, useModel as c, vModelDynamic as l, withDirectives as u } from "vue";
4
- //#region src/components/BaseInput.vue?vue&type=script&setup=true&lang.ts
5
- var d = [
6
- "id",
7
- "aria-describedby",
8
- "aria-invalid"
9
- ], f = [
10
- "id",
11
- "aria-describedby",
12
- "aria-invalid"
13
- ], p = /* @__PURE__ */ r({
14
- inheritAttrs: !1,
15
- __name: "BaseInput",
16
- props: {
17
- modelValue: {},
18
- modelModifiers: {}
19
- },
20
- emits: ["update:modelValue"],
21
- setup(r) {
22
- let [p, m] = c(r, "modelValue", { set: (e) => t(e, m) }), { controlId: h, describedBy: g, ariaInvalid: _ } = e();
23
- return (e, t) => s(m).lazy ? u((o(), n("input", a({ key: 0 }, e.$attrs, {
24
- id: s(h),
25
- "onUpdate:modelValue": t[0] ||= (e) => i(p) ? p.value = e : null,
26
- "aria-describedby": s(g),
27
- "aria-invalid": s(_)
28
- }), null, 16, d)), [[
29
- l,
30
- s(p),
31
- void 0,
32
- { lazy: !0 }
33
- ]]) : u((o(), n("input", a({ key: 1 }, e.$attrs, {
34
- id: s(h),
35
- "onUpdate:modelValue": t[1] ||= (e) => i(p) ? p.value = e : null,
36
- "aria-describedby": s(g),
37
- "aria-invalid": s(_)
38
- }), null, 16, f)), [[l, s(p)]]);
39
- }
40
- });
41
- //#endregion
42
- export { p as default };
@@ -1,14 +0,0 @@
1
- import { fieldKey as e } from "./internal/keys.js";
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
- //#region src/components/BaseLabel.vue?vue&type=script&setup=true&lang.ts
4
- var c = ["for"], l = /* @__PURE__ */ r({
5
- inheritAttrs: !1,
6
- __name: "BaseLabel",
7
- props: { for: {} },
8
- setup(r) {
9
- let l = r, u = i(e, null), d = t(() => l.for ?? u?.id.value);
10
- return (e, t) => (o(), n("label", a(e.$attrs, { for: d.value }), [s(e.$slots, "default")], 16, c));
11
- }
12
- });
13
- //#endregion
14
- export { l as default };
@@ -1,33 +0,0 @@
1
- import { radioGroupKey as e } from "./internal/keys.js";
2
- import { useFieldControl as t } from "./internal/field.js";
3
- import { computed as n, createElementBlock as r, defineComponent as i, inject as a, isRef as o, mergeModels as s, mergeProps as c, openBlock as l, unref as u, useAttrs as d, useModel as f, vModelRadio as p, withDirectives as m } from "vue";
4
- //#region src/components/BaseRadio.vue?vue&type=script&setup=true&lang.ts
5
- var h = [
6
- "id",
7
- "aria-describedby",
8
- "aria-invalid",
9
- "name",
10
- "value"
11
- ], g = /* @__PURE__ */ i({
12
- inheritAttrs: !1,
13
- __name: "BaseRadio",
14
- props: /* @__PURE__ */ s({ value: {} }, {
15
- modelValue: {},
16
- modelModifiers: {}
17
- }),
18
- emits: ["update:modelValue"],
19
- setup(i) {
20
- let s = f(i, "modelValue"), g = a(e, null), _ = g ? g.model : s, v = d(), { controlId: y, describedBy: b, ariaInvalid: x } = t(), S = n(() => typeof v.name == "string" ? v.name : g?.name.value);
21
- return (e, t) => m((l(), r("input", c(e.$attrs, {
22
- id: u(y),
23
- "onUpdate:modelValue": t[0] ||= (e) => o(_) ? _.value = e : null,
24
- "aria-describedby": u(b),
25
- "aria-invalid": u(x),
26
- name: S.value,
27
- value: i.value,
28
- type: "radio"
29
- }), null, 16, h)), [[p, u(_)]]);
30
- }
31
- });
32
- //#endregion
33
- export { g as default };
@@ -1,21 +0,0 @@
1
- import { fieldKey as e, radioGroupKey as t } from "./internal/keys.js";
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
- //#region src/components/BaseRadioGroup.vue?vue&type=script&setup=true&lang.ts
4
- var p = /* @__PURE__ */ i({
5
- inheritAttrs: !1,
6
- __name: "BaseRadioGroup",
7
- props: {
8
- modelValue: {},
9
- modelModifiers: {}
10
- },
11
- emits: ["update:modelValue"],
12
- setup(i) {
13
- let p = f(i, "modelValue"), m = u(), h = d();
14
- return c(t, {
15
- model: p,
16
- name: n(() => typeof m.name == "string" ? m.name : h)
17
- }), c(e, null), (e, t) => (s(), r("fieldset", o(a(e.$attrs)), [l(e.$slots, "default")], 16));
18
- }
19
- });
20
- //#endregion
21
- export { p as default };
@@ -1,27 +0,0 @@
1
- import { useFieldControl as e } from "./internal/field.js";
2
- import { createElementBlock as t, defineComponent as n, mergeProps as r, openBlock as i, renderSlot as a, unref as o, useModel as s, vModelSelect as c, withDirectives as l } from "vue";
3
- //#region src/components/BaseSelect.vue?vue&type=script&setup=true&lang.ts
4
- var u = [
5
- "id",
6
- "aria-describedby",
7
- "aria-invalid"
8
- ], d = /* @__PURE__ */ n({
9
- inheritAttrs: !1,
10
- __name: "BaseSelect",
11
- props: {
12
- modelValue: {},
13
- modelModifiers: {}
14
- },
15
- emits: ["update:modelValue"],
16
- setup(n) {
17
- let d = s(n, "modelValue"), { controlId: f, describedBy: p, ariaInvalid: m } = e();
18
- return (e, n) => l((i(), t("select", r(e.$attrs, {
19
- id: o(f),
20
- "onUpdate:modelValue": n[0] ||= (e) => d.value = e,
21
- "aria-describedby": o(p),
22
- "aria-invalid": o(m)
23
- }), [a(e.$slots, "default")], 16, u)), [[c, d.value]]);
24
- }
25
- });
26
- //#endregion
27
- export { d as default };
@@ -1,18 +0,0 @@
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, watchEffect as m } from "vue";
3
- //#region src/components/BaseSupportingText.vue?vue&type=script&setup=true&lang.ts
4
- var h = ["id"], g = /* @__PURE__ */ a({
5
- inheritAttrs: !1,
6
- __name: "BaseSupportingText",
7
- props: { validation: { type: Boolean } },
8
- setup(a) {
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.supportingTextId.value = b.value);
12
- }), c(() => {
13
- y && (y.supportingTextId.value = void 0);
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", { key: 1 })], 16, h));
15
- }
16
- });
17
- //#endregion
18
- export { g as default };
@@ -1,42 +0,0 @@
1
- import { useFieldControl as e } from "./internal/field.js";
2
- import { applyModelModifiers as t } from "./internal/modifiers.js";
3
- import { createElementBlock as n, defineComponent as r, isRef as i, mergeProps as a, openBlock as o, unref as s, useModel as c, vModelText as l, withDirectives as u } from "vue";
4
- //#region src/components/BaseTextarea.vue?vue&type=script&setup=true&lang.ts
5
- var d = [
6
- "id",
7
- "aria-describedby",
8
- "aria-invalid"
9
- ], f = [
10
- "id",
11
- "aria-describedby",
12
- "aria-invalid"
13
- ], p = /* @__PURE__ */ r({
14
- inheritAttrs: !1,
15
- __name: "BaseTextarea",
16
- props: {
17
- modelValue: {},
18
- modelModifiers: {}
19
- },
20
- emits: ["update:modelValue"],
21
- setup(r) {
22
- let [p, m] = c(r, "modelValue", { set: (e) => t(e, m) }), { controlId: h, describedBy: g, ariaInvalid: _ } = e();
23
- return (e, t) => s(m).lazy ? u((o(), n("textarea", a({ key: 0 }, e.$attrs, {
24
- id: s(h),
25
- "onUpdate:modelValue": t[0] ||= (e) => i(p) ? p.value = e : null,
26
- "aria-describedby": s(g),
27
- "aria-invalid": s(_)
28
- }), null, 16, d)), [[
29
- l,
30
- s(p),
31
- void 0,
32
- { lazy: !0 }
33
- ]]) : u((o(), n("textarea", a({ key: 1 }, e.$attrs, {
34
- id: s(h),
35
- "onUpdate:modelValue": t[1] ||= (e) => i(p) ? p.value = e : null,
36
- "aria-describedby": s(g),
37
- "aria-invalid": s(_)
38
- }), null, 16, f)), [[l, s(p)]]);
39
- }
40
- });
41
- //#endregion
42
- export { p as default };