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

Additional Extension Provider #76

Closed
elbakerino opened this issue Oct 22, 2020 · 1 comment
Closed

Additional Extension Provider #76

elbakerino opened this issue Oct 22, 2020 · 1 comment
Labels
enhancement New feature or request plugin
Projects
Milestone

Comments

@elbakerino
Copy link
Member

elbakerino commented Oct 22, 2020

A default available extension provider would be great to enable e.g. custom component rendering where all supporting components can be enhanced with full components.

Use cases which could benefit from it:

info usecase: an available placeholder in textfield, list, options, selects etc., which would consist of an info component, which may either render a button that opens an dialog or as inline description or (any) other way. This way some apps could also add markdown support with a free chose of the markdown renderer, others may use mustache etc. But the textfield etc. does not contain any logic for the placeholder, only "if placeholder exists, render it and pass down schema"

onKeyPress / onBeforeChange / onClickLabel / onClickInput handlers which are applied to all widgets, passed down once, could enable features like warn in demo mode / opening for readable-writable (#78) / global read-only mode / undo-redo store changes with CTRL+Z

@elbakerino elbakerino added the enhancement New feature or request label Oct 22, 2020
@elbakerino elbakerino added this to To do in ui-schema via automation Oct 22, 2020
@elbakerino elbakerino added this to the v0.3.0 milestone Jul 3, 2021
@elbakerino elbakerino moved this from To do to In progress in ui-schema Jul 3, 2021
@elbakerino
Copy link
Member Author

elbakerino commented Jul 3, 2021

Added extra extension provider & context, custom by default. is hard wired / included in UIStoreProvider.

export interface FormConfig {
    something: string
}

const Comp1 = () => {
    return <UIStoreProvider<FormConfig>
        // all default props + FormConfig
        something={'one-thing'}
    />
}

const Comp2 = () => {
    const {something}= useUIConfig<FormConfig>()

    return null
}

Useful for generator-wide, but not for-all-generators, usages.

Note: for most use cases the custom UIMetaProvider extension is more useful, like used in Read-or-Write

ui-schema automation moved this from In progress to Done Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request plugin
Projects
ui-schema
  
Done
Development

No branches or pull requests

1 participant