energy-components 1.10.1 → 1.12.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/collapsable.es.js +4 -0
- package/dist/components/collapsable.scss_vue_type_style_index_0_src_true_lang-DfOWp1XD.js +86 -0
- package/dist/components/datepicker.es.js +717 -708
- package/dist/components/filterTag.es.js +70 -0
- package/dist/components/index.es.js +91 -85
- package/dist/components/modal.es.js +29 -27
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/collapsable.css +1 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/filterTag.css +1 -0
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/tabBar.css +1 -1
- package/dist/components/style/textArea.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/tabBar.es.js +103 -98
- package/dist/components/textArea.es.js +96 -86
- package/dist/components/textField.es.js +140 -118
- package/dist/energy-components.es.js +4157 -3962
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
- package/dist/types/src/components/input/filter-tag/filter-tag.vue.d.ts +53 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { R as
|
|
3
|
-
import { _ as
|
|
4
|
-
import './style/textArea.css';function
|
|
5
|
-
return
|
|
1
|
+
import { defineComponent as Q, mergeModels as W, useModel as X, toRefs as Y, ref as k, computed as o, createElementBlock as h, openBlock as s, normalizeClass as u, createElementVNode as r, withDirectives as Z, unref as e, vModelText as ee, renderSlot as S, createTextVNode as te, createBlock as T, createCommentVNode as i, mergeProps as $, toHandlers as A, toDisplayString as d } from "vue";
|
|
2
|
+
import { R as F } from "./icon-svg-DuzOdbk1.js";
|
|
3
|
+
import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/textArea.css';function V(t, g = !0, c = !0) {
|
|
5
|
+
return g && !t.trim() ? (console.warn("Advertencia: El valor no puede estar vacío"), !1) : c && !/^[\w\-:]+$/.test(t) ? (console.warn("Advertencia: El valor contiene caracteres inválidos"), !1) : !0;
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const re = { class: "rds-e-textarea__input-container" }, le = ["id", "name", "maxlength", "minlength", "rows", "disabled"], ne = ["for"], se = { key: 0 }, oe = { key: 0 }, ue = { key: 1 }, ie = { key: 0 }, de = /* @__PURE__ */ Q({
|
|
8
8
|
__name: "text-area",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ W({
|
|
10
10
|
/**
|
|
11
11
|
* Etiqueta que se muestra sobre el campo de entrada. y Placeholder
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
14
14
|
type: String,
|
|
15
15
|
required: !0,
|
|
16
16
|
validator(t) {
|
|
17
|
-
return
|
|
17
|
+
return V(t, !0, !0);
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
/**
|
|
@@ -24,7 +24,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
24
24
|
type: String,
|
|
25
25
|
required: !1,
|
|
26
26
|
validator(t) {
|
|
27
|
-
return
|
|
27
|
+
return V(t, !1, !0);
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
/**
|
|
@@ -34,7 +34,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
34
34
|
type: String,
|
|
35
35
|
required: !1,
|
|
36
36
|
validator(t) {
|
|
37
|
-
return
|
|
37
|
+
return V(t, !1, !0);
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
/**
|
|
@@ -136,133 +136,143 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
|
|
|
136
136
|
}),
|
|
137
137
|
emits: ["update:modelValue"],
|
|
138
138
|
setup(t) {
|
|
139
|
-
const
|
|
140
|
-
label:
|
|
141
|
-
id:
|
|
142
|
-
disabled:
|
|
139
|
+
const g = t, c = X(t, "modelValue"), {
|
|
140
|
+
label: B,
|
|
141
|
+
id: M,
|
|
142
|
+
disabled: x,
|
|
143
143
|
maxlength: m,
|
|
144
|
-
minlength:
|
|
145
|
-
modelValue:
|
|
146
|
-
icon:
|
|
147
|
-
rightIcon:
|
|
148
|
-
helper:
|
|
149
|
-
error:
|
|
150
|
-
helperText:
|
|
151
|
-
clearable:
|
|
152
|
-
lengthError:
|
|
153
|
-
} =
|
|
154
|
-
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
144
|
+
minlength: y,
|
|
145
|
+
modelValue: v,
|
|
146
|
+
icon: R,
|
|
147
|
+
rightIcon: E,
|
|
148
|
+
helper: z,
|
|
149
|
+
error: b,
|
|
150
|
+
helperText: P,
|
|
151
|
+
clearable: w,
|
|
152
|
+
lengthError: j
|
|
153
|
+
} = Y(g), f = k(!1), _ = k(!1), p = k(!1), H = () => {
|
|
154
|
+
p.value = !0;
|
|
155
|
+
}, K = () => {
|
|
156
|
+
f.value = !1, _.value = !1, p.value = !1;
|
|
157
|
+
}, U = () => {
|
|
158
|
+
f.value = !0, _.value = !p.value, p.value = !1;
|
|
159
|
+
}, N = o(() => v.value.length === m.value), C = o(() => v.value.length === 0 ? !1 : v.value.length < y.value), I = o(() => j.value && (N.value || C.value)), G = o(() => {
|
|
160
|
+
const a = [];
|
|
161
|
+
return v.value && a.push("rds-e-textarea--filled"), b.value && a.push("rds-e-textarea--error"), x.value && a.push("rds-e-textarea--disabled"), I.value && a.push("rds-e-textarea--error"), a.join(" ");
|
|
162
|
+
}), J = () => {
|
|
163
|
+
c.value = "";
|
|
164
|
+
}, l = o(() => {
|
|
165
|
+
const a = {
|
|
166
|
+
name: R.value,
|
|
163
167
|
class: "",
|
|
164
168
|
events: {
|
|
165
169
|
click: () => {
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
}, n = {
|
|
169
|
-
left: { ...
|
|
170
|
-
right: { ...
|
|
173
|
+
left: { ...a },
|
|
174
|
+
right: { ...a, name: E.value }
|
|
171
175
|
};
|
|
172
|
-
return
|
|
173
|
-
...
|
|
176
|
+
return w.value && (n.right = {
|
|
177
|
+
...a,
|
|
174
178
|
name: "close",
|
|
175
179
|
class: "rds-e-textfield__icon--clear",
|
|
176
180
|
events: {
|
|
177
|
-
click: () =>
|
|
181
|
+
click: () => J()
|
|
178
182
|
}
|
|
179
183
|
}), n;
|
|
180
|
-
}),
|
|
181
|
-
return (
|
|
182
|
-
var
|
|
183
|
-
return s(),
|
|
184
|
-
class:
|
|
184
|
+
}), L = o(() => v.value.length);
|
|
185
|
+
return (a, n) => {
|
|
186
|
+
var D, q;
|
|
187
|
+
return s(), h("div", {
|
|
188
|
+
class: u(["rds-e-textarea", G.value])
|
|
185
189
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
r("div", {
|
|
191
|
+
class: u(["rds-e-textarea__container", {
|
|
192
|
+
"rds-e-textarea__container--keyboard-focus": _.value,
|
|
193
|
+
"rds-e-textarea__container--active": f.value && !_.value
|
|
194
|
+
}]),
|
|
195
|
+
onMousedown: H
|
|
196
|
+
}, [
|
|
197
|
+
r("div", re, [
|
|
198
|
+
Z(r("textarea", {
|
|
199
|
+
id: (D = e(M)) == null ? void 0 : D.toString(),
|
|
200
|
+
"onUpdate:modelValue": n[0] || (n[0] = (O) => c.value = O),
|
|
191
201
|
type: "text",
|
|
192
|
-
class:
|
|
202
|
+
class: u(["rds-e-textarea__input", { "rds-e-textarea__input--active": f.value }]),
|
|
193
203
|
name: t.name,
|
|
194
204
|
maxlength: e(m),
|
|
195
|
-
minlength: e(
|
|
205
|
+
minlength: e(y),
|
|
196
206
|
rows: t.rows,
|
|
197
|
-
disabled: e(
|
|
198
|
-
onBlur:
|
|
199
|
-
onFocus:
|
|
200
|
-
}, null, 42,
|
|
201
|
-
[
|
|
207
|
+
disabled: e(x),
|
|
208
|
+
onBlur: K,
|
|
209
|
+
onFocus: U
|
|
210
|
+
}, null, 42, le), [
|
|
211
|
+
[ee, c.value]
|
|
202
212
|
]),
|
|
203
|
-
n[1] || (n[1] =
|
|
204
|
-
|
|
213
|
+
n[1] || (n[1] = r("div", { class: "rds-e-textarea__resize-handle" }, [
|
|
214
|
+
r("svg", {
|
|
205
215
|
width: "12",
|
|
206
216
|
height: "14",
|
|
207
217
|
viewBox: "0 0 12 14",
|
|
208
218
|
fill: "none",
|
|
209
219
|
xmlns: "http://www.w3.org/2000/svg"
|
|
210
220
|
}, [
|
|
211
|
-
|
|
221
|
+
r("path", {
|
|
212
222
|
d: "M11 1V3C11 8.52285 6.52285 13 1 13V13",
|
|
213
223
|
"stroke-width": "1.2",
|
|
214
224
|
"stroke-linecap": "round"
|
|
215
225
|
})
|
|
216
226
|
])
|
|
217
227
|
], -1)),
|
|
218
|
-
|
|
219
|
-
for: (
|
|
220
|
-
class:
|
|
228
|
+
r("label", {
|
|
229
|
+
for: (q = e(M)) == null ? void 0 : q.toString(),
|
|
230
|
+
class: u(["rds-e-textarea__label", {
|
|
221
231
|
"rds-e-textarea__label--with-icon": l.value.left.name,
|
|
222
|
-
"rds-e-textarea__label--active":
|
|
232
|
+
"rds-e-textarea__label--active": f.value
|
|
223
233
|
}])
|
|
224
234
|
}, [
|
|
225
|
-
|
|
226
|
-
l.value.left.name ? (s(),
|
|
235
|
+
S(a.$slots, "left-icon", {}, () => [
|
|
236
|
+
l.value.left.name ? (s(), T(F, $({
|
|
227
237
|
key: 0,
|
|
228
|
-
class:
|
|
238
|
+
class: "rds-e-textarea__icon rds-e-textarea__icon--left",
|
|
229
239
|
"aria-hidden": "true"
|
|
230
|
-
}, l.value.left,
|
|
240
|
+
}, l.value.left, A(l.value.left.events)), null, 16)) : i("", !0)
|
|
231
241
|
], !0),
|
|
232
|
-
|
|
233
|
-
], 10,
|
|
234
|
-
|
|
235
|
-
class:
|
|
236
|
-
"rds-e-textarea__counter--disabled": e(
|
|
237
|
-
"rds-e-textarea__counter--clearable": e(
|
|
242
|
+
te(" " + d(e(B)), 1)
|
|
243
|
+
], 10, ne),
|
|
244
|
+
r("div", {
|
|
245
|
+
class: u(["rds-e-textarea__counter", {
|
|
246
|
+
"rds-e-textarea__counter--disabled": e(x),
|
|
247
|
+
"rds-e-textarea__counter--clearable": e(w)
|
|
238
248
|
}])
|
|
239
249
|
}, [
|
|
240
|
-
t.counter && !e(
|
|
241
|
-
|
|
242
|
-
l.value.right.name
|
|
250
|
+
t.counter && !e(E) && !e(w) ? (s(), h("p", se, d(L.value) + "/" + d(e(m)), 1)) : i("", !0),
|
|
251
|
+
S(a.$slots, "right-icon", {}, () => [
|
|
252
|
+
l.value.right.name ? (s(), T(F, $({
|
|
243
253
|
key: 0,
|
|
244
254
|
class: "rds-e-textarea__icon rds-e-textarea__icon--right",
|
|
245
255
|
"aria-hidden": "true"
|
|
246
|
-
}, l.value.right,
|
|
256
|
+
}, l.value.right, A(l.value.right.events)), null, 16)) : i("", !0)
|
|
247
257
|
], !0)
|
|
248
258
|
], 2)
|
|
249
259
|
])
|
|
250
|
-
]),
|
|
251
|
-
|
|
252
|
-
class:
|
|
260
|
+
], 34),
|
|
261
|
+
r("ul", {
|
|
262
|
+
class: u(["rds-e-textarea__helper", e(b) || I.value ? "rds-e-textarea__helper--error" : ""])
|
|
253
263
|
}, [
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
e(
|
|
264
|
+
N.value ? (s(), h("li", oe, " Max text length is " + d(e(m)), 1)) : i("", !0),
|
|
265
|
+
C.value ? (s(), h("li", ue, " Min text length is " + d(e(y)), 1)) : i("", !0),
|
|
266
|
+
r("li", null, [
|
|
267
|
+
S(a.$slots, "helper-text", {}, () => [
|
|
268
|
+
e(z) || e(b) ? (s(), h("span", ie, d(e(P)), 1)) : i("", !0)
|
|
259
269
|
], !0)
|
|
260
270
|
])
|
|
261
271
|
], 2)
|
|
262
272
|
], 2);
|
|
263
273
|
};
|
|
264
274
|
}
|
|
265
|
-
}),
|
|
275
|
+
}), he = /* @__PURE__ */ ae(de, [["__scopeId", "data-v-cdbbf388"]]);
|
|
266
276
|
export {
|
|
267
|
-
|
|
277
|
+
he as default
|
|
268
278
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import { R, s as
|
|
4
|
-
import { _ as
|
|
5
|
-
import './style/textField.css';const
|
|
1
|
+
import { defineComponent as re, toRefs as ie, ref as f, computed as v, watch as F, onMounted as ue, onBeforeUnmount as de, createElementBlock as V, openBlock as m, normalizeClass as k, createElementVNode as h, createCommentVNode as S, renderSlot as E, createBlock as R, mergeProps as A, toHandlers as ce, unref as d, toDisplayString as M, withModifiers as fe } from "vue";
|
|
2
|
+
import { g as ve } from "./getInstance-GhoEcxLF.js";
|
|
3
|
+
import { R as K, s as pe } from "./icon-svg-DuzOdbk1.js";
|
|
4
|
+
import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/textField.css';const he = { class: "rds-e-textfield__input-container" }, ge = ["id", "type", "maxlength", "minlength", "disabled", "value", "autocomplete", "readonly"], _e = ["for"], ye = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
8
|
-
},
|
|
8
|
+
}, xe = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "rds-e-textfield__helper"
|
|
11
|
-
},
|
|
11
|
+
}, be = /* @__PURE__ */ re({
|
|
12
12
|
__name: "text-field",
|
|
13
13
|
props: {
|
|
14
14
|
/**
|
|
@@ -78,8 +78,8 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
78
78
|
type: String,
|
|
79
79
|
default: "text",
|
|
80
80
|
validator: (t) => {
|
|
81
|
-
const
|
|
82
|
-
return
|
|
81
|
+
const s = ["text", "number", "password", "email", "tel", "url"], r = s.includes(t);
|
|
82
|
+
return r || console.warn(`[RDSTextfield]: El valor de la prop 'type' debe ser uno de: ${s.join(", ")}. Valor recibido: ${t}`), r;
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
/**
|
|
@@ -140,67 +140,76 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
140
140
|
autocomplete: {
|
|
141
141
|
type: String,
|
|
142
142
|
default: "off",
|
|
143
|
-
validator: (t,
|
|
144
|
-
const
|
|
145
|
-
return (
|
|
143
|
+
validator: (t, s) => {
|
|
144
|
+
const r = ["new-password", "current-password", "off"];
|
|
145
|
+
return (s.password || s.type === "password") && !r.includes(t) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${r.join(", ")}`), !1) : !0;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
|
|
150
|
-
setup(t, { expose:
|
|
151
|
-
const
|
|
152
|
-
type:
|
|
153
|
-
label:
|
|
154
|
-
disabled:
|
|
155
|
-
maxLength:
|
|
156
|
-
minLength:
|
|
157
|
-
modelValue:
|
|
158
|
-
icon:
|
|
159
|
-
rightIcon:
|
|
160
|
-
helper:
|
|
161
|
-
error:
|
|
162
|
-
helperText:
|
|
163
|
-
clearable:
|
|
164
|
-
password:
|
|
165
|
-
autocomplete:
|
|
166
|
-
fullWidth:
|
|
167
|
-
} =
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
}),
|
|
150
|
+
setup(t, { expose: s, emit: r }) {
|
|
151
|
+
const n = t, c = r, {
|
|
152
|
+
type: g,
|
|
153
|
+
label: P,
|
|
154
|
+
disabled: N,
|
|
155
|
+
maxLength: j,
|
|
156
|
+
minLength: q,
|
|
157
|
+
modelValue: i,
|
|
158
|
+
icon: W,
|
|
159
|
+
rightIcon: O,
|
|
160
|
+
helper: U,
|
|
161
|
+
error: L,
|
|
162
|
+
helperText: z,
|
|
163
|
+
clearable: H,
|
|
164
|
+
password: _,
|
|
165
|
+
autocomplete: G,
|
|
166
|
+
fullWidth: J
|
|
167
|
+
} = ie(n), a = f(null), p = f(!0), y = f(!1), x = f(!1), b = f(!1), Q = ve(), w = f(""), B = v(() => n.id || `text-field-${Q}`), X = v(() => _.value ? p.value ? "text" : "password" : g.value), Y = v(() => {
|
|
168
|
+
if (_.value || g.value === "password")
|
|
169
|
+
return G.value;
|
|
170
|
+
}), Z = (e) => {
|
|
171
171
|
const l = e.target;
|
|
172
|
-
let
|
|
173
|
-
if (
|
|
172
|
+
let u = l.value;
|
|
173
|
+
if (g.value === "number")
|
|
174
174
|
if (l.value.trim() === "")
|
|
175
|
-
|
|
175
|
+
u = null;
|
|
176
176
|
else {
|
|
177
|
-
const
|
|
178
|
-
|
|
177
|
+
const D = Number.parseFloat(l.value);
|
|
178
|
+
u = Number.isNaN(D) ? l.value : D;
|
|
179
179
|
}
|
|
180
|
-
else l.value === "" &&
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
b.value = !1;
|
|
184
|
-
}, E = () => {
|
|
180
|
+
else l.value === "" && i.value === null && (u = null);
|
|
181
|
+
c("update:modelValue", u);
|
|
182
|
+
}, ee = () => {
|
|
185
183
|
b.value = !0;
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
184
|
+
}, T = () => {
|
|
185
|
+
y.value = !1, x.value = !1, b.value = !1;
|
|
186
|
+
}, I = () => {
|
|
187
|
+
y.value = !0, x.value = !b.value, b.value = !1;
|
|
188
|
+
}, te = (e) => {
|
|
189
|
+
c("keydown", e);
|
|
190
|
+
}, le = (e) => {
|
|
191
|
+
c("keyup", e);
|
|
192
|
+
}, ae = (e) => {
|
|
193
|
+
c("keypress", e);
|
|
194
|
+
}, ne = (e) => {
|
|
195
|
+
c("change", e);
|
|
196
|
+
}, oe = v(() => {
|
|
197
|
+
if (L.value) return !0;
|
|
198
|
+
const e = i.value === null || i.value === void 0 ? "" : String(i.value);
|
|
199
|
+
return e.length > 0 && (e.length < q.value || g.value !== "number" && e.length > j.value);
|
|
200
|
+
}), se = v(() => {
|
|
199
201
|
const e = [];
|
|
200
|
-
return
|
|
201
|
-
})
|
|
202
|
+
return w.value !== "" && e.push(w.value), i.value !== null && String(i.value).length > 0 && e.push("rds-e-textfield--filled"), oe.value && e.push("rds-e-textfield--error"), N.value && e.push("rds-e-textfield--disabled"), J.value && e.push("rds-e-textfield--full-width"), e.join(" ");
|
|
203
|
+
});
|
|
204
|
+
F(
|
|
205
|
+
() => i.value,
|
|
206
|
+
(e) => {
|
|
207
|
+
e !== null && String(e).length > 0 && (w.value = "");
|
|
208
|
+
}
|
|
209
|
+
);
|
|
210
|
+
const o = v(() => {
|
|
202
211
|
const e = {
|
|
203
|
-
name:
|
|
212
|
+
name: W.value,
|
|
204
213
|
class: "",
|
|
205
214
|
events: {
|
|
206
215
|
click: () => {
|
|
@@ -212,23 +221,23 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
212
221
|
},
|
|
213
222
|
right: {
|
|
214
223
|
...e,
|
|
215
|
-
name:
|
|
224
|
+
name: O.value
|
|
216
225
|
}
|
|
217
226
|
};
|
|
218
|
-
return
|
|
227
|
+
return _.value ? {
|
|
219
228
|
left: {
|
|
220
229
|
...e,
|
|
221
230
|
name: null
|
|
222
231
|
},
|
|
223
232
|
right: {
|
|
224
233
|
...e,
|
|
225
|
-
name:
|
|
234
|
+
name: p.value ? "eye_open" : "eye_close",
|
|
226
235
|
class: "rds-e-textfield__icon--password",
|
|
227
236
|
events: {
|
|
228
|
-
click: () =>
|
|
237
|
+
click: () => p.value = !p.value
|
|
229
238
|
}
|
|
230
239
|
}
|
|
231
|
-
} :
|
|
240
|
+
} : H.value ? {
|
|
232
241
|
left: {
|
|
233
242
|
...e
|
|
234
243
|
},
|
|
@@ -237,86 +246,99 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
237
246
|
name: "close",
|
|
238
247
|
class: "rds-e-textfield__icon--clear",
|
|
239
248
|
events: {
|
|
240
|
-
click: () =>
|
|
249
|
+
click: () => c("update:modelValue", "")
|
|
241
250
|
}
|
|
242
251
|
}
|
|
243
252
|
} : l;
|
|
244
253
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
(e) =>
|
|
254
|
+
F(
|
|
255
|
+
_,
|
|
256
|
+
(e) => p.value = !e,
|
|
248
257
|
{ immediate: !0 }
|
|
249
258
|
);
|
|
250
|
-
const
|
|
251
|
-
const l =
|
|
259
|
+
const C = (e) => {
|
|
260
|
+
const l = pe.includes(e);
|
|
252
261
|
return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
|
|
262
|
+
}, $ = (e) => {
|
|
263
|
+
var u;
|
|
264
|
+
((u = a.value) == null ? void 0 : u.matches(":-webkit-autofill")) && e.animationName.startsWith("onAutoFillStart") && (w.value = "rds-e-textfield--filled");
|
|
253
265
|
};
|
|
254
|
-
return
|
|
266
|
+
return ue(() => {
|
|
267
|
+
a.value && a.value.addEventListener("animationstart", $);
|
|
268
|
+
}), de(() => {
|
|
269
|
+
a.value && a.value.removeEventListener("animationstart", $);
|
|
270
|
+
}), s({
|
|
255
271
|
focus: () => {
|
|
256
|
-
|
|
272
|
+
a.value && (a.value.focus(), I());
|
|
257
273
|
},
|
|
258
274
|
blur: () => {
|
|
259
|
-
|
|
275
|
+
a.value && (a.value.blur(), T());
|
|
260
276
|
}
|
|
261
|
-
}), (e, l) => (
|
|
262
|
-
class:
|
|
277
|
+
}), (e, l) => (m(), V("div", {
|
|
278
|
+
class: k(["rds-e-textfield", se.value])
|
|
263
279
|
}, [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
280
|
+
h("div", {
|
|
281
|
+
class: k(["rds-e-textfield__container", {
|
|
282
|
+
"rds-e-textfield__container--keyboard-focus": x.value,
|
|
283
|
+
"rds-e-textfield__container--active": y.value && !x.value
|
|
284
|
+
}]),
|
|
285
|
+
onMousedown: ee
|
|
286
|
+
}, [
|
|
287
|
+
E(e.$slots, "left-icon", {}, () => [
|
|
288
|
+
o.value.left.name && C(o.value.left.name) ? (m(), R(K, A({
|
|
267
289
|
key: 0,
|
|
268
|
-
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden":
|
|
290
|
+
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": y.value }],
|
|
269
291
|
"aria-hidden": "true"
|
|
270
|
-
},
|
|
292
|
+
}, o.value.left, ce(o.value.left.events)), null, 16, ["class"])) : S("", !0)
|
|
271
293
|
], !0),
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
id:
|
|
294
|
+
h("div", he, [
|
|
295
|
+
h("input", {
|
|
296
|
+
id: B.value,
|
|
275
297
|
ref_key: "input",
|
|
276
|
-
ref:
|
|
277
|
-
type:
|
|
298
|
+
ref: a,
|
|
299
|
+
type: X.value,
|
|
278
300
|
class: "rds-e-textfield__input",
|
|
279
|
-
maxlength:
|
|
280
|
-
minlength:
|
|
281
|
-
disabled:
|
|
282
|
-
value:
|
|
283
|
-
autocomplete:
|
|
301
|
+
maxlength: n.type === "number" ? void 0 : n.maxLength,
|
|
302
|
+
minlength: n.type === "number" ? void 0 : n.minLength,
|
|
303
|
+
disabled: d(N),
|
|
304
|
+
value: n.modelValue === null ? "" : n.modelValue,
|
|
305
|
+
autocomplete: Y.value,
|
|
284
306
|
readonly: t.readonly,
|
|
285
|
-
onInput:
|
|
286
|
-
onBlur:
|
|
287
|
-
onFocus:
|
|
288
|
-
onKeydown:
|
|
289
|
-
onKeyup:
|
|
290
|
-
onKeypress:
|
|
291
|
-
onChange:
|
|
292
|
-
}, null, 40,
|
|
293
|
-
|
|
294
|
-
for:
|
|
295
|
-
class:
|
|
296
|
-
},
|
|
307
|
+
onInput: Z,
|
|
308
|
+
onBlur: T,
|
|
309
|
+
onFocus: I,
|
|
310
|
+
onKeydown: te,
|
|
311
|
+
onKeyup: le,
|
|
312
|
+
onKeypress: ae,
|
|
313
|
+
onChange: ne
|
|
314
|
+
}, null, 40, ge),
|
|
315
|
+
h("label", {
|
|
316
|
+
for: B.value,
|
|
317
|
+
class: k(["rds-e-textfield__label", d(N) ? "rds-e-textfield__label--disabled" : ""])
|
|
318
|
+
}, M(d(P)), 11, _e)
|
|
297
319
|
]),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
320
|
+
o.value.right.name || e.$slots["right-icon"] ? (m(), V("span", ye, [
|
|
321
|
+
E(e.$slots, "right-icon", {}, () => [
|
|
322
|
+
o.value.right.name && C(o.value.right.name) ? (m(), R(K, A({
|
|
301
323
|
key: 0,
|
|
302
324
|
"aria-hidden": "true",
|
|
303
325
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
304
|
-
},
|
|
305
|
-
onClick:
|
|
306
|
-
}), null, 16, ["onClick"])) :
|
|
326
|
+
}, o.value.right, {
|
|
327
|
+
onClick: fe(o.value.right.events.click, ["stop"])
|
|
328
|
+
}), null, 16, ["onClick"])) : S("", !0)
|
|
307
329
|
], !0)
|
|
308
|
-
])) :
|
|
309
|
-
]),
|
|
310
|
-
(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
class:
|
|
314
|
-
},
|
|
330
|
+
])) : S("", !0)
|
|
331
|
+
], 34),
|
|
332
|
+
d(U) || d(L) ? (m(), V("div", xe, [
|
|
333
|
+
E(e.$slots, "helper-text", {}, () => [
|
|
334
|
+
h("span", {
|
|
335
|
+
class: k(d(L) ? "rds-e-textfield__helper--error" : "")
|
|
336
|
+
}, M(d(z)), 3)
|
|
315
337
|
], !0)
|
|
316
|
-
])) :
|
|
338
|
+
])) : S("", !0)
|
|
317
339
|
], 2));
|
|
318
340
|
}
|
|
319
|
-
}),
|
|
341
|
+
}), Le = /* @__PURE__ */ me(be, [["__scopeId", "data-v-c84ec649"]]);
|
|
320
342
|
export {
|
|
321
|
-
|
|
343
|
+
Le as default
|
|
322
344
|
};
|