energy-components 1.11.0 → 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/filterTag.es.js +70 -0
- package/dist/components/index.es.js +88 -85
- package/dist/components/modal.es.js +29 -27
- package/dist/components/style/button.css +1 -1
- package/dist/components/style/filterTag.css +1 -0
- 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 +116 -108
- package/dist/energy-components.es.js +3851 -3761
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/index.d.ts +1 -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,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import { R 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 pe = { class: "rds-e-textfield__container"
|
|
|
78
78
|
type: String,
|
|
79
79
|
default: "text",
|
|
80
80
|
validator: (t) => {
|
|
81
|
-
const s = ["text", "number", "password", "email", "tel", "url"],
|
|
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
|
/**
|
|
@@ -141,73 +141,75 @@ import './style/textField.css';const pe = { class: "rds-e-textfield__container"
|
|
|
141
141
|
type: String,
|
|
142
142
|
default: "off",
|
|
143
143
|
validator: (t, s) => {
|
|
144
|
-
const
|
|
145
|
-
return (s.password || s.type === "password") && !
|
|
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: s, emit:
|
|
151
|
-
const n = t, c =
|
|
152
|
-
type:
|
|
150
|
+
setup(t, { expose: s, emit: r }) {
|
|
151
|
+
const n = t, c = r, {
|
|
152
|
+
type: g,
|
|
153
153
|
label: P,
|
|
154
|
-
disabled:
|
|
154
|
+
disabled: N,
|
|
155
155
|
maxLength: j,
|
|
156
156
|
minLength: q,
|
|
157
|
-
modelValue:
|
|
158
|
-
icon:
|
|
159
|
-
rightIcon:
|
|
160
|
-
helper:
|
|
161
|
-
error:
|
|
162
|
-
helperText:
|
|
163
|
-
clearable:
|
|
157
|
+
modelValue: i,
|
|
158
|
+
icon: W,
|
|
159
|
+
rightIcon: O,
|
|
160
|
+
helper: U,
|
|
161
|
+
error: L,
|
|
162
|
+
helperText: z,
|
|
163
|
+
clearable: H,
|
|
164
164
|
password: _,
|
|
165
|
-
autocomplete:
|
|
166
|
-
fullWidth:
|
|
167
|
-
} =
|
|
168
|
-
if (_.value ||
|
|
169
|
-
return
|
|
170
|
-
}),
|
|
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
|
-
c("update:modelValue",
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
180
|
+
else l.value === "" && i.value === null && (u = null);
|
|
181
|
+
c("update:modelValue", u);
|
|
182
|
+
}, ee = () => {
|
|
183
|
+
b.value = !0;
|
|
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) => {
|
|
187
189
|
c("keydown", e);
|
|
188
|
-
},
|
|
190
|
+
}, le = (e) => {
|
|
189
191
|
c("keyup", e);
|
|
190
|
-
},
|
|
192
|
+
}, ae = (e) => {
|
|
191
193
|
c("keypress", e);
|
|
192
|
-
},
|
|
194
|
+
}, ne = (e) => {
|
|
193
195
|
c("change", e);
|
|
194
|
-
},
|
|
195
|
-
if (
|
|
196
|
-
const e =
|
|
197
|
-
return e.length > 0 && (e.length < q.value ||
|
|
198
|
-
}),
|
|
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
|
|
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(" ");
|
|
201
203
|
});
|
|
202
|
-
|
|
203
|
-
() =>
|
|
204
|
+
F(
|
|
205
|
+
() => i.value,
|
|
204
206
|
(e) => {
|
|
205
|
-
e !== null && String(e).length > 0 && (
|
|
207
|
+
e !== null && String(e).length > 0 && (w.value = "");
|
|
206
208
|
}
|
|
207
209
|
);
|
|
208
|
-
const o =
|
|
210
|
+
const o = v(() => {
|
|
209
211
|
const e = {
|
|
210
|
-
name:
|
|
212
|
+
name: W.value,
|
|
211
213
|
class: "",
|
|
212
214
|
events: {
|
|
213
215
|
click: () => {
|
|
@@ -219,7 +221,7 @@ import './style/textField.css';const pe = { class: "rds-e-textfield__container"
|
|
|
219
221
|
},
|
|
220
222
|
right: {
|
|
221
223
|
...e,
|
|
222
|
-
name:
|
|
224
|
+
name: O.value
|
|
223
225
|
}
|
|
224
226
|
};
|
|
225
227
|
return _.value ? {
|
|
@@ -235,7 +237,7 @@ import './style/textField.css';const pe = { class: "rds-e-textfield__container"
|
|
|
235
237
|
click: () => p.value = !p.value
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
|
-
} :
|
|
240
|
+
} : H.value ? {
|
|
239
241
|
left: {
|
|
240
242
|
...e
|
|
241
243
|
},
|
|
@@ -249,88 +251,94 @@ import './style/textField.css';const pe = { class: "rds-e-textfield__container"
|
|
|
249
251
|
}
|
|
250
252
|
} : l;
|
|
251
253
|
});
|
|
252
|
-
|
|
254
|
+
F(
|
|
253
255
|
_,
|
|
254
256
|
(e) => p.value = !e,
|
|
255
257
|
{ immediate: !0 }
|
|
256
258
|
);
|
|
257
|
-
const
|
|
258
|
-
const l =
|
|
259
|
+
const C = (e) => {
|
|
260
|
+
const l = pe.includes(e);
|
|
259
261
|
return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
|
|
260
|
-
},
|
|
261
|
-
var
|
|
262
|
-
((
|
|
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");
|
|
263
265
|
};
|
|
264
|
-
return
|
|
265
|
-
a.value && a.value.addEventListener("animationstart",
|
|
266
|
-
}),
|
|
267
|
-
a.value && a.value.removeEventListener("animationstart",
|
|
266
|
+
return ue(() => {
|
|
267
|
+
a.value && a.value.addEventListener("animationstart", $);
|
|
268
|
+
}), de(() => {
|
|
269
|
+
a.value && a.value.removeEventListener("animationstart", $);
|
|
268
270
|
}), s({
|
|
269
271
|
focus: () => {
|
|
270
|
-
a.value && (a.value.focus(),
|
|
272
|
+
a.value && (a.value.focus(), I());
|
|
271
273
|
},
|
|
272
274
|
blur: () => {
|
|
273
|
-
a.value && (a.value.blur(),
|
|
275
|
+
a.value && (a.value.blur(), T());
|
|
274
276
|
}
|
|
275
|
-
}), (e, l) => (
|
|
276
|
-
class:
|
|
277
|
+
}), (e, l) => (m(), V("div", {
|
|
278
|
+
class: k(["rds-e-textfield", se.value])
|
|
277
279
|
}, [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
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({
|
|
281
289
|
key: 0,
|
|
282
|
-
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 }],
|
|
283
291
|
"aria-hidden": "true"
|
|
284
|
-
}, o.value.left,
|
|
292
|
+
}, o.value.left, ce(o.value.left.events)), null, 16, ["class"])) : S("", !0)
|
|
285
293
|
], !0),
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
id:
|
|
294
|
+
h("div", he, [
|
|
295
|
+
h("input", {
|
|
296
|
+
id: B.value,
|
|
289
297
|
ref_key: "input",
|
|
290
298
|
ref: a,
|
|
291
|
-
type:
|
|
299
|
+
type: X.value,
|
|
292
300
|
class: "rds-e-textfield__input",
|
|
293
301
|
maxlength: n.type === "number" ? void 0 : n.maxLength,
|
|
294
302
|
minlength: n.type === "number" ? void 0 : n.minLength,
|
|
295
|
-
disabled:
|
|
303
|
+
disabled: d(N),
|
|
296
304
|
value: n.modelValue === null ? "" : n.modelValue,
|
|
297
|
-
autocomplete:
|
|
305
|
+
autocomplete: Y.value,
|
|
298
306
|
readonly: t.readonly,
|
|
299
|
-
onInput:
|
|
300
|
-
onBlur:
|
|
301
|
-
onFocus:
|
|
302
|
-
onKeydown:
|
|
303
|
-
onKeyup:
|
|
304
|
-
onKeypress:
|
|
305
|
-
onChange:
|
|
306
|
-
}, null, 40,
|
|
307
|
-
|
|
308
|
-
for:
|
|
309
|
-
class:
|
|
310
|
-
},
|
|
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)
|
|
311
319
|
]),
|
|
312
|
-
o.value.right.name || e.$slots["right-icon"] ? (
|
|
313
|
-
|
|
314
|
-
o.value.right.name &&
|
|
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({
|
|
315
323
|
key: 0,
|
|
316
324
|
"aria-hidden": "true",
|
|
317
325
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
318
326
|
}, o.value.right, {
|
|
319
|
-
onClick:
|
|
320
|
-
}), null, 16, ["onClick"])) :
|
|
327
|
+
onClick: fe(o.value.right.events.click, ["stop"])
|
|
328
|
+
}), null, 16, ["onClick"])) : S("", !0)
|
|
321
329
|
], !0)
|
|
322
|
-
])) :
|
|
323
|
-
]),
|
|
324
|
-
(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
class:
|
|
328
|
-
},
|
|
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)
|
|
329
337
|
], !0)
|
|
330
|
-
])) :
|
|
338
|
+
])) : S("", !0)
|
|
331
339
|
], 2));
|
|
332
340
|
}
|
|
333
|
-
}),
|
|
341
|
+
}), Le = /* @__PURE__ */ me(be, [["__scopeId", "data-v-c84ec649"]]);
|
|
334
342
|
export {
|
|
335
|
-
|
|
343
|
+
Le as default
|
|
336
344
|
};
|