@bpmn-io/properties-panel 3.35.1 → 3.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1532,3 +1532,9 @@ textarea.bio-properties-panel-input {
1532
1532
  .bio-properties-panel-feel-popup .cm-gutters .cm-lineNumbers .cm-gutterElement {
1533
1533
  text-align: center;
1534
1534
  }
1535
+
1536
+ /* Checkbox Group */
1537
+ .bio-properties-panel-checkbox-group .bio-properties-panel-checkbox-group-entries > .bio-properties-panel-entry {
1538
+ margin: 0;
1539
+ padding: 0;
1540
+ }
package/dist/index.esm.js CHANGED
@@ -1028,9 +1028,11 @@ function PropertiesPanel(props) {
1028
1028
  return get(layout, key, defaultValue);
1029
1029
  };
1030
1030
  const setLayoutForKey = (key, config) => {
1031
- const newLayout = assign({}, layout);
1032
- set(newLayout, key, config);
1033
- setLayout(newLayout);
1031
+ setLayout(prevLayout => {
1032
+ const newLayout = assign({}, prevLayout);
1033
+ set(newLayout, key, config);
1034
+ return newLayout;
1035
+ });
1034
1036
  };
1035
1037
  const layoutContext = {
1036
1038
  layout,
@@ -1687,6 +1689,73 @@ function prefixId$8(id) {
1687
1689
  return `bio-properties-panel-${id}`;
1688
1690
  }
1689
1691
 
1692
+ /**
1693
+ * @param {Object} props
1694
+ * @param {Object} props.element
1695
+ * @param {String} props.id
1696
+ * @param {String} props.label
1697
+ * @param {Array<{label: String, value: *}>} props.options
1698
+ * @param {Function} props.getValue
1699
+ * @param {Function} props.setValue
1700
+ * @param {String} [props.description]
1701
+ * @param {string|import('preact').Component} [props.tooltip]
1702
+ * @param {boolean} [props.disabled]
1703
+ * @param {Function} [props.onFocus]
1704
+ * @param {Function} [props.onBlur]
1705
+ */
1706
+ function CheckboxGroup(props) {
1707
+ const {
1708
+ element,
1709
+ id,
1710
+ label,
1711
+ description,
1712
+ tooltip,
1713
+ options = [],
1714
+ getValue,
1715
+ setValue,
1716
+ disabled,
1717
+ onFocus,
1718
+ onBlur
1719
+ } = props;
1720
+ const value = getValue(element) || [];
1721
+ const handleOptionChange = (optionValue, checked) => {
1722
+ const newValue = checked ? [...value, optionValue] : value.filter(v => v !== optionValue);
1723
+ setValue(newValue);
1724
+ };
1725
+ return jsxs("div", {
1726
+ class: "bio-properties-panel-entry bio-properties-panel-checkbox-group",
1727
+ "data-entry-id": id,
1728
+ children: [jsx("div", {
1729
+ class: "bio-properties-panel-group-header",
1730
+ children: jsx("p", {
1731
+ class: "bio-properties-panel-label",
1732
+ children: jsx(TooltipWrapper, {
1733
+ value: tooltip,
1734
+ forId: id,
1735
+ element: element,
1736
+ children: label
1737
+ })
1738
+ })
1739
+ }), jsx("div", {
1740
+ class: "bio-properties-panel-checkbox-group-entries",
1741
+ children: options.map(option => jsx(CheckboxEntry, {
1742
+ id: `${id}-${option.value}`,
1743
+ label: option.label,
1744
+ setValue: checked => handleOptionChange(option.value, checked),
1745
+ getValue: () => value.includes(option.value),
1746
+ disabled: disabled,
1747
+ onFocus: onFocus,
1748
+ onBlur: onBlur,
1749
+ element: element
1750
+ }, option.value))
1751
+ }), jsx(Description, {
1752
+ forId: id,
1753
+ element: element,
1754
+ value: description
1755
+ })]
1756
+ });
1757
+ }
1758
+
1690
1759
  /**
1691
1760
  * Button to open popups.
1692
1761
  *
@@ -4692,5 +4761,5 @@ var index = {
4692
4761
  feelPopupRenderer: ['type', FeelPopupRenderer]
4693
4762
  };
4694
4763
 
4695
- export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelLanguageContext, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, OpenPopupIcon, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$8 as isCheckboxEntryEdited, isEdited$5 as isFeelEntryEdited, isEdited$6 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$7 as isToggleSwitchEntryEdited, useDebounce, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
4764
+ export { ArrowIcon, CheckboxEntry, CheckboxGroup, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelLanguageContext, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, OpenPopupIcon, Placeholder, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$8 as isCheckboxEntryEdited, isEdited$5 as isFeelEntryEdited, isEdited$6 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$7 as isToggleSwitchEntryEdited, useDebounce, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
4696
4765
  //# sourceMappingURL=index.esm.js.map