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