Skip to content

Implementing new field widgets? #29

@josephguillaume

Description

@josephguillaume

Just trying to understand the design

The documentation states:
"The field widget, the widget that will be displayed. It may be a dropdown, radios, a map to select a location or something else. You can also implement your own."

If I understand correctly, widgets are exported in https://github.com/danielbeeke/rdf-form/blob/master/src/plugins.ts and loaded as BaseFields in:

Object.assign(this.registeredFieldClasses, BaseFields, event.detail.fields)

event.detail.fields doesn't seem to add anything at this time?

Each widget has to extend https://github.com/danielbeeke/rdf-form/blob/master/src/elements/ElementBase.ts and includes html templates constructed as string literals using uhtml

Implementing a widget therefore involves adding an import to plugins.ts and rebuilding the custom component. (There is no dynamic/runtime widget registration).

Does this sound right? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions