@pdfme/ui 4.1.0-dev.6 → 4.1.1-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +138 -86
- package/dist/index.umd.js +6 -6
- package/dist/types/contexts.d.ts +4 -1
- package/package.json +1 -1
- package/src/components/Designer/RightSidebar/DetailView/index.tsx +26 -8
- package/src/components/Renderer.tsx +37 -14
- package/src/i18n.ts +34 -1
package/dist/index.es.js
CHANGED
@@ -9291,6 +9291,9 @@ z.object({
|
|
9291
9291
|
"schemas.text.fit": z.string(),
|
9292
9292
|
"schemas.text.dynamicFontSize": z.string(),
|
9293
9293
|
"schemas.text.format": z.string(),
|
9294
|
+
"schemas.mvt.typingInstructions": z.string(),
|
9295
|
+
"schemas.mvt.sampleField": z.string(),
|
9296
|
+
"schemas.mvt.variablesSampleData": z.string(),
|
9294
9297
|
"schemas.barcodes.barColor": z.string(),
|
9295
9298
|
"schemas.barcodes.includetext": z.string(),
|
9296
9299
|
"schemas.table.alternateBackgroundColor": z.string(),
|
@@ -81694,7 +81697,7 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81694
81697
|
opacity: St
|
81695
81698
|
});
|
81696
81699
|
});
|
81697
|
-
}, DEFAULT_OPACITY = 1, HEX_COLOR_PATTERN = "^#(?:[A-Fa-f0-9]{
|
81700
|
+
}, DEFAULT_OPACITY = 1, HEX_COLOR_PATTERN = "^#(?:[A-Fa-f0-9]{6})$", TextStrikethroughIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28c.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85c-.29-.86-1.2-1.28-2.25-1.28c-1.86 0-2.34 1.02-2.34 1.7c0 .48.25.88.74 1.21c.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92zM21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97c0 1-.81 1.67-2.28 1.67c-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58c.81 2.29 3.29 3.3 5.67 3.3c2.27 0 5.3-.89 5.3-4.05c0-.3-.01-1.16-.48-1.94H21V12z" fill="currentColor"></path></svg>', TextUnderlineIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z" fill="currentColor"></path></svg>', TextAlignLeftIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z" fill="currentColor"></path></svg>', TextAlignCenterIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" fill="currentColor"></path></svg>', TextAlignRightIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z" fill="currentColor"></path></svg>', TextVerticalAlignTopIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M8 11h3v10h2V11h3l-4-4l-4 4zM4 3v2h16V3H4z" fill="currentColor"></path></svg>', TextVerticalAlignMiddleIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M8 19h3v4h2v-4h3l-4-4l-4 4zm8-14h-3V1h-2v4H8l4 4l4-4zM4 11v2h16v-2H4z" fill="currentColor"></path></svg>', TextVerticalAlignBottomIcon = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M16 13h-3V3h-2v10H8l4 4l4-4zM4 19v2h16v-2H4z" fill="currentColor"></path></svg>';
|
81698
81701
|
var Formatter;
|
81699
81702
|
(function(a) {
|
81700
81703
|
a.STRIKETHROUGH = "strikethrough", a.UNDERLINE = "underline", a.ALIGNMENT = "alignment", a.VERTICAL_ALIGNMENT = "verticalAlignment";
|
@@ -81861,28 +81864,53 @@ const UseDynamicFontSize = (a) => {
|
|
81861
81864
|
strikethrough: !1,
|
81862
81865
|
underline: !1
|
81863
81866
|
}
|
81864
|
-
},
|
81865
|
-
|
81866
|
-
|
81867
|
-
|
81868
|
-
|
81869
|
-
return "center";
|
81870
|
-
case VERTICAL_ALIGN_BOTTOM:
|
81871
|
-
return "flex-end";
|
81867
|
+
}, uiRender = async (a) => {
|
81868
|
+
const { value: s, schema: $, mode: _, onChange: _e, stopEditing: tt, tabIndex: nt, placeholder: at, options: ot, _cache: rt } = a, st = isEditable(_, $) && at && !s, lt = await buildStyledTextContainer(a, st ? at : s);
|
81869
|
+
if (!isEditable(_, $)) {
|
81870
|
+
lt.innerHTML = s.split("").map((et, it) => `<span style="letter-spacing:${String(s).length === it + 1 ? 0 : "inherit"};">${et}</span>`).join("");
|
81871
|
+
return;
|
81872
81872
|
}
|
81873
|
-
|
81874
|
-
|
81875
|
-
|
81876
|
-
|
81877
|
-
|
81878
|
-
|
81879
|
-
|
81880
|
-
|
81881
|
-
|
81882
|
-
|
81873
|
+
if (makeElementPlainTextContentEditable(lt), lt.tabIndex = nt || 0, lt.innerText = s, lt.addEventListener("blur", (et) => {
|
81874
|
+
_e && _e({ key: "content", value: et.target.innerText }), tt && tt();
|
81875
|
+
}), $.dynamicFontSize) {
|
81876
|
+
let et;
|
81877
|
+
const it = (ot == null ? void 0 : ot.font) || getDefaultFont(), ut = await getFontKitFont($.fontName, it, rt);
|
81878
|
+
lt.addEventListener("keyup", () => {
|
81879
|
+
setTimeout(() => {
|
81880
|
+
(async () => {
|
81881
|
+
if (!lt.textContent)
|
81882
|
+
return;
|
81883
|
+
et = await calculateDynamicFontSize({
|
81884
|
+
textSchema: $,
|
81885
|
+
font: it,
|
81886
|
+
value: lt.textContent,
|
81887
|
+
startingFontSize: et,
|
81888
|
+
_cache: rt
|
81889
|
+
}), lt.style.fontSize = `${et}pt`;
|
81890
|
+
const { topAdj: ft, bottomAdj: ht } = getBrowserVerticalFontAdjustments(ut, et ?? $.fontSize ?? DEFAULT_FONT_SIZE, $.lineHeight ?? DEFAULT_LINE_HEIGHT, $.verticalAlignment ?? DEFAULT_VERTICAL_ALIGNMENT);
|
81891
|
+
lt.style.paddingTop = `${ft}px`, lt.style.marginBottom = `${ht}px`;
|
81892
|
+
})();
|
81893
|
+
}, 0);
|
81894
|
+
});
|
81895
|
+
}
|
81896
|
+
st && (lt.style.color = PLACEHOLDER_FONT_COLOR, lt.addEventListener("focus", () => {
|
81897
|
+
lt.innerText === at && (lt.innerText = "", lt.style.color = $.fontColor ?? DEFAULT_FONT_COLOR);
|
81898
|
+
})), _ === "designer" && setTimeout(() => {
|
81899
|
+
lt.focus();
|
81900
|
+
const et = window.getSelection(), it = document.createRange();
|
81901
|
+
et && it && (it.selectNodeContents(lt), it.collapse(!1), et == null || et.removeAllRanges(), et == null || et.addRange(it));
|
81883
81902
|
});
|
81884
|
-
|
81885
|
-
const
|
81903
|
+
}, buildStyledTextContainer = async (a, s) => {
|
81904
|
+
const { schema: $, rootElement: _, mode: _e, options: tt, _cache: nt } = a, at = (tt == null ? void 0 : tt.font) || getDefaultFont();
|
81905
|
+
let ot;
|
81906
|
+
$.dynamicFontSize && s && (ot = await calculateDynamicFontSize({
|
81907
|
+
textSchema: $,
|
81908
|
+
font: at,
|
81909
|
+
value: s,
|
81910
|
+
startingFontSize: ot,
|
81911
|
+
_cache: nt
|
81912
|
+
}));
|
81913
|
+
const rt = await getFontKitFont($.fontName, at, nt), { topAdj: st, bottomAdj: lt } = getBrowserVerticalFontAdjustments(rt, ot ?? $.fontSize ?? DEFAULT_FONT_SIZE, $.lineHeight ?? DEFAULT_LINE_HEIGHT, $.verticalAlignment ?? DEFAULT_VERTICAL_ALIGNMENT), et = st.toString(), it = lt.toString(), ut = document.createElement("div"), ft = {
|
81886
81914
|
padding: 0,
|
81887
81915
|
resize: "none",
|
81888
81916
|
backgroundColor: getBackgroundColor(s, $),
|
@@ -81894,14 +81922,14 @@ const UseDynamicFontSize = (a) => {
|
|
81894
81922
|
height: "100%",
|
81895
81923
|
cursor: isEditable(_e, $) ? "text" : "default"
|
81896
81924
|
};
|
81897
|
-
Object.assign(
|
81898
|
-
const
|
81899
|
-
$.strikethrough &&
|
81900
|
-
const
|
81925
|
+
Object.assign(ut.style, ft), _.innerHTML = "", _.appendChild(ut);
|
81926
|
+
const ht = [];
|
81927
|
+
$.strikethrough && ht.push("line-through"), $.underline && ht.push("underline");
|
81928
|
+
const dt = {
|
81901
81929
|
// Font formatting styles
|
81902
81930
|
fontFamily: $.fontName ? `'${$.fontName}'` : "inherit",
|
81903
81931
|
color: $.fontColor ? $.fontColor : DEFAULT_FONT_COLOR,
|
81904
|
-
fontSize: `${
|
81932
|
+
fontSize: `${ot ?? $.fontSize ?? DEFAULT_FONT_SIZE}pt`,
|
81905
81933
|
letterSpacing: `${$.characterSpacing ?? DEFAULT_CHARACTER_SPACING}pt`,
|
81906
81934
|
lineHeight: `${$.lineHeight ?? DEFAULT_LINE_HEIGHT}em`,
|
81907
81935
|
textAlign: $.alignment ?? DEFAULT_ALIGNMENT,
|
@@ -81911,48 +81939,36 @@ const UseDynamicFontSize = (a) => {
|
|
81911
81939
|
resize: "none",
|
81912
81940
|
border: "none",
|
81913
81941
|
outline: "none",
|
81914
|
-
marginBottom: `${
|
81915
|
-
paddingTop: `${
|
81942
|
+
marginBottom: `${it}px`,
|
81943
|
+
paddingTop: `${et}px`,
|
81916
81944
|
backgroundColor: "transparent",
|
81917
|
-
textDecoration:
|
81918
|
-
},
|
81919
|
-
|
81920
|
-
|
81921
|
-
|
81922
|
-
|
81923
|
-
|
81924
|
-
|
81925
|
-
|
81926
|
-
|
81927
|
-
|
81928
|
-
|
81929
|
-
|
81930
|
-
|
81931
|
-
|
81932
|
-
|
81933
|
-
|
81934
|
-
|
81935
|
-
|
81936
|
-
|
81937
|
-
|
81938
|
-
|
81939
|
-
|
81940
|
-
|
81941
|
-
|
81942
|
-
|
81943
|
-
|
81944
|
-
At.addEventListener("focus", () => {
|
81945
|
-
At.innerText === ot && (At.innerText = "", At.style.color = $.fontColor ?? DEFAULT_FONT_COLOR);
|
81946
|
-
});
|
81947
|
-
}
|
81948
|
-
pt.appendChild(At), _e === "designer" && setTimeout(() => {
|
81949
|
-
At.focus();
|
81950
|
-
const xt = window.getSelection(), bt = document.createRange();
|
81951
|
-
bt.selectNodeContents(At), bt.collapse(!1), xt == null || xt.removeAllRanges(), xt == null || xt.addRange(bt);
|
81952
|
-
});
|
81953
|
-
} else
|
81954
|
-
At.innerHTML = s.split("").map((xt, bt) => `<span style="letter-spacing:${String(s).length === bt + 1 ? 0 : "inherit"};">${xt}</span>`).join(""), pt.appendChild(At);
|
81955
|
-
}, textSchema = { pdf: pdfRender, ui: uiRender, propPanel }, text = textSchema;
|
81945
|
+
textDecoration: ht.join(" ")
|
81946
|
+
}, gt = document.createElement("div");
|
81947
|
+
return gt.id = "text-" + $.id, Object.assign(gt.style, dt), ut.appendChild(gt), gt;
|
81948
|
+
}, makeElementPlainTextContentEditable = (a) => {
|
81949
|
+
if (!isFirefox()) {
|
81950
|
+
a.contentEditable = "plaintext-only";
|
81951
|
+
return;
|
81952
|
+
}
|
81953
|
+
a.contentEditable = "true", a.addEventListener("keydown", (s) => {
|
81954
|
+
s.key === "Enter" && !s.shiftKey && (s.preventDefault(), document.execCommand("insertLineBreak", !1, void 0));
|
81955
|
+
}), a.addEventListener("paste", (s) => {
|
81956
|
+
var _e;
|
81957
|
+
s.preventDefault();
|
81958
|
+
const $ = (_e = s.clipboardData) == null ? void 0 : _e.getData("text"), _ = window.getSelection();
|
81959
|
+
_ != null && _.rangeCount && (_.deleteFromDocument(), _.getRangeAt(0).insertNode(document.createTextNode($ || "")), _.collapseToEnd());
|
81960
|
+
});
|
81961
|
+
}, mapVerticalAlignToFlex = (a) => {
|
81962
|
+
switch (a) {
|
81963
|
+
case VERTICAL_ALIGN_TOP:
|
81964
|
+
return "flex-start";
|
81965
|
+
case VERTICAL_ALIGN_MIDDLE:
|
81966
|
+
return "center";
|
81967
|
+
case VERTICAL_ALIGN_BOTTOM:
|
81968
|
+
return "flex-end";
|
81969
|
+
}
|
81970
|
+
return "flex-start";
|
81971
|
+
}, getBackgroundColor = (a, s) => !a || !s.backgroundColor ? "transparent" : s.backgroundColor, textSchema = { pdf: pdfRender, ui: uiRender, propPanel }, text = textSchema;
|
81956
81972
|
textSchema.pdf, textSchema.ui, {
|
81957
81973
|
...textSchema.propPanel,
|
81958
81974
|
defaultSchema: {
|
@@ -135160,6 +135176,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135160
135176
|
"schemas.text.fit": "Fit",
|
135161
135177
|
"schemas.text.dynamicFontSize": "Dynamic Font Size",
|
135162
135178
|
"schemas.text.format": "Format",
|
135179
|
+
"schemas.mvt.typingInstructions": "Add variables by typing words surrounded by curly brackets, e.g.",
|
135180
|
+
"schemas.mvt.sampleField": "name",
|
135181
|
+
"schemas.mvt.variablesSampleData": "Variables Sample Data",
|
135163
135182
|
"schemas.barcodes.barColor": "Bar Color",
|
135164
135183
|
"schemas.barcodes.includetext": "Include Text",
|
135165
135184
|
"schemas.table.alternateBackgroundColor": "Alternate Background Color",
|
@@ -135218,6 +135237,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135218
135237
|
"schemas.text.fit": "适应",
|
135219
135238
|
"schemas.text.dynamicFontSize": "动态字体大小",
|
135220
135239
|
"schemas.text.format": "格式",
|
135240
|
+
"schemas.mvt.typingInstructions": "通过输入用花括号括起来的单词来添加变量,例如",
|
135241
|
+
"schemas.mvt.sampleField": "姓名",
|
135242
|
+
"schemas.mvt.variablesSampleData": "变量样本数据",
|
135221
135243
|
"schemas.barcodes.barColor": "条码颜色",
|
135222
135244
|
"schemas.barcodes.includetext": "包括文本",
|
135223
135245
|
"schemas.table.alternateBackgroundColor": "交替背景颜色",
|
@@ -135276,6 +135298,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135276
135298
|
"schemas.text.fit": "フィット",
|
135277
135299
|
"schemas.text.dynamicFontSize": "動的フォントサイズ",
|
135278
135300
|
"schemas.text.format": "書式",
|
135301
|
+
"schemas.mvt.typingInstructions": "中括弧で囲まれた単語を入力して変数を追加します。例:",
|
135302
|
+
"schemas.mvt.sampleField": "名前",
|
135303
|
+
"schemas.mvt.variablesSampleData": "変数サンプルデータ",
|
135279
135304
|
"schemas.barcodes.barColor": "バーの色",
|
135280
135305
|
"schemas.barcodes.includetext": "テキストを含める",
|
135281
135306
|
"schemas.table.alternateBackgroundColor": "交互の背景色",
|
@@ -135334,6 +135359,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135334
135359
|
"schemas.text.fit": "맞춤",
|
135335
135360
|
"schemas.text.dynamicFontSize": "동적 폰트 크기",
|
135336
135361
|
"schemas.text.format": "형식",
|
135362
|
+
"schemas.mvt.typingInstructions": "중괄호로 묶인 단어를 입력하여 변수를 추가하세요.",
|
135363
|
+
"schemas.mvt.sampleField": "이름",
|
135364
|
+
"schemas.mvt.variablesSampleData": "변수 샘플 데이터",
|
135337
135365
|
"schemas.barcodes.barColor": "바코드 색상",
|
135338
135366
|
"schemas.barcodes.includetext": "텍스트 포함",
|
135339
135367
|
"schemas.table.alternateBackgroundColor": "대체 배경색",
|
@@ -135392,6 +135420,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135392
135420
|
"schemas.text.fit": "ملاءمة",
|
135393
135421
|
"schemas.text.dynamicFontSize": "حجم الخط الديناميكي",
|
135394
135422
|
"schemas.text.format": "تنسيق",
|
135423
|
+
"schemas.mvt.typingInstructions": "قم بإضافة المتغيرات عن طريق كتابة الكلمات المحاطة بأقواس متعرجة، على سبيل المثال:",
|
135424
|
+
"schemas.mvt.sampleField": "اسم",
|
135425
|
+
"schemas.mvt.variablesSampleData": "بيانات عينة المتغيرات",
|
135395
135426
|
"schemas.barcodes.barColor": "لون الشريط",
|
135396
135427
|
"schemas.barcodes.includetext": "تضمين النص",
|
135397
135428
|
"schemas.table.alternateBackgroundColor": "لون الخلفية البديل",
|
@@ -135450,6 +135481,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135450
135481
|
"schemas.text.fit": "พอดี",
|
135451
135482
|
"schemas.text.dynamicFontSize": "ขนาดตัวอักษรแบบไดนามิก",
|
135452
135483
|
"schemas.text.format": "รูปแบบ",
|
135484
|
+
"schemas.mvt.typingInstructions": "เพิ่มตัวแปรโดยพิมพ์คำที่ล้อมรอบด้วยวงเล็บปีกกา เช่น",
|
135485
|
+
"schemas.mvt.sampleField": "ชื่อ",
|
135486
|
+
"schemas.mvt.variablesSampleData": "ข้อมูลตัวอย่างตัวแปร",
|
135453
135487
|
"schemas.barcodes.barColor": "สีบาร์",
|
135454
135488
|
"schemas.barcodes.includetext": "รวมข้อความ",
|
135455
135489
|
"schemas.table.alternateBackgroundColor": "สีพื้นหลังสลับกัน",
|
@@ -135508,6 +135542,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135508
135542
|
"schemas.text.fit": "Adatta",
|
135509
135543
|
"schemas.text.dynamicFontSize": "Dimensione font dinamica",
|
135510
135544
|
"schemas.text.format": "Formato",
|
135545
|
+
"schemas.mvt.typingInstructions": "Aggiungi variabili digitando parole circondate da parentesi graffe, ad es.",
|
135546
|
+
"schemas.mvt.sampleField": "nome",
|
135547
|
+
"schemas.mvt.variablesSampleData": "Dati di esempio variabili",
|
135511
135548
|
"schemas.barcodes.barColor": "Colore barra",
|
135512
135549
|
"schemas.barcodes.includetext": "Includi testo",
|
135513
135550
|
"schemas.table.alternateBackgroundColor": "Colore di Sfondo Alternato",
|
@@ -135566,6 +135603,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135566
135603
|
"schemas.text.fit": "Dopasowanie",
|
135567
135604
|
"schemas.text.dynamicFontSize": "Dynamiczny rozmiar czcionki",
|
135568
135605
|
"schemas.text.format": "Format",
|
135606
|
+
"schemas.mvt.typingInstructions": "Dodaj zmienne, wpisując słowa ujęte w nawiasy klamrowe, np.",
|
135607
|
+
"schemas.mvt.sampleField": "nazwa",
|
135608
|
+
"schemas.mvt.variablesSampleData": "Zmienne Przykładowe dane",
|
135569
135609
|
"schemas.barcodes.barColor": "Kolor paska",
|
135570
135610
|
"schemas.barcodes.includetext": "Dołącz tekst",
|
135571
135611
|
"schemas.table.alternateBackgroundColor": "Alternatywny kolor tła",
|
@@ -135624,6 +135664,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135624
135664
|
"schemas.text.fit": "Anpassen",
|
135625
135665
|
"schemas.text.dynamicFontSize": "Dynamische Schriftgröße",
|
135626
135666
|
"schemas.text.format": "Format",
|
135667
|
+
"schemas.mvt.typingInstructions": "Fügen Sie Variablen hinzu, indem Sie Wörter in geschweiften Klammern eingeben, z. B.",
|
135668
|
+
"schemas.mvt.sampleField": "Name",
|
135669
|
+
"schemas.mvt.variablesSampleData": "Variablen Beispieldaten",
|
135627
135670
|
"schemas.barcodes.barColor": "Strichcodefarbe",
|
135628
135671
|
"schemas.barcodes.includetext": "Text anzeigen",
|
135629
135672
|
"schemas.table.alternateBackgroundColor": "Wechselnde Hintergrundfarbe",
|
@@ -135682,6 +135725,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135682
135725
|
"schemas.text.fit": "Ajustar",
|
135683
135726
|
"schemas.text.dynamicFontSize": "Tamaño de fuente dinámico",
|
135684
135727
|
"schemas.text.format": "Formato",
|
135728
|
+
"schemas.mvt.typingInstructions": "Agregue variables escribiendo palabras entre llaves, p.",
|
135729
|
+
"schemas.mvt.sampleField": "nombre",
|
135730
|
+
"schemas.mvt.variablesSampleData": "Variables Datos de muestra",
|
135685
135731
|
"schemas.barcodes.barColor": "Color de la barra",
|
135686
135732
|
"schemas.barcodes.includetext": "Incluir texto",
|
135687
135733
|
"schemas.table.alternateBackgroundColor": "Color de fondo alternativo",
|
@@ -135740,6 +135786,9 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135740
135786
|
"schemas.text.fit": "Ajustement",
|
135741
135787
|
"schemas.text.dynamicFontSize": "Taille de police dynamique",
|
135742
135788
|
"schemas.text.format": "Format",
|
135789
|
+
"schemas.mvt.typingInstructions": "Ajoutez des variables en tapant des mots entourés d'accolades, par ex.",
|
135790
|
+
"schemas.mvt.sampleField": "nom",
|
135791
|
+
"schemas.mvt.variablesSampleData": "Variables Exemples de données",
|
135743
135792
|
"schemas.barcodes.barColor": "Couleur de la barre",
|
135744
135793
|
"schemas.barcodes.includetext": "Inclure le texte",
|
135745
135794
|
"schemas.table.alternateBackgroundColor": "Couleur de fond alternative",
|
@@ -151838,13 +151887,17 @@ const FormRender = withProvider(FormCore, defaultWidgets), svgBaseProp = {
|
|
151838
151887
|
pt.x = pt.position.x, pt.y = pt.position.y, delete pt.position, pt.key !== (at.getValues() || {}).key && at.resetFields(), at.setValues(pt);
|
151839
151888
|
}, [at, tt]);
|
151840
151889
|
const it = (pt) => {
|
151841
|
-
|
151890
|
+
let mt = [];
|
151842
151891
|
for (let ct in pt)
|
151843
|
-
if (!["id", "content"].includes(ct) && pt[ct] !== tt[ct]) {
|
151892
|
+
if (!["id", "content"].includes(ct) && (ct === "x" && (ct = "position.x"), ct === "y" && (ct = "position.y"), pt[ct] !== tt[ct])) {
|
151844
151893
|
let vt = pt[ct];
|
151845
|
-
vt === null && ["rotate", "opacity"].includes(ct) && (vt = void 0),
|
151894
|
+
vt === null && ["rotate", "opacity"].includes(ct) && (vt = void 0), mt.push({ key: ct, value: vt, schemaId: tt.id });
|
151846
151895
|
}
|
151847
|
-
mt.length && _(mt)
|
151896
|
+
mt.length && at.validateFields().then(() => _(mt)).catch((ct) => {
|
151897
|
+
ct.errorFields.length && (mt = mt.filter((vt) => !ct.errorFields.find(
|
151898
|
+
(At) => At.name.includes(vt.key)
|
151899
|
+
))), mt.length && _(mt);
|
151900
|
+
});
|
151848
151901
|
}, ut = Object.values(rt).find(
|
151849
151902
|
(pt) => (pt == null ? void 0 : pt.propPanel.defaultSchema.type) === tt.type
|
151850
151903
|
), ft = ut == null ? void 0 : ut.propPanel.schema;
|
@@ -151863,9 +151916,9 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
|
|
151863
151916
|
widget: "select",
|
151864
151917
|
props: { options: ht },
|
151865
151918
|
required: !0,
|
151866
|
-
span:
|
151919
|
+
span: 12
|
151867
151920
|
},
|
151868
|
-
key: { title: ot("fieldName"), type: "string", required: !0, span:
|
151921
|
+
key: { title: ot("fieldName"), type: "string", required: !0, span: 12 },
|
151869
151922
|
"-": { type: "void", widget: "Divider" },
|
151870
151923
|
align: { title: ot("align"), type: "void", widget: "AlignWidget" },
|
151871
151924
|
x: { title: "X", type: "number", widget: "inputNumber", required: !0, span: 8, min: 0 },
|
@@ -152019,7 +152072,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
|
|
152019
152072
|
] })
|
152020
152073
|
}
|
152021
152074
|
);
|
152022
|
-
}, RightSidebar = Sidebar, Wrapper = ({
|
152075
|
+
}, RightSidebar = Sidebar, useRerenderDependencies = ({ plugin: a, value: s, mode: $, scale: _, schema: _e, options: tt }) => reactExports.useMemo(() => a.uninterruptedEditMode && $ === "designer" ? [$] : [s, $, _, JSON.stringify(_e), JSON.stringify(tt)], [s, $, _, _e, tt]), Wrapper = ({
|
152023
152076
|
children: a,
|
152024
152077
|
outline: s,
|
152025
152078
|
onChangeHoveringSchemaId: $,
|
@@ -152046,19 +152099,18 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
|
|
152046
152099
|
children: a
|
152047
152100
|
}
|
152048
152101
|
), Renderer = (a) => {
|
152049
|
-
const s = reactExports.useContext(PluginsRegistry), $ = reactExports.useContext(OptionsContext), _ = reactExports.useContext(I18nContext), { token: _e } = theme.useToken(), { schema: tt, basePdf: nt, value: at, mode: ot, onChange: rt, stopEditing: st, tabIndex: lt, placeholder: et, scale: it } = a, ut = reactExports.useRef(null), ft = reactExports.useRef(/* @__PURE__ */ new Map())
|
152102
|
+
const s = reactExports.useContext(PluginsRegistry), $ = reactExports.useContext(OptionsContext), _ = reactExports.useContext(I18nContext), { token: _e } = theme.useToken(), { schema: tt, basePdf: nt, value: at, mode: ot, onChange: rt, stopEditing: st, tabIndex: lt, placeholder: et, scale: it } = a, ut = reactExports.useRef(null), ft = reactExports.useRef(/* @__PURE__ */ new Map()), ht = Object.values(s).find(
|
152103
|
+
(gt) => (gt == null ? void 0 : gt.propPanel.defaultSchema.type) === tt.type
|
152104
|
+
);
|
152105
|
+
if (!ht || !ht.ui)
|
152106
|
+
return console.error(`[@pdfme/ui] Renderer for type ${tt.type} not found.
|
152107
|
+
Check this document: https://pdfme.com/docs/custom-schemas`), /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
152108
|
+
const dt = useRerenderDependencies({ plugin: ht, value: at, mode: ot, scale: it, schema: tt, options: $ });
|
152050
152109
|
return reactExports.useEffect(() => {
|
152051
|
-
var ht;
|
152052
152110
|
if (ut.current && tt.type) {
|
152053
|
-
|
152054
|
-
|
152055
|
-
|
152056
|
-
if (!dt) {
|
152057
|
-
console.error(`[@pdfme/ui] Renderer for type ${tt.type} not found.
|
152058
|
-
Check this document: https://pdfme.com/docs/custom-schemas`);
|
152059
|
-
return;
|
152060
|
-
}
|
152061
|
-
ut.current.innerHTML = "", dt({
|
152111
|
+
ut.current.innerHTML = "";
|
152112
|
+
const gt = ht.ui;
|
152113
|
+
gt({
|
152062
152114
|
key: tt.key,
|
152063
152115
|
value: at,
|
152064
152116
|
schema: tt,
|
@@ -152079,7 +152131,7 @@ Check this document: https://pdfme.com/docs/custom-schemas`);
|
|
152079
152131
|
return () => {
|
152080
152132
|
ut.current && (ut.current.innerHTML = "");
|
152081
152133
|
};
|
152082
|
-
},
|
152134
|
+
}, dt), /* @__PURE__ */ jsxRuntimeExports.jsx(Wrapper, { ...a, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { height: "100%", width: "100%" }, ref: ut }) });
|
152083
152135
|
}, Renderer$1 = Renderer, Draggable$1 = (a) => {
|
152084
152136
|
const { scale: s, basePdf: $, plugin: _ } = a, { token: _e } = theme.useToken(), tt = _.propPanel.defaultSchema, nt = useDraggable({ id: tt.type, data: tt }), { listeners: at, setNodeRef: ot, attributes: rt, transform: st, isDragging: lt } = nt, et = { transform: CSS$1.Translate.toString(st) };
|
152085
152137
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: ot, style: et, ...at, ...rt, children: [
|