@bpmn-io/properties-panel 0.22.0 → 0.24.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.esm.js CHANGED
@@ -1183,7 +1183,9 @@ function Checkbox(props) {
1183
1183
  label,
1184
1184
  onChange,
1185
1185
  disabled,
1186
- value = false
1186
+ value = false,
1187
+ onFocus,
1188
+ onBlur
1187
1189
  } = props;
1188
1190
  const [localValue, setLocalValue] = useState(value);
1189
1191
 
@@ -1212,6 +1214,8 @@ function Checkbox(props) {
1212
1214
  ref: ref,
1213
1215
  id: prefixId$7(id),
1214
1216
  name: id,
1217
+ onFocus: onFocus,
1218
+ onBlur: onBlur,
1215
1219
  type: "checkbox",
1216
1220
  class: "bio-properties-panel-input",
1217
1221
  onChange: handleChange,
@@ -1232,6 +1236,8 @@ function Checkbox(props) {
1232
1236
  * @param {String} props.label
1233
1237
  * @param {Function} props.getValue
1234
1238
  * @param {Function} props.setValue
1239
+ * @param {Function} props.onFocus
1240
+ * @param {Function} props.onBlur
1235
1241
  * @param {boolean} [props.disabled]
1236
1242
  */
1237
1243
 
@@ -1244,7 +1250,9 @@ function CheckboxEntry(props) {
1244
1250
  label,
1245
1251
  getValue,
1246
1252
  setValue,
1247
- disabled
1253
+ disabled,
1254
+ onFocus,
1255
+ onBlur
1248
1256
  } = props;
1249
1257
  const value = getValue(element);
1250
1258
  const error = useError(id);
@@ -1256,6 +1264,8 @@ function CheckboxEntry(props) {
1256
1264
  id: id,
1257
1265
  label: label,
1258
1266
  onChange: setValue,
1267
+ onFocus: onFocus,
1268
+ onBlur: onBlur,
1259
1269
  value: value
1260
1270
  }, element), error && jsx("div", {
1261
1271
  class: "bio-properties-panel-error",
@@ -1438,6 +1448,7 @@ function FeelTextfield(props) {
1438
1448
  feel,
1439
1449
  value = '',
1440
1450
  disabled = false,
1451
+ variables,
1441
1452
  OptionalComponent = OptionalFeelInput
1442
1453
  } = props;
1443
1454
  const [localValue, _setLocalValue] = useState(value);
@@ -1448,7 +1459,7 @@ function FeelTextfield(props) {
1448
1459
  const [focus, _setFocus] = useState(undefined);
1449
1460
 
1450
1461
  const setFocus = (offset = 0) => {
1451
- const hasFocus = containerRef.current.contains(document.activeElement); // Keep carret position if it is already focused, otherwise focus at the end
1462
+ const hasFocus = containerRef.current.contains(document.activeElement); // Keep caret position if it is already focused, otherwise focus at the end
1452
1463
 
1453
1464
  const position = hasFocus ? document.activeElement.selectionStart : Infinity;
1454
1465
 
@@ -1594,7 +1605,7 @@ function FeelTextfield(props) {
1594
1605
  },
1595
1606
  onLint: handleLint,
1596
1607
  value: feelOnlyValue,
1597
- variables: props.variables,
1608
+ variables: variables,
1598
1609
  ref: editorRef
1599
1610
  }) : jsx(OptionalComponent, { ...props,
1600
1611
  onInput: handleLocalInput,
@@ -1610,7 +1621,9 @@ const OptionalFeelInput = forwardRef((props, ref) => {
1610
1621
  id,
1611
1622
  disabled,
1612
1623
  onInput,
1613
- value
1624
+ value,
1625
+ onFocus,
1626
+ onBlur
1614
1627
  } = props;
1615
1628
  const inputRef = useRef(); // To be consistent with the FEEL editor, set focus at start of input
1616
1629
  // this ensures clean editing experience when switching with the keyboard
@@ -1644,8 +1657,8 @@ const OptionalFeelInput = forwardRef((props, ref) => {
1644
1657
  disabled: disabled,
1645
1658
  class: "bio-properties-panel-input",
1646
1659
  onInput: e => onInput(e.target.value),
1647
- onFocus: props.onFocus,
1648
- onBlur: props.onBlur,
1660
+ onFocus: onFocus,
1661
+ onBlur: onBlur,
1649
1662
  value: value || ''
1650
1663
  });
1651
1664
  });
@@ -1654,7 +1667,9 @@ const OptionalFeelTextArea = forwardRef((props, ref) => {
1654
1667
  id,
1655
1668
  disabled,
1656
1669
  onInput,
1657
- value
1670
+ value,
1671
+ onFocus,
1672
+ onBlur
1658
1673
  } = props;
1659
1674
  const inputRef = useRef(); // To be consistent with the FEEL editor, set focus at start of input
1660
1675
  // this ensures clean editing experience when switching with the keyboard
@@ -1681,8 +1696,8 @@ const OptionalFeelTextArea = forwardRef((props, ref) => {
1681
1696
  disabled: disabled,
1682
1697
  class: "bio-properties-panel-input",
1683
1698
  onInput: e => onInput(e.target.value),
1684
- onFocus: props.onFocus,
1685
- onBlur: props.onBlur,
1699
+ onFocus: onFocus,
1700
+ onBlur: onBlur,
1686
1701
  value: value || ''
1687
1702
  });
1688
1703
  });
@@ -1711,7 +1726,11 @@ function FeelEntry(props) {
1711
1726
  getValue,
1712
1727
  setValue,
1713
1728
  validate,
1714
- show = noop
1729
+ show = noop,
1730
+ example,
1731
+ variables,
1732
+ onFocus,
1733
+ onBlur
1715
1734
  } = props;
1716
1735
  const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
1717
1736
  const [validationError, setValidationError] = useState(null);
@@ -1751,7 +1770,7 @@ function FeelEntry(props) {
1751
1770
  }
1752
1771
 
1753
1772
  const temporaryError = useError(id);
1754
- const error = temporaryError || validationError || localError;
1773
+ const error = localError || temporaryError || validationError;
1755
1774
  return jsxs("div", {
1756
1775
  class: classnames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),
1757
1776
  "data-entry-id": id,
@@ -1763,10 +1782,12 @@ function FeelEntry(props) {
1763
1782
  label: label,
1764
1783
  onInput: onInput,
1765
1784
  onError: onError,
1766
- example: props.example,
1785
+ onFocus: onFocus,
1786
+ onBlur: onBlur,
1787
+ example: example,
1767
1788
  show: show,
1768
1789
  value: value,
1769
- variables: props.variables,
1790
+ variables: variables,
1770
1791
  OptionalComponent: props.OptionalComponent
1771
1792
  }, element), error && jsx("div", {
1772
1793
  class: "bio-properties-panel-error",
@@ -1788,6 +1809,8 @@ function FeelEntry(props) {
1788
1809
  * @param {String} props.label
1789
1810
  * @param {Function} props.getValue
1790
1811
  * @param {Function} props.setValue
1812
+ * @param {Function} props.onFocus
1813
+ * @param {Function} props.onBlur
1791
1814
  * @param {Function} props.validate
1792
1815
  */
1793
1816
 
@@ -2004,7 +2027,9 @@ function NumberField(props) {
2004
2027
  min,
2005
2028
  onInput,
2006
2029
  step,
2007
- value = ''
2030
+ value = '',
2031
+ onFocus,
2032
+ onBlur
2008
2033
  } = props;
2009
2034
  const [localValue, setLocalValue] = useState(value);
2010
2035
  const handleInputCallback = useMemo(() => {
@@ -2049,6 +2074,8 @@ function NumberField(props) {
2049
2074
  max: max,
2050
2075
  min: min,
2051
2076
  onInput: handleInput,
2077
+ onFocus: onFocus,
2078
+ onBlur: onBlur,
2052
2079
  step: step,
2053
2080
  value: localValue
2054
2081
  })]
@@ -2066,6 +2093,8 @@ function NumberField(props) {
2066
2093
  * @param {String} props.max
2067
2094
  * @param {String} props.min
2068
2095
  * @param {Function} props.setValue
2096
+ * @param {Function} props.onFocus
2097
+ * @param {Function} props.onBlur
2069
2098
  * @param {String} props.step
2070
2099
  */
2071
2100
 
@@ -2082,7 +2111,9 @@ function NumberFieldEntry(props) {
2082
2111
  max,
2083
2112
  min,
2084
2113
  setValue,
2085
- step
2114
+ step,
2115
+ onFocus,
2116
+ onBlur
2086
2117
  } = props;
2087
2118
  const value = getValue(element);
2088
2119
  return jsxs("div", {
@@ -2094,6 +2125,8 @@ function NumberFieldEntry(props) {
2094
2125
  id: id,
2095
2126
  label: label,
2096
2127
  onInput: setValue,
2128
+ onFocus: onFocus,
2129
+ onBlur: onBlur,
2097
2130
  max: max,
2098
2131
  min: min,
2099
2132
  step: step,
@@ -2120,7 +2153,9 @@ function Select(props) {
2120
2153
  onChange,
2121
2154
  options = [],
2122
2155
  value,
2123
- disabled
2156
+ disabled,
2157
+ onFocus,
2158
+ onBlur
2124
2159
  } = props;
2125
2160
  const ref = useShowEntryEvent(id);
2126
2161
  const [localValue, setLocalValue] = useState(value);
@@ -2155,6 +2190,8 @@ function Select(props) {
2155
2190
  name: id,
2156
2191
  class: "bio-properties-panel-input",
2157
2192
  onInput: handleChange,
2193
+ onFocus: onFocus,
2194
+ onBlur: onBlur,
2158
2195
  value: localValue,
2159
2196
  disabled: disabled,
2160
2197
  children: options.map((option, idx) => {
@@ -2175,6 +2212,8 @@ function Select(props) {
2175
2212
  * @param {string} props.label
2176
2213
  * @param {Function} props.getValue
2177
2214
  * @param {Function} props.setValue
2215
+ * @param {Function} props.onFocus
2216
+ * @param {Function} props.onBlur
2178
2217
  * @param {Function} props.getOptions
2179
2218
  * @param {boolean} [props.disabled]
2180
2219
  */
@@ -2189,7 +2228,9 @@ function SelectEntry(props) {
2189
2228
  getValue,
2190
2229
  setValue,
2191
2230
  getOptions,
2192
- disabled
2231
+ disabled,
2232
+ onFocus,
2233
+ onBlur
2193
2234
  } = props;
2194
2235
  const value = getValue(element);
2195
2236
  const options = getOptions(element);
@@ -2202,6 +2243,8 @@ function SelectEntry(props) {
2202
2243
  label: label,
2203
2244
  value: value,
2204
2245
  onChange: setValue,
2246
+ onFocus: onFocus,
2247
+ onBlur: onBlur,
2205
2248
  options: options,
2206
2249
  disabled: disabled
2207
2250
  }, element), error && jsx("div", {
@@ -2288,7 +2331,9 @@ function TextArea(props) {
2288
2331
  onInput,
2289
2332
  value = '',
2290
2333
  disabled,
2291
- monospace
2334
+ monospace,
2335
+ onFocus,
2336
+ onBlur
2292
2337
  } = props;
2293
2338
  const [localValue, setLocalValue] = useState(value);
2294
2339
  const ref = useShowEntryEvent(id);
@@ -2323,8 +2368,8 @@ function TextArea(props) {
2323
2368
  spellCheck: "false",
2324
2369
  class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : ''),
2325
2370
  onInput: handleInput,
2326
- onFocus: props.onFocus,
2327
- onBlur: props.onBlur,
2371
+ onFocus: onFocus,
2372
+ onBlur: onBlur,
2328
2373
  rows: rows,
2329
2374
  value: localValue,
2330
2375
  disabled: disabled
@@ -2340,6 +2385,8 @@ function TextArea(props) {
2340
2385
  * @param {string} props.label
2341
2386
  * @param {Function} props.getValue
2342
2387
  * @param {Function} props.setValue
2388
+ * @param {Function} props.onFocus
2389
+ * @param {Function} props.onBlur
2343
2390
  * @param {number} props.rows
2344
2391
  * @param {boolean} props.monospace
2345
2392
  * @param {boolean} [props.disabled]
@@ -2357,7 +2404,9 @@ function TextAreaEntry(props) {
2357
2404
  setValue,
2358
2405
  rows,
2359
2406
  monospace,
2360
- disabled
2407
+ disabled,
2408
+ onFocus,
2409
+ onBlur
2361
2410
  } = props;
2362
2411
  const value = getValue(element);
2363
2412
  const error = useError(id);
@@ -2369,6 +2418,8 @@ function TextAreaEntry(props) {
2369
2418
  label: label,
2370
2419
  value: value,
2371
2420
  onInput: setValue,
2421
+ onFocus: onFocus,
2422
+ onBlur: onBlur,
2372
2423
  rows: rows,
2373
2424
  debounce: debounce,
2374
2425
  monospace: monospace,
@@ -2398,6 +2449,8 @@ function Textfield(props) {
2398
2449
  id,
2399
2450
  label,
2400
2451
  onInput,
2452
+ onFocus,
2453
+ onBlur,
2401
2454
  value = ''
2402
2455
  } = props;
2403
2456
  const [localValue, setLocalValue] = useState(value || '');
@@ -2436,8 +2489,8 @@ function Textfield(props) {
2436
2489
  disabled: disabled,
2437
2490
  class: "bio-properties-panel-input",
2438
2491
  onInput: handleInput,
2439
- onFocus: props.onFocus,
2440
- onBlur: props.onBlur,
2492
+ onFocus: onFocus,
2493
+ onBlur: onBlur,
2441
2494
  value: localValue
2442
2495
  })]
2443
2496
  });
@@ -2452,6 +2505,8 @@ function Textfield(props) {
2452
2505
  * @param {String} props.label
2453
2506
  * @param {Function} props.getValue
2454
2507
  * @param {Function} props.setValue
2508
+ * @param {Function} props.onFocus
2509
+ * @param {Function} props.onBlur
2455
2510
  * @param {Function} props.validate
2456
2511
  */
2457
2512
 
@@ -2466,7 +2521,9 @@ function TextfieldEntry(props) {
2466
2521
  label,
2467
2522
  getValue,
2468
2523
  setValue,
2469
- validate
2524
+ validate,
2525
+ onFocus,
2526
+ onBlur
2470
2527
  } = props;
2471
2528
  const [cachedInvalidValue, setCachedInvalidValue] = useState(null);
2472
2529
  const globalError = useError(id);
@@ -2510,6 +2567,8 @@ function TextfieldEntry(props) {
2510
2567
  id: id,
2511
2568
  label: label,
2512
2569
  onInput: onInput,
2570
+ onFocus: onFocus,
2571
+ onBlur: onBlur,
2513
2572
  value: value
2514
2573
  }, element), error && jsx("div", {
2515
2574
  class: "bio-properties-panel-error",
@@ -2535,7 +2594,9 @@ function ToggleSwitch(props) {
2535
2594
  label,
2536
2595
  onInput,
2537
2596
  value,
2538
- switcherLabel
2597
+ switcherLabel,
2598
+ onFocus,
2599
+ onBlur
2539
2600
  } = props;
2540
2601
  const [localValue, setLocalValue] = useState(value);
2541
2602
 
@@ -2569,9 +2630,11 @@ function ToggleSwitch(props) {
2569
2630
  id: prefixId(id),
2570
2631
  class: "bio-properties-panel-input",
2571
2632
  type: "checkbox",
2633
+ onFocus: onFocus,
2634
+ onBlur: onBlur,
2572
2635
  name: id,
2573
2636
  onInput: handleInput,
2574
- checked: localValue
2637
+ checked: !!localValue
2575
2638
  }), jsx("span", {
2576
2639
  class: "bio-properties-panel-toggle-switch__slider"
2577
2640
  })]
@@ -2591,6 +2654,8 @@ function ToggleSwitch(props) {
2591
2654
  * @param {String} props.switcherLabel
2592
2655
  * @param {Function} props.getValue
2593
2656
  * @param {Function} props.setValue
2657
+ * @param {Function} props.onFocus
2658
+ * @param {Function} props.onBlur
2594
2659
  */
2595
2660
 
2596
2661
 
@@ -2602,7 +2667,9 @@ function ToggleSwitchEntry(props) {
2602
2667
  label,
2603
2668
  switcherLabel,
2604
2669
  getValue,
2605
- setValue
2670
+ setValue,
2671
+ onFocus,
2672
+ onBlur
2606
2673
  } = props;
2607
2674
  const value = getValue(element);
2608
2675
  return jsxs("div", {
@@ -2613,6 +2680,8 @@ function ToggleSwitchEntry(props) {
2613
2680
  label: label,
2614
2681
  value: value,
2615
2682
  onInput: setValue,
2683
+ onFocus: onFocus,
2684
+ onBlur: onBlur,
2616
2685
  switcherLabel: switcherLabel
2617
2686
  }), jsx(Description, {
2618
2687
  forId: id,