@veztraa/report-designer 0.1.4 → 0.2.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 +53 -60
- package/dist/index.js +425 -432
- package/package.json +4 -3
- package/dist/index.css +0 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=Open+Sans:ital,wght@0,400;0,700;1,400;1,700&family=Lato:ital,wght@0,400;0,700;1,400;1,700&family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&family=Poppins:ital,wght@0,400;0,700;1,400;1,700&family=Nunito:ital,wght@0,400;0,700;1,400;1,700&family=Raleway:ital,wght@0,400;0,700;1,400;1,700&family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Source+Code+Pro:ital,wght@0,400;0,700;1,400;1,700&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.z-10{z-index:10}.z-50{z-index:50}.mb-2{margin-bottom:.5rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mt-1{margin-top:.25rem}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-full{height:100%}.min-h-0{min-height:0px}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.resize-none{resize:none}.resize{resize:both}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.gap-0\\.5{gap:.125rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-0{border-width:0px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-amber-800\\/60{border-color:#92400e99}.border-amber-900\\/50{border-color:#78350f80}.border-gray-700{--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.border-gray-800{--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.bg-amber-900\\/60{background-color:#78350f99}.bg-amber-950\\/40{background-color:#451a0366}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-blue-900{--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-gray-950{--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.bg-green-900{--tw-bg-opacity: 1;background-color:rgb(20 83 45 / var(--tw-bg-opacity, 1))}.bg-orange-900{--tw-bg-opacity: 1;background-color:rgb(124 45 18 / var(--tw-bg-opacity, 1))}.bg-purple-900{--tw-bg-opacity: 1;background-color:rgb(88 28 135 / var(--tw-bg-opacity, 1))}.bg-yellow-900{--tw-bg-opacity: 1;background-color:rgb(113 63 18 / var(--tw-bg-opacity, 1))}.p-0\\.5{padding:.125rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.ordinal{--tw-ordinal: ordinal;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-wider{letter-spacing:.05em}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-blue-300{--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-orange-300{--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.text-purple-300{--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-300{--tw-text-opacity: 1;color:rgb(253 224 71 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{--bg: #eeeef4;--panel: #ffffff;--card: #f4f4f9;--input: #eaeaf2;--hover: #e2e2ec;--active: #d8d8e8;--border: rgba(0,0,0,.1);--border-h: rgba(0,0,0,.18);--border-s: rgba(0,0,0,.28);--text-1: #111118;--text-2: #3c3c52;--text-3: #6c6c84;--accent: #6c63ff;--accent-h: #7b73ff;--accent-dim: rgba(108,99,255,.1);--accent-ring: rgba(108,99,255,.22);--danger: #dc2626;--success: #16a34a;--warn: #d97706}[data-theme=dark]{--bg: #0c0c10;--panel: #111115;--card: #17171c;--input: #1e1e25;--hover: #242430;--active: #2c2c3a;--border: rgba(255,255,255,.07);--border-h: rgba(255,255,255,.13);--border-s: rgba(255,255,255,.2);--text-1: #e4e4ef;--text-2: #8080a0;--text-3: #404055;--accent: #7c6af7;--accent-h: #9585f9;--accent-dim: rgba(124,106,247,.14);--accent-ring: rgba(124,106,247,.4);--danger: #f87171;--success: #4ade80;--warn: #fbbf24}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}body{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:var(--bg);color:var(--text-1);height:100vh;overflow:hidden;font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#root{height:100vh;display:flex;flex-direction:column}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border-h);border-radius:4px}::-webkit-scrollbar-thumb:hover{background:var(--border-s)}input:focus-visible,textarea:focus-visible,select:focus-visible,button:focus-visible{outline:1.5px solid var(--accent);outline-offset:1px}.resize-handle{position:absolute;width:8px;height:8px;background:var(--accent);border:1.5px solid rgba(255,255,255,.85);border-radius:2.5px;z-index:10;transition:transform .12s ease}.resize-handle:hover{transform:scale(1.4)}.canvas-grid{background-image:radial-gradient(circle,rgba(0,0,0,.09) 1px,transparent 1px);background-size:20px 20px}[data-theme=dark] .canvas-grid{background-image:radial-gradient(circle,rgba(255,255,255,.07) 1px,transparent 1px)}.font-mono{font-family:JetBrains Mono,Fira Code,Cascadia Code,ui-monospace,monospace}.section-label{font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;position:absolute;top:3px;left:6px;pointer-events:none}.hover\\:bg-amber-700\\/70:hover{background-color:#b45309b3}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-800\\/50:hover{background-color:#1f293780}.hover\\:text-gray-200:hover{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.hover\\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.focus\\:border-blue-500:focus{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
1
2
|
import { jsxs as v, jsx as t, Fragment as Q } from "react/jsx-runtime";
|
|
2
3
|
import { useState as U, useEffect as re, useRef as ee, useMemo as nt, useCallback as vi, useLayoutEffect as bi } from "react";
|
|
3
4
|
import { create as Fo } from "zustand";
|
|
4
5
|
import { SUPPORTED_FONTS as $o } from "@veztraa/report-core";
|
|
5
6
|
import { createPortal as mi } from "react-dom";
|
|
6
|
-
import {
|
|
7
|
+
import { usePDF as xi } from "@react-pdf/renderer";
|
|
7
8
|
import { ReportDocument as wi } from "@veztraa/report-renderer";
|
|
8
9
|
function H({ size: e = 24, color: o = "currentColor", strokeWidth: i = 2, className: a, style: l, children: s }) {
|
|
9
10
|
return /* @__PURE__ */ t(
|
|
@@ -1685,16 +1686,16 @@ function _a({ fields: e, onChange: o }) {
|
|
|
1685
1686
|
}
|
|
1686
1687
|
function ti({ field: e, depth: o = 0, onUpdate: i, onRemove: a }) {
|
|
1687
1688
|
var E;
|
|
1688
|
-
const [l, s] = U(!1), [f, h] = U(!1), [u, r] = U(""), n = ba[e.type], c = (S, M) => i({ [S]: M }), d = e.type === "sum" || e.type === "average", p = ["string", "number", "boolean", "date"].includes(e.type), g = !["sum", "average", "richtext"].includes(e.type), y = ["number", "date", "sum", "average"].includes(e.type), w = d, b = e.type === "list" || e.type === "collection",
|
|
1689
|
+
const [l, s] = U(!1), [f, h] = U(!1), [u, r] = U(""), n = ba[e.type], c = (S, M) => i({ [S]: M }), d = e.type === "sum" || e.type === "average", p = ["string", "number", "boolean", "date"].includes(e.type), g = !["sum", "average", "richtext"].includes(e.type), y = ["number", "date", "sum", "average"].includes(e.type), w = d, b = e.type === "list" || e.type === "collection", x = ["list", "collection", "simplelist"].includes(e.type), O = o > 0 ? "rgba(0,0,0,0.04)" : "transparent", m = e.type === "collection" ? "{}" : "[]";
|
|
1689
1690
|
return /* @__PURE__ */ v(Q, { children: [
|
|
1690
1691
|
/* @__PURE__ */ v("div", { style: { borderBottom: "1px solid var(--border)" }, children: [
|
|
1691
1692
|
/* @__PURE__ */ v(
|
|
1692
1693
|
"div",
|
|
1693
1694
|
{
|
|
1694
|
-
style: { display: "flex", alignItems: "center", gap: 6, padding: `7px ${10 + o * 10}px`, cursor: "pointer", transition: "background 0.1s", background:
|
|
1695
|
+
style: { display: "flex", alignItems: "center", gap: 6, padding: `7px ${10 + o * 10}px`, cursor: "pointer", transition: "background 0.1s", background: O },
|
|
1695
1696
|
onClick: () => s(!l),
|
|
1696
1697
|
onMouseEnter: (S) => S.currentTarget.style.background = "var(--hover)",
|
|
1697
|
-
onMouseLeave: (S) => S.currentTarget.style.background =
|
|
1698
|
+
onMouseLeave: (S) => S.currentTarget.style.background = O,
|
|
1698
1699
|
children: [
|
|
1699
1700
|
/* @__PURE__ */ t("span", { style: { color: "var(--text-3)", flexShrink: 0, display: "flex" }, children: l ? /* @__PURE__ */ t(nr, { size: 12 }) : /* @__PURE__ */ t(ki, { size: 12 }) }),
|
|
1700
1701
|
/* @__PURE__ */ t("span", { style: { padding: "1px 5px", borderRadius: 4, fontSize: 9, fontWeight: 700, fontFamily: "monospace", background: n.bg, color: n.color, flexShrink: 0 }, children: n.label }),
|
|
@@ -1754,7 +1755,7 @@ function ti({ field: e, depth: o = 0, onUpdate: i, onRemove: a }) {
|
|
|
1754
1755
|
}
|
|
1755
1756
|
),
|
|
1756
1757
|
/* @__PURE__ */ t("p", { style: { fontSize: 10, color: "var(--text-3)", marginTop: 4 }, children: "Rich text can contain HTML tags for formatting." })
|
|
1757
|
-
] }) :
|
|
1758
|
+
] }) : x ? /* @__PURE__ */ v(
|
|
1758
1759
|
"button",
|
|
1759
1760
|
{
|
|
1760
1761
|
onClick: () => h(!0),
|
|
@@ -1789,7 +1790,7 @@ function ti({ field: e, depth: o = 0, onUpdate: i, onRemove: a }) {
|
|
|
1789
1790
|
{
|
|
1790
1791
|
title: `Test data — ${e.key}`,
|
|
1791
1792
|
subtitle: `(${(E = Gr.find((S) => S.value === e.type)) == null ? void 0 : E.label})`,
|
|
1792
|
-
jsonText: e.value ||
|
|
1793
|
+
jsonText: e.value || m,
|
|
1793
1794
|
jsonError: u,
|
|
1794
1795
|
onChange: (S) => {
|
|
1795
1796
|
c("value", S);
|
|
@@ -1816,21 +1817,21 @@ function Ea() {
|
|
|
1816
1817
|
}
|
|
1817
1818
|
}, [e]), re(() => {
|
|
1818
1819
|
if (!r) return;
|
|
1819
|
-
const b = (
|
|
1820
|
-
|
|
1820
|
+
const b = (x) => {
|
|
1821
|
+
x.key === "Escape" && n(!1);
|
|
1821
1822
|
};
|
|
1822
1823
|
return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
|
|
1823
1824
|
}, [r]);
|
|
1824
1825
|
const d = (b) => {
|
|
1825
|
-
const
|
|
1826
|
-
c.current =
|
|
1827
|
-
}, p = () => d([...a, tt()]), g = (b,
|
|
1826
|
+
const x = JSON.stringify(ya(b), null, 2);
|
|
1827
|
+
c.current = x, l(b), f(x), o(x), i(ei(b)), u("");
|
|
1828
|
+
}, p = () => d([...a, tt()]), g = (b, x) => d(a.map((O) => O.id === b ? { ...O, ...x } : O)), y = (b) => d(a.filter((x) => x.id !== b)), w = (b) => {
|
|
1828
1829
|
f(b);
|
|
1829
1830
|
try {
|
|
1830
|
-
const
|
|
1831
|
-
c.current = b, l(
|
|
1832
|
-
} catch (
|
|
1833
|
-
u(
|
|
1831
|
+
const x = er(JSON.parse(b));
|
|
1832
|
+
c.current = b, l(x), o(b), u("");
|
|
1833
|
+
} catch (x) {
|
|
1834
|
+
u(x.message);
|
|
1834
1835
|
}
|
|
1835
1836
|
};
|
|
1836
1837
|
return /* @__PURE__ */ v(Q, { children: [
|
|
@@ -1868,7 +1869,7 @@ function Ea() {
|
|
|
1868
1869
|
ti,
|
|
1869
1870
|
{
|
|
1870
1871
|
field: b,
|
|
1871
|
-
onUpdate: (
|
|
1872
|
+
onUpdate: (x) => g(b.id, x),
|
|
1872
1873
|
onRemove: () => y(b.id)
|
|
1873
1874
|
},
|
|
1874
1875
|
b.id
|
|
@@ -2249,8 +2250,8 @@ function Ra({ margin: e, onUpdate: o }) {
|
|
|
2249
2250
|
] });
|
|
2250
2251
|
}
|
|
2251
2252
|
function Aa() {
|
|
2252
|
-
var _,
|
|
2253
|
-
const { template: e, updatePage: o, updateMargin: i, updateHeaderHeight: a, updateFooterHeight: l, updateHeaderEnabled: s, updateFooterEnabled: f, updateHeaderDisplay: h, updateFooterDisplay: u, setTemplateName: r } = X(), n = e.page ?? { size: "A4", orientation: "portrait", margin: { top: 20, right: 20, bottom: 20, left: 20 } }, c = n.margin ?? { top: 20, right: 20, bottom: 20, left: 20 }, d = ((_ = e.header) == null ? void 0 : _.height) ?? 60, p = ((
|
|
2253
|
+
var _, T, D, F, B, V;
|
|
2254
|
+
const { template: e, updatePage: o, updateMargin: i, updateHeaderHeight: a, updateFooterHeight: l, updateHeaderEnabled: s, updateFooterEnabled: f, updateHeaderDisplay: h, updateFooterDisplay: u, setTemplateName: r } = X(), n = e.page ?? { size: "A4", orientation: "portrait", margin: { top: 20, right: 20, bottom: 20, left: 20 } }, c = n.margin ?? { top: 20, right: 20, bottom: 20, left: 20 }, d = ((_ = e.header) == null ? void 0 : _.height) ?? 60, p = ((T = e.footer) == null ? void 0 : T.height) ?? 40, g = ((D = e.header) == null ? void 0 : D.enabled) !== !1, y = ((F = e.footer) == null ? void 0 : F.enabled) !== !1, w = ((B = e.header) == null ? void 0 : B.display) ?? "always", b = ((V = e.footer) == null ? void 0 : V.display) ?? "always", x = n.watermark ?? {}, O = x.enabled ?? !1, m = (L) => o({ watermark: { ...x, ...L } }), E = n.size ?? "A4", S = n.orientation === "landscape", [M, z] = Ta[E] ?? [794, 1123], C = S ? z : M, A = S ? M : z, R = n.customHeight ?? A;
|
|
2254
2255
|
return /* @__PURE__ */ v("div", { className: "flex-1 overflow-y-auto", style: { paddingBottom: 24 }, children: [
|
|
2255
2256
|
/* @__PURE__ */ t(Pe, { children: "Document" }),
|
|
2256
2257
|
/* @__PURE__ */ t("div", { style: { padding: "0 14px", display: "flex", flexDirection: "column", gap: 10 }, children: /* @__PURE__ */ v("div", { children: [
|
|
@@ -2457,33 +2458,33 @@ function Aa() {
|
|
|
2457
2458
|
/* @__PURE__ */ t(Pe, { children: "Watermark" }),
|
|
2458
2459
|
/* @__PURE__ */ t("div", { style: { padding: "0 14px" }, children: /* @__PURE__ */ v("div", { style: {
|
|
2459
2460
|
borderRadius: 9,
|
|
2460
|
-
border: `1px solid ${
|
|
2461
|
+
border: `1px solid ${O ? "var(--border-h)" : "var(--border)"}`,
|
|
2461
2462
|
background: "var(--card)",
|
|
2462
2463
|
overflow: "hidden",
|
|
2463
|
-
opacity:
|
|
2464
|
+
opacity: O ? 1 : 0.65,
|
|
2464
2465
|
transition: "opacity 0.15s"
|
|
2465
2466
|
}, children: [
|
|
2466
2467
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", padding: "9px 12px" }, children: [
|
|
2467
2468
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
|
|
2468
|
-
/* @__PURE__ */ t("div", { style: { width: 8, height: 8, borderRadius: "50%", background:
|
|
2469
|
+
/* @__PURE__ */ t("div", { style: { width: 8, height: 8, borderRadius: "50%", background: O ? "#ef4444" : "var(--text-3)" } }),
|
|
2469
2470
|
/* @__PURE__ */ t("span", { style: { fontSize: 12, fontWeight: 600, color: "var(--text-1)" }, children: "Watermark" })
|
|
2470
2471
|
] }),
|
|
2471
2472
|
/* @__PURE__ */ t(
|
|
2472
2473
|
Le,
|
|
2473
2474
|
{
|
|
2474
|
-
value:
|
|
2475
|
-
onChange: (L) =>
|
|
2475
|
+
value: O,
|
|
2476
|
+
onChange: (L) => m(L ? { enabled: !0, text: x.text || "DRAFT" } : { enabled: !1 })
|
|
2476
2477
|
}
|
|
2477
2478
|
)
|
|
2478
2479
|
] }),
|
|
2479
|
-
/* @__PURE__ */ t(qe, { open:
|
|
2480
|
+
/* @__PURE__ */ t(qe, { open: O, children: /* @__PURE__ */ v("div", { style: { padding: "0 12px 10px", display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
2480
2481
|
/* @__PURE__ */ v("div", { children: [
|
|
2481
2482
|
/* @__PURE__ */ t(se, { children: "Text" }),
|
|
2482
2483
|
/* @__PURE__ */ t(
|
|
2483
2484
|
"input",
|
|
2484
2485
|
{
|
|
2485
|
-
value:
|
|
2486
|
-
onChange: (L) =>
|
|
2486
|
+
value: x.text ?? "DRAFT",
|
|
2487
|
+
onChange: (L) => m({ text: L.target.value }),
|
|
2487
2488
|
placeholder: "DRAFT",
|
|
2488
2489
|
style: {
|
|
2489
2490
|
width: "100%",
|
|
@@ -2504,48 +2505,48 @@ function Aa() {
|
|
|
2504
2505
|
] }),
|
|
2505
2506
|
/* @__PURE__ */ v("div", { children: [
|
|
2506
2507
|
/* @__PURE__ */ t(se, { children: "Font" }),
|
|
2507
|
-
/* @__PURE__ */ t(st, { value:
|
|
2508
|
+
/* @__PURE__ */ t(st, { value: x.fontFamily ?? "Helvetica", onChange: (L) => m({ fontFamily: L }), options: ka })
|
|
2508
2509
|
] }),
|
|
2509
2510
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: 8, alignItems: "flex-end" }, children: [
|
|
2510
2511
|
/* @__PURE__ */ v("div", { children: [
|
|
2511
2512
|
/* @__PURE__ */ t(se, { children: "Style" }),
|
|
2512
2513
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: 6 }, children: [
|
|
2513
|
-
/* @__PURE__ */ t(Qr, { label: "B", active: !!
|
|
2514
|
-
/* @__PURE__ */ t(Qr, { label: "I", active: !!
|
|
2514
|
+
/* @__PURE__ */ t(Qr, { label: "B", active: !!x.bold, bold: !0, onClick: () => m({ bold: !x.bold }) }),
|
|
2515
|
+
/* @__PURE__ */ t(Qr, { label: "I", active: !!x.italic, italic: !0, onClick: () => m({ italic: !x.italic }) })
|
|
2515
2516
|
] })
|
|
2516
2517
|
] }),
|
|
2517
2518
|
/* @__PURE__ */ v("div", { style: { flex: 1 }, children: [
|
|
2518
2519
|
/* @__PURE__ */ t(se, { children: "Letter spacing" }),
|
|
2519
|
-
/* @__PURE__ */ t(Te, { value:
|
|
2520
|
+
/* @__PURE__ */ t(Te, { value: x.letterSpacing ?? 0, onChange: (L) => m({ letterSpacing: L }), min: -5, max: 40, suffix: "px" })
|
|
2520
2521
|
] })
|
|
2521
2522
|
] }),
|
|
2522
2523
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2523
2524
|
/* @__PURE__ */ v("div", { style: { flex: 1 }, children: [
|
|
2524
2525
|
/* @__PURE__ */ t(se, { children: "Size" }),
|
|
2525
|
-
/* @__PURE__ */ t(Te, { value:
|
|
2526
|
+
/* @__PURE__ */ t(Te, { value: x.fontSize ?? 72, onChange: (L) => m({ fontSize: L }), min: 8, max: 300, suffix: "px" })
|
|
2526
2527
|
] }),
|
|
2527
2528
|
/* @__PURE__ */ v("div", { style: { flex: 1 }, children: [
|
|
2528
2529
|
/* @__PURE__ */ t(se, { children: "Angle" }),
|
|
2529
|
-
/* @__PURE__ */ t(Te, { value:
|
|
2530
|
+
/* @__PURE__ */ t(Te, { value: x.rotation ?? -45, onChange: (L) => m({ rotation: L }), min: -90, max: 90, suffix: "°" })
|
|
2530
2531
|
] })
|
|
2531
2532
|
] }),
|
|
2532
2533
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: 8 }, children: [
|
|
2533
2534
|
/* @__PURE__ */ v("div", { style: { flex: 1 }, children: [
|
|
2534
2535
|
/* @__PURE__ */ t(se, { children: "Opacity" }),
|
|
2535
|
-
/* @__PURE__ */ t(Te, { value: Math.round((
|
|
2536
|
+
/* @__PURE__ */ t(Te, { value: Math.round((x.opacity ?? 0.12) * 100), onChange: (L) => m({ opacity: L / 100 }), min: 1, max: 100, suffix: "%" })
|
|
2536
2537
|
] }),
|
|
2537
2538
|
/* @__PURE__ */ v("div", { style: { flex: 1 }, children: [
|
|
2538
2539
|
/* @__PURE__ */ t(se, { children: "Color" }),
|
|
2539
|
-
/* @__PURE__ */ t(Oa, { value:
|
|
2540
|
+
/* @__PURE__ */ t(Oa, { value: x.color ?? "#1e293b", onChange: (L) => m({ color: L }) })
|
|
2540
2541
|
] })
|
|
2541
2542
|
] }),
|
|
2542
2543
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", paddingTop: 2 }, children: [
|
|
2543
2544
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: "var(--text-2)" }, children: "Repeat across page" }),
|
|
2544
|
-
/* @__PURE__ */ t(Le, { value: !!
|
|
2545
|
+
/* @__PURE__ */ t(Le, { value: !!x.tile, onChange: (L) => m({ tile: L }) })
|
|
2545
2546
|
] }),
|
|
2546
2547
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
2547
2548
|
/* @__PURE__ */ t("span", { style: { fontSize: 11, color: "var(--text-2)" }, children: "Show on canvas" }),
|
|
2548
|
-
/* @__PURE__ */ t(Le, { value: !!
|
|
2549
|
+
/* @__PURE__ */ t(Le, { value: !!x.showOnCanvas, onChange: (L) => m({ showOnCanvas: L }) })
|
|
2549
2550
|
] })
|
|
2550
2551
|
] }) })
|
|
2551
2552
|
] }) }),
|
|
@@ -3157,15 +3158,15 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3157
3158
|
getTemplate: y,
|
|
3158
3159
|
showPreview: w,
|
|
3159
3160
|
togglePreview: b,
|
|
3160
|
-
theme:
|
|
3161
|
-
toggleTheme:
|
|
3162
|
-
} = X(), [
|
|
3161
|
+
theme: x,
|
|
3162
|
+
toggleTheme: O
|
|
3163
|
+
} = X(), [m, E] = U(!1), S = e ?? {}, M = (_) => S[_] !== !1, z = S.actions ?? [], C = M("duplicate") || M("delete"), A = () => {
|
|
3163
3164
|
if (S.onSave) {
|
|
3164
3165
|
S.onSave(y());
|
|
3165
3166
|
return;
|
|
3166
3167
|
}
|
|
3167
|
-
const _ = JSON.stringify(y(), null, 2),
|
|
3168
|
-
Object.assign(document.createElement("a"), { href:
|
|
3168
|
+
const _ = JSON.stringify(y(), null, 2), T = URL.createObjectURL(new Blob([_], { type: "application/json" }));
|
|
3169
|
+
Object.assign(document.createElement("a"), { href: T, download: `${y().name}.json` }).click(), URL.revokeObjectURL(T);
|
|
3169
3170
|
}, R = () => {
|
|
3170
3171
|
if (S.onLoad) {
|
|
3171
3172
|
S.onLoad();
|
|
@@ -3174,10 +3175,10 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3174
3175
|
const _ = Object.assign(document.createElement("input"), { type: "file", accept: ".json" });
|
|
3175
3176
|
_.onchange = async () => {
|
|
3176
3177
|
var D;
|
|
3177
|
-
const
|
|
3178
|
-
if (
|
|
3178
|
+
const T = (D = _.files) == null ? void 0 : D[0];
|
|
3179
|
+
if (T)
|
|
3179
3180
|
try {
|
|
3180
|
-
g(JSON.parse(await
|
|
3181
|
+
g(JSON.parse(await T.text()));
|
|
3181
3182
|
} catch {
|
|
3182
3183
|
alert("Invalid template JSON");
|
|
3183
3184
|
}
|
|
@@ -3190,7 +3191,7 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3190
3191
|
style: { height: 46, padding: "0 12px", background: "var(--panel)", borderBottom: "1px solid var(--border)", gap: 0 },
|
|
3191
3192
|
children: [
|
|
3192
3193
|
(() => {
|
|
3193
|
-
const _ = o != null && o.hidden ? tr.filter((F) => F.id !== "components") : tr,
|
|
3194
|
+
const _ = o != null && o.hidden ? tr.filter((F) => F.id !== "components") : tr, T = _.find((F) => F.id === d) ? d : _[0].id, D = _.findIndex((F) => F.id === T);
|
|
3194
3195
|
return /* @__PURE__ */ v("div", { style: { display: "flex", padding: 3, borderRadius: 9, background: "var(--card)", border: "1px solid var(--border)", position: "relative", gap: 0, width: 333, flexShrink: 0 }, children: [
|
|
3195
3196
|
/* @__PURE__ */ t("div", { "aria-hidden": !0, style: {
|
|
3196
3197
|
position: "absolute",
|
|
@@ -3221,18 +3222,18 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3221
3222
|
border: "none",
|
|
3222
3223
|
cursor: "pointer",
|
|
3223
3224
|
fontSize: 10,
|
|
3224
|
-
fontWeight:
|
|
3225
|
+
fontWeight: T === F.id ? 600 : 500,
|
|
3225
3226
|
fontFamily: "inherit",
|
|
3226
3227
|
whiteSpace: "nowrap",
|
|
3227
3228
|
background: "transparent",
|
|
3228
|
-
color:
|
|
3229
|
+
color: T === F.id ? "#fff" : "var(--text-3)",
|
|
3229
3230
|
transition: "color 0.18s"
|
|
3230
3231
|
},
|
|
3231
3232
|
onMouseEnter: (B) => {
|
|
3232
|
-
|
|
3233
|
+
T !== F.id && (B.currentTarget.style.color = "var(--text-1)");
|
|
3233
3234
|
},
|
|
3234
3235
|
onMouseLeave: (B) => {
|
|
3235
|
-
|
|
3236
|
+
T !== F.id && (B.currentTarget.style.color = "var(--text-3)");
|
|
3236
3237
|
},
|
|
3237
3238
|
children: [
|
|
3238
3239
|
F.icon,
|
|
@@ -3259,7 +3260,7 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3259
3260
|
M("duplicate") && /* @__PURE__ */ t(pe, { onClick: r, title: "Duplicate (Ctrl+D)", children: /* @__PURE__ */ t(Ei, { size: 13 }) }),
|
|
3260
3261
|
M("delete") && /* @__PURE__ */ t(pe, { onClick: u, title: "Delete (Del)", danger: !0, children: /* @__PURE__ */ t(Fr, { size: 13 }) }),
|
|
3261
3262
|
M("sections") && (() => {
|
|
3262
|
-
const _ = ["header", "body", "footer"],
|
|
3263
|
+
const _ = ["header", "body", "footer"], T = _.indexOf(n);
|
|
3263
3264
|
return /* @__PURE__ */ v("div", { style: { display: "flex", padding: 3, borderRadius: 9, background: "var(--card)", border: "1px solid var(--border)", position: "relative", gap: 0, marginLeft: 6 }, children: [
|
|
3264
3265
|
/* @__PURE__ */ t("div", { "aria-hidden": !0, style: {
|
|
3265
3266
|
position: "absolute",
|
|
@@ -3270,7 +3271,7 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3270
3271
|
borderRadius: 6,
|
|
3271
3272
|
background: "var(--accent)",
|
|
3272
3273
|
pointerEvents: "none",
|
|
3273
|
-
transform: `translateX(calc(${
|
|
3274
|
+
transform: `translateX(calc(${T} * 100%))`,
|
|
3274
3275
|
transition: "transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1)"
|
|
3275
3276
|
} }),
|
|
3276
3277
|
_.map((D) => /* @__PURE__ */ t(
|
|
@@ -3343,7 +3344,7 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3343
3344
|
}
|
|
3344
3345
|
),
|
|
3345
3346
|
/* @__PURE__ */ t("div", { style: { width: 8, flexShrink: 0 } }),
|
|
3346
|
-
M("theme") && /* @__PURE__ */ t(pe, { onClick:
|
|
3347
|
+
M("theme") && /* @__PURE__ */ t(pe, { onClick: O, title: x === "dark" ? "Switch to Light mode" : "Switch to Dark mode", children: x === "dark" ? /* @__PURE__ */ t(Si, { size: 13 }) : /* @__PURE__ */ t(_i, { size: 13 }) }),
|
|
3347
3348
|
M("zoom") && /* @__PURE__ */ t(fr, {}),
|
|
3348
3349
|
M("zoom") && /* @__PURE__ */ v("div", { className: "flex items-center gap-0.5", children: [
|
|
3349
3350
|
/* @__PURE__ */ t(pe, { onClick: () => h(Math.max(0.25, f - 0.1)), title: "Zoom out", children: /* @__PURE__ */ t(Yi, { size: 13 }) }),
|
|
@@ -3353,7 +3354,7 @@ function Ba({ config: e, elements: o } = {}) {
|
|
|
3353
3354
|
] }),
|
|
3354
3355
|
/* @__PURE__ */ t(pe, { onClick: () => h(Math.min(3, f + 0.1)), title: "Zoom in", children: /* @__PURE__ */ t(Ui, { size: 13 }) })
|
|
3355
3356
|
] }),
|
|
3356
|
-
|
|
3357
|
+
m && /* @__PURE__ */ t(La, { onClose: () => E(!1) })
|
|
3357
3358
|
]
|
|
3358
3359
|
}
|
|
3359
3360
|
);
|
|
@@ -3392,7 +3393,7 @@ function ke({ onPick: e, filterType: o = "all", paths: i, wrapInExpr: a = !0 })
|
|
|
3392
3393
|
if (!i)
|
|
3393
3394
|
try {
|
|
3394
3395
|
const g = JSON.parse(u || "{}");
|
|
3395
|
-
d = $r(g), o === "image" ? d = d.filter((y) => r[y] === "image") : o === "string" && (d = d.filter((y) => typeof y.split(".").reduce((b,
|
|
3396
|
+
d = $r(g), o === "image" ? d = d.filter((y) => r[y] === "image") : o === "string" && (d = d.filter((y) => typeof y.split(".").reduce((b, x) => b == null ? void 0 : b[x], g) == "string"));
|
|
3396
3397
|
} catch {
|
|
3397
3398
|
}
|
|
3398
3399
|
const p = /* @__PURE__ */ t(
|
|
@@ -3706,18 +3707,18 @@ const Wa = {
|
|
|
3706
3707
|
Legal: [816, 1344]
|
|
3707
3708
|
};
|
|
3708
3709
|
function Ha({ el: e }) {
|
|
3709
|
-
var z, C, A, R, _,
|
|
3710
|
-
const { updateElement: o, template: i } = X(), a = i.page ?? {}, l = a.orientation === "landscape", [s, f] = Wa[a.size ?? "A4"] ?? [794, 1123], h = l ? f : s, u = a.customHeight ?? (l ? s : f), r = a.margin ?? { top: 0, right: 0, bottom: 0, left: 0 }, n = r.left ?? 0, c = r.right ?? 0, d = r.top ?? 0, p = r.bottom ?? 0, g = Math.max(100, h - n - c), y = Math.max(200, u - d - p), w = ((z = i.header) == null ? void 0 : z.enabled) !== !1 ? ((C = i.header) == null ? void 0 : C.height) ?? 60 : 0, b = ((A = i.footer) == null ? void 0 : A.enabled) !== !1 ? ((R = i.footer) == null ? void 0 : R.height) ?? 40 : 0,
|
|
3710
|
+
var z, C, A, R, _, T, D, F;
|
|
3711
|
+
const { updateElement: o, template: i } = X(), a = i.page ?? {}, l = a.orientation === "landscape", [s, f] = Wa[a.size ?? "A4"] ?? [794, 1123], h = l ? f : s, u = a.customHeight ?? (l ? s : f), r = a.margin ?? { top: 0, right: 0, bottom: 0, left: 0 }, n = r.left ?? 0, c = r.right ?? 0, d = r.top ?? 0, p = r.bottom ?? 0, g = Math.max(100, h - n - c), y = Math.max(200, u - d - p), w = ((z = i.header) == null ? void 0 : z.enabled) !== !1 ? ((C = i.header) == null ? void 0 : C.height) ?? 60 : 0, b = ((A = i.footer) == null ? void 0 : A.enabled) !== !1 ? ((R = i.footer) == null ? void 0 : R.height) ?? 40 : 0, x = ((T = (_ = i.header) == null ? void 0 : _.elements) == null ? void 0 : T.some((B) => B.id === e.id)) ?? !1, O = ((F = (D = i.footer) == null ? void 0 : D.elements) == null ? void 0 : F.some((B) => B.id === e.id)) ?? !1, m = g, E = x ? w : O ? b : Math.max(100, y - w - b), S = (B, V) => {
|
|
3711
3712
|
const L = Math.round(Number(V));
|
|
3712
3713
|
let Y = L;
|
|
3713
|
-
B === "x" && (Y = Math.max(0, Math.min(L,
|
|
3714
|
+
B === "x" && (Y = Math.max(0, Math.min(L, m - 10))), B === "y" && (Y = Math.max(0, Math.min(L, E - 5))), B === "width" && (Y = Math.max(10, Math.min(L, m - e.x))), B === "height" && (Y = Math.max(5, Math.min(L, E - e.y))), o(e.id, { [B]: Y });
|
|
3714
3715
|
}, M = e.type === "table";
|
|
3715
3716
|
return /* @__PURE__ */ v(Q, { children: [
|
|
3716
3717
|
/* @__PURE__ */ t(ye, { children: "Position & Size" }),
|
|
3717
3718
|
/* @__PURE__ */ t("div", { style: { padding: "0 14px" }, children: /* @__PURE__ */ v(He, { children: [
|
|
3718
3719
|
/* @__PURE__ */ t($, { label: "X", children: /* @__PURE__ */ t(G, { type: "number", value: e.x, onChange: (B) => S("x", B) }) }),
|
|
3719
3720
|
/* @__PURE__ */ t($, { label: "Y", children: /* @__PURE__ */ t(G, { type: "number", value: e.y, onChange: (B) => S("y", B) }) }),
|
|
3720
|
-
/* @__PURE__ */ t($, { label: `Width (max ${
|
|
3721
|
+
/* @__PURE__ */ t($, { label: `Width (max ${m - e.x})`, children: /* @__PURE__ */ t(G, { type: "number", value: e.width, onChange: (B) => S("width", B) }) }),
|
|
3721
3722
|
!M && /* @__PURE__ */ t($, { label: `Height (max ${E - e.y})`, children: /* @__PURE__ */ t(G, { type: "number", value: e.height, onChange: (B) => S("height", B) }) }),
|
|
3722
3723
|
M && /* @__PURE__ */ t($, { label: "Height", children: /* @__PURE__ */ v("div", { style: {
|
|
3723
3724
|
padding: "5px 9px",
|
|
@@ -3810,19 +3811,19 @@ function ja({ title: e, open: o, onToggle: i, children: a }) {
|
|
|
3810
3811
|
function Ua({ el: e }) {
|
|
3811
3812
|
const { updateElement: o, previewData: i } = X(), [a, l] = U(null), [s, f] = U(/* @__PURE__ */ new Set()), [h, u] = U(!1);
|
|
3812
3813
|
if (e.type !== "table") return null;
|
|
3813
|
-
const r = e.style ?? {}, n = e.altRowStyle ?? {}, c = e.headerStyle ?? {}, d = () => o(e.id, { columns: [...e.columns, { key: "", label: "Column", width: 100 }] }), p = (
|
|
3814
|
-
e.columns.length <= 1 || o(e.id, { columns: e.columns.filter((E, S) => S !==
|
|
3815
|
-
}, g = (
|
|
3816
|
-
if (
|
|
3817
|
-
const S = [...e.columns], [M] = S.splice(
|
|
3814
|
+
const r = e.style ?? {}, n = e.altRowStyle ?? {}, c = e.headerStyle ?? {}, d = () => o(e.id, { columns: [...e.columns, { key: "", label: "Column", width: 100 }] }), p = (m) => {
|
|
3815
|
+
e.columns.length <= 1 || o(e.id, { columns: e.columns.filter((E, S) => S !== m) });
|
|
3816
|
+
}, g = (m, E) => {
|
|
3817
|
+
if (m === E) return;
|
|
3818
|
+
const S = [...e.columns], [M] = S.splice(m, 1);
|
|
3818
3819
|
S.splice(E, 0, M), o(e.id, { columns: S });
|
|
3819
|
-
}, y = (
|
|
3820
|
+
}, y = (m) => f((E) => {
|
|
3820
3821
|
const S = new Set(E);
|
|
3821
|
-
return S.has(
|
|
3822
|
-
}), w = (
|
|
3823
|
-
let
|
|
3822
|
+
return S.has(m) ? S.delete(m) : S.add(m), S;
|
|
3823
|
+
}), w = (m, E) => o(e.id, { style: { ...r, [m]: E } }), b = (m, E) => o(e.id, { altRowStyle: { ...n, [m]: E } });
|
|
3824
|
+
let x = [], O = [];
|
|
3824
3825
|
try {
|
|
3825
|
-
const
|
|
3826
|
+
const m = JSON.parse(i || "{}"), E = (S, M = "") => {
|
|
3826
3827
|
const z = [];
|
|
3827
3828
|
if (typeof S == "object" && S !== null && !Array.isArray(S))
|
|
3828
3829
|
for (const [C, A] of Object.entries(S)) {
|
|
@@ -3831,12 +3832,12 @@ function Ua({ el: e }) {
|
|
|
3831
3832
|
}
|
|
3832
3833
|
return z;
|
|
3833
3834
|
};
|
|
3834
|
-
if (
|
|
3835
|
+
if (x = E(m), e.dataSource) {
|
|
3835
3836
|
const S = e.dataSource.split(".").reduce(
|
|
3836
3837
|
(M, z) => M == null ? void 0 : M[z],
|
|
3837
|
-
|
|
3838
|
+
m
|
|
3838
3839
|
);
|
|
3839
|
-
Array.isArray(S) && S.length > 0 && typeof S[0] == "object" && S[0] !== null && (
|
|
3840
|
+
Array.isArray(S) && S.length > 0 && typeof S[0] == "object" && S[0] !== null && (O = Object.keys(S[0]));
|
|
3840
3841
|
}
|
|
3841
3842
|
} catch {
|
|
3842
3843
|
}
|
|
@@ -3844,8 +3845,8 @@ function Ua({ el: e }) {
|
|
|
3844
3845
|
/* @__PURE__ */ t(ye, { children: "Table" }),
|
|
3845
3846
|
/* @__PURE__ */ v("div", { style: { padding: "0 14px", display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
3846
3847
|
/* @__PURE__ */ t($, { label: "Data Source", children: /* @__PURE__ */ v("div", { style: { display: "flex", gap: 6 }, children: [
|
|
3847
|
-
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(G, { value: e.dataSource, onChange: (
|
|
3848
|
-
/* @__PURE__ */ t(ke, { paths:
|
|
3848
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(G, { value: e.dataSource, onChange: (m) => o(e.id, { dataSource: m }), placeholder: "items" }) }),
|
|
3849
|
+
/* @__PURE__ */ t(ke, { paths: x, wrapInExpr: !1, onPick: (m) => o(e.id, { dataSource: m }) })
|
|
3849
3850
|
] }) }),
|
|
3850
3851
|
/* @__PURE__ */ v("div", { children: [
|
|
3851
3852
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", marginBottom: 6 }, children: [
|
|
@@ -3871,8 +3872,8 @@ function Ua({ el: e }) {
|
|
|
3871
3872
|
" Add"
|
|
3872
3873
|
] })
|
|
3873
3874
|
] }),
|
|
3874
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: e.columns.map((
|
|
3875
|
-
var M, z, C, A, R, _,
|
|
3875
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: e.columns.map((m, E) => {
|
|
3876
|
+
var M, z, C, A, R, _, T, D, F, B, V, L, Y, q, N, K;
|
|
3876
3877
|
const S = s.has(E);
|
|
3877
3878
|
return /* @__PURE__ */ v("div", { style: {
|
|
3878
3879
|
borderRadius: 8,
|
|
@@ -3903,21 +3904,21 @@ function Ua({ el: e }) {
|
|
|
3903
3904
|
},
|
|
3904
3905
|
children: [
|
|
3905
3906
|
/* @__PURE__ */ t("span", { style: { color: "var(--text-3)", flexShrink: 0, display: "flex", cursor: "grab" }, onClick: (P) => P.stopPropagation(), children: /* @__PURE__ */ t($i, { size: 13, strokeWidth: 1.8 }) }),
|
|
3906
|
-
/* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 12, fontWeight: 500, color: "var(--text-1)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0 }, children:
|
|
3907
|
-
|
|
3907
|
+
/* @__PURE__ */ t("span", { style: { flex: 1, fontSize: 12, fontWeight: 500, color: "var(--text-1)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", minWidth: 0 }, children: m.label || /* @__PURE__ */ t("span", { style: { color: "var(--text-3)", fontStyle: "italic", fontWeight: 400 }, children: "Untitled" }) }),
|
|
3908
|
+
m.key && /* @__PURE__ */ t("span", { style: {
|
|
3908
3909
|
fontSize: 9,
|
|
3909
3910
|
fontFamily: "monospace",
|
|
3910
3911
|
flexShrink: 0,
|
|
3911
|
-
color:
|
|
3912
|
-
background:
|
|
3912
|
+
color: m.key.includes("{{") ? "var(--accent)" : "var(--text-3)",
|
|
3913
|
+
background: m.key.includes("{{") ? "var(--accent-ring)" : "var(--hover)",
|
|
3913
3914
|
padding: "1px 5px",
|
|
3914
3915
|
borderRadius: 4,
|
|
3915
3916
|
maxWidth: 80,
|
|
3916
3917
|
overflow: "hidden",
|
|
3917
3918
|
textOverflow: "ellipsis",
|
|
3918
3919
|
whiteSpace: "nowrap"
|
|
3919
|
-
}, children:
|
|
3920
|
-
/* @__PURE__ */ t("span", { style: { color: "var(--text-3)", flexShrink: 0, display: "flex" }, children:
|
|
3920
|
+
}, children: m.key }),
|
|
3921
|
+
/* @__PURE__ */ t("span", { style: { color: "var(--text-3)", flexShrink: 0, display: "flex" }, children: m.align === "center" ? /* @__PURE__ */ t(Ze, { size: 11 }) : m.align === "right" ? /* @__PURE__ */ t(et, { size: 11 }) : /* @__PURE__ */ t(Ie, { size: 11 }) }),
|
|
3921
3922
|
/* @__PURE__ */ t("span", { style: { color: S ? "var(--accent)" : "var(--text-3)", flexShrink: 0, display: "flex", transform: S ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 0.18s ease" }, children: /* @__PURE__ */ t(nr, { size: 12, strokeWidth: 2.5 }) }),
|
|
3922
3923
|
/* @__PURE__ */ t(
|
|
3923
3924
|
"button",
|
|
@@ -3950,7 +3951,7 @@ function Ua({ el: e }) {
|
|
|
3950
3951
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
3951
3952
|
G,
|
|
3952
3953
|
{
|
|
3953
|
-
value:
|
|
3954
|
+
value: m.key,
|
|
3954
3955
|
placeholder: "{{field}} or literal text",
|
|
3955
3956
|
onChange: (P) => {
|
|
3956
3957
|
const k = [...e.columns];
|
|
@@ -3958,7 +3959,7 @@ function Ua({ el: e }) {
|
|
|
3958
3959
|
}
|
|
3959
3960
|
}
|
|
3960
3961
|
) }),
|
|
3961
|
-
/* @__PURE__ */ t(ke, { paths:
|
|
3962
|
+
/* @__PURE__ */ t(ke, { paths: O, wrapInExpr: !0, onPick: (P) => {
|
|
3962
3963
|
const k = [...e.columns];
|
|
3963
3964
|
k[E] = { ...k[E], key: P }, o(e.id, { columns: k });
|
|
3964
3965
|
} })
|
|
@@ -3966,7 +3967,7 @@ function Ua({ el: e }) {
|
|
|
3966
3967
|
/* @__PURE__ */ t($, { label: "Header Label", children: /* @__PURE__ */ t(
|
|
3967
3968
|
G,
|
|
3968
3969
|
{
|
|
3969
|
-
value:
|
|
3970
|
+
value: m.label,
|
|
3970
3971
|
placeholder: "Column header text",
|
|
3971
3972
|
onChange: (P) => {
|
|
3972
3973
|
const k = [...e.columns];
|
|
@@ -3975,14 +3976,14 @@ function Ua({ el: e }) {
|
|
|
3975
3976
|
}
|
|
3976
3977
|
) }),
|
|
3977
3978
|
/* @__PURE__ */ v(He, { children: [
|
|
3978
|
-
/* @__PURE__ */ t($, { label: "Width", children: /* @__PURE__ */ t(G, { type: "number", value:
|
|
3979
|
+
/* @__PURE__ */ t($, { label: "Width", children: /* @__PURE__ */ t(G, { type: "number", value: m.width, suffix: "px", onChange: (P) => {
|
|
3979
3980
|
const k = [...e.columns];
|
|
3980
3981
|
k[E] = { ...k[E], width: Math.max(20, Number(P)) }, o(e.id, { columns: k });
|
|
3981
3982
|
} }) }),
|
|
3982
3983
|
/* @__PURE__ */ t($, { label: "Alignment", children: /* @__PURE__ */ t(
|
|
3983
3984
|
rt,
|
|
3984
3985
|
{
|
|
3985
|
-
value:
|
|
3986
|
+
value: m.align ?? "left",
|
|
3986
3987
|
onChange: (P) => {
|
|
3987
3988
|
const k = [...e.columns];
|
|
3988
3989
|
k[E] = { ...k[E], align: P }, o(e.id, { columns: k });
|
|
@@ -3998,23 +3999,23 @@ function Ua({ el: e }) {
|
|
|
3998
3999
|
/* @__PURE__ */ v("div", { style: { paddingTop: 8, borderTop: "1px dashed var(--border)" }, children: [
|
|
3999
4000
|
/* @__PURE__ */ t("span", { style: { fontSize: 9, fontWeight: 700, color: "var(--text-3)", letterSpacing: "0.07em", textTransform: "uppercase", display: "block", marginBottom: 6 }, children: "Header Cell Style" }),
|
|
4000
4001
|
/* @__PURE__ */ v(He, { children: [
|
|
4001
|
-
/* @__PURE__ */ t($, { label: "Background", children: /* @__PURE__ */ t(ue, { value: ((M =
|
|
4002
|
+
/* @__PURE__ */ t($, { label: "Background", children: /* @__PURE__ */ t(ue, { value: ((M = m.headerStyle) == null ? void 0 : M.backgroundColor) ?? c.backgroundColor ?? "", onChange: (P) => {
|
|
4002
4003
|
const k = [...e.columns];
|
|
4003
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4004
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, backgroundColor: P } }, o(e.id, { columns: k });
|
|
4004
4005
|
} }) }),
|
|
4005
|
-
/* @__PURE__ */ t($, { label: "Text Color", children: /* @__PURE__ */ t(ue, { value: ((z =
|
|
4006
|
+
/* @__PURE__ */ t($, { label: "Text Color", children: /* @__PURE__ */ t(ue, { value: ((z = m.headerStyle) == null ? void 0 : z.color) ?? c.color ?? "", onChange: (P) => {
|
|
4006
4007
|
const k = [...e.columns];
|
|
4007
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4008
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, color: P } }, o(e.id, { columns: k });
|
|
4008
4009
|
} }) }),
|
|
4009
4010
|
/* @__PURE__ */ t($, { label: "Font Size", children: /* @__PURE__ */ t(
|
|
4010
4011
|
G,
|
|
4011
4012
|
{
|
|
4012
4013
|
type: "number",
|
|
4013
4014
|
suffix: "px",
|
|
4014
|
-
value: ((C =
|
|
4015
|
+
value: ((C = m.headerStyle) == null ? void 0 : C.fontSize) ?? c.fontSize ?? r.fontSize ?? 10,
|
|
4015
4016
|
onChange: (P) => {
|
|
4016
4017
|
const k = [...e.columns];
|
|
4017
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4018
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, fontSize: Number(P) } }, o(e.id, { columns: k });
|
|
4018
4019
|
}
|
|
4019
4020
|
}
|
|
4020
4021
|
) }),
|
|
@@ -4023,10 +4024,10 @@ function Ua({ el: e }) {
|
|
|
4023
4024
|
{
|
|
4024
4025
|
type: "number",
|
|
4025
4026
|
suffix: "px",
|
|
4026
|
-
value: ((A =
|
|
4027
|
+
value: ((A = m.headerStyle) == null ? void 0 : A.padding) ?? c.padding ?? r.padding ?? 4,
|
|
4027
4028
|
onChange: (P) => {
|
|
4028
4029
|
const k = [...e.columns];
|
|
4029
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4030
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, padding: Number(P) } }, o(e.id, { columns: k });
|
|
4030
4031
|
}
|
|
4031
4032
|
}
|
|
4032
4033
|
) }),
|
|
@@ -4035,10 +4036,10 @@ function Ua({ el: e }) {
|
|
|
4035
4036
|
{
|
|
4036
4037
|
type: "number",
|
|
4037
4038
|
suffix: "px",
|
|
4038
|
-
value: ((R =
|
|
4039
|
+
value: ((R = m.headerStyle) == null ? void 0 : R.letterSpacing) ?? c.letterSpacing ?? r.letterSpacing ?? 0,
|
|
4039
4040
|
onChange: (P) => {
|
|
4040
4041
|
const k = [...e.columns];
|
|
4041
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4042
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, letterSpacing: Number(P) } }, o(e.id, { columns: k });
|
|
4042
4043
|
}
|
|
4043
4044
|
}
|
|
4044
4045
|
) })
|
|
@@ -4049,12 +4050,12 @@ function Ua({ el: e }) {
|
|
|
4049
4050
|
/* @__PURE__ */ t(
|
|
4050
4051
|
Re,
|
|
4051
4052
|
{
|
|
4052
|
-
active: (((_ =
|
|
4053
|
+
active: (((_ = m.headerStyle) == null ? void 0 : _.fontWeight) ?? c.fontWeight) === "bold",
|
|
4053
4054
|
title: "Bold",
|
|
4054
4055
|
onClick: () => {
|
|
4055
4056
|
var W;
|
|
4056
|
-
const P = (((W =
|
|
4057
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4057
|
+
const P = (((W = m.headerStyle) == null ? void 0 : W.fontWeight) ?? c.fontWeight) === "bold" ? "normal" : "bold", k = [...e.columns];
|
|
4058
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, fontWeight: P } }, o(e.id, { columns: k });
|
|
4058
4059
|
},
|
|
4059
4060
|
children: /* @__PURE__ */ t(Xt, { size: 12, strokeWidth: 2.5 })
|
|
4060
4061
|
}
|
|
@@ -4062,12 +4063,12 @@ function Ua({ el: e }) {
|
|
|
4062
4063
|
/* @__PURE__ */ t(
|
|
4063
4064
|
Re,
|
|
4064
4065
|
{
|
|
4065
|
-
active: (((
|
|
4066
|
+
active: (((T = m.headerStyle) == null ? void 0 : T.fontStyle) ?? c.fontStyle) === "italic",
|
|
4066
4067
|
title: "Italic",
|
|
4067
4068
|
onClick: () => {
|
|
4068
4069
|
var W;
|
|
4069
|
-
const P = (((W =
|
|
4070
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4070
|
+
const P = (((W = m.headerStyle) == null ? void 0 : W.fontStyle) ?? c.fontStyle) === "italic" ? "normal" : "italic", k = [...e.columns];
|
|
4071
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, fontStyle: P } }, o(e.id, { columns: k });
|
|
4071
4072
|
},
|
|
4072
4073
|
children: /* @__PURE__ */ t(Kt, { size: 12, strokeWidth: 2.5 })
|
|
4073
4074
|
}
|
|
@@ -4079,10 +4080,10 @@ function Ua({ el: e }) {
|
|
|
4079
4080
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
4080
4081
|
rt,
|
|
4081
4082
|
{
|
|
4082
|
-
value: ((D =
|
|
4083
|
+
value: ((D = m.headerStyle) == null ? void 0 : D.textAlign) ?? c.textAlign ?? "left",
|
|
4083
4084
|
onChange: (P) => {
|
|
4084
4085
|
const k = [...e.columns];
|
|
4085
|
-
k[E] = { ...k[E], headerStyle: { ...
|
|
4086
|
+
k[E] = { ...k[E], headerStyle: { ...m.headerStyle, textAlign: P } }, o(e.id, { columns: k });
|
|
4086
4087
|
},
|
|
4087
4088
|
options: [
|
|
4088
4089
|
{ value: "left", icon: /* @__PURE__ */ t(Ie, { size: 12, strokeWidth: 2 }), title: "Left" },
|
|
@@ -4096,23 +4097,23 @@ function Ua({ el: e }) {
|
|
|
4096
4097
|
/* @__PURE__ */ v("div", { style: { paddingTop: 8, borderTop: "1px dashed var(--border)" }, children: [
|
|
4097
4098
|
/* @__PURE__ */ t("span", { style: { fontSize: 9, fontWeight: 700, color: "var(--text-3)", letterSpacing: "0.07em", textTransform: "uppercase", display: "block", marginBottom: 6 }, children: "Data Cell Style" }),
|
|
4098
4099
|
/* @__PURE__ */ v(He, { children: [
|
|
4099
|
-
/* @__PURE__ */ t($, { label: "Text Color", children: /* @__PURE__ */ t(ue, { value: ((F =
|
|
4100
|
+
/* @__PURE__ */ t($, { label: "Text Color", children: /* @__PURE__ */ t(ue, { value: ((F = m.style) == null ? void 0 : F.color) ?? r.color ?? "", onChange: (P) => {
|
|
4100
4101
|
const k = [...e.columns];
|
|
4101
|
-
k[E] = { ...k[E], style: { ...
|
|
4102
|
+
k[E] = { ...k[E], style: { ...m.style, color: P } }, o(e.id, { columns: k });
|
|
4102
4103
|
} }) }),
|
|
4103
|
-
/* @__PURE__ */ t($, { label: "Background", children: /* @__PURE__ */ t(ue, { value: ((B =
|
|
4104
|
+
/* @__PURE__ */ t($, { label: "Background", children: /* @__PURE__ */ t(ue, { value: ((B = m.style) == null ? void 0 : B.backgroundColor) ?? r.backgroundColor ?? "", onChange: (P) => {
|
|
4104
4105
|
const k = [...e.columns];
|
|
4105
|
-
k[E] = { ...k[E], style: { ...
|
|
4106
|
+
k[E] = { ...k[E], style: { ...m.style, backgroundColor: P } }, o(e.id, { columns: k });
|
|
4106
4107
|
} }) }),
|
|
4107
4108
|
/* @__PURE__ */ t($, { label: "Font Size", children: /* @__PURE__ */ t(
|
|
4108
4109
|
G,
|
|
4109
4110
|
{
|
|
4110
4111
|
type: "number",
|
|
4111
4112
|
suffix: "px",
|
|
4112
|
-
value: ((V =
|
|
4113
|
+
value: ((V = m.style) == null ? void 0 : V.fontSize) ?? r.fontSize ?? 10,
|
|
4113
4114
|
onChange: (P) => {
|
|
4114
4115
|
const k = [...e.columns];
|
|
4115
|
-
k[E] = { ...k[E], style: { ...
|
|
4116
|
+
k[E] = { ...k[E], style: { ...m.style, fontSize: Number(P) } }, o(e.id, { columns: k });
|
|
4116
4117
|
}
|
|
4117
4118
|
}
|
|
4118
4119
|
) }),
|
|
@@ -4121,10 +4122,10 @@ function Ua({ el: e }) {
|
|
|
4121
4122
|
{
|
|
4122
4123
|
type: "number",
|
|
4123
4124
|
suffix: "px",
|
|
4124
|
-
value: ((L =
|
|
4125
|
+
value: ((L = m.style) == null ? void 0 : L.padding) ?? r.padding ?? 4,
|
|
4125
4126
|
onChange: (P) => {
|
|
4126
4127
|
const k = [...e.columns];
|
|
4127
|
-
k[E] = { ...k[E], style: { ...
|
|
4128
|
+
k[E] = { ...k[E], style: { ...m.style, padding: Number(P) } }, o(e.id, { columns: k });
|
|
4128
4129
|
}
|
|
4129
4130
|
}
|
|
4130
4131
|
) }),
|
|
@@ -4133,10 +4134,10 @@ function Ua({ el: e }) {
|
|
|
4133
4134
|
{
|
|
4134
4135
|
type: "number",
|
|
4135
4136
|
suffix: "px",
|
|
4136
|
-
value: ((Y =
|
|
4137
|
+
value: ((Y = m.style) == null ? void 0 : Y.letterSpacing) ?? r.letterSpacing ?? 0,
|
|
4137
4138
|
onChange: (P) => {
|
|
4138
4139
|
const k = [...e.columns];
|
|
4139
|
-
k[E] = { ...k[E], style: { ...
|
|
4140
|
+
k[E] = { ...k[E], style: { ...m.style, letterSpacing: Number(P) } }, o(e.id, { columns: k });
|
|
4140
4141
|
}
|
|
4141
4142
|
}
|
|
4142
4143
|
) })
|
|
@@ -4147,12 +4148,12 @@ function Ua({ el: e }) {
|
|
|
4147
4148
|
/* @__PURE__ */ t(
|
|
4148
4149
|
Re,
|
|
4149
4150
|
{
|
|
4150
|
-
active: ((q =
|
|
4151
|
+
active: ((q = m.style) == null ? void 0 : q.fontWeight) === "bold",
|
|
4151
4152
|
title: "Bold",
|
|
4152
4153
|
onClick: () => {
|
|
4153
4154
|
var W;
|
|
4154
|
-
const P = ((W =
|
|
4155
|
-
k[E] = { ...k[E], style: { ...
|
|
4155
|
+
const P = ((W = m.style) == null ? void 0 : W.fontWeight) === "bold" ? "normal" : "bold", k = [...e.columns];
|
|
4156
|
+
k[E] = { ...k[E], style: { ...m.style, fontWeight: P } }, o(e.id, { columns: k });
|
|
4156
4157
|
},
|
|
4157
4158
|
children: /* @__PURE__ */ t(Xt, { size: 12, strokeWidth: 2.5 })
|
|
4158
4159
|
}
|
|
@@ -4160,12 +4161,12 @@ function Ua({ el: e }) {
|
|
|
4160
4161
|
/* @__PURE__ */ t(
|
|
4161
4162
|
Re,
|
|
4162
4163
|
{
|
|
4163
|
-
active: ((N =
|
|
4164
|
+
active: ((N = m.style) == null ? void 0 : N.fontStyle) === "italic",
|
|
4164
4165
|
title: "Italic",
|
|
4165
4166
|
onClick: () => {
|
|
4166
4167
|
var W;
|
|
4167
|
-
const P = ((W =
|
|
4168
|
-
k[E] = { ...k[E], style: { ...
|
|
4168
|
+
const P = ((W = m.style) == null ? void 0 : W.fontStyle) === "italic" ? "normal" : "italic", k = [...e.columns];
|
|
4169
|
+
k[E] = { ...k[E], style: { ...m.style, fontStyle: P } }, o(e.id, { columns: k });
|
|
4169
4170
|
},
|
|
4170
4171
|
children: /* @__PURE__ */ t(Kt, { size: 12, strokeWidth: 2.5 })
|
|
4171
4172
|
}
|
|
@@ -4177,10 +4178,10 @@ function Ua({ el: e }) {
|
|
|
4177
4178
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
4178
4179
|
rt,
|
|
4179
4180
|
{
|
|
4180
|
-
value: ((K =
|
|
4181
|
+
value: ((K = m.style) == null ? void 0 : K.textAlign) ?? m.align ?? "left",
|
|
4181
4182
|
onChange: (P) => {
|
|
4182
4183
|
const k = [...e.columns];
|
|
4183
|
-
k[E] = { ...k[E], style: { ...
|
|
4184
|
+
k[E] = { ...k[E], style: { ...m.style, textAlign: P } }, o(e.id, { columns: k });
|
|
4184
4185
|
},
|
|
4185
4186
|
options: [
|
|
4186
4187
|
{ value: "left", icon: /* @__PURE__ */ t(Ie, { size: 12, strokeWidth: 2 }), title: "Left" },
|
|
@@ -4199,7 +4200,7 @@ function Ua({ el: e }) {
|
|
|
4199
4200
|
{
|
|
4200
4201
|
onClick: () => {
|
|
4201
4202
|
const P = [...e.columns];
|
|
4202
|
-
P[E] = { ...P[E], conditionalStyles: [...
|
|
4203
|
+
P[E] = { ...P[E], conditionalStyles: [...m.conditionalStyles ?? [], { condition: "{{value}} > 0", style: {} }] }, o(e.id, { columns: P });
|
|
4203
4204
|
},
|
|
4204
4205
|
style: {
|
|
4205
4206
|
display: "flex",
|
|
@@ -4221,12 +4222,12 @@ function Ua({ el: e }) {
|
|
|
4221
4222
|
}
|
|
4222
4223
|
)
|
|
4223
4224
|
] }),
|
|
4224
|
-
(
|
|
4225
|
+
(m.conditionalStyles ?? []).length === 0 && /* @__PURE__ */ v("p", { style: { fontSize: 10, color: "var(--text-3)", fontStyle: "italic", margin: "0 0 2px" }, children: [
|
|
4225
4226
|
"No rules. Use ",
|
|
4226
4227
|
/* @__PURE__ */ t("code", { style: { fontFamily: "monospace", color: "var(--accent)" }, children: "{{value}}" }),
|
|
4227
4228
|
" for the cell value."
|
|
4228
4229
|
] }),
|
|
4229
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: (
|
|
4230
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: (m.conditionalStyles ?? []).map((P, k) => /* @__PURE__ */ v("div", { style: { borderRadius: 7, border: "1px solid var(--border)", padding: "8px", background: "var(--card)", display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
4230
4231
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
|
|
4231
4232
|
/* @__PURE__ */ t("span", { style: { fontSize: 10, color: "var(--text-3)", fontWeight: 600, flexShrink: 0 }, children: "if" }),
|
|
4232
4233
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: /* @__PURE__ */ t(
|
|
@@ -4235,7 +4236,7 @@ function Ua({ el: e }) {
|
|
|
4235
4236
|
value: P.condition,
|
|
4236
4237
|
placeholder: "{{value}} > 100",
|
|
4237
4238
|
onChange: (W) => {
|
|
4238
|
-
const j = [...e.columns], I = [...
|
|
4239
|
+
const j = [...e.columns], I = [...m.conditionalStyles ?? []];
|
|
4239
4240
|
I[k] = { ...I[k], condition: W }, j[E] = { ...j[E], conditionalStyles: I }, o(e.id, { columns: j });
|
|
4240
4241
|
}
|
|
4241
4242
|
}
|
|
@@ -4245,7 +4246,7 @@ function Ua({ el: e }) {
|
|
|
4245
4246
|
{
|
|
4246
4247
|
onClick: () => {
|
|
4247
4248
|
const W = [...e.columns];
|
|
4248
|
-
W[E] = { ...W[E], conditionalStyles: (
|
|
4249
|
+
W[E] = { ...W[E], conditionalStyles: (m.conditionalStyles ?? []).filter((j, I) => I !== k) }, o(e.id, { columns: W });
|
|
4249
4250
|
},
|
|
4250
4251
|
style: {
|
|
4251
4252
|
width: 22,
|
|
@@ -4266,11 +4267,11 @@ function Ua({ el: e }) {
|
|
|
4266
4267
|
] }),
|
|
4267
4268
|
/* @__PURE__ */ v(He, { children: [
|
|
4268
4269
|
/* @__PURE__ */ t($, { label: "Text Color", children: /* @__PURE__ */ t(ue, { value: P.style.color ?? "", onChange: (W) => {
|
|
4269
|
-
const j = [...e.columns], I = [...
|
|
4270
|
+
const j = [...e.columns], I = [...m.conditionalStyles ?? []];
|
|
4270
4271
|
I[k] = { ...I[k], style: { ...I[k].style, color: W } }, j[E] = { ...j[E], conditionalStyles: I }, o(e.id, { columns: j });
|
|
4271
4272
|
} }) }),
|
|
4272
4273
|
/* @__PURE__ */ t($, { label: "Background", children: /* @__PURE__ */ t(ue, { value: P.style.backgroundColor ?? "", onChange: (W) => {
|
|
4273
|
-
const j = [...e.columns], I = [...
|
|
4274
|
+
const j = [...e.columns], I = [...m.conditionalStyles ?? []];
|
|
4274
4275
|
I[k] = { ...I[k], style: { ...I[k].style, backgroundColor: W } }, j[E] = { ...j[E], conditionalStyles: I }, o(e.id, { columns: j });
|
|
4275
4276
|
} }) }),
|
|
4276
4277
|
/* @__PURE__ */ t($, { label: "Font Size", children: /* @__PURE__ */ t(
|
|
@@ -4280,7 +4281,7 @@ function Ua({ el: e }) {
|
|
|
4280
4281
|
suffix: "px",
|
|
4281
4282
|
value: P.style.fontSize ?? "",
|
|
4282
4283
|
onChange: (W) => {
|
|
4283
|
-
const j = [...e.columns], I = [...
|
|
4284
|
+
const j = [...e.columns], I = [...m.conditionalStyles ?? []];
|
|
4284
4285
|
I[k] = { ...I[k], style: { ...I[k].style, fontSize: Number(W) || void 0 } }, j[E] = { ...j[E], conditionalStyles: I }, o(e.id, { columns: j });
|
|
4285
4286
|
}
|
|
4286
4287
|
}
|
|
@@ -4292,7 +4293,7 @@ function Ua({ el: e }) {
|
|
|
4292
4293
|
suffix: "px",
|
|
4293
4294
|
value: P.style.letterSpacing ?? "",
|
|
4294
4295
|
onChange: (W) => {
|
|
4295
|
-
const j = [...e.columns], I = [...
|
|
4296
|
+
const j = [...e.columns], I = [...m.conditionalStyles ?? []];
|
|
4296
4297
|
I[k] = { ...I[k], style: { ...I[k].style, letterSpacing: Number(W) || void 0 } }, j[E] = { ...j[E], conditionalStyles: I }, o(e.id, { columns: j });
|
|
4297
4298
|
}
|
|
4298
4299
|
}
|
|
@@ -4307,7 +4308,7 @@ function Ua({ el: e }) {
|
|
|
4307
4308
|
active: P.style.fontWeight === "bold",
|
|
4308
4309
|
title: "Bold",
|
|
4309
4310
|
onClick: () => {
|
|
4310
|
-
const W = [...e.columns], j = [...
|
|
4311
|
+
const W = [...e.columns], j = [...m.conditionalStyles ?? []];
|
|
4311
4312
|
j[k] = { ...j[k], style: { ...j[k].style, fontWeight: P.style.fontWeight === "bold" ? "normal" : "bold" } }, W[E] = { ...W[E], conditionalStyles: j }, o(e.id, { columns: W });
|
|
4312
4313
|
},
|
|
4313
4314
|
children: /* @__PURE__ */ t(Xt, { size: 12, strokeWidth: 2.5 })
|
|
@@ -4319,7 +4320,7 @@ function Ua({ el: e }) {
|
|
|
4319
4320
|
active: P.style.fontStyle === "italic",
|
|
4320
4321
|
title: "Italic",
|
|
4321
4322
|
onClick: () => {
|
|
4322
|
-
const W = [...e.columns], j = [...
|
|
4323
|
+
const W = [...e.columns], j = [...m.conditionalStyles ?? []];
|
|
4323
4324
|
j[k] = { ...j[k], style: { ...j[k].style, fontStyle: P.style.fontStyle === "italic" ? "normal" : "italic" } }, W[E] = { ...W[E], conditionalStyles: j }, o(e.id, { columns: W });
|
|
4324
4325
|
},
|
|
4325
4326
|
children: /* @__PURE__ */ t(Kt, { size: 12, strokeWidth: 2.5 })
|
|
@@ -4333,9 +4334,9 @@ function Ua({ el: e }) {
|
|
|
4333
4334
|
] }, E);
|
|
4334
4335
|
}) })
|
|
4335
4336
|
] }),
|
|
4336
|
-
/* @__PURE__ */ t(ja, { title: "Row Colors", open: h, onToggle: () => u((
|
|
4337
|
-
/* @__PURE__ */ t($, { label: "Odd rows", children: /* @__PURE__ */ t(ue, { value: r.backgroundColor ?? "", onChange: (
|
|
4338
|
-
/* @__PURE__ */ t($, { label: "Even rows", children: /* @__PURE__ */ t(ue, { value: n.backgroundColor ?? "", onChange: (
|
|
4337
|
+
/* @__PURE__ */ t(ja, { title: "Row Colors", open: h, onToggle: () => u((m) => !m), children: /* @__PURE__ */ v(He, { children: [
|
|
4338
|
+
/* @__PURE__ */ t($, { label: "Odd rows", children: /* @__PURE__ */ t(ue, { value: r.backgroundColor ?? "", onChange: (m) => w("backgroundColor", m) }) }),
|
|
4339
|
+
/* @__PURE__ */ t($, { label: "Even rows", children: /* @__PURE__ */ t(ue, { value: n.backgroundColor ?? "", onChange: (m) => b("backgroundColor", m) }) })
|
|
4339
4340
|
] }) })
|
|
4340
4341
|
] })
|
|
4341
4342
|
] });
|
|
@@ -5569,19 +5570,19 @@ function sl() {
|
|
|
5569
5570
|
if (!s.isValid(p))
|
|
5570
5571
|
throw new Error("Invalid QR Code version");
|
|
5571
5572
|
typeof y > "u" && (y = l.BYTE);
|
|
5572
|
-
const w = o.getSymbolTotalCodewords(p), b = i.getTotalCodewordsCount(p, g),
|
|
5573
|
-
if (y === l.MIXED) return
|
|
5574
|
-
const
|
|
5573
|
+
const w = o.getSymbolTotalCodewords(p), b = i.getTotalCodewordsCount(p, g), x = (w - b) * 8;
|
|
5574
|
+
if (y === l.MIXED) return x;
|
|
5575
|
+
const O = x - r(y, p);
|
|
5575
5576
|
switch (y) {
|
|
5576
5577
|
case l.NUMERIC:
|
|
5577
|
-
return Math.floor(
|
|
5578
|
+
return Math.floor(O / 10 * 3);
|
|
5578
5579
|
case l.ALPHANUMERIC:
|
|
5579
|
-
return Math.floor(
|
|
5580
|
+
return Math.floor(O / 11 * 2);
|
|
5580
5581
|
case l.KANJI:
|
|
5581
|
-
return Math.floor(
|
|
5582
|
+
return Math.floor(O / 13);
|
|
5582
5583
|
case l.BYTE:
|
|
5583
5584
|
default:
|
|
5584
|
-
return Math.floor(
|
|
5585
|
+
return Math.floor(O / 8);
|
|
5585
5586
|
}
|
|
5586
5587
|
}, e.getBestVersionForData = function(p, g) {
|
|
5587
5588
|
let y;
|
|
@@ -5834,22 +5835,22 @@ function vl() {
|
|
|
5834
5835
|
function r(b) {
|
|
5835
5836
|
return unescape(encodeURIComponent(b)).length;
|
|
5836
5837
|
}
|
|
5837
|
-
function n(b,
|
|
5838
|
-
const
|
|
5838
|
+
function n(b, x, O) {
|
|
5839
|
+
const m = [];
|
|
5839
5840
|
let E;
|
|
5840
|
-
for (; (E = b.exec(
|
|
5841
|
-
|
|
5841
|
+
for (; (E = b.exec(O)) !== null; )
|
|
5842
|
+
m.push({
|
|
5842
5843
|
data: E[0],
|
|
5843
5844
|
index: E.index,
|
|
5844
|
-
mode:
|
|
5845
|
+
mode: x,
|
|
5845
5846
|
length: E[0].length
|
|
5846
5847
|
});
|
|
5847
|
-
return
|
|
5848
|
+
return m;
|
|
5848
5849
|
}
|
|
5849
5850
|
function c(b) {
|
|
5850
|
-
const
|
|
5851
|
-
let
|
|
5852
|
-
return h.isKanjiModeEnabled() ? (
|
|
5851
|
+
const x = n(f.NUMERIC, o.NUMERIC, b), O = n(f.ALPHANUMERIC, o.ALPHANUMERIC, b);
|
|
5852
|
+
let m, E;
|
|
5853
|
+
return h.isKanjiModeEnabled() ? (m = n(f.BYTE, o.BYTE, b), E = n(f.KANJI, o.KANJI, b)) : (m = n(f.BYTE_KANJI, o.BYTE, b), E = []), x.concat(O, m, E).sort(function(M, z) {
|
|
5853
5854
|
return M.index - z.index;
|
|
5854
5855
|
}).map(function(M) {
|
|
5855
5856
|
return {
|
|
@@ -5859,8 +5860,8 @@ function vl() {
|
|
|
5859
5860
|
};
|
|
5860
5861
|
});
|
|
5861
5862
|
}
|
|
5862
|
-
function d(b,
|
|
5863
|
-
switch (
|
|
5863
|
+
function d(b, x) {
|
|
5864
|
+
switch (x) {
|
|
5864
5865
|
case o.NUMERIC:
|
|
5865
5866
|
return i.getBitsLength(b);
|
|
5866
5867
|
case o.ALPHANUMERIC:
|
|
@@ -5872,69 +5873,69 @@ function vl() {
|
|
|
5872
5873
|
}
|
|
5873
5874
|
}
|
|
5874
5875
|
function p(b) {
|
|
5875
|
-
return b.reduce(function(
|
|
5876
|
-
const
|
|
5877
|
-
return
|
|
5876
|
+
return b.reduce(function(x, O) {
|
|
5877
|
+
const m = x.length - 1 >= 0 ? x[x.length - 1] : null;
|
|
5878
|
+
return m && m.mode === O.mode ? (x[x.length - 1].data += O.data, x) : (x.push(O), x);
|
|
5878
5879
|
}, []);
|
|
5879
5880
|
}
|
|
5880
5881
|
function g(b) {
|
|
5881
|
-
const
|
|
5882
|
-
for (let
|
|
5883
|
-
const
|
|
5884
|
-
switch (
|
|
5882
|
+
const x = [];
|
|
5883
|
+
for (let O = 0; O < b.length; O++) {
|
|
5884
|
+
const m = b[O];
|
|
5885
|
+
switch (m.mode) {
|
|
5885
5886
|
case o.NUMERIC:
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
{ data:
|
|
5889
|
-
{ data:
|
|
5887
|
+
x.push([
|
|
5888
|
+
m,
|
|
5889
|
+
{ data: m.data, mode: o.ALPHANUMERIC, length: m.length },
|
|
5890
|
+
{ data: m.data, mode: o.BYTE, length: m.length }
|
|
5890
5891
|
]);
|
|
5891
5892
|
break;
|
|
5892
5893
|
case o.ALPHANUMERIC:
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
{ data:
|
|
5894
|
+
x.push([
|
|
5895
|
+
m,
|
|
5896
|
+
{ data: m.data, mode: o.BYTE, length: m.length }
|
|
5896
5897
|
]);
|
|
5897
5898
|
break;
|
|
5898
5899
|
case o.KANJI:
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
{ data:
|
|
5900
|
+
x.push([
|
|
5901
|
+
m,
|
|
5902
|
+
{ data: m.data, mode: o.BYTE, length: r(m.data) }
|
|
5902
5903
|
]);
|
|
5903
5904
|
break;
|
|
5904
5905
|
case o.BYTE:
|
|
5905
|
-
|
|
5906
|
-
{ data:
|
|
5906
|
+
x.push([
|
|
5907
|
+
{ data: m.data, mode: o.BYTE, length: r(m.data) }
|
|
5907
5908
|
]);
|
|
5908
5909
|
}
|
|
5909
5910
|
}
|
|
5910
|
-
return
|
|
5911
|
+
return x;
|
|
5911
5912
|
}
|
|
5912
|
-
function y(b,
|
|
5913
|
-
const
|
|
5913
|
+
function y(b, x) {
|
|
5914
|
+
const O = {}, m = { start: {} };
|
|
5914
5915
|
let E = ["start"];
|
|
5915
5916
|
for (let S = 0; S < b.length; S++) {
|
|
5916
5917
|
const M = b[S], z = [];
|
|
5917
5918
|
for (let C = 0; C < M.length; C++) {
|
|
5918
5919
|
const A = M[C], R = "" + S + C;
|
|
5919
|
-
z.push(R),
|
|
5920
|
+
z.push(R), O[R] = { node: A, lastCount: 0 }, m[R] = {};
|
|
5920
5921
|
for (let _ = 0; _ < E.length; _++) {
|
|
5921
|
-
const
|
|
5922
|
-
T
|
|
5922
|
+
const T = E[_];
|
|
5923
|
+
O[T] && O[T].node.mode === A.mode ? (m[T][R] = d(O[T].lastCount + A.length, A.mode) - d(O[T].lastCount, A.mode), O[T].lastCount += A.length) : (O[T] && (O[T].lastCount = A.length), m[T][R] = d(A.length, A.mode) + 4 + o.getCharCountIndicator(A.mode, x));
|
|
5923
5924
|
}
|
|
5924
5925
|
}
|
|
5925
5926
|
E = z;
|
|
5926
5927
|
}
|
|
5927
5928
|
for (let S = 0; S < E.length; S++)
|
|
5928
|
-
|
|
5929
|
-
return { map:
|
|
5930
|
-
}
|
|
5931
|
-
function w(b,
|
|
5932
|
-
let
|
|
5933
|
-
const
|
|
5934
|
-
if (
|
|
5935
|
-
throw new Error('"' + b + '" cannot be encoded with mode ' + o.toString(
|
|
5936
|
-
Suggested mode is: ` + o.toString(
|
|
5937
|
-
switch (
|
|
5929
|
+
m[E[S]].end = 0;
|
|
5930
|
+
return { map: m, table: O };
|
|
5931
|
+
}
|
|
5932
|
+
function w(b, x) {
|
|
5933
|
+
let O;
|
|
5934
|
+
const m = o.getBestModeForData(b);
|
|
5935
|
+
if (O = o.from(x, m), O !== o.BYTE && O.bit < m.bit)
|
|
5936
|
+
throw new Error('"' + b + '" cannot be encoded with mode ' + o.toString(O) + `.
|
|
5937
|
+
Suggested mode is: ` + o.toString(m));
|
|
5938
|
+
switch (O === o.KANJI && !h.isKanjiModeEnabled() && (O = o.BYTE), O) {
|
|
5938
5939
|
case o.NUMERIC:
|
|
5939
5940
|
return new i(b);
|
|
5940
5941
|
case o.ALPHANUMERIC:
|
|
@@ -5945,18 +5946,18 @@ function vl() {
|
|
|
5945
5946
|
return new l(b);
|
|
5946
5947
|
}
|
|
5947
5948
|
}
|
|
5948
|
-
e.fromArray = function(
|
|
5949
|
-
return
|
|
5950
|
-
return typeof
|
|
5949
|
+
e.fromArray = function(x) {
|
|
5950
|
+
return x.reduce(function(O, m) {
|
|
5951
|
+
return typeof m == "string" ? O.push(w(m, null)) : m.data && O.push(w(m.data, m.mode)), O;
|
|
5951
5952
|
}, []);
|
|
5952
|
-
}, e.fromString = function(
|
|
5953
|
-
const
|
|
5953
|
+
}, e.fromString = function(x, O) {
|
|
5954
|
+
const m = c(x, h.isKanjiModeEnabled()), E = g(m), S = y(E, O), M = u.find_path(S.map, "start", "end"), z = [];
|
|
5954
5955
|
for (let C = 1; C < M.length - 1; C++)
|
|
5955
5956
|
z.push(S.table[M[C]].node);
|
|
5956
5957
|
return e.fromArray(p(z));
|
|
5957
|
-
}, e.rawSplit = function(
|
|
5958
|
+
}, e.rawSplit = function(x) {
|
|
5958
5959
|
return e.fromArray(
|
|
5959
|
-
c(
|
|
5960
|
+
c(x, h.isKanjiModeEnabled())
|
|
5960
5961
|
);
|
|
5961
5962
|
};
|
|
5962
5963
|
})(Tr)), Tr;
|
|
@@ -5970,10 +5971,10 @@ function bl() {
|
|
|
5970
5971
|
const z = S.size, C = s.getPositions(M);
|
|
5971
5972
|
for (let A = 0; A < C.length; A++) {
|
|
5972
5973
|
const R = C[A][0], _ = C[A][1];
|
|
5973
|
-
for (let
|
|
5974
|
-
if (!(R +
|
|
5974
|
+
for (let T = -1; T <= 7; T++)
|
|
5975
|
+
if (!(R + T <= -1 || z <= R + T))
|
|
5975
5976
|
for (let D = -1; D <= 7; D++)
|
|
5976
|
-
_ + D <= -1 || z <= _ + D || (
|
|
5977
|
+
_ + D <= -1 || z <= _ + D || (T >= 0 && T <= 6 && (D === 0 || D === 6) || D >= 0 && D <= 6 && (T === 0 || T === 6) || T >= 2 && T <= 4 && D >= 2 && D <= 4 ? S.set(R + T, _ + D, !0, !0) : S.set(R + T, _ + D, !1, !0));
|
|
5977
5978
|
}
|
|
5978
5979
|
}
|
|
5979
5980
|
function g(S) {
|
|
@@ -5988,15 +5989,15 @@ function bl() {
|
|
|
5988
5989
|
for (let C = 0; C < z.length; C++) {
|
|
5989
5990
|
const A = z[C][0], R = z[C][1];
|
|
5990
5991
|
for (let _ = -2; _ <= 2; _++)
|
|
5991
|
-
for (let
|
|
5992
|
-
_ === -2 || _ === 2 ||
|
|
5992
|
+
for (let T = -2; T <= 2; T++)
|
|
5993
|
+
_ === -2 || _ === 2 || T === -2 || T === 2 || _ === 0 && T === 0 ? S.set(A + _, R + T, !0, !0) : S.set(A + _, R + T, !1, !0);
|
|
5993
5994
|
}
|
|
5994
5995
|
}
|
|
5995
5996
|
function w(S, M) {
|
|
5996
5997
|
const z = S.size, C = r.getEncodedBits(M);
|
|
5997
5998
|
let A, R, _;
|
|
5998
|
-
for (let
|
|
5999
|
-
A = Math.floor(
|
|
5999
|
+
for (let T = 0; T < 18; T++)
|
|
6000
|
+
A = Math.floor(T / 3), R = T % 3 + z - 8 - 3, _ = (C >> T & 1) === 1, S.set(A, R, _, !0), S.set(R, A, _, !0);
|
|
6000
6001
|
}
|
|
6001
6002
|
function b(S, M, z) {
|
|
6002
6003
|
const C = S.size, A = n.getEncodedBits(M, z);
|
|
@@ -6005,15 +6006,15 @@ function bl() {
|
|
|
6005
6006
|
_ = (A >> R & 1) === 1, R < 6 ? S.set(R, 8, _, !0) : R < 8 ? S.set(R + 1, 8, _, !0) : S.set(C - 15 + R, 8, _, !0), R < 8 ? S.set(8, C - R - 1, _, !0) : R < 9 ? S.set(8, 15 - R - 1 + 1, _, !0) : S.set(8, 15 - R - 1, _, !0);
|
|
6006
6007
|
S.set(C - 8, 8, 1, !0);
|
|
6007
6008
|
}
|
|
6008
|
-
function
|
|
6009
|
+
function x(S, M) {
|
|
6009
6010
|
const z = S.size;
|
|
6010
6011
|
let C = -1, A = z - 1, R = 7, _ = 0;
|
|
6011
|
-
for (let
|
|
6012
|
-
for (
|
|
6012
|
+
for (let T = z - 1; T > 0; T -= 2)
|
|
6013
|
+
for (T === 6 && T--; ; ) {
|
|
6013
6014
|
for (let D = 0; D < 2; D++)
|
|
6014
|
-
if (!S.isReserved(A,
|
|
6015
|
+
if (!S.isReserved(A, T - D)) {
|
|
6015
6016
|
let F = !1;
|
|
6016
|
-
_ < M.length && (F = (M[_] >>> R & 1) === 1), S.set(A,
|
|
6017
|
+
_ < M.length && (F = (M[_] >>> R & 1) === 1), S.set(A, T - D, F), R--, R === -1 && (_++, R = 7);
|
|
6017
6018
|
}
|
|
6018
6019
|
if (A += C, A < 0 || z <= A) {
|
|
6019
6020
|
A -= C, C = -C;
|
|
@@ -6021,7 +6022,7 @@ function bl() {
|
|
|
6021
6022
|
}
|
|
6022
6023
|
}
|
|
6023
6024
|
}
|
|
6024
|
-
function
|
|
6025
|
+
function O(S, M, z) {
|
|
6025
6026
|
const C = new i();
|
|
6026
6027
|
z.forEach(function(D) {
|
|
6027
6028
|
C.put(D.mode.bit, 4), C.put(D.getLength(), c.getCharCountIndicator(D.mode, S)), D.write(C);
|
|
@@ -6029,13 +6030,13 @@ function bl() {
|
|
|
6029
6030
|
const A = e.getSymbolTotalCodewords(S), R = h.getTotalCodewordsCount(S, M), _ = (A - R) * 8;
|
|
6030
6031
|
for (C.getLengthInBits() + 4 <= _ && C.put(0, 4); C.getLengthInBits() % 8 !== 0; )
|
|
6031
6032
|
C.putBit(0);
|
|
6032
|
-
const
|
|
6033
|
-
for (let D = 0; D <
|
|
6033
|
+
const T = (_ - C.getLengthInBits()) / 8;
|
|
6034
|
+
for (let D = 0; D < T; D++)
|
|
6034
6035
|
C.put(D % 2 ? 17 : 236, 8);
|
|
6035
|
-
return
|
|
6036
|
+
return m(C, S, M);
|
|
6036
6037
|
}
|
|
6037
|
-
function
|
|
6038
|
-
const C = e.getSymbolTotalCodewords(M), A = h.getTotalCodewordsCount(M, z), R = C - A, _ = h.getBlocksCount(M, z),
|
|
6038
|
+
function m(S, M, z) {
|
|
6039
|
+
const C = e.getSymbolTotalCodewords(M), A = h.getTotalCodewordsCount(M, z), R = C - A, _ = h.getBlocksCount(M, z), T = C % _, D = _ - T, F = Math.floor(C / _), B = Math.floor(R / _), V = B + 1, L = F - B, Y = new u(L);
|
|
6039
6040
|
let q = 0;
|
|
6040
6041
|
const N = new Array(_), K = new Array(_);
|
|
6041
6042
|
let P = 0;
|
|
@@ -6079,8 +6080,8 @@ The chosen QR Code version cannot contain this amount of data.
|
|
|
6079
6080
|
Minimum version required to store current data is: ` + R + `.
|
|
6080
6081
|
`
|
|
6081
6082
|
);
|
|
6082
|
-
const _ =
|
|
6083
|
-
return p(D, M), g(D), y(D, M), b(D, z, 0), M >= 7 && w(D, M),
|
|
6083
|
+
const _ = O(M, z, A), T = e.getSymbolSize(M), D = new a(T);
|
|
6084
|
+
return p(D, M), g(D), y(D, M), b(D, z, 0), M >= 7 && w(D, M), x(D, _), isNaN(C) && (C = f.getBestMask(
|
|
6084
6085
|
D,
|
|
6085
6086
|
b.bind(null, D, z)
|
|
6086
6087
|
)), f.applyMask(C, D), b(D, z, C), {
|
|
@@ -6267,13 +6268,13 @@ function El() {
|
|
|
6267
6268
|
}), Ge.CODE39 = void 0;
|
|
6268
6269
|
var e = /* @__PURE__ */ (function() {
|
|
6269
6270
|
function y(w, b) {
|
|
6270
|
-
for (var
|
|
6271
|
-
var
|
|
6272
|
-
|
|
6271
|
+
for (var x = 0; x < b.length; x++) {
|
|
6272
|
+
var O = b[x];
|
|
6273
|
+
O.enumerable = O.enumerable || !1, O.configurable = !0, "value" in O && (O.writable = !0), Object.defineProperty(w, O.key, O);
|
|
6273
6274
|
}
|
|
6274
6275
|
}
|
|
6275
|
-
return function(w, b,
|
|
6276
|
-
return b && y(w.prototype, b),
|
|
6276
|
+
return function(w, b, x) {
|
|
6277
|
+
return b && y(w.prototype, b), x && y(w, x), w;
|
|
6277
6278
|
};
|
|
6278
6279
|
})(), o = de(), i = a(o);
|
|
6279
6280
|
function a(y) {
|
|
@@ -6295,16 +6296,16 @@ function El() {
|
|
|
6295
6296
|
}
|
|
6296
6297
|
var h = (function(y) {
|
|
6297
6298
|
f(w, y);
|
|
6298
|
-
function w(b,
|
|
6299
|
-
return l(this, w), b = b.toUpperCase(),
|
|
6299
|
+
function w(b, x) {
|
|
6300
|
+
return l(this, w), b = b.toUpperCase(), x.mod43 && (b += d(g(b))), s(this, (w.__proto__ || Object.getPrototypeOf(w)).call(this, b, x));
|
|
6300
6301
|
}
|
|
6301
6302
|
return e(w, [{
|
|
6302
6303
|
key: "encode",
|
|
6303
6304
|
value: function() {
|
|
6304
|
-
for (var
|
|
6305
|
-
|
|
6306
|
-
return
|
|
6307
|
-
data:
|
|
6305
|
+
for (var x = n("*"), O = 0; O < this.data.length; O++)
|
|
6306
|
+
x += n(this.data[O]) + "0";
|
|
6307
|
+
return x += n("*"), {
|
|
6308
|
+
data: x,
|
|
6308
6309
|
text: this.text
|
|
6309
6310
|
};
|
|
6310
6311
|
}
|
|
@@ -6455,10 +6456,10 @@ function or() {
|
|
|
6455
6456
|
b !== void 0 ? y = n.next(d, p + 1, b) : ((g === a.SET_A || g === a.SET_B) && w === a.SHIFT && (d[0] = g === a.SET_A ? d[0] > 95 ? d[0] - 96 : d[0] : d[0] < 32 ? d[0] + 96 : d[0]), y = n.next(d, p + 1, g));
|
|
6456
6457
|
} else
|
|
6457
6458
|
w = n.correctIndex(d, g), y = n.next(d, p + 1, g);
|
|
6458
|
-
var
|
|
6459
|
+
var x = n.getBar(w), O = w * p;
|
|
6459
6460
|
return {
|
|
6460
|
-
result:
|
|
6461
|
-
checksum:
|
|
6461
|
+
result: x + y.result,
|
|
6462
|
+
checksum: O + y.checksum
|
|
6462
6463
|
};
|
|
6463
6464
|
}
|
|
6464
6465
|
}]), n;
|
|
@@ -7315,8 +7316,8 @@ function Pl() {
|
|
|
7315
7316
|
var e = /* @__PURE__ */ (function() {
|
|
7316
7317
|
function g(y, w) {
|
|
7317
7318
|
for (var b = 0; b < w.length; b++) {
|
|
7318
|
-
var
|
|
7319
|
-
|
|
7319
|
+
var x = w[b];
|
|
7320
|
+
x.enumerable = x.enumerable || !1, x.configurable = !0, "value" in x && (x.writable = !0), Object.defineProperty(y, x.key, x);
|
|
7320
7321
|
}
|
|
7321
7322
|
}
|
|
7322
7323
|
return function(y, w, b) {
|
|
@@ -7344,17 +7345,17 @@ function Pl() {
|
|
|
7344
7345
|
r(y, g);
|
|
7345
7346
|
function y(w, b) {
|
|
7346
7347
|
h(this, y);
|
|
7347
|
-
var
|
|
7348
|
-
if (
|
|
7349
|
-
|
|
7348
|
+
var x = u(this, (y.__proto__ || Object.getPrototypeOf(y)).call(this, w, b));
|
|
7349
|
+
if (x.isValid = !1, w.search(/^[0-9]{6}$/) !== -1)
|
|
7350
|
+
x.middleDigits = w, x.upcA = p(w, "0"), x.text = b.text || "" + x.upcA[0] + w + x.upcA[x.upcA.length - 1], x.isValid = !0;
|
|
7350
7351
|
else if (w.search(/^[01][0-9]{7}$/) !== -1)
|
|
7351
|
-
if (
|
|
7352
|
-
|
|
7352
|
+
if (x.middleDigits = w.substring(1, w.length - 1), x.upcA = p(x.middleDigits, w[0]), x.upcA[x.upcA.length - 1] === w[w.length - 1])
|
|
7353
|
+
x.isValid = !0;
|
|
7353
7354
|
else
|
|
7354
|
-
return u(
|
|
7355
|
+
return u(x);
|
|
7355
7356
|
else
|
|
7356
|
-
return u(
|
|
7357
|
-
return
|
|
7357
|
+
return u(x);
|
|
7358
|
+
return x.displayValue = b.displayValue, b.fontSize > b.width * 10 ? x.fontSize = b.width * 10 : x.fontSize = b.fontSize, x.guardHeight = b.height + x.fontSize / 2 + b.textMargin, x;
|
|
7358
7359
|
}
|
|
7359
7360
|
return e(y, [{
|
|
7360
7361
|
key: "valid",
|
|
@@ -7402,17 +7403,17 @@ function Pl() {
|
|
|
7402
7403
|
}, {
|
|
7403
7404
|
key: "encodeMiddleDigits",
|
|
7404
7405
|
value: function() {
|
|
7405
|
-
var b = this.upcA[0],
|
|
7406
|
-
return (0, i.default)(this.middleDigits,
|
|
7406
|
+
var b = this.upcA[0], x = this.upcA[this.upcA.length - 1], O = c[parseInt(x)][parseInt(b)];
|
|
7407
|
+
return (0, i.default)(this.middleDigits, O);
|
|
7407
7408
|
}
|
|
7408
7409
|
}]), y;
|
|
7409
7410
|
})(l.default);
|
|
7410
7411
|
function p(g, y) {
|
|
7411
|
-
for (var w = parseInt(g[g.length - 1]), b = n[w],
|
|
7412
|
-
var E = b[
|
|
7413
|
-
E === "X" ?
|
|
7412
|
+
for (var w = parseInt(g[g.length - 1]), b = n[w], x = "", O = 0, m = 0; m < b.length; m++) {
|
|
7413
|
+
var E = b[m];
|
|
7414
|
+
E === "X" ? x += g[O++] : x += E;
|
|
7414
7415
|
}
|
|
7415
|
-
return
|
|
7416
|
+
return x = "" + y + x, "" + x + (0, s.checksum)(x);
|
|
7416
7417
|
}
|
|
7417
7418
|
return Ot.default = d, Ot;
|
|
7418
7419
|
}
|
|
@@ -8178,8 +8179,8 @@ function ui() {
|
|
|
8178
8179
|
key: "checksum",
|
|
8179
8180
|
value: function(d, p) {
|
|
8180
8181
|
var g = d.slice().reverse().reduce(function(y, w, b) {
|
|
8181
|
-
var
|
|
8182
|
-
return y + n.symbolValue(w) *
|
|
8182
|
+
var x = b % p + 1;
|
|
8183
|
+
return y + n.symbolValue(w) * x;
|
|
8183
8184
|
}, 0);
|
|
8184
8185
|
return n.getSymbol(g % 47);
|
|
8185
8186
|
}
|
|
@@ -8904,27 +8905,27 @@ function lc() {
|
|
|
8904
8905
|
function b(C) {
|
|
8905
8906
|
return C && C.__esModule ? C : { default: C };
|
|
8906
8907
|
}
|
|
8907
|
-
var
|
|
8908
|
-
},
|
|
8909
|
-
var
|
|
8908
|
+
var x = function() {
|
|
8909
|
+
}, O = function(A, R, _) {
|
|
8910
|
+
var T = new x();
|
|
8910
8911
|
if (typeof A > "u")
|
|
8911
8912
|
throw Error("No element to render on was provided.");
|
|
8912
|
-
return
|
|
8913
|
+
return T._renderProperties = (0, r.default)(A), T._encodings = [], T._options = w.default, T._errorHandler = new p.default(T), typeof R < "u" && (_ = _ || {}, _.format || (_.format = M()), T.options(_)[_.format](R, _).render()), T;
|
|
8913
8914
|
};
|
|
8914
|
-
|
|
8915
|
+
O.getModule = function(C) {
|
|
8915
8916
|
return o.default[C];
|
|
8916
8917
|
};
|
|
8917
|
-
for (var
|
|
8918
|
-
o.default.hasOwnProperty(
|
|
8918
|
+
for (var m in o.default)
|
|
8919
|
+
o.default.hasOwnProperty(m) && E(o.default, m);
|
|
8919
8920
|
function E(C, A) {
|
|
8920
|
-
|
|
8921
|
-
var
|
|
8922
|
-
return
|
|
8921
|
+
x.prototype[A] = x.prototype[A.toUpperCase()] = x.prototype[A.toLowerCase()] = function(R, _) {
|
|
8922
|
+
var T = this;
|
|
8923
|
+
return T._errorHandler.wrapBarcodeCall(function() {
|
|
8923
8924
|
_.text = typeof _.text > "u" ? void 0 : "" + _.text;
|
|
8924
|
-
var D = (0, a.default)(
|
|
8925
|
+
var D = (0, a.default)(T._options, _);
|
|
8925
8926
|
D = (0, c.default)(D);
|
|
8926
8927
|
var F = C[A], B = S(R, F, D);
|
|
8927
|
-
return
|
|
8928
|
+
return T._encodings.push(B), T;
|
|
8928
8929
|
});
|
|
8929
8930
|
};
|
|
8930
8931
|
}
|
|
@@ -8933,21 +8934,21 @@ function lc() {
|
|
|
8933
8934
|
var _ = new A(C, R);
|
|
8934
8935
|
if (!_.valid())
|
|
8935
8936
|
throw new g.InvalidInputException(_.constructor.name, C);
|
|
8936
|
-
var
|
|
8937
|
-
|
|
8938
|
-
for (var D = 0; D <
|
|
8939
|
-
|
|
8940
|
-
return
|
|
8937
|
+
var T = _.encode();
|
|
8938
|
+
T = (0, s.default)(T);
|
|
8939
|
+
for (var D = 0; D < T.length; D++)
|
|
8940
|
+
T[D].options = (0, a.default)(R, T[D].options);
|
|
8941
|
+
return T;
|
|
8941
8942
|
}
|
|
8942
8943
|
function M() {
|
|
8943
8944
|
return o.default.CODE128 ? "CODE128" : Object.keys(o.default)[0];
|
|
8944
8945
|
}
|
|
8945
|
-
|
|
8946
|
+
x.prototype.options = function(C) {
|
|
8946
8947
|
return this._options = (0, a.default)(this._options, C), this;
|
|
8947
|
-
},
|
|
8948
|
+
}, x.prototype.blank = function(C) {
|
|
8948
8949
|
var A = new Array(C + 1).join("0");
|
|
8949
8950
|
return this._encodings.push({ data: A }), this;
|
|
8950
|
-
},
|
|
8951
|
+
}, x.prototype.init = function() {
|
|
8951
8952
|
if (this._renderProperties) {
|
|
8952
8953
|
Array.isArray(this._renderProperties) || (this._renderProperties = [this._renderProperties]);
|
|
8953
8954
|
var C;
|
|
@@ -8955,12 +8956,12 @@ function lc() {
|
|
|
8955
8956
|
C = this._renderProperties[A];
|
|
8956
8957
|
var R = (0, a.default)(this._options, C.options);
|
|
8957
8958
|
R.format == "auto" && (R.format = M()), this._errorHandler.wrapBarcodeCall(function() {
|
|
8958
|
-
var _ = R.value,
|
|
8959
|
+
var _ = R.value, T = o.default[R.format.toUpperCase()], D = S(_, T, R);
|
|
8959
8960
|
z(C, D, R);
|
|
8960
8961
|
});
|
|
8961
8962
|
}
|
|
8962
8963
|
}
|
|
8963
|
-
},
|
|
8964
|
+
}, x.prototype.render = function() {
|
|
8964
8965
|
if (!this._renderProperties)
|
|
8965
8966
|
throw new g.NoElementException();
|
|
8966
8967
|
if (Array.isArray(this._renderProperties))
|
|
@@ -8969,21 +8970,21 @@ function lc() {
|
|
|
8969
8970
|
else
|
|
8970
8971
|
z(this._renderProperties, this._encodings, this._options);
|
|
8971
8972
|
return this;
|
|
8972
|
-
},
|
|
8973
|
+
}, x.prototype._defaults = w.default;
|
|
8973
8974
|
function z(C, A, R) {
|
|
8974
8975
|
A = (0, s.default)(A);
|
|
8975
8976
|
for (var _ = 0; _ < A.length; _++)
|
|
8976
8977
|
A[_].options = (0, a.default)(R, A[_].options), (0, h.default)(A[_].options);
|
|
8977
8978
|
(0, h.default)(R);
|
|
8978
|
-
var
|
|
8979
|
+
var T = C.renderer, D = new T(C.element, A, R);
|
|
8979
8980
|
D.render(), C.afterRender && C.afterRender();
|
|
8980
8981
|
}
|
|
8981
|
-
return typeof window < "u" && (window.JsBarcode =
|
|
8982
|
+
return typeof window < "u" && (window.JsBarcode = O), typeof jQuery < "u" && (jQuery.fn.JsBarcode = function(C, A) {
|
|
8982
8983
|
var R = [];
|
|
8983
8984
|
return jQuery(this).each(function() {
|
|
8984
8985
|
R.push(this);
|
|
8985
|
-
}),
|
|
8986
|
-
}), Lr =
|
|
8986
|
+
}), O(R, C, A);
|
|
8987
|
+
}), Lr = O, Lr;
|
|
8987
8988
|
}
|
|
8988
8989
|
var cc = lc();
|
|
8989
8990
|
const dc = /* @__PURE__ */ ni(cc), sc = {
|
|
@@ -9116,7 +9117,7 @@ function vc({ el: e }) {
|
|
|
9116
9117
|
}
|
|
9117
9118
|
function bc({ el: e }) {
|
|
9118
9119
|
if (e.type !== "table") return null;
|
|
9119
|
-
const { updateElement: o, selectedId: i, zoom: a } = X(), l = i === e.id, s = e.style ?? {}, f = e.headerStyle ?? {}, h = e.altRowStyle ?? {}, u = e.previewRows ?? (e.dataSource ? [{}] : Array.from({ length: e.rowCount ?? 1 }, () => ({}))), r = e.columns.reduce((q, N) => q + N.width, 0) || 1, [n, c] = U(null), [d, p] = U(null), [g, y] = U(null), [w, b] = U(null), [
|
|
9120
|
+
const { updateElement: o, selectedId: i, zoom: a } = X(), l = i === e.id, s = e.style ?? {}, f = e.headerStyle ?? {}, h = e.altRowStyle ?? {}, u = e.previewRows ?? (e.dataSource ? [{}] : Array.from({ length: e.rowCount ?? 1 }, () => ({}))), r = e.columns.reduce((q, N) => q + N.width, 0) || 1, [n, c] = U(null), [d, p] = U(null), [g, y] = U(null), [w, b] = U(null), [x, O] = U(null), [m, E] = U(null), S = ee(null), M = (q) => {
|
|
9120
9121
|
if (u.length <= 1) return;
|
|
9121
9122
|
const N = u.filter((K, P) => P !== q);
|
|
9122
9123
|
o(e.id, { previewRows: N, rowCount: N.length });
|
|
@@ -9143,13 +9144,13 @@ function bc({ el: e }) {
|
|
|
9143
9144
|
const N = [...e.columns], [K] = N.splice(g, 1);
|
|
9144
9145
|
N.splice(q, 0, K), o(e.id, { columns: N }), y(null), b(null);
|
|
9145
9146
|
}, R = (q) => {
|
|
9146
|
-
if (
|
|
9147
|
-
|
|
9147
|
+
if (x === null || x === q) {
|
|
9148
|
+
O(null), E(null);
|
|
9148
9149
|
return;
|
|
9149
9150
|
}
|
|
9150
|
-
const N = [...u], [K] = N.splice(
|
|
9151
|
-
N.splice(q, 0, K), o(e.id, { previewRows: N }),
|
|
9152
|
-
}, _ = s.borderWidth ?? 0.5,
|
|
9151
|
+
const N = [...u], [K] = N.splice(x, 1);
|
|
9152
|
+
N.splice(q, 0, K), o(e.id, { previewRows: N }), O(null), E(null);
|
|
9153
|
+
}, _ = s.borderWidth ?? 0.5, T = s.borderColor ?? "#e2e8f0", D = `${_}px solid ${T}`, F = `${Math.max(_, 1)}px solid ${T}`, B = s.padding ?? 6, V = s.fontSize ?? 10, L = f.backgroundColor ?? s.backgroundColor ?? "#f8fafc", Y = 18;
|
|
9153
9154
|
return /* @__PURE__ */ t("div", { style: { width: "100%", fontSize: V, fontFamily: "inherit", overflow: "visible" }, children: /* @__PURE__ */ v("table", { style: { borderCollapse: "collapse", tableLayout: "fixed", width: "100%", lineHeight: 1.4 }, children: [
|
|
9154
9155
|
/* @__PURE__ */ t("colgroup", { children: e.columns.map((q, N) => /* @__PURE__ */ t("col", { style: { width: `${q.width / r * 100}%` } }, N)) }),
|
|
9155
9156
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: e.columns.map((q, N) => {
|
|
@@ -9229,7 +9230,7 @@ function bc({ el: e }) {
|
|
|
9229
9230
|
);
|
|
9230
9231
|
}) }) }),
|
|
9231
9232
|
/* @__PURE__ */ t("tbody", { children: u.map((q, N) => {
|
|
9232
|
-
const P = N % 2 === 1 ? h.backgroundColor ?? "rgba(0,0,0,0.022)" : s.backgroundColor ?? "transparent", k = l && n === N, W = l &&
|
|
9233
|
+
const P = N % 2 === 1 ? h.backgroundColor ?? "rgba(0,0,0,0.022)" : s.backgroundColor ?? "transparent", k = l && n === N, W = l && m === N;
|
|
9233
9234
|
return /* @__PURE__ */ t(
|
|
9234
9235
|
"tr",
|
|
9235
9236
|
{
|
|
@@ -9237,7 +9238,7 @@ function bc({ el: e }) {
|
|
|
9237
9238
|
background: W ? "var(--accent-dim, rgba(108,99,255,0.07))" : k ? "rgba(0,0,0,0.025)" : P,
|
|
9238
9239
|
outline: W ? "1.5px solid var(--accent, #6c63ff)" : "none",
|
|
9239
9240
|
outlineOffset: -1,
|
|
9240
|
-
opacity: l &&
|
|
9241
|
+
opacity: l && x === N ? 0.35 : 1,
|
|
9241
9242
|
transition: "background 0.08s, opacity 0.1s"
|
|
9242
9243
|
},
|
|
9243
9244
|
onMouseEnter: l ? () => c(N) : void 0,
|
|
@@ -9275,10 +9276,10 @@ function bc({ el: e }) {
|
|
|
9275
9276
|
{
|
|
9276
9277
|
draggable: !0,
|
|
9277
9278
|
onDragStart: (J) => {
|
|
9278
|
-
J.stopPropagation(),
|
|
9279
|
+
J.stopPropagation(), O(N);
|
|
9279
9280
|
},
|
|
9280
9281
|
onDragEnd: () => {
|
|
9281
|
-
|
|
9282
|
+
O(null), E(null);
|
|
9282
9283
|
},
|
|
9283
9284
|
onMouseDown: (J) => J.stopPropagation(),
|
|
9284
9285
|
onClick: (J) => J.stopPropagation(),
|
|
@@ -9635,13 +9636,13 @@ function Ac(e, o, i, a, l) {
|
|
|
9635
9636
|
const r = [e, e + i / 2, e + i], n = [o, o + a / 2, o + a];
|
|
9636
9637
|
for (const y of l) {
|
|
9637
9638
|
const w = [y.x, y.x + y.width / 2, y.x + y.width], b = [y.y, y.y + y.height / 2, y.y + y.height];
|
|
9638
|
-
for (const
|
|
9639
|
-
const
|
|
9640
|
-
Math.abs(
|
|
9639
|
+
for (const x of r) for (const O of w) {
|
|
9640
|
+
const m = O - x;
|
|
9641
|
+
Math.abs(m) < Math.abs(s) && (s = m, h = m);
|
|
9641
9642
|
}
|
|
9642
|
-
for (const
|
|
9643
|
-
const
|
|
9644
|
-
Math.abs(
|
|
9643
|
+
for (const x of n) for (const O of b) {
|
|
9644
|
+
const m = O - x;
|
|
9645
|
+
Math.abs(m) < Math.abs(f) && (f = m, u = m);
|
|
9645
9646
|
}
|
|
9646
9647
|
}
|
|
9647
9648
|
Math.abs(s) > Lo && (h = 0), Math.abs(f) > Lo && (u = 0);
|
|
@@ -9649,9 +9650,9 @@ function Ac(e, o, i, a, l) {
|
|
|
9649
9650
|
if (h !== 0 || u !== 0) {
|
|
9650
9651
|
const y = [c, c + i / 2, c + i], w = [d, d + a / 2, d + a];
|
|
9651
9652
|
for (const b of l) {
|
|
9652
|
-
const
|
|
9653
|
-
for (const
|
|
9654
|
-
for (const
|
|
9653
|
+
const x = [b.x, b.x + b.width / 2, b.x + b.width], O = [b.y, b.y + b.height / 2, b.y + b.height];
|
|
9654
|
+
for (const m of y) for (const E of x) Math.abs(m - E) < 1 && p.add(Math.round(E));
|
|
9655
|
+
for (const m of w) for (const E of O) Math.abs(m - E) < 1 && g.add(Math.round(E));
|
|
9655
9656
|
}
|
|
9656
9657
|
}
|
|
9657
9658
|
return {
|
|
@@ -9667,47 +9668,47 @@ function Br({ el: e, zoom: o, sectionWidth: i, sectionHeight: a }) {
|
|
|
9667
9668
|
const { selectedId: l, selectElement: s, updateElement: f } = X(), { set: h, clear: u } = ri(), r = l === e.id, n = e.type === "pagebreak", c = e.type === "table", d = ee(null), p = ee(null), g = ee(null);
|
|
9668
9669
|
re(() => {
|
|
9669
9670
|
if (!c || !g.current) return;
|
|
9670
|
-
const
|
|
9671
|
-
const
|
|
9672
|
-
|
|
9671
|
+
const x = new ResizeObserver((O) => {
|
|
9672
|
+
const m = Math.round(O[0].contentRect.height);
|
|
9673
|
+
m > 0 && Math.abs(m - e.height) > 1 && f(e.id, { height: m });
|
|
9673
9674
|
});
|
|
9674
|
-
return
|
|
9675
|
+
return x.observe(g.current), () => x.disconnect();
|
|
9675
9676
|
}, [c, e.id, e.height, f]);
|
|
9676
|
-
const y = (
|
|
9677
|
-
if (
|
|
9678
|
-
d.current = { mx:
|
|
9679
|
-
const
|
|
9677
|
+
const y = (x) => {
|
|
9678
|
+
if (x.stopPropagation(), s(e.id), e.locked) return;
|
|
9679
|
+
d.current = { mx: x.clientX, my: x.clientY, x: e.x, y: e.y };
|
|
9680
|
+
const O = (E) => {
|
|
9680
9681
|
if (!d.current) return;
|
|
9681
9682
|
const S = zo(e.id, n), M = (E.clientY - d.current.my) / o, z = Math.round(d.current.y + M), C = Po(z, e.height, S, a);
|
|
9682
9683
|
if (n)
|
|
9683
9684
|
u(), f(e.id, { x: 0, y: C, width: i });
|
|
9684
9685
|
else {
|
|
9685
|
-
const A = (E.clientX - d.current.mx) / o, R = Ae(Math.round(d.current.x + A), 0, i - e.width), _ = Rc(e.id), { x:
|
|
9686
|
-
h(F, { x:
|
|
9687
|
-
x: Ae(Math.round(
|
|
9686
|
+
const A = (E.clientX - d.current.mx) / o, R = Ae(Math.round(d.current.x + A), 0, i - e.width), _ = Rc(e.id), { x: T, y: D, guides: F } = Ac(R, C, e.width, e.height, _);
|
|
9687
|
+
h(F, { x: T, y: D, w: e.width, h: e.height }), f(e.id, {
|
|
9688
|
+
x: Ae(Math.round(T), 0, i - e.width),
|
|
9688
9689
|
y: Po(Math.round(D), e.height, S, a)
|
|
9689
9690
|
});
|
|
9690
9691
|
}
|
|
9691
|
-
},
|
|
9692
|
-
d.current = null, u(), window.removeEventListener("mousemove",
|
|
9692
|
+
}, m = () => {
|
|
9693
|
+
d.current = null, u(), window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", m);
|
|
9693
9694
|
};
|
|
9694
|
-
window.addEventListener("mousemove",
|
|
9695
|
-
}, w = (
|
|
9696
|
-
|
|
9697
|
-
const
|
|
9695
|
+
window.addEventListener("mousemove", O), window.addEventListener("mouseup", m);
|
|
9696
|
+
}, w = (x, O) => {
|
|
9697
|
+
x.stopPropagation(), x.preventDefault(), p.current = { handle: O, mx: x.clientX, my: x.clientY, x: e.x, y: e.y, w: e.width, h: e.height };
|
|
9698
|
+
const m = (S) => {
|
|
9698
9699
|
if (!p.current) return;
|
|
9699
|
-
const { handle: M, mx: z, my: C, x: A, y: R, w: _, h:
|
|
9700
|
-
let B = A, V = R, L = _, Y =
|
|
9701
|
-
n || (M.includes("e") && (L = Math.max(20, _ + D)), M.includes("w") && (L = Math.max(20, _ - D), B = A + (_ - L))), M.includes("s") && (Y = Math.max(10,
|
|
9700
|
+
const { handle: M, mx: z, my: C, x: A, y: R, w: _, h: T } = p.current, D = (S.clientX - z) / o, F = (S.clientY - C) / o;
|
|
9701
|
+
let B = A, V = R, L = _, Y = T;
|
|
9702
|
+
n || (M.includes("e") && (L = Math.max(20, _ + D)), M.includes("w") && (L = Math.max(20, _ - D), B = A + (_ - L))), M.includes("s") && (Y = Math.max(10, T + F)), M.includes("n") && (Y = Math.max(10, T - F), V = R + (T - Y));
|
|
9702
9703
|
const q = zo(e.id, n);
|
|
9703
9704
|
if (!n)
|
|
9704
9705
|
for (const N of q)
|
|
9705
|
-
M.includes("s") && V < N.y && V + Y > N.y && (Y = N.y - V), M.includes("n") && V + Y > N.y + N.height && V < N.y + N.height && (V = N.y + N.height, Y = R +
|
|
9706
|
+
M.includes("s") && V < N.y && V + Y > N.y && (Y = N.y - V), M.includes("n") && V + Y > N.y + N.height && V < N.y + N.height && (V = N.y + N.height, Y = R + T - V);
|
|
9706
9707
|
B = n ? 0 : Ae(Math.round(B), 0, i - 20), V = Ae(Math.round(V), 0, a - 10), L = n ? i : Ae(Math.round(L), 20, i - B), Y = Ae(Math.round(Y), 10, a - V), f(e.id, { x: B, y: V, width: L, height: Y });
|
|
9707
9708
|
}, E = () => {
|
|
9708
|
-
p.current = null, u(), window.removeEventListener("mousemove",
|
|
9709
|
+
p.current = null, u(), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", E);
|
|
9709
9710
|
};
|
|
9710
|
-
window.addEventListener("mousemove",
|
|
9711
|
+
window.addEventListener("mousemove", m), window.addEventListener("mouseup", E);
|
|
9711
9712
|
}, b = n ? Oc : c ? Mc : jr;
|
|
9712
9713
|
return /* @__PURE__ */ v(
|
|
9713
9714
|
"div",
|
|
@@ -9729,14 +9730,14 @@ function Br({ el: e, zoom: o, sectionWidth: i, sectionHeight: a }) {
|
|
|
9729
9730
|
},
|
|
9730
9731
|
children: [
|
|
9731
9732
|
Tc(e),
|
|
9732
|
-
r && !e.locked && b.map((
|
|
9733
|
+
r && !e.locked && b.map((x) => /* @__PURE__ */ t(
|
|
9733
9734
|
"div",
|
|
9734
9735
|
{
|
|
9735
9736
|
className: "resize-handle",
|
|
9736
|
-
style: { ...
|
|
9737
|
-
onMouseDown: (
|
|
9737
|
+
style: { ...x },
|
|
9738
|
+
onMouseDown: (O) => w(O, x.id)
|
|
9738
9739
|
},
|
|
9739
|
-
|
|
9740
|
+
x.id
|
|
9740
9741
|
))
|
|
9741
9742
|
]
|
|
9742
9743
|
}
|
|
@@ -9842,7 +9843,7 @@ function Nr({
|
|
|
9842
9843
|
}
|
|
9843
9844
|
function Lc() {
|
|
9844
9845
|
var L, Y, q, N, K, P, k, W, j;
|
|
9845
|
-
const { template: e, zoom: o, selectElement: i, addElement: a, activeSection: l } = X(), s = ee(null), f = ee(null), h = ee(null), { guides: u, elBounds: r } = ri(), n = e.page ?? {}, c = n.size ?? "A4", d = n.orientation === "landscape", p = n.margin ?? { top: 0, right: 0, bottom: 0, left: 0 }, [g, y] = Ic[c] ?? [794, 1123], w = d ? y : g, b = d ? g : y,
|
|
9846
|
+
const { template: e, zoom: o, selectElement: i, addElement: a, activeSection: l } = X(), s = ee(null), f = ee(null), h = ee(null), { guides: u, elBounds: r } = ri(), n = e.page ?? {}, c = n.size ?? "A4", d = n.orientation === "landscape", p = n.margin ?? { top: 0, right: 0, bottom: 0, left: 0 }, [g, y] = Ic[c] ?? [794, 1123], w = d ? y : g, b = d ? g : y, x = n.customHeight ?? b, O = p.left ?? 0, m = p.right ?? 0, E = p.top ?? 0, S = p.bottom ?? 0, M = Math.max(100, w - O - m), z = Math.max(200, x - E - S), C = ((L = e.header) == null ? void 0 : L.enabled) !== !1, A = ((Y = e.footer) == null ? void 0 : Y.enabled) !== !1, R = C ? ((q = e.header) == null ? void 0 : q.height) ?? 60 : 0, _ = A ? ((N = e.footer) == null ? void 0 : N.height) ?? 40 : 0, T = Math.max(100, z - R - _), D = (I, oe, te) => (fe) => {
|
|
9846
9847
|
fe.preventDefault();
|
|
9847
9848
|
const je = fe.dataTransfer.getData("application/reportforge");
|
|
9848
9849
|
if (!je) return;
|
|
@@ -9860,25 +9861,25 @@ function Lc() {
|
|
|
9860
9861
|
header: ((K = e.header) == null ? void 0 : K.elements) ?? [],
|
|
9861
9862
|
body: e.body.elements,
|
|
9862
9863
|
footer: ((P = e.footer) == null ? void 0 : P.elements) ?? []
|
|
9863
|
-
}, B = (I) => l === I, V =
|
|
9864
|
-
return /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto canvas-grid", style: { background: "var(--bg)" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "40px 48px 80px", minHeight: "100%" }, children: /* @__PURE__ */ t("div", { style: { width: w * o, height:
|
|
9864
|
+
}, B = (I) => l === I, V = O > 0 || m > 0 || E > 0 || S > 0;
|
|
9865
|
+
return /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto canvas-grid", style: { background: "var(--bg)" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "40px 48px 80px", minHeight: "100%" }, children: /* @__PURE__ */ t("div", { style: { width: w * o, height: x * o, flexShrink: 0 }, children: /* @__PURE__ */ t("div", { style: { transform: `scale(${o})`, transformOrigin: "top left" }, children: /* @__PURE__ */ v("div", { style: {
|
|
9865
9866
|
position: "relative",
|
|
9866
9867
|
width: w,
|
|
9867
|
-
height:
|
|
9868
|
+
height: x,
|
|
9868
9869
|
background: V ? "rgba(241,241,248,1)" : "white",
|
|
9869
9870
|
boxShadow: "0 0 0 1px rgba(0,0,0,0.10), 0 4px 24px rgba(0,0,0,0.18), 0 16px 64px rgba(0,0,0,0.10)"
|
|
9870
9871
|
}, children: [
|
|
9871
|
-
((W = (k = e.page) == null ? void 0 : k.watermark) == null ? void 0 : W.enabled) && e.page.watermark.showOnCanvas && /* @__PURE__ */ t(Pc, { wm: e.page.watermark, pageWidth: w, pageHeight:
|
|
9872
|
+
((W = (k = e.page) == null ? void 0 : k.watermark) == null ? void 0 : W.enabled) && e.page.watermark.showOnCanvas && /* @__PURE__ */ t(Pc, { wm: e.page.watermark, pageWidth: w, pageHeight: x }),
|
|
9872
9873
|
V && /* @__PURE__ */ v("div", { style: { position: "absolute", inset: 0, pointerEvents: "none", zIndex: 50 }, children: [
|
|
9873
|
-
|
|
9874
|
-
|
|
9874
|
+
O > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", top: 0, bottom: 0, left: O, borderLeft: "1px dashed rgba(99,102,241,0.45)" } }),
|
|
9875
|
+
m > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", top: 0, bottom: 0, right: m, borderRight: "1px dashed rgba(99,102,241,0.45)" } }),
|
|
9875
9876
|
E > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", left: 0, right: 0, top: E, borderTop: "1px dashed rgba(99,102,241,0.45)" } }),
|
|
9876
9877
|
S > 0 && /* @__PURE__ */ t("div", { style: { position: "absolute", left: 0, right: 0, bottom: S, borderBottom: "1px dashed rgba(99,102,241,0.45)" } })
|
|
9877
9878
|
] }),
|
|
9878
9879
|
/* @__PURE__ */ v("div", { style: {
|
|
9879
9880
|
position: "absolute",
|
|
9880
9881
|
top: E,
|
|
9881
|
-
left:
|
|
9882
|
+
left: O,
|
|
9882
9883
|
width: M,
|
|
9883
9884
|
background: "white"
|
|
9884
9885
|
}, children: [
|
|
@@ -9915,13 +9916,13 @@ function Lc() {
|
|
|
9915
9916
|
ref: f,
|
|
9916
9917
|
style: {
|
|
9917
9918
|
width: M,
|
|
9918
|
-
height:
|
|
9919
|
+
height: T,
|
|
9919
9920
|
position: "relative",
|
|
9920
9921
|
background: "#ffffff",
|
|
9921
9922
|
outline: B("body") ? "2px solid var(--accent-dim)" : "none",
|
|
9922
9923
|
outlineOffset: -1
|
|
9923
9924
|
},
|
|
9924
|
-
onDrop: B("body") ? D(f, "body",
|
|
9925
|
+
onDrop: B("body") ? D(f, "body", T) : void 0,
|
|
9925
9926
|
onDragOver: B("body") ? (I) => I.preventDefault() : void 0,
|
|
9926
9927
|
onMouseDown: (I) => {
|
|
9927
9928
|
I.target === I.currentTarget && i(null);
|
|
@@ -9935,7 +9936,7 @@ function Lc() {
|
|
|
9935
9936
|
backgroundImage: "radial-gradient(circle, rgba(0,0,0,0.07) 1px, transparent 1px)",
|
|
9936
9937
|
backgroundSize: "20px 20px"
|
|
9937
9938
|
} }),
|
|
9938
|
-
F.body.map((I) => /* @__PURE__ */ t(Br, { el: I, zoom: o, sectionWidth: M, sectionHeight:
|
|
9939
|
+
F.body.map((I) => /* @__PURE__ */ t(Br, { el: I, zoom: o, sectionWidth: M, sectionHeight: T }, I.id)),
|
|
9939
9940
|
B("body") && /* @__PURE__ */ t(Nr, { guides: u, elBounds: r }),
|
|
9940
9941
|
!B("body") && /* @__PURE__ */ t("div", { style: { position: "absolute", inset: 0, background: "rgba(0,0,0,0.07)", zIndex: 10, cursor: "default" } })
|
|
9941
9942
|
]
|
|
@@ -10009,8 +10010,8 @@ async function Bc(e) {
|
|
|
10009
10010
|
try {
|
|
10010
10011
|
p(b.toDataURL("image/png"));
|
|
10011
10012
|
} catch {
|
|
10012
|
-
const
|
|
10013
|
-
p(`data:image/svg+xml;base64,${
|
|
10013
|
+
const x = btoa(unescape(encodeURIComponent(r)));
|
|
10014
|
+
p(`data:image/svg+xml;base64,${x}`);
|
|
10014
10015
|
}
|
|
10015
10016
|
}, y.onerror = () => {
|
|
10016
10017
|
URL.revokeObjectURL(c), g(new Error("img load"));
|
|
@@ -10044,100 +10045,92 @@ function $c({ onClose: e } = {}) {
|
|
|
10044
10045
|
const { template: o, previewData: i, setPreviewData: a } = X(), [l, s] = U({
|
|
10045
10046
|
template: o,
|
|
10046
10047
|
data: Bo(i)
|
|
10047
|
-
}), [f, h] = U(!1), [u, r] = U(""), n = ee(null),
|
|
10048
|
+
}), [f, h] = U(!1), [u, r] = U(""), n = ee(null), c = ee({ template: o, previewData: i });
|
|
10048
10049
|
re(() => {
|
|
10049
|
-
if (!(
|
|
10050
|
-
return
|
|
10050
|
+
if (!(c.current.template === o && c.current.previewData === i))
|
|
10051
|
+
return c.current = { template: o, previewData: i }, n.current && clearTimeout(n.current), n.current = setTimeout(async () => {
|
|
10051
10052
|
const y = Bo(i), w = await Fc(o);
|
|
10052
10053
|
s({ template: w, data: y });
|
|
10053
10054
|
}, 400), () => {
|
|
10054
10055
|
n.current && clearTimeout(n.current);
|
|
10055
10056
|
};
|
|
10056
10057
|
}, [o, i]);
|
|
10057
|
-
const
|
|
10058
|
+
const d = nt(
|
|
10058
10059
|
() => /* @__PURE__ */ t(wi, { template: l.template, data: l.data }),
|
|
10059
10060
|
[l]
|
|
10060
|
-
);
|
|
10061
|
-
return (
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
)
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
|
|
10127
|
-
onChange: (m) => {
|
|
10128
|
-
a(m);
|
|
10129
|
-
try {
|
|
10130
|
-
JSON.parse(m), r("");
|
|
10131
|
-
} catch (T) {
|
|
10132
|
-
r(T.message);
|
|
10133
|
-
}
|
|
10134
|
-
},
|
|
10135
|
-
onClose: () => h(!1)
|
|
10061
|
+
), [{ url: p, loading: g }] = xi({ document: d });
|
|
10062
|
+
return /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ v("div", { className: "flex flex-col h-full", children: [
|
|
10063
|
+
/* @__PURE__ */ v("div", { className: "flex items-center gap-3 shrink-0", style: { padding: "0 16px", height: 52, borderBottom: "1px solid var(--border)", background: "var(--panel)" }, children: [
|
|
10064
|
+
/* @__PURE__ */ t("div", { style: { width: 8, height: 8, borderRadius: "50%", background: "var(--accent)", boxShadow: "0 0 10px var(--accent)", flexShrink: 0 } }),
|
|
10065
|
+
/* @__PURE__ */ t("span", { style: { fontWeight: 600, fontSize: 14, whiteSpace: "nowrap" }, children: "PDF Preview" }),
|
|
10066
|
+
/* @__PURE__ */ t("div", { style: { width: 1, height: 18, background: "var(--border-h)", flexShrink: 0, margin: "0 2px" } }),
|
|
10067
|
+
/* @__PURE__ */ t(
|
|
10068
|
+
"button",
|
|
10069
|
+
{
|
|
10070
|
+
onClick: () => h(!0),
|
|
10071
|
+
style: { padding: "5px 10px", borderRadius: 7, background: "var(--card)", border: "1px solid var(--border)", color: "var(--text-2)", fontSize: 11, fontFamily: "inherit", cursor: "pointer", whiteSpace: "nowrap" },
|
|
10072
|
+
children: "📋 Edit Data"
|
|
10073
|
+
}
|
|
10074
|
+
),
|
|
10075
|
+
g ? /* @__PURE__ */ t("span", { style: { fontSize: 11, color: "var(--warn)", whiteSpace: "nowrap" }, children: "● Rendering…" }) : /* @__PURE__ */ t("span", { style: { fontSize: 11, color: "var(--success)", whiteSpace: "nowrap" }, children: "✓ Ready" }),
|
|
10076
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 } }),
|
|
10077
|
+
p && /* @__PURE__ */ t(
|
|
10078
|
+
"a",
|
|
10079
|
+
{
|
|
10080
|
+
href: p,
|
|
10081
|
+
download: `${l.template.name}.pdf`,
|
|
10082
|
+
style: { padding: "5px 12px", borderRadius: 7, background: "var(--accent)", color: "#fff", fontSize: 12, fontWeight: 500, border: "none", textDecoration: "none", display: "inline-flex", alignItems: "center", whiteSpace: "nowrap" },
|
|
10083
|
+
children: "⬇ Download PDF"
|
|
10084
|
+
}
|
|
10085
|
+
),
|
|
10086
|
+
e && /* @__PURE__ */ t(
|
|
10087
|
+
"button",
|
|
10088
|
+
{
|
|
10089
|
+
onClick: e,
|
|
10090
|
+
style: { width: 28, height: 28, borderRadius: 8, background: "var(--card)", color: "var(--text-2)", border: "1px solid var(--border)", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", flexShrink: 0 },
|
|
10091
|
+
onMouseEnter: (y) => {
|
|
10092
|
+
y.currentTarget.style.background = "var(--hover)", y.currentTarget.style.color = "var(--text-1)";
|
|
10093
|
+
},
|
|
10094
|
+
onMouseLeave: (y) => {
|
|
10095
|
+
y.currentTarget.style.background = "var(--card)", y.currentTarget.style.color = "var(--text-2)";
|
|
10096
|
+
},
|
|
10097
|
+
title: "Close (Esc)",
|
|
10098
|
+
children: /* @__PURE__ */ t(rr, { size: 13 })
|
|
10099
|
+
}
|
|
10100
|
+
)
|
|
10101
|
+
] }),
|
|
10102
|
+
/* @__PURE__ */ v("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
10103
|
+
g && /* @__PURE__ */ t("div", { className: "absolute inset-0 z-10 flex items-center justify-center", style: { background: "rgba(12,12,16,0.45)", backdropFilter: "blur(3px)" }, children: /* @__PURE__ */ t("span", { style: { fontSize: 13, color: "var(--text-2)" }, children: "Rendering PDF…" }) }),
|
|
10104
|
+
p && /* @__PURE__ */ t(
|
|
10105
|
+
"iframe",
|
|
10106
|
+
{
|
|
10107
|
+
src: `${p}#navpanes=0`,
|
|
10108
|
+
width: "100%",
|
|
10109
|
+
height: "100%",
|
|
10110
|
+
style: { border: "none", display: "block" }
|
|
10111
|
+
}
|
|
10112
|
+
)
|
|
10113
|
+
] }),
|
|
10114
|
+
/* @__PURE__ */ t("div", { className: "shrink-0", style: { padding: "6px 16px", borderTop: "1px solid var(--border)", background: "var(--panel)" }, children: /* @__PURE__ */ t("p", { style: { fontSize: 11, color: "var(--text-3)" }, children: "Updates 400ms after last change · Uses your data variables" }) }),
|
|
10115
|
+
f && /* @__PURE__ */ t(
|
|
10116
|
+
Hr,
|
|
10117
|
+
{
|
|
10118
|
+
title: "Edit Preview Data",
|
|
10119
|
+
subtitle: "Edit the data the preview renders with",
|
|
10120
|
+
jsonText: i,
|
|
10121
|
+
jsonError: u,
|
|
10122
|
+
onChange: (y) => {
|
|
10123
|
+
a(y);
|
|
10124
|
+
try {
|
|
10125
|
+
JSON.parse(y), r("");
|
|
10126
|
+
} catch (w) {
|
|
10127
|
+
r(w.message);
|
|
10136
10128
|
}
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10129
|
+
},
|
|
10130
|
+
onClose: () => h(!1)
|
|
10131
|
+
}
|
|
10132
|
+
)
|
|
10133
|
+
] }) });
|
|
10141
10134
|
}
|
|
10142
10135
|
function Wc(e) {
|
|
10143
10136
|
const o = e.replace("#", "");
|
|
@@ -10183,14 +10176,14 @@ function Jc({
|
|
|
10183
10176
|
duplicateSelected: y,
|
|
10184
10177
|
showPreview: w,
|
|
10185
10178
|
togglePreview: b,
|
|
10186
|
-
theme:
|
|
10187
|
-
previewData:
|
|
10188
|
-
loadTemplate:
|
|
10179
|
+
theme: x,
|
|
10180
|
+
previewData: O,
|
|
10181
|
+
loadTemplate: m,
|
|
10189
10182
|
setPreviewData: E,
|
|
10190
10183
|
setTheme: S,
|
|
10191
10184
|
setZoom: M
|
|
10192
|
-
} = c, z = ee(
|
|
10193
|
-
z.current =
|
|
10185
|
+
} = c, z = ee(m);
|
|
10186
|
+
z.current = m;
|
|
10194
10187
|
const C = ee(void 0);
|
|
10195
10188
|
re(() => {
|
|
10196
10189
|
!e || e === C.current || (C.current = e, z.current(e));
|
|
@@ -10199,26 +10192,26 @@ function Jc({
|
|
|
10199
10192
|
}, []);
|
|
10200
10193
|
const A = o === void 0 ? void 0 : typeof o == "string" ? o : JSON.stringify(o, null, 2);
|
|
10201
10194
|
return re(() => {
|
|
10202
|
-
A !== void 0 && A !==
|
|
10203
|
-
}, [A,
|
|
10204
|
-
a && a !==
|
|
10205
|
-
}, [a,
|
|
10206
|
-
document.documentElement.setAttribute("data-theme",
|
|
10207
|
-
}, [
|
|
10195
|
+
A !== void 0 && A !== O && E(A);
|
|
10196
|
+
}, [A, O, E]), re(() => {
|
|
10197
|
+
a && a !== x && S(a);
|
|
10198
|
+
}, [a, x, S]), No(O, i), No(x, l), re(() => {
|
|
10199
|
+
document.documentElement.setAttribute("data-theme", x);
|
|
10200
|
+
}, [x]), re(() => {
|
|
10208
10201
|
const R = (_) => {
|
|
10209
10202
|
if (_.key === "Escape") {
|
|
10210
10203
|
w && b();
|
|
10211
10204
|
return;
|
|
10212
10205
|
}
|
|
10213
|
-
const
|
|
10214
|
-
|
|
10206
|
+
const T = _.target.tagName;
|
|
10207
|
+
T === "INPUT" || T === "TEXTAREA" || T === "SELECT" || ((_.metaKey || _.ctrlKey) && _.key === "z" && (_.preventDefault(), d()), (_.metaKey || _.ctrlKey) && (_.key === "y" || _.shiftKey && _.key === "z") && (_.preventDefault(), p()), (_.metaKey || _.ctrlKey) && _.key === "d" && (_.preventDefault(), y()), (_.key === "Delete" || _.key === "Backspace") && g());
|
|
10215
10208
|
};
|
|
10216
10209
|
return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
|
|
10217
10210
|
}, [d, p, g, y, w, b]), /* @__PURE__ */ v(
|
|
10218
10211
|
"div",
|
|
10219
10212
|
{
|
|
10220
10213
|
className: n,
|
|
10221
|
-
"data-theme":
|
|
10214
|
+
"data-theme": x,
|
|
10222
10215
|
style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, overflow: "hidden", background: "var(--bg)", ...h ? Wc(h) : {}, ...r },
|
|
10223
10216
|
children: [
|
|
10224
10217
|
/* @__PURE__ */ t(Ba, { config: s, elements: f }),
|