@nilloq/ouds-web 0.1.6 → 0.1.8
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 +17 -115
- package/dist/{alert-bsnEmrzb.js → alert-B4w3fDHo.js} +2 -2
- package/dist/{alert-By364Om4.js → alert-Chns046l.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/{badge-fffoaFuZ.js → badge-CDpWg-AO.js} +1 -1
- package/dist/badge.js +1 -1
- package/dist/{button-BUziAVbu.js → button-OgsnDYrO.js} +4 -3
- package/dist/{button-nN1Pcwm6.js → button-gcQ7CyWb.js} +3 -2
- package/dist/button.js +1 -1
- package/dist/checkbox-D7TFFuw3.js +196 -0
- package/dist/checkbox-DfYlHYR2.js +155 -0
- package/dist/checkbox.js +1 -1
- package/dist/chip-B3v4pWZD.js +92 -0
- package/dist/chip-DGfqitrQ.js +115 -0
- package/dist/chip.js +2 -0
- package/dist/{control-item-slots-BNXNsI1e.js → control-item-slots-BDoeNuk4.js} +5 -2
- package/dist/{control-item-slots-XV8Gjvf1.js → control-item-slots-Ddp7c8w8.js} +4 -1
- package/dist/elements-alert.js +1 -1
- package/dist/elements-badge.js +1 -1
- package/dist/elements-button.js +1 -1
- package/dist/elements-checkbox.js +1 -1
- package/dist/elements-chip.js +2 -0
- package/dist/elements-modal.js +1 -1
- package/dist/elements-radio.js +1 -1
- package/dist/elements-select.js +1 -1
- package/dist/elements-switch.js +1 -1
- package/dist/elements-tag.js +1 -1
- package/dist/elements-text-area.js +1 -1
- package/dist/elements-text-input.js +1 -1
- package/dist/elements.js +14 -13
- package/dist/index.js +13 -12
- package/dist/{modal-IEXNB8St.js → modal-BAvMVUIE.js} +2 -2
- package/dist/{modal-CHjaB_yR.js → modal-BnT5Kxjg.js} +1 -1
- package/dist/modal.js +1 -1
- package/dist/radio-CDq4r1_L.js +155 -0
- package/dist/radio-TaYThYkI.js +199 -0
- package/dist/radio.js +1 -1
- package/dist/{runtime-dom.esm-bundler-BeOO_l6v.js → runtime-dom.esm-bundler-DLryEdgJ.js} +1 -1
- package/dist/select-BWhJ-QB-.js +195 -0
- package/dist/select-BbeCpnsY.js +136 -0
- package/dist/select.js +1 -1
- package/dist/switch-BmxLKPbL.js +179 -0
- package/dist/switch-D5N-j5F7.js +140 -0
- package/dist/switch.js +1 -1
- package/dist/{tag-Un7w0uDf.js → tag--KKxqOf8.js} +17 -16
- package/dist/tag-D6j9yaoI.js +85 -0
- package/dist/tag.js +1 -1
- package/dist/text-area-Cmn22-fj.js +108 -0
- package/dist/text-area-Cr8RssdQ.js +165 -0
- package/dist/text-area.js +1 -1
- package/dist/text-input-DgFIuIOA.js +235 -0
- package/dist/text-input-i559HVOP.js +163 -0
- package/dist/text-input.js +1 -1
- package/dist/types/chip.d.ts +1 -0
- package/dist/types/components/alert/Alert.vue.d.ts +3 -3
- package/dist/types/components/badge/Badge.vue.d.ts +1 -1
- package/dist/types/components/button/Button.vue.d.ts +3 -1
- package/dist/types/components/button/button.types.d.ts +1 -0
- package/dist/types/components/checkbox/Checkbox.vue.d.ts +4 -15
- package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +9 -3
- package/dist/types/components/checkbox/checkbox.types.d.ts +16 -0
- package/dist/types/components/chip/Chip.vue.d.ts +38 -0
- package/dist/types/components/chip/VueChip.vue.d.ts +32 -0
- package/dist/types/components/chip/chip.context.d.ts +2 -0
- package/dist/types/components/chip/chip.types.d.ts +27 -0
- package/dist/types/components/modal/Modal.vue.d.ts +8 -8
- package/dist/types/components/radio/Radio.vue.d.ts +2 -17
- package/dist/types/components/radio/VueRadio.vue.d.ts +8 -6
- package/dist/types/components/radio/radio.types.d.ts +16 -0
- package/dist/types/components/select/Select.vue.d.ts +2 -19
- package/dist/types/components/select/VueSelect.vue.d.ts +9 -3
- package/dist/types/components/select/select.types.d.ts +24 -0
- package/dist/types/components/shared/control-item-slots.d.ts +1 -0
- package/dist/types/components/switch/Switch.vue.d.ts +2 -14
- package/dist/types/components/switch/VueSwitch.vue.d.ts +9 -3
- package/dist/types/components/switch/switch.types.d.ts +13 -0
- package/dist/types/components/tag/Tag.vue.d.ts +3 -1
- package/dist/types/components/tag/tag.types.d.ts +1 -0
- package/dist/types/components/text-area/TextArea.vue.d.ts +2 -16
- package/dist/types/components/text-area/VueTextArea.vue.d.ts +9 -3
- package/dist/types/components/text-area/text-area.types.d.ts +18 -0
- package/dist/types/components/text-input/TextInput.vue.d.ts +2 -19
- package/dist/types/components/text-input/VueTextInput.vue.d.ts +9 -3
- package/dist/types/components/text-input/text-input.types.d.ts +25 -0
- package/dist/types/elements/chip.d.ts +4 -0
- package/dist/types/elements/index.d.ts +2 -0
- package/dist/types/vue/checkbox.d.ts +1 -1
- package/dist/types/vue/chip.d.ts +2 -0
- package/dist/types/vue/index.d.ts +8 -6
- package/dist/types/vue/radio.d.ts +1 -1
- package/dist/types/vue/select.d.ts +1 -1
- package/dist/types/vue/switch.d.ts +1 -1
- package/dist/types/vue/text-area.d.ts +1 -1
- package/dist/types/vue/text-input.d.ts +1 -1
- package/dist/vue-alert.js +1 -1
- package/dist/vue-button.js +1 -1
- package/dist/vue-checkbox.js +1 -1
- package/dist/vue-chip.js +2 -0
- package/dist/vue-modal.js +1 -1
- package/dist/vue-radio.js +1 -1
- package/dist/vue-select.js +1 -1
- package/dist/vue-switch.js +1 -1
- package/dist/vue-tag.js +1 -1
- package/dist/vue-text-area.js +1 -1
- package/dist/vue-text-input.js +1 -1
- package/dist/vue.js +12 -11
- package/package.json +15 -2
- package/dist/checkbox-PAgQqiIw.js +0 -145
- package/dist/checkbox-g6cqR6wz.js +0 -170
- package/dist/radio-Cmrtred_.js +0 -147
- package/dist/radio-CqVqsZ7n.js +0 -175
- package/dist/select-Bpou1HIY.js +0 -167
- package/dist/select-CWjTpHGb.js +0 -126
- package/dist/switch-CFv0JUeq.js +0 -132
- package/dist/switch-DEYsTCw5.js +0 -157
- package/dist/tag-BdB0YDBJ.js +0 -84
- package/dist/text-area-DkjEGpHg.js +0 -99
- package/dist/text-area-DqBoz2_d.js +0 -139
- package/dist/text-input-DnWjB1vE.js +0 -207
- package/dist/text-input-DxzwRS2R.js +0 -157
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l } from "vue";
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, toDisplayString as u } from "vue";
|
|
2
2
|
//#region src/components/tag/Tag.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var d = {
|
|
4
|
+
role: "status",
|
|
5
|
+
class: "visually-hidden"
|
|
6
|
+
}, f = {
|
|
4
7
|
key: 1,
|
|
5
8
|
class: "tag-status-icon",
|
|
6
9
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
10
|
+
}, p = {
|
|
8
11
|
key: 2,
|
|
9
12
|
class: "tag-bullet",
|
|
10
13
|
"aria-hidden": "true"
|
|
11
|
-
},
|
|
14
|
+
}, m = /* @__PURE__ */ o({
|
|
12
15
|
__name: "Tag",
|
|
13
16
|
props: {
|
|
14
17
|
variant: { default: "neutral" },
|
|
@@ -32,25 +35,26 @@ var u = {
|
|
|
32
35
|
loading: {
|
|
33
36
|
type: Boolean,
|
|
34
37
|
default: !1
|
|
35
|
-
}
|
|
38
|
+
},
|
|
39
|
+
loadingText: { default: "Loading" }
|
|
36
40
|
},
|
|
37
41
|
setup(o) {
|
|
38
|
-
let
|
|
42
|
+
let m = t(() => o.variant.startsWith("categorical-")), h = t(() => [
|
|
39
43
|
"positive",
|
|
40
44
|
"info",
|
|
41
45
|
"warning",
|
|
42
46
|
"negative"
|
|
43
|
-
].includes(o.variant)),
|
|
47
|
+
].includes(o.variant)), g = t(() => [
|
|
44
48
|
"tag",
|
|
45
49
|
o.variant !== "neutral" && `tag-${o.variant}`,
|
|
46
50
|
{
|
|
47
|
-
"tag-muted": o.muted && !
|
|
51
|
+
"tag-muted": o.muted && !m.value,
|
|
48
52
|
"tag-small": o.size === "small",
|
|
49
53
|
disabled: o.disabled,
|
|
50
54
|
loading: o.loading
|
|
51
55
|
}
|
|
52
56
|
]);
|
|
53
|
-
return (t,
|
|
57
|
+
return (t, m) => (c(), r("span", { class: s(g.value) }, [o.loading ? (c(), r(e, { key: 0 }, [m[0] ||= i("svg", {
|
|
54
58
|
viewBox: "0 0 40 40",
|
|
55
59
|
class: "tag-loader",
|
|
56
60
|
"aria-hidden": "true"
|
|
@@ -59,12 +63,9 @@ var u = {
|
|
|
59
63
|
cx: "20",
|
|
60
64
|
cy: "20",
|
|
61
65
|
r: "15"
|
|
62
|
-
})], -1), f[1] ||=
|
|
63
|
-
role: "status",
|
|
64
|
-
class: "visually-hidden"
|
|
65
|
-
}, "Loading", -1)], 64)) : o.statusIcon && p.value ? (c(), r("span", u)) : o.bullet ? (c(), r("span", d)) : n("", !0), l(t.$slots, "default", {}, () => [f[2] ||= a("Tag", -1)])], 2));
|
|
66
|
+
})], -1), i("span", d, u(o.loadingText), 1)], 64)) : o.statusIcon && h.value ? (c(), r("span", f)) : o.bullet ? (c(), r("span", p)) : n("", !0), l(t.$slots, "default", {}, () => [m[1] ||= a("Tag", -1)])], 2));
|
|
66
67
|
}
|
|
67
|
-
}),
|
|
68
|
+
}), h = [
|
|
68
69
|
"neutral",
|
|
69
70
|
"accent",
|
|
70
71
|
"positive",
|
|
@@ -76,6 +77,6 @@ var u = {
|
|
|
76
77
|
"categorical-3",
|
|
77
78
|
"categorical-4",
|
|
78
79
|
"categorical-5"
|
|
79
|
-
],
|
|
80
|
+
], g = ["medium", "small"];
|
|
80
81
|
//#endregion
|
|
81
|
-
export {
|
|
82
|
+
export { h as n, m as r, g as t };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { N as e, a as t, c as n, d as r, g as i, i as a, j as o, l as s, o as c, t as l, u, v as d } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
|
|
2
|
+
//#region src/components/tag/Tag.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var f = {
|
|
4
|
+
role: "status",
|
|
5
|
+
class: "visually-hidden"
|
|
6
|
+
}, p = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "tag-status-icon",
|
|
9
|
+
"aria-hidden": "true"
|
|
10
|
+
}, m = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "tag-bullet",
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
}, h = /* @__PURE__ */ r({
|
|
15
|
+
__name: "Tag",
|
|
16
|
+
props: {
|
|
17
|
+
variant: { default: "neutral" },
|
|
18
|
+
statusIcon: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
size: { default: "medium" },
|
|
23
|
+
muted: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
bullet: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
disabled: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: !1
|
|
34
|
+
},
|
|
35
|
+
loading: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
loadingText: { default: "Loading" }
|
|
40
|
+
},
|
|
41
|
+
setup(r) {
|
|
42
|
+
let l = t(() => r.variant.startsWith("categorical-")), h = t(() => [
|
|
43
|
+
"positive",
|
|
44
|
+
"info",
|
|
45
|
+
"warning",
|
|
46
|
+
"negative"
|
|
47
|
+
].includes(r.variant)), g = t(() => [
|
|
48
|
+
"tag",
|
|
49
|
+
r.variant !== "neutral" && `tag-${r.variant}`,
|
|
50
|
+
{
|
|
51
|
+
"tag-muted": r.muted && !l.value,
|
|
52
|
+
"tag-small": r.size === "small",
|
|
53
|
+
disabled: r.disabled,
|
|
54
|
+
loading: r.loading
|
|
55
|
+
}
|
|
56
|
+
]);
|
|
57
|
+
return (t, l) => (i(), s("span", { class: o(g.value) }, [r.loading ? (i(), s(a, { key: 0 }, [l[0] ||= c("svg", {
|
|
58
|
+
viewBox: "0 0 40 40",
|
|
59
|
+
class: "tag-loader",
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
}, [c("circle", {
|
|
62
|
+
class: "tag-loader-inner",
|
|
63
|
+
cx: "20",
|
|
64
|
+
cy: "20",
|
|
65
|
+
r: "15"
|
|
66
|
+
})], -1), c("span", f, e(r.loadingText), 1)], 64)) : r.statusIcon && h.value ? (i(), s("span", p)) : r.bullet ? (i(), s("span", m)) : n("", !0), d(t.$slots, "default", {}, () => [l[1] ||= u("Tag", -1)])], 2));
|
|
67
|
+
}
|
|
68
|
+
}), g = [
|
|
69
|
+
"neutral",
|
|
70
|
+
"accent",
|
|
71
|
+
"positive",
|
|
72
|
+
"info",
|
|
73
|
+
"warning",
|
|
74
|
+
"negative",
|
|
75
|
+
"categorical-1",
|
|
76
|
+
"categorical-2",
|
|
77
|
+
"categorical-3",
|
|
78
|
+
"categorical-4",
|
|
79
|
+
"categorical-5"
|
|
80
|
+
], _ = ["medium", "small"], v = l(h, { shadowRoot: !1 });
|
|
81
|
+
function y() {
|
|
82
|
+
typeof customElements < "u" && (customElements.get("ouds-tag") || customElements.define("ouds-tag", v));
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { g as i, y as n, _ as r, v as t };
|
package/dist/tag.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./tag-
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./tag-D6j9yaoI.js";
|
|
2
2
|
export { r as OudsTag, t as defineOudsTag, n as tagSizes, e as tagVariants };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { A as e, M as t, N as n, S as r, a as i, b as a, c as o, d as s, g as c, j as l, k as u, l as d, o as f, p, t as m, u as h, v as g, x as _ } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
|
|
2
|
+
//#region src/components/text-area/TextArea.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var v = ["id", "for"], y = [
|
|
4
|
+
"id",
|
|
5
|
+
"placeholder",
|
|
6
|
+
"value",
|
|
7
|
+
"disabled",
|
|
8
|
+
"readonly",
|
|
9
|
+
"required",
|
|
10
|
+
"aria-describedby",
|
|
11
|
+
"aria-invalid"
|
|
12
|
+
], b = ["id"], x = ["id"], S = [
|
|
13
|
+
"id",
|
|
14
|
+
"href",
|
|
15
|
+
"aria-labelledby"
|
|
16
|
+
], C = { class: "visually-hidden" }, w = m(/* @__PURE__ */ s({
|
|
17
|
+
inheritAttrs: !1,
|
|
18
|
+
__name: "TextArea",
|
|
19
|
+
props: {
|
|
20
|
+
label: { default: "Text area" },
|
|
21
|
+
placeholder: { default: " " },
|
|
22
|
+
helperText: { default: "" },
|
|
23
|
+
errorText: { default: "" },
|
|
24
|
+
helperLink: { default: "" },
|
|
25
|
+
helperLinkHref: { default: "" },
|
|
26
|
+
helperLinkAria: { default: "on" },
|
|
27
|
+
value: { default: "" },
|
|
28
|
+
outlined: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
readonly: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
required: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
invalid: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
maxWidth: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(s) {
|
|
54
|
+
let m = a();
|
|
55
|
+
function w() {
|
|
56
|
+
let { class: e, style: t, ...n } = m;
|
|
57
|
+
return n;
|
|
58
|
+
}
|
|
59
|
+
let T = u(() => m.id), E = r(), D = _(), O = u(() => T.value || `ouds-text-area-${D}`), k = u(() => `${O.value}-helper`), A = u(() => `${O.value}-error`), j = u(() => `${O.value}-label`), M = u(() => `${O.value}-helper-link`);
|
|
60
|
+
function N() {
|
|
61
|
+
let e = [m["aria-describedby"]];
|
|
62
|
+
return (s.helperText || E["helper-text"]) && !s.invalid && e.push(k.value), s.invalid && (s.errorText || E["error-text"]) && e.push(A.value), s.helperLinkHref && (s.helperLink || E["helper-link"]) && e.push(M.value), e.filter(Boolean).join(" ") || void 0;
|
|
63
|
+
}
|
|
64
|
+
let P = i(() => ["text-area", { "component-max-width": s.maxWidth }]), F = i(() => ["text-area-container", { "text-area-container-outlined": s.outlined }]);
|
|
65
|
+
return (r, i) => (c(), d("div", {
|
|
66
|
+
class: l([P.value, e(m).class]),
|
|
67
|
+
style: t(e(m).style)
|
|
68
|
+
}, [
|
|
69
|
+
f("div", { class: l(F.value) }, [f("label", {
|
|
70
|
+
id: j.value,
|
|
71
|
+
for: O.value,
|
|
72
|
+
class: l({ "is-required": s.required })
|
|
73
|
+
}, [g(r.$slots, "label", {}, () => [h(n(s.label), 1)])], 10, v), f("textarea", p(w(), {
|
|
74
|
+
id: O.value,
|
|
75
|
+
class: "text-area-field",
|
|
76
|
+
placeholder: s.placeholder || " ",
|
|
77
|
+
value: s.value,
|
|
78
|
+
disabled: s.disabled,
|
|
79
|
+
readonly: s.readonly,
|
|
80
|
+
required: s.required,
|
|
81
|
+
"aria-describedby": N(),
|
|
82
|
+
"aria-invalid": s.invalid
|
|
83
|
+
}), null, 16, y)], 2),
|
|
84
|
+
(s.helperText || r.$slots["helper-text"]) && !s.invalid ? (c(), d("p", {
|
|
85
|
+
key: 0,
|
|
86
|
+
id: k.value,
|
|
87
|
+
class: "helper-text"
|
|
88
|
+
}, [g(r.$slots, "helper-text", {}, () => [h(n(s.helperText), 1)])], 8, b)) : o("", !0),
|
|
89
|
+
s.invalid && (s.errorText || r.$slots["error-text"]) ? (c(), d("p", {
|
|
90
|
+
key: 1,
|
|
91
|
+
id: A.value,
|
|
92
|
+
class: "error-text"
|
|
93
|
+
}, [g(r.$slots, "error-text", {}, () => [h(n(s.errorText), 1)])], 8, x)) : o("", !0),
|
|
94
|
+
s.helperLinkHref && (s.helperLink || r.$slots["helper-link"]) ? (c(), d("a", {
|
|
95
|
+
key: 2,
|
|
96
|
+
id: M.value,
|
|
97
|
+
href: s.helperLinkHref,
|
|
98
|
+
"aria-labelledby": `${M.value} ${j.value}`,
|
|
99
|
+
class: "link link-small"
|
|
100
|
+
}, [g(r.$slots, "helper-link", {}, () => [h(n(s.helperLink), 1)]), f("span", C, n(s.helperLinkAria), 1)], 8, S)) : o("", !0)
|
|
101
|
+
], 6));
|
|
102
|
+
}
|
|
103
|
+
}), { shadowRoot: !1 });
|
|
104
|
+
function T() {
|
|
105
|
+
typeof customElements < "u" && (customElements.get("ouds-text-area") || customElements.define("ouds-text-area", w));
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { T as n, w as t };
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createSlots as a, createTextVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderSlot as p, toDisplayString as m, toRef as h, unref as g, useAttrs as _, useId as v, useModel as y, useSlots as b, withCtx as x } from "vue";
|
|
2
|
+
//#region src/components/text-area/TextArea.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var S = ["id", "for"], C = [
|
|
4
|
+
"id",
|
|
5
|
+
"placeholder",
|
|
6
|
+
"value",
|
|
7
|
+
"disabled",
|
|
8
|
+
"readonly",
|
|
9
|
+
"required",
|
|
10
|
+
"aria-describedby",
|
|
11
|
+
"aria-invalid"
|
|
12
|
+
], w = ["id"], T = ["id"], E = [
|
|
13
|
+
"id",
|
|
14
|
+
"href",
|
|
15
|
+
"aria-labelledby"
|
|
16
|
+
], D = { class: "visually-hidden" }, O = /* @__PURE__ */ s({
|
|
17
|
+
inheritAttrs: !1,
|
|
18
|
+
__name: "TextArea",
|
|
19
|
+
props: {
|
|
20
|
+
label: { default: "Text area" },
|
|
21
|
+
placeholder: { default: " " },
|
|
22
|
+
helperText: { default: "" },
|
|
23
|
+
errorText: { default: "" },
|
|
24
|
+
helperLink: { default: "" },
|
|
25
|
+
helperLinkHref: { default: "" },
|
|
26
|
+
helperLinkAria: { default: "on" },
|
|
27
|
+
value: { default: "" },
|
|
28
|
+
outlined: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
disabled: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
readonly: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
required: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
invalid: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
maxWidth: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
setup(t) {
|
|
54
|
+
let a = _();
|
|
55
|
+
function s() {
|
|
56
|
+
let { class: e, style: t, ...n } = a;
|
|
57
|
+
return n;
|
|
58
|
+
}
|
|
59
|
+
let c = h(() => a.id), y = b(), x = v(), O = h(() => c.value || `ouds-text-area-${x}`), k = h(() => `${O.value}-helper`), A = h(() => `${O.value}-error`), j = h(() => `${O.value}-label`), M = h(() => `${O.value}-helper-link`);
|
|
60
|
+
function N() {
|
|
61
|
+
let e = [a["aria-describedby"]];
|
|
62
|
+
return (t.helperText || y["helper-text"]) && !t.invalid && e.push(k.value), t.invalid && (t.errorText || y["error-text"]) && e.push(A.value), t.helperLinkHref && (t.helperLink || y["helper-link"]) && e.push(M.value), e.filter(Boolean).join(" ") || void 0;
|
|
63
|
+
}
|
|
64
|
+
let P = e(() => ["text-area", { "component-max-width": t.maxWidth }]), F = e(() => ["text-area-container", { "text-area-container-outlined": t.outlined }]);
|
|
65
|
+
return (e, c) => (f(), r("div", {
|
|
66
|
+
class: u([P.value, g(a).class]),
|
|
67
|
+
style: d(g(a).style)
|
|
68
|
+
}, [
|
|
69
|
+
i("div", { class: u(F.value) }, [i("label", {
|
|
70
|
+
id: j.value,
|
|
71
|
+
for: O.value,
|
|
72
|
+
class: u({ "is-required": t.required })
|
|
73
|
+
}, [p(e.$slots, "label", {}, () => [o(m(t.label), 1)])], 10, S), i("textarea", l(s(), {
|
|
74
|
+
id: O.value,
|
|
75
|
+
class: "text-area-field",
|
|
76
|
+
placeholder: t.placeholder || " ",
|
|
77
|
+
value: t.value,
|
|
78
|
+
disabled: t.disabled,
|
|
79
|
+
readonly: t.readonly,
|
|
80
|
+
required: t.required,
|
|
81
|
+
"aria-describedby": N(),
|
|
82
|
+
"aria-invalid": t.invalid
|
|
83
|
+
}), null, 16, C)], 2),
|
|
84
|
+
(t.helperText || e.$slots["helper-text"]) && !t.invalid ? (f(), r("p", {
|
|
85
|
+
key: 0,
|
|
86
|
+
id: k.value,
|
|
87
|
+
class: "helper-text"
|
|
88
|
+
}, [p(e.$slots, "helper-text", {}, () => [o(m(t.helperText), 1)])], 8, w)) : n("", !0),
|
|
89
|
+
t.invalid && (t.errorText || e.$slots["error-text"]) ? (f(), r("p", {
|
|
90
|
+
key: 1,
|
|
91
|
+
id: A.value,
|
|
92
|
+
class: "error-text"
|
|
93
|
+
}, [p(e.$slots, "error-text", {}, () => [o(m(t.errorText), 1)])], 8, T)) : n("", !0),
|
|
94
|
+
t.helperLinkHref && (t.helperLink || e.$slots["helper-link"]) ? (f(), r("a", {
|
|
95
|
+
key: 2,
|
|
96
|
+
id: M.value,
|
|
97
|
+
href: t.helperLinkHref,
|
|
98
|
+
"aria-labelledby": `${M.value} ${j.value}`,
|
|
99
|
+
class: "link link-small"
|
|
100
|
+
}, [p(e.$slots, "helper-link", {}, () => [o(m(t.helperLink), 1)]), i("span", D, m(t.helperLinkAria), 1)], 8, E)) : n("", !0)
|
|
101
|
+
], 6));
|
|
102
|
+
}
|
|
103
|
+
}), k = /* @__PURE__ */ s({
|
|
104
|
+
inheritAttrs: !1,
|
|
105
|
+
__name: "VueTextArea",
|
|
106
|
+
props: /*@__PURE__*/ c({
|
|
107
|
+
label: {},
|
|
108
|
+
placeholder: {},
|
|
109
|
+
helperText: {},
|
|
110
|
+
errorText: {},
|
|
111
|
+
helperLink: {},
|
|
112
|
+
helperLinkHref: {},
|
|
113
|
+
helperLinkAria: {},
|
|
114
|
+
outlined: { type: Boolean },
|
|
115
|
+
disabled: { type: Boolean },
|
|
116
|
+
readonly: { type: Boolean },
|
|
117
|
+
required: { type: Boolean },
|
|
118
|
+
invalid: { type: Boolean },
|
|
119
|
+
maxWidth: { type: Boolean }
|
|
120
|
+
}, {
|
|
121
|
+
modelValue: { default: "" },
|
|
122
|
+
modelModifiers: {}
|
|
123
|
+
}),
|
|
124
|
+
emits: /*@__PURE__*/ c(["input", "change"], ["update:modelValue"]),
|
|
125
|
+
setup(e, { emit: n }) {
|
|
126
|
+
let r = e, i = y(e, "modelValue"), o = n;
|
|
127
|
+
function s(e) {
|
|
128
|
+
i.value = e.target.value, o("input", e);
|
|
129
|
+
}
|
|
130
|
+
function c(e) {
|
|
131
|
+
i.value = e.target.value, o("change", e);
|
|
132
|
+
}
|
|
133
|
+
return (e, n) => (f(), t(O, l({
|
|
134
|
+
...e.$attrs,
|
|
135
|
+
...r
|
|
136
|
+
}, {
|
|
137
|
+
value: i.value,
|
|
138
|
+
onInput: s,
|
|
139
|
+
onChange: c
|
|
140
|
+
}), a({ _: 2 }, [
|
|
141
|
+
e.$slots.label ? {
|
|
142
|
+
name: "label",
|
|
143
|
+
fn: x(() => [p(e.$slots, "label")]),
|
|
144
|
+
key: "0"
|
|
145
|
+
} : void 0,
|
|
146
|
+
e.$slots["helper-text"] ? {
|
|
147
|
+
name: "helper-text",
|
|
148
|
+
fn: x(() => [p(e.$slots, "helper-text")]),
|
|
149
|
+
key: "1"
|
|
150
|
+
} : void 0,
|
|
151
|
+
e.$slots["error-text"] ? {
|
|
152
|
+
name: "error-text",
|
|
153
|
+
fn: x(() => [p(e.$slots, "error-text")]),
|
|
154
|
+
key: "2"
|
|
155
|
+
} : void 0,
|
|
156
|
+
e.$slots["helper-link"] ? {
|
|
157
|
+
name: "helper-link",
|
|
158
|
+
fn: x(() => [p(e.$slots, "helper-link")]),
|
|
159
|
+
key: "3"
|
|
160
|
+
} : void 0
|
|
161
|
+
]), 1040, ["value"]));
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
//#endregion
|
|
165
|
+
export { k as t };
|
package/dist/text-area.js
CHANGED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, openBlock as h, renderSlot as g, toDisplayString as _, toRef as v, unref as y, useAttrs as b, useId as x, useModel as S, useSlots as C, withCtx as w } from "vue";
|
|
2
|
+
//#region src/components/text-input/TextInput.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var T = ["id", "for"], E = ["data-bs-prefix", "data-bs-suffix"], D = [
|
|
4
|
+
"id",
|
|
5
|
+
"type",
|
|
6
|
+
"placeholder",
|
|
7
|
+
"value",
|
|
8
|
+
"disabled",
|
|
9
|
+
"readonly",
|
|
10
|
+
"required",
|
|
11
|
+
"aria-describedby",
|
|
12
|
+
"aria-invalid"
|
|
13
|
+
], O = [
|
|
14
|
+
"id",
|
|
15
|
+
"type",
|
|
16
|
+
"placeholder",
|
|
17
|
+
"value",
|
|
18
|
+
"disabled",
|
|
19
|
+
"readonly",
|
|
20
|
+
"required",
|
|
21
|
+
"aria-describedby",
|
|
22
|
+
"aria-invalid"
|
|
23
|
+
], k = ["id"], A = ["id"], j = ["id"], M = [
|
|
24
|
+
"id",
|
|
25
|
+
"href",
|
|
26
|
+
"aria-labelledby"
|
|
27
|
+
], N = { class: "visually-hidden" }, P = /* @__PURE__ */ c({
|
|
28
|
+
inheritAttrs: !1,
|
|
29
|
+
__name: "TextInput",
|
|
30
|
+
props: {
|
|
31
|
+
prefix: { default: "" },
|
|
32
|
+
label: { default: "Text input" },
|
|
33
|
+
placeholder: { default: " " },
|
|
34
|
+
helperText: { default: "" },
|
|
35
|
+
errorText: { default: "" },
|
|
36
|
+
helperLink: { default: "" },
|
|
37
|
+
helperLinkHref: { default: "" },
|
|
38
|
+
helperLinkAria: { default: "on" },
|
|
39
|
+
suffix: { default: "" },
|
|
40
|
+
value: { default: "" },
|
|
41
|
+
type: { default: "text" },
|
|
42
|
+
outlined: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
readonly: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
required: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
invalid: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
maxWidth: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !1
|
|
65
|
+
},
|
|
66
|
+
loading: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
loadingText: { default: "Loading" }
|
|
71
|
+
},
|
|
72
|
+
setup(n) {
|
|
73
|
+
let o = b();
|
|
74
|
+
function c() {
|
|
75
|
+
let { class: e, style: t, ...n } = o;
|
|
76
|
+
return n;
|
|
77
|
+
}
|
|
78
|
+
let l = v(() => o.id), u = C(), p = x(), S = v(() => l.value || `ouds-text-input-${p}`), w = v(() => `${S.value}-helper`), P = v(() => `${S.value}-error`), F = v(() => `${S.value}-label`), I = v(() => `${S.value}-helper-link`), L = v(() => `${S.value}-loading`);
|
|
79
|
+
function R() {
|
|
80
|
+
let e = [o["aria-describedby"]];
|
|
81
|
+
return (n.helperText || u["helper-text"]) && !n.invalid && e.push(w.value), n.invalid && (n.errorText || u["error-text"]) && e.push(P.value), n.helperLinkHref && (n.helperLink || u["helper-link"]) && e.push(I.value), n.loading && e.push(L.value), e.filter(Boolean).join(" ") || void 0;
|
|
82
|
+
}
|
|
83
|
+
let z = t(() => ["text-input", { "component-max-width": n.maxWidth }]), B = t(() => ["text-input-container", { "text-input-container-outlined": n.outlined }]), V = t(() => ["text-input-field", { "loading-indeterminate": n.loading }]);
|
|
84
|
+
return (t, l) => (h(), i("div", {
|
|
85
|
+
class: f([z.value, y(o).class]),
|
|
86
|
+
style: m(y(o).style)
|
|
87
|
+
}, [
|
|
88
|
+
a("div", { class: f(B.value) }, [
|
|
89
|
+
g(t.$slots, "leading-icon"),
|
|
90
|
+
a("label", {
|
|
91
|
+
id: F.value,
|
|
92
|
+
for: S.value,
|
|
93
|
+
class: f({ "is-required": n.required })
|
|
94
|
+
}, [g(t.$slots, "label", {}, () => [s(_(n.label), 1)])], 10, T),
|
|
95
|
+
n.prefix || n.suffix ? (h(), i("div", {
|
|
96
|
+
key: 0,
|
|
97
|
+
class: "input-container",
|
|
98
|
+
"data-bs-prefix": n.prefix || void 0,
|
|
99
|
+
"data-bs-suffix": n.suffix || void 0
|
|
100
|
+
}, [a("input", d(c(), {
|
|
101
|
+
id: S.value,
|
|
102
|
+
type: n.type,
|
|
103
|
+
class: V.value,
|
|
104
|
+
placeholder: n.placeholder || " ",
|
|
105
|
+
value: n.value,
|
|
106
|
+
disabled: n.disabled,
|
|
107
|
+
readonly: n.readonly,
|
|
108
|
+
required: n.required,
|
|
109
|
+
"aria-describedby": R(),
|
|
110
|
+
"aria-invalid": n.invalid
|
|
111
|
+
}), null, 16, D)], 8, E)) : (h(), i("input", d({ key: 1 }, c(), {
|
|
112
|
+
id: S.value,
|
|
113
|
+
type: n.type,
|
|
114
|
+
class: V.value,
|
|
115
|
+
placeholder: n.placeholder || " ",
|
|
116
|
+
value: n.value,
|
|
117
|
+
disabled: n.disabled,
|
|
118
|
+
readonly: n.readonly,
|
|
119
|
+
required: n.required,
|
|
120
|
+
"aria-describedby": R(),
|
|
121
|
+
"aria-invalid": n.invalid
|
|
122
|
+
}), null, 16, O)),
|
|
123
|
+
n.loading ? (h(), i(e, { key: 2 }, [l[0] ||= a("svg", {
|
|
124
|
+
viewBox: "0 0 40 40",
|
|
125
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
126
|
+
class: "loader",
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}, [a("circle", {
|
|
129
|
+
class: "loader-inner",
|
|
130
|
+
cx: "20",
|
|
131
|
+
cy: "20",
|
|
132
|
+
r: "17"
|
|
133
|
+
})], -1), a("span", {
|
|
134
|
+
id: L.value,
|
|
135
|
+
role: "status",
|
|
136
|
+
class: "visually-hidden"
|
|
137
|
+
}, _(n.loadingText), 9, k)], 64)) : g(t.$slots, "trailing-action", { disabled: n.disabled || n.readonly }, void 0, void 0, 3)
|
|
138
|
+
], 2),
|
|
139
|
+
(n.helperText || t.$slots["helper-text"]) && !n.invalid ? (h(), i("p", {
|
|
140
|
+
key: 0,
|
|
141
|
+
id: w.value,
|
|
142
|
+
class: "helper-text"
|
|
143
|
+
}, [g(t.$slots, "helper-text", {}, () => [s(_(n.helperText), 1)])], 8, A)) : r("", !0),
|
|
144
|
+
n.invalid && (n.errorText || t.$slots["error-text"]) ? (h(), i("p", {
|
|
145
|
+
key: 1,
|
|
146
|
+
id: P.value,
|
|
147
|
+
class: "error-text"
|
|
148
|
+
}, [g(t.$slots, "error-text", {}, () => [s(_(n.errorText), 1)])], 8, j)) : r("", !0),
|
|
149
|
+
n.helperLinkHref && (n.helperLink || t.$slots["helper-link"]) ? (h(), i("a", {
|
|
150
|
+
key: 2,
|
|
151
|
+
id: I.value,
|
|
152
|
+
href: n.helperLinkHref,
|
|
153
|
+
"aria-labelledby": `${I.value} ${F.value}`,
|
|
154
|
+
class: "link link-small"
|
|
155
|
+
}, [g(t.$slots, "helper-link", {}, () => [s(_(n.helperLink), 1)]), a("span", N, _(n.helperLinkAria), 1)], 8, M)) : r("", !0)
|
|
156
|
+
], 6));
|
|
157
|
+
}
|
|
158
|
+
}), F = /* @__PURE__ */ c({
|
|
159
|
+
inheritAttrs: !1,
|
|
160
|
+
__name: "VueTextInput",
|
|
161
|
+
props: /*@__PURE__*/ u({
|
|
162
|
+
prefix: {},
|
|
163
|
+
label: {},
|
|
164
|
+
placeholder: {},
|
|
165
|
+
helperText: {},
|
|
166
|
+
errorText: {},
|
|
167
|
+
helperLink: {},
|
|
168
|
+
helperLinkHref: {},
|
|
169
|
+
helperLinkAria: {},
|
|
170
|
+
suffix: {},
|
|
171
|
+
type: {},
|
|
172
|
+
outlined: { type: Boolean },
|
|
173
|
+
disabled: { type: Boolean },
|
|
174
|
+
readonly: { type: Boolean },
|
|
175
|
+
required: { type: Boolean },
|
|
176
|
+
invalid: { type: Boolean },
|
|
177
|
+
maxWidth: { type: Boolean },
|
|
178
|
+
loading: { type: Boolean },
|
|
179
|
+
loadingText: {}
|
|
180
|
+
}, {
|
|
181
|
+
modelValue: { default: "" },
|
|
182
|
+
modelModifiers: {}
|
|
183
|
+
}),
|
|
184
|
+
emits: /*@__PURE__*/ u(["input", "change"], ["update:modelValue"]),
|
|
185
|
+
setup(e, { emit: t }) {
|
|
186
|
+
let r = e, i = S(e, "modelValue"), a = t;
|
|
187
|
+
function s(e) {
|
|
188
|
+
i.value = e.target.value, a("input", e);
|
|
189
|
+
}
|
|
190
|
+
function c(e) {
|
|
191
|
+
i.value = e.target.value, a("change", e);
|
|
192
|
+
}
|
|
193
|
+
return (e, t) => (h(), n(P, d({
|
|
194
|
+
...e.$attrs,
|
|
195
|
+
...r
|
|
196
|
+
}, {
|
|
197
|
+
value: i.value,
|
|
198
|
+
onInput: s,
|
|
199
|
+
onChange: c
|
|
200
|
+
}), o({ _: 2 }, [
|
|
201
|
+
e.$slots.label ? {
|
|
202
|
+
name: "label",
|
|
203
|
+
fn: w(() => [g(e.$slots, "label")]),
|
|
204
|
+
key: "0"
|
|
205
|
+
} : void 0,
|
|
206
|
+
e.$slots["leading-icon"] ? {
|
|
207
|
+
name: "leading-icon",
|
|
208
|
+
fn: w(() => [g(e.$slots, "leading-icon")]),
|
|
209
|
+
key: "1"
|
|
210
|
+
} : void 0,
|
|
211
|
+
e.$slots["trailing-action"] ? {
|
|
212
|
+
name: "trailing-action",
|
|
213
|
+
fn: w((t) => [g(e.$slots, "trailing-action", p(l(t)))]),
|
|
214
|
+
key: "2"
|
|
215
|
+
} : void 0,
|
|
216
|
+
e.$slots["helper-text"] ? {
|
|
217
|
+
name: "helper-text",
|
|
218
|
+
fn: w(() => [g(e.$slots, "helper-text")]),
|
|
219
|
+
key: "3"
|
|
220
|
+
} : void 0,
|
|
221
|
+
e.$slots["error-text"] ? {
|
|
222
|
+
name: "error-text",
|
|
223
|
+
fn: w(() => [g(e.$slots, "error-text")]),
|
|
224
|
+
key: "4"
|
|
225
|
+
} : void 0,
|
|
226
|
+
e.$slots["helper-link"] ? {
|
|
227
|
+
name: "helper-link",
|
|
228
|
+
fn: w(() => [g(e.$slots, "helper-link")]),
|
|
229
|
+
key: "5"
|
|
230
|
+
} : void 0
|
|
231
|
+
]), 1040, ["value"]));
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
//#endregion
|
|
235
|
+
export { F as t };
|