qr-scanner-app 0.0.0 → 0.0.1
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.
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qr-scanner-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"ng": "ng",
|
|
6
6
|
"start": "ng serve",
|
|
7
7
|
"build": "ng build",
|
|
8
|
+
"build:lib": "ng build ngx-custom-qr-scanner",
|
|
9
|
+
"pack:lib": "cd dist/ngx-custom-qr-scanner && npm pack",
|
|
10
|
+
"publish:lib": "cd dist/ngx-custom-qr-scanner && npm publish",
|
|
8
11
|
"watch": "ng build --watch --configuration development",
|
|
9
12
|
"test": "ng test"
|
|
10
13
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dheeraj Prajapati
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,63 +1,159 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ngx-custom-qr-scanner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A modern, feature-rich Angular QR code scanner library with an elegant UI, zoom controls, and torch/flash support. Built as a standalone component for Angular 19+.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## ✨ Features
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- 🎯 **Standalone Component** - Easy integration with Angular 19+
|
|
8
|
+
- 📱 **Responsive Design** - Works on desktop and mobile devices
|
|
9
|
+
- 🔦 **Torch/Flash Support** - Toggle flash for scanning in low light
|
|
10
|
+
- 🔍 **Zoom Controls** - Adjustable zoom with vertical slider
|
|
11
|
+
- 🎨 **Premium UI** - Modern interface with red sidebars and scan animations
|
|
12
|
+
- 🔄 **Inverted QR Support** - Scans both normal and inverted (white on black) QR codes
|
|
13
|
+
- 📸 **Auto-start** - Begins scanning immediately on component load
|
|
14
|
+
- 🎯 **Environment Camera** - Defaults to back camera on mobile devices
|
|
15
|
+
|
|
16
|
+
## 📦 Installation
|
|
8
17
|
|
|
9
18
|
```bash
|
|
10
|
-
|
|
19
|
+
npm install ngx-custom-qr-scanner qr-scanner
|
|
11
20
|
```
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
> **Note:** `qr-scanner` is a peer dependency and must be installed separately.
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
## 🚀 Quick Start
|
|
25
|
+
|
|
26
|
+
### 1. Import the Component
|
|
27
|
+
|
|
28
|
+
Since this is a standalone component, you can import it directly into your component or module:
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import { Component } from '@angular/core';
|
|
32
|
+
import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
|
|
33
|
+
|
|
34
|
+
@Component({
|
|
35
|
+
selector: 'app-root',
|
|
36
|
+
standalone: true,
|
|
37
|
+
imports: [NgxCustomQrScannerComponent],
|
|
38
|
+
template: `<ngx-custom-qr-scanner></ngx-custom-qr-scanner>`
|
|
39
|
+
})
|
|
40
|
+
export class AppComponent { }
|
|
17
41
|
```
|
|
18
42
|
|
|
19
|
-
|
|
43
|
+
### 2. Use in Your Template
|
|
20
44
|
|
|
21
|
-
|
|
45
|
+
```html
|
|
46
|
+
<ngx-custom-qr-scanner></ngx-custom-qr-scanner>
|
|
47
|
+
```
|
|
22
48
|
|
|
23
|
-
|
|
24
|
-
|
|
49
|
+
That's it! The scanner will automatically start when the component loads.
|
|
50
|
+
|
|
51
|
+
## 🎛️ Usage
|
|
52
|
+
|
|
53
|
+
### Basic Implementation
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { Component } from '@angular/core';
|
|
57
|
+
import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
|
|
58
|
+
|
|
59
|
+
@Component({
|
|
60
|
+
selector: 'app-scanner-page',
|
|
61
|
+
standalone: true,
|
|
62
|
+
imports: [NgxCustomQrScannerComponent],
|
|
63
|
+
template: `
|
|
64
|
+
<div class="scanner-wrapper">
|
|
65
|
+
<ngx-custom-qr-scanner></ngx-custom-qr-scanner>
|
|
66
|
+
</div>
|
|
67
|
+
`,
|
|
68
|
+
styles: [`
|
|
69
|
+
.scanner-wrapper {
|
|
70
|
+
width: 100vw;
|
|
71
|
+
height: 100vh;
|
|
72
|
+
}
|
|
73
|
+
`]
|
|
74
|
+
})
|
|
75
|
+
export class ScannerPageComponent { }
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### In a Non-Standalone Module
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { NgModule } from '@angular/core';
|
|
82
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
83
|
+
import { NgxCustomQrScannerComponent } from 'ngx-custom-qr-scanner';
|
|
84
|
+
import { AppComponent } from './app.component';
|
|
85
|
+
|
|
86
|
+
@NgModule({
|
|
87
|
+
declarations: [AppComponent],
|
|
88
|
+
imports: [
|
|
89
|
+
BrowserModule,
|
|
90
|
+
NgxCustomQrScannerComponent // Import the standalone component
|
|
91
|
+
],
|
|
92
|
+
bootstrap: [AppComponent]
|
|
93
|
+
})
|
|
94
|
+
export class AppModule { }
|
|
25
95
|
```
|
|
26
96
|
|
|
27
|
-
|
|
97
|
+
## 🎨 UI Components
|
|
28
98
|
|
|
29
|
-
|
|
99
|
+
The scanner includes:
|
|
30
100
|
|
|
31
|
-
|
|
101
|
+
- **Left Sidebar**: Displays "Tyre QR Code" text vertically with a thumbnail placeholder
|
|
102
|
+
- **Center Area**: Live camera feed with scan region overlay and animated scan line
|
|
103
|
+
- **Right Sidebar**:
|
|
104
|
+
- Torch/Flash toggle button
|
|
105
|
+
- Vertical zoom slider with real-time zoom value display
|
|
32
106
|
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd dist/ngx-custom-qr-scanner
|
|
36
|
-
```
|
|
107
|
+
## 📱 Browser Compatibility
|
|
37
108
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
109
|
+
- Chrome/Edge 87+
|
|
110
|
+
- Firefox 88+
|
|
111
|
+
- Safari 14.1+
|
|
112
|
+
- Mobile browsers with camera access
|
|
42
113
|
|
|
43
|
-
|
|
114
|
+
> **Note:** Requires HTTPS in production for camera access.
|
|
44
115
|
|
|
45
|
-
|
|
116
|
+
## 🔧 API Reference
|
|
46
117
|
|
|
47
|
-
|
|
48
|
-
|
|
118
|
+
### Component Selector
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
selector: 'ngx-custom-qr-scanner'
|
|
49
122
|
```
|
|
50
123
|
|
|
51
|
-
|
|
124
|
+
### Public Properties
|
|
52
125
|
|
|
53
|
-
|
|
126
|
+
The component currently handles QR scanning internally and displays results via alert. Future versions will include output events for custom handling.
|
|
54
127
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
128
|
+
## 🤝 Contributing
|
|
129
|
+
|
|
130
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
131
|
+
|
|
132
|
+
1. Fork the repository
|
|
133
|
+
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
|
|
134
|
+
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
|
|
135
|
+
4. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
136
|
+
5. Open a Pull Request
|
|
137
|
+
|
|
138
|
+
## 📄 License
|
|
139
|
+
|
|
140
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
141
|
+
|
|
142
|
+
## 👨💻 Author
|
|
143
|
+
|
|
144
|
+
**Dheeraj Prajapati**
|
|
145
|
+
- Email: dheerajprajapati9898@gmail.com
|
|
146
|
+
- GitHub: [@dheerajprajapati9898](https://github.com/dheerajprajapati9898)
|
|
147
|
+
|
|
148
|
+
## 🐛 Issues
|
|
149
|
+
|
|
150
|
+
Found a bug? Please [open an issue](https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner/issues) with a detailed description.
|
|
151
|
+
|
|
152
|
+
## 🙏 Acknowledgments
|
|
58
153
|
|
|
59
|
-
|
|
154
|
+
- Built with [qr-scanner](https://github.com/nimiq/qr-scanner) library
|
|
155
|
+
- Designed for Angular 19+
|
|
60
156
|
|
|
61
|
-
|
|
157
|
+
---
|
|
62
158
|
|
|
63
|
-
|
|
159
|
+
**Happy Scanning! 📱✨**
|
|
@@ -10,11 +10,15 @@
|
|
|
10
10
|
],
|
|
11
11
|
"private": false,
|
|
12
12
|
"license": "MIT",
|
|
13
|
+
"homepage": "https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner#readme",
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "git+https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner.git"
|
|
16
17
|
},
|
|
17
|
-
"
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/dheerajprajapati9898/ngx-custom-qr-scanner/issues"
|
|
20
|
+
},
|
|
21
|
+
"author": "Dheeraj Prajapati <dheerajprajapati9898@gmail.com>",
|
|
18
22
|
"peerDependencies": {
|
|
19
23
|
"@angular/common": "^19.2.0",
|
|
20
24
|
"@angular/core": "^19.2.0",
|
package/src.zip
ADDED
|
Binary file
|