@pdfme/ui 6.1.0 → 6.1.1
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/class.d.ts +8 -0
- package/dist/helper.d.ts +13 -0
- package/dist/index.js +341 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/class.d.ts
CHANGED
|
@@ -41,6 +41,10 @@ export declare abstract class BaseUIClass {
|
|
|
41
41
|
start: number;
|
|
42
42
|
end?: number | undefined;
|
|
43
43
|
} | undefined;
|
|
44
|
+
__itemRange?: {
|
|
45
|
+
start: number;
|
|
46
|
+
end?: number | undefined;
|
|
47
|
+
} | undefined;
|
|
44
48
|
__isSplit?: boolean | undefined;
|
|
45
49
|
}[][];
|
|
46
50
|
basePdf: string | ArrayBuffer | Uint8Array<ArrayBuffer> | {
|
|
@@ -66,6 +70,10 @@ export declare abstract class BaseUIClass {
|
|
|
66
70
|
start: number;
|
|
67
71
|
end?: number | undefined;
|
|
68
72
|
} | undefined;
|
|
73
|
+
__itemRange?: {
|
|
74
|
+
start: number;
|
|
75
|
+
end?: number | undefined;
|
|
76
|
+
} | undefined;
|
|
69
77
|
__isSplit?: boolean | undefined;
|
|
70
78
|
}[] | undefined;
|
|
71
79
|
};
|
package/dist/helper.d.ts
CHANGED
|
@@ -35,6 +35,10 @@ export declare const template2SchemasList: (_template: Template) => Promise<{
|
|
|
35
35
|
start: number;
|
|
36
36
|
end?: number | undefined;
|
|
37
37
|
} | undefined;
|
|
38
|
+
__itemRange?: {
|
|
39
|
+
start: number;
|
|
40
|
+
end?: number | undefined;
|
|
41
|
+
} | undefined;
|
|
38
42
|
__isSplit?: boolean | undefined;
|
|
39
43
|
}[][]>;
|
|
40
44
|
export declare const schemasList2template: (schemasList: SchemaForUI[][], basePdf: BasePdf) => Template;
|
|
@@ -69,5 +73,14 @@ export declare const changeSchemas: (args: {
|
|
|
69
73
|
};
|
|
70
74
|
commitSchemas: (newSchemas: SchemaForUI[]) => void;
|
|
71
75
|
}) => void;
|
|
76
|
+
export declare const getDynamicHeightReflowChanges: (args: {
|
|
77
|
+
schemas: SchemaForUI[];
|
|
78
|
+
schema: SchemaForUI;
|
|
79
|
+
height: unknown;
|
|
80
|
+
}) => {
|
|
81
|
+
key: string;
|
|
82
|
+
value: unknown;
|
|
83
|
+
schemaId: string;
|
|
84
|
+
}[];
|
|
72
85
|
export declare const useMaxZoom: () => number;
|
|
73
86
|
export declare const setFontNameRecursively: (obj: Record<string, unknown>, fontName: string, seen?: WeakSet<WeakKey>) => void;
|
package/dist/index.js
CHANGED
|
@@ -9453,7 +9453,7 @@ function parseExpressionAt(input, pos, options) {
|
|
|
9453
9453
|
}
|
|
9454
9454
|
//#endregion
|
|
9455
9455
|
//#region ../common/dist/index.js
|
|
9456
|
-
var PDFME_VERSION = "6.1.
|
|
9456
|
+
var PDFME_VERSION = "6.1.1";
|
|
9457
9457
|
var PT_TO_PX_RATIO = 1.333;
|
|
9458
9458
|
var PT_TO_MM_RATIO = .3528;
|
|
9459
9459
|
var MM_TO_PT_RATIO = 2.8346;
|
|
@@ -9560,7 +9560,18 @@ object$1({
|
|
|
9560
9560
|
"schemas.date.locale": string$1(),
|
|
9561
9561
|
"schemas.select.options": string$1(),
|
|
9562
9562
|
"schemas.select.optionPlaceholder": string$1(),
|
|
9563
|
-
"schemas.radioGroup.groupName": string$1()
|
|
9563
|
+
"schemas.radioGroup.groupName": string$1(),
|
|
9564
|
+
"schemas.list.listStyle": string$1(),
|
|
9565
|
+
"schemas.list.bullet": string$1(),
|
|
9566
|
+
"schemas.list.ordered": string$1(),
|
|
9567
|
+
"schemas.list.markerWidth": string$1(),
|
|
9568
|
+
"schemas.list.markerGap": string$1(),
|
|
9569
|
+
"schemas.list.indentSize": string$1(),
|
|
9570
|
+
"schemas.list.itemSpacing": string$1(),
|
|
9571
|
+
"schemas.list.addItem": string$1(),
|
|
9572
|
+
"schemas.list.removeItem": string$1(),
|
|
9573
|
+
"schemas.list.indentItem": string$1(),
|
|
9574
|
+
"schemas.list.outdentItem": string$1()
|
|
9564
9575
|
});
|
|
9565
9576
|
_enum([
|
|
9566
9577
|
"viewer",
|
|
@@ -9590,6 +9601,10 @@ var Schema$1 = object$1({
|
|
|
9590
9601
|
start: number$1(),
|
|
9591
9602
|
end: number$1().optional()
|
|
9592
9603
|
}).optional(),
|
|
9604
|
+
__itemRange: object$1({
|
|
9605
|
+
start: number$1(),
|
|
9606
|
+
end: number$1().optional()
|
|
9607
|
+
}).optional(),
|
|
9593
9608
|
__isSplit: boolean$1().optional()
|
|
9594
9609
|
}).passthrough();
|
|
9595
9610
|
var SchemaForUIAdditionalInfo = object$1({ id: string$1() });
|
|
@@ -9858,7 +9873,7 @@ function normalizePageSchemas(pageSchemas, paddingTop) {
|
|
|
9858
9873
|
schema: cloneDeep$1(schema),
|
|
9859
9874
|
baseY: localY,
|
|
9860
9875
|
height: schema.height,
|
|
9861
|
-
|
|
9876
|
+
dynamicLayout: { heights: [schema.height] }
|
|
9862
9877
|
});
|
|
9863
9878
|
orderMap.set(schema.name, index);
|
|
9864
9879
|
});
|
|
@@ -9872,20 +9887,21 @@ function normalizePageSchemas(pageSchemas, paddingTop) {
|
|
|
9872
9887
|
};
|
|
9873
9888
|
}
|
|
9874
9889
|
/**
|
|
9875
|
-
* Place
|
|
9890
|
+
* Place height units on pages, splitting across pages as needed.
|
|
9876
9891
|
* @returns The final global Y coordinate after placement
|
|
9877
9892
|
*/
|
|
9878
|
-
function
|
|
9879
|
-
|
|
9893
|
+
function placeUnitsOnPages(schema, dynamicLayout, startGlobalY, contentHeight, paddingTop, pages) {
|
|
9894
|
+
const dynamicHeights = dynamicLayout.heights;
|
|
9895
|
+
let currentUnitIndex = 0;
|
|
9880
9896
|
let currentPageIndex = Math.floor(startGlobalY / contentHeight);
|
|
9881
9897
|
let currentYInPage = startGlobalY % contentHeight;
|
|
9882
9898
|
if (currentYInPage < 0) currentYInPage = 0;
|
|
9883
9899
|
let actualGlobalEndY = 0;
|
|
9884
9900
|
const isSplittable = dynamicHeights.length > 1;
|
|
9885
|
-
while (
|
|
9901
|
+
while (currentUnitIndex < dynamicHeights.length) {
|
|
9886
9902
|
while (pages.length <= currentPageIndex) pages.push([]);
|
|
9887
9903
|
const spaceLeft = contentHeight - currentYInPage;
|
|
9888
|
-
if (dynamicHeights[
|
|
9904
|
+
if (dynamicHeights[currentUnitIndex] > spaceLeft + EPSILON) {
|
|
9889
9905
|
if (!(Math.abs(spaceLeft - contentHeight) <= EPSILON)) {
|
|
9890
9906
|
currentPageIndex++;
|
|
9891
9907
|
currentYInPage = 0;
|
|
@@ -9893,40 +9909,41 @@ function placeRowsOnPages(schema, dynamicHeights, startGlobalY, contentHeight, p
|
|
|
9893
9909
|
}
|
|
9894
9910
|
}
|
|
9895
9911
|
let chunkHeight = 0;
|
|
9896
|
-
const
|
|
9897
|
-
while (
|
|
9898
|
-
const h = dynamicHeights[
|
|
9912
|
+
const startUnitIndex = currentUnitIndex;
|
|
9913
|
+
while (currentUnitIndex < dynamicHeights.length) {
|
|
9914
|
+
const h = dynamicHeights[currentUnitIndex];
|
|
9899
9915
|
if (currentYInPage + chunkHeight + h <= contentHeight + EPSILON) {
|
|
9900
9916
|
chunkHeight += h;
|
|
9901
|
-
|
|
9917
|
+
currentUnitIndex++;
|
|
9902
9918
|
} else break;
|
|
9903
9919
|
}
|
|
9904
9920
|
const isAtPageTop = currentYInPage <= EPSILON;
|
|
9905
|
-
if (isSplittable &&
|
|
9906
|
-
|
|
9921
|
+
if (dynamicLayout.avoidFirstUnitOnly && isSplittable && startUnitIndex === 0 && currentUnitIndex === 1 && dynamicHeights.length > 1 && !isAtPageTop) {
|
|
9922
|
+
currentUnitIndex = 0;
|
|
9907
9923
|
currentPageIndex++;
|
|
9908
9924
|
currentYInPage = 0;
|
|
9909
9925
|
continue;
|
|
9910
9926
|
}
|
|
9911
|
-
if (
|
|
9912
|
-
chunkHeight += dynamicHeights[
|
|
9913
|
-
|
|
9927
|
+
if (currentUnitIndex === startUnitIndex) {
|
|
9928
|
+
chunkHeight += dynamicHeights[currentUnitIndex];
|
|
9929
|
+
currentUnitIndex++;
|
|
9914
9930
|
}
|
|
9931
|
+
const patch = dynamicLayout.patchSplitSchema?.({
|
|
9932
|
+
schema,
|
|
9933
|
+
start: startUnitIndex,
|
|
9934
|
+
end: currentUnitIndex,
|
|
9935
|
+
isSplit: startUnitIndex > 0,
|
|
9936
|
+
chunkHeight
|
|
9937
|
+
}) ?? {};
|
|
9915
9938
|
const newSchema = {
|
|
9916
9939
|
...schema,
|
|
9940
|
+
...patch,
|
|
9917
9941
|
height: chunkHeight,
|
|
9918
9942
|
position: {
|
|
9919
9943
|
...schema.position,
|
|
9920
9944
|
y: currentYInPage + paddingTop
|
|
9921
9945
|
}
|
|
9922
9946
|
};
|
|
9923
|
-
if (isSplittable) {
|
|
9924
|
-
newSchema.__bodyRange = {
|
|
9925
|
-
start: startRowIndex === 0 ? 0 : startRowIndex - 1,
|
|
9926
|
-
end: currentRowIndex - 1
|
|
9927
|
-
};
|
|
9928
|
-
newSchema.__isSplit = startRowIndex > 0;
|
|
9929
|
-
}
|
|
9930
9947
|
pages[currentPageIndex].push(newSchema);
|
|
9931
9948
|
currentYInPage += chunkHeight;
|
|
9932
9949
|
if (currentYInPage >= contentHeight - EPSILON) {
|
|
@@ -9957,12 +9974,19 @@ function processDynamicPage(items, orderMap, contentHeight, paddingTop) {
|
|
|
9957
9974
|
let totalYOffset = 0;
|
|
9958
9975
|
for (const item of items) {
|
|
9959
9976
|
const currentGlobalStartY = item.baseY + totalYOffset;
|
|
9960
|
-
totalYOffset =
|
|
9977
|
+
totalYOffset = placeUnitsOnPages(item.schema, item.dynamicLayout, currentGlobalStartY, contentHeight, paddingTop, pages) - (item.baseY + item.height);
|
|
9961
9978
|
}
|
|
9962
9979
|
sortPagesByOrder(pages, orderMap);
|
|
9963
9980
|
removeTrailingEmptyPages(pages);
|
|
9964
9981
|
return pages;
|
|
9965
9982
|
}
|
|
9983
|
+
var normalizeDynamicLayoutResult = (result) => {
|
|
9984
|
+
const dynamicLayout = Array.isArray(result) ? { heights: result } : result;
|
|
9985
|
+
return {
|
|
9986
|
+
...dynamicLayout,
|
|
9987
|
+
heights: dynamicLayout.heights.length === 0 ? [0] : dynamicLayout.heights
|
|
9988
|
+
};
|
|
9989
|
+
};
|
|
9966
9990
|
/**
|
|
9967
9991
|
* Process a template containing tables with dynamic heights
|
|
9968
9992
|
* and generate a new template with proper page breaks.
|
|
@@ -9994,9 +10018,9 @@ var getDynamicTemplate = async (arg) => {
|
|
|
9994
10018
|
basePdf,
|
|
9995
10019
|
options,
|
|
9996
10020
|
_cache
|
|
9997
|
-
}).then(
|
|
10021
|
+
}).then(normalizeDynamicLayoutResult);
|
|
9998
10022
|
}));
|
|
9999
|
-
for (let j = 0; j < chunkResults.length; j++) items[i + j].
|
|
10023
|
+
for (let j = 0; j < chunkResults.length; j++) items[i + j].dynamicLayout = chunkResults[j];
|
|
10000
10024
|
}
|
|
10001
10025
|
const processedPages = processDynamicPage(items, orderMap, contentHeight, paddingTop);
|
|
10002
10026
|
resultPages.push(...processedPages);
|
|
@@ -81492,7 +81516,18 @@ var dictionaries = {
|
|
|
81492
81516
|
"schemas.date.locale": "Locale",
|
|
81493
81517
|
"schemas.select.options": "Options",
|
|
81494
81518
|
"schemas.select.optionPlaceholder": "Enter an option",
|
|
81495
|
-
"schemas.radioGroup.groupName": "Group Name"
|
|
81519
|
+
"schemas.radioGroup.groupName": "Group Name",
|
|
81520
|
+
"schemas.list.listStyle": "List Style",
|
|
81521
|
+
"schemas.list.bullet": "Bullet",
|
|
81522
|
+
"schemas.list.ordered": "Ordered",
|
|
81523
|
+
"schemas.list.markerWidth": "Marker Width",
|
|
81524
|
+
"schemas.list.markerGap": "Marker Gap",
|
|
81525
|
+
"schemas.list.indentSize": "Indent Size",
|
|
81526
|
+
"schemas.list.itemSpacing": "Item Spacing",
|
|
81527
|
+
"schemas.list.addItem": "Add item",
|
|
81528
|
+
"schemas.list.removeItem": "Remove item",
|
|
81529
|
+
"schemas.list.indentItem": "Indent item",
|
|
81530
|
+
"schemas.list.outdentItem": "Outdent item"
|
|
81496
81531
|
},
|
|
81497
81532
|
zh: {
|
|
81498
81533
|
cancel: "取消",
|
|
@@ -81581,7 +81616,18 @@ var dictionaries = {
|
|
|
81581
81616
|
"schemas.date.locale": " 语言环境",
|
|
81582
81617
|
"schemas.select.options": "选项",
|
|
81583
81618
|
"schemas.select.optionPlaceholder": "请输入选项",
|
|
81584
|
-
"schemas.radioGroup.groupName": "组名"
|
|
81619
|
+
"schemas.radioGroup.groupName": "组名",
|
|
81620
|
+
"schemas.list.listStyle": "列表样式",
|
|
81621
|
+
"schemas.list.bullet": "项目符号",
|
|
81622
|
+
"schemas.list.ordered": "编号",
|
|
81623
|
+
"schemas.list.markerWidth": "标记宽度",
|
|
81624
|
+
"schemas.list.markerGap": "标记间距",
|
|
81625
|
+
"schemas.list.indentSize": "缩进大小",
|
|
81626
|
+
"schemas.list.itemSpacing": "项目间距",
|
|
81627
|
+
"schemas.list.addItem": "添加项目",
|
|
81628
|
+
"schemas.list.removeItem": "删除项目",
|
|
81629
|
+
"schemas.list.indentItem": "增加缩进",
|
|
81630
|
+
"schemas.list.outdentItem": "减少缩进"
|
|
81585
81631
|
},
|
|
81586
81632
|
ja: {
|
|
81587
81633
|
cancel: "キャンセル",
|
|
@@ -81670,7 +81716,18 @@ var dictionaries = {
|
|
|
81670
81716
|
"schemas.date.locale": "ロケール",
|
|
81671
81717
|
"schemas.select.options": "オプション",
|
|
81672
81718
|
"schemas.select.optionPlaceholder": "オプションを入力してください",
|
|
81673
|
-
"schemas.radioGroup.groupName": "グループ名"
|
|
81719
|
+
"schemas.radioGroup.groupName": "グループ名",
|
|
81720
|
+
"schemas.list.listStyle": "リストスタイル",
|
|
81721
|
+
"schemas.list.bullet": "箇条書き",
|
|
81722
|
+
"schemas.list.ordered": "番号付き",
|
|
81723
|
+
"schemas.list.markerWidth": "マーカー幅",
|
|
81724
|
+
"schemas.list.markerGap": "マーカー間隔",
|
|
81725
|
+
"schemas.list.indentSize": "インデント幅",
|
|
81726
|
+
"schemas.list.itemSpacing": "項目間隔",
|
|
81727
|
+
"schemas.list.addItem": "項目を追加",
|
|
81728
|
+
"schemas.list.removeItem": "項目を削除",
|
|
81729
|
+
"schemas.list.indentItem": "インデント",
|
|
81730
|
+
"schemas.list.outdentItem": "インデント解除"
|
|
81674
81731
|
},
|
|
81675
81732
|
ko: {
|
|
81676
81733
|
cancel: "취소",
|
|
@@ -81759,7 +81816,18 @@ var dictionaries = {
|
|
|
81759
81816
|
"schemas.date.locale": " 장소",
|
|
81760
81817
|
"schemas.select.options": "옵션",
|
|
81761
81818
|
"schemas.select.optionPlaceholder": "옵션을 입력하세요",
|
|
81762
|
-
"schemas.radioGroup.groupName": "그룹 이름"
|
|
81819
|
+
"schemas.radioGroup.groupName": "그룹 이름",
|
|
81820
|
+
"schemas.list.listStyle": "목록 스타일",
|
|
81821
|
+
"schemas.list.bullet": "글머리 기호",
|
|
81822
|
+
"schemas.list.ordered": "번호 매기기",
|
|
81823
|
+
"schemas.list.markerWidth": "마커 너비",
|
|
81824
|
+
"schemas.list.markerGap": "마커 간격",
|
|
81825
|
+
"schemas.list.indentSize": "들여쓰기 크기",
|
|
81826
|
+
"schemas.list.itemSpacing": "항목 간격",
|
|
81827
|
+
"schemas.list.addItem": "항목 추가",
|
|
81828
|
+
"schemas.list.removeItem": "항목 삭제",
|
|
81829
|
+
"schemas.list.indentItem": "들여쓰기",
|
|
81830
|
+
"schemas.list.outdentItem": "내어쓰기"
|
|
81763
81831
|
},
|
|
81764
81832
|
ar: {
|
|
81765
81833
|
cancel: "إلغاء",
|
|
@@ -81848,7 +81916,18 @@ var dictionaries = {
|
|
|
81848
81916
|
"schemas.date.locale": "لغة",
|
|
81849
81917
|
"schemas.select.options": "خيارات",
|
|
81850
81918
|
"schemas.select.optionPlaceholder": "أدخل خيارًا",
|
|
81851
|
-
"schemas.radioGroup.groupName": "اسم المجموعة"
|
|
81919
|
+
"schemas.radioGroup.groupName": "اسم المجموعة",
|
|
81920
|
+
"schemas.list.listStyle": "نمط القائمة",
|
|
81921
|
+
"schemas.list.bullet": "نقاط",
|
|
81922
|
+
"schemas.list.ordered": "مرقمة",
|
|
81923
|
+
"schemas.list.markerWidth": "عرض العلامة",
|
|
81924
|
+
"schemas.list.markerGap": "مسافة العلامة",
|
|
81925
|
+
"schemas.list.indentSize": "حجم المسافة البادئة",
|
|
81926
|
+
"schemas.list.itemSpacing": "تباعد العناصر",
|
|
81927
|
+
"schemas.list.addItem": "إضافة عنصر",
|
|
81928
|
+
"schemas.list.removeItem": "حذف عنصر",
|
|
81929
|
+
"schemas.list.indentItem": "زيادة المسافة البادئة",
|
|
81930
|
+
"schemas.list.outdentItem": "تقليل المسافة البادئة"
|
|
81852
81931
|
},
|
|
81853
81932
|
th: {
|
|
81854
81933
|
cancel: "ยกเลิก",
|
|
@@ -81937,7 +82016,18 @@ var dictionaries = {
|
|
|
81937
82016
|
"schemas.date.locale": "สถาน",
|
|
81938
82017
|
"schemas.select.options": "ตัวเลือก",
|
|
81939
82018
|
"schemas.select.optionPlaceholder": "กรอกตัวเลือก",
|
|
81940
|
-
"schemas.radioGroup.groupName": "ชื่อกลุ่ม"
|
|
82019
|
+
"schemas.radioGroup.groupName": "ชื่อกลุ่ม",
|
|
82020
|
+
"schemas.list.listStyle": "รูปแบบรายการ",
|
|
82021
|
+
"schemas.list.bullet": "สัญลักษณ์หัวข้อ",
|
|
82022
|
+
"schemas.list.ordered": "ลำดับเลข",
|
|
82023
|
+
"schemas.list.markerWidth": "ความกว้างเครื่องหมาย",
|
|
82024
|
+
"schemas.list.markerGap": "ระยะห่างเครื่องหมาย",
|
|
82025
|
+
"schemas.list.indentSize": "ขนาดย่อหน้า",
|
|
82026
|
+
"schemas.list.itemSpacing": "ระยะห่างรายการ",
|
|
82027
|
+
"schemas.list.addItem": "เพิ่มรายการ",
|
|
82028
|
+
"schemas.list.removeItem": "ลบรายการ",
|
|
82029
|
+
"schemas.list.indentItem": "เพิ่มย่อหน้า",
|
|
82030
|
+
"schemas.list.outdentItem": "ลดย่อหน้า"
|
|
81941
82031
|
},
|
|
81942
82032
|
it: {
|
|
81943
82033
|
cancel: "Annulla",
|
|
@@ -82026,7 +82116,18 @@ var dictionaries = {
|
|
|
82026
82116
|
"schemas.date.locale": "Locale",
|
|
82027
82117
|
"schemas.select.options": "Opzioni",
|
|
82028
82118
|
"schemas.select.optionPlaceholder": "Inserisci un'opzione",
|
|
82029
|
-
"schemas.radioGroup.groupName": "Nome del Gruppo"
|
|
82119
|
+
"schemas.radioGroup.groupName": "Nome del Gruppo",
|
|
82120
|
+
"schemas.list.listStyle": "Stile elenco",
|
|
82121
|
+
"schemas.list.bullet": "Puntato",
|
|
82122
|
+
"schemas.list.ordered": "Numerato",
|
|
82123
|
+
"schemas.list.markerWidth": "Larghezza indicatore",
|
|
82124
|
+
"schemas.list.markerGap": "Spazio indicatore",
|
|
82125
|
+
"schemas.list.indentSize": "Dimensione rientro",
|
|
82126
|
+
"schemas.list.itemSpacing": "Spaziatura elementi",
|
|
82127
|
+
"schemas.list.addItem": "Aggiungi elemento",
|
|
82128
|
+
"schemas.list.removeItem": "Rimuovi elemento",
|
|
82129
|
+
"schemas.list.indentItem": "Aumenta rientro",
|
|
82130
|
+
"schemas.list.outdentItem": "Riduci rientro"
|
|
82030
82131
|
},
|
|
82031
82132
|
pl: {
|
|
82032
82133
|
cancel: "Anuluj",
|
|
@@ -82115,7 +82216,18 @@ var dictionaries = {
|
|
|
82115
82216
|
"schemas.date.locale": "Widownia",
|
|
82116
82217
|
"schemas.select.options": "Opcje",
|
|
82117
82218
|
"schemas.select.optionPlaceholder": "Wpisz opcję",
|
|
82118
|
-
"schemas.radioGroup.groupName": "Nazwa grupy"
|
|
82219
|
+
"schemas.radioGroup.groupName": "Nazwa grupy",
|
|
82220
|
+
"schemas.list.listStyle": "Styl listy",
|
|
82221
|
+
"schemas.list.bullet": "Punktowana",
|
|
82222
|
+
"schemas.list.ordered": "Numerowana",
|
|
82223
|
+
"schemas.list.markerWidth": "Szerokość znacznika",
|
|
82224
|
+
"schemas.list.markerGap": "Odstęp znacznika",
|
|
82225
|
+
"schemas.list.indentSize": "Rozmiar wcięcia",
|
|
82226
|
+
"schemas.list.itemSpacing": "Odstęp elementów",
|
|
82227
|
+
"schemas.list.addItem": "Dodaj element",
|
|
82228
|
+
"schemas.list.removeItem": "Usuń element",
|
|
82229
|
+
"schemas.list.indentItem": "Zwiększ wcięcie",
|
|
82230
|
+
"schemas.list.outdentItem": "Zmniejsz wcięcie"
|
|
82119
82231
|
},
|
|
82120
82232
|
de: {
|
|
82121
82233
|
cancel: "Abbrechen",
|
|
@@ -82204,7 +82316,18 @@ var dictionaries = {
|
|
|
82204
82316
|
"schemas.date.locale": "Gebietsschema",
|
|
82205
82317
|
"schemas.select.options": "Optionen",
|
|
82206
82318
|
"schemas.select.optionPlaceholder": "Geben Sie eine Option ein",
|
|
82207
|
-
"schemas.radioGroup.groupName": "Gruppenname"
|
|
82319
|
+
"schemas.radioGroup.groupName": "Gruppenname",
|
|
82320
|
+
"schemas.list.listStyle": "Listenstil",
|
|
82321
|
+
"schemas.list.bullet": "Aufzählung",
|
|
82322
|
+
"schemas.list.ordered": "Nummeriert",
|
|
82323
|
+
"schemas.list.markerWidth": "Markerbreite",
|
|
82324
|
+
"schemas.list.markerGap": "Markerabstand",
|
|
82325
|
+
"schemas.list.indentSize": "Einzugsgröße",
|
|
82326
|
+
"schemas.list.itemSpacing": "Elementabstand",
|
|
82327
|
+
"schemas.list.addItem": "Element hinzufügen",
|
|
82328
|
+
"schemas.list.removeItem": "Element entfernen",
|
|
82329
|
+
"schemas.list.indentItem": "Einzug erhöhen",
|
|
82330
|
+
"schemas.list.outdentItem": "Einzug verringern"
|
|
82208
82331
|
},
|
|
82209
82332
|
es: {
|
|
82210
82333
|
cancel: "Cancelar",
|
|
@@ -82293,7 +82416,18 @@ var dictionaries = {
|
|
|
82293
82416
|
"schemas.date.locale": "Lugar",
|
|
82294
82417
|
"schemas.select.options": "Opciones",
|
|
82295
82418
|
"schemas.select.optionPlaceholder": "Ingrese una opción",
|
|
82296
|
-
"schemas.radioGroup.groupName": "Nombre del grupo"
|
|
82419
|
+
"schemas.radioGroup.groupName": "Nombre del grupo",
|
|
82420
|
+
"schemas.list.listStyle": "Estilo de lista",
|
|
82421
|
+
"schemas.list.bullet": "Viñetas",
|
|
82422
|
+
"schemas.list.ordered": "Numerada",
|
|
82423
|
+
"schemas.list.markerWidth": "Ancho del marcador",
|
|
82424
|
+
"schemas.list.markerGap": "Espacio del marcador",
|
|
82425
|
+
"schemas.list.indentSize": "Tamaño de sangría",
|
|
82426
|
+
"schemas.list.itemSpacing": "Espaciado de elementos",
|
|
82427
|
+
"schemas.list.addItem": "Agregar elemento",
|
|
82428
|
+
"schemas.list.removeItem": "Eliminar elemento",
|
|
82429
|
+
"schemas.list.indentItem": "Aumentar sangría",
|
|
82430
|
+
"schemas.list.outdentItem": "Reducir sangría"
|
|
82297
82431
|
},
|
|
82298
82432
|
fr: {
|
|
82299
82433
|
cancel: "Annuler",
|
|
@@ -82382,7 +82516,18 @@ var dictionaries = {
|
|
|
82382
82516
|
"schemas.date.locale": "Lieu",
|
|
82383
82517
|
"schemas.select.options": "Options",
|
|
82384
82518
|
"schemas.select.optionPlaceholder": "Entrez une option",
|
|
82385
|
-
"schemas.radioGroup.groupName": "Nom du groupe"
|
|
82519
|
+
"schemas.radioGroup.groupName": "Nom du groupe",
|
|
82520
|
+
"schemas.list.listStyle": "Style de liste",
|
|
82521
|
+
"schemas.list.bullet": "Puces",
|
|
82522
|
+
"schemas.list.ordered": "Numérotée",
|
|
82523
|
+
"schemas.list.markerWidth": "Largeur du marqueur",
|
|
82524
|
+
"schemas.list.markerGap": "Espacement du marqueur",
|
|
82525
|
+
"schemas.list.indentSize": "Taille du retrait",
|
|
82526
|
+
"schemas.list.itemSpacing": "Espacement des éléments",
|
|
82527
|
+
"schemas.list.addItem": "Ajouter un élément",
|
|
82528
|
+
"schemas.list.removeItem": "Supprimer un élément",
|
|
82529
|
+
"schemas.list.indentItem": "Augmenter le retrait",
|
|
82530
|
+
"schemas.list.outdentItem": "Réduire le retrait"
|
|
82386
82531
|
}
|
|
82387
82532
|
};
|
|
82388
82533
|
var getDict = (lang) => dictionaries[lang] || dictionaries["en"];
|
|
@@ -98333,7 +98478,7 @@ $d636bc798e7178db$export$36b2f24e97d43be($21ee218f84ac7f32$export$2e2bcd8739ae03
|
|
|
98333
98478
|
$d636bc798e7178db$export$36b2f24e97d43be($cd5853a56c68fec7$export$2e2bcd8739ae039);
|
|
98334
98479
|
$d636bc798e7178db$export$36b2f24e97d43be($05f49f930186144e$export$2e2bcd8739ae039);
|
|
98335
98480
|
//#endregion
|
|
98336
|
-
//#region ../schemas/dist/
|
|
98481
|
+
//#region ../schemas/dist/helper-M_MmV_d5.js
|
|
98337
98482
|
var ALIGN_LEFT = "left";
|
|
98338
98483
|
var ALIGN_CENTER = "center";
|
|
98339
98484
|
var ALIGN_RIGHT = "right";
|
|
@@ -98681,6 +98826,8 @@ var filterEndJP = (lines) => {
|
|
|
98681
98826
|
return [...filtered.slice(0, -1), combinedItem];
|
|
98682
98827
|
} else return filtered;
|
|
98683
98828
|
};
|
|
98829
|
+
//#endregion
|
|
98830
|
+
//#region ../schemas/dist/dynamicTemplate-DmuRoTw4.js
|
|
98684
98831
|
function _typeof$18(o) {
|
|
98685
98832
|
"@babel/helpers - typeof";
|
|
98686
98833
|
return _typeof$18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -99226,6 +99373,19 @@ var getDynamicHeightsForTable = async (value, args) => {
|
|
|
99226
99373
|
}
|
|
99227
99374
|
return result;
|
|
99228
99375
|
};
|
|
99376
|
+
var getDynamicLayoutForTable = async (value, args) => {
|
|
99377
|
+
return {
|
|
99378
|
+
heights: await getDynamicHeightsForTable(value, args),
|
|
99379
|
+
avoidFirstUnitOnly: true,
|
|
99380
|
+
patchSplitSchema: ({ start, end, isSplit }) => ({
|
|
99381
|
+
__bodyRange: {
|
|
99382
|
+
start: start === 0 ? 0 : start - 1,
|
|
99383
|
+
end: end - 1
|
|
99384
|
+
},
|
|
99385
|
+
__isSplit: isSplit
|
|
99386
|
+
})
|
|
99387
|
+
};
|
|
99388
|
+
};
|
|
99229
99389
|
//#endregion
|
|
99230
99390
|
//#region ../schemas/dist/utils.js
|
|
99231
99391
|
var convertForPdfLayoutProps = ({ schema, pageHeight, applyRotateTranslate = true }) => {
|
|
@@ -99517,7 +99677,7 @@ var Underline = [["path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }], ["line", {
|
|
|
99517
99677
|
y2: "20"
|
|
99518
99678
|
}]];
|
|
99519
99679
|
//#endregion
|
|
99520
|
-
//#region ../schemas/dist/builtins-
|
|
99680
|
+
//#region ../schemas/dist/builtins-CWHhKSVA.js
|
|
99521
99681
|
var MARKDOWN_ESCAPABLE_CHARS = new Set([
|
|
99522
99682
|
"\\",
|
|
99523
99683
|
"*",
|
|
@@ -101213,6 +101373,20 @@ var changeSchemas = (args) => {
|
|
|
101213
101373
|
return acc;
|
|
101214
101374
|
}, cloneDeep$1(schemas)));
|
|
101215
101375
|
};
|
|
101376
|
+
var getDynamicHeightReflowChanges = (args) => {
|
|
101377
|
+
const { schemas, schema, height } = args;
|
|
101378
|
+
if (schema.type !== "list") return [];
|
|
101379
|
+
const nextHeight = Number(height);
|
|
101380
|
+
if (!Number.isFinite(nextHeight)) return [];
|
|
101381
|
+
const delta = nextHeight - schema.height;
|
|
101382
|
+
if (delta === 0) return [];
|
|
101383
|
+
const baseBottom = schema.position.y + schema.height;
|
|
101384
|
+
return schemas.filter((s) => s.id !== schema.id && s.position.y >= baseBottom).map((s) => ({
|
|
101385
|
+
key: "position.y",
|
|
101386
|
+
value: round$2(s.position.y + delta, 2),
|
|
101387
|
+
schemaId: s.id
|
|
101388
|
+
}));
|
|
101389
|
+
};
|
|
101216
101390
|
var useMaxZoom = () => {
|
|
101217
101391
|
const options = (0, import_react$9.useContext)(OptionsContext);
|
|
101218
101392
|
return options.maxZoom ? options.maxZoom / 100 : 2;
|
|
@@ -234866,6 +235040,105 @@ var Designer = class extends BaseUIClass {
|
|
|
234866
235040
|
}
|
|
234867
235041
|
};
|
|
234868
235042
|
//#endregion
|
|
235043
|
+
//#region ../schemas/dist/lists-B6dmgpkS.js
|
|
235044
|
+
var normalizeListItems = (value) => {
|
|
235045
|
+
if (Array.isArray(value)) return value.map((item) => String(item));
|
|
235046
|
+
if (typeof value !== "string") return value == null ? [] : [String(value)];
|
|
235047
|
+
const trimmed = value.trim();
|
|
235048
|
+
if (!trimmed) return [];
|
|
235049
|
+
try {
|
|
235050
|
+
const parsed = JSON.parse(trimmed);
|
|
235051
|
+
if (Array.isArray(parsed)) return parsed.map((item) => String(item));
|
|
235052
|
+
} catch {}
|
|
235053
|
+
return value.split(/\r\n|\r|\n/g);
|
|
235054
|
+
};
|
|
235055
|
+
var parseListItem = (value) => {
|
|
235056
|
+
const indent = value.match(/^\t+/)?.[0].length ?? 0;
|
|
235057
|
+
return {
|
|
235058
|
+
level: Math.min(indent, 8),
|
|
235059
|
+
text: value.slice(indent)
|
|
235060
|
+
};
|
|
235061
|
+
};
|
|
235062
|
+
var getListMarkers = (schema, items) => {
|
|
235063
|
+
if ((schema.listStyle ?? "bullet") !== "ordered") return items.map(() => "•");
|
|
235064
|
+
const counters = Array.from({ length: 9 }, () => 0);
|
|
235065
|
+
return items.map((rawItem) => {
|
|
235066
|
+
const { level } = parseListItem(rawItem);
|
|
235067
|
+
counters[level] += 1;
|
|
235068
|
+
counters.fill(0, level + 1);
|
|
235069
|
+
return `${counters[level]}.`;
|
|
235070
|
+
});
|
|
235071
|
+
};
|
|
235072
|
+
var calculateListLayout = async (arg) => {
|
|
235073
|
+
const { schema, items, markerItems, startIndex, options, _cache } = arg;
|
|
235074
|
+
const markerWidth = schema.markerWidth ?? 6;
|
|
235075
|
+
const markerGap = schema.markerGap ?? 2;
|
|
235076
|
+
const indentSize = schema.indentSize ?? 6;
|
|
235077
|
+
const font = options.font || getDefaultFont();
|
|
235078
|
+
const fontKitFont = await getFontKitFont(schema.fontName, font, _cache);
|
|
235079
|
+
const fontSize = schema.fontSize ?? 13;
|
|
235080
|
+
const lineHeight = schema.lineHeight ?? 1;
|
|
235081
|
+
const characterSpacing = schema.characterSpacing ?? 0;
|
|
235082
|
+
const itemSpacing = schema.itemSpacing ?? 1;
|
|
235083
|
+
const lineHeightMm = pt2mm(fontSize * lineHeight);
|
|
235084
|
+
const markers = markerItems ? getListMarkers(schema, markerItems).slice(startIndex, startIndex + items.length) : getListMarkers(schema, items);
|
|
235085
|
+
const layoutItems = items.map((rawItem, index) => {
|
|
235086
|
+
const item = parseListItem(rawItem);
|
|
235087
|
+
const markerX = item.level * indentSize;
|
|
235088
|
+
const bodyX = markerX + markerWidth + markerGap;
|
|
235089
|
+
const bodyWidth = Math.max(schema.width - bodyX, 0);
|
|
235090
|
+
const lines = splitTextToSize({
|
|
235091
|
+
value: item.text,
|
|
235092
|
+
characterSpacing,
|
|
235093
|
+
boxWidthInPt: mm2pt(Math.max(bodyWidth, .1)),
|
|
235094
|
+
fontSize,
|
|
235095
|
+
fontKitFont
|
|
235096
|
+
});
|
|
235097
|
+
const height = Math.max(lines.length, 1) * lineHeightMm + (index === items.length - 1 ? 0 : itemSpacing);
|
|
235098
|
+
return {
|
|
235099
|
+
item: item.text,
|
|
235100
|
+
itemIndex: startIndex + index,
|
|
235101
|
+
level: item.level,
|
|
235102
|
+
marker: markers[index],
|
|
235103
|
+
lines,
|
|
235104
|
+
height,
|
|
235105
|
+
markerX,
|
|
235106
|
+
bodyX,
|
|
235107
|
+
bodyWidth
|
|
235108
|
+
};
|
|
235109
|
+
});
|
|
235110
|
+
return {
|
|
235111
|
+
items: layoutItems,
|
|
235112
|
+
totalHeight: layoutItems.reduce((sum, item) => sum + item.height, 0),
|
|
235113
|
+
markerWidth,
|
|
235114
|
+
markerGap,
|
|
235115
|
+
indentSize
|
|
235116
|
+
};
|
|
235117
|
+
};
|
|
235118
|
+
var getDynamicLayoutForList = async (value, args) => {
|
|
235119
|
+
if (args.schema.type !== "list") return { heights: [args.schema.height] };
|
|
235120
|
+
const schema = args.schema;
|
|
235121
|
+
const items = normalizeListItems(value);
|
|
235122
|
+
if (items.length === 0) return { heights: [0] };
|
|
235123
|
+
return {
|
|
235124
|
+
heights: (await calculateListLayout({
|
|
235125
|
+
schema,
|
|
235126
|
+
items,
|
|
235127
|
+
startIndex: 0,
|
|
235128
|
+
options: args.options,
|
|
235129
|
+
_cache: args._cache
|
|
235130
|
+
})).items.map((item) => item.height),
|
|
235131
|
+
avoidFirstUnitOnly: false,
|
|
235132
|
+
patchSplitSchema: ({ start, end, isSplit }) => ({
|
|
235133
|
+
__itemRange: {
|
|
235134
|
+
start,
|
|
235135
|
+
end
|
|
235136
|
+
},
|
|
235137
|
+
__isSplit: isSplit
|
|
235138
|
+
})
|
|
235139
|
+
};
|
|
235140
|
+
};
|
|
235141
|
+
//#endregion
|
|
234869
235142
|
//#region src/components/UnitPager.tsx
|
|
234870
235143
|
var { Text } = Typography;
|
|
234871
235144
|
var icons = {
|
|
@@ -234983,6 +235256,17 @@ var UnitPager = ({ size, unitCursor, unitNum, setUnitCursor }) => {
|
|
|
234983
235256
|
//#endregion
|
|
234984
235257
|
//#region src/components/Preview.tsx
|
|
234985
235258
|
var _cache = /* @__PURE__ */ new Map();
|
|
235259
|
+
var applySchemaChange = (schema, key, value) => {
|
|
235260
|
+
if (key === "position.x") {
|
|
235261
|
+
schema.position.x = value;
|
|
235262
|
+
return;
|
|
235263
|
+
}
|
|
235264
|
+
if (key === "position.y") {
|
|
235265
|
+
schema.position.y = value;
|
|
235266
|
+
return;
|
|
235267
|
+
}
|
|
235268
|
+
schema[key] = value;
|
|
235269
|
+
};
|
|
234986
235270
|
var Preview = ({ template, inputs, size, onChangeInput, onPageChange }) => {
|
|
234987
235271
|
const { token } = theme_default.useToken();
|
|
234988
235272
|
const font = (0, import_react$9.useContext)(FontContext);
|
|
@@ -235031,7 +235315,8 @@ var Preview = ({ template, inputs, size, onChangeInput, onPageChange }) => {
|
|
|
235031
235315
|
_cache,
|
|
235032
235316
|
getDynamicHeights: (value, args) => {
|
|
235033
235317
|
switch (args.schema.type) {
|
|
235034
|
-
case "table": return
|
|
235318
|
+
case "table": return getDynamicLayoutForTable(value, args);
|
|
235319
|
+
case "list": return getDynamicLayoutForList(value, args);
|
|
235035
235320
|
default: return Promise.resolve([args.schema.height]);
|
|
235036
235321
|
}
|
|
235037
235322
|
}
|
|
@@ -235087,14 +235372,23 @@ var Preview = ({ template, inputs, size, onChangeInput, onPageChange }) => {
|
|
|
235087
235372
|
name: schema.name,
|
|
235088
235373
|
value: newValue
|
|
235089
235374
|
});
|
|
235090
|
-
if (schema.type === "table") {
|
|
235375
|
+
if (schema.type === "table" || schema.type === "list") {
|
|
235091
235376
|
isNeedInit = true;
|
|
235092
235377
|
newInputValue = newValue;
|
|
235093
235378
|
}
|
|
235094
235379
|
} else {
|
|
235095
|
-
const
|
|
235380
|
+
const pageSchemas = schemasList[pageCursor] || [];
|
|
235381
|
+
const targetSchema = pageSchemas.find((s) => s.id === schema.id);
|
|
235096
235382
|
if (!targetSchema) return;
|
|
235097
|
-
|
|
235383
|
+
if (_key === "height" && isBlankPdf(template.basePdf)) getDynamicHeightReflowChanges({
|
|
235384
|
+
schemas: pageSchemas,
|
|
235385
|
+
schema: targetSchema,
|
|
235386
|
+
height: value
|
|
235387
|
+
}).forEach(({ key, value, schemaId }) => {
|
|
235388
|
+
const reflowTarget = pageSchemas.find((s) => s.id === schemaId);
|
|
235389
|
+
if (reflowTarget) applySchemaChange(reflowTarget, key, value);
|
|
235390
|
+
});
|
|
235391
|
+
applySchemaChange(targetSchema, _key, value);
|
|
235098
235392
|
}
|
|
235099
235393
|
});
|
|
235100
235394
|
if (isNeedInit && newInputValue !== void 0) init(template, {
|
|
@@ -235148,6 +235442,7 @@ var Preview = ({ template, inputs, size, onChangeInput, onPageChange }) => {
|
|
|
235148
235442
|
pageSizes,
|
|
235149
235443
|
backgrounds,
|
|
235150
235444
|
renderSchema: ({ schema, index }) => {
|
|
235445
|
+
const hasInputValue = Boolean(input && Object.prototype.hasOwnProperty.call(input, schema.name));
|
|
235151
235446
|
const value = schema.readOnly ? replacePlaceholders({
|
|
235152
235447
|
content: schema.content || "",
|
|
235153
235448
|
variables: {
|
|
@@ -235156,13 +235451,13 @@ var Preview = ({ template, inputs, size, onChangeInput, onPageChange }) => {
|
|
|
235156
235451
|
currentPage: index + 1
|
|
235157
235452
|
},
|
|
235158
235453
|
schemas: schemasList
|
|
235159
|
-
}) : String(
|
|
235454
|
+
}) : String(hasInputValue ? input?.[schema.name] ?? "" : "");
|
|
235160
235455
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Renderer, {
|
|
235161
235456
|
schema,
|
|
235162
235457
|
basePdf: template.basePdf,
|
|
235163
235458
|
value,
|
|
235164
235459
|
mode: isForm ? "form" : "viewer",
|
|
235165
|
-
placeholder: schema.content,
|
|
235460
|
+
placeholder: hasInputValue ? void 0 : schema.content,
|
|
235166
235461
|
tabIndex: index + 100,
|
|
235167
235462
|
onChange: (arg) => {
|
|
235168
235463
|
handleOnChangeRenderer(Array.isArray(arg) ? arg : [arg], schema);
|