2024-10-22 08:01:21 +00:00
|
|
|
/* eslint-disable import/no-unresolved */
|
2025-05-16 06:40:38 +00:00
|
|
|
import React, { useEffect, useMemo, useRef, useState, useContext } from 'react';
|
2024-10-22 08:01:21 +00:00
|
|
|
import { PreviewBox } from './PreviewBox';
|
|
|
|
|
import { ToolTip } from '@/Editor/Inspector/Elements/Components/ToolTip';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2025-03-25 23:11:00 +00:00
|
|
|
import { camelCase, isEmpty, noop, get } from 'lodash';
|
2024-10-22 08:01:21 +00:00
|
|
|
import CodeMirror from '@uiw/react-codemirror';
|
|
|
|
|
import { javascript } from '@codemirror/lang-javascript';
|
2025-01-15 12:51:01 +00:00
|
|
|
import {
|
|
|
|
|
autocompletion,
|
|
|
|
|
completionKeymap,
|
|
|
|
|
completionStatus,
|
|
|
|
|
acceptCompletion,
|
|
|
|
|
startCompletion,
|
|
|
|
|
} from '@codemirror/autocomplete';
|
2024-10-22 08:01:21 +00:00
|
|
|
import { defaultKeymap } from '@codemirror/commands';
|
|
|
|
|
import { keymap } from '@codemirror/view';
|
|
|
|
|
import FxButton from '../CodeBuilder/Elements/FxButton';
|
|
|
|
|
import cx from 'classnames';
|
|
|
|
|
import { DynamicFxTypeRenderer } from './DynamicFxTypeRenderer';
|
2025-03-25 23:11:00 +00:00
|
|
|
import { isInsideParent, resolveReferences } from './utils';
|
2024-10-22 08:01:21 +00:00
|
|
|
import { okaidia } from '@uiw/codemirror-theme-okaidia';
|
|
|
|
|
import { githubLight } from '@uiw/codemirror-theme-github';
|
|
|
|
|
import { getAutocompletion } from './autocompleteExtensionConfig';
|
|
|
|
|
import ErrorBoundary from '@/_ui/ErrorBoundary';
|
|
|
|
|
import CodeHinter from './CodeHinter';
|
|
|
|
|
// import { EditorContext } from '../Context/EditorContextWrapper';
|
|
|
|
|
import { removeNestedDoubleCurlyBraces } from '@/_helpers/utils';
|
|
|
|
|
import useStore from '@/AppBuilder/_stores/store';
|
|
|
|
|
import { shallow } from 'zustand/shallow';
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
import { getCssVarValue } from '@/Editor/Components/utils';
|
2025-04-30 03:35:32 +00:00
|
|
|
import { useModuleContext } from '@/AppBuilder/_contexts/ModuleContext';
|
2025-01-20 10:53:37 +00:00
|
|
|
import { CodeHinterContext } from '../CodeBuilder/CodeHinterContext';
|
|
|
|
|
import { createReferencesLookup } from '@/_stores/utils';
|
2025-03-07 10:04:31 +00:00
|
|
|
import { useQueryPanelKeyHooks } from './useQueryPanelKeyHooks';
|
2025-06-27 14:38:15 +00:00
|
|
|
import Icon from '@/_ui/Icon/solidIcons/index';
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
const SingleLineCodeEditor = ({ componentName, fieldMeta = {}, componentId, ...restProps }) => {
|
2025-04-30 03:35:32 +00:00
|
|
|
const { moduleId } = useModuleContext();
|
2025-07-07 09:41:58 +00:00
|
|
|
const { initialValue, onChange, enablePreview = true, portalProps, paramName } = restProps;
|
2024-10-22 08:01:21 +00:00
|
|
|
const { validation = {} } = fieldMeta;
|
2025-02-25 06:52:50 +00:00
|
|
|
const [showPreview, setShowPreview] = useState(false);
|
2024-10-22 08:01:21 +00:00
|
|
|
const [isFocused, setIsFocused] = useState(false);
|
|
|
|
|
const [currentValue, setCurrentValue] = useState('');
|
|
|
|
|
const [errorStateActive, setErrorStateActive] = useState(false);
|
|
|
|
|
const [cursorInsidePreview, setCursorInsidePreview] = useState(false);
|
2025-03-02 21:09:32 +00:00
|
|
|
const [showSuggestions, setShowSuggestions] = useState(true);
|
2025-02-25 06:52:50 +00:00
|
|
|
const validationFn = restProps?.validationFn;
|
2025-04-25 15:42:32 +00:00
|
|
|
const componentDefinition = useStore((state) => state.getComponentDefinition(componentId, moduleId), shallow);
|
2024-11-07 16:10:41 +00:00
|
|
|
const parentId = componentDefinition?.component?.parent;
|
|
|
|
|
const customResolvables = useStore((state) => state.resolvedStore.modules.canvas?.customResolvables, shallow);
|
|
|
|
|
|
|
|
|
|
const customVariables = customResolvables?.[parentId]?.[0] || {};
|
|
|
|
|
|
2025-03-02 21:09:32 +00:00
|
|
|
useEffect(() => {
|
|
|
|
|
const observer = new IntersectionObserver(
|
|
|
|
|
([entry]) => {
|
|
|
|
|
if (entry.intersectionRatio < 1) {
|
|
|
|
|
setShowPreview(false);
|
|
|
|
|
setShowSuggestions(false);
|
|
|
|
|
} else {
|
|
|
|
|
setShowSuggestions(true);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ root: null, threshold: [1] } // Fires when any part of the element is out of view
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (wrapperRef.current) {
|
|
|
|
|
observer.observe(wrapperRef.current);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
|
if (wrapperRef.current) {
|
|
|
|
|
observer.unobserve(wrapperRef.current);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}, []);
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
const isPreviewFocused = useRef(false);
|
|
|
|
|
const wrapperRef = useRef(null);
|
|
|
|
|
|
|
|
|
|
const replaceIdsWithName = useStore((state) => state.replaceIdsWithName, shallow);
|
|
|
|
|
let newInitialValue = initialValue;
|
|
|
|
|
if (typeof initialValue === 'string' && (initialValue?.includes('components') || initialValue?.includes('queries'))) {
|
|
|
|
|
newInitialValue = replaceIdsWithName(initialValue);
|
|
|
|
|
}
|
2025-01-20 10:53:37 +00:00
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
//! Re render the component when the componentName changes as the initialValue is not updated
|
|
|
|
|
|
|
|
|
|
// const { variablesExposedForPreview } = useContext(EditorContext) || {};
|
|
|
|
|
|
|
|
|
|
// const customVariables = variablesExposedForPreview?.[componentId] ?? {};
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (typeof newInitialValue !== 'string') return;
|
|
|
|
|
|
|
|
|
|
// const [valid, _error] = !isEmpty(validation)
|
|
|
|
|
// ? resolveReferences(newInitialValue, validation, customVariables)
|
|
|
|
|
// : [true, null];
|
|
|
|
|
|
2024-11-07 16:10:41 +00:00
|
|
|
//!TODO use the updated new resolver
|
2025-02-25 06:52:50 +00:00
|
|
|
const [valid, _error] =
|
|
|
|
|
!isEmpty(validation) || validationFn
|
|
|
|
|
? resolveReferences(newInitialValue, validation, customVariables, validationFn)
|
|
|
|
|
: [true, null];
|
|
|
|
|
|
|
|
|
|
setErrorStateActive(!valid);
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
setCurrentValue(newInitialValue);
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2025-02-25 06:52:50 +00:00
|
|
|
}, [componentName, newInitialValue, validationFn]);
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const handleClickOutside = (event) => {
|
|
|
|
|
if (cursorInsidePreview || portalProps?.isOpen || event.target.closest('.cm-tooltip-autocomplete')) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (wrapperRef.current && isFocused && !wrapperRef.current.contains(event.target)) {
|
|
|
|
|
isPreviewFocused.current = false;
|
|
|
|
|
setIsFocused(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
document.addEventListener('mousedown', handleClickOutside);
|
|
|
|
|
return () => {
|
|
|
|
|
document.removeEventListener('mousedown', handleClickOutside);
|
|
|
|
|
};
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, [wrapperRef, isFocused, isPreviewFocused, currentValue, portalProps?.isOpen, cursorInsidePreview]);
|
|
|
|
|
|
|
|
|
|
const isWorkspaceVariable =
|
|
|
|
|
typeof currentValue === 'string' && (currentValue.includes('%%client') || currentValue.includes('%%server'));
|
|
|
|
|
|
2025-02-25 06:52:50 +00:00
|
|
|
const previewRef = useRef(null);
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
ref={wrapperRef}
|
|
|
|
|
className="code-hinter-wrapper position-relative"
|
|
|
|
|
style={{ width: '100%', height: restProps?.lang === 'jsx' && '320px' }}
|
|
|
|
|
>
|
|
|
|
|
<PreviewBox.Container
|
2025-02-25 06:52:50 +00:00
|
|
|
previewRef={previewRef}
|
|
|
|
|
showPreview={showPreview}
|
2024-11-07 16:10:41 +00:00
|
|
|
customVariables={customVariables}
|
2024-10-22 08:01:21 +00:00
|
|
|
enablePreview={enablePreview}
|
|
|
|
|
currentValue={currentValue}
|
|
|
|
|
isFocused={isFocused}
|
2025-07-07 09:41:58 +00:00
|
|
|
setIsFocused={setIsFocused}
|
2024-10-22 08:01:21 +00:00
|
|
|
setCursorInsidePreview={setCursorInsidePreview}
|
|
|
|
|
componentName={componentName}
|
|
|
|
|
validationSchema={validation}
|
|
|
|
|
setErrorStateActive={setErrorStateActive}
|
|
|
|
|
ignoreValidation={restProps?.ignoreValidation || isEmpty(validation)}
|
2025-07-07 09:41:58 +00:00
|
|
|
componentId={componentId ?? null}
|
|
|
|
|
fieldMeta={fieldMeta}
|
|
|
|
|
paramName={paramName}
|
2024-10-22 08:01:21 +00:00
|
|
|
isWorkspaceVariable={isWorkspaceVariable}
|
|
|
|
|
errorStateActive={errorStateActive}
|
|
|
|
|
previewPlacement={restProps?.cyLabel === 'canvas-bg-colour' ? 'top' : 'left-start'}
|
|
|
|
|
isPortalOpen={restProps?.portalProps?.isOpen}
|
2025-02-25 06:52:50 +00:00
|
|
|
validationFn={validationFn}
|
2025-07-07 09:41:58 +00:00
|
|
|
onAiSuggestionAccept={(newValue) => {
|
|
|
|
|
setCurrentValue(newValue);
|
|
|
|
|
onChange(newValue);
|
|
|
|
|
}}
|
2024-10-22 08:01:21 +00:00
|
|
|
>
|
|
|
|
|
<div className="code-editor-basic-wrapper d-flex">
|
|
|
|
|
<div className="codehinter-container w-100">
|
|
|
|
|
<SingleLineCodeEditor.Editor
|
2025-02-25 06:52:50 +00:00
|
|
|
previewRef={previewRef}
|
2024-10-22 08:01:21 +00:00
|
|
|
currentValue={currentValue}
|
|
|
|
|
setCurrentValue={setCurrentValue}
|
|
|
|
|
isFocused={isFocused}
|
|
|
|
|
setFocus={setIsFocused}
|
|
|
|
|
validationType={validation?.schema?.type}
|
|
|
|
|
onBlurUpdate={onChange}
|
|
|
|
|
error={errorStateActive}
|
|
|
|
|
cyLabel={restProps.cyLabel}
|
|
|
|
|
portalProps={portalProps}
|
|
|
|
|
componentName={componentName}
|
2025-02-25 06:52:50 +00:00
|
|
|
setShowPreview={setShowPreview}
|
|
|
|
|
showPreview={showPreview}
|
2025-03-25 23:11:00 +00:00
|
|
|
wrapperRef={wrapperRef}
|
2025-03-02 21:09:32 +00:00
|
|
|
showSuggestions={showSuggestions}
|
2025-07-07 09:41:58 +00:00
|
|
|
cursorInsidePreview={cursorInsidePreview}
|
2024-10-22 08:01:21 +00:00
|
|
|
{...restProps}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</PreviewBox.Container>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const EditorInput = ({
|
|
|
|
|
currentValue,
|
|
|
|
|
setCurrentValue,
|
|
|
|
|
setFocus,
|
|
|
|
|
validationType,
|
|
|
|
|
onBlurUpdate,
|
|
|
|
|
placeholder = '',
|
|
|
|
|
error,
|
|
|
|
|
cyLabel = '',
|
|
|
|
|
componentName,
|
|
|
|
|
usePortalEditor = true,
|
|
|
|
|
renderPreview,
|
|
|
|
|
portalProps,
|
|
|
|
|
lang,
|
|
|
|
|
isFocused,
|
|
|
|
|
componentId,
|
|
|
|
|
type,
|
|
|
|
|
delayOnChange = true, // Added this prop to immediately update the onBlurUpdate callback
|
|
|
|
|
paramLabel = '',
|
|
|
|
|
disabled = false,
|
2025-02-25 06:52:50 +00:00
|
|
|
previewRef,
|
|
|
|
|
setShowPreview,
|
|
|
|
|
onInputChange,
|
2025-03-25 23:11:00 +00:00
|
|
|
wrapperRef,
|
2025-03-02 21:09:32 +00:00
|
|
|
showSuggestions,
|
2025-06-27 14:38:15 +00:00
|
|
|
setCodeEditorView = null, // Function to set the CodeMirror view
|
2025-07-07 09:41:58 +00:00
|
|
|
cursorInsidePreview = false,
|
2024-10-22 08:01:21 +00:00
|
|
|
}) => {
|
2025-01-20 10:53:37 +00:00
|
|
|
const codeHinterContext = useContext(CodeHinterContext);
|
|
|
|
|
const { suggestionList: paramHints } = createReferencesLookup(codeHinterContext, true);
|
2025-03-25 23:11:00 +00:00
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
const getSuggestions = useStore((state) => state.getSuggestions, shallow);
|
2025-01-15 12:51:01 +00:00
|
|
|
const [codeMirrorView, setCodeMirrorView] = useState(undefined);
|
2025-05-14 17:59:52 +00:00
|
|
|
|
2025-06-27 14:38:15 +00:00
|
|
|
const getServerSideGlobalResolveSuggestions = useStore(
|
|
|
|
|
(state) => state.getServerSideGlobalResolveSuggestions,
|
|
|
|
|
shallow
|
|
|
|
|
);
|
2025-05-14 17:59:52 +00:00
|
|
|
|
2025-03-07 10:04:31 +00:00
|
|
|
const { queryPanelKeybindings } = useQueryPanelKeyHooks(onBlurUpdate, currentValue, 'singleline');
|
|
|
|
|
|
2025-03-25 23:11:00 +00:00
|
|
|
const isInsideQueryManager = useMemo(
|
|
|
|
|
() => isInsideParent(wrapperRef?.current, 'query-manager'),
|
|
|
|
|
[wrapperRef.current]
|
|
|
|
|
);
|
2024-10-22 08:01:21 +00:00
|
|
|
function autoCompleteExtensionConfig(context) {
|
2025-01-20 10:53:37 +00:00
|
|
|
const hintsWithoutParamHints = getSuggestions();
|
2025-05-22 20:08:04 +00:00
|
|
|
const serverHints = getServerSideGlobalResolveSuggestions(isInsideQueryManager);
|
2025-04-01 20:41:13 +00:00
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
let word = context.matchBefore(/\w*/);
|
|
|
|
|
|
2025-01-20 10:53:37 +00:00
|
|
|
const hints = {
|
|
|
|
|
...hintsWithoutParamHints,
|
2025-05-16 06:40:38 +00:00
|
|
|
appHints: [...hintsWithoutParamHints.appHints, ...serverHints, ...paramHints],
|
2025-01-20 10:53:37 +00:00
|
|
|
};
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
const totalReferences = (context.state.doc.toString().match(/{{/g) || []).length;
|
|
|
|
|
|
|
|
|
|
let queryInput = context.state.doc.toString();
|
|
|
|
|
const originalQueryInput = queryInput;
|
|
|
|
|
|
|
|
|
|
if (totalReferences > 0) {
|
|
|
|
|
const currentCursor = context.state.selection.main.head;
|
|
|
|
|
const currentCursorPos = context.pos;
|
|
|
|
|
|
|
|
|
|
let currentWord = queryInput.substring(currentCursor, currentCursorPos);
|
|
|
|
|
|
|
|
|
|
if (currentWord?.length === 0) {
|
|
|
|
|
const lastBracesFromPos = queryInput.lastIndexOf('{{', currentCursorPos);
|
|
|
|
|
currentWord = queryInput.substring(lastBracesFromPos, currentCursorPos);
|
|
|
|
|
//remove curly braces from the current word as will append it later
|
|
|
|
|
currentWord = removeNestedDoubleCurlyBraces(currentWord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (currentWord.includes(' ')) {
|
|
|
|
|
currentWord = currentWord.split(' ').pop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// remove \n from the current word if it is present
|
|
|
|
|
currentWord = currentWord.replace(/\n/g, '');
|
|
|
|
|
|
|
|
|
|
queryInput = '{{' + currentWord + '}}';
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-16 06:40:38 +00:00
|
|
|
let completions = getAutocompletion(queryInput, validationType, hints, totalReferences, originalQueryInput);
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
from: word.from,
|
|
|
|
|
options: completions,
|
|
|
|
|
validFor: /^\{\{.*\}\}$/,
|
2025-01-09 12:59:01 +00:00
|
|
|
filter: false,
|
2024-10-22 08:01:21 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
const overRideFunction = React.useCallback(
|
|
|
|
|
(context) => autoCompleteExtensionConfig(context),
|
|
|
|
|
[isInsideQueryManager, paramHints]
|
|
|
|
|
);
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
const autoCompleteConfig = autocompletion({
|
|
|
|
|
override: [overRideFunction],
|
|
|
|
|
compareCompletions: (a, b) => {
|
|
|
|
|
return a.section.rank - b.section.rank && a.label.localeCompare(b.label);
|
|
|
|
|
},
|
|
|
|
|
aboveCursor: false,
|
|
|
|
|
defaultKeymap: true,
|
|
|
|
|
positionInfo: () => {
|
|
|
|
|
return {
|
2025-03-02 21:09:32 +00:00
|
|
|
class: 'cm-completionInfo-top cm-custom-completion-info cm-custom-singleline-completion-info',
|
2024-10-22 08:01:21 +00:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
maxRenderedOptions: 10,
|
|
|
|
|
});
|
|
|
|
|
|
2025-03-07 10:04:31 +00:00
|
|
|
const customKeyMaps = [
|
|
|
|
|
...defaultKeymap.filter((keyBinding) => keyBinding.key !== 'Mod-Enter'), // Remove default keybinding for Mod-Enter
|
|
|
|
|
...completionKeymap,
|
|
|
|
|
];
|
2024-10-22 08:01:21 +00:00
|
|
|
const customTabKeymap = keymap.of([
|
|
|
|
|
{
|
|
|
|
|
key: 'Tab',
|
|
|
|
|
run: (view) => {
|
|
|
|
|
if (completionStatus(view.state)) {
|
|
|
|
|
return acceptCompletion(view);
|
|
|
|
|
}
|
|
|
|
|
if (isOpen) {
|
|
|
|
|
const { state } = view;
|
|
|
|
|
const { selection } = state;
|
|
|
|
|
const { anchor } = selection.main;
|
|
|
|
|
const tabSize = 2;
|
|
|
|
|
|
|
|
|
|
view?.dispatch({
|
|
|
|
|
changes: { from: anchor, insert: ' '.repeat(tabSize) },
|
|
|
|
|
selection: { anchor: anchor + tabSize },
|
|
|
|
|
});
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-03-07 10:04:31 +00:00
|
|
|
...queryPanelKeybindings,
|
2024-10-22 08:01:21 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const handleOnChange = React.useCallback((val) => {
|
|
|
|
|
setCurrentValue(val);
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const handleOnBlur = () => {
|
2025-07-07 09:41:58 +00:00
|
|
|
!cursorInsidePreview && setShowPreview(false);
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
if (!delayOnChange) {
|
|
|
|
|
setFirstTimeFocus(false);
|
|
|
|
|
return onBlurUpdate(currentValue);
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setFirstTimeFocus(false);
|
|
|
|
|
onBlurUpdate(currentValue);
|
|
|
|
|
}, 0);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const darkMode = localStorage.getItem('darkMode') === 'true';
|
|
|
|
|
const theme = darkMode ? okaidia : githubLight;
|
|
|
|
|
|
|
|
|
|
const { handleTogglePopupExapand, isOpen, setIsOpen, forceUpdate } = portalProps;
|
2025-02-25 06:52:50 +00:00
|
|
|
// when full screen editor is closed, show the preview box
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (isFocused && !isOpen) {
|
|
|
|
|
setShowPreview(true);
|
|
|
|
|
}
|
|
|
|
|
}, [isOpen, isFocused]);
|
2024-10-22 08:01:21 +00:00
|
|
|
|
|
|
|
|
const [firstTimeFocus, setFirstTimeFocus] = useState(false);
|
2025-02-25 06:52:50 +00:00
|
|
|
const currentEditorHeightRef = useRef(null);
|
|
|
|
|
const isInsideQueryPane = !!currentEditorHeightRef?.current?.closest('.query-details');
|
|
|
|
|
const showLineNumbers = lang == 'jsx' || type === 'extendedSingleLine' || false;
|
2024-10-22 08:01:21 +00:00
|
|
|
|
2025-03-18 09:12:48 +00:00
|
|
|
const customClassNames = cx('codehinter-input single-line-codehinter-input', {
|
2024-10-22 08:01:21 +00:00
|
|
|
'border-danger': error,
|
|
|
|
|
focused: isFocused,
|
|
|
|
|
'focus-box-shadow-active': firstTimeFocus,
|
|
|
|
|
'widget-code-editor': componentId,
|
|
|
|
|
'disabled-pointerevents': disabled,
|
2025-02-25 06:52:50 +00:00
|
|
|
'code-editor-query-panel': isInsideQueryPane,
|
|
|
|
|
'show-line-numbers': showLineNumbers,
|
2024-10-22 08:01:21 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const handleFocus = () => {
|
|
|
|
|
setFirstTimeFocus(true);
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
setFocus(true);
|
|
|
|
|
}, 50);
|
|
|
|
|
};
|
|
|
|
|
|
2025-02-25 06:52:50 +00:00
|
|
|
// in query panel we are allowing code editor to have dynamic height, this observer is to show/hide preview box based on the visibility of the editor
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!isInsideQueryPane) return;
|
|
|
|
|
const observer = new IntersectionObserver(
|
|
|
|
|
([entry]) => {
|
|
|
|
|
if (entry.isIntersecting && isFocused) {
|
|
|
|
|
setShowPreview(true);
|
|
|
|
|
} else {
|
|
|
|
|
setShowPreview(false);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: document.querySelector('.query-details'),
|
|
|
|
|
threshold: 0.01,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
if (currentEditorHeightRef.current) {
|
|
|
|
|
observer.observe(currentEditorHeightRef.current);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return () => {
|
|
|
|
|
if (currentEditorHeightRef.current) {
|
|
|
|
|
observer.unobserve(currentEditorHeightRef.current);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}, [isInsideQueryPane, isFocused]);
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
cyLabel = paramLabel ? paramLabel.toLowerCase().trim().replace(/\s+/g, '-') : cyLabel;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
ref={currentEditorHeightRef}
|
|
|
|
|
className={`cm-codehinter ${darkMode && 'cm-codehinter-dark-themed'} ${disabled ? 'disabled-cursor' : ''}`}
|
2025-03-19 08:26:33 +00:00
|
|
|
data-cy={`${cyLabel.replace(/_/g, '-')}-input-field`}
|
2024-10-22 08:01:21 +00:00
|
|
|
>
|
2025-02-25 06:52:50 +00:00
|
|
|
{/* sticky element to position the preview box correctly on top without flowing out of container */}
|
2024-10-22 08:01:21 +00:00
|
|
|
{usePortalEditor && (
|
|
|
|
|
<CodeHinter.PopupIcon
|
|
|
|
|
callback={handleTogglePopupExapand}
|
|
|
|
|
icon="portal-open"
|
|
|
|
|
tip="Pop out code editor into a new window"
|
|
|
|
|
position={currentEditorHeightRef?.current?.getBoundingClientRect()}
|
2025-02-25 06:52:50 +00:00
|
|
|
isQueryManager={isInsideQueryPane}
|
2024-10-22 08:01:21 +00:00
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
<CodeHinter.Portal
|
|
|
|
|
isCopilotEnabled={false}
|
|
|
|
|
isOpen={isOpen}
|
|
|
|
|
callback={setIsOpen}
|
|
|
|
|
componentName={componentName}
|
|
|
|
|
key={componentName}
|
|
|
|
|
customComponent={renderPreview}
|
|
|
|
|
forceUpdate={forceUpdate}
|
|
|
|
|
optionalProps={{ styles: { height: 300 }, cls: '' }}
|
|
|
|
|
darkMode={darkMode}
|
|
|
|
|
selectors={{ className: 'preview-block-portal' }}
|
|
|
|
|
dragResizePortal={true}
|
|
|
|
|
callgpt={null}
|
|
|
|
|
>
|
|
|
|
|
<ErrorBoundary>
|
2025-03-02 21:09:32 +00:00
|
|
|
<div
|
|
|
|
|
style={{
|
|
|
|
|
position: 'relative',
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
|
width: '100%',
|
|
|
|
|
height: '100%',
|
2024-10-22 08:01:21 +00:00
|
|
|
}}
|
2025-03-02 21:09:32 +00:00
|
|
|
className="check-here"
|
|
|
|
|
ref={previewRef}
|
|
|
|
|
>
|
|
|
|
|
<CodeMirror
|
2025-05-14 17:59:52 +00:00
|
|
|
onCreateEditor={(view) => {
|
|
|
|
|
setCodeMirrorView(view);
|
2025-06-27 14:38:15 +00:00
|
|
|
if (setCodeEditorView) {
|
|
|
|
|
setCodeEditorView(view);
|
|
|
|
|
}
|
2025-05-14 17:59:52 +00:00
|
|
|
}}
|
2025-03-02 21:09:32 +00:00
|
|
|
value={currentValue}
|
|
|
|
|
placeholder={placeholder}
|
|
|
|
|
height={isInsideQueryPane ? '100%' : showLineNumbers ? '400px' : '100%'}
|
|
|
|
|
width="100%"
|
|
|
|
|
extensions={
|
|
|
|
|
showSuggestions
|
|
|
|
|
? [
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
javascript({ jsx: lang === 'jsx' }),
|
|
|
|
|
autoCompleteConfig,
|
|
|
|
|
keymap.of([...customKeyMaps]),
|
|
|
|
|
customTabKeymap,
|
|
|
|
|
]
|
2025-03-02 21:09:32 +00:00
|
|
|
: [javascript({ jsx: lang === 'jsx' })]
|
|
|
|
|
}
|
|
|
|
|
onChange={(val) => {
|
|
|
|
|
setFirstTimeFocus(false);
|
|
|
|
|
handleOnChange(val);
|
|
|
|
|
onInputChange && onInputChange(val);
|
|
|
|
|
}}
|
|
|
|
|
basicSetup={{
|
|
|
|
|
lineNumbers: showLineNumbers,
|
|
|
|
|
syntaxHighlighting: true,
|
|
|
|
|
bracketMatching: true,
|
|
|
|
|
foldGutter: false,
|
|
|
|
|
highlightActiveLine: false,
|
2025-03-24 18:38:16 +00:00
|
|
|
autocompletion: true,
|
|
|
|
|
defaultKeymap: false,
|
2025-03-02 21:09:32 +00:00
|
|
|
completionKeymap: true,
|
|
|
|
|
searchKeymap: false,
|
|
|
|
|
}}
|
|
|
|
|
onMouseDown={() => handleFocus()}
|
|
|
|
|
onBlur={() => handleOnBlur()}
|
|
|
|
|
className={customClassNames}
|
|
|
|
|
theme={theme}
|
|
|
|
|
indentWithTab={false}
|
|
|
|
|
readOnly={disabled}
|
2025-05-14 17:59:52 +00:00
|
|
|
onKeyDown={(event) => {
|
|
|
|
|
if (event.key === 'Backspace') {
|
|
|
|
|
startCompletion(codeMirrorView);
|
|
|
|
|
}
|
|
|
|
|
}}
|
2025-03-02 21:09:32 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
</ErrorBoundary>
|
|
|
|
|
</CodeHinter.Portal>
|
|
|
|
|
</div>
|
2024-10-22 08:01:21 +00:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const DynamicEditorBridge = (props) => {
|
|
|
|
|
const {
|
|
|
|
|
initialValue,
|
|
|
|
|
type,
|
|
|
|
|
fxActive,
|
|
|
|
|
paramType = 'code',
|
|
|
|
|
paramLabel,
|
|
|
|
|
paramName,
|
|
|
|
|
fieldMeta,
|
|
|
|
|
darkMode,
|
|
|
|
|
className,
|
|
|
|
|
onFxPress = noop,
|
|
|
|
|
onChange,
|
|
|
|
|
styleDefinition,
|
|
|
|
|
component,
|
|
|
|
|
onVisibilityChange,
|
|
|
|
|
isEventManagerParam = false,
|
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
|
|
const [forceCodeBox, setForceCodeBox] = React.useState(fxActive);
|
|
|
|
|
const codeShow = paramType === 'code' || forceCodeBox;
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
const HIDDEN_CODE_HINTER_LABELS = ['Table data', 'Column data', 'Text Format', 'Slider type'];
|
2025-06-27 14:38:15 +00:00
|
|
|
const { isFxNotRequired, newLine = false, section = '' } = fieldMeta;
|
|
|
|
|
const isDeprecated = section === 'deprecated';
|
2024-10-22 08:01:21 +00:00
|
|
|
const { t } = useTranslation();
|
2025-06-27 14:38:15 +00:00
|
|
|
const replaceIdsWithName = useStore((state) => state.replaceIdsWithName, shallow);
|
|
|
|
|
let newInitialValue = initialValue,
|
|
|
|
|
shouldResolve = true;
|
|
|
|
|
|
|
|
|
|
// This is to handle the case when the initial value is a string and contains components or queries
|
|
|
|
|
// and we need to replace the ids with names
|
|
|
|
|
// but we don't want to resolve the references as it needs to be displayed as it is
|
|
|
|
|
if (paramName === 'generateFormFrom') {
|
|
|
|
|
if (
|
|
|
|
|
typeof initialValue === 'string' &&
|
|
|
|
|
(initialValue?.includes('components') || initialValue?.includes('queries'))
|
|
|
|
|
) {
|
|
|
|
|
newInitialValue = replaceIdsWithName(initialValue);
|
|
|
|
|
shouldResolve = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const [_, error, value] =
|
|
|
|
|
type === 'fxEditor' ? (shouldResolve ? resolveReferences(newInitialValue) : [false, '', newInitialValue]) : [];
|
2024-10-22 08:01:21 +00:00
|
|
|
let cyLabel = paramLabel ? paramLabel.toLowerCase().trim().replace(/\s+/g, '-') : props.cyLabel;
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setForceCodeBox(fxActive);
|
|
|
|
|
}, [component, fxActive]);
|
|
|
|
|
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
let modifiedValue = initialValue;
|
|
|
|
|
if (paramType === 'colorSwatches' && typeof initialValue === 'string' && initialValue?.includes('var(')) {
|
|
|
|
|
modifiedValue = getCssVarValue(document.documentElement, initialValue);
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-19 10:52:26 +00:00
|
|
|
const renderFx = () => {
|
2025-06-11 08:30:38 +00:00
|
|
|
if (paramType === 'query' || !(paramLabel !== 'Type' && isFxNotRequired === undefined)) {
|
2025-04-19 10:52:26 +00:00
|
|
|
return null;
|
|
|
|
|
}
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
|
2025-04-19 10:52:26 +00:00
|
|
|
return (
|
|
|
|
|
<div
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
className={`col-auto pt-0 fx-common fx-button-container ${
|
|
|
|
|
(isEventManagerParam || codeShow) && 'show-fx-button-container'
|
|
|
|
|
}`}
|
2025-04-19 10:52:26 +00:00
|
|
|
>
|
|
|
|
|
<FxButton
|
|
|
|
|
active={codeShow}
|
|
|
|
|
onPress={() => {
|
|
|
|
|
if (codeShow) {
|
|
|
|
|
setForceCodeBox(false);
|
|
|
|
|
onFxPress(false);
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
if (paramType === 'colorSwatches') {
|
|
|
|
|
onChange(modifiedValue);
|
|
|
|
|
}
|
2025-04-19 10:52:26 +00:00
|
|
|
} else {
|
|
|
|
|
setForceCodeBox(true);
|
|
|
|
|
onFxPress(true);
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
dataCy={cyLabel}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-22 08:01:21 +00:00
|
|
|
const fxClass = isEventManagerParam ? 'justify-content-start' : 'justify-content-end';
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
|
2025-06-27 14:38:15 +00:00
|
|
|
const renderedLabel = () => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
2024-10-22 08:01:21 +00:00
|
|
|
{paramLabel !== ' ' && !HIDDEN_CODE_HINTER_LABELS.includes(paramLabel) && (
|
|
|
|
|
<div className={`field ${className}`} data-cy={`${cyLabel}-widget-parameter-label`}>
|
|
|
|
|
<ToolTip
|
|
|
|
|
label={t(`widget.commonProperties.${camelCase(paramLabel)}`, paramLabel)}
|
|
|
|
|
meta={fieldMeta}
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
labelClass={`tj-text-xsm color-slate12 ${codeShow ? 'mb-2' : 'mb-0'} ${
|
|
|
|
|
darkMode && 'color-whitish-darkmode'
|
|
|
|
|
}`}
|
2024-10-22 08:01:21 +00:00
|
|
|
/>
|
2025-06-27 14:38:15 +00:00
|
|
|
{isDeprecated && (
|
|
|
|
|
<span className={'list-item-deprecated-column-type'}>
|
|
|
|
|
<Icon name={'warning'} height={14} width={14} fill="#DB4324" />
|
|
|
|
|
</span>
|
|
|
|
|
)}
|
2024-10-22 08:01:21 +00:00
|
|
|
</div>
|
|
|
|
|
)}
|
2025-06-27 14:38:15 +00:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const renderDynamicFx = () => {
|
|
|
|
|
if (codeShow) return null;
|
|
|
|
|
return (
|
|
|
|
|
<DynamicFxTypeRenderer
|
|
|
|
|
value={!error ? value : ''}
|
|
|
|
|
onChange={onChange}
|
|
|
|
|
paramName={paramName}
|
|
|
|
|
paramLabel={paramLabel}
|
|
|
|
|
paramType={paramType}
|
|
|
|
|
forceCodeBox={() => {
|
|
|
|
|
setForceCodeBox(true);
|
|
|
|
|
onFxPress(true);
|
|
|
|
|
}}
|
|
|
|
|
meta={fieldMeta}
|
|
|
|
|
cyLabel={cyLabel}
|
|
|
|
|
styleDefinition={styleDefinition}
|
|
|
|
|
component={component}
|
|
|
|
|
onVisibilityChange={onVisibilityChange}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={cx({ 'codeShow-active': codeShow }, 'wrapper-div-code-editor')}>
|
|
|
|
|
<div className={cx('d-flex align-items-center justify-content-between code-flex-wrapper')}>
|
|
|
|
|
{renderedLabel()}
|
2024-10-22 08:01:21 +00:00
|
|
|
<div className={`${(paramType ?? 'code') === 'code' ? 'd-none' : ''} flex-grow-1`}>
|
|
|
|
|
<div style={{ marginBottom: codeShow ? '0.5rem' : '0px' }} className={`d-flex align-items-center ${fxClass}`}>
|
2025-04-19 10:52:26 +00:00
|
|
|
{renderFx()}
|
2024-10-22 08:01:21 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-06-27 14:38:15 +00:00
|
|
|
{!newLine && renderDynamicFx()}
|
2024-10-22 08:01:21 +00:00
|
|
|
</div>
|
2025-06-27 14:38:15 +00:00
|
|
|
{newLine && renderDynamicFx()}
|
2024-10-22 08:01:21 +00:00
|
|
|
{codeShow && (
|
|
|
|
|
<div className={`row custom-row`} style={{ display: codeShow ? 'flex' : 'none' }}>
|
|
|
|
|
<div className={`col code-hinter-col`}>
|
|
|
|
|
<div className="d-flex">
|
Custom themes (#13064)
* feat: Add CSA and functionalities for managing loading, visibility, and disable states for full tab component. (#11267)
* feat: tab draggble option and popover menu (#11267)
* feat: tab scrollable arrows and tabItem logic(#11267)
* feat: remove logs(#11267)
* feat: Tabslayout name change(#11267)
* fix: component update on Tabs
* fix: tab text color update
* feat: setTabDisable CSA added(#11267)
* feat: added CSA for tab specific changes(#11267)
* feat: added handle function for tab specific changes(#11267)
* feat: shimmer for tab nav and icon chooser (#11267)
* feat: icon for each tab in TabNav items (#11267)
* feat: equal split width fix for each tab in TabNav items (#11267)
* feat: styles for Tab Nav (#11267)
* feat: slide options(#11267)
* feat: fix radius (#11267)
* feat: slider (#11267)
* feat: fix slide direction (#11267)
* feat: fix slide direction 2 (#11267)
* feat: fix styles right side inspector view (#11267)
* feat: nav ellipsis ... (#11267)
* feat: children different for dynamic and non-dynamic (#11267)
* feat:[tabsLayout] change default values in config (#11267)
* feat:[tabsLayout] split and auto fix (#11267)
* feat: fix styles accent and text (#11267)
* feat: fix styles divider and more 2(#11267)
* feat: fix styles divider and more 3(#11267)
* feat: fix styles 4(#11267)
* feat: fix styles 5(#11267)
* feat: fix tab icon visibility 6 (#11267)
* feat: modify name of property from id to Tab 7(#11267)
* fixes and changes
* fix: csa for tabs
* new changes and fixes
* fix: dynamic options sytling
* v2 changes
* add: new properties and styles to inspector for range slider
* fixes of range slider
* fix: styling
* fix: styling of icons
* fixed endvalue and startvalue problem
* ColorSwatches for table
* fix: styling
* transition effect fix
* fix: properties and migration
* fix: slider functionality
* fixed transition
* new changes
* visible,disable,loading,width
* feat: merge appbuilder/sprint-11 with main
* fix: styling
* style: extend tabpane background to whole pane
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable' -m 'Changes done for: Currency, Email, Phone Number & ModalV2 component
* review changes
* fix: tinycolor import
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Date, Time, DateTime & Date Range Picker components
* [Issue 12503] Update input's with type as color to colorSwatches and also change accent color value to primary brand css variable
Changes done for: Form, Textarea & Horizontal Divider component
* Fix: Add default selected value config for Header & Footer Background Color input field for Form component so that its shows correct color demo & its value
* Fix: Resolved custom theming issues in different components
* feat: Revamps file uploader widget
* Fixes added
* Custom theme extra code for extra components
* Submodule commit change
* Submodule commit change
* Textinput theming added
* Number input theming added
* Email & Password Theming added
* Textarea theming added
* Error system status added along with rating theming
* ToggleV2 theming added
* Toggle, RadioButton & Error related theming added
* Checkbox Theming added
* Dropdown V2 and legacy theming added
* Multiselect V2 theming added
* Adding ux friendly error messages
* Misc1 and Misc 2 theming added
* Multiselect legacy theming added
* Form components theming added
* Subcontainer related issues
* Subcontainers theming added
* Tabs theming added
* Filepicker theming added
* Range slider theming added
* Steps theming added
* Submodule update
* Package update
* Added Header text, background and container background color
* Submodule Update
* Submodule update
* Submodule update
* Submodule update
* Hover effect added
* feat: Revamps file uploader widget
* Adding ux friendly error messages
* Adds style tab
* Adds min file validation
* Reset vs code
* Adds support for theme
* Base theme added
* Base theme added
* Base theme added
* initial commit
* fix
* Fixes
* Submodule update
* Added auto color assign feature for multiselect/select in table
* Table column popover going out of bounds fix
* Changed layout of component manager
* DropdownV2 added to selectInputs
* HTML column data type added
* Table column icons added
* Fix dropping widget width while dragging
* Changed datepicker icon and added icons to table dropdown
* Style: Update Accordion Component UI
* Temp changes
* Fix group selection in form
* fix when dropping a component, shadow is coming on top of component manager.
* improve performace on useGroupedTargetsScrollHandler
* Fix
* Review fixes
* Minor changes
* chore: update submodule references
* Color swatches added icon/default and added disabled/loading state
* Submodule update
* Bugs solved
* Fixes for Component sidebar
* Custom theme related bug fixes
* App Background Switch added
* Submodule update
* Submodule update
* HTML fixes
* Submodule update
* Query breaking on Symbol fix
* Import export property migration for Rangepicker & Textarea
* Auto color pills not working for table select fix
* Custom themes minor bugs
* Submodule update
* Minor fixes
* Revamp pages in editor and viewer
* bug fixes
* merge base
* fix conflicts
* fix conflicts
* bug fixes
* Added swatches to page menu
* Submodule update
* Submodule update
* Submodule update
* Styling fixes
* Changed few page styles
* bug fixes
* fix: pages icon and layout for right sidebar
* fix: styling for pages menu
* fix base styling
* merge base
* bug fixes
* Bug fixes
* Submodule update
* Submodules updated
* bug fixes
* fix top styling of nav bar
* Sass loader error fix
* styles: correct styles to match the dsigns
* Accordion design added with some minor styling fixes
* fix: update default supported file of filepicker to any
* fix: update styles mismatches
* fix: hide min and max file count if multi file select is disabled
* TJ Default changed to Tooljet Migration
* Multiline code editor suggestions now close when out of view
* add border to canvas
* Dark theme link color fix for html column type
* Spinner color fix
* bug fixes
* bug fixes
* Submodules updated
* update reference
* Submodule update
---------
Co-authored-by: Raman Kumar <k.raman1998@yahoo.in>
Co-authored-by: Vijaykant Yadav <vjy239@gmail.com>
Co-authored-by: TaruunMalik <taruunrmalik09@gmail.com>
Co-authored-by: johnsoncherian <johnsonc.dev@gmail.com>
Co-authored-by: NishidhJain11 <nishidh@tooljet.com>
Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com>
Co-authored-by: Nakul Nagargade <nakul@tooljet.com>
2025-06-27 12:42:34 +00:00
|
|
|
<SingleLineCodeEditor {...props} initialValue={modifiedValue} />
|
2024-10-22 08:01:21 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SingleLineCodeEditor.Editor = EditorInput;
|
|
|
|
|
SingleLineCodeEditor.EditorBridge = DynamicEditorBridge;
|
|
|
|
|
|
|
|
|
|
export default SingleLineCodeEditor;
|