energy-components 1.2.0 → 1.4.0-beta.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 (48) 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 +2 -2
  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 +83 -74
  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 +69 -86
  15. package/dist/components/radioButton.es.js +16 -16
  16. package/dist/components/selectionChip.es.js +87 -0
  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/quantitySelector.css +1 -1
  21. package/dist/components/style/selectionChip.css +1 -0
  22. package/dist/components/style/sidedrawer.css +1 -0
  23. package/dist/components/style/switch.css +1 -1
  24. package/dist/components/style/textArea.css +1 -1
  25. package/dist/components/style/textField.css +1 -1
  26. package/dist/components/style/toggle.css +1 -0
  27. package/dist/components/switch.es.js +40 -36
  28. package/dist/components/tabBar.es.js +12 -12
  29. package/dist/components/tag.es.js +5 -5
  30. package/dist/components/textArea.es.js +64 -57
  31. package/dist/components/textField.es.js +91 -77
  32. package/dist/components/toggle.es.js +53 -0
  33. package/dist/components/tooltip.es.js +61 -61
  34. package/dist/energy-components.es.js +4081 -3862
  35. package/dist/energy-components.umd.js +1 -1
  36. package/dist/style.css +1 -1
  37. package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
  38. package/dist/types/src/components/index.d.ts +3 -0
  39. package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +24 -19
  40. package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +120 -0
  41. package/dist/types/src/components/input/switch/switch.vue.d.ts +12 -3
  42. package/dist/types/src/components/input/text-field/text-field.vue.d.ts +8 -0
  43. package/dist/types/src/components/input/toggle/toggle.vue.d.ts +41 -0
  44. package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +75 -0
  45. package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +1 -1
  46. package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +1 -1
  47. package/dist/types/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +2 -2
@@ -1,12 +1,12 @@
1
- import { defineComponent as R, mergeModels as U, useModel as F, toRefs as G, computed as o, openBlock as s, createElementBlock as f, normalizeClass as h, createElementVNode as a, withDirectives as J, unref as e, vModelText as K, renderSlot as x, createBlock as M, mergeProps as I, toHandlers as q, createCommentVNode as i, createTextVNode as L, toDisplayString as u } from "vue";
2
- import { I as T } from "./icon-svg-GoL3_ayS.js";
3
- import { _ as O } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import './style/textArea.css';function y(t, m = !0, d = !0) {
5
- return m && !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;
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
+ import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import './style/textArea.css';function b(t, _ = !0, d = !0) {
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;
6
6
  }
7
- const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__input-container" }, X = ["id", "name", "maxlength", "minlength", "rows", "disabled"], Y = ["for"], Z = { key: 0 }, ee = { key: 0 }, te = { key: 1 }, re = { key: 0 }, ae = /* @__PURE__ */ R({
7
+ const Z = { class: "rds-e-textarea__container" }, ee = { class: "rds-e-textarea__input-container" }, te = ["id", "name", "maxlength", "minlength", "rows", "disabled"], re = ["for"], ae = { key: 0 }, le = { key: 0 }, ne = { key: 1 }, se = { key: 0 }, oe = /* @__PURE__ */ G({
8
8
  __name: "text-area",
9
- props: /* @__PURE__ */ U({
9
+ props: /* @__PURE__ */ J({
10
10
  /**
11
11
  * Etiqueta que se muestra sobre el campo de entrada. y Placeholder
12
12
  */
@@ -14,7 +14,7 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
14
14
  type: String,
15
15
  required: !0,
16
16
  validator(t) {
17
- return y(t, !0, !0);
17
+ return b(t, !0, !0);
18
18
  }
19
19
  },
20
20
  /**
@@ -24,7 +24,7 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
24
24
  type: String,
25
25
  required: !1,
26
26
  validator(t) {
27
- return y(t, !1, !0);
27
+ return b(t, !1, !0);
28
28
  }
29
29
  },
30
30
  /**
@@ -34,7 +34,7 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
34
34
  type: String,
35
35
  required: !1,
36
36
  validator(t) {
37
- return y(t, !1, !0);
37
+ return b(t, !1, !0);
38
38
  }
39
39
  },
40
40
  /**
@@ -136,26 +136,30 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
136
136
  }),
137
137
  emits: ["update:modelValue"],
138
138
  setup(t) {
139
- const m = t, d = F(t, "modelValue"), {
140
- label: b,
141
- id: w,
139
+ const _ = t, d = K(t, "modelValue"), {
140
+ label: w,
141
+ id: S,
142
142
  disabled: p,
143
- maxlength: v,
143
+ maxlength: m,
144
144
  minlength: g,
145
145
  modelValue: c,
146
- icon: $,
146
+ icon: A,
147
147
  rightIcon: k,
148
- helper: A,
149
- error: _,
150
- helperText: z,
151
- clearable: S,
152
- lengthError: D
153
- } = G(m), V = o(() => c.value.length === v.value), B = o(() => c.value.length === 0 ? !1 : c.value.length < g.value), E = o(() => D.value && (V.value || B.value)), P = o(() => {
148
+ helper: D,
149
+ error: x,
150
+ helperText: R,
151
+ clearable: V,
152
+ lengthError: z
153
+ } = L(_), v = O(!1), F = () => {
154
+ v.value = !1;
155
+ }, P = () => {
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(() => z.value && (B.value || E.value)), j = o(() => {
154
158
  const r = [];
155
- return c.value && r.push("rds-e-textarea--filled"), _.value && r.push("rds-e-textarea--error"), p.value && r.push("rds-e-textarea--disabled"), E.value && r.push("rds-e-textarea--error"), r.join(" ");
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(" ");
156
160
  }), l = o(() => {
157
161
  const r = {
158
- name: $.value,
162
+ name: A.value,
159
163
  class: "",
160
164
  events: {
161
165
  click: () => {
@@ -165,7 +169,7 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
165
169
  left: { ...r },
166
170
  right: { ...r, name: k.value }
167
171
  };
168
- return S.value && (n.right = {
172
+ return V.value && (n.right = {
169
173
  ...r,
170
174
  name: "close",
171
175
  class: "rds-e-textfield__icon--clear",
@@ -173,26 +177,28 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
173
177
  click: () => d.value = ""
174
178
  }
175
179
  }), n;
176
- }), j = o(() => c.value.length);
180
+ }), H = o(() => c.value.length);
177
181
  return (r, n) => {
178
- var N, C;
182
+ var C, M;
179
183
  return s(), f("div", {
180
- class: h(["rds-e-textarea", P.value])
184
+ class: h(["rds-e-textarea", j.value])
181
185
  }, [
182
- a("div", Q, [
183
- a("div", W, [
184
- J(a("textarea", {
185
- id: (N = e(w)) == null ? void 0 : N.toString(),
186
- "onUpdate:modelValue": n[0] || (n[0] = (H) => d.value = H),
186
+ a("div", Z, [
187
+ a("div", ee, [
188
+ Q(a("textarea", {
189
+ id: (C = e(S)) == null ? void 0 : C.toString(),
190
+ "onUpdate:modelValue": n[0] || (n[0] = (U) => d.value = U),
187
191
  type: "text",
188
- class: "rds-e-textarea__input",
192
+ class: h(["rds-e-textarea__input", { "rds-e-textarea__input--active": v.value }]),
189
193
  name: t.name,
190
- maxlength: e(v),
194
+ maxlength: e(m),
191
195
  minlength: e(g),
192
196
  rows: t.rows,
193
- disabled: e(p)
194
- }, null, 8, X), [
195
- [K, d.value]
197
+ disabled: e(p),
198
+ onBlur: F,
199
+ onFocus: P
200
+ }, null, 42, te), [
201
+ [W, d.value]
196
202
  ]),
197
203
  n[1] || (n[1] = a("div", { class: "rds-e-textarea__resize-handle" }, [
198
204
  a("svg", {
@@ -210,52 +216,53 @@ const Q = { class: "rds-e-textarea__container" }, W = { class: "rds-e-textarea__
210
216
  ])
211
217
  ], -1)),
212
218
  a("label", {
213
- for: (C = e(w)) == null ? void 0 : C.toString(),
219
+ for: (M = e(S)) == null ? void 0 : M.toString(),
214
220
  class: h(["rds-e-textarea__label", {
215
- "rds-e-textarea__label--with-icon": l.value.left.name
221
+ "rds-e-textarea__label--with-icon": l.value.left.name,
222
+ "rds-e-textarea__label--active": v.value
216
223
  }])
217
224
  }, [
218
- x(r.$slots, "left-icon", {}, () => [
219
- l.value.left.name ? (s(), M(T, I({
225
+ y(r.$slots, "left-icon", {}, () => [
226
+ l.value.left.name ? (s(), I($, q({
220
227
  key: 0,
221
- class: "rds-e-textarea__icon rds-e-textarea__icon--left",
228
+ class: ["rds-e-textarea__icon rds-e-textarea__icon--left", { "rds-e-textarea__icon--hidden": v.value }],
222
229
  "aria-hidden": "true"
223
- }, l.value.left, q(l.value.left.events)), null, 16)) : i("", !0)
230
+ }, l.value.left, T(l.value.left.events)), null, 16, ["class"])) : i("", !0)
224
231
  ], !0),
225
- L(" " + u(e(b)), 1)
226
- ], 10, Y),
232
+ X(" " + u(e(w)), 1)
233
+ ], 10, re),
227
234
  a("div", {
228
235
  class: h(["rds-e-textarea__counter", {
229
236
  "rds-e-textarea__counter--disabled": e(p),
230
- "rds-e-textarea__counter--clearable": e(S)
237
+ "rds-e-textarea__counter--clearable": e(V)
231
238
  }])
232
239
  }, [
233
- t.counter && !e(k) ? (s(), f("p", Z, u(j.value) + "/" + u(e(v)), 1)) : i("", !0),
234
- x(r.$slots, "right-icon", {}, () => [
235
- l.value.right.name && !l.value.left.name ? (s(), M(T, I({
240
+ t.counter && !e(k) ? (s(), f("p", ae, u(H.value) + "/" + u(e(m)), 1)) : i("", !0),
241
+ y(r.$slots, "right-icon", {}, () => [
242
+ l.value.right.name && !l.value.left.name ? (s(), I($, q({
236
243
  key: 0,
237
244
  class: "rds-e-textarea__icon rds-e-textarea__icon--right",
238
245
  "aria-hidden": "true"
239
- }, l.value.right, q(l.value.right.events)), null, 16)) : i("", !0)
246
+ }, l.value.right, T(l.value.right.events)), null, 16)) : i("", !0)
240
247
  ], !0)
241
248
  ], 2)
242
249
  ])
243
250
  ]),
244
251
  a("ul", {
245
- class: h(["rds-e-textarea__helper", e(_) || E.value ? "rds-e-textarea__helper--error" : ""])
252
+ class: h(["rds-e-textarea__helper", e(x) || N.value ? "rds-e-textarea__helper--error" : ""])
246
253
  }, [
247
- V.value ? (s(), f("li", ee, " Max text length is " + u(e(v)), 1)) : i("", !0),
248
- B.value ? (s(), f("li", te, " Min text length is " + u(e(g)), 1)) : i("", !0),
254
+ B.value ? (s(), f("li", le, " Max text length is " + u(e(m)), 1)) : i("", !0),
255
+ E.value ? (s(), f("li", ne, " Min text length is " + u(e(g)), 1)) : i("", !0),
249
256
  a("li", null, [
250
- x(r.$slots, "helper-text", {}, () => [
251
- e(A) || e(_) ? (s(), f("span", re, u(e(z)), 1)) : i("", !0)
257
+ y(r.$slots, "helper-text", {}, () => [
258
+ e(D) || e(x) ? (s(), f("span", se, u(e(R)), 1)) : i("", !0)
252
259
  ], !0)
253
260
  ])
254
261
  ], 2)
255
262
  ], 2);
256
263
  };
257
264
  }
258
- }), oe = /* @__PURE__ */ O(ae, [["__scopeId", "data-v-51c6b51e"]]);
265
+ }), ce = /* @__PURE__ */ Y(oe, [["__scopeId", "data-v-e01ef58d"]]);
259
266
  export {
260
- oe as default
267
+ ce as default
261
268
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as H, toRefs as M, ref as L, computed as s, watch as U, openBlock as u, createElementBlock as v, normalizeClass as h, createElementVNode as i, renderSlot as _, createBlock as A, mergeProps as S, toHandlers as G, createCommentVNode as g, unref as t, toDisplayString as B, createVNode as J, withModifiers as K } from "vue";
2
- import { g as O } from "./getInstance-GhoEcxLF.js";
3
- import { I as V } from "./icon-svg-GoL3_ayS.js";
4
- import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
- import './style/textField.css';const W = { class: "rds-e-textfield__container" }, X = { class: "rds-e-textfield__input-container" }, Y = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], Z = ["for"], ee = {
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
- }, te = { class: "rds-e-textfield__helper" }, le = /* @__PURE__ */ H({
8
+ }, oe = { class: "rds-e-textfield__helper" }, se = /* @__PURE__ */ G({
9
9
  __name: "text-field",
10
10
  props: {
11
11
  /**
@@ -117,44 +117,54 @@ import './style/textField.css';const W = { 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, {
129
- label: E,
130
- disabled: d,
131
- maxLength: y,
126
+ emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
127
+ setup(l, { emit: f }) {
128
+ const n = l, r = f, {
129
+ label: V,
130
+ disabled: u,
131
+ maxLength: x,
132
132
  minLength: b,
133
133
  modelValue: o,
134
- icon: I,
135
- rightIcon: T,
136
- helper: $,
137
- error: f,
138
- helperText: C,
139
- clearable: R,
140
- password: p,
141
- autocomplete: q
142
- } = M(a), n = L(!0), m = L(!1), D = O(), N = s(() => a.id || `text-field-${D}`), F = s(() => {
143
- if (p.value)
144
- return q.value;
145
- }), k = (e) => {
146
- m.value = !1, x(
134
+ icon: E,
135
+ rightIcon: I,
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
+ }), F = (e) => {
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 = !0;
152
- }, P = s(() => !!(f.value || o.value.length && (o.value.length < b.value || o.value.length > y.value))), z = 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(() => {
153
163
  const e = [];
154
- return o.value && e.push("rds-e-textfield--filled"), P.value && e.push("rds-e-textfield--error"), d.value && e.push("rds-e-textfield--disabled"), e.join(" ");
155
- }), 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(() => {
156
166
  const e = {
157
- name: I.value,
167
+ name: E.value,
158
168
  class: "",
159
169
  events: {
160
170
  click: () => {
@@ -166,23 +176,23 @@ import './style/textField.css';const W = { class: "rds-e-textfield__container" }
166
176
  },
167
177
  right: {
168
178
  ...e,
169
- name: T.value
179
+ name: I.value
170
180
  }
171
181
  };
172
- return p.value ? {
182
+ return m.value ? {
173
183
  left: {
174
184
  ...e,
175
185
  name: null
176
186
  },
177
187
  right: {
178
188
  ...e,
179
- name: n.value ? "eye_open" : "eye_close",
189
+ name: s.value ? "eye_open" : "eye_close",
180
190
  class: "rds-e-textfield__icon--password",
181
191
  events: {
182
- click: () => n.value = !n.value
192
+ click: () => s.value = !s.value
183
193
  }
184
194
  }
185
- } : R.value ? {
195
+ } : T.value ? {
186
196
  left: {
187
197
  ...e
188
198
  },
@@ -191,68 +201,72 @@ import './style/textField.css';const W = { class: "rds-e-textfield__container" }
191
201
  name: "close",
192
202
  class: "rds-e-textfield__icon--clear",
193
203
  events: {
194
- click: () => x("update:modelValue", "")
204
+ click: () => r("update:modelValue", "")
195
205
  }
196
206
  }
197
207
  } : w;
198
208
  });
199
- return U(
200
- p,
201
- (e) => n.value = !e,
209
+ return O(
210
+ m,
211
+ (e) => s.value = !e,
202
212
  { immediate: !0 }
203
- ), (e, w) => (u(), v("div", {
204
- class: h(["rds-e-textfield", z.value])
213
+ ), (e, w) => (c(), v("div", {
214
+ class: _(["rds-e-textfield", A.value])
205
215
  }, [
206
- i("div", W, [
207
- _(e.$slots, "left-icon", {}, () => [
208
- r.value.left.name ? (u(), A(V, S({
216
+ d("div", te, [
217
+ g(e.$slots, "left-icon", {}, () => [
218
+ a.value.left.name ? (c(), Q(B, S({
209
219
  key: 0,
210
- 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 }],
211
221
  "aria-hidden": "true"
212
- }, r.value.left, G(r.value.left.events)), null, 16, ["class"])) : g("", !0)
222
+ }, a.value.left, W(a.value.left.events)), null, 16, ["class"])) : y("", !0)
213
223
  ], !0),
214
- i("div", X, [
215
- i("input", {
216
- id: N.value,
217
- type: n.value ? "text" : "password",
224
+ d("div", le, [
225
+ d("input", {
226
+ id: k.value,
227
+ type: s.value ? "text" : "password",
218
228
  class: "rds-e-textfield__input",
219
- maxLength: t(y),
229
+ maxLength: t(x),
220
230
  minLength: t(b),
221
- disabled: t(d),
231
+ disabled: t(u),
222
232
  value: t(o),
223
- autocomplete: F.value,
233
+ autocomplete: q.value,
224
234
  readonly: l.readonly,
225
- onInput: k,
226
- onBlur: k,
227
- onFocus: j
228
- }, null, 40, Y),
229
- i("label", {
230
- for: N.value,
231
- class: h(["rds-e-textfield__label", t(d) ? "rds-e-textfield__label--disabled" : ""])
232
- }, B(t(E)), 11, Z)
235
+ onInput: F,
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)
233
247
  ]),
234
- r.value.right.name || e.$slots["right-icon"] ? (u(), v("span", ee, [
235
- _(e.$slots, "right-icon", {}, () => [
236
- J(V, S({
248
+ a.value.right.name || e.$slots["right-icon"] ? (c(), v("span", ne, [
249
+ g(e.$slots, "right-icon", {}, () => [
250
+ X(B, S({
237
251
  "aria-hidden": "true",
238
252
  class: "rds-e-textfield__icon rds-e-textfield__icon--right"
239
- }, r.value.right, {
240
- onClick: K(r.value.right.events.click, ["stop"])
253
+ }, a.value.right, {
254
+ onClick: Y(a.value.right.events.click, ["stop"])
241
255
  }), null, 16, ["onClick"])
242
256
  ], !0)
243
- ])) : g("", !0)
257
+ ])) : y("", !0)
244
258
  ]),
245
- i("div", te, [
246
- _(e.$slots, "helper-text", {}, () => [
247
- (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", {
248
262
  key: 0,
249
- class: h(t(f) ? "rds-e-textfield__helper--error" : "")
250
- }, B(t(C)), 3)) : g("", !0)
263
+ class: _(t(p) ? "rds-e-textfield__helper--error" : "")
264
+ }, L(t(R)), 3)) : y("", !0)
251
265
  ], !0)
252
266
  ])
253
267
  ], 2));
254
268
  }
255
- }), se = /* @__PURE__ */ Q(le, [["__scopeId", "data-v-2a397de0"]]);
269
+ }), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-b490642c"]]);
256
270
  export {
257
- se as default
271
+ fe as default
258
272
  };
@@ -0,0 +1,53 @@
1
+ import { defineComponent as T, toRefs as E, ref as L, onMounted as _, openBlock as y, createElementBlock as B, normalizeClass as d, createElementVNode as p, unref as i, toDisplayString as m } from "vue";
2
+ import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ import './style/toggle.css';const I = /* @__PURE__ */ T({
4
+ __name: "toggle",
5
+ props: {
6
+ small: { type: Boolean },
7
+ modelValue: { type: [Number, Boolean, String] },
8
+ switchType: { type: Boolean },
9
+ fullWidth: { type: Boolean },
10
+ valueLeft: {},
11
+ valueRight: {},
12
+ labelLeft: {},
13
+ labelRight: {}
14
+ },
15
+ emits: ["update:modelValue"],
16
+ setup(f, { emit: v }) {
17
+ const b = f, n = v, { modelValue: e, switchType: s, valueLeft: u, valueRight: o } = E(b), t = {
18
+ LEFT: "left",
19
+ RIGHT: "right"
20
+ }, a = L(t.LEFT), g = (l) => {
21
+ n("update:modelValue", l);
22
+ };
23
+ return _(() => {
24
+ s != null && s.value ? (n("update:modelValue", e == null ? void 0 : e.value), a.value = e != null && e.value ? t.RIGHT : t.LEFT) : (e == null ? void 0 : e.value) === (o == null ? void 0 : o.value) ? (n("update:modelValue", o == null ? void 0 : o.value), a.value = t.RIGHT) : (n("update:modelValue", u == null ? void 0 : u.value), a.value = t.LEFT);
25
+ }), (l, r) => (y(), B("div", {
26
+ class: d(["rds-e-toggle", [
27
+ {
28
+ "rds-e-toggle--full-width": l.fullWidth && !l.small,
29
+ "rds-e-toggle--width": !l.fullWidth && !l.small,
30
+ "rds-e-toggle--small": l.small
31
+ }
32
+ ]])
33
+ }, [
34
+ p("button", {
35
+ class: d(["rds-e-toggle__tab", {
36
+ "rds-e-toggle__tab--active": a.value === t.LEFT
37
+ }]),
38
+ type: "button",
39
+ onClick: r[0] || (r[0] = (c) => (g(i(s) ? !0 : i(u)), a.value = t.LEFT))
40
+ }, m(l.labelLeft), 3),
41
+ p("button", {
42
+ class: d(["rds-e-toggle__tab", {
43
+ "rds-e-toggle__tab--active": a.value === t.RIGHT
44
+ }]),
45
+ type: "button",
46
+ onClick: r[1] || (r[1] = (c) => (g(i(s) ? !1 : i(o)), a.value = t.RIGHT))
47
+ }, m(l.labelRight), 3)
48
+ ], 2));
49
+ }
50
+ }), H = /* @__PURE__ */ F(I, [["__scopeId", "data-v-191362c2"]]);
51
+ export {
52
+ H as default
53
+ };