diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js b/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js index ab3eb40c2c..8ae34a5647 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js @@ -123,6 +123,14 @@ export const buttonGroupConfig = { defaultValue: '#007bff', }, }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'left', + }, + }, }, exposedVariables: { selected: [1], @@ -155,6 +163,7 @@ export const buttonGroupConfig = { disabledState: { value: '{{false}}' }, selectedTextColor: { value: '#FFFFFF' }, selectedBackgroundColor: { value: '#4368E3' }, + alignment: { value: 'left' }, }, }, }; diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/image.js b/frontend/src/AppBuilder/WidgetManager/widgets/image.js index c4bd7b6147..b962c270a5 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/image.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/image.js @@ -143,6 +143,15 @@ export const imageConfig = { }, accordian: 'Image', }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'center', + }, + accordian: 'Image', + }, backgroundColor: { type: 'color', displayName: 'Background', @@ -179,11 +188,11 @@ export const imageConfig = { padding: { type: 'switch', displayName: 'Padding', - validation: { schema: { type: 'string' }, defaultValue: 'default' }, options: [ { displayName: 'Default', value: 'default' }, { displayName: 'Custom', value: 'custom' }, ], + validation: { schema: { type: 'string' }, defaultValue: 'default' }, accordian: 'Container', isFxNotRequired: true, }, @@ -244,7 +253,6 @@ export const imageConfig = { loadingState: { value: '{{false}}' }, disabledState: { value: '{{false}}' }, visibility: { value: '{{true}}' }, - visible: { value: '{{true}}' }, }, events: [], styles: { @@ -256,6 +264,7 @@ export const imageConfig = { boxShadow: { value: '0px 0px 0px 0px #00000090' }, padding: { value: 'default' }, customPadding: { value: '{{0}}' }, + alignment: { value: 'center' }, }, }, }; diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/link.js b/frontend/src/AppBuilder/WidgetManager/widgets/link.js index 673abb1e75..b4da6d30ee 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/link.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/link.js @@ -159,6 +159,14 @@ export const linkConfig = { ], accordian: 'container', }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'left', + }, + }, }, exposedVariables: {}, actions: [ diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/pagination.js b/frontend/src/AppBuilder/WidgetManager/widgets/pagination.js index 6fabfa889a..116d0e9849 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/pagination.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/pagination.js @@ -50,6 +50,14 @@ export const paginationConfig = { defaultValue: false, }, }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'left', + }, + }, }, exposedVariables: { totalPages: null, @@ -73,6 +81,7 @@ export const paginationConfig = { styles: { visibility: { value: '{{true}}' }, disabledState: { value: '{{false}}' }, + alignment: { value: 'left' }, }, }, }; diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/svgImage.js b/frontend/src/AppBuilder/WidgetManager/widgets/svgImage.js index 315a6e2c28..9780f0cdd6 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/svgImage.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/svgImage.js @@ -32,6 +32,14 @@ export const svgImageConfig = { defaultValue: true, }, }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'left', + }, + }, }, exposedVariables: { value: {}, @@ -50,6 +58,7 @@ export const svgImageConfig = { events: [], styles: { visibility: { value: '{{true}}' }, + alignment: { value: 'left' }, }, }, }; diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/tags.js b/frontend/src/AppBuilder/WidgetManager/widgets/tags.js index 8af289b23a..73cd44b550 100644 --- a/frontend/src/AppBuilder/WidgetManager/widgets/tags.js +++ b/frontend/src/AppBuilder/WidgetManager/widgets/tags.js @@ -38,6 +38,14 @@ export const tagsConfig = { defaultValue: true, }, }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'left', + }, + }, }, exposedVariables: {}, definition: { @@ -54,6 +62,7 @@ export const tagsConfig = { events: [], styles: { visibility: { value: '{{true}}' }, + alignment: { value: 'left' }, }, }, }; diff --git a/frontend/src/Editor/Components/ButtonGroup.jsx b/frontend/src/Editor/Components/ButtonGroup.jsx index 67618a61ab..3647743e3a 100644 --- a/frontend/src/Editor/Components/ButtonGroup.jsx +++ b/frontend/src/Editor/Components/ButtonGroup.jsx @@ -25,6 +25,7 @@ export const ButtonGroup = function Button({ selectedBackgroundColor, selectedTextColor, boxShadow, + alignment, } = styles; const computedStyles = { @@ -115,38 +116,53 @@ export const ButtonGroup = function Button({ fireEvent('onClick'); } }; + + const mapAlignment = (alignment) => { + switch (alignment) { + case 'left': + return 'flex-start'; + case 'right': + return 'flex-end'; + case 'center': + return 'center'; + default: + return 'flex-start'; // Default to left alignment if the value is unknown + } + }; return ( -
- {label} -
- )} +