2022-01-21 10:19:10 +00:00
|
|
|
import Widget from "./widget";
|
2022-05-04 09:45:57 +00:00
|
|
|
import IconSVG from "./icon.svg";
|
|
|
|
|
import { ButtonPlacementTypes, ButtonVariantTypes } from "components/constants";
|
2022-12-01 04:55:57 +00:00
|
|
|
import { MenuItemsSource } from "./constants";
|
2021-09-09 15:10:22 +00:00
|
|
|
|
|
|
|
|
export const CONFIG = {
|
|
|
|
|
type: Widget.getWidgetType(),
|
|
|
|
|
name: "Menu Button",
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
defaults: {
|
|
|
|
|
label: "Open Menu",
|
2021-10-12 08:04:51 +00:00
|
|
|
menuVariant: ButtonVariantTypes.PRIMARY,
|
2021-12-29 12:02:37 +00:00
|
|
|
placement: ButtonPlacementTypes.CENTER,
|
2021-09-09 15:10:22 +00:00
|
|
|
isCompact: false,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
isVisible: true,
|
2021-12-14 07:55:58 +00:00
|
|
|
animateLoading: true,
|
2022-12-01 04:55:57 +00:00
|
|
|
menuItemsSource: MenuItemsSource.STATIC,
|
2021-09-09 15:10:22 +00:00
|
|
|
menuItems: {
|
|
|
|
|
menuItem1: {
|
|
|
|
|
label: "First Menu Item",
|
|
|
|
|
id: "menuItem1",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 0,
|
|
|
|
|
},
|
|
|
|
|
menuItem2: {
|
|
|
|
|
label: "Second Menu Item",
|
|
|
|
|
id: "menuItem2",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 1,
|
|
|
|
|
},
|
|
|
|
|
menuItem3: {
|
|
|
|
|
label: "Third Menu Item",
|
|
|
|
|
id: "menuItem3",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 2,
|
|
|
|
|
},
|
|
|
|
|
},
|
2022-01-21 10:19:10 +00:00
|
|
|
rows: 4,
|
|
|
|
|
columns: 16,
|
2021-09-09 15:10:22 +00:00
|
|
|
widgetName: "MenuButton",
|
|
|
|
|
version: 1,
|
|
|
|
|
},
|
|
|
|
|
properties: {
|
|
|
|
|
derived: Widget.getDerivedPropertiesMap(),
|
|
|
|
|
default: Widget.getDefaultPropertiesMap(),
|
|
|
|
|
meta: Widget.getMetaPropertiesMap(),
|
|
|
|
|
config: Widget.getPropertyPaneConfig(),
|
2022-08-15 08:05:46 +00:00
|
|
|
contentConfig: Widget.getPropertyPaneContentConfig(),
|
|
|
|
|
styleConfig: Widget.getPropertyPaneStyleConfig(),
|
2022-11-28 04:44:31 +00:00
|
|
|
stylesheetConfig: Widget.getStylesheetConfig(),
|
2023-04-14 06:27:49 +00:00
|
|
|
autocompleteDefinitions: Widget.getAutocompleteDefinitions(),
|
2021-09-09 15:10:22 +00:00
|
|
|
},
|
2023-04-07 13:51:35 +00:00
|
|
|
autoLayout: {
|
|
|
|
|
defaults: {
|
|
|
|
|
rows: 4,
|
|
|
|
|
columns: 6.632,
|
|
|
|
|
},
|
|
|
|
|
autoDimension: {
|
|
|
|
|
width: true,
|
|
|
|
|
},
|
|
|
|
|
widgetSize: [
|
|
|
|
|
{
|
|
|
|
|
viewportMinWidth: 0,
|
|
|
|
|
configuration: () => {
|
|
|
|
|
return {
|
|
|
|
|
minWidth: "120px",
|
|
|
|
|
maxWidth: "360px",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
disableResizeHandles: {
|
|
|
|
|
vertical: true,
|
|
|
|
|
horizontal: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
2021-09-09 15:10:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Widget;
|