Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow custom controls to add one or more Option based attributes #1510

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lucasnetau
Copy link
Collaborator

@lucasnetau lucasnetau commented Jan 29, 2024

Allow adding Option attributes to custom controls (or when a template overrides a builtin control)

This can be defined by assigning the type: options

noSelect: flag can be set to true to hide the radio select buttons (where selecting options isn't used by the control).

Example definition:

columns: {
  label: 'Columns',
      type: 'options',
      values: [
      {
          "label": "Default Column",
          "value": "col1",
          "selected": false
      }
  ],
      noSelect: true,
},   

@todo: Support a no-value option

Resolves: #866
Resolves: #825
Resolved: #1129

@lucasnetau
Copy link
Collaborator Author

@kevinchappell WIP for the options code. Would like you opinion on the flag noSelect (default false) to disable the radio buttons, this could also be worded as allowSelection (default true)

Copy link
Owner

@kevinchappell kevinchappell left a comment

Choose a reason for hiding this comment

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

oops, i never finished my review. this mostly looks good to me. i will take a swing at fixing the test and it should be good to merge after.

@@ -17,3 +17,9 @@ console.error = (...params) => {
originalConsoleError(...params)
}
}

import { webcrypto } from 'node:crypto'
Copy link
Owner

Choose a reason for hiding this comment

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

💯

@lucasnetau
Copy link
Collaborator Author

I have one more change to push to this. A button to switch from option => value to just an option (and value is equal to option). Useful for lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants