energy-components 1.10.0 → 1.11.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/breadcrumbs.es.js +21 -19
- package/dist/components/button.es.js +56 -48
- 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/index.es.js +73 -70
- package/dist/components/link.es.js +59 -47
- package/dist/components/pagination.es.js +129 -80
- package/dist/components/sidedrawer.es.js +48 -43
- package/dist/components/style/actionButton.css +1 -1
- package/dist/components/style/breadcrumbs.css +1 -1
- 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/floatingActionButton.css +1 -1
- package/dist/components/style/link.css +1 -1
- package/dist/components/style/modal.css +1 -1
- package/dist/components/style/pagination.css +1 -1
- package/dist/components/style/selectionChip.css +1 -1
- package/dist/components/style/sidedrawer.css +1 -1
- package/dist/components/style/tabBar.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/tabBar.es.js +95 -84
- package/dist/components/textField.es.js +122 -108
- package/dist/energy-components.es.js +4468 -4276
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/buttons/button/button.vue.d.ts +15 -0
- package/dist/types/src/components/content/collapsable/collapsable.vue.d.ts +53 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/input/datepicker/datepicker.vue.d.ts +15 -0
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +7 -5
- package/dist/types/src/components/navigation/link/link.vue.d.ts +15 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +29 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -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 ne, toRefs as oe, ref as x, computed as f, watch as $, onMounted as re, onBeforeUnmount as se, createElementBlock as k, openBlock as v, normalizeClass as N, createElementVNode as m, createCommentVNode as b, renderSlot as L, createBlock as R, mergeProps as F, toHandlers as ie, unref as r, toDisplayString as D, withModifiers as ue } from "vue";
|
|
2
|
+
import { g as de } from "./getInstance-GhoEcxLF.js";
|
|
3
|
+
import { R as A, s as ce } from "./icon-svg-DuzOdbk1.js";
|
|
4
|
+
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
import './style/textField.css';const pe = { class: "rds-e-textfield__container" }, ve = { class: "rds-e-textfield__input-container" }, me = ["id", "type", "maxlength", "minlength", "disabled", "value", "autocomplete", "readonly"], he = ["for"], ge = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
8
|
-
},
|
|
8
|
+
}, _e = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "rds-e-textfield__helper"
|
|
11
|
-
},
|
|
11
|
+
}, ye = /* @__PURE__ */ ne({
|
|
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"], i = s.includes(t);
|
|
82
|
+
return i || console.warn(`[RDSTextfield]: El valor de la prop 'type' debe ser uno de: ${s.join(", ")}. Valor recibido: ${t}`), i;
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
/**
|
|
@@ -140,67 +140,74 @@ 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 i = ["new-password", "current-password", "off"];
|
|
145
|
+
return (s.password || s.type === "password") && !i.includes(t) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${i.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:
|
|
150
|
+
setup(t, { expose: s, emit: i }) {
|
|
151
|
+
const n = t, c = i, {
|
|
152
|
+
type: h,
|
|
153
|
+
label: P,
|
|
154
|
+
disabled: g,
|
|
155
|
+
maxLength: j,
|
|
156
|
+
minLength: q,
|
|
157
157
|
modelValue: u,
|
|
158
|
-
icon:
|
|
159
|
-
rightIcon:
|
|
160
|
-
helper:
|
|
161
|
-
error:
|
|
162
|
-
helperText:
|
|
163
|
-
clearable:
|
|
164
|
-
password:
|
|
165
|
-
autocomplete:
|
|
158
|
+
icon: K,
|
|
159
|
+
rightIcon: W,
|
|
160
|
+
helper: M,
|
|
161
|
+
error: w,
|
|
162
|
+
helperText: O,
|
|
163
|
+
clearable: U,
|
|
164
|
+
password: _,
|
|
165
|
+
autocomplete: z,
|
|
166
166
|
fullWidth: H
|
|
167
|
-
} =
|
|
168
|
-
if (
|
|
169
|
-
return
|
|
170
|
-
}),
|
|
167
|
+
} = oe(n), a = x(null), p = x(!0), S = x(!1), G = de(), y = x(""), V = f(() => n.id || `text-field-${G}`), J = f(() => _.value ? p.value ? "text" : "password" : h.value), Q = f(() => {
|
|
168
|
+
if (_.value || h.value === "password")
|
|
169
|
+
return z.value;
|
|
170
|
+
}), X = (e) => {
|
|
171
171
|
const l = e.target;
|
|
172
|
-
let
|
|
173
|
-
if (
|
|
172
|
+
let d = l.value;
|
|
173
|
+
if (h.value === "number")
|
|
174
174
|
if (l.value.trim() === "")
|
|
175
|
-
|
|
175
|
+
d = null;
|
|
176
176
|
else {
|
|
177
|
-
const
|
|
178
|
-
|
|
177
|
+
const C = Number.parseFloat(l.value);
|
|
178
|
+
d = Number.isNaN(C) ? l.value : C;
|
|
179
179
|
}
|
|
180
|
-
else l.value === "" && u.value === null && (
|
|
181
|
-
|
|
182
|
-
}, B = () => {
|
|
183
|
-
b.value = !1;
|
|
180
|
+
else l.value === "" && u.value === null && (d = null);
|
|
181
|
+
c("update:modelValue", d);
|
|
184
182
|
}, E = () => {
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
}, Q = (e) => {
|
|
189
|
-
i("keyup", e);
|
|
190
|
-
}, X = (e) => {
|
|
191
|
-
i("keypress", e);
|
|
183
|
+
S.value = !1;
|
|
184
|
+
}, B = () => {
|
|
185
|
+
S.value = !0;
|
|
192
186
|
}, Y = (e) => {
|
|
193
|
-
|
|
194
|
-
}, Z =
|
|
195
|
-
|
|
187
|
+
c("keydown", e);
|
|
188
|
+
}, Z = (e) => {
|
|
189
|
+
c("keyup", e);
|
|
190
|
+
}, ee = (e) => {
|
|
191
|
+
c("keypress", e);
|
|
192
|
+
}, te = (e) => {
|
|
193
|
+
c("change", e);
|
|
194
|
+
}, le = f(() => {
|
|
195
|
+
if (w.value) return !0;
|
|
196
196
|
const e = u.value === null || u.value === void 0 ? "" : String(u.value);
|
|
197
|
-
return e.length > 0 && (e.length <
|
|
198
|
-
}),
|
|
197
|
+
return e.length > 0 && (e.length < q.value || h.value !== "number" && e.length > j.value);
|
|
198
|
+
}), ae = f(() => {
|
|
199
199
|
const e = [];
|
|
200
|
-
return u.value !== null && String(u.value).length > 0 && e.push("rds-e-textfield--filled"),
|
|
201
|
-
})
|
|
200
|
+
return y.value !== "" && e.push(y.value), u.value !== null && String(u.value).length > 0 && e.push("rds-e-textfield--filled"), le.value && e.push("rds-e-textfield--error"), g.value && e.push("rds-e-textfield--disabled"), H.value && e.push("rds-e-textfield--full-width"), e.join(" ");
|
|
201
|
+
});
|
|
202
|
+
$(
|
|
203
|
+
() => u.value,
|
|
204
|
+
(e) => {
|
|
205
|
+
e !== null && String(e).length > 0 && (y.value = "");
|
|
206
|
+
}
|
|
207
|
+
);
|
|
208
|
+
const o = f(() => {
|
|
202
209
|
const e = {
|
|
203
|
-
name:
|
|
210
|
+
name: K.value,
|
|
204
211
|
class: "",
|
|
205
212
|
events: {
|
|
206
213
|
click: () => {
|
|
@@ -212,23 +219,23 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
212
219
|
},
|
|
213
220
|
right: {
|
|
214
221
|
...e,
|
|
215
|
-
name:
|
|
222
|
+
name: W.value
|
|
216
223
|
}
|
|
217
224
|
};
|
|
218
|
-
return
|
|
225
|
+
return _.value ? {
|
|
219
226
|
left: {
|
|
220
227
|
...e,
|
|
221
228
|
name: null
|
|
222
229
|
},
|
|
223
230
|
right: {
|
|
224
231
|
...e,
|
|
225
|
-
name:
|
|
232
|
+
name: p.value ? "eye_open" : "eye_close",
|
|
226
233
|
class: "rds-e-textfield__icon--password",
|
|
227
234
|
events: {
|
|
228
|
-
click: () =>
|
|
235
|
+
click: () => p.value = !p.value
|
|
229
236
|
}
|
|
230
237
|
}
|
|
231
|
-
} :
|
|
238
|
+
} : U.value ? {
|
|
232
239
|
left: {
|
|
233
240
|
...e
|
|
234
241
|
},
|
|
@@ -237,86 +244,93 @@ import './style/textField.css';const ue = { class: "rds-e-textfield__container"
|
|
|
237
244
|
name: "close",
|
|
238
245
|
class: "rds-e-textfield__icon--clear",
|
|
239
246
|
events: {
|
|
240
|
-
click: () =>
|
|
247
|
+
click: () => c("update:modelValue", "")
|
|
241
248
|
}
|
|
242
249
|
}
|
|
243
250
|
} : l;
|
|
244
251
|
});
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
(e) =>
|
|
252
|
+
$(
|
|
253
|
+
_,
|
|
254
|
+
(e) => p.value = !e,
|
|
248
255
|
{ immediate: !0 }
|
|
249
256
|
);
|
|
250
|
-
const
|
|
251
|
-
const l =
|
|
257
|
+
const T = (e) => {
|
|
258
|
+
const l = ce.includes(e);
|
|
252
259
|
return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
|
|
260
|
+
}, I = (e) => {
|
|
261
|
+
var d;
|
|
262
|
+
((d = a.value) == null ? void 0 : d.matches(":-webkit-autofill")) && e.animationName.startsWith("onAutoFillStart") && (y.value = "rds-e-textfield--filled");
|
|
253
263
|
};
|
|
254
|
-
return
|
|
264
|
+
return re(() => {
|
|
265
|
+
a.value && a.value.addEventListener("animationstart", I);
|
|
266
|
+
}), se(() => {
|
|
267
|
+
a.value && a.value.removeEventListener("animationstart", I);
|
|
268
|
+
}), s({
|
|
255
269
|
focus: () => {
|
|
256
|
-
|
|
270
|
+
a.value && (a.value.focus(), B());
|
|
257
271
|
},
|
|
258
272
|
blur: () => {
|
|
259
|
-
|
|
273
|
+
a.value && (a.value.blur(), E());
|
|
260
274
|
}
|
|
261
|
-
}), (e, l) => (
|
|
262
|
-
class:
|
|
275
|
+
}), (e, l) => (v(), k("div", {
|
|
276
|
+
class: N(["rds-e-textfield", ae.value])
|
|
263
277
|
}, [
|
|
264
|
-
m("div",
|
|
265
|
-
|
|
266
|
-
|
|
278
|
+
m("div", pe, [
|
|
279
|
+
L(e.$slots, "left-icon", {}, () => [
|
|
280
|
+
o.value.left.name && T(o.value.left.name) ? (v(), R(A, F({
|
|
267
281
|
key: 0,
|
|
268
|
-
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden":
|
|
282
|
+
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": S.value }],
|
|
269
283
|
"aria-hidden": "true"
|
|
270
|
-
},
|
|
284
|
+
}, o.value.left, ie(o.value.left.events)), null, 16, ["class"])) : b("", !0)
|
|
271
285
|
], !0),
|
|
272
|
-
m("div",
|
|
286
|
+
m("div", ve, [
|
|
273
287
|
m("input", {
|
|
274
288
|
id: V.value,
|
|
275
289
|
ref_key: "input",
|
|
276
|
-
ref:
|
|
277
|
-
type:
|
|
290
|
+
ref: a,
|
|
291
|
+
type: J.value,
|
|
278
292
|
class: "rds-e-textfield__input",
|
|
279
|
-
maxlength:
|
|
280
|
-
minlength:
|
|
281
|
-
disabled:
|
|
282
|
-
value:
|
|
283
|
-
autocomplete:
|
|
293
|
+
maxlength: n.type === "number" ? void 0 : n.maxLength,
|
|
294
|
+
minlength: n.type === "number" ? void 0 : n.minLength,
|
|
295
|
+
disabled: r(g),
|
|
296
|
+
value: n.modelValue === null ? "" : n.modelValue,
|
|
297
|
+
autocomplete: Q.value,
|
|
284
298
|
readonly: t.readonly,
|
|
285
|
-
onInput:
|
|
286
|
-
onBlur:
|
|
287
|
-
onFocus:
|
|
288
|
-
onKeydown:
|
|
289
|
-
onKeyup:
|
|
290
|
-
onKeypress:
|
|
291
|
-
onChange:
|
|
292
|
-
}, null, 40,
|
|
299
|
+
onInput: X,
|
|
300
|
+
onBlur: E,
|
|
301
|
+
onFocus: B,
|
|
302
|
+
onKeydown: Y,
|
|
303
|
+
onKeyup: Z,
|
|
304
|
+
onKeypress: ee,
|
|
305
|
+
onChange: te
|
|
306
|
+
}, null, 40, me),
|
|
293
307
|
m("label", {
|
|
294
308
|
for: V.value,
|
|
295
|
-
class:
|
|
296
|
-
},
|
|
309
|
+
class: N(["rds-e-textfield__label", r(g) ? "rds-e-textfield__label--disabled" : ""])
|
|
310
|
+
}, D(r(P)), 11, he)
|
|
297
311
|
]),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
312
|
+
o.value.right.name || e.$slots["right-icon"] ? (v(), k("span", ge, [
|
|
313
|
+
L(e.$slots, "right-icon", {}, () => [
|
|
314
|
+
o.value.right.name && T(o.value.right.name) ? (v(), R(A, F({
|
|
301
315
|
key: 0,
|
|
302
316
|
"aria-hidden": "true",
|
|
303
317
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
304
|
-
},
|
|
305
|
-
onClick:
|
|
306
|
-
}), null, 16, ["onClick"])) :
|
|
318
|
+
}, o.value.right, {
|
|
319
|
+
onClick: ue(o.value.right.events.click, ["stop"])
|
|
320
|
+
}), null, 16, ["onClick"])) : b("", !0)
|
|
307
321
|
], !0)
|
|
308
|
-
])) :
|
|
322
|
+
])) : b("", !0)
|
|
309
323
|
]),
|
|
310
|
-
(
|
|
311
|
-
|
|
324
|
+
(r(M) || r(w)) && !r(g) ? (v(), k("div", _e, [
|
|
325
|
+
L(e.$slots, "helper-text", {}, () => [
|
|
312
326
|
m("span", {
|
|
313
|
-
class:
|
|
314
|
-
},
|
|
327
|
+
class: N(r(w) ? "rds-e-textfield__helper--error" : "")
|
|
328
|
+
}, D(r(O)), 3)
|
|
315
329
|
], !0)
|
|
316
|
-
])) :
|
|
330
|
+
])) : b("", !0)
|
|
317
331
|
], 2));
|
|
318
332
|
}
|
|
319
|
-
}),
|
|
333
|
+
}), ke = /* @__PURE__ */ fe(ye, [["__scopeId", "data-v-7ba97dce"]]);
|
|
320
334
|
export {
|
|
321
|
-
|
|
335
|
+
ke as default
|
|
322
336
|
};
|