+
+
+
+ handlerChanged(index, 'windowTarget', _value)}
+ defaultValue={event?.windowTarget || 'newTab'}
+ style={{ width: '74%' }}
+ >
+ New tab
+ Current tab
+
+
)}
diff --git a/frontend/src/AppBuilder/RightSideBar/Inspector/Inspector.jsx b/frontend/src/AppBuilder/RightSideBar/Inspector/Inspector.jsx
index 6a3465403d..9e227b1e05 100644
--- a/frontend/src/AppBuilder/RightSideBar/Inspector/Inspector.jsx
+++ b/frontend/src/AppBuilder/RightSideBar/Inspector/Inspector.jsx
@@ -8,6 +8,8 @@ import { validateQueryName, convertToKebabCase, resolveReferences } from '@/_hel
import { useHotkeys } from 'react-hotkeys-hook';
import { DefaultComponent } from './Components/DefaultComponent';
import { FilePicker } from './Components/FilePicker';
+import { PhoneInput } from './Components/PhoneInput/PhoneInput.jsx';
+import { CurrencyInput } from './Components/CurrencyInput/CurrencyInput.jsx';
import { Modal } from './Components/Modal';
import { ModalV2 } from './Components/ModalV2';
import { CustomComponent } from './Components/CustomComponent';
@@ -36,6 +38,7 @@ import { EMPTY_ARRAY } from '@/_stores/editorStore';
import { Select } from './Components/Select';
import { deepClone } from '@/_helpers/utilities/utils.helpers';
import useStore from '@/AppBuilder/_stores/store';
+// import { componentTypes } from '@/Editor/WidgetManager/components';
import { componentTypes } from '@/AppBuilder/WidgetManager/componentTypes';
import { copyComponents } from '@/AppBuilder/AppCanvas/appCanvasUtils.js';
import DatetimePickerV2 from './Components/DatetimePickerV2.jsx';
@@ -66,7 +69,11 @@ const INSPECTOR_HEADER_OPTIONS = [
const NEW_REVAMPED_COMPONENTS = [
'Text',
'TextInput',
+ 'TextArea',
'PasswordInput',
+ 'EmailInput',
+ 'PhoneInput',
+ 'CurrencyInput',
'NumberInput',
'Table',
'ToggleSwitchV2',
@@ -80,6 +87,7 @@ const NEW_REVAMPED_COMPONENTS = [
'Image',
'Container',
'ModalV2',
+ 'Link',
];
export const Inspector = ({ componentDefinitionChanged, darkMode, pages, selectedComponentId }) => {
@@ -730,6 +738,10 @@ const GetAccordion = React.memo(
case 'DatePickerV2':
case 'TimePicker':
return
;
+ case 'PhoneInput':
+ return
;
+ case 'CurrencyInput':
+ return
;
default: {
return
;
diff --git a/frontend/src/AppBuilder/RightSideBar/Inspector/Utils.js b/frontend/src/AppBuilder/RightSideBar/Inspector/Utils.js
index 62ee032172..7e47f7f6c0 100644
--- a/frontend/src/AppBuilder/RightSideBar/Inspector/Utils.js
+++ b/frontend/src/AppBuilder/RightSideBar/Inspector/Utils.js
@@ -43,6 +43,9 @@ export function renderCustomStyles(
componentConfig.component == 'TextInput' ||
componentConfig.component == 'NumberInput' ||
componentConfig.component == 'PasswordInput' ||
+ componentConfig.component == 'EmailInput' ||
+ componentConfig.component == 'PhoneInput' ||
+ componentConfig.component == 'CurrencyInput' ||
componentConfig.component == 'ToggleSwitchV2' ||
componentConfig.component == 'Checkbox' ||
componentConfig.component == 'Table' ||
diff --git a/frontend/src/AppBuilder/RightSideBar/WidgetBox/WidgetBox.jsx b/frontend/src/AppBuilder/RightSideBar/WidgetBox/WidgetBox.jsx
index 69ded14971..9ce3bbd4ce 100644
--- a/frontend/src/AppBuilder/RightSideBar/WidgetBox/WidgetBox.jsx
+++ b/frontend/src/AppBuilder/RightSideBar/WidgetBox/WidgetBox.jsx
@@ -13,6 +13,7 @@ const NEW_WIDGETS = [
'DatePickerV2',
'TimePicker',
'ModalV2',
+ 'TextArea',
];
export const WidgetBox = ({ component, darkMode }) => {
diff --git a/frontend/src/AppBuilder/Viewer/MobileNavigationMenu.jsx b/frontend/src/AppBuilder/Viewer/MobileNavigationMenu.jsx
index e6c8179328..bf4b6b50b4 100644
--- a/frontend/src/AppBuilder/Viewer/MobileNavigationMenu.jsx
+++ b/frontend/src/AppBuilder/Viewer/MobileNavigationMenu.jsx
@@ -134,7 +134,7 @@ const MobileNavigationMenu = ({ pages, switchPage, currentPageId, darkMode, chan
version: selectedVersionName,
env: selectedEnvironmentName,
};
- switchPage(pageId, pages.find((page) => page.id === pageId)?.handle, Object.entries(queryParams), true);
+ switchPage(pageId, pages.find((page) => page.id === pageId)?.handle, Object.entries(queryParams));
};
var styles = {
bmBurgerButton: {
diff --git a/frontend/src/AppBuilder/Viewer/ViewerSidebarNavigation.jsx b/frontend/src/AppBuilder/Viewer/ViewerSidebarNavigation.jsx
index d913bffd91..a7111a48a0 100644
--- a/frontend/src/AppBuilder/Viewer/ViewerSidebarNavigation.jsx
+++ b/frontend/src/AppBuilder/Viewer/ViewerSidebarNavigation.jsx
@@ -95,7 +95,7 @@ export const ViewerSidebarNavigation = ({
version: selectedVersionName,
env: selectedEnvironmentName,
};
- switchPage(pageId, pages.find((page) => page.id === pageId)?.handle, Object.entries(queryParams), true);
+ switchPage(pageId, pages.find((page) => page.id === pageId)?.handle, Object.entries(queryParams));
};
const isLicensed =
diff --git a/frontend/src/AppBuilder/WidgetManager/configs/widgetConfig.js b/frontend/src/AppBuilder/WidgetManager/configs/widgetConfig.js
index be2855c476..136ef942c7 100644
--- a/frontend/src/AppBuilder/WidgetManager/configs/widgetConfig.js
+++ b/frontend/src/AppBuilder/WidgetManager/configs/widgetConfig.js
@@ -58,6 +58,9 @@ import {
linkConfig,
iconConfig,
boundedBoxConfig,
+ emailinputConfig,
+ phoneinputConfig,
+ currencyinputConfig,
} from '../widgets';
export const widgets = [
@@ -70,6 +73,9 @@ export const widgets = [
textinputConfig,
numberinputConfig,
passinputConfig,
+ emailinputConfig,
+ phoneinputConfig,
+ currencyinputConfig,
datepickerConfig,
datetimePickerV2Config,
datePickerV2Config,
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/button.js b/frontend/src/AppBuilder/WidgetManager/widgets/button.js
index 67da105c55..d5b6a58214 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/button.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/button.js
@@ -61,7 +61,7 @@ export const buttonConfig = {
accordian: 'button',
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: {
schema: { type: 'string' },
@@ -74,7 +74,7 @@ export const buttonConfig = {
accordian: 'button',
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -83,7 +83,7 @@ export const buttonConfig = {
accordian: 'button',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
@@ -92,7 +92,7 @@ export const buttonConfig = {
accordian: 'button',
},
loaderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Loader color',
validation: {
schema: { type: 'string' },
@@ -110,7 +110,7 @@ export const buttonConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Icon color',
validation: { schema: { type: 'string' } },
accordian: 'button',
@@ -219,10 +219,10 @@ export const buttonConfig = {
events: [],
styles: {
textColor: { value: '#FFFFFF' },
- borderColor: { value: '#4368E3' },
+ borderColor: { value: 'var(--primary-brand)' },
loaderColor: { value: '#FFFFFF' },
borderRadius: { value: '{{6}}' },
- backgroundColor: { value: '#4368E3' },
+ backgroundColor: { value: 'var(--primary-brand)' },
iconColor: { value: '#FFFFFF' },
direction: { value: 'left' },
padding: { value: 'default' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js b/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js
index c0fa889dd5..d4ab44b3ab 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/buttonGroup.js
@@ -68,7 +68,7 @@ export const buttonGroupConfig = {
},
styles: {
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background color',
validation: {
schema: { type: 'string' },
@@ -76,7 +76,7 @@ export const buttonGroupConfig = {
},
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -108,7 +108,7 @@ export const buttonGroupConfig = {
},
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Selected text colour',
validation: {
schema: { type: 'string' },
@@ -116,17 +116,32 @@ export const buttonGroupConfig = {
},
},
selectedBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Selected background color',
validation: {
schema: { type: 'string' },
- defaultValue: '#007bff',
+ defaultValue: 'var(--primary-brand)',
+ },
+ },
+ alignment: {
+ type: 'alignButtons',
+ displayName: 'Alignment',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'left',
},
},
},
exposedVariables: {
selected: [1],
},
+ actions: [
+ {
+ handle: 'setSelected',
+ displayName: 'Select option',
+ params: [{ handle: 'selected', displayName: 'Value' }],
+ },
+ ],
definition: {
others: {
showOnDesktop: { value: '{{true}}' },
@@ -147,7 +162,8 @@ export const buttonGroupConfig = {
borderRadius: { value: '{{4}}' },
disabledState: { value: '{{false}}' },
selectedTextColor: { value: '#FFFFFF' },
- selectedBackgroundColor: { value: '#4368E3' },
+ selectedBackgroundColor: { value: 'var(--primary-brand)' },
+ alignment: { value: 'left' },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/chart.js b/frontend/src/AppBuilder/WidgetManager/widgets/chart.js
index 72ab688056..81dbd2547a 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/chart.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/chart.js
@@ -39,13 +39,13 @@ export const chartConfig = {
},
},
markerColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Marker color',
validation: {
schema: {
type: 'string',
},
- defaultValue: '#CDE1F8',
+ defaultValue: 'var(--primary-brand)',
},
},
showAxes: {
@@ -134,7 +134,7 @@ export const chartConfig = {
},
styles: {
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background color',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
},
@@ -192,7 +192,7 @@ export const chartConfig = {
},
properties: {
title: { value: 'This title can be changed' },
- markerColor: { value: '#CDE1F8' },
+ markerColor: { value: 'var(--primary-brand)' },
showAxes: { value: '{{true}}' },
showGridLines: { value: '{{true}}' },
plotFromJson: { value: '{{false}}' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/checkbox.js b/frontend/src/AppBuilder/WidgetManager/widgets/checkbox.js
index c9b6424020..ca509979cb 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/checkbox.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/checkbox.js
@@ -70,7 +70,7 @@ export const checkboxConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -78,7 +78,7 @@ export const checkboxConfig = {
accordian: 'label',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
@@ -86,7 +86,7 @@ export const checkboxConfig = {
accordian: 'switch',
},
checkboxColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Checked color',
validation: {
schema: { type: 'string' },
@@ -94,7 +94,7 @@ export const checkboxConfig = {
accordian: 'switch',
},
uncheckedColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Unchecked color',
validation: {
schema: { type: 'string' },
@@ -102,7 +102,7 @@ export const checkboxConfig = {
accordian: 'switch',
},
handleColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Handle color',
validation: {
schema: { type: 'string' },
@@ -183,7 +183,7 @@ export const checkboxConfig = {
styles: {
disabledState: { value: '{{false}}' },
textColor: { value: '#1B1F24' },
- checkboxColor: { value: '#4368E3' },
+ checkboxColor: { value: 'var(--primary-brand)' },
uncheckedColor: { value: '#E4E7EB' },
borderColor: { value: '#CCD1D5' },
handleColor: { value: '#FFFFFF' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/circularProgressbar.js b/frontend/src/AppBuilder/WidgetManager/widgets/circularProgressbar.js
index a7ffd551af..2babc27a12 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/circularProgressbar.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/circularProgressbar.js
@@ -32,15 +32,15 @@ export const circularProgressbarConfig = {
events: {},
styles: {
color: {
- type: 'color',
- displayName: 'Color',
+ type: 'colorSwatches',
+ displayName: 'colorSwatches',
validation: {
schema: { type: 'string' },
- defaultValue: '#375FCF',
+ defaultValue: 'var(--primary-brand)',
},
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text Color',
validation: {
schema: { type: 'string' },
@@ -104,7 +104,7 @@ export const circularProgressbarConfig = {
},
events: [],
styles: {
- color: { value: '' },
+ color: { value: 'var(--primary-brand)' },
textColor: { value: '' },
textSize: { value: '{{16}}' },
strokeWidth: { value: '{{8}}' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/colorPicker.js b/frontend/src/AppBuilder/WidgetManager/widgets/colorPicker.js
index b2fddd7e4c..6ecdede1a8 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/colorPicker.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/colorPicker.js
@@ -4,7 +4,7 @@ export const colorPickerConfig = {
description: 'Choose colors from a palette',
component: 'ColorPicker',
properties: {
- defaultColor: { type: 'color', displayName: 'Default color' },
+ defaultColor: { type: 'colorSwatches', displayName: 'Default color' },
},
defaultSize: {
width: 9,
@@ -14,7 +14,9 @@ export const colorPickerConfig = {
{
displayName: 'Set Color',
handle: 'setColor',
- params: [{ handle: 'color', displayName: 'color', defaultValue: '#ffffff', type: 'color' }],
+ params: [
+ { handle: 'colorSwatches', displayName: 'colorSwatches', defaultValue: '#ffffff', type: 'colorSwatches' },
+ ],
},
],
others: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/container.js b/frontend/src/AppBuilder/WidgetManager/widgets/container.js
index 37a895f553..424b9a801d 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/container.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/container.js
@@ -44,7 +44,7 @@ export const containerConfig = {
displayName: 'Show header',
validation: {
schema: { type: 'boolean' },
- defaultValue: true,
+ defaultValue: false,
},
},
},
@@ -58,6 +58,7 @@ export const containerConfig = {
},
displayName: 'ContainerText',
properties: ['text'],
+ slotName: 'header',
accessorKey: 'text',
styles: ['fontWeight', 'textSize', 'textColor'],
defaultValue: {
@@ -71,7 +72,7 @@ export const containerConfig = {
events: {},
styles: {
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: {
schema: { type: 'string' },
@@ -80,7 +81,7 @@ export const containerConfig = {
accordian: 'container',
},
headerBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: {
schema: { type: 'string' },
@@ -89,7 +90,7 @@ export const containerConfig = {
accordian: 'header',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
@@ -153,7 +154,7 @@ export const containerConfig = {
showOnMobile: { value: '{{false}}' },
},
properties: {
- showHeader: { value: `{{true}}` },
+ showHeader: { value: `{{false}}` },
loadingState: { value: `{{false}}` },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
@@ -163,6 +164,7 @@ export const containerConfig = {
backgroundColor: { value: '#fff' },
headerBackgroundColor: { value: '#fff' },
borderRadius: { value: '4' },
+ headerHeight: { value: '{{80}}' },
borderColor: { value: '#fff' },
boxShadow: { value: '0px 0px 0px 0px #00000040' },
},
diff --git a/server/src/modules/apps/services/widget-config/timepickerV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/currencyinput.js
similarity index 59%
rename from server/src/modules/apps/services/widget-config/timepickerV2.js
rename to frontend/src/AppBuilder/WidgetManager/widgets/currencyinput.js
index 22f64ea366..64a8f2df57 100644
--- a/server/src/modules/apps/services/widget-config/timepickerV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/currencyinput.js
@@ -1,32 +1,12 @@
-export const timePickerConfig = {
- name: 'TimePicker',
- displayName: 'Time Picker',
- description: 'Choose date and time',
- component: 'TimePicker',
+export const currencyinputConfig = {
+ name: 'CurrencyInput',
+ displayName: 'Currency Input',
+ description: 'Currency input field',
+ component: 'CurrencyInput',
defaultSize: {
width: 10,
height: 40,
},
- validation: {
- minTime: {
- type: 'timepicker',
- placeholder: 'HH:mm',
- displayName: 'Min Time',
- },
- maxTime: {
- type: 'timepicker',
- placeholder: 'HH:mm',
- displayName: 'Max Time',
- },
- customRule: {
- type: 'code',
- displayName: 'Custom validation',
- },
- mandatory: {
- type: 'toggle',
- displayName: 'Make this field mandatory',
- },
- },
others: {
showOnDesktop: { type: 'toggle', displayName: 'Show on desktop' },
showOnMobile: { type: 'toggle', displayName: 'Show on mobile' },
@@ -35,142 +15,88 @@ export const timePickerConfig = {
label: {
type: 'code',
displayName: 'Label',
+ validation: { schema: { type: 'string' }, defaultValue: 'Label' },
+ },
+ placeholder: {
+ type: 'code',
+ displayName: 'Placeholder',
validation: {
schema: { type: 'string' },
- defaultValue: 'Label',
+ defaultValue: 'Enter your number',
},
- accordian: 'Data',
},
- defaultValue: {
+ value: {
type: 'code',
displayName: 'Default value',
validation: {
- schema: { type: 'string' },
- defaultValue: '00:00',
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: 0,
},
},
- isTimezoneEnabled: {
+ decimalPlaces: {
+ type: 'code',
+ displayName: 'Decimal places',
+ validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: '2' },
+ },
+ isCountryChangeEnabled: {
type: 'toggle',
- displayName: 'Manage time zones',
- validation: { schema: { type: 'boolean' }, defaultValue: false },
- section: 'formatting',
+ displayName: 'Enable currency change',
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
},
loadingState: {
type: 'toggle',
displayName: 'Loading state',
- validation: { schema: { type: 'boolean' }, defaultValue: true },
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
section: 'additionalActions',
},
visibility: {
type: 'toggle',
displayName: 'Visibility',
validation: { schema: { type: 'boolean' }, defaultValue: true },
-
section: 'additionalActions',
},
disabledState: {
type: 'toggle',
displayName: 'Disable',
- validation: { schema: { type: 'boolean' }, defaultValue: true },
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
section: 'additionalActions',
},
tooltip: {
type: 'code',
displayName: 'Tooltip',
- validation: {
- schema: { type: 'string' },
- defaultValue: 'Enter tooltip text',
- },
+ validation: { schema: { type: 'string' }, defaultValue: 'Tooltip text' },
section: 'additionalActions',
placeholder: 'Enter tooltip text',
},
},
+ validation: {
+ mandatory: { type: 'toggle', displayName: 'Make this field mandatory' },
+ regex: { type: 'code', displayName: 'Regex', placeholder: '^[a-zA-Z0-9_ -]{3,16}$' },
+ minValue: { type: 'code', displayName: 'Min value', placeholder: 'Enter min value' },
+ maxValue: { type: 'code', displayName: 'Max value', placeholder: 'Enter max value' },
+ customRule: {
+ type: 'code',
+ displayName: 'Custom validation',
+ placeholder: `{{components.text2.text=='yes'&&'valid'}}`,
+ },
+ },
events: {
- onSelect: { displayName: 'On select' },
+ onChange: { displayName: 'On change' },
+ onEnterPressed: { displayName: 'On enter pressed' },
onFocus: { displayName: 'On focus' },
onBlur: { displayName: 'On blur' },
},
- actions: [
- {
- handle: 'setValue',
- displayName: 'Set value',
- params: [
- { handle: 'value', displayName: 'Value' },
- { handle: 'format', displayName: 'Format' },
- ],
- },
- {
- handle: 'clearValue',
- displayName: 'Clear value',
- },
- {
- handle: 'setTime',
- displayName: 'Set time',
- params: [
- { handle: 'value', displayName: 'Value' },
- { handle: 'format', displayName: 'Format' },
- ],
- },
- {
- handle: 'setValueInTimestamp',
- displayName: 'Set value in timestamp',
- params: [{ handle: 'value', displayName: 'Value' }],
- },
- {
- handle: 'setMinTime',
- displayName: 'Set min time',
- params: [{ handle: 'value', displayName: 'Value' }],
- },
- {
- handle: 'setMaxTime',
- displayName: 'Set max time',
- params: [{ handle: 'value', displayName: 'Value' }],
- },
- {
- handle: 'setDisplayTimezone',
- displayName: 'Set display timezone',
- params: [{ handle: 'value', displayName: 'Value' }],
- },
- {
- handle: 'setStoreTimezone',
- displayName: 'Set store timezone',
- params: [{ handle: 'value', displayName: 'Value' }],
- },
- {
- handle: 'setVisibility',
- displayName: 'Set visibility',
- params: [{ handle: 'value', displayName: 'Value', defaultValue: `{{true}}`, type: 'toggle' }],
- },
- {
- handle: 'setLoading',
- displayName: 'Set loading',
- params: [{ handle: 'value', displayName: 'Value', defaultValue: `{{false}}`, type: 'toggle' }],
- },
- {
- handle: 'setDisable',
- displayName: 'Set disable',
- params: [{ handle: 'value', displayName: 'Value', defaultValue: `{{false}}`, type: 'toggle' }],
- },
- {
- handle: 'setFocus',
- displayName: 'Set focus',
- },
- {
- handle: 'setBlur',
- displayName: 'Set blur',
- },
- ],
styles: {
- labelColor: {
+ color: {
type: 'color',
- displayName: 'Color',
+ displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
},
alignment: {
type: 'switch',
displayName: 'Alignment',
- validation: { schema: { type: 'string' }, defaultValue: 'top' },
+ validation: { schema: { type: 'string' }, defaultValue: 'side' },
options: [
{ displayName: 'Side', value: 'side' },
{ displayName: 'Top', value: 'top' },
@@ -179,7 +105,7 @@ export const timePickerConfig = {
},
direction: {
type: 'switch',
- displayName: 'Direction',
+ displayName: '',
validation: { schema: { type: 'string' }, defaultValue: 'left' },
showLabel: false,
isIcon: true,
@@ -190,7 +116,7 @@ export const timePickerConfig = {
accordian: 'label',
isFxNotRequired: true,
},
- labelWidth: {
+ width: {
type: 'slider',
displayName: 'Width',
accordian: 'label',
@@ -204,7 +130,7 @@ export const timePickerConfig = {
type: 'checkbox',
displayName: 'auto',
showLabel: false,
- validation: { schema: { type: 'boolean' } },
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
accordian: 'label',
conditionallyRender: {
key: 'alignment',
@@ -212,13 +138,14 @@ export const timePickerConfig = {
},
isFxNotRequired: true,
},
- fieldBackgroundColor: {
+
+ backgroundColor: {
type: 'color',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
- fieldBorderColor: {
+ borderColor: {
type: 'color',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
@@ -230,7 +157,7 @@ export const timePickerConfig = {
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
- selectedTextColor: {
+ textColor: {
type: 'color',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
@@ -239,7 +166,7 @@ export const timePickerConfig = {
errTextColor: {
type: 'color',
displayName: 'Error text',
- validation: { schema: { type: 'string' }, defaultValue: '#E54D2E' },
+ validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
},
icon: {
@@ -251,38 +178,24 @@ export const timePickerConfig = {
},
iconColor: {
type: 'color',
- displayName: '',
- showLabel: false,
- validation: {
- schema: { type: 'string' },
- defaultValue: '#6A727C',
- },
+ displayName: 'Icon color',
+ validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' },
accordian: 'field',
- },
- iconDirection: {
- type: 'switch',
- displayName: '',
- validation: { schema: { type: 'string' } },
+ visibility: false,
showLabel: false,
- isIcon: true,
- options: [
- { displayName: 'alignleftinspector', value: 'left', iconName: 'alignleftinspector' },
- { displayName: 'alignrightinspector', value: 'right', iconName: 'alignrightinspector' },
- ],
- accordian: 'field',
},
- fieldBorderRadius: {
- type: 'input',
+ borderRadius: {
+ type: 'numberInput',
displayName: 'Border radius',
validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: 6 },
accordian: 'field',
},
boxShadow: {
type: 'boxShadow',
- displayName: 'Box shadow',
+ displayName: 'Box Shadow',
validation: {
schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
- defaultValue: '0px 0px 0px 0px #121212',
+ defaultValue: '0px 0px 0px 0px #00000040',
},
accordian: 'field',
},
@@ -293,6 +206,7 @@ export const timePickerConfig = {
schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
defaultValue: 'default',
},
+ isFxNotRequired: true,
options: [
{ displayName: 'Default', value: 'default' },
{ displayName: 'None', value: 'none' },
@@ -300,52 +214,92 @@ export const timePickerConfig = {
accordian: 'container',
},
},
-
exposedVariables: {
value: '',
+ isMandatory: false,
+ isVisible: true,
+ isDisabled: false,
+ isLoading: false,
},
+ actions: [
+ {
+ handle: 'setValue',
+ displayName: 'Set Value',
+ params: [
+ { handle: 'value', displayName: 'value', defaultValue: '' },
+ { handle: 'country', displayName: 'country', defaultValue: '' },
+ ],
+ },
+ {
+ handle: 'clear',
+ displayName: 'Clear',
+ },
+ {
+ handle: 'setFocus',
+ displayName: 'Set focus',
+ },
+ {
+ handle: 'setBlur',
+ displayName: 'Set blur',
+ },
+ {
+ handle: 'setVisibility',
+ displayName: 'Set visibility',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setDisable',
+ displayName: 'Set disable',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setLoading',
+ displayName: 'Set loading',
+ params: [{ handle: 'loading', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ ],
definition: {
+ validation: {
+ mandatory: { value: '{{false}}' },
+ regex: { value: '' },
+ minValue: { value: '' },
+ maxValue: { value: '' },
+ customRule: { value: '' },
+ },
+
others: {
showOnDesktop: { value: '{{true}}' },
showOnMobile: { value: '{{false}}' },
},
- validation: {
- minTime: { value: '' },
- maxTime: { value: '' },
- customRule: { value: '' },
- mandatory: { value: '{{false}}' },
- },
properties: {
+ value: { value: '0' },
label: { value: 'Label' },
- defaultValue: { value: '00:00' },
- timeFormat: { value: 'HH:mm' },
- isTimezoneEnabled: { value: '{{false}}' },
- displayTimezone: { value: 'UTC' },
- storeTimezone: { value: 'UTC' },
- loadingState: { value: '{{false}}' },
+ placeholder: { value: 'Enter amount' },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
+ loadingState: { value: '{{false}}' },
tooltip: { value: '' },
+ isCountryChangeEnabled: { value: '{{true}}' },
+ decimalPlaces: { value: '2' },
},
events: [],
styles: {
- labelColor: { value: '#1B1F24' },
- alignment: { value: 'side' },
- direction: { value: 'left' },
- labelWidth: { value: '20' },
- auto: { value: '{{true}}' },
- fieldBackgroundColor: { value: '#fff' },
- fieldBorderColor: { value: '#CCD1D5' },
+ textColor: { value: '#1B1F24' },
+ borderColor: { value: '#CCD1D5' },
accentColor: { value: '#4368E3' },
- selectedTextColor: { value: '#1B1F24' },
- errTextColor: { value: '#E54D2E' },
- icon: { value: 'IconClock' },
- iconVisibility: { value: true },
- iconDirection: { value: 'left' },
- fieldBorderRadius: { value: '{{6}}' },
- boxShadow: { value: '0px 0px 0px 0px #121212' },
+ errTextColor: { value: '#D72D39' },
+ borderRadius: { value: '{{6}}' },
+ backgroundColor: { value: '#fff' },
+ iconColor: { value: '#CFD3D859' },
+ direction: { value: 'left' },
+ width: { value: '{{33}}' },
+ alignment: { value: 'side' },
+ color: { value: '#1B1F24' },
+ auto: { value: '{{true}}' },
padding: { value: 'default' },
- iconColor: { value: '#6A727C' },
+ boxShadow: { value: '0px 0px 0px 0px #00000040' },
+ icon: { value: 'IconHome2' },
+ iconVisibility: { value: false },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/datepickerV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/datepickerV2.js
index 87de5d137b..ea56598d2e 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/datepickerV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/datepickerV2.js
@@ -169,8 +169,8 @@ export const datePickerV2Config = {
],
styles: {
labelColor: {
- type: 'color',
- displayName: 'Color',
+ type: 'colorSwatches',
+ displayName: 'colorSwatches',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
},
@@ -220,31 +220,31 @@ export const datePickerV2Config = {
isFxNotRequired: true,
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#E54D2E' },
accordian: 'field',
@@ -257,7 +257,7 @@ export const datePickerV2Config = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: '',
showLabel: false,
validation: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/daterangepicker.js b/frontend/src/AppBuilder/WidgetManager/widgets/daterangepicker.js
index 1f38a8df6d..2fcd5bfb42 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/daterangepicker.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/daterangepicker.js
@@ -199,8 +199,8 @@ export const daterangepickerConfig = {
],
styles: {
labelColor: {
- type: 'color',
- displayName: 'Color',
+ type: 'colorSwatches',
+ displayName: 'colorSwatches',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
},
@@ -250,31 +250,31 @@ export const daterangepickerConfig = {
isFxNotRequired: true,
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#E54D2E' },
accordian: 'field',
@@ -287,7 +287,7 @@ export const daterangepickerConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: '',
showLabel: false,
validation: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/datetimepickerV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/datetimepickerV2.js
index 388eb9786c..658cc31c01 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/datetimepickerV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/datetimepickerV2.js
@@ -214,8 +214,8 @@ export const datetimePickerV2Config = {
],
styles: {
labelColor: {
- type: 'color',
- displayName: 'Color',
+ type: 'colorSwatches',
+ displayName: 'colorSwatches',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
},
@@ -265,31 +265,31 @@ export const datetimePickerV2Config = {
isFxNotRequired: true,
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#E54D2E' },
accordian: 'field',
@@ -302,7 +302,7 @@ export const datetimePickerV2Config = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: '',
showLabel: false,
validation: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/divider.js b/frontend/src/AppBuilder/WidgetManager/widgets/divider.js
index 045f894816..3905c7583d 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/divider.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/divider.js
@@ -15,7 +15,7 @@ export const dividerConfig = {
events: {},
styles: {
dividerColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Divider color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/dropdown.js b/frontend/src/AppBuilder/WidgetManager/widgets/dropdown.js
index b2c58acc7a..b8b090af24 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/dropdown.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/dropdown.js
@@ -128,7 +128,7 @@ export const dropdownConfig = {
defaultValue: true,
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Selected text color',
validation: {
schema: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/dropdownV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/dropdownV2.js
index de90dbd0bf..588bc655c6 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/dropdownV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/dropdownV2.js
@@ -101,7 +101,7 @@ export const dropdownV2Config = {
},
styles: {
labelColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -153,31 +153,31 @@ export const dropdownV2Config = {
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
@@ -190,7 +190,7 @@ export const dropdownV2Config = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: '',
showLabel: false,
validation: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/emailinput.js b/frontend/src/AppBuilder/WidgetManager/widgets/emailinput.js
new file mode 100644
index 0000000000..825340616f
--- /dev/null
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/emailinput.js
@@ -0,0 +1,292 @@
+export const emailinputConfig = {
+ name: 'EmailInput',
+ displayName: 'Email Input',
+ description: 'Email input field',
+ component: 'EmailInput',
+ defaultSize: {
+ width: 10,
+ height: 40,
+ },
+ others: {
+ showOnDesktop: { type: 'toggle', displayName: 'Show on desktop' },
+ showOnMobile: { type: 'toggle', displayName: 'Show on mobile' },
+ },
+ properties: {
+ label: {
+ type: 'code',
+ displayName: 'Label',
+ validation: { schema: { type: 'string' }, defaultValue: 'Label' },
+ },
+ placeholder: {
+ type: 'code',
+ displayName: 'Placeholder',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'Enter email',
+ },
+ },
+ value: {
+ type: 'code',
+ displayName: 'Default value',
+ validation: {
+ schema: {
+ type: 'string',
+ },
+ defaultValue: 'Default value',
+ },
+ },
+ loadingState: {
+ type: 'toggle',
+ displayName: 'Loading state',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ visibility: {
+ type: 'toggle',
+ displayName: 'Visibility',
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ section: 'additionalActions',
+ },
+ disabledState: {
+ type: 'toggle',
+ displayName: 'Disable',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ tooltip: {
+ type: 'code',
+ displayName: 'Tooltip',
+ validation: { schema: { type: 'string' }, defaultValue: 'Tooltip text' },
+ section: 'additionalActions',
+ placeholder: 'Enter tooltip text',
+ },
+ },
+ validation: {
+ mandatory: { type: 'toggle', displayName: 'Make this field mandatory' },
+ regex: { type: 'code', displayName: 'Regex', placeholder: '^[a-zA-Z0-9_ -]{3,16}$' },
+ minLength: { type: 'code', displayName: 'Min length', placeholder: 'Enter min length' },
+ maxLength: { type: 'code', displayName: 'Max length', placeholder: 'Enter max length' },
+ customRule: {
+ type: 'code',
+ displayName: 'Custom validation',
+ placeholder: `{{components.text2.text=='yes'&&'valid'}}`,
+ },
+ },
+ events: {
+ onChange: { displayName: 'On change' },
+ onEnterPressed: { displayName: 'On enter pressed' },
+ onFocus: { displayName: 'On focus' },
+ onBlur: { displayName: 'On blur' },
+ },
+ styles: {
+ color: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'label',
+ },
+ alignment: {
+ type: 'switch',
+ displayName: 'Alignment',
+ validation: { schema: { type: 'string' }, defaultValue: 'side' },
+ options: [
+ { displayName: 'Side', value: 'side' },
+ { displayName: 'Top', value: 'top' },
+ ],
+ accordian: 'label',
+ },
+ direction: {
+ type: 'switch',
+ displayName: '',
+ validation: { schema: { type: 'string' }, defaultValue: 'left' },
+ showLabel: false,
+ isIcon: true,
+ options: [
+ { displayName: 'alignleftinspector', value: 'left', iconName: 'alignleftinspector' },
+ { displayName: 'alignrightinspector', value: 'right', iconName: 'alignrightinspector' },
+ ],
+ accordian: 'label',
+ isFxNotRequired: true,
+ },
+ width: {
+ type: 'slider',
+ displayName: 'Width',
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
+ },
+ isFxNotRequired: true,
+ },
+ auto: {
+ type: 'checkbox',
+ displayName: 'auto',
+ showLabel: false,
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
+ },
+ isFxNotRequired: true,
+ },
+
+ backgroundColor: {
+ type: 'color',
+ displayName: 'Background',
+ validation: { schema: { type: 'string' }, defaultValue: '#fff' },
+ accordian: 'field',
+ },
+ borderColor: {
+ type: 'color',
+ displayName: 'Border',
+ validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
+ accordian: 'field',
+ },
+ accentColor: {
+ type: 'color',
+ displayName: 'Accent',
+ validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ accordian: 'field',
+ },
+ textColor: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'field',
+ },
+ errTextColor: {
+ type: 'color',
+ displayName: 'Error text',
+ validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
+ accordian: 'field',
+ },
+ icon: {
+ type: 'icon',
+ displayName: 'Icon',
+ validation: { schema: { type: 'string' }, defaultValue: 'IconMailFilled' },
+ accordian: 'field',
+ visibility: true,
+ },
+ iconColor: {
+ type: 'color',
+ displayName: 'Icon color',
+ validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
+ accordian: 'field',
+ visibility: false,
+ showLabel: false,
+ },
+ borderRadius: {
+ type: 'numberInput',
+ displayName: 'Border radius',
+ validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: 6 },
+ accordian: 'field',
+ },
+ boxShadow: {
+ type: 'boxShadow',
+ displayName: 'Box Shadow',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: '0px 0px 0px 0px #00000040',
+ },
+ accordian: 'field',
+ },
+ padding: {
+ type: 'switch',
+ displayName: 'Padding',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: 'default',
+ },
+ isFxNotRequired: true,
+ options: [
+ { displayName: 'Default', value: 'default' },
+ { displayName: 'None', value: 'none' },
+ ],
+ accordian: 'container',
+ },
+ },
+ exposedVariables: {
+ value: '',
+ isMandatory: false,
+ isVisible: true,
+ isDisabled: false,
+ isLoading: false,
+ },
+ actions: [
+ {
+ handle: 'setText',
+ displayName: 'Set text',
+ params: [{ handle: 'text', displayName: 'text', defaultValue: 'New text' }],
+ },
+ {
+ handle: 'clear',
+ displayName: 'Clear',
+ },
+ {
+ handle: 'setFocus',
+ displayName: 'Set focus',
+ },
+ {
+ handle: 'setBlur',
+ displayName: 'Set blur',
+ },
+ {
+ handle: 'setVisibility',
+ displayName: 'Set visibility',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setDisable',
+ displayName: 'Set disable',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setLoading',
+ displayName: 'Set loading',
+ params: [{ handle: 'loading', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ ],
+ definition: {
+ validation: {
+ mandatory: { value: '{{false}}' },
+ regex: { value: '' },
+ minLength: { value: '' },
+ maxLength: { value: '' },
+ customRule: { value: '' },
+ },
+
+ others: {
+ showOnDesktop: { value: '{{true}}' },
+ showOnMobile: { value: '{{false}}' },
+ },
+ properties: {
+ value: { value: '' },
+ label: { value: 'Label' },
+ placeholder: { value: 'Enter email' },
+ visibility: { value: '{{true}}' },
+ disabledState: { value: '{{false}}' },
+ loadingState: { value: '{{false}}' },
+ tooltip: { value: '' },
+ },
+ events: [],
+ styles: {
+ textColor: { value: '#1B1F24' },
+ borderColor: { value: '#CCD1D5' },
+ accentColor: { value: '#4368E3' },
+ errTextColor: { value: '#D72D39' },
+ borderRadius: { value: '{{6}}' },
+ backgroundColor: { value: '#fff' },
+ iconColor: { value: '#CCD1D5' },
+ direction: { value: 'left' },
+ width: { value: '{{33}}' },
+ alignment: { value: 'side' },
+ color: { value: '#1B1F24' },
+ auto: { value: '{{true}}' },
+ padding: { value: 'default' },
+ boxShadow: { value: '0px 0px 0px 0px #00000040' },
+ icon: { value: 'IconMailFilled' },
+ iconVisibility: { value: true },
+ },
+ },
+};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/form.js b/frontend/src/AppBuilder/WidgetManager/widgets/form.js
index 2d8eb7f0a8..d299ec2a6f 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/form.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/form.js
@@ -333,7 +333,7 @@ export const formConfig = {
},
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background color',
validation: {
schema: { type: 'string' },
@@ -351,7 +351,7 @@ export const formConfig = {
},
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/icon.js b/frontend/src/AppBuilder/WidgetManager/widgets/icon.js
index aea06c976c..761a2da425 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/icon.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/icon.js
@@ -61,7 +61,7 @@ export const iconConfig = {
},
styles: {
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/image.js b/frontend/src/AppBuilder/WidgetManager/widgets/image.js
index c4bd7b6147..ca74e31d12 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/image.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/image.js
@@ -143,8 +143,17 @@ export const imageConfig = {
},
accordian: 'Image',
},
+ alignment: {
+ type: 'alignButtons',
+ displayName: 'Alignment',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'center',
+ },
+ accordian: 'Image',
+ },
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: {
schema: { type: 'string' },
@@ -153,7 +162,7 @@ export const imageConfig = {
accordian: 'Container',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: {
schema: { type: 'string' },
@@ -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/index.js b/frontend/src/AppBuilder/WidgetManager/widgets/index.js
index ce0e73fdf5..e79bee68c2 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/index.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/index.js
@@ -58,6 +58,9 @@ import { kanbanBoardConfig } from './kanbanBoard';
import { datetimePickerV2Config } from './datetimepickerV2';
import { datePickerV2Config } from './datepickerV2';
import { timePickerConfig } from './timepicker';
+import { emailinputConfig } from './emailinput';
+import { phoneinputConfig } from './phoneinput';
+import { currencyinputConfig } from './currencyinput';
export {
buttonConfig,
@@ -73,6 +76,9 @@ export {
datetimePickerV2Config,
datePickerV2Config,
timePickerConfig,
+ emailinputConfig,
+ phoneinputConfig,
+ currencyinputConfig,
checkboxConfig,
radiobuttonConfig, //!Depreciated
radiobuttonV2Config,
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/kanban.js b/frontend/src/AppBuilder/WidgetManager/widgets/kanban.js
index 0705581c51..cd39d0bd7b 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/kanban.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/kanban.js
@@ -77,7 +77,7 @@ export const kanbanConfig = {
styles: {
disabledState: { type: 'toggle', displayName: 'Disable' },
visibility: { type: 'toggle', displayName: 'Visibility' },
- accentColor: { type: 'color', displayName: 'Accent color' },
+ accentColor: { type: 'colorSwatches', displayName: 'Accent color' },
},
actions: [
{
@@ -157,7 +157,7 @@ export const kanbanConfig = {
styles: {
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
- accentColor: { value: '#4d72fa' },
+ accentColor: { value: 'var(--primary-brand)' },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/kanbanBoard.js b/frontend/src/AppBuilder/WidgetManager/widgets/kanbanBoard.js
index 4929bad9fe..4363c0d0b7 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/kanbanBoard.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/kanbanBoard.js
@@ -30,7 +30,7 @@ export const kanbanBoardConfig = {
visibility: { type: 'toggle', displayName: 'Visibility' },
width: { type: 'number', displayName: 'Width' },
minWidth: { type: 'number', displayName: 'Min Width' },
- accentColor: { type: 'color', displayName: 'Accent color' },
+ accentColor: { type: 'colorSwatches', displayName: 'Accent color' },
},
exposedVariables: {
columns: {},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/link.js b/frontend/src/AppBuilder/WidgetManager/widgets/link.js
index bf419e16c0..16d5f13368 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/link.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/link.js
@@ -12,14 +12,6 @@ export const linkConfig = {
showOnMobile: { type: 'toggle', displayName: 'Show on mobile' },
},
properties: {
- linkTarget: {
- type: 'code',
- displayName: 'Link target',
- validation: {
- schema: { type: 'string' },
- defaultValue: 'https://dev.to/',
- },
- },
linkText: {
type: 'code',
displayName: 'Link text',
@@ -28,6 +20,14 @@ export const linkConfig = {
defaultValue: 'Click here',
},
},
+ linkTarget: {
+ type: 'code',
+ displayName: 'Link target',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'https://dev.to/',
+ },
+ },
targetType: {
type: 'select',
displayName: 'Target type',
@@ -39,6 +39,34 @@ export const linkConfig = {
schema: { type: 'string' },
},
},
+ loadingState: {
+ type: 'toggle',
+ displayName: 'Loading state',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ visibility: {
+ type: 'toggle',
+ displayName: 'Visibility',
+ validation: {
+ schema: { type: 'boolean' },
+ defaultValue: true,
+ },
+ section: 'additionalActions',
+ },
+ disabledState: {
+ type: 'toggle',
+ displayName: 'Disable',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ tooltip: {
+ type: 'code',
+ displayName: 'Tooltip',
+ validation: { schema: { type: 'string' }, defaultValue: 'Tooltip text' },
+ section: 'additionalActions',
+ placeholder: 'Enter tooltip text',
+ },
},
events: {
onClick: { displayName: 'On click' },
@@ -46,21 +74,54 @@ export const linkConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
defaultValue: '#375FCF',
},
+ accordian: 'Link text',
},
textSize: {
- type: 'number',
+ type: 'numberInput',
displayName: 'Text size',
validation: {
schema: { type: 'number' },
defaultValue: 14,
},
+ accordian: 'Link text',
},
+ horizontalAlignment: {
+ type: 'alignButtons',
+ displayName: 'Alignment',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'left',
+ },
+ accordian: 'Link text',
+ },
+ verticalAlignment: {
+ type: 'switch',
+ displayName: '',
+ validation: { schema: { type: 'string' }, defaultValue: 'center' },
+ showLabel: false,
+ isIcon: true,
+ options: [
+ { displayName: 'alignverticallytop', value: 'top', iconName: 'alignverticallytop' },
+ { displayName: 'alignverticallycenter', value: 'center', iconName: 'alignverticallycenter' },
+ { displayName: 'alignverticallybottom', value: 'bottom', iconName: 'alignverticallybottom' },
+ ],
+ accordian: 'Link text',
+ isFxNotRequired: true,
+ },
+ icon: {
+ type: 'icon',
+ displayName: 'Icon',
+ validation: { schema: { type: 'string' }, defaultValue: 'IconHome2' },
+ accordian: 'Link text',
+ visibility: false,
+ },
+
underline: {
type: 'select',
displayName: 'Underline',
@@ -73,13 +134,37 @@ export const linkConfig = {
schema: { type: 'string' },
defaultValue: 'on-hover',
},
+ accordian: 'Link text',
},
- visibility: {
- type: 'toggle',
- displayName: 'Visibility',
+ boxShadow: {
+ type: 'boxShadow',
+ displayName: 'Box Shadow',
validation: {
- schema: { type: 'boolean' },
- defaultValue: true,
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: '0px 0px 0px 0px #00000040',
+ },
+ accordian: 'Link text',
+ },
+ padding: {
+ type: 'switch',
+ displayName: 'Padding',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: 'default',
+ },
+ isFxNotRequired: true,
+ options: [
+ { displayName: 'Default', value: 'default' },
+ { displayName: 'None', value: 'none' },
+ ],
+ accordian: 'container',
+ },
+ alignment: {
+ type: 'alignButtons',
+ displayName: 'Alignment',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'left',
},
},
},
@@ -89,6 +174,31 @@ export const linkConfig = {
handle: 'click',
displayName: 'Click',
},
+ {
+ handle: 'setLinkTarget',
+ displayName: 'Set link target',
+ params: [{ handle: 'setLinkTargetState', displayName: 'Value', defaultValue: '', type: 'code' }],
+ },
+ {
+ handle: 'setLinkText',
+ displayName: 'Set link text',
+ params: [{ handle: 'setLinkTextState', displayName: 'Value', defaultValue: '', type: 'code' }],
+ },
+ {
+ handle: 'setVisibility',
+ displayName: 'Set visibility',
+ params: [{ handle: 'isVisible', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setDisable',
+ displayName: 'Set disable',
+ params: [{ handle: 'isDisabled', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setLoading',
+ displayName: 'Set loading',
+ params: [{ handle: 'isLoading', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
],
definition: {
others: {
@@ -99,13 +209,22 @@ export const linkConfig = {
linkTarget: { value: 'https://dev.to/' },
linkText: { value: 'Click here' },
targetType: { value: 'new' },
+ visibility: { value: '{{true}}' },
+ disabledState: { value: '{{false}}' },
+ tooltip: { value: '' },
+ loadingState: { value: '{{false}}' },
},
events: [],
styles: {
- textColor: { value: '#375FCF' },
+ textColor: { value: '#4368E3' },
textSize: { value: '{{14}}' },
underline: { value: 'on-hover' },
- visibility: { value: '{{true}}' },
+ verticalAlignment: { value: 'center' },
+ horizontalAlignment: { value: 'left' },
+ padding: { value: 'default' },
+ boxShadow: { value: '0px 0px 0px 0px #00000040' },
+ icon: { value: 'IconLink' },
+ iconVisibility: { value: false },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/listview.js b/frontend/src/AppBuilder/WidgetManager/widgets/listview.js
index fec2e812b4..6c599bc2fc 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/listview.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/listview.js
@@ -13,6 +13,7 @@ export const listviewConfig = {
top: 15,
left: 3,
height: 100,
+ width: 7,
},
properties: ['source'],
accessorKey: 'imageURL',
@@ -124,7 +125,7 @@ export const listviewConfig = {
},
styles: {
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background color',
validation: {
schema: { type: 'string' },
@@ -132,7 +133,7 @@ export const listviewConfig = {
},
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/modal.js b/frontend/src/AppBuilder/WidgetManager/widgets/modal.js
index 8f0c34b566..3443c73c9b 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/modal.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/modal.js
@@ -81,7 +81,7 @@ export const modalConfig = {
},
styles: {
headerBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Header background color',
validation: {
schema: { type: 'string' },
@@ -89,7 +89,7 @@ export const modalConfig = {
},
},
headerTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Header title color',
validation: {
schema: { type: 'string' },
@@ -97,7 +97,7 @@ export const modalConfig = {
},
},
bodyBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Body background color',
validation: {
schema: { type: 'string' },
@@ -121,7 +121,7 @@ export const modalConfig = {
},
},
triggerButtonBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Trigger button background color',
validation: {
schema: { type: 'string' },
@@ -129,7 +129,7 @@ export const modalConfig = {
},
},
triggerButtonTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Trigger button text color',
validation: {
schema: { type: 'string' },
@@ -175,7 +175,7 @@ export const modalConfig = {
bodyBackgroundColor: { value: '#ffffffff' },
disabledState: { value: '{{false}}' },
visibility: { value: '{{true}}' },
- triggerButtonBackgroundColor: { value: '#4D72FA' },
+ triggerButtonBackgroundColor: { value: 'var(--primary-brand)' },
triggerButtonTextColor: { value: '#ffffffff' },
},
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/multiselectV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/multiselectV2.js
index 6aefd71067..2bc4cae17b 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/multiselectV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/multiselectV2.js
@@ -165,7 +165,7 @@ export const multiselectV2Config = {
styles: {
labelColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -218,32 +218,32 @@ export const multiselectV2Config = {
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error Text',
validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
@@ -256,7 +256,7 @@ export const multiselectV2Config = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Icon color',
validation: {
schema: { type: 'string' },
@@ -365,7 +365,7 @@ export const multiselectV2Config = {
icon: { value: 'IconHome2' },
iconVisibility: { value: false },
iconColor: { value: '#6A727C' },
- accentColor: { value: '#4368E3' },
+ accentColor: { value: 'var(--primary-brand)' },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/numberinput.js b/frontend/src/AppBuilder/WidgetManager/widgets/numberinput.js
index fe3947e47b..cba9c04cd1 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/numberinput.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/numberinput.js
@@ -72,7 +72,7 @@ export const numberinputConfig = {
},
styles: {
color: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -124,31 +124,31 @@ export const numberinputConfig = {
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
- validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ validation: { schema: { type: 'string' }, defaultValue: 'var(--primary-brand)' },
accordian: 'field',
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
@@ -161,7 +161,7 @@ export const numberinputConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Icon color',
validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' },
accordian: 'field',
@@ -279,7 +279,7 @@ export const numberinputConfig = {
borderRadius: { value: '{{6}}' },
backgroundColor: { value: '#fff' },
borderColor: { value: '#CCD1D5' },
- accentColor: { value: '#4368E3' },
+ accentColor: { value: 'var(--primary-brand)' },
errTextColor: { value: '#D72D39' },
textColor: { value: '#1B1F24' },
color: { value: '#1B1F24' },
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/passwordinput.js b/frontend/src/AppBuilder/WidgetManager/widgets/passwordinput.js
index 92a4a4711c..fad0d00735 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/passwordinput.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/passwordinput.js
@@ -84,7 +84,7 @@ export const passinputConfig = {
},
styles: {
color: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -136,31 +136,31 @@ export const passinputConfig = {
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
- validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ validation: { schema: { type: 'string' }, defaultValue: 'var(--primary-brand)' },
accordian: 'field',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
@@ -173,7 +173,7 @@ export const passinputConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Icon color',
validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' },
accordian: 'field',
@@ -278,7 +278,7 @@ export const passinputConfig = {
borderRadius: { value: '{{6}}' },
backgroundColor: { value: '#fff' },
borderColor: { value: '#CCD1D5' },
- accentColor: { value: '#4368E3' },
+ accentColor: { value: 'var(--primary-brand)' },
errTextColor: { value: '#D72D39' },
textColor: { value: '#1B1F24' },
iconColor: { value: '#CFD3D859' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/phoneinput.js b/frontend/src/AppBuilder/WidgetManager/widgets/phoneinput.js
new file mode 100644
index 0000000000..83e35ffc68
--- /dev/null
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/phoneinput.js
@@ -0,0 +1,288 @@
+export const phoneinputConfig = {
+ name: 'PhoneInput',
+ displayName: 'Phone Input',
+ description: 'Phone input field',
+ component: 'PhoneInput',
+ defaultSize: {
+ width: 10,
+ height: 40,
+ },
+ others: {
+ showOnDesktop: { type: 'toggle', displayName: 'Show on desktop' },
+ showOnMobile: { type: 'toggle', displayName: 'Show on mobile' },
+ },
+ properties: {
+ label: {
+ type: 'code',
+ displayName: 'Label',
+ validation: { schema: { type: 'string' }, defaultValue: 'Label' },
+ },
+ placeholder: {
+ type: 'code',
+ displayName: 'Placeholder',
+ validation: {
+ schema: { type: 'string' },
+ defaultValue: 'Enter your input',
+ },
+ },
+ value: {
+ type: 'code',
+ displayName: 'Default value',
+ validation: {
+ schema: {
+ type: 'string',
+ },
+ defaultValue: 'Default value',
+ },
+ },
+ isCountryChangeEnabled: {
+ type: 'toggle',
+ displayName: 'Enable country change',
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ },
+ loadingState: {
+ type: 'toggle',
+ displayName: 'Loading state',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ visibility: {
+ type: 'toggle',
+ displayName: 'Visibility',
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ section: 'additionalActions',
+ },
+ disabledState: {
+ type: 'toggle',
+ displayName: 'Disable',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ tooltip: {
+ type: 'code',
+ displayName: 'Tooltip',
+ validation: { schema: { type: 'string' }, defaultValue: 'Tooltip text' },
+ section: 'additionalActions',
+ placeholder: 'Enter tooltip text',
+ },
+ },
+ validation: {
+ mandatory: { type: 'toggle', displayName: 'Make this field mandatory' },
+ regex: { type: 'code', displayName: 'Regex', placeholder: '^[a-zA-Z0-9_ -]{3,16}$' },
+ minLength: { type: 'code', displayName: 'Min length', placeholder: 'Enter min length' },
+ maxLength: { type: 'code', displayName: 'Max length', placeholder: 'Enter max length' },
+ customRule: {
+ type: 'code',
+ displayName: 'Custom validation',
+ placeholder: `{{components.text2.text=='yes'&&'valid'}}`,
+ },
+ },
+ events: {
+ onChange: { displayName: 'On change' },
+ onEnterPressed: { displayName: 'On enter pressed' },
+ onFocus: { displayName: 'On focus' },
+ onBlur: { displayName: 'On blur' },
+ },
+ styles: {
+ color: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'label',
+ },
+ alignment: {
+ type: 'switch',
+ displayName: 'Alignment',
+ validation: { schema: { type: 'string' }, defaultValue: 'side' },
+ options: [
+ { displayName: 'Side', value: 'side' },
+ { displayName: 'Top', value: 'top' },
+ ],
+ accordian: 'label',
+ },
+ direction: {
+ type: 'switch',
+ displayName: '',
+ validation: { schema: { type: 'string' }, defaultValue: 'left' },
+ showLabel: false,
+ isIcon: true,
+ options: [
+ { displayName: 'alignleftinspector', value: 'left', iconName: 'alignleftinspector' },
+ { displayName: 'alignrightinspector', value: 'right', iconName: 'alignrightinspector' },
+ ],
+ accordian: 'label',
+ isFxNotRequired: true,
+ },
+ width: {
+ type: 'slider',
+ displayName: 'Width',
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
+ },
+ isFxNotRequired: true,
+ },
+ auto: {
+ type: 'checkbox',
+ displayName: 'auto',
+ showLabel: false,
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
+ },
+ isFxNotRequired: true,
+ },
+
+ backgroundColor: {
+ type: 'color',
+ displayName: 'Background',
+ validation: { schema: { type: 'string' }, defaultValue: '#fff' },
+ accordian: 'field',
+ },
+ borderColor: {
+ type: 'color',
+ displayName: 'Border',
+ validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
+ accordian: 'field',
+ },
+ accentColor: {
+ type: 'color',
+ displayName: 'Accent',
+ validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ accordian: 'field',
+ },
+ textColor: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'field',
+ },
+ errTextColor: {
+ type: 'color',
+ displayName: 'Error text',
+ validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
+ accordian: 'field',
+ },
+ borderRadius: {
+ type: 'numberInput',
+ displayName: 'Border radius',
+ validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: 6 },
+ accordian: 'field',
+ },
+ boxShadow: {
+ type: 'boxShadow',
+ displayName: 'Box Shadow',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: '0px 0px 0px 0px #00000040',
+ },
+ accordian: 'field',
+ },
+ padding: {
+ type: 'switch',
+ displayName: 'Padding',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: 'default',
+ },
+ isFxNotRequired: true,
+ options: [
+ { displayName: 'Default', value: 'default' },
+ { displayName: 'None', value: 'none' },
+ ],
+ accordian: 'container',
+ },
+ },
+ exposedVariables: {
+ value: '',
+ isMandatory: false,
+ isVisible: true,
+ isDisabled: false,
+ isLoading: false,
+ },
+ actions: [
+ {
+ handle: 'setValue',
+ displayName: 'Set Value',
+ params: [
+ { handle: 'value', displayName: 'value', defaultValue: '' },
+ { handle: 'country', displayName: 'country', defaultValue: '' },
+ ],
+ },
+ {
+ handle: 'setCountryCode',
+ displayName: 'Set country code',
+ params: [{ handle: 'countryCode', displayName: 'Country code', defaultValue: '' }],
+ },
+ {
+ handle: 'clear',
+ displayName: 'Clear',
+ },
+ {
+ handle: 'setFocus',
+ displayName: 'Set focus',
+ },
+ {
+ handle: 'setBlur',
+ displayName: 'Set blur',
+ },
+ {
+ handle: 'setVisibility',
+ displayName: 'Set visibility',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setDisable',
+ displayName: 'Set disable',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setLoading',
+ displayName: 'Set loading',
+ params: [{ handle: 'loading', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ ],
+ definition: {
+ validation: {
+ mandatory: { value: '{{false}}' },
+ regex: { value: '' },
+ minLength: { value: '' },
+ maxLength: { value: '' },
+ customRule: { value: '' },
+ },
+
+ others: {
+ showOnDesktop: { value: '{{true}}' },
+ showOnMobile: { value: '{{false}}' },
+ },
+ properties: {
+ value: { value: '' },
+ label: { value: 'Label' },
+ placeholder: { value: 'Enter your phone' },
+ visibility: { value: '{{true}}' },
+ disabledState: { value: '{{false}}' },
+ loadingState: { value: '{{false}}' },
+ tooltip: { value: '' },
+ isCountryChangeEnabled: { value: '{{true}}' },
+ },
+ events: [],
+ styles: {
+ textColor: { value: '#1B1F24' },
+ borderColor: { value: '#CCD1D5' },
+ accentColor: { value: '#4368E3' },
+ errTextColor: { value: '#D72D39' },
+ borderRadius: { value: '{{6}}' },
+ backgroundColor: { value: '#fff' },
+ direction: { value: 'left' },
+ width: { value: '{{33}}' },
+ alignment: { value: 'side' },
+ color: { value: '#1B1F24' },
+ auto: { value: '{{true}}' },
+ padding: { value: 'default' },
+ boxShadow: { value: '0px 0px 0px 0px #00000040' },
+ },
+ },
+};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/radioButtonV2.js b/frontend/src/AppBuilder/WidgetManager/widgets/radioButtonV2.js
index 2ff6ca6c7c..62a084d75a 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/radioButtonV2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/radioButtonV2.js
@@ -89,7 +89,7 @@ export const radiobuttonV2Config = {
},
styles: {
labelColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -139,7 +139,7 @@ export const radiobuttonV2Config = {
isFxNotRequired: true,
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: {
schema: { type: 'string' },
@@ -147,7 +147,7 @@ export const radiobuttonV2Config = {
accordian: 'switch',
},
switchOnBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Checked background',
validation: {
schema: { type: 'string' },
@@ -158,7 +158,7 @@ export const radiobuttonV2Config = {
tooltipPlacement: 'bottom',
},
switchOffBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Unchecked background',
validation: {
schema: { type: 'string' },
@@ -169,7 +169,7 @@ export const radiobuttonV2Config = {
tooltipPlacement: 'bottom',
},
handleColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Handle color',
validation: {
schema: { type: 'string' },
@@ -177,7 +177,7 @@ export const radiobuttonV2Config = {
accordian: 'switch',
},
optionsTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/radiobutton.js b/frontend/src/AppBuilder/WidgetManager/widgets/radiobutton.js
index d6ec057526..66d055ca5e 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/radiobutton.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/radiobutton.js
@@ -53,7 +53,7 @@ export const radiobuttonConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -61,11 +61,11 @@ export const radiobuttonConfig = {
},
},
activeColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Active color',
validation: {
schema: { type: 'string' },
- defaultValue: '#000000',
+ defaultValue: 'var(--primary-brand)',
},
},
visibility: {
@@ -113,7 +113,7 @@ export const radiobuttonConfig = {
events: [],
styles: {
textColor: { value: '' },
- activeColor: { value: '' },
+ activeColor: { value: 'var(--primary-brand)' },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/rangeslider.js b/frontend/src/AppBuilder/WidgetManager/widgets/rangeslider.js
index 151dca3384..320e7a6741 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/rangeslider.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/rangeslider.js
@@ -53,7 +53,7 @@ export const rangeSliderConfig = {
},
styles: {
lineColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Line color',
validation: {
schema: { type: 'string' },
@@ -61,7 +61,7 @@ export const rangeSliderConfig = {
},
},
handleColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Handle color',
validation: {
schema: { type: 'string' },
@@ -69,7 +69,7 @@ export const rangeSliderConfig = {
},
},
trackColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Track color',
validation: {
schema: { type: 'string' },
@@ -109,7 +109,7 @@ export const rangeSliderConfig = {
styles: {
lineColor: { value: '' },
handleColor: { value: '' },
- trackColor: { value: '' },
+ trackColor: { value: 'var(--primary-brand)' },
visibility: { value: '{{true}}' },
},
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/spinner.js b/frontend/src/AppBuilder/WidgetManager/widgets/spinner.js
index a6bf80b9be..c38bfdc468 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/spinner.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/spinner.js
@@ -23,11 +23,11 @@ export const spinnerConfig = {
},
},
colour: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Colour',
validation: {
schema: { type: 'string' },
- defaultValue: '#0565ff',
+ defaultValue: 'var(--primary-brand)',
},
},
size: {
@@ -54,7 +54,7 @@ export const spinnerConfig = {
styles: {
visibility: { value: '{{true}}' },
size: { value: 'sm' },
- colour: { value: '#0565ff' },
+ colour: { value: 'var(--primary-brand)' },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/starrating.js b/frontend/src/AppBuilder/WidgetManager/widgets/starrating.js
index 01240d0369..8cb239133d 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/starrating.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/starrating.js
@@ -58,7 +58,7 @@ export const starratingConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Star color',
validation: {
schema: { type: 'string' },
@@ -66,7 +66,7 @@ export const starratingConfig = {
},
},
labelColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Label color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/statistics.js b/frontend/src/AppBuilder/WidgetManager/widgets/statistics.js
index d364d78524..ecf1f70aed 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/statistics.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/statistics.js
@@ -55,22 +55,22 @@ export const statisticsConfig = {
events: {},
styles: {
primaryLabelColour: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Primary label colour',
validation: { schema: { type: 'string' }, defaultValue: '#8092AB' },
},
primaryTextColour: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Primary text colour',
validation: { schema: { type: 'string' }, defaultValue: '#000000' },
},
secondaryLabelColour: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Secondary label colour',
validation: { schema: { type: 'string' }, defaultValue: '#8092AB' },
},
secondaryTextColour: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Secondary text colour',
validation: { schema: { type: 'string' }, defaultValue: '#36AF8B' },
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/steps.js b/frontend/src/AppBuilder/WidgetManager/widgets/steps.js
index a39c634919..0a6a2cd575 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/steps.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/steps.js
@@ -45,15 +45,15 @@ export const stepsConfig = {
},
styles: {
color: {
- type: 'color',
- displayName: 'Color',
+ type: 'colorSwatches',
+ displayName: 'colorSwatches',
validation: {
schema: { type: 'string' },
- defaultValue: '#000000',
+ defaultValue: 'var(--primary-brand)',
},
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -101,7 +101,7 @@ export const stepsConfig = {
styles: {
visibility: { value: '{{true}}' },
theme: { value: 'titles' },
- color: { value: '' },
+ color: { value: 'var(--primary-brand)' },
textColor: { value: '' },
},
},
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/table.js b/frontend/src/AppBuilder/WidgetManager/widgets/table.js
index 8a89701494..9f0c4fd723 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/table.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/table.js
@@ -157,7 +157,7 @@ export const tableConfig = {
defaultValue: 'clientSide',
},
actionButtonBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background color',
validation: {
schema: { type: 'string' },
@@ -165,7 +165,7 @@ export const tableConfig = {
},
},
actionButtonTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
@@ -293,7 +293,7 @@ export const tableConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text Color',
validation: {
schema: { type: 'string' },
@@ -404,7 +404,7 @@ export const tableConfig = {
accordian: 'Container',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/tabs.js b/frontend/src/AppBuilder/WidgetManager/widgets/tabs.js
index a397979a3e..a9c10bebaf 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/tabs.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/tabs.js
@@ -13,6 +13,7 @@ export const tabsConfig = {
top: 60,
left: 17,
height: 100,
+ width: 7,
},
tab: 0,
properties: ['source'],
@@ -109,11 +110,11 @@ export const tabsConfig = {
events: { onTabSwitch: { displayName: 'On tab switch' } },
styles: {
highlightColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Highlight color',
validation: {
schema: { type: 'string' },
- defaultValue: '#375FCF',
+ defaultValue: 'var(--primary-brand)',
},
},
visibility: {
@@ -174,7 +175,7 @@ export const tabsConfig = {
},
events: [],
styles: {
- highlightColor: { value: '#375FCF' },
+ highlightColor: { value: 'var(--primary-brand)' },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
tabWidth: { value: 'auto' },
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/AppBuilder/WidgetManager/widgets/text.js b/frontend/src/AppBuilder/WidgetManager/widgets/text.js
index ada530d127..8ed1edffd1 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/text.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/text.js
@@ -105,7 +105,7 @@ export const textConfig = {
accordian: 'Text',
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: {
schema: { type: 'string' },
@@ -185,7 +185,7 @@ export const textConfig = {
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: {
schema: { type: 'string' },
@@ -195,7 +195,7 @@ export const textConfig = {
colorPickerPosition: 'top',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/textarea.js b/frontend/src/AppBuilder/WidgetManager/widgets/textarea.js
index c5e71be77d..d0e0364334 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/textarea.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/textarea.js
@@ -4,7 +4,7 @@ export const textareaConfig = {
description: 'Multi-line text input',
component: 'TextArea',
defaultSize: {
- width: 6,
+ width: 10,
height: 100,
},
others: {
@@ -12,82 +12,291 @@ export const textareaConfig = {
showOnMobile: { type: 'toggle', displayName: 'Show on mobile' },
},
properties: {
- value: {
+ label: {
type: 'code',
- displayName: 'Default value',
- validation: {
- schema: { type: 'string' },
- defaultValue: 'default text',
- },
+ displayName: 'Label',
+ validation: { schema: { type: 'string' }, defaultValue: 'Label' },
},
placeholder: {
type: 'code',
displayName: 'Placeholder',
validation: {
schema: { type: 'string' },
- defaultValue: 'Placeholder text',
+ defaultValue: 'Enter your input',
},
},
- },
- events: {},
- styles: {
+ value: {
+ type: 'code',
+ displayName: 'Default value',
+ validation: {
+ schema: {
+ type: 'string',
+ },
+ defaultValue: 'Default value',
+ },
+ },
+ loadingState: {
+ type: 'toggle',
+ displayName: 'Loading state',
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
visibility: {
type: 'toggle',
displayName: 'Visibility',
- validation: {
- schema: { type: 'boolean' },
- defaultValue: true,
- },
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ section: 'additionalActions',
},
disabledState: {
type: 'toggle',
displayName: 'Disable',
- validation: {
- schema: { type: 'boolean' },
- defaultValue: false,
+ validation: { schema: { type: 'boolean' }, defaultValue: false },
+ section: 'additionalActions',
+ },
+ tooltip: {
+ type: 'code',
+ displayName: 'Tooltip',
+ validation: { schema: { type: 'string' }, defaultValue: 'Tooltip text' },
+ section: 'additionalActions',
+ placeholder: 'Enter tooltip text',
+ },
+ },
+ validation: {
+ mandatory: { type: 'toggle', displayName: 'Make this field mandatory' },
+ regex: { type: 'code', displayName: 'Regex', placeholder: '^[a-zA-Z0-9_ -]{3,16}$' },
+ minLength: { type: 'code', displayName: 'Min length', placeholder: 'Enter min length' },
+ maxLength: { type: 'code', displayName: 'Max length', placeholder: 'Enter max length' },
+ customRule: {
+ type: 'code',
+ displayName: 'Custom validation',
+ placeholder: `{{components.text2.text=='yes'&&'valid'}}`,
+ },
+ },
+ events: {
+ onChange: { displayName: 'On change' },
+ onEnterPressed: { displayName: 'On enter pressed' },
+ onFocus: { displayName: 'On focus' },
+ onBlur: { displayName: 'On blur' },
+ },
+ styles: {
+ color: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'label',
+ },
+ alignment: {
+ type: 'switch',
+ displayName: 'Alignment',
+ validation: { schema: { type: 'string' }, defaultValue: 'side' },
+ options: [
+ { displayName: 'Side', value: 'side' },
+ { displayName: 'Top', value: 'top' },
+ ],
+ accordian: 'label',
+ },
+ direction: {
+ type: 'switch',
+ displayName: '',
+ validation: { schema: { type: 'string' }, defaultValue: 'left' },
+ showLabel: false,
+ isIcon: true,
+ options: [
+ { displayName: 'alignleftinspector', value: 'left', iconName: 'alignleftinspector' },
+ { displayName: 'alignrightinspector', value: 'right', iconName: 'alignrightinspector' },
+ ],
+ accordian: 'label',
+ isFxNotRequired: true,
+ },
+ width: {
+ type: 'slider',
+ displayName: 'Width',
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
},
+ isFxNotRequired: true,
+ },
+ auto: {
+ type: 'checkbox',
+ displayName: 'auto',
+ showLabel: false,
+ validation: { schema: { type: 'boolean' }, defaultValue: true },
+ accordian: 'label',
+ conditionallyRender: {
+ key: 'alignment',
+ value: 'side',
+ },
+ isFxNotRequired: true,
+ },
+
+ backgroundColor: {
+ type: 'color',
+ displayName: 'Background',
+ validation: { schema: { type: 'string' }, defaultValue: '#fff' },
+ accordian: 'field',
+ },
+ borderColor: {
+ type: 'color',
+ displayName: 'Border',
+ validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
+ accordian: 'field',
+ },
+ accentColor: {
+ type: 'color',
+ displayName: 'Accent',
+ validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ accordian: 'field',
+ },
+ textColor: {
+ type: 'color',
+ displayName: 'Text',
+ validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
+ accordian: 'field',
+ },
+ errTextColor: {
+ type: 'color',
+ displayName: 'Error text',
+ validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
+ accordian: 'field',
+ },
+ icon: {
+ type: 'icon',
+ displayName: 'Icon',
+ validation: { schema: { type: 'string' }, defaultValue: 'IconHome2' },
+ accordian: 'field',
+ visibility: false,
+ },
+ iconColor: {
+ type: 'color',
+ displayName: 'Icon color',
+ validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' },
+ accordian: 'field',
+ visibility: false,
+ showLabel: false,
},
borderRadius: {
- type: 'code',
+ type: 'numberInput',
displayName: 'Border radius',
+ validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: 6 },
+ accordian: 'field',
+ },
+ boxShadow: {
+ type: 'boxShadow',
+ displayName: 'Box Shadow',
validation: {
- schema: { type: 'number' },
- defaultValue: 4,
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: '0px 0px 0px 0px #00000040',
},
+ accordian: 'field',
+ },
+ padding: {
+ type: 'switch',
+ displayName: 'Padding',
+ validation: {
+ schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
+ defaultValue: 'default',
+ },
+ isFxNotRequired: true,
+ options: [
+ { displayName: 'Default', value: 'default' },
+ { displayName: 'None', value: 'none' },
+ ],
+ accordian: 'container',
},
},
exposedVariables: {
- value:
- 'ToolJet is an open-source low-code platform for building and deploying internal tools with minimal engineering efforts 🚀',
+ value: '',
+ isMandatory: false,
+ isVisible: true,
+ isDisabled: false,
+ isLoading: false,
},
actions: [
{
handle: 'setText',
- displayName: 'Set Text',
- params: [{ handle: 'text', displayName: 'text', defaultValue: 'New Text' }],
+ displayName: 'Set text',
+ params: [{ handle: 'text', displayName: 'text', defaultValue: 'New text' }],
},
{
handle: 'clear',
displayName: 'Clear',
},
+ {
+ handle: 'setFocus',
+ displayName: 'Set focus',
+ },
+ {
+ handle: 'setBlur',
+ displayName: 'Set blur',
+ },
+ {
+ handle: 'disable',
+ displayName: 'Disable(deprecated)',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'visibility',
+ displayName: 'Visibility(deprecated)',
+ params: [{ handle: 'visibility', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setVisibility',
+ displayName: 'Set visibility',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setDisable',
+ displayName: 'Set disable',
+ params: [{ handle: 'disable', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
+ {
+ handle: 'setLoading',
+ displayName: 'Set loading',
+ params: [{ handle: 'loading', displayName: 'Value', defaultValue: '{{false}}', type: 'toggle' }],
+ },
],
definition: {
+ validation: {
+ mandatory: { value: '{{false}}' },
+ regex: { value: '' },
+ minLength: { value: '' },
+ maxLength: { value: '' },
+ customRule: { value: '' },
+ },
+
others: {
showOnDesktop: { value: '{{true}}' },
showOnMobile: { value: '{{false}}' },
},
properties: {
- value: {
- value:
- 'ToolJet is an open-source low-code platform for building and deploying internal tools with minimal engineering efforts 🚀',
- },
- placeholder: { value: 'Placeholder text' },
+ value: { value: '' },
+ label: { value: 'Label' },
+ placeholder: { value: 'Enter your input' },
+ visibility: { value: '{{true}}' },
+ disabledState: { value: '{{false}}' },
+ loadingState: { value: '{{false}}' },
+ tooltip: { value: '' },
},
events: [],
styles: {
- visibility: { value: '{{true}}' },
- disabledState: { value: '{{false}}' },
- borderRadius: { value: '{{4}}' },
+ textColor: { value: '#1B1F24' },
+ borderColor: { value: '#CCD1D5' },
+ accentColor: { value: '#4368E3' },
+ errTextColor: { value: '#D72D39' },
+ borderRadius: { value: '{{6}}' },
+ backgroundColor: { value: '#fff' },
+ iconColor: { value: '#CFD3D859' },
+ direction: { value: 'left' },
+ width: { value: '{{33}}' },
+ alignment: { value: 'side' },
+ color: { value: '#1B1F24' },
+ auto: { value: '{{true}}' },
+ padding: { value: 'default' },
+ boxShadow: { value: '0px 0px 0px 0px #00000040' },
+ icon: { value: 'IconHome2' },
+ iconVisibility: { value: false },
},
},
};
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/textinput.js b/frontend/src/AppBuilder/WidgetManager/widgets/textinput.js
index 15a52ea306..e259ecddd0 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/textinput.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/textinput.js
@@ -80,7 +80,7 @@ export const textinputConfig = {
},
styles: {
color: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -132,31 +132,31 @@ export const textinputConfig = {
},
backgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
- validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
+ validation: { schema: { type: 'string' }, defaultValue: 'var(--primary-brand)' },
accordian: 'field',
},
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#D72D39' },
accordian: 'field',
@@ -169,7 +169,7 @@ export const textinputConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Icon color',
validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' },
accordian: 'field',
@@ -283,7 +283,7 @@ export const textinputConfig = {
styles: {
textColor: { value: '#1B1F24' },
borderColor: { value: '#CCD1D5' },
- accentColor: { value: '#4368E3' },
+ accentColor: { value: 'var(--primary-brand)' },
errTextColor: { value: '#D72D39' },
borderRadius: { value: '{{6}}' },
backgroundColor: { value: '#fff' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/timeline.js b/frontend/src/AppBuilder/WidgetManager/widgets/timeline.js
index 6ece608f5c..63776f0b99 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/timeline.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/timeline.js
@@ -48,7 +48,7 @@ export const timelineConfig = {
properties: {
data: {
value:
- "{{ [ \n\t\t{ title: 'Product Launched', subTitle: 'First version of our product released to public', date: '20/10/2021', iconBackgroundColor: '#4d72fa'},\n\t\t { title: 'First Signup', subTitle: 'Congratulations! We got our first signup', date: '22/10/2021', iconBackgroundColor: '#4d72fa'}, \n\t\t { title: 'First Payment', subTitle: 'Hurray! We got our first payment', date: '01/11/2021', iconBackgroundColor: '#4d72fa'} \n] }}",
+ "{{ [ \n\t\t{ title: 'Product Launched', subTitle: 'First version of our product released to public', date: '20/10/2021', iconBackgroundColor: 'var(--primary-brand)'},\n\t\t { title: 'First Signup', subTitle: 'Congratulations! We got our first signup', date: '22/10/2021', iconBackgroundColor: 'var(--primary-brand)'}, \n\t\t { title: 'First Payment', subTitle: 'Hurray! We got our first payment', date: '01/11/2021', iconBackgroundColor: 'var(--primary-brand)'} \n] }}",
},
hideDate: { value: '{{false}}' },
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/timepicker.js b/frontend/src/AppBuilder/WidgetManager/widgets/timepicker.js
index 79a3d05d4e..a5a1fb6b06 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/timepicker.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/timepicker.js
@@ -164,7 +164,7 @@ export const timePickerConfig = {
],
styles: {
labelColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Color',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'label',
@@ -215,31 +215,31 @@ export const timePickerConfig = {
isFxNotRequired: true,
},
fieldBackgroundColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Background',
validation: { schema: { type: 'string' }, defaultValue: '#fff' },
accordian: 'field',
},
fieldBorderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border',
validation: { schema: { type: 'string' }, defaultValue: '#CCD1D5' },
accordian: 'field',
},
accentColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Accent',
validation: { schema: { type: 'string' }, defaultValue: '#4368E3' },
accordian: 'field',
},
selectedTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text',
validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' },
accordian: 'field',
},
errTextColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Error text',
validation: { schema: { type: 'string' }, defaultValue: '#E54D2E' },
accordian: 'field',
@@ -252,7 +252,7 @@ export const timePickerConfig = {
visibility: false,
},
iconColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: '',
showLabel: false,
validation: {
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitch.js b/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitch.js
index ec3a97450d..bd646a47f3 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitch.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitch.js
@@ -32,14 +32,14 @@ export const toggleswitchConfig = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text color',
validation: {
schema: { type: 'string' },
},
},
toggleSwitchColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Toggle switch color',
validation: {
schema: { type: 'string' },
@@ -75,7 +75,7 @@ export const toggleswitchConfig = {
events: [],
styles: {
textColor: { value: '' },
- toggleSwitchColor: { value: '' },
+ toggleSwitchColor: { value: 'var(--primary-brand)' },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitchv2.js b/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitchv2.js
index 6753fbb50d..4bc21f3a86 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitchv2.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/toggleswitchv2.js
@@ -71,7 +71,7 @@ export const toggleSwitchV2Config = {
},
styles: {
textColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Text Color',
validation: {
schema: { type: 'string' },
@@ -79,7 +79,7 @@ export const toggleSwitchV2Config = {
accordian: 'label',
},
borderColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Border color',
validation: {
schema: { type: 'string' },
@@ -87,7 +87,7 @@ export const toggleSwitchV2Config = {
accordian: 'switch',
},
toggleSwitchColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Checked color',
validation: {
schema: { type: 'string' },
@@ -95,7 +95,7 @@ export const toggleSwitchV2Config = {
accordian: 'switch',
},
uncheckedColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Unchecked color',
validation: {
schema: { type: 'string' },
@@ -103,7 +103,7 @@ export const toggleSwitchV2Config = {
accordian: 'switch',
},
handleColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Handle color',
validation: {
schema: { type: 'string' },
@@ -181,7 +181,7 @@ export const toggleSwitchV2Config = {
events: [],
styles: {
textColor: { value: '#1B1F24' },
- toggleSwitchColor: { value: '#4368E3' }, //keeping same key for backward comopatibility
+ toggleSwitchColor: { value: 'var(--primary-brand)' }, //keeping same key for backward comopatibility
uncheckedColor: { value: '#E4E7EB' },
borderColor: { value: '#E4E7EB' },
handleColor: { value: '#FFFFFF' },
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/treeSelect.js b/frontend/src/AppBuilder/WidgetManager/widgets/treeSelect.js
index 1d7485b47a..898f0b3ed0 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/treeSelect.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/treeSelect.js
@@ -23,8 +23,8 @@ export const treeSelectConfig = {
onUnCheck: { displayName: 'On uncheck' },
},
styles: {
- textColor: { type: 'color', displayName: 'Text Color' },
- checkboxColor: { type: 'color', displayName: 'Checkbox color' },
+ textColor: { type: 'colorSwatches', displayName: 'Text Color' },
+ checkboxColor: { type: 'colorSwatches', displayName: 'Checkbox color' },
visibility: { type: 'toggle', displayName: 'Visibility' },
disabledState: { type: 'toggle', displayName: 'Disable' },
},
@@ -71,7 +71,7 @@ export const treeSelectConfig = {
events: [],
styles: {
textColor: { value: '' },
- checkboxColor: { value: '' },
+ checkboxColor: { value: 'var(--primary-brand)' },
visibility: { value: '{{true}}' },
disabledState: { value: '{{false}}' },
},
diff --git a/frontend/src/AppBuilder/WidgetManager/widgets/verticalDivider.js b/frontend/src/AppBuilder/WidgetManager/widgets/verticalDivider.js
index 443526c3b8..e43b81adf7 100644
--- a/frontend/src/AppBuilder/WidgetManager/widgets/verticalDivider.js
+++ b/frontend/src/AppBuilder/WidgetManager/widgets/verticalDivider.js
@@ -15,7 +15,7 @@ export const verticalDividerConfig = {
events: {},
styles: {
dividerColor: {
- type: 'color',
+ type: 'colorSwatches',
displayName: 'Divider color',
validation: {
schema: { type: 'string' },
diff --git a/frontend/src/AppBuilder/Widgets/BaseComponents/BaseInput.jsx b/frontend/src/AppBuilder/Widgets/BaseComponents/BaseInput.jsx
new file mode 100644
index 0000000000..74ce215737
--- /dev/null
+++ b/frontend/src/AppBuilder/Widgets/BaseComponents/BaseInput.jsx
@@ -0,0 +1,240 @@
+import React, { forwardRef } from 'react';
+import Label from '@/_ui/Label';
+import Loader from '@/ToolJetUI/Loader/Loader';
+import * as Icons from '@tabler/icons-react';
+const tinycolor = require('tinycolor2');
+
+const RenderInput = forwardRef((props, ref) => {
+ return props.inputType !== 'textarea' ?
:
;
+});
+
+export const BaseInput = ({
+ height,
+ styles,
+ properties,
+ darkMode,
+ componentName,
+ dataCy,
+ // From useInput hook
+ inputRef,
+ labelRef,
+ visibility,
+ loading,
+ labelWidth,
+ validationError,
+ showValidationError,
+ isFocused,
+ isMandatory,
+ disable,
+ value,
+ handleChange,
+ handleBlur,
+ handleFocus,
+ handleKeyUp,
+ isValid,
+ // Input specific props
+ inputType = 'text',
+ additionalInputProps = {},
+ rightIcon,
+ getCustomStyles,
+}) => {
+ const {
+ padding,
+ borderRadius,
+ borderColor,
+ backgroundColor,
+ textColor,
+ boxShadow,
+ width,
+ alignment,
+ direction,
+ color,
+ auto,
+ errTextColor,
+ iconColor,
+ accentColor,
+ iconVisibility: showLeftIcon,
+ icon,
+ } = styles;
+
+ const { label, placeholder } = properties;
+ const _width = (width / 100) * 70;
+ const defaultAlignment = alignment === 'side' || alignment === 'top' ? alignment : 'side';
+
+ const computedStyles = {
+ height: height == 36 ? (padding == 'default' ? '36px' : '40px') : padding == 'default' ? height : height + 4,
+ borderRadius: `${borderRadius}px`,
+ color: !['#1B1F24', '#000', '#000000ff'].includes(textColor)
+ ? textColor
+ : disable || loading
+ ? 'var(--text-disabled)'
+ : 'var(--text-primary)',
+ borderColor: isFocused
+ ? accentColor != '4368E3'
+ ? accentColor
+ : 'var(--primary-accent-strong)'
+ : borderColor != '#CCD1D5'
+ ? borderColor
+ : disable || loading
+ ? '1px solid var(--borders-disabled-on-white)'
+ : 'var(--borders-default)',
+ '--tblr-input-border-color-darker': tinycolor(borderColor).darken(24).toString(),
+ backgroundColor:
+ backgroundColor != '#fff'
+ ? backgroundColor
+ : disable || loading
+ ? darkMode
+ ? 'var(--surfaces-app-bg-default)'
+ : 'var(--surfaces-surface-03)'
+ : 'var(--surfaces-surface-01)',
+ boxShadow,
+ padding: showLeftIcon ? '8px 10px 8px 29px' : '8px 10px',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ };
+
+ let loaderStyle;
+ // for textarea loader position is fixed on top right of input box.
+ if (inputType !== 'textarea') {
+ loaderStyle = {
+ right:
+ direction === 'right' &&
+ defaultAlignment === 'side' &&
+ ((label?.length > 0 && width > 0) || (auto && width == 0 && label && label?.length != 0))
+ ? `${labelWidth + 11}px`
+ : '11px',
+ top:
+ defaultAlignment === 'top'
+ ? ((label?.length > 0 && width > 0) || (auto && width == 0 && label && label?.length != 0)) &&
+ 'calc(50% + 10px)'
+ : '',
+ transform:
+ defaultAlignment === 'top' &&
+ ((label?.length > 0 && width > 0) || (auto && width == 0 && label && label?.length != 0)) &&
+ ' translateY(-50%)',
+ zIndex: 3,
+ };
+ } else {
+ loaderStyle = {
+ right:
+ direction === 'right' &&
+ defaultAlignment === 'side' &&
+ ((label?.length > 0 && width > 0) || (auto && width == 0 && label && label?.length != 0))
+ ? `${labelWidth + 11}px`
+ : '11px',
+ top: defaultAlignment === 'top' ? '30px' : '10px',
+ transform: 'none',
+ zIndex: 3,
+ };
+ }
+
+ // eslint-disable-next-line import/namespace
+ const IconElement = Icons[icon] ?? Icons['IconHome2'];
+
+ const finalStyles = getCustomStyles ? getCustomStyles(computedStyles) : computedStyles;
+
+ return (
+ <>
+
+
+
+ {showLeftIcon && (
+ 0 && width > 0) || (auto && width == 0 && label && label?.length != 0)
+ ? `${labelWidth + 11}px`
+ : '11px',
+ position: 'absolute',
+ top:
+ inputType === 'textarea'
+ ? defaultAlignment === 'top'
+ ? '38px'
+ : '18px'
+ : defaultAlignment === 'side'
+ ? '50%'
+ : (label?.length > 0 && width > 0) || (auto && width == 0 && label && label?.length != 0)
+ ? 'calc(50% + 10px)'
+ : '50%',
+ transform: 'translateY(-50%)',
+ color: iconColor !== '#CFD3D859' ? iconColor : 'var(--icons-weak-disabled)',
+ zIndex: 3,
+ }}
+ stroke={1.5}
+ />
+ )}
+
+
+ {rightIcon}
+ {loading && }
+
+
+ {showValidationError && visibility && (
+
+ {validationError}
+
+ )}
+ >
+ );
+};
diff --git a/frontend/src/AppBuilder/Widgets/BaseComponents/hooks/useInput.js b/frontend/src/AppBuilder/Widgets/BaseComponents/hooks/useInput.js
new file mode 100644
index 0000000000..57260875a2
--- /dev/null
+++ b/frontend/src/AppBuilder/Widgets/BaseComponents/hooks/useInput.js
@@ -0,0 +1,235 @@
+import { useState, useRef, useEffect } from 'react';
+import { useGridStore } from '@/_stores/gridStore';
+//eslint-disable-next-line import/no-unresolved
+import { getCountryCallingCode } from 'react-phone-number-input';
+
+export const useInput = ({
+ id,
+ properties,
+ styles,
+ validation,
+ validate,
+ setExposedVariable,
+ setExposedVariables,
+ fireEvent,
+ inputType,
+}) => {
+ const isInitialRender = useRef(true);
+ const inputRef = useRef();
+ const labelRef = useRef();
+
+ const { loadingState, disabledState, label, visibility: initialVisibility } = properties;
+ const isResizing = useGridStore((state) => state.resizingComponentId === id);
+
+ const [value, setValue] = useState(properties.value ?? '');
+ const [visibility, setVisibility] = useState(initialVisibility);
+ const [loading, setLoading] = useState(loadingState);
+ const [disable, setDisable] = useState(disabledState || loadingState);
+ const [validationStatus, setValidationStatus] = useState(validate(value));
+ const [showValidationError, setShowValidationError] = useState(false);
+ const [isFocused, setIsFocused] = useState(false);
+ const [labelWidth, setLabelWidth] = useState(0);
+ const [iconVisibility, setIconVisibility] = useState(false);
+ const [country, setCountry] = useState(properties.defaultCountry || 'US');
+
+ const { isValid, validationError } = validationStatus;
+ const isMandatory = validation?.mandatory ?? false;
+
+ const getCountryCallingCodeSafe = (country) => {
+ try {
+ return getCountryCallingCode(country);
+ } catch (error) {
+ return '';
+ }
+ };
+
+ useEffect(() => {
+ if (labelRef?.current) {
+ const absolutewidth = labelRef?.current?.getBoundingClientRect()?.width;
+ setLabelWidth(absolutewidth);
+ } else setLabelWidth(0);
+ }, [
+ isResizing,
+ styles.width,
+ styles.auto,
+ styles.alignment,
+ styles.iconVisibility,
+ label?.length,
+ isMandatory,
+ styles.padding,
+ styles.direction,
+ labelRef?.current?.getBoundingClientRect()?.width,
+ ]);
+
+ useEffect(() => {
+ if (isInitialRender.current) return;
+ setExposedVariable('label', label);
+ }, [label]);
+
+ useEffect(() => {
+ disable !== disabledState && setDisable(disabledState);
+ if (isInitialRender.current) return;
+ setExposedVariable('isDisabled', disabledState);
+ }, [disabledState]);
+
+ useEffect(() => {
+ visibility !== properties.visibility && setVisibility(properties.visibility);
+ if (isInitialRender.current) return;
+ setExposedVariable('isVisible', properties.visibility);
+ }, [properties.visibility]);
+
+ useEffect(() => {
+ loading !== loadingState && setLoading(loadingState);
+ if (isInitialRender.current) return;
+ setExposedVariable('isLoading', loadingState);
+ }, [loadingState]);
+
+ useEffect(() => {
+ if (isInitialRender.current) return;
+ setExposedVariable('isMandatory', isMandatory);
+ }, [isMandatory]);
+
+ useEffect(() => {
+ if (isInitialRender.current) return;
+ const validationStatus = validate(value);
+ setValidationStatus(validationStatus);
+ setExposedVariable('isValid', validationStatus?.isValid);
+ }, [validate]);
+
+ useEffect(() => {
+ if (inputType === 'phone') {
+ let code = getCountryCallingCodeSafe(country);
+ setInputValue(`+${code}${properties.value}`);
+ } else {
+ setInputValue(properties.value ?? '');
+ }
+ }, [properties.value]);
+
+ useEffect(() => {
+ if (inputType !== 'phone') return;
+ setExposedVariable('setValue', async function (value, countryCode = country) {
+ const code = getCountryCallingCodeSafe(country);
+ setInputValue(`+${code}${value}`);
+ setCountry(countryCode);
+ fireEvent('onChange');
+ });
+ }, [inputType, country]);
+
+ useEffect(() => {
+ if (inputType !== 'currency') return;
+ setExposedVariable('setValue', async function (value, countryCode = country) {
+ setInputValue(value);
+ setCountry(countryCode);
+ fireEvent('onChange');
+ });
+ }, [inputType, country]);
+
+ useEffect(() => {
+ const exposedVariables = {
+ ...(inputType !== 'phone' && {
+ setText: async function (text) {
+ setInputValue(text);
+ fireEvent('onChange');
+ },
+ }),
+ clear: async function () {
+ setInputValue('');
+ fireEvent('onChange');
+ },
+ setFocus: async function () {
+ inputRef.current.focus();
+ },
+ setBlur: async function () {
+ inputRef.current.blur();
+ },
+ setVisibility: async function (state) {
+ setVisibility(state);
+ setExposedVariable('isVisible', state);
+ },
+ setDisable: async function (disable) {
+ setDisable(disable);
+ setExposedVariable('isDisabled', disable);
+ },
+ setLoading: async function (loading) {
+ setLoading(loading);
+ setExposedVariable('isLoading', loading);
+ },
+ label,
+ isValid,
+ value: properties.value ?? '',
+ isMandatory,
+ isLoading: loading,
+ isVisible: visibility,
+ isDisabled: disable,
+ };
+
+ setExposedVariables(exposedVariables);
+ isInitialRender.current = false;
+ }, []);
+
+ const setInputValue = (value) => {
+ setValue(value);
+ setExposedVariable('value', value);
+ const validationStatus = validate(value);
+ setValidationStatus(validationStatus);
+ setExposedVariable('isValid', validationStatus?.isValid);
+ };
+
+ const handleChange = (e) => {
+ setInputValue(e.target.value);
+ fireEvent('onChange');
+ };
+
+ const handlePhoneCurrencyInputChange = (value) => {
+ setInputValue(value);
+ fireEvent('onChange');
+ };
+
+ const handleBlur = (e) => {
+ setShowValidationError(true);
+ setIsFocused(false);
+ e.stopPropagation();
+ fireEvent('onBlur');
+ };
+
+ const handleFocus = (e) => {
+ setIsFocused(true);
+ e.stopPropagation();
+ setTimeout(() => {
+ fireEvent('onFocus');
+ }, 0);
+ };
+
+ const handleKeyUp = (e) => {
+ if (e.key === 'Enter') {
+ setInputValue(e.target.value);
+ fireEvent('onEnterPressed');
+ }
+ };
+
+ return {
+ inputRef,
+ labelRef,
+ value,
+ visibility,
+ loading,
+ disable,
+ country,
+ setCountry,
+ validationStatus,
+ showValidationError,
+ isFocused,
+ labelWidth,
+ iconVisibility,
+ setIconVisibility,
+ isValid,
+ validationError,
+ isMandatory,
+ setInputValue,
+ handlePhoneCurrencyInputChange,
+ handleChange,
+ handleBlur,
+ handleFocus,
+ handleKeyUp,
+ };
+};
diff --git a/frontend/src/AppBuilder/Widgets/EmailInput.jsx b/frontend/src/AppBuilder/Widgets/EmailInput.jsx
new file mode 100644
index 0000000000..90061b0a66
--- /dev/null
+++ b/frontend/src/AppBuilder/Widgets/EmailInput.jsx
@@ -0,0 +1,12 @@
+import React from 'react';
+import { BaseInput } from './BaseComponents/BaseInput';
+import { useInput } from './BaseComponents/hooks/useInput';
+
+export const EmailInput = (props) => {
+ const inputLogic = useInput(props);
+ const additionalInputProps = {
+ autocomplete: 'email',
+ name: 'email',
+ };
+ return
;
+};
diff --git a/frontend/src/AppBuilder/Widgets/Form/FormUtils.js b/frontend/src/AppBuilder/Widgets/Form/FormUtils.js
index f8366e0b29..2dea50bdf9 100644
--- a/frontend/src/AppBuilder/Widgets/Form/FormUtils.js
+++ b/frontend/src/AppBuilder/Widgets/Form/FormUtils.js
@@ -97,6 +97,9 @@ export function generateUIComponents(JSONSchema, advanced, componentName = '') {
if (uiComponentsDraft?.length > 0 && uiComponentsDraft[index * 2 + 1]) {
switch (typeResolver(value?.type)) {
case 'TextInput':
+ case 'EmailInput':
+ case 'PhoneInput':
+ case 'CurrencyInput':
if (value?.styles?.backgroundColor)
uiComponentsDraft[index * 2 + 1]['definition']['styles']['backgroundColor'] =
value?.styles?.backgroundColor;
@@ -127,6 +130,15 @@ export function generateUIComponents(JSONSchema, advanced, componentName = '') {
if (value?.value) uiComponentsDraft[index * 2 + 1]['definition']['properties']['value'] = value?.value;
if (value?.placeholder)
uiComponentsDraft[index * 2 + 1]['definition']['properties']['placeholder'] = value?.placeholder;
+
+ if (value?.defaultCountry && ['PhoneInput', 'CurrencyInput'].includes(typeResolver(value?.type))) {
+ uiComponentsDraft[index * 2 + 1]['definition']['properties']['defaultCountry'] = value?.defaultCountry;
+ }
+
+ if (value?.defaultCountry && typeResolver(value?.type) === 'CurrencyInput') {
+ uiComponentsDraft[index * 2 + 1]['definition']['properties']['decimalPlaces'] = value?.decimalPlaces;
+ }
+
// prevent label from showing up in text input, because it is already shown in the text component. (Defaults to "Label" if not updated explicitly with an empty string)
uiComponentsDraft[index * 2 + 1]['definition']['properties']['label'] = '';
break;
@@ -482,6 +494,12 @@ const typeResolver = (type) => {
return 'DropDown';
case 'button':
return 'Button';
+ case 'emailinput':
+ return 'EmailInput';
+ case 'phoneinput':
+ return 'PhoneInput';
+ case 'currencyinput':
+ return 'CurrencyInput';
case 'text':
return 'Text';
case 'number':
diff --git a/frontend/src/AppBuilder/Widgets/Form/RenderSchema.jsx b/frontend/src/AppBuilder/Widgets/Form/RenderSchema.jsx
index b5bfa9e4c3..89d34b65c7 100644
--- a/frontend/src/AppBuilder/Widgets/Form/RenderSchema.jsx
+++ b/frontend/src/AppBuilder/Widgets/Form/RenderSchema.jsx
@@ -26,6 +26,7 @@ const RenderSchema = ({ component, parent, id, onOptionChange, onOptionsChange,
return validateWidget({
...{ widgetValue: value },
...{ validationObject: component.definition.validation },
+ componentType: component?.component,
});
},
[component.definition.validation]
diff --git a/frontend/src/AppBuilder/Widgets/Modal.jsx b/frontend/src/AppBuilder/Widgets/Modal.jsx
index e0f099205f..c410cf4840 100644
--- a/frontend/src/AppBuilder/Widgets/Modal.jsx
+++ b/frontend/src/AppBuilder/Widgets/Modal.jsx
@@ -68,6 +68,54 @@ export const Modal = function Modal({
}, [showModal, id, mode]);
/**** End - Logic to reset the zIndex of modal control box ****/
+ // Side effects for modal, which include dom manipulation to hide overflow when opening
+ // And cleaning up dom when modal is closed
+
+ const onShowSideEffects = () => {
+ const canvasElement = document.querySelector('.page-container.canvas-container');
+ const realCanvasEl = document.getElementsByClassName('real-canvas')[0];
+ const allModalContainers = realCanvasEl.querySelectorAll('.modal');
+ const modalContainer = allModalContainers[allModalContainers.length - 1];
+
+ if (canvasElement && realCanvasEl && modalContainer) {
+ const currentScroll = canvasElement.scrollTop;
+ canvasElement.style.overflowY = 'hidden';
+
+ modalContainer.style.height = `${canvasElement.offsetHeight}px`;
+ modalContainer.style.top = `${currentScroll}px`;
+ fireEvent('onOpen');
+ }
+ };
+
+ const onHideSideEffects = () => {
+ const canvasElement = document.querySelector('.page-container.canvas-container');
+ const realCanvasEl = document.getElementsByClassName('real-canvas')[0];
+ const allModalContainers = realCanvasEl.querySelectorAll('.modal');
+ const modalContainer = allModalContainers[allModalContainers.length - 1];
+ const hasManyModalsOpen = allModalContainers.length > 1;
+
+ if (canvasElement && realCanvasEl && modalContainer) {
+ modalContainer.style.height = ``;
+ modalContainer.style.top = ``;
+ fireEvent('onClose');
+ }
+ if (canvasElement && !hasManyModalsOpen) {
+ canvasElement.style.overflow = 'auto';
+ }
+ };
+
+ // useEventListener('resize', onShowSideEffects, window);
+
+ const onShowModal = () => {
+ openModal();
+ onShowSideEffects();
+ };
+
+ const onHideModal = () => {
+ onHideSideEffects();
+ hideModal();
+ };
+
useEffect(() => {
const exposedVariables = {
open: async function () {
@@ -93,58 +141,48 @@ export const Modal = function Modal({
setShowModal(true);
}
+ // Add debounced version of handleModalOpen
+ const debouncedModalOpen = debounce(() => {
+ onShowSideEffects();
+ }, 10);
+
useEffect(() => {
- const handleModalOpen = () => {
- openModal();
- const canvasElement = document.getElementsByClassName('canvas-container')[0];
- const modalBackdropEl = document.getElementsByClassName('modal-backdrop')[0];
- const realCanvasEl = document.getElementsByClassName('real-canvas')[0];
- const modalCanvasEl = document.getElementById(`canvas-${id}`);
- if (canvasElement && modalBackdropEl && modalCanvasEl && realCanvasEl) {
- realCanvasEl.style.height = '100vh';
- realCanvasEl.style.position = 'absolute';
- realCanvasEl.style.overflow = 'hidden';
+ // Select the DOM element
+ const canvasElement = document.querySelector('.page-container.canvas-container');
- modalBackdropEl.style.height = '100vh';
- modalBackdropEl.style.minHeight = '100vh';
- modalBackdropEl.style.minHeight = '100vh';
- modalCanvasEl.style.height = modalHeight;
- }
+ if (!canvasElement) return; // Ensure the element exists
+
+ // Create a ResizeObserver
+ const resizeObserver = new ResizeObserver(() => {
+ debouncedModalOpen();
+ });
+
+ // Observe the canvas element
+ resizeObserver.observe(canvasElement);
+
+ return () => {
+ // Cleanup observer on component unmount
+ resizeObserver.disconnect();
};
+ }, []);
- // Add debounced version of handleModalOpen
- const debouncedModalOpen = debounce(() => {
- handleModalOpen();
- }, 10);
-
- const handleModalClose = () => {
- const canvasElement = document.getElementsByClassName('canvas-container')[0];
- const realCanvasEl = document.getElementsByClassName('real-canvas')[0];
- const canvasHeight = realCanvasEl?.getAttribute('canvas-height');
-
- if (canvasElement && realCanvasEl && canvasHeight) {
- realCanvasEl.style.height = canvasHeight;
- realCanvasEl.style.position = '';
-
- realCanvasEl.style.overflow = 'auto';
- }
- };
+ useEffect(() => {
if (showModal) {
debouncedModalOpen();
} else {
- // if (document.getElementsByClassName('modal-content')[0] == undefined) {
- handleModalClose();
- // }
+ if (document.getElementsByClassName('modal-content')[0] == undefined) {
+ onHideModal();
+ }
}
// Cleanup the effect
return () => {
if (document.getElementsByClassName('modal-content')[0] == undefined) {
- handleModalClose();
+ onHideModal();
}
};
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [showModal, modalHeight]);
+ }, [modalHeight, size]);
useEffect(() => {
if (isInitialRender.current) {
@@ -180,6 +218,7 @@ export const Modal = function Modal({
display: visibility ? '' : 'none',
'--tblr-btn-color-darker': tinycolor(triggerButtonBackgroundColor).darken(8).toString(),
boxShadow,
+ borderColor: 'var(--primary-brand)',
},
};
@@ -244,7 +283,9 @@ export const Modal = function Modal({
keyboard={true}
enforceFocus={false}
animation={false}
- onEscapeKeyDown={() => hideOnEsc && hideModal()}
+ onShow={() => onShowModal()}
+ onHide={() => onHideModal()}
+ onEscapeKeyDown={() => hideOnEsc && onHideModal()}
id="modal-container"
component-id={id}
backdrop={'static'}
@@ -257,7 +298,7 @@ export const Modal = function Modal({
titleAlignment,
hideTitleBar,
hideCloseButton,
- hideModal,
+ hideModal: onHideModal,
component,
showConfigHandler: mode === 'edit',
}}
diff --git a/frontend/src/AppBuilder/Widgets/ModalV2/Components/Footer.jsx b/frontend/src/AppBuilder/Widgets/ModalV2/Components/Footer.jsx
index e25027ce33..8ff4c0cbb1 100644
--- a/frontend/src/AppBuilder/Widgets/ModalV2/Components/Footer.jsx
+++ b/frontend/src/AppBuilder/Widgets/ModalV2/Components/Footer.jsx
@@ -19,6 +19,7 @@ export const ModalFooter = React.memo(({ id, isDisabled, customStyles, darkMode,
overflowX: 'hidden',
overflowY: isDisabled ? 'hidden' : 'auto',
}}
+ componentType="ModalV2"
/>
{isDisabled && (
{isDisabled && (
diff --git a/frontend/src/AppBuilder/Widgets/ModalV2/Components/Modal.jsx b/frontend/src/AppBuilder/Widgets/ModalV2/Components/Modal.jsx
index 25796a9951..2615ca3d5c 100644
--- a/frontend/src/AppBuilder/Widgets/ModalV2/Components/Modal.jsx
+++ b/frontend/src/AppBuilder/Widgets/ModalV2/Components/Modal.jsx
@@ -105,9 +105,10 @@ export const ModalWidget = ({ ...restProps }) => {
+ {isEditable ? editableContent(isEditable, value, onChange) : nonEditableContent(value)}
+
+ );
+};
diff --git a/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/CustomDropdown.jsx b/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/CustomDropdown.jsx
new file mode 100644
index 0000000000..e69e22a5fc
--- /dev/null
+++ b/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/CustomDropdown.jsx
@@ -0,0 +1,135 @@
+import React, { useState, useEffect, useCallback, useMemo } from 'react';
+import SelectSearch from 'react-select-search';
+import '@/_styles/editor/react-select-search.scss';
+import { useTranslation } from 'react-i18next';
+import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
+
+export const CustomDropdownColumn = ({
+ options = [],
+ value,
+ multiple,
+ onChange,
+ isEditable,
+ width,
+ contentWrap,
+ autoHeight,
+ darkMode,
+}) => {
+ const [showOverlay, setShowOverlay] = useState(false);
+ const { t } = useTranslation();
+
+ const sanitizedValue = useMemo(() => {
+ if (!multiple) return value;
+ if (!Array.isArray(value)) return [];
+ return value.every((val) => typeof val !== 'object') ? value : [];
+ }, [value, multiple]);
+
+ const handleMouseMove = useCallback(() => {
+ if (!showOverlay) {
+ setShowOverlay(true);
+ }
+ }, [showOverlay]);
+
+ const handleMouseLeave = useCallback(() => {
+ setShowOverlay(false);
+ }, []);
+
+ const renderValue = useCallback(
+ (valueProps) => {
+ if (!valueProps) return null;
+
+ const stringValue = String(valueProps.value);
+ const values = stringValue.includes(',') ? stringValue.split(', ') : stringValue.split(' ');
+
+ return (
+ {
+ if (isNewRow && isEditable) {
+ setIsFocused((prev) => !prev);
+ }
+ }}
+ >
+
+ {
+ if (!isValid) {
+ setIsFocused(true); // Open the dropdown
+ }
+ }}
+ className={` ${isValid ? 'd-none' : 'invalid-feedback d-block'}`}
+ >
+ {validationError}
+
+ >
+
+ );
+};
diff --git a/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/Datepicker.jsx b/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/Datepicker.jsx
new file mode 100644
index 0000000000..23e9640902
--- /dev/null
+++ b/frontend/src/AppBuilder/Widgets/NewTable/_components/DataTypes/Datepicker.jsx
@@ -0,0 +1,279 @@
+import React, { useState, useCallback, useEffect, useRef, forwardRef } from 'react';
+import DatePickerComponent from 'react-datepicker';
+import moment from 'moment-timezone';
+import cx from 'classnames';
+import SolidIcon from '@/_ui/Icon/SolidIcons';
+import CustomDatePickerHeader from './_components/CustomDatePickerHeader';
+import 'react-datepicker/dist/react-datepicker.css';
+import useTextColor from '../DataTypes/_hooks/useTextColor';
+
+const DISABLED_DATE_FORMAT = 'MM/DD/YYYY';
+
+const DatepickerInput = forwardRef(({ value, onClick, styles, readOnly, onInputChange, onInputFocus }, ref) => (
+ {
+ setIsEditing(false);
+ if (cellValue !== e.target.textContent) {
+ const value = JSON.stringify(JSON.parse(e.target.textContent.replace(/\n/g, '')));
+ handleCellValueChange(row.index, column.key || column.name, value, row.original);
+ }
+ }}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter') {
+ ref.current.blur();
+ if (cellValue !== e.target.textContent) {
+ const value = JSON.stringify(JSON.parse(e.target.textContent.replace(/\n/g, '')));
+ handleCellValueChange(row.index, column.key || column.name, value, row.original);
+ }
+ }
+ }}
+ onFocus={(e) => {
+ setIsEditing(true);
+ e.stopPropagation();
+ }}
+ >
+ {String(formatCellValue(cellValue))}
+
+ );
+
+ const getOverlay = () => {
+ return (
+ setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ style={{ color: 'var(--text-primary)' }}
+ >
+
+ {String(formatCellValue(cellValue, true))}
+
+
+ );
+ };
+
+ const _showOverlay =
+ ref?.current &&
+ (ref?.current?.clientWidth < ref?.current?.children[0]?.offsetWidth ||
+ ref?.current?.clientHeight < ref?.current?.children[0]?.offsetHeight);
+
+ return (
+ <>
+ {
+ if (!hovered) setHovered(true);
+ }}
+ onMouseLeave={() => {
+ setHovered(false);
+ }}
+ ref={ref}
+ >
+
+ {String(formatCellValue(cellValue))}
+
+
+ ) : (
+ setHovered(true)}
+ onMouseLeave={() => setHovered(false)}
+ style={{ color: 'var(--text-primary)' }}
+ >
+
+ {getCellValue(cellValue)}
+
+
+ );
+ };
+
+ const renderEditable = () => {
+ const onChange = (e) => {
+ if (cellValue !== e.target.textContent) {
+ const value = e.target.textContent;
+ handleCellValueChange(cell.row.index, column.key || column.name, value, cell.row.original);
+ }
+ };
+
+ return (
+