@bpmn-io/properties-panel 3.6.0 → 3.7.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 +83 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +84 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1357,6 +1357,11 @@ const FEEL_POPUP_HEIGHT = 250;
|
|
|
1357
1357
|
function FEELPopupRoot(props) {
|
|
1358
1358
|
const {
|
|
1359
1359
|
element,
|
|
1360
|
+
eventBus = {
|
|
1361
|
+
fire() {},
|
|
1362
|
+
on() {},
|
|
1363
|
+
off() {}
|
|
1364
|
+
},
|
|
1360
1365
|
popupContainer
|
|
1361
1366
|
} = props;
|
|
1362
1367
|
const prevElement = usePrevious(element);
|
|
@@ -1364,15 +1369,23 @@ function FEELPopupRoot(props) {
|
|
|
1364
1369
|
const [open, setOpen] = hooks.useState(false);
|
|
1365
1370
|
const [source, setSource] = hooks.useState(null);
|
|
1366
1371
|
const [sourceElement, setSourceElement] = hooks.useState(null);
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1372
|
+
const emit = (type, context) => {
|
|
1373
|
+
eventBus.fire('feelPopup.' + type, context);
|
|
1374
|
+
};
|
|
1375
|
+
const isOpen = hooks.useCallback(() => {
|
|
1376
|
+
return !!open;
|
|
1377
|
+
}, [open]);
|
|
1378
|
+
const handleOpen = (entryId, config, _sourceElement) => {
|
|
1379
|
+
setSource(entryId);
|
|
1369
1380
|
setPopupConfig(config);
|
|
1370
1381
|
setOpen(true);
|
|
1371
1382
|
setSourceElement(_sourceElement);
|
|
1383
|
+
emit('opened');
|
|
1372
1384
|
};
|
|
1373
1385
|
const handleClose = () => {
|
|
1374
1386
|
setOpen(false);
|
|
1375
1387
|
setSource(null);
|
|
1388
|
+
emit('closed');
|
|
1376
1389
|
};
|
|
1377
1390
|
const feelPopupContext = {
|
|
1378
1391
|
open: handleOpen,
|
|
@@ -1382,10 +1395,33 @@ function FEELPopupRoot(props) {
|
|
|
1382
1395
|
|
|
1383
1396
|
// close popup on element change, cf. https://github.com/bpmn-io/properties-panel/issues/270
|
|
1384
1397
|
hooks.useEffect(() => {
|
|
1385
|
-
if (element && element !== prevElement) {
|
|
1398
|
+
if (element && prevElement && element !== prevElement) {
|
|
1386
1399
|
handleClose();
|
|
1387
1400
|
}
|
|
1388
1401
|
}, [element]);
|
|
1402
|
+
|
|
1403
|
+
// allow close and open via events
|
|
1404
|
+
hooks.useEffect(() => {
|
|
1405
|
+
const handlePopupOpen = context => {
|
|
1406
|
+
const {
|
|
1407
|
+
entryId,
|
|
1408
|
+
popupConfig,
|
|
1409
|
+
sourceElement
|
|
1410
|
+
} = context;
|
|
1411
|
+
handleOpen(entryId, popupConfig, sourceElement);
|
|
1412
|
+
};
|
|
1413
|
+
const handleIsOpen = () => {
|
|
1414
|
+
return isOpen();
|
|
1415
|
+
};
|
|
1416
|
+
eventBus.on('feelPopup._close', handleClose);
|
|
1417
|
+
eventBus.on('feelPopup._open', handlePopupOpen);
|
|
1418
|
+
eventBus.on('feelPopup._isOpen', handleIsOpen);
|
|
1419
|
+
return () => {
|
|
1420
|
+
eventBus.off('feelPopup._close', handleClose);
|
|
1421
|
+
eventBus.off('feelPopup._open', handleOpen);
|
|
1422
|
+
eventBus.off('feelPopup._isOpen', handleIsOpen);
|
|
1423
|
+
};
|
|
1424
|
+
}, [eventBus, isOpen]);
|
|
1389
1425
|
return jsxRuntime.jsxs(FeelPopupContext.Provider, {
|
|
1390
1426
|
value: feelPopupContext,
|
|
1391
1427
|
children: [open && jsxRuntime.jsx(FeelPopupComponent, {
|
|
@@ -2659,6 +2695,7 @@ function PropertiesPanel(props) {
|
|
|
2659
2695
|
value: eventContext,
|
|
2660
2696
|
children: jsxRuntime.jsx(FEELPopupRoot, {
|
|
2661
2697
|
element: element,
|
|
2698
|
+
eventBus: eventBus,
|
|
2662
2699
|
popupContainer: feelPopupContainer,
|
|
2663
2700
|
children: jsxRuntime.jsxs("div", {
|
|
2664
2701
|
class: "bio-properties-panel",
|
|
@@ -4124,15 +4161,56 @@ function debounceInput(debounceDelay) {
|
|
|
4124
4161
|
}
|
|
4125
4162
|
debounceInput.$inject = ['config.debounceInput'];
|
|
4126
4163
|
|
|
4127
|
-
var index = {
|
|
4164
|
+
var index$1 = {
|
|
4128
4165
|
debounceInput: ['factory', debounceInput]
|
|
4129
4166
|
};
|
|
4130
4167
|
|
|
4168
|
+
class FeelPopupModule {
|
|
4169
|
+
constructor(eventBus) {
|
|
4170
|
+
this._eventBus = eventBus;
|
|
4171
|
+
}
|
|
4172
|
+
|
|
4173
|
+
/**
|
|
4174
|
+
* Check if the FEEL popup is open.
|
|
4175
|
+
* @return {Boolean}
|
|
4176
|
+
*/
|
|
4177
|
+
isOpen() {
|
|
4178
|
+
return this._eventBus.fire('feelPopup._isOpen');
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
/**
|
|
4182
|
+
* Open the FEEL popup.
|
|
4183
|
+
*
|
|
4184
|
+
* @param {String} entryId
|
|
4185
|
+
* @param {Object} popupConfig
|
|
4186
|
+
* @param {HTMLElement} sourceElement
|
|
4187
|
+
*/
|
|
4188
|
+
open(entryId, popupConfig, sourceElement) {
|
|
4189
|
+
return this._eventBus.fire('feelPopup._open', {
|
|
4190
|
+
entryId,
|
|
4191
|
+
popupConfig,
|
|
4192
|
+
sourceElement
|
|
4193
|
+
});
|
|
4194
|
+
}
|
|
4195
|
+
|
|
4196
|
+
/**
|
|
4197
|
+
* Close the FEEL popup.
|
|
4198
|
+
*/
|
|
4199
|
+
close() {
|
|
4200
|
+
return this._eventBus.fire('feelPopup._close');
|
|
4201
|
+
}
|
|
4202
|
+
}
|
|
4203
|
+
FeelPopupModule.$inject = ['eventBus'];
|
|
4204
|
+
|
|
4205
|
+
var index = {
|
|
4206
|
+
feelPopup: ['type', FeelPopupModule]
|
|
4207
|
+
};
|
|
4208
|
+
|
|
4131
4209
|
exports.ArrowIcon = ArrowIcon;
|
|
4132
4210
|
exports.CheckboxEntry = CheckboxEntry;
|
|
4133
4211
|
exports.CollapsibleEntry = CollapsibleEntry;
|
|
4134
4212
|
exports.CreateIcon = CreateIcon;
|
|
4135
|
-
exports.DebounceInputModule = index;
|
|
4213
|
+
exports.DebounceInputModule = index$1;
|
|
4136
4214
|
exports.DeleteIcon = DeleteIcon;
|
|
4137
4215
|
exports.DescriptionContext = DescriptionContext;
|
|
4138
4216
|
exports.DescriptionEntry = Description;
|
|
@@ -4145,6 +4223,7 @@ exports.FeelCheckboxEntry = FeelCheckboxEntry;
|
|
|
4145
4223
|
exports.FeelEntry = FeelEntry;
|
|
4146
4224
|
exports.FeelIcon = FeelIcon$1;
|
|
4147
4225
|
exports.FeelNumberEntry = FeelNumberEntry;
|
|
4226
|
+
exports.FeelPopupModule = index;
|
|
4148
4227
|
exports.FeelTemplatingEntry = FeelTemplatingEntry;
|
|
4149
4228
|
exports.FeelTextAreaEntry = FeelTextAreaEntry;
|
|
4150
4229
|
exports.FeelToggleSwitchEntry = FeelToggleSwitchEntry;
|