energy-components 1.0.2
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/LICENSE +21 -0
- package/README.md +94 -0
- package/dist/.empty +0 -0
- package/dist/components/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/accordion.es.js +121 -0
- package/dist/components/accordionGroup.es.js +32 -0
- package/dist/components/actionButton.es.js +64 -0
- package/dist/components/breadcrumbs.es.js +90 -0
- package/dist/components/button.es.js +144 -0
- package/dist/components/checkbox.es.js +130 -0
- package/dist/components/divider.es.js +35 -0
- package/dist/components/dropdown.es.js +331 -0
- package/dist/components/floatingActionButton.es.js +97 -0
- package/dist/components/functions-DIHwdgF0.js +18 -0
- package/dist/components/icon-svg-Cpx09myr.js +10818 -0
- package/dist/components/iconList.es.js +49 -0
- package/dist/components/iconSvg.es.js +5 -0
- package/dist/components/index.es.js +81 -0
- package/dist/components/indicator.es.js +175 -0
- package/dist/components/link.es.js +147 -0
- package/dist/components/multiselect.es.js +1039 -0
- package/dist/components/pagination.es.js +138 -0
- package/dist/components/radioButton.es.js +111 -0
- package/dist/components/style/accordion.css +1 -0
- package/dist/components/style/accordionGroup.css +1 -0
- package/dist/components/style/actionButton.css +1 -0
- package/dist/components/style/breadcrumbs.css +1 -0
- package/dist/components/style/button.css +1 -0
- package/dist/components/style/checkbox.css +1 -0
- package/dist/components/style/divider.css +1 -0
- package/dist/components/style/dropdown.css +1 -0
- package/dist/components/style/floatingActionButton.css +1 -0
- package/dist/components/style/icon-svg.css +1 -0
- package/dist/components/style/iconList.css +1 -0
- package/dist/components/style/indicator.css +1 -0
- package/dist/components/style/link.css +1 -0
- package/dist/components/style/multiselect.css +1 -0
- package/dist/components/style/pagination.css +1 -0
- package/dist/components/style/radioButton.css +1 -0
- package/dist/components/style/switch.css +1 -0
- package/dist/components/style/tabBar.css +1 -0
- package/dist/components/style/tag.css +1 -0
- package/dist/components/style/textArea.css +1 -0
- package/dist/components/style/textField.css +1 -0
- package/dist/components/style/tooltip.css +1 -0
- package/dist/components/switch.es.js +96 -0
- package/dist/components/tabBar.es.js +181 -0
- package/dist/components/tag.es.js +91 -0
- package/dist/components/textArea.es.js +259 -0
- package/dist/components/textField.es.js +254 -0
- package/dist/components/tooltip.es.js +1082 -0
- package/dist/energy-components.es.js +15368 -0
- package/dist/energy-components.umd.js +1 -0
- package/dist/style.css +1 -0
- package/dist/types/src/components/buttons/action-button/action-button.vue.d.ts +100 -0
- package/dist/types/src/components/buttons/button/button.vue.d.ts +196 -0
- package/dist/types/src/components/buttons/constants/buttonDocs.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/buttonPosition.d.ts +1 -0
- package/dist/types/src/components/buttons/constants/socialMedia.d.ts +1 -0
- package/dist/types/src/components/buttons/floating-action-button/floating-action-button.vue.d.ts +136 -0
- package/dist/types/src/components/content/accordion/accordion.vue.d.ts +122 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.d.ts +6 -0
- package/dist/types/src/components/content/acordion-group/accordion-group.vue.d.ts +33 -0
- package/dist/types/src/components/content/divider/divider.vue.d.ts +35 -0
- package/dist/types/src/components/content/tag/tag.vue.d.ts +105 -0
- package/dist/types/src/components/feedback/indicator/indicator.vue.d.ts +100 -0
- package/dist/types/src/components/icon-svg/icon-list.d.ts +11 -0
- package/dist/types/src/components/icon-svg/icon-list.vue.d.ts +2 -0
- package/dist/types/src/components/icon-svg/icon-svg.vue.d.ts +68 -0
- package/dist/types/src/components/index.d.ts +20 -0
- package/dist/types/src/components/input/checkbox/checkbox.vue.d.ts +151 -0
- package/dist/types/src/components/input/dropdown/Multiselect/Multiselect.vue.d.ts +2 -0
- package/dist/types/src/components/input/dropdown/dropdown.vue.d.ts +270 -0
- package/dist/types/src/components/input/radio-button/radio-button.vue.d.ts +114 -0
- package/dist/types/src/components/input/switch/switch.vue.d.ts +104 -0
- package/dist/types/src/components/input/text-area/text-area.vue.d.ts +281 -0
- package/dist/types/src/components/input/text-field/text-field.vue.d.ts +271 -0
- package/dist/types/src/components/navigation/breadcrumbs/breadcrumbs.vue.d.ts +63 -0
- package/dist/types/src/components/navigation/link/link.types.d.ts +15 -0
- package/dist/types/src/components/navigation/link/link.vue.d.ts +175 -0
- package/dist/types/src/components/navigation/pagination/pagination.vue.d.ts +67 -0
- package/dist/types/src/components/navigation/tab-bar/tab-bar.vue.d.ts +132 -0
- package/dist/types/src/components/overlay/tooltip/tooltip.vue.d.ts +118 -0
- package/dist/types/src/helpers/functions.d.ts +3 -0
- package/dist/types/src/helpers/stories.helpers.d.ts +1 -0
- package/dist/types/src/helpers/validation.d.ts +1 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +156 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { defineComponent as P, toRefs as z, ref as F, computed as d, watch as H, openBlock as u, createElementBlock as m, normalizeClass as v, createElementVNode as n, renderSlot as h, createBlock as A, mergeProps as L, toHandlers as w, createCommentVNode as _, unref as t, toDisplayString as B, createVNode as G } from "vue";
|
|
2
|
+
import { R as V } from "./icon-svg-Cpx09myr.js";
|
|
3
|
+
import { _ as J } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import './style/textField.css';const K = { class: "rds-textfield__container" }, M = { class: "rds-textfield__input-container" }, O = ["id", "type", "maxLength", "minLength", "disabled", "value", "autocomplete", "readonly"], Q = ["for"], U = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "rds-textfield__icon rds-textfield__icon--right"
|
|
7
|
+
}, W = { class: "rds-textfield__helper" }, X = /* @__PURE__ */ P({
|
|
8
|
+
__name: "text-field",
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Etiqueta que se muestra sobre el campo de entrada. y Placeholder
|
|
12
|
+
*/
|
|
13
|
+
label: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: !0
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Identificador único del campo de entrada.
|
|
19
|
+
*/
|
|
20
|
+
id: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
required: !0,
|
|
23
|
+
default: "text-field-0"
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* v-model valor de entrada y salida
|
|
27
|
+
*/
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: !0
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Indica si el campo de entrada está deshabilitado o no.
|
|
34
|
+
*/
|
|
35
|
+
disabled: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !1
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Indica si el campo de entrada es de solo lectura o no.
|
|
41
|
+
*/
|
|
42
|
+
readonly: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* Número máximo de caracteres permitidos en el campo de entrada.
|
|
48
|
+
*/
|
|
49
|
+
maxLength: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 100,
|
|
52
|
+
validator: (l) => l < 0 ? (console.info("El valor de maxLength no puede ser menor a 0"), !1) : Number.isNaN(l) ? (console.info("El valor de maxLength debe ser un número"), !1) : !0
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Número mínimo de caracteres permitidos en el campo de entrada.
|
|
56
|
+
*/
|
|
57
|
+
minLength: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: 0,
|
|
60
|
+
validator: (l) => l < 0 ? (console.info("El valor de minLength no puede ser menor a 0"), !1) : Number.isNaN(l) ? (console.info("El valor de minLength debe ser un número"), !1) : !0
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* Nombre del icono que se mostrará dentro del campo de entrada.
|
|
64
|
+
* por defecto se mosrtrara a al izquierda del campo
|
|
65
|
+
*/
|
|
66
|
+
icon: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: ""
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Muestra un icono a la derecha
|
|
72
|
+
* Se desactiva si la opccion de `clearable` esta activa
|
|
73
|
+
*/
|
|
74
|
+
rightIcon: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Indica si se debe mostrar un mensaje de ayuda debajo del campo de entrada o no.
|
|
80
|
+
*/
|
|
81
|
+
helper: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !1
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Indica si el campo de entrada contiene un error o no.
|
|
87
|
+
*/
|
|
88
|
+
error: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: !1
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Texto que se muestra como mensaje de ayuda debajo del campo de entrada.
|
|
94
|
+
*/
|
|
95
|
+
helperText: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: ""
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Muestra un boton para limpiar el campo de texto
|
|
101
|
+
*/
|
|
102
|
+
clearable: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !1
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Muestra el campo de texto como password
|
|
108
|
+
*/
|
|
109
|
+
password: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: !1
|
|
112
|
+
},
|
|
113
|
+
/**
|
|
114
|
+
* Indica si el campo de texto es para una nueva contraseña (solo para campos de contraseña).
|
|
115
|
+
* Opciones permitidas: 'new-password', 'current-password', 'off'.
|
|
116
|
+
*/
|
|
117
|
+
autocomplete: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "off",
|
|
120
|
+
validator: (l, c) => {
|
|
121
|
+
const s = ["new-password", "current-password", "off"];
|
|
122
|
+
return c.password && !s.includes(l) ? (console.info(`[RDSTextfield]: El valor de autocomplete para un campo de contraseña debe ser uno de los siguientes: ${s.join(", ")}`), !1) : !0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
emits: ["update:modelValue"],
|
|
127
|
+
setup(l, { emit: c }) {
|
|
128
|
+
const s = l, g = c, {
|
|
129
|
+
label: k,
|
|
130
|
+
id: x,
|
|
131
|
+
disabled: i,
|
|
132
|
+
maxLength: y,
|
|
133
|
+
minLength: b,
|
|
134
|
+
modelValue: a,
|
|
135
|
+
icon: E,
|
|
136
|
+
rightIcon: I,
|
|
137
|
+
helper: T,
|
|
138
|
+
error: f,
|
|
139
|
+
helperText: R,
|
|
140
|
+
clearable: $,
|
|
141
|
+
password: p,
|
|
142
|
+
autocomplete: D
|
|
143
|
+
} = z(s), o = F(!0), q = d(() => {
|
|
144
|
+
if (p.value)
|
|
145
|
+
return D.value;
|
|
146
|
+
}), S = (e) => {
|
|
147
|
+
g(
|
|
148
|
+
"update:modelValue",
|
|
149
|
+
e.target.value
|
|
150
|
+
);
|
|
151
|
+
}, C = d(() => !!(f.value || a.value.length && (a.value.length < b.value || a.value.length > y.value))), j = d(() => {
|
|
152
|
+
const e = [];
|
|
153
|
+
return a.value && e.push("rds-textfield--filled"), C.value && e.push("rds-textfield--error"), i.value && e.push("rds-textfield--disabled"), e.join(" ");
|
|
154
|
+
}), r = d(() => {
|
|
155
|
+
const e = {
|
|
156
|
+
name: E.value,
|
|
157
|
+
class: "",
|
|
158
|
+
events: {
|
|
159
|
+
click: () => {
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}, N = {
|
|
163
|
+
left: {
|
|
164
|
+
...e
|
|
165
|
+
},
|
|
166
|
+
right: {
|
|
167
|
+
...e,
|
|
168
|
+
name: I.value
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
return p.value ? {
|
|
172
|
+
left: {
|
|
173
|
+
...e,
|
|
174
|
+
name: null
|
|
175
|
+
},
|
|
176
|
+
right: {
|
|
177
|
+
...e,
|
|
178
|
+
name: o.value ? "eye_open" : "eye_close",
|
|
179
|
+
class: "rds-textfield__icon--password",
|
|
180
|
+
events: {
|
|
181
|
+
click: () => o.value = !o.value
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
} : $.value ? {
|
|
185
|
+
left: {
|
|
186
|
+
...e
|
|
187
|
+
},
|
|
188
|
+
right: {
|
|
189
|
+
...e,
|
|
190
|
+
name: "close",
|
|
191
|
+
class: "rds-textfield__icon--clear",
|
|
192
|
+
events: {
|
|
193
|
+
click: () => g("update:modelValue", "")
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
} : N;
|
|
197
|
+
});
|
|
198
|
+
return H(
|
|
199
|
+
p,
|
|
200
|
+
(e) => o.value = !e,
|
|
201
|
+
{ immediate: !0 }
|
|
202
|
+
), (e, N) => (u(), m("div", {
|
|
203
|
+
class: v(["rds-textfield", j.value])
|
|
204
|
+
}, [
|
|
205
|
+
n("div", K, [
|
|
206
|
+
h(e.$slots, "left-icon", {}, () => [
|
|
207
|
+
r.value.left.name ? (u(), A(V, L({
|
|
208
|
+
key: 0,
|
|
209
|
+
class: "rds-textfield__icon rds-textfield__icon--left",
|
|
210
|
+
"aria-hidden": "true"
|
|
211
|
+
}, r.value.left, w(r.value.left.events)), null, 16)) : _("", !0)
|
|
212
|
+
], !0),
|
|
213
|
+
n("div", M, [
|
|
214
|
+
n("input", {
|
|
215
|
+
id: t(x).toString(),
|
|
216
|
+
type: o.value ? "text" : "password",
|
|
217
|
+
class: "rds-textfield__input",
|
|
218
|
+
maxLength: t(y),
|
|
219
|
+
minLength: t(b),
|
|
220
|
+
disabled: t(i),
|
|
221
|
+
value: t(a),
|
|
222
|
+
autocomplete: q.value,
|
|
223
|
+
readonly: l.readonly,
|
|
224
|
+
onInput: S,
|
|
225
|
+
onBlur: S
|
|
226
|
+
}, null, 40, O),
|
|
227
|
+
n("label", {
|
|
228
|
+
for: t(x).toString(),
|
|
229
|
+
class: v(["rds-textfield__label", t(i) ? "rds-textfield__label--disabled" : ""])
|
|
230
|
+
}, B(t(k)), 11, Q)
|
|
231
|
+
]),
|
|
232
|
+
r.value.right.name || e.$slots["right-icon"] ? (u(), m("span", U, [
|
|
233
|
+
h(e.$slots, "right-icon", {}, () => [
|
|
234
|
+
G(V, L({
|
|
235
|
+
"aria-hidden": "true",
|
|
236
|
+
class: "rds-textfield__icon rds-textfield__icon--right"
|
|
237
|
+
}, r.value.right, w(r.value.right.events)), null, 16)
|
|
238
|
+
], !0)
|
|
239
|
+
])) : _("", !0)
|
|
240
|
+
]),
|
|
241
|
+
n("div", W, [
|
|
242
|
+
h(e.$slots, "helper-text", {}, () => [
|
|
243
|
+
(t(T) || t(f)) && !t(i) ? (u(), m("span", {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: v(t(f) ? "rds-textfield__helper--error" : "")
|
|
246
|
+
}, B(t(R)), 3)) : _("", !0)
|
|
247
|
+
], !0)
|
|
248
|
+
])
|
|
249
|
+
], 2));
|
|
250
|
+
}
|
|
251
|
+
}), te = /* @__PURE__ */ J(X, [["__scopeId", "data-v-e9626824"]]);
|
|
252
|
+
export {
|
|
253
|
+
te as default
|
|
254
|
+
};
|