energy-components 1.10.0-beta.0 → 1.10.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 +1 -1
- package/dist/components/avatar.es.js +1 -1
- package/dist/components/breadcrumbs.es.js +2 -3
- package/dist/components/button.es.js +1 -1
- package/dist/components/checkbox.es.js +1 -1
- package/dist/components/directAccess.es.js +1 -1
- package/dist/components/dragAndDrop.es.js +1 -1
- package/dist/components/dropdown.es.js +19 -18
- package/dist/components/fileUploadItem.es.js +1 -1
- package/dist/components/filterChip.es.js +1 -1
- package/dist/components/{icon-svg-YXBqzlJN.js → icon-svg-DuzOdbk1.js} +4360 -2853
- package/dist/components/iconList.es.js +1 -1
- package/dist/components/iconSvg.es.js +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/components/infoBox.es.js +1 -1
- package/dist/components/link.es.js +1 -1
- package/dist/components/modal.es.js +1 -1
- package/dist/components/multiselectcontentwrapper.es.js +25 -22
- package/dist/components/persistentToast.es.js +1 -1
- package/dist/components/progressBar.es.js +1 -1
- package/dist/components/quantitySelector.es.js +1 -1
- package/dist/components/radioButton.es.js +1 -1
- package/dist/components/selectionChip.es.js +1 -1
- package/dist/components/sidedrawer.es.js +1 -1
- package/dist/components/style/dropdown.css +1 -1
- package/dist/components/style/multiselect.css +1 -1
- package/dist/components/style/multiselectcontentwrapper.css +1 -1
- package/dist/components/style/tag.css +1 -1
- package/dist/components/style/textField.css +1 -1
- package/dist/components/switch.es.js +1 -1
- package/dist/components/tabBar.es.js +1 -1
- package/dist/components/tableslotedcomponent.es.js +1 -1
- package/dist/components/tag.es.js +15 -15
- package/dist/components/textArea.es.js +1 -1
- package/dist/components/textField.es.js +64 -53
- package/dist/components/tooltip.es.js +293 -295
- package/dist/energy-components.es.js +6988 -5469
- package/dist/energy-components.umd.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types/src/components/input/drag-and-drop/drag-and-drop.vue.d.ts +1 -1
- package/dist/types/src/components/input/dropdown/Multiselect/MultiselectContentWrapper.vue.d.ts +9 -2
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +4 -4
- package/dist/types/src/components/input/quantity-selector/quantity-selector.vue.d.ts +1 -1
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +17 -0
- package/dist/types/src/setupTests.d.ts +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -2
|
@@ -1,13 +1,24 @@
|
|
|
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 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 = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
8
|
-
},
|
|
8
|
+
}, me = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "rds-e-textfield__helper"
|
|
11
|
+
}, ve = /* @__PURE__ */ te({
|
|
9
12
|
__name: "text-field",
|
|
10
13
|
props: {
|
|
14
|
+
/**
|
|
15
|
+
* Hace que el campo ocupe todo el ancho disponible del contenedor padre (elimina min-width).
|
|
16
|
+
* ⚠️ Solo recomendado para contenedores muy pequeños.
|
|
17
|
+
*/
|
|
18
|
+
fullWidth: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
11
22
|
/**
|
|
12
23
|
* Etiqueta que se muestra sobre el campo de entrada. y Placeholder
|
|
13
24
|
*/
|
|
@@ -137,7 +148,7 @@ import './style/textField.css';const ie = { class: "rds-e-textfield__container"
|
|
|
137
148
|
},
|
|
138
149
|
emits: ["update:modelValue", "keydown", "keyup", "keypress", "change"],
|
|
139
150
|
setup(t, { expose: r, emit: s }) {
|
|
140
|
-
const
|
|
151
|
+
const a = t, i = s, {
|
|
141
152
|
type: v,
|
|
142
153
|
label: D,
|
|
143
154
|
disabled: h,
|
|
@@ -148,13 +159,14 @@ import './style/textField.css';const ie = { class: "rds-e-textfield__container"
|
|
|
148
159
|
rightIcon: q,
|
|
149
160
|
helper: K,
|
|
150
161
|
error: x,
|
|
151
|
-
helperText:
|
|
152
|
-
clearable:
|
|
162
|
+
helperText: W,
|
|
163
|
+
clearable: z,
|
|
153
164
|
password: g,
|
|
154
|
-
autocomplete:
|
|
155
|
-
|
|
165
|
+
autocomplete: A,
|
|
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(() => {
|
|
156
168
|
if (g.value || v.value === "password")
|
|
157
|
-
return
|
|
169
|
+
return A.value;
|
|
158
170
|
}), J = (e) => {
|
|
159
171
|
const l = e.target;
|
|
160
172
|
let _ = l.value;
|
|
@@ -162,31 +174,31 @@ import './style/textField.css';const ie = { class: "rds-e-textfield__container"
|
|
|
162
174
|
if (l.value.trim() === "")
|
|
163
175
|
_ = null;
|
|
164
176
|
else {
|
|
165
|
-
const
|
|
166
|
-
_ = Number.isNaN(
|
|
177
|
+
const T = Number.parseFloat(l.value);
|
|
178
|
+
_ = Number.isNaN(T) ? l.value : T;
|
|
167
179
|
}
|
|
168
180
|
else l.value === "" && u.value === null && (_ = null);
|
|
169
181
|
i("update:modelValue", _);
|
|
170
|
-
},
|
|
182
|
+
}, B = () => {
|
|
171
183
|
b.value = !1;
|
|
172
|
-
},
|
|
184
|
+
}, E = () => {
|
|
173
185
|
b.value = !0;
|
|
174
186
|
}, O = (e) => {
|
|
175
187
|
i("keydown", e);
|
|
176
188
|
}, Q = (e) => {
|
|
177
189
|
i("keyup", e);
|
|
178
|
-
}, W = (e) => {
|
|
179
|
-
i("keypress", e);
|
|
180
190
|
}, X = (e) => {
|
|
191
|
+
i("keypress", e);
|
|
192
|
+
}, Y = (e) => {
|
|
181
193
|
i("change", e);
|
|
182
|
-
},
|
|
194
|
+
}, Z = d(() => {
|
|
183
195
|
if (x.value) return !0;
|
|
184
196
|
const e = u.value === null || u.value === void 0 ? "" : String(u.value);
|
|
185
197
|
return e.length > 0 && (e.length < P.value || v.value !== "number" && e.length > F.value);
|
|
186
|
-
}),
|
|
198
|
+
}), ee = d(() => {
|
|
187
199
|
const e = [];
|
|
188
|
-
return u.value !== null && String(u.value).length > 0 && e.push("rds-e-textfield--filled"),
|
|
189
|
-
}),
|
|
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(() => {
|
|
190
202
|
const e = {
|
|
191
203
|
name: j.value,
|
|
192
204
|
class: "",
|
|
@@ -216,7 +228,7 @@ import './style/textField.css';const ie = { class: "rds-e-textfield__container"
|
|
|
216
228
|
click: () => f.value = !f.value
|
|
217
229
|
}
|
|
218
230
|
}
|
|
219
|
-
} :
|
|
231
|
+
} : z.value ? {
|
|
220
232
|
left: {
|
|
221
233
|
...e
|
|
222
234
|
},
|
|
@@ -230,82 +242,81 @@ import './style/textField.css';const ie = { class: "rds-e-textfield__container"
|
|
|
230
242
|
}
|
|
231
243
|
} : l;
|
|
232
244
|
});
|
|
233
|
-
|
|
245
|
+
ae(
|
|
234
246
|
g,
|
|
235
247
|
(e) => f.value = !e,
|
|
236
248
|
{ immediate: !0 }
|
|
237
249
|
);
|
|
238
|
-
const
|
|
239
|
-
const l =
|
|
250
|
+
const L = (e) => {
|
|
251
|
+
const l = se.includes(e);
|
|
240
252
|
return l || console.warn(`[RDSTextfield]: El icono "${e}" no es un icono válido.`), l;
|
|
241
253
|
};
|
|
242
254
|
return r({
|
|
243
255
|
focus: () => {
|
|
244
|
-
c.value && (c.value.focus(),
|
|
256
|
+
c.value && (c.value.focus(), E());
|
|
245
257
|
},
|
|
246
258
|
blur: () => {
|
|
247
|
-
c.value && (c.value.blur(),
|
|
259
|
+
c.value && (c.value.blur(), B());
|
|
248
260
|
}
|
|
249
261
|
}), (e, l) => (p(), k("div", {
|
|
250
|
-
class: S(["rds-e-textfield",
|
|
262
|
+
class: S(["rds-e-textfield", ee.value])
|
|
251
263
|
}, [
|
|
252
|
-
m("div",
|
|
264
|
+
m("div", ue, [
|
|
253
265
|
N(e.$slots, "left-icon", {}, () => [
|
|
254
|
-
|
|
266
|
+
n.value.left.name && L(n.value.left.name) ? (p(), I(R, $({
|
|
255
267
|
key: 0,
|
|
256
268
|
class: ["rds-e-textfield__icon rds-e-textfield__icon--left", { "rds-e-textfield__icon--hidden": b.value }],
|
|
257
269
|
"aria-hidden": "true"
|
|
258
|
-
},
|
|
270
|
+
}, n.value.left, ne(n.value.left.events)), null, 16, ["class"])) : y("", !0)
|
|
259
271
|
], !0),
|
|
260
|
-
m("div",
|
|
272
|
+
m("div", de, [
|
|
261
273
|
m("input", {
|
|
262
274
|
id: V.value,
|
|
263
275
|
ref_key: "input",
|
|
264
276
|
ref: c,
|
|
265
277
|
type: U.value,
|
|
266
278
|
class: "rds-e-textfield__input",
|
|
267
|
-
maxlength:
|
|
268
|
-
minlength:
|
|
279
|
+
maxlength: a.type === "number" ? void 0 : a.maxLength,
|
|
280
|
+
minlength: a.type === "number" ? void 0 : a.minLength,
|
|
269
281
|
disabled: o(h),
|
|
270
|
-
value:
|
|
282
|
+
value: a.modelValue === null ? "" : a.modelValue,
|
|
271
283
|
autocomplete: G.value,
|
|
272
284
|
readonly: t.readonly,
|
|
273
285
|
onInput: J,
|
|
274
|
-
onBlur:
|
|
275
|
-
onFocus:
|
|
286
|
+
onBlur: B,
|
|
287
|
+
onFocus: E,
|
|
276
288
|
onKeydown: O,
|
|
277
289
|
onKeyup: Q,
|
|
278
|
-
onKeypress:
|
|
279
|
-
onChange:
|
|
280
|
-
}, null, 40,
|
|
290
|
+
onKeypress: X,
|
|
291
|
+
onChange: Y
|
|
292
|
+
}, null, 40, ce),
|
|
281
293
|
m("label", {
|
|
282
294
|
for: V.value,
|
|
283
295
|
class: S(["rds-e-textfield__label", o(h) ? "rds-e-textfield__label--disabled" : ""])
|
|
284
|
-
}, C(o(D)), 11,
|
|
296
|
+
}, C(o(D)), 11, fe)
|
|
285
297
|
]),
|
|
286
|
-
|
|
298
|
+
n.value.right.name || e.$slots["right-icon"] ? (p(), k("span", pe, [
|
|
287
299
|
N(e.$slots, "right-icon", {}, () => [
|
|
288
|
-
|
|
300
|
+
n.value.right.name && L(n.value.right.name) ? (p(), I(R, $({
|
|
289
301
|
key: 0,
|
|
290
302
|
"aria-hidden": "true",
|
|
291
303
|
class: "rds-e-textfield__icon rds-e-textfield__icon--right"
|
|
292
|
-
},
|
|
293
|
-
onClick:
|
|
304
|
+
}, n.value.right, {
|
|
305
|
+
onClick: oe(n.value.right.events.click, ["stop"])
|
|
294
306
|
}), null, 16, ["onClick"])) : y("", !0)
|
|
295
307
|
], !0)
|
|
296
308
|
])) : y("", !0)
|
|
297
309
|
]),
|
|
298
|
-
|
|
310
|
+
(o(K) || o(x)) && !o(h) ? (p(), k("div", me, [
|
|
299
311
|
N(e.$slots, "helper-text", {}, () => [
|
|
300
|
-
(
|
|
301
|
-
key: 0,
|
|
312
|
+
m("span", {
|
|
302
313
|
class: S(o(x) ? "rds-e-textfield__helper--error" : "")
|
|
303
|
-
}, C(o(
|
|
314
|
+
}, C(o(W)), 3)
|
|
304
315
|
], !0)
|
|
305
|
-
])
|
|
316
|
+
])) : y("", !0)
|
|
306
317
|
], 2));
|
|
307
318
|
}
|
|
308
|
-
}),
|
|
319
|
+
}), xe = /* @__PURE__ */ ie(ve, [["__scopeId", "data-v-3d4a237a"]]);
|
|
309
320
|
export {
|
|
310
|
-
|
|
321
|
+
xe as default
|
|
311
322
|
};
|