npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dotgov/z_formviewer

v0.1.68

Published

Form Viewer for DGS system.

Downloads

88

Readme

Angular5 formviewer - Lightweight form renderer

Features

  • [x] Production Mode (AOT compilation compatibility)
  • [x] Custom controls, html, pdf viewer, file upload, menu grid and other templates
  • [x] Multiple instances
  • [x] 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

import { FormViewerModule, FVEnviroment } from '@dotgov/formviewer';

const fvEnviroment: FVEnviroment = {
  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: [FormViewerModule.forRoot(fvEnviroment)],
  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

| Models | Services | Modules | | ------------- | ------------- | ------------- | | ApiResponse | ApiService | FormViewerModule | | Breadcrumbps | ProcessService | | FVNotificationService | FVNotification | | ComponentConfig | | Control | | ControlType | | BindingSet | | Dock | | DockItem | | Extract | | Field | | Item | | Model | | Path | | Proxy | | Tab | | Task | | FVDoneResponse | | FVEnviroment | | GridComponentConfig | | Store | | GridColumn | | EditHandler | | GridSort | | GridFilter | | GridConfig | | Lang | | Menu | | Folder |

API

Inputs

| Input | Type | Default | Required | Description | | ------------- | ------------- | ------------- | ------------- | ------------- | | task | Task | - | yes | Initial process object | | language | Lang | The one you sent in fvEnviroment | no | Sends active language to formviewer | | grid | boolean | false | no | Let formviewer know that you are gonna use instance as a grid | | hideName | boolean | false | no | Decides to show process name or not |

Outputs

| Output | Type | Description | | ------------- | ------------- | ------------- | | (onDone) | FVDoneResponse | Fired when process got status 1 (done) | | (onLoaded) | boolean | Fired after process been loaded (AfterViewInit) | | (titleUpdated) | string | Fired when process title 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);
      }
    });
  }
}

Custom styles

Not implemented yet.

Contributors

| Contributor Name | Contributor Page | | ------------- | ------------- | | Grigore Meleca | grigoreme |

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

To release to npm just run npm run release, of course if you have permissions ;)

Inspiration

Thanks to ng-select for README inspiration.