@bpmn-io/form-js-editor 1.14.0 → 1.15.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/assets/form-js-editor.css +4 -0
- package/dist/assets/properties-panel.css +4 -0
- package/dist/index.cjs +100 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +101 -212
- package/dist/index.es.js.map +1 -1
- package/dist/types/features/properties-panel/entries/index.d.ts +0 -1
- package/dist/types/features/properties-panel/groups/index.d.ts +0 -1
- package/package.json +5 -5
- package/dist/types/features/properties-panel/entries/EndpointKey.d.ts +0 -10
- package/dist/types/features/properties-panel/groups/DownloadSettings.d.ts +0 -12
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Ids from 'ids';
|
|
2
|
-
import { FormFieldRegistry as FormFieldRegistry$1, iconsByType, Label as Label$3, IFrame, Text as Text$1, Html, Table, ExpressionField, DocumentPreview, FormFields, sanitizeImageSource, getAncestryList, FormContext, FormRenderContext, FormComponent, getScrollContainer,
|
|
2
|
+
import { FormFieldRegistry as FormFieldRegistry$1, iconsByType, Label as Label$3, IFrame, Text as Text$1, Html, Table, ExpressionField, DocumentPreview, FormFields, sanitizeImageSource, getAncestryList, FormContext, FormRenderContext, FormComponent, getScrollContainer, FieldFactory, FormLayouter, PathRegistry, Importer, FeelExpressionLanguage, OPTIONS_SOURCES, OPTIONS_SOURCES_PATHS, clone, runRecursively, getSchemaVariables, DATETIME_SUBTYPES, DATE_LABEL_PATH, TIME_LABEL_PATH, TIME_USE24H_PATH, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES_LABELS, TIME_INTERVAL_PATH, TIME_SERIALISING_FORMAT_PATH, DATE_DISALLOW_PAST_PATH, TIME_SERIALISING_FORMATS, TIME_SERIALISINGFORMAT_LABELS, getOptionsSource, OPTIONS_SOURCES_DEFAULTS, OPTIONS_SOURCES_LABELS, SECURITY_ATTRIBUTES_DEFINITIONS, createFormContainer, createInjector, MarkdownRendererModule, schemaVersion } from '@bpmn-io/form-js-viewer';
|
|
3
3
|
export { schemaVersion } from '@bpmn-io/form-js-viewer';
|
|
4
4
|
import { isArray, isFunction, isNumber, bind, assign, debounce, forEach, isString, uniqueBy, isObject, get, isDefined, set as set$1, reduce, without, isNil, has } from 'min-dash';
|
|
5
5
|
import classnames from 'classnames';
|
|
@@ -5578,7 +5578,7 @@ function TooltipWrapper(props) {
|
|
|
5578
5578
|
return jsx(Tooltip, {
|
|
5579
5579
|
...props,
|
|
5580
5580
|
value: value,
|
|
5581
|
-
forId:
|
|
5581
|
+
forId: `bio-properties-panel-${forId}`
|
|
5582
5582
|
});
|
|
5583
5583
|
}
|
|
5584
5584
|
function Tooltip(props) {
|
|
@@ -5589,71 +5589,52 @@ function Tooltip(props) {
|
|
|
5589
5589
|
direction = 'right',
|
|
5590
5590
|
position
|
|
5591
5591
|
} = props;
|
|
5592
|
-
const [visible,
|
|
5593
|
-
|
|
5592
|
+
const [visible, setVisible] = useState(false);
|
|
5593
|
+
|
|
5594
|
+
// Tooltip will be shown after SHOW_DELAY ms from hovering over the source element.
|
|
5595
|
+
const SHOW_DELAY = 200;
|
|
5594
5596
|
let timeout = null;
|
|
5595
5597
|
const wrapperRef = useRef(null);
|
|
5596
5598
|
const tooltipRef = useRef(null);
|
|
5597
|
-
const
|
|
5598
|
-
|
|
5599
|
-
if (
|
|
5600
|
-
|
|
5601
|
-
|
|
5602
|
-
}
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
}
|
|
5599
|
+
const show = (_, delay) => {
|
|
5600
|
+
if (visible) return;
|
|
5601
|
+
if (delay) {
|
|
5602
|
+
timeout = setTimeout(() => {
|
|
5603
|
+
setVisible(true);
|
|
5604
|
+
}, SHOW_DELAY);
|
|
5605
|
+
} else {
|
|
5606
|
+
setVisible(true);
|
|
5606
5607
|
}
|
|
5607
5608
|
};
|
|
5608
|
-
const
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
};
|
|
5612
|
-
const hideTooltipViaEscape = e => {
|
|
5613
|
-
e.code === 'Escape' && hideTooltip();
|
|
5609
|
+
const hide = () => {
|
|
5610
|
+
clearTimeout(timeout);
|
|
5611
|
+
setVisible(false);
|
|
5614
5612
|
};
|
|
5615
|
-
const
|
|
5616
|
-
|
|
5617
|
-
y
|
|
5613
|
+
const handleMouseLeave = ({
|
|
5614
|
+
relatedTarget
|
|
5618
5615
|
}) => {
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5616
|
+
// Don't hide the tooltip when moving mouse between the wrapper and the tooltip.
|
|
5617
|
+
if (relatedTarget === wrapperRef.current || relatedTarget === tooltipRef.current || relatedTarget?.parentElement === tooltipRef.current) {
|
|
5618
|
+
return;
|
|
5619
|
+
}
|
|
5620
|
+
hide();
|
|
5622
5621
|
};
|
|
5623
|
-
|
|
5622
|
+
const handleFocusOut = e => {
|
|
5624
5623
|
const {
|
|
5625
|
-
|
|
5626
|
-
} =
|
|
5627
|
-
|
|
5624
|
+
target
|
|
5625
|
+
} = e;
|
|
5626
|
+
|
|
5627
|
+
// Don't hide the tooltip if the wrapper or the tooltip itself is clicked.
|
|
5628
|
+
const isHovered = target.matches(':hover') || tooltipRef.current?.matches(':hover');
|
|
5629
|
+
if (target === wrapperRef.current && isHovered) {
|
|
5630
|
+
e.stopPropagation();
|
|
5628
5631
|
return;
|
|
5629
5632
|
}
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
}) && !(isFocused && focusedViaKeyboard)) {
|
|
5636
|
-
hideTooltip();
|
|
5637
|
-
}
|
|
5638
|
-
};
|
|
5639
|
-
const hideFocusedTooltip = e => {
|
|
5640
|
-
const {
|
|
5641
|
-
relatedTarget
|
|
5642
|
-
} = e;
|
|
5643
|
-
const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
|
|
5644
|
-
if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
|
|
5645
|
-
hideTooltip();
|
|
5646
|
-
}
|
|
5647
|
-
};
|
|
5648
|
-
document.addEventListener('wheel', hideHoveredTooltip);
|
|
5649
|
-
document.addEventListener('focusout', hideFocusedTooltip);
|
|
5650
|
-
document.addEventListener('mousemove', hideHoveredTooltip);
|
|
5651
|
-
return () => {
|
|
5652
|
-
document.removeEventListener('wheel', hideHoveredTooltip);
|
|
5653
|
-
document.removeEventListener('mousemove', hideHoveredTooltip);
|
|
5654
|
-
document.removeEventListener('focusout', hideFocusedTooltip);
|
|
5655
|
-
};
|
|
5656
|
-
}, [wrapperRef.current, visible, focusedViaKeyboard]);
|
|
5633
|
+
hide();
|
|
5634
|
+
};
|
|
5635
|
+
const hideTooltipViaEscape = e => {
|
|
5636
|
+
e.code === 'Escape' && hide();
|
|
5637
|
+
};
|
|
5657
5638
|
const renderTooltip = () => {
|
|
5658
5639
|
return jsxs("div", {
|
|
5659
5640
|
class: `bio-properties-panel-tooltip ${direction}`,
|
|
@@ -5663,6 +5644,7 @@ function Tooltip(props) {
|
|
|
5663
5644
|
style: position || getTooltipPosition(wrapperRef.current),
|
|
5664
5645
|
ref: tooltipRef,
|
|
5665
5646
|
onClick: e => e.stopPropagation(),
|
|
5647
|
+
onMouseLeave: handleMouseLeave,
|
|
5666
5648
|
children: [jsx("div", {
|
|
5667
5649
|
class: "bio-properties-panel-tooltip-content",
|
|
5668
5650
|
children: value
|
|
@@ -5675,39 +5657,23 @@ function Tooltip(props) {
|
|
|
5675
5657
|
class: "bio-properties-panel-tooltip-wrapper",
|
|
5676
5658
|
tabIndex: "0",
|
|
5677
5659
|
ref: wrapperRef,
|
|
5678
|
-
onMouseEnter:
|
|
5679
|
-
onMouseLeave:
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
},
|
|
5683
|
-
onFocus: showTooltip,
|
|
5660
|
+
onMouseEnter: e => show(e, true),
|
|
5661
|
+
onMouseLeave: handleMouseLeave,
|
|
5662
|
+
onFocus: show,
|
|
5663
|
+
onBlur: handleFocusOut,
|
|
5684
5664
|
onKeyDown: hideTooltipViaEscape,
|
|
5685
5665
|
children: [props.children, visible ? parent ? createPortal(renderTooltip(), parent.current) : renderTooltip() : null]
|
|
5686
5666
|
});
|
|
5687
5667
|
}
|
|
5688
5668
|
|
|
5689
5669
|
// helper
|
|
5690
|
-
|
|
5691
|
-
const {
|
|
5692
|
-
top,
|
|
5693
|
-
right,
|
|
5694
|
-
bottom,
|
|
5695
|
-
left
|
|
5696
|
-
} = bounds;
|
|
5697
|
-
return x >= left && x <= right && y >= top && y <= bottom;
|
|
5698
|
-
}
|
|
5670
|
+
|
|
5699
5671
|
function getTooltipPosition(refElement) {
|
|
5700
5672
|
const refPosition = refElement.getBoundingClientRect();
|
|
5701
5673
|
const right = `calc(100% - ${refPosition.x}px)`;
|
|
5702
5674
|
const top = `${refPosition.top - 10}px`;
|
|
5703
5675
|
return `right: ${right}; top: ${top};`;
|
|
5704
5676
|
}
|
|
5705
|
-
function isHovered(element) {
|
|
5706
|
-
return element.matches(':hover');
|
|
5707
|
-
}
|
|
5708
|
-
function prefixId$9(id) {
|
|
5709
|
-
return `bio-properties-panel-${id}`;
|
|
5710
|
-
}
|
|
5711
5677
|
|
|
5712
5678
|
/**
|
|
5713
5679
|
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
@@ -7230,6 +7196,7 @@ function FeelTextfieldComponent(props) {
|
|
|
7230
7196
|
label,
|
|
7231
7197
|
hostLanguage,
|
|
7232
7198
|
onInput,
|
|
7199
|
+
onBlur,
|
|
7233
7200
|
onError,
|
|
7234
7201
|
placeholder,
|
|
7235
7202
|
feel,
|
|
@@ -7295,6 +7262,12 @@ function FeelTextfieldComponent(props) {
|
|
|
7295
7262
|
setFocus(-1);
|
|
7296
7263
|
}
|
|
7297
7264
|
};
|
|
7265
|
+
const handleOnBlur = e => {
|
|
7266
|
+
if (onBlur) {
|
|
7267
|
+
onBlur(e);
|
|
7268
|
+
}
|
|
7269
|
+
setLocalValue(e.target.value.trim());
|
|
7270
|
+
};
|
|
7298
7271
|
const handleLint = useStaticCallback((lint = []) => {
|
|
7299
7272
|
const syntaxError = lint.some(report => report.type === 'Syntax Error');
|
|
7300
7273
|
if (syntaxError) {
|
|
@@ -7416,6 +7389,7 @@ function FeelTextfieldComponent(props) {
|
|
|
7416
7389
|
...props,
|
|
7417
7390
|
popupOpen: popuOpen,
|
|
7418
7391
|
onInput: handleLocalInput,
|
|
7392
|
+
onBlur: handleOnBlur,
|
|
7419
7393
|
contentAttributes: {
|
|
7420
7394
|
'id': prefixId$5(id),
|
|
7421
7395
|
'aria-label': label
|
|
@@ -8714,6 +8688,12 @@ function TextArea(props) {
|
|
|
8714
8688
|
autoResize && resizeToContents(e.target);
|
|
8715
8689
|
setLocalValue(e.target.value);
|
|
8716
8690
|
};
|
|
8691
|
+
const handleOnBlur = e => {
|
|
8692
|
+
if (onBlur) {
|
|
8693
|
+
onBlur(e);
|
|
8694
|
+
}
|
|
8695
|
+
setLocalValue(e.target.value.trim());
|
|
8696
|
+
};
|
|
8717
8697
|
useLayoutEffect(() => {
|
|
8718
8698
|
autoResize && resizeToContents(ref.current);
|
|
8719
8699
|
}, []);
|
|
@@ -8745,7 +8725,7 @@ function TextArea(props) {
|
|
|
8745
8725
|
class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
|
|
8746
8726
|
onInput: handleInput,
|
|
8747
8727
|
onFocus: onFocus,
|
|
8748
|
-
onBlur:
|
|
8728
|
+
onBlur: handleOnBlur,
|
|
8749
8729
|
placeholder: placeholder,
|
|
8750
8730
|
rows: rows,
|
|
8751
8731
|
value: localValue,
|
|
@@ -8863,6 +8843,12 @@ function Textfield(props) {
|
|
|
8863
8843
|
const handleInputCallback = useMemo(() => {
|
|
8864
8844
|
return debounce(target => onInput(target.value.length ? target.value : undefined));
|
|
8865
8845
|
}, [onInput, debounce]);
|
|
8846
|
+
const handleOnBlur = e => {
|
|
8847
|
+
if (onBlur) {
|
|
8848
|
+
onBlur(e);
|
|
8849
|
+
}
|
|
8850
|
+
setLocalValue(e.target.value.trim());
|
|
8851
|
+
};
|
|
8866
8852
|
const handleInput = e => {
|
|
8867
8853
|
handleInputCallback(e.target);
|
|
8868
8854
|
setLocalValue(e.target.value);
|
|
@@ -8895,7 +8881,7 @@ function Textfield(props) {
|
|
|
8895
8881
|
class: "bio-properties-panel-input",
|
|
8896
8882
|
onInput: handleInput,
|
|
8897
8883
|
onFocus: onFocus,
|
|
8898
|
-
onBlur:
|
|
8884
|
+
onBlur: handleOnBlur,
|
|
8899
8885
|
placeholder: placeholder,
|
|
8900
8886
|
value: localValue
|
|
8901
8887
|
})]
|
|
@@ -9428,7 +9414,7 @@ function Columns(props) {
|
|
|
9428
9414
|
editField,
|
|
9429
9415
|
id
|
|
9430
9416
|
} = props;
|
|
9431
|
-
|
|
9417
|
+
useService('debounce');
|
|
9432
9418
|
const formLayoutValidator = useService('formLayoutValidator');
|
|
9433
9419
|
const validate = useCallback(value => {
|
|
9434
9420
|
return formLayoutValidator.validateField(field, value ? parseInt(value) : null);
|
|
@@ -9454,7 +9440,6 @@ function Columns(props) {
|
|
|
9454
9440
|
...asArray(16).filter(i => i >= MIN_COLUMNS).map(asOption)];
|
|
9455
9441
|
};
|
|
9456
9442
|
return SelectEntry({
|
|
9457
|
-
debounce,
|
|
9458
9443
|
element: field,
|
|
9459
9444
|
id,
|
|
9460
9445
|
label: 'Columns',
|
|
@@ -10530,7 +10515,7 @@ function Height(props) {
|
|
|
10530
10515
|
id,
|
|
10531
10516
|
getValue,
|
|
10532
10517
|
setValue,
|
|
10533
|
-
validate: validate$
|
|
10518
|
+
validate: validate$9
|
|
10534
10519
|
});
|
|
10535
10520
|
}
|
|
10536
10521
|
|
|
@@ -10540,7 +10525,7 @@ function Height(props) {
|
|
|
10540
10525
|
* @param {number|void} value
|
|
10541
10526
|
* @returns {string|null}
|
|
10542
10527
|
*/
|
|
10543
|
-
const validate$
|
|
10528
|
+
const validate$9 = value => {
|
|
10544
10529
|
if (typeof value !== 'number') {
|
|
10545
10530
|
return 'A number is required.';
|
|
10546
10531
|
}
|
|
@@ -10604,7 +10589,7 @@ function Url(props) {
|
|
|
10604
10589
|
setValue,
|
|
10605
10590
|
singleLine: true,
|
|
10606
10591
|
tooltip: getTooltip$1(),
|
|
10607
|
-
validate: validate$
|
|
10592
|
+
validate: validate$8,
|
|
10608
10593
|
variables
|
|
10609
10594
|
});
|
|
10610
10595
|
}
|
|
@@ -10632,7 +10617,7 @@ function getTooltip$1() {
|
|
|
10632
10617
|
* @param {string|void} value
|
|
10633
10618
|
* @returns {string|null}
|
|
10634
10619
|
*/
|
|
10635
|
-
const validate$
|
|
10620
|
+
const validate$8 = value => {
|
|
10636
10621
|
if (!value || value.startsWith('=')) {
|
|
10637
10622
|
return;
|
|
10638
10623
|
}
|
|
@@ -10723,7 +10708,7 @@ function Text(props) {
|
|
|
10723
10708
|
};
|
|
10724
10709
|
return FeelTemplatingEntry({
|
|
10725
10710
|
debounce,
|
|
10726
|
-
description: description$
|
|
10711
|
+
description: description$3,
|
|
10727
10712
|
element: field,
|
|
10728
10713
|
getValue,
|
|
10729
10714
|
id,
|
|
@@ -10733,7 +10718,7 @@ function Text(props) {
|
|
|
10733
10718
|
variables
|
|
10734
10719
|
});
|
|
10735
10720
|
}
|
|
10736
|
-
const description$
|
|
10721
|
+
const description$3 = jsxs(Fragment$1, {
|
|
10737
10722
|
children: ["Supports markdown and templating.", ' ', jsx("a", {
|
|
10738
10723
|
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
|
|
10739
10724
|
target: "_blank",
|
|
@@ -10776,13 +10761,13 @@ function Content(props) {
|
|
|
10776
10761
|
};
|
|
10777
10762
|
return FeelTemplatingEntry({
|
|
10778
10763
|
debounce,
|
|
10779
|
-
description: description$
|
|
10764
|
+
description: description$2,
|
|
10780
10765
|
element: field,
|
|
10781
10766
|
getValue,
|
|
10782
10767
|
id,
|
|
10783
10768
|
label: 'Content',
|
|
10784
10769
|
hostLanguage: 'html',
|
|
10785
|
-
validate: validate$
|
|
10770
|
+
validate: validate$7,
|
|
10786
10771
|
setValue,
|
|
10787
10772
|
variables
|
|
10788
10773
|
});
|
|
@@ -10790,7 +10775,7 @@ function Content(props) {
|
|
|
10790
10775
|
|
|
10791
10776
|
// helpers //////////
|
|
10792
10777
|
|
|
10793
|
-
const description$
|
|
10778
|
+
const description$2 = jsxs(Fragment$1, {
|
|
10794
10779
|
children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsx("a", {
|
|
10795
10780
|
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
|
|
10796
10781
|
target: "_blank",
|
|
@@ -10803,7 +10788,7 @@ const description$3 = jsxs(Fragment$1, {
|
|
|
10803
10788
|
* @param {string|void} value
|
|
10804
10789
|
* @returns {string|null}
|
|
10805
10790
|
*/
|
|
10806
|
-
const validate$
|
|
10791
|
+
const validate$7 = value => {
|
|
10807
10792
|
// allow empty state
|
|
10808
10793
|
if (typeof value !== 'string' || value === '') {
|
|
10809
10794
|
return null;
|
|
@@ -11642,7 +11627,7 @@ function InputValuesKey(props) {
|
|
|
11642
11627
|
id,
|
|
11643
11628
|
label: 'Input values key',
|
|
11644
11629
|
setValue,
|
|
11645
|
-
validate: validate$
|
|
11630
|
+
validate: validate$6
|
|
11646
11631
|
});
|
|
11647
11632
|
}
|
|
11648
11633
|
|
|
@@ -11652,7 +11637,7 @@ function InputValuesKey(props) {
|
|
|
11652
11637
|
* @param {string|void} value
|
|
11653
11638
|
* @returns {string|null}
|
|
11654
11639
|
*/
|
|
11655
|
-
const validate$
|
|
11640
|
+
const validate$6 = value => {
|
|
11656
11641
|
if (typeof value !== 'string' || value.length === 0) {
|
|
11657
11642
|
return 'Must not be empty.';
|
|
11658
11643
|
}
|
|
@@ -11678,7 +11663,14 @@ function StaticOptionsSourceEntry(props) {
|
|
|
11678
11663
|
editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
|
|
11679
11664
|
};
|
|
11680
11665
|
const removeEntry = entry => {
|
|
11681
|
-
|
|
11666
|
+
if (field.defaultValue === entry.value) {
|
|
11667
|
+
editField(field, {
|
|
11668
|
+
values: without(values, entry),
|
|
11669
|
+
defaultValue: undefined
|
|
11670
|
+
});
|
|
11671
|
+
} else {
|
|
11672
|
+
editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], without(values, entry));
|
|
11673
|
+
}
|
|
11682
11674
|
};
|
|
11683
11675
|
const validateFactory = (key, getValue) => {
|
|
11684
11676
|
return value => {
|
|
@@ -11934,7 +11926,6 @@ function RepeatableEntry(props) {
|
|
|
11934
11926
|
path: ['nonCollapsedItems'],
|
|
11935
11927
|
label: 'Number of non-collapsing items',
|
|
11936
11928
|
min: 1,
|
|
11937
|
-
defaultValue: 5,
|
|
11938
11929
|
props
|
|
11939
11930
|
});
|
|
11940
11931
|
entries.push(nonCollapseItemsEntry);
|
|
@@ -12095,7 +12086,7 @@ function Source(props) {
|
|
|
12095
12086
|
setValue,
|
|
12096
12087
|
singleLine: true,
|
|
12097
12088
|
variables,
|
|
12098
|
-
validate: validate$
|
|
12089
|
+
validate: validate$5
|
|
12099
12090
|
});
|
|
12100
12091
|
}
|
|
12101
12092
|
|
|
@@ -12105,7 +12096,7 @@ function Source(props) {
|
|
|
12105
12096
|
* @param {string|void} value
|
|
12106
12097
|
* @returns {string|null}
|
|
12107
12098
|
*/
|
|
12108
|
-
const validate$
|
|
12099
|
+
const validate$5 = value => {
|
|
12109
12100
|
if (!isString(value) || value.length === 0) {
|
|
12110
12101
|
return 'Must not be empty.';
|
|
12111
12102
|
}
|
|
@@ -12209,7 +12200,7 @@ function RowCount(props) {
|
|
|
12209
12200
|
id,
|
|
12210
12201
|
getValue,
|
|
12211
12202
|
setValue,
|
|
12212
|
-
validate: validate$
|
|
12203
|
+
validate: validate$4
|
|
12213
12204
|
});
|
|
12214
12205
|
}
|
|
12215
12206
|
|
|
@@ -12219,7 +12210,7 @@ function RowCount(props) {
|
|
|
12219
12210
|
* @param {string|void} value
|
|
12220
12211
|
* @returns {string|null}
|
|
12221
12212
|
*/
|
|
12222
|
-
const validate$
|
|
12213
|
+
const validate$4 = value => {
|
|
12223
12214
|
if (isNil(value)) {
|
|
12224
12215
|
return null;
|
|
12225
12216
|
}
|
|
@@ -12393,7 +12384,7 @@ function ColumnsExpression(props) {
|
|
|
12393
12384
|
setValue,
|
|
12394
12385
|
singleLine: true,
|
|
12395
12386
|
variables,
|
|
12396
|
-
validate: validate$
|
|
12387
|
+
validate: validate$3
|
|
12397
12388
|
});
|
|
12398
12389
|
}
|
|
12399
12390
|
|
|
@@ -12403,7 +12394,7 @@ function ColumnsExpression(props) {
|
|
|
12403
12394
|
* @param {string|void} value
|
|
12404
12395
|
* @returns {string|null}
|
|
12405
12396
|
*/
|
|
12406
|
-
const validate$
|
|
12397
|
+
const validate$3 = value => {
|
|
12407
12398
|
if (!isString(value) || value.length === 0 || value === '=') {
|
|
12408
12399
|
return 'Must not be empty.';
|
|
12409
12400
|
}
|
|
@@ -12501,7 +12492,7 @@ function Key(props) {
|
|
|
12501
12492
|
id,
|
|
12502
12493
|
label: 'Key',
|
|
12503
12494
|
setValue,
|
|
12504
|
-
validate: validate$
|
|
12495
|
+
validate: validate$2
|
|
12505
12496
|
});
|
|
12506
12497
|
}
|
|
12507
12498
|
|
|
@@ -12511,7 +12502,7 @@ function Key(props) {
|
|
|
12511
12502
|
* @param {string|void} value
|
|
12512
12503
|
* @returns {string|null}
|
|
12513
12504
|
*/
|
|
12514
|
-
function validate$
|
|
12505
|
+
function validate$2(value) {
|
|
12515
12506
|
if (!isString(value) || value.length === 0) {
|
|
12516
12507
|
return 'Must not be empty.';
|
|
12517
12508
|
}
|
|
@@ -12649,13 +12640,13 @@ function Accept(props) {
|
|
|
12649
12640
|
singleLine: true,
|
|
12650
12641
|
setValue,
|
|
12651
12642
|
variables,
|
|
12652
|
-
description: description$
|
|
12643
|
+
description: description$1
|
|
12653
12644
|
});
|
|
12654
12645
|
}
|
|
12655
12646
|
|
|
12656
12647
|
// helpers //////////
|
|
12657
12648
|
|
|
12658
|
-
const description$
|
|
12649
|
+
const description$1 = jsxs(Fragment$1, {
|
|
12659
12650
|
children: ["A comma-separated list of", ' ', jsx("a", {
|
|
12660
12651
|
href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
|
|
12661
12652
|
target: "_blank",
|
|
@@ -12776,85 +12767,6 @@ function DocumentsDataSource(props) {
|
|
|
12776
12767
|
setValue,
|
|
12777
12768
|
variables,
|
|
12778
12769
|
tooltip,
|
|
12779
|
-
validate: validate$2
|
|
12780
|
-
});
|
|
12781
|
-
}
|
|
12782
|
-
|
|
12783
|
-
// helpers //////////
|
|
12784
|
-
|
|
12785
|
-
/**
|
|
12786
|
-
* @param {string|undefined} value
|
|
12787
|
-
* @returns {string|null}
|
|
12788
|
-
*/
|
|
12789
|
-
const validate$2 = value => {
|
|
12790
|
-
if (typeof value !== 'string' || value.length === 0) {
|
|
12791
|
-
return 'The document data source is required.';
|
|
12792
|
-
}
|
|
12793
|
-
};
|
|
12794
|
-
|
|
12795
|
-
function EndpointKeyEntry(props) {
|
|
12796
|
-
const {
|
|
12797
|
-
editField,
|
|
12798
|
-
field
|
|
12799
|
-
} = props;
|
|
12800
|
-
const entries = [];
|
|
12801
|
-
entries.push({
|
|
12802
|
-
id: 'endpointKey',
|
|
12803
|
-
component: EndpointKey,
|
|
12804
|
-
editField: editField,
|
|
12805
|
-
field: field,
|
|
12806
|
-
isEdited: isEdited$6,
|
|
12807
|
-
isDefaultVisible: field => field.type === 'documentPreview'
|
|
12808
|
-
});
|
|
12809
|
-
return entries;
|
|
12810
|
-
}
|
|
12811
|
-
function EndpointKey(props) {
|
|
12812
|
-
const {
|
|
12813
|
-
editField,
|
|
12814
|
-
field,
|
|
12815
|
-
id
|
|
12816
|
-
} = props;
|
|
12817
|
-
const debounce = useService('debounce');
|
|
12818
|
-
const variables = useVariables().map(name => ({
|
|
12819
|
-
name
|
|
12820
|
-
}));
|
|
12821
|
-
const path = ['endpointKey'];
|
|
12822
|
-
const getValue = () => {
|
|
12823
|
-
return get(field, path, '');
|
|
12824
|
-
};
|
|
12825
|
-
const setValue = value => {
|
|
12826
|
-
return editField(field, path, value);
|
|
12827
|
-
};
|
|
12828
|
-
const tooltip = jsxs("div", {
|
|
12829
|
-
children: [jsx("p", {
|
|
12830
|
-
children: "Enter a context key that generates a string with the API endpoint to download a document."
|
|
12831
|
-
}), jsxs("p", {
|
|
12832
|
-
children: ["The string must contain ", jsx("code", {
|
|
12833
|
-
children: '{ documentId }'
|
|
12834
|
-
}), ", which will be replaced with the document ID from the document\u2018s reference."]
|
|
12835
|
-
}), jsx("p", {
|
|
12836
|
-
children: "If you\u2018re using the Camunda Tasklist, this variable is automatically added to the context for you."
|
|
12837
|
-
}), jsxs("p", {
|
|
12838
|
-
children: ["For more details, see the", ' ', jsx("a", {
|
|
12839
|
-
href: "https://docs.camunda.io/docs/next/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
|
|
12840
|
-
rel: "noopener noreferrer",
|
|
12841
|
-
target: "_blank",
|
|
12842
|
-
children: "Camunda documentation"
|
|
12843
|
-
})]
|
|
12844
|
-
})]
|
|
12845
|
-
});
|
|
12846
|
-
return FeelTemplatingEntry({
|
|
12847
|
-
debounce,
|
|
12848
|
-
element: field,
|
|
12849
|
-
getValue,
|
|
12850
|
-
id,
|
|
12851
|
-
label: 'Document URL',
|
|
12852
|
-
feel: 'required',
|
|
12853
|
-
singleLine: true,
|
|
12854
|
-
setValue,
|
|
12855
|
-
variables,
|
|
12856
|
-
description: description$1,
|
|
12857
|
-
tooltip,
|
|
12858
12770
|
validate: validate$1
|
|
12859
12771
|
});
|
|
12860
12772
|
}
|
|
@@ -12867,12 +12779,9 @@ function EndpointKey(props) {
|
|
|
12867
12779
|
*/
|
|
12868
12780
|
const validate$1 = value => {
|
|
12869
12781
|
if (typeof value !== 'string' || value.length === 0) {
|
|
12870
|
-
return 'The document
|
|
12782
|
+
return 'The document data source is required.';
|
|
12871
12783
|
}
|
|
12872
12784
|
};
|
|
12873
|
-
const description$1 = jsx(Fragment$1, {
|
|
12874
|
-
children: "Define an API URL for downloading a document"
|
|
12875
|
-
});
|
|
12876
12785
|
|
|
12877
12786
|
function MaxHeightEntry(props) {
|
|
12878
12787
|
const {
|
|
@@ -12976,13 +12885,9 @@ function GeneralGroup(field, editField, getService) {
|
|
|
12976
12885
|
editField
|
|
12977
12886
|
}), ...TextEntry({
|
|
12978
12887
|
field,
|
|
12979
|
-
editField,
|
|
12980
|
-
getService
|
|
12981
|
-
}), ...HtmlEntry({
|
|
12888
|
+
editField}), ...HtmlEntry({
|
|
12982
12889
|
field,
|
|
12983
|
-
editField,
|
|
12984
|
-
getService
|
|
12985
|
-
}), ...IFrameUrlEntry({
|
|
12890
|
+
editField}), ...IFrameUrlEntry({
|
|
12986
12891
|
field,
|
|
12987
12892
|
editField
|
|
12988
12893
|
}), ...IFrameHeightEntry({
|
|
@@ -13304,12 +13209,11 @@ function ValidationType(props) {
|
|
|
13304
13209
|
id,
|
|
13305
13210
|
onChange
|
|
13306
13211
|
} = props;
|
|
13307
|
-
|
|
13212
|
+
useService('debounce');
|
|
13308
13213
|
const setValue = validationType => {
|
|
13309
13214
|
onChange('validationType')(validationType || undefined);
|
|
13310
13215
|
};
|
|
13311
13216
|
return SelectEntry({
|
|
13312
|
-
debounce,
|
|
13313
13217
|
element: field,
|
|
13314
13218
|
getValue: getValue('validationType'),
|
|
13315
13219
|
id,
|
|
@@ -13659,21 +13563,6 @@ const TOOLTIP_TEXT = `"List of items" defines a constant, predefined set of form
|
|
|
13659
13563
|
"Expression" defines options that are populated from a FEEL expression.
|
|
13660
13564
|
`;
|
|
13661
13565
|
|
|
13662
|
-
function DownloadSettings(field, editField) {
|
|
13663
|
-
const entries = [...EndpointKeyEntry({
|
|
13664
|
-
field,
|
|
13665
|
-
editField
|
|
13666
|
-
})];
|
|
13667
|
-
if (!entries.length) {
|
|
13668
|
-
return null;
|
|
13669
|
-
}
|
|
13670
|
-
return {
|
|
13671
|
-
id: 'downloadSettings',
|
|
13672
|
-
label: 'Download settings',
|
|
13673
|
-
entries
|
|
13674
|
-
};
|
|
13675
|
-
}
|
|
13676
|
-
|
|
13677
13566
|
class PropertiesProvider {
|
|
13678
13567
|
constructor(propertiesPanel, injector) {
|
|
13679
13568
|
this._injector = injector;
|
|
@@ -13709,7 +13598,7 @@ class PropertiesProvider {
|
|
|
13709
13598
|
return groups;
|
|
13710
13599
|
}
|
|
13711
13600
|
const getService = (type, strict = true) => this._injector.get(type, strict);
|
|
13712
|
-
groups = [...groups, GeneralGroup(field, editField, getService),
|
|
13601
|
+
groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
|
|
13713
13602
|
this._filterVisibleEntries(groups, field, getService);
|
|
13714
13603
|
|
|
13715
13604
|
// contract: if a group has no entries or items, it should not be displayed at all
|