diff --git a/.version b/.version index 19811903a7..a5c4c76339 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -3.8.0 +3.9.0 diff --git a/frontend/.version b/frontend/.version index 19811903a7..a5c4c76339 100644 --- a/frontend/.version +++ b/frontend/.version @@ -1 +1 @@ -3.8.0 +3.9.0 diff --git a/frontend/assets/images/icons/widgets/emailinput.jsx b/frontend/assets/images/icons/widgets/emailinput.jsx new file mode 100644 index 0000000000..1394959b50 --- /dev/null +++ b/frontend/assets/images/icons/widgets/emailinput.jsx @@ -0,0 +1,39 @@ +import React from 'react'; + +const EmailInput = ({ fill = '#D7DBDF', width = 24, className = '', viewBox = '0 0 49 48' }) => ( + + + + + + +); + +export default EmailInput; diff --git a/frontend/assets/images/icons/widgets/index.jsx b/frontend/assets/images/icons/widgets/index.jsx index 24705fdc6f..5f1715689c 100644 --- a/frontend/assets/images/icons/widgets/index.jsx +++ b/frontend/assets/images/icons/widgets/index.jsx @@ -59,6 +59,8 @@ import Upstatistics from './upstatistics.jsx'; import Verticaldivider from './verticaldivider.jsx'; import TimePicker from './timepicker.jsx'; import DatepickerV2 from './datepickerv2.jsx'; +import PhoneInput from './phoneinput.jsx'; +import EmailInput from './emailinput.jsx'; const WidgetIcon = (props) => { switch (props.name) { @@ -99,6 +101,10 @@ const WidgetIcon = (props) => { return ; case 'datetimepickerv2': return ; + case 'emailinput': + return ; + case 'phoneinput': + return ; case 'daterangepicker': return ; case 'horizontaldivider': @@ -180,6 +186,7 @@ const WidgetIcon = (props) => { case 'text': return ; case 'textarea': + case 'textarealegacy': return - ); -}; diff --git a/frontend/src/Editor/Components/TextInput.jsx b/frontend/src/Editor/Components/TextInput.jsx index 29fbaaa625..ce482947a9 100644 --- a/frontend/src/Editor/Components/TextInput.jsx +++ b/frontend/src/Editor/Components/TextInput.jsx @@ -236,8 +236,6 @@ export const TextInput = function TextInput({ value: properties.value, isMandatory: isMandatory, isLoading: loading, - isVisible: visibility, - isDisabled: disable, }; setExposedVariables(exposedVariables); @@ -245,6 +243,17 @@ export const TextInput = function TextInput({ // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + useEffect(() => { + // Fix for "visibility is not defined" in production because there's a naming conflict in the code. + // The issue is in the exposedVariables object where we had both a function named visibility and a property isVisible that depends on the state variable with the same name. + const exposedVariables = { + isVisible: visibility, + isDisabled: disable, + }; + setExposedVariables(exposedVariables); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + const setInputValue = (value) => { setValue(value); setExposedVariable('value', value); diff --git a/frontend/src/Editor/Components/Timer.jsx b/frontend/src/Editor/Components/Timer.jsx index b7b1f529fd..d40dfcac40 100644 --- a/frontend/src/Editor/Components/Timer.jsx +++ b/frontend/src/Editor/Components/Timer.jsx @@ -164,19 +164,25 @@ export const Timer = function Timer({ height, properties = {}, styles, setExpose
{state === 'initial' && ( onStart()} > Start )} {state === 'running' && ( - + Pause )} {state === 'paused' && ( - + Resume )} diff --git a/frontend/src/Editor/LeftSidebar/SidebarDebugger/Logs.jsx b/frontend/src/Editor/LeftSidebar/SidebarDebugger/Logs.jsx index aba2ca6af1..a30585bf42 100644 --- a/frontend/src/Editor/LeftSidebar/SidebarDebugger/Logs.jsx +++ b/frontend/src/Editor/LeftSidebar/SidebarDebugger/Logs.jsx @@ -27,7 +27,7 @@ function Logs({ logProps, idx }) { logProps?.description || (isString(logProps?.message) && logProps?.message) || (isString(logProps?.error?.description) && logProps?.error?.description) || //added string check since description can be an object. eg: runpy - logProps?.error?.message.trim() + logProps?.error?.message }`; const defaultStyles = { @@ -87,12 +87,12 @@ function Logs({ logProps, idx }) {

{ - setOpen((prev) => !prev); + logProps?.type !== 'Custom Log' && setOpen((prev) => !prev); }} style={{ pointerEvents: logProps?.isQuerySuccessLog ? 'none' : 'default', position: 'relative' }} > - + {logProps?.type !== 'Custom Log' && } {logProps.type === 'navToDisablePage' ? ( @@ -103,23 +103,32 @@ function Logs({ logProps, idx }) {

{logProps?.errorTarget}
{moment(logProps?.timestamp).fromNow()}
-
+ {logProps?.type === 'Custom Log' && ( +
+ Custom Log +
+ )} +
+ {logProps?.type == 'Custom Log' &&
{message}
} - {message} - {logProps?.error?.lineNumber ? `, Line ${logProps.error.lineNumber}` : ''} + {logProps?.type !== 'Custom Log' && message} )} diff --git a/frontend/src/Editor/WidgetManager/components.js b/frontend/src/Editor/WidgetManager/components.js index d7aa4442f0..6b0c4beb53 100644 --- a/frontend/src/Editor/WidgetManager/components.js +++ b/frontend/src/Editor/WidgetManager/components.js @@ -1,4 +1,4 @@ -import { widgets } from './widgetConfig'; +import { widgets } from '../../AppBuilder/WidgetManager/configs/widgetConfig'; const universalProps = { properties: {}, diff --git a/frontend/src/Editor/WidgetManager/configs/container.js b/frontend/src/Editor/WidgetManager/configs/container.js index 37a895f553..424b9a801d 100644 --- a/frontend/src/Editor/WidgetManager/configs/container.js +++ b/frontend/src/Editor/WidgetManager/configs/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/frontend/src/Editor/WidgetManager/configs/image.js b/frontend/src/Editor/WidgetManager/configs/image.js index 453d9b4ed6..b962c270a5 100644 --- a/frontend/src/Editor/WidgetManager/configs/image.js +++ b/frontend/src/Editor/WidgetManager/configs/image.js @@ -143,6 +143,15 @@ export const imageConfig = { }, accordian: 'Image', }, + alignment: { + type: 'alignButtons', + displayName: 'Alignment', + validation: { + schema: { type: 'string' }, + defaultValue: 'center', + }, + accordian: 'Image', + }, backgroundColor: { type: 'color', displayName: 'Background', @@ -255,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/Editor/WidgetManager/configs/link.js b/frontend/src/Editor/WidgetManager/configs/link.js index bf419e16c0..673abb1e75 100644 --- a/frontend/src/Editor/WidgetManager/configs/link.js +++ b/frontend/src/Editor/WidgetManager/configs/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' }, @@ -52,15 +80,48 @@ export const linkConfig = { 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,14 +134,30 @@ 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', }, }, exposedVariables: {}, @@ -89,6 +166,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 +201,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/Editor/WidgetManager/configs/listview.js b/frontend/src/Editor/WidgetManager/configs/listview.js index 25da8f73c6..86825142eb 100644 --- a/frontend/src/Editor/WidgetManager/configs/listview.js +++ b/frontend/src/Editor/WidgetManager/configs/listview.js @@ -13,6 +13,7 @@ export const listviewConfig = { top: 15, left: 3, height: 100, + width: 7, }, properties: ['source'], accessorKey: 'imageURL', diff --git a/frontend/src/Editor/WidgetManager/configs/tabs.js b/frontend/src/Editor/WidgetManager/configs/tabs.js index a397979a3e..0ed1e2a320 100644 --- a/frontend/src/Editor/WidgetManager/configs/tabs.js +++ b/frontend/src/Editor/WidgetManager/configs/tabs.js @@ -13,6 +13,7 @@ export const tabsConfig = { top: 60, left: 17, height: 100, + width: 7, }, tab: 0, properties: ['source'], diff --git a/frontend/src/Editor/WidgetManager/configs/textarea.js b/frontend/src/Editor/WidgetManager/configs/textarea.js index c5e71be77d..d0e0364334 100644 --- a/frontend/src/Editor/WidgetManager/configs/textarea.js +++ b/frontend/src/Editor/WidgetManager/configs/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/Editor/WidgetManager/constants.js b/frontend/src/Editor/WidgetManager/constants.js index 8c593455e1..3e7144a412 100644 --- a/frontend/src/Editor/WidgetManager/constants.js +++ b/frontend/src/Editor/WidgetManager/constants.js @@ -4,4 +4,5 @@ export const LEGACY_ITEMS = [ 'MultiselectLegacy', 'RadioButtonLegacy', 'ModalLegacy', + 'TextareaLegacy', ]; diff --git a/frontend/src/LicenseTooltip/index.jsx b/frontend/src/LicenseTooltip/index.jsx index 7accc41376..efe4b1f28a 100644 --- a/frontend/src/LicenseTooltip/index.jsx +++ b/frontend/src/LicenseTooltip/index.jsx @@ -25,6 +25,7 @@ const LicenseTooltip = ({ 'Multi-environments': 'multiEnvironment', 'Import from git': 'gitSync', GitSync: 'gitSync', + 'Custom themes': 'customThemes', }; const generateMessage = () => { diff --git a/frontend/src/Routes/AppsRoute.jsx b/frontend/src/Routes/AppsRoute.jsx index 7ed530162d..b84a2b04ff 100644 --- a/frontend/src/Routes/AppsRoute.jsx +++ b/frontend/src/Routes/AppsRoute.jsx @@ -8,6 +8,7 @@ import { useLocation, useNavigate, useParams } from 'react-router-dom'; import { handleAppAccess } from '@/_helpers/handleAppAccess'; import { getQueryParams } from '@/_helpers/routes'; import queryString from 'query-string'; +import useStore from '@/AppBuilder/_stores/store'; export const AppsRoute = ({ children, componentType }) => { const params = useParams(); @@ -20,6 +21,7 @@ export const AppsRoute = ({ children, componentType }) => { }); const clonedElement = React.cloneElement(children, extraProps); const navigate = useNavigate(); + const switchPage = useStore((state) => state.switchPage); /* any extra logic specifc to the route can be done @@ -29,6 +31,10 @@ export const AppsRoute = ({ children, componentType }) => { if (isValidSession) { onValidSession(); } + + // handle back and forward navigation + window.addEventListener('popstate', handleBrowserNavigation); + return () => window.removeEventListener('popstate', handleBrowserNavigation); // eslint-disable-next-line react-hooks/exhaustive-deps }, [isValidSession]); @@ -69,5 +75,10 @@ export const AppsRoute = ({ children, componentType }) => { } }; + const handleBrowserNavigation = (e) => { + const { id, handle } = e.state; + switchPage(id, handle, [], true); + }; + return {clonedElement}; }; diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index f0c66a1fc8..9ce0e8527a 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -2486,7 +2486,9 @@ export const setMultipleComponentsSelected = (components) => { export const calculateMoveableBoxHeight = (componentType, layoutData, stylesDefinition, label) => { // Early return for non input components - if (!['TextInput', 'PasswordInput', 'NumberInput', 'DropdownV2', 'MultiselectV2'].includes(componentType)) { + if ( + !['TextInput', 'PasswordInput', 'NumberInput', 'DropdownV2', 'MultiselectV2', 'TextArea'].includes(componentType) + ) { return layoutData?.height; } const { alignment = { value: null }, width = { value: null }, auto = { value: null } } = stylesDefinition ?? {}; diff --git a/frontend/src/_helpers/editorHelpers.js b/frontend/src/_helpers/editorHelpers.js index 1f97cc42ee..35335477d0 100644 --- a/frontend/src/_helpers/editorHelpers.js +++ b/frontend/src/_helpers/editorHelpers.js @@ -4,7 +4,6 @@ import { Text } from '@/Editor/Components/Text'; import { Table } from '@/Editor/Components/Table/Table'; import { TextInput } from '@/Editor/Components/TextInput'; import { NumberInput } from '@/Editor/Components/NumberInput'; -import { TextArea } from '@/Editor/Components/TextArea'; import { Container } from '@/Editor/Components/Container'; import { Tabs } from '@/Editor/Components/Tabs'; import { RichTextEditor } from '@/Editor/Components/RichTextEditor'; @@ -50,7 +49,7 @@ import { Kanban } from '@/Editor/Components/Kanban/Kanban'; import { Steps } from '@/Editor/Components/Steps'; import { TreeSelect } from '@/Editor/Components/TreeSelect'; import { Icon } from '@/Editor/Components/Icon'; -import { Link } from '@/Editor/Components/Link'; +import { Link } from '@/Editor/Components/Link/Link'; import { Form } from '@/Editor/Components/Form/Form'; import { BoundedBox } from '@/Editor/Components/BoundedBox/BoundedBox'; import { isPDFSupported } from '@/_helpers/appUtils'; @@ -81,7 +80,6 @@ export const AllComponents = { TextInput, NumberInput, Table, - TextArea, Container, Tabs, RichTextEditor, diff --git a/frontend/src/_helpers/utils.js b/frontend/src/_helpers/utils.js index 834667942e..a2285ed6db 100644 --- a/frontend/src/_helpers/utils.js +++ b/frontend/src/_helpers/utils.js @@ -230,18 +230,20 @@ export function resolveReferences( } else { const dynamicVariables = getDynamicVariables(object); - for (const dynamicVariable of dynamicVariables) { - const value = resolveString( - dynamicVariable, - state, - customObjects, - reservedKeyword, - withError, - forPreviewBox - ); + if (dynamicVariables) { + for (const dynamicVariable of dynamicVariables) { + const value = resolveString( + dynamicVariable, + state, + customObjects, + reservedKeyword, + withError, + forPreviewBox + ); - if (typeof value !== 'function') { - object = object.replace(dynamicVariable, value); + if (typeof value !== 'function') { + object = object.replace(dynamicVariable, value); + } } } } diff --git a/frontend/src/_styles/designtheme.scss b/frontend/src/_styles/designtheme.scss index bfdb6cee41..52ce379af0 100644 --- a/frontend/src/_styles/designtheme.scss +++ b/frontend/src/_styles/designtheme.scss @@ -164,7 +164,7 @@ // new design theme - --primary-brand: #4A6DD9; + --primary-accent-strong: #4A6DD9; --primary-accent-subtle: rgba(74, 109, 217, 30%); --primary-white: #FAFCFF; diff --git a/frontend/src/_styles/left-sidebar.scss b/frontend/src/_styles/left-sidebar.scss index 3f68e1486b..1883213fa8 100644 --- a/frontend/src/_styles/left-sidebar.scss +++ b/frontend/src/_styles/left-sidebar.scss @@ -195,6 +195,7 @@ .text-tomato-9 { color: var(--tomato9); + font-weight: 500; } .text-slate-10 { @@ -252,12 +253,25 @@ background-color: var(--slate3); } - .error-target { + .error-target, .error-target-custom-log { background-color: var(--interactive-overlays-fill-hover) !important; padding: 4px 7px; border-radius: 7px; color: var(--slate10) } + + .error-target-custom-log { + display: flex; + align-items: center; + margin-top: 5px; + background: var(--purple5) !important; + color: var(--purple11); + width: fit-content; + + svg { + margin-right: 1px; + } + } } @@ -701,6 +715,7 @@ .sidebar-h-100-popover { position: relative; height: 100vh; + overflow-y:scroll !important; margin-top: 0px; border-radius: 0px !important; diff --git a/frontend/src/_styles/queryManager.scss b/frontend/src/_styles/queryManager.scss index 7b256c3812..1c63a111e9 100644 --- a/frontend/src/_styles/queryManager.scss +++ b/frontend/src/_styles/queryManager.scss @@ -1856,8 +1856,9 @@ $border-radius: 4px; .tjdb-codhinter-wrapper{ .codehinter-input{ .cm-editor{ - height: 30px !important; + // height: 30px !important; min-height: 30px !important; + max-height:100px !important; border-radius: 0 !important; border-right: 0 ; } @@ -1865,8 +1866,9 @@ $border-radius: 4px; } .tjdb-limit-offset-codehinter{ .cm-editor{ - height: 30px !important; + // height: 30px !important; min-height: 30px !important; + max-height:100px !important; } } @@ -1904,4 +1906,19 @@ $border-radius: 4px; line-height: 18px; } } +} + + +.qm-delete-btn { + min-height: 30px; + height: 100% !important; + align-items: flex-start !important; + padding-top: 6px; +} + +.restapi-key-value { + .code-hinter-wrapper, .code-editor-basic-wrapper, .codehinter-container, .cm-codehinter, .code-editor-query-panel{ + height:100%; + max-height: 100px; + } } \ No newline at end of file diff --git a/frontend/src/_styles/table-component.scss b/frontend/src/_styles/table-component.scss index 82f6b3de71..a9da483a1f 100644 --- a/frontend/src/_styles/table-component.scss +++ b/frontend/src/_styles/table-component.scss @@ -3,6 +3,10 @@ .jet-table.table-component { padding: 8px; + width: 100%; + overflow: hidden; + padding: 8px; + background-color: 'red !important'; &.jet-table { background-color: var(--surfaces-surface-01); @@ -13,6 +17,11 @@ .table-filters { border: 1px solid var(--slate3, #F1F3F5) !important; + .card-body { + overflow-y: auto; + overflow-x: hidden; + } + .card-footer { background-color: inherit !important; } @@ -35,42 +44,6 @@ border-bottom: 0 !important; } - // .table-clear-icon{ - // border-radius: 4px; - // border: 1px solid rgba(255, 255, 255, 0.00) !important; - // background: var(--indigo3, #F0F4FF) !important; - // } - .table-global-search { - border: 1px solid var(--borders-default) !important; - - input { - color: var(--text-primary) !important; - } - - ; - - &:hover { - border-radius: 6px; - border: 1px solid var(--slate8, #C1C8CD) !important; - background: var(surfaces/surface-01) !important; - } - - &:focus-visible { - border-radius: 6px; - border: 2px solid var(--primary-accent-strong) !important; - // background: var(--base-base, #FFF) !important; - /* Focus rings/Gray/light */ - // box-shadow: 0px 0px 0px 4px var(--slate6) !important; - } - - &:focus-within { - border-radius: 6px; - border: 2px solid var(--primary-accent-strong) !important; - /* Selected ring/Indigo/light */ - // box-shadow: 0px 0px 0px 1px var(--indigo6) !important; - } - } - .tr { .th { .thead-editable-icon-header-text-wrapper { @@ -94,406 +67,556 @@ .table-bordered> :not(caption)>*>* { border-width: 0 1px 0 0; } -} -.jet-data-table { - &::-webkit-scrollbar { - display: unset !important; - } + &.jet-table { + background-color: var(--surfaces-surface-01); + box-shadow: var(--elevation-200-box-shadow); + border: 1px solid var(--borders-weak-disabled); - &::-webkit-scrollbar-thumb { - background-color: var(--slate4) !important; - /* Color of the scrollbar thumb */ - border-radius: 8px; - /* Rounded corners of the thumb */ - } + .table-card-header { + padding: 12px; + height: 56px; - thead { - z-index: 2; - } - .table thead th:not(.rdtPrev):not(.rdtSwitch):not(.rdtNext):not(.dow) { - display: flex !important; - } + .table-global-search { + border: 1px solid var(--borders-default) !important; - .table-row.selected { - --tblr-table-accent-bg: var(--indigo3, #F0F4FF) !important; - background: var(--indigo3, #F0F4FF) !important; - } + input { + color: var(--text-primary) !important; + } - td { - overflow-x: initial; - padding: 8px 12px !important; - overflow-y: hidden; + &:hover { + border-radius: 6px; + border: 1px solid var(--slate8, #C1C8CD) !important; + background: var(surfaces/surface-01) !important; + } - &.has-number { - padding: 0px 12px 0px 12px !important; - } + &:focus-visible { + border-radius: 6px; + border: 2px solid var(--primary-accent-strong) !important; + // background: var(--base-base, #FFF) !important; + /* Focus rings/Gray/light */ + // box-shadow: 0px 0px 0px 4px var(--slate6) !important; + } - &.has-number.isEditable { - padding: 0px 0px 0px 12px !important; - } - - &.has-dropdown, - &.has-multiselect, - &.has-badge, - &.has-badges { - overflow-y: visible !important; - } - - // &.has-number { - // padding: 0 !important; - // } - - .text-container { - padding: 0; - margin: 0; - border: 0; - height: 100%; - outline: none; - -webkit-user-modify: read-write-plaintext-only; - } - - textarea { - resize: none; - } - } - - td.regular { - white-space: nowrap; - /* Prevent text wrapping */ - - } - - td.condensed { - white-space: nowrap; - /* Prevent text wrapping */ - } - - .has-dropdown, - .has-multiselect, - .has-datepicker, - .has-text .has-actions { - padding: 0 5px; - } - - .has-text, - .has-actions { - margin: 0; - } - - .overflow-x-hidden { - overflow-x: hidden !important; - } - - .wrap-wrapper { - white-space: normal !important; - word-break: break-word; - } - - .scroll-wrapper { - overflow-x: auto; - } - - .hide-wrapper { - overflow-x: hidden !important; - } - - .td { - - // padding: 6px 12px; - .text-container:focus-visible, - .text-container:focus, - .text-container:focus-within, - .text-container:hover { - outline: none; - height: 100%; - } - - - &:not(:focus-within):hover { - background: linear-gradient(0deg, var(--interactive-overlays-fill-hover), var(--interactive-overlays-fill-hover)), - } - - - display: flex !important; - - .td-container { - margin-top: auto; - margin-bottom: auto; - } - - .td-container:has(.action-button) { - height: inherit !important; - } - } - - td { - .text-container:focus { - position: absolute; - height: 100%; - overflow-y: scroll; - top: 0; - left: 0; - right: 0; - background: var(--surfaces-surface-01) !important; - box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, - rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px; - } - - .text-container:focus-visible, - .text-container:focus, - .text-container:focus-within, - .text-container:hover { - outline: none; - } - - } - - td { - .text-container::-webkit-scrollbar { - background: transparent; - height: 0; - width: 0; - } - } - - td::-webkit-scrollbar { - background: transparent; - height: 0; - width: 0; - } - - td:hover::-webkit-scrollbar { - height: 4px; - width: 4px; - } - - .th { - white-space: normal; - } - - // th:after { - // content: " "; - // position: relative; - // height: 0; - // width: 0; - // } - - // .sort-desc:after { - // border-left: 5px solid transparent; - // border-right: 5px solid transparent; - // border-top: 5px solid #767676; - // border-bottom: 5px solid transparent; - // left: 0px; - // top: 7px; - // } - - // .sort-asc:after { - // border-left: 5px solid transparent; - // border-right: 5px solid transparent; - // border-top: 0px solid transparent; - // border-bottom: 5px solid #767676; - // left: 0px; - // top: 7px; - // } -} - -.jet-data-table>table:not(.table-resizing) { - - .table-row:hover, - .table-row:focus { - background: var(--slate4, #ECEEF0) !important; - } -} - -// .jet-data-table>thead+div::-webkit-scrollbar, -.jet-data-table tbody::-webkit-scrollbar, -.jet-data-table::-webkit-scrollbar { - background: transparent; -} - -// .jet-data-table>thead+div::-webkit-scrollbar-track, -.jet-data-table tbody::-webkit-scrollbar-track, -.jet-data-table::-webkit-scrollbar-track { - background: transparent; -} - -.jet-data-table tbody:hover, -.jet-data-table:hover { - overflow-x: auto; - overflow-y: auto; -} - -.jet-data-table tbody { - overflow-x: hidden !important; -} - -// .jet-data-table>thead+div { - -// overflow: hidden !important; - -// &::-webkit-scrollbar-thumb { -// background-color: var(--slate4) !important; -// /* Color of the scrollbar thumb */ -// border-radius: 8px; -// /* Rounded corners of the thumb */ -// } - -// &:hover { -// overflow-x: auto !important; -// overflow-y: auto !important; -// } -// } - -.jet-data-table { - - .th:first-child, - td:first-child { - border-left: none; - } - - .th:last-child, - td:last-child { - border-right: none; - } - - overflow: hidden; - - .form-check { - margin-bottom: 0; - } - - .form-check-inline { - margin-right: 0; - } - - .table-row { - cursor: pointer; - } - - thead { - position: sticky; - top: 0px; - display: inline-block; - - tr { - border-top: none; - } - } - - tbody { - display: inline-block; - } -} - -.jet-data-table { - display: inline-block; - height: 100%; - - thead { - width: 100%; - - } - - .select-search:not(.is-loading):not(.select-search--multiple) .select-search__value::after { - display: none; - } - - .custom-select { - .select-search:not(.select-search--multiple) .select-search__select { - top: 0px; - border: solid #9fa0a1 1px; - } - } - - .tags { - width: 100%; - min-height: 20px; - - .add-tag-button { - display: none; - } - - .tag { - font-weight: 400; - font-size: 0.85rem; - letter-spacing: 0.04em; - text-transform: none; - - .remove-tag-button { - margin-left: 5px; - margin-right: -7px; - display: none; + &:focus-within { + border-radius: 6px; + border: 2px solid var(--primary-accent-strong) !important; + /* Selected ring/Indigo/light */ + // box-shadow: 0px 0px 0px 1px var(--indigo6) !important; + } } } - .form-control-plaintext { - font-size: 12px; + .card-footer { + .pagination-loader { + span { + width: 100%; + } + } } - .form-control-plaintext:hover, - .form-control-plaintext:focus-visible { - outline: none; - } - } + .jet-data-table { + &::-webkit-scrollbar { + display: unset !important; + } - .tags:hover { - .add-tag-button { - display: inline-flex; - } - } + &::-webkit-scrollbar-thumb { + background-color: var(--slate4) !important; + /* Color of the scrollbar thumb */ + border-radius: 8px; + /* Rounded corners of the thumb */ + } - .tag:hover { - .remove-tag-button { - display: inline-flex; - } - } + thead { + z-index: 2; + } - .th { - .resizer { + .table thead th:not(.rdtPrev):not(.rdtSwitch):not(.rdtNext):not(.dow) { + display: flex !important; + } + + .table-row.selected { + --tblr-table-accent-bg: var(--indigo3, #F0F4FF) !important; + background: var(--indigo3, #F0F4FF) !important; + } + + td { + overflow-x: initial; + padding: 8px 12px !important; + overflow-y: hidden; + + &.has-number { + padding: 0px 12px 0px 12px !important; + } + + &.has-number.isEditable { + padding: 0px 0px 0px 12px !important; + } + + &.has-dropdown, + &.has-multiselect, + &.has-badge, + &.has-badges { + overflow-y: visible !important; + } + + // &.has-number { + // padding: 0 !important; + // } + + .text-container { + padding: 0; + margin: 0; + border: 0; + height: 100%; + outline: none; + -webkit-user-modify: read-write-plaintext-only; + } + + textarea { + resize: none; + } + } + + td.regular { + white-space: nowrap; + /* Prevent text wrapping */ + + } + + td.condensed { + white-space: nowrap; + /* Prevent text wrapping */ + } + + .has-dropdown, + .has-multiselect, + .has-datepicker, + .has-text .has-actions { + padding: 0 5px; + } + + .has-text, + .has-actions { + margin: 0; + } + + .overflow-x-hidden { + overflow-x: hidden !important; + } + + .wrap-wrapper { + white-space: normal !important; + word-break: break-word; + } + + .scroll-wrapper { + overflow-x: auto; + } + + .hide-wrapper { + overflow-x: hidden !important; + } + + .td { + + // padding: 6px 12px; + .text-container:focus-visible, + .text-container:focus, + .text-container:focus-within, + .text-container:hover { + outline: none; + height: 100%; + } + + + &:not(:focus-within):hover { + background: linear-gradient(0deg, var(--interactive-overlays-fill-hover), var(--interactive-overlays-fill-hover)), + } + + + display: flex !important; + + .td-container { + margin-top: auto; + margin-bottom: auto; + } + + .td-container:has(.action-button) { + height: inherit !important; + } + } + + td { + .text-container:focus { + position: absolute; + height: 100%; + overflow-y: scroll; + top: 0; + left: 0; + right: 0; + background: var(--surfaces-surface-01) !important; + box-shadow: rgba(15, 15, 15, 0.05) 0px 0px 0px 1px, + rgba(15, 15, 15, 0.1) 0px 3px 6px, rgba(15, 15, 15, 0.2) 0px 9px 24px; + } + + .text-container:focus-visible, + .text-container:focus, + .text-container:focus-within, + .text-container:hover { + outline: none; + } + + } + + td { + .text-container::-webkit-scrollbar { + background: transparent; + height: 0; + width: 0; + } + } + + td::-webkit-scrollbar { + background: transparent; + height: 0; + width: 0; + } + + td:hover::-webkit-scrollbar { + height: 4px; + width: 4px; + } + + .th { + white-space: normal; + } + } + + .jet-data-table>table:not(.table-resizing) { + + .table-row:hover, + .table-row:focus { + background: var(--slate4, #ECEEF0) !important; + } + } + + .jet-data-table::-webkit-scrollbar { + background: transparent; + } + + .jet-data-table::-webkit-scrollbar-track { + background: transparent; + } + + .jet-data-table:hover { + overflow-x: auto; + overflow-y: auto; + } + + .jet-data-table { + + .th:first-child, + td:first-child { + border-left: none; + } + + .th:last-child, + td:last-child { + border-right: none; + } + + overflow: hidden; + + .form-check { + margin-bottom: 0; + } + + .form-check-inline { + margin-right: 0; + } + + .table-row { + cursor: pointer; + } + + thead { + position: sticky; + top: 0px; + display: inline-block; + + tr { + border-top: none; + } + } + + tbody { + display: inline-block; + } + } + + .jet-data-table { display: inline-block; height: 100%; - position: absolute; - right: 0; - top: 0; - transform: translateX(50%); - z-index: 1; - touch-action: none; - width: 30px; - cursor: ew-resize !important; - border: 0 !important; // overriding the border added in theme.scss - .table-column-resize-handle { + thead { + width: 100%; + + } + + .select-search:not(.is-loading):not(.select-search--multiple) .select-search__value::after { display: none; - width: 10px; - height: 100%; - transform: translateX(50%); + } - &::after { - content: ''; - display: block; - height: 10px; - width: 4px; - background: var(--interactive-overlay-column-resize); - top: 11px; - position: absolute; - left: 3px; - border-radius: 10px; + .custom-select { + .select-search:not(.select-search--multiple) .select-search__select { + top: 0px; + border: solid #9fa0a1 1px; } } - &:hover { - .table-column-resize-handle { - display: block !important; + .tags { + width: 100%; + min-height: 20px; + + .add-tag-button { + display: none; + } + + .tag { + font-weight: 400; + font-size: 0.85rem; + letter-spacing: 0.04em; + text-transform: none; + + .remove-tag-button { + margin-left: 5px; + margin-right: -7px; + display: none; + } + } + + .form-control-plaintext { + font-size: 12px; + } + + .form-control-plaintext:hover, + .form-control-plaintext:focus-visible { + outline: none; + } + } + + .tags:hover { + .add-tag-button { + display: inline-flex; + } + } + + .tag:hover { + .remove-tag-button { + display: inline-flex; + } + } + + .th { + .resizer { + display: inline-block; + height: 100%; + position: absolute; + right: 0; + top: 0; + transform: translateX(50%); + z-index: 1; + touch-action: none; + width: 30px; + cursor: ew-resize !important; + border: 0 !important; // overriding the border added in theme.scss + + .table-column-resize-handle { + display: none; + width: 10px; + height: 100%; + transform: translateX(50%); + + &::after { + content: ''; + display: block; + height: 10px; + width: 4px; + background: var(--interactive-overlay-column-resize); + top: 11px; + position: absolute; + left: 3px; + border-radius: 10px; + } + } + + &:hover { + .table-column-resize-handle { + display: block !important; + } + } + } + + &:last-child { + .resizer { + transform: translateX(0%); + } } } } - &:last-child { - .resizer { - transform: translateX(0%); + // Table set to full width + .jet-data-table thead { + display: flex !important; + + tr { + flex-grow: 1; + + th:last-child { + flex: 1 1 auto !important; + } + } + } + + } + + .jet-data-table { + td { + border-bottom: 1px solid #656d7729; + + // overflow: hidden; + &:hover { + // border: 1px solid var(--slate8); + background-color: var(--slate4); + } + + .invalid-feedback { + height: 22px; + } + + &:has(.invalid-feedback):hover { + border: 1px solid var(--tomato10); + + } + + &:focus-within:not(.has-actions) { + border: 1px solid var(--interactive-overlays-focus-outline); + background-color: var(--surfaces-surface-01) !important; + box-shadow: var(--elevation-200-box-shadow); + + &:has(.long-text-input) { + border: 0; + padding: 0 !important; + overflow: visible !important; + } + } + + .table-column-type-div-element, + .table-column-type-input-element { + &:focus-visible { + border: none !important; + outline: none !important; + } + } + + .table-column-type-input-element { + color: var(--slate12); + } + + .table-column-type-div-element { + display: flex; + align-items: center; + } + + &.has-textarea { + overflow: hidden; + + .table-column-type-div-element { + display: flex; + height: 100%; + } + } + + } + + //for select column type + .td.has-dropdown, + td.has-multiselect { + .select-search-input { + //old dropdown + border: 0; + background: transparent; + } + } + + .td.has-badge, + .td.has-tags, + .td.has-badge, + .td.has-link, + .td.has-radio, + .td.has-dropdown, + .td.has-multiselect, + td.has-toggle { + background-color: inherit; + } + + .td.has-select { + .react-select__control { + border: none !important; + background: inherit !important; + } + + .table-select-search { + height: 100%; + display: flex; + align-items: center; + width: 100%; + + .react-select__control { + height: 100%; + display: flex; + align-items: center; + width: 100%; + + .react-select__value-container { + display: flex; + align-items: center; + padding: 0px; + } + + .react-select__value-container--is-multi { + flex-flow: wrap; + gap: 4px; + max-height: 100%; + } + } + + .react-select__indicators { + display: flex; + align-items: center; + height: 100%; + } + + .react-select__dropdown-indicator { + svg { + background-color: var(--slate7) !important; + padding: 2px !important; + border-radius: 4px !important; + + path { + fill: var(--slate11) !important + } + } + } + } + + &:focus-within { + border: 1px solid var(--indigo9) !important; + background-color: var(--indigo1) !important; + } } } @@ -892,153 +1015,6 @@ } - -.jet-data-table { - .table { - .td { - - border-bottom: 1px solid #656d7729; - - // overflow: hidden; - &:hover { - // border: 1px solid var(--slate8); - background-color: var(--slate4); - } - - .invalid-feedback { - height: 22px; - } - - &:has(.invalid-feedback):hover { - border: 1px solid var(--tomato10); - - } - - &:focus-within:not(.has-actions) { - border: 1px solid var(--interactive-overlays-focus-outline); - background-color: var(--surfaces-surface-01) !important; - box-shadow: var(--elevation-200-box-shadow); - - &:has(.long-text-input) { - border: 0; - padding: 0 !important; - overflow: visible !important; - } - } - - .table-column-type-div-element, - .table-column-type-input-element { - &:focus-visible { - border: none !important; - outline: none !important; - } - } - - .table-column-type-input-element { - color: var(--slate12); - } - - .table-column-type-div-element { - display: flex; - align-items: center; - } - - &.has-textarea { - overflow: hidden; - - .table-column-type-div-element { - display: flex; - height: 100%; - } - } - - } - - //for select column type - .td.has-dropdown, - td.has-multiselect { - .select-search-input { - //old dropdown - border: 0; - background: transparent; - } - } - - .td.has-badge, - .td.has-tags, - .td.has-badge, - .td.has-link, - .td.has-radio, - .td.has-dropdown, - .td.has-multiselect, - td.has-toggle { - background-color: inherit; - } - - .td.has-select { - .react-select__control { - border: none !important; - background: inherit !important; - } - - .table-select-search { - height: 100%; - display: flex; - align-items: center; - width: 100%; - - .react-select__control { - height: 100%; - display: flex; - align-items: center; - width: 100%; - - .react-select__value-container { - display: flex; - align-items: center; - padding: 0px; - } - - .react-select__value-container--is-multi { - flex-flow: wrap; - gap: 4px; - max-height: 100%; - } - } - - .react-select__indicators { - display: flex; - align-items: center; - height: 100%; - } - - .react-select__dropdown-indicator { - svg { - background-color: var(--slate7) !important; - padding: 2px !important; - border-radius: 4px !important; - - path { - fill: var(--slate11) !important - } - } - } - } - - &:focus-within { - border: 1px solid var(--indigo9) !important; - background-color: var(--indigo1) !important; - - .table-select-search { - .react-select__indicators { - // display: none !important; - } - } - } - } - } -} - .table-select-column-type-search-box-wrapper { border-bottom: 1px solid var(--slate4); display: flex; @@ -1467,11 +1443,12 @@ } .tj-table-tag-col-readonly { - margin-left: -2px !important; //this -ve margin offset for the margin given to each tags in overall column width + margin-left: -2px !important; //this -ve margin offset for the margin given to each tags in overall column width } .jet-data-table { .table-bordered { + th, td { border-bottom: 1px solid var(--interactive-overlay-border-pressed) !important; @@ -1488,25 +1465,35 @@ thead th { border-top: none !important; - + &:first-child { border-left: none !important; } - + &:last-child { border-right: none !important; } } } + .table-striped> :not(caption)>* { + border-width: 0px; + } + + .table-bordered> :not(caption)>* { + border-width: 0px; + } + .table-striped { tbody { - div[data-index]:nth-child(odd) { + tr[data-index]:nth-child(odd) { background-color: transparent !important; } - div[data-index]:nth-child(even) { + tr[data-index]:nth-child(even) { background-color: var(--slate2) !important; + --tblr-table-accent-bg: none; + color: inherit !important; } } } @@ -1516,6 +1503,7 @@ .jet-data-table { overflow: auto; } + // hide scrollbar on touch devices .jet-data-table::-webkit-scrollbar { width: 0; @@ -1523,3 +1511,13 @@ background: transparent; } } + +.table-pagination-btn { + min-width: 28px; + width: 28px; + height: 28px; + padding: 7px; + border-radius: 6px; + display: flex; + justify-content: center; +} \ No newline at end of file diff --git a/frontend/src/_styles/tabler.scss b/frontend/src/_styles/tabler.scss index 34afb6bd0e..086712dfa5 100644 --- a/frontend/src/_styles/tabler.scss +++ b/frontend/src/_styles/tabler.scss @@ -6126,11 +6126,22 @@ fieldset:disabled .btn { vertical-align: text-bottom; border: 2px solid currentColor; border-right-color: transparent; - border-radius: 50%; + border-radius: 50%; -webkit-animation: .75s linear infinite spinner-border; animation: .75s linear infinite spinner-border } +.spinner-border-filepicker { + display: inline-block; + width: 1.5rem; + height: 1.5rem; + vertical-align: text-bottom; + border: 2px solid var(--primary-brand); + border-right-color: transparent; + border-radius: 50%; + -webkit-animation: .75s linear infinite spinner-border; + animation: .75s linear infinite spinner-border +} .spinner-light { color: var(--indigo9) !important; } diff --git a/frontend/src/_styles/theme.scss b/frontend/src/_styles/theme.scss index c423bf5a85..4fd1083987 100644 --- a/frontend/src/_styles/theme.scss +++ b/frontend/src/_styles/theme.scss @@ -346,9 +346,9 @@ button { } .accordion-item-trigger { - background-image: url('data:image/svg+xml,') !important; - height: 16px !important; - width: 16px !important; + background-image: url('data:image/svg+xml,') !important; + height: 12px !important; + width: 12px !important; background-position: center; background-repeat: no-repeat; background-size: cover; @@ -1543,7 +1543,7 @@ button { .tab-content { overflow-y: auto; // TAB HEADER HEIGHT + FOOTER HEIGHT + Extra padding = 120px - height: calc(100vh - 7.5rem); + height: calc(100vh - 10.4rem); // Hide scrollbar -ms-overflow-style: none; /* IE and Edge */ @@ -1654,7 +1654,7 @@ button { .pagination { .page-item.active { a.page-link { - background-color: $primary-light; + background-color: var(--primary-brand); } } } @@ -2475,32 +2475,32 @@ body { .CalendarDay__selected, .CalendarDay__selected:active, .CalendarDay__selected:hover { - background: $primary; - border: 1px double $primary; + background: var(--primary-brand); + border: 1px double var(--primary-brand); } .CalendarDay__selected_span { - background: $primary; - border: $primary; + background: var(--primary-brand); + border: var(--primary-brand); } .CalendarDay__selected_span:active, .CalendarDay__selected_span:hover { - background: $primary; - border: 1px double $primary; + background: var(--primary-brand); + border: 1px double var(--primary-brand); color: #ffffff; } .CalendarDay__hovered_span:active, .CalendarDay__hovered_span:hover { - background: $primary; - border: 1px double $primary; + background: var(--primary-brand); + border: 1px double var(--primary-brand); color: #ffffff; } .CalendarDay__hovered_span { - background: #83b8e7; - border: 1px double #83b8e7; + background: var(--primary-brand); + border: 1px double var(--primary-brand); color: #ffffff; } @@ -3866,7 +3866,7 @@ input[type="text"] { } .react-datepicker__day--selected { - background-color: $primary-light; + background-color: var(--primary-brand); } } @@ -4119,6 +4119,8 @@ input[type="text"] { .rbc-event-label { display: none; } + background-color: var(--primary-brand) !important; + border: transparent } .rbc-off-range-bg { @@ -4410,6 +4412,15 @@ input[type="text"] { } } +.color-icon { + width: 18px; + height: 18px; + border-radius: 6px; + background-color: #0091FF; + border: 1px solid var(--Border-default, #CCD1D5); + box-shadow: 0px 1px 0px 0px #e5e5e5; +} + .portal-header { display: flex; align-items: center; @@ -7157,8 +7168,6 @@ tbody { } .link-widget { - display: flex; - align-items: center; overflow: auto; &.hover { @@ -15768,6 +15777,11 @@ tbody { /* Set the desired width */ } +textarea.tj-text-input-widget{ + resize: none !important; + overflow-y: auto !important; +} + .tj-text-input-widget { border: 1px solid var(--borders-default); background-color: var(--surfaces-surface-01); @@ -15779,7 +15793,7 @@ tbody { background-color: var(--surfaces-surface-03); } - &:hover:not(:focus) { + &:hover:not(:focus):not([data-ignore-hover="true"]) { border: 1px solid var(--tblr-input-border-color-darker) !important; } @@ -15857,6 +15871,7 @@ tbody { } .rest-api-options-codehinter { + height: 100%; .cm-content>.cm-line { // max-width: 357px !important; } @@ -18610,6 +18625,192 @@ section.ai-message-prompt-input-wrapper { flex-grow: 1; } } + + +.codebuilder-color-swatches-wrapper { + min-width: 231.333px; + width: 100%; + height: 48px; + padding: 8px; + + + .codebuilder-color-swatches { + display: flex; + padding: 2px; + flex-wrap: wrap; + + .ToggleGroup { + width: 100%; + height: 100%; + } + } + +} + +.codebuilder-color-swatches-options { + width:100%; + height:30px; + padding: 6px 8px; + border-radius: 6px; + + &:hover { + background-color: #f0f1f2 !important; + } + + .color-icon { + width: 18px; + height: 18px; + border-radius: 4px; + border: 1.5px solid #CCD1D5; + background-color: #0091FF; + } +} + + +.theme-dropdown-wrapper { + gap: 75px; + height: 32px; + margin-bottom: 20px !important; + justify-content: space-between; +} + +.theme-custom-menu-list-header { + margin: 16px 14px 0px 16px !important; + font-size: 12px; +} + +.theme-create-btn { + width: 100%; + margin-bottom: 8px; + height:32px; + color:#000; + border: 1px solid var(--Border-brand-weak, #97AEFC); +} + + +.theme-default-pill { + font-size: 11px; + background-color: #CCD1D54D; + color: #6A727C; + width: 49px; + height: 18px; + border-radius: 20px +} + +.no-scroll { + overflow: hidden; +} + + +.textarea-widget:focus { + border-color: var(--primary-brand); +} + +.multiselct-widget-option{ + input:checked { + background-color: var(--primary-brand); + } +} + +.multiselect-box { + .options{ + input:checked { + background-color: var(--primary-brand); + } + } +} + +.timer-btn { + background-color: var(--primary-brand); + &:hover { + background-color: var(--primary-brand); + } +} + +.timer-btn-hover:hover { + background-color: var(--primary-brand); +} + +.canvas-styles-header { + display: flex; + width: 100%; + padding: 6px 16px; + font-family: IBM Plex Sans; + font-size: 12px; + font-weight: 500; + line-height: 20px; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + background: var(--Background-surface-layer-02, #F6F8FA); + color: #6A727C; + + +} + +.app-export-btn { + background-color: #FFFFFF; + border: 1px solid var(--Border-default, #CCD1D5); + box-shadow: 0px 1px 0px 0px var(--Dropshadow000); +} + +.dark-theme { + .app-export-btn { + background-color: #313b46; + color: #ffffff; + border: 1px solid transparent; + } + .canvas-styles-header { + background-color: #212325; + color: #ffffff; + } +} + +.dark-theme { + .codebuilder-color-swatches-options:hover { + background-color: #313b46 !important; + } +} + +.codebuilder-color-picker { + .sketch-picker { + border: none !important; + } +} + +.accordion-button.inspector { + width: 300; + height: 32px; + justify-content: space-between; + padding-top: 6px; + padding-right: 16px; + padding-bottom: 6px; + padding-left: 16px; + border-bottom-width: 1px; + font-family: IBM Plex Sans; + font-weight: 500; + font-size: 12px; + line-height: 20px; + letter-spacing: 0%; + background: var(--Background-surface-layer-02, #F6F8FA); + color: var(--Text-placeholder, #6A727C) !important; + +} + +.dark-theme { + .accordion-button.inspector { + background: var(--slate3); + color: var(--slate12); + } +} + +#inspector-tabpane-properties .accordion-header { + height:32px; +} +.cm-tooltip { + z-index: 9999 !important; +} + .workspace-constant-value { position: relative; @@ -18658,3 +18859,20 @@ section.ai-message-prompt-input-wrapper { } } } + +.phone-input-widget { + .tj-text-input-widget.is-invalid { + border-left: none !important; + } + + input[type="tel"] { + border-top-left-radius: '0px' !important; + border-bottom-left-radius: '0px' !important; + } +} + +.single-line-codehinter-input { + .cm-editor { + max-height: 100px !important; + } +} \ No newline at end of file diff --git a/frontend/src/_ui/Icon/bulkIcons/Planet.jsx b/frontend/src/_ui/Icon/bulkIcons/Planet.jsx new file mode 100644 index 0000000000..0606a7b3e1 --- /dev/null +++ b/frontend/src/_ui/Icon/bulkIcons/Planet.jsx @@ -0,0 +1,27 @@ +import React from 'react'; + +const Globe = ({ fill = '#C1C8CD', width = '25', className = '', viewBox = '0 0 25 25' }) => ( + + + + + +); + +export default Globe; diff --git a/frontend/src/_ui/Icon/bulkIcons/index.js b/frontend/src/_ui/Icon/bulkIcons/index.js index 5936461f90..0a0930c179 100644 --- a/frontend/src/_ui/Icon/bulkIcons/index.js +++ b/frontend/src/_ui/Icon/bulkIcons/index.js @@ -118,6 +118,7 @@ import Lock from './Lock.jsx'; import AddTemplate from './AddTemplate.jsx'; import InviteCollaborator from './InviteCollabarator.jsx'; import CloseIcon from './CloseIcon.jsx'; +import Planet from './Planet.jsx'; const Icon = (props) => { switch (props.name) { @@ -361,7 +362,8 @@ const Icon = (props) => { return ; case 'checkcircle': return ; - + case 'planet': + return ; default: return ; } diff --git a/frontend/src/_ui/Icon/solidIcons/Code.jsx b/frontend/src/_ui/Icon/solidIcons/Code.jsx new file mode 100644 index 0000000000..d4022f94d0 --- /dev/null +++ b/frontend/src/_ui/Icon/solidIcons/Code.jsx @@ -0,0 +1,21 @@ +import React from 'react'; + +const Code = ({ fill = 'var(--purple11)', width = '25', className = '', viewBox = '0 0 25 25' }) => ( + + + +); + +export default Code; diff --git a/frontend/src/_ui/Icon/solidIcons/index.js b/frontend/src/_ui/Icon/solidIcons/index.js index 34a2410e1d..02ef072f4a 100644 --- a/frontend/src/_ui/Icon/solidIcons/index.js +++ b/frontend/src/_ui/Icon/solidIcons/index.js @@ -229,6 +229,7 @@ import CalendarSmall from './CalendarSmall.jsx'; import UserGroupsGrey from './UserGroupsGrey.jsx'; import AppLimitSvg from './AppLimitSvg.jsx'; import NewTabSmall from './NewTabSmall.jsx'; +import Code from './Code.jsx'; const Icon = (props) => { switch (props.name) { @@ -308,6 +309,8 @@ const Icon = (props) => { return ; case 'clearrectangle': return ; + case 'code': + return ; case 'clock': return ; case 'column': diff --git a/frontend/src/_ui/Label.jsx b/frontend/src/_ui/Label.jsx index 721ac05203..443f4ddc6e 100644 --- a/frontend/src/_ui/Label.jsx +++ b/frontend/src/_ui/Label.jsx @@ -13,7 +13,7 @@ function Label({ label, width, labelRef, color, defaultAlignment, direction, aut justifyContent: direction == 'right' ? 'flex-end' : 'flex-start', fontSize: '12px', height: defaultAlignment === 'top' && '20px', - overflow: 'hidden', + overflow: auto ? 'visible' : 'hidden', }} >

{ +const CheckIcon = ({ size, fill = 'white' }) => { const className = size === 'large' ? 'tw-h-[20px] tw-w-[20px]' : 'tw-h-[16px] tw-w-[16px]'; return ( { fillRule="evenodd" clipRule="evenodd" d="M8.93064 0.811811C9.20532 1.03656 9.24581 1.44146 9.02106 1.71616L4.64307 7.12414C3.98209 8.00969 3.34866 7.75601 2.80188 7.27755L1.05248 5.74684C0.785368 5.5131 0.758301 5.10709 0.992027 4.83998C1.22575 4.57286 1.63177 4.54579 1.89888 4.77952L3.64828 6.31027L8.02628 0.902247C8.25102 0.627539 8.6559 0.58705 8.93064 0.811811Z" - fill="white" + fill={fill} /> ); diff --git a/frontend/src/modules/Appbuilder/components/ColorSwatches/ColorSwatches.jsx b/frontend/src/modules/Appbuilder/components/ColorSwatches/ColorSwatches.jsx new file mode 100644 index 0000000000..bf0839f842 --- /dev/null +++ b/frontend/src/modules/Appbuilder/components/ColorSwatches/ColorSwatches.jsx @@ -0,0 +1,9 @@ +import React from 'react'; +import { withEditionSpecificComponent } from '@/modules/common/helpers'; +import BaseColorSwatches from '@/modules/common/components/BaseColorSwatches'; + +const ColorSwatches = (props) => { + return ; +}; + +export default withEditionSpecificComponent(ColorSwatches, 'Appbuilder'); diff --git a/frontend/src/modules/Appbuilder/components/ColorSwatches/index.js b/frontend/src/modules/Appbuilder/components/ColorSwatches/index.js new file mode 100644 index 0000000000..97c38817ea --- /dev/null +++ b/frontend/src/modules/Appbuilder/components/ColorSwatches/index.js @@ -0,0 +1 @@ +export { default } from './ColorSwatches'; diff --git a/frontend/src/modules/Appbuilder/components/ThemeSelect/ThemeSelect.jsx b/frontend/src/modules/Appbuilder/components/ThemeSelect/ThemeSelect.jsx new file mode 100644 index 0000000000..dcf433452e --- /dev/null +++ b/frontend/src/modules/Appbuilder/components/ThemeSelect/ThemeSelect.jsx @@ -0,0 +1,6 @@ +import React from 'react'; +import { withEditionSpecificComponent } from '@/modules/common/helpers'; +const ThemeSelect = () => { + return <>; +}; +export default withEditionSpecificComponent(ThemeSelect, 'Appbuilder'); diff --git a/frontend/src/modules/Appbuilder/components/ThemeSelect/index.js b/frontend/src/modules/Appbuilder/components/ThemeSelect/index.js new file mode 100644 index 0000000000..59a41175bf --- /dev/null +++ b/frontend/src/modules/Appbuilder/components/ThemeSelect/index.js @@ -0,0 +1 @@ +export { default } from './ThemeSelect'; diff --git a/frontend/src/modules/Appbuilder/components/index.js b/frontend/src/modules/Appbuilder/components/index.js index 4adb32d020..b1778f177f 100644 --- a/frontend/src/modules/Appbuilder/components/index.js +++ b/frontend/src/modules/Appbuilder/components/index.js @@ -2,5 +2,7 @@ import CreateVersionModal from './CreateVersionModal'; import PromoteReleaseButton from './PromoteReleaseButton'; import LogoNavDropdown from './LogoNavDropdown'; import AppEnvironments from './AppEnvironments'; +import ThemeSelect from './ThemeSelect'; +import ColorSwatches from './ColorSwatches'; -export { CreateVersionModal, PromoteReleaseButton, LogoNavDropdown, AppEnvironments }; +export { CreateVersionModal, PromoteReleaseButton, LogoNavDropdown, AppEnvironments, ThemeSelect, ColorSwatches }; diff --git a/frontend/src/modules/WorkspaceSettings/components/BaseSSOConfigurationList/Configuration.scss b/frontend/src/modules/WorkspaceSettings/components/BaseSSOConfigurationList/Configuration.scss index 70d3b05ea2..666b828022 100644 --- a/frontend/src/modules/WorkspaceSettings/components/BaseSSOConfigurationList/Configuration.scss +++ b/frontend/src/modules/WorkspaceSettings/components/BaseSSOConfigurationList/Configuration.scss @@ -297,10 +297,18 @@ input:checked+.slider:before { } } + + + .theme-dark { .form-control { background-color: unset !important; } + + .react-tel-input .form-control { + background-color: inherit !important; // Or any default value you prefer + } + } .dark-theme { diff --git a/frontend/src/modules/common/components/BaseColorSwatches/BaseColorSwatches.jsx b/frontend/src/modules/common/components/BaseColorSwatches/BaseColorSwatches.jsx new file mode 100644 index 0000000000..e616f718ed --- /dev/null +++ b/frontend/src/modules/common/components/BaseColorSwatches/BaseColorSwatches.jsx @@ -0,0 +1,144 @@ +import React, { useState } from 'react'; +import { SketchPicker } from 'react-color'; +import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; +import Popover from 'react-bootstrap/Popover'; +import classNames from 'classnames'; +import { computeColor } from '@/_helpers/utils'; + +const BaseColorSwatches = ({ + value, + onChange, + pickerStyle = {}, + colorMap = {}, + cyLabel, + asBoxShadowPopover = true, + meta, + outerWidth = '142px', + component, + styleDefinition, + componentType = 'color', + CustomOptionList = () => {}, + SwatchesToggle = () => {}, +}) => { + value = component == 'Button' ? computeColor(styleDefinition, value, meta) : value; + const [showPicker, setShowPicker] = useState(false); + const darkMode = localStorage.getItem('darkMode') === 'true'; + const colorPickerPosition = meta?.colorPickerPosition ?? ''; + const coverStyles = { + position: 'fixed', + top: '0px', + right: '0px', + bottom: '0px', + left: '0px', + }; + const outerStyles = { + width: outerWidth, + height: '32px', + borderRadius: ' 6px', + border: 'none', + display: 'flex', + paddingLeft: '4px', + alignItems: 'center', + gap: '4px', + background: showPicker && 'var(--indigo2)', + outline: showPicker && '1px solid var(--indigo9)', + boxShadow: showPicker && '0px 0px 0px 1px #C6D4F9', + }; + + const decimalToHex = (alpha) => { + let aHex = Math.round(255 * alpha).toString(16); + return alpha === 0 ? '00' : aHex.length < 2 ? `0${aHex}` : aHex; + }; + const handleColorChange = (color) => { + const hexCode = `${color.hex}${decimalToHex(color?.rgb?.a ?? 1.0)}`; + onChange(hexCode); + }; + const eventPopover = () => { + return ( + + + <>{ColorPicker()} + + + ); + }; + + const ColorPicker = () => { + return ( +

+ {SwatchesToggle()} + {showPicker && componentType === 'swatches' && CustomOptionList()} + {showPicker && componentType === 'color' && ( +
+ {/*
setShowPicker(false)} /> */} +
+ setShowPicker(true)} + color={value} + onChangeComplete={handleColorChange} + style={{ bottom: 0 }} + /> +
+
+ )} +
+ ); + }; + const ColorPickerInputBox = () => { + return ( +
setShowPicker(true)} + data-cy={`${String(cyLabel)}-picker`} + style={outerStyles} + > +
+ +
+ {colorMap?.[value] + ? 'Brand/' + colorMap?.[value]?.charAt(0).toUpperCase() + colorMap?.[value]?.slice(1) + : value} +
+
+ ); + }; + + return ( +
+
+
+ {!asBoxShadowPopover ? ( + <> + {ColorPicker()} + {ColorPickerInputBox()} + + ) : ( + { + setShowPicker(showPicker); + }} + show={showPicker} + trigger="click" + placement={!colorPickerPosition ? 'bottom' : colorPickerPosition} + flip={true} + fallbackPlacements={['top', 'left']} + rootClose={true} + overlay={eventPopover()} + > + {ColorPickerInputBox()} + + )} +
+
+
+ ); +}; + +export default BaseColorSwatches; diff --git a/frontend/src/modules/common/components/BaseColorSwatches/index.js b/frontend/src/modules/common/components/BaseColorSwatches/index.js new file mode 100644 index 0000000000..ce3bd7aea7 --- /dev/null +++ b/frontend/src/modules/common/components/BaseColorSwatches/index.js @@ -0,0 +1 @@ +export { default } from './BaseColorSwatches'; diff --git a/frontend/src/modules/common/components/index.js b/frontend/src/modules/common/components/index.js index 59aea3306a..1261db54ec 100644 --- a/frontend/src/modules/common/components/index.js +++ b/frontend/src/modules/common/components/index.js @@ -25,6 +25,7 @@ import EditRoleErrorModal from './ErrorModal'; import BaseOnboardingQuestions from './BaseOnboardingQuestions'; import BaseSetupAdminPage from './BaseSetupAdminPage'; import UsersTable from './UsersTable'; +import BaseColorSwatches from './BaseColorSwatches'; export { FormTextInput, @@ -32,6 +33,7 @@ export { GeneralFeatureImage, SubmitButton, FormHeader, + BaseColorSwatches, EmailComponent, FormDescription, SSOAuthModule, diff --git a/server/.version b/server/.version index 19811903a7..a5c4c76339 100644 --- a/server/.version +++ b/server/.version @@ -1 +1 @@ -3.8.0 +3.9.0 diff --git a/server/data-migrations/1736448327127-MoveVisibilityDisabledStatesToPropertiesTextarea.ts b/server/data-migrations/1736448327127-MoveVisibilityDisabledStatesToPropertiesTextarea.ts new file mode 100644 index 0000000000..7fbbc29ad9 --- /dev/null +++ b/server/data-migrations/1736448327127-MoveVisibilityDisabledStatesToPropertiesTextarea.ts @@ -0,0 +1,64 @@ +import { Component } from 'src/entities/component.entity'; +import { processDataInBatches } from '@helpers/migration.helper'; +import { EntityManager, MigrationInterface, QueryRunner } from 'typeorm'; + +export class MoveVisibilityDisabledStatesToPropertiesTextarea1736448327127 implements MigrationInterface { + public async up(queryRunner: QueryRunner): Promise { + const batchSize = 100; + const entityManager = queryRunner.manager; + + await processDataInBatches( + entityManager, + async (entityManager: EntityManager) => { + return await entityManager.find(Component, { + where: { type: 'TextArea' }, + order: { createdAt: 'ASC' }, + }); + }, + async (entityManager: EntityManager, components: Component[]) => { + await this.processUpdates(entityManager, components); + }, + batchSize + ); + } + + private async processUpdates(entityManager, components) { + for (const component of components) { + const properties = component.properties; + const styles = component.styles; + const general = component.general; + const generalStyles = component.generalStyles; + const validation = component.validation; + + if (styles.visibility) { + properties.visibility = styles?.visibility; + delete styles?.visibility; + } + + if (styles.disabledState) { + properties.disabledState = styles?.disabledState; + delete styles?.disabledState; + } + + if (generalStyles?.boxShadow) { + styles.boxShadow = generalStyles?.boxShadow; + delete generalStyles?.boxShadow; + } + + // Label and value + if (properties.label == undefined || null) { + properties.label = ''; + } + + await entityManager.update(Component, component.id, { + properties, + styles, + general, + generalStyles, + validation, + }); + } + } + + public async down(queryRunner: QueryRunner): Promise {} +} diff --git a/server/src/modules/apps/services/widget-config/button.js b/server/src/modules/apps/services/widget-config/button.js index 73b4a03bd4..d5b6a58214 100644 --- a/server/src/modules/apps/services/widget-config/button.js +++ b/server/src/modules/apps/services/widget-config/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', @@ -132,10 +132,7 @@ export const buttonConfig = { borderRadius: { type: 'numberInput', displayName: 'Border radius', - validation: { - validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] } }, - defaultValue: false, - }, + validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: false }, accordian: 'button', }, boxShadow: { @@ -222,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/server/src/modules/apps/services/widget-config/buttonGroup.js b/server/src/modules/apps/services/widget-config/buttonGroup.js index c0fa889dd5..10468038af 100644 --- a/server/src/modules/apps/services/widget-config/buttonGroup.js +++ b/server/src/modules/apps/services/widget-config/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,33 @@ 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 +163,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/server/src/modules/apps/services/widget-config/chart.js b/server/src/modules/apps/services/widget-config/chart.js index 72ab688056..81dbd2547a 100644 --- a/server/src/modules/apps/services/widget-config/chart.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/checkbox.js b/server/src/modules/apps/services/widget-config/checkbox.js index c9b6424020..ca509979cb 100644 --- a/server/src/modules/apps/services/widget-config/checkbox.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/circularProgressbar.js b/server/src/modules/apps/services/widget-config/circularProgressbar.js index a7ffd551af..2babc27a12 100644 --- a/server/src/modules/apps/services/widget-config/circularProgressbar.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/colorPicker.js b/server/src/modules/apps/services/widget-config/colorPicker.js index b2fddd7e4c..6ecdede1a8 100644 --- a/server/src/modules/apps/services/widget-config/colorPicker.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/container.js b/server/src/modules/apps/services/widget-config/container.js index ec1d5174b0..424b9a801d 100644 --- a/server/src/modules/apps/services/widget-config/container.js +++ b/server/src/modules/apps/services/widget-config/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/currencyinput.js b/server/src/modules/apps/services/widget-config/currencyinput.js new file mode 100644 index 0000000000..64a8f2df57 --- /dev/null +++ b/server/src/modules/apps/services/widget-config/currencyinput.js @@ -0,0 +1,305 @@ +export const currencyinputConfig = { + name: 'CurrencyInput', + displayName: 'Currency Input', + description: 'Currency input field', + component: 'CurrencyInput', + 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 number', + }, + }, + value: { + type: 'code', + displayName: 'Default value', + validation: { + schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, + defaultValue: 0, + }, + }, + decimalPlaces: { + type: 'code', + displayName: 'Decimal places', + validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: '2' }, + }, + isCountryChangeEnabled: { + type: 'toggle', + displayName: 'Enable currency 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}$' }, + 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: { + 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: '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: '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}}' }, + }, + properties: { + value: { value: '0' }, + label: { value: 'Label' }, + placeholder: { value: 'Enter amount' }, + visibility: { value: '{{true}}' }, + disabledState: { value: '{{false}}' }, + loadingState: { value: '{{false}}' }, + tooltip: { value: '' }, + isCountryChangeEnabled: { value: '{{true}}' }, + decimalPlaces: { value: '2' }, + }, + events: [], + styles: { + 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/server/src/modules/apps/services/widget-config/datepickerV2.js b/server/src/modules/apps/services/widget-config/datepickerV2.js index 87de5d137b..ea56598d2e 100644 --- a/server/src/modules/apps/services/widget-config/datepickerV2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/daterangepicker.js b/server/src/modules/apps/services/widget-config/daterangepicker.js index 1f38a8df6d..2fcd5bfb42 100644 --- a/server/src/modules/apps/services/widget-config/daterangepicker.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/datetimepickerV2.js b/server/src/modules/apps/services/widget-config/datetimepickerV2.js index 388eb9786c..658cc31c01 100644 --- a/server/src/modules/apps/services/widget-config/datetimepickerV2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/divider.js b/server/src/modules/apps/services/widget-config/divider.js index 045f894816..3905c7583d 100644 --- a/server/src/modules/apps/services/widget-config/divider.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/dropdown.js b/server/src/modules/apps/services/widget-config/dropdown.js index b2c58acc7a..b8b090af24 100644 --- a/server/src/modules/apps/services/widget-config/dropdown.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/dropdownV2.js b/server/src/modules/apps/services/widget-config/dropdownV2.js index de90dbd0bf..588bc655c6 100644 --- a/server/src/modules/apps/services/widget-config/dropdownV2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/emailinput.js b/server/src/modules/apps/services/widget-config/emailinput.js new file mode 100644 index 0000000000..825340616f --- /dev/null +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/form.js b/server/src/modules/apps/services/widget-config/form.js index 2d8eb7f0a8..4feca316c0 100644 --- a/server/src/modules/apps/services/widget-config/form.js +++ b/server/src/modules/apps/services/widget-config/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' }, @@ -403,6 +403,7 @@ export const formConfig = { value: "{{ {title: 'User registration form', properties: {firstname: {type: 'textinput',value: 'Maria',label:'First name', validation:{maxLength:6}, styles: {backgroundColor: '#f6f5ff',textColor: 'black'},},lastname:{type: 'textinput',value: 'Doe', label:'Last name', styles: {backgroundColor: '#f6f5ff',textColor: 'black'},},age:{type:'number', label:'Age'},}, submitButton: {value: 'Submit', styles: {backgroundColor: '#3a433b',borderColor:'#595959'}}} }}", }, + buttonToSubmit: { value: '{{"none"}}' }, showHeader: { value: '{{false}}' }, showFooter: { value: '{{false}}' }, visibility: { value: '{{true}}' }, diff --git a/server/src/modules/apps/services/widget-config/icon.js b/server/src/modules/apps/services/widget-config/icon.js index aea06c976c..761a2da425 100644 --- a/server/src/modules/apps/services/widget-config/icon.js +++ b/server/src/modules/apps/services/widget-config/icon.js @@ -61,7 +61,7 @@ export const iconConfig = { }, styles: { iconColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Color', validation: { schema: { type: 'string' }, diff --git a/server/src/modules/apps/services/widget-config/image.js b/server/src/modules/apps/services/widget-config/image.js index c4bd7b6147..ca74e31d12 100644 --- a/server/src/modules/apps/services/widget-config/image.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/index.js b/server/src/modules/apps/services/widget-config/index.js index bef9a2ea99..fdb4cf26df 100644 --- a/server/src/modules/apps/services/widget-config/index.js +++ b/server/src/modules/apps/services/widget-config/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'; const widgets = { buttonConfig, @@ -73,12 +76,15 @@ const widgets = { datetimePickerV2Config, datePickerV2Config, timePickerConfig, + emailinputConfig, + phoneinputConfig, + currencyinputConfig, checkboxConfig, radiobuttonConfig, //!Depreciated radiobuttonV2Config, toggleswitchConfig, //!Depreciated toggleSwitchV2Config, - textareaConfig, + textareaConfig, //! Deprecated daterangepickerConfig, textConfig, imageConfig, diff --git a/server/src/modules/apps/services/widget-config/kanban.js b/server/src/modules/apps/services/widget-config/kanban.js index 0705581c51..cd39d0bd7b 100644 --- a/server/src/modules/apps/services/widget-config/kanban.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/kanbanBoard.js b/server/src/modules/apps/services/widget-config/kanbanBoard.js index 4929bad9fe..4363c0d0b7 100644 --- a/server/src/modules/apps/services/widget-config/kanbanBoard.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/link.js b/server/src/modules/apps/services/widget-config/link.js index bf419e16c0..16d5f13368 100644 --- a/server/src/modules/apps/services/widget-config/link.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/listview.js b/server/src/modules/apps/services/widget-config/listview.js index d710babbf0..9cef676a85 100644 --- a/server/src/modules/apps/services/widget-config/listview.js +++ b/server/src/modules/apps/services/widget-config/listview.js @@ -13,6 +13,7 @@ export const listviewConfig = { top: 15, left: 3, height: 100, + width: 7, }, properties: ['source'], accessorKey: 'imageURL', @@ -120,7 +121,7 @@ export const listviewConfig = { }, styles: { backgroundColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Background color', validation: { schema: { type: 'string' }, @@ -128,7 +129,7 @@ export const listviewConfig = { }, }, borderColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Border color', validation: { schema: { type: 'string' }, diff --git a/server/src/modules/apps/services/widget-config/modal.js b/server/src/modules/apps/services/widget-config/modal.js index 7716ac8e2c..3443c73c9b 100644 --- a/server/src/modules/apps/services/widget-config/modal.js +++ b/server/src/modules/apps/services/widget-config/modal.js @@ -20,19 +20,6 @@ export const modalConfig = { defaultValue: 'This title can be changed', }, }, - titleAlignment: { - type: 'select', - displayName: 'Title alignment', - options: [ - { name: 'left', value: 'left' }, - { name: 'center', value: 'center' }, - { name: 'right', value: 'right' }, - ], - validation: { - schema: { type: 'string' }, - defaultValue: 'left', - }, - }, loadingState: { type: 'toggle', displayName: 'Loading state', @@ -94,7 +81,7 @@ export const modalConfig = { }, styles: { headerBackgroundColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Header background color', validation: { schema: { type: 'string' }, @@ -102,7 +89,7 @@ export const modalConfig = { }, }, headerTextColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Header title color', validation: { schema: { type: 'string' }, @@ -110,7 +97,7 @@ export const modalConfig = { }, }, bodyBackgroundColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Body background color', validation: { schema: { type: 'string' }, @@ -134,7 +121,7 @@ export const modalConfig = { }, }, triggerButtonBackgroundColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Trigger button background color', validation: { schema: { type: 'string' }, @@ -142,7 +129,7 @@ export const modalConfig = { }, }, triggerButtonTextColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Trigger button text color', validation: { schema: { type: 'string' }, @@ -188,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/server/src/modules/apps/services/widget-config/multiselectV2.js b/server/src/modules/apps/services/widget-config/multiselectV2.js index 6aefd71067..2bc4cae17b 100644 --- a/server/src/modules/apps/services/widget-config/multiselectV2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/numberinput.js b/server/src/modules/apps/services/widget-config/numberinput.js index b0f72e6d81..cba9c04cd1 100644 --- a/server/src/modules/apps/services/widget-config/numberinput.js +++ b/server/src/modules/apps/services/widget-config/numberinput.js @@ -20,10 +20,7 @@ export const numberinputConfig = { value: { type: 'code', displayName: 'Default value', - validation: { - schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, - defaultValue: 0, - }, + validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, defaultValue: 0 }, }, placeholder: { type: 'code', @@ -75,7 +72,7 @@ export const numberinputConfig = { }, styles: { color: { - type: 'color', + type: 'colorSwatches', displayName: 'Text', validation: { schema: { type: 'string' }, defaultValue: '#1B1F24' }, accordian: 'label', @@ -127,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', @@ -164,7 +161,7 @@ export const numberinputConfig = { visibility: false, }, iconColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Icon color', validation: { schema: { type: 'string' }, defaultValue: '#CFD3D859' }, accordian: 'field', @@ -282,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/server/src/modules/apps/services/widget-config/pagination.js b/server/src/modules/apps/services/widget-config/pagination.js index 6fabfa889a..116d0e9849 100644 --- a/server/src/modules/apps/services/widget-config/pagination.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/passwordinput.js b/server/src/modules/apps/services/widget-config/passwordinput.js index 92a4a4711c..fad0d00735 100644 --- a/server/src/modules/apps/services/widget-config/passwordinput.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/phoneinput.js b/server/src/modules/apps/services/widget-config/phoneinput.js new file mode 100644 index 0000000000..83e35ffc68 --- /dev/null +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/radioButtonV2.js b/server/src/modules/apps/services/widget-config/radioButtonV2.js index 2ff6ca6c7c..62a084d75a 100644 --- a/server/src/modules/apps/services/widget-config/radioButtonV2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/radiobutton.js b/server/src/modules/apps/services/widget-config/radiobutton.js index 40c9d3ef5c..66d055ca5e 100644 --- a/server/src/modules/apps/services/widget-config/radiobutton.js +++ b/server/src/modules/apps/services/widget-config/radiobutton.js @@ -1,6 +1,6 @@ export const radiobuttonConfig = { - name: 'RadioButton', - displayName: 'Radio Button', + name: 'RadioButtonLegacy', + displayName: 'Radio Button (Legacy)', description: 'Select one from multiple choices', component: 'RadioButton', defaultSize: { @@ -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: { @@ -97,9 +97,7 @@ export const radiobuttonConfig = { ], }, ], - exposedVariables: { - value: true, - }, + exposedVariables: {}, definition: { others: { showOnDesktop: { value: '{{true}}' }, @@ -115,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/server/src/modules/apps/services/widget-config/rangeslider.js b/server/src/modules/apps/services/widget-config/rangeslider.js index 151dca3384..320e7a6741 100644 --- a/server/src/modules/apps/services/widget-config/rangeslider.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/spinner.js b/server/src/modules/apps/services/widget-config/spinner.js index a6bf80b9be..c38bfdc468 100644 --- a/server/src/modules/apps/services/widget-config/spinner.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/starrating.js b/server/src/modules/apps/services/widget-config/starrating.js index 01240d0369..8cb239133d 100644 --- a/server/src/modules/apps/services/widget-config/starrating.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/statistics.js b/server/src/modules/apps/services/widget-config/statistics.js index d364d78524..ecf1f70aed 100644 --- a/server/src/modules/apps/services/widget-config/statistics.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/steps.js b/server/src/modules/apps/services/widget-config/steps.js index a39c634919..c8b9753d9a 100644 --- a/server/src/modules/apps/services/widget-config/steps.js +++ b/server/src/modules/apps/services/widget-config/steps.js @@ -45,15 +45,15 @@ export const stepsConfig = { }, styles: { color: { - type: 'color', + type: 'colorSwatches', displayName: 'Color', 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/server/src/modules/apps/services/widget-config/svgImage.js b/server/src/modules/apps/services/widget-config/svgImage.js index 315a6e2c28..9780f0cdd6 100644 --- a/server/src/modules/apps/services/widget-config/svgImage.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/table.js b/server/src/modules/apps/services/widget-config/table.js index 735feccbc7..9f0c4fd723 100644 --- a/server/src/modules/apps/services/widget-config/table.js +++ b/server/src/modules/apps/services/widget-config/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' }, @@ -373,7 +373,6 @@ export const tableConfig = { }, maxRowHeightValue: { type: 'tableRowHeightInput', - isFxNotRequired: true, showLabel: false, validation: { schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] }, @@ -405,7 +404,7 @@ export const tableConfig = { accordian: 'Container', }, borderColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Border', validation: { schema: { type: 'string' }, @@ -517,7 +516,7 @@ export const tableConfig = { loadingState: { value: '{{false}}' }, data: { value: - "{{ [ \n\t\t{ id: 1, name: 'Olivia Nguyen', email: 'olivia.nguyen@example.com', date: '15/05/2022', phone: 9876543210, interest: ['Reading', 'Traveling','Photography'], photo: 'https://reqres.in/img/faces/7-image.jpg' }, \n\t\t{ id: 2, name: 'Liam Patel', email: 'liam.patel@example.com', date: '20/09/2021', phone: 8765432109, interest: ['Cooking','Gardening','Hiking'], photo: 'https://reqres.in/img/faces/5-image.jpg' }, \n\t\t{ id: 3, name: 'Sophia Reyes', email: 'sophia.reyes@example.com', date: '01/01/2023', phone: 7654321098, interest: ['Music','Dancing','Crafting'], photo: 'https://reqres.in/img/faces/3-image.jpg' }, \n\t\t{ id: 4, name: 'Jacob Hernandez', email: 'jacob.hernandez@example.com', date: '10/11/2022', phone: 6543210987, interest: ['Reading', 'Traveling', 'Volunteering'], photo: 'https://reqres.in/img/faces/1-image.jpg' }, \n\t\t{ id: 5, name: 'William Sanchez', email: 'william.sanchez@example.com', date: '07/01/2021', phone: 4321098765, interest: ['Music', 'Dancing', 'Hiking'], photo: 'https://reqres.in/img/faces/4-image.jpg' }, \n\t\t{ id: 6, name: 'Ethan Morales', email: 'ethan.morales@example.com', date: '05/11/2021', phone: 2109876543, interest: ['Cooking', 'Traveling', 'Photography'], photo: 'https://reqres.in/img/faces/6-image.jpg' }, \n\t\t{ id: 7, name: 'Mia Tiana', email: 'mia.tiana@example.com', date: '21/11/2022', phone: 1098705217, interest: ['Music', 'Gardening', 'Hiking'], photo: 'https://reqres.in/img/faces/2-image.jpg' }, \n\t\t{ id: 8, name: 'Lucas Ramirez', email: 'lucas.ramirez@example.com', date: '31/03/2023', phone: 9876543210, interest: ['Reading', 'Dancing', 'Crafting'], photo: 'https://reqres.in/img/faces/9-image.jpg' }, \n\t\t{ id: 9, name: 'Alexander Vela', email: 'alexander.vela@example.com', date: '07/09/2022', phone: 7654321098, interest: ['Music','Gardening','Photography'], photo: 'https://reqres.in/img/faces/8-image.jpg' }, \n\t\t{ id: 10, name: 'Michael Reyes', email: 'michael.reyes@example.com', date: '25/12/2021', phone: 5432109876, interest: ['Cooking','Crafting','Volunteering'], photo: 'https://reqres.in/img/faces/10-image.jpg' } \n] }}", + "{{ [ \n\t\t{ id: 1, name: 'Olivia Nguyen', email: 'olivia.nguyen@example.com', date: '15/05/2022', mobile_number: 9876543210, interest: ['Reading', 'Traveling','Photography'], photo: 'https://reqres.in/img/faces/7-image.jpg' }, \n\t\t{ id: 2, name: 'Liam Patel', email: 'liam.patel@example.com', date: '20/09/2021', mobile_number: 8765432109, interest: ['Cooking','Gardening','Hiking'], photo: 'https://reqres.in/img/faces/5-image.jpg' }, \n\t\t{ id: 3, name: 'Sophia Reyes', email: 'sophia.reyes@example.com', date: '01/01/2023', mobile_number: 7654321098, interest: ['Music','Dancing','Crafting'], photo: 'https://reqres.in/img/faces/3-image.jpg' }, \n\t\t{ id: 4, name: 'Jacob Hernandez', email: 'jacob.hernandez@example.com', date: '10/11/2022', mobile_number: 6543210987, interest: ['Reading', 'Traveling', 'Volunteering'], photo: 'https://reqres.in/img/faces/1-image.jpg' }, \n\t\t{ id: 5, name: 'William Sanchez', email: 'william.sanchez@example.com', date: '07/01/2021', mobile_number: 4321098765, interest: ['Music', 'Dancing', 'Hiking'], photo: 'https://reqres.in/img/faces/4-image.jpg' }, \n\t\t{ id: 6, name: 'Ethan Morales', email: 'ethan.morales@example.com', date: '05/11/2021', mobile_number: 2109876543, interest: ['Cooking', 'Traveling', 'Photography'], photo: 'https://reqres.in/img/faces/6-image.jpg' }, \n\t\t{ id: 7, name: 'Mia Tiana', email: 'mia.tiana@example.com', date: '21/11/2022', mobile_number: 1098705217, interest: ['Music', 'Gardening', 'Hiking'], photo: 'https://reqres.in/img/faces/2-image.jpg' }, \n\t\t{ id: 8, name: 'Lucas Ramirez', email: 'lucas.ramirez@example.com', date: '31/03/2023', mobile_number: 9876543210, interest: ['Reading', 'Dancing', 'Crafting'], photo: 'https://reqres.in/img/faces/9-image.jpg' }, \n\t\t{ id: 9, name: 'Alexander Vela', email: 'alexander.vela@example.com', date: '07/09/2022', mobile_number: 7654321098, interest: ['Music','Gardening','Photography'], photo: 'https://reqres.in/img/faces/8-image.jpg' }, \n\t\t{ id: 10, name: 'Michael Reyes', email: 'michael.reyes@example.com', date: '25/12/2021', mobile_number: 5432109876, interest: ['Cooking','Crafting','Volunteering'], photo: 'https://reqres.in/img/faces/10-image.jpg' } \n] }}", }, useDynamicColumn: { value: '{{false}}' }, columnData: { @@ -591,8 +590,8 @@ export const tableConfig = { columnSize: 130, }, { - name: 'phone', - key: 'phone', + name: 'mobile_number', + key: 'mobile_number', id: '9c2e3c40572a4aefb8e179ee39a0e1ac9dc2b2e6634be56e1c05be13c3d1de56', autogenerated: true, fxActiveFields: [], diff --git a/server/src/modules/apps/services/widget-config/tabs.js b/server/src/modules/apps/services/widget-config/tabs.js index a397979a3e..a9c10bebaf 100644 --- a/server/src/modules/apps/services/widget-config/tabs.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/tags.js b/server/src/modules/apps/services/widget-config/tags.js index 8af289b23a..73cd44b550 100644 --- a/server/src/modules/apps/services/widget-config/tags.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/text.js b/server/src/modules/apps/services/widget-config/text.js index ada530d127..8ed1edffd1 100644 --- a/server/src/modules/apps/services/widget-config/text.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/textarea.js b/server/src/modules/apps/services/widget-config/textarea.js index c5e71be77d..d0e0364334 100644 --- a/server/src/modules/apps/services/widget-config/textarea.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/textinput.js b/server/src/modules/apps/services/widget-config/textinput.js index 15a52ea306..e259ecddd0 100644 --- a/server/src/modules/apps/services/widget-config/textinput.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/timeline.js b/server/src/modules/apps/services/widget-config/timeline.js index 6ece608f5c..63776f0b99 100644 --- a/server/src/modules/apps/services/widget-config/timeline.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/timepicker.js b/server/src/modules/apps/services/widget-config/timepicker.js index 79a3d05d4e..a5a1fb6b06 100644 --- a/server/src/modules/apps/services/widget-config/timepicker.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/toggleswitch.js b/server/src/modules/apps/services/widget-config/toggleswitch.js index ec3a97450d..bd646a47f3 100644 --- a/server/src/modules/apps/services/widget-config/toggleswitch.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/toggleswitchv2.js b/server/src/modules/apps/services/widget-config/toggleswitchv2.js index 6753fbb50d..4bc21f3a86 100644 --- a/server/src/modules/apps/services/widget-config/toggleswitchv2.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/treeSelect.js b/server/src/modules/apps/services/widget-config/treeSelect.js index 1d7485b47a..898f0b3ed0 100644 --- a/server/src/modules/apps/services/widget-config/treeSelect.js +++ b/server/src/modules/apps/services/widget-config/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/server/src/modules/apps/services/widget-config/verticalDivider.js b/server/src/modules/apps/services/widget-config/verticalDivider.js index 443526c3b8..e43b81adf7 100644 --- a/server/src/modules/apps/services/widget-config/verticalDivider.js +++ b/server/src/modules/apps/services/widget-config/verticalDivider.js @@ -15,7 +15,7 @@ export const verticalDividerConfig = { events: {}, styles: { dividerColor: { - type: 'color', + type: 'colorSwatches', displayName: 'Divider color', validation: { schema: { type: 'string' },