chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { Alignment } from "@blueprintjs/core";
|
|
|
|
|
import type { IconName } from "@blueprintjs/icons";
|
|
|
|
|
import type { ButtonPlacement, ButtonVariant } from "components/constants";
|
|
|
|
|
import { ButtonPlacementTypes, ButtonVariantTypes } from "components/constants";
|
2023-03-04 07:25:54 +00:00
|
|
|
import { EventType } from "constants/AppsmithActionConstants/ActionConstants";
|
|
|
|
|
import { ValidationTypes } from "constants/WidgetValidation";
|
2023-07-08 14:07:26 +00:00
|
|
|
import type { SetterConfig, Stylesheet } from "entities/AppTheming";
|
2023-03-04 07:25:54 +00:00
|
|
|
import { get } from "lodash";
|
|
|
|
|
import React from "react";
|
chore: upgrade to prettier v2 + enforce import types (#21013)Co-authored-by: Satish Gandham <hello@satishgandham.com> Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
## Description
This PR upgrades Prettier to v2 + enforces TypeScript’s [`import
type`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export)
syntax where applicable. It’s submitted as a separate PR so we can merge
it easily.
As a part of this PR, we reformat the codebase heavily:
- add `import type` everywhere where it’s required, and
- re-format the code to account for Prettier 2’s breaking changes:
https://prettier.io/blog/2020/03/21/2.0.0.html#breaking-changes
This PR is submitted against `release` to make sure all new code by team
members will adhere to new formatting standards, and we’ll have fewer
conflicts when merging `bundle-optimizations` into `release`. (I’ll
merge `release` back into `bundle-optimizations` once this PR is
merged.)
### Why is this needed?
This PR is needed because, for the Lodash optimization from
https://github.com/appsmithorg/appsmith/commit/7cbb12af886621256224be0c93e6a465dd710ad3,
we need to use `import type`. Otherwise, `babel-plugin-lodash` complains
that `LoDashStatic` is not a lodash function.
However, just using `import type` in the current codebase will give you
this:
<img width="962" alt="Screenshot 2023-03-08 at 17 45 59"
src="https://user-images.githubusercontent.com/2953267/223775744-407afa0c-e8b9-44a1-90f9-b879348da57f.png">
That’s because Prettier 1 can’t parse `import type` at all. To parse it,
we need to upgrade to Prettier 2.
### Why enforce `import type`?
Apart from just enabling `import type` support, this PR enforces
specifying `import type` everywhere it’s needed. (Developers will get
immediate TypeScript and ESLint errors when they forget to do so.)
I’m doing this because I believe `import type` improves DX and makes
refactorings easier.
Let’s say you had a few imports like below. Can you tell which of these
imports will increase the bundle size? (Tip: it’s not all of them!)
```ts
// app/client/src/workers/Linting/utils.ts
import { Position } from "codemirror";
import { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
It’s pretty hard, right?
What about now?
```ts
// app/client/src/workers/Linting/utils.ts
import type { Position } from "codemirror";
import type { LintError as JSHintError, LintOptions } from "jshint";
import { get, isEmpty, isNumber, keys, last, set } from "lodash";
```
Now, it’s clear that only `lodash` will be bundled.
This helps developers to see which imports are problematic, but it
_also_ helps with refactorings. Now, if you want to see where
`codemirror` is bundled, you can just grep for `import \{.*\} from
"codemirror"` – and you won’t get any type-only imports.
This also helps (some) bundlers. Upon transpiling, TypeScript erases
type-only imports completely. In some environment (not ours), this makes
the bundle smaller, as the bundler doesn’t need to bundle type-only
imports anymore.
## Type of change
- Chore (housekeeping or task changes that don't impact user perception)
## How Has This Been Tested?
This was tested to not break the build.
### Test Plan
> Add Testsmith test cases links that relate to this PR
### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag
### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
---------
Co-authored-by: Satish Gandham <hello@satishgandham.com>
Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
2023-03-16 11:41:47 +00:00
|
|
|
import type { WidgetProps, WidgetState } from "widgets/BaseWidget";
|
|
|
|
|
import BaseWidget from "widgets/BaseWidget";
|
2023-09-13 13:57:42 +00:00
|
|
|
import { MinimumPopupWidthInPercentage } from "WidgetProvider/constants";
|
2023-03-04 07:25:54 +00:00
|
|
|
import ButtonGroupComponent from "../component";
|
2022-05-04 09:45:57 +00:00
|
|
|
import { getStylesheetValue } from "./helpers";
|
2023-04-14 06:27:49 +00:00
|
|
|
import { DefaultAutocompleteDefinitions } from "widgets/WidgetUtils";
|
2023-09-06 12:15:04 +00:00
|
|
|
import type { AutocompletionDefinitions } from "WidgetProvider/constants";
|
|
|
|
|
import { FILL_WIDGET_MIN_WIDTH } from "constants/minWidthConstants";
|
|
|
|
|
import { klona as clone } from "klona/full";
|
2023-09-11 15:55:11 +00:00
|
|
|
import { ResponsiveBehavior } from "layoutSystems/autolayout/utils/constants";
|
2023-09-06 12:15:04 +00:00
|
|
|
import { BlueprintOperationTypes } from "WidgetProvider/constants";
|
|
|
|
|
import IconSVG from "../icon.svg";
|
2023-09-13 13:57:42 +00:00
|
|
|
import { WIDGET_TAGS, layoutConfigurations } from "constants/WidgetConstants";
|
2021-11-11 06:41:05 +00:00
|
|
|
|
|
|
|
|
class ButtonGroupWidget extends BaseWidget<
|
|
|
|
|
ButtonGroupWidgetProps,
|
|
|
|
|
WidgetState
|
|
|
|
|
> {
|
2023-09-06 12:15:04 +00:00
|
|
|
static type = "BUTTON_GROUP_WIDGET";
|
|
|
|
|
|
|
|
|
|
static getConfig() {
|
|
|
|
|
return {
|
|
|
|
|
name: "Button Group", // The display name which will be made in uppercase and show in the widgets panel ( can have spaces )
|
|
|
|
|
iconSVG: IconSVG,
|
|
|
|
|
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
|
|
|
|
|
searchTags: ["click", "submit"],
|
|
|
|
|
tags: [WIDGET_TAGS.BUTTONS],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getDefaults() {
|
|
|
|
|
return {
|
|
|
|
|
rows: 4,
|
|
|
|
|
columns: 24,
|
|
|
|
|
widgetName: "ButtonGroup",
|
|
|
|
|
orientation: "horizontal",
|
|
|
|
|
buttonVariant: ButtonVariantTypes.PRIMARY,
|
|
|
|
|
isVisible: true,
|
|
|
|
|
version: 1,
|
|
|
|
|
animateLoading: true,
|
|
|
|
|
responsiveBehavior: ResponsiveBehavior.Fill,
|
|
|
|
|
minWidth: FILL_WIDGET_MIN_WIDTH,
|
|
|
|
|
groupButtons: {
|
|
|
|
|
groupButton1: {
|
|
|
|
|
label: "Favorite",
|
|
|
|
|
iconName: "heart",
|
|
|
|
|
id: "groupButton1",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
buttonType: "SIMPLE",
|
|
|
|
|
placement: "CENTER",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 0,
|
|
|
|
|
menuItems: {},
|
|
|
|
|
},
|
|
|
|
|
groupButton2: {
|
|
|
|
|
label: "Add",
|
|
|
|
|
iconName: "add",
|
|
|
|
|
id: "groupButton2",
|
|
|
|
|
buttonType: "SIMPLE",
|
|
|
|
|
placement: "CENTER",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 1,
|
|
|
|
|
menuItems: {},
|
|
|
|
|
},
|
|
|
|
|
groupButton3: {
|
|
|
|
|
label: "More",
|
|
|
|
|
iconName: "more",
|
|
|
|
|
id: "groupButton3",
|
|
|
|
|
buttonType: "MENU",
|
|
|
|
|
placement: "CENTER",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 2,
|
|
|
|
|
menuItems: {
|
|
|
|
|
menuItem1: {
|
|
|
|
|
label: "First Option",
|
|
|
|
|
backgroundColor: "#FFFFFF",
|
|
|
|
|
id: "menuItem1",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
onClick: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 0,
|
|
|
|
|
},
|
|
|
|
|
menuItem2: {
|
|
|
|
|
label: "Second Option",
|
|
|
|
|
backgroundColor: "#FFFFFF",
|
|
|
|
|
id: "menuItem2",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
onClick: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 1,
|
|
|
|
|
},
|
|
|
|
|
menuItem3: {
|
|
|
|
|
label: "Delete",
|
|
|
|
|
iconName: "trash",
|
|
|
|
|
iconColor: "#FFFFFF",
|
|
|
|
|
iconAlign: "right",
|
|
|
|
|
textColor: "#FFFFFF",
|
|
|
|
|
backgroundColor: "#DD4B34",
|
|
|
|
|
id: "menuItem3",
|
|
|
|
|
widgetId: "",
|
|
|
|
|
onClick: "",
|
|
|
|
|
isVisible: true,
|
|
|
|
|
isDisabled: false,
|
|
|
|
|
index: 2,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
blueprint: {
|
|
|
|
|
operations: [
|
|
|
|
|
{
|
|
|
|
|
type: BlueprintOperationTypes.MODIFY_PROPS,
|
|
|
|
|
fn: (widget: WidgetProps & { children?: WidgetProps[] }) => {
|
|
|
|
|
const groupButtons = clone(widget.groupButtons);
|
|
|
|
|
const dynamicBindingPathList: any[] = get(
|
|
|
|
|
widget,
|
|
|
|
|
"dynamicBindingPathList",
|
|
|
|
|
[],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Object.keys(groupButtons).map((groupButtonKey) => {
|
|
|
|
|
groupButtons[groupButtonKey].buttonColor = get(
|
|
|
|
|
widget,
|
|
|
|
|
"childStylesheet.button.buttonColor",
|
|
|
|
|
"{{appsmith.theme.colors.primaryColor}}",
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
dynamicBindingPathList.push({
|
|
|
|
|
key: `groupButtons.${groupButtonKey}.buttonColor`,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const updatePropertyMap = [
|
|
|
|
|
{
|
|
|
|
|
widgetId: widget.widgetId,
|
|
|
|
|
propertyName: "dynamicBindingPathList",
|
|
|
|
|
propertyValue: dynamicBindingPathList,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
widgetId: widget.widgetId,
|
|
|
|
|
propertyName: "groupButtons",
|
|
|
|
|
propertyValue: groupButtons,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return updatePropertyMap;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getAutoLayoutConfig() {
|
|
|
|
|
return {
|
|
|
|
|
autoDimension: {
|
|
|
|
|
height: true,
|
|
|
|
|
},
|
|
|
|
|
widgetSize: [
|
|
|
|
|
{
|
|
|
|
|
viewportMinWidth: 0,
|
|
|
|
|
configuration: (props: ButtonGroupWidgetProps) => {
|
|
|
|
|
let minWidth = 120;
|
|
|
|
|
const buttonLength = Object.keys(props.groupButtons).length;
|
|
|
|
|
if (props.orientation === "horizontal") {
|
|
|
|
|
// 120 is the width of the button, 8 is widget padding, 1 is the gap between buttons
|
|
|
|
|
minWidth = 120 * buttonLength + 8 + (buttonLength - 1) * 1;
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
minWidth: `${minWidth}px`,
|
|
|
|
|
minHeight: "40px",
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
disableResizeHandles: {
|
|
|
|
|
vertical: true,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-14 06:27:49 +00:00
|
|
|
static getAutocompleteDefinitions(): AutocompletionDefinitions {
|
|
|
|
|
return {
|
|
|
|
|
"!doc":
|
|
|
|
|
"The Button group widget represents a set of buttons in a group. Group can have simple buttons or menu buttons with drop-down items.",
|
|
|
|
|
"!url": "https://docs.appsmith.com/widget-reference/button-group",
|
|
|
|
|
isVisible: DefaultAutocompleteDefinitions.isVisible,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-15 08:05:46 +00:00
|
|
|
static getPropertyPaneContentConfig() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Data",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
helpText: "Group Buttons",
|
|
|
|
|
propertyName: "groupButtons",
|
|
|
|
|
controlType: "GROUP_BUTTONS",
|
|
|
|
|
label: "Buttons",
|
|
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
dependencies: ["childStylesheet"],
|
|
|
|
|
panelConfig: {
|
|
|
|
|
editableTitle: true,
|
|
|
|
|
titlePropertyName: "label",
|
|
|
|
|
panelIdPropertyName: "id",
|
|
|
|
|
updateHook: (
|
|
|
|
|
props: any,
|
|
|
|
|
propertyPath: string,
|
|
|
|
|
propertyValue: string,
|
|
|
|
|
) => {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
propertyPath,
|
|
|
|
|
propertyValue,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
contentChildren: [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Data",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "buttonType",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Button type",
|
2022-10-20 14:06:32 +00:00
|
|
|
controlType: "ICON_TABS",
|
|
|
|
|
fullWidth: true,
|
2022-08-15 08:05:46 +00:00
|
|
|
helpText: "Sets button type",
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: "Simple",
|
|
|
|
|
value: "SIMPLE",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Menu",
|
|
|
|
|
value: "MENU",
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-06-07 11:03:22 +00:00
|
|
|
defaultValue: "SIMPLE",
|
2022-08-15 08:05:46 +00:00
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: {
|
|
|
|
|
type: ValidationTypes.TEXT,
|
|
|
|
|
params: {
|
|
|
|
|
allowedValues: ["SIMPLE", "MENU"],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
hidden: (
|
|
|
|
|
props: ButtonGroupWidgetProps,
|
|
|
|
|
propertyPath: string,
|
|
|
|
|
) => {
|
|
|
|
|
const buttonType = get(
|
|
|
|
|
props,
|
|
|
|
|
`${propertyPath.split(".", 2).join(".")}.buttonType`,
|
|
|
|
|
"",
|
|
|
|
|
);
|
|
|
|
|
return buttonType !== "MENU";
|
|
|
|
|
},
|
|
|
|
|
dependencies: ["groupButtons"],
|
2023-05-19 18:37:06 +00:00
|
|
|
helpText: "Menu items",
|
2022-08-15 08:05:46 +00:00
|
|
|
propertyName: "menuItems",
|
|
|
|
|
controlType: "MENU_ITEMS",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Menu items",
|
2022-08-15 08:05:46 +00:00
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
panelConfig: {
|
|
|
|
|
editableTitle: true,
|
|
|
|
|
titlePropertyName: "label",
|
|
|
|
|
panelIdPropertyName: "id",
|
|
|
|
|
updateHook: (
|
|
|
|
|
props: any,
|
|
|
|
|
propertyPath: string,
|
|
|
|
|
propertyValue: string,
|
|
|
|
|
) => {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
propertyPath,
|
|
|
|
|
propertyValue,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
contentChildren: [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Label",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "label",
|
|
|
|
|
helpText: "Sets the label of a menu item",
|
|
|
|
|
label: "Text",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
placeholderText: "Enter label",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "General",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "isVisible",
|
|
|
|
|
helpText:
|
|
|
|
|
"Controls the visibility of menu item",
|
|
|
|
|
label: "Visible",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: {
|
|
|
|
|
type: ValidationTypes.BOOLEAN,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "isDisabled",
|
|
|
|
|
helpText: "Disables menu item",
|
|
|
|
|
label: "Disabled",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: {
|
|
|
|
|
type: ValidationTypes.BOOLEAN,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Events",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
2023-04-06 16:49:12 +00:00
|
|
|
helpText: "when the menu item is clicked",
|
2022-08-15 08:05:46 +00:00
|
|
|
propertyName: "onClick",
|
|
|
|
|
label: "onClick",
|
|
|
|
|
controlType: "ACTION_SELECTOR",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
styleChildren: [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Icon",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "iconName",
|
|
|
|
|
label: "Icon",
|
|
|
|
|
helpText:
|
|
|
|
|
"Sets the icon to be used for a menu item",
|
|
|
|
|
controlType: "ICON_SELECT",
|
2022-10-26 09:45:30 +00:00
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
2022-08-15 08:05:46 +00:00
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "iconAlign",
|
|
|
|
|
label: "Position",
|
|
|
|
|
helpText:
|
|
|
|
|
"Sets the icon alignment of a menu item",
|
|
|
|
|
controlType: "ICON_TABS",
|
2023-05-19 18:37:06 +00:00
|
|
|
fullWidth: false,
|
2022-08-15 08:05:46 +00:00
|
|
|
options: [
|
|
|
|
|
{
|
2023-05-19 18:37:06 +00:00
|
|
|
startIcon: "skip-left-line",
|
2022-08-15 08:05:46 +00:00
|
|
|
value: "left",
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-19 18:37:06 +00:00
|
|
|
startIcon: "skip-right-line",
|
2022-08-15 08:05:46 +00:00
|
|
|
value: "right",
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-06-07 11:03:22 +00:00
|
|
|
defaultValue: "left",
|
2022-08-15 08:05:46 +00:00
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Color",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "backgroundColor",
|
|
|
|
|
helpText:
|
|
|
|
|
"Sets the background color of a menu item",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Background color",
|
2022-08-15 08:05:46 +00:00
|
|
|
controlType: "COLOR_PICKER",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "iconColor",
|
|
|
|
|
helpText: "Sets the icon color of a menu item",
|
|
|
|
|
label: "Icon Color",
|
|
|
|
|
controlType: "COLOR_PICKER",
|
|
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "textColor",
|
|
|
|
|
helpText: "Sets the text color of a menu item",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Text color",
|
2022-08-15 08:05:46 +00:00
|
|
|
controlType: "COLOR_PICKER",
|
|
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Label",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "label",
|
|
|
|
|
helpText: "Sets the label of a menu item",
|
|
|
|
|
label: "Text",
|
|
|
|
|
controlType: "INPUT_TEXT",
|
|
|
|
|
placeholderText: "Enter label",
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "General",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "isVisible",
|
|
|
|
|
helpText: "Controls the visibility of the widget",
|
|
|
|
|
label: "Visible",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.BOOLEAN },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "isDisabled",
|
|
|
|
|
helpText: "Disables input to the widget",
|
|
|
|
|
label: "Disabled",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.BOOLEAN },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Events",
|
|
|
|
|
hidden: (
|
|
|
|
|
props: ButtonGroupWidgetProps,
|
|
|
|
|
propertyPath: string,
|
|
|
|
|
) => {
|
|
|
|
|
const buttonType = get(
|
|
|
|
|
props,
|
|
|
|
|
`${propertyPath}.buttonType`,
|
|
|
|
|
"",
|
|
|
|
|
);
|
|
|
|
|
return buttonType === "MENU";
|
|
|
|
|
},
|
|
|
|
|
children: [
|
|
|
|
|
{
|
2023-04-06 16:49:12 +00:00
|
|
|
helpText: "when the button is clicked",
|
2022-08-15 08:05:46 +00:00
|
|
|
propertyName: "onClick",
|
|
|
|
|
label: "onClick",
|
|
|
|
|
controlType: "ACTION_SELECTOR",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
styleChildren: [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Icon",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "iconName",
|
|
|
|
|
label: "Icon",
|
|
|
|
|
helpText: "Sets the icon to be used for a button",
|
|
|
|
|
controlType: "ICON_SELECT",
|
2022-12-06 17:32:43 +00:00
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
2022-08-15 08:05:46 +00:00
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "iconAlign",
|
|
|
|
|
label: "Position",
|
|
|
|
|
helpText: "Sets the icon alignment of a button",
|
|
|
|
|
controlType: "ICON_TABS",
|
2023-05-19 18:37:06 +00:00
|
|
|
fullWidth: false,
|
2022-08-15 08:05:46 +00:00
|
|
|
options: [
|
|
|
|
|
{
|
2023-05-19 18:37:06 +00:00
|
|
|
startIcon: "skip-left-line",
|
2022-08-15 08:05:46 +00:00
|
|
|
value: "left",
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-19 18:37:06 +00:00
|
|
|
startIcon: "skip-right-line",
|
2022-08-15 08:05:46 +00:00
|
|
|
value: "right",
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-06-07 11:03:22 +00:00
|
|
|
defaultValue: "left",
|
2022-08-15 08:05:46 +00:00
|
|
|
isBindProperty: false,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "placement",
|
|
|
|
|
label: "Placement",
|
|
|
|
|
controlType: "DROP_DOWN",
|
|
|
|
|
helpText: "Sets the space between items",
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: "Start",
|
|
|
|
|
value: ButtonPlacementTypes.START,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Between",
|
|
|
|
|
value: ButtonPlacementTypes.BETWEEN,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Center",
|
|
|
|
|
value: ButtonPlacementTypes.CENTER,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
defaultValue: ButtonPlacementTypes.CENTER,
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: {
|
|
|
|
|
type: ValidationTypes.TEXT,
|
|
|
|
|
params: {
|
|
|
|
|
allowedValues: [
|
|
|
|
|
ButtonPlacementTypes.START,
|
|
|
|
|
ButtonPlacementTypes.BETWEEN,
|
|
|
|
|
ButtonPlacementTypes.CENTER,
|
|
|
|
|
],
|
|
|
|
|
default: ButtonPlacementTypes.CENTER,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "Color",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
getStylesheetValue,
|
|
|
|
|
propertyName: "buttonColor",
|
|
|
|
|
helpText: "Changes the color of the button",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Button color",
|
2022-08-15 08:05:46 +00:00
|
|
|
controlType: "COLOR_PICKER",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
sectionName: "General",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
helpText: "Controls the visibility of the widget",
|
|
|
|
|
propertyName: "isVisible",
|
|
|
|
|
label: "Visible",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.BOOLEAN },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "isDisabled",
|
|
|
|
|
label: "Disabled",
|
|
|
|
|
controlType: "SWITCH",
|
|
|
|
|
helpText: "Disables clicks to this widget",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.BOOLEAN },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "animateLoading",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Animate loading",
|
2022-08-15 08:05:46 +00:00
|
|
|
controlType: "SWITCH",
|
|
|
|
|
helpText: "Controls the loading of the widget",
|
|
|
|
|
defaultValue: true,
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.BOOLEAN },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getPropertyPaneStyleConfig() {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
sectionName: "General",
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "buttonVariant",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Button variant",
|
2022-10-20 14:06:32 +00:00
|
|
|
controlType: "ICON_TABS",
|
|
|
|
|
fullWidth: true,
|
2022-08-15 08:05:46 +00:00
|
|
|
helpText: "Sets the variant of the button",
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: "Primary",
|
|
|
|
|
value: ButtonVariantTypes.PRIMARY,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Secondary",
|
|
|
|
|
value: ButtonVariantTypes.SECONDARY,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Tertiary",
|
|
|
|
|
value: ButtonVariantTypes.TERTIARY,
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-06-07 11:03:22 +00:00
|
|
|
defaultValue: ButtonVariantTypes.PRIMARY,
|
2022-08-15 08:05:46 +00:00
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: {
|
|
|
|
|
type: ValidationTypes.TEXT,
|
|
|
|
|
params: {
|
|
|
|
|
allowedValues: [
|
|
|
|
|
ButtonVariantTypes.PRIMARY,
|
|
|
|
|
ButtonVariantTypes.SECONDARY,
|
|
|
|
|
ButtonVariantTypes.TERTIARY,
|
|
|
|
|
],
|
|
|
|
|
default: ButtonVariantTypes.PRIMARY,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
helpText: "Controls widget orientation",
|
|
|
|
|
propertyName: "orientation",
|
|
|
|
|
label: "Orientation",
|
2022-10-20 14:06:32 +00:00
|
|
|
controlType: "ICON_TABS",
|
|
|
|
|
fullWidth: true,
|
2022-08-15 08:05:46 +00:00
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
label: "Horizontal",
|
|
|
|
|
value: "horizontal",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "Vertical",
|
|
|
|
|
value: "vertical",
|
|
|
|
|
},
|
|
|
|
|
],
|
2023-06-07 11:03:22 +00:00
|
|
|
defaultValue: "horizontal",
|
2022-08-15 08:05:46 +00:00
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
2023-05-19 18:37:06 +00:00
|
|
|
sectionName: "Border and shadow",
|
2022-08-15 08:05:46 +00:00
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
propertyName: "borderRadius",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Border radius",
|
2022-08-15 08:05:46 +00:00
|
|
|
helpText:
|
|
|
|
|
"Rounds the corners of the icon button's outer border edge",
|
|
|
|
|
controlType: "BORDER_RADIUS_OPTIONS",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
propertyName: "boxShadow",
|
2023-05-19 18:37:06 +00:00
|
|
|
label: "Box shadow",
|
2022-08-15 08:05:46 +00:00
|
|
|
helpText:
|
|
|
|
|
"Enables you to cast a drop shadow from the frame of the widget",
|
|
|
|
|
controlType: "BOX_SHADOW_OPTIONS",
|
|
|
|
|
isJSConvertible: true,
|
|
|
|
|
isBindProperty: true,
|
|
|
|
|
isTriggerProperty: false,
|
|
|
|
|
validation: { type: ValidationTypes.TEXT },
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-28 04:44:31 +00:00
|
|
|
static getStylesheetConfig(): Stylesheet {
|
|
|
|
|
return {
|
|
|
|
|
borderRadius: "{{appsmith.theme.borderRadius.appBorderRadius}}",
|
|
|
|
|
boxShadow: "none",
|
|
|
|
|
childStylesheet: {
|
|
|
|
|
button: {
|
|
|
|
|
buttonColor: "{{appsmith.theme.colors.primaryColor}}",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-20 08:51:54 +00:00
|
|
|
handleClick = (onClick: string | undefined, callback: () => void): void => {
|
2021-11-11 06:41:05 +00:00
|
|
|
if (onClick) {
|
|
|
|
|
super.executeAction({
|
|
|
|
|
triggerPropertyName: "onClick",
|
|
|
|
|
dynamicString: onClick,
|
|
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_CLICK,
|
2022-07-20 08:51:54 +00:00
|
|
|
callback,
|
2021-11-11 06:41:05 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2023-07-08 14:07:26 +00:00
|
|
|
static getSetterConfig(): SetterConfig {
|
|
|
|
|
return {
|
|
|
|
|
__setters: {
|
|
|
|
|
setVisibility: {
|
|
|
|
|
path: "isVisible",
|
|
|
|
|
type: "boolean",
|
|
|
|
|
},
|
|
|
|
|
setDisabled: {
|
|
|
|
|
path: "isDisabled",
|
|
|
|
|
type: "boolean",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-11 15:55:11 +00:00
|
|
|
getWidgetView() {
|
|
|
|
|
const { componentWidth } = this.props;
|
2023-09-13 13:57:42 +00:00
|
|
|
const minPopoverWidth =
|
|
|
|
|
(MinimumPopupWidthInPercentage / 100) *
|
|
|
|
|
(this.props.mainCanvasWidth ?? layoutConfigurations.MOBILE.maxWidth);
|
2022-02-24 08:21:45 +00:00
|
|
|
|
2021-11-11 06:41:05 +00:00
|
|
|
return (
|
|
|
|
|
<ButtonGroupComponent
|
|
|
|
|
borderRadius={this.props.borderRadius}
|
|
|
|
|
boxShadow={this.props.boxShadow}
|
|
|
|
|
buttonClickHandler={this.handleClick}
|
2023-07-04 14:12:00 +00:00
|
|
|
buttonMinWidth={this.isAutoLayoutMode ? 120 : undefined}
|
2021-11-11 06:41:05 +00:00
|
|
|
buttonVariant={this.props.buttonVariant}
|
|
|
|
|
groupButtons={this.props.groupButtons}
|
|
|
|
|
isDisabled={this.props.isDisabled}
|
2023-07-04 14:12:00 +00:00
|
|
|
minHeight={this.isAutoLayoutMode ? this.props.minHeight : undefined}
|
2022-03-28 07:14:40 +00:00
|
|
|
minPopoverWidth={minPopoverWidth}
|
2021-11-11 06:41:05 +00:00
|
|
|
orientation={this.props.orientation}
|
2022-03-13 17:21:04 +00:00
|
|
|
renderMode={this.props.renderMode}
|
2022-03-28 07:14:40 +00:00
|
|
|
widgetId={this.props.widgetId}
|
2022-02-24 08:21:45 +00:00
|
|
|
width={componentWidth}
|
2021-11-11 06:41:05 +00:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ButtonGroupWidgetProps extends WidgetProps {
|
|
|
|
|
orientation: string;
|
|
|
|
|
isDisabled: boolean;
|
2022-05-04 09:45:57 +00:00
|
|
|
borderRadius?: string;
|
|
|
|
|
boxShadow?: string;
|
2021-11-11 06:41:05 +00:00
|
|
|
buttonVariant: ButtonVariant;
|
|
|
|
|
groupButtons: Record<
|
|
|
|
|
string,
|
|
|
|
|
{
|
|
|
|
|
widgetId: string;
|
|
|
|
|
id: string;
|
|
|
|
|
index: number;
|
|
|
|
|
isVisible?: boolean;
|
|
|
|
|
isDisabled?: boolean;
|
|
|
|
|
label?: string;
|
|
|
|
|
buttonType?: string;
|
|
|
|
|
buttonColor?: string;
|
|
|
|
|
iconName?: IconName;
|
|
|
|
|
iconAlign?: Alignment;
|
2021-12-08 13:11:13 +00:00
|
|
|
placement?: ButtonPlacement;
|
2021-11-11 06:41:05 +00:00
|
|
|
onClick?: string;
|
|
|
|
|
menuItems: Record<
|
|
|
|
|
string,
|
|
|
|
|
{
|
|
|
|
|
widgetId: string;
|
|
|
|
|
id: string;
|
|
|
|
|
index: number;
|
|
|
|
|
isVisible?: boolean;
|
|
|
|
|
isDisabled?: boolean;
|
|
|
|
|
label?: string;
|
|
|
|
|
backgroundColor?: string;
|
|
|
|
|
textColor?: string;
|
|
|
|
|
iconName?: IconName;
|
|
|
|
|
iconColor?: string;
|
|
|
|
|
iconAlign?: Alignment;
|
|
|
|
|
onClick?: string;
|
|
|
|
|
}
|
|
|
|
|
>;
|
|
|
|
|
}
|
|
|
|
|
>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ButtonGroupWidget;
|