The "Create Widget" repository is an utility to kick start the development of a custom element, used in the employee application. It generates the file and folder structure, a first small example widget and the toolbelt to run the development cycle and build the final script.
The widgets are based on the web component standard and leverage the lifecycle methods of it. Read more about web components in the documentation.
The root folder contains the configuration files and package manager description. For Webpack the config differentiate between development and production environments for more clarity.
. ├── README.md ├── favicon.png ├── index.html ├── package.json ├── src │ ├── bootstrap.ts │ ├── config.tsx │ ├── configuration-schema.ts │ ├── dummy-widget.tsx │ └── index.tsx ├── tsconfig.json ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js
A mocked implementation of the registration methods used in the real application. It is needed to preview the widget in development.
The configuration form which is rendered from the configuration schema in the widget. It is also used in the preview to alter the component.
A simple schema to define custom settings for the widget. For more information, please refer to the documentation of RJFS.
The naming of this file should reflect the chosen widget name. This file contains the logic of the widget. It is rendered within the render method of the index.tsx file.
Bootstrap the widget here to be used inside the target platform. Also the block definition is set here.
Read more about custom-element naming conventions here.
To run the generator from a local copy of the source code, first install dependencies:
then build the generator:
npm run build
and finally, start the generator using:
The generated widget code will reside in the current directory.
- The development preview of the widget and the preview of the configuration are not connected. Submitting the form doesn't update the widget on the left hand side.
- not compatible with npm 7