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.
- package/dist/components/accordion.es.js +13 -13
- package/dist/components/button.es.js +11 -11
- package/dist/components/checkbox.es.js +7 -7
- package/dist/components/datepicker.es.js +2 -2
- package/dist/components/dropdown.es.js +11 -11
- package/dist/components/{icon-svg-GoL3_ayS.js → icon-svg-u9BWBbvW.js} +1 -1
- package/dist/components/iconList.es.js +5 -5
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +83 -74
- package/dist/components/infoBox.es.js +8 -8
- package/dist/components/link.es.js +15 -15
- package/dist/components/modal.es.js +12 -12
- package/dist/components/persistentToast.es.js +5 -5
- package/dist/components/quantitySelector.es.js +69 -86
- package/dist/components/radioButton.es.js +16 -16
- package/dist/components/selectionChip.es.js +87 -0
- package/dist/components/sidedrawer.es.js +85 -0
- package/dist/components/style/datepicker.css +1 -1
- package/dist/components/style/overlay.css +1 -1
- package/dist/components/style/quantitySelector.css +1 -1
- package/dist/components/style/selectionChip.css +1 -0
- package/dist/components/style/sidedrawer.css +1 -0
- package/dist/components/style/switch.css +1 -1
- package/dist/components/style/textArea.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/style/toggle.css +1 -0
- package/dist/components/switch.es.js +40 -36
- package/dist/components/tabBar.es.js +12 -12
- package/dist/components/tag.es.js +5 -5
- package/dist/components/textArea.es.js +64 -57
- package/dist/components/textField.es.js +91 -77
- package/dist/components/toggle.es.js +53 -0
- package/dist/components/tooltip.es.js +61 -61
- package/dist/energy-components.es.js +4081 -3862
- package/dist/energy-components.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +3 -0
- package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +24 -19
- package/dist/types/src/components/input/selection-chip/selection-chip.vue.d.ts +120 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +12 -3
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +8 -0
- package/dist/types/src/components/input/toggle/toggle.vue.d.ts +41 -0
- package/dist/types/src/components/layout/sidedrawer/sidedrawer.vue.d.ts +75 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +1 -1
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
4
|
-
import './style/textArea.css';function
|
|
5
|
-
return
|
|
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
|
|
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__ */
|
|
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
|
|
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
|
|
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
|
|
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
|
|
140
|
-
label:
|
|
141
|
-
id:
|
|
139
|
+
const _ = t, d = K(t, "modelValue"), {
|
|
140
|
+
label: w,
|
|
141
|
+
id: S,
|
|
142
142
|
disabled: p,
|
|
143
|
-
maxlength:
|
|
143
|
+
maxlength: m,
|
|
144
144
|
minlength: g,
|
|
145
145
|
modelValue: c,
|
|
146
|
-
icon:
|
|
146
|
+
icon: A,
|
|
147
147
|
rightIcon: k,
|
|
148
|
-
helper:
|
|
149
|
-
error:
|
|
150
|
-
helperText:
|
|
151
|
-
clearable:
|
|
152
|
-
lengthError:
|
|
153
|
-
} =
|
|
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"),
|
|
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:
|
|
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
|
|
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
|
-
}),
|
|
180
|
+
}), H = o(() => c.value.length);
|
|
177
181
|
return (r, n) => {
|
|
178
|
-
var
|
|
182
|
+
var C, M;
|
|
179
183
|
return s(), f("div", {
|
|
180
|
-
class: h(["rds-e-textarea",
|
|
184
|
+
class: h(["rds-e-textarea", j.value])
|
|
181
185
|
}, [
|
|
182
|
-
a("div",
|
|
183
|
-
a("div",
|
|
184
|
-
|
|
185
|
-
id: (
|
|
186
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
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(
|
|
194
|
+
maxlength: e(m),
|
|
191
195
|
minlength: e(g),
|
|
192
196
|
rows: t.rows,
|
|
193
|
-
disabled: e(p)
|
|
194
|
-
|
|
195
|
-
|
|
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: (
|
|
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
|
-
|
|
219
|
-
l.value.left.name ? (s(),
|
|
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,
|
|
230
|
+
}, l.value.left, T(l.value.left.events)), null, 16, ["class"])) : i("", !0)
|
|
224
231
|
], !0),
|
|
225
|
-
|
|
226
|
-
], 10,
|
|
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(
|
|
237
|
+
"rds-e-textarea__counter--clearable": e(V)
|
|
231
238
|
}])
|
|
232
239
|
}, [
|
|
233
|
-
t.counter && !e(k) ? (s(), f("p",
|
|
234
|
-
|
|
235
|
-
l.value.right.name && !l.value.left.name ? (s(),
|
|
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,
|
|
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(
|
|
252
|
+
class: h(["rds-e-textarea__helper", e(x) || N.value ? "rds-e-textarea__helper--error" : ""])
|
|
246
253
|
}, [
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
251
|
-
e(
|
|
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
|
-
}),
|
|
265
|
+
}), ce = /* @__PURE__ */ Y(oe, [["__scopeId", "data-v-e01ef58d"]]);
|
|
259
266
|
export {
|
|
260
|
-
|
|
267
|
+
ce as default
|
|
261
268
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
import './style/textField.css';const
|
|
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
|
-
},
|
|
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,
|
|
121
|
-
const
|
|
122
|
-
return
|
|
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:
|
|
128
|
-
const
|
|
129
|
-
label:
|
|
130
|
-
disabled:
|
|
131
|
-
maxLength:
|
|
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:
|
|
135
|
-
rightIcon:
|
|
136
|
-
helper:
|
|
137
|
-
error:
|
|
138
|
-
helperText:
|
|
139
|
-
clearable:
|
|
140
|
-
password:
|
|
141
|
-
autocomplete:
|
|
142
|
-
} =
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
145
|
-
}),
|
|
146
|
-
|
|
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
|
-
|
|
152
|
-
}, P =
|
|
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"),
|
|
155
|
-
}),
|
|
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:
|
|
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:
|
|
179
|
+
name: I.value
|
|
170
180
|
}
|
|
171
181
|
};
|
|
172
|
-
return
|
|
182
|
+
return m.value ? {
|
|
173
183
|
left: {
|
|
174
184
|
...e,
|
|
175
185
|
name: null
|
|
176
186
|
},
|
|
177
187
|
right: {
|
|
178
188
|
...e,
|
|
179
|
-
name:
|
|
189
|
+
name: s.value ? "eye_open" : "eye_close",
|
|
180
190
|
class: "rds-e-textfield__icon--password",
|
|
181
191
|
events: {
|
|
182
|
-
click: () =>
|
|
192
|
+
click: () => s.value = !s.value
|
|
183
193
|
}
|
|
184
194
|
}
|
|
185
|
-
} :
|
|
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: () =>
|
|
204
|
+
click: () => r("update:modelValue", "")
|
|
195
205
|
}
|
|
196
206
|
}
|
|
197
207
|
} : w;
|
|
198
208
|
});
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
(e) =>
|
|
209
|
+
return O(
|
|
210
|
+
m,
|
|
211
|
+
(e) => s.value = !e,
|
|
202
212
|
{ immediate: !0 }
|
|
203
|
-
), (e, w) => (
|
|
204
|
-
class:
|
|
213
|
+
), (e, w) => (c(), v("div", {
|
|
214
|
+
class: _(["rds-e-textfield", A.value])
|
|
205
215
|
}, [
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
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":
|
|
220
|
+
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": h.value }],
|
|
211
221
|
"aria-hidden": "true"
|
|
212
|
-
},
|
|
222
|
+
}, a.value.left, W(a.value.left.events)), null, 16, ["class"])) : y("", !0)
|
|
213
223
|
], !0),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
id:
|
|
217
|
-
type:
|
|
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(
|
|
229
|
+
maxLength: t(x),
|
|
220
230
|
minLength: t(b),
|
|
221
|
-
disabled: t(
|
|
231
|
+
disabled: t(u),
|
|
222
232
|
value: t(o),
|
|
223
|
-
autocomplete:
|
|
233
|
+
autocomplete: q.value,
|
|
224
234
|
readonly: l.readonly,
|
|
225
|
-
onInput:
|
|
226
|
-
onBlur:
|
|
227
|
-
onFocus: j
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
},
|
|
240
|
-
onClick:
|
|
253
|
+
}, a.value.right, {
|
|
254
|
+
onClick: Y(a.value.right.events.click, ["stop"])
|
|
241
255
|
}), null, 16, ["onClick"])
|
|
242
256
|
], !0)
|
|
243
|
-
])) :
|
|
257
|
+
])) : y("", !0)
|
|
244
258
|
]),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
(t(
|
|
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:
|
|
250
|
-
},
|
|
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
|
-
}),
|
|
269
|
+
}), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-b490642c"]]);
|
|
256
270
|
export {
|
|
257
|
-
|
|
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
|
+
};
|