@xsmusices/ui 1.44.7 → 1.44.9
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/fesm2022/{xsmusices-ui-xs-buttons-group.xsstory-H1pcuFtx.mjs → xsmusices-ui-xs-buttons-group.xsstory-Cgmflzcs.mjs} +27 -5
- package/fesm2022/xsmusices-ui-xs-buttons-group.xsstory-Cgmflzcs.mjs.map +1 -0
- package/fesm2022/xsmusices-ui.mjs +13 -19
- package/fesm2022/xsmusices-ui.mjs.map +1 -1
- package/index.d.ts +14 -14
- package/package.json +1 -1
- package/fesm2022/xsmusices-ui-xs-buttons-group.xsstory-H1pcuFtx.mjs.map +0 -1
|
@@ -69,6 +69,28 @@ const story = {
|
|
|
69
69
|
],
|
|
70
70
|
},
|
|
71
71
|
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Control segmentado',
|
|
74
|
+
description: 'Un botón marcado como selected queda activo y no emite clic, como en un conmutador de vistas',
|
|
75
|
+
inputs: {
|
|
76
|
+
buttonsInput: [
|
|
77
|
+
{ label: 'Lista', selected: true },
|
|
78
|
+
{ label: 'Stats' },
|
|
79
|
+
{ label: 'Opciones' },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Control segmentado con iconos',
|
|
85
|
+
description: 'Sin label el layout cae a iconOnly automáticamente',
|
|
86
|
+
inputs: {
|
|
87
|
+
buttonsInput: [
|
|
88
|
+
{ icon: { name: 'list' }, selected: true },
|
|
89
|
+
{ icon: { name: 'chart-simple' } },
|
|
90
|
+
{ icon: { name: 'gear' } },
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
72
94
|
],
|
|
73
95
|
multilanguage: false,
|
|
74
96
|
notes: [
|
|
@@ -86,12 +108,12 @@ const story = {
|
|
|
86
108
|
},
|
|
87
109
|
],
|
|
88
110
|
coverage: {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
111
|
+
statements: 97,
|
|
112
|
+
branches: 100,
|
|
113
|
+
functions: 92,
|
|
114
|
+
lines: 97,
|
|
93
115
|
},
|
|
94
116
|
};
|
|
95
117
|
|
|
96
118
|
export { story };
|
|
97
|
-
//# sourceMappingURL=xsmusices-ui-xs-buttons-group.xsstory-
|
|
119
|
+
//# sourceMappingURL=xsmusices-ui-xs-buttons-group.xsstory-Cgmflzcs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xsmusices-ui-xs-buttons-group.xsstory-Cgmflzcs.mjs","sources":["../../../projects/xs-ui/src/lib/components/base/buttons-group/xs-buttons-group.xsstory.ts"],"sourcesContent":["import { StoryMeta } from '../../../story.types';\nimport { XSButtonsGroupComponent } from './xs-buttons-group.component';\n\nexport const story: StoryMeta = {\n id: 'buttons-group',\n name: 'Buttons Group',\n type: 'component',\n subtype: 'Base',\n status: 'active',\n usage: [],\n updated: '2026-01-16T11:57:36.415Z',\n created: '2025-08-15T21:04:25.954Z',\n description:\n 'Componente contenedor para crear grupos de botones con estilos conectados. Facilita la creación de barras de herramientas y controles segmentados.',\n component: XSButtonsGroupComponent,\n selector: 'xs-buttons-group',\n inputs: [\n {\n key: 'buttonsInput',\n label: 'Botones (Array)',\n type: 'json',\n default: [],\n },\n {\n key: 'buttonClick',\n label: 'Función de Click',\n type: 'json',\n default: undefined,\n },\n ],\n examples: [\n {\n name: 'Grupo Básico con Array',\n description:\n 'Grupo de botones creado desde un array de configuración',\n inputs: {\n buttonsInput: [\n { label: 'Guardar', variant: 'success' },\n { label: 'Cancelar', variant: 'secondary' },\n { label: 'Eliminar', variant: 'error' },\n ],\n },\n },\n {\n name: 'Grupo con Iconos',\n description: 'Botones agrupados con iconos FontAwesome',\n inputs: {\n buttonsInput: [\n { label: 'Editar', icon: { name: 'edit' } },\n { label: 'Copiar', icon: { name: 'copy' } },\n {\n label: 'Eliminar',\n icon: { name: 'trash' },\n variant: 'error',\n },\n ],\n },\n },\n {\n name: 'Grupo con Contenido Proyectado',\n description:\n 'Usando ng-content para botones personalizados',\n inputs: {},\n },\n {\n name: 'Grupo con Estados',\n description:\n 'Botones con diferentes estados (disabled, loading)',\n inputs: {\n buttonsInput: [\n { label: 'Activo' },\n { label: 'Cargando', loading: true },\n { label: 'Deshabilitado', disabled: true },\n ],\n },\n },\n {\n name: 'Control segmentado',\n description:\n 'Un botón marcado como selected queda activo y no emite clic, como en un conmutador de vistas',\n inputs: {\n buttonsInput: [\n { label: 'Lista', selected: true },\n { label: 'Stats' },\n { label: 'Opciones' },\n ],\n },\n },\n {\n name: 'Control segmentado con iconos',\n description:\n 'Sin label el layout cae a iconOnly automáticamente',\n inputs: {\n buttonsInput: [\n { icon: { name: 'list' }, selected: true },\n { icon: { name: 'chart-simple' } },\n { icon: { name: 'gear' } },\n ],\n },\n },\n ],\n multilanguage: false,\n notes: [\n {\n text: 'Los botones se conectan automáticamente con bordes y radios apropiados.',\n type: 'info',\n },\n {\n text: 'Soporta tanto configuración declarativa (buttonsInput) como proyección de contenido (ng-content).',\n type: 'info',\n },\n {\n text: 'Para eventos de click, usa buttonClickOutput o configura buttonClick.',\n type: 'info',\n },\n ],\n coverage: {\n statements: 97,\n branches: 100,\n functions: 92,\n lines: 97,\n },\n};\n"],"names":[],"mappings":";;AAGO,MAAM,KAAK,GAAc;AAC9B,IAAA,EAAE,EAAE,eAAe;AACnB,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,OAAO,EAAE,0BAA0B;AACnC,IAAA,OAAO,EAAE,0BAA0B;AACnC,IAAA,WAAW,EACT,oJAAoJ;AACtJ,IAAA,SAAS,EAAE,uBAAuB;AAClC,IAAA,QAAQ,EAAE,kBAAkB;AAC5B,IAAA,MAAM,EAAE;AACN,QAAA;AACE,YA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G,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACD,QAAA;AACE,YAAA,IAAI,EAAE,uEAAuE;AAC7E,YAAA,IAAI,EAAE,MAAM;AACb,SAAA;AACF,KAAA;AACD,IAAA,QAAQ,EAAE;AACR,QAAA,UAAU,EAAE,EAAE;AACd,QAAA,QAAQ,EAAE,GAAG;AACb,QAAA,SAAS,EAAE,EAAE;AACb,QAAA,KAAK,EAAE,EAAE;AACV,KAAA;;;;;"}
|
|
@@ -15779,12 +15779,22 @@ class XSButtonsGroupComponent {
|
|
|
15779
15779
|
return button.icon ?? null;
|
|
15780
15780
|
}
|
|
15781
15781
|
getButtonVariant(button) {
|
|
15782
|
-
|
|
15782
|
+
if (button.variant)
|
|
15783
|
+
return button.variant;
|
|
15784
|
+
if (button.selected)
|
|
15785
|
+
return 'tertiary';
|
|
15786
|
+
return 'primary';
|
|
15783
15787
|
}
|
|
15784
15788
|
getButtonLayout(button) {
|
|
15785
|
-
|
|
15789
|
+
if (button.layout)
|
|
15790
|
+
return button.layout;
|
|
15791
|
+
if (button.icon && !button.label)
|
|
15792
|
+
return 'iconOnly';
|
|
15793
|
+
return 'base';
|
|
15786
15794
|
}
|
|
15787
15795
|
onButtonClick(button, index) {
|
|
15796
|
+
if (button.selected || button.disabled)
|
|
15797
|
+
return;
|
|
15788
15798
|
const callback = this.buttonClick();
|
|
15789
15799
|
if (callback) {
|
|
15790
15800
|
callback(button, index);
|
|
@@ -15802,22 +15812,6 @@ class XSButtonsGroupComponent {
|
|
|
15802
15812
|
else {
|
|
15803
15813
|
button.groupPosition.set('middle');
|
|
15804
15814
|
}
|
|
15805
|
-
const buttonElement = button.elementRef
|
|
15806
|
-
.nativeElement;
|
|
15807
|
-
buttonElement.classList.add('button-grouped');
|
|
15808
|
-
buttonElement.classList.remove('border-l', 'border-zinc-700');
|
|
15809
|
-
if (index > 0) {
|
|
15810
|
-
buttonElement.classList.add('border-l', 'border-zinc-700');
|
|
15811
|
-
}
|
|
15812
|
-
if (index === 0) {
|
|
15813
|
-
buttonElement.style.borderRadius = '0.5rem 0 0 0.5rem';
|
|
15814
|
-
}
|
|
15815
|
-
else if (index === totalButtons - 1) {
|
|
15816
|
-
buttonElement.style.borderRadius = '0 0.5rem 0.5rem 0';
|
|
15817
|
-
}
|
|
15818
|
-
else {
|
|
15819
|
-
buttonElement.style.borderRadius = '0';
|
|
15820
|
-
}
|
|
15821
15815
|
}
|
|
15822
15816
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: XSButtonsGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15823
15817
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: XSButtonsGroupComponent, isStandalone: true, selector: "xs-buttons-group", inputs: { buttonsInput: { classPropertyName: "buttonsInput", publicName: "buttonsInput", isSignal: true, isRequired: false, transformFunction: null }, buttonClick: { classPropertyName: "buttonClick", publicName: "buttonClick", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClickOutput: "buttonClickOutput" }, host: { attributes: { "xs-buttons-group-host": "" } }, queries: [{ propertyName: "contentButtons", predicate: XSButtonComponent, isSignal: true }], viewQueries: [{ propertyName: "viewButtons", predicate: XSButtonComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"inline-flex w-full\">\n @for (\n button of buttonsInput();\n track $index\n ) {\n <xs-button\n [label]=\"button.label || ''\"\n [icon]=\"getButtonIcon(button)\"\n [variant]=\"getButtonVariant(button)\"\n [layout]=\"getButtonLayout(button)\"\n [disabled]=\"button.disabled || false\"\n [loading]=\"button.loading || false\"\n [customClass]=\"button.customClass || ''\"\n (click)=\"onButtonClick(button, $index)\"\n (keydown.enter)=\"onButtonClick(button, $index)\"\n ></xs-button>\n }\n\n @if (buttonsInput().length === 0) {\n <ng-content></ng-content>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: XSButtonComponent, selector: "xs-button", inputs: ["id", "label", "type", "icon", "action", "customClass", "variant", "layout", "badgeCount", "isFull", "disabled", "loading", "title", "ariaLabel", "borderRadius", "isGrouped", "groupPosition"], outputs: ["isGroupedChange", "groupPositionChange", "click", "onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -23220,7 +23214,7 @@ const LIB_STORIES = [
|
|
|
23220
23214
|
() => import('./xsmusices-ui-xs-action-sheet.xsstory-CBpZBlfx.mjs').then((m) => m.story),
|
|
23221
23215
|
() => import('./xsmusices-ui-xs-block.xsstory-GXV6UFJo.mjs').then((m) => m.story),
|
|
23222
23216
|
() => import('./xsmusices-ui-xs-button.xsstory-DqECZuZF.mjs').then((m) => m.story),
|
|
23223
|
-
() => import('./xsmusices-ui-xs-buttons-group.xsstory-
|
|
23217
|
+
() => import('./xsmusices-ui-xs-buttons-group.xsstory-Cgmflzcs.mjs').then((m) => m.story),
|
|
23224
23218
|
() => import('./xsmusices-ui-xs-chart.xsstory--iUHj7bv.mjs').then((m) => m.story),
|
|
23225
23219
|
() => import('./xsmusices-ui-xs-formly.xsstory-Bjne7mpZ.mjs').then((m) => m.story),
|
|
23226
23220
|
() => import('./xsmusices-ui-xs-empty-state.xsstory-CCOJ4b9_.mjs').then((m) => m.story),
|