@bpmn-io/properties-panel 3.16.0 → 3.17.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,
@@ -2128,6 +2135,7 @@ function FeelTextfield(props) {
2128
2135
  })]
2129
2136
  });
2130
2137
  }
2138
+ const FeelTextfield = withAutoClosePopup(FeelTextfieldComponent);
2131
2139
  const OptionalFeelInput = forwardRef((props, ref) => {
2132
2140
  const {
2133
2141
  id,
@@ -2380,7 +2388,7 @@ function FeelEntry(props) {
2380
2388
  const newValidationError = validate(value) || null;
2381
2389
  setValidationError(newValidationError);
2382
2390
  }
2383
- }, [value]);
2391
+ }, [value, validate]);
2384
2392
  const onInput = useStaticCallback(newValue => {
2385
2393
  let newValidationError = null;
2386
2394
  if (isFunction(validate)) {
@@ -2606,6 +2614,27 @@ function getPopupTitle(element, label) {
2606
2614
  }
2607
2615
  return `${popupTitle}${label}`;
2608
2616
  }
2617
+ function withAutoClosePopup(Component) {
2618
+ return function (props) {
2619
+ const {
2620
+ id
2621
+ } = props;
2622
+ const {
2623
+ close
2624
+ } = useContext(FeelPopupContext);
2625
+ const closePopup = useStaticCallback(close);
2626
+ useEffect(() => {
2627
+ return () => {
2628
+ closePopup({
2629
+ id
2630
+ });
2631
+ };
2632
+ }, []);
2633
+ return jsx(Component, {
2634
+ ...props
2635
+ });
2636
+ };
2637
+ }
2609
2638
 
2610
2639
  const DEFAULT_LAYOUT = {};
2611
2640
  const DEFAULT_DESCRIPTION = {};
@@ -3446,7 +3475,7 @@ function TemplatingEntry(props) {
3446
3475
  const newValidationError = validate(value) || null;
3447
3476
  setValidationError(newValidationError);
3448
3477
  }
3449
- }, [value]);
3478
+ }, [value, validate]);
3450
3479
  const onInput = useStaticCallback(newValue => {
3451
3480
  let newValidationError = null;
3452
3481
  if (isFunction(validate)) {
@@ -3868,7 +3897,7 @@ function SelectEntry(props) {
3868
3897
  const newValidationError = validate(value) || null;
3869
3898
  setLocalError(newValidationError);
3870
3899
  }
3871
- }, [value]);
3900
+ }, [value, validate]);
3872
3901
  const onChange = newValue => {
3873
3902
  let newValidationError = null;
3874
3903
  if (isFunction(validate)) {
@@ -4077,7 +4106,7 @@ function TextAreaEntry(props) {
4077
4106
  const newValidationError = validate(value) || null;
4078
4107
  setLocalError(newValidationError);
4079
4108
  }
4080
- }, [value]);
4109
+ }, [value, validate]);
4081
4110
  const onInput = newValue => {
4082
4111
  let newValidationError = null;
4083
4112
  if (isFunction(validate)) {
@@ -4217,7 +4246,7 @@ function TextfieldEntry(props) {
4217
4246
  const newValidationError = validate(value) || null;
4218
4247
  setLocalError(newValidationError);
4219
4248
  }
4220
- }, [value]);
4249
+ }, [value, validate]);
4221
4250
  const onInput = newValue => {
4222
4251
  let newValidationError = null;
4223
4252
  if (isFunction(validate)) {