mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 07:26:02 +01:00
feat(interface/dialog): disabled row property (#142)
* feat(interface/dialog): readonly, disabled flags * Update TS prop types * refactor(web/input): remove read only property Co-authored-by: davidxd33 <dponce@gmail.com>
This commit is contained in:
@@ -29,6 +29,7 @@ const InputField: React.FC<Props> = (props) => {
|
||||
placeholder={props.row.placeholder}
|
||||
defaultValue={props.row.default}
|
||||
type={!props.row.password || props.passwordStates[props.index] ? 'text' : 'password'}
|
||||
isDisabled={props.row.disabled}
|
||||
/>
|
||||
{props.row.password && (
|
||||
<InputRightElement
|
||||
|
||||
@@ -31,6 +31,7 @@ const NumberField: React.FC<Props> = (props) => {
|
||||
defaultValue={props.row.default}
|
||||
min={props.row.min}
|
||||
max={props.row.max}
|
||||
isDisabled={props.row.disabled}
|
||||
>
|
||||
{props.row.icon && (
|
||||
<InputLeftElement pointerEvents="none" children={<FontAwesomeIcon icon={props.row.icon} fixedWidth />} />
|
||||
|
||||
@@ -25,6 +25,8 @@ const SelectField: React.FC<Props> = (props) => {
|
||||
<Select
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => props.handleChange(e.target.value, props.index)}
|
||||
defaultValue={props.row.default || ''}
|
||||
isDisabled={props.row.disabled}
|
||||
isReadOnly={props.row.readonly}
|
||||
>
|
||||
{/* Hacky workaround for selectable placeholder issue */}
|
||||
{!props.row.default && (
|
||||
|
||||
@@ -26,6 +26,7 @@ const SliderField: React.FC<Props> = (props) => {
|
||||
min={props.row.min}
|
||||
max={props.row.max}
|
||||
step={props.row.step}
|
||||
isDisabled={props.row.disabled}
|
||||
>
|
||||
<SliderTrack>
|
||||
<SliderFilledTrack />
|
||||
|
||||
Reference in New Issue
Block a user