mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 00:48:25 +00:00
Feature: Number input text color (#4193)
* Number input text color * Default value and missing commit * Update widgetConfig.js * Update NumberInput.jsx * Update NumberInput.jsx * Update NumberInput.jsx Co-authored-by: Midhun G S <gsmithun4@gmail.com>
This commit is contained in:
parent
6b3916c2ef
commit
a920811cb4
2 changed files with 10 additions and 1 deletions
|
|
@ -6,10 +6,13 @@ export const NumberInput = function NumberInput({
|
|||
styles,
|
||||
setExposedVariable,
|
||||
component,
|
||||
darkMode,
|
||||
fireEvent,
|
||||
}) {
|
||||
const { visibility, borderRadius } = styles;
|
||||
|
||||
const textColor = darkMode && ['#232e3c', '#000000ff'].includes(styles.textColor) ? '#fff' : styles.textColor;
|
||||
|
||||
const [value, setValue] = React.useState(parseInt(properties.value));
|
||||
|
||||
const handleChange = (e) => {
|
||||
|
|
@ -47,7 +50,7 @@ export const NumberInput = function NumberInput({
|
|||
type="number"
|
||||
className="form-control"
|
||||
placeholder={properties.placeholder}
|
||||
style={{ height, display: visibility ? '' : 'none', borderRadius: `${borderRadius}px` }}
|
||||
style={{ height, display: visibility ? '' : 'none', borderRadius: `${borderRadius}px`, color: textColor }}
|
||||
value={value}
|
||||
data-cy={`draggable-widget-${String(component.name).toLowerCase()}`}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1092,6 +1092,11 @@ export const widgets = [
|
|||
schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
|
||||
},
|
||||
},
|
||||
textColor: {
|
||||
type: 'color',
|
||||
displayName: 'Text Color',
|
||||
validation: { schema: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
exposedVariables: {
|
||||
value: 0,
|
||||
|
|
@ -1112,6 +1117,7 @@ export const widgets = [
|
|||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
borderRadius: { value: '{{0}}' },
|
||||
textColor: { value: '#232e3c' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue