MicroStrategy ONE
Component API for the React Format Panel
This feature is available starting in MicroStrategy 2021 Update 3.
In your config file, you can use the following tagName
(component types) in the config object:
BorderAndColorFill
This higher order component is used to manage properties such as border, fill color, opacity, and so on.
Parameters
Name |
Description |
---|---|
min | The minimum border opacity. |
max | The maximum border opacity. |
format | The format for border opacity. |
defaultValue | The default value for border opacity. |
borderStyleOptions | enum values used to format the border style. Example: 1 pt dotted, 1 pt solid |
borderStyleIcons | A list of icons used to represent border styling options (borderStyleOptions). borderStyleIcons should match the borderStyleOptions |
keyIDs | An array of keyIDs used to add to individual components. |
onChange | An onChange function to call when the property value changes. |
borderOnSameLine | Some designs may need the border, border color, and border opacity to be on the same horizontal layout. Use this property to set the alignment. |
title | A header title. |
showWeight | Chose whether to display the border weight property. |
alternateColorPicker | An alternate color picker. Use this to pass in a color picker with specific properties already selected. |
useFillGradient | Specify if the fill should use a gradient. |
useColorPickerOpacity |
Specify whether the fill section should use a color picker with the opacity section turned on. |
Example
{
"tagName": "BorderAndColorFillConfig",
"keyIDs": {
"fillColor": "containerFill",
"fillOpacity": "container_bo",
"borderStyle": "container_borderStyle",
"borderColor": "container_borderColor"
},
"borderOnSameLine": true,
"title": "Style",
"showWeight": true
}
Button
A standard button that is useful for triggering a logical action through an event.
Parameters
Name |
Description |
---|---|
text | The button text |
type | Changes the look of the button. See the Ant Design documentation for more information about the various types. |
innerClassName | The wrapper class name for button text. |
icon | The icon class name for the button, which is appended after innerClassName. |
size | The size of the button. Check the Ant Design documentation for all sizes. |
style | An extra CSS style object for the button. |
disabled | The disabled status of the button. |
onClick | A function triggered when the button is clicked. |
onChange | A function triggered when the button is clicked. It is called with a specified keyID. |
Example
{
"tagName": "Button",
"text": "Regular"
}
ButtonList
A list of buttons that can be used for single or multiple selection.
Parameters
Name |
Description |
---|---|
buttonType | The type of button to display. |
options | An array of objects describing each button. The name is used for styling. ariaLabel is assigned to the aria-label attribute. |
title | A string value that appears to the left of the button list. |
default | A number that determines which button is selected by default. |
ariaLabel | A string that is assigned to the aria-label attribute in the top level wrapper container of this component. |
useTooltips | Determines whether to use tooltips. |
Example
{
tagName: 'ButtonList',
title: 'Button List Icons',
buttonType: 'icon',
options: [
{ name: 'option1', ariaLabel: 'aria-label-option1' },
{ name: 'option2', ariaLabel: 'aria-label-option2' },
],
ariaLabel: 'button-list-icon',
className: 'button-list-icon',
};
Checkbox
A checkbox for turning a setting on or off.
Parameters
Name |
Description |
---|---|
checked | Determines whether the checkbox should be selected at the start. If not specified, the checkbox is unselected. |
text | Label text for the checkbox. |
isValueString | The checked value in onChange is normally a Boolean. This option converts it to a string. |
isIndeterminate | Determines whether to display if the state is indeterminate. |
firstRenderNeedsDispatch | Determines whether the checkbox should dispatch a check event when it is rendered for the first time (in some cases), such as a status change of other controls. |
Example
{
"tagName": "Checkbox",
"checked": true,
"text": "Regular checkbox"
}
ColorFillButton
A button with a color fill and icon.
Parameters
Name |
Description |
---|---|
colorHexValues | The hex color values used on the button. |
onChange | The function called when the button is clicked. |
ariaLabel | The aria label for the button. |
isImageBased | Determines if the button need to be image based. This means an image appears on the button. |
icon | The class name for image based buttons. |
Example
{
"tagName": "ColorFillButton",
"colorHexValues": ["#d5e2dd", "#94c4bc", "#3db3b9", "#2293a9", "#1a6e8c"],
"ariaLabel": "Edit threshold"
}
ColorPalette
A wrapper component for ColorPicker and is used to display multiple color pickers as a pallette.
Parameters
Name |
Description |
---|---|
themePalette | A palette provided by the user from the dashboard's global settings. |
essentiaPalette | A palette of essential colors. If this is undefined, the default palette from the color picker is used. |
func | A func parameter provided by user. The logic is the same as in the other components. |
parentIsHidden | The state of the parent component. |
keyID | An identifier for the component instance. |
useGradient | This parameter is passed down to the color picker component to determine if the gradient tab should appear. |
title | The title of the color palette. |
Example
{
"tagName": "ColorPalette",
"key": "basic"
}
ColorPicker
A standard color picker. It can be used to select or edit colors using RGB or hex values.
Parameters
Name |
Description |
---|---|
text | The button text. |
type | Changes the look of the button. See the Ant Design documentation for more information about the different types. |
useOpacity | Determines whether to include the opacity slider in the color picker. |
useGradient | Determines whether to include the gradient tab in the color picker. |
opacity | The opacity value of the color picker. |
onOpacityChange | A callback function for changing the opacity. |
value | The hex or RGB value in the color picker. Example: #993300 |
encode | When specified, the color is encoded before passing it to color picker component. |
Example
{
"tagName": "ColorPicker"
}
ColorPickerWithOpacity
A config component that comes with a color picker and an input number. The input number corresponds with the opacity of the color. When the opacity of one of the components changes, it changes the values in the other components as well.
Parameters
Name |
Description |
---|---|
min | The minimum border opacity. |
max | The maximum border opacity. |
format | A string to add along to the value of the input number. |
defaultValue | The default opacity. |
alternateColorPicker | Passes an alternate color picker in place of the default one. |
useFillGradient | Determines whether the color picker includes the gradient tab. |
onChange | A callback function to use for both the color picker and the input number. |
EditableText
This component is a replacement for text when double-clicking to edit it.
Parameters
Name |
Description |
---|---|
keyID | A key to send to onChange |
onChange | A callback to getApply. |
text | The default title text. |
ariaLabel | Passes the aria label to mark the text as editable. |
Example
{
tagName: 'EditableText',
text: 'original'
};
FontConfig
A higher order component for managing font properties like font family, size, style, and so on. Depending on your needs, you can manage which font properties ap
Parameters
Name |
Description |
---|---|
fontFamily | The font family options. |
fontStyle | The font style options such as bold, italic, and so on. |
defaultFontStyles | The default values for font styles, if the values are not defined. |
minFontSize | The minimum font size. |
maxFontSize | The maximum font size. |
defaultFontSize | The default font size, if the font size is not defined. |
isFontSizeString | A Boolean value to check if you need font sizes in string format, such as '10px'. |
format | The font size format, such as '%', 'px', 'pt', and so on. |
showFontSizeStepper | A Boolean used to determine whether to display a stepper for the Font Size component . |
horizontalAlignmentOptions | The options for horizontal alignment. |
verticalAlign | The options for vertical alignment. |
rotationOptions | The font rotation options. |
keyIDs | An array of keyIDs used to add to individual components. |
displayOptions | An array of font properties to display. |
alternateColorPicker | An alternate color picker. Use this to pass in a color picker with specific properties already selected. |
onChange |
The onChange function. |
Example
{
{
"tagName": "FontConfig",
"keyIDs": {
"fontName": "fontName",
"fontStyle": "fontStyle",
"fontSize": "fontSize",
"fontColor": "fontColor",
"textAlignment": "textAlignment",
"verticalAlign" : "verticalAlign",
"rotation": "rotation"
},
"displayOptions": [
"title",
"nameSelect",
"style",
"sizeAndColor",
"horizontalAlign",
"verticalAlign",
"rotation"
]
}
FontSizer
Component used as a stepper to edit font size.
Parameters
Name |
Description |
---|---|
stepSize | The amount the font size changes with each step. The default is 2. |
minValue | The minimum font size. |
maxValue | The maximum font size. |
defaultValue | The default font size. |
keyID | A unique key to distinguish this component. |
onChange | A function to call when the font size changes. |
showResetIcon | A Boolean value that determines whether to display a reset icon. This allows the user to reset the current value to the default one. |
allowDecimals | A Boolean value that determines if decimal values are allowed. |
Example
{
tagName: 'FontSizer',
key: KPI_PROP.FONT_UNIFY_STEPS,
stepSize: 1,
defaultValue: 0,
minValue: -34,
showResetIcon: true
},
HideableLayout
Used as a container for child elements, with an on/off toggle.
Parameters
Name |
Description |
---|---|
title | The layout title. |
children | The content to be rendered inside the layout. |
contextMenuItems | An array of items that appear in the context menu. |
withSwitch | Determines whether to render a switch next to the layout title. |
switchValue |
If set to false, the layout switch is disabled and the layout cannot be expanded. |
returnAllStatus | If set to true, switchValue, isExpanded, and isSwitchDisabled are returned as an object. |
switchFunc | An extra function that is dispatched when the switch value is changed. |
Example
{
tagName: 'HideableLayout',
title: 'Basic Hideable Layout',
className: 'hideable-layout',
children: [
{
tagName: 'Text',
key: 'content1',
text: 'Grid'
},
{
tagName: 'Text',
key: 'content2',
text: 'Content for button 2'
},
{
tagName: 'Text',
key: 'content3',
text: 'Content for button 3'
}
]
};
HorizontalLayout
A layout where all elements are horizontal.
Parameters
Name |
Description |
---|---|
children | Any elements that exist inside this layout. |
keyID | A unique key to distinguish this component. |
Example
{
"tagName": "HorizontalLayout",
"children": [
{
"tagName": "Button",
"text": "button 1"
},
{
"tagName": "Button",
"text": "button 2"
}
]
}
IconButton
A button that is an icon.
Parameters
Name |
Description |
---|---|
icon | The class name for the icon. The icon is in the background. |
onClick | A function triggered when the button is clicked. |
ariaLabel | An aria label for the icon. |
Example
{
tagName: 'IconButton',
icon: 'revert-to-default',
tooltipTitle: { desc: 12061, name: 'Restore to Original Size' },
}
InfoIcon
Displays an icon, along with text, when hovering over an item.
Parameters
Name |
Description |
---|---|
tooltip | A tooltip that appears when hovering over the icon. |
Example
{
tagName: 'InfoIcon',
tooltip: {
tagName: 'VerticalLayout',
className: 'min-size-tooltip-container',
children: [
{
tagName: 'Text',
className: 'header-text',
text: { desc: 11990, name: 'Proportional' }
},
{
tagName: 'Text',
className: 'subcontent-text',
text: {
desc: 13743,
name: 'The smallest element\'s size is proportional to its data element'
}
},
{
tagName: 'Text',
className: 'header-text',
text: { desc: 13741, name: 'Full Range' }
},
{
tagName: 'Text',
className: 'subcontent-text',
text: {
desc: 13744,
name: 'The smallest element\'s size is fixed, independent of its data value'
}
},
{
tagName: 'Text',
className: 'header-text',
text: { desc: 14118, name: 'Adjusted Range' }
},
{
tagName: 'Text',
className: 'subcontent-text bottom-subcontent',
text: {
desc: null, // TODO: Add string
name: 'The smallest element\'s size is the percentage of the largest element\'s size as you defined'
}
},
]
},
}
Input
A text box to input data.
Parameters
Name |
Description |
---|---|
value | The initial value of the input. |
placeholder | A placeholder for the input value. |
displayErrorIcon | Determines whether to display an error icon inside the input field. |
dataType | The data type for input validation such as number, alphanumeric, and so on. |
onValidate | Validates the input. |
rows | Determines the height of the text area. It corresponds to the number of lines. |
autoFocus | Allows the input box to be focused on render. |
blurCallback | Passes in a function to call on a blur event. |
Example
{
tagName: 'VerticalLayout',
children: [
{
tagName: 'Text',
text: 'Regular Input'
},
{
"tagName": "Input",
"placeholder": "Default Text"
}
{
tagName: 'Text',
text: 'Regular Text Area'
},
{
tagName: 'Input',
isTextArea: true,
},
{
tagName: 'Text',
text: 'Specify Height'
},
{
tagName: 'Input',
isTextArea: true,
rows: 4
},
]
};
InputNumber
An input specifically for numbers that gives access to a stepper.
Parameters
Name |
Description |
---|---|
format | A string to add along to the value. |
max | The maximum input value. |
min | The minimum input value. |
showStepper | Determines if the stepper appears. The default setting is true. |
value | The number shown in the input. |
step | The amount the input number changes with each step. The default setting is 1. |
precision | The amount of extra decimals to display. The default value is 0. |
validateRange | If the Input Number component is from InputNumberRange, validate if the value is in the given limits. Example: min <= value <= max |
errorTooltipText | The tooltip to display when the validateRange function returns false. Example: The value exceeds the min-max range. |
displayError | A Boolean value that determines whether to display the error as a tooltip. |
Example
{
tagName: 'InputNumber',
step: 0.01,
precision: 2,
applyChangeOnFocusOut: true,
min: 0,
max: 1,
format: 'px'
}
MultiSelect
Selection component where you choose multiple options, instead of just one. It is useful for replacing columns of checkboxes.
Parameters
Name |
Description |
---|---|
value | A list of all selected options. |
options | The options to be shown for selection. |
placeholder | Text that appears when no options are selected. |
maxTagCount | The number of options that can appear in the top bar before they are cut off. |
selectAll | The option to use for the select all value. If this isn't included, the option to select all in a single click is not available. |
onlySendChangedValue |
The list of selected values are normally sent in onChange. If this parameter is turned on, it only sends the value that was just changed and whether it was selected. |
Example
{
tagName: 'MultiSelect',
placeholder: 'Select multiple options',
options: [
{ name: 'A', value: 1 },
{ name: 'B', value: 2 },
{ name: 'C', value: 3 },
],
};
MultiSelectBar
A component with multiple checkable tags instead. All values can be turned on or off, independent of other values.
Parameters
Name |
Description |
---|---|
checked | An array that is the size of the total amount of items. Determines whether each item is selected. |
options | An array that is the size of the total amount of items. Determines what values appear for each child. |
type | Determines whether children use icons or text for their values. |
ariaLabels | An array that is the size of the total amount of items. Provides aria labels for each child. |
atLeastOneChecked | Determines whether to force at least one child to be selected. You should force at least one child to be selected if your UX requires that the multi-select bar should never be empty. |
innerClassName | A class name given to each child using icons. This helps add a specifier to the icon class name. |
tooltips | An array of strings that should appear as tooltips when hovering over each tab. |
useTooltips | Determines whether to display tooltips. If no tooltips are specified, ariaLabels is used instead |
Example
{
tagName: 'MultiSelectBar',
checked: [false, false, false, false],
innerClassName: 'property-panel-icons',
useTooltips: true,
ariaLabels: ['Bold', 'Italic', 'Underline', 'Underscore'],
options: ['bold', 'italic', 'underline', 'underscore'],
};
NestedSelect
A selection component with the ability to have nested content for specific options.
Parameters
Name |
Description |
---|---|
value | A value to represent the currently selected option. |
options | A list of items in the dropdown. If there is subContent in an option, it should be in the form of a React component. |
visible | Determines the display of the dropdown. |
className | An extra class name to pass to this component. |
conflictOption | An option to show when the selected option is not in options. |
Example
{
tagName: 'NestedSelect',
value: '2',
options: [
{ value: '1', name: 'Option 1' },
{
value: '2',
name: 'Option 2',
subContent: {
tagName: 'Button',
text: 'Nested button'
},
buttonBar: {
ok: {
id: 'okButton',
text: 'OK'
},
cancel: {
id: 'cancelButton',
text: 'Cancel'
}
}
},
{ value: '3', name: 'Option 3' },
],
};
Popup
A popup screen that only takes up a portion of the screen and can be closed. This is useful for Settings screens.
Parameters
Name |
Description |
---|---|
title | The title of the popup. |
children | All content inside the popup. |
onSubmit | The logic to apply when the Apply or OK buttons are clicked. |
Example
{
tagName: 'VerticalLayout',
children: [
{
tagName: 'Button',
key: 'button',
text: 'Show the popup',
func: {
type: 'hide',
targets: ['popup'],
payload: false
}
},
{
tagName: 'Popup',
title: 'Title',
key: 'popup',
children: [
{
tagName: 'Text',
text: 'Text'
}
]
}
]
};
PositionAndSize
A higher order component for managing position and size properties.
Parameters
Name |
Description |
---|---|
min | The minimum value for height, width, top and left position. |
max | The maximum value for height, width, top and left position. |
format | The format for height, width, top and left position. |
keyIDs | An array of keyIDs used to add to individual components. |
hasPositionSelect | A selector of position options. |
positionOptions | The position options. |
onChange | A function to call when a property value changes. |
Example
{
"tagName": "VerticalLayout",
"children": [
{
"tagName": "PositionSizeConfig"
}
]
}
Radio
An array of radio buttons.
Parameters
Name |
Description |
---|---|
items | All of the options that appear. |
default | The default option, based on the index. |
horizontal | Determines whether to use a horizontal display. |
default | The default value of the radio buttons. |
useButtons | Determines whether to display as a button. |
useIcons | Determines whether to display as an icon. |
useTooltips | Determines whether to display tooltips. |
Example
{
"tagName": "Radio",
"options": ["Item 1", "Item 2", "Item 3"]
}
SegmentControl
Used as a container to hold several tabs; three at the most. Each tab can have their own panel and children.
Parameters
Name |
Description |
---|---|
default | The default option, based on the index. |
options | An array containing icon names and aria labels for each of three buttons in SegmentControl. |
children | The components that appear alongside the SegmentControl switch. |
useTooltip | A Boolean that determines if each child has tooltip text. |
Example
{
tagName: 'SegmentControl',
options: [
{
icon: 'grid',
ariaLabel: 'grid-label'
},
{
icon: 'text-format',
ariaLabel: 'text-format-label'
},
{
icon: 'title-container',
ariaLabel: 'title-container-label'
},
],
ariaLabel: 'segment-control-label',
className: 'segment-control',
children: [
{
tagName: 'Text',
key: 'content1',
text: 'Grid'
},
{
tagName: 'Text',
key: 'content2',
text: 'Content for button 2'
},
{
tagName: 'Text',
key: 'content3',
text: 'Content for button 3'
}
]
};
SegmentControlDropdownMenu
A SegmentControl
component has a SegmentControlDropdownMenu
with a dropdown of menu options. Each menu option corresponds to a separate panel. The dropdown menu options are used instead of tabs.
Parameters
Name |
Description |
---|---|
default | The default selected option index. |
optionDisplayNames | A list of option names to display. |
children | Components to display alongside the SegmentControlDropdownMenu. |
reuseChild | If true, always use the first child. The default setting is false. |
hideOptions | A Boolean property to hide the option dropdown menu. |
hideOptionsWithOneChild | A Boolean property to hide the option dropdown menu if there is only one child. |
Example
{
tagName: 'SegmentControlDropdownMenu',
optionDisplayNames: [
'option 1', 'option 2',
],
children: [
{
tagName: 'VerticalLayout',
children: [
{
tagName: 'Checkbox',
checked: true,
text: 'Click me to hide the text',
func: {
type: 'hide',
targets: ['textToHide', 'transferToHide', 'layoutToHide']
}
},
{
tagName: 'Checkbox',
key: 'textToHide',
text: 'Hide Me'
},
{
tagName: 'Transfer',
key: 'transferToHide',
sourceTitle: 'Left Axis',
targetTitle: 'Right Axis',
options: [{ n: 'Metric 1' }, { n: 'Metric 2' }, { n: 'Metric 3' }, { n: 'Metric 4' }]
},
{
tagName: 'VerticalLayout',
key: 'layoutToHide',
children: [
{
tagName: 'Text',
text: 'This is inside of a layout'
}
]
}
]
},
{
tagName: 'VerticalLayout',
children: [
{
tagName: 'Checkbox',
checked: true,
text: 'Text next to a checkbox'
},
{ tagName: 'ColorPicker' },
{
tagName: 'Input',
placeholder: 'Default Text'
},
{
tagName: 'Text',
text: 'Aliquam ultrices, augue nec viverra tempor, erat nisl consequat tortor, vitae dictum nunc sem at justo. Cras et ullamcorper neque, ut facilisis est. Aliquam finibus mauris ultricies turpis volutpat mollis.'
}
]
}
]
};
SegmentControlSelect
A select dropdown that renders content, passed as children, based on its selection.
Parameters
Name |
Description |
---|---|
title | The title that appears on the left side of the select dropdown. |
default | The default option, based on the index. |
options | All content in the dropdown. |
children | Components to display below the SegmentControlSelect dropdown. |
Example
{
tagName: 'SegmentControlSelect',
options: ['content1', 'content2', 'content3'],
className: 'basic-class',
children: [
{
tagName: 'Text',
key: 'content1',
text: 'Box Plot'
},
{
tagName: 'Text',
key: 'content2',
text: 'Content for button 2'
},
{
tagName: 'Text',
key: 'content3',
text: 'Content for button 3'
}
]
};
Select
A dropdown bar that alllows the selection of one option. This is useful for when you have multiple options, but only want to choose one. This component has a better look and feel than radio buttons and should be used instead of radio buttons if there are more than four options.
Parameters
Name |
Description |
---|---|
icons | Icons to display next to menu items. |
name | The default value that appears in the dropdown. |
options | All content in the dropdown. |
isValueNumber |
The selected value in onChange is a normally a string. This option converts it to a number. |
showOptionTooltip | Displays tooltips for options in the dropdown. |
dropdownClassName | The class name to pass into the select dropdown. It is always a sibling of mstr-antd. |
Example
{
"tagName": "Select",
"className": "selectColorScheme",
"options": [
"This is a loooooooooooooooooooooooooooooooooooong selection",
"Longer one is another long long long long long long long long one",
"short"
],
"key": "regular",
"ariaLabel": "Regular select"
}
Slider
A slider displays current values and intervals in a range.
Parameters
Name |
Description |
---|---|
max | The maximum value. If range is off, use number. If range is on, use [number, number]. |
min | The minimum value. If range is off, use number. If range is on, use [number, number]. |
range | A dual thumb mode. |
step | A number to denote increments when moving the slider. |
format | A string to format the tooltip or a function to format the tooltip. |
tooltipVisible |
Do not give this parameter a value for default tooltip behavior. If false, the tooltip never appears. If true, the tooltip always appears. |
value | If range is off, use number. If range is on, use [number, number]. |
Example
{
tagName: 'Slider',
max: 100,
min: 0,
};
Switch
A switch button, best used for turning a setting on or off.
Parameters
Name |
Description |
---|---|
on | Whether the switch should set to on at the start. The switch is on by default. |
text | A text label above the switch. |
Example
{
tagName: 'Switch',
on: true,
};
Text
Simple text display text.
Parameters
Name |
Description |
---|---|
text | The text content. |
type | The text design. See the Ant Design documentation for all types. |
Example
{
tagName: 'Text',
text: 'This is some text'
};
Tooltip
Displays a tooltip when hovering over an item.
Parameters
Name |
Description |
---|---|
title | The tooltip content. |
placement | The placement of the tooltip at 'left', 'right', 'top', or 'bottom'. |
mouseEnterDelay | A delay between when the user hovers over the tooltip and when it appears. |
autoAdjustOverflow | Determines whether to automatically adjust the tooltip width when the text overflows. |
Example
{
tagName: 'AdvancedTooltip',
tooltipContent: {
title:'title Testing description paragraph with some text. H',
description:'Testing description paragraph with some text. Here is some additional text Testing description paragraph with some text. H Testing description paragraph with some text. H',
link: {
name: 'Learn More',
address: '/'
},
animation:'testtitle',
}
};
Transfer
A double column transfer box that is useful when you want to transfer content from one category to another.
Parameters
Name |
Description |
---|---|
items | The content in the transfer box. |
targetOptions | Items that should start out in the right column. |
sourceTitle | The title of the left box. |
targetTitle | The title of the right box. |
Example
{
"tagName": "Transfer",
"key": "regular",
"sourceTitle": "Left Axis",
"targetTitle": "Right Axis",
"options": [
{
"n": "Metric 1",
"dssid": 0
},
{
"n": "Metric 2",
"dssid": 1
},
{
"n": "Metric 3",
"dssid": 2
},
{
"n": "Metric 4",
"dssid": 3
}
]
}
VerticalLayout
A layout where all the elements inside are vertical. This is useful for wrapping children that have dependencies, since they must have a common parent.
Parameters
Name |
Description |
---|---|
children | Any elements that exist inside this layout. |
Example
{
"tagName": "VerticalLayout",
"children": [
{
"tagName": "Button",
"text": "button 1"
},
{
"tagName": "Button",
"text": "button 2"
}
]
}