@bpmn-io/properties-panel 1.3.0 → 1.4.0

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.
package/dist/index.js CHANGED
@@ -2168,6 +2168,16 @@ function Select(props) {
2168
2168
  value: localValue,
2169
2169
  disabled: disabled,
2170
2170
  children: options.map((option, idx) => {
2171
+ if (option.children) {
2172
+ return jsxRuntime.jsx("optgroup", {
2173
+ label: option.label,
2174
+ children: option.children.map((child, idx) => jsxRuntime.jsx("option", {
2175
+ value: child.value,
2176
+ disabled: child.disabled,
2177
+ children: child.label
2178
+ }, idx))
2179
+ }, idx);
2180
+ }
2171
2181
  return jsxRuntime.jsx("option", {
2172
2182
  value: option.value,
2173
2183
  disabled: option.disabled,
@@ -2297,13 +2307,15 @@ function prefixId$3(id) {
2297
2307
 
2298
2308
  function resizeToContents(element) {
2299
2309
  element.style.height = 'auto';
2300
- element.style.height = Math.min(element.scrollHeight + 2, 150) + 'px';
2310
+
2311
+ // a 2px pixel offset is required to prevent scrollbar from
2312
+ // appearing on OS with a full length scroll bar (Windows/Linux)
2313
+ element.style.height = `${element.scrollHeight + 2}px`;
2301
2314
  }
2302
2315
  function TextArea(props) {
2303
2316
  const {
2304
2317
  id,
2305
2318
  label,
2306
- rows = 2,
2307
2319
  debounce,
2308
2320
  onInput,
2309
2321
  value = '',
@@ -2311,7 +2323,8 @@ function TextArea(props) {
2311
2323
  monospace,
2312
2324
  onFocus,
2313
2325
  onBlur,
2314
- autoResize
2326
+ autoResize,
2327
+ rows = autoResize ? 1 : 2
2315
2328
  } = props;
2316
2329
  const [localValue, setLocalValue] = hooks.useState(value);
2317
2330
  const ref = useShowEntryEvent(id);