@codeandfunction/callaloo 3.23.0 → 4.1.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/assets/shared/form-utilities.css +1 -1
- package/dist/chunks/{CLButton.vue_vue_type_style_index_0_lang-kYdsi6-T.js → CLButton.vue_vue_type_style_index_0_lang-B-XC2_j4.js} +46 -44
- package/dist/chunks/{CLCard.vue_vue_type_style_index_0_lang-C8dDRXYZ.js → CLCard.vue_vue_type_style_index_0_lang-DZ-2FEcq.js} +1 -1
- package/dist/chunks/{CLIcon.vue_vue_type_style_index_0_lang-CduBjI1N.js → CLIcon.vue_vue_type_style_index_0_lang-CMjcMLcy.js} +1 -1
- package/dist/chunks/{CLLink.vue_vue_type_style_index_0_lang-BDgJvHNE.js → CLLink.vue_vue_type_style_index_0_lang-sXIdl0uH.js} +1 -1
- package/dist/chunks/{CLNavLink.vue_vue_type_script_setup_true_lang-CMUfxGA3.js → CLNavLink.vue_vue_type_script_setup_true_lang-FMOMJjMR.js} +1 -1
- package/dist/chunks/{CLPill.vue_vue_type_style_index_0_lang-BPOoZ5_q.js → CLPill.vue_vue_type_style_index_0_lang-BbXWiTde.js} +27 -24
- package/dist/chunks/{CLToast.vue_vue_type_style_index_0_lang-BH6Tnr-h.js → CLToast.vue_vue_type_style_index_0_lang-BL61sRYd.js} +61 -59
- package/dist/chunks/helper-oZuRnF9g.js +81 -0
- package/dist/components/Buttons/CLButton/CLButton.css +1 -1
- package/dist/components/Buttons/CLButton/CLButton.js +1 -1
- package/dist/components/Buttons/CLButton/CLButton.vue.d.ts +4 -4
- package/dist/components/CLIcon/CLIcon.js +1 -1
- package/dist/components/Containers/CLCard/CLCard.js +1 -1
- package/dist/components/Containers/CLCarousel/CLCarousel.js +2 -2
- package/dist/components/Containers/CLDisclosure/CLDisclosure.js +14 -15
- package/dist/components/Containers/CLDisclosure/CLDisclosure.vue.d.ts +3 -5
- package/dist/components/Form/CLCheckbox/CLCheckbox.js +1 -1
- package/dist/components/Form/CLInput/CLInput.js +228 -176
- package/dist/components/Form/CLInput/CLInput.vue.d.ts +12 -0
- package/dist/components/Form/CLInput/CLInputPrefix.vue.d.ts +13 -4
- package/dist/components/Form/CLInput/CLInputSuffix.vue.d.ts +13 -4
- package/dist/components/Form/CLSelect/CLSelect.js +1 -1
- package/dist/components/Indicators/CLBanner/CLBanner.js +1 -1
- package/dist/components/Indicators/CLPill/CLPill.js +1 -1
- package/dist/components/Indicators/CLPill/CLPill.vue.d.ts +3 -0
- package/dist/components/Modals/CLModal/CLModal.js +2 -2
- package/dist/components/Navigation/CLLink/CLLink.js +1 -1
- package/dist/components/Navigation/CLNavLink/CLNavLink.js +1 -1
- package/dist/components/Navigation/CLNavSection/CLNavSection.js +1 -1
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.js +149 -151
- package/dist/components/Popups/CLDropdownMenu/CLDropdownMenu.vue.d.ts +5 -8
- package/dist/components/Popups/CLToast/CLToast.js +1 -1
- package/dist/components/Popups/CLToast/CLToast.vue.d.ts +1 -0
- package/dist/components/Providers/CLThemeProvider/CLThemeProvider.js +1 -1
- package/dist/components/Providers/CLToastProvider/CLToastProvider.js +1 -1
- package/dist/composables/useDropdown.js +1 -1
- package/dist/composables/useEsc.js +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/utils/helper.d.ts +4 -1
- package/package.json +1 -1
- package/dist/chunks/helper-BYpahJAh.js +0 -63
|
@@ -1,184 +1,226 @@
|
|
|
1
1
|
import '../../../assets/core.css';
|
|
2
2
|
import './CLInput.css';
|
|
3
3
|
import '../../../assets/shared/form-utilities.css';
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
import { _ as te, i as
|
|
4
|
+
import { defineComponent as S, computed as k, createBlock as x, createElementBlock as h, unref as i, openBlock as r, normalizeClass as y, Fragment as q, createTextVNode as X, toDisplayString as w, createVNode as K, ref as A, watch as P, createCommentVNode as v, mergeModels as M, useTemplateRef as Q, useModel as W, withCtx as Y, createElementVNode as F, normalizeStyle as Z, withDirectives as _, vModelDynamic as ee, isRef as le } from "vue";
|
|
5
|
+
import { _ as te, i as ie, a as ae } from "../../../chunks/CLInputMessages.vue_vue_type_style_index_0_lang-CF_lxNr8.js";
|
|
6
6
|
import { _ as oe } from "../../../chunks/CLFormLabel.vue_vue_type_script_setup_true_lang-DYYs8W4N.js";
|
|
7
7
|
import { _ as ne } from "../../../chunks/CLFormCharCounter.vue_vue_type_style_index_0_lang-CJ4VrvmR.js";
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { _ as
|
|
12
|
-
const de = ["data-testid"],
|
|
8
|
+
import { _ as E } from "../../../chunks/CLIcon.vue_vue_type_style_index_0_lang-CMjcMLcy.js";
|
|
9
|
+
import { _ as V } from "../../../chunks/CLButton.vue_vue_type_style_index_0_lang-B-XC2_j4.js";
|
|
10
|
+
import { CLSizes as d, CLColors as p, CLBorderRadius as B, CLIconSizes as f, CLColorVariants as I, CLIconNames as L, CLInputTypes as n, CLOrientation as N, CLCharCounterLayout as ue } from "../../../index.js";
|
|
11
|
+
import { _ as re } from "../../../chunks/CLPill.vue_vue_type_style_index_0_lang-BbXWiTde.js";
|
|
12
|
+
const de = ["data-testid"], H = /* @__PURE__ */ S({
|
|
13
13
|
name: "CLInputPrefix",
|
|
14
14
|
__name: "CLInputPrefix",
|
|
15
15
|
props: {
|
|
16
|
-
|
|
16
|
+
ariaLabel: { default: void 0 },
|
|
17
|
+
borderRadius: { default: B.XS },
|
|
18
|
+
color: { default: p.Neutral },
|
|
17
19
|
grouped: { type: Boolean, default: !1 },
|
|
20
|
+
onClick: { type: Function, default: void 0 },
|
|
18
21
|
prefix: {},
|
|
19
|
-
size: { default:
|
|
22
|
+
size: { default: d.Small },
|
|
20
23
|
testId: { default: "clll-input-prefix" }
|
|
21
24
|
},
|
|
22
25
|
setup(e) {
|
|
23
|
-
const
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
},
|
|
30
|
-
`${
|
|
26
|
+
const a = e, s = "clll-input", l = (o) => Object.values(L).includes(o), C = (o) => o, t = (o) => o?.replace("rounded-", "") || "xs", b = {
|
|
27
|
+
[d.Tiny]: f.Tiny,
|
|
28
|
+
[d.Small]: f.Small,
|
|
29
|
+
[d.Medium]: f.Medium,
|
|
30
|
+
[d.Large]: f.Large,
|
|
31
|
+
[d.XL]: f.XL
|
|
32
|
+
}, g = k(() => !!a.onClick && l(a.prefix)), u = k(() => [
|
|
33
|
+
`${s}__input-prefix`,
|
|
31
34
|
"form-addon-flex",
|
|
32
35
|
"form-addon-flex--left",
|
|
33
|
-
l(
|
|
34
|
-
{ "--
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
l(a.prefix) ? `${s}__input-prefix--icon form-addon-flex--icon` : `${s}__input-prefix--string form-addon-flex--string`,
|
|
37
|
+
{ "--interactive": g },
|
|
38
|
+
{ "--input-group": a.grouped || a.prefix },
|
|
39
|
+
a.grouped ? `form-addon-radius--left-${t(a.borderRadius)}` : ""
|
|
40
|
+
]), $ = (o) => {
|
|
41
|
+
a.onClick && o && (o.stopPropagation(), a.onClick(o));
|
|
42
|
+
};
|
|
43
|
+
return (o, R) => i(g) ? (r(), x(i(V), {
|
|
44
|
+
key: 0,
|
|
45
|
+
"aria-label": e.ariaLabel,
|
|
46
|
+
"border-radius": i(B).None,
|
|
47
|
+
class: y(i(u)),
|
|
48
|
+
color: e.color,
|
|
49
|
+
"icon-before": C(e.prefix),
|
|
50
|
+
"icon-size": b[e.size],
|
|
51
|
+
"on-click": $,
|
|
52
|
+
size: e.size,
|
|
53
|
+
"test-id": e.testId,
|
|
54
|
+
variant: i(I).Ghost,
|
|
55
|
+
wrap: ""
|
|
56
|
+
}, null, 8, ["aria-label", "border-radius", "class", "color", "icon-before", "icon-size", "size", "test-id", "variant"])) : (r(), h("span", {
|
|
57
|
+
key: 1,
|
|
58
|
+
class: y(i(u)),
|
|
39
59
|
"data-testid": e.testId
|
|
40
60
|
}, [
|
|
41
|
-
l(e.prefix) ? (
|
|
61
|
+
l(e.prefix) ? (r(), x(i(E), {
|
|
42
62
|
key: 0,
|
|
43
|
-
name:
|
|
44
|
-
size:
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
name: C(e.prefix),
|
|
64
|
+
size: b[e.size],
|
|
65
|
+
color: e.color
|
|
66
|
+
}, null, 8, ["name", "size", "color"])) : (r(), h(q, { key: 1 }, [
|
|
67
|
+
X(w(e.prefix), 1)
|
|
47
68
|
], 64))
|
|
48
69
|
], 10, de));
|
|
49
70
|
}
|
|
50
|
-
}),
|
|
71
|
+
}), se = ["data-testid"], O = /* @__PURE__ */ S({
|
|
51
72
|
name: "CLInputSuffix",
|
|
52
73
|
__name: "CLInputSuffix",
|
|
53
74
|
props: {
|
|
54
|
-
|
|
75
|
+
ariaLabel: { default: void 0 },
|
|
76
|
+
borderRadius: { default: B.XS },
|
|
77
|
+
color: { default: p.Neutral },
|
|
55
78
|
grouped: { type: Boolean, default: !1 },
|
|
79
|
+
onClick: { type: Function, default: void 0 },
|
|
56
80
|
suffix: {},
|
|
57
|
-
size: { default:
|
|
81
|
+
size: { default: d.Small },
|
|
58
82
|
testId: { default: "clll-input-suffix" }
|
|
59
83
|
},
|
|
60
84
|
setup(e) {
|
|
61
|
-
const
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
},
|
|
68
|
-
`${
|
|
85
|
+
const a = e, s = "clll-input", l = (o) => Object.values(L).includes(o), C = (o) => o, t = (o) => o?.replace("rounded-", "") || "xs", b = {
|
|
86
|
+
[d.Tiny]: f.Tiny,
|
|
87
|
+
[d.Small]: f.Small,
|
|
88
|
+
[d.Medium]: f.Medium,
|
|
89
|
+
[d.Large]: f.Large,
|
|
90
|
+
[d.XL]: f.XL
|
|
91
|
+
}, g = k(() => !!a.onClick && l(a.suffix)), u = k(() => [
|
|
92
|
+
`${s}__input-suffix`,
|
|
69
93
|
"form-addon-flex",
|
|
70
94
|
"form-addon-flex--right",
|
|
71
|
-
l(
|
|
72
|
-
{ "--
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
95
|
+
l(a.suffix) ? `${s}__input-suffix--icon form-addon-flex--icon` : `${s}__input-suffix--string form-addon-flex--string`,
|
|
96
|
+
{ "--interactive": g },
|
|
97
|
+
{ "--input-group": a.grouped || a.suffix },
|
|
98
|
+
a.grouped ? `form-addon-radius--right-${t(a.borderRadius)}` : ""
|
|
99
|
+
]), $ = (o) => {
|
|
100
|
+
a.onClick && o && (o.stopPropagation(), a.onClick(o));
|
|
101
|
+
};
|
|
102
|
+
return (o, R) => i(g) ? (r(), x(i(V), {
|
|
103
|
+
key: 0,
|
|
104
|
+
"aria-label": e.ariaLabel,
|
|
105
|
+
"border-radius": i(B).None,
|
|
106
|
+
class: y(i(u)),
|
|
107
|
+
color: e.color,
|
|
108
|
+
"icon-before": C(e.suffix),
|
|
109
|
+
"icon-size": b[e.size],
|
|
110
|
+
"on-click": $,
|
|
111
|
+
size: e.size,
|
|
112
|
+
"test-id": e.testId,
|
|
113
|
+
variant: i(I).Ghost,
|
|
114
|
+
wrap: ""
|
|
115
|
+
}, null, 8, ["aria-label", "border-radius", "class", "color", "icon-before", "icon-size", "size", "test-id", "variant"])) : (r(), h("span", {
|
|
116
|
+
key: 1,
|
|
117
|
+
class: y(i(u)),
|
|
77
118
|
"data-testid": e.testId
|
|
78
119
|
}, [
|
|
79
|
-
l(e.suffix) ? (
|
|
120
|
+
l(e.suffix) ? (r(), x(i(E), {
|
|
80
121
|
key: 0,
|
|
81
|
-
name:
|
|
82
|
-
size:
|
|
83
|
-
|
|
84
|
-
|
|
122
|
+
name: C(e.suffix),
|
|
123
|
+
size: b[e.size],
|
|
124
|
+
color: e.color
|
|
125
|
+
}, null, 8, ["name", "size", "color"])) : (r(), h(q, { key: 1 }, [
|
|
126
|
+
X(w(e.suffix), 1)
|
|
85
127
|
], 64))
|
|
86
|
-
], 10,
|
|
128
|
+
], 10, se));
|
|
87
129
|
}
|
|
88
|
-
}), ce = ["data-testid"], U = /* @__PURE__ */
|
|
130
|
+
}), ce = ["data-testid"], U = /* @__PURE__ */ S({
|
|
89
131
|
name: "CLInputPill",
|
|
90
132
|
__name: "CLInputPill",
|
|
91
133
|
props: {
|
|
92
|
-
color: { default:
|
|
134
|
+
color: { default: p.Neutral },
|
|
93
135
|
label: {},
|
|
94
136
|
testId: { default: "clll-input-pill" }
|
|
95
137
|
},
|
|
96
138
|
setup(e) {
|
|
97
|
-
const
|
|
98
|
-
return (
|
|
99
|
-
class:
|
|
139
|
+
const a = "clll-input";
|
|
140
|
+
return (s, l) => (r(), h("span", {
|
|
141
|
+
class: y(`${a}__pill`),
|
|
100
142
|
"data-testid": e.testId
|
|
101
143
|
}, [
|
|
102
|
-
K(
|
|
144
|
+
K(i(re), {
|
|
103
145
|
color: e.color,
|
|
104
146
|
label: e.label,
|
|
105
|
-
variant:
|
|
147
|
+
variant: i(I).Soft
|
|
106
148
|
}, null, 8, ["color", "label", "variant"])
|
|
107
149
|
], 10, ce));
|
|
108
150
|
}
|
|
109
|
-
}), fe = ["data-testid"],
|
|
151
|
+
}), fe = ["data-testid"], G = /* @__PURE__ */ S({
|
|
110
152
|
name: "CLInputColorTools",
|
|
111
153
|
__name: "CLInputColorTools",
|
|
112
154
|
props: {
|
|
113
155
|
copied: { type: Boolean, default: !1 },
|
|
114
156
|
initialValue: { default: void 0 },
|
|
115
157
|
modelValue: { default: void 0 },
|
|
116
|
-
size: { default:
|
|
158
|
+
size: { default: d.Small },
|
|
117
159
|
testId: { default: "clll-input-color-tools" }
|
|
118
160
|
},
|
|
119
161
|
emits: ["copy", "reset", "update:copied"],
|
|
120
|
-
setup(e, { emit:
|
|
121
|
-
const
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
[
|
|
126
|
-
[
|
|
127
|
-
},
|
|
162
|
+
setup(e, { emit: a }) {
|
|
163
|
+
const s = e, l = a, C = "clll-input", t = A(s.copied), b = {
|
|
164
|
+
[d.Tiny]: f.Tiny,
|
|
165
|
+
[d.Small]: f.Small,
|
|
166
|
+
[d.Medium]: f.Medium,
|
|
167
|
+
[d.Large]: f.Large,
|
|
168
|
+
[d.XL]: f.XL
|
|
169
|
+
}, g = async () => {
|
|
128
170
|
try {
|
|
129
|
-
|
|
130
|
-
} catch (
|
|
131
|
-
console.error(
|
|
171
|
+
s.modelValue && (await navigator.clipboard.writeText(s.modelValue.toString()), t.value = !0, l("update:copied", !0), l("copy"));
|
|
172
|
+
} catch ($) {
|
|
173
|
+
console.error($);
|
|
132
174
|
}
|
|
133
|
-
},
|
|
134
|
-
l("reset",
|
|
175
|
+
}, u = () => {
|
|
176
|
+
l("reset", s.initialValue);
|
|
135
177
|
};
|
|
136
|
-
return
|
|
137
|
-
t.value =
|
|
138
|
-
}),
|
|
178
|
+
return P(() => s.copied, ($) => {
|
|
179
|
+
t.value = $;
|
|
180
|
+
}), P(() => s.modelValue, () => {
|
|
139
181
|
t.value = !1, l("update:copied", !1);
|
|
140
|
-
}), (
|
|
141
|
-
class:
|
|
182
|
+
}), ($, o) => (r(), h("span", {
|
|
183
|
+
class: y(`${C}__selected-color-tools`),
|
|
142
184
|
"data-testid": e.testId
|
|
143
185
|
}, [
|
|
144
|
-
e.modelValue ? (
|
|
186
|
+
e.modelValue ? (r(), x(i(V), {
|
|
145
187
|
key: 0,
|
|
146
188
|
"aria-label": "Copy color to clipboard",
|
|
147
|
-
class:
|
|
148
|
-
color:
|
|
149
|
-
"icon-before":
|
|
150
|
-
"icon-size":
|
|
151
|
-
"on-click":
|
|
189
|
+
class: y(`${C}__copy-to-clipboard`),
|
|
190
|
+
color: i(p).Neutral,
|
|
191
|
+
"icon-before": i(t) ? i(L).Check : i(L).Copy,
|
|
192
|
+
"icon-size": b[e.size],
|
|
193
|
+
"on-click": g,
|
|
152
194
|
size: e.size,
|
|
153
|
-
title:
|
|
154
|
-
variant:
|
|
195
|
+
title: i(t) ? "Color copied to clipboard" : "Copy color to clipboard",
|
|
196
|
+
variant: i(I).Ghost,
|
|
155
197
|
wrap: ""
|
|
156
|
-
}, null, 8, ["class", "color", "icon-before", "icon-size", "size", "title", "variant"])) :
|
|
157
|
-
e.modelValue ? (
|
|
198
|
+
}, null, 8, ["class", "color", "icon-before", "icon-size", "size", "title", "variant"])) : v("", !0),
|
|
199
|
+
e.modelValue ? (r(), x(i(V), {
|
|
158
200
|
key: 1,
|
|
159
201
|
"aria-label": "Reset selected color",
|
|
160
|
-
class:
|
|
161
|
-
color:
|
|
162
|
-
"on-click":
|
|
163
|
-
"icon-before":
|
|
164
|
-
"icon-size":
|
|
202
|
+
class: y(`${C}__reset-selected-color`),
|
|
203
|
+
color: i(p).Neutral,
|
|
204
|
+
"on-click": u,
|
|
205
|
+
"icon-before": i(L).Restore,
|
|
206
|
+
"icon-size": b[e.size],
|
|
165
207
|
size: e.size,
|
|
166
208
|
title: "Reset selected color",
|
|
167
|
-
variant:
|
|
209
|
+
variant: i(I).Ghost,
|
|
168
210
|
wrap: ""
|
|
169
|
-
}, null, 8, ["class", "color", "icon-before", "icon-size", "size", "variant"])) :
|
|
211
|
+
}, null, 8, ["class", "color", "icon-before", "icon-size", "size", "variant"])) : v("", !0)
|
|
170
212
|
], 10, fe));
|
|
171
213
|
}
|
|
172
|
-
}), me = ["data-testid"], xe = ["id", "name", "aria-label", "autocomplete", "disabled", "form", "maxlength", "minlength", "pattern", "placeholder", "readonly", "required", "spellcheck", "type"], ye = /* @__PURE__ */
|
|
214
|
+
}), me = ["data-testid"], xe = ["id", "name", "aria-label", "autocomplete", "disabled", "form", "maxlength", "minlength", "pattern", "placeholder", "readonly", "required", "spellcheck", "type"], ye = /* @__PURE__ */ S({
|
|
173
215
|
name: "CLInput",
|
|
174
216
|
__name: "CLInput",
|
|
175
|
-
props: /* @__PURE__ */
|
|
217
|
+
props: /* @__PURE__ */ M({
|
|
176
218
|
ariaLabel: { default: void 0 },
|
|
177
219
|
autoComplete: { type: Boolean, default: void 0 },
|
|
178
220
|
borderRadius: { default: void 0 },
|
|
179
221
|
busy: { type: Boolean, default: !1 },
|
|
180
222
|
charCounter: { type: Boolean, default: !1 },
|
|
181
|
-
color: { default:
|
|
223
|
+
color: { default: p.Neutral },
|
|
182
224
|
disabled: { type: Boolean, default: !1 },
|
|
183
225
|
fluid: { type: Boolean, default: !1 },
|
|
184
226
|
form: { default: void 0 },
|
|
@@ -194,29 +236,33 @@ const de = ["data-testid"], E = /* @__PURE__ */ v({
|
|
|
194
236
|
onChange: { type: Function, default: void 0 },
|
|
195
237
|
onFocus: { type: Function, default: void 0 },
|
|
196
238
|
onInput: { type: Function, default: void 0 },
|
|
197
|
-
|
|
239
|
+
onPrefixClick: { type: Function, default: void 0 },
|
|
240
|
+
onSuffixClick: { type: Function, default: void 0 },
|
|
241
|
+
orientation: { default: N.Vertical },
|
|
198
242
|
pattern: { default: void 0 },
|
|
199
243
|
pill: { default: void 0 },
|
|
200
244
|
placeholder: { default: void 0 },
|
|
201
245
|
prefix: { default: void 0 },
|
|
246
|
+
prefixAriaLabel: { default: void 0 },
|
|
202
247
|
readonly: { type: Boolean, default: !1 },
|
|
203
248
|
required: { type: Boolean, default: !1 },
|
|
204
249
|
rounded: { type: Boolean, default: !0 },
|
|
205
|
-
size: { default:
|
|
250
|
+
size: { default: d.Small },
|
|
206
251
|
spellCheck: { type: Boolean, default: void 0 },
|
|
207
252
|
suffix: { default: void 0 },
|
|
253
|
+
suffixAriaLabel: { default: void 0 },
|
|
208
254
|
testId: { default: "clll-input" },
|
|
209
|
-
type: { default:
|
|
210
|
-
variant: { default:
|
|
255
|
+
type: { default: n.Text },
|
|
256
|
+
variant: { default: I.Outline }
|
|
211
257
|
}, {
|
|
212
258
|
modelValue: {},
|
|
213
259
|
modelModifiers: {}
|
|
214
260
|
}),
|
|
215
|
-
emits: /* @__PURE__ */
|
|
216
|
-
setup(e, { expose:
|
|
217
|
-
const l = e,
|
|
218
|
-
l.type ===
|
|
219
|
-
const
|
|
261
|
+
emits: /* @__PURE__ */ M(["reset"], ["update:modelValue"]),
|
|
262
|
+
setup(e, { expose: a, emit: s }) {
|
|
263
|
+
const l = e, C = s, t = "clll-input", b = A(!1), g = Q("input-elem"), u = W(e, "modelValue");
|
|
264
|
+
l.type === n.Color && !u.value && (u.value = "#FFFFFF");
|
|
265
|
+
const $ = u.value?.toString(), o = (z) => Object.values(L).includes(z), R = k(() => [
|
|
220
266
|
t,
|
|
221
267
|
l.borderRadius ? `${t}--${l.borderRadius}` : "",
|
|
222
268
|
l.busy ? `${t}--busy` : `${t}--ready`,
|
|
@@ -225,75 +271,78 @@ const de = ["data-testid"], E = /* @__PURE__ */ v({
|
|
|
225
271
|
`${t}--${l.type}`,
|
|
226
272
|
`${t}--${l.variant}`,
|
|
227
273
|
l.disabled || l.busy ? `${t}--disabled` : `${t}--active`,
|
|
228
|
-
l.fluid || l.orientation ===
|
|
274
|
+
l.fluid || l.orientation === N.Horizontal ? `${t}--fluid` : `${t}--fixed`,
|
|
229
275
|
l.grouped ? `${t}--grouped` : "",
|
|
230
276
|
l.label ? `${t}--haslabel` : "",
|
|
231
277
|
l.messageType ? `${t}--${l.messageType}` : "",
|
|
232
278
|
l.orientation ? `${t}--${l.orientation}` : "",
|
|
233
279
|
l.pill ? `${t}--haspill` : "",
|
|
234
|
-
l.charCounter && l.maxLength && [
|
|
235
|
-
l.prefix && ![
|
|
236
|
-
l.prefix && ![
|
|
280
|
+
l.charCounter && l.maxLength && [n.Email, n.None, n.Text, n.Url].includes(l.type) ? `${t}--hascharcounter` : "",
|
|
281
|
+
l.prefix && ![n.Color, n.File].includes(l.type) ? `${t}--hasprefix` : "",
|
|
282
|
+
l.prefix && ![n.Color, n.File].includes(l.type) ? o(l.prefix) ? `${t}--hasiconprefix` : `${t}--hascustomprefix` : "",
|
|
237
283
|
l.readonly ? `${t}--readonly` : `${t}--writeable`,
|
|
238
284
|
l.rounded ? `${t}--rounded` : `${t}--box`,
|
|
239
285
|
l.required ? `${t}--required` : `${t}--optional`,
|
|
240
|
-
l.suffix && ![
|
|
241
|
-
l.suffix && ![
|
|
242
|
-
]),
|
|
286
|
+
l.suffix && ![n.Color, n.File].includes(l.type) ? `${t}--hassuffix` : "",
|
|
287
|
+
l.suffix && ![n.Color, n.File].includes(l.type) ? o(l.suffix) ? `${t}--hasiconsuffix` : `${t}--hascustomsuffix` : ""
|
|
288
|
+
]), j = k(() => [
|
|
243
289
|
`${t}__input`,
|
|
244
|
-
{ "--nocolor": l.type ===
|
|
290
|
+
{ "--nocolor": l.type === n.Color && !u.value },
|
|
245
291
|
{ "--input-group": l.grouped || l.prefix || l.suffix }
|
|
246
|
-
]),
|
|
247
|
-
|
|
248
|
-
}, J = () => {
|
|
249
|
-
|
|
292
|
+
]), D = (z) => {
|
|
293
|
+
u.value = z, C("reset", u.value);
|
|
294
|
+
}, J = (z) => {
|
|
295
|
+
!z.target.closest('button, a, [role="button"]') && g.value && g.value.focus();
|
|
250
296
|
};
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
}),
|
|
254
|
-
inputRef:
|
|
255
|
-
}), (z, c) => (
|
|
297
|
+
return P(u, () => {
|
|
298
|
+
b.value = !1;
|
|
299
|
+
}), a({
|
|
300
|
+
inputRef: g
|
|
301
|
+
}), (z, c) => (r(), x(te, {
|
|
256
302
|
fluid: e.fluid,
|
|
257
303
|
"has-pill": !!e.pill,
|
|
258
304
|
"has-char-counter": !!(e.charCounter && e.maxLength),
|
|
259
305
|
orientation: e.orientation
|
|
260
306
|
}, {
|
|
261
307
|
default: Y(() => [
|
|
262
|
-
|
|
263
|
-
class:
|
|
264
|
-
style: Z(
|
|
308
|
+
F("span", {
|
|
309
|
+
class: y(i(R)),
|
|
310
|
+
style: Z(i(ie)({ color: e.color, variant: e.variant })),
|
|
265
311
|
"data-testid": e.testId
|
|
266
312
|
}, [
|
|
267
|
-
e.label ? (
|
|
313
|
+
e.label ? (r(), x(oe, {
|
|
268
314
|
key: 0,
|
|
269
315
|
"css-prefix": t,
|
|
270
316
|
"html-for": e.id,
|
|
271
317
|
label: e.label,
|
|
272
318
|
required: e.required,
|
|
273
319
|
size: e.size
|
|
274
|
-
}, null, 8, ["html-for", "label", "required", "size"])) :
|
|
275
|
-
|
|
276
|
-
class:
|
|
320
|
+
}, null, 8, ["html-for", "label", "required", "size"])) : v("", !0),
|
|
321
|
+
F("span", {
|
|
322
|
+
class: y([`${t}__input-container`, "--focus-within"]),
|
|
277
323
|
onClick: J
|
|
278
324
|
}, [
|
|
279
|
-
e.prefix && ![
|
|
325
|
+
e.prefix && ![i(n).Color, i(n).File].includes(e.type) ? (r(), x(H, {
|
|
280
326
|
key: 0,
|
|
281
327
|
prefix: e.prefix,
|
|
282
328
|
size: e.size,
|
|
283
329
|
grouped: e.grouped,
|
|
284
|
-
"border-radius": e.borderRadius
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
330
|
+
"border-radius": e.borderRadius,
|
|
331
|
+
color: e.color,
|
|
332
|
+
"on-click": e.onPrefixClick,
|
|
333
|
+
"aria-label": e.prefixAriaLabel
|
|
334
|
+
}, null, 8, ["prefix", "size", "grouped", "border-radius", "color", "on-click", "aria-label"])) : v("", !0),
|
|
335
|
+
F("span", {
|
|
336
|
+
class: y(`${t}__input-border-control`)
|
|
288
337
|
}, [
|
|
289
|
-
_(
|
|
338
|
+
_(F("input", {
|
|
290
339
|
id: e.id,
|
|
291
340
|
ref: "input-elem",
|
|
292
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
341
|
+
"onUpdate:modelValue": c[0] || (c[0] = (m) => u.value = m),
|
|
293
342
|
name: e.name,
|
|
294
343
|
"aria-label": e.ariaLabel,
|
|
295
344
|
autocomplete: e.autoComplete ? "on" : "off",
|
|
296
|
-
class:
|
|
345
|
+
class: y(i(j)),
|
|
297
346
|
disabled: e.disabled || e.busy,
|
|
298
347
|
form: e.form,
|
|
299
348
|
maxlength: e.maxLength,
|
|
@@ -305,74 +354,77 @@ const de = ["data-testid"], E = /* @__PURE__ */ v({
|
|
|
305
354
|
spellcheck: e.spellCheck,
|
|
306
355
|
type: e.type,
|
|
307
356
|
onBlur: c[1] || (c[1] = //@ts-ignore
|
|
308
|
-
(...
|
|
357
|
+
(...m) => e.onBlur && e.onBlur(...m)),
|
|
309
358
|
onChange: c[2] || (c[2] = //@ts-ignore
|
|
310
|
-
(...
|
|
359
|
+
(...m) => e.onChange && e.onChange(...m)),
|
|
311
360
|
onFocus: c[3] || (c[3] = //@ts-ignore
|
|
312
|
-
(...
|
|
361
|
+
(...m) => e.onFocus && e.onFocus(...m)),
|
|
313
362
|
onInput: c[4] || (c[4] = //@ts-ignore
|
|
314
|
-
(...
|
|
363
|
+
(...m) => e.onInput && e.onInput(...m))
|
|
315
364
|
}, null, 42, xe), [
|
|
316
|
-
[ee,
|
|
365
|
+
[ee, u.value]
|
|
317
366
|
])
|
|
318
367
|
], 2),
|
|
319
|
-
e.type ===
|
|
368
|
+
e.type === i(n).Color ? (r(), h("span", {
|
|
320
369
|
key: 1,
|
|
321
|
-
class:
|
|
322
|
-
},
|
|
323
|
-
e.type ===
|
|
370
|
+
class: y(`${t}__selected-color`)
|
|
371
|
+
}, w(u.value || "none"), 3)) : v("", !0),
|
|
372
|
+
e.type === i(n).Color ? (r(), x(G, {
|
|
324
373
|
key: 2,
|
|
325
|
-
modelValue:
|
|
326
|
-
"onUpdate:modelValue": c[5] || (c[5] = (
|
|
327
|
-
copied:
|
|
328
|
-
"onUpdate:copied": c[6] || (c[6] = (
|
|
329
|
-
"initial-value":
|
|
374
|
+
modelValue: u.value,
|
|
375
|
+
"onUpdate:modelValue": c[5] || (c[5] = (m) => u.value = m),
|
|
376
|
+
copied: i(b),
|
|
377
|
+
"onUpdate:copied": c[6] || (c[6] = (m) => le(b) ? b.value = m : null),
|
|
378
|
+
"initial-value": i($),
|
|
330
379
|
size: e.size,
|
|
331
|
-
onReset:
|
|
332
|
-
}, null, 8, ["modelValue", "copied", "initial-value", "size"])) :
|
|
333
|
-
e.suffix && ![
|
|
380
|
+
onReset: D
|
|
381
|
+
}, null, 8, ["modelValue", "copied", "initial-value", "size"])) : v("", !0),
|
|
382
|
+
e.suffix && ![i(n).Color, i(n).File].includes(e.type) ? (r(), x(O, {
|
|
334
383
|
key: 3,
|
|
335
384
|
suffix: e.suffix,
|
|
336
385
|
size: e.size,
|
|
337
386
|
grouped: e.grouped,
|
|
338
|
-
"border-radius": e.borderRadius
|
|
339
|
-
|
|
340
|
-
|
|
387
|
+
"border-radius": e.borderRadius,
|
|
388
|
+
color: e.color,
|
|
389
|
+
"on-click": e.onSuffixClick,
|
|
390
|
+
"aria-label": e.suffixAriaLabel
|
|
391
|
+
}, null, 8, ["suffix", "size", "grouped", "border-radius", "color", "on-click", "aria-label"])) : v("", !0),
|
|
392
|
+
e.charCounter && e.maxLength && [i(n).Email, i(n).None, i(n).Text, i(n).Url].includes(e.type) ? (r(), x(ne, {
|
|
341
393
|
key: 4,
|
|
342
394
|
color: e.color,
|
|
343
395
|
"css-prefix": t,
|
|
344
|
-
"current-length":
|
|
396
|
+
"current-length": u.value ? u.value.toString().length : 0,
|
|
345
397
|
"max-length": e.maxLength,
|
|
346
|
-
layout:
|
|
398
|
+
layout: i(ue).Inline,
|
|
347
399
|
size: e.size
|
|
348
|
-
}, null, 8, ["color", "current-length", "max-length", "layout", "size"])) :
|
|
400
|
+
}, null, 8, ["color", "current-length", "max-length", "layout", "size"])) : v("", !0)
|
|
349
401
|
], 2)
|
|
350
402
|
], 14, me),
|
|
351
|
-
e.pill && e.label && e.orientation ===
|
|
403
|
+
e.pill && e.label && e.orientation === i(N).Horizontal ? (r(), h("span", {
|
|
352
404
|
key: 0,
|
|
353
|
-
class:
|
|
354
|
-
}, null, 2)) :
|
|
355
|
-
e.pill ? (
|
|
405
|
+
class: y(`${t}__spacer`)
|
|
406
|
+
}, null, 2)) : v("", !0),
|
|
407
|
+
e.pill ? (r(), x(U, {
|
|
356
408
|
key: 1,
|
|
357
409
|
label: e.pill,
|
|
358
410
|
color: e.color
|
|
359
|
-
}, null, 8, ["label", "color"])) :
|
|
360
|
-
e.id ? (
|
|
411
|
+
}, null, 8, ["label", "color"])) : v("", !0),
|
|
412
|
+
e.id ? (r(), x(ae, {
|
|
361
413
|
key: 2,
|
|
362
414
|
id: e.id,
|
|
363
415
|
messages: e.messages,
|
|
364
416
|
"message-type": e.messageType
|
|
365
|
-
}, null, 8, ["id", "messages", "message-type"])) :
|
|
417
|
+
}, null, 8, ["id", "messages", "message-type"])) : v("", !0)
|
|
366
418
|
]),
|
|
367
419
|
_: 1
|
|
368
420
|
}, 8, ["fluid", "has-pill", "has-char-counter", "orientation"]));
|
|
369
421
|
}
|
|
370
|
-
}),
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
422
|
+
}), T = ye;
|
|
423
|
+
T.Prefix = H;
|
|
424
|
+
T.Suffix = O;
|
|
425
|
+
T.Pill = U;
|
|
426
|
+
T.ColorTools = G;
|
|
375
427
|
export {
|
|
376
|
-
|
|
377
|
-
|
|
428
|
+
T as CLInput,
|
|
429
|
+
T as default
|
|
378
430
|
};
|
|
@@ -42,6 +42,10 @@ export interface CLInputProps {
|
|
|
42
42
|
onFocus?: CLGenericFocusFunction;
|
|
43
43
|
/** A callback function which handles when the input value changes due to user input. */
|
|
44
44
|
onInput?: CLGenericInputFunction;
|
|
45
|
+
/** A callback function which handles when the prefix icon is clicked. */
|
|
46
|
+
onPrefixClick?: (event?: MouseEvent) => void;
|
|
47
|
+
/** A callback function which handles when the suffix icon is clicked. */
|
|
48
|
+
onSuffixClick?: (event?: MouseEvent) => void;
|
|
45
49
|
/** Sets the label position to be above or to the left of the form element. The property can be one of `CLOrientation` */
|
|
46
50
|
orientation?: CLOrientation;
|
|
47
51
|
/** A regexp pattern that can be used for validation. */
|
|
@@ -52,6 +56,8 @@ export interface CLInputProps {
|
|
|
52
56
|
placeholder?: string;
|
|
53
57
|
/** Sets the icon or text to be displayed before the user input. */
|
|
54
58
|
prefix?: string | CLIconNames;
|
|
59
|
+
/** Sets the aria-label for the prefix icon when it's interactive. */
|
|
60
|
+
prefixAriaLabel?: string;
|
|
55
61
|
/** When set to `true` the input cannot be edited. */
|
|
56
62
|
readonly?: boolean;
|
|
57
63
|
/** Set the required state. */
|
|
@@ -64,6 +70,8 @@ export interface CLInputProps {
|
|
|
64
70
|
spellCheck?: boolean;
|
|
65
71
|
/**Sets the icon or text to be displayed after the user input. */
|
|
66
72
|
suffix?: string | CLIconNames;
|
|
73
|
+
/** Sets the aria-label for the suffix icon when it's interactive. */
|
|
74
|
+
suffixAriaLabel?: string;
|
|
67
75
|
/** Sets a custom ID used for unit tests. */
|
|
68
76
|
testId?: string;
|
|
69
77
|
/**Set the type of input, supports various input types. */
|
|
@@ -115,8 +123,12 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
115
123
|
autoComplete: boolean;
|
|
116
124
|
charCounter: boolean;
|
|
117
125
|
minLength: number;
|
|
126
|
+
onPrefixClick: (event?: MouseEvent) => void;
|
|
127
|
+
onSuffixClick: (event?: MouseEvent) => void;
|
|
128
|
+
prefixAriaLabel: string;
|
|
118
129
|
readonly: boolean;
|
|
119
130
|
spellCheck: boolean;
|
|
131
|
+
suffixAriaLabel: string;
|
|
120
132
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
121
133
|
'input-elem': HTMLInputElement;
|
|
122
134
|
}, HTMLDivElement>;
|