@bpmn-io/properties-panel 3.16.0 → 3.18.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.
@@ -1113,7 +1113,7 @@ textarea.bio-properties-panel-input {
1113
1113
  }
1114
1114
 
1115
1115
  .bio-properties-panel-feel-editor-container .bio-properties-panel-input {
1116
- resize: vertical;
1116
+ resize: none;
1117
1117
  overflow: hidden;
1118
1118
  overflow-y: auto;
1119
1119
  }
@@ -1165,14 +1165,14 @@ textarea.bio-properties-panel-input {
1165
1165
  max-width: 300px;
1166
1166
  font-size: var(--text-size-small);
1167
1167
  font-family: var(--font-family);
1168
+ }
1168
1169
 
1169
- &.right {
1170
- padding-right: 6px;
1171
- }
1170
+ .bio-properties-panel-tooltip.right {
1171
+ padding-right: 6px;
1172
+ }
1172
1173
 
1173
- &.top {
1174
- flex-direction: column;
1175
- }
1174
+ .bio-properties-panel-tooltip.top {
1175
+ flex-direction: column;
1176
1176
  }
1177
1177
 
1178
1178
  .bio-properties-panel-tooltip-content {
@@ -1414,9 +1414,12 @@ textarea.bio-properties-panel-input {
1414
1414
  .bio-properties-panel-feelers-editor-container .bio-properties-panel-open-feel-popup,
1415
1415
  .bio-properties-panel-feel-container .bio-properties-panel-open-feel-popup {
1416
1416
  position: absolute;
1417
- display: none;
1417
+ top: 0;
1418
1418
  right: 0;
1419
- bottom: -1px;
1419
+ line-height: 1;
1420
+ padding: 2px 4px;
1421
+ margin: 3px;
1422
+ display: none;
1420
1423
  background: none;
1421
1424
  border: none;
1422
1425
  color: var(--feel-open-popup-color);
package/dist/index.esm.js CHANGED
@@ -1270,6 +1270,7 @@ function PopupComponent(props, globalRef) {
1270
1270
  }
1271
1271
  return () => focusTrapRef.current && focusTrapRef.current.deactivate();
1272
1272
  }, [popupRef]);
1273
+ useEvent('propertiesPanel.detach', onClose);
1273
1274
  return createPortal(jsx("div", {
1274
1275
  "aria-label": title,
1275
1276
  tabIndex: -1,
@@ -1449,7 +1450,13 @@ function FEELPopupRoot(props) {
1449
1450
  setSourceElement(_sourceElement);
1450
1451
  emit('open');
1451
1452
  };
1452
- const handleClose = () => {
1453
+ const handleClose = (event = {}) => {
1454
+ const {
1455
+ id
1456
+ } = event;
1457
+ if (id && id !== source) {
1458
+ return;
1459
+ }
1453
1460
  setOpen(false);
1454
1461
  setSource(null);
1455
1462
  };
@@ -1618,7 +1625,7 @@ function FeelPopupComponent(props) {
1618
1625
  }), jsx(Popup.Footer, {
1619
1626
  children: jsx("button", {
1620
1627
  type: "button",
1621
- onClick: onClose,
1628
+ onClick: () => onClose(),
1622
1629
  title: "Close pop-up editor",
1623
1630
  class: "bio-properties-panel-feel-popup__close-btn",
1624
1631
  children: "Close"
@@ -1880,7 +1887,7 @@ function NumberFieldEntry(props) {
1880
1887
  const newValidationError = validate(value) || null;
1881
1888
  setLocalError(newValidationError);
1882
1889
  }
1883
- }, [value]);
1890
+ }, [value, validate]);
1884
1891
  const onInput = newValue => {
1885
1892
  let newValidationError = null;
1886
1893
  if (isFunction(validate)) {
@@ -1926,7 +1933,7 @@ function prefixId$6(id) {
1926
1933
  }
1927
1934
 
1928
1935
  const noop$2 = () => {};
1929
- function FeelTextfield(props) {
1936
+ function FeelTextfieldComponent(props) {
1930
1937
  const {
1931
1938
  debounce,
1932
1939
  id,
@@ -2003,9 +2010,7 @@ function FeelTextfield(props) {
2003
2010
  onError(undefined);
2004
2011
  return;
2005
2012
  }
2006
- const error = lint[0];
2007
- const message = `${error.source}: ${error.message}`;
2008
- onError(message);
2013
+ onError('Unparsable FEEL expression.');
2009
2014
  });
2010
2015
  const handlePopupOpen = (type = 'feel') => {
2011
2016
  const popupOptions = {
@@ -2128,6 +2133,7 @@ function FeelTextfield(props) {
2128
2133
  })]
2129
2134
  });
2130
2135
  }
2136
+ const FeelTextfield = withAutoClosePopup(FeelTextfieldComponent);
2131
2137
  const OptionalFeelInput = forwardRef((props, ref) => {
2132
2138
  const {
2133
2139
  id,
@@ -2380,7 +2386,7 @@ function FeelEntry(props) {
2380
2386
  const newValidationError = validate(value) || null;
2381
2387
  setValidationError(newValidationError);
2382
2388
  }
2383
- }, [value]);
2389
+ }, [value, validate]);
2384
2390
  const onInput = useStaticCallback(newValue => {
2385
2391
  let newValidationError = null;
2386
2392
  if (isFunction(validate)) {
@@ -2606,6 +2612,27 @@ function getPopupTitle(element, label) {
2606
2612
  }
2607
2613
  return `${popupTitle}${label}`;
2608
2614
  }
2615
+ function withAutoClosePopup(Component) {
2616
+ return function (props) {
2617
+ const {
2618
+ id
2619
+ } = props;
2620
+ const {
2621
+ close
2622
+ } = useContext(FeelPopupContext);
2623
+ const closePopup = useStaticCallback(close);
2624
+ useEffect(() => {
2625
+ return () => {
2626
+ closePopup({
2627
+ id
2628
+ });
2629
+ };
2630
+ }, []);
2631
+ return jsx(Component, {
2632
+ ...props
2633
+ });
2634
+ };
2635
+ }
2609
2636
 
2610
2637
  const DEFAULT_LAYOUT = {};
2611
2638
  const DEFAULT_DESCRIPTION = {};
@@ -3446,7 +3473,7 @@ function TemplatingEntry(props) {
3446
3473
  const newValidationError = validate(value) || null;
3447
3474
  setValidationError(newValidationError);
3448
3475
  }
3449
- }, [value]);
3476
+ }, [value, validate]);
3450
3477
  const onInput = useStaticCallback(newValue => {
3451
3478
  let newValidationError = null;
3452
3479
  if (isFunction(validate)) {
@@ -3868,7 +3895,7 @@ function SelectEntry(props) {
3868
3895
  const newValidationError = validate(value) || null;
3869
3896
  setLocalError(newValidationError);
3870
3897
  }
3871
- }, [value]);
3898
+ }, [value, validate]);
3872
3899
  const onChange = newValue => {
3873
3900
  let newValidationError = null;
3874
3901
  if (isFunction(validate)) {
@@ -4077,7 +4104,7 @@ function TextAreaEntry(props) {
4077
4104
  const newValidationError = validate(value) || null;
4078
4105
  setLocalError(newValidationError);
4079
4106
  }
4080
- }, [value]);
4107
+ }, [value, validate]);
4081
4108
  const onInput = newValue => {
4082
4109
  let newValidationError = null;
4083
4110
  if (isFunction(validate)) {
@@ -4217,7 +4244,7 @@ function TextfieldEntry(props) {
4217
4244
  const newValidationError = validate(value) || null;
4218
4245
  setLocalError(newValidationError);
4219
4246
  }
4220
- }, [value]);
4247
+ }, [value, validate]);
4221
4248
  const onInput = newValue => {
4222
4249
  let newValidationError = null;
4223
4250
  if (isFunction(validate)) {