@bpmn-io/properties-panel 3.33.1 → 3.33.2

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
@@ -2200,7 +2200,7 @@ function FeelTextfield(props) {
2200
2200
  element,
2201
2201
  label,
2202
2202
  hostLanguage,
2203
- onInput,
2203
+ onInput: commitValue,
2204
2204
  onBlur,
2205
2205
  onError,
2206
2206
  placeholder,
@@ -2216,6 +2216,12 @@ function FeelTextfield(props) {
2216
2216
  const [localValue, setLocalValue] = useState(value);
2217
2217
  const editorRef = useShowEntryEvent(id);
2218
2218
  const containerRef = useRef();
2219
+ const onInput = useCallback(newValue => {
2220
+ // we don't commit empty FEEL expressions,
2221
+ // but instead serialize them as <undefined>
2222
+ const newModelValue = newValue === '' || newValue === '=' ? undefined : newValue;
2223
+ commitValue(newModelValue);
2224
+ }, [commitValue]);
2219
2225
  const feelActive = isString(localValue) && localValue.startsWith('=') || feel === 'required';
2220
2226
  const feelOnlyValue = isString(localValue) && localValue.startsWith('=') ? localValue.substring(1) : localValue;
2221
2227
  const feelLanguageContext = useContext(FeelLanguageContext);
@@ -2235,13 +2241,7 @@ function FeelTextfield(props) {
2235
2241
  /**
2236
2242
  * @type { import('min-dash').DebouncedFunction }
2237
2243
  */
2238
- const handleInputCallback = useDebounce(onInput, debounce);
2239
- const handleInput = newValue => {
2240
- // we don't commit empty FEEL expressions,
2241
- // but instead serialize them as <undefined>
2242
- const newModelValue = newValue === '' || newValue === '=' ? undefined : newValue;
2243
- handleInputCallback(newModelValue);
2244
- };
2244
+ const handleInput = useDebounce(onInput, debounce);
2245
2245
  const handleFeelToggle = useStaticCallback(() => {
2246
2246
  if (feel === 'required') {
2247
2247
  return;
@@ -3432,7 +3432,7 @@ function TextArea(props) {
3432
3432
  id,
3433
3433
  label,
3434
3434
  debounce,
3435
- onInput,
3435
+ onInput: commitValue,
3436
3436
  value = '',
3437
3437
  disabled,
3438
3438
  monospace,
@@ -3445,16 +3445,16 @@ function TextArea(props) {
3445
3445
  } = props;
3446
3446
  const [localValue, setLocalValue] = useState(value);
3447
3447
  const ref = useShowEntryEvent(id);
3448
+ const onInput = useCallback(newValue => {
3449
+ const newModelValue = newValue === '' ? undefined : newValue;
3450
+ commitValue(newModelValue);
3451
+ }, [commitValue]);
3448
3452
  const visible = useElementVisible(ref.current);
3449
3453
 
3450
3454
  /**
3451
3455
  * @type { import('min-dash').DebouncedFunction }
3452
3456
  */
3453
- const handleInputCallback = useDebounce(onInput, debounce);
3454
- const handleInput = newValue => {
3455
- const newModelValue = newValue === '' ? undefined : newValue;
3456
- handleInputCallback(newModelValue);
3457
- };
3457
+ const handleInput = useDebounce(onInput, debounce);
3458
3458
  const handleLocalInput = e => {
3459
3459
  autoResize && resizeToContents(e.target);
3460
3460
  if (e.target.value === localValue) {
@@ -3613,7 +3613,7 @@ function Textfield(props) {
3613
3613
  disabled = false,
3614
3614
  id,
3615
3615
  label,
3616
- onInput,
3616
+ onInput: commitValue,
3617
3617
  onFocus,
3618
3618
  onBlur,
3619
3619
  placeholder,
@@ -3622,11 +3622,15 @@ function Textfield(props) {
3622
3622
  } = props;
3623
3623
  const [localValue, setLocalValue] = useState(value || '');
3624
3624
  const ref = useShowEntryEvent(id);
3625
+ const onInput = useCallback(newValue => {
3626
+ const newModelValue = newValue === '' ? undefined : newValue;
3627
+ commitValue(newModelValue);
3628
+ }, [commitValue]);
3625
3629
 
3626
3630
  /**
3627
3631
  * @type { import('min-dash').DebouncedFunction }
3628
3632
  */
3629
- const handleInputCallback = useDebounce(onInput, debounce);
3633
+ const handleInput = useDebounce(onInput, debounce);
3630
3634
  const handleOnBlur = e => {
3631
3635
  const trimmedValue = e.target.value.trim();
3632
3636
 
@@ -3636,10 +3640,6 @@ function Textfield(props) {
3636
3640
  onBlur(e);
3637
3641
  }
3638
3642
  };
3639
- const handleInput = newValue => {
3640
- const newModelValue = newValue === '' ? undefined : newValue;
3641
- handleInputCallback(newModelValue);
3642
- };
3643
3643
  const handleLocalInput = e => {
3644
3644
  if (e.target.value === localValue) {
3645
3645
  return;