@bpmn-io/form-js-viewer 1.8.8 → 1.9.2
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/LICENSE +22 -22
- package/dist/assets/form-js-base.css +13 -0
- package/dist/assets/form-js.css +13 -0
- package/dist/index.cjs +27 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +27 -12
- package/dist/index.es.js.map +1 -1
- package/dist/types/render/components/util/dateTimeUtil.d.ts +6 -0
- package/package.json +5 -4
package/dist/index.es.js
CHANGED
|
@@ -6,6 +6,7 @@ import { jsx, jsxs, Fragment } from 'preact/jsx-runtime';
|
|
|
6
6
|
import { useContext, useMemo, useRef, useCallback, useEffect, useState, useLayoutEffect } from 'preact/hooks';
|
|
7
7
|
import { createContext, createElement, Fragment as Fragment$1, render } from 'preact';
|
|
8
8
|
import isEqual from 'lodash/isEqual';
|
|
9
|
+
import { DateTime } from 'luxon';
|
|
9
10
|
import flatpickr from 'flatpickr';
|
|
10
11
|
import * as React from 'preact/compat';
|
|
11
12
|
import { createPortal } from 'preact/compat';
|
|
@@ -1418,16 +1419,16 @@ function parseIsoTime(isoTimeString) {
|
|
|
1418
1419
|
return parseBasicMinutes(isoTimeString);
|
|
1419
1420
|
}
|
|
1420
1421
|
}
|
|
1422
|
+
|
|
1423
|
+
/**
|
|
1424
|
+
* Returns the date object as a simple 'YYYY-MM-DD' formatted date in the local timezone.
|
|
1425
|
+
*
|
|
1426
|
+
* @param {*} date The date object to serialize.
|
|
1427
|
+
* @returns {string} The serialized date.
|
|
1428
|
+
*/
|
|
1421
1429
|
function serializeDate(date) {
|
|
1422
|
-
|
|
1423
|
-
month = '' + (d.getMonth() + 1),
|
|
1424
|
-
day = '' + d.getDate(),
|
|
1425
|
-
year = d.getFullYear();
|
|
1426
|
-
if (month.length < 2) month = '0' + month;
|
|
1427
|
-
if (day.length < 2) day = '0' + day;
|
|
1428
|
-
return [year, month, day].join('-');
|
|
1430
|
+
return DateTime.fromJSDate(date).toISODate();
|
|
1429
1431
|
}
|
|
1430
|
-
|
|
1431
1432
|
// this method is used to make the `new Date(value)` parsing behavior stricter
|
|
1432
1433
|
function isDateTimeInputInformationSufficient(value) {
|
|
1433
1434
|
if (!value || typeof value !== 'string') return false;
|
|
@@ -2847,7 +2848,7 @@ function Datetime(props) {
|
|
|
2847
2848
|
switch (subtype) {
|
|
2848
2849
|
case DATETIME_SUBTYPES.DATE:
|
|
2849
2850
|
{
|
|
2850
|
-
date =
|
|
2851
|
+
date = typeof value === 'string' ? DateTime.fromISO(value).toJSDate() : new Date(NaN);
|
|
2851
2852
|
break;
|
|
2852
2853
|
}
|
|
2853
2854
|
case DATETIME_SUBTYPES.TIME:
|
|
@@ -6788,6 +6789,7 @@ class RepeatRenderManager {
|
|
|
6788
6789
|
const hasChildren = repeaterField.components && repeaterField.components.length > 0;
|
|
6789
6790
|
const showRemove = repeaterField.allowAddRemove && hasChildren;
|
|
6790
6791
|
const displayValues = isCollapsed ? values.slice(0, nonCollapsedItems) : values;
|
|
6792
|
+
const hiddenValues = isCollapsed ? values.slice(nonCollapsedItems) : [];
|
|
6791
6793
|
const onDeleteItem = index => {
|
|
6792
6794
|
const updatedValues = values.slice();
|
|
6793
6795
|
updatedValues.splice(index, 1);
|
|
@@ -6798,8 +6800,8 @@ class RepeatRenderManager {
|
|
|
6798
6800
|
});
|
|
6799
6801
|
};
|
|
6800
6802
|
const parentExpressionContextInfo = useContext(LocalExpressionContext);
|
|
6801
|
-
return
|
|
6802
|
-
children: displayValues.map((itemValue, itemIndex) => jsx(RepetitionScaffold, {
|
|
6803
|
+
return jsxs(Fragment, {
|
|
6804
|
+
children: [displayValues.map((itemValue, itemIndex) => jsx(RepetitionScaffold, {
|
|
6803
6805
|
itemIndex: itemIndex,
|
|
6804
6806
|
itemValue: itemValue,
|
|
6805
6807
|
parentExpressionContextInfo: parentExpressionContextInfo,
|
|
@@ -6809,7 +6811,20 @@ class RepeatRenderManager {
|
|
|
6809
6811
|
onDeleteItem: onDeleteItem,
|
|
6810
6812
|
showRemove: showRemove,
|
|
6811
6813
|
...restProps
|
|
6812
|
-
}, itemIndex))
|
|
6814
|
+
}, itemIndex)), hiddenValues.length > 0 ? jsx("div", {
|
|
6815
|
+
className: "fjs-repeat-row-collapsed",
|
|
6816
|
+
children: hiddenValues.map((itemValue, itemIndex) => jsx(RepetitionScaffold, {
|
|
6817
|
+
itemIndex: itemIndex + nonCollapsedItems,
|
|
6818
|
+
itemValue: itemValue,
|
|
6819
|
+
parentExpressionContextInfo: parentExpressionContextInfo,
|
|
6820
|
+
repeaterField: repeaterField,
|
|
6821
|
+
RowsRenderer: RowsRenderer,
|
|
6822
|
+
indexes: indexes,
|
|
6823
|
+
onDeleteItem: onDeleteItem,
|
|
6824
|
+
showRemove: showRemove,
|
|
6825
|
+
...restProps
|
|
6826
|
+
}, itemIndex))
|
|
6827
|
+
}) : null]
|
|
6813
6828
|
});
|
|
6814
6829
|
}
|
|
6815
6830
|
RepeatFooter(props) {
|