@pdfme/ui 4.0.2-dev.1 → 4.0.2-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 +157 -69
- package/dist/index.umd.js +4 -4
- package/dist/types/components/Designer/RightSidebar/DetailView/ButtonGroupWidget.d.ts +4 -0
- package/dist/types/contexts.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/Designer/RightSidebar/DetailView/ButtonGroupWidget.tsx +70 -0
- package/src/components/Designer/RightSidebar/DetailView/index.tsx +3 -1
- package/src/i18n.ts +12 -1
package/dist/index.es.js
CHANGED
@@ -9290,6 +9290,7 @@ z.object({
|
|
9290
9290
|
"schemas.text.max": z.string(),
|
9291
9291
|
"schemas.text.fit": z.string(),
|
9292
9292
|
"schemas.text.dynamicFontSize": z.string(),
|
9293
|
+
"schemas.text.format": z.string(),
|
9293
9294
|
"schemas.barcodes.barColor": z.string(),
|
9294
9295
|
"schemas.barcodes.includetext": z.string(),
|
9295
9296
|
"schemas.table.alternateBackgroundColor": z.string(),
|
@@ -81654,17 +81655,37 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81654
81655
|
}
|
81655
81656
|
const It = { x: bt + vt / 2, y: ct - mm2pt(nt.position.y) - At / 2 };
|
81656
81657
|
wt.forEach((yt, Rt) => {
|
81657
|
-
const kt = widthOfTextAtSize(yt, lt, it, gt), jt = dt * it * Rt;
|
81658
|
-
let
|
81659
|
-
ft === "center" ?
|
81660
|
-
let
|
81658
|
+
const kt = widthOfTextAtSize(yt, lt, it, gt), jt = heightOfFontAtSize(lt, it), Ht = dt * it * Rt;
|
81659
|
+
let Ft = bt;
|
81660
|
+
ft === "center" ? Ft += (vt - kt) / 2 : ft === "right" && (Ft += vt - kt);
|
81661
|
+
let _t = ct - mm2pt(nt.position.y) - Ct - Ht;
|
81662
|
+
if (nt.strikethrough && kt > 0) {
|
81663
|
+
const Nt = Ft + kt + 1, Mt = _t + jt / 3;
|
81664
|
+
_e.drawLine({
|
81665
|
+
start: rotatePoint({ x: Ft, y: Mt }, It, xt.angle),
|
81666
|
+
end: rotatePoint({ x: Nt, y: Mt }, It, xt.angle),
|
81667
|
+
thickness: 1 / 12 * it,
|
81668
|
+
color: ut,
|
81669
|
+
opacity: St
|
81670
|
+
});
|
81671
|
+
}
|
81672
|
+
if (nt.underline && kt > 0) {
|
81673
|
+
const Nt = Ft + kt + 1, Mt = _t - jt / 12;
|
81674
|
+
_e.drawLine({
|
81675
|
+
start: rotatePoint({ x: Ft, y: Mt }, It, xt.angle),
|
81676
|
+
end: rotatePoint({ x: Nt, y: Mt }, It, xt.angle),
|
81677
|
+
thickness: 1 / 12 * it,
|
81678
|
+
color: ut,
|
81679
|
+
opacity: St
|
81680
|
+
});
|
81681
|
+
}
|
81661
81682
|
if (xt.angle !== 0) {
|
81662
|
-
const
|
81663
|
-
|
81683
|
+
const Nt = rotatePoint({ x: Ft, y: _t }, It, xt.angle);
|
81684
|
+
Ft = Nt.x, _t = Nt.y;
|
81664
81685
|
}
|
81665
81686
|
_e.drawText(yt, {
|
81666
|
-
x:
|
81667
|
-
y:
|
81687
|
+
x: Ft,
|
81688
|
+
y: _t,
|
81668
81689
|
rotate: xt,
|
81669
81690
|
size: it,
|
81670
81691
|
color: ut,
|
@@ -81673,7 +81694,45 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81673
81694
|
opacity: St
|
81674
81695
|
});
|
81675
81696
|
});
|
81676
|
-
}, DEFAULT_OPACITY = 1, HEX_COLOR_PATTERN = "^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$",
|
81697
|
+
}, DEFAULT_OPACITY = 1, HEX_COLOR_PATTERN = "^#(?:[A-Fa-f0-9]{3,4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$", 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
|
+
var Formatter;
|
81699
|
+
(function(a) {
|
81700
|
+
a.STRIKETHROUGH = "strikethrough", a.UNDERLINE = "underline", a.ALIGNMENT = "alignment", a.VERTICAL_ALIGNMENT = "verticalAlignment";
|
81701
|
+
})(Formatter || (Formatter = {}));
|
81702
|
+
function getExtraFormatterSchema(a) {
|
81703
|
+
const s = [
|
81704
|
+
{ key: Formatter.STRIKETHROUGH, icon: TextStrikethroughIcon, type: "boolean" },
|
81705
|
+
{ key: Formatter.UNDERLINE, icon: TextUnderlineIcon, type: "boolean" },
|
81706
|
+
{ key: Formatter.ALIGNMENT, icon: TextAlignLeftIcon, type: "select", value: DEFAULT_ALIGNMENT },
|
81707
|
+
{ key: Formatter.ALIGNMENT, icon: TextAlignCenterIcon, type: "select", value: ALIGN_CENTER },
|
81708
|
+
{ key: Formatter.ALIGNMENT, icon: TextAlignRightIcon, type: "select", value: ALIGN_RIGHT },
|
81709
|
+
{
|
81710
|
+
key: Formatter.VERTICAL_ALIGNMENT,
|
81711
|
+
icon: TextVerticalAlignTopIcon,
|
81712
|
+
type: "select",
|
81713
|
+
value: DEFAULT_VERTICAL_ALIGNMENT
|
81714
|
+
},
|
81715
|
+
{
|
81716
|
+
key: Formatter.VERTICAL_ALIGNMENT,
|
81717
|
+
icon: TextVerticalAlignMiddleIcon,
|
81718
|
+
type: "select",
|
81719
|
+
value: VERTICAL_ALIGN_MIDDLE
|
81720
|
+
},
|
81721
|
+
{
|
81722
|
+
key: Formatter.VERTICAL_ALIGNMENT,
|
81723
|
+
icon: TextVerticalAlignBottomIcon,
|
81724
|
+
type: "select",
|
81725
|
+
value: VERTICAL_ALIGN_BOTTOM
|
81726
|
+
}
|
81727
|
+
];
|
81728
|
+
return {
|
81729
|
+
title: a("schemas.text.format"),
|
81730
|
+
widget: "ButtonGroup",
|
81731
|
+
buttons: s,
|
81732
|
+
span: 16
|
81733
|
+
};
|
81734
|
+
}
|
81735
|
+
const UseDynamicFontSize = (a) => {
|
81677
81736
|
const { rootElement: s, changeSchemas: $, activeSchema: _, i18n: _e } = a, tt = document.createElement("input");
|
81678
81737
|
tt.type = "checkbox", tt.checked = !!(_ != null && _.dynamicFontSize), tt.onchange = (at) => {
|
81679
81738
|
const ot = at.target.checked ? {
|
@@ -81712,32 +81771,7 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81712
81771
|
span: 6,
|
81713
81772
|
props: { min: 0 }
|
81714
81773
|
},
|
81715
|
-
|
81716
|
-
title: $("schemas.text.textAlign"),
|
81717
|
-
type: "string",
|
81718
|
-
widget: "select",
|
81719
|
-
props: {
|
81720
|
-
options: [
|
81721
|
-
{ label: $("schemas.left"), value: DEFAULT_ALIGNMENT },
|
81722
|
-
{ label: $("schemas.center"), value: ALIGN_CENTER },
|
81723
|
-
{ label: $("schemas.right"), value: ALIGN_RIGHT }
|
81724
|
-
]
|
81725
|
-
},
|
81726
|
-
span: 8
|
81727
|
-
},
|
81728
|
-
verticalAlignment: {
|
81729
|
-
title: $("schemas.text.verticalAlign"),
|
81730
|
-
type: "string",
|
81731
|
-
widget: "select",
|
81732
|
-
props: {
|
81733
|
-
options: [
|
81734
|
-
{ label: $("schemas.top"), value: VERTICAL_ALIGN_TOP },
|
81735
|
-
{ label: $("schemas.middle"), value: VERTICAL_ALIGN_MIDDLE },
|
81736
|
-
{ label: $("schemas.bottom"), value: VERTICAL_ALIGN_BOTTOM }
|
81737
|
-
]
|
81738
|
-
},
|
81739
|
-
span: 8
|
81740
|
-
},
|
81774
|
+
formatter: getExtraFormatterSchema($),
|
81741
81775
|
lineHeight: {
|
81742
81776
|
title: $("schemas.text.lineHeight"),
|
81743
81777
|
type: "number",
|
@@ -81823,7 +81857,9 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81823
81857
|
fontColor: DEFAULT_FONT_COLOR,
|
81824
81858
|
fontName: void 0,
|
81825
81859
|
backgroundColor: "",
|
81826
|
-
opacity: DEFAULT_OPACITY
|
81860
|
+
opacity: DEFAULT_OPACITY,
|
81861
|
+
strikethrough: !1,
|
81862
|
+
underline: !1
|
81827
81863
|
}
|
81828
81864
|
}, mapVerticalAlignToFlex = (a) => {
|
81829
81865
|
switch (a) {
|
@@ -81838,10 +81874,10 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81838
81874
|
}, getBackgroundColor = (a, s) => !a || !s.backgroundColor ? "transparent" : s.backgroundColor, uiRender = async (a) => {
|
81839
81875
|
const { value: s, schema: $, rootElement: _, mode: _e, onChange: tt, stopEditing: nt, tabIndex: at, placeholder: ot, options: rt, _cache: st } = a, lt = (rt == null ? void 0 : rt.font) || getDefaultFont();
|
81840
81876
|
let et;
|
81841
|
-
const it = (
|
81877
|
+
const it = (xt) => ({
|
81842
81878
|
textSchema: $,
|
81843
81879
|
font: lt,
|
81844
|
-
value:
|
81880
|
+
value: xt,
|
81845
81881
|
startingFontSize: et,
|
81846
81882
|
_cache: st
|
81847
81883
|
});
|
@@ -81859,7 +81895,9 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81859
81895
|
cursor: isEditable(_e, $) ? "text" : "default"
|
81860
81896
|
};
|
81861
81897
|
Object.assign(pt.style, mt), _.innerHTML = "", _.appendChild(pt);
|
81862
|
-
const ct =
|
81898
|
+
const ct = [];
|
81899
|
+
$.strikethrough && ct.push("line-through"), $.underline && ct.push("underline");
|
81900
|
+
const vt = {
|
81863
81901
|
// Font formatting styles
|
81864
81902
|
fontFamily: $.fontName ? `'${$.fontName}'` : "inherit",
|
81865
81903
|
color: $.fontColor ? $.fontColor : DEFAULT_FONT_COLOR,
|
@@ -81875,44 +81913,45 @@ const convertForPdfLayoutProps = ({ schema: a, pageHeight: s, applyRotateTransla
|
|
81875
81913
|
outline: "none",
|
81876
81914
|
marginBottom: `${gt}px`,
|
81877
81915
|
paddingTop: `${dt}px`,
|
81878
|
-
backgroundColor: "transparent"
|
81879
|
-
|
81880
|
-
|
81881
|
-
|
81882
|
-
|
81883
|
-
|
81884
|
-
|
81885
|
-
|
81886
|
-
|
81887
|
-
bt
|
81888
|
-
|
81889
|
-
|
81890
|
-
|
81916
|
+
backgroundColor: "transparent",
|
81917
|
+
textDecoration: ct.join(" ")
|
81918
|
+
}, At = document.createElement("div");
|
81919
|
+
if (Object.assign(At.style, vt), isEditable(_e, $)) {
|
81920
|
+
if (isFirefox() ? (At.contentEditable = "true", At.addEventListener("keydown", (xt) => {
|
81921
|
+
xt.key === "Enter" && !xt.shiftKey && (xt.preventDefault(), document.execCommand("insertLineBreak", !1, void 0));
|
81922
|
+
}), At.addEventListener("paste", (xt) => {
|
81923
|
+
var St;
|
81924
|
+
xt.preventDefault();
|
81925
|
+
const bt = (St = xt.clipboardData) == null ? void 0 : St.getData("text"), Et = window.getSelection();
|
81926
|
+
Et != null && Et.rangeCount && (Et.deleteFromDocument(), Et.getRangeAt(0).insertNode(document.createTextNode(bt || "")), Et.collapseToEnd());
|
81927
|
+
})) : At.contentEditable = "plaintext-only", At.tabIndex = at || 0, At.innerText = s, At.addEventListener("blur", (xt) => {
|
81928
|
+
tt && tt({ key: "content", value: xt.target.innerText }), nt && nt();
|
81929
|
+
}), $.dynamicFontSize && At.addEventListener("keyup", () => {
|
81891
81930
|
setTimeout(() => {
|
81892
81931
|
(async () => {
|
81893
|
-
if (!
|
81932
|
+
if (!At.textContent)
|
81894
81933
|
return;
|
81895
|
-
et = await calculateDynamicFontSize(it(
|
81896
|
-
const { topAdj:
|
81897
|
-
|
81934
|
+
et = await calculateDynamicFontSize(it(At.textContent)), At.style.fontSize = `${et}pt`;
|
81935
|
+
const { topAdj: xt, bottomAdj: bt } = getBrowserVerticalFontAdjustments(ut, et ?? $.fontSize ?? DEFAULT_FONT_SIZE, $.lineHeight ?? DEFAULT_LINE_HEIGHT, $.verticalAlignment ?? DEFAULT_VERTICAL_ALIGNMENT);
|
81936
|
+
At.style.paddingTop = `${xt}px`, At.style.marginBottom = `${bt}px`;
|
81898
81937
|
})();
|
81899
81938
|
}, 0);
|
81900
81939
|
}), ot && !s) {
|
81901
|
-
if (
|
81902
|
-
const
|
81903
|
-
|
81940
|
+
if (At.innerText = ot, At.style.color = PLACEHOLDER_FONT_COLOR, $.dynamicFontSize) {
|
81941
|
+
const xt = await calculateDynamicFontSize(it(ot));
|
81942
|
+
At.style.fontSize = `${xt}pt`;
|
81904
81943
|
}
|
81905
|
-
|
81906
|
-
|
81944
|
+
At.addEventListener("focus", () => {
|
81945
|
+
At.innerText === ot && (At.innerText = "", At.style.color = $.fontColor ?? DEFAULT_FONT_COLOR);
|
81907
81946
|
});
|
81908
81947
|
}
|
81909
|
-
pt.appendChild(
|
81910
|
-
|
81911
|
-
const
|
81912
|
-
|
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);
|
81913
81952
|
});
|
81914
81953
|
} else
|
81915
|
-
|
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);
|
81916
81955
|
}, textSchema = { pdf: pdfRender, ui: uiRender, propPanel }, text = textSchema;
|
81917
81956
|
textSchema.pdf, textSchema.ui, {
|
81918
81957
|
...textSchema.propPanel,
|
@@ -135120,6 +135159,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135120
135159
|
"schemas.text.max": "Max",
|
135121
135160
|
"schemas.text.fit": "Fit",
|
135122
135161
|
"schemas.text.dynamicFontSize": "Dynamic Font Size",
|
135162
|
+
"schemas.text.format": "Format",
|
135123
135163
|
"schemas.barcodes.barColor": "Bar Color",
|
135124
135164
|
"schemas.barcodes.includetext": "Include Text",
|
135125
135165
|
"schemas.table.alternateBackgroundColor": "Alternate Background Color",
|
@@ -135177,6 +135217,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135177
135217
|
"schemas.text.max": "最大",
|
135178
135218
|
"schemas.text.fit": "适应",
|
135179
135219
|
"schemas.text.dynamicFontSize": "动态字体大小",
|
135220
|
+
"schemas.text.format": "格式",
|
135180
135221
|
"schemas.barcodes.barColor": "条码颜色",
|
135181
135222
|
"schemas.barcodes.includetext": "包括文本",
|
135182
135223
|
"schemas.table.alternateBackgroundColor": "交替背景颜色",
|
@@ -135234,6 +135275,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135234
135275
|
"schemas.text.max": "最大",
|
135235
135276
|
"schemas.text.fit": "フィット",
|
135236
135277
|
"schemas.text.dynamicFontSize": "動的フォントサイズ",
|
135278
|
+
"schemas.text.format": "書式",
|
135237
135279
|
"schemas.barcodes.barColor": "バーの色",
|
135238
135280
|
"schemas.barcodes.includetext": "テキストを含める",
|
135239
135281
|
"schemas.table.alternateBackgroundColor": "交互の背景色",
|
@@ -135291,6 +135333,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135291
135333
|
"schemas.text.max": "최대",
|
135292
135334
|
"schemas.text.fit": "맞춤",
|
135293
135335
|
"schemas.text.dynamicFontSize": "동적 폰트 크기",
|
135336
|
+
"schemas.text.format": "형식",
|
135294
135337
|
"schemas.barcodes.barColor": "바코드 색상",
|
135295
135338
|
"schemas.barcodes.includetext": "텍스트 포함",
|
135296
135339
|
"schemas.table.alternateBackgroundColor": "대체 배경색",
|
@@ -135348,6 +135391,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135348
135391
|
"schemas.text.max": "الحد الأقصى",
|
135349
135392
|
"schemas.text.fit": "ملاءمة",
|
135350
135393
|
"schemas.text.dynamicFontSize": "حجم الخط الديناميكي",
|
135394
|
+
"schemas.text.format": "تنسيق",
|
135351
135395
|
"schemas.barcodes.barColor": "لون الشريط",
|
135352
135396
|
"schemas.barcodes.includetext": "تضمين النص",
|
135353
135397
|
"schemas.table.alternateBackgroundColor": "لون الخلفية البديل",
|
@@ -135405,6 +135449,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135405
135449
|
"schemas.text.max": "สูงสุด",
|
135406
135450
|
"schemas.text.fit": "พอดี",
|
135407
135451
|
"schemas.text.dynamicFontSize": "ขนาดตัวอักษรแบบไดนามิก",
|
135452
|
+
"schemas.text.format": "รูปแบบ",
|
135408
135453
|
"schemas.barcodes.barColor": "สีบาร์",
|
135409
135454
|
"schemas.barcodes.includetext": "รวมข้อความ",
|
135410
135455
|
"schemas.table.alternateBackgroundColor": "สีพื้นหลังสลับกัน",
|
@@ -135462,6 +135507,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135462
135507
|
"schemas.text.max": "Massimo",
|
135463
135508
|
"schemas.text.fit": "Adatta",
|
135464
135509
|
"schemas.text.dynamicFontSize": "Dimensione font dinamica",
|
135510
|
+
"schemas.text.format": "Formato",
|
135465
135511
|
"schemas.barcodes.barColor": "Colore barra",
|
135466
135512
|
"schemas.barcodes.includetext": "Includi testo",
|
135467
135513
|
"schemas.table.alternateBackgroundColor": "Colore di Sfondo Alternato",
|
@@ -135519,6 +135565,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135519
135565
|
"schemas.text.max": "Maksimum",
|
135520
135566
|
"schemas.text.fit": "Dopasowanie",
|
135521
135567
|
"schemas.text.dynamicFontSize": "Dynamiczny rozmiar czcionki",
|
135568
|
+
"schemas.text.format": "Format",
|
135522
135569
|
"schemas.barcodes.barColor": "Kolor paska",
|
135523
135570
|
"schemas.barcodes.includetext": "Dołącz tekst",
|
135524
135571
|
"schemas.table.alternateBackgroundColor": "Alternatywny kolor tła",
|
@@ -135576,6 +135623,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135576
135623
|
"schemas.text.max": "Max",
|
135577
135624
|
"schemas.text.fit": "Anpassen",
|
135578
135625
|
"schemas.text.dynamicFontSize": "Dynamische Schriftgröße",
|
135626
|
+
"schemas.text.format": "Format",
|
135579
135627
|
"schemas.barcodes.barColor": "Strichcodefarbe",
|
135580
135628
|
"schemas.barcodes.includetext": "Text anzeigen",
|
135581
135629
|
"schemas.table.alternateBackgroundColor": "Wechselnde Hintergrundfarbe",
|
@@ -135633,6 +135681,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135633
135681
|
"schemas.text.max": "Máx",
|
135634
135682
|
"schemas.text.fit": "Ajustar",
|
135635
135683
|
"schemas.text.dynamicFontSize": "Tamaño de fuente dinámico",
|
135684
|
+
"schemas.text.format": "Formato",
|
135636
135685
|
"schemas.barcodes.barColor": "Color de la barra",
|
135637
135686
|
"schemas.barcodes.includetext": "Incluir texto",
|
135638
135687
|
"schemas.table.alternateBackgroundColor": "Color de fondo alternativo",
|
@@ -135657,7 +135706,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135657
135706
|
fieldsList: "Liste des champs",
|
135658
135707
|
editField: "Éditer le champ",
|
135659
135708
|
type: "Type",
|
135660
|
-
errorOccurred: "
|
135709
|
+
errorOccurred: "Une erreur est survenue",
|
135661
135710
|
errorBulkUpdateFieldName: "Impossible de confirmer le changement car le nombre d'éléments a changé.",
|
135662
135711
|
commitBulkUpdateFieldName: "Confirmer les changements",
|
135663
135712
|
bulkUpdateFieldName: "Modifier les noms de champs en masse",
|
@@ -135690,6 +135739,7 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135690
135739
|
"schemas.text.max": "Max",
|
135691
135740
|
"schemas.text.fit": "Ajustement",
|
135692
135741
|
"schemas.text.dynamicFontSize": "Taille de police dynamique",
|
135742
|
+
"schemas.text.format": "Format",
|
135693
135743
|
"schemas.barcodes.barColor": "Couleur de la barre",
|
135694
135744
|
"schemas.barcodes.includetext": "Inclure le texte",
|
135695
135745
|
"schemas.table.alternateBackgroundColor": "Couleur de fond alternative",
|
@@ -151721,12 +151771,50 @@ const FormRender = withProvider(FormCore, defaultWidgets), svgBaseProp = {
|
|
151721
151771
|
return reactExports.useEffect(() => (_.current && (_.current.innerHTML = "", s({ ...$, rootElement: _.current })), () => {
|
151722
151772
|
_.current && (_.current.innerHTML = "");
|
151723
151773
|
}), [a.activeSchema]), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: _ });
|
151724
|
-
}, WidgetRenderer$1 = WidgetRenderer,
|
151774
|
+
}, WidgetRenderer$1 = WidgetRenderer, ButtonGroupWidget = (a) => {
|
151775
|
+
const { activeElements: s, changeSchemas: $, schemas: _, schema: _e } = a, tt = (ot) => {
|
151776
|
+
const rt = ot.key, st = ot.type, lt = s.map((it) => it.id), et = _.filter((it) => lt.includes(it.id));
|
151777
|
+
$(
|
151778
|
+
et.map((it) => {
|
151779
|
+
const ut = it[rt] ?? !1, ft = st === "boolean" ? !ut : ot.value;
|
151780
|
+
return { key: rt, value: ft, schemaId: it.id };
|
151781
|
+
})
|
151782
|
+
);
|
151783
|
+
}, nt = (ot) => {
|
151784
|
+
const rt = ot.key, st = ot.type;
|
151785
|
+
let lt = !1;
|
151786
|
+
const et = s.map((ut) => ut.id);
|
151787
|
+
return _.filter((ut) => et.includes(ut.id)).forEach((ut) => {
|
151788
|
+
lt = st === "boolean" ? ut[rt] ?? !1 : ut[rt] === ot.value;
|
151789
|
+
}), lt;
|
151790
|
+
}, at = (ot) => {
|
151791
|
+
const rt = `data:image/svg+xml;utf8,${encodeURIComponent(ot)}`;
|
151792
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { width: 17, height: 17, src: rt });
|
151793
|
+
};
|
151794
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Form$3.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button$2.Group, { children: _e.buttons.map((ot, rt) => {
|
151795
|
+
const st = nt(ot);
|
151796
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
151797
|
+
Button$2,
|
151798
|
+
{
|
151799
|
+
type: st ? "primary" : void 0,
|
151800
|
+
ghost: st,
|
151801
|
+
onClick: () => tt(ot),
|
151802
|
+
style: {
|
151803
|
+
padding: 7,
|
151804
|
+
zIndex: st ? 2 : 0
|
151805
|
+
},
|
151806
|
+
icon: at(ot.icon)
|
151807
|
+
},
|
151808
|
+
rt
|
151809
|
+
);
|
151810
|
+
}) }) });
|
151811
|
+
}, ButtonGroupWidget$1 = ButtonGroupWidget, { Text: Text$2 } = Typography$1, DetailView = (a) => {
|
151725
151812
|
const { token: s } = theme.useToken(), { size: $, changeSchemas: _, deselectSchema: _e, activeSchema: tt, activeElements: nt } = a, at = useForm(), ot = reactExports.useContext(I18nContext), rt = reactExports.useContext(PluginsRegistry), st = reactExports.useContext(OptionsContext), [lt, et] = reactExports.useState({});
|
151726
151813
|
reactExports.useEffect(() => {
|
151727
151814
|
const pt = {
|
151728
151815
|
AlignWidget: (mt) => /* @__PURE__ */ jsxRuntimeExports.jsx(AlignWidget$1, { ...mt, ...a, options: st }),
|
151729
|
-
Divider: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$1, { style: { marginTop: s.marginXS, marginBottom: s.marginXS } })
|
151816
|
+
Divider: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Divider$1, { style: { marginTop: s.marginXS, marginBottom: s.marginXS } }),
|
151817
|
+
ButtonGroup: (mt) => /* @__PURE__ */ jsxRuntimeExports.jsx(ButtonGroupWidget$1, { ...mt, ...a, options: st })
|
151730
151818
|
};
|
151731
151819
|
for (const mt of Object.values(rt)) {
|
151732
151820
|
const ct = (mt == null ? void 0 : mt.propPanel.widgets) || {};
|