iglooform 2.5.15 → 2.5.18

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.
@@ -104,7 +104,7 @@ var ClaimList = function ClaimList(props) {
104
104
  }, []);
105
105
  setExpandedRowKeys(tableExtendKeys);
106
106
  setShowDetailKeys(claimExtendKeys);
107
- }, []);
107
+ }, [dateSource]);
108
108
 
109
109
  var handleClickRow = function handleClickRow(record, rowKey, showDetailKeys, expandedRowKeys, handleClaimOpenChange) {
110
110
  var copyExtendsKeys = _toConsumableArray(showDetailKeys);
@@ -2,5 +2,7 @@ import { FC } from 'react';
2
2
  declare const Documents: FC<{
3
3
  docList: string[];
4
4
  docNames?: string[];
5
+ showAllPages?: boolean;
6
+ destroyOnClose?: boolean;
5
7
  }>;
6
8
  export default Documents;
@@ -26,7 +26,11 @@ var Documents = function Documents(_ref) {
26
26
  var _ref$docList = _ref.docList,
27
27
  docList = _ref$docList === void 0 ? [] : _ref$docList,
28
28
  _ref$docNames = _ref.docNames,
29
- docNames = _ref$docNames === void 0 ? [] : _ref$docNames;
29
+ docNames = _ref$docNames === void 0 ? [] : _ref$docNames,
30
+ _ref$showAllPages = _ref.showAllPages,
31
+ showAllPages = _ref$showAllPages === void 0 ? true : _ref$showAllPages,
32
+ _ref$destroyOnClose = _ref.destroyOnClose,
33
+ destroyOnClose = _ref$destroyOnClose === void 0 ? true : _ref$destroyOnClose;
30
34
 
31
35
  var _useState = useState(0),
32
36
  _useState2 = _slicedToArray(_useState, 2),
@@ -109,7 +113,9 @@ var Documents = function Documents(_ref) {
109
113
  src: src,
110
114
  type: type,
111
115
  docNames: docNames,
112
- name: docNames[index]
116
+ name: docNames[index],
117
+ showAllPages: showAllPages,
118
+ destroyOnClose: destroyOnClose
113
119
  })
114
120
  }, index);
115
121
  })
@@ -24,12 +24,16 @@
24
24
  "Done": "Done",
25
25
  "Drag and drop a file here": "Drag and drop a file here",
26
26
  "Edit": "Edit",
27
+ "Encrypted PDF": "Encrypted PDF",
28
+ "Enter the password to open this PDF file.": "Enter the password to open this PDF file.",
27
29
  "Error Report": "Error Report",
30
+ "Failed to load PDF file.": "Failed to load PDF file.",
28
31
  "Filter": "Filter",
29
32
  "I agree to the Igloo": "I agree to the Igloo",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.",
31
34
  "Import": "Import",
32
35
  "Invalid KTP Number.": "Invalid KTP Number.",
36
+ "Invalid password.": "Invalid password.",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.",
34
38
  "Last 7 Days": "Last 7 Days",
35
39
  "Last Day": "Last Day",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "No preview for this file. Only support image, video or PDF file.",
40
44
  "Numbers only, please omit \" \" or \"-\".": "Numbers only, please omit \" \" or \"-\".",
41
45
  "OK": "OK",
46
+ "Ok": "Ok",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.",
44
49
  "Optional": "Optional",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "The file type is not supported.",
75
80
  "There are no options available currently": "There are no options available currently",
76
81
  "This Month": "This Month",
82
+ "This is an encrypted file, click to enter password.": "This is an encrypted file, click to enter password.",
77
83
  "Unselect All": "Unselect All",
78
84
  "Uploading": "Uploading",
79
85
  "We support CSV or XLSX files (less than 20M each).": "We support CSV or XLSX files (less than 20M each).",
@@ -24,12 +24,16 @@
24
24
  "Done": "Selesai",
25
25
  "Drag and drop a file here": "Geser dan Letakkan Dokumen disini",
26
26
  "Edit": "Ubah",
27
+ "Encrypted PDF": "PDF terenkripsi",
28
+ "Enter the password to open this PDF file.": "Masukkan kata sandi untuk membuka file PDF ini.",
27
29
  "Error Report": "Laporan Kesalahan",
30
+ "Failed to load PDF file.": "Gagal memuat file PDF.",
28
31
  "Filter": "Saring",
29
32
  "I agree to the Igloo": "Saya setuju dengan Igloo",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Saya menyatakan bahwa pernyataan yang saya jelaskan di atas adalah benar. Selanjutnya saya nyatakan bahwa kerugian yang terjadi merupakan ketidaksengajaan, dan terjadi tanpa perencanaan atau hasil musyawarah dengan pihak lain.",
31
34
  "Import": "Impor",
32
- "Invalid KTP Number.": "Số KTP không hợp lệ.",
35
+ "Invalid KTP Number.": "Nomor KTP Tidak Valid",
36
+ "Invalid password.": "Kata sandi salah.",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Direkomendasikan untuk memilih tidak lebih dari {colMax} metrik untuk memastikan sudut pandang default dari setiap isi kolom.",
34
38
  "Last 7 Days": "7 hari terakhir",
35
39
  "Last Day": "hari terakhir",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "Tidak ada pratinjau untuk file ini. Hanya mendukung file gambar, video atau PDF.",
40
44
  "Numbers only, please omit \" \" or \"-\".": "Angka saja, harap hilangkan \" \" atau \"-\".",
41
45
  "OK": "oke",
46
+ "Ok": "oke",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "Setelah Anda puas dengan hal di atas, dan Anda telah mencentang kotak di bawah, silakan lanjutkan dan kirimkan aktivasi Anda.",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Jika Anda puas dengan apa yang telah disampaikan, dan Anda telah memeriksa deklarasi tersebut, silakan lanjutkan dan ajukan klaim Anda.",
44
49
  "Optional": "Pilihan",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "Jenis file tidak didukung.",
75
80
  "There are no options available currently": "Tidak ada opsi yang tersedia saat ini",
76
81
  "This Month": "Bulan ini",
82
+ "This is an encrypted file, click to enter password.": "Ini adalah file terenkripsi, klik untuk memasukkan kata sandi.",
77
83
  "Unselect All": "Batalkan semua",
78
84
  "Uploading": "Mengunggah",
79
85
  "We support CSV or XLSX files (less than 20M each).": "Kami mendukung file CSV atau XLSX (Ukuran maksimal 20 MB) .",
@@ -24,12 +24,16 @@
24
24
  "Done": "เสร็จแล้ว",
25
25
  "Drag and drop a file here": "ลากและวางไฟล์มาที่นี่",
26
26
  "Edit": "แก้ไข",
27
+ "Encrypted PDF": "PDF ที่เข้ารหัส",
28
+ "Enter the password to open this PDF file.": "ป้อนรหัสผ่านเพื่อเปิดไฟล์ PDF นี้",
27
29
  "Error Report": "รายงานข้อผิดพลาด",
30
+ "Failed to load PDF file.": "ไม่สามารถโหลดไฟล์ PDF",
28
31
  "Filter": "กรอง",
29
32
  "I agree to the Igloo": "ฉันเห็นด้วยกับกระท่อมน้ำแข็ง",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "ข้าพเจ้ายืนยันว่าข้อความที่ข้าพเจ้าได้อธิบายข้างต้นนั้นเป็นความจริง และยืนยันว่าความเสียหายที่เกิดขึ้นนั้นเกิดจากอุบัติเหตุ ปราศจากการวางแผน หรือ การเห็นพ้องร่วมกันกับฝ่ายอื่น",
31
34
  "Import": "นำเข้า",
32
- "Invalid KTP Number.": "",
35
+ "Invalid KTP Number.": "หมายเลข KTP ไม่ถูกต้อง",
36
+ "Invalid password.": "รหัสผ่านไม่ถูกต้อง.",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "แนะนำให้เลือกจำนวนไม่เกิน {colMax} เพื่อให้แน่ใจว่ามองเห็นค่าเริ่มต้นของข้อมูลแต่ละคอลัมน์",
34
38
  "Last 7 Days": "เมื่อ 7 วันที่แล้ว",
35
39
  "Last Day": "วันสุดท้าย",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "ไม่มีการแสดงตัวอย่างสำหรับไฟล์นี้ รองรับเฉพาะรูปภาพ, วิดีโอ หรือ ไฟล์ PDF",
40
44
  "Numbers only, please omit \" \" or \"-\".": "ตัวเลขเท่านั้น โปรดเว้น \" \" หรือ \"-\"",
41
45
  "OK": "ตกลง",
46
+ "Ok": "ตกลง",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "เมื่อคุณพอใจกับสิ่งด้านบนแล้ว และคุณได้ทำเครื่องหมายที่ช่องด้านล่างแล้ว โปรดดำเนินการต่อและส่งการเปิดใช้งานของคุณ",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "หากตรวจสอบแล้วและต้องการยืนยันข้อมูลข้างต้น กรุณากดดำเนินการต่อและยืนยันการเคลมของคุณ",
44
49
  "Optional": "ไม่จำเป็น",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "ประเภทไฟล์ไม่รองรับ",
75
80
  "There are no options available currently": "ไม่มีตัวเลือกในขณะนี้",
76
81
  "This Month": "เดือนนี้",
82
+ "This is an encrypted file, click to enter password.": "นี่เป็นไฟล์ที่เข้ารหัส คลิกเพื่อป้อนรหัสผ่าน",
77
83
  "Unselect All": "ไม่เลือกทั้งหมด",
78
84
  "Uploading": "กำลังอัพโหลด",
79
85
  "We support CSV or XLSX files (less than 20M each).": "เรารองรับ CSV หรือ XLSX ไฟล์ (แต่ละไฟล์ขนาดไฟล์ต้องไม่เกิน 20M)",
@@ -24,12 +24,16 @@
24
24
  "Done": "Xong",
25
25
  "Drag and drop a file here": "Thả tệp tin vào đây",
26
26
  "Edit": "Sửa",
27
+ "Encrypted PDF": "PDF được mã hóa",
28
+ "Enter the password to open this PDF file.": "Nhập mật khẩu để mở tệp PDF này.",
27
29
  "Error Report": "Báo cáo lỗi",
30
+ "Failed to load PDF file.": "Không tải được tệp PDF.",
28
31
  "Filter": "Lọc",
29
32
  "I agree to the Igloo": "Tôi đồng ý với Igloo",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "Tôi tuyên bố rằng những điều tôi đã mô tả ở trên là đúng sự thật. Tôi tuyên bố thêm rằng tổn thất xảy ra là do ngẫu nhiên, không có kế hoạch hoặc sự đồng thuận với các bên khác.",
31
34
  "Import": "Nhập",
32
- "Invalid KTP Number.": "",
35
+ "Invalid KTP Number.": "Số KTP không hợp lệ.",
36
+ "Invalid password.": "Mật khẩu không hợp lệ.",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "Vui lòng chọn không quá {colMax} cột.",
34
38
  "Last 7 Days": "7 ngày gần nhất",
35
39
  "Last Day": "ngày cuối",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "Không có bản xem trước cho tệp này. Chỉ hỗ trợ hình ảnh, video hoặc tệp PDF.",
40
44
  "Numbers only, please omit \" \" or \"-\".": "Chỉ số, vui lòng bỏ qua \" \" hoặc \"-\".",
41
45
  "OK": "Vâng",
46
+ "Ok": "Vâng",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "Khi bạn hài lòng với những điều trên và đã chọn hộp bên dưới, hãy tiếp tục và gửi kích hoạt của bạn.",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "Vui lòng xác nhận và gửi yêu cầu bồi thường.",
44
49
  "Optional": "Không bắt buộc",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "Loại tệp không được hỗ trợ.",
75
80
  "There are no options available currently": "Hiện tại không có tùy chọn nào",
76
81
  "This Month": "Tháng này",
82
+ "This is an encrypted file, click to enter password.": "Đây là một tập tin được mã hóa, bấm vào để nhập mật khẩu.",
77
83
  "Unselect All": "Hủy chọn tất cả",
78
84
  "Uploading": "Đang tải lên",
79
85
  "We support CSV or XLSX files (less than 20M each).": "Hỗ trợ .CSV hoặc .XLSX (file nhỏ hơn 20MB)",
@@ -24,12 +24,16 @@
24
24
  "Done": "完成",
25
25
  "Drag and drop a file here": "拖拽一个文件到这里",
26
26
  "Edit": "编辑",
27
+ "Encrypted PDF": "加密的PDF文件",
28
+ "Enter the password to open this PDF file.": "输入密码后预览该文件",
27
29
  "Error Report": "错误报告",
30
+ "Failed to load PDF file.": "PDF文件加载失败",
28
31
  "Filter": "过滤条件",
29
32
  "I agree to the Igloo": "我同意Igloo",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "我承诺上述信息均真实有效,并且物品遗失纯属意外。",
31
34
  "Import": "导入",
32
- "Invalid KTP Number.": "",
35
+ "Invalid KTP Number.": "不合法的ID",
36
+ "Invalid password.": "无效的密码",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建议不要选择超过{colMax}个字段,以确保最佳展示效果。",
34
38
  "Last 7 Days": "过去7天",
35
39
  "Last Day": "昨天",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "此文件不支持预览。仅支持图片、视频和PDF。",
40
44
  "Numbers only, please omit \" \" or \"-\".": "仅数字,请省略“ ”或“-”。",
41
45
  "OK": "确定",
46
+ "Ok": "确定",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "如您对上述填写内容满意,请继续提交。",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "如您对上述填写内容满意,在勾选以下申明后,请继续提交您的理赔申请。",
44
49
  "Optional": "可选",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "不支持上传该类型的文件。",
75
80
  "There are no options available currently": "当前没有可用的选项",
76
81
  "This Month": "当月",
82
+ "This is an encrypted file, click to enter password.": "该文件已加密,请输入密码。",
77
83
  "Unselect All": "反选",
78
84
  "Uploading": "上传中",
79
85
  "We support CSV or XLSX files (less than 20M each).": "支持上传20M以内的CSV和XLSX文件",
@@ -24,12 +24,16 @@
24
24
  "Done": "完成",
25
25
  "Drag and drop a file here": "拖放文件至此",
26
26
  "Edit": "編輯",
27
+ "Encrypted PDF": "",
28
+ "Enter the password to open this PDF file.": "",
27
29
  "Error Report": "錯誤報告",
30
+ "Failed to load PDF file.": "",
28
31
  "Filter": "篩選",
29
32
  "I agree to the Igloo": "",
30
33
  "I declare that the statements I have described above are true. I further declare that the loss occured was accidental, without planning or consensus with other parties.": "我聲明我上面描述的陳述是真的。我進一步宣布發生損失是偶然的,沒有規劃或與其他方的共識。",
31
34
  "Import": "導入",
32
35
  "Invalid KTP Number.": "",
36
+ "Invalid password.": "",
33
37
  "It is recommended to select no more than {colMax} metrics to ensure the default visibility of each column input.": "建議選擇不超過{colMax}指標以確保每個列輸入的默認可見性。",
34
38
  "Last 7 Days": "過去7天",
35
39
  "Last Day": "過去1天",
@@ -39,6 +43,7 @@
39
43
  "No preview for this file. Only support image, video or PDF file.": "不支持預覽此文件。只支持圖像,視頻或PDF文件。",
40
44
  "Numbers only, please omit \" \" or \"-\".": "只有數字,請省略“”或“ - ”。",
41
45
  "OK": "好",
46
+ "Ok": "",
42
47
  "Once you’re happy with the above, and you’ve checked the box below, please go ahead and submit your activation.": "",
43
48
  "Once you’re happy with the above, and you’ve checked the declaration, please go ahead and submit your claim.": "一旦您對上述內容感到滿意,您已檢查聲明,請繼續並提交您的索賠。",
44
49
  "Optional": "可選項",
@@ -74,6 +79,7 @@
74
79
  "The file type is not supported.": "不支持文件類型。",
75
80
  "There are no options available currently": "當前沒有可用的選項",
76
81
  "This Month": "本月",
82
+ "This is an encrypted file, click to enter password.": "",
77
83
  "Unselect All": "全部取消選擇",
78
84
  "Uploading": "上傳",
79
85
  "We support CSV or XLSX files (less than 20M each).": "我們支持CSV或XLSX文件(小於20M)。",
@@ -12,6 +12,8 @@ interface Props {
12
12
  docNames?: string[];
13
13
  className?: any;
14
14
  style?: CSSProperties;
15
+ showAllPages?: boolean;
16
+ destroyOnClose?: boolean;
15
17
  }
16
18
  declare const MediaWithPreview: FC<Props>;
17
19
  export default MediaWithPreview;
package/es/media/index.js CHANGED
@@ -50,7 +50,11 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
50
50
  _ref$type = _ref.type,
51
51
  type = _ref$type === void 0 ? '' : _ref$type,
52
52
  _ref$docNames = _ref.docNames,
53
- docNames = _ref$docNames === void 0 ? [] : _ref$docNames;
53
+ docNames = _ref$docNames === void 0 ? [] : _ref$docNames,
54
+ _ref$showAllPages = _ref.showAllPages,
55
+ showAllPages = _ref$showAllPages === void 0 ? true : _ref$showAllPages,
56
+ _ref$destroyOnClose = _ref.destroyOnClose,
57
+ destroyOnClose = _ref$destroyOnClose === void 0 ? true : _ref$destroyOnClose;
54
58
 
55
59
  var _useState = useState(1),
56
60
  _useState2 = _slicedToArray(_useState, 2),
@@ -225,7 +229,7 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
225
229
  }),
226
230
  wrapClassName: "igloo-media-preview",
227
231
  width: "100%",
228
- destroyOnClose: true,
232
+ destroyOnClose: destroyOnClose,
229
233
  children: [Boolean(docNames && docNames.length) && _jsxs("div", {
230
234
  className: "igloo-document-name",
231
235
  children: [_jsx("div", {
@@ -262,7 +266,8 @@ var MediaWithPreview = function MediaWithPreview(_ref) {
262
266
  type: mediaType,
263
267
  src: src,
264
268
  scale: scale,
265
- isCurrent: true
269
+ isCurrent: true,
270
+ showAllPages: showAllPages
266
271
  })
267
272
  }, index), _jsx(MinusOutlined, {
268
273
  onClick: zoomIn,
package/es/media/media.js CHANGED
@@ -1,12 +1,39 @@
1
1
  import "antd/es/tooltip/style";
2
2
  import _Tooltip from "antd/es/tooltip";
3
+
4
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
+
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
11
+
12
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
13
+
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
+
3
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { useRef, useState, useContext } from 'react';
4
18
  import { Document, Page } from 'react-pdf/dist/esm/entry.webpack';
19
+ import { LocaleContext } from '../locale';
5
20
 
6
21
  var MediaItem = function MediaItem(_ref) {
7
22
  var type = _ref.type,
8
23
  src = _ref.src;
9
24
 
25
+ var _useContext = useContext(LocaleContext),
26
+ formatMessage = _useContext.formatMessage;
27
+
28
+ var documentRef = useRef(null);
29
+
30
+ var _useState = useState(formatMessage({
31
+ id: 'Failed to load PDF file.'
32
+ })),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ errorText = _useState2[0],
35
+ setErrorText = _useState2[1];
36
+
10
37
  switch (type) {
11
38
  case 'video':
12
39
  return _jsx("video", {
@@ -19,6 +46,20 @@ var MediaItem = function MediaItem(_ref) {
19
46
  });
20
47
 
21
48
  case 'pdf':
49
+ var needPassword = function needPassword() {
50
+ var current = documentRef === null || documentRef === void 0 ? void 0 : documentRef.current;
51
+
52
+ if (current) {
53
+ // @ts-ignore
54
+ current.setState({
55
+ pdf: false
56
+ });
57
+ setErrorText(formatMessage({
58
+ id: 'Encrypted PDF'
59
+ }));
60
+ }
61
+ };
62
+
22
63
  return _jsx("div", {
23
64
  style: {
24
65
  maxWidth: 80,
@@ -26,7 +67,15 @@ var MediaItem = function MediaItem(_ref) {
26
67
  position: 'absolute'
27
68
  },
28
69
  children: _jsx(Document, {
70
+ ref: documentRef,
29
71
  file: src,
72
+ onPassword: needPassword,
73
+ error: _jsx("div", {
74
+ style: {
75
+ textAlign: 'center'
76
+ },
77
+ children: errorText
78
+ }),
30
79
  children: _jsx(Page, {
31
80
  pageNumber: 1,
32
81
  scale: 0.1
@@ -6,6 +6,7 @@ interface MediaProps {
6
6
  isCurrent?: boolean;
7
7
  className?: any;
8
8
  style?: CSSProperties;
9
+ showAllPages?: boolean;
9
10
  }
10
11
  declare const Media: FC<MediaProps>;
11
12
  export default Media;