Skip to content

Conversation

@miguelgrc
Copy link
Contributor

Closes #82 #113

  • Adds a slider field which can be of two different kinds:
    • Discrete: the user can provide a list of values and a list of labels
    • Continuous: the user can customize minimum and maximum values and step size, and a numeric input (which can be hidden) is displayed at the side
  • Allows suffixes (e.g. px, %), but just for visualization (only the plain numeric values will be stored)
  • Changed some numeric fields such as the code editor height or the modal width setting to use a slider, and added a new height setting to the rich editor also using a slider (addressing richEditor: make height customisable #113)
  • Removed the previous slider field that was used for the common field width setting and switched to this new one

: "500px",
border: props.noBorder ? "none" : undefined,
height: height || undefined,
border: noBorder ? "none" : undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a react-formule prop (from legacy) - maybe we should pass it as uiOption = {border: '0 | 1px solid #000 | borderStyle' }

const { defaultValue, values, labels, minimum, maximum, step, kind } = schema;
const { suffix, hideInput } = options;

const isDiscrete = kind === "discrete";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind should be part of the uiSchema/uiOptions, not the schema

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think so? I put it in schema since it changes the behavior of the field, it's not just a cosmetic setting

options,
readonly,
}: SliderWidgetProps) => {
const { defaultValue, values, labels, minimum, maximum, step, kind } = schema;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values labels might be better to be enum (schema) enumNames (uiSchema)

@pamfilos
Copy link
Collaborator

closing as superseded by #123

@pamfilos pamfilos closed this Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add a slider field

2 participants