@ulu/frontend-vue 0.5.15 → 0.6.0
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/elements/UluButton.vue.d.ts +4 -0
- package/dist/components/elements/UluButton.vue.d.ts.map +1 -1
- package/dist/components/elements/UluButton.vue.js +31 -16
- package/dist/components/elements/UluIcon.vue.js +21 -36
- package/dist/components/forms/UluFormCheckbox.vue.d.ts +3 -19
- package/dist/components/forms/UluFormCheckbox.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormCheckbox.vue.js +10 -31
- package/dist/components/forms/UluFormFile.vue.d.ts +3 -25
- package/dist/components/forms/UluFormFile.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormFile.vue.js +11 -49
- package/dist/components/forms/UluFormItem.vue.d.ts +23 -8
- package/dist/components/forms/UluFormItem.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormItem.vue.js +126 -29
- package/dist/components/forms/UluFormLabel.vue.d.ts +24 -0
- package/dist/components/forms/UluFormLabel.vue.d.ts.map +1 -0
- package/dist/components/forms/UluFormLabel.vue.js +34 -0
- package/dist/components/forms/UluFormRadio.vue.d.ts +7 -25
- package/dist/components/forms/UluFormRadio.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormRadio.vue.js +11 -37
- package/dist/components/forms/UluFormSelect.vue.d.ts +7 -23
- package/dist/components/forms/UluFormSelect.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormSelect.vue.js +24 -43
- package/dist/components/forms/UluFormText.vue.d.ts +5 -23
- package/dist/components/forms/UluFormText.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormText.vue.js +10 -38
- package/dist/components/forms/UluFormTextarea.vue.d.ts +5 -23
- package/dist/components/forms/UluFormTextarea.vue.d.ts.map +1 -1
- package/dist/components/forms/UluFormTextarea.vue.js +10 -37
- package/dist/components/forms/UluSearchForm.vue.d.ts +24 -3
- package/dist/components/forms/UluSearchForm.vue.d.ts.map +1 -1
- package/dist/components/forms/UluSearchForm.vue.js +67 -22
- package/dist/components/index.d.ts +1 -0
- package/dist/components/systems/facets/UluFacetsFilterSelects.vue.d.ts.map +1 -1
- package/dist/components/systems/facets/UluFacetsFilterSelects.vue.js +21 -22
- package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/UluScrollAnchors.vue.js +18 -10
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts +8 -2
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue.js +92 -47
- package/dist/components/systems/scroll-anchors/useScrollAnchors.d.ts.map +1 -1
- package/dist/components/systems/scroll-anchors/useScrollAnchors.js +113 -70
- package/dist/components/utils/UluAction.vue.d.ts +2 -0
- package/dist/components/utils/UluAction.vue.d.ts.map +1 -1
- package/dist/components/utils/UluAction.vue.js +9 -5
- package/dist/components/visualizations/UluProgressBar.vue.d.ts +2 -2
- package/dist/index.js +130 -128
- package/dist/plugins/core/index.d.ts.map +1 -1
- package/dist/plugins/core/index.js +17 -16
- package/dist/utils/props.d.ts +7 -0
- package/dist/utils/props.d.ts.map +1 -1
- package/dist/utils/props.js +8 -2
- package/lib/components/elements/UluButton.vue +18 -3
- package/lib/components/elements/UluIcon.vue +8 -26
- package/lib/components/forms/UluForm.vue +25 -25
- package/lib/components/forms/UluFormCheckbox.vue +11 -25
- package/lib/components/forms/UluFormFieldset.vue +6 -6
- package/lib/components/forms/UluFormFile.vue +10 -40
- package/lib/components/forms/UluFormItem.vue +150 -39
- package/lib/components/forms/UluFormLabel.vue +30 -0
- package/lib/components/forms/UluFormRadio.vue +15 -34
- package/lib/components/forms/UluFormSelect.vue +19 -24
- package/lib/components/forms/UluFormText.vue +7 -25
- package/lib/components/forms/UluFormTextarea.vue +7 -25
- package/lib/components/forms/UluSearchForm.vue +67 -19
- package/lib/components/forms/UluSelectableMenu.vue +62 -62
- package/lib/components/index.js +1 -0
- package/lib/components/systems/facets/UluFacetsFilterSelects.vue +11 -14
- package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +9 -1
- package/lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue +95 -16
- package/lib/components/systems/scroll-anchors/_scroll-anchors-nav-animated.scss +12 -1
- package/lib/components/systems/scroll-anchors/useScrollAnchors.js +195 -54
- package/lib/components/utils/UluAction.vue +6 -2
- package/lib/plugins/core/index.js +2 -1
- package/lib/utils/props.js +14 -0
- package/package.json +3 -3
|
@@ -13,6 +13,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
13
13
|
outline: boolean;
|
|
14
14
|
transparent: boolean;
|
|
15
15
|
noMargin: boolean;
|
|
16
|
+
type?: string | undefined;
|
|
16
17
|
size?: string | undefined;
|
|
17
18
|
icon?: string | unknown[] | undefined;
|
|
18
19
|
modifiers?: string | unknown[] | undefined;
|
|
@@ -22,6 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
22
23
|
download?: string | boolean | undefined;
|
|
23
24
|
text?: string | undefined;
|
|
24
25
|
alt?: string | undefined;
|
|
26
|
+
ariaLabel?: string | undefined;
|
|
25
27
|
$props: {
|
|
26
28
|
readonly iconOnly?: boolean | undefined;
|
|
27
29
|
readonly iconBefore?: boolean | undefined;
|
|
@@ -32,6 +34,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
32
34
|
readonly outline?: boolean | undefined;
|
|
33
35
|
readonly transparent?: boolean | undefined;
|
|
34
36
|
readonly noMargin?: boolean | undefined;
|
|
37
|
+
readonly type?: string | undefined;
|
|
35
38
|
readonly size?: string | undefined;
|
|
36
39
|
readonly icon?: string | unknown[] | undefined;
|
|
37
40
|
readonly modifiers?: string | unknown[] | undefined;
|
|
@@ -41,6 +44,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
41
44
|
readonly download?: string | boolean | undefined;
|
|
42
45
|
readonly text?: string | undefined;
|
|
43
46
|
readonly alt?: string | undefined;
|
|
47
|
+
readonly ariaLabel?: string | undefined;
|
|
44
48
|
};
|
|
45
49
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
50
|
type __VLS_TemplateResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluButton.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluButton.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/elements/UluButton.vue"],"names":[],"mappings":"AAmCA;wBAyYqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2OAQG"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { computed as i, createBlock as a, openBlock as
|
|
1
|
+
import { computed as i, createBlock as a, openBlock as o, normalizeClass as d, unref as m, withCtx as f, renderSlot as l, createCommentVNode as r, createElementBlock as g, createTextVNode as y, toDisplayString as B } from "vue";
|
|
2
2
|
import b from "../utils/UluAction.vue.js";
|
|
3
3
|
import c from "./UluIcon.vue.js";
|
|
4
4
|
import { useModifiers as S } from "../../composables/useModifiers.js";
|
|
5
|
-
|
|
5
|
+
import { checkDeprecatedProps as h } from "../../utils/props.js";
|
|
6
|
+
const k = { key: 1 }, C = {
|
|
6
7
|
__name: "UluButton",
|
|
7
8
|
props: {
|
|
8
9
|
/**
|
|
@@ -35,9 +36,14 @@ const h = { key: 1 }, z = {
|
|
|
35
36
|
*/
|
|
36
37
|
download: [Boolean, String],
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* **Deprecated!** Use `ariaLabel` instead.
|
|
40
|
+
* @deprecated Use `ariaLabel` instead.
|
|
39
41
|
*/
|
|
40
42
|
alt: String,
|
|
43
|
+
/**
|
|
44
|
+
* For icon only buttons or buttons that need an explicit aria-label
|
|
45
|
+
*/
|
|
46
|
+
ariaLabel: String,
|
|
41
47
|
/**
|
|
42
48
|
* If not using slot this sets the buttons text via prop
|
|
43
49
|
*/
|
|
@@ -77,10 +83,18 @@ const h = { key: 1 }, z = {
|
|
|
77
83
|
/**
|
|
78
84
|
* Modifiers (to add any modifier classes based on base class [ie. 'tertiary'])
|
|
79
85
|
*/
|
|
80
|
-
modifiers: [String, Array]
|
|
86
|
+
modifiers: [String, Array],
|
|
87
|
+
/**
|
|
88
|
+
* Button type (e.g. 'submit', 'reset', 'button').
|
|
89
|
+
*/
|
|
90
|
+
type: String
|
|
81
91
|
},
|
|
82
92
|
setup(e) {
|
|
83
|
-
const n = e
|
|
93
|
+
const n = e;
|
|
94
|
+
h(n, ["alt"], (t) => {
|
|
95
|
+
console.warn(`[@ulu/frontend-vue] UluButton: The "${t}" prop is deprecated. Please use "ariaLabel" instead.`);
|
|
96
|
+
});
|
|
97
|
+
const { resolvedModifiers: s } = S({
|
|
84
98
|
props: n,
|
|
85
99
|
baseClass: "button",
|
|
86
100
|
internal: i(() => ({
|
|
@@ -94,14 +108,15 @@ const h = { key: 1 }, z = {
|
|
|
94
108
|
[n.size]: n.size
|
|
95
109
|
}))
|
|
96
110
|
}), u = i(() => {
|
|
97
|
-
const
|
|
98
|
-
return
|
|
111
|
+
const t = n.ariaLabel || n.alt || n.iconOnly && n.text;
|
|
112
|
+
return t || null;
|
|
99
113
|
});
|
|
100
|
-
return (
|
|
114
|
+
return (t, O) => (o(), a(b, {
|
|
101
115
|
to: e.to,
|
|
102
116
|
href: e.href,
|
|
103
117
|
target: e.target,
|
|
104
118
|
download: e.download,
|
|
119
|
+
type: e.type,
|
|
105
120
|
class: d(["button", [
|
|
106
121
|
{
|
|
107
122
|
"no-margin": e.noMargin
|
|
@@ -111,28 +126,28 @@ const h = { key: 1 }, z = {
|
|
|
111
126
|
"aria-label": u.value
|
|
112
127
|
}, {
|
|
113
128
|
default: f(() => [
|
|
114
|
-
l(
|
|
115
|
-
e.icon && (e.iconBefore || e.iconOnly) ? (
|
|
129
|
+
l(t.$slots, "before"),
|
|
130
|
+
e.icon && (e.iconBefore || e.iconOnly) ? (o(), a(c, {
|
|
116
131
|
key: 0,
|
|
117
132
|
icon: e.icon,
|
|
118
133
|
class: "button__icon"
|
|
119
134
|
}, null, 8, ["icon"])) : r("", !0),
|
|
120
|
-
(
|
|
121
|
-
l(
|
|
135
|
+
(t.$slots.default || e.text) && !e.iconOnly ? (o(), g("span", k, [
|
|
136
|
+
l(t.$slots, "default", {}, () => [
|
|
122
137
|
y(B(e.text), 1)
|
|
123
138
|
])
|
|
124
139
|
])) : r("", !0),
|
|
125
|
-
e.icon && !e.iconBefore && !e.iconOnly ? (
|
|
140
|
+
e.icon && !e.iconBefore && !e.iconOnly ? (o(), a(c, {
|
|
126
141
|
key: 2,
|
|
127
142
|
icon: e.icon,
|
|
128
143
|
class: "button__icon"
|
|
129
144
|
}, null, 8, ["icon"])) : r("", !0),
|
|
130
|
-
l(
|
|
145
|
+
l(t.$slots, "after")
|
|
131
146
|
]),
|
|
132
147
|
_: 3
|
|
133
|
-
}, 8, ["to", "href", "target", "download", "class", "aria-label"]));
|
|
148
|
+
}, 8, ["to", "href", "target", "download", "type", "class", "aria-label"]));
|
|
134
149
|
}
|
|
135
150
|
};
|
|
136
151
|
export {
|
|
137
|
-
|
|
152
|
+
C as default
|
|
138
153
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { useIcon as
|
|
3
|
-
const
|
|
1
|
+
import { inject as P, defineAsyncComponent as S, computed as e, createBlock as p, createElementBlock as _, createCommentVNode as h, openBlock as a, resolveDynamicComponent as m, mergeProps as v, normalizeClass as w } from "vue";
|
|
2
|
+
import { useIcon as B } from "../../composables/useIcon.js";
|
|
3
|
+
const b = {
|
|
4
4
|
__name: "UluIcon",
|
|
5
5
|
props: {
|
|
6
6
|
/**
|
|
7
7
|
* Icon definition can be string (fa classes), or array or object (any prop format FaIcon accepts)
|
|
8
|
-
* - This will override the 'type' prop if both are provided
|
|
9
8
|
*/
|
|
10
9
|
icon: [String, Array, Object, Boolean],
|
|
11
10
|
/**
|
|
@@ -13,43 +12,29 @@ const x = {
|
|
|
13
12
|
*/
|
|
14
13
|
spaced: Boolean
|
|
15
14
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const { icon:
|
|
21
|
-
if (typeof
|
|
15
|
+
setup(f) {
|
|
16
|
+
const t = P("uluCore"), { getIconProps: g, getClassesFromDefinition: C } = B(), y = S(
|
|
17
|
+
() => import("@fortawesome/vue-fontawesome").then((n) => n.FontAwesomeIcon)
|
|
18
|
+
), u = f, r = e(() => t.getSetting("fontAwesomeStatic")), c = e(() => t.getSetting("iconComponent")), I = e(() => t.getSetting("iconPropResolver")), o = e(() => {
|
|
19
|
+
const { icon: n } = u;
|
|
20
|
+
if (typeof n == "string" && n.startsWith("type:"))
|
|
22
21
|
try {
|
|
23
|
-
const
|
|
24
|
-
return
|
|
25
|
-
} catch (
|
|
26
|
-
return console.warn(
|
|
22
|
+
const s = n.substring(5);
|
|
23
|
+
return t.getIcon(s);
|
|
24
|
+
} catch (s) {
|
|
25
|
+
return console.warn(s), null;
|
|
27
26
|
}
|
|
28
|
-
return
|
|
29
|
-
}),
|
|
30
|
-
"flow-inline":
|
|
31
|
-
}));
|
|
32
|
-
return
|
|
33
|
-
if (!c.value && n.value) {
|
|
34
|
-
if (l.value === null)
|
|
35
|
-
if (a)
|
|
36
|
-
l.value = v(a.FontAwesomeIcon);
|
|
37
|
-
else {
|
|
38
|
-
const o = A(async () => {
|
|
39
|
-
const t = await import("@fortawesome/vue-fontawesome");
|
|
40
|
-
return a = t, t.FontAwesomeIcon;
|
|
41
|
-
});
|
|
42
|
-
l.value = v(o);
|
|
43
|
-
}
|
|
44
|
-
} else
|
|
45
|
-
l.value = null;
|
|
46
|
-
}), (o, t) => r.value ? (i(), p(f(r.value), g({ key: 0 }, w.value, { class: u.value }), null, 16, ["class"])) : !c.value && l.value && n.value ? (i(), p(f(l.value), g({ key: 1 }, k.value, { class: u.value }), null, 16, ["class"])) : c.value && n.value ? (i(), B("span", {
|
|
27
|
+
return n;
|
|
28
|
+
}), d = e(() => !c.value || !o.value ? null : I.value(o.value)), k = e(() => g(o.value)), A = e(() => C(o.value)), l = e(() => ({
|
|
29
|
+
"flow-inline": u.spaced
|
|
30
|
+
})), i = e(() => !r.value && o.value ? y : null);
|
|
31
|
+
return (n, s) => c.value ? (a(), p(m(c.value), v({ key: 0 }, d.value, { class: l.value }), null, 16, ["class"])) : !r.value && i.value ? (a(), p(m(i.value), v({ key: 1 }, k.value, { class: l.value }), null, 16, ["class"])) : r.value && o.value ? (a(), _("span", {
|
|
47
32
|
key: 2,
|
|
48
|
-
class:
|
|
33
|
+
class: w([A.value, l.value]),
|
|
49
34
|
"aria-hidden": "true"
|
|
50
|
-
}, null, 2)) :
|
|
35
|
+
}, null, 2)) : h("", !0);
|
|
51
36
|
}
|
|
52
37
|
};
|
|
53
38
|
export {
|
|
54
|
-
|
|
39
|
+
b as default
|
|
55
40
|
};
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
export default _default;
|
|
3
|
-
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
4
|
-
$slots: S;
|
|
5
|
-
});
|
|
6
|
-
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
7
2
|
$emit: (event: "update:modelValue", ...args: any[]) => void;
|
|
8
3
|
modelValue: boolean;
|
|
9
|
-
required: boolean;
|
|
10
|
-
label?: string | undefined;
|
|
11
4
|
$props: {
|
|
12
5
|
readonly modelValue?: boolean | undefined;
|
|
13
|
-
readonly required?: boolean | undefined;
|
|
14
|
-
readonly label?: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
-
type __VLS_TemplateResult = {
|
|
18
|
-
attrs: Partial<{}>;
|
|
19
|
-
slots: {
|
|
20
|
-
default?(_: {}): any;
|
|
21
6
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
7
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLInputElement>;
|
|
8
|
+
export default _default;
|
|
25
9
|
//# sourceMappingURL=UluFormCheckbox.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluFormCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormCheckbox.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluFormCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormCheckbox.vue"],"names":[],"mappings":"AAQA;"}
|
|
@@ -1,42 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import p from "./UluFormRequiredChar.vue.js";
|
|
4
|
-
const V = ["id", "checked", "required"], b = ["for"], x = {
|
|
1
|
+
import { inject as n, computed as r, createElementBlock as a, openBlock as d, mergeProps as m } from "vue";
|
|
2
|
+
const s = ["checked"], i = {
|
|
5
3
|
__name: "UluFormCheckbox",
|
|
6
4
|
props: {
|
|
7
|
-
/**
|
|
8
|
-
* The label for the checkbox.
|
|
9
|
-
*/
|
|
10
|
-
label: String,
|
|
11
5
|
/**
|
|
12
6
|
* The value of the checkbox (for v-model).
|
|
13
7
|
*/
|
|
14
|
-
modelValue: Boolean
|
|
15
|
-
/**
|
|
16
|
-
* If true, the field will be required.
|
|
17
|
-
*/
|
|
18
|
-
required: Boolean
|
|
8
|
+
modelValue: Boolean
|
|
19
9
|
},
|
|
20
10
|
emits: ["update:modelValue"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
checked: e.modelValue,
|
|
28
|
-
onChange: r[0] || (r[0] = (a) => o.$emit("update:modelValue", a.target.checked)),
|
|
29
|
-
required: e.required
|
|
30
|
-
}, null, 40, V),
|
|
31
|
-
d("label", { for: n(t) }, [
|
|
32
|
-
m(o.$slots, "default", {}, () => [
|
|
33
|
-
c(k(e.label), 1),
|
|
34
|
-
e.required ? (l(), s(p, { key: 0 })) : f("", !0)
|
|
35
|
-
])
|
|
36
|
-
], 8, b)
|
|
37
|
-
], 64));
|
|
11
|
+
setup(o) {
|
|
12
|
+
const e = n("uluFormFieldAttrs", null), l = r(() => e ? e.value : {});
|
|
13
|
+
return (u, t) => (d(), a("input", m({ type: "checkbox" }, l.value, {
|
|
14
|
+
checked: o.modelValue,
|
|
15
|
+
onChange: t[0] || (t[0] = (c) => u.$emit("update:modelValue", c.target.checked))
|
|
16
|
+
}), null, 16, s));
|
|
38
17
|
}
|
|
39
18
|
};
|
|
40
19
|
export {
|
|
41
|
-
|
|
20
|
+
i as default
|
|
42
21
|
};
|
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
declare const _default:
|
|
2
|
-
export default _default;
|
|
3
|
-
type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
4
|
-
$slots: S;
|
|
5
|
-
});
|
|
6
|
-
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
7
2
|
$emit: (event: "file-change", ...args: any[]) => void;
|
|
8
|
-
required: boolean;
|
|
9
|
-
label: string;
|
|
10
|
-
labelHidden: boolean;
|
|
11
|
-
noClasses: boolean;
|
|
12
3
|
multiple: boolean;
|
|
13
|
-
inputAttrs?: Record<string, any> | undefined;
|
|
14
4
|
$props: {
|
|
15
|
-
readonly required?: boolean | undefined;
|
|
16
|
-
readonly label?: string | undefined;
|
|
17
|
-
readonly labelHidden?: boolean | undefined;
|
|
18
|
-
readonly noClasses?: boolean | undefined;
|
|
19
5
|
readonly multiple?: boolean | undefined;
|
|
20
|
-
readonly inputAttrs?: Record<string, any> | undefined;
|
|
21
|
-
};
|
|
22
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
23
|
-
type __VLS_TemplateResult = {
|
|
24
|
-
attrs: Partial<{}>;
|
|
25
|
-
slots: {
|
|
26
|
-
label?(_: {}): any;
|
|
27
6
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
7
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLInputElement>;
|
|
8
|
+
export default _default;
|
|
31
9
|
//# sourceMappingURL=UluFormFile.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluFormFile.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormFile.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluFormFile.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormFile.vue"],"names":[],"mappings":"AAQA;"}
|
|
@@ -1,61 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import q from "./UluFormRequiredChar.vue.js";
|
|
4
|
-
const y = ["for"], C = ["multiple", "id", "required"], V = {
|
|
1
|
+
import { inject as s, computed as c, createElementBlock as u, openBlock as a, mergeProps as m } from "vue";
|
|
2
|
+
const p = ["multiple"], d = {
|
|
5
3
|
__name: "UluFormFile",
|
|
6
4
|
props: {
|
|
7
|
-
/**
|
|
8
|
-
* The label for the file input.
|
|
9
|
-
*/
|
|
10
|
-
label: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "Select File"
|
|
13
|
-
},
|
|
14
|
-
/**
|
|
15
|
-
* If true, the label will be visually hidden.
|
|
16
|
-
*/
|
|
17
|
-
labelHidden: Boolean,
|
|
18
|
-
/**
|
|
19
|
-
* If true, default classes will not be applied.
|
|
20
|
-
*/
|
|
21
|
-
noClasses: Boolean,
|
|
22
5
|
/**
|
|
23
6
|
* If true, allows multiple file selection.
|
|
24
7
|
*/
|
|
25
|
-
multiple: Boolean
|
|
26
|
-
/**
|
|
27
|
-
* Additional attributes to bind to the input element.
|
|
28
|
-
*/
|
|
29
|
-
inputAttrs: Object,
|
|
30
|
-
/**
|
|
31
|
-
* If true, the field will be required.
|
|
32
|
-
*/
|
|
33
|
-
required: Boolean
|
|
8
|
+
multiple: Boolean
|
|
34
9
|
},
|
|
35
10
|
emits: ["file-change"],
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
38
|
-
|
|
11
|
+
setup(l, { emit: n }) {
|
|
12
|
+
const o = n, t = s("uluFormFieldAttrs", null), i = c(() => t ? { ...t.value } : {}), r = (e) => {
|
|
13
|
+
o("file-change", e.target.files);
|
|
39
14
|
};
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
u(l.$slots, "label", {}, () => [
|
|
46
|
-
f(h(e.label), 1),
|
|
47
|
-
e.required ? (n(), g(q, { key: 0 })) : p("", !0)
|
|
48
|
-
])
|
|
49
|
-
], 10, y),
|
|
50
|
-
i("input", b({
|
|
51
|
-
type: "file",
|
|
52
|
-
onChange: m,
|
|
53
|
-
multiple: e.multiple,
|
|
54
|
-
id: o(t)
|
|
55
|
-
}, e.inputAttrs, { required: e.required }), null, 16, C)
|
|
56
|
-
], 64));
|
|
15
|
+
return (e, f) => (a(), u("input", m({ type: "file" }, i.value, {
|
|
16
|
+
multiple: l.multiple,
|
|
17
|
+
onChange: r
|
|
18
|
+
}), null, 16, p));
|
|
57
19
|
}
|
|
58
20
|
};
|
|
59
21
|
export {
|
|
60
|
-
|
|
22
|
+
d as default
|
|
61
23
|
};
|
|
@@ -4,27 +4,42 @@ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
|
|
|
4
4
|
$slots: S;
|
|
5
5
|
});
|
|
6
6
|
declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
7
|
-
|
|
8
|
-
select: boolean;
|
|
9
|
-
textarea: boolean;
|
|
10
|
-
file: boolean;
|
|
7
|
+
required: boolean;
|
|
11
8
|
warning: boolean;
|
|
12
9
|
error: boolean;
|
|
10
|
+
labelHidden: boolean;
|
|
13
11
|
alignTop: boolean;
|
|
12
|
+
modifiers?: string | unknown[] | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
label?: string | undefined;
|
|
15
|
+
layout?: string | undefined;
|
|
16
|
+
fieldId?: string | undefined;
|
|
17
|
+
errorMessage?: string | undefined;
|
|
18
|
+
warningMessage?: string | undefined;
|
|
14
19
|
$props: {
|
|
15
|
-
readonly
|
|
16
|
-
readonly select?: boolean | undefined;
|
|
17
|
-
readonly textarea?: boolean | undefined;
|
|
18
|
-
readonly file?: boolean | undefined;
|
|
20
|
+
readonly required?: boolean | undefined;
|
|
19
21
|
readonly warning?: boolean | undefined;
|
|
20
22
|
readonly error?: boolean | undefined;
|
|
23
|
+
readonly labelHidden?: boolean | undefined;
|
|
21
24
|
readonly alignTop?: boolean | undefined;
|
|
25
|
+
readonly modifiers?: string | unknown[] | undefined;
|
|
26
|
+
readonly description?: string | undefined;
|
|
27
|
+
readonly label?: string | undefined;
|
|
28
|
+
readonly layout?: string | undefined;
|
|
29
|
+
readonly fieldId?: string | undefined;
|
|
30
|
+
readonly errorMessage?: string | undefined;
|
|
31
|
+
readonly warningMessage?: string | undefined;
|
|
22
32
|
};
|
|
23
33
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
24
34
|
type __VLS_TemplateResult = {
|
|
25
35
|
attrs: Partial<{}>;
|
|
26
36
|
slots: {
|
|
37
|
+
label?(_: {}): any;
|
|
38
|
+
label?(_: {}): any;
|
|
27
39
|
default?(_: {}): any;
|
|
40
|
+
description?(_: {}): any;
|
|
41
|
+
errorMessage?(_: {}): any;
|
|
42
|
+
warningMessage?(_: {}): any;
|
|
28
43
|
};
|
|
29
44
|
refs: {};
|
|
30
45
|
rootEl: HTMLDivElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UluFormItem.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UluFormItem.vue.d.ts","sourceRoot":"","sources":["../../../lib/components/forms/UluFormItem.vue"],"names":[],"mappings":"AAuDA;wBAkbqB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;;6BAEtE,CAAC,EAAE,CAAC;;;AAXjC;;;;;;;;;;;;;;;;;;;;;;;;;;;sPAQG"}
|
|
@@ -1,52 +1,149 @@
|
|
|
1
|
-
import { createElementBlock as
|
|
2
|
-
|
|
1
|
+
import { useSlots as I, computed as i, provide as q, createElementBlock as H, openBlock as o, normalizeClass as p, unref as A, createBlock as d, createCommentVNode as u, renderSlot as t, withCtx as g, createTextVNode as c, toDisplayString as f } from "vue";
|
|
2
|
+
import { newId as C } from "../../utils/dom.js";
|
|
3
|
+
import { useModifiers as F } from "../../composables/useModifiers.js";
|
|
4
|
+
import m from "./UluFormMessage.vue.js";
|
|
5
|
+
import h from "./UluFormLabel.vue.js";
|
|
6
|
+
const j = {
|
|
3
7
|
__name: "UluFormItem",
|
|
4
8
|
props: {
|
|
5
9
|
/**
|
|
6
|
-
*
|
|
10
|
+
* The layout variant for this form item (e.g., 'text', 'select', 'textarea', 'checkbox', 'radio', 'file').
|
|
11
|
+
* This determines the layout and BEM styling of the item container.
|
|
7
12
|
*/
|
|
8
|
-
|
|
13
|
+
layout: String,
|
|
9
14
|
/**
|
|
10
|
-
* If
|
|
15
|
+
* The ID to use for the form field. If not provided, a unique ID is generated.
|
|
11
16
|
*/
|
|
12
|
-
|
|
17
|
+
fieldId: String,
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
19
|
+
* The label for the form field.
|
|
15
20
|
*/
|
|
16
|
-
|
|
21
|
+
label: String,
|
|
22
|
+
/**
|
|
23
|
+
* If true, the label will be visually hidden.
|
|
24
|
+
*/
|
|
25
|
+
labelHidden: Boolean,
|
|
26
|
+
/**
|
|
27
|
+
* The description text for the form field.
|
|
28
|
+
*/
|
|
29
|
+
description: String,
|
|
30
|
+
/**
|
|
31
|
+
* The error message text.
|
|
32
|
+
*/
|
|
33
|
+
errorMessage: String,
|
|
34
|
+
/**
|
|
35
|
+
* The warning message text.
|
|
36
|
+
*/
|
|
37
|
+
warningMessage: String,
|
|
17
38
|
/**
|
|
18
|
-
* If true,
|
|
39
|
+
* If true, the field will be marked as required.
|
|
19
40
|
*/
|
|
20
|
-
|
|
41
|
+
required: Boolean,
|
|
21
42
|
/**
|
|
22
|
-
* If true, applies the
|
|
43
|
+
* If true, applies the error state styles.
|
|
23
44
|
*/
|
|
24
|
-
|
|
45
|
+
error: Boolean,
|
|
25
46
|
/**
|
|
26
|
-
* If true, applies the
|
|
47
|
+
* If true, applies the warning state styles.
|
|
27
48
|
*/
|
|
28
|
-
|
|
49
|
+
warning: Boolean,
|
|
50
|
+
/**
|
|
51
|
+
* If true, aligns the item to the top.
|
|
52
|
+
*/
|
|
53
|
+
alignTop: Boolean,
|
|
29
54
|
/**
|
|
30
|
-
*
|
|
55
|
+
* Additional BEM modifiers for the form item.
|
|
31
56
|
*/
|
|
32
|
-
|
|
57
|
+
modifiers: [String, Array]
|
|
33
58
|
},
|
|
34
|
-
setup(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
setup(r) {
|
|
60
|
+
const e = r, s = I(), { resolvedModifiers: S } = F({
|
|
61
|
+
props: e,
|
|
62
|
+
baseClass: "form-theme__item",
|
|
63
|
+
internal: i(() => ({
|
|
64
|
+
[e.layout]: e.layout,
|
|
65
|
+
"align-top": e.alignTop
|
|
66
|
+
}))
|
|
67
|
+
}), l = i(() => e.fieldId || C()), v = i(() => `${l.value}-desc`), b = i(() => `${l.value}-error`), M = i(() => `${l.value}-warn`), w = i(() => !!e.label || !!s.label), $ = i(() => e.error || !!e.errorMessage || !!s.errorMessage), k = i(() => e.warning || !!e.warningMessage || !!s.warningMessage), y = i(() => ["checkbox", "radio"].includes(e.layout)), B = i(() => {
|
|
68
|
+
const a = {
|
|
69
|
+
id: l.value
|
|
70
|
+
}, n = [];
|
|
71
|
+
return (e.description || s.description) && n.push(v.value), (e.errorMessage || s.errorMessage) && n.push(b.value), (e.warningMessage || s.warningMessage) && n.push(M.value), n.length > 0 && (a["aria-describedby"] = n.join(" ")), $.value && (a["aria-invalid"] = "true"), a;
|
|
72
|
+
});
|
|
73
|
+
return q("uluFormFieldAttrs", B), (a, n) => (o(), H("div", {
|
|
74
|
+
class: p(["form-theme__item", [
|
|
75
|
+
A(S),
|
|
76
|
+
{
|
|
77
|
+
"is-danger": $.value,
|
|
78
|
+
"is-warning": k.value
|
|
79
|
+
}
|
|
80
|
+
]])
|
|
45
81
|
}, [
|
|
46
|
-
|
|
82
|
+
!y.value && w.value ? (o(), d(h, {
|
|
83
|
+
key: 0,
|
|
84
|
+
id: l.value,
|
|
85
|
+
labelHidden: r.labelHidden,
|
|
86
|
+
required: r.required
|
|
87
|
+
}, {
|
|
88
|
+
default: g(() => [
|
|
89
|
+
t(a.$slots, "label", {}, () => [
|
|
90
|
+
c(f(r.label), 1)
|
|
91
|
+
])
|
|
92
|
+
]),
|
|
93
|
+
_: 3
|
|
94
|
+
}, 8, ["id", "labelHidden", "required"])) : u("", !0),
|
|
95
|
+
t(a.$slots, "default"),
|
|
96
|
+
y.value && w.value ? (o(), d(h, {
|
|
97
|
+
key: 1,
|
|
98
|
+
id: l.value,
|
|
99
|
+
labelHidden: r.labelHidden,
|
|
100
|
+
required: r.required
|
|
101
|
+
}, {
|
|
102
|
+
default: g(() => [
|
|
103
|
+
t(a.$slots, "label", {}, () => [
|
|
104
|
+
c(f(r.label), 1)
|
|
105
|
+
])
|
|
106
|
+
]),
|
|
107
|
+
_: 3
|
|
108
|
+
}, 8, ["id", "labelHidden", "required"])) : u("", !0),
|
|
109
|
+
r.description || a.$slots.description ? (o(), d(m, {
|
|
110
|
+
key: 2,
|
|
111
|
+
id: v.value
|
|
112
|
+
}, {
|
|
113
|
+
default: g(() => [
|
|
114
|
+
t(a.$slots, "description", {}, () => [
|
|
115
|
+
c(f(r.description), 1)
|
|
116
|
+
])
|
|
117
|
+
]),
|
|
118
|
+
_: 3
|
|
119
|
+
}, 8, ["id"])) : u("", !0),
|
|
120
|
+
r.errorMessage || a.$slots.errorMessage ? (o(), d(m, {
|
|
121
|
+
key: 3,
|
|
122
|
+
id: b.value,
|
|
123
|
+
error: ""
|
|
124
|
+
}, {
|
|
125
|
+
default: g(() => [
|
|
126
|
+
t(a.$slots, "errorMessage", {}, () => [
|
|
127
|
+
c(f(r.errorMessage), 1)
|
|
128
|
+
])
|
|
129
|
+
]),
|
|
130
|
+
_: 3
|
|
131
|
+
}, 8, ["id"])) : u("", !0),
|
|
132
|
+
r.warningMessage || a.$slots.warningMessage ? (o(), d(m, {
|
|
133
|
+
key: 4,
|
|
134
|
+
id: M.value,
|
|
135
|
+
warning: ""
|
|
136
|
+
}, {
|
|
137
|
+
default: g(() => [
|
|
138
|
+
t(a.$slots, "warningMessage", {}, () => [
|
|
139
|
+
c(f(r.warningMessage), 1)
|
|
140
|
+
])
|
|
141
|
+
]),
|
|
142
|
+
_: 3
|
|
143
|
+
}, 8, ["id"])) : u("", !0)
|
|
47
144
|
], 2));
|
|
48
145
|
}
|
|
49
146
|
};
|
|
50
147
|
export {
|
|
51
|
-
|
|
148
|
+
j as default
|
|
52
149
|
};
|