Giter Site home page Giter Site logo

form-js-examples's Introduction

form-js-examples

Examples that illustrate uses of form-js.

form-js-examples's People

Contributors

bpmn-io-bot avatar nikku avatar philippfromme avatar smbea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

form-js-examples's Issues

Add example for custom form elements

What should we do?

We should add one (or more) examples of how to create custom form elements.

This should include

  • Provide custom form field definitions + rendering
  • Provide properties panel extensions
  • Provide custom styling
  • ...

Some helpful resources:

Why should we do it?

Give our users good examples of consuming our custom form elements API.

Related to bpmn-io/form-js#123
Depends on bpmn-io/form-js#776

can't reuse entryFields from @bpmn-io/properties-panel

Describe the Bug

if wrap playgroundForm in preact component - it work fine
if then add custom component from sample - got error in NumberField

Steps to Reproduce

  1. npm create vite@latest wrapper-sample -- --template preact
  2. add playground in wrapper (its work fine):
export function App() {
  useEffect(() => {
    const container = document.getElementById('anchor');
    console.log(container);
    new FormPlayground({
      container,
      schema,
      data: {},
    });
  }, []);
  return (
    <div id="anchor" />
  )
}
  1. add custom component from custom-sample
    new FormPlayground({
      container,
      schema,
      data: {},

      // load rendering extension
      additionalModules: [
        RenderExtension
      ],

      // load properties panel extension
      editorAdditionalModules: [
        PropertiesPanelExtension
      ]
    });
  1. render fine, but on attempt drug Range to form - got error in console

wrapper-sample

Expected Behavior

no error, custom component work as in custom-sample

Environment

  • Host (Browser/Node version), if applicable: FireFox 119, Node 18.16.0
  • OS: Ubuntu 22.04
  • Library version: @bpmn-io/form-js ^1.4.0

Error when using custom component in FormEditor

Description

I've encountered a problem when trying to integrate a custom component into FormEditor. I was following an example for FormPlayground, but when using it within FormEditor, selecting the custom Range component in the UI throws an error.

Code to Reproduce

formEditorRef.value = new FormEditor({
  container: document.querySelector('#form-editor'),
  additionalModules: [
    RangeExtension,
    PropertiesPanelExtension,
  ],
});

Expected Behavior

The custom component should be available and functional within the form editor without any errors.

Actual Behavior

When selecting the custom Range component in the interface, the following JavaScript error is displayed:
Uncaught TypeError: Cannot read properties of undefined (reading '__H')

Screenshots

image

Steps to Reproduce

  1. Integrate the custom Range component into FormEditor using the code provided above.
  2. Open the form editor UI.
  3. Select the custom Range component.
  4. Notice the error in the browser console.

Additional Information

Version of bpmn-io/form-js: 1.7.0
Version Vue.js: 3.2.45

Can't build custom components in production mode

Describe the Bug

Can't build custom components in production mode

Steps to Reproduce

  1. open webpack.config.js in custom-components
  2. change mode to production
  3. npm start
  4. Uncaught Error: No provider for "e"! (Resolving: rangeField -> e)

Environment

  • Host Chrome
  • OS: Macos
  • Library version: 1.6.4

Viewer example in Angular

How would the form-js viewer be integrated with Angular forms?

My current customer has already built a custom tasklist for Camunda Platform using Angular. They already have Camunda's REST API integrated to query and complete tasks. For very simple forms, it would be great to design them using form-js as it is included in Camunda Modeler. One could then imagine letting the form keys of the user tasks reference the JSON form definitions for the tasklist to load them.

Could you provide a code example of how the form-js viewer would interact with the Angular programming model?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.