New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@dotgov/formviewer

Package Overview
Dependencies
Maintainers
4
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotgov/formviewer

Form Viewer for DGS system.

latest
npmnpm
Version
2.0.18
Version published
Maintainers
4
Created
Source

Angular6 formviewer - Lightweight form renderer

  • Features
  • Getting started
  • Roadmap
  • API
  • Custom styles
  • Custom themes
  • Exports
  • Contributors
  • Development

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 ;)

Keywords

angular

FAQs

Package last updated on 24 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts