@node-projects/web-component-designer-zpl 0.2.0 → 0.3.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.
Files changed (75) hide show
  1. package/README.md +16 -2
  2. package/THIRD-PARTY-LICENSES.md +432 -0
  3. package/dist/assets/fonts/LICENSE-APACHE-2.0.txt +202 -0
  4. package/dist/assets/fonts/NOTICE.md +27 -0
  5. package/dist/assets/fonts/OCRA-NOTICE.md +27 -0
  6. package/dist/assets/fonts/OCRA.ttf +0 -0
  7. package/dist/assets/fonts/OCRB-NOTICE.md +21 -0
  8. package/dist/assets/fonts/OCRB.ttf +0 -0
  9. package/dist/assets/fonts/PrintLabMono-NOTICE.md +24 -0
  10. package/dist/assets/fonts/PrintLabMono.ttf +0 -0
  11. package/dist/assets/fonts/PrintLabZPL-Bold.ttf +0 -0
  12. package/dist/assets/fonts/PrintLabZPL-Bold.woff2 +0 -0
  13. package/dist/assets/fonts/VeraMono-Bold.ttf +0 -0
  14. package/dist/assets/fonts/VeraMono-NOTICE.md +57 -0
  15. package/dist/assets/fonts/VeraMono.ttf +0 -0
  16. package/dist/assets/licenses/BWIP-JS-LICENSE.txt +23 -0
  17. package/dist/assets/licenses/ZPLab-LICENSE.txt +21 -0
  18. package/dist/barcodes/barcodeRegistry.d.ts +124 -0
  19. package/dist/barcodes/barcodeRegistry.js +357 -0
  20. package/dist/barcodes/bwipRenderer.d.ts +70 -0
  21. package/dist/barcodes/bwipRenderer.js +552 -0
  22. package/dist/fonts/zplFonts.d.ts +27 -0
  23. package/dist/fonts/zplFonts.js +85 -0
  24. package/dist/index.d.ts +10 -3
  25. package/dist/index.js +10 -3
  26. package/dist/services/ZplBarcodeElementsService.d.ts +5 -0
  27. package/dist/services/ZplBarcodeElementsService.js +16 -0
  28. package/dist/services/ZplBarcodePropertiesService.d.ts +10 -0
  29. package/dist/services/ZplBarcodePropertiesService.js +59 -0
  30. package/dist/services/ZplDiagonalLineExtension.d.ts +46 -0
  31. package/dist/services/ZplDiagonalLineExtension.js +255 -0
  32. package/dist/services/ZplElementResizeStrategy.d.ts +20 -0
  33. package/dist/services/ZplElementResizeStrategy.js +182 -0
  34. package/dist/services/ZplGraphicResizeStrategy.d.ts +18 -0
  35. package/dist/services/ZplGraphicResizeStrategy.js +81 -0
  36. package/dist/services/ZplIncludeInOutputPropertiesService.d.ts +12 -0
  37. package/dist/services/ZplIncludeInOutputPropertiesService.js +50 -0
  38. package/dist/services/ZplParserService.d.ts +7 -4
  39. package/dist/services/ZplParserService.js +214 -249
  40. package/dist/services/ZplSelectionExtensionProvider.d.ts +9 -0
  41. package/dist/services/ZplSelectionExtensionProvider.js +15 -0
  42. package/dist/services/ZplTextEditExtension.d.ts +20 -0
  43. package/dist/services/ZplTextEditExtension.js +80 -0
  44. package/dist/services/ZplTextPropertiesService.d.ts +8 -0
  45. package/dist/services/ZplTextPropertiesService.js +24 -0
  46. package/dist/services/hiddenMetadata.d.ts +17 -0
  47. package/dist/services/hiddenMetadata.js +95 -0
  48. package/dist/services/zplResizeGeometry.d.ts +6 -0
  49. package/dist/services/zplResizeGeometry.js +8 -0
  50. package/dist/setupZplServiceContainer.js +24 -5
  51. package/dist/widgets/elements.json +0 -24
  52. package/dist/widgets/views/zpl-demo-view.js +2 -1
  53. package/dist/widgets/zpl-barcode.d.ts +68 -14
  54. package/dist/widgets/zpl-barcode.js +162 -74
  55. package/dist/widgets/zpl-comment.d.ts +2 -0
  56. package/dist/widgets/zpl-comment.js +6 -3
  57. package/dist/widgets/zpl-graphic-box.d.ts +12 -0
  58. package/dist/widgets/zpl-graphic-box.js +49 -13
  59. package/dist/widgets/zpl-graphic-circle.d.ts +2 -0
  60. package/dist/widgets/zpl-graphic-circle.js +7 -0
  61. package/dist/widgets/zpl-graphic-diagonal-line.d.ts +2 -0
  62. package/dist/widgets/zpl-graphic-diagonal-line.js +7 -0
  63. package/dist/widgets/zpl-image.d.ts +4 -1
  64. package/dist/widgets/zpl-image.js +17 -14
  65. package/dist/widgets/zpl-text.d.ts +38 -8
  66. package/dist/widgets/zpl-text.js +183 -49
  67. package/dist/zplHelper.d.ts +1 -1
  68. package/dist/zplHelper.js +5 -1
  69. package/package.json +9 -4
  70. package/dist/extensions/ZplLayoutResizeExtensionProvider.d.ts +0 -4
  71. package/dist/extensions/ZplLayoutResizeExtensionProvider.js +0 -16
  72. package/dist/jsBarcodeOptions.d.ts +0 -27
  73. package/dist/jsBarcodeOptions.js +0 -14
  74. package/dist/qr.d.ts +0 -11
  75. package/dist/qr.js +0 -759
@@ -1,25 +1,55 @@
1
- import { BaseCustomWebComponentConstructorAppend } from "@node-projects/base-custom-webcomponent";
2
- declare enum FontNames {
3
- Font_0 = "0",
4
- Font_A = "A"
5
- }
1
+ import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
2
+ import { ZplFontName } from '../fonts/zplFonts.js';
3
+ type ZplRotation = 'N' | 'R' | 'I' | 'B';
4
+ /** Compensate for the printer font origin without moving preview ink outside its design box. */
5
+ export declare const zplTextOutputOriginCorrection = 3;
6
+ export declare function getZplTextOutputOffset(rotation: ZplRotation): {
7
+ x: number;
8
+ y: number;
9
+ };
6
10
  export declare class ZplText extends BaseCustomWebComponentConstructorAppend {
7
11
  static readonly style: CSSStyleSheet;
8
12
  static readonly template: HTMLTemplateElement;
9
13
  static readonly is = "zpl-text";
14
+ static get observedAttributes(): string[];
10
15
  content: string;
11
- fontName: string;
16
+ fontName: ZplFontName;
12
17
  fontHeight: number;
13
18
  fontWidth: number;
19
+ rotation: ZplRotation;
14
20
  private _text;
21
+ private _frame;
22
+ private _fontLoadStarted;
23
+ private _widgetReady;
24
+ private _inlineEditing;
15
25
  static readonly properties: {
16
26
  content: StringConstructor;
17
- fontName: typeof FontNames;
27
+ fontName: StringConstructor;
18
28
  fontHeight: NumberConstructor;
19
29
  fontWidth: NumberConstructor;
30
+ rotation: StringConstructor;
20
31
  };
21
32
  constructor();
22
- ready(): Promise<void>;
33
+ ready(): void;
34
+ attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
35
+ /** Called by the property service as well as native attribute callbacks. */
36
+ refreshFromAttributes(): void;
37
+ renderText(): void;
38
+ /**
39
+ * Text elements can temporarily have no layout box while the designer
40
+ * switches views. Canvas measurement keeps scalable Font 0 selectable in
41
+ * that state; the final approximation is only for DOM implementations
42
+ * without canvas support (notably unit-test DOMs).
43
+ */
44
+ private _measureTextWithoutLayout;
45
+ /** Starts plain-text editing inside the widget's shadow DOM. */
46
+ beginInlineEdit(): void;
47
+ refreshInlineEditBounds(): void;
48
+ get inlineEditElement(): HTMLDivElement;
49
+ get inlineEditContent(): string;
50
+ finishInlineEdit(): void;
51
+ private _ensureFontsLoaded;
52
+ private _setRotatedBounds;
23
53
  createZpl(): string;
24
54
  }
25
55
  export {};
@@ -1,69 +1,203 @@
1
- import { BaseCustomWebComponentConstructorAppend, css, html } from "@node-projects/base-custom-webcomponent";
2
- import { getZplCoordinates } from "../zplHelper.js";
3
- var FontNames;
4
- (function (FontNames) {
5
- FontNames["Font_0"] = "0";
6
- FontNames["Font_A"] = "A";
7
- })(FontNames || (FontNames = {}));
1
+ import { BaseCustomWebComponentConstructorAppend, css, html } from '@node-projects/base-custom-webcomponent';
2
+ import { applyDeviceFontCase, getDeviceFontMetrics, loadZplFonts, zplFontFamilies } from '../fonts/zplFonts.js';
3
+ import { getZplCoordinates } from '../zplHelper.js';
4
+ /** Compensate for the printer font origin without moving preview ink outside its design box. */
5
+ export const zplTextOutputOriginCorrection = 3;
6
+ export function getZplTextOutputOffset(rotation) {
7
+ switch (rotation) {
8
+ case 'R': return { x: -zplTextOutputOriginCorrection, y: 0 };
9
+ case 'I': return { x: 0, y: -zplTextOutputOriginCorrection };
10
+ case 'B': return { x: zplTextOutputOriginCorrection, y: 0 };
11
+ default: return { x: 0, y: zplTextOutputOriginCorrection };
12
+ }
13
+ }
8
14
  export class ZplText extends BaseCustomWebComponentConstructorAppend {
9
15
  static style = css `
10
- *{
11
- box-sizing: border-box;
12
- }
13
- `;
14
- static template = html `
15
- <div id="text-div" style="width: 100%; height: 100%; pointer-events: none">
16
- </div>
16
+ :host { display: block; min-width: 1px; min-height: 1px; }
17
+ #text-frame { position: relative; transform-origin: 0 0; width: max-content; height: max-content; }
18
+ #text-div { display: inline-block; white-space: pre; transform-origin: 0 0; line-height: 1; }
17
19
  `;
20
+ static template = html `<div id="text-frame"><div id="text-div"></div></div>`;
18
21
  static is = 'zpl-text';
19
- content;
20
- fontName;
21
- fontHeight;
22
- fontWidth;
22
+ static get observedAttributes() {
23
+ return ['content', 'font-name', 'font-height', 'font-width', 'rotation'];
24
+ }
25
+ content = '';
26
+ fontName = '0';
27
+ fontHeight = 30;
28
+ fontWidth = 0;
29
+ rotation = 'N';
23
30
  _text;
31
+ _frame;
32
+ _fontLoadStarted = false;
33
+ _widgetReady = false;
34
+ _inlineEditing = false;
24
35
  static properties = {
25
- content: String,
26
- fontName: FontNames,
27
- fontHeight: Number,
28
- fontWidth: Number
36
+ content: String, fontName: String, fontHeight: Number, fontWidth: Number, rotation: String
29
37
  };
30
38
  constructor() {
31
39
  super();
32
40
  this._restoreCachedInititalValues();
33
- this._text = this._getDomElement("text-div");
41
+ this._text = this._getDomElement('text-div');
42
+ this._frame = this._getDomElement('text-frame');
34
43
  }
35
- async ready() {
44
+ ready() {
45
+ this._widgetReady = true;
46
+ this.refreshFromAttributes();
47
+ this._ensureFontsLoaded();
48
+ }
49
+ attributeChangedCallback(_name, oldValue, newValue) {
50
+ if (oldValue === newValue || !this._widgetReady)
51
+ return;
52
+ this.refreshFromAttributes();
53
+ }
54
+ /** Called by the property service as well as native attribute callbacks. */
55
+ refreshFromAttributes() {
36
56
  this._parseAttributesToProperties();
37
- this._text.innerHTML = this.content;
38
- this._text.style.transformOrigin = "0 0";
39
- switch (this.fontName) {
40
- case FontNames.Font_0:
41
- this._text.style.fontSize = "9px";
42
- this._text.style.fontFamily = "RobotoCn, Verdana";
43
- this._text.style.fontKerning = "none";
44
- this._text.style.transform = "scaleX(" + this.fontWidth / 9 + ") scaleY(" + this.fontHeight / 9 + ") translate(0px, -3px)";
57
+ this.renderText();
58
+ }
59
+ renderText() {
60
+ const font = /^[0A-H]$/.test(this.fontName) ? this.fontName : '0';
61
+ const metrics = getDeviceFontMetrics(font, this.fontHeight, this.fontWidth);
62
+ const fontSize = metrics?.fontSize ?? Math.max(1, this.fontHeight);
63
+ const scaleX = metrics?.scaleX ?? (this.fontWidth > 0 ? this.fontWidth / this.fontHeight : 1);
64
+ // PrintLab's browser line box drifts progressively below Zebra Font 0
65
+ // as the requested em grows. This curve is calibrated against one
66
+ // batched 15..240-dot printer fixture and keeps the visible ink inside
67
+ // the ZPL-origin selection frame (rather than moving the element).
68
+ const scalableFontYOffset = font === '0'
69
+ ? -Math.max(0, Math.round((this.fontHeight - 60) * .12))
70
+ : 0;
71
+ const displayedContent = applyDeviceFontCase(font, this.content ?? '');
72
+ if (!this._inlineEditing)
73
+ this._text.textContent = displayedContent;
74
+ this._text.style.fontFamily = `"${zplFontFamilies[font]}", monospace`;
75
+ this._text.style.fontSize = `${fontSize}px`;
76
+ this._text.style.fontWeight = font === '0' ? 'bold' : 'normal';
77
+ this._text.style.letterSpacing = `${metrics?.letterSpacing ?? 0}px`;
78
+ this._text.style.transform = `translate(${metrics?.xOffset ?? 0}px, ${(metrics?.yOffset ?? 0) + scalableFontYOffset}px) scaleX(${scaleX})`;
79
+ // Force layout here. Resize strategies need the quantized bounds in the
80
+ // same pointer event, rather than one animation frame later.
81
+ const layoutWidth = this._text.scrollWidth;
82
+ const rawWidth = Math.max(1, layoutWidth || this._measureTextWithoutLayout(displayedContent, fontSize, font));
83
+ // Device fonts are fixed-cell bitmap fonts, so their printed advance is
84
+ // deterministic. Do not depend on scrollWidth: it is zero while the
85
+ // designer is hidden or being moved into split view, which previously
86
+ // collapsed the host selection box while its glyphs overflowed it.
87
+ const width = metrics
88
+ ? Math.max(1, [...displayedContent].length * metrics.characterAdvance + Math.abs(metrics.xOffset))
89
+ : Math.max(1, rawWidth * scaleX);
90
+ const height = Math.max(1, fontSize + Math.abs(metrics?.yOffset ?? 0));
91
+ this._setRotatedBounds(width, height, this.rotation);
92
+ }
93
+ /**
94
+ * Text elements can temporarily have no layout box while the designer
95
+ * switches views. Canvas measurement keeps scalable Font 0 selectable in
96
+ * that state; the final approximation is only for DOM implementations
97
+ * without canvas support (notably unit-test DOMs).
98
+ */
99
+ _measureTextWithoutLayout(content, fontSize, font) {
100
+ try {
101
+ if (!this.ownerDocument.defaultView?.navigator.userAgent.includes('jsdom')) {
102
+ const canvas = this.ownerDocument.createElement('canvas');
103
+ const context = canvas.getContext('2d');
104
+ if (context) {
105
+ context.font = `${font === '0' ? 'bold ' : ''}${fontSize}px "${zplFontFamilies[font]}", monospace`;
106
+ return context.measureText(content).width;
107
+ }
108
+ }
109
+ }
110
+ catch { /* use deterministic fallback */ }
111
+ return [...content].length * fontSize * .6;
112
+ }
113
+ /** Starts plain-text editing inside the widget's shadow DOM. */
114
+ beginInlineEdit() {
115
+ if (this._inlineEditing)
116
+ return;
117
+ this._inlineEditing = true;
118
+ this._text.textContent = this.content ?? '';
119
+ this._text.setAttribute('contenteditable', 'plaintext-only');
120
+ this._text.spellcheck = false;
121
+ this._text.style.cursor = 'text';
122
+ this._text.style.userSelect = 'text';
123
+ this._text.style.outline = 'none';
124
+ this.refreshInlineEditBounds();
125
+ this._text.focus({ preventScroll: true });
126
+ const selection = this.ownerDocument.getSelection();
127
+ if (selection) {
128
+ const range = this.ownerDocument.createRange();
129
+ range.selectNodeContents(this._text);
130
+ range.collapse(false);
131
+ selection.removeAllRanges();
132
+ selection.addRange(range);
133
+ }
134
+ }
135
+ refreshInlineEditBounds() {
136
+ if (!this._inlineEditing)
137
+ return;
138
+ const value = this.inlineEditContent;
139
+ const font = /^[0A-H]$/.test(this.fontName) ? this.fontName : '0';
140
+ const metrics = getDeviceFontMetrics(font, this.fontHeight, this.fontWidth);
141
+ const fontSize = metrics?.fontSize ?? Math.max(1, this.fontHeight);
142
+ const scaleX = metrics?.scaleX ?? (this.fontWidth > 0 ? this.fontWidth / this.fontHeight : 1);
143
+ const layoutWidth = this._text.scrollWidth;
144
+ const width = metrics
145
+ ? Math.max(1, [...value].length * metrics.characterAdvance + Math.abs(metrics.xOffset))
146
+ : Math.max(1, (layoutWidth || this._measureTextWithoutLayout(value, fontSize, font)) * scaleX);
147
+ const height = Math.max(1, fontSize + Math.abs(metrics?.yOffset ?? 0));
148
+ this._setRotatedBounds(width, height, this.rotation);
149
+ }
150
+ get inlineEditElement() { return this._text; }
151
+ get inlineEditContent() {
152
+ return (this._text.textContent ?? '').replace(/[\r\n]+/g, ' ');
153
+ }
154
+ finishInlineEdit() {
155
+ if (!this._inlineEditing)
156
+ return;
157
+ this._inlineEditing = false;
158
+ this._text.removeAttribute('contenteditable');
159
+ this._text.spellcheck = true;
160
+ this._text.style.cursor = '';
161
+ this._text.style.userSelect = '';
162
+ this._text.style.outline = '';
163
+ this.renderText();
164
+ }
165
+ _ensureFontsLoaded() {
166
+ if (this._fontLoadStarted)
167
+ return;
168
+ this._fontLoadStarted = true;
169
+ void loadZplFonts(this.ownerDocument)
170
+ .then(() => this.renderText())
171
+ .catch(() => { });
172
+ }
173
+ _setRotatedBounds(width, height, rotation) {
174
+ this._frame.style.width = `${width}px`;
175
+ this._frame.style.height = `${height}px`;
176
+ this._frame.style.transform = '';
177
+ switch (rotation) {
178
+ case 'R':
179
+ this._frame.style.transform = `translateX(${height}px) rotate(90deg)`;
180
+ this.style.width = `${height}px`;
181
+ this.style.height = `${width}px`;
182
+ break;
183
+ case 'I':
184
+ this._frame.style.transform = `translate(${width}px, ${height}px) rotate(180deg)`;
185
+ this.style.width = `${width}px`;
186
+ this.style.height = `${height}px`;
45
187
  break;
46
- case FontNames.Font_A:
47
- this._text.style.fontSize = "9px";
48
- this._text.style.fontFamily = "monospace";
49
- this._text.style.transform = "scaleX(" + this.fontWidth / 5 + ") scaleY(" + this.fontHeight / 8 + ") translate(0px, -3px)";
188
+ case 'B':
189
+ this._frame.style.transform = `translateY(${width}px) rotate(270deg)`;
190
+ this.style.width = `${height}px`;
191
+ this.style.height = `${width}px`;
50
192
  break;
193
+ default:
194
+ this.style.width = `${width}px`;
195
+ this.style.height = `${height}px`;
51
196
  }
52
- this.style.width = '';
53
- this.style.height = '';
54
- requestAnimationFrame(() => {
55
- let rect = this._text.getBoundingClientRect();
56
- this.style.width = rect.width + 'px';
57
- this.style.height = rect.height / 2 + 'px';
58
- });
59
197
  }
60
198
  createZpl() {
61
- let zpl = "";
62
- zpl += getZplCoordinates(this, 0);
63
- zpl += "^CF" + this.fontName + "," + this.fontHeight + "," + this.fontWidth;
64
- zpl += "^FD" + this.content;
65
- zpl += "^FS";
66
- return zpl;
199
+ const offset = getZplTextOutputOffset(this.rotation);
200
+ return `${getZplCoordinates(this, 0, offset.x, offset.y)}^A${this.fontName}${this.rotation},${this.fontHeight},${this.fontWidth}^FD${this.content}^FS`;
67
201
  }
68
202
  }
69
203
  customElements.define(ZplText.is, ZplText);
@@ -1 +1 @@
1
- export declare function getZplCoordinates(obj: any, alignment: 0 | 1 | 2): string;
1
+ export declare function getZplCoordinates(obj: any, alignment: 0 | 1 | 2, xOffset?: number, yOffset?: number): string;
package/dist/zplHelper.js CHANGED
@@ -1,5 +1,9 @@
1
- export function getZplCoordinates(obj, alignment) {
1
+ export function getZplCoordinates(obj, alignment, xOffset = 0, yOffset = 0) {
2
2
  let x = obj.style.left.replace("px", "");
3
3
  let y = obj.style.top.replace("px", "");
4
+ if (xOffset)
5
+ x = String((Number(x) || 0) + xOffset);
6
+ if (yOffset)
7
+ y = String((Number(y) || 0) + yOffset);
4
8
  return "^FO" + x + "," + y + "," + alignment;
5
9
  }
package/package.json CHANGED
@@ -1,24 +1,29 @@
1
1
  {
2
2
  "description": "web-component-designer addon: Widgets and Services for creating a ZPL Designer",
3
3
  "name": "@node-projects/web-component-designer-zpl",
4
- "version": "0.2.0",
4
+ "version": "0.3.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",
8
8
  "license": "MIT",
9
9
  "scripts": {
10
10
  "tsc": "tsc",
11
+ "prebuild": "node -e \"const fs=require('node:fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('tsconfig.tsbuildinfo', { force: true })\"",
11
12
  "build": "tsc",
13
+ "test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js --config ../../jest.config.js packages/web-component-designer-zpl/test --runInBand",
14
+ "copy": "node scripts/copy-package-files.mjs",
15
+ "attribution:generate": "node scripts/generate-third-party-licenses.mjs",
16
+ "attribution:check": "node scripts/generate-third-party-licenses.mjs --check",
12
17
  "link": "npm link",
13
- "prepublishOnly": "npm run build"
18
+ "prepublishOnly": "npm run attribution:check && npm run build && npm run copy"
14
19
  },
15
20
  "dependencies": {
16
21
  "@node-projects/base-custom-webcomponent": ">=0.27.8",
17
22
  "@node-projects/web-component-designer": ">=0.2.0",
18
- "jsbarcode": "^3.11.6"
23
+ "@bwip-js/browser": "4.11.2"
19
24
  },
20
25
  "repository": {
21
26
  "type": "git",
22
27
  "url": "git+https://github.com/node-projects/web-component-designer.git"
23
28
  }
24
- }
29
+ }
@@ -1,4 +0,0 @@
1
- import { IExtensionManager, IDesignerCanvas, IDesignItem, ResizeExtensionProvider } from '@node-projects/web-component-designer';
2
- export declare class ZplLayoutResizeExtensionProvider extends ResizeExtensionProvider {
3
- shouldExtend(extensionManager: IExtensionManager, designerView: IDesignerCanvas, designItem: IDesignItem): boolean;
4
- }
@@ -1,16 +0,0 @@
1
- import { ResizeExtensionProvider } from '@node-projects/web-component-designer';
2
- import { ZplImage } from '../widgets/zpl-image.js';
3
- import { ZplBarcode } from '../widgets/zpl-barcode.js';
4
- import { ZplText } from '../widgets/zpl-text.js';
5
- export class ZplLayoutResizeExtensionProvider extends ResizeExtensionProvider {
6
- shouldExtend(extensionManager, designerView, designItem) {
7
- //return designItem.element.localName !== MfcConfigRoute.is;
8
- switch (designItem.name) {
9
- case ZplImage.is:
10
- case ZplBarcode.is:
11
- case ZplText.is:
12
- return false;
13
- }
14
- return true;
15
- }
16
- }
@@ -1,27 +0,0 @@
1
- export type BarcodeOptions = {
2
- format?: BarcodeFormat;
3
- width?: number;
4
- height?: number;
5
- displayValue?: boolean;
6
- text?: string;
7
- fontOptions?: string;
8
- font?: string;
9
- textAlign?: string;
10
- textPosition?: string;
11
- textMargin?: number;
12
- fontSize?: number;
13
- background?: string;
14
- lineColor?: string;
15
- margin?: number;
16
- marginTop?: number;
17
- marginBottom?: number;
18
- marginLeft?: number;
19
- marginRight?: number;
20
- flat?: boolean;
21
- valid?: Function;
22
- };
23
- export declare enum BarcodeFormat {
24
- CODE128 = "CODE128",
25
- EAN13 = "EAN13",
26
- QR = "QR"
27
- }
@@ -1,14 +0,0 @@
1
- export var BarcodeFormat;
2
- (function (BarcodeFormat) {
3
- BarcodeFormat["CODE128"] = "CODE128";
4
- // CODE128A = "CODE128A",
5
- // CODE128B = "CODE128B",
6
- // CODE123C = "CODE128C",
7
- // CODE39 = "CODE39",
8
- // EAN2 = "EAN2",
9
- // EAN5 = "EAN5",
10
- // EAN8 = "EAN8",
11
- BarcodeFormat["EAN13"] = "EAN13";
12
- // UPC = "UPC",
13
- BarcodeFormat["QR"] = "QR";
14
- })(BarcodeFormat || (BarcodeFormat = {}));
package/dist/qr.d.ts DELETED
@@ -1,11 +0,0 @@
1
- declare var QRCode: {
2
- generate: (data: any, options: any) => any[];
3
- generateHTML: (data: any, options: any) => HTMLDivElement;
4
- generateSVG: (data: any, options: {
5
- background?: string;
6
- modulesize?: number;
7
- margin?: number;
8
- }) => SVGSVGElement;
9
- generatePNG: (data: any, options: any) => string;
10
- };
11
- export default QRCode;