@bpmn-io/properties-panel 3.27.4 → 3.27.5
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 +28 -34
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +27 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useContext, useState, useRef, useEffect, useMemo,
|
|
1
|
+
import { useContext, useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from '../preact/hooks';
|
|
2
2
|
import { isFunction, isString, isArray, get, assign, set, isNumber, debounce } from 'min-dash';
|
|
3
3
|
import { createPortal, forwardRef } from '../preact/compat';
|
|
4
4
|
import { jsx, jsxs, Fragment } from '../preact/jsx-runtime';
|
|
@@ -402,6 +402,18 @@ function useDescriptionContext(id, element) {
|
|
|
402
402
|
return getDescriptionForId(id, element);
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
+
function useDebounce(callback, debounceFn) {
|
|
406
|
+
const debouncedCallback = useCallback(debounceFn(callback), [callback, debounceFn]);
|
|
407
|
+
|
|
408
|
+
// make sure previous call is not stalled
|
|
409
|
+
useEffect(() => {
|
|
410
|
+
return () => {
|
|
411
|
+
debouncedCallback.flush?.();
|
|
412
|
+
};
|
|
413
|
+
}, [debouncedCallback]);
|
|
414
|
+
return debouncedCallback;
|
|
415
|
+
}
|
|
416
|
+
|
|
405
417
|
function useError(id) {
|
|
406
418
|
const {
|
|
407
419
|
errors
|
|
@@ -2008,11 +2020,7 @@ function FeelTextfieldComponent(props) {
|
|
|
2008
2020
|
/**
|
|
2009
2021
|
* @type { import('min-dash').DebouncedFunction }
|
|
2010
2022
|
*/
|
|
2011
|
-
const handleInputCallback =
|
|
2012
|
-
return debounce(newValue => {
|
|
2013
|
-
onInput(newValue);
|
|
2014
|
-
});
|
|
2015
|
-
}, [onInput, debounce]);
|
|
2023
|
+
const handleInputCallback = useDebounce(onInput, debounce);
|
|
2016
2024
|
const handleInput = newValue => {
|
|
2017
2025
|
// we don't commit empty FEEL expressions,
|
|
2018
2026
|
// but instead serialize them as <undefined>
|
|
@@ -2046,14 +2054,10 @@ function FeelTextfieldComponent(props) {
|
|
|
2046
2054
|
}
|
|
2047
2055
|
};
|
|
2048
2056
|
const handleOnBlur = e => {
|
|
2049
|
-
const
|
|
2057
|
+
const trimmedValue = e.target.value.trim();
|
|
2050
2058
|
|
|
2051
|
-
//
|
|
2052
|
-
|
|
2053
|
-
if (value.trim() !== value) {
|
|
2054
|
-
setLocalValue(value.trim());
|
|
2055
|
-
handleInput(value.trim());
|
|
2056
|
-
}
|
|
2059
|
+
// trim and commit on blur
|
|
2060
|
+
onInput(trimmedValue);
|
|
2057
2061
|
if (onBlur) {
|
|
2058
2062
|
onBlur(e);
|
|
2059
2063
|
}
|
|
@@ -4005,11 +4009,7 @@ function TextArea(props) {
|
|
|
4005
4009
|
/**
|
|
4006
4010
|
* @type { import('min-dash').DebouncedFunction }
|
|
4007
4011
|
*/
|
|
4008
|
-
const handleInputCallback =
|
|
4009
|
-
return debounce(newValue => {
|
|
4010
|
-
onInput(newValue);
|
|
4011
|
-
});
|
|
4012
|
-
}, [onInput, debounce]);
|
|
4012
|
+
const handleInputCallback = useDebounce(onInput, debounce);
|
|
4013
4013
|
const handleInput = newValue => {
|
|
4014
4014
|
const newModelValue = newValue === '' ? undefined : newValue;
|
|
4015
4015
|
handleInputCallback(newModelValue);
|
|
@@ -4023,11 +4023,10 @@ function TextArea(props) {
|
|
|
4023
4023
|
handleInput(e.target.value);
|
|
4024
4024
|
};
|
|
4025
4025
|
const handleOnBlur = e => {
|
|
4026
|
-
const
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
}
|
|
4026
|
+
const trimmedValue = e.target.value.trim();
|
|
4027
|
+
|
|
4028
|
+
// trim and commit on blur
|
|
4029
|
+
onInput(trimmedValue);
|
|
4031
4030
|
if (onBlur) {
|
|
4032
4031
|
onBlur(e);
|
|
4033
4032
|
}
|
|
@@ -4186,17 +4185,12 @@ function Textfield(props) {
|
|
|
4186
4185
|
/**
|
|
4187
4186
|
* @type { import('min-dash').DebouncedFunction }
|
|
4188
4187
|
*/
|
|
4189
|
-
const handleInputCallback =
|
|
4190
|
-
return debounce(newValue => {
|
|
4191
|
-
onInput(newValue);
|
|
4192
|
-
});
|
|
4193
|
-
}, [onInput, debounce]);
|
|
4188
|
+
const handleInputCallback = useDebounce(onInput, debounce);
|
|
4194
4189
|
const handleOnBlur = e => {
|
|
4195
|
-
const
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
}
|
|
4190
|
+
const trimmedValue = e.target.value.trim();
|
|
4191
|
+
|
|
4192
|
+
// trim and commit on blur
|
|
4193
|
+
onInput(trimmedValue);
|
|
4200
4194
|
if (onBlur) {
|
|
4201
4195
|
onBlur(e);
|
|
4202
4196
|
}
|
|
@@ -4415,5 +4409,5 @@ var index = {
|
|
|
4415
4409
|
feelPopup: ['type', FeelPopupModule]
|
|
4416
4410
|
};
|
|
4417
4411
|
|
|
4418
|
-
export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, Popup, PopupIcon, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$5 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$7 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$8 as isToggleSwitchEntryEdited, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
|
|
4412
|
+
export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, LaunchIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, Popup, PopupIcon, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$5 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$7 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$8 as isToggleSwitchEntryEdited, useDebounce, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
|
|
4419
4413
|
//# sourceMappingURL=index.esm.js.map
|