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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@piserve-tech/octa-form-preview-webcomponent

v1.0.9

Published

Distributable web component build for form preview (bundle.js, bundle.css, fonts, icons)

Readme

🧩 Octa Form Preview Web Component

The Octa Form Preview Web Component is a fully framework-independent, reusable UI component that enables developers to dynamically create, edit, and manage forms. It can be used seamlessly in Angular, React, Vue, or pure HTML/JavaScript environments.


🚀 Installation

Step 1: Install the package

npm i @piserve-tech/octa-form-preview-webcomponent

⚙️ Setup Guide

Step 2: Copy Required Assets

Run the following command to copy the assets (bundle.js and bundle.css) into your project’s assets folder.

node .\node_modules\@piserve-tech\octa-form-preview-webcomponent\copy-assets.js

This script will copy files into:

/src/assets/octa-form-preview-webcomponent/

Step 3: Add Component in HTML

Use the web component directly in your HTML file or within any framework template:

<octa-form-preview-webcomponent
submissionid="submissionid" formdata="formdata" language="en"></octa-form-preview-webcomponent>

Step 4: Load JS & CSS (Optional for Frameworks)

If your environment doesn’t automatically include the assets, load them dynamically in your code.

Example (JavaScript or Angular):

loadScript(src: string): Promise<void> {
  return new Promise((resolve, reject) => {
    if (document.querySelector(`script[src="${src}"]`)) {
      resolve();
      return;
    }
    const script = document.createElement('script');
    script.src = src;
    script.onload = () => resolve();
    script.onerror = () => reject();
    document.body.appendChild(script);
  });
}

loadStyle(href: string): Promise<void> {
  return new Promise((resolve, reject) => {
    if (document.querySelector(`link[href="${href}"]`)) {
      resolve();
      return;
    }
    const link = document.createElement('link');
    link.rel = 'stylesheet';
    link.href = href;
    link.onload = () => resolve();
    link.onerror = () => reject();
    document.head.appendChild(link);
  });
}

async ngAfterViewInit() {
  await this.loadStyle('./assets/octa-form-preview-webcomponent/bundle.css');
  await this.loadScript('./assets/octa-form-preview-webcomponent/bundle.js');
  const el = document.querySelector('octa-form-preview-webcomponent') as any;
  if (el) {
    el.formId = this.id;
    el.edit = true;
    el.showModifyInfo = false;
    el.formData = this.formData;
    el.top = '0';
    el.createDuplicate = false;
    el.formElements = this.formElements;
  }
}

Step 5 (Angular Only): Add CUSTOM_ELEMENTS_SCHEMA

If you are using Angular, include CUSTOM_ELEMENTS_SCHEMA in your module file (e.g. app.module.ts).

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  bootstrap: [AppComponent],
  schemas: [CUSTOM_ELEMENTS_SCHEMA] // 👈 Important for Web Components
})
export class AppModule {}

Step 6 (Optional): Add Bundle in angular.json

If you prefer referencing the bundle directly via Angular CLI build options, include the following line:

"scripts": [
  "node_modules/@piserve-tech/octa-form-preview-webcomponent/dist/bundle.js"
]

🛠️ Tech Stack

  • Web Components (Custom Elements API)
  • Angular 16+ Compatible
  • TypeScript
  • Node.js (for asset copy script)

📄 License

© 2025 Piserve Technologies Pvt Ltd
Licensed under the MIT License.