@bpmn-io/form-js-playground 1.14.1-alpha.0 → 1.15.1
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/form-playground.umd.js +577 -687
- package/package.json +7 -7
|
@@ -41257,11 +41257,11 @@
|
|
|
41257
41257
|
moveY = 0;
|
|
41258
41258
|
if (y == "nearest") {
|
|
41259
41259
|
if (rect.top < bounding.top) {
|
|
41260
|
-
moveY =
|
|
41261
|
-
if (side > 0 && rect.bottom > bounding.bottom + moveY) moveY = rect.bottom - bounding.bottom +
|
|
41260
|
+
moveY = rect.top - (bounding.top + yMargin);
|
|
41261
|
+
if (side > 0 && rect.bottom > bounding.bottom + moveY) moveY = rect.bottom - bounding.bottom + yMargin;
|
|
41262
41262
|
} else if (rect.bottom > bounding.bottom) {
|
|
41263
41263
|
moveY = rect.bottom - bounding.bottom + yMargin;
|
|
41264
|
-
if (side < 0 && rect.top - moveY < bounding.top) moveY =
|
|
41264
|
+
if (side < 0 && rect.top - moveY < bounding.top) moveY = rect.top - (bounding.top + yMargin);
|
|
41265
41265
|
}
|
|
41266
41266
|
} else {
|
|
41267
41267
|
let rectHeight = rect.bottom - rect.top,
|
|
@@ -41271,11 +41271,11 @@
|
|
|
41271
41271
|
}
|
|
41272
41272
|
if (x == "nearest") {
|
|
41273
41273
|
if (rect.left < bounding.left) {
|
|
41274
|
-
moveX =
|
|
41275
|
-
if (side > 0 && rect.right > bounding.right + moveX) moveX = rect.right - bounding.right +
|
|
41274
|
+
moveX = rect.left - (bounding.left + xMargin);
|
|
41275
|
+
if (side > 0 && rect.right > bounding.right + moveX) moveX = rect.right - bounding.right + xMargin;
|
|
41276
41276
|
} else if (rect.right > bounding.right) {
|
|
41277
41277
|
moveX = rect.right - bounding.right + xMargin;
|
|
41278
|
-
if (side < 0 && rect.left < bounding.left + moveX) moveX =
|
|
41278
|
+
if (side < 0 && rect.left < bounding.left + moveX) moveX = rect.left - (bounding.left + xMargin);
|
|
41279
41279
|
}
|
|
41280
41280
|
} else {
|
|
41281
41281
|
let targetLeft = x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin;
|
|
@@ -41308,6 +41308,12 @@
|
|
|
41308
41308
|
}
|
|
41309
41309
|
}
|
|
41310
41310
|
if (top) break;
|
|
41311
|
+
if (rect.top < bounding.top || rect.bottom > bounding.bottom || rect.left < bounding.left || rect.right > bounding.right) rect = {
|
|
41312
|
+
left: Math.max(rect.left, bounding.left),
|
|
41313
|
+
right: Math.min(rect.right, bounding.right),
|
|
41314
|
+
top: Math.max(rect.top, bounding.top),
|
|
41315
|
+
bottom: Math.min(rect.bottom, bounding.bottom)
|
|
41316
|
+
};
|
|
41311
41317
|
cur = cur.assignedSlot || cur.parentNode;
|
|
41312
41318
|
} else if (cur.nodeType == 11) {
|
|
41313
41319
|
// A shadow root
|
|
@@ -45249,7 +45255,7 @@
|
|
|
45249
45255
|
handleEvent(event) {
|
|
45250
45256
|
if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event)) return;
|
|
45251
45257
|
if (event.type == "keydown" && this.keydown(event)) return;
|
|
45252
|
-
this.runHandlers(event.type, event);
|
|
45258
|
+
if (this.view.updateState != 0 /* UpdateState.Idle */) Promise.resolve().then(() => this.runHandlers(event.type, event));else this.runHandlers(event.type, event);
|
|
45253
45259
|
}
|
|
45254
45260
|
runHandlers(type, event) {
|
|
45255
45261
|
let handlers = this.handlers[type];
|
|
@@ -48386,8 +48392,9 @@
|
|
|
48386
48392
|
return !abort;
|
|
48387
48393
|
}
|
|
48388
48394
|
update(update) {
|
|
48389
|
-
let reverted = this.pendingContextChange
|
|
48390
|
-
|
|
48395
|
+
let reverted = this.pendingContextChange,
|
|
48396
|
+
startSel = update.startState.selection.main;
|
|
48397
|
+
if (this.composing && (this.composing.drifted || !update.changes.touchesRange(startSel.from, startSel.to) && update.transactions.some(tr => !tr.isUserEvent("input.type") && tr.changes.touchesRange(this.from, this.to)))) {
|
|
48391
48398
|
this.composing.drifted = true;
|
|
48392
48399
|
this.composing.editorBase = update.changes.mapPos(this.composing.editorBase);
|
|
48393
48400
|
} else if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {
|
|
@@ -50794,14 +50801,12 @@
|
|
|
50794
50801
|
return tooltipConfig.of(config);
|
|
50795
50802
|
}
|
|
50796
50803
|
function windowSpace(view) {
|
|
50797
|
-
let
|
|
50798
|
-
win
|
|
50799
|
-
} = view;
|
|
50804
|
+
let docElt = view.dom.ownerDocument.documentElement;
|
|
50800
50805
|
return {
|
|
50801
50806
|
top: 0,
|
|
50802
50807
|
left: 0,
|
|
50803
|
-
bottom:
|
|
50804
|
-
right:
|
|
50808
|
+
bottom: docElt.clientHeight,
|
|
50809
|
+
right: docElt.clientWidth
|
|
50805
50810
|
};
|
|
50806
50811
|
}
|
|
50807
50812
|
const tooltipConfig = /*@__PURE__*/Facet.define({
|
|
@@ -70025,10 +70030,15 @@
|
|
|
70025
70030
|
};
|
|
70026
70031
|
const type$k = 'documentPreview';
|
|
70027
70032
|
|
|
70033
|
+
/**
|
|
70034
|
+
* @typedef DocumentEndpointBuilder
|
|
70035
|
+
* @property {(document: DocumentMetadata) => string} buildUrl
|
|
70036
|
+
*/
|
|
70037
|
+
|
|
70028
70038
|
/**
|
|
70029
70039
|
* @typedef DocumentMetadata
|
|
70030
70040
|
* @property {string} documentId
|
|
70031
|
-
* @property {string}
|
|
70041
|
+
* @property {string} endpoint
|
|
70032
70042
|
* @property {Object} metadata
|
|
70033
70043
|
* @property {string|undefined} [metadata.contentType]
|
|
70034
70044
|
* @property {string} metadata.fileName
|
|
@@ -70037,7 +70047,6 @@
|
|
|
70037
70047
|
* @property {string} id
|
|
70038
70048
|
* @property {string} [title]
|
|
70039
70049
|
* @property {string} [dataSource]
|
|
70040
|
-
* @property {string} [endpointKey]
|
|
70041
70050
|
* @property {number} [maxHeight]
|
|
70042
70051
|
* @property {string} [label]
|
|
70043
70052
|
*
|
|
@@ -70049,18 +70058,18 @@
|
|
|
70049
70058
|
* @returns {import("preact").JSX.Element}
|
|
70050
70059
|
*/
|
|
70051
70060
|
function DocumentPreview(props) {
|
|
70061
|
+
/** @type {DocumentEndpointBuilder | null} */
|
|
70062
|
+
const documentEndpointBuilder = useService$2('documentEndpointBuilder', false);
|
|
70052
70063
|
const {
|
|
70053
70064
|
field,
|
|
70054
70065
|
domId
|
|
70055
70066
|
} = props;
|
|
70056
70067
|
const {
|
|
70057
70068
|
dataSource,
|
|
70058
|
-
endpointKey,
|
|
70059
70069
|
maxHeight,
|
|
70060
70070
|
label
|
|
70061
70071
|
} = field;
|
|
70062
70072
|
const errorMessageId = `${domId}-error-message`;
|
|
70063
|
-
const endpoint = useExpressionEvaluation(endpointKey || '');
|
|
70064
70073
|
const data = useValidDocumentData(dataSource || '');
|
|
70065
70074
|
const evaluatedLabel = useSingleLineTemplateEvaluation(label, {
|
|
70066
70075
|
debug: true
|
|
@@ -70073,18 +70082,19 @@
|
|
|
70073
70082
|
}), o("div", {
|
|
70074
70083
|
class: `fjs-${type$k}-document-container`,
|
|
70075
70084
|
id: domId,
|
|
70076
|
-
children:
|
|
70077
|
-
|
|
70078
|
-
|
|
70079
|
-
|
|
70080
|
-
|
|
70081
|
-
|
|
70085
|
+
children: data.map((document, index) => {
|
|
70086
|
+
const finalEndpoint = tryCatch(() => documentEndpointBuilder?.buildUrl(document)) ?? document.endpoint;
|
|
70087
|
+
return isValidDocumentEndpoint(finalEndpoint) ? o(DocumentRenderer, {
|
|
70088
|
+
documentMetadata: document,
|
|
70089
|
+
endpoint: finalEndpoint,
|
|
70090
|
+
maxHeight: maxHeight,
|
|
70091
|
+
domId: `${domId}-${index}`
|
|
70092
|
+
}, document.documentId) : null;
|
|
70093
|
+
})
|
|
70082
70094
|
}), o(Errors, {
|
|
70083
70095
|
id: errorMessageId,
|
|
70084
70096
|
errors: getErrors({
|
|
70085
|
-
dataSource
|
|
70086
|
-
endpoint,
|
|
70087
|
-
endpointKey
|
|
70097
|
+
dataSource
|
|
70088
70098
|
})
|
|
70089
70099
|
})]
|
|
70090
70100
|
});
|
|
@@ -70096,43 +70106,27 @@
|
|
|
70096
70106
|
name: 'Document preview',
|
|
70097
70107
|
create: (options = {}) => ({
|
|
70098
70108
|
label: 'Document preview',
|
|
70099
|
-
endpointKey: DEFAULT_ENDPOINT_KEY,
|
|
70100
70109
|
...options
|
|
70101
70110
|
})
|
|
70102
70111
|
};
|
|
70103
70112
|
|
|
70104
70113
|
// helpers /////////////////////////////
|
|
70105
70114
|
|
|
70106
|
-
const DOCUMENT_ID_PLACEHOLDER = '{documentId}';
|
|
70107
|
-
const DEFAULT_ENDPOINT_KEY = '=defaultDocumentsEndpointKey';
|
|
70108
|
-
|
|
70109
70115
|
/**
|
|
70110
70116
|
* @typedef GetErrorOptions
|
|
70111
70117
|
* @property {string|undefined} dataSource
|
|
70112
|
-
* @property {string|undefined} endpointKey
|
|
70113
|
-
* @property {string|null} endpoint
|
|
70114
70118
|
*
|
|
70115
70119
|
* @param {GetErrorOptions} options
|
|
70116
70120
|
* @returns {string[]}
|
|
70117
70121
|
*/
|
|
70118
70122
|
function getErrors(options) {
|
|
70119
70123
|
const {
|
|
70120
|
-
dataSource
|
|
70121
|
-
endpointKey,
|
|
70122
|
-
endpoint
|
|
70124
|
+
dataSource
|
|
70123
70125
|
} = options;
|
|
70124
70126
|
let errors = [];
|
|
70125
70127
|
if (!isString$3(dataSource) || dataSource.length < 1) {
|
|
70126
70128
|
errors.push('Document reference is not defined.');
|
|
70127
70129
|
}
|
|
70128
|
-
if (!isString$3(endpointKey) || endpointKey.length < 1) {
|
|
70129
|
-
errors.push('Endpoint key is not defined.');
|
|
70130
|
-
}
|
|
70131
|
-
if (endpointKey !== DEFAULT_ENDPOINT_KEY && !URL.canParse(endpoint)) {
|
|
70132
|
-
errors.push(`If you change the endpoint key from "${DEFAULT_ENDPOINT_KEY}", the document preview won't work with Camunda Tasklist and you must provide a valid URL.`);
|
|
70133
|
-
} else if (endpointKey !== DEFAULT_ENDPOINT_KEY && !isValidDocumentEndpoint(endpoint)) {
|
|
70134
|
-
errors.push('Endpoint must contain "{documentId}".');
|
|
70135
|
-
}
|
|
70136
70130
|
return errors;
|
|
70137
70131
|
}
|
|
70138
70132
|
|
|
@@ -70142,7 +70136,7 @@
|
|
|
70142
70136
|
* @returns boolean
|
|
70143
70137
|
*/
|
|
70144
70138
|
function isValidDocumentEndpoint(endpoint) {
|
|
70145
|
-
return typeof endpoint === 'string' && URL.canParse(endpoint)
|
|
70139
|
+
return typeof endpoint === 'string' && URL.canParse(endpoint);
|
|
70146
70140
|
}
|
|
70147
70141
|
|
|
70148
70142
|
/**
|
|
@@ -70179,9 +70173,11 @@
|
|
|
70179
70173
|
onError,
|
|
70180
70174
|
errorMessageId
|
|
70181
70175
|
} = props;
|
|
70176
|
+
/** @type {ReturnType<typeof import("preact/hooks").useState<null | string>>} */
|
|
70182
70177
|
const [pdfObjectUrl, setPdfObjectUrl] = h(null);
|
|
70183
70178
|
const [hasError, setHasError] = h(false);
|
|
70184
70179
|
p(() => {
|
|
70180
|
+
/** @type {null | string} */
|
|
70185
70181
|
let objectUrl = null;
|
|
70186
70182
|
const fetchPdf = async () => {
|
|
70187
70183
|
try {
|
|
@@ -70207,7 +70203,7 @@
|
|
|
70207
70203
|
};
|
|
70208
70204
|
}, [url, onError]);
|
|
70209
70205
|
return o(k$2, {
|
|
70210
|
-
children: [pdfObjectUrl ? o("embed", {
|
|
70206
|
+
children: [pdfObjectUrl !== null ? o("embed", {
|
|
70211
70207
|
src: pdfObjectUrl,
|
|
70212
70208
|
type: "application/pdf",
|
|
70213
70209
|
class: `fjs-${type$k}-pdf-viewer`
|
|
@@ -70241,11 +70237,6 @@
|
|
|
70241
70237
|
const [hasError, setHasError] = h(false);
|
|
70242
70238
|
const ref = _$1(null);
|
|
70243
70239
|
const isInViewport = useInViewport(ref);
|
|
70244
|
-
const fullUrl = buildUrl({
|
|
70245
|
-
baseUrl: endpoint,
|
|
70246
|
-
documentId: documentMetadata.documentId,
|
|
70247
|
-
contentHash: documentMetadata.contentHash
|
|
70248
|
-
});
|
|
70249
70240
|
const singleDocumentContainerClassName = `fjs-${type$k}-single-document-container`;
|
|
70250
70241
|
const errorMessageId = `${domId}-error-message`;
|
|
70251
70242
|
const errorMessage = 'Unable to download document';
|
|
@@ -70258,11 +70249,11 @@
|
|
|
70258
70249
|
},
|
|
70259
70250
|
"aria-describedby": hasError ? errorMessageId : undefined,
|
|
70260
70251
|
children: [o("img", {
|
|
70261
|
-
src:
|
|
70252
|
+
src: endpoint,
|
|
70262
70253
|
alt: metadata.fileName,
|
|
70263
70254
|
class: `fjs-${type$k}-image`
|
|
70264
70255
|
}), o(DownloadButton, {
|
|
70265
|
-
endpoint:
|
|
70256
|
+
endpoint: endpoint,
|
|
70266
70257
|
fileName: metadata.fileName,
|
|
70267
70258
|
onDownloadError: () => {
|
|
70268
70259
|
setHasError(true);
|
|
@@ -70281,7 +70272,7 @@
|
|
|
70281
70272
|
},
|
|
70282
70273
|
"aria-describedby": hasError ? errorMessageId : undefined,
|
|
70283
70274
|
children: o(PdfRenderer, {
|
|
70284
|
-
url:
|
|
70275
|
+
url: endpoint,
|
|
70285
70276
|
fileName: metadata.fileName,
|
|
70286
70277
|
onError: () => setHasError(true),
|
|
70287
70278
|
errorMessageId: errorMessageId
|
|
@@ -70301,7 +70292,7 @@
|
|
|
70301
70292
|
errors: [errorMessage]
|
|
70302
70293
|
}) : null]
|
|
70303
70294
|
}), o(DownloadButton, {
|
|
70304
|
-
endpoint:
|
|
70295
|
+
endpoint: endpoint,
|
|
70305
70296
|
fileName: metadata.fileName,
|
|
70306
70297
|
onDownloadError: () => {
|
|
70307
70298
|
setHasError(true);
|
|
@@ -70381,27 +70372,18 @@
|
|
|
70381
70372
|
}
|
|
70382
70373
|
|
|
70383
70374
|
/**
|
|
70384
|
-
*
|
|
70385
|
-
*
|
|
70386
|
-
* @
|
|
70387
|
-
* @param {string} options.baseUrl
|
|
70388
|
-
* @param {string} options.documentId
|
|
70389
|
-
* @param {string} [options.contentHash]
|
|
70390
|
-
*
|
|
70391
|
-
* @returns {string}
|
|
70375
|
+
* @template T
|
|
70376
|
+
* @param {() => T} fn - Function to execute
|
|
70377
|
+
* @returns {T | null}
|
|
70392
70378
|
*/
|
|
70393
|
-
|
|
70394
|
-
|
|
70395
|
-
|
|
70396
|
-
|
|
70397
|
-
|
|
70398
|
-
|
|
70399
|
-
const finalUrl = new URL(baseUrl.replace(DOCUMENT_ID_PLACEHOLDER, documentId));
|
|
70400
|
-
if (contentHash !== undefined) {
|
|
70401
|
-
finalUrl.searchParams.set('contentHash', contentHash);
|
|
70379
|
+
const tryCatch = fn => {
|
|
70380
|
+
try {
|
|
70381
|
+
return fn();
|
|
70382
|
+
} catch (error) {
|
|
70383
|
+
console.error(error);
|
|
70384
|
+
return null;
|
|
70402
70385
|
}
|
|
70403
|
-
|
|
70404
|
-
}
|
|
70386
|
+
};
|
|
70405
70387
|
|
|
70406
70388
|
/**
|
|
70407
70389
|
* This file must not be changed or exchanged.
|
|
@@ -70556,7 +70538,7 @@
|
|
|
70556
70538
|
return this._formFields[type];
|
|
70557
70539
|
}
|
|
70558
70540
|
}
|
|
70559
|
-
const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression', 'expression', 'multiple', 'accept', '
|
|
70541
|
+
const EXPRESSION_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'conditional.hide', 'description', 'label', 'source', 'readonly', 'text', 'validate.min', 'validate.max', 'validate.minLength', 'validate.maxLength', 'valuesExpression', 'url', 'dataSource', 'columnsExpression', 'expression', 'multiple', 'accept', 'title'];
|
|
70560
70542
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url', 'title'];
|
|
70561
70543
|
|
|
70562
70544
|
/**
|
|
@@ -83489,19 +83471,19 @@
|
|
|
83489
83471
|
errors: {}
|
|
83490
83472
|
});
|
|
83491
83473
|
|
|
83492
|
-
/**
|
|
83493
|
-
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
83494
|
-
*
|
|
83495
|
-
* @example
|
|
83496
|
-
*
|
|
83497
|
-
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
83498
|
-
* // ...
|
|
83499
|
-
* });
|
|
83500
|
-
*
|
|
83501
|
-
* @param {Object} context
|
|
83502
|
-
* @param {boolean} [context.focus]
|
|
83503
|
-
*
|
|
83504
|
-
* @returns void
|
|
83474
|
+
/**
|
|
83475
|
+
* @typedef {Function} <propertiesPanel.showEntry> callback
|
|
83476
|
+
*
|
|
83477
|
+
* @example
|
|
83478
|
+
*
|
|
83479
|
+
* useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
|
|
83480
|
+
* // ...
|
|
83481
|
+
* });
|
|
83482
|
+
*
|
|
83483
|
+
* @param {Object} context
|
|
83484
|
+
* @param {boolean} [context.focus]
|
|
83485
|
+
*
|
|
83486
|
+
* @returns void
|
|
83505
83487
|
*/
|
|
83506
83488
|
|
|
83507
83489
|
const EventContext = G({
|
|
@@ -83518,20 +83500,20 @@
|
|
|
83518
83500
|
getTooltipForId: () => {}
|
|
83519
83501
|
});
|
|
83520
83502
|
|
|
83521
|
-
/**
|
|
83522
|
-
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
83523
|
-
*
|
|
83524
|
-
* @example
|
|
83525
|
-
* ```jsx
|
|
83526
|
-
* function TextField(props) {
|
|
83527
|
-
* const tooltip = useTooltipContext('input1', element);
|
|
83528
|
-
* }
|
|
83529
|
-
* ```
|
|
83530
|
-
*
|
|
83531
|
-
* @param {string} id
|
|
83532
|
-
* @param {object} element
|
|
83533
|
-
*
|
|
83534
|
-
* @returns {string}
|
|
83503
|
+
/**
|
|
83504
|
+
* Accesses the global TooltipContext and returns a tooltip for a given id and element.
|
|
83505
|
+
*
|
|
83506
|
+
* @example
|
|
83507
|
+
* ```jsx
|
|
83508
|
+
* function TextField(props) {
|
|
83509
|
+
* const tooltip = useTooltipContext('input1', element);
|
|
83510
|
+
* }
|
|
83511
|
+
* ```
|
|
83512
|
+
*
|
|
83513
|
+
* @param {string} id
|
|
83514
|
+
* @param {object} element
|
|
83515
|
+
*
|
|
83516
|
+
* @returns {string}
|
|
83535
83517
|
*/
|
|
83536
83518
|
function useTooltipContext(id, element) {
|
|
83537
83519
|
const {
|
|
@@ -83552,7 +83534,7 @@
|
|
|
83552
83534
|
return o(Tooltip, {
|
|
83553
83535
|
...props,
|
|
83554
83536
|
value: value,
|
|
83555
|
-
forId:
|
|
83537
|
+
forId: `bio-properties-panel-${forId}`
|
|
83556
83538
|
});
|
|
83557
83539
|
}
|
|
83558
83540
|
function Tooltip(props) {
|
|
@@ -83563,71 +83545,52 @@
|
|
|
83563
83545
|
direction = 'right',
|
|
83564
83546
|
position
|
|
83565
83547
|
} = props;
|
|
83566
|
-
const [visible,
|
|
83567
|
-
|
|
83548
|
+
const [visible, setVisible] = h(false);
|
|
83549
|
+
|
|
83550
|
+
// Tooltip will be shown after SHOW_DELAY ms from hovering over the source element.
|
|
83551
|
+
const SHOW_DELAY = 200;
|
|
83568
83552
|
let timeout = null;
|
|
83569
83553
|
const wrapperRef = _$1(null);
|
|
83570
83554
|
const tooltipRef = _$1(null);
|
|
83571
|
-
const
|
|
83572
|
-
|
|
83573
|
-
if (
|
|
83574
|
-
|
|
83575
|
-
|
|
83576
|
-
}
|
|
83577
|
-
|
|
83578
|
-
|
|
83579
|
-
}
|
|
83555
|
+
const show = (_, delay) => {
|
|
83556
|
+
if (visible) return;
|
|
83557
|
+
if (delay) {
|
|
83558
|
+
timeout = setTimeout(() => {
|
|
83559
|
+
setVisible(true);
|
|
83560
|
+
}, SHOW_DELAY);
|
|
83561
|
+
} else {
|
|
83562
|
+
setVisible(true);
|
|
83580
83563
|
}
|
|
83581
83564
|
};
|
|
83582
|
-
const
|
|
83583
|
-
|
|
83584
|
-
|
|
83585
|
-
};
|
|
83586
|
-
const hideTooltipViaEscape = e => {
|
|
83587
|
-
e.code === 'Escape' && hideTooltip();
|
|
83565
|
+
const hide = () => {
|
|
83566
|
+
clearTimeout(timeout);
|
|
83567
|
+
setVisible(false);
|
|
83588
83568
|
};
|
|
83589
|
-
const
|
|
83590
|
-
|
|
83591
|
-
y
|
|
83569
|
+
const handleMouseLeave = ({
|
|
83570
|
+
relatedTarget
|
|
83592
83571
|
}) => {
|
|
83593
|
-
|
|
83594
|
-
|
|
83595
|
-
|
|
83572
|
+
// Don't hide the tooltip when moving mouse between the wrapper and the tooltip.
|
|
83573
|
+
if (relatedTarget === wrapperRef.current || relatedTarget === tooltipRef.current || relatedTarget?.parentElement === tooltipRef.current) {
|
|
83574
|
+
return;
|
|
83575
|
+
}
|
|
83576
|
+
hide();
|
|
83596
83577
|
};
|
|
83597
|
-
|
|
83578
|
+
const handleFocusOut = e => {
|
|
83598
83579
|
const {
|
|
83599
|
-
|
|
83600
|
-
} =
|
|
83601
|
-
|
|
83580
|
+
target
|
|
83581
|
+
} = e;
|
|
83582
|
+
|
|
83583
|
+
// Don't hide the tooltip if the wrapper or the tooltip itself is clicked.
|
|
83584
|
+
const isHovered = target.matches(':hover') || tooltipRef.current?.matches(':hover');
|
|
83585
|
+
if (target === wrapperRef.current && isHovered) {
|
|
83586
|
+
e.stopPropagation();
|
|
83602
83587
|
return;
|
|
83603
83588
|
}
|
|
83604
|
-
|
|
83605
|
-
|
|
83606
|
-
|
|
83607
|
-
|
|
83608
|
-
|
|
83609
|
-
}) && !(isFocused && focusedViaKeyboard)) {
|
|
83610
|
-
hideTooltip();
|
|
83611
|
-
}
|
|
83612
|
-
};
|
|
83613
|
-
const hideFocusedTooltip = e => {
|
|
83614
|
-
const {
|
|
83615
|
-
relatedTarget
|
|
83616
|
-
} = e;
|
|
83617
|
-
const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
|
|
83618
|
-
if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
|
|
83619
|
-
hideTooltip();
|
|
83620
|
-
}
|
|
83621
|
-
};
|
|
83622
|
-
document.addEventListener('wheel', hideHoveredTooltip);
|
|
83623
|
-
document.addEventListener('focusout', hideFocusedTooltip);
|
|
83624
|
-
document.addEventListener('mousemove', hideHoveredTooltip);
|
|
83625
|
-
return () => {
|
|
83626
|
-
document.removeEventListener('wheel', hideHoveredTooltip);
|
|
83627
|
-
document.removeEventListener('mousemove', hideHoveredTooltip);
|
|
83628
|
-
document.removeEventListener('focusout', hideFocusedTooltip);
|
|
83629
|
-
};
|
|
83630
|
-
}, [wrapperRef.current, visible, focusedViaKeyboard]);
|
|
83589
|
+
hide();
|
|
83590
|
+
};
|
|
83591
|
+
const hideTooltipViaEscape = e => {
|
|
83592
|
+
e.code === 'Escape' && hide();
|
|
83593
|
+
};
|
|
83631
83594
|
const renderTooltip = () => {
|
|
83632
83595
|
return o("div", {
|
|
83633
83596
|
class: `bio-properties-panel-tooltip ${direction}`,
|
|
@@ -83637,6 +83600,7 @@
|
|
|
83637
83600
|
style: position || getTooltipPosition(wrapperRef.current),
|
|
83638
83601
|
ref: tooltipRef,
|
|
83639
83602
|
onClick: e => e.stopPropagation(),
|
|
83603
|
+
onMouseLeave: handleMouseLeave,
|
|
83640
83604
|
children: [o("div", {
|
|
83641
83605
|
class: "bio-properties-panel-tooltip-content",
|
|
83642
83606
|
children: value
|
|
@@ -83649,54 +83613,38 @@
|
|
|
83649
83613
|
class: "bio-properties-panel-tooltip-wrapper",
|
|
83650
83614
|
tabIndex: "0",
|
|
83651
83615
|
ref: wrapperRef,
|
|
83652
|
-
onMouseEnter:
|
|
83653
|
-
onMouseLeave:
|
|
83654
|
-
|
|
83655
|
-
|
|
83656
|
-
},
|
|
83657
|
-
onFocus: showTooltip,
|
|
83616
|
+
onMouseEnter: e => show(e, true),
|
|
83617
|
+
onMouseLeave: handleMouseLeave,
|
|
83618
|
+
onFocus: show,
|
|
83619
|
+
onBlur: handleFocusOut,
|
|
83658
83620
|
onKeyDown: hideTooltipViaEscape,
|
|
83659
83621
|
children: [props.children, visible ? parent ? z$1(renderTooltip(), parent.current) : renderTooltip() : null]
|
|
83660
83622
|
});
|
|
83661
83623
|
}
|
|
83662
83624
|
|
|
83663
83625
|
// helper
|
|
83664
|
-
|
|
83665
|
-
const {
|
|
83666
|
-
top,
|
|
83667
|
-
right,
|
|
83668
|
-
bottom,
|
|
83669
|
-
left
|
|
83670
|
-
} = bounds;
|
|
83671
|
-
return x >= left && x <= right && y >= top && y <= bottom;
|
|
83672
|
-
}
|
|
83626
|
+
|
|
83673
83627
|
function getTooltipPosition(refElement) {
|
|
83674
83628
|
const refPosition = refElement.getBoundingClientRect();
|
|
83675
83629
|
const right = `calc(100% - ${refPosition.x}px)`;
|
|
83676
83630
|
const top = `${refPosition.top - 10}px`;
|
|
83677
83631
|
return `right: ${right}; top: ${top};`;
|
|
83678
83632
|
}
|
|
83679
|
-
function isHovered(element) {
|
|
83680
|
-
return element.matches(':hover');
|
|
83681
|
-
}
|
|
83682
|
-
function prefixId$9(id) {
|
|
83683
|
-
return `bio-properties-panel-${id}`;
|
|
83684
|
-
}
|
|
83685
83633
|
|
|
83686
|
-
/**
|
|
83687
|
-
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
83688
|
-
*
|
|
83689
|
-
* @example
|
|
83690
|
-
* ```jsx
|
|
83691
|
-
* function TextField(props) {
|
|
83692
|
-
* const description = useDescriptionContext('input1', element);
|
|
83693
|
-
* }
|
|
83694
|
-
* ```
|
|
83695
|
-
*
|
|
83696
|
-
* @param {string} id
|
|
83697
|
-
* @param {object} element
|
|
83698
|
-
*
|
|
83699
|
-
* @returns {string}
|
|
83634
|
+
/**
|
|
83635
|
+
* Accesses the global DescriptionContext and returns a description for a given id and element.
|
|
83636
|
+
*
|
|
83637
|
+
* @example
|
|
83638
|
+
* ```jsx
|
|
83639
|
+
* function TextField(props) {
|
|
83640
|
+
* const description = useDescriptionContext('input1', element);
|
|
83641
|
+
* }
|
|
83642
|
+
* ```
|
|
83643
|
+
*
|
|
83644
|
+
* @param {string} id
|
|
83645
|
+
* @param {object} element
|
|
83646
|
+
*
|
|
83647
|
+
* @returns {string}
|
|
83700
83648
|
*/
|
|
83701
83649
|
function useDescriptionContext(id, element) {
|
|
83702
83650
|
const {
|
|
@@ -83717,11 +83665,11 @@
|
|
|
83717
83665
|
return errors;
|
|
83718
83666
|
}
|
|
83719
83667
|
|
|
83720
|
-
/**
|
|
83721
|
-
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
83722
|
-
*
|
|
83723
|
-
* @param {string} event
|
|
83724
|
-
* @param {Function} callback
|
|
83668
|
+
/**
|
|
83669
|
+
* Subscribe to an event immediately. Update subscription after inputs changed.
|
|
83670
|
+
*
|
|
83671
|
+
* @param {string} event
|
|
83672
|
+
* @param {Function} callback
|
|
83725
83673
|
*/
|
|
83726
83674
|
function useEvent(event, callback, eventBus) {
|
|
83727
83675
|
const eventContext = q$1(EventContext);
|
|
@@ -83751,20 +83699,20 @@
|
|
|
83751
83699
|
}, [callback, event, eventBus]);
|
|
83752
83700
|
}
|
|
83753
83701
|
|
|
83754
|
-
/**
|
|
83755
|
-
* Creates a state that persists in the global LayoutContext.
|
|
83756
|
-
*
|
|
83757
|
-
* @example
|
|
83758
|
-
* ```jsx
|
|
83759
|
-
* function Group(props) {
|
|
83760
|
-
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
83761
|
-
* }
|
|
83762
|
-
* ```
|
|
83763
|
-
*
|
|
83764
|
-
* @param {(string|number)[]} path
|
|
83765
|
-
* @param {any} [defaultValue]
|
|
83766
|
-
*
|
|
83767
|
-
* @returns {[ any, Function ]}
|
|
83702
|
+
/**
|
|
83703
|
+
* Creates a state that persists in the global LayoutContext.
|
|
83704
|
+
*
|
|
83705
|
+
* @example
|
|
83706
|
+
* ```jsx
|
|
83707
|
+
* function Group(props) {
|
|
83708
|
+
* const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
|
|
83709
|
+
* }
|
|
83710
|
+
* ```
|
|
83711
|
+
*
|
|
83712
|
+
* @param {(string|number)[]} path
|
|
83713
|
+
* @param {any} [defaultValue]
|
|
83714
|
+
*
|
|
83715
|
+
* @returns {[ any, Function ]}
|
|
83768
83716
|
*/
|
|
83769
83717
|
function useLayoutState(path, defaultValue) {
|
|
83770
83718
|
const {
|
|
@@ -83778,11 +83726,11 @@
|
|
|
83778
83726
|
return [layoutForKey, setState];
|
|
83779
83727
|
}
|
|
83780
83728
|
|
|
83781
|
-
/**
|
|
83782
|
-
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
83783
|
-
* state on updates.
|
|
83784
|
-
*
|
|
83785
|
-
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
83729
|
+
/**
|
|
83730
|
+
* @pinussilvestrus: we need to introduce our own hook to persist the previous
|
|
83731
|
+
* state on updates.
|
|
83732
|
+
*
|
|
83733
|
+
* cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
|
83786
83734
|
*/
|
|
83787
83735
|
|
|
83788
83736
|
function usePrevious(value) {
|
|
@@ -83793,12 +83741,12 @@
|
|
|
83793
83741
|
return ref.current;
|
|
83794
83742
|
}
|
|
83795
83743
|
|
|
83796
|
-
/**
|
|
83797
|
-
* Subscribe to `propertiesPanel.showEntry`.
|
|
83798
|
-
*
|
|
83799
|
-
* @param {string} id
|
|
83800
|
-
*
|
|
83801
|
-
* @returns {import('preact').Ref}
|
|
83744
|
+
/**
|
|
83745
|
+
* Subscribe to `propertiesPanel.showEntry`.
|
|
83746
|
+
*
|
|
83747
|
+
* @param {string} id
|
|
83748
|
+
*
|
|
83749
|
+
* @returns {import('preact').Ref}
|
|
83802
83750
|
*/
|
|
83803
83751
|
function useShowEntryEvent(id) {
|
|
83804
83752
|
const {
|
|
@@ -83829,20 +83777,20 @@
|
|
|
83829
83777
|
return ref;
|
|
83830
83778
|
}
|
|
83831
83779
|
|
|
83832
|
-
/**
|
|
83833
|
-
* @callback setSticky
|
|
83834
|
-
* @param {boolean} value
|
|
83780
|
+
/**
|
|
83781
|
+
* @callback setSticky
|
|
83782
|
+
* @param {boolean} value
|
|
83835
83783
|
*/
|
|
83836
83784
|
|
|
83837
|
-
/**
|
|
83838
|
-
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
83839
|
-
* If sticky is observered setSticky(true) will be called.
|
|
83840
|
-
* If sticky mode is left, setSticky(false) will be called.
|
|
83841
|
-
*
|
|
83842
|
-
*
|
|
83843
|
-
* @param {Object} ref
|
|
83844
|
-
* @param {string} scrollContainerSelector
|
|
83845
|
-
* @param {setSticky} setSticky
|
|
83785
|
+
/**
|
|
83786
|
+
* Use IntersectionObserver to identify when DOM element is in sticky mode.
|
|
83787
|
+
* If sticky is observered setSticky(true) will be called.
|
|
83788
|
+
* If sticky mode is left, setSticky(false) will be called.
|
|
83789
|
+
*
|
|
83790
|
+
*
|
|
83791
|
+
* @param {Object} ref
|
|
83792
|
+
* @param {string} scrollContainerSelector
|
|
83793
|
+
* @param {setSticky} setSticky
|
|
83846
83794
|
*/
|
|
83847
83795
|
function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
|
|
83848
83796
|
const [scrollContainer, setScrollContainer] = h(query(scrollContainerSelector));
|
|
@@ -83896,19 +83844,19 @@
|
|
|
83896
83844
|
}, [ref.current, scrollContainer, setSticky]);
|
|
83897
83845
|
}
|
|
83898
83846
|
|
|
83899
|
-
/**
|
|
83900
|
-
* Creates a static function reference with changing body.
|
|
83901
|
-
* This is necessary when external libraries require a callback function
|
|
83902
|
-
* that has references to state variables.
|
|
83903
|
-
*
|
|
83904
|
-
* Usage:
|
|
83905
|
-
* const callback = useStaticCallback((val) => {val === currentState});
|
|
83906
|
-
*
|
|
83907
|
-
* The `callback` reference is static and can be safely used in external
|
|
83908
|
-
* libraries or as a prop that does not cause rerendering of children.
|
|
83909
|
-
*
|
|
83910
|
-
* @param {Function} callback function with changing reference
|
|
83911
|
-
* @returns {Function} static function reference
|
|
83847
|
+
/**
|
|
83848
|
+
* Creates a static function reference with changing body.
|
|
83849
|
+
* This is necessary when external libraries require a callback function
|
|
83850
|
+
* that has references to state variables.
|
|
83851
|
+
*
|
|
83852
|
+
* Usage:
|
|
83853
|
+
* const callback = useStaticCallback((val) => {val === currentState});
|
|
83854
|
+
*
|
|
83855
|
+
* The `callback` reference is static and can be safely used in external
|
|
83856
|
+
* libraries or as a prop that does not cause rerendering of children.
|
|
83857
|
+
*
|
|
83858
|
+
* @param {Function} callback function with changing reference
|
|
83859
|
+
* @returns {Function} static function reference
|
|
83912
83860
|
*/
|
|
83913
83861
|
function useStaticCallback(callback) {
|
|
83914
83862
|
const callbackRef = _$1(callback);
|
|
@@ -84049,13 +83997,13 @@
|
|
|
84049
83997
|
return null;
|
|
84050
83998
|
}
|
|
84051
83999
|
|
|
84052
|
-
/**
|
|
84053
|
-
* @typedef { {
|
|
84054
|
-
* text: (element: object) => string,
|
|
84055
|
-
* icon?: (element: Object) => import('preact').Component
|
|
84056
|
-
* } } PlaceholderDefinition
|
|
84057
|
-
*
|
|
84058
|
-
* @param { PlaceholderDefinition } props
|
|
84000
|
+
/**
|
|
84001
|
+
* @typedef { {
|
|
84002
|
+
* text: (element: object) => string,
|
|
84003
|
+
* icon?: (element: Object) => import('preact').Component
|
|
84004
|
+
* } } PlaceholderDefinition
|
|
84005
|
+
*
|
|
84006
|
+
* @param { PlaceholderDefinition } props
|
|
84059
84007
|
*/
|
|
84060
84008
|
function Placeholder(props) {
|
|
84061
84009
|
const {
|
|
@@ -84092,9 +84040,9 @@
|
|
|
84092
84040
|
}
|
|
84093
84041
|
const noop$6 = () => {};
|
|
84094
84042
|
|
|
84095
|
-
/**
|
|
84096
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
84097
|
-
* Set Focus inside when the editor is ready.
|
|
84043
|
+
/**
|
|
84044
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
84045
|
+
* Set Focus inside when the editor is ready.
|
|
84098
84046
|
*/
|
|
84099
84047
|
const useBufferedFocus$1 = function (editor, ref) {
|
|
84100
84048
|
const [buffer, setBuffer] = h(undefined);
|
|
@@ -84194,9 +84142,9 @@
|
|
|
84194
84142
|
});
|
|
84195
84143
|
const noop$5 = () => {};
|
|
84196
84144
|
|
|
84197
|
-
/**
|
|
84198
|
-
* Buffer `.focus()` calls while the editor is not initialized.
|
|
84199
|
-
* Set Focus inside when the editor is ready.
|
|
84145
|
+
/**
|
|
84146
|
+
* Buffer `.focus()` calls while the editor is not initialized.
|
|
84147
|
+
* Set Focus inside when the editor is ready.
|
|
84200
84148
|
*/
|
|
84201
84149
|
const useBufferedFocus = function (editor, ref) {
|
|
84202
84150
|
const [buffer, setBuffer] = h(undefined);
|
|
@@ -84245,10 +84193,10 @@
|
|
|
84245
84193
|
p(() => {
|
|
84246
84194
|
let editor;
|
|
84247
84195
|
|
|
84248
|
-
/* Trigger FEEL toggle when
|
|
84249
|
-
*
|
|
84250
|
-
* - `backspace` is pressed
|
|
84251
|
-
* - AND the cursor is at the beginning of the input
|
|
84196
|
+
/* Trigger FEEL toggle when
|
|
84197
|
+
*
|
|
84198
|
+
* - `backspace` is pressed
|
|
84199
|
+
* - AND the cursor is at the beginning of the input
|
|
84252
84200
|
*/
|
|
84253
84201
|
const onKeyDown = e => {
|
|
84254
84202
|
if (e.key !== 'Backspace' || !editor) {
|
|
@@ -84337,10 +84285,10 @@
|
|
|
84337
84285
|
}
|
|
84338
84286
|
const noop$4 = () => {};
|
|
84339
84287
|
|
|
84340
|
-
/**
|
|
84341
|
-
* @param {Object} props
|
|
84342
|
-
* @param {Object} props.label
|
|
84343
|
-
* @param {String} props.feel
|
|
84288
|
+
/**
|
|
84289
|
+
* @param {Object} props
|
|
84290
|
+
* @param {Object} props.label
|
|
84291
|
+
* @param {String} props.feel
|
|
84344
84292
|
*/
|
|
84345
84293
|
function FeelIcon(props) {
|
|
84346
84294
|
const {
|
|
@@ -84374,22 +84322,22 @@
|
|
|
84374
84322
|
source: null
|
|
84375
84323
|
});
|
|
84376
84324
|
|
|
84377
|
-
/**
|
|
84378
|
-
* Add a dragger that calls back the passed function with
|
|
84379
|
-
* { event, delta } on drag.
|
|
84380
|
-
*
|
|
84381
|
-
* @example
|
|
84382
|
-
*
|
|
84383
|
-
* function dragMove(event, delta) {
|
|
84384
|
-
* // we are dragging (!!)
|
|
84385
|
-
* }
|
|
84386
|
-
*
|
|
84387
|
-
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
84388
|
-
*
|
|
84389
|
-
* @param {Function} fn
|
|
84390
|
-
* @param {Element} [dragPreview]
|
|
84391
|
-
*
|
|
84392
|
-
* @return {Function} drag start callback function
|
|
84325
|
+
/**
|
|
84326
|
+
* Add a dragger that calls back the passed function with
|
|
84327
|
+
* { event, delta } on drag.
|
|
84328
|
+
*
|
|
84329
|
+
* @example
|
|
84330
|
+
*
|
|
84331
|
+
* function dragMove(event, delta) {
|
|
84332
|
+
* // we are dragging (!!)
|
|
84333
|
+
* }
|
|
84334
|
+
*
|
|
84335
|
+
* domElement.addEventListener('dragstart', dragger(dragMove));
|
|
84336
|
+
*
|
|
84337
|
+
* @param {Function} fn
|
|
84338
|
+
* @param {Element} [dragPreview]
|
|
84339
|
+
*
|
|
84340
|
+
* @return {Function} drag start callback function
|
|
84393
84341
|
*/
|
|
84394
84342
|
function createDragger(fn, dragPreview) {
|
|
84395
84343
|
let self;
|
|
@@ -84443,23 +84391,23 @@
|
|
|
84443
84391
|
}
|
|
84444
84392
|
const noop$3 = () => {};
|
|
84445
84393
|
|
|
84446
|
-
/**
|
|
84447
|
-
* A generic popup component.
|
|
84448
|
-
*
|
|
84449
|
-
* @param {Object} props
|
|
84450
|
-
* @param {HTMLElement} [props.container]
|
|
84451
|
-
* @param {string} [props.className]
|
|
84452
|
-
* @param {boolean} [props.delayInitialFocus]
|
|
84453
|
-
* @param {{x: number, y: number}} [props.position]
|
|
84454
|
-
* @param {number} [props.width]
|
|
84455
|
-
* @param {number} [props.height]
|
|
84456
|
-
* @param {Function} props.onClose
|
|
84457
|
-
* @param {Function} [props.onPostActivate]
|
|
84458
|
-
* @param {Function} [props.onPostDeactivate]
|
|
84459
|
-
* @param {boolean} [props.returnFocus]
|
|
84460
|
-
* @param {boolean} [props.closeOnEscape]
|
|
84461
|
-
* @param {string} props.title
|
|
84462
|
-
* @param {Ref} [ref]
|
|
84394
|
+
/**
|
|
84395
|
+
* A generic popup component.
|
|
84396
|
+
*
|
|
84397
|
+
* @param {Object} props
|
|
84398
|
+
* @param {HTMLElement} [props.container]
|
|
84399
|
+
* @param {string} [props.className]
|
|
84400
|
+
* @param {boolean} [props.delayInitialFocus]
|
|
84401
|
+
* @param {{x: number, y: number}} [props.position]
|
|
84402
|
+
* @param {number} [props.width]
|
|
84403
|
+
* @param {number} [props.height]
|
|
84404
|
+
* @param {Function} props.onClose
|
|
84405
|
+
* @param {Function} [props.onPostActivate]
|
|
84406
|
+
* @param {Function} [props.onPostDeactivate]
|
|
84407
|
+
* @param {boolean} [props.returnFocus]
|
|
84408
|
+
* @param {boolean} [props.closeOnEscape]
|
|
84409
|
+
* @param {string} props.title
|
|
84410
|
+
* @param {Ref} [ref]
|
|
84463
84411
|
*/
|
|
84464
84412
|
function PopupComponent(props, globalRef) {
|
|
84465
84413
|
const {
|
|
@@ -84677,12 +84625,12 @@
|
|
|
84677
84625
|
const FEEL_POPUP_WIDTH = 700;
|
|
84678
84626
|
const FEEL_POPUP_HEIGHT = 250;
|
|
84679
84627
|
|
|
84680
|
-
/**
|
|
84681
|
-
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
84682
|
-
* - `feelPopup.open` - fired before the popup is mounted
|
|
84683
|
-
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
84684
|
-
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
84685
|
-
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
84628
|
+
/**
|
|
84629
|
+
* FEEL popup component, built as a singleton. Emits lifecycle events as follows:
|
|
84630
|
+
* - `feelPopup.open` - fired before the popup is mounted
|
|
84631
|
+
* - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
|
|
84632
|
+
* - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
|
|
84633
|
+
* - `feelPopup.closed` - fired after the popup is unmounted
|
|
84686
84634
|
*/
|
|
84687
84635
|
function FEELPopupRoot(props) {
|
|
84688
84636
|
const {
|
|
@@ -84909,11 +84857,11 @@
|
|
|
84909
84857
|
return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
|
|
84910
84858
|
}
|
|
84911
84859
|
|
|
84912
|
-
/**
|
|
84913
|
-
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
84914
|
-
*
|
|
84915
|
-
* @param {Function} effect
|
|
84916
|
-
* @param {Array} deps
|
|
84860
|
+
/**
|
|
84861
|
+
* This hook behaves like useEffect, but does not trigger on the first render.
|
|
84862
|
+
*
|
|
84863
|
+
* @param {Function} effect
|
|
84864
|
+
* @param {Array} deps
|
|
84917
84865
|
*/
|
|
84918
84866
|
function useUpdateEffect(effect, deps) {
|
|
84919
84867
|
const isMounted = _$1(false);
|
|
@@ -84990,19 +84938,19 @@
|
|
|
84990
84938
|
});
|
|
84991
84939
|
}
|
|
84992
84940
|
|
|
84993
|
-
/**
|
|
84994
|
-
* @param {Object} props
|
|
84995
|
-
* @param {Object} props.element
|
|
84996
|
-
* @param {String} props.id
|
|
84997
|
-
* @param {String} props.description
|
|
84998
|
-
* @param {String} props.label
|
|
84999
|
-
* @param {String} props.switcherLabel
|
|
85000
|
-
* @param {Boolean} props.inline
|
|
85001
|
-
* @param {Function} props.getValue
|
|
85002
|
-
* @param {Function} props.setValue
|
|
85003
|
-
* @param {Function} props.onFocus
|
|
85004
|
-
* @param {Function} props.onBlur
|
|
85005
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
84941
|
+
/**
|
|
84942
|
+
* @param {Object} props
|
|
84943
|
+
* @param {Object} props.element
|
|
84944
|
+
* @param {String} props.id
|
|
84945
|
+
* @param {String} props.description
|
|
84946
|
+
* @param {String} props.label
|
|
84947
|
+
* @param {String} props.switcherLabel
|
|
84948
|
+
* @param {Boolean} props.inline
|
|
84949
|
+
* @param {Function} props.getValue
|
|
84950
|
+
* @param {Function} props.setValue
|
|
84951
|
+
* @param {Function} props.onFocus
|
|
84952
|
+
* @param {Function} props.onBlur
|
|
84953
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
85006
84954
|
*/
|
|
85007
84955
|
function ToggleSwitchEntry(props) {
|
|
85008
84956
|
const {
|
|
@@ -85109,22 +85057,22 @@
|
|
|
85109
85057
|
});
|
|
85110
85058
|
}
|
|
85111
85059
|
|
|
85112
|
-
/**
|
|
85113
|
-
* @param {Object} props
|
|
85114
|
-
* @param {Boolean} props.debounce
|
|
85115
|
-
* @param {String} props.description
|
|
85116
|
-
* @param {Boolean} props.disabled
|
|
85117
|
-
* @param {Object} props.element
|
|
85118
|
-
* @param {Function} props.getValue
|
|
85119
|
-
* @param {String} props.id
|
|
85120
|
-
* @param {String} props.label
|
|
85121
|
-
* @param {String} props.max
|
|
85122
|
-
* @param {String} props.min
|
|
85123
|
-
* @param {Function} props.setValue
|
|
85124
|
-
* @param {Function} props.onFocus
|
|
85125
|
-
* @param {Function} props.onBlur
|
|
85126
|
-
* @param {String} props.step
|
|
85127
|
-
* @param {Function} props.validate
|
|
85060
|
+
/**
|
|
85061
|
+
* @param {Object} props
|
|
85062
|
+
* @param {Boolean} props.debounce
|
|
85063
|
+
* @param {String} props.description
|
|
85064
|
+
* @param {Boolean} props.disabled
|
|
85065
|
+
* @param {Object} props.element
|
|
85066
|
+
* @param {Function} props.getValue
|
|
85067
|
+
* @param {String} props.id
|
|
85068
|
+
* @param {String} props.label
|
|
85069
|
+
* @param {String} props.max
|
|
85070
|
+
* @param {String} props.min
|
|
85071
|
+
* @param {Function} props.setValue
|
|
85072
|
+
* @param {Function} props.onFocus
|
|
85073
|
+
* @param {Function} props.onBlur
|
|
85074
|
+
* @param {String} props.step
|
|
85075
|
+
* @param {Function} props.validate
|
|
85128
85076
|
*/
|
|
85129
85077
|
function NumberFieldEntry(props) {
|
|
85130
85078
|
const {
|
|
@@ -85204,6 +85152,7 @@
|
|
|
85204
85152
|
label,
|
|
85205
85153
|
hostLanguage,
|
|
85206
85154
|
onInput,
|
|
85155
|
+
onBlur,
|
|
85207
85156
|
onError,
|
|
85208
85157
|
placeholder,
|
|
85209
85158
|
feel,
|
|
@@ -85269,6 +85218,12 @@
|
|
|
85269
85218
|
setFocus(-1);
|
|
85270
85219
|
}
|
|
85271
85220
|
};
|
|
85221
|
+
const handleOnBlur = e => {
|
|
85222
|
+
if (onBlur) {
|
|
85223
|
+
onBlur(e);
|
|
85224
|
+
}
|
|
85225
|
+
setLocalValue(e.target.value.trim());
|
|
85226
|
+
};
|
|
85272
85227
|
const handleLint = useStaticCallback((lint = []) => {
|
|
85273
85228
|
const syntaxError = lint.some(report => report.type === 'Syntax Error');
|
|
85274
85229
|
if (syntaxError) {
|
|
@@ -85390,6 +85345,7 @@
|
|
|
85390
85345
|
...props,
|
|
85391
85346
|
popupOpen: popuOpen,
|
|
85392
85347
|
onInput: handleLocalInput,
|
|
85348
|
+
onBlur: handleOnBlur,
|
|
85393
85349
|
contentAttributes: {
|
|
85394
85350
|
'id': prefixId$5(id),
|
|
85395
85351
|
'aria-label': label
|
|
@@ -85609,26 +85565,26 @@
|
|
|
85609
85565
|
});
|
|
85610
85566
|
});
|
|
85611
85567
|
|
|
85612
|
-
/**
|
|
85613
|
-
* @param {Object} props
|
|
85614
|
-
* @param {Object} props.element
|
|
85615
|
-
* @param {String} props.id
|
|
85616
|
-
* @param {String} props.description
|
|
85617
|
-
* @param {Boolean} props.debounce
|
|
85618
|
-
* @param {Boolean} props.disabled
|
|
85619
|
-
* @param {Boolean} props.feel
|
|
85620
|
-
* @param {String} props.label
|
|
85621
|
-
* @param {Function} props.getValue
|
|
85622
|
-
* @param {Function} props.setValue
|
|
85623
|
-
* @param {Function} props.tooltipContainer
|
|
85624
|
-
* @param {Function} props.validate
|
|
85625
|
-
* @param {Function} props.show
|
|
85626
|
-
* @param {Function} props.example
|
|
85627
|
-
* @param {Function} props.variables
|
|
85628
|
-
* @param {Function} props.onFocus
|
|
85629
|
-
* @param {Function} props.onBlur
|
|
85630
|
-
* @param {string} [props.placeholder]
|
|
85631
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
85568
|
+
/**
|
|
85569
|
+
* @param {Object} props
|
|
85570
|
+
* @param {Object} props.element
|
|
85571
|
+
* @param {String} props.id
|
|
85572
|
+
* @param {String} props.description
|
|
85573
|
+
* @param {Boolean} props.debounce
|
|
85574
|
+
* @param {Boolean} props.disabled
|
|
85575
|
+
* @param {Boolean} props.feel
|
|
85576
|
+
* @param {String} props.label
|
|
85577
|
+
* @param {Function} props.getValue
|
|
85578
|
+
* @param {Function} props.setValue
|
|
85579
|
+
* @param {Function} props.tooltipContainer
|
|
85580
|
+
* @param {Function} props.validate
|
|
85581
|
+
* @param {Function} props.show
|
|
85582
|
+
* @param {Function} props.example
|
|
85583
|
+
* @param {Function} props.variables
|
|
85584
|
+
* @param {Function} props.onFocus
|
|
85585
|
+
* @param {Function} props.onBlur
|
|
85586
|
+
* @param {string} [props.placeholder]
|
|
85587
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
85632
85588
|
*/
|
|
85633
85589
|
function FeelEntry(props) {
|
|
85634
85590
|
const {
|
|
@@ -85715,27 +85671,27 @@
|
|
|
85715
85671
|
});
|
|
85716
85672
|
}
|
|
85717
85673
|
|
|
85718
|
-
/**
|
|
85719
|
-
* @param {Object} props
|
|
85720
|
-
* @param {Object} props.element
|
|
85721
|
-
* @param {String} props.id
|
|
85722
|
-
* @param {String} props.description
|
|
85723
|
-
* @param {Boolean} props.debounce
|
|
85724
|
-
* @param {Boolean} props.disabled
|
|
85725
|
-
* @param {String} props.max
|
|
85726
|
-
* @param {String} props.min
|
|
85727
|
-
* @param {String} props.step
|
|
85728
|
-
* @param {Boolean} props.feel
|
|
85729
|
-
* @param {String} props.label
|
|
85730
|
-
* @param {Function} props.getValue
|
|
85731
|
-
* @param {Function} props.setValue
|
|
85732
|
-
* @param {Function} props.tooltipContainer
|
|
85733
|
-
* @param {Function} props.validate
|
|
85734
|
-
* @param {Function} props.show
|
|
85735
|
-
* @param {Function} props.example
|
|
85736
|
-
* @param {Function} props.variables
|
|
85737
|
-
* @param {Function} props.onFocus
|
|
85738
|
-
* @param {Function} props.onBlur
|
|
85674
|
+
/**
|
|
85675
|
+
* @param {Object} props
|
|
85676
|
+
* @param {Object} props.element
|
|
85677
|
+
* @param {String} props.id
|
|
85678
|
+
* @param {String} props.description
|
|
85679
|
+
* @param {Boolean} props.debounce
|
|
85680
|
+
* @param {Boolean} props.disabled
|
|
85681
|
+
* @param {String} props.max
|
|
85682
|
+
* @param {String} props.min
|
|
85683
|
+
* @param {String} props.step
|
|
85684
|
+
* @param {Boolean} props.feel
|
|
85685
|
+
* @param {String} props.label
|
|
85686
|
+
* @param {Function} props.getValue
|
|
85687
|
+
* @param {Function} props.setValue
|
|
85688
|
+
* @param {Function} props.tooltipContainer
|
|
85689
|
+
* @param {Function} props.validate
|
|
85690
|
+
* @param {Function} props.show
|
|
85691
|
+
* @param {Function} props.example
|
|
85692
|
+
* @param {Function} props.variables
|
|
85693
|
+
* @param {Function} props.onFocus
|
|
85694
|
+
* @param {Function} props.onBlur
|
|
85739
85695
|
*/
|
|
85740
85696
|
function FeelNumberEntry(props) {
|
|
85741
85697
|
return o(FeelEntry, {
|
|
@@ -85745,24 +85701,24 @@
|
|
|
85745
85701
|
});
|
|
85746
85702
|
}
|
|
85747
85703
|
|
|
85748
|
-
/**
|
|
85749
|
-
* @param {Object} props
|
|
85750
|
-
* @param {Object} props.element
|
|
85751
|
-
* @param {String} props.id
|
|
85752
|
-
* @param {String} props.description
|
|
85753
|
-
* @param {Boolean} props.debounce
|
|
85754
|
-
* @param {Boolean} props.disabled
|
|
85755
|
-
* @param {Boolean} props.feel
|
|
85756
|
-
* @param {String} props.label
|
|
85757
|
-
* @param {Function} props.getValue
|
|
85758
|
-
* @param {Function} props.setValue
|
|
85759
|
-
* @param {Function} props.tooltipContainer
|
|
85760
|
-
* @param {Function} props.validate
|
|
85761
|
-
* @param {Function} props.show
|
|
85762
|
-
* @param {Function} props.example
|
|
85763
|
-
* @param {Function} props.variables
|
|
85764
|
-
* @param {Function} props.onFocus
|
|
85765
|
-
* @param {Function} props.onBlur
|
|
85704
|
+
/**
|
|
85705
|
+
* @param {Object} props
|
|
85706
|
+
* @param {Object} props.element
|
|
85707
|
+
* @param {String} props.id
|
|
85708
|
+
* @param {String} props.description
|
|
85709
|
+
* @param {Boolean} props.debounce
|
|
85710
|
+
* @param {Boolean} props.disabled
|
|
85711
|
+
* @param {Boolean} props.feel
|
|
85712
|
+
* @param {String} props.label
|
|
85713
|
+
* @param {Function} props.getValue
|
|
85714
|
+
* @param {Function} props.setValue
|
|
85715
|
+
* @param {Function} props.tooltipContainer
|
|
85716
|
+
* @param {Function} props.validate
|
|
85717
|
+
* @param {Function} props.show
|
|
85718
|
+
* @param {Function} props.example
|
|
85719
|
+
* @param {Function} props.variables
|
|
85720
|
+
* @param {Function} props.onFocus
|
|
85721
|
+
* @param {Function} props.onBlur
|
|
85766
85722
|
*/
|
|
85767
85723
|
function FeelToggleSwitchEntry(props) {
|
|
85768
85724
|
return o(FeelEntry, {
|
|
@@ -85772,26 +85728,26 @@
|
|
|
85772
85728
|
});
|
|
85773
85729
|
}
|
|
85774
85730
|
|
|
85775
|
-
/**
|
|
85776
|
-
* @param {Object} props
|
|
85777
|
-
* @param {Object} props.element
|
|
85778
|
-
* @param {String} props.id
|
|
85779
|
-
* @param {String} props.description
|
|
85780
|
-
* @param {String} props.hostLanguage
|
|
85781
|
-
* @param {Boolean} props.singleLine
|
|
85782
|
-
* @param {Boolean} props.debounce
|
|
85783
|
-
* @param {Boolean} props.disabled
|
|
85784
|
-
* @param {Boolean} props.feel
|
|
85785
|
-
* @param {String} props.label
|
|
85786
|
-
* @param {Function} props.getValue
|
|
85787
|
-
* @param {Function} props.setValue
|
|
85788
|
-
* @param {Function} props.tooltipContainer
|
|
85789
|
-
* @param {Function} props.validate
|
|
85790
|
-
* @param {Function} props.show
|
|
85791
|
-
* @param {Function} props.example
|
|
85792
|
-
* @param {Function} props.variables
|
|
85793
|
-
* @param {Function} props.onFocus
|
|
85794
|
-
* @param {Function} props.onBlur
|
|
85731
|
+
/**
|
|
85732
|
+
* @param {Object} props
|
|
85733
|
+
* @param {Object} props.element
|
|
85734
|
+
* @param {String} props.id
|
|
85735
|
+
* @param {String} props.description
|
|
85736
|
+
* @param {String} props.hostLanguage
|
|
85737
|
+
* @param {Boolean} props.singleLine
|
|
85738
|
+
* @param {Boolean} props.debounce
|
|
85739
|
+
* @param {Boolean} props.disabled
|
|
85740
|
+
* @param {Boolean} props.feel
|
|
85741
|
+
* @param {String} props.label
|
|
85742
|
+
* @param {Function} props.getValue
|
|
85743
|
+
* @param {Function} props.setValue
|
|
85744
|
+
* @param {Function} props.tooltipContainer
|
|
85745
|
+
* @param {Function} props.validate
|
|
85746
|
+
* @param {Function} props.show
|
|
85747
|
+
* @param {Function} props.example
|
|
85748
|
+
* @param {Function} props.variables
|
|
85749
|
+
* @param {Function} props.onFocus
|
|
85750
|
+
* @param {Function} props.onBlur
|
|
85795
85751
|
*/
|
|
85796
85752
|
function FeelTemplatingEntry(props) {
|
|
85797
85753
|
return o(FeelEntry, {
|
|
@@ -85859,85 +85815,85 @@
|
|
|
85859
85815
|
const DEFAULT_DESCRIPTION = {};
|
|
85860
85816
|
const DEFAULT_TOOLTIP = {};
|
|
85861
85817
|
|
|
85862
|
-
/**
|
|
85863
|
-
* @typedef { {
|
|
85864
|
-
* component: import('preact').Component,
|
|
85865
|
-
* id: String,
|
|
85866
|
-
* isEdited?: Function
|
|
85867
|
-
* } } EntryDefinition
|
|
85868
|
-
*
|
|
85869
|
-
* @typedef { {
|
|
85870
|
-
* autoFocusEntry: String,
|
|
85871
|
-
* autoOpen?: Boolean,
|
|
85872
|
-
* entries: Array<EntryDefinition>,
|
|
85873
|
-
* id: String,
|
|
85874
|
-
* label: String,
|
|
85875
|
-
* remove: (event: MouseEvent) => void
|
|
85876
|
-
* } } ListItemDefinition
|
|
85877
|
-
*
|
|
85878
|
-
* @typedef { {
|
|
85879
|
-
* add: (event: MouseEvent) => void,
|
|
85880
|
-
* component: import('preact').Component,
|
|
85881
|
-
* element: Object,
|
|
85882
|
-
* id: String,
|
|
85883
|
-
* items: Array<ListItemDefinition>,
|
|
85884
|
-
* label: String,
|
|
85885
|
-
* shouldOpen?: Boolean
|
|
85886
|
-
* } } ListGroupDefinition
|
|
85887
|
-
*
|
|
85888
|
-
* @typedef { {
|
|
85889
|
-
* component?: import('preact').Component,
|
|
85890
|
-
* entries: Array<EntryDefinition>,
|
|
85891
|
-
* id: String,
|
|
85892
|
-
* label: String,
|
|
85893
|
-
* shouldOpen?: Boolean
|
|
85894
|
-
* } } GroupDefinition
|
|
85895
|
-
*
|
|
85896
|
-
* @typedef { {
|
|
85897
|
-
* [id: String]: GetDescriptionFunction
|
|
85898
|
-
* } } DescriptionConfig
|
|
85899
|
-
*
|
|
85900
|
-
* @typedef { {
|
|
85901
|
-
* [id: String]: GetTooltipFunction
|
|
85902
|
-
* } } TooltipConfig
|
|
85903
|
-
*
|
|
85904
|
-
* @callback { {
|
|
85905
|
-
* @param {string} id
|
|
85906
|
-
* @param {Object} element
|
|
85907
|
-
* @returns {string}
|
|
85908
|
-
* } } GetDescriptionFunction
|
|
85909
|
-
*
|
|
85910
|
-
* @callback { {
|
|
85911
|
-
* @param {string} id
|
|
85912
|
-
* @param {Object} element
|
|
85913
|
-
* @returns {string}
|
|
85914
|
-
* } } GetTooltipFunction
|
|
85915
|
-
*
|
|
85916
|
-
* @typedef { {
|
|
85917
|
-
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
85918
|
-
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
85919
|
-
* } } PlaceholderProvider
|
|
85920
|
-
*
|
|
85818
|
+
/**
|
|
85819
|
+
* @typedef { {
|
|
85820
|
+
* component: import('preact').Component,
|
|
85821
|
+
* id: String,
|
|
85822
|
+
* isEdited?: Function
|
|
85823
|
+
* } } EntryDefinition
|
|
85824
|
+
*
|
|
85825
|
+
* @typedef { {
|
|
85826
|
+
* autoFocusEntry: String,
|
|
85827
|
+
* autoOpen?: Boolean,
|
|
85828
|
+
* entries: Array<EntryDefinition>,
|
|
85829
|
+
* id: String,
|
|
85830
|
+
* label: String,
|
|
85831
|
+
* remove: (event: MouseEvent) => void
|
|
85832
|
+
* } } ListItemDefinition
|
|
85833
|
+
*
|
|
85834
|
+
* @typedef { {
|
|
85835
|
+
* add: (event: MouseEvent) => void,
|
|
85836
|
+
* component: import('preact').Component,
|
|
85837
|
+
* element: Object,
|
|
85838
|
+
* id: String,
|
|
85839
|
+
* items: Array<ListItemDefinition>,
|
|
85840
|
+
* label: String,
|
|
85841
|
+
* shouldOpen?: Boolean
|
|
85842
|
+
* } } ListGroupDefinition
|
|
85843
|
+
*
|
|
85844
|
+
* @typedef { {
|
|
85845
|
+
* component?: import('preact').Component,
|
|
85846
|
+
* entries: Array<EntryDefinition>,
|
|
85847
|
+
* id: String,
|
|
85848
|
+
* label: String,
|
|
85849
|
+
* shouldOpen?: Boolean
|
|
85850
|
+
* } } GroupDefinition
|
|
85851
|
+
*
|
|
85852
|
+
* @typedef { {
|
|
85853
|
+
* [id: String]: GetDescriptionFunction
|
|
85854
|
+
* } } DescriptionConfig
|
|
85855
|
+
*
|
|
85856
|
+
* @typedef { {
|
|
85857
|
+
* [id: String]: GetTooltipFunction
|
|
85858
|
+
* } } TooltipConfig
|
|
85859
|
+
*
|
|
85860
|
+
* @callback { {
|
|
85861
|
+
* @param {string} id
|
|
85862
|
+
* @param {Object} element
|
|
85863
|
+
* @returns {string}
|
|
85864
|
+
* } } GetDescriptionFunction
|
|
85865
|
+
*
|
|
85866
|
+
* @callback { {
|
|
85867
|
+
* @param {string} id
|
|
85868
|
+
* @param {Object} element
|
|
85869
|
+
* @returns {string}
|
|
85870
|
+
* } } GetTooltipFunction
|
|
85871
|
+
*
|
|
85872
|
+
* @typedef { {
|
|
85873
|
+
* getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
|
|
85874
|
+
* getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
|
|
85875
|
+
* } } PlaceholderProvider
|
|
85876
|
+
*
|
|
85921
85877
|
*/
|
|
85922
85878
|
|
|
85923
|
-
/**
|
|
85924
|
-
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
85925
|
-
* data from implementor to describe *what* will be rendered.
|
|
85926
|
-
*
|
|
85927
|
-
* @param {Object} props
|
|
85928
|
-
* @param {Object|Array} props.element
|
|
85929
|
-
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
85930
|
-
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
85931
|
-
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
85932
|
-
* @param {Object} [props.layoutConfig]
|
|
85933
|
-
* @param {Function} [props.layoutChanged]
|
|
85934
|
-
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
85935
|
-
* @param {Function} [props.descriptionLoaded]
|
|
85936
|
-
* @param {TooltipConfig} [props.tooltipConfig]
|
|
85937
|
-
* @param {Function} [props.tooltipLoaded]
|
|
85938
|
-
* @param {HTMLElement} [props.feelPopupContainer]
|
|
85939
|
-
* @param {Function} [props.getFeelPopupLinks]
|
|
85940
|
-
* @param {Object} [props.eventBus]
|
|
85879
|
+
/**
|
|
85880
|
+
* A basic properties panel component. Describes *how* content will be rendered, accepts
|
|
85881
|
+
* data from implementor to describe *what* will be rendered.
|
|
85882
|
+
*
|
|
85883
|
+
* @param {Object} props
|
|
85884
|
+
* @param {Object|Array} props.element
|
|
85885
|
+
* @param {import('./components/Header').HeaderProvider} props.headerProvider
|
|
85886
|
+
* @param {PlaceholderProvider} [props.placeholderProvider]
|
|
85887
|
+
* @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
|
|
85888
|
+
* @param {Object} [props.layoutConfig]
|
|
85889
|
+
* @param {Function} [props.layoutChanged]
|
|
85890
|
+
* @param {DescriptionConfig} [props.descriptionConfig]
|
|
85891
|
+
* @param {Function} [props.descriptionLoaded]
|
|
85892
|
+
* @param {TooltipConfig} [props.tooltipConfig]
|
|
85893
|
+
* @param {Function} [props.tooltipLoaded]
|
|
85894
|
+
* @param {HTMLElement} [props.feelPopupContainer]
|
|
85895
|
+
* @param {Function} [props.getFeelPopupLinks]
|
|
85896
|
+
* @param {Object} [props.eventBus]
|
|
85941
85897
|
*/
|
|
85942
85898
|
function PropertiesPanel$1(props) {
|
|
85943
85899
|
const {
|
|
@@ -86110,11 +86066,11 @@
|
|
|
86110
86066
|
|
|
86111
86067
|
// hooks //////////////////
|
|
86112
86068
|
|
|
86113
|
-
/**
|
|
86114
|
-
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
86115
|
-
*
|
|
86116
|
-
* @param {Function} effect
|
|
86117
|
-
* @param {Array} deps
|
|
86069
|
+
/**
|
|
86070
|
+
* This hook behaves like useLayoutEffect, but does not trigger on the first render.
|
|
86071
|
+
*
|
|
86072
|
+
* @param {Function} effect
|
|
86073
|
+
* @param {Array} deps
|
|
86118
86074
|
*/
|
|
86119
86075
|
function useUpdateLayoutEffect(effect, deps) {
|
|
86120
86076
|
const isMounted = _$1(false);
|
|
@@ -86127,20 +86083,20 @@
|
|
|
86127
86083
|
}, deps);
|
|
86128
86084
|
}
|
|
86129
86085
|
|
|
86130
|
-
/**
|
|
86131
|
-
* @typedef { {
|
|
86132
|
-
* [key: string]: string;
|
|
86133
|
-
* } } TranslateReplacements
|
|
86086
|
+
/**
|
|
86087
|
+
* @typedef { {
|
|
86088
|
+
* [key: string]: string;
|
|
86089
|
+
* } } TranslateReplacements
|
|
86134
86090
|
*/
|
|
86135
86091
|
|
|
86136
|
-
/**
|
|
86137
|
-
* A simple translation stub to be used for multi-language support.
|
|
86138
|
-
* Can be easily replaced with a more sophisticated solution.
|
|
86139
|
-
*
|
|
86140
|
-
* @param {string} template to interpolate
|
|
86141
|
-
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
86142
|
-
*
|
|
86143
|
-
* @return {string} the translated string
|
|
86092
|
+
/**
|
|
86093
|
+
* A simple translation stub to be used for multi-language support.
|
|
86094
|
+
* Can be easily replaced with a more sophisticated solution.
|
|
86095
|
+
*
|
|
86096
|
+
* @param {string} template to interpolate
|
|
86097
|
+
* @param {TranslateReplacements} [replacements] a map with substitutes
|
|
86098
|
+
*
|
|
86099
|
+
* @return {string} the translated string
|
|
86144
86100
|
*/
|
|
86145
86101
|
function translateFallback(template, replacements) {
|
|
86146
86102
|
replacements = replacements || {};
|
|
@@ -86249,8 +86205,8 @@
|
|
|
86249
86205
|
}
|
|
86250
86206
|
const noop$1 = () => {};
|
|
86251
86207
|
|
|
86252
|
-
/**
|
|
86253
|
-
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
86208
|
+
/**
|
|
86209
|
+
* @param {import('../PropertiesPanel').ListGroupDefinition} props
|
|
86254
86210
|
*/
|
|
86255
86211
|
function ListGroup(props) {
|
|
86256
86212
|
const {
|
|
@@ -86441,18 +86397,18 @@
|
|
|
86441
86397
|
});
|
|
86442
86398
|
}
|
|
86443
86399
|
|
|
86444
|
-
/**
|
|
86445
|
-
* @param {Object} props
|
|
86446
|
-
* @param {Object} props.element
|
|
86447
|
-
* @param {String} props.id
|
|
86448
|
-
* @param {String} props.description
|
|
86449
|
-
* @param {String} props.label
|
|
86450
|
-
* @param {Function} props.getValue
|
|
86451
|
-
* @param {Function} props.setValue
|
|
86452
|
-
* @param {Function} props.onFocus
|
|
86453
|
-
* @param {Function} props.onBlur
|
|
86454
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
86455
|
-
* @param {boolean} [props.disabled]
|
|
86400
|
+
/**
|
|
86401
|
+
* @param {Object} props
|
|
86402
|
+
* @param {Object} props.element
|
|
86403
|
+
* @param {String} props.id
|
|
86404
|
+
* @param {String} props.description
|
|
86405
|
+
* @param {String} props.label
|
|
86406
|
+
* @param {Function} props.getValue
|
|
86407
|
+
* @param {Function} props.setValue
|
|
86408
|
+
* @param {Function} props.onFocus
|
|
86409
|
+
* @param {Function} props.onBlur
|
|
86410
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
86411
|
+
* @param {boolean} [props.disabled]
|
|
86456
86412
|
*/
|
|
86457
86413
|
function CheckboxEntry(props) {
|
|
86458
86414
|
const {
|
|
@@ -86572,20 +86528,20 @@
|
|
|
86572
86528
|
});
|
|
86573
86529
|
}
|
|
86574
86530
|
|
|
86575
|
-
/**
|
|
86576
|
-
* @param {object} props
|
|
86577
|
-
* @param {object} props.element
|
|
86578
|
-
* @param {string} props.id
|
|
86579
|
-
* @param {string} [props.description]
|
|
86580
|
-
* @param {string} props.label
|
|
86581
|
-
* @param {Function} props.getValue
|
|
86582
|
-
* @param {Function} props.setValue
|
|
86583
|
-
* @param {Function} props.onFocus
|
|
86584
|
-
* @param {Function} props.onBlur
|
|
86585
|
-
* @param {Function} props.getOptions
|
|
86586
|
-
* @param {boolean} [props.disabled]
|
|
86587
|
-
* @param {Function} [props.validate]
|
|
86588
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
86531
|
+
/**
|
|
86532
|
+
* @param {object} props
|
|
86533
|
+
* @param {object} props.element
|
|
86534
|
+
* @param {string} props.id
|
|
86535
|
+
* @param {string} [props.description]
|
|
86536
|
+
* @param {string} props.label
|
|
86537
|
+
* @param {Function} props.getValue
|
|
86538
|
+
* @param {Function} props.setValue
|
|
86539
|
+
* @param {Function} props.onFocus
|
|
86540
|
+
* @param {Function} props.onBlur
|
|
86541
|
+
* @param {Function} props.getOptions
|
|
86542
|
+
* @param {boolean} [props.disabled]
|
|
86543
|
+
* @param {Function} [props.validate]
|
|
86544
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
86589
86545
|
*/
|
|
86590
86546
|
function SelectEntry(props) {
|
|
86591
86547
|
const {
|
|
@@ -86688,6 +86644,12 @@
|
|
|
86688
86644
|
autoResize && resizeToContents(e.target);
|
|
86689
86645
|
setLocalValue(e.target.value);
|
|
86690
86646
|
};
|
|
86647
|
+
const handleOnBlur = e => {
|
|
86648
|
+
if (onBlur) {
|
|
86649
|
+
onBlur(e);
|
|
86650
|
+
}
|
|
86651
|
+
setLocalValue(e.target.value.trim());
|
|
86652
|
+
};
|
|
86691
86653
|
y(() => {
|
|
86692
86654
|
autoResize && resizeToContents(ref.current);
|
|
86693
86655
|
}, []);
|
|
@@ -86719,7 +86681,7 @@
|
|
|
86719
86681
|
class: classNames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
|
|
86720
86682
|
onInput: handleInput,
|
|
86721
86683
|
onFocus: onFocus,
|
|
86722
|
-
onBlur:
|
|
86684
|
+
onBlur: handleOnBlur,
|
|
86723
86685
|
placeholder: placeholder,
|
|
86724
86686
|
rows: rows,
|
|
86725
86687
|
value: localValue,
|
|
@@ -86837,6 +86799,12 @@
|
|
|
86837
86799
|
const handleInputCallback = F$1(() => {
|
|
86838
86800
|
return debounce(target => onInput(target.value.length ? target.value : undefined));
|
|
86839
86801
|
}, [onInput, debounce]);
|
|
86802
|
+
const handleOnBlur = e => {
|
|
86803
|
+
if (onBlur) {
|
|
86804
|
+
onBlur(e);
|
|
86805
|
+
}
|
|
86806
|
+
setLocalValue(e.target.value.trim());
|
|
86807
|
+
};
|
|
86840
86808
|
const handleInput = e => {
|
|
86841
86809
|
handleInputCallback(e.target);
|
|
86842
86810
|
setLocalValue(e.target.value);
|
|
@@ -86869,27 +86837,27 @@
|
|
|
86869
86837
|
class: "bio-properties-panel-input",
|
|
86870
86838
|
onInput: handleInput,
|
|
86871
86839
|
onFocus: onFocus,
|
|
86872
|
-
onBlur:
|
|
86840
|
+
onBlur: handleOnBlur,
|
|
86873
86841
|
placeholder: placeholder,
|
|
86874
86842
|
value: localValue
|
|
86875
86843
|
})]
|
|
86876
86844
|
});
|
|
86877
86845
|
}
|
|
86878
86846
|
|
|
86879
|
-
/**
|
|
86880
|
-
* @param {Object} props
|
|
86881
|
-
* @param {Object} props.element
|
|
86882
|
-
* @param {String} props.id
|
|
86883
|
-
* @param {String} props.description
|
|
86884
|
-
* @param {Boolean} props.debounce
|
|
86885
|
-
* @param {Boolean} props.disabled
|
|
86886
|
-
* @param {String} props.label
|
|
86887
|
-
* @param {Function} props.getValue
|
|
86888
|
-
* @param {Function} props.setValue
|
|
86889
|
-
* @param {Function} props.onFocus
|
|
86890
|
-
* @param {Function} props.onBlur
|
|
86891
|
-
* @param {string|import('preact').Component} props.tooltip
|
|
86892
|
-
* @param {Function} props.validate
|
|
86847
|
+
/**
|
|
86848
|
+
* @param {Object} props
|
|
86849
|
+
* @param {Object} props.element
|
|
86850
|
+
* @param {String} props.id
|
|
86851
|
+
* @param {String} props.description
|
|
86852
|
+
* @param {Boolean} props.debounce
|
|
86853
|
+
* @param {Boolean} props.disabled
|
|
86854
|
+
* @param {String} props.label
|
|
86855
|
+
* @param {Function} props.getValue
|
|
86856
|
+
* @param {Function} props.setValue
|
|
86857
|
+
* @param {Function} props.onFocus
|
|
86858
|
+
* @param {Function} props.onBlur
|
|
86859
|
+
* @param {string|import('preact').Component} props.tooltip
|
|
86860
|
+
* @param {Function} props.validate
|
|
86893
86861
|
*/
|
|
86894
86862
|
function TextfieldEntry(props) {
|
|
86895
86863
|
const {
|
|
@@ -86964,20 +86932,20 @@
|
|
|
86964
86932
|
this._eventBus = eventBus;
|
|
86965
86933
|
}
|
|
86966
86934
|
|
|
86967
|
-
/**
|
|
86968
|
-
* Check if the FEEL popup is open.
|
|
86969
|
-
* @return {Boolean}
|
|
86935
|
+
/**
|
|
86936
|
+
* Check if the FEEL popup is open.
|
|
86937
|
+
* @return {Boolean}
|
|
86970
86938
|
*/
|
|
86971
86939
|
isOpen() {
|
|
86972
86940
|
return this._eventBus.fire('feelPopup._isOpen');
|
|
86973
86941
|
}
|
|
86974
86942
|
|
|
86975
|
-
/**
|
|
86976
|
-
* Open the FEEL popup.
|
|
86977
|
-
*
|
|
86978
|
-
* @param {String} entryId
|
|
86979
|
-
* @param {Object} popupConfig
|
|
86980
|
-
* @param {HTMLElement} sourceElement
|
|
86943
|
+
/**
|
|
86944
|
+
* Open the FEEL popup.
|
|
86945
|
+
*
|
|
86946
|
+
* @param {String} entryId
|
|
86947
|
+
* @param {Object} popupConfig
|
|
86948
|
+
* @param {HTMLElement} sourceElement
|
|
86981
86949
|
*/
|
|
86982
86950
|
open(entryId, popupConfig, sourceElement) {
|
|
86983
86951
|
return this._eventBus.fire('feelPopup._open', {
|
|
@@ -86987,8 +86955,8 @@
|
|
|
86987
86955
|
});
|
|
86988
86956
|
}
|
|
86989
86957
|
|
|
86990
|
-
/**
|
|
86991
|
-
* Close the FEEL popup.
|
|
86958
|
+
/**
|
|
86959
|
+
* Close the FEEL popup.
|
|
86992
86960
|
*/
|
|
86993
86961
|
close() {
|
|
86994
86962
|
return this._eventBus.fire('feelPopup._close');
|
|
@@ -88483,7 +88451,7 @@
|
|
|
88483
88451
|
id,
|
|
88484
88452
|
getValue,
|
|
88485
88453
|
setValue,
|
|
88486
|
-
validate: validate$
|
|
88454
|
+
validate: validate$9
|
|
88487
88455
|
});
|
|
88488
88456
|
}
|
|
88489
88457
|
|
|
@@ -88493,7 +88461,7 @@
|
|
|
88493
88461
|
* @param {number|void} value
|
|
88494
88462
|
* @returns {string|null}
|
|
88495
88463
|
*/
|
|
88496
|
-
const validate$
|
|
88464
|
+
const validate$9 = value => {
|
|
88497
88465
|
if (typeof value !== 'number') {
|
|
88498
88466
|
return 'A number is required.';
|
|
88499
88467
|
}
|
|
@@ -88555,7 +88523,7 @@
|
|
|
88555
88523
|
setValue,
|
|
88556
88524
|
singleLine: true,
|
|
88557
88525
|
tooltip: getTooltip$1(),
|
|
88558
|
-
validate: validate$
|
|
88526
|
+
validate: validate$8,
|
|
88559
88527
|
variables
|
|
88560
88528
|
});
|
|
88561
88529
|
}
|
|
@@ -88583,7 +88551,7 @@
|
|
|
88583
88551
|
* @param {string|void} value
|
|
88584
88552
|
* @returns {string|null}
|
|
88585
88553
|
*/
|
|
88586
|
-
const validate$
|
|
88554
|
+
const validate$8 = value => {
|
|
88587
88555
|
if (!value || value.startsWith('=')) {
|
|
88588
88556
|
return;
|
|
88589
88557
|
}
|
|
@@ -88672,7 +88640,7 @@
|
|
|
88672
88640
|
};
|
|
88673
88641
|
return FeelTemplatingEntry({
|
|
88674
88642
|
debounce,
|
|
88675
|
-
description: description$
|
|
88643
|
+
description: description$3,
|
|
88676
88644
|
element: field,
|
|
88677
88645
|
getValue,
|
|
88678
88646
|
id,
|
|
@@ -88682,7 +88650,7 @@
|
|
|
88682
88650
|
variables
|
|
88683
88651
|
});
|
|
88684
88652
|
}
|
|
88685
|
-
const description$
|
|
88653
|
+
const description$3 = o(k$2, {
|
|
88686
88654
|
children: ["Supports markdown and templating.", ' ', o("a", {
|
|
88687
88655
|
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
|
|
88688
88656
|
target: "_blank",
|
|
@@ -88724,13 +88692,13 @@
|
|
|
88724
88692
|
};
|
|
88725
88693
|
return FeelTemplatingEntry({
|
|
88726
88694
|
debounce,
|
|
88727
|
-
description: description$
|
|
88695
|
+
description: description$2,
|
|
88728
88696
|
element: field,
|
|
88729
88697
|
getValue,
|
|
88730
88698
|
id,
|
|
88731
88699
|
label: 'Content',
|
|
88732
88700
|
hostLanguage: 'html',
|
|
88733
|
-
validate: validate$
|
|
88701
|
+
validate: validate$7,
|
|
88734
88702
|
setValue,
|
|
88735
88703
|
variables
|
|
88736
88704
|
});
|
|
@@ -88738,7 +88706,7 @@
|
|
|
88738
88706
|
|
|
88739
88707
|
// helpers //////////
|
|
88740
88708
|
|
|
88741
|
-
const description$
|
|
88709
|
+
const description$2 = o(k$2, {
|
|
88742
88710
|
children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', o("a", {
|
|
88743
88711
|
href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
|
|
88744
88712
|
target: "_blank",
|
|
@@ -88751,7 +88719,7 @@
|
|
|
88751
88719
|
* @param {string|void} value
|
|
88752
88720
|
* @returns {string|null}
|
|
88753
88721
|
*/
|
|
88754
|
-
const validate$
|
|
88722
|
+
const validate$7 = value => {
|
|
88755
88723
|
// allow empty state
|
|
88756
88724
|
if (typeof value !== 'string' || value === '') {
|
|
88757
88725
|
return null;
|
|
@@ -89578,7 +89546,7 @@
|
|
|
89578
89546
|
id,
|
|
89579
89547
|
label: 'Input values key',
|
|
89580
89548
|
setValue,
|
|
89581
|
-
validate: validate$
|
|
89549
|
+
validate: validate$6
|
|
89582
89550
|
});
|
|
89583
89551
|
}
|
|
89584
89552
|
|
|
@@ -89588,7 +89556,7 @@
|
|
|
89588
89556
|
* @param {string|void} value
|
|
89589
89557
|
* @returns {string|null}
|
|
89590
89558
|
*/
|
|
89591
|
-
const validate$
|
|
89559
|
+
const validate$6 = value => {
|
|
89592
89560
|
if (typeof value !== 'string' || value.length === 0) {
|
|
89593
89561
|
return 'Must not be empty.';
|
|
89594
89562
|
}
|
|
@@ -89613,7 +89581,14 @@
|
|
|
89613
89581
|
editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
|
|
89614
89582
|
};
|
|
89615
89583
|
const removeEntry = entry => {
|
|
89616
|
-
|
|
89584
|
+
if (field.defaultValue === entry.value) {
|
|
89585
|
+
editField(field, {
|
|
89586
|
+
values: without(values, entry),
|
|
89587
|
+
defaultValue: undefined
|
|
89588
|
+
});
|
|
89589
|
+
} else {
|
|
89590
|
+
editField(field, OPTIONS_SOURCES_PATHS[OPTIONS_SOURCES.STATIC], without(values, entry));
|
|
89591
|
+
}
|
|
89617
89592
|
};
|
|
89618
89593
|
const validateFactory = (key, getValue) => {
|
|
89619
89594
|
return value => {
|
|
@@ -90022,7 +89997,7 @@
|
|
|
90022
89997
|
setValue,
|
|
90023
89998
|
singleLine: true,
|
|
90024
89999
|
variables,
|
|
90025
|
-
validate: validate$
|
|
90000
|
+
validate: validate$5
|
|
90026
90001
|
});
|
|
90027
90002
|
}
|
|
90028
90003
|
|
|
@@ -90032,7 +90007,7 @@
|
|
|
90032
90007
|
* @param {string|void} value
|
|
90033
90008
|
* @returns {string|null}
|
|
90034
90009
|
*/
|
|
90035
|
-
const validate$
|
|
90010
|
+
const validate$5 = value => {
|
|
90036
90011
|
if (!isString$3(value) || value.length === 0) {
|
|
90037
90012
|
return 'Must not be empty.';
|
|
90038
90013
|
}
|
|
@@ -90134,7 +90109,7 @@
|
|
|
90134
90109
|
id,
|
|
90135
90110
|
getValue,
|
|
90136
90111
|
setValue,
|
|
90137
|
-
validate: validate$
|
|
90112
|
+
validate: validate$4
|
|
90138
90113
|
});
|
|
90139
90114
|
}
|
|
90140
90115
|
|
|
@@ -90144,7 +90119,7 @@
|
|
|
90144
90119
|
* @param {string|void} value
|
|
90145
90120
|
* @returns {string|null}
|
|
90146
90121
|
*/
|
|
90147
|
-
const validate$
|
|
90122
|
+
const validate$4 = value => {
|
|
90148
90123
|
if (isNil(value)) {
|
|
90149
90124
|
return null;
|
|
90150
90125
|
}
|
|
@@ -90316,7 +90291,7 @@
|
|
|
90316
90291
|
setValue,
|
|
90317
90292
|
singleLine: true,
|
|
90318
90293
|
variables,
|
|
90319
|
-
validate: validate$
|
|
90294
|
+
validate: validate$3
|
|
90320
90295
|
});
|
|
90321
90296
|
}
|
|
90322
90297
|
|
|
@@ -90326,7 +90301,7 @@
|
|
|
90326
90301
|
* @param {string|void} value
|
|
90327
90302
|
* @returns {string|null}
|
|
90328
90303
|
*/
|
|
90329
|
-
const validate$
|
|
90304
|
+
const validate$3 = value => {
|
|
90330
90305
|
if (!isString$3(value) || value.length === 0 || value === '=') {
|
|
90331
90306
|
return 'Must not be empty.';
|
|
90332
90307
|
}
|
|
@@ -90423,7 +90398,7 @@
|
|
|
90423
90398
|
id,
|
|
90424
90399
|
label: 'Key',
|
|
90425
90400
|
setValue,
|
|
90426
|
-
validate: validate$
|
|
90401
|
+
validate: validate$2
|
|
90427
90402
|
});
|
|
90428
90403
|
}
|
|
90429
90404
|
|
|
@@ -90433,7 +90408,7 @@
|
|
|
90433
90408
|
* @param {string|void} value
|
|
90434
90409
|
* @returns {string|null}
|
|
90435
90410
|
*/
|
|
90436
|
-
function validate$
|
|
90411
|
+
function validate$2(value) {
|
|
90437
90412
|
if (!isString$3(value) || value.length === 0) {
|
|
90438
90413
|
return 'Must not be empty.';
|
|
90439
90414
|
}
|
|
@@ -90568,13 +90543,13 @@
|
|
|
90568
90543
|
singleLine: true,
|
|
90569
90544
|
setValue,
|
|
90570
90545
|
variables,
|
|
90571
|
-
description: description$
|
|
90546
|
+
description: description$1
|
|
90572
90547
|
});
|
|
90573
90548
|
}
|
|
90574
90549
|
|
|
90575
90550
|
// helpers //////////
|
|
90576
90551
|
|
|
90577
|
-
const description$
|
|
90552
|
+
const description$1 = o(k$2, {
|
|
90578
90553
|
children: ["A comma-separated list of", ' ', o("a", {
|
|
90579
90554
|
href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
|
|
90580
90555
|
target: "_blank",
|
|
@@ -90663,6 +90638,7 @@
|
|
|
90663
90638
|
const schema = `[
|
|
90664
90639
|
{
|
|
90665
90640
|
"documentId": "u123",
|
|
90641
|
+
"endpoint": "https://api.example.com/documents/u123",
|
|
90666
90642
|
"metadata": {
|
|
90667
90643
|
"fileName": "Document.pdf",
|
|
90668
90644
|
"contentType": "application/pdf"
|
|
@@ -90680,83 +90656,15 @@
|
|
|
90680
90656
|
children: o("code", {
|
|
90681
90657
|
children: schema
|
|
90682
90658
|
})
|
|
90683
|
-
})]
|
|
90684
|
-
});
|
|
90685
|
-
return FeelTemplatingEntry({
|
|
90686
|
-
debounce,
|
|
90687
|
-
element: field,
|
|
90688
|
-
getValue,
|
|
90689
|
-
id,
|
|
90690
|
-
label: 'Document reference',
|
|
90691
|
-
feel: 'required',
|
|
90692
|
-
singleLine: true,
|
|
90693
|
-
setValue,
|
|
90694
|
-
variables,
|
|
90695
|
-
tooltip,
|
|
90696
|
-
validate: validate$2
|
|
90697
|
-
});
|
|
90698
|
-
}
|
|
90699
|
-
|
|
90700
|
-
// helpers //////////
|
|
90701
|
-
|
|
90702
|
-
/**
|
|
90703
|
-
* @param {string|undefined} value
|
|
90704
|
-
* @returns {string|null}
|
|
90705
|
-
*/
|
|
90706
|
-
const validate$2 = value => {
|
|
90707
|
-
if (typeof value !== 'string' || value.length === 0) {
|
|
90708
|
-
return 'The document data source is required.';
|
|
90709
|
-
}
|
|
90710
|
-
};
|
|
90711
|
-
function EndpointKeyEntry(props) {
|
|
90712
|
-
const {
|
|
90713
|
-
editField,
|
|
90714
|
-
field
|
|
90715
|
-
} = props;
|
|
90716
|
-
const entries = [];
|
|
90717
|
-
entries.push({
|
|
90718
|
-
id: 'endpointKey',
|
|
90719
|
-
component: EndpointKey,
|
|
90720
|
-
editField: editField,
|
|
90721
|
-
field: field,
|
|
90722
|
-
isEdited: isEdited$6,
|
|
90723
|
-
isDefaultVisible: field => field.type === 'documentPreview'
|
|
90724
|
-
});
|
|
90725
|
-
return entries;
|
|
90726
|
-
}
|
|
90727
|
-
function EndpointKey(props) {
|
|
90728
|
-
const {
|
|
90729
|
-
editField,
|
|
90730
|
-
field,
|
|
90731
|
-
id
|
|
90732
|
-
} = props;
|
|
90733
|
-
const debounce = useService('debounce');
|
|
90734
|
-
const variables = useVariables().map(name => ({
|
|
90735
|
-
name
|
|
90736
|
-
}));
|
|
90737
|
-
const path = ['endpointKey'];
|
|
90738
|
-
const getValue = () => {
|
|
90739
|
-
return get$1(field, path, '');
|
|
90740
|
-
};
|
|
90741
|
-
const setValue = value => {
|
|
90742
|
-
return editField(field, path, value);
|
|
90743
|
-
};
|
|
90744
|
-
const tooltip = o("div", {
|
|
90745
|
-
children: [o("p", {
|
|
90746
|
-
children: "Enter a context key that generates a string with the API endpoint to download a document."
|
|
90747
90659
|
}), o("p", {
|
|
90748
|
-
children:
|
|
90749
|
-
children: '{ documentId }'
|
|
90750
|
-
}), ", which will be replaced with the document ID from the document\u2018s reference."]
|
|
90660
|
+
children: "When using Camunda Tasklist UI, additional document reference attributes are automatically handled. Modifying the document reference may affect the document preview functionality."
|
|
90751
90661
|
}), o("p", {
|
|
90752
|
-
children: "
|
|
90753
|
-
|
|
90754
|
-
children: ["For more details, see the", ' ', o("a", {
|
|
90755
|
-
href: "https://docs.camunda.io/docs/next/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
|
|
90756
|
-
rel: "noopener noreferrer",
|
|
90662
|
+
children: ["Learn more in our", ' ', o("a", {
|
|
90663
|
+
href: "https://docs.camunda.io/docs/8.7/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
|
|
90757
90664
|
target: "_blank",
|
|
90758
|
-
|
|
90759
|
-
|
|
90665
|
+
rel: "noopener noreferrer",
|
|
90666
|
+
children: "documentation"
|
|
90667
|
+
}), "."]
|
|
90760
90668
|
})]
|
|
90761
90669
|
});
|
|
90762
90670
|
return FeelTemplatingEntry({
|
|
@@ -90764,12 +90672,11 @@
|
|
|
90764
90672
|
element: field,
|
|
90765
90673
|
getValue,
|
|
90766
90674
|
id,
|
|
90767
|
-
label: 'Document
|
|
90675
|
+
label: 'Document reference',
|
|
90768
90676
|
feel: 'required',
|
|
90769
90677
|
singleLine: true,
|
|
90770
90678
|
setValue,
|
|
90771
90679
|
variables,
|
|
90772
|
-
description: description$1,
|
|
90773
90680
|
tooltip,
|
|
90774
90681
|
validate: validate$1
|
|
90775
90682
|
});
|
|
@@ -90783,12 +90690,9 @@
|
|
|
90783
90690
|
*/
|
|
90784
90691
|
const validate$1 = value => {
|
|
90785
90692
|
if (typeof value !== 'string' || value.length === 0) {
|
|
90786
|
-
return 'The document
|
|
90693
|
+
return 'The document data source is required.';
|
|
90787
90694
|
}
|
|
90788
90695
|
};
|
|
90789
|
-
const description$1 = o(k$2, {
|
|
90790
|
-
children: "Define an API URL for downloading a document"
|
|
90791
|
-
});
|
|
90792
90696
|
function MaxHeightEntry(props) {
|
|
90793
90697
|
const {
|
|
90794
90698
|
editField,
|
|
@@ -91559,20 +91463,6 @@
|
|
|
91559
91463
|
|
|
91560
91464
|
"Expression" defines options that are populated from a FEEL expression.
|
|
91561
91465
|
`;
|
|
91562
|
-
function DownloadSettings(field, editField) {
|
|
91563
|
-
const entries = [...EndpointKeyEntry({
|
|
91564
|
-
field,
|
|
91565
|
-
editField
|
|
91566
|
-
})];
|
|
91567
|
-
if (!entries.length) {
|
|
91568
|
-
return null;
|
|
91569
|
-
}
|
|
91570
|
-
return {
|
|
91571
|
-
id: 'downloadSettings',
|
|
91572
|
-
label: 'Download settings',
|
|
91573
|
-
entries
|
|
91574
|
-
};
|
|
91575
|
-
}
|
|
91576
91466
|
class PropertiesProvider {
|
|
91577
91467
|
constructor(propertiesPanel, injector) {
|
|
91578
91468
|
this._injector = injector;
|
|
@@ -91608,7 +91498,7 @@
|
|
|
91608
91498
|
return groups;
|
|
91609
91499
|
}
|
|
91610
91500
|
const getService = (type, strict = true) => this._injector.get(type, strict);
|
|
91611
|
-
groups = [...groups, GeneralGroup(field, editField, getService),
|
|
91501
|
+
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);
|
|
91612
91502
|
this._filterVisibleEntries(groups, field, getService);
|
|
91613
91503
|
|
|
91614
91504
|
// contract: if a group has no entries or items, it should not be displayed at all
|