Fixes #23405 Test Plan: Steps to import an excel file into document viewer: 1. Import a file using file picker widget in base64 format. 2. Bind filepicker.files[0].data to document viewer data. Test cases to cover 1. Import an .xls file into document viewer and it should work. 2. Import an .xlsx file into document viewer and it should work 3. Import an .xlsx file, verify it renders fine. Changing the file data to an .xls file. Verify it renders fine without having the need to use another document viewer widget
25 lines
678 B
TypeScript
25 lines
678 B
TypeScript
// This file contains common constants which can be used across the widget configuration file (index.ts), widget and component folders.
|
|
export const DOCUMENTVIEWER_WIDGET_CONSTANT = "";
|
|
// txt and pdf handle by viewerType = "url"
|
|
// and other types handle by viewerType = "office"
|
|
export const SUPPORTED_EXTENSIONS = [
|
|
"txt",
|
|
"pdf",
|
|
"docx",
|
|
"ppt",
|
|
"pptx",
|
|
"xlsx",
|
|
"xls",
|
|
];
|
|
|
|
export const Renderers = {
|
|
DOCUMENT_VIEWER: "DOCUMENT_VIEWER",
|
|
DOCX_VIEWER: "DOCX_VIEWER",
|
|
XLSX_VIEWER: "XLSX_VIEWER",
|
|
ERROR: "ERROR",
|
|
};
|
|
|
|
export type Renderer = (typeof Renderers)[keyof typeof Renderers];
|
|
|
|
export type ViewerType = "google" | "office" | "mammoth" | "pdf" | "url";
|