2023-04-07 13:51:35 +00:00
|
|
|
import { ResponsiveBehavior } from "utils/autoLayout/constants";
|
2021-11-29 15:37:49 +00:00
|
|
|
import IconSVG from "./icon.svg";
|
2022-01-21 10:19:10 +00:00
|
|
|
import Widget from "./widget";
|
2023-04-20 08:24:55 +00:00
|
|
|
import { isAirgapped } from "@appsmith/utils/airgapHelpers";
|
2023-07-22 05:57:18 +00:00
|
|
|
import { WIDGET_TAGS } from "constants/WidgetConstants";
|
2023-04-20 08:24:55 +00:00
|
|
|
|
|
|
|
|
const isAirgappedInstance = isAirgapped();
|
2021-11-29 15:37:49 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Document Viewer", // The display name which will be made in uppercase and show in the widgets panel ( can have spaces )
|
|
|
|
|
iconSVG: IconSVG,
|
2023-07-22 05:57:18 +00:00
|
|
|
tags: [WIDGET_TAGS.MEDIA],
|
2021-11-29 15:37:49 +00:00
|
|
|
needsMeta: false, // Defines if this widget adds any meta properties
|
|
|
|
|
isCanvas: false, // Defines if this widget has a canvas within in which we can drop other widgets
|
2022-06-17 03:12:47 +00:00
|
|
|
searchTags: ["pdf"],
|
2021-11-29 15:37:49 +00:00
|
|
|
defaults: {
|
|
|
|
|
widgetName: "DocumentViewer",
|
2023-04-20 08:24:55 +00:00
|
|
|
docUrl: !isAirgappedInstance
|
|
|
|
|
? "https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf"
|
|
|
|
|
: "",
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 40,
|
|
|
|
|
columns: 24,
|
2021-11-29 15:37:49 +00:00
|
|
|
version: 1,
|
2021-12-14 07:55:58 +00:00
|
|
|
animateLoading: true,
|
2023-04-07 13:51:35 +00:00
|
|
|
responsiveBehavior: ResponsiveBehavior.Fill,
|
2021-11-29 15:37:49 +00:00
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
2022-08-04 05:31:05 +00:00
|
|
|
contentConfig: Widget.getPropertyPaneContentConfig(),
|
2023-07-08 14:07:26 +00:00
|
|
|
setterConfig: Widget.getSetterConfig(),
|
2023-04-14 06:27:49 +00:00
|
|
|
autocompleteDefinitions: Widget.getAutocompleteDefinitions(),
|
2021-11-29 15:37:49 +00:00
|
|
|
},
|
2023-04-07 13:51:35 +00:00
|
|
|
autoLayout: {
|
|
|
|
|
widgetSize: [
|
|
|
|
|
{
|
|
|
|
|
viewportMinWidth: 0,
|
|
|
|
|
configuration: () => {
|
|
|
|
|
return {
|
|
|
|
|
minWidth: "280px",
|
|
|
|
|
minHeight: "280px",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2021-11-29 15:37:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|