@sam-senior/zebra-printer 1.0.3 → 2.0.0
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/README.md +14 -14
- package/esm2022/lib/sam-zebra-printer.service.mjs +49 -0
- package/esm2022/public_api.mjs +5 -0
- package/esm2022/sam-senior-zebra-printer.mjs +5 -0
- package/fesm2022/sam-senior-zebra-printer.mjs +60 -0
- package/fesm2022/sam-senior-zebra-printer.mjs.map +1 -0
- package/{sam-senior-zebra-printer.d.ts → index.d.ts} +1 -0
- package/lib/sam-zebra-printer.service.d.ts +3 -0
- package/package.json +18 -14
- package/bundles/sam-senior-zebra-printer.umd.js +0 -242
- package/bundles/sam-senior-zebra-printer.umd.js.map +0 -1
- package/bundles/sam-senior-zebra-printer.umd.min.js +0 -2
- package/bundles/sam-senior-zebra-printer.umd.min.js.map +0 -1
- package/esm2015/lib/sam-zebra-printer.service.js +0 -94
- package/esm2015/public_api.js +0 -9
- package/esm2015/sam-senior-zebra-printer.js +0 -9
- package/esm5/lib/sam-zebra-printer.service.js +0 -125
- package/esm5/public_api.js +0 -9
- package/esm5/sam-senior-zebra-printer.js +0 -9
- package/fesm2015/sam-senior-zebra-printer.js +0 -94
- package/fesm2015/sam-senior-zebra-printer.js.map +0 -1
- package/fesm5/sam-senior-zebra-printer.js +0 -124
- package/fesm5/sam-senior-zebra-printer.js.map +0 -1
- package/sam-senior-zebra-printer.metadata.json +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
# Zebra printer
|
|
3
|
-
|
|
4
|
-
***Como usar***
|
|
5
|
-
|
|
6
|
-
Importe o `sam-zebra-printer-service` para o projeto e utilizar o serviço SamZebraPrinterService.
|
|
7
|
-
```
|
|
8
|
-
export class TestPrintComponent {
|
|
9
|
-
constructor(private SamZebraPrinter: SamZebraPrinterService) {}
|
|
10
|
-
|
|
11
|
-
public async print() {
|
|
12
|
-
await this.SamZebraPrinter.printTest();
|
|
13
|
-
}
|
|
14
|
-
}
|
|
1
|
+
|
|
2
|
+
# Zebra printer
|
|
3
|
+
|
|
4
|
+
***Como usar***
|
|
5
|
+
|
|
6
|
+
Importe o `sam-zebra-printer-service` para o projeto e utilizar o serviço SamZebraPrinterService.
|
|
7
|
+
```
|
|
8
|
+
export class TestPrintComponent {
|
|
9
|
+
constructor(private SamZebraPrinter: SamZebraPrinterService) {}
|
|
10
|
+
|
|
11
|
+
public async print() {
|
|
12
|
+
await this.SamZebraPrinter.printTest();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
15
|
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common/http";
|
|
4
|
+
export class SamZebraPrinterService {
|
|
5
|
+
httpClient;
|
|
6
|
+
printerError = null;
|
|
7
|
+
constructor(httpClient) {
|
|
8
|
+
this.httpClient = httpClient;
|
|
9
|
+
}
|
|
10
|
+
async print(content, ip = '127.0.0.1', isSSL = false) {
|
|
11
|
+
try {
|
|
12
|
+
this.printerError = null;
|
|
13
|
+
const http = new XMLHttpRequest();
|
|
14
|
+
http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);
|
|
15
|
+
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
16
|
+
http.send(content);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
this.printerError = err;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async printTest(ip = '127.0.0.1', isSSL = false) {
|
|
23
|
+
const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
24
|
+
'^XA' +
|
|
25
|
+
'^MMT' +
|
|
26
|
+
'^PW831' +
|
|
27
|
+
'^LL0480' +
|
|
28
|
+
'^LS0' +
|
|
29
|
+
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
30
|
+
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
31
|
+
'^PQ1,0,1,Y^XZ;';
|
|
32
|
+
await this.print(content, ip, isSSL);
|
|
33
|
+
}
|
|
34
|
+
haveError() {
|
|
35
|
+
return !!this.printerError;
|
|
36
|
+
}
|
|
37
|
+
getError() {
|
|
38
|
+
return this.printerError;
|
|
39
|
+
}
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, providedIn: 'root' });
|
|
42
|
+
}
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, decorators: [{
|
|
44
|
+
type: Injectable,
|
|
45
|
+
args: [{
|
|
46
|
+
providedIn: 'root'
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXplYnJhLXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3NhbS16ZWJyYS1wcmludGVyL3NyYy9saWIvc2FtLXplYnJhLXByaW50ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7QUFNM0MsTUFBTSxPQUFPLHNCQUFzQjtJQUt2QjtJQUhGLFlBQVksR0FBRyxJ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vcjtcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of zebra-printer
|
|
3
|
+
*/
|
|
4
|
+
export * from './lib/sam-zebra-printer.service';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3NhbS16ZWJyYS1wcmludGVyL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxpQ0FBaUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXHJcbiAqIFB1YmxpYyBBUEkgU3VyZmFjZSBvZiB6ZWJyYS1wcmludGVyXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2FtLXplYnJhLXByaW50ZXIuc2VydmljZSc7XHJcbiJdfQ==
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXNlbmlvci16ZWJyYS1wcmludGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvc2FtLXplYnJhLXByaW50ZXIvc3JjL3NhbS1zZW5pb3ItemVicmEtcHJpbnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common/http';
|
|
4
|
+
|
|
5
|
+
class SamZebraPrinterService {
|
|
6
|
+
httpClient;
|
|
7
|
+
printerError = null;
|
|
8
|
+
constructor(httpClient) {
|
|
9
|
+
this.httpClient = httpClient;
|
|
10
|
+
}
|
|
11
|
+
async print(content, ip = '127.0.0.1', isSSL = false) {
|
|
12
|
+
try {
|
|
13
|
+
this.printerError = null;
|
|
14
|
+
const http = new XMLHttpRequest();
|
|
15
|
+
http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);
|
|
16
|
+
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
17
|
+
http.send(content);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
this.printerError = err;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async printTest(ip = '127.0.0.1', isSSL = false) {
|
|
24
|
+
const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
25
|
+
'^XA' +
|
|
26
|
+
'^MMT' +
|
|
27
|
+
'^PW831' +
|
|
28
|
+
'^LL0480' +
|
|
29
|
+
'^LS0' +
|
|
30
|
+
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
31
|
+
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
32
|
+
'^PQ1,0,1,Y^XZ;';
|
|
33
|
+
await this.print(content, ip, isSSL);
|
|
34
|
+
}
|
|
35
|
+
haveError() {
|
|
36
|
+
return !!this.printerError;
|
|
37
|
+
}
|
|
38
|
+
getError() {
|
|
39
|
+
return this.printerError;
|
|
40
|
+
}
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
42
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, providedIn: 'root' });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SamZebraPrinterService, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{
|
|
47
|
+
providedIn: 'root'
|
|
48
|
+
}]
|
|
49
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
* Public API Surface of zebra-printer
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Generated bundle index. Do not edit.
|
|
57
|
+
*/
|
|
58
|
+
|
|
59
|
+
export { SamZebraPrinterService };
|
|
60
|
+
//# sourceMappingURL=sam-senior-zebra-printer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sam-senior-zebra-printer.mjs","sources":["../../../projects/sam-zebra-printer/src/lib/sam-zebra-printer.service.ts","../../../projects/sam-zebra-printer/src/public_api.ts","../../../projects/sam-zebra-printer/src/sam-senior-zebra-printer.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SamZebraPrinterService {\r\n\r\n private printerError = null;\r\n\r\n constructor(\r\n private httpClient: HttpClient\r\n ) { }\r\n\r\n public async print(content: string, ip = '127.0.0.1', isSSL = false): Promise<void> {\r\n try {\r\n this.printerError = null;\r\n const http = new XMLHttpRequest();\r\n http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);\r\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\r\n http.send(content);\r\n } catch (err) {\r\n this.printerError = err;\r\n }\r\n }\r\n\r\n public async printTest(ip = '127.0.0.1', isSSL = false): Promise<void> {\r\n const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +\r\n '^XA' +\r\n '^MMT' +\r\n '^PW831' +\r\n '^LL0480' +\r\n '^LS0' +\r\n '^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +\r\n '^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +\r\n '^PQ1,0,1,Y^XZ;';\r\n await this.print(content, ip, isSSL);\r\n }\r\n\r\n public haveError(): boolean {\r\n return !!this.printerError;\r\n }\r\n\r\n public getError(): HttpErrorResponse {\r\n return this.printerError;\r\n }\r\n}\r\n","/*\r\n * Public API Surface of zebra-printer\r\n */\r\n\r\nexport * from './lib/sam-zebra-printer.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;MAMa,sBAAsB,CAAA;AAKvB,IAAA,UAAA,CAAA;IAHF,YAAY,GAAG,IAAI,CAAC;AAE5B,IAAA,WAAA,CACU,UAAsB,EAAA;QAAtB,IAAU,CAAA,UAAA,GAAV,UAAU,CAAY;KAC3B;IAEE,MAAM,KAAK,CAAC,OAAe,EAAE,EAAE,GAAG,WAAW,EAAE,KAAK,GAAG,KAAK,EAAA;AACjE,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;AACzB,YAAA,MAAM,IAAI,GAAG,IAAI,cAAc,EAAE,CAAC;YAClC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAO,IAAA,EAAA,KAAK,GAAG,GAAG,GAAG,EAAE,CAAA,GAAA,EAAM,EAAE,CAAkB,gBAAA,CAAA,EAAE,IAAI,CAAC,CAAC;AA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ular/common/http';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class SamZebraPrinterService {
|
|
3
4
|
private httpClient;
|
|
4
5
|
private printerError;
|
|
@@ -7,4 +8,6 @@ export declare class SamZebraPrinterService {
|
|
|
7
8
|
printTest(ip?: string, isSSL?: boolean): Promise<void>;
|
|
8
9
|
haveError(): boolean;
|
|
9
10
|
getError(): HttpErrorResponse;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SamZebraPrinterService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SamZebraPrinterService>;
|
|
10
13
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sam-senior/zebra-printer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
5
|
+
"@angular/common": "^18.0.0",
|
|
6
|
+
"@angular/core": "^18.0.0"
|
|
7
|
+
},
|
|
8
|
+
"module": "fesm2022/sam-senior-zebra-printer.mjs",
|
|
9
|
+
"typings": "index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
"./package.json": {
|
|
12
|
+
"default": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"esm2022": "./esm2022/sam-senior-zebra-printer.mjs",
|
|
17
|
+
"esm": "./esm2022/sam-senior-zebra-printer.mjs",
|
|
18
|
+
"default": "./fesm2022/sam-senior-zebra-printer.mjs"
|
|
19
|
+
}
|
|
7
20
|
},
|
|
8
|
-
"main": "bundles/sam-senior-zebra-printer.umd.js",
|
|
9
|
-
"module": "fesm5/sam-senior-zebra-printer.js",
|
|
10
|
-
"es2015": "fesm2015/sam-senior-zebra-printer.js",
|
|
11
|
-
"esm5": "esm5/sam-senior-zebra-printer.js",
|
|
12
|
-
"esm2015": "esm2015/sam-senior-zebra-printer.js",
|
|
13
|
-
"fesm5": "fesm5/sam-senior-zebra-printer.js",
|
|
14
|
-
"fesm2015": "fesm2015/sam-senior-zebra-printer.js",
|
|
15
|
-
"typings": "sam-senior-zebra-printer.d.ts",
|
|
16
|
-
"metadata": "sam-senior-zebra-printer.metadata.json",
|
|
17
21
|
"sideEffects": false,
|
|
18
22
|
"dependencies": {
|
|
19
|
-
"tslib": "^
|
|
23
|
+
"tslib": "^2.3.0"
|
|
20
24
|
}
|
|
21
|
-
}
|
|
25
|
+
}
|
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@sam-senior/zebra-printer', ['exports', '@angular/core', '@angular/common/http'], factory) :
|
|
4
|
-
(factory((global['sam-senior'] = global['sam-senior'] || {}, global['sam-senior']['zebra-printer'] = {}),global.ng.core,global.ng.common.http));
|
|
5
|
-
}(this, (function (exports,i0,i1) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/*! *****************************************************************************
|
|
8
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
10
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
11
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
|
|
13
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
15
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
16
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
17
|
-
|
|
18
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
19
|
-
and limitations under the License.
|
|
20
|
-
***************************************************************************** */
|
|
21
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
22
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
|
-
function fulfilled(value) { try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
}
|
|
26
|
-
catch (e) {
|
|
27
|
-
reject(e);
|
|
28
|
-
} }
|
|
29
|
-
function rejected(value) { try {
|
|
30
|
-
step(generator["throw"](value));
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
} }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function __generator(thisArg, body) {
|
|
40
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
41
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
42
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
43
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
44
|
-
function step(op) {
|
|
45
|
-
if (f)
|
|
46
|
-
throw new TypeError("Generator is already executing.");
|
|
47
|
-
while (_)
|
|
48
|
-
try {
|
|
49
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
50
|
-
return t;
|
|
51
|
-
if (y = 0, t)
|
|
52
|
-
op = [op[0] & 2, t.value];
|
|
53
|
-
switch (op[0]) {
|
|
54
|
-
case 0:
|
|
55
|
-
case 1:
|
|
56
|
-
t = op;
|
|
57
|
-
break;
|
|
58
|
-
case 4:
|
|
59
|
-
_.label++;
|
|
60
|
-
return { value: op[1], done: false };
|
|
61
|
-
case 5:
|
|
62
|
-
_.label++;
|
|
63
|
-
y = op[1];
|
|
64
|
-
op = [0];
|
|
65
|
-
continue;
|
|
66
|
-
case 7:
|
|
67
|
-
op = _.ops.pop();
|
|
68
|
-
_.trys.pop();
|
|
69
|
-
continue;
|
|
70
|
-
default:
|
|
71
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
72
|
-
_ = 0;
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
76
|
-
_.label = op[1];
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
80
|
-
_.label = t[1];
|
|
81
|
-
t = op;
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
if (t && _.label < t[2]) {
|
|
85
|
-
_.label = t[2];
|
|
86
|
-
_.ops.push(op);
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
if (t[2])
|
|
90
|
-
_.ops.pop();
|
|
91
|
-
_.trys.pop();
|
|
92
|
-
continue;
|
|
93
|
-
}
|
|
94
|
-
op = body.call(thisArg, _);
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
op = [6, e];
|
|
98
|
-
y = 0;
|
|
99
|
-
}
|
|
100
|
-
finally {
|
|
101
|
-
f = t = 0;
|
|
102
|
-
}
|
|
103
|
-
if (op[0] & 5)
|
|
104
|
-
throw op[1];
|
|
105
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* @fileoverview added by tsickle
|
|
111
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
112
|
-
*/
|
|
113
|
-
var SamZebraPrinterService = /** @class */ (function () {
|
|
114
|
-
function SamZebraPrinterService(httpClient) {
|
|
115
|
-
this.httpClient = httpClient;
|
|
116
|
-
this.printerError = null;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* @param {?} content
|
|
120
|
-
* @param {?=} ip
|
|
121
|
-
* @param {?=} isSSL
|
|
122
|
-
* @return {?}
|
|
123
|
-
*/
|
|
124
|
-
SamZebraPrinterService.prototype.print = /**
|
|
125
|
-
* @param {?} content
|
|
126
|
-
* @param {?=} ip
|
|
127
|
-
* @param {?=} isSSL
|
|
128
|
-
* @return {?}
|
|
129
|
-
*/
|
|
130
|
-
function (content, ip, isSSL) {
|
|
131
|
-
if (ip === void 0) {
|
|
132
|
-
ip = '127.0.0.1';
|
|
133
|
-
}
|
|
134
|
-
if (isSSL === void 0) {
|
|
135
|
-
isSSL = false;
|
|
136
|
-
}
|
|
137
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
138
|
-
var http;
|
|
139
|
-
return __generator(this, function (_a) {
|
|
140
|
-
try {
|
|
141
|
-
this.printerError = null;
|
|
142
|
-
http = new XMLHttpRequest();
|
|
143
|
-
http.open('POST', "http" + (isSSL ? 's' : '') + "://" + ip + "/printer/pstprnt", true);
|
|
144
|
-
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
145
|
-
http.send(content);
|
|
146
|
-
}
|
|
147
|
-
catch (err) {
|
|
148
|
-
this.printerError = err;
|
|
149
|
-
}
|
|
150
|
-
return [2 /*return*/];
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
/**
|
|
155
|
-
* @param {?=} ip
|
|
156
|
-
* @param {?=} isSSL
|
|
157
|
-
* @return {?}
|
|
158
|
-
*/
|
|
159
|
-
SamZebraPrinterService.prototype.printTest = /**
|
|
160
|
-
* @param {?=} ip
|
|
161
|
-
* @param {?=} isSSL
|
|
162
|
-
* @return {?}
|
|
163
|
-
*/
|
|
164
|
-
function (ip, isSSL) {
|
|
165
|
-
if (ip === void 0) {
|
|
166
|
-
ip = '127.0.0.1';
|
|
167
|
-
}
|
|
168
|
-
if (isSSL === void 0) {
|
|
169
|
-
isSSL = false;
|
|
170
|
-
}
|
|
171
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
-
var content;
|
|
173
|
-
return __generator(this, function (_a) {
|
|
174
|
-
switch (_a.label) {
|
|
175
|
-
case 0:
|
|
176
|
-
content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
177
|
-
'^XA' +
|
|
178
|
-
'^MMT' +
|
|
179
|
-
'^PW831' +
|
|
180
|
-
'^LL0480' +
|
|
181
|
-
'^LS0' +
|
|
182
|
-
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
183
|
-
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
184
|
-
'^PQ1,0,1,Y^XZ;';
|
|
185
|
-
return [4 /*yield*/, this.print(content, ip, isSSL)];
|
|
186
|
-
case 1:
|
|
187
|
-
_a.sent();
|
|
188
|
-
return [2 /*return*/];
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* @return {?}
|
|
195
|
-
*/
|
|
196
|
-
SamZebraPrinterService.prototype.haveError = /**
|
|
197
|
-
* @return {?}
|
|
198
|
-
*/
|
|
199
|
-
function () {
|
|
200
|
-
return !!this.printerError;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* @return {?}
|
|
204
|
-
*/
|
|
205
|
-
SamZebraPrinterService.prototype.getError = /**
|
|
206
|
-
* @return {?}
|
|
207
|
-
*/
|
|
208
|
-
function () {
|
|
209
|
-
return this.printerError;
|
|
210
|
-
};
|
|
211
|
-
SamZebraPrinterService.decorators = [
|
|
212
|
-
{ type: i0.Injectable, args: [{
|
|
213
|
-
providedIn: 'root'
|
|
214
|
-
},] }
|
|
215
|
-
];
|
|
216
|
-
/** @nocollapse */
|
|
217
|
-
SamZebraPrinterService.ctorParameters = function () {
|
|
218
|
-
return [
|
|
219
|
-
{ type: i1.HttpClient }
|
|
220
|
-
];
|
|
221
|
-
};
|
|
222
|
-
/** @nocollapse */ SamZebraPrinterService.ngInjectableDef = i0.defineInjectable({ factory: function SamZebraPrinterService_Factory() { return new SamZebraPrinterService(i0.inject(i1.HttpClient)); }, token: SamZebraPrinterService, providedIn: "root" });
|
|
223
|
-
return SamZebraPrinterService;
|
|
224
|
-
}());
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @fileoverview added by tsickle
|
|
228
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* @fileoverview added by tsickle
|
|
233
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
234
|
-
*/
|
|
235
|
-
|
|
236
|
-
exports.SamZebraPrinterService = SamZebraPrinterService;
|
|
237
|
-
|
|
238
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
239
|
-
|
|
240
|
-
})));
|
|
241
|
-
|
|
242
|
-
//# sourceMappingURL=sam-senior-zebra-printer.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sam-senior-zebra-printer.umd.js.map","sources":["node_modules/tslib/tslib.es6.js","ng://@sam-senior/zebra-printer/lib/sam-zebra-printer.service.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SamZebraPrinterService {\n\n private printerError = null;\n\n constructor(\n private httpClient: HttpClient\n ) { }\n\n public async print(content: string, ip = '127.0.0.1', isSSL = false): Promise<void> {\n try {\n this.printerError = null;\n const http = new XMLHttpRequest();\n http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n http.send(content);\n } catch (err) {\n this.printerError = err;\n }\n }\n\n public async printTest(ip = '127.0.0.1', isSSL = false): Promise<void> {\n const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +\n '^XA' +\n '^MMT' +\n '^PW831' +\n '^LL0480' +\n '^LS0' +\n '^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +\n '^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +\n '^PQ1,0,1,Y^XZ;';\n await this.print(content, ip, isSSL);\n }\n\n public haveError(): boolean {\n return !!this.printerError;\n }\n\n public getError(): HttpErrorResponse {\n return this.printerError;\n }\n}\n"],"names":["Injectable","HttpClient"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;AAcA,aAmDgB,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS;QACvD,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM;YACrD,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI;gBAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;aAAE;YAAC,OAAO,CAAC,EAAE;gBAAE,MAAM,CAAC,CAAC,CAAC,CAAC;aAAE,EAAE;YAC3F,SAAS,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E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;yBACpB;wBAAC,OAAO,GAAG,EAAE;4BACZ,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;yBACzB;;;;aACF;;;;;;QAEY,0CAAS;;;;;YAAtB,UAAuB,EAAgB,EAAE,KAAa;gBAA/B,mBAAA;oBAAA,gBAAgB;;gBAAE,sBAAA;oBAAA,aAAa;;;;;;;gCAC9C,OAAO,GAAG,uEAAuE;oCACrF,KAAK;oCACL,MAAM;oCACN,QAAQ;oCACR,SAAS;oCACT,MAAM;oCACN,iDAAiD;oCACjD,iDAAiD;oCACjD,gBAAgB;gCAClB,qBAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAA;;gCAApC,SAAoC,CAAC;;;;;aACtC;;;;QAEM,0CAAS;;;YAAhB;gBACE,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;aAC5B;;;;QAEM,yCAAQ;;;YAAf;gBACE,OAAO,IAAI,CAAC,YAAY,CAAC;aAC1B;;oBA1CFA,aAAU,SAAC;wBACV,UAAU,EAAE,MAAM;qBACnB;;;;;wBAJQC,aAAU;;;;qCADnB;KAGA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common/http")):"function"==typeof define&&define.amd?define("@sam-senior/zebra-printer",["exports","@angular/core","@angular/common/http"],e):e((t["sam-senior"]=t["sam-senior"]||{},t["sam-senior"]["zebra-printer"]={}),t.ng.core,t.ng.common.http)}(this,function(t,e,r){"use strict";function u(e,u,a,c){return new(a||(a=Promise))(function(t,r){function n(t){try{i(c.next(t))}catch(e){r(e)}}function o(t){try{i(c["throw"](t))}catch(e){r(e)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(n,o)}i((c=c.apply(e,u||[])).next())})}function a(n,o){var i,u,a,t,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function r(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(i=1,u&&(a=2&t[0]?u["return"]:t[0]?u["throw"]||((a=u["return"])&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,a&&(t=[2&t[0],a.value]),t[0]){case 0:case 1:a=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,u=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(a=0<(a=c.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){c.label=t[1];break}if(6===t[0]&&c.label<a[1]){c.label=a[1],a=t;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(t);break}a[2]&&c.ops.pop(),c.trys.pop();continue}t=o.call(n,c)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([e,t])}}}var n=function(){function t(t){this.httpClient=t,this.printerError=null}return t.prototype.print=function(n,o,i){return void 0===o&&(o="127.0.0.1"),void 0===i&&(i=!1),u(this,void 0,void 0,function(){var r;return a(this,function(t){try{this.printerError=null,(r=new XMLHttpRequest).open("POST","http"+(i?"s":"")+"://"+o+"/printer/pstprnt",!0),r.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r.send(n)}catch(e){this.printerError=e}return[2]})})},t.prototype.printTest=function(e,r){return void 0===e&&(e="127.0.0.1"),void 0===r&&(r=!1),u(this,void 0,void 0,function(){return a(this,function(t){switch(t.label){case 0:return"^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ^XA^MMT^PW831^LL0480^LS0^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS^PQ1,0,1,Y^XZ;",[4,this.print("^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ^XA^MMT^PW831^LL0480^LS0^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS^PQ1,0,1,Y^XZ;",e,r)];case 1:return t.sent(),[2]}})})},t.prototype.haveError=function(){return!!this.printerError},t.prototype.getError=function(){return this.printerError},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:r.HttpClient}]},t.ngInjectableDef=e.defineInjectable({factory:function(){return new t(e.inject(r.HttpClient))},token:t,providedIn:"root"}),t}();t.SamZebraPrinterService=n,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
|
-
//# sourceMappingURL=sam-senior-zebra-printer.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["node_modules/tslib/tslib.es6.js","ng://@sam-senior/zebra-printer/lib/sam-zebra-printer.service.ts"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","__generator","body","f","y","t","g","_","label","sent","trys","ops","verb","throw","return","Symbol","iterator","this","n","v","op","TypeError","call","pop","length","push","SamZebraPrinterService","httpClient","printerError","prototype","print","content","ip","isSSL","http","XMLHttpRequest","open","setRequestHeader","send","err","printTest","_a","haveError","getError","Injectable","args","providedIn","HttpClient"],"mappings":"kZAcA,SAmDgBA,EAAUC,EAASC,EAAYC,EAAGC,GAC9C,OAAO,IAAKD,IAAMA,EAAIE,UAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUC,GAAS,IAAMC,EAAKN,EAAUO,KAAKF,IAAW,MAAOG,GAAKL,EAAOK,IACpF,SAASC,EAASJ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ACV,MAAOQ,GACPtB,KAAKW,aAAeW,iBAIXb,EAAAG,UAAAW,UAAb,SAAuBR,EAAkBC,eAAlB,IAAAD,IAAAA,EAAA,kBAAkB,IAAAC,IAAAA,GAAA,oFAUvC,MATgB,4MAShB,CAAA,EAAMhB,KAAKa,MATK,4MASUE,EAAIC,kBAA9BQ,EAAAhC,iBAGKiB,EAAAG,UAAAa,UAAP,WACE,QAASzB,KAAKW,cAGTF,EAAAG,UAAAc,SAAP,WACE,OAAO1B,KAAKW,kCAzCfgB,EAAAA,WAAUC,KAAA,CAAC,CACVC,WAAY,oDAHLC,EAAAA","sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import { Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SamZebraPrinterService {\n\n private printerError = null;\n\n constructor(\n private httpClient: HttpClient\n ) { }\n\n public async print(content: string, ip = '127.0.0.1', isSSL = false): Promise<void> {\n try {\n this.printerError = null;\n const http = new XMLHttpRequest();\n http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n http.send(content);\n } catch (err) {\n this.printerError = err;\n }\n }\n\n public async printTest(ip = '127.0.0.1', isSSL = false): Promise<void> {\n const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +\n '^XA' +\n '^MMT' +\n '^PW831' +\n '^LL0480' +\n '^LS0' +\n '^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +\n '^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +\n '^PQ1,0,1,Y^XZ;';\n await this.print(content, ip, isSSL);\n }\n\n public haveError(): boolean {\n return !!this.printerError;\n }\n\n public getError(): HttpErrorResponse {\n return this.printerError;\n }\n}\n"]}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Injectable } from '@angular/core';
|
|
7
|
-
import { HttpClient } from '@angular/common/http';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@angular/common/http";
|
|
10
|
-
export class SamZebraPrinterService {
|
|
11
|
-
/**
|
|
12
|
-
* @param {?} httpClient
|
|
13
|
-
*/
|
|
14
|
-
constructor(httpClient) {
|
|
15
|
-
this.httpClient = httpClient;
|
|
16
|
-
this.printerError = null;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* @param {?} content
|
|
20
|
-
* @param {?=} ip
|
|
21
|
-
* @param {?=} isSSL
|
|
22
|
-
* @return {?}
|
|
23
|
-
*/
|
|
24
|
-
print(content, ip = '127.0.0.1', isSSL = false) {
|
|
25
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
try {
|
|
27
|
-
this.printerError = null;
|
|
28
|
-
/** @type {?} */
|
|
29
|
-
const http = new XMLHttpRequest();
|
|
30
|
-
http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);
|
|
31
|
-
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
32
|
-
http.send(content);
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
this.printerError = err;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @param {?=} ip
|
|
41
|
-
* @param {?=} isSSL
|
|
42
|
-
* @return {?}
|
|
43
|
-
*/
|
|
44
|
-
printTest(ip = '127.0.0.1', isSSL = false) {
|
|
45
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
/** @type {?} */
|
|
47
|
-
const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
48
|
-
'^XA' +
|
|
49
|
-
'^MMT' +
|
|
50
|
-
'^PW831' +
|
|
51
|
-
'^LL0480' +
|
|
52
|
-
'^LS0' +
|
|
53
|
-
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
54
|
-
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
55
|
-
'^PQ1,0,1,Y^XZ;';
|
|
56
|
-
yield this.print(content, ip, isSSL);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @return {?}
|
|
61
|
-
*/
|
|
62
|
-
haveError() {
|
|
63
|
-
return !!this.printerError;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* @return {?}
|
|
67
|
-
*/
|
|
68
|
-
getError() {
|
|
69
|
-
return this.printerError;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
SamZebraPrinterService.decorators = [
|
|
73
|
-
{ type: Injectable, args: [{
|
|
74
|
-
providedIn: 'root'
|
|
75
|
-
},] }
|
|
76
|
-
];
|
|
77
|
-
/** @nocollapse */
|
|
78
|
-
SamZebraPrinterService.ctorParameters = () => [
|
|
79
|
-
{ type: HttpClient }
|
|
80
|
-
];
|
|
81
|
-
/** @nocollapse */ SamZebraPrinterService.ngInjectableDef = i0.defineInjectable({ factory: function SamZebraPrinterService_Factory() { return new SamZebraPrinterService(i0.inject(i1.HttpClient)); }, token: SamZebraPrinterService, providedIn: "root" });
|
|
82
|
-
if (false) {
|
|
83
|
-
/**
|
|
84
|
-
* @type {?}
|
|
85
|
-
* @private
|
|
86
|
-
*/
|
|
87
|
-
SamZebraPrinterService.prototype.printerError;
|
|
88
|
-
/**
|
|
89
|
-
* @type {?}
|
|
90
|
-
* @private
|
|
91
|
-
*/
|
|
92
|
-
SamZebraPrinterService.prototype.httpClient;
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXplYnJhLXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzYW0tc2VuaW9yL3plYnJhLXByaW50ZXIvIiwic291cmNlcyI6WyJsaWIvc2FtLXplYnJhLXByaW50ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLFVBQVUsRUFBcUIsTUFBTSxzQkFBc0IsQ0FBQzs7O0FBS3JFLE1BQU0sT0FBTyxzQkFBc0I7Ozs7SUFJakMsWUFDVSxVQUFzQjtRQUF0QixlQUFVLEdBQVYsVUFBVSxDQUFZO1FBSHhCLGlCQUFZLEdBQUcsSUFBSSxDQUFDO0lBSXhCLENBQUM7Ozs7Ozs7SUFFUSxLQUFLLENBQUMsT0FBZSxFQUFFLEVBQUUsR0FBRyxXQUFXLEVBQUUsS0FBSyxHQUFHLEtBQUs7O1lBQ2pFLElBQUk7Z0JBQ0YsSUFBSSxDQUFDLFlBQVksR0FBRyxJQUFJLENBQUM7O3NCQUNuQixJQUFJLEdBQUcsSUFBSSxjQUFjLEVBQUU7Z0JBQ2pDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLE9BQU8sS0FBSyxDQUFDLENBQUMsQ0FBQyxHQUF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1LDV+U0QxNV5KVVNeTFJOXkNJMF5YWicgK1xuICAgICAgJ15YQScgK1xuICAgICAgJ15NTVQnICtcbiAgICAgICdeUFc4MzEnICtcbiAgICAgICdeTEwwNDgwJyArXG4gICAgICAnXkxTMCcgK1xuICAgICAgJ15GVDc2NiwyNjheQTBJLDU2LDU1XkZCNzExLDEsMCxDXkZIXkZEJFRlc3RlXkZTJyArXG4gICAgICAnXkZUNTYyLDEyMF5BMEksNTEsNTBeRkIzMzUsMSwwLENeRkheRkQkVGVzdGVeRlMnICtcbiAgICAgICdeUFExLDAsMSxZXlhaOyc7XG4gICAgYXdhaXQgdGhpcy5wcmludChjb250ZW50LCBpcCwgaXNTU0wpO1xuICB9XG5cbiAgcHVibGljIGhhdmVFcnJvcigpOiBib29sZWFuIHtcbiAgICByZXR1cm4gISF0aGlzLnByaW50ZXJFcnJvcjtcbiAgfVxuXG4gIHB1YmxpYyBnZXRFcnJvcigpOiBIdHRwRXJyb3JSZXNwb25zZSB7XG4gICAgcmV0dXJuIHRoaXMucHJpbnRlckVycm9yO1xuICB9XG59XG4iXX0=
|
package/esm2015/public_api.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
/*
|
|
6
|
-
* Public API Surface of zebra-printer
|
|
7
|
-
*/
|
|
8
|
-
export { SamZebraPrinterService } from './lib/sam-zebra-printer.service';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzYW0tc2VuaW9yL3plYnJhLXByaW50ZXIvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSx1Q0FBYyxpQ0FBaUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgemVicmEtcHJpbnRlclxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3NhbS16ZWJyYS1wcmludGVyLnNlcnZpY2UnO1xuIl19
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export { SamZebraPrinterService } from './public_api';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXNlbmlvci16ZWJyYS1wcmludGVyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNhbS1zZW5pb3IvemVicmEtcHJpbnRlci8iLCJzb3VyY2VzIjpbInNhbS1zZW5pb3ItemVicmEtcHJpbnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsdUNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
import * as tslib_1 from "tslib";
|
|
6
|
-
import { Injectable } from '@angular/core';
|
|
7
|
-
import { HttpClient } from '@angular/common/http';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
import * as i1 from "@angular/common/http";
|
|
10
|
-
var SamZebraPrinterService = /** @class */ (function () {
|
|
11
|
-
function SamZebraPrinterService(httpClient) {
|
|
12
|
-
this.httpClient = httpClient;
|
|
13
|
-
this.printerError = null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param {?} content
|
|
17
|
-
* @param {?=} ip
|
|
18
|
-
* @param {?=} isSSL
|
|
19
|
-
* @return {?}
|
|
20
|
-
*/
|
|
21
|
-
SamZebraPrinterService.prototype.print = /**
|
|
22
|
-
* @param {?} content
|
|
23
|
-
* @param {?=} ip
|
|
24
|
-
* @param {?=} isSSL
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
|
-
function (content, ip, isSSL) {
|
|
28
|
-
if (ip === void 0) { ip = '127.0.0.1'; }
|
|
29
|
-
if (isSSL === void 0) { isSSL = false; }
|
|
30
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
31
|
-
var http;
|
|
32
|
-
return tslib_1.__generator(this, function (_a) {
|
|
33
|
-
try {
|
|
34
|
-
this.printerError = null;
|
|
35
|
-
http = new XMLHttpRequest();
|
|
36
|
-
http.open('POST', "http" + (isSSL ? 's' : '') + "://" + ip + "/printer/pstprnt", true);
|
|
37
|
-
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
38
|
-
http.send(content);
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
this.printerError = err;
|
|
42
|
-
}
|
|
43
|
-
return [2 /*return*/];
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* @param {?=} ip
|
|
49
|
-
* @param {?=} isSSL
|
|
50
|
-
* @return {?}
|
|
51
|
-
*/
|
|
52
|
-
SamZebraPrinterService.prototype.printTest = /**
|
|
53
|
-
* @param {?=} ip
|
|
54
|
-
* @param {?=} isSSL
|
|
55
|
-
* @return {?}
|
|
56
|
-
*/
|
|
57
|
-
function (ip, isSSL) {
|
|
58
|
-
if (ip === void 0) { ip = '127.0.0.1'; }
|
|
59
|
-
if (isSSL === void 0) { isSSL = false; }
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var content;
|
|
62
|
-
return tslib_1.__generator(this, function (_a) {
|
|
63
|
-
switch (_a.label) {
|
|
64
|
-
case 0:
|
|
65
|
-
content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
66
|
-
'^XA' +
|
|
67
|
-
'^MMT' +
|
|
68
|
-
'^PW831' +
|
|
69
|
-
'^LL0480' +
|
|
70
|
-
'^LS0' +
|
|
71
|
-
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
72
|
-
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
73
|
-
'^PQ1,0,1,Y^XZ;';
|
|
74
|
-
return [4 /*yield*/, this.print(content, ip, isSSL)];
|
|
75
|
-
case 1:
|
|
76
|
-
_a.sent();
|
|
77
|
-
return [2 /*return*/];
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* @return {?}
|
|
84
|
-
*/
|
|
85
|
-
SamZebraPrinterService.prototype.haveError = /**
|
|
86
|
-
* @return {?}
|
|
87
|
-
*/
|
|
88
|
-
function () {
|
|
89
|
-
return !!this.printerError;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* @return {?}
|
|
93
|
-
*/
|
|
94
|
-
SamZebraPrinterService.prototype.getError = /**
|
|
95
|
-
* @return {?}
|
|
96
|
-
*/
|
|
97
|
-
function () {
|
|
98
|
-
return this.printerError;
|
|
99
|
-
};
|
|
100
|
-
SamZebraPrinterService.decorators = [
|
|
101
|
-
{ type: Injectable, args: [{
|
|
102
|
-
providedIn: 'root'
|
|
103
|
-
},] }
|
|
104
|
-
];
|
|
105
|
-
/** @nocollapse */
|
|
106
|
-
SamZebraPrinterService.ctorParameters = function () { return [
|
|
107
|
-
{ type: HttpClient }
|
|
108
|
-
]; };
|
|
109
|
-
/** @nocollapse */ SamZebraPrinterService.ngInjectableDef = i0.defineInjectable({ factory: function SamZebraPrinterService_Factory() { return new SamZebraPrinterService(i0.inject(i1.HttpClient)); }, token: SamZebraPrinterService, providedIn: "root" });
|
|
110
|
-
return SamZebraPrinterService;
|
|
111
|
-
}());
|
|
112
|
-
export { SamZebraPrinterService };
|
|
113
|
-
if (false) {
|
|
114
|
-
/**
|
|
115
|
-
* @type {?}
|
|
116
|
-
* @private
|
|
117
|
-
*/
|
|
118
|
-
SamZebraPrinterService.prototype.printerError;
|
|
119
|
-
/**
|
|
120
|
-
* @type {?}
|
|
121
|
-
* @private
|
|
122
|
-
*/
|
|
123
|
-
SamZebraPrinterService.prototype.httpClient;
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXplYnJhLXByaW50ZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzYW0tc2VuaW9yL3plYnJhLXByaW50ZXIvIiwic291cmNlcyI6WyJsaWIvc2FtLXplYnJhLXByaW50ZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLFVBQVUsRUFBcUIsTUFBTSxzQkFBc0IsQ0FBQzs7O0FBRXJFO0lBT0UsZ0NBQ1UsVUFBc0I7UUFBdEIsZUFBVSxHQUFWLFVBQVUsQ0FBWTtRQUh4QixpQkFBWSxHQUFHLElBQUksQ0FBQztJQUl4QixDQUFDOzs7Ozs7O0lBRVEsc0NBQUs7Ozs7OztJQUFsQixVQUF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m5/public_api.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
/*
|
|
6
|
-
* Public API Surface of zebra-printer
|
|
7
|
-
*/
|
|
8
|
-
export { SamZebraPrinterService } from './lib/sam-zebra-printer.service';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BzYW0tc2VuaW9yL3plYnJhLXByaW50ZXIvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFJQSx1Q0FBYyxpQ0FBaUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gKiBQdWJsaWMgQVBJIFN1cmZhY2Ugb2YgemVicmEtcHJpbnRlclxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL3NhbS16ZWJyYS1wcmludGVyLnNlcnZpY2UnO1xuIl19
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
8
|
-
export { SamZebraPrinterService } from './public_api';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2FtLXNlbmlvci16ZWJyYS1wcmludGVyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQHNhbS1zZW5pb3IvemVicmEtcHJpbnRlci8iLCJzb3VyY2VzIjpbInNhbS1zZW5pb3ItemVicmEtcHJpbnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsdUNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
|
-
import { Injectable, defineInjectable, inject } from '@angular/core';
|
|
3
|
-
import { HttpClient } from '@angular/common/http';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @fileoverview added by tsickle
|
|
7
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
8
|
-
*/
|
|
9
|
-
class SamZebraPrinterService {
|
|
10
|
-
/**
|
|
11
|
-
* @param {?} httpClient
|
|
12
|
-
*/
|
|
13
|
-
constructor(httpClient) {
|
|
14
|
-
this.httpClient = httpClient;
|
|
15
|
-
this.printerError = null;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @param {?} content
|
|
19
|
-
* @param {?=} ip
|
|
20
|
-
* @param {?=} isSSL
|
|
21
|
-
* @return {?}
|
|
22
|
-
*/
|
|
23
|
-
print(content, ip = '127.0.0.1', isSSL = false) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
try {
|
|
26
|
-
this.printerError = null;
|
|
27
|
-
/** @type {?} */
|
|
28
|
-
const http = new XMLHttpRequest();
|
|
29
|
-
http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);
|
|
30
|
-
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
31
|
-
http.send(content);
|
|
32
|
-
}
|
|
33
|
-
catch (err) {
|
|
34
|
-
this.printerError = err;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @param {?=} ip
|
|
40
|
-
* @param {?=} isSSL
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
printTest(ip = '127.0.0.1', isSSL = false) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
/** @type {?} */
|
|
46
|
-
const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
47
|
-
'^XA' +
|
|
48
|
-
'^MMT' +
|
|
49
|
-
'^PW831' +
|
|
50
|
-
'^LL0480' +
|
|
51
|
-
'^LS0' +
|
|
52
|
-
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
53
|
-
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
54
|
-
'^PQ1,0,1,Y^XZ;';
|
|
55
|
-
yield this.print(content, ip, isSSL);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @return {?}
|
|
60
|
-
*/
|
|
61
|
-
haveError() {
|
|
62
|
-
return !!this.printerError;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @return {?}
|
|
66
|
-
*/
|
|
67
|
-
getError() {
|
|
68
|
-
return this.printerError;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
SamZebraPrinterService.decorators = [
|
|
72
|
-
{ type: Injectable, args: [{
|
|
73
|
-
providedIn: 'root'
|
|
74
|
-
},] }
|
|
75
|
-
];
|
|
76
|
-
/** @nocollapse */
|
|
77
|
-
SamZebraPrinterService.ctorParameters = () => [
|
|
78
|
-
{ type: HttpClient }
|
|
79
|
-
];
|
|
80
|
-
/** @nocollapse */ SamZebraPrinterService.ngInjectableDef = defineInjectable({ factory: function SamZebraPrinterService_Factory() { return new SamZebraPrinterService(inject(HttpClient)); }, token: SamZebraPrinterService, providedIn: "root" });
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @fileoverview added by tsickle
|
|
84
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
85
|
-
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* @fileoverview added by tsickle
|
|
89
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
export { SamZebraPrinterService };
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=sam-senior-zebra-printer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sam-senior-zebra-printer.js.map","sources":["ng://@sam-senior/zebra-printer/lib/sam-zebra-printer.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SamZebraPrinterService {\n\n private printerError = null;\n\n constructor(\n private httpClient: HttpClient\n ) { }\n\n public async print(content: string, ip = '127.0.0.1', isSSL = false): Promise<void> {\n try {\n this.printerError = null;\n const http = new XMLHttpRequest();\n http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n http.send(content);\n } catch (err) {\n this.printerError = err;\n }\n }\n\n public async printTest(ip = '127.0.0.1', isSSL = false): Promise<void> {\n const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +\n '^XA' +\n '^MMT' +\n '^PW831' +\n '^LL0480' +\n '^LS0' +\n '^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +\n '^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +\n '^PQ1,0,1,Y^XZ;';\n await this.print(content, ip, isSSL);\n }\n\n public haveError(): boolean {\n return !!this.printerError;\n }\n\n public getError(): HttpErrorResponse {\n return this.printerError;\n }\n}\n"],"names":[],"mappings":";;;;;;;;MAMa,sBAAsB;;;;IAIjC,YACU,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAHxB,iBAAY,GAAG,IAAI,CAAC;KAIvB;;;;;;;IAEQ,KAAK,CAAC,OAAe,EAAE,EAAE,GAAG,WAAW,EAAE,KAAK,GAAG,KAAK;;YACjE,IAAI;gBACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;;sBACnB,IAAI,GAAG,IAAI,cAAc,EAAE;gBACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,KAAK,GAAG,GAAG,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;gBAC3E,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,mCAAmC,CAAC,CAAC;gBAC3E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACpB;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;aACzB;SACF;KAAA;;;;;;IAEY,SAAS,CAAC,EAAE,GAAG,WAAW,EAAE,KAAK,GAAG,KAAK;;;kBAC9C,OAAO,GAAG,uEAAuE;gBACrF,KAAK;gBACL,MAAM;gBACN,QAAQ;gBACR,SAAS;gBACT,MAAM;gBACN,iDAAiD;gBACjD,iDAAiD;gBACjD,gBAAgB;YAClB,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACtC;KAAA;;;;IAEM,SAAS;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;KAC5B;;;;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;;;YA1CF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;;YAJQ,UAAU;;;;;;;;;;;;;;;;"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator } from 'tslib';
|
|
2
|
-
import { Injectable, defineInjectable, inject } from '@angular/core';
|
|
3
|
-
import { HttpClient } from '@angular/common/http';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @fileoverview added by tsickle
|
|
7
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
8
|
-
*/
|
|
9
|
-
var SamZebraPrinterService = /** @class */ (function () {
|
|
10
|
-
function SamZebraPrinterService(httpClient) {
|
|
11
|
-
this.httpClient = httpClient;
|
|
12
|
-
this.printerError = null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @param {?} content
|
|
16
|
-
* @param {?=} ip
|
|
17
|
-
* @param {?=} isSSL
|
|
18
|
-
* @return {?}
|
|
19
|
-
*/
|
|
20
|
-
SamZebraPrinterService.prototype.print = /**
|
|
21
|
-
* @param {?} content
|
|
22
|
-
* @param {?=} ip
|
|
23
|
-
* @param {?=} isSSL
|
|
24
|
-
* @return {?}
|
|
25
|
-
*/
|
|
26
|
-
function (content, ip, isSSL) {
|
|
27
|
-
if (ip === void 0) { ip = '127.0.0.1'; }
|
|
28
|
-
if (isSSL === void 0) { isSSL = false; }
|
|
29
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
30
|
-
var http;
|
|
31
|
-
return __generator(this, function (_a) {
|
|
32
|
-
try {
|
|
33
|
-
this.printerError = null;
|
|
34
|
-
http = new XMLHttpRequest();
|
|
35
|
-
http.open('POST', "http" + (isSSL ? 's' : '') + "://" + ip + "/printer/pstprnt", true);
|
|
36
|
-
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
37
|
-
http.send(content);
|
|
38
|
-
}
|
|
39
|
-
catch (err) {
|
|
40
|
-
this.printerError = err;
|
|
41
|
-
}
|
|
42
|
-
return [2 /*return*/];
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* @param {?=} ip
|
|
48
|
-
* @param {?=} isSSL
|
|
49
|
-
* @return {?}
|
|
50
|
-
*/
|
|
51
|
-
SamZebraPrinterService.prototype.printTest = /**
|
|
52
|
-
* @param {?=} ip
|
|
53
|
-
* @param {?=} isSSL
|
|
54
|
-
* @return {?}
|
|
55
|
-
*/
|
|
56
|
-
function (ip, isSSL) {
|
|
57
|
-
if (ip === void 0) { ip = '127.0.0.1'; }
|
|
58
|
-
if (isSSL === void 0) { isSSL = false; }
|
|
59
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
60
|
-
var content;
|
|
61
|
-
return __generator(this, function (_a) {
|
|
62
|
-
switch (_a.label) {
|
|
63
|
-
case 0:
|
|
64
|
-
content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +
|
|
65
|
-
'^XA' +
|
|
66
|
-
'^MMT' +
|
|
67
|
-
'^PW831' +
|
|
68
|
-
'^LL0480' +
|
|
69
|
-
'^LS0' +
|
|
70
|
-
'^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +
|
|
71
|
-
'^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +
|
|
72
|
-
'^PQ1,0,1,Y^XZ;';
|
|
73
|
-
return [4 /*yield*/, this.print(content, ip, isSSL)];
|
|
74
|
-
case 1:
|
|
75
|
-
_a.sent();
|
|
76
|
-
return [2 /*return*/];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* @return {?}
|
|
83
|
-
*/
|
|
84
|
-
SamZebraPrinterService.prototype.haveError = /**
|
|
85
|
-
* @return {?}
|
|
86
|
-
*/
|
|
87
|
-
function () {
|
|
88
|
-
return !!this.printerError;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* @return {?}
|
|
92
|
-
*/
|
|
93
|
-
SamZebraPrinterService.prototype.getError = /**
|
|
94
|
-
* @return {?}
|
|
95
|
-
*/
|
|
96
|
-
function () {
|
|
97
|
-
return this.printerError;
|
|
98
|
-
};
|
|
99
|
-
SamZebraPrinterService.decorators = [
|
|
100
|
-
{ type: Injectable, args: [{
|
|
101
|
-
providedIn: 'root'
|
|
102
|
-
},] }
|
|
103
|
-
];
|
|
104
|
-
/** @nocollapse */
|
|
105
|
-
SamZebraPrinterService.ctorParameters = function () { return [
|
|
106
|
-
{ type: HttpClient }
|
|
107
|
-
]; };
|
|
108
|
-
/** @nocollapse */ SamZebraPrinterService.ngInjectableDef = defineInjectable({ factory: function SamZebraPrinterService_Factory() { return new SamZebraPrinterService(inject(HttpClient)); }, token: SamZebraPrinterService, providedIn: "root" });
|
|
109
|
-
return SamZebraPrinterService;
|
|
110
|
-
}());
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* @fileoverview added by tsickle
|
|
114
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* @fileoverview added by tsickle
|
|
119
|
-
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
120
|
-
*/
|
|
121
|
-
|
|
122
|
-
export { SamZebraPrinterService };
|
|
123
|
-
|
|
124
|
-
//# sourceMappingURL=sam-senior-zebra-printer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sam-senior-zebra-printer.js.map","sources":["ng://@sam-senior/zebra-printer/lib/sam-zebra-printer.service.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SamZebraPrinterService {\n\n private printerError = null;\n\n constructor(\n private httpClient: HttpClient\n ) { }\n\n public async print(content: string, ip = '127.0.0.1', isSSL = false): Promise<void> {\n try {\n this.printerError = null;\n const http = new XMLHttpRequest();\n http.open('POST', `http${isSSL ? 's' : ''}://${ip}/printer/pstprnt`, true);\n http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n http.send(content);\n } catch (err) {\n this.printerError = err;\n }\n }\n\n public async printTest(ip = '127.0.0.1', isSSL = false): Promise<void> {\n const content = '^XA~TA000~JSN^LT0^MNW^MTT^PON^PMN^LH0,0^JMA^PR5,5~SD15^JUS^LRN^CI0^XZ' +\n '^XA' +\n '^MMT' +\n '^PW831' +\n '^LL0480' +\n '^LS0' +\n '^FT766,268^A0I,56,55^FB711,1,0,C^FH^FD$Teste^FS' +\n '^FT562,120^A0I,51,50^FB335,1,0,C^FH^FD$Teste^FS' +\n '^PQ1,0,1,Y^XZ;';\n await this.print(content, ip, isSSL);\n }\n\n public haveError(): boolean {\n return !!this.printerError;\n }\n\n public getError(): HttpErrorResponse {\n return this.printerError;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;IAUE,gCACU,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAHxB,iBAAY,GAAG,IAAI,CAAC;KAIvB;;;;;;;IAEQ,sCAAK;;;;;;IAAlB,UAAmB,OAAe,EAAE,EAAgB,EAAE,KAAa;QAA/B,mBAAA,EAAA,gBAAgB;QAAE,sBAAA,EAAA,aAAa;;;;gBACjE,IAAI;oBACF,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;oBACnB,IAAI,GAAG,IAAI,cAAc,EAAE;oBACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,UAAO,KAAK,GAAG,GAAG,GAAG,EAAE,YAAM,EAAE,qBAAkB,EAAE,IAAI,CAAC,CAAC;oBAC3E,IAAI,CAAC,gBAAgB,CAAC,cAAc,EAAE,mCAAmC,CAAC,CAAC;oBAC3E,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpB;gBAAC,OAAO,GAAG,EAAE;oBACZ,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC;iBACzB;;;;KACF;;;;;;IAEY,0CAAS;;;;;IAAtB,UAAuB,EAAgB,EAAE,KAAa;QAA/B,mBAAA,EAAA,gBAAgB;QAAE,sBAAA,EAAA,aAAa;;;;;;wBAC9C,OAAO,GAAG,uEAAuE;4BACrF,KAAK;4BACL,MAAM;4BACN,QAAQ;4BACR,SAAS;4BACT,MAAM;4BACN,iDAAiD;4BACjD,iDAAiD;4BACjD,gBAAgB;wBAClB,qBAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAA;;wBAApC,SAAoC,CAAC;;;;;KACtC;;;;IAEM,0CAAS;;;IAAhB;QACE,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;KAC5B;;;;IAEM,yCAAQ;;;IAAf;QACE,OAAO,IAAI,CAAC,YAAY,CAAC;KAC1B;;gBA1CF,UAAU,SAAC;oBACV,UAAU,EAAE,MAAM;iBACnB;;;;gBAJQ,UAAU;;;iCADnB;CAGA;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"SamZebraPrinterService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":3,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient","line":11,"character":24}]}],"print":[{"__symbolic":"method"}],"printTest":[{"__symbolic":"method"}],"haveError":[{"__symbolic":"method"}],"getError":[{"__symbolic":"method"}]},"statics":{"ngInjectableDef":{}}}},"origins":{"SamZebraPrinterService":"./lib/sam-zebra-printer.service"},"importAs":"@sam-senior/zebra-printer"}
|