@pdfme/ui 5.0.0 → 5.1.1-dev.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/index.es.js +76 -14
- package/dist/index.umd.js +4 -4
- package/dist/types/Form.d.ts +3 -0
- package/dist/types/class.d.ts +1 -1
- package/dist/types/contexts.d.ts +5 -1
- package/package.json +3 -2
- package/src/Form.tsx +31 -0
- package/src/class.ts +2 -2
- package/src/i18n.ts +61 -10
package/dist/index.es.js
CHANGED
@@ -9241,6 +9241,7 @@ const langs = ["en", "zh", "ja", "ko", "ar", "th", "pl", "it", "de", "es", "fr"]
|
|
9241
9241
|
z.object({
|
9242
9242
|
// -----------------used in ui-----------------
|
9243
9243
|
cancel: z.string(),
|
9244
|
+
close: z.string(),
|
9244
9245
|
field: z.string(),
|
9245
9246
|
fieldName: z.string(),
|
9246
9247
|
align: z.string(),
|
@@ -9304,7 +9305,10 @@ z.object({
|
|
9304
9305
|
"schemas.table.tableStyle": z.string(),
|
9305
9306
|
"schemas.table.headStyle": z.string(),
|
9306
9307
|
"schemas.table.bodyStyle": z.string(),
|
9307
|
-
"schemas.table.columnStyle": z.string()
|
9308
|
+
"schemas.table.columnStyle": z.string(),
|
9309
|
+
"schemas.date.format": z.string(),
|
9310
|
+
"schemas.select.options": z.string(),
|
9311
|
+
"schemas.select.optionPlaceholder": z.string()
|
9308
9312
|
});
|
9309
9313
|
z.enum(["viewer", "form", "designer"]);
|
9310
9314
|
const ColorType = z.enum(["rgb", "cmyk"]).optional();
|
@@ -9348,7 +9352,7 @@ const SchemaPageArray = z.array(z.array(Schema$1)), Template = z.object({
|
|
9348
9352
|
creationDate: z.date().optional(),
|
9349
9353
|
creator: z.string().optional(),
|
9350
9354
|
keywords: z.array(z.string()).optional(),
|
9351
|
-
|
9355
|
+
lang: Lang.optional(),
|
9352
9356
|
modificationDate: z.date().optional(),
|
9353
9357
|
producer: z.string().optional(),
|
9354
9358
|
subject: z.string().optional(),
|
@@ -82545,7 +82549,7 @@ const UseDynamicFontSize = (a) => {
|
|
82545
82549
|
backgroundColor: "transparent",
|
82546
82550
|
textDecoration: ht.join(" ")
|
82547
82551
|
}, gt = document.createElement("div");
|
82548
|
-
return gt.id = "text-" + $.id, Object.assign(gt.style, dt), ut.appendChild(gt), gt;
|
82552
|
+
return gt.id = "text-" + String($.id), Object.assign(gt.style, dt), ut.appendChild(gt), gt;
|
82549
82553
|
}, makeElementPlainTextContentEditable = (a) => {
|
82550
82554
|
if (!isFirefox()) {
|
82551
82555
|
a.contentEditable = "plaintext-only";
|
@@ -135203,6 +135207,7 @@ var MinusOutlined = function a(s, $) {
|
|
135203
135207
|
};
|
135204
135208
|
const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined), dictEn = {
|
135205
135209
|
cancel: "Cancel",
|
135210
|
+
close: "Close",
|
135206
135211
|
field: "field",
|
135207
135212
|
fieldName: "Name",
|
135208
135213
|
align: "Align",
|
@@ -135264,9 +135269,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135264
135269
|
"schemas.table.tableStyle": "Table Style",
|
135265
135270
|
"schemas.table.headStyle": "Header Style",
|
135266
135271
|
"schemas.table.bodyStyle": "Body Style",
|
135267
|
-
"schemas.table.columnStyle": "Column Style"
|
135272
|
+
"schemas.table.columnStyle": "Column Style",
|
135273
|
+
"schemas.date.format": "Date Format",
|
135274
|
+
"schemas.select.options": "Options",
|
135275
|
+
"schemas.select.optionPlaceholder": "Enter an option"
|
135268
135276
|
}, dictZh = {
|
135269
135277
|
cancel: "取消",
|
135278
|
+
close: "关闭",
|
135270
135279
|
field: "字段",
|
135271
135280
|
fieldName: "名称",
|
135272
135281
|
align: "对齐",
|
@@ -135328,9 +135337,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135328
135337
|
"schemas.table.tableStyle": "表格样式",
|
135329
135338
|
"schemas.table.headStyle": "表头样式",
|
135330
135339
|
"schemas.table.bodyStyle": "表体样式",
|
135331
|
-
"schemas.table.columnStyle": "列样式"
|
135340
|
+
"schemas.table.columnStyle": "列样式",
|
135341
|
+
"schemas.date.format": "日期格式",
|
135342
|
+
"schemas.select.options": "选项",
|
135343
|
+
"schemas.select.optionPlaceholder": "请输入选项"
|
135332
135344
|
}, dictJa = {
|
135333
135345
|
cancel: "キャンセル",
|
135346
|
+
close: "閉じる",
|
135334
135347
|
field: "入力項目",
|
135335
135348
|
fieldName: "項目名",
|
135336
135349
|
align: "整列",
|
@@ -135392,9 +135405,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135392
135405
|
"schemas.table.tableStyle": "テーブルスタイル",
|
135393
135406
|
"schemas.table.headStyle": "ヘッダースタイル",
|
135394
135407
|
"schemas.table.bodyStyle": "ボディスタイル",
|
135395
|
-
"schemas.table.columnStyle": "カラムスタイル"
|
135408
|
+
"schemas.table.columnStyle": "カラムスタイル",
|
135409
|
+
"schemas.date.format": "日付形式",
|
135410
|
+
"schemas.select.options": "オプション",
|
135411
|
+
"schemas.select.optionPlaceholder": "オプションを入力してください"
|
135396
135412
|
}, dictKo = {
|
135397
135413
|
cancel: "취소",
|
135414
|
+
close: "닫기",
|
135398
135415
|
field: "필드",
|
135399
135416
|
fieldName: "이름",
|
135400
135417
|
align: "정렬",
|
@@ -135456,9 +135473,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135456
135473
|
"schemas.table.tableStyle": "테이블 스타일",
|
135457
135474
|
"schemas.table.headStyle": "헤더 스타일",
|
135458
135475
|
"schemas.table.bodyStyle": "본문 스타일",
|
135459
|
-
"schemas.table.columnStyle": "열 스타일"
|
135476
|
+
"schemas.table.columnStyle": "열 스타일",
|
135477
|
+
"schemas.date.format": "날짜 형식",
|
135478
|
+
"schemas.select.options": "옵션",
|
135479
|
+
"schemas.select.optionPlaceholder": "옵션을 입력하세요"
|
135460
135480
|
}, dictAr = {
|
135461
135481
|
cancel: "إلغاء",
|
135482
|
+
close: "إغلاق",
|
135462
135483
|
field: "الحقل",
|
135463
135484
|
fieldName: "اسم الحقل",
|
135464
135485
|
align: "محاذاة",
|
@@ -135520,9 +135541,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135520
135541
|
"schemas.table.tableStyle": "أسلوب الجدول",
|
135521
135542
|
"schemas.table.headStyle": "أسلوب الرأس",
|
135522
135543
|
"schemas.table.bodyStyle": "أسلوب الجسم",
|
135523
|
-
"schemas.table.columnStyle": "أسلوب العمود"
|
135544
|
+
"schemas.table.columnStyle": "أسلوب العمود",
|
135545
|
+
"schemas.date.format": "تنسيق التاريخ",
|
135546
|
+
"schemas.select.options": "خيارات",
|
135547
|
+
"schemas.select.optionPlaceholder": "أدخل خيارًا"
|
135524
135548
|
}, dictTh = {
|
135525
135549
|
cancel: "ยกเลิก",
|
135550
|
+
close: "ปิด",
|
135526
135551
|
field: "ฟิลด์",
|
135527
135552
|
fieldName: "ชื่อฟิลด์",
|
135528
135553
|
align: "จัดเรียง",
|
@@ -135584,9 +135609,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135584
135609
|
"schemas.table.tableStyle": "สไตล์ตาราง",
|
135585
135610
|
"schemas.table.headStyle": "สไตล์หัวข้อ",
|
135586
135611
|
"schemas.table.bodyStyle": "สไตล์เนื้อหา",
|
135587
|
-
"schemas.table.columnStyle": "สไตล์คอลัมน์"
|
135612
|
+
"schemas.table.columnStyle": "สไตล์คอลัมน์",
|
135613
|
+
"schemas.date.format": "รูปแบบวันที่",
|
135614
|
+
"schemas.select.options": "ตัวเลือก",
|
135615
|
+
"schemas.select.optionPlaceholder": "กรอกตัวเลือก"
|
135588
135616
|
}, dictIt = {
|
135589
135617
|
cancel: "Annulla",
|
135618
|
+
close: "Chiudi",
|
135590
135619
|
field: "Campo",
|
135591
135620
|
fieldName: "Nome",
|
135592
135621
|
align: "Allinea",
|
@@ -135648,9 +135677,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135648
135677
|
"schemas.table.tableStyle": "Stile della Tabella",
|
135649
135678
|
"schemas.table.headStyle": "Stile dell'Intestazione",
|
135650
135679
|
"schemas.table.bodyStyle": "Stile del Corpo",
|
135651
|
-
"schemas.table.columnStyle": "Stile della Colonna"
|
135680
|
+
"schemas.table.columnStyle": "Stile della Colonna",
|
135681
|
+
"schemas.date.format": "Formato data",
|
135682
|
+
"schemas.select.options": "Opzioni",
|
135683
|
+
"schemas.select.optionPlaceholder": "Inserisci un'opzione"
|
135652
135684
|
}, dictPl = {
|
135653
135685
|
cancel: "Anuluj",
|
135686
|
+
close: "Zamknij",
|
135654
135687
|
field: "pole",
|
135655
135688
|
fieldName: "Klucz pola",
|
135656
135689
|
align: "Wyrównanie",
|
@@ -135712,9 +135745,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135712
135745
|
"schemas.table.tableStyle": "Styl tabeli",
|
135713
135746
|
"schemas.table.headStyle": "Styl nagłówka",
|
135714
135747
|
"schemas.table.bodyStyle": "Styl ciała",
|
135715
|
-
"schemas.table.columnStyle": "Styl kolumny"
|
135748
|
+
"schemas.table.columnStyle": "Styl kolumny",
|
135749
|
+
"schemas.date.format": "Format daty",
|
135750
|
+
"schemas.select.options": "Opcje",
|
135751
|
+
"schemas.select.optionPlaceholder": "Wpisz opcję"
|
135716
135752
|
}, dictDe = {
|
135717
135753
|
cancel: "Abbrechen",
|
135754
|
+
close: "Schließen",
|
135718
135755
|
field: "Feld",
|
135719
135756
|
fieldName: "Name",
|
135720
135757
|
align: "Ausrichten",
|
@@ -135776,9 +135813,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135776
135813
|
"schemas.table.tableStyle": "Tabellenstil",
|
135777
135814
|
"schemas.table.headStyle": "Kopfzeilenstil",
|
135778
135815
|
"schemas.table.bodyStyle": "Körperstil",
|
135779
|
-
"schemas.table.columnStyle": "Spaltenstil"
|
135816
|
+
"schemas.table.columnStyle": "Spaltenstil",
|
135817
|
+
"schemas.date.format": "Datumsformat",
|
135818
|
+
"schemas.select.options": "Optionen",
|
135819
|
+
"schemas.select.optionPlaceholder": "Geben Sie eine Option ein"
|
135780
135820
|
}, dictEs = {
|
135781
135821
|
cancel: "Cancelar",
|
135822
|
+
close: "Cerrar",
|
135782
135823
|
field: "campo",
|
135783
135824
|
fieldName: "Nombre",
|
135784
135825
|
align: "Alinear",
|
@@ -135840,9 +135881,13 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135840
135881
|
"schemas.table.tableStyle": "Estilo de tabla",
|
135841
135882
|
"schemas.table.headStyle": "Estilo de cabecera",
|
135842
135883
|
"schemas.table.bodyStyle": "Estilo de cuerpo",
|
135843
|
-
"schemas.table.columnStyle": "Estilo de columna"
|
135884
|
+
"schemas.table.columnStyle": "Estilo de columna",
|
135885
|
+
"schemas.date.format": "Formato de fecha",
|
135886
|
+
"schemas.select.options": "Opciones",
|
135887
|
+
"schemas.select.optionPlaceholder": "Ingrese una opción"
|
135844
135888
|
}, dictFr = {
|
135845
135889
|
cancel: "Annuler",
|
135890
|
+
close: "Fermer",
|
135846
135891
|
field: "Champ",
|
135847
135892
|
fieldName: "Nom",
|
135848
135893
|
align: "Aligner",
|
@@ -135904,7 +135949,10 @@ const MinusOutlined$1 = /* @__PURE__ */ reactExports.forwardRef(MinusOutlined),
|
|
135904
135949
|
"schemas.table.tableStyle": "Style de tableau",
|
135905
135950
|
"schemas.table.headStyle": "Style d'en-tête",
|
135906
135951
|
"schemas.table.bodyStyle": "Style de corps",
|
135907
|
-
"schemas.table.columnStyle": "Style de colonne"
|
135952
|
+
"schemas.table.columnStyle": "Style de colonne",
|
135953
|
+
"schemas.date.format": "Format de date",
|
135954
|
+
"schemas.select.options": "Options",
|
135955
|
+
"schemas.select.optionPlaceholder": "Entrez une option"
|
135908
135956
|
}, dictionaries = {
|
135909
135957
|
en: dictEn,
|
135910
135958
|
zh: dictZh,
|
@@ -162930,6 +162978,20 @@ class Form extends PreviewUI {
|
|
162930
162978
|
onChangeInput(s) {
|
162931
162979
|
this.onChangeInputCallback = s;
|
162932
162980
|
}
|
162981
|
+
setInputs(s) {
|
162982
|
+
const $ = this.getInputs();
|
162983
|
+
super.setInputs(s);
|
162984
|
+
const _ = [];
|
162985
|
+
s.forEach((_e, tt) => {
|
162986
|
+
const nt = $[tt] || {};
|
162987
|
+
(/* @__PURE__ */ new Set([...Object.keys(_e), ...Object.keys(nt)])).forEach((ot) => {
|
162988
|
+
const rt = _e[ot], st = nt[ot];
|
162989
|
+
rt !== st && _.push({ index: tt, name: ot, value: rt });
|
162990
|
+
});
|
162991
|
+
}), _.forEach((_e) => {
|
162992
|
+
this.onChangeInputCallback && this.onChangeInputCallback(_e);
|
162993
|
+
});
|
162994
|
+
}
|
162933
162995
|
render() {
|
162934
162996
|
if (!this.domContainer)
|
162935
162997
|
throw Error(DESTROYED_ERR_MSG);
|