@piserve-tech/octa-form-submission-webcomponent 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +14 -131
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,144 +1,27 @@
1
- # 🧩 Octa Form Submission Web Component
1
+ # AngularFormSubmissionComponent
2
2
 
3
- The **Octa Form Submission 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.
3
+ This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.8.
4
4
 
5
- ---
5
+ ## Development server
6
6
 
7
- ## 🚀 Installation
7
+ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
8
8
 
9
- ### Step 1: Install the package
9
+ ## Code scaffolding
10
10
 
11
- ```bash
12
- npm i @piserve-tech/octa-form-submission-webcomponent
13
- ```
11
+ Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
14
12
 
15
- ---
13
+ ## Build
16
14
 
17
- ## ⚙️ Setup Guide
15
+ Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
18
16
 
19
- ### Step 2: Copy Required Assets
17
+ ## Running unit tests
20
18
 
21
- Run the following command to copy the assets (bundle.js and bundle.css) into your project’s `assets` folder.
19
+ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
22
20
 
23
- ```bash
24
- node .\node_modules\@piserve-tech\octa-form-submission-webcomponent\copy-assets.js
25
- ```
21
+ ## Running end-to-end tests
26
22
 
27
- This script will copy files into:
28
- ```
29
- /src/assets/octa-form-submission-webcomponent/
30
- ```
23
+ Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
31
24
 
32
- ---
25
+ ## Further help
33
26
 
34
- ### Step 3: Add Component in HTML
35
-
36
- Use the web component directly in your HTML file or within any framework template:
37
-
38
- ```html
39
- <octa-form-submission-webcomponent
40
- formData='{"apiurl":"http://192.168.2.189:8080","modulename":"b673ddd3-066e-4261-aa32-41ccfe6e1864","headers":{"contentType":"application/json","auth-user":"John","acceptedLanguage":"en"},"skipMargin":false}'
41
- submissionid="4a76519a-78aa-4d2c-8abf-52e1bb081ab5"
42
- [edit]="edit"
43
- (submitForm) = "submitForm($event)"
44
- (apiCalled)="getFormApiCalled($event)"
45
- ></octa-form-submission-webcomponent>
46
- ```
47
- ---
48
-
49
- ### Step 4: Load JS & CSS (Optional for Frameworks)
50
-
51
- If your environment doesn’t automatically include the assets, load them dynamically in your code.
52
-
53
- #### Example (JavaScript or Angular):
54
-
55
- ```typescript
56
- loadScript(src: string): Promise<void> {
57
- return new Promise((resolve, reject) => {
58
- if (document.querySelector(`script[src="${src}"]`)) {
59
- resolve();
60
- return;
61
- }
62
- const script = document.createElement('script');
63
- script.src = src;
64
- script.onload = () => resolve();
65
- script.onerror = () => reject();
66
- document.body.appendChild(script);
67
- });
68
- }
69
-
70
- loadStyle(href: string): Promise<void> {
71
- return new Promise((resolve, reject) => {
72
- if (document.querySelector(`link[href="${href}"]`)) {
73
- resolve();
74
- return;
75
- }
76
- const link = document.createElement('link');
77
- link.rel = 'stylesheet';
78
- link.href = href;
79
- link.onload = () => resolve();
80
- link.onerror = () => reject();
81
- document.head.appendChild(link);
82
- });
83
- }
84
-
85
- async ngAfterViewInit() {
86
- await this.loadStyle('./assets/octa-form-submission-webcomponent/bundle.css');
87
- await this.loadScript('./assets/octa-form-submission-webcomponent/bundle.js');
88
- const el = document.querySelector('octa-form-submission-webcomponent') as any;
89
- if (el) {
90
- el.formId = this.id;
91
- el.edit = true;
92
- el.showModifyInfo = false;
93
- el.formData = this.formData;
94
- el.top = '0';
95
- el.createDuplicate = false;
96
- el.formElements = this.formElements;
97
- }
98
- }
99
- ```
100
-
101
- ---
102
-
103
- ### Step 5 (Angular Only): Add `CUSTOM_ELEMENTS_SCHEMA`
104
-
105
- If you are using Angular, include `CUSTOM_ELEMENTS_SCHEMA` in your module file (e.g. `app.module.ts`).
106
-
107
- ```typescript
108
- import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
109
- import { BrowserModule } from '@angular/platform-browser';
110
- import { AppComponent } from './app.component';
111
-
112
- @NgModule({
113
- declarations: [AppComponent],
114
- imports: [BrowserModule],
115
- bootstrap: [AppComponent],
116
- schemas: [CUSTOM_ELEMENTS_SCHEMA] // 👈 Important for Web Components
117
- })
118
- export class AppModule {}
119
- ```
120
-
121
- ---
122
-
123
- ### Step 6 (Optional): Add Bundle in `angular.json`
124
-
125
- If you prefer referencing the bundle directly via Angular CLI build options, include the following line:
126
-
127
- ```json
128
- "scripts": [
129
- "node_modules/@piserve-tech/octa-form-submission-webcomponent/dist/bundle.js"
130
- ]
131
- ```
132
- ---
133
-
134
- ## 🛠️ Tech Stack
135
- - **Web Components (Custom Elements API)**
136
- - **Angular 16+ Compatible**
137
- - **TypeScript**
138
- - **Node.js (for asset copy script)**
139
-
140
- ---
141
-
142
- ## 📄 License
143
- **© 2025 Piserve Technologies Pvt Ltd**
144
- Licensed under the **MIT License**.
27
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@piserve-tech/octa-form-submission-webcomponent",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Distributable web component build for form submission (bundle.js, bundle.css, fonts, icons)",
5
5
  "main": "dist/bundle.js",
6
6
  "style": "dist/bundle.css",
@@ -42,7 +42,7 @@
42
42
  "@piserve-tech/drop-down": "1.2.89",
43
43
  "@piserve-tech/file-preview": "1.0.0",
44
44
  "@piserve-tech/file-upload": "1.1.51",
45
- "@piserve-tech/octa-form-submission-webcomponent": "^1.0.25",
45
+ "@piserve-tech/octa-form-submission-webcomponent": "^1.0.27",
46
46
  "@syncfusion/ej2-material-theme": "~25.1.40",
47
47
  "@types/google.maps": "^3.55.8",
48
48
  "@types/googlemaps": "^3.43.3",