2.0.18 • Published 3 years ago

@dotgov/formviewer v2.0.18

Weekly downloads
19
License
MIT
Repository
-
Last release
3 years ago

Angular6 formviewer - Lightweight form renderer

Features

  • Production Mode (AOT compilation compatibility)
  • Custom controls, html, pdf viewer, file upload, menu grid and other templates
  • Multiple instances
  • Translable content, inputs, fileds, validation, other..
  • Keyboard navigation
  • Custom styles

Warning

Library is under active development and may have breaking changes until stable 2.0.0 release or subsequent major versions after 2.0.0.

Getting started

Step 1: Install formviewer

NPM

npm install --save @dotgov/formviewer

Step 2: Import the component module

Consider that every DotGov Module including FormViewer must be imported next/in same context as DGSCoreModule.

import { DGSCoreModule, DGSEnvironment } from '@dotgov/core';
import { FormViewerModule } from '@dotgov/formviewer';


const dgsEnviroment: DGSEnvironment = {
  debug: environment.debug,
  apiUrl: environment.apiUrl,
  defaultLanguage: {
    Name: 'English',
    Code: 'en',
    Icon: 'fa fa-globe',
  },
  languages: [{
      Name: 'English',
      Code: 'en',
      Icon: 'fa fa-globe',
    }],
  lowerCaseTranslates: true,
};

@NgModule({
  declarations: [AppComponent],
  imports: [
    DGSCoreModule.forRoot(dgsEnviroment),
    FormViewerModule.forRoot(dgsEnviroment),
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

Step 3: Include assets

To load assets like themes and pdf viewer its ncessary to include assets. IF you're using the Angular CLI, you can add this to your angular-cli.json. Note: Path to formviewer bundle must set relative to basepath inside angular-cli.json.

"apps": {
    ...any,
    "assets": [
        ...any,
        {
          "glob": "**/*",
          "input": "../node_modules/@dotgov/formviewer/assets/",
          "output": "./assets/"
        }
    ],
    ...any,
}

Step 3: Include a theme

For now library doesn't allow you to use a custom theme, but i will be avalaible soon. Keep in touch with us.

Exports

ModelsServicesModules
ApiResponseApiServiceFormViewerModule
BreadcrumbpsProcessService
FVNotificationServiceFVNotification
ComponentConfig
Control
ControlType
BindingSet
Dock
DockItem
Extract
Field
Item
Model
Path
Proxy
Tab
Task
FVDoneResponse
GridComponentConfig
Store
GridColumn
EditHandler
GridSort
GridFilter
GridConfig
Lang
Menu
Folder

API

Inputs

InputTypeDefaultRequiredDescription
taskTask-yesInitial process object
firstLevelbooleanfalsenoTells formviewer process running is not first-level type. ( means its child of another process )
parentTaskbooleanfalsenoIf its not first-level type, please pass whos the parent.
hideNamebooleanfalsenoDecides to show process name or not
disabledbooleanfalsenoDisable or enable all the controls rendered on given form.

Outputs

OutputTypeDescription
(onDone)FVDoneResponseFired when process got status 1 (done)
(onLoaded)booleanFired after process been loaded (AfterViewInit)
(titleUpdated)stringFired when process title got updated
(taskUpdated)stringFired when task got updated

Also you may communicate with FVNotificationService. Example:

import { FVNotificationService, FVNotification } from '@dotgov/formviewer';

@Component({
  selector: 'app-component',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less'],
})
export class AppComponent {
  constructor(
    private fvNotification: FVNotificationService,
  ) {
    this.fvNotification.subscription((notify: FVNotification) => {
      const allowedTypes = ['error', 'info', 'success', 'warning'];
      if (allowedTypes.indexOf(notify.type) !== -1) {
        this.handleNotification[notify.type](notify.message, notify.title);
      }
    });
  }
}

Contributors

Contributor NameContributor Page
Grigore Melecagrigoreme
Mihail Racilamracila25

Development

Setup build path

Open ng-package.json and setup dest to location where you want your build to go. (example: ../myProject/node_modules/@dotgov/formviewer)

Build

npm run build

For more information read docs/developer_guide.md

Release

Use CI/CD for that. Or just run npm run old_school_release, of course if you have permissions ;)

2.0.18

3 years ago

2.0.17

3 years ago

2.0.16

3 years ago

2.0.15

4 years ago

2.0.14

4 years ago

2.0.13

4 years ago

2.0.11

4 years ago

2.0.10

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.4

4 years ago

2.0.2

4 years ago

2.0.0

4 years ago

1.8.82

4 years ago

1.8.81

4 years ago

1.8.80

4 years ago

1.8.79

5 years ago

1.8.78

5 years ago

1.8.77

5 years ago

1.8.76

5 years ago

1.8.75

5 years ago

1.8.74

5 years ago

1.8.73

5 years ago

1.8.72

5 years ago

1.8.71

5 years ago

1.8.70

5 years ago

1.8.69

5 years ago

1.8.68

5 years ago

1.8.67

5 years ago

1.8.66

5 years ago

1.8.65

5 years ago

1.8.64

5 years ago

1.8.63

5 years ago

1.8.62

5 years ago

1.8.61

5 years ago

1.8.60

5 years ago

1.8.59

5 years ago

1.8.58

5 years ago

1.8.57

5 years ago

1.8.56

5 years ago

1.8.55

5 years ago

1.8.54

5 years ago

1.8.53

5 years ago

1.8.52

5 years ago

1.8.51

5 years ago

1.8.50

5 years ago

1.8.49

5 years ago

1.8.48

5 years ago

1.8.47

5 years ago

1.8.46

5 years ago

1.8.45

5 years ago

1.8.44

5 years ago

1.8.43

5 years ago

1.8.42

5 years ago

1.8.40

5 years ago

1.8.39

5 years ago

1.8.38

5 years ago

1.8.37

5 years ago

1.8.36

5 years ago

1.8.35

5 years ago

1.8.34

5 years ago

1.8.33

5 years ago

1.8.32

5 years ago

1.8.31

5 years ago

1.8.30

5 years ago

1.8.29

5 years ago

1.8.28

5 years ago

1.8.27

5 years ago

1.8.26

5 years ago

1.8.25

5 years ago

1.8.24

5 years ago

1.8.23

5 years ago

1.8.22

5 years ago

1.8.21

5 years ago

1.8.20

5 years ago

1.8.19

5 years ago

1.8.18

5 years ago

1.8.17

5 years ago

1.8.16

5 years ago

1.8.15

5 years ago

1.8.14

5 years ago

1.8.13

5 years ago

1.8.12

5 years ago

1.8.11

5 years ago

1.8.10

6 years ago

1.8.9

6 years ago

1.8.8

6 years ago

1.8.7

6 years ago

1.8.6

6 years ago

1.8.5

6 years ago

1.8.4

6 years ago

1.8.3

6 years ago

1.8.2

6 years ago

1.8.1

6 years ago

1.8.0

6 years ago

1.7.80

6 years ago

1.7.78

6 years ago

1.7.77

6 years ago

1.7.76

6 years ago

1.7.75

6 years ago

1.7.74

6 years ago

1.7.73

6 years ago

1.7.72

6 years ago

1.7.71

6 years ago

1.7.70

6 years ago

1.7.69

6 years ago

1.7.68

6 years ago

1.7.67

6 years ago

1.7.66

6 years ago

1.7.65

6 years ago

1.7.64

6 years ago

1.7.63

6 years ago

1.7.62

6 years ago

1.7.61

6 years ago

1.7.60

6 years ago

1.7.59

6 years ago

1.7.58

6 years ago

1.7.57

6 years ago

1.7.56

6 years ago

1.7.55

6 years ago

1.7.54

6 years ago

1.7.53

6 years ago

1.7.52

6 years ago

1.7.51

6 years ago

1.7.50

6 years ago

1.7.49

6 years ago

1.7.47

6 years ago

1.7.46

6 years ago

1.7.45

6 years ago

1.7.44

6 years ago

1.7.43

6 years ago

1.7.42

6 years ago

1.7.41

6 years ago

1.7.40

6 years ago

1.7.39

6 years ago

1.7.38

6 years ago