@bpmn-io/form-js-viewer 1.23.0 → 1.23.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.
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Ids } from 'ids';
2
- import { isString, get, isNil, isObject, some, isNumber, set, findIndex, isArray, isDefined, values, uniqueBy, isFunction, bind, assign, groupBy, isUndefined } from 'min-dash';
2
+ import { isString, get, isNil, isObject, some, isNumber, set, isDefined, findIndex, isArray, values, uniqueBy, isFunction, bind, assign, groupBy, isUndefined } from 'min-dash';
3
3
  import Big from 'big.js';
4
4
  import classNames from 'classnames';
5
5
  import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
@@ -4225,7 +4225,7 @@ function SearchableSelect(props) {
4225
4225
  onChange: props.onChange
4226
4226
  });
4227
4227
  const getLabelCorrelation = useGetLabelCorrelation(options);
4228
- const label = useMemo(() => value && getLabelCorrelation(value), [value, getLabelCorrelation]);
4228
+ const label = useMemo(() => isDefined(value) ? getLabelCorrelation(value) : undefined, [value, getLabelCorrelation]);
4229
4229
 
4230
4230
  // whenever we change the underlying value, set the label to it
4231
4231
  useEffect(() => {
@@ -4243,7 +4243,7 @@ function SearchableSelect(props) {
4243
4243
  const pickOption = useCallback(option => {
4244
4244
  setFilter(option && option.label || '');
4245
4245
  props.onChange({
4246
- value: option && option.value || null
4246
+ value: option?.value ?? null
4247
4247
  });
4248
4248
  }, [props]);
4249
4249
  const displayState = useMemo(() => {
@@ -4390,10 +4390,10 @@ function SimpleSelect(props) {
4390
4390
  onChange: props.onChange
4391
4391
  });
4392
4392
  const getLabelCorrelation = useGetLabelCorrelation(options);
4393
- const valueLabel = useMemo(() => value && getLabelCorrelation(value), [value, getLabelCorrelation]);
4393
+ const valueLabel = useMemo(() => isDefined(value) ? getLabelCorrelation(value) : undefined, [value, getLabelCorrelation]);
4394
4394
  const pickOption = useCallback(option => {
4395
4395
  props.onChange({
4396
- value: option && option.value || null
4396
+ value: option?.value ?? null
4397
4397
  });
4398
4398
  }, [props]);
4399
4399
  const displayState = useMemo(() => {