@connectedxm/zpl-generator 0.0.4-beta.10 → 0.0.4-beta.12

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/dist/index.es.js CHANGED
@@ -3051,18 +3051,18 @@ function oc(e) {
3051
3051
  function ic(e) {
3052
3052
  return kt.parse(e);
3053
3053
  }
3054
- function sc(e, t) {
3054
+ function sc(e, t, n) {
3055
3055
  if (e.type === "thermal")
3056
- return Ws(e, t);
3056
+ return Ws(e, t, n);
3057
3057
  throw new Error(`Unsupported badge type: ${e.type}`);
3058
3058
  }
3059
- function Ws(e, t) {
3060
- const n = ["^XA", Ys(e)];
3061
- for (const r of e.fields) {
3062
- const o = Ks(r, t);
3063
- o && n.push(o);
3059
+ function Ws(e, t, n) {
3060
+ const r = ["^XA", Ys(e)];
3061
+ for (const o of e.fields) {
3062
+ const s = Ks(o, t, n?.[o.name]);
3063
+ s && r.push(s);
3064
3064
  }
3065
- return n.push("^XZ"), n.join(`
3065
+ return r.push("^XZ"), r.join(`
3066
3066
  `);
3067
3067
  }
3068
3068
  function Ys(e) {
@@ -3088,19 +3088,19 @@ function Ys(e) {
3088
3088
  return n.join(`
3089
3089
  `);
3090
3090
  }
3091
- function Ks(e, t) {
3092
- let n = Gs(e, t);
3093
- if (typeof n == "string")
3091
+ function Ks(e, t, n) {
3092
+ let r = n ?? Gs(e, t);
3093
+ if (typeof r == "string")
3094
3094
  switch (e.type) {
3095
3095
  case "text":
3096
- return n = Hs(e, n), qs(e, n);
3096
+ return r = Hs(e, r), qs(e, r);
3097
3097
  case "barcode":
3098
- return ec(e, n);
3098
+ return ec(e, r);
3099
3099
  case "qrcode":
3100
- return tc(e, n);
3100
+ return tc(e, r);
3101
3101
  default: {
3102
- const r = e;
3103
- throw new Error(`Unsupported field type: ${r.type}`);
3102
+ const o = e;
3103
+ throw new Error(`Unsupported field type: ${o.type}`);
3104
3104
  }
3105
3105
  }
3106
3106
  }
@@ -1,6 +1,8 @@
1
1
  import { Badge, Field, TextField } from './validate';
2
2
  import { SourceData } from './interfaces';
3
- export declare function generate(badge: Badge, data?: SourceData): string;
3
+ export declare function generate(badge: Badge, data?: SourceData, overrides?: {
4
+ [key: string]: string;
5
+ }): string;
4
6
  export declare function getFieldValue(field: Field, data?: SourceData): string | undefined;
5
7
  /**
6
8
  * Counts how many lines the field data will occupy inside a ^FB field.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@connectedxm/zpl-generator",
3
- "version": "0.0.4-beta.10",
3
+ "version": "0.0.4-beta.12",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",