@atmgrupomaggioli/iris-button 0.2.4 → 0.3.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/cjs/index-D8dxP54K.js +1337 -0
- package/dist/cjs/index-D8dxP54K.js.map +1 -0
- package/dist/cjs/iris-button.cjs.entry.js +2408 -52
- package/dist/cjs/iris-button.cjs.entry.js.map +1 -1
- package/dist/cjs/iris-button.cjs.js +3 -4
- package/dist/cjs/iris-button.cjs.js.map +1 -1
- package/dist/cjs/iris-button.entry.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/iris-button/iris-button.css +4 -25
- package/dist/collection/components/iris-button/iris-button.js +112 -56
- package/dist/collection/components/iris-button/iris-button.js.map +1 -1
- package/dist/components/index.js +54 -37
- package/dist/components/index.js.map +1 -1
- package/dist/components/iris-button.js +2407 -51
- package/dist/components/iris-button.js.map +1 -1
- package/dist/esm/index-Ca-CmCbL.js +1329 -0
- package/dist/esm/index-Ca-CmCbL.js.map +1 -0
- package/dist/esm/iris-button.entry.js +2408 -52
- package/dist/esm/iris-button.entry.js.map +1 -1
- package/dist/esm/iris-button.js +3 -4
- package/dist/esm/iris-button.js.map +1 -1
- package/dist/esm/loader.js +2 -3
- package/dist/esm/loader.js.map +1 -1
- package/dist/iris-button/iris-button.css +15 -1
- package/dist/iris-button/iris-button.entry.esm.js.map +1 -1
- package/dist/iris-button/iris-button.esm.js +1 -1
- package/dist/iris-button/iris-button.esm.js.map +1 -1
- package/dist/iris-button/loader.esm.js.map +1 -1
- package/dist/iris-button/p-54a170a0.entry.js +2 -0
- package/dist/iris-button/p-54a170a0.entry.js.map +1 -0
- package/dist/iris-button/p-Ca-CmCbL.js +3 -0
- package/dist/iris-button/p-Ca-CmCbL.js.map +1 -0
- package/dist/types/components/iris-button/iris-button.d.ts +13 -0
- package/dist/types/components.d.ts +43 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -1
- package/package.json +9 -7
- package/readme.md +22 -19
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -8
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/index-Cej08wkk.js +0 -1316
- package/dist/cjs/index-Cej08wkk.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -6
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/index-BRSjmv8U.js +0 -1309
- package/dist/esm/index-BRSjmv8U.js.map +0 -1
- package/dist/iris-button/p-25d399b6.entry.js +0 -2
- package/dist/iris-button/p-25d399b6.entry.js.map +0 -1
- package/dist/iris-button/p-BRSjmv8U.js +0 -3
- package/dist/iris-button/p-BRSjmv8U.js.map +0 -1
- package/dist/iris-button/p-DQuL1Twl.js +0 -2
- package/dist/iris-button/p-DQuL1Twl.js.map +0 -1
@@ -1,56 +1,97 @@
|
|
1
1
|
import { h } from "@stencil/core";
|
2
2
|
import { RequieredPropsUtils } from "@atmgrupomaggioli/iris-utils";
|
3
|
+
import { getGlobalComponentConfig } from "@atmgrupomaggioli/iris-globals";
|
4
|
+
/**
|
5
|
+
* Su función principal es comunicar información de manera rápida y visualmente efectiva.
|
6
|
+
*
|
7
|
+
* Algunos casos comunes de uso incluyen:
|
8
|
+
* - **Notificaciones interactivas**: Proporcionar una notificación visual, como el número de mensajes no leídos, junto con la capacidad de acceder rápidamente a esos mensajes al hacer click en el badge.
|
9
|
+
* - **Acciones rápidas**: Ofrecer accesos directos a acciones comunes o funciones importantes. Por ejemplo, un badge con botón podría representar el número de elementos en un carrito de compras, permitiendo al usuario abrir el carrito al hacer click en él.
|
10
|
+
* - **Estado y acciones combinadas**: Mostrar el estado actual de un elemento junto con opciones de acción relacionadas. Por ejemplo, un badge con botón podría indicar que hay una actualización disponible para descargar, y al hacer click en él, el usuario puede iniciar la descarga directamente.
|
11
|
+
*/
|
3
12
|
export class IrisButton {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
13
|
+
//#region Props
|
14
|
+
/**
|
15
|
+
* Texto del botón.
|
16
|
+
*/
|
17
|
+
label;
|
18
|
+
/**
|
19
|
+
* Indica el tipo de botón ayudando al usuario a explicar su funcionalidad.
|
20
|
+
* Para ver más información al respecto, lea la documentación del componente.
|
21
|
+
*/
|
22
|
+
color = getGlobalComponentConfig('IrisButton')?.color || 'primary';
|
23
|
+
/**
|
24
|
+
* Icono del botón.
|
25
|
+
* Consulta todos los iconos disponibles en: https://fonts.google.com/icons
|
26
|
+
*/
|
27
|
+
icon;
|
28
|
+
/**
|
29
|
+
* Deshabilita el botón para que no pueda ser pulsado.
|
30
|
+
*/
|
31
|
+
disabled = getGlobalComponentConfig('IrisButton')?.disabled || false;
|
32
|
+
/**
|
33
|
+
* Tipo de botón.
|
34
|
+
*/
|
35
|
+
type = getGlobalComponentConfig('IrisButton')?.type || '';
|
36
|
+
/**
|
37
|
+
* Permite mostrar una animación de carga mientras se realiza alguna acción.
|
38
|
+
* Al activarse esta opción, el botón se deshabilita.
|
39
|
+
*/
|
40
|
+
loading = getGlobalComponentConfig('IrisButton')?.loading || false;
|
41
|
+
/**
|
42
|
+
* Tamaño del botón.
|
43
|
+
*/
|
44
|
+
size = getGlobalComponentConfig('IrisButton')?.size || 'medium';
|
45
|
+
//#endregion
|
46
|
+
//#region Variables privadas
|
47
|
+
// Tag <button> del DOM.
|
48
|
+
button;
|
49
|
+
//#endregion
|
50
|
+
//#region Events
|
51
|
+
/**
|
52
|
+
* Evento del botón al ser pulsado.
|
53
|
+
*/
|
54
|
+
buttonClicked;
|
55
|
+
/**
|
56
|
+
* Evento del botón al ser enfocado.
|
57
|
+
*/
|
58
|
+
buttonFocused;
|
59
|
+
/**
|
60
|
+
* Evento lanzado cuando el componente está complementamente listo.
|
61
|
+
*/
|
62
|
+
ready;
|
63
|
+
//#endregion
|
64
|
+
//#region Handlers
|
65
|
+
//FIXME: Cuando loading se pone en true, también debería mantenerse disabled en true hasta que termine. Ahora se pone disabled a false antes de tiempo y rompe el funcionamiento.
|
66
|
+
/**
|
67
|
+
* Método que se ejecuta al hacer clic y emite el evento.
|
68
|
+
* @param ev
|
69
|
+
*/
|
70
|
+
handleClick = (ev) => {
|
71
|
+
// Evitamos que el evento burbujee.
|
72
|
+
ev.stopPropagation();
|
73
|
+
// Deshabilitamos el botón durante un segundo para que no sea pulsados repetidas veces.
|
74
|
+
this.button.disabled = true;
|
75
|
+
setTimeout(() => {
|
76
|
+
if (!this.loading) {
|
77
|
+
this.button.disabled = false;
|
78
|
+
}
|
79
|
+
}, 1000);
|
80
|
+
// Lanzamos el evento.
|
81
|
+
this.buttonClicked.emit(ev);
|
82
|
+
};
|
83
|
+
/**
|
84
|
+
* Método que se ejecuta cuando se ha hecho focus en el botón.
|
85
|
+
* @param ev
|
86
|
+
*/
|
87
|
+
handleFocus = (ev) => {
|
88
|
+
this.buttonFocused.emit(ev);
|
89
|
+
};
|
90
|
+
//#endregion
|
91
|
+
//#region Ciclos de vida
|
92
|
+
componentDidLoad() {
|
93
|
+
// Emitimos el evento de que el control se ha cargado.
|
94
|
+
this.ready.emit();
|
54
95
|
}
|
55
96
|
//#endregion
|
56
97
|
render() {
|
@@ -60,7 +101,7 @@ export class IrisButton {
|
|
60
101
|
return;
|
61
102
|
return (h("button", { class: `${this.size}`, color: this.color, type: this.type, onClick: this.handleClick, disabled: this.disabled || this.loading, onFocus: this.handleFocus, ref: (el) => (this.button = el), title: this.label },
|
62
103
|
// Comprobamos si se muestra cargando
|
63
|
-
!this.loading ? (h("iris-icon", { icon: this.icon, size: this.size })) : (h("
|
104
|
+
!this.loading ? (h("iris-icon", { icon: this.icon, size: this.size })) : (h("div", { class: "loading" }, h("iris-loading", { size: "small", color: this.color }))),
|
64
105
|
// Solo añadimos el label para los botones normales.
|
65
106
|
this.type == 'icon' || this.type == 'fab' ? '' : this.label));
|
66
107
|
}
|
@@ -115,7 +156,7 @@ export class IrisButton {
|
|
115
156
|
"getter": false,
|
116
157
|
"setter": false,
|
117
158
|
"reflect": false,
|
118
|
-
"defaultValue": "'primary'"
|
159
|
+
"defaultValue": "getGlobalComponentConfig('IrisButton')?.color || 'primary'"
|
119
160
|
},
|
120
161
|
"icon": {
|
121
162
|
"type": "string",
|
@@ -154,7 +195,7 @@ export class IrisButton {
|
|
154
195
|
"getter": false,
|
155
196
|
"setter": false,
|
156
197
|
"reflect": false,
|
157
|
-
"defaultValue": "false"
|
198
|
+
"defaultValue": "getGlobalComponentConfig('IrisButton')?.disabled || false"
|
158
199
|
},
|
159
200
|
"type": {
|
160
201
|
"type": "string",
|
@@ -174,7 +215,7 @@ export class IrisButton {
|
|
174
215
|
"getter": false,
|
175
216
|
"setter": false,
|
176
217
|
"reflect": false,
|
177
|
-
"defaultValue": "''"
|
218
|
+
"defaultValue": "getGlobalComponentConfig('IrisButton')?.type || ''"
|
178
219
|
},
|
179
220
|
"loading": {
|
180
221
|
"type": "boolean",
|
@@ -194,7 +235,7 @@ export class IrisButton {
|
|
194
235
|
"getter": false,
|
195
236
|
"setter": false,
|
196
237
|
"reflect": false,
|
197
|
-
"defaultValue": "false"
|
238
|
+
"defaultValue": "getGlobalComponentConfig('IrisButton')?.loading || false"
|
198
239
|
},
|
199
240
|
"size": {
|
200
241
|
"type": "string",
|
@@ -214,7 +255,7 @@ export class IrisButton {
|
|
214
255
|
"getter": false,
|
215
256
|
"setter": false,
|
216
257
|
"reflect": false,
|
217
|
-
"defaultValue": "'medium'"
|
258
|
+
"defaultValue": "getGlobalComponentConfig('IrisButton')?.size || 'medium'"
|
218
259
|
}
|
219
260
|
};
|
220
261
|
}
|
@@ -261,6 +302,21 @@ export class IrisButton {
|
|
261
302
|
}
|
262
303
|
}
|
263
304
|
}
|
305
|
+
}, {
|
306
|
+
"method": "ready",
|
307
|
+
"name": "ready",
|
308
|
+
"bubbles": true,
|
309
|
+
"cancelable": true,
|
310
|
+
"composed": true,
|
311
|
+
"docs": {
|
312
|
+
"tags": [],
|
313
|
+
"text": "Evento lanzado cuando el componente est\u00E1 complementamente listo."
|
314
|
+
},
|
315
|
+
"complexType": {
|
316
|
+
"original": "void",
|
317
|
+
"resolved": "void",
|
318
|
+
"references": {}
|
319
|
+
}
|
264
320
|
}];
|
265
321
|
}
|
266
322
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"iris-button.js","sourceRoot":"","sources":["../../../src/components/iris-button/iris-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;
|
1
|
+
{"version":3,"file":"iris-button.js","sourceRoot":"","sources":["../../../src/components/iris-button/iris-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE1E;;;;;;;GAOG;AAMH,MAAM,OAAO,UAAU;IACrB,eAAe;IA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CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAEtD,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { RequieredPropsUtils } from '@atmgrupomaggioli/iris-utils';\nimport { getGlobalComponentConfig } from '@atmgrupomaggioli/iris-globals';\n\n/**\n * Su función principal es comunicar información de manera rápida y visualmente efectiva.\n *\n * Algunos casos comunes de uso incluyen:\n * - **Notificaciones interactivas**: Proporcionar una notificación visual, como el número de mensajes no leídos, junto con la capacidad de acceder rápidamente a esos mensajes al hacer click en el badge.\n * - **Acciones rápidas**: Ofrecer accesos directos a acciones comunes o funciones importantes. Por ejemplo, un badge con botón podría representar el número de elementos en un carrito de compras, permitiendo al usuario abrir el carrito al hacer click en él.\n * - **Estado y acciones combinadas**: Mostrar el estado actual de un elemento junto con opciones de acción relacionadas. Por ejemplo, un badge con botón podría indicar que hay una actualización disponible para descargar, y al hacer click en él, el usuario puede iniciar la descarga directamente.\n */\n@Component({\n tag: 'iris-button',\n styleUrl: 'iris-button.scss',\n shadow: true,\n})\nexport class IrisButton {\n //#region Props\n\n /**\n * Texto del botón.\n */\n @Prop() label!: string;\n\n /**\n * Indica el tipo de botón ayudando al usuario a explicar su funcionalidad.\n * Para ver más información al respecto, lea la documentación del componente.\n */\n @Prop()\n color: 'primary' | 'success' | 'warning' | 'error' | 'basic' =\n getGlobalComponentConfig('IrisButton')?.color || 'primary';\n\n /**\n * Icono del botón.\n * Consulta todos los iconos disponibles en: https://fonts.google.com/icons\n */\n @Prop()\n icon!: string;\n\n /**\n * Deshabilita el botón para que no pueda ser pulsado.\n */\n @Prop()\n disabled = getGlobalComponentConfig('IrisButton')?.disabled || false;\n\n /**\n * Tipo de botón.\n */\n @Prop()\n type: '' | 'icon' | 'fab' = getGlobalComponentConfig('IrisButton')?.type || '';\n\n /**\n * Permite mostrar una animación de carga mientras se realiza alguna acción.\n * Al activarse esta opción, el botón se deshabilita.\n */\n @Prop()\n loading = getGlobalComponentConfig('IrisButton')?.loading || false;\n\n /**\n * Tamaño del botón.\n */\n @Prop()\n size: 'small' | 'medium' | 'large' = getGlobalComponentConfig('IrisButton')?.size || 'medium';\n\n //#endregion\n\n //#region Variables privadas\n\n // Tag <button> del DOM.\n button!: HTMLButtonElement;\n\n //#endregion\n\n //#region Events\n\n /**\n * Evento del botón al ser pulsado.\n */\n @Event({ bubbles: false, composed: false }) buttonClicked: EventEmitter<Event>;\n\n /**\n * Evento del botón al ser enfocado.\n */\n @Event() buttonFocused: EventEmitter<Event>;\n\n /**\n * Evento lanzado cuando el componente está complementamente listo.\n */\n @Event() ready: EventEmitter<void>;\n\n //#endregion\n\n //#region Handlers\n\n //FIXME: Cuando loading se pone en true, también debería mantenerse disabled en true hasta que termine. Ahora se pone disabled a false antes de tiempo y rompe el funcionamiento.\n\n /**\n * Método que se ejecuta al hacer clic y emite el evento.\n * @param ev\n */\n handleClick = (ev: Event) => {\n // Evitamos que el evento burbujee.\n ev.stopPropagation();\n\n // Deshabilitamos el botón durante un segundo para que no sea pulsados repetidas veces.\n this.button.disabled = true;\n setTimeout(() => {\n if (!this.loading) {\n this.button.disabled = false;\n }\n }, 1000);\n\n // Lanzamos el evento.\n this.buttonClicked.emit(ev);\n };\n\n /**\n * Método que se ejecuta cuando se ha hecho focus en el botón.\n * @param ev\n */\n handleFocus = (ev: Event) => {\n this.buttonFocused.emit(ev);\n };\n\n //#endregion\n\n //#region Ciclos de vida\n\n componentDidLoad() {\n // Emitimos el evento de que el control se ha cargado.\n this.ready.emit();\n }\n\n //#endregion\n\n render() {\n // Validamos que todos los campos están rellenos.\n const requiredFiles: Record<string, any> = { label: this.label, icon: this.icon };\n if (!RequieredPropsUtils.check(requiredFiles)) return;\n\n return (\n <button\n class={`${this.size}`}\n color={this.color}\n type={this.type}\n onClick={this.handleClick}\n disabled={this.disabled || this.loading}\n onFocus={this.handleFocus}\n ref={(el) => (this.button = el as HTMLButtonElement)}\n title={this.label}\n >\n {\n // Comprobamos si se muestra cargando\n !this.loading ? (\n <iris-icon icon={this.icon} size={this.size}></iris-icon>\n ) : (\n <div class=\"loading\">\n <iris-loading size=\"small\" color={this.color}></iris-loading>\n </div>\n )\n }\n {\n // Solo añadimos el label para los botones normales.\n this.type == 'icon' || this.type == 'fab' ? '' : this.label\n }\n </button>\n );\n }\n}\n"]}
|