etiquetas.js 1.0.0-alpha.7 → 1.0.0-alpha.9

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.
@@ -11529,7 +11529,7 @@ function(t2) {
11529
11529
  */
11530
11530
  function(t2) {
11531
11531
  function e2() {
11532
- return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-yItW81m8.js")).catch(function(t3) {
11532
+ return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-5Yp5bfMA.js")).catch(function(t3) {
11533
11533
  return Promise.reject(new Error("Could not load canvg: " + t3));
11534
11534
  }).then(function(t3) {
11535
11535
  return t3.default ? t3.default : t3;
@@ -27880,7 +27880,7 @@ const getImagesFromUrlToBase64 = (url) => __async(void 0, null, function* () {
27880
27880
  throw new Error("Invalid URL provided");
27881
27881
  }
27882
27882
  console.log("getImagesFromUrlToBase64: Converting URL to Base64:", url);
27883
- const response = yield fetch("https://cors-anywhere.herokuapp.com/" + url);
27883
+ const response = yield fetch(url);
27884
27884
  if (!response.ok) {
27885
27885
  throw new Error(`HTTP error! status: ${response.status}`);
27886
27886
  }
@@ -29024,6 +29024,14 @@ function NEW_createLabel(params) {
29024
29024
  const firstLeft = rectCanvas.left;
29025
29025
  const firstTop = rectCanvas.top;
29026
29026
  const pdfInstance = params.pdfInstance;
29027
+ const sortedLabelElements = labelElements.sort((a2, b2) => {
29028
+ const aIsVolumeContent = (a2 == null ? void 0 : a2.specialProp) === "volumeContent";
29029
+ const bIsVolumeContent = (b2 == null ? void 0 : b2.specialProp) === "volumeContent";
29030
+ if (aIsVolumeContent && !bIsVolumeContent) return 1;
29031
+ if (!aIsVolumeContent && bIsVolumeContent) return -1;
29032
+ return 0;
29033
+ });
29034
+ console.log("sorted =>>", sortedLabelElements);
29027
29035
  if (pageLines > 0) {
29028
29036
  yield createLabelPage(
29029
29037
  __spreadProps(__spreadValues({}, params), {
@@ -29031,7 +29039,7 @@ function NEW_createLabel(params) {
29031
29039
  pageWidth,
29032
29040
  pageHeight,
29033
29041
  rectCanvas,
29034
- labelElements,
29042
+ labelElements: sortedLabelElements,
29035
29043
  dataIndex,
29036
29044
  dataSource,
29037
29045
  width,
@@ -29084,6 +29092,14 @@ function createLabelsGenerator(params) {
29084
29092
  rectCanvas.top;
29085
29093
  indexLabel >= dataSource.length - 1;
29086
29094
  let containerEl = null;
29095
+ const sortedLabelElements = otherElements.sort((a2, b2) => {
29096
+ const aIsVolumeContent = (a2 == null ? void 0 : a2.specialProp) === "volumeContent";
29097
+ const bIsVolumeContent = (b2 == null ? void 0 : b2.specialProp) === "volumeContent";
29098
+ if (aIsVolumeContent && !bIsVolumeContent) return 1;
29099
+ if (!aIsVolumeContent && bIsVolumeContent) return -1;
29100
+ return 0;
29101
+ });
29102
+ console.log("otherElements =", sortedLabelElements);
29087
29103
  if (typeof document !== "undefined") {
29088
29104
  containerEl = document.getElementById("label-container");
29089
29105
  if (!containerEl) {
@@ -29114,7 +29130,7 @@ function createLabelsGenerator(params) {
29114
29130
  dataIndex: indexLabel,
29115
29131
  sheets,
29116
29132
  sheetsByPartCode,
29117
- labels: otherElements,
29133
+ labels: sortedLabelElements,
29118
29134
  rectCanvas,
29119
29135
  pdfInstance,
29120
29136
  imagesCache,
@@ -59403,4 +59419,4 @@ export {
59403
59419
  sendToPrinter as y,
59404
59420
  validateLabelData as z
59405
59421
  };
59406
- //# sourceMappingURL=index-Tvy8FVsM.js.map
59422
+ //# sourceMappingURL=index-Br1zbFfm.js.map