mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Add border color property to number input widget (#4175)
* add border color property to number input widget * fix lint * adds default value * fixes * fix lint
This commit is contained in:
parent
a920811cb4
commit
4c4749af0a
2 changed files with 16 additions and 2 deletions
|
|
@ -9,7 +9,7 @@ export const NumberInput = function NumberInput({
|
|||
darkMode,
|
||||
fireEvent,
|
||||
}) {
|
||||
const { visibility, borderRadius } = styles;
|
||||
const { visibility, borderRadius, borderColor } = styles;
|
||||
|
||||
const textColor = darkMode && ['#232e3c', '#000000ff'].includes(styles.textColor) ? '#fff' : styles.textColor;
|
||||
|
||||
|
|
@ -50,7 +50,13 @@ export const NumberInput = function NumberInput({
|
|||
type="number"
|
||||
className="form-control"
|
||||
placeholder={properties.placeholder}
|
||||
style={{ height, display: visibility ? '' : 'none', borderRadius: `${borderRadius}px`, color: textColor }}
|
||||
style={{
|
||||
height,
|
||||
display: visibility ? '' : 'none',
|
||||
borderRadius: `${borderRadius}px`,
|
||||
borderColor,
|
||||
color: textColor,
|
||||
}}
|
||||
value={value}
|
||||
data-cy={`draggable-widget-${String(component.name).toLowerCase()}`}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1092,6 +1092,13 @@ export const widgets = [
|
|||
schema: { type: 'union', schemas: [{ type: 'string' }, { type: 'number' }] },
|
||||
},
|
||||
},
|
||||
borderColor: {
|
||||
type: 'color',
|
||||
displayName: 'Border Color',
|
||||
validation: {
|
||||
schema: { type: 'string' },
|
||||
},
|
||||
},
|
||||
textColor: {
|
||||
type: 'color',
|
||||
displayName: 'Text Color',
|
||||
|
|
@ -1117,6 +1124,7 @@ export const widgets = [
|
|||
visibility: { value: '{{true}}' },
|
||||
disabledState: { value: '{{false}}' },
|
||||
borderRadius: { value: '{{0}}' },
|
||||
borderColor: { value: '#fff' },
|
||||
textColor: { value: '#232e3c' },
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue