energy-components 1.3.0 → 1.4.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/accordion.es.js +13 -13
  2. package/dist/components/button.es.js +11 -11
  3. package/dist/components/checkbox.es.js +7 -7
  4. package/dist/components/datepicker.es.js +1403 -1382
  5. package/dist/components/dropdown.es.js +11 -11
  6. package/dist/components/{icon-svg-GoL3_ayS.js → icon-svg-u9BWBbvW.js} +1 -1
  7. package/dist/components/iconList.es.js +5 -5
  8. package/dist/components/iconSvg.es.js +1 -1
  9. package/dist/components/index.es.js +59 -56
  10. package/dist/components/infoBox.es.js +8 -8
  11. package/dist/components/link.es.js +15 -15
  12. package/dist/components/modal.es.js +12 -12
  13. package/dist/components/persistentToast.es.js +5 -5
  14. package/dist/components/quantitySelector.es.js +9 -9
  15. package/dist/components/radioButton.es.js +16 -16
  16. package/dist/components/selectionChip.es.js +5 -5
  17. package/dist/components/sidedrawer.es.js +85 -0
  18. package/dist/components/style/datepicker.css +1 -1
  19. package/dist/components/style/overlay.css +1 -1
  20. package/dist/components/style/sidedrawer.css +1 -0
  21. package/dist/components/style/switch.css +1 -1
  22. package/dist/components/style/textField.css +1 -1
  23. package/dist/components/switch.es.js +40 -36
  24. package/dist/components/tabBar.es.js +12 -12
  25. package/dist/components/tag.es.js +5 -5
  26. package/dist/components/textArea.es.js +22 -22
  27. package/dist/components/textField.es.js +86 -74
  28. package/dist/components/tooltip.es.js +61 -61
  29. package/dist/energy-components.es.js +4464 -4347
  30. package/dist/energy-components.umd.js +1 -1
  31. package/dist/style.css +1 -1
  32. package/dist/types/src/components/index.d.ts +1 -0
  33. package/dist/types/src/components/input/switch/switch.vue.d.ts +12 -3
  34. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +8 -0
  35. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +75 -0
  36. package/dist/types/tsconfig.tsbuildinfo +1 -1
  37. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import { defineComponent as G, mergeModels as J, useModel as K, toRefs as L, ref as O, computed as o, openBlock as s, createElementBlock as f, normalizeClass as h, createElementVNode as a, withDirectives as Q, unref as e, vModelText as W, renderSlot as y, createBlock as M, mergeProps as q, toHandlers as T, createCommentVNode as i, createTextVNode as X, toDisplayString as u } from "vue";
2
- import { I as $ } from "./icon-svg-GoL3_ayS.js";
1
+ import { defineComponent as G, mergeModels as J, useModel as K, toRefs as L, ref as O, computed as o, openBlock as s, createElementBlock as f, normalizeClass as h, createElementVNode as a, withDirectives as Q, unref as e, vModelText as W, renderSlot as y, createBlock as I, mergeProps as q, toHandlers as T, createCommentVNode as i, createTextVNode as X, toDisplayString as u } from "vue";
2
+ import { R as $ } from "./icon-svg-u9BWBbvW.js";
3
3
  import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import './style/textArea.css';function b(t, _ = !0, d = !0) {
5
5
  return _ && !t.trim() ? (console.warn("Advertencia: El valor no puede estar vacío"), !1) : d && !/^[\w\-:]+$/.test(t) ? (console.warn("Advertencia: El valor contiene caracteres inválidos"), !1) : !0;
@@ -138,23 +138,23 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
138
138
  setup(t) {
139
139
  const _ = t, d = K(t, "modelValue"), {
140
140
  label: w,
141
- id: k,
141
+ id: S,
142
142
  disabled: p,
143
143
  maxlength: m,
144
144
  minlength: g,
145
145
  modelValue: c,
146
146
  icon: A,
147
- rightIcon: S,
148
- helper: z,
147
+ rightIcon: k,
148
+ helper: D,
149
149
  error: x,
150
- helperText: D,
150
+ helperText: R,
151
151
  clearable: V,
152
- lengthError: F
153
- } = L(_), v = O(!1), P = () => {
152
+ lengthError: z
153
+ } = L(_), v = O(!1), F = () => {
154
154
  v.value = !1;
155
- }, j = () => {
155
+ }, P = () => {
156
156
  v.value = !0;
157
- }, B = o(() => c.value.length === m.value), E = o(() => c.value.length === 0 ? !1 : c.value.length < g.value), N = o(() => F.value && (B.value || E.value)), H = o(() => {
157
+ }, B = o(() => c.value.length === m.value), E = o(() => c.value.length === 0 ? !1 : c.value.length < g.value), N = o(() => z.value && (B.value || E.value)), j = o(() => {
158
158
  const r = [];
159
159
  return c.value && r.push("rds-e-textarea--filled"), x.value && r.push("rds-e-textarea--error"), p.value && r.push("rds-e-textarea--disabled"), N.value && r.push("rds-e-textarea--error"), r.join(" ");
160
160
  }), l = o(() => {
@@ -167,7 +167,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
167
167
  }
168
168
  }, n = {
169
169
  left: { ...r },
170
- right: { ...r, name: S.value }
170
+ right: { ...r, name: k.value }
171
171
  };
172
172
  return V.value && (n.right = {
173
173
  ...r,
@@ -177,16 +177,16 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
177
177
  click: () => d.value = ""
178
178
  }
179
179
  }), n;
180
- }), R = o(() => c.value.length);
180
+ }), H = o(() => c.value.length);
181
181
  return (r, n) => {
182
- var C, I;
182
+ var C, M;
183
183
  return s(), f("div", {
184
- class: h(["rds-e-textarea", H.value])
184
+ class: h(["rds-e-textarea", j.value])
185
185
  }, [
186
186
  a("div", Z, [
187
187
  a("div", ee, [
188
188
  Q(a("textarea", {
189
- id: (C = e(k)) == null ? void 0 : C.toString(),
189
+ id: (C = e(S)) == null ? void 0 : C.toString(),
190
190
  "onUpdate:modelValue": n[0] || (n[0] = (U) => d.value = U),
191
191
  type: "text",
192
192
  class: h(["rds-e-textarea__input", { "rds-e-textarea__input--active": v.value }]),
@@ -195,8 +195,8 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
195
195
  minlength: e(g),
196
196
  rows: t.rows,
197
197
  disabled: e(p),
198
- onBlur: P,
199
- onFocus: j
198
+ onBlur: F,
199
+ onFocus: P
200
200
  }, null, 42, te), [
201
201
  [W, d.value]
202
202
  ]),
@@ -216,14 +216,14 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
216
216
  ])
217
217
  ], -1)),
218
218
  a("label", {
219
- for: (I = e(k)) == null ? void 0 : I.toString(),
219
+ for: (M = e(S)) == null ? void 0 : M.toString(),
220
220
  class: h(["rds-e-textarea__label", {
221
221
  "rds-e-textarea__label--with-icon": l.value.left.name,
222
222
  "rds-e-textarea__label--active": v.value
223
223
  }])
224
224
  }, [
225
225
  y(r.$slots, "left-icon", {}, () => [
226
- l.value.left.name ? (s(), M($, q({
226
+ l.value.left.name ? (s(), I($, q({
227
227
  key: 0,
228
228
  class: ["rds-e-textarea__icon rds-e-textarea__icon--left", { "rds-e-textarea__icon--hidden": v.value }],
229
229
  "aria-hidden": "true"
@@ -237,9 +237,9 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
237
237
  "rds-e-textarea__counter--clearable": e(V)
238
238
  }])
239
239
  }, [
240
- t.counter && !e(S) ? (s(), f("p", ae, u(R.value) + "/" + u(e(m)), 1)) : i("", !0),
240
+ t.counter && !e(k) ? (s(), f("p", ae, u(H.value) + "/" + u(e(m)), 1)) : i("", !0),
241
241
  y(r.$slots, "right-icon", {}, () => [
242
- l.value.right.name && !l.value.left.name ? (s(), M($, q({
242
+ l.value.right.name && !l.value.left.name ? (s(), I($, q({
243
243
  key: 0,
244
244
  class: "rds-e-textarea__icon rds-e-textarea__icon--right",
245
245
  "aria-hidden": "true"
@@ -255,7 +255,7 @@ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea_
255
255
  E.value ? (s(), f("li", ne, " Min text length is " + u(e(g)), 1)) : i("", !0),
256
256
  a("li", null, [
257
257
  y(r.$slots, "helper-text", {}, () => [
258
- e(z) || e(x) ? (s(), f("span", se, u(e(D)), 1)) : i("", !0)
258
+ e(D) || e(x) ? (s(), f("span", se, u(e(R)), 1)) : i("", !0)
259
259
  ], !0)
260
260
  ])
261
261
  ], 2)
@@ -1,11 +1,11 @@
1
- import { defineComponent as M, toRefs as U, ref as w, computed as s, watch as A, openBlock as u, createElementBlock as v, normalizeClass as h, createElementVNode as i, renderSlot as _, createBlock as G, mergeProps as L, toHandlers as J, createCommentVNode as g, unref as t, toDisplayString as S, createVNode as K, withModifiers as O } from "vue";
2
- import { g as Q } from "./getInstance-GhoEcxLF.js";
3
- import { I as B } from "./icon-svg-GoL3_ayS.js";
4
- import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/textField.css';const X = { class: "rds-e-textfield__container" }, Y = { class: "rds-e-textfield__input-container" }, Z = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], ee = ["for"], te = {
1
+ import { defineComponent as G, toRefs as J, ref as N, computed as i, watch as O, openBlock as c, createElementBlock as v, normalizeClass as _, createElementVNode as d, renderSlot as g, createBlock as Q, mergeProps as S, toHandlers as W, createCommentVNode as y, unref as t, toDisplayString as L, createVNode as X, withModifiers as Y } from "vue";
2
+ import { g as Z } from "./getInstance-GhoEcxLF.js";
3
+ import { R as B } from "./icon-svg-u9BWBbvW.js";
4
+ import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
+ import './style/textField.css';const te = { class: "rds-e-textfield__container" }, le = { class: "rds-e-textfield__input-container" }, re = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], ae = ["for"], ne = {
6
6
  key: 0,
7
7
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
8
- }, le = { class: "rds-e-textfield__helper" }, re = /* @__PURE__ */ M({
8
+ }, oe = { class: "rds-e-textfield__helper" }, se = /* @__PURE__ */ G({
9
9
  __name: "text-field",
10
10
  props: {
11
11
  /**
@@ -117,44 +117,52 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
117
117
  autocomplete: {
118
118
  type: String,
119
119
  default: "off",
120
- validator: (l, c) => {
121
- const a = ["new-password", "current-password", "off"];
122
- return c.password && !a.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${a.join(", ")}`), !1) : !0;
120
+ validator: (l, f) => {
121
+ const n = ["new-password", "current-password", "off"];
122
+ return f.password && !n.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${n.join(", ")}`), !1) : !0;
123
123
  }
124
124
  }
125
125
  },
126
- emits: ["update:modelValue"],
127
- setup(l, { emit: c }) {
128
- const a = l, x = c, {
126
+ emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
127
+ setup(l, { emit: f }) {
128
+ const n = l, r = f, {
129
129
  label: V,
130
- disabled: d,
131
- maxLength: y,
130
+ disabled: u,
131
+ maxLength: x,
132
132
  minLength: b,
133
133
  modelValue: o,
134
134
  icon: E,
135
135
  rightIcon: I,
136
- helper: T,
137
- error: f,
138
- helperText: $,
139
- clearable: C,
140
- password: p,
141
- autocomplete: R
142
- } = U(a), n = w(!0), m = w(!1), q = Q(), N = s(() => a.id || `text-field-${q}`), D = s(() => {
143
- if (p.value)
144
- return R.value;
136
+ helper: C,
137
+ error: p,
138
+ helperText: R,
139
+ clearable: T,
140
+ password: m,
141
+ autocomplete: $
142
+ } = J(n), s = N(!0), h = N(!1), D = Z(), k = i(() => n.id || `text-field-${D}`), q = i(() => {
143
+ if (m.value)
144
+ return $.value;
145
145
  }), F = (e) => {
146
- x(
146
+ r(
147
147
  "update:modelValue",
148
148
  e.target.value
149
149
  );
150
+ }, K = () => {
151
+ h.value = !1;
150
152
  }, j = () => {
151
- m.value = !1;
152
- }, P = () => {
153
- m.value = !0;
154
- }, z = s(() => !!(f.value || o.value.length && (o.value.length < b.value || o.value.length > y.value))), H = s(() => {
153
+ h.value = !0;
154
+ }, P = (e) => {
155
+ r("keydown", e);
156
+ }, z = (e) => {
157
+ r("keyup", e);
158
+ }, H = (e) => {
159
+ r("keypress", e);
160
+ }, M = (e) => {
161
+ r("change", e);
162
+ }, U = i(() => !!(p.value || o.value.length && (o.value.length < b.value || o.value.length > x.value))), A = i(() => {
155
163
  const e = [];
156
- return o.value && e.push("rds-e-textfield--filled"), z.value && e.push("rds-e-textfield--error"), d.value && e.push("rds-e-textfield--disabled"), e.join(" ");
157
- }), r = s(() => {
164
+ return o.value && e.push("rds-e-textfield--filled"), U.value && e.push("rds-e-textfield--error"), u.value && e.push("rds-e-textfield--disabled"), e.join(" ");
165
+ }), a = i(() => {
158
166
  const e = {
159
167
  name: E.value,
160
168
  class: "",
@@ -162,7 +170,7 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
162
170
  click: () => {
163
171
  }
164
172
  }
165
- }, k = {
173
+ }, w = {
166
174
  left: {
167
175
  ...e
168
176
  },
@@ -171,20 +179,20 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
171
179
  name: I.value
172
180
  }
173
181
  };
174
- return p.value ? {
182
+ return m.value ? {
175
183
  left: {
176
184
  ...e,
177
185
  name: null
178
186
  },
179
187
  right: {
180
188
  ...e,
181
- name: n.value ? "eye_open" : "eye_close",
189
+ name: s.value ? "eye_open" : "eye_close",
182
190
  class: "rds-e-textfield__icon--password",
183
191
  events: {
184
- click: () => n.value = !n.value
192
+ click: () => s.value = !s.value
185
193
  }
186
194
  }
187
- } : C.value ? {
195
+ } : T.value ? {
188
196
  left: {
189
197
  ...e
190
198
  },
@@ -193,68 +201,72 @@ import './style/textField.css';const X = { class: "rds-e-textfield__container" }
193
201
  name: "close",
194
202
  class: "rds-e-textfield__icon--clear",
195
203
  events: {
196
- click: () => x("update:modelValue", "")
204
+ click: () => r("update:modelValue", "")
197
205
  }
198
206
  }
199
- } : k;
207
+ } : w;
200
208
  });
201
- return A(
202
- p,
203
- (e) => n.value = !e,
209
+ return O(
210
+ m,
211
+ (e) => s.value = !e,
204
212
  { immediate: !0 }
205
- ), (e, k) => (u(), v("div", {
206
- class: h(["rds-e-textfield", H.value])
213
+ ), (e, w) => (c(), v("div", {
214
+ class: _(["rds-e-textfield", A.value])
207
215
  }, [
208
- i("div", X, [
209
- _(e.$slots, "left-icon", {}, () => [
210
- r.value.left.name ? (u(), G(B, L({
216
+ d("div", te, [
217
+ g(e.$slots, "left-icon", {}, () => [
218
+ a.value.left.name ? (c(), Q(B, S({
211
219
  key: 0,
212
- class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": m.value }],
220
+ class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": h.value }],
213
221
  "aria-hidden": "true"
214
- }, r.value.left, J(r.value.left.events)), null, 16, ["class"])) : g("", !0)
222
+ }, a.value.left, W(a.value.left.events)), null, 16, ["class"])) : y("", !0)
215
223
  ], !0),
216
- i("div", Y, [
217
- i("input", {
218
- id: N.value,
219
- type: n.value ? "text" : "password",
224
+ d("div", le, [
225
+ d("input", {
226
+ id: k.value,
227
+ type: s.value ? "text" : "password",
220
228
  class: "rds-e-textfield__input",
221
- maxLength: t(y),
229
+ maxLength: t(x),
222
230
  minLength: t(b),
223
- disabled: t(d),
231
+ disabled: t(u),
224
232
  value: t(o),
225
- autocomplete: D.value,
233
+ autocomplete: q.value,
226
234
  readonly: l.readonly,
227
235
  onInput: F,
228
- onBlur: j,
229
- onFocus: P
230
- }, null, 40, Z),
231
- i("label", {
232
- for: N.value,
233
- class: h(["rds-e-textfield__label", t(d) ? "rds-e-textfield__label--disabled" : ""])
234
- }, S(t(V)), 11, ee)
236
+ onBlur: K,
237
+ onFocus: j,
238
+ onKeydown: P,
239
+ onKeyup: z,
240
+ onKeypress: H,
241
+ onChange: M
242
+ }, null, 40, re),
243
+ d("label", {
244
+ for: k.value,
245
+ class: _(["rds-e-textfield__label", t(u) ? "rds-e-textfield__label--disabled" : ""])
246
+ }, L(t(V)), 11, ae)
235
247
  ]),
236
- r.value.right.name || e.$slots["right-icon"] ? (u(), v("span", te, [
237
- _(e.$slots, "right-icon", {}, () => [
238
- K(B, L({
248
+ a.value.right.name || e.$slots["right-icon"] ? (c(), v("span", ne, [
249
+ g(e.$slots, "right-icon", {}, () => [
250
+ X(B, S({
239
251
  "aria-hidden": "true",
240
252
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
241
- }, r.value.right, {
242
- onClick: O(r.value.right.events.click, ["stop"])
253
+ }, a.value.right, {
254
+ onClick: Y(a.value.right.events.click, ["stop"])
243
255
  }), null, 16, ["onClick"])
244
256
  ], !0)
245
- ])) : g("", !0)
257
+ ])) : y("", !0)
246
258
  ]),
247
- i("div", le, [
248
- _(e.$slots, "helper-text", {}, () => [
249
- (t(T) || t(f)) && !t(d) ? (u(), v("span", {
259
+ d("div", oe, [
260
+ g(e.$slots, "helper-text", {}, () => [
261
+ (t(C) || t(p)) && !t(u) ? (c(), v("span", {
250
262
  key: 0,
251
- class: h(t(f) ? "rds-e-textfield__helper--error" : "")
252
- }, S(t($)), 3)) : g("", !0)
263
+ class: _(t(p) ? "rds-e-textfield__helper--error" : "")
264
+ }, L(t(R)), 3)) : y("", !0)
253
265
  ], !0)
254
266
  ])
255
267
  ], 2));
256
268
  }
257
- }), ie = /* @__PURE__ */ W(re, [["__scopeId", "data-v-ec322549"]]);
269
+ }), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-b490642c"]]);
258
270
  export {
259
- ie as default
271
+ fe as default
260
272
  };