@bpmn-io/form-js-viewer 1.11.0-alpha.0 → 1.11.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/README.md +1 -0
- package/dist/assets/form-js-base.css +5 -0
- package/dist/assets/form-js.css +5 -0
- package/dist/index.cjs +316 -427
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +316 -427
- package/dist/index.es.js.map +1 -1
- package/dist/types/Form.d.ts +1 -2
- package/dist/types/core/FieldFactory.d.ts +1 -1
- package/dist/types/core/FormFieldInstanceRegistry.d.ts +2 -3
- package/dist/types/core/index.d.ts +0 -1
- package/dist/types/features/repeatRender/RepeatRenderManager.d.ts +4 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/types/render/components/Util.d.ts +1 -0
- package/dist/types/render/components/form-fields/Button.d.ts +2 -1
- package/dist/types/render/components/form-fields/Checkbox.d.ts +4 -2
- package/dist/types/render/components/form-fields/Checklist.d.ts +2 -3
- package/dist/types/render/components/form-fields/Datetime.d.ts +3 -2
- package/dist/types/render/components/form-fields/Default.d.ts +1 -0
- package/dist/types/render/components/form-fields/DynamicList.d.ts +2 -1
- package/dist/types/render/components/form-fields/ExpressionField.d.ts +1 -1
- package/dist/types/render/components/form-fields/FilePicker.d.ts +5 -4
- package/dist/types/render/components/form-fields/Group.d.ts +2 -1
- package/dist/types/render/components/form-fields/Html.d.ts +1 -1
- package/dist/types/render/components/form-fields/IFrame.d.ts +2 -1
- package/dist/types/render/components/form-fields/Image.d.ts +2 -1
- package/dist/types/render/components/form-fields/Number.d.ts +4 -2
- package/dist/types/render/components/form-fields/Radio.d.ts +2 -3
- package/dist/types/render/components/form-fields/Select.d.ts +2 -3
- package/dist/types/render/components/form-fields/Separator.d.ts +1 -1
- package/dist/types/render/components/form-fields/Spacer.d.ts +1 -1
- package/dist/types/render/components/form-fields/Table.d.ts +2 -1
- package/dist/types/render/components/form-fields/Taglist.d.ts +2 -3
- package/dist/types/render/components/form-fields/Text.d.ts +2 -1
- package/dist/types/render/components/form-fields/Textarea.d.ts +4 -2
- package/dist/types/render/components/form-fields/Textfield.d.ts +4 -2
- package/dist/types/render/components/index.d.ts +1 -1
- package/dist/types/render/hooks/index.d.ts +0 -1
- package/dist/types/render/hooks/useExpressionEvaluation.d.ts +4 -3
- package/dist/types/render/hooks/useService.d.ts +1 -7
- package/dist/types/render/index.d.ts +0 -2
- package/dist/types/util/expressions.d.ts +4 -3
- package/package.json +8 -8
- package/dist/types/render/FileRegistry.d.ts +0 -52
- package/dist/types/render/hooks/useBooleanExpressionEvaluation.d.ts +0 -9
- package/dist/types/util/constants/FilePickerConstants.d.ts +0 -1
- package/dist/types/util/extractFileReferencesFromRemovedData.d.ts +0 -7
package/dist/index.cjs
CHANGED
|
@@ -591,6 +591,18 @@ function gridColumnClasses(formField) {
|
|
|
591
591
|
// always fall back to top-down on smallest screens
|
|
592
592
|
'cds--col-sm-16', 'cds--col-md-16');
|
|
593
593
|
}
|
|
594
|
+
function textToLabel(text) {
|
|
595
|
+
if (typeof text != 'string') return null;
|
|
596
|
+
for (const line of text.split('\n')) {
|
|
597
|
+
const displayLine = line.trim();
|
|
598
|
+
|
|
599
|
+
// we use the first non-whitespace line in the text as label
|
|
600
|
+
if (displayLine !== '') {
|
|
601
|
+
return displayLine;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return null;
|
|
605
|
+
}
|
|
594
606
|
function prefixId(id, formId, indexes) {
|
|
595
607
|
let result = 'fjs-form';
|
|
596
608
|
if (formId) {
|
|
@@ -665,12 +677,6 @@ const FormContext = preact.createContext({
|
|
|
665
677
|
formId: null
|
|
666
678
|
});
|
|
667
679
|
|
|
668
|
-
/**
|
|
669
|
-
* @template T
|
|
670
|
-
* @param {string} type
|
|
671
|
-
* @param {boolean} [strict=true]
|
|
672
|
-
* @returns {T | null}
|
|
673
|
-
*/
|
|
674
680
|
function useService(type, strict) {
|
|
675
681
|
const {
|
|
676
682
|
getService
|
|
@@ -749,10 +755,11 @@ function buildExpressionContext(context) {
|
|
|
749
755
|
}
|
|
750
756
|
|
|
751
757
|
/**
|
|
752
|
-
*
|
|
758
|
+
* Evaluate a string based on the expressionLanguage and context information.
|
|
759
|
+
* If the string is not an expression, it is returned as is.
|
|
753
760
|
*
|
|
754
761
|
* @param {any} expressionLanguage - The expression language to use.
|
|
755
|
-
* @param {
|
|
762
|
+
* @param {string} value - The string to evaluate.
|
|
756
763
|
* @param {Object} expressionContextInfo - The context information to use.
|
|
757
764
|
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
758
765
|
*/
|
|
@@ -883,10 +890,11 @@ function _isAllowedValue(value) {
|
|
|
883
890
|
}
|
|
884
891
|
|
|
885
892
|
/**
|
|
886
|
-
*
|
|
893
|
+
* Evaluate a string reactively based on the expressionLanguage and form data.
|
|
894
|
+
* If the string is not an expression, it is returned as is.
|
|
887
895
|
* The function is memoized to minimize re-renders.
|
|
888
896
|
*
|
|
889
|
-
* @param {
|
|
897
|
+
* @param {string} value - The string to evaluate.
|
|
890
898
|
* @returns {any} - Evaluated value or the original value if not an expression.
|
|
891
899
|
*/
|
|
892
900
|
function useExpressionEvaluation(value) {
|
|
@@ -903,6 +911,7 @@ function useExpressionEvaluation(value) {
|
|
|
903
911
|
* @returns {T} - Returns the current state.
|
|
904
912
|
*/
|
|
905
913
|
function useDeepCompareMemoize(value) {
|
|
914
|
+
/** @type {import("preact").RefObject<T>} */
|
|
906
915
|
const ref = hooks.useRef();
|
|
907
916
|
if (!isEqual(value, ref.current)) {
|
|
908
917
|
ref.current = value;
|
|
@@ -1126,7 +1135,7 @@ function _isElementScrollable(el) {
|
|
|
1126
1135
|
}
|
|
1127
1136
|
|
|
1128
1137
|
const EMPTY_OBJECT = {};
|
|
1129
|
-
const EMPTY_ARRAY
|
|
1138
|
+
const EMPTY_ARRAY = [];
|
|
1130
1139
|
|
|
1131
1140
|
/**
|
|
1132
1141
|
* Custom hook to scroll an element within a scrollable container.
|
|
@@ -1142,7 +1151,7 @@ const EMPTY_ARRAY$2 = [];
|
|
|
1142
1151
|
*/
|
|
1143
1152
|
function useScrollIntoView(scrolledElementRef, deps, scrollOptions, flagRefs) {
|
|
1144
1153
|
const _scrollOptions = scrollOptions || EMPTY_OBJECT;
|
|
1145
|
-
const _flagRefs = flagRefs || EMPTY_ARRAY
|
|
1154
|
+
const _flagRefs = flagRefs || EMPTY_ARRAY;
|
|
1146
1155
|
hooks.useEffect(() => {
|
|
1147
1156
|
// return early if flags are not raised, or component is not mounted
|
|
1148
1157
|
if (minDash.some(_flagRefs, ref => !ref.current) || !scrolledElementRef.current) {
|
|
@@ -1196,23 +1205,6 @@ function _getTopOffset(item, scrollContainer, options) {
|
|
|
1196
1205
|
return 0;
|
|
1197
1206
|
}
|
|
1198
1207
|
|
|
1199
|
-
/**
|
|
1200
|
-
* If the value is a valid expression, we evaluate it. Otherwise, we continue with the value as-is.
|
|
1201
|
-
* If the resulting value isn't a boolean, we return 'false'
|
|
1202
|
-
* The function is memoized to minimize re-renders.
|
|
1203
|
-
*
|
|
1204
|
-
* @param {boolean | string} value - A static boolean or expression to evaluate.
|
|
1205
|
-
* @returns {boolean} - Evaluated boolean result.
|
|
1206
|
-
*/
|
|
1207
|
-
function useBooleanExpressionEvaluation(value) {
|
|
1208
|
-
const expressionLanguage = useService('expressionLanguage');
|
|
1209
|
-
const expressionContextInfo = hooks.useContext(LocalExpressionContext);
|
|
1210
|
-
return hooks.useMemo(() => {
|
|
1211
|
-
const evaluationResult = runExpressionEvaluation(expressionLanguage, value, expressionContextInfo);
|
|
1212
|
-
return typeof evaluationResult === 'boolean' ? evaluationResult : false;
|
|
1213
|
-
}, [expressionLanguage, expressionContextInfo, value]);
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
1208
|
/**
|
|
1217
1209
|
* Returns the conditionally filtered data of a form reactively.
|
|
1218
1210
|
* Memoised to minimize re-renders
|
|
@@ -1726,9 +1718,10 @@ function Button(props) {
|
|
|
1726
1718
|
Button.config = {
|
|
1727
1719
|
type: type$i,
|
|
1728
1720
|
keyed: false,
|
|
1729
|
-
|
|
1721
|
+
name: 'Button',
|
|
1730
1722
|
group: 'action',
|
|
1731
1723
|
create: (options = {}) => ({
|
|
1724
|
+
label: 'Button',
|
|
1732
1725
|
action: 'submit',
|
|
1733
1726
|
...options
|
|
1734
1727
|
})
|
|
@@ -1836,11 +1829,9 @@ function Checkbox(props) {
|
|
|
1836
1829
|
}), {
|
|
1837
1830
|
'fjs-checked': value
|
|
1838
1831
|
}),
|
|
1839
|
-
children: [jsxRuntime.
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
required: required,
|
|
1843
|
-
children: jsxRuntime.jsx("input", {
|
|
1832
|
+
children: [jsxRuntime.jsxs("div", {
|
|
1833
|
+
class: "fjs-inline-label",
|
|
1834
|
+
children: [jsxRuntime.jsx("input", {
|
|
1844
1835
|
checked: value,
|
|
1845
1836
|
class: "fjs-input",
|
|
1846
1837
|
disabled: disabled,
|
|
@@ -1853,7 +1844,11 @@ function Checkbox(props) {
|
|
|
1853
1844
|
required: required,
|
|
1854
1845
|
"aria-invalid": errors.length > 0,
|
|
1855
1846
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1856
|
-
})
|
|
1847
|
+
}), jsxRuntime.jsx(Label, {
|
|
1848
|
+
htmlFor: domId,
|
|
1849
|
+
label: label,
|
|
1850
|
+
required: required
|
|
1851
|
+
})]
|
|
1857
1852
|
}), jsxRuntime.jsx(Description, {
|
|
1858
1853
|
id: descriptionId,
|
|
1859
1854
|
description: description
|
|
@@ -1866,13 +1861,14 @@ function Checkbox(props) {
|
|
|
1866
1861
|
Checkbox.config = {
|
|
1867
1862
|
type: type$h,
|
|
1868
1863
|
keyed: true,
|
|
1869
|
-
|
|
1864
|
+
name: 'Checkbox',
|
|
1870
1865
|
group: 'selection',
|
|
1871
1866
|
emptyValue: false,
|
|
1872
1867
|
sanitizeValue: ({
|
|
1873
1868
|
value
|
|
1874
1869
|
}) => value === true,
|
|
1875
1870
|
create: (options = {}) => ({
|
|
1871
|
+
label: 'Checkbox',
|
|
1876
1872
|
...options
|
|
1877
1873
|
})
|
|
1878
1874
|
};
|
|
@@ -1894,6 +1890,8 @@ function Checklist(props) {
|
|
|
1894
1890
|
label,
|
|
1895
1891
|
validate = {}
|
|
1896
1892
|
} = field;
|
|
1893
|
+
|
|
1894
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
1897
1895
|
const outerDivRef = hooks.useRef();
|
|
1898
1896
|
const {
|
|
1899
1897
|
required
|
|
@@ -1939,31 +1937,32 @@ function Checklist(props) {
|
|
|
1939
1937
|
children: [jsxRuntime.jsx(Label, {
|
|
1940
1938
|
label: label,
|
|
1941
1939
|
required: required
|
|
1942
|
-
}), loadState == LOAD_STATES.LOADED && options.map((
|
|
1940
|
+
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
1943
1941
|
const itemDomId = `${domId}-${index}`;
|
|
1944
|
-
const isChecked = hasEqualValue(
|
|
1945
|
-
return jsxRuntime.
|
|
1946
|
-
|
|
1947
|
-
label: o.label,
|
|
1948
|
-
class: classNames({
|
|
1942
|
+
const isChecked = hasEqualValue(option.value, values);
|
|
1943
|
+
return jsxRuntime.jsxs("div", {
|
|
1944
|
+
className: classNames('fjs-inline-label', {
|
|
1949
1945
|
'fjs-checked': isChecked
|
|
1950
1946
|
}),
|
|
1951
|
-
|
|
1952
|
-
children: jsxRuntime.jsx("input", {
|
|
1947
|
+
children: [jsxRuntime.jsx("input", {
|
|
1953
1948
|
checked: isChecked,
|
|
1954
1949
|
class: "fjs-input",
|
|
1955
1950
|
disabled: disabled,
|
|
1956
1951
|
readOnly: readonly,
|
|
1957
1952
|
id: itemDomId,
|
|
1958
1953
|
type: "checkbox",
|
|
1959
|
-
onClick: () => toggleCheckbox(
|
|
1954
|
+
onClick: () => toggleCheckbox(option.value),
|
|
1960
1955
|
onBlur: onCheckboxBlur,
|
|
1961
1956
|
onFocus: onCheckboxFocus,
|
|
1962
1957
|
required: required,
|
|
1963
1958
|
"aria-invalid": errors.length > 0,
|
|
1964
1959
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1965
|
-
})
|
|
1966
|
-
|
|
1960
|
+
}), jsxRuntime.jsx(Label, {
|
|
1961
|
+
htmlFor: itemDomId,
|
|
1962
|
+
label: option.label,
|
|
1963
|
+
required: false
|
|
1964
|
+
})]
|
|
1965
|
+
}, option.value);
|
|
1967
1966
|
}), jsxRuntime.jsx(Description, {
|
|
1968
1967
|
id: descriptionId,
|
|
1969
1968
|
description: description
|
|
@@ -1976,17 +1975,18 @@ function Checklist(props) {
|
|
|
1976
1975
|
Checklist.config = {
|
|
1977
1976
|
type: type$g,
|
|
1978
1977
|
keyed: true,
|
|
1979
|
-
|
|
1978
|
+
name: 'Checkbox group',
|
|
1980
1979
|
group: 'selection',
|
|
1981
1980
|
emptyValue: [],
|
|
1982
1981
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
1983
|
-
create:
|
|
1982
|
+
create: (options = {}) => ({
|
|
1983
|
+
label: 'Checkbox group',
|
|
1984
|
+
...createEmptyOptions(options)
|
|
1985
|
+
})
|
|
1984
1986
|
};
|
|
1985
1987
|
|
|
1986
1988
|
const noop$1 = () => false;
|
|
1987
|
-
const ids$2 = new Ids([32, 36, 1]);
|
|
1988
1989
|
function FormField(props) {
|
|
1989
|
-
const instanceIdRef = hooks.useRef(ids$2.next());
|
|
1990
1990
|
const {
|
|
1991
1991
|
field,
|
|
1992
1992
|
indexes,
|
|
@@ -2032,28 +2032,22 @@ function FormField(props) {
|
|
|
2032
2032
|
// add precedence: global readonly > form field disabled
|
|
2033
2033
|
const disabled = !properties.readOnly && (properties.disabled || field.disabled || false);
|
|
2034
2034
|
const hidden = useCondition(field.conditional && field.conditional.hide || null);
|
|
2035
|
-
const
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
expressionContextInfo: localExpressionContext,
|
|
2042
|
-
valuePath,
|
|
2043
|
-
value,
|
|
2044
|
-
indexes,
|
|
2045
|
-
hidden
|
|
2046
|
-
});
|
|
2047
|
-
}, [formFieldInstanceRegistry, field.id, localExpressionContext, valuePath, value, indexes, hidden]);
|
|
2048
|
-
const fieldInstance = instanceId ? formFieldInstanceRegistry.get(instanceId) : null;
|
|
2035
|
+
const fieldInstance = hooks.useMemo(() => ({
|
|
2036
|
+
id: field.id,
|
|
2037
|
+
expressionContextInfo: localExpressionContext,
|
|
2038
|
+
valuePath,
|
|
2039
|
+
indexes
|
|
2040
|
+
}), [field.id, valuePath, localExpressionContext, indexes]);
|
|
2049
2041
|
|
|
2050
|
-
//
|
|
2042
|
+
// register form field instance
|
|
2051
2043
|
hooks.useEffect(() => {
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
return () =>
|
|
2044
|
+
if (formFieldInstanceRegistry && !hidden) {
|
|
2045
|
+
const instanceId = formFieldInstanceRegistry.add(fieldInstance);
|
|
2046
|
+
return () => {
|
|
2047
|
+
formFieldInstanceRegistry.remove(instanceId);
|
|
2048
|
+
};
|
|
2055
2049
|
}
|
|
2056
|
-
}, [formFieldInstanceRegistry]);
|
|
2050
|
+
}, [fieldInstance, formFieldInstanceRegistry, hidden]);
|
|
2057
2051
|
|
|
2058
2052
|
// ensures the initial validation behavior can be re-triggered upon form reset
|
|
2059
2053
|
hooks.useEffect(() => {
|
|
@@ -2286,11 +2280,12 @@ Default.config = {
|
|
|
2286
2280
|
create: (options = {}) => ({
|
|
2287
2281
|
components: [],
|
|
2288
2282
|
...options
|
|
2289
|
-
})
|
|
2283
|
+
}),
|
|
2284
|
+
getSubheading: field => field.id
|
|
2290
2285
|
};
|
|
2291
2286
|
|
|
2292
2287
|
var _path$x;
|
|
2293
|
-
function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (
|
|
2288
|
+
function _extends$y() { return _extends$y = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$y.apply(null, arguments); }
|
|
2294
2289
|
var SvgCalendar = function SvgCalendar(props) {
|
|
2295
2290
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
|
|
2296
2291
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2426,7 +2421,11 @@ function Datepicker(props) {
|
|
|
2426
2421
|
readonly,
|
|
2427
2422
|
setDate
|
|
2428
2423
|
} = props;
|
|
2424
|
+
|
|
2425
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
2429
2426
|
const dateInputRef = hooks.useRef();
|
|
2427
|
+
|
|
2428
|
+
/** @type {import("preact").RefObject<HTMLElement>} */
|
|
2430
2429
|
const focusScopeRef = hooks.useRef();
|
|
2431
2430
|
const [flatpickrInstance, setFlatpickrInstance] = hooks.useState(null);
|
|
2432
2431
|
const [isInputDirty, setIsInputDirty] = hooks.useState(false);
|
|
@@ -2564,7 +2563,7 @@ function Datepicker(props) {
|
|
|
2564
2563
|
}
|
|
2565
2564
|
|
|
2566
2565
|
var _path$w, _path2$4;
|
|
2567
|
-
function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (
|
|
2566
|
+
function _extends$x() { return _extends$x = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$x.apply(null, arguments); }
|
|
2568
2567
|
var SvgClock = function SvgClock(props) {
|
|
2569
2568
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
|
|
2570
2569
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2598,7 +2597,11 @@ function DropdownList(props) {
|
|
|
2598
2597
|
const [mouseControl, setMouseControl] = hooks.useState(false);
|
|
2599
2598
|
const [focusedValueIndex, setFocusedValueIndex] = hooks.useState(initialFocusIndex);
|
|
2600
2599
|
const [smoothScrolling, setSmoothScrolling] = hooks.useState(false);
|
|
2600
|
+
|
|
2601
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2601
2602
|
const dropdownContainer = hooks.useRef();
|
|
2603
|
+
|
|
2604
|
+
/** @type {import("preact").RefObject<{ x: number, y: number }>} */
|
|
2602
2605
|
const mouseScreenPos = hooks.useRef();
|
|
2603
2606
|
const focusedItem = hooks.useMemo(() => values.length ? values[focusedValueIndex] : null, [focusedValueIndex, values]);
|
|
2604
2607
|
const changeFocusedValueIndex = hooks.useCallback(delta => {
|
|
@@ -2816,7 +2819,7 @@ function Timepicker(props) {
|
|
|
2816
2819
|
value: rawValue,
|
|
2817
2820
|
disabled: disabled,
|
|
2818
2821
|
readOnly: readonly,
|
|
2819
|
-
placeholder: use24h ? 'hh:mm' : 'hh:mm
|
|
2822
|
+
placeholder: use24h ? 'hh:mm' : 'hh:mm --',
|
|
2820
2823
|
autoComplete: "off",
|
|
2821
2824
|
onInput: e => {
|
|
2822
2825
|
// @ts-expect-error
|
|
@@ -2872,6 +2875,8 @@ function Datetime(props) {
|
|
|
2872
2875
|
const {
|
|
2873
2876
|
formId
|
|
2874
2877
|
} = hooks.useContext(FormContext);
|
|
2878
|
+
|
|
2879
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2875
2880
|
const dateTimeGroupRef = hooks.useRef();
|
|
2876
2881
|
const [dateTime, setDateTime] = hooks.useState(getNullDateTime());
|
|
2877
2882
|
const [dateTimeUpdateRequest, setDateTimeUpdateRequest] = hooks.useState(null);
|
|
@@ -3037,18 +3042,23 @@ function Datetime(props) {
|
|
|
3037
3042
|
Datetime.config = {
|
|
3038
3043
|
type: type$f,
|
|
3039
3044
|
keyed: true,
|
|
3040
|
-
|
|
3045
|
+
name: 'Date time',
|
|
3041
3046
|
group: 'basic-input',
|
|
3042
3047
|
emptyValue: null,
|
|
3043
3048
|
sanitizeValue: sanitizeDateTimePickerValue,
|
|
3044
|
-
create: (options = {}) => {
|
|
3049
|
+
create: (options = {}, isNewField) => {
|
|
3045
3050
|
const defaults = {};
|
|
3046
3051
|
minDash.set(defaults, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES.DATE);
|
|
3047
|
-
|
|
3052
|
+
if (isNewField) {
|
|
3053
|
+
minDash.set(defaults, DATE_LABEL_PATH, 'Date');
|
|
3054
|
+
}
|
|
3048
3055
|
return {
|
|
3049
3056
|
...defaults,
|
|
3050
3057
|
...options
|
|
3051
3058
|
};
|
|
3059
|
+
},
|
|
3060
|
+
getSubheading: field => {
|
|
3061
|
+
return field.dateLabel || field.timeLabel;
|
|
3052
3062
|
}
|
|
3053
3063
|
};
|
|
3054
3064
|
|
|
@@ -3086,9 +3096,10 @@ function Group(props) {
|
|
|
3086
3096
|
Group.config = {
|
|
3087
3097
|
type: 'group',
|
|
3088
3098
|
pathed: true,
|
|
3089
|
-
|
|
3099
|
+
name: 'Group',
|
|
3090
3100
|
group: 'container',
|
|
3091
3101
|
create: (options = {}) => ({
|
|
3102
|
+
label: 'Group',
|
|
3092
3103
|
components: [],
|
|
3093
3104
|
showOutline: true,
|
|
3094
3105
|
...options
|
|
@@ -3162,9 +3173,10 @@ function IFramePlaceholder(props) {
|
|
|
3162
3173
|
IFrame.config = {
|
|
3163
3174
|
type: type$e,
|
|
3164
3175
|
keyed: false,
|
|
3165
|
-
|
|
3176
|
+
name: 'iFrame',
|
|
3166
3177
|
group: 'container',
|
|
3167
3178
|
create: (options = {}) => ({
|
|
3179
|
+
label: 'iFrame',
|
|
3168
3180
|
security: {
|
|
3169
3181
|
allowScripts: true
|
|
3170
3182
|
},
|
|
@@ -3173,7 +3185,7 @@ IFrame.config = {
|
|
|
3173
3185
|
};
|
|
3174
3186
|
|
|
3175
3187
|
var _path$v;
|
|
3176
|
-
function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (
|
|
3188
|
+
function _extends$w() { return _extends$w = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$w.apply(null, arguments); }
|
|
3177
3189
|
var SvgButton = function SvgButton(props) {
|
|
3178
3190
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
|
|
3179
3191
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3187,7 +3199,7 @@ var SvgButton = function SvgButton(props) {
|
|
|
3187
3199
|
};
|
|
3188
3200
|
|
|
3189
3201
|
var _path$u;
|
|
3190
|
-
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (
|
|
3202
|
+
function _extends$v() { return _extends$v = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$v.apply(null, arguments); }
|
|
3191
3203
|
var SvgCheckbox = function SvgCheckbox(props) {
|
|
3192
3204
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
|
|
3193
3205
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3200,7 +3212,7 @@ var SvgCheckbox = function SvgCheckbox(props) {
|
|
|
3200
3212
|
};
|
|
3201
3213
|
|
|
3202
3214
|
var _path$t;
|
|
3203
|
-
function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (
|
|
3215
|
+
function _extends$u() { return _extends$u = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$u.apply(null, arguments); }
|
|
3204
3216
|
var SvgChecklist = function SvgChecklist(props) {
|
|
3205
3217
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
|
|
3206
3218
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3216,7 +3228,7 @@ var SvgChecklist = function SvgChecklist(props) {
|
|
|
3216
3228
|
};
|
|
3217
3229
|
|
|
3218
3230
|
var _path$s, _path2$3, _path3;
|
|
3219
|
-
function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (
|
|
3231
|
+
function _extends$t() { return _extends$t = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$t.apply(null, arguments); }
|
|
3220
3232
|
var SvgDatetime = function SvgDatetime(props) {
|
|
3221
3233
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
3222
3234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3235,7 +3247,7 @@ var SvgDatetime = function SvgDatetime(props) {
|
|
|
3235
3247
|
};
|
|
3236
3248
|
|
|
3237
3249
|
var _path$r, _path2$2;
|
|
3238
|
-
function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (
|
|
3250
|
+
function _extends$s() { return _extends$s = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$s.apply(null, arguments); }
|
|
3239
3251
|
var SvgTaglist = function SvgTaglist(props) {
|
|
3240
3252
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
|
|
3241
3253
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3251,7 +3263,7 @@ var SvgTaglist = function SvgTaglist(props) {
|
|
|
3251
3263
|
};
|
|
3252
3264
|
|
|
3253
3265
|
var _rect, _rect2, _rect3;
|
|
3254
|
-
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (
|
|
3266
|
+
function _extends$r() { return _extends$r = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$r.apply(null, arguments); }
|
|
3255
3267
|
var SvgForm = function SvgForm(props) {
|
|
3256
3268
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
3257
3269
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3279,7 +3291,7 @@ var SvgForm = function SvgForm(props) {
|
|
|
3279
3291
|
};
|
|
3280
3292
|
|
|
3281
3293
|
var _path$q;
|
|
3282
|
-
function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (
|
|
3294
|
+
function _extends$q() { return _extends$q = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$q.apply(null, arguments); }
|
|
3283
3295
|
var SvgGroup = function SvgGroup(props) {
|
|
3284
3296
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
|
|
3285
3297
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3295,7 +3307,7 @@ var SvgGroup = function SvgGroup(props) {
|
|
|
3295
3307
|
};
|
|
3296
3308
|
|
|
3297
3309
|
var _path$p;
|
|
3298
|
-
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (
|
|
3310
|
+
function _extends$p() { return _extends$p = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$p.apply(null, arguments); }
|
|
3299
3311
|
var SvgNumber = function SvgNumber(props) {
|
|
3300
3312
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
3301
3313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3309,7 +3321,7 @@ var SvgNumber = function SvgNumber(props) {
|
|
|
3309
3321
|
};
|
|
3310
3322
|
|
|
3311
3323
|
var _path$o;
|
|
3312
|
-
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (
|
|
3324
|
+
function _extends$o() { return _extends$o = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$o.apply(null, arguments); }
|
|
3313
3325
|
var SvgRadio = function SvgRadio(props) {
|
|
3314
3326
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
|
|
3315
3327
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3322,7 +3334,7 @@ var SvgRadio = function SvgRadio(props) {
|
|
|
3322
3334
|
};
|
|
3323
3335
|
|
|
3324
3336
|
var _path$n;
|
|
3325
|
-
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (
|
|
3337
|
+
function _extends$n() { return _extends$n = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$n.apply(null, arguments); }
|
|
3326
3338
|
var SvgSelect = function SvgSelect(props) {
|
|
3327
3339
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
|
|
3328
3340
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3336,7 +3348,7 @@ var SvgSelect = function SvgSelect(props) {
|
|
|
3336
3348
|
};
|
|
3337
3349
|
|
|
3338
3350
|
var _path$m;
|
|
3339
|
-
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (
|
|
3351
|
+
function _extends$m() { return _extends$m = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$m.apply(null, arguments); }
|
|
3340
3352
|
var SvgSeparator = function SvgSeparator(props) {
|
|
3341
3353
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
|
|
3342
3354
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3350,7 +3362,7 @@ var SvgSeparator = function SvgSeparator(props) {
|
|
|
3350
3362
|
};
|
|
3351
3363
|
|
|
3352
3364
|
var _path$l;
|
|
3353
|
-
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (
|
|
3365
|
+
function _extends$l() { return _extends$l = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$l.apply(null, arguments); }
|
|
3354
3366
|
var SvgSpacer = function SvgSpacer(props) {
|
|
3355
3367
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
|
|
3356
3368
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3364,7 +3376,7 @@ var SvgSpacer = function SvgSpacer(props) {
|
|
|
3364
3376
|
};
|
|
3365
3377
|
|
|
3366
3378
|
var _path$k;
|
|
3367
|
-
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (
|
|
3379
|
+
function _extends$k() { return _extends$k = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$k.apply(null, arguments); }
|
|
3368
3380
|
var SvgDynamicList = function SvgDynamicList(props) {
|
|
3369
3381
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
|
|
3370
3382
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3380,7 +3392,7 @@ var SvgDynamicList = function SvgDynamicList(props) {
|
|
|
3380
3392
|
};
|
|
3381
3393
|
|
|
3382
3394
|
var _path$j;
|
|
3383
|
-
function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (
|
|
3395
|
+
function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
|
|
3384
3396
|
var SvgText = function SvgText(props) {
|
|
3385
3397
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
|
|
3386
3398
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3393,7 +3405,7 @@ var SvgText = function SvgText(props) {
|
|
|
3393
3405
|
};
|
|
3394
3406
|
|
|
3395
3407
|
var _path$i;
|
|
3396
|
-
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (
|
|
3408
|
+
function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
|
|
3397
3409
|
var SvgHtml = function SvgHtml(props) {
|
|
3398
3410
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
3399
3411
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3409,7 +3421,7 @@ var SvgHtml = function SvgHtml(props) {
|
|
|
3409
3421
|
};
|
|
3410
3422
|
|
|
3411
3423
|
var _path$h;
|
|
3412
|
-
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (
|
|
3424
|
+
function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
|
|
3413
3425
|
var SvgExpressionField = function SvgExpressionField(props) {
|
|
3414
3426
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
3415
3427
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3425,7 +3437,7 @@ var SvgExpressionField = function SvgExpressionField(props) {
|
|
|
3425
3437
|
};
|
|
3426
3438
|
|
|
3427
3439
|
var _path$g;
|
|
3428
|
-
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (
|
|
3440
|
+
function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
|
|
3429
3441
|
var SvgTextfield = function SvgTextfield(props) {
|
|
3430
3442
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
3431
3443
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3439,7 +3451,7 @@ var SvgTextfield = function SvgTextfield(props) {
|
|
|
3439
3451
|
};
|
|
3440
3452
|
|
|
3441
3453
|
var _path$f;
|
|
3442
|
-
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (
|
|
3454
|
+
function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
|
|
3443
3455
|
var SvgTextarea = function SvgTextarea(props) {
|
|
3444
3456
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
3445
3457
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3453,7 +3465,7 @@ var SvgTextarea = function SvgTextarea(props) {
|
|
|
3453
3465
|
};
|
|
3454
3466
|
|
|
3455
3467
|
var _path$e;
|
|
3456
|
-
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (
|
|
3468
|
+
function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
|
|
3457
3469
|
var SvgIFrame = function SvgIFrame(props) {
|
|
3458
3470
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
|
|
3459
3471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3469,7 +3481,7 @@ var SvgIFrame = function SvgIFrame(props) {
|
|
|
3469
3481
|
};
|
|
3470
3482
|
|
|
3471
3483
|
var _path$d, _path2$1;
|
|
3472
|
-
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (
|
|
3484
|
+
function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
|
|
3473
3485
|
var SvgImage = function SvgImage(props) {
|
|
3474
3486
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
3475
3487
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3488,7 +3500,7 @@ var SvgImage = function SvgImage(props) {
|
|
|
3488
3500
|
};
|
|
3489
3501
|
|
|
3490
3502
|
var _path$c;
|
|
3491
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (
|
|
3503
|
+
function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
|
|
3492
3504
|
var SvgTable = function SvgTable(props) {
|
|
3493
3505
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
3494
3506
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3503,7 +3515,7 @@ var SvgTable = function SvgTable(props) {
|
|
|
3503
3515
|
};
|
|
3504
3516
|
|
|
3505
3517
|
var _path$b;
|
|
3506
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (
|
|
3518
|
+
function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
|
|
3507
3519
|
var SvgFilePicker = function SvgFilePicker(props) {
|
|
3508
3520
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
3509
3521
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3594,11 +3606,10 @@ function Image(props) {
|
|
|
3594
3606
|
Image.config = {
|
|
3595
3607
|
type: type$d,
|
|
3596
3608
|
keyed: false,
|
|
3597
|
-
|
|
3609
|
+
name: 'Image view',
|
|
3598
3610
|
group: 'presentation',
|
|
3599
|
-
create: (options = {}) =>
|
|
3600
|
-
|
|
3601
|
-
})
|
|
3611
|
+
create: (options = {}) => options,
|
|
3612
|
+
getSubheading: field => field.alt
|
|
3602
3613
|
};
|
|
3603
3614
|
|
|
3604
3615
|
function TemplatedInputAdorner(props) {
|
|
@@ -3620,7 +3631,7 @@ function TemplatedInputAdorner(props) {
|
|
|
3620
3631
|
}
|
|
3621
3632
|
|
|
3622
3633
|
var _path$a;
|
|
3623
|
-
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (
|
|
3634
|
+
function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
|
|
3624
3635
|
var SvgAngelDown = function SvgAngelDown(props) {
|
|
3625
3636
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
3626
3637
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3637,7 +3648,7 @@ var SvgAngelDown = function SvgAngelDown(props) {
|
|
|
3637
3648
|
};
|
|
3638
3649
|
|
|
3639
3650
|
var _path$9;
|
|
3640
|
-
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (
|
|
3651
|
+
function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
|
|
3641
3652
|
var SvgAngelUp = function SvgAngelUp(props) {
|
|
3642
3653
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
3643
3654
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3709,6 +3720,8 @@ function Numberfield(props) {
|
|
|
3709
3720
|
const {
|
|
3710
3721
|
required
|
|
3711
3722
|
} = validate;
|
|
3723
|
+
|
|
3724
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
3712
3725
|
const inputRef = hooks.useRef();
|
|
3713
3726
|
const [cachedValue, setCachedValue] = hooks.useState(value);
|
|
3714
3727
|
const [displayValue, setDisplayValue] = hooks.useState(value);
|
|
@@ -3905,7 +3918,7 @@ function Numberfield(props) {
|
|
|
3905
3918
|
Numberfield.config = {
|
|
3906
3919
|
type: type$c,
|
|
3907
3920
|
keyed: true,
|
|
3908
|
-
|
|
3921
|
+
name: 'Number',
|
|
3909
3922
|
group: 'basic-input',
|
|
3910
3923
|
emptyValue: null,
|
|
3911
3924
|
sanitizeValue: ({
|
|
@@ -3919,6 +3932,7 @@ Numberfield.config = {
|
|
|
3919
3932
|
return formField.serializeToString ? value.toString() : Number(value);
|
|
3920
3933
|
},
|
|
3921
3934
|
create: (options = {}) => ({
|
|
3935
|
+
label: 'Number',
|
|
3922
3936
|
...options
|
|
3923
3937
|
})
|
|
3924
3938
|
};
|
|
@@ -3940,6 +3954,8 @@ function Radio(props) {
|
|
|
3940
3954
|
label,
|
|
3941
3955
|
validate = {}
|
|
3942
3956
|
} = field;
|
|
3957
|
+
|
|
3958
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
3943
3959
|
const outerDivRef = hooks.useRef();
|
|
3944
3960
|
const {
|
|
3945
3961
|
required
|
|
@@ -3987,18 +4003,16 @@ function Radio(props) {
|
|
|
3987
4003
|
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
3988
4004
|
const itemDomId = `${domId}-${index}`;
|
|
3989
4005
|
const isChecked = isEqual(option.value, value);
|
|
3990
|
-
return jsxRuntime.
|
|
3991
|
-
|
|
3992
|
-
label: option.label,
|
|
3993
|
-
class: classNames({
|
|
4006
|
+
return jsxRuntime.jsxs("div", {
|
|
4007
|
+
className: classNames('fjs-inline-label', {
|
|
3994
4008
|
'fjs-checked': isChecked
|
|
3995
4009
|
}),
|
|
3996
|
-
|
|
3997
|
-
children: jsxRuntime.jsx("input", {
|
|
4010
|
+
children: [jsxRuntime.jsx("input", {
|
|
3998
4011
|
checked: isChecked,
|
|
3999
4012
|
class: "fjs-input",
|
|
4000
4013
|
disabled: disabled,
|
|
4001
4014
|
readOnly: readonly,
|
|
4015
|
+
name: domId,
|
|
4002
4016
|
id: itemDomId,
|
|
4003
4017
|
type: "radio",
|
|
4004
4018
|
onClick: () => onChange(option.value),
|
|
@@ -4007,8 +4021,15 @@ function Radio(props) {
|
|
|
4007
4021
|
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
4008
4022
|
required: required,
|
|
4009
4023
|
"aria-invalid": errors.length > 0
|
|
4010
|
-
})
|
|
4011
|
-
|
|
4024
|
+
}), jsxRuntime.jsx(Label, {
|
|
4025
|
+
htmlFor: itemDomId,
|
|
4026
|
+
label: option.label,
|
|
4027
|
+
class: classNames({
|
|
4028
|
+
'fjs-checked': isChecked
|
|
4029
|
+
}),
|
|
4030
|
+
required: false
|
|
4031
|
+
})]
|
|
4032
|
+
}, option.value);
|
|
4012
4033
|
}), jsxRuntime.jsx(Description, {
|
|
4013
4034
|
id: descriptionId,
|
|
4014
4035
|
description: description
|
|
@@ -4021,15 +4042,18 @@ function Radio(props) {
|
|
|
4021
4042
|
Radio.config = {
|
|
4022
4043
|
type: type$b,
|
|
4023
4044
|
keyed: true,
|
|
4024
|
-
|
|
4045
|
+
name: 'Radio group',
|
|
4025
4046
|
group: 'selection',
|
|
4026
4047
|
emptyValue: null,
|
|
4027
4048
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4028
|
-
create:
|
|
4049
|
+
create: (options = {}) => ({
|
|
4050
|
+
label: 'Radio group',
|
|
4051
|
+
...createEmptyOptions(options)
|
|
4052
|
+
})
|
|
4029
4053
|
};
|
|
4030
4054
|
|
|
4031
4055
|
var _path$8;
|
|
4032
|
-
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (
|
|
4056
|
+
function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
|
|
4033
4057
|
var SvgXMark = function SvgXMark(props) {
|
|
4034
4058
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
|
|
4035
4059
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4060,6 +4084,8 @@ function SearchableSelect(props) {
|
|
|
4060
4084
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4061
4085
|
const [isFilterActive, setIsFilterActive] = hooks.useState(true);
|
|
4062
4086
|
const [isEscapeClosed, setIsEscapeClose] = hooks.useState(false);
|
|
4087
|
+
|
|
4088
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4063
4089
|
const searchbarRef = hooks.useRef();
|
|
4064
4090
|
const eventBus = useService('eventBus');
|
|
4065
4091
|
const {
|
|
@@ -4087,9 +4113,9 @@ function SearchableSelect(props) {
|
|
|
4087
4113
|
if (!filter || !isFilterActive) {
|
|
4088
4114
|
return options;
|
|
4089
4115
|
}
|
|
4090
|
-
return options.filter(
|
|
4116
|
+
return options.filter(option => option.label && option.value && option.label.toLowerCase().includes(filter.toLowerCase()));
|
|
4091
4117
|
}, [filter, loadState, options, isFilterActive]);
|
|
4092
|
-
const
|
|
4118
|
+
const pickOption = hooks.useCallback(option => {
|
|
4093
4119
|
setFilter(option && option.label || '');
|
|
4094
4120
|
props.onChange({
|
|
4095
4121
|
value: option && option.value || null
|
|
@@ -4187,7 +4213,7 @@ function SearchableSelect(props) {
|
|
|
4187
4213
|
}), displayState.displayCross && jsxRuntime.jsxs("span", {
|
|
4188
4214
|
class: "fjs-select-cross",
|
|
4189
4215
|
onMouseDown: e => {
|
|
4190
|
-
|
|
4216
|
+
pickOption(null);
|
|
4191
4217
|
e.preventDefault();
|
|
4192
4218
|
},
|
|
4193
4219
|
children: [jsxRuntime.jsx(SvgXMark, {}), ' ']
|
|
@@ -4200,9 +4226,9 @@ function SearchableSelect(props) {
|
|
|
4200
4226
|
class: "fjs-select-anchor",
|
|
4201
4227
|
children: displayState.displayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4202
4228
|
values: filteredOptions,
|
|
4203
|
-
getLabel:
|
|
4204
|
-
onValueSelected:
|
|
4205
|
-
|
|
4229
|
+
getLabel: option => option.label,
|
|
4230
|
+
onValueSelected: option => {
|
|
4231
|
+
pickOption(option);
|
|
4206
4232
|
setIsDropdownExpanded(false);
|
|
4207
4233
|
},
|
|
4208
4234
|
listenerElement: searchbarRef.current
|
|
@@ -4224,6 +4250,8 @@ function SimpleSelect(props) {
|
|
|
4224
4250
|
} = props;
|
|
4225
4251
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4226
4252
|
const selectRef = hooks.useRef();
|
|
4253
|
+
|
|
4254
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4227
4255
|
const inputRef = hooks.useRef();
|
|
4228
4256
|
const {
|
|
4229
4257
|
loadState,
|
|
@@ -4238,7 +4266,7 @@ function SimpleSelect(props) {
|
|
|
4238
4266
|
});
|
|
4239
4267
|
const getLabelCorrelation = useGetLabelCorrelation(options);
|
|
4240
4268
|
const valueLabel = hooks.useMemo(() => value && getLabelCorrelation(value), [value, getLabelCorrelation]);
|
|
4241
|
-
const
|
|
4269
|
+
const pickOption = hooks.useCallback(option => {
|
|
4242
4270
|
props.onChange({
|
|
4243
4271
|
value: option && option.value || null
|
|
4244
4272
|
});
|
|
@@ -4263,7 +4291,7 @@ function SimpleSelect(props) {
|
|
|
4263
4291
|
}
|
|
4264
4292
|
e.preventDefault();
|
|
4265
4293
|
}, [disabled, isDropdownExpanded]);
|
|
4266
|
-
const initialFocusIndex = hooks.useMemo(() => value && minDash.findIndex(options,
|
|
4294
|
+
const initialFocusIndex = hooks.useMemo(() => value && minDash.findIndex(options, option => option.value === value) || 0, [options, value]);
|
|
4267
4295
|
const onInputFocus = hooks.useCallback(() => {
|
|
4268
4296
|
if (!readonly) {
|
|
4269
4297
|
setIsDropdownExpanded(true);
|
|
@@ -4305,7 +4333,7 @@ function SimpleSelect(props) {
|
|
|
4305
4333
|
}), displayState.displayCross && jsxRuntime.jsx("span", {
|
|
4306
4334
|
class: "fjs-select-cross",
|
|
4307
4335
|
onMouseDown: e => {
|
|
4308
|
-
|
|
4336
|
+
pickOption(null);
|
|
4309
4337
|
e.stopPropagation();
|
|
4310
4338
|
},
|
|
4311
4339
|
children: jsxRuntime.jsx(SvgXMark, {})
|
|
@@ -4317,10 +4345,10 @@ function SimpleSelect(props) {
|
|
|
4317
4345
|
class: "fjs-select-anchor",
|
|
4318
4346
|
children: displayState.displayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4319
4347
|
values: options,
|
|
4320
|
-
getLabel:
|
|
4348
|
+
getLabel: option => option.label,
|
|
4321
4349
|
initialFocusIndex: initialFocusIndex,
|
|
4322
|
-
onValueSelected:
|
|
4323
|
-
|
|
4350
|
+
onValueSelected: option => {
|
|
4351
|
+
pickOption(option);
|
|
4324
4352
|
setIsDropdownExpanded(false);
|
|
4325
4353
|
},
|
|
4326
4354
|
listenerElement: selectRef.current
|
|
@@ -4399,11 +4427,14 @@ function Select(props) {
|
|
|
4399
4427
|
Select.config = {
|
|
4400
4428
|
type: type$a,
|
|
4401
4429
|
keyed: true,
|
|
4402
|
-
|
|
4430
|
+
name: 'Select',
|
|
4403
4431
|
group: 'selection',
|
|
4404
4432
|
emptyValue: null,
|
|
4405
4433
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4406
|
-
create:
|
|
4434
|
+
create: (options = {}) => ({
|
|
4435
|
+
label: 'Select',
|
|
4436
|
+
...createEmptyOptions(options)
|
|
4437
|
+
})
|
|
4407
4438
|
};
|
|
4408
4439
|
|
|
4409
4440
|
const type$9 = 'separator';
|
|
@@ -4416,7 +4447,7 @@ function Separator() {
|
|
|
4416
4447
|
Separator.config = {
|
|
4417
4448
|
type: type$9,
|
|
4418
4449
|
keyed: false,
|
|
4419
|
-
|
|
4450
|
+
name: 'Separator',
|
|
4420
4451
|
group: 'presentation',
|
|
4421
4452
|
create: (options = {}) => ({
|
|
4422
4453
|
...options
|
|
@@ -4441,7 +4472,7 @@ function Spacer(props) {
|
|
|
4441
4472
|
Spacer.config = {
|
|
4442
4473
|
type: type$8,
|
|
4443
4474
|
keyed: false,
|
|
4444
|
-
|
|
4475
|
+
name: 'Spacer',
|
|
4445
4476
|
group: 'presentation',
|
|
4446
4477
|
create: (options = {}) => ({
|
|
4447
4478
|
height: 60,
|
|
@@ -4487,9 +4518,10 @@ DynamicList.config = {
|
|
|
4487
4518
|
type: 'dynamiclist',
|
|
4488
4519
|
pathed: true,
|
|
4489
4520
|
repeatable: true,
|
|
4490
|
-
|
|
4521
|
+
name: 'Dynamic list',
|
|
4491
4522
|
group: 'container',
|
|
4492
4523
|
create: (options = {}) => ({
|
|
4524
|
+
label: 'Dynamic list',
|
|
4493
4525
|
components: [],
|
|
4494
4526
|
showOutline: true,
|
|
4495
4527
|
isRepeating: true,
|
|
@@ -4543,7 +4575,11 @@ function Taglist(props) {
|
|
|
4543
4575
|
const [filter, setFilter] = hooks.useState('');
|
|
4544
4576
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4545
4577
|
const [isEscapeClosed, setIsEscapeClose] = hooks.useState(false);
|
|
4578
|
+
|
|
4579
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
4546
4580
|
const focusScopeRef = hooks.useRef();
|
|
4581
|
+
|
|
4582
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4547
4583
|
const inputRef = hooks.useRef();
|
|
4548
4584
|
const eventBus = useService('eventBus');
|
|
4549
4585
|
const {
|
|
@@ -4732,8 +4768,8 @@ function Taglist(props) {
|
|
|
4732
4768
|
class: "fjs-taglist-anchor",
|
|
4733
4769
|
children: shouldDisplayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4734
4770
|
values: filteredOptions,
|
|
4735
|
-
getLabel:
|
|
4736
|
-
onValueSelected:
|
|
4771
|
+
getLabel: option => option.label,
|
|
4772
|
+
onValueSelected: option => selectValue(option.value),
|
|
4737
4773
|
emptyListMessage: hasOptionsLeft ? 'No results' : 'All values selected',
|
|
4738
4774
|
listenerElement: inputRef.current
|
|
4739
4775
|
})
|
|
@@ -4749,11 +4785,14 @@ function Taglist(props) {
|
|
|
4749
4785
|
Taglist.config = {
|
|
4750
4786
|
type: type$7,
|
|
4751
4787
|
keyed: true,
|
|
4752
|
-
|
|
4788
|
+
name: 'Tag list',
|
|
4753
4789
|
group: 'selection',
|
|
4754
4790
|
emptyValue: [],
|
|
4755
4791
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
4756
|
-
create:
|
|
4792
|
+
create: (options = {}) => ({
|
|
4793
|
+
label: 'Tag list',
|
|
4794
|
+
...createEmptyOptions(options)
|
|
4795
|
+
})
|
|
4757
4796
|
};
|
|
4758
4797
|
|
|
4759
4798
|
const NODE_TYPE_TEXT = 3,
|
|
@@ -4778,7 +4817,7 @@ function sanitizeHTML(html) {
|
|
|
4778
4817
|
doc.normalize();
|
|
4779
4818
|
const element = doc.body.firstChild;
|
|
4780
4819
|
if (element) {
|
|
4781
|
-
sanitizeNode(
|
|
4820
|
+
sanitizeNode(/** @type Element */element);
|
|
4782
4821
|
return /** @type Element */element.innerHTML;
|
|
4783
4822
|
} else {
|
|
4784
4823
|
// handle the case that document parsing
|
|
@@ -4835,7 +4874,7 @@ function sanitizeNode(node) {
|
|
|
4835
4874
|
node.setAttribute('rel', 'noopener');
|
|
4836
4875
|
}
|
|
4837
4876
|
for (let i = node.childNodes.length; i--;) {
|
|
4838
|
-
sanitizeNode(
|
|
4877
|
+
sanitizeNode(/** @type Element */node.childNodes[i]);
|
|
4839
4878
|
}
|
|
4840
4879
|
}
|
|
4841
4880
|
|
|
@@ -4922,12 +4961,15 @@ function Text(props) {
|
|
|
4922
4961
|
Text.config = {
|
|
4923
4962
|
type: type$6,
|
|
4924
4963
|
keyed: false,
|
|
4925
|
-
|
|
4964
|
+
name: 'Text view',
|
|
4926
4965
|
group: 'presentation',
|
|
4927
4966
|
create: (options = {}) => ({
|
|
4928
4967
|
text: '# Text',
|
|
4929
4968
|
...options
|
|
4930
|
-
})
|
|
4969
|
+
}),
|
|
4970
|
+
getSubheading: field => {
|
|
4971
|
+
textToLabel(field.text);
|
|
4972
|
+
}
|
|
4931
4973
|
};
|
|
4932
4974
|
|
|
4933
4975
|
const type$5 = 'html';
|
|
@@ -4988,7 +5030,7 @@ function Html(props) {
|
|
|
4988
5030
|
Html.config = {
|
|
4989
5031
|
type: type$5,
|
|
4990
5032
|
keyed: false,
|
|
4991
|
-
|
|
5033
|
+
name: 'HTML view',
|
|
4992
5034
|
group: 'presentation',
|
|
4993
5035
|
create: (options = {}) => ({
|
|
4994
5036
|
content: '',
|
|
@@ -5034,7 +5076,7 @@ function ExpressionField(props) {
|
|
|
5034
5076
|
}
|
|
5035
5077
|
ExpressionField.config = {
|
|
5036
5078
|
type: type$4,
|
|
5037
|
-
|
|
5079
|
+
name: 'Expression',
|
|
5038
5080
|
group: 'basic-input',
|
|
5039
5081
|
keyed: true,
|
|
5040
5082
|
emptyValue: null,
|
|
@@ -5127,7 +5169,7 @@ function Textfield(props) {
|
|
|
5127
5169
|
Textfield.config = {
|
|
5128
5170
|
type: type$3,
|
|
5129
5171
|
keyed: true,
|
|
5130
|
-
|
|
5172
|
+
name: 'Text field',
|
|
5131
5173
|
group: 'basic-input',
|
|
5132
5174
|
emptyValue: '',
|
|
5133
5175
|
sanitizeValue: ({
|
|
@@ -5144,6 +5186,7 @@ Textfield.config = {
|
|
|
5144
5186
|
return String(value);
|
|
5145
5187
|
},
|
|
5146
5188
|
create: (options = {}) => ({
|
|
5189
|
+
label: 'Text field',
|
|
5147
5190
|
...options
|
|
5148
5191
|
})
|
|
5149
5192
|
};
|
|
@@ -5232,13 +5275,14 @@ function Textarea(props) {
|
|
|
5232
5275
|
Textarea.config = {
|
|
5233
5276
|
type: type$2,
|
|
5234
5277
|
keyed: true,
|
|
5235
|
-
|
|
5278
|
+
name: 'Text area',
|
|
5236
5279
|
group: 'basic-input',
|
|
5237
5280
|
emptyValue: '',
|
|
5238
5281
|
sanitizeValue: ({
|
|
5239
5282
|
value
|
|
5240
5283
|
}) => minDash.isArray(value) || minDash.isObject(value) || minDash.isNil(value) ? '' : String(value),
|
|
5241
5284
|
create: (options = {}) => ({
|
|
5285
|
+
label: 'Text area',
|
|
5242
5286
|
...options
|
|
5243
5287
|
})
|
|
5244
5288
|
};
|
|
@@ -5262,7 +5306,7 @@ const autoSizeTextarea = textarea => {
|
|
|
5262
5306
|
};
|
|
5263
5307
|
|
|
5264
5308
|
var _path$7;
|
|
5265
|
-
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (
|
|
5309
|
+
function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
|
|
5266
5310
|
var SvgArrowDown = function SvgArrowDown(props) {
|
|
5267
5311
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
|
|
5268
5312
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5274,7 +5318,7 @@ var SvgArrowDown = function SvgArrowDown(props) {
|
|
|
5274
5318
|
};
|
|
5275
5319
|
|
|
5276
5320
|
var _path$6;
|
|
5277
|
-
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (
|
|
5321
|
+
function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
|
|
5278
5322
|
var SvgArrowUp = function SvgArrowUp(props) {
|
|
5279
5323
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
|
|
5280
5324
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5286,7 +5330,7 @@ var SvgArrowUp = function SvgArrowUp(props) {
|
|
|
5286
5330
|
};
|
|
5287
5331
|
|
|
5288
5332
|
var _path$5;
|
|
5289
|
-
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (
|
|
5333
|
+
function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
|
|
5290
5334
|
var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
5291
5335
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
5292
5336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5299,7 +5343,7 @@ var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
|
5299
5343
|
};
|
|
5300
5344
|
|
|
5301
5345
|
var _path$4;
|
|
5302
|
-
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (
|
|
5346
|
+
function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
|
|
5303
5347
|
var SvgCaretRight = function SvgCaretRight(props) {
|
|
5304
5348
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
5305
5349
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5350,9 +5394,7 @@ function Table(props) {
|
|
|
5350
5394
|
id,
|
|
5351
5395
|
label
|
|
5352
5396
|
} = field;
|
|
5353
|
-
|
|
5354
|
-
/** @type {[(null|Sorting), import("preact/hooks").StateUpdater<null|Sorting>]} */
|
|
5355
|
-
const [sortBy, setSortBy] = hooks.useState(null);
|
|
5397
|
+
const [sortBy, setSortBy] = hooks.useState(/** @type {Sorting | null} */null);
|
|
5356
5398
|
const evaluatedColumns = useEvaluatedColumns(columnsExpression || '', columns);
|
|
5357
5399
|
const columnKeys = evaluatedColumns.map(({
|
|
5358
5400
|
key
|
|
@@ -5368,6 +5410,12 @@ function Table(props) {
|
|
|
5368
5410
|
hooks.useEffect(() => {
|
|
5369
5411
|
setCurrentPage(0);
|
|
5370
5412
|
}, [rowCount, sortBy]);
|
|
5413
|
+
const serializeCellData = cellData => {
|
|
5414
|
+
if (cellData !== null && typeof cellData === 'object') {
|
|
5415
|
+
return JSON.stringify(cellData);
|
|
5416
|
+
}
|
|
5417
|
+
return cellData;
|
|
5418
|
+
};
|
|
5371
5419
|
|
|
5372
5420
|
/** @param {string} key */
|
|
5373
5421
|
function toggleSortBy(key) {
|
|
@@ -5451,7 +5499,7 @@ function Table(props) {
|
|
|
5451
5499
|
class: "fjs-table-tr",
|
|
5452
5500
|
children: columnKeys.map(key => jsxRuntime.jsx("td", {
|
|
5453
5501
|
class: "fjs-table-td",
|
|
5454
|
-
children: row[key]
|
|
5502
|
+
children: serializeCellData(row[key])
|
|
5455
5503
|
}, key))
|
|
5456
5504
|
}, index))
|
|
5457
5505
|
})]
|
|
@@ -5487,7 +5535,7 @@ function Table(props) {
|
|
|
5487
5535
|
Table.config = {
|
|
5488
5536
|
type: type$1,
|
|
5489
5537
|
keyed: false,
|
|
5490
|
-
|
|
5538
|
+
name: 'Table',
|
|
5491
5539
|
group: 'presentation',
|
|
5492
5540
|
create: (options = {}) => {
|
|
5493
5541
|
const {
|
|
@@ -5516,6 +5564,7 @@ Table.config = {
|
|
|
5516
5564
|
}
|
|
5517
5565
|
return {
|
|
5518
5566
|
...remainingOptions,
|
|
5567
|
+
label: 'Table',
|
|
5519
5568
|
rowCount: 10,
|
|
5520
5569
|
columns: [{
|
|
5521
5570
|
label: 'ID',
|
|
@@ -5637,11 +5686,7 @@ function getHeaderAriaLabel(sortBy, key, label) {
|
|
|
5637
5686
|
return `Click to sort by ${label} ascending`;
|
|
5638
5687
|
}
|
|
5639
5688
|
|
|
5640
|
-
const FILE_PICKER_FILE_KEY_PREFIX = 'files::';
|
|
5641
|
-
|
|
5642
5689
|
const type = 'filepicker';
|
|
5643
|
-
const ids$1 = new Ids();
|
|
5644
|
-
const EMPTY_ARRAY$1 = [];
|
|
5645
5690
|
|
|
5646
5691
|
/**
|
|
5647
5692
|
* @typedef Props
|
|
@@ -5655,8 +5700,7 @@ const EMPTY_ARRAY$1 = [];
|
|
|
5655
5700
|
* @property {string} field.id
|
|
5656
5701
|
* @property {string} [field.label]
|
|
5657
5702
|
* @property {string} [field.accept]
|
|
5658
|
-
* @property {
|
|
5659
|
-
* @property {string} [value]
|
|
5703
|
+
* @property {boolean} [field.multiple]
|
|
5660
5704
|
*
|
|
5661
5705
|
* @param {Props} props
|
|
5662
5706
|
* @returns {import("preact").JSX.Element}
|
|
@@ -5664,8 +5708,9 @@ const EMPTY_ARRAY$1 = [];
|
|
|
5664
5708
|
function FilePicker(props) {
|
|
5665
5709
|
/** @type {import("preact/hooks").Ref<HTMLInputElement>} */
|
|
5666
5710
|
const fileInputRef = hooks.useRef(null);
|
|
5667
|
-
/** @type {import(
|
|
5668
|
-
const
|
|
5711
|
+
/** @type {[File[],import("preact/hooks").StateUpdater<File[]>]} */
|
|
5712
|
+
const [selectedFiles, setSelectedFiles] = hooks.useState([]);
|
|
5713
|
+
const eventBus = useService('eventBus');
|
|
5669
5714
|
const {
|
|
5670
5715
|
field,
|
|
5671
5716
|
onChange,
|
|
@@ -5673,59 +5718,33 @@ function FilePicker(props) {
|
|
|
5673
5718
|
errors = [],
|
|
5674
5719
|
disabled,
|
|
5675
5720
|
readonly,
|
|
5676
|
-
required
|
|
5677
|
-
value: filesKey = ''
|
|
5721
|
+
required
|
|
5678
5722
|
} = props;
|
|
5679
5723
|
const {
|
|
5680
5724
|
label,
|
|
5681
|
-
multiple =
|
|
5682
|
-
accept = ''
|
|
5725
|
+
multiple = '',
|
|
5726
|
+
accept = '',
|
|
5727
|
+
id
|
|
5683
5728
|
} = field;
|
|
5684
|
-
/** @type {string} */
|
|
5685
5729
|
const evaluatedAccept = useSingleLineTemplateEvaluation(accept);
|
|
5686
|
-
const evaluatedMultiple =
|
|
5730
|
+
const evaluatedMultiple = useSingleLineTemplateEvaluation(typeof multiple === 'string' ? multiple : multiple.toString()) === 'true';
|
|
5687
5731
|
const errorMessageId = `${domId}-error-message`;
|
|
5688
|
-
/** @type {File[]} */
|
|
5689
|
-
const selectedFiles = fileRegistry === null ? EMPTY_ARRAY$1 : fileRegistry.getFiles(filesKey);
|
|
5690
|
-
hooks.useEffect(() => {
|
|
5691
|
-
if (filesKey && fileRegistry !== null && !fileRegistry.hasKey(filesKey)) {
|
|
5692
|
-
onChange({
|
|
5693
|
-
value: null
|
|
5694
|
-
});
|
|
5695
|
-
}
|
|
5696
|
-
}, [fileRegistry, filesKey, onChange, selectedFiles.length]);
|
|
5697
5732
|
hooks.useEffect(() => {
|
|
5698
|
-
const
|
|
5699
|
-
|
|
5700
|
-
fileInputRef.current.files = data.files;
|
|
5701
|
-
}, [selectedFiles]);
|
|
5702
|
-
|
|
5703
|
-
/**
|
|
5704
|
-
* @type import("preact").JSX.GenericEventHandler<HTMLInputElement>
|
|
5705
|
-
*/
|
|
5706
|
-
const onFileChange = event => {
|
|
5707
|
-
const input = /** @type {HTMLInputElement} */event.target;
|
|
5708
|
-
|
|
5709
|
-
// if we have an associated file key but no files are selected, clear the file key and associated files
|
|
5710
|
-
if ((input.files === null || input.files.length === 0) && filesKey !== '') {
|
|
5711
|
-
fileRegistry.deleteFiles(filesKey);
|
|
5733
|
+
const reset = () => {
|
|
5734
|
+
setSelectedFiles([]);
|
|
5712
5735
|
onChange({
|
|
5713
5736
|
value: null
|
|
5714
5737
|
});
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
value: updatedFilesKey
|
|
5724
|
-
});
|
|
5725
|
-
};
|
|
5726
|
-
const isInputDisabled = disabled || readonly || fileRegistry === null;
|
|
5738
|
+
};
|
|
5739
|
+
eventBus.on('import.done', reset);
|
|
5740
|
+
eventBus.on('reset', reset);
|
|
5741
|
+
return () => {
|
|
5742
|
+
eventBus.off('import.done', reset);
|
|
5743
|
+
eventBus.off('reset', reset);
|
|
5744
|
+
};
|
|
5745
|
+
}, [eventBus, onChange]);
|
|
5727
5746
|
return jsxRuntime.jsxs("div", {
|
|
5728
|
-
|
|
5747
|
+
class: formFieldClasses(type, {
|
|
5729
5748
|
errors,
|
|
5730
5749
|
disabled,
|
|
5731
5750
|
readonly
|
|
@@ -5740,17 +5759,29 @@ function FilePicker(props) {
|
|
|
5740
5759
|
ref: fileInputRef,
|
|
5741
5760
|
id: domId,
|
|
5742
5761
|
name: domId,
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5762
|
+
multiple: evaluatedMultiple === false ? undefined : evaluatedMultiple,
|
|
5763
|
+
accept: evaluatedAccept === '' ? undefined : evaluatedAccept,
|
|
5764
|
+
onChange: event => {
|
|
5765
|
+
const input = /** @type {HTMLInputElement} */event.target;
|
|
5766
|
+
if (input.files === null || input.files.length === 0) {
|
|
5767
|
+
onChange({
|
|
5768
|
+
value: null
|
|
5769
|
+
});
|
|
5770
|
+
return;
|
|
5771
|
+
}
|
|
5772
|
+
const files = Array.from(input.files);
|
|
5773
|
+
onChange({
|
|
5774
|
+
value: `${id}_value_key`
|
|
5775
|
+
});
|
|
5776
|
+
setSelectedFiles(files);
|
|
5777
|
+
}
|
|
5747
5778
|
}), jsxRuntime.jsxs("div", {
|
|
5748
5779
|
className: "fjs-filepicker-container",
|
|
5749
5780
|
children: [jsxRuntime.jsx("button", {
|
|
5750
5781
|
type: "button",
|
|
5751
|
-
disabled:
|
|
5782
|
+
disabled: disabled,
|
|
5752
5783
|
readonly: readonly,
|
|
5753
|
-
|
|
5784
|
+
class: "fjs-button",
|
|
5754
5785
|
onClick: () => {
|
|
5755
5786
|
fileInputRef.current.click();
|
|
5756
5787
|
},
|
|
@@ -5771,6 +5802,11 @@ FilePicker.config = {
|
|
|
5771
5802
|
label: 'File picker',
|
|
5772
5803
|
group: 'basic-input',
|
|
5773
5804
|
emptyValue: null,
|
|
5805
|
+
sanitizeValue: ({
|
|
5806
|
+
value
|
|
5807
|
+
}) => {
|
|
5808
|
+
return value;
|
|
5809
|
+
},
|
|
5774
5810
|
create: (options = {}) => ({
|
|
5775
5811
|
...options
|
|
5776
5812
|
})
|
|
@@ -5949,7 +5985,7 @@ class FormFields {
|
|
|
5949
5985
|
}
|
|
5950
5986
|
}
|
|
5951
5987
|
|
|
5952
|
-
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'
|
|
5988
|
+
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'];
|
|
5953
5989
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url'];
|
|
5954
5990
|
|
|
5955
5991
|
/**
|
|
@@ -6167,21 +6203,11 @@ class ConditionChecker {
|
|
|
6167
6203
|
// if we have a hidden repeatable field, and the data structure allows, we clear it directly at the root and stop recursion
|
|
6168
6204
|
if (context.isHidden && isRepeatable) {
|
|
6169
6205
|
context.preventRecursion = true;
|
|
6170
|
-
this._eventBus.fire('conditionChecker.remove', {
|
|
6171
|
-
item: {
|
|
6172
|
-
[field.key]: minDash.get(workingData, getFilterPath(field, indexes))
|
|
6173
|
-
}
|
|
6174
|
-
});
|
|
6175
6206
|
this._cleanlyClearDataAtPath(getFilterPath(field, indexes), workingData);
|
|
6176
6207
|
}
|
|
6177
6208
|
|
|
6178
6209
|
// for simple leaf fields, we always clear
|
|
6179
6210
|
if (context.isHidden && isClosed) {
|
|
6180
|
-
this._eventBus.fire('conditionChecker.remove', {
|
|
6181
|
-
item: {
|
|
6182
|
-
[field.key]: minDash.get(workingData, getFilterPath(field, indexes))
|
|
6183
|
-
}
|
|
6184
|
-
});
|
|
6185
6211
|
this._cleanlyClearDataAtPath(getFilterPath(field, indexes), workingData);
|
|
6186
6212
|
}
|
|
6187
6213
|
});
|
|
@@ -6913,7 +6939,7 @@ const ViewerCommandsModule = {
|
|
|
6913
6939
|
};
|
|
6914
6940
|
|
|
6915
6941
|
var _path$3;
|
|
6916
|
-
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (
|
|
6942
|
+
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
6917
6943
|
var SvgExpand = function SvgExpand(props) {
|
|
6918
6944
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
6919
6945
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6927,7 +6953,7 @@ var SvgExpand = function SvgExpand(props) {
|
|
|
6927
6953
|
};
|
|
6928
6954
|
|
|
6929
6955
|
var _path$2;
|
|
6930
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
6956
|
+
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
6931
6957
|
var SvgCollapse = function SvgCollapse(props) {
|
|
6932
6958
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
6933
6959
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6941,7 +6967,7 @@ var SvgCollapse = function SvgCollapse(props) {
|
|
|
6941
6967
|
};
|
|
6942
6968
|
|
|
6943
6969
|
var _path$1, _path2;
|
|
6944
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
6970
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
6945
6971
|
var SvgAdd = function SvgAdd(props) {
|
|
6946
6972
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
6947
6973
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6958,7 +6984,7 @@ var SvgAdd = function SvgAdd(props) {
|
|
|
6958
6984
|
};
|
|
6959
6985
|
|
|
6960
6986
|
var _path;
|
|
6961
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
6987
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
6962
6988
|
var SvgDelete = function SvgDelete(props) {
|
|
6963
6989
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
6964
6990
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6975,16 +7001,11 @@ var SvgDelete = function SvgDelete(props) {
|
|
|
6975
7001
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
6976
7002
|
|
|
6977
7003
|
class RepeatRenderManager {
|
|
6978
|
-
constructor(form, formFields, formFieldRegistry, pathRegistry
|
|
7004
|
+
constructor(form, formFields, formFieldRegistry, pathRegistry) {
|
|
6979
7005
|
this._form = form;
|
|
6980
|
-
/** @type {import('../../render/FormFields').FormFields} */
|
|
6981
7006
|
this._formFields = formFields;
|
|
6982
|
-
/** @type {import('../../core/FormFieldRegistry').FormFieldRegistry} */
|
|
6983
7007
|
this._formFieldRegistry = formFieldRegistry;
|
|
6984
|
-
/** @type {import('../../core/PathRegistry').PathRegistry} */
|
|
6985
7008
|
this._pathRegistry = pathRegistry;
|
|
6986
|
-
/** @type {import('../../core/EventBus').EventBus} */
|
|
6987
|
-
this._eventBus = eventBus;
|
|
6988
7009
|
this.Repeater = this.Repeater.bind(this);
|
|
6989
7010
|
this.RepeatFooter = this.RepeatFooter.bind(this);
|
|
6990
7011
|
}
|
|
@@ -7024,18 +7045,11 @@ class RepeatRenderManager {
|
|
|
7024
7045
|
const isCollapsed = collapseEnabled && sharedRepeatState.isCollapsed;
|
|
7025
7046
|
const hasChildren = repeaterField.components && repeaterField.components.length > 0;
|
|
7026
7047
|
const showRemove = repeaterField.allowAddRemove && hasChildren;
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
* @param {number} index
|
|
7030
|
-
*/
|
|
7048
|
+
const displayValues = isCollapsed ? values.slice(0, nonCollapsedItems) : values;
|
|
7049
|
+
const hiddenValues = isCollapsed ? values.slice(nonCollapsedItems) : [];
|
|
7031
7050
|
const onDeleteItem = index => {
|
|
7032
7051
|
const updatedValues = values.slice();
|
|
7033
|
-
|
|
7034
|
-
this._eventBus.fire('repeatRenderManager.remove', {
|
|
7035
|
-
dataPath,
|
|
7036
|
-
index,
|
|
7037
|
-
item: removedItem
|
|
7038
|
-
});
|
|
7052
|
+
updatedValues.splice(index, 1);
|
|
7039
7053
|
props.onChange({
|
|
7040
7054
|
field: repeaterField,
|
|
7041
7055
|
value: updatedValues,
|
|
@@ -7043,13 +7057,21 @@ class RepeatRenderManager {
|
|
|
7043
7057
|
});
|
|
7044
7058
|
};
|
|
7045
7059
|
const parentExpressionContextInfo = hooks.useContext(LocalExpressionContext);
|
|
7046
|
-
return jsxRuntime.
|
|
7047
|
-
children:
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7060
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7061
|
+
children: [displayValues.map((itemValue, itemIndex) => jsxRuntime.jsx(RepetitionScaffold, {
|
|
7062
|
+
itemIndex: itemIndex,
|
|
7063
|
+
itemValue: itemValue,
|
|
7064
|
+
parentExpressionContextInfo: parentExpressionContextInfo,
|
|
7065
|
+
repeaterField: repeaterField,
|
|
7066
|
+
RowsRenderer: RowsRenderer,
|
|
7067
|
+
indexes: indexes,
|
|
7068
|
+
onDeleteItem: onDeleteItem,
|
|
7069
|
+
showRemove: showRemove,
|
|
7070
|
+
...restProps
|
|
7071
|
+
}, itemIndex)), hiddenValues.length > 0 ? jsxRuntime.jsx("div", {
|
|
7072
|
+
className: "fjs-repeat-row-collapsed",
|
|
7073
|
+
children: hiddenValues.map((itemValue, itemIndex) => jsxRuntime.jsx(RepetitionScaffold, {
|
|
7074
|
+
itemIndex: itemIndex + nonCollapsedItems,
|
|
7053
7075
|
itemValue: itemValue,
|
|
7054
7076
|
parentExpressionContextInfo: parentExpressionContextInfo,
|
|
7055
7077
|
repeaterField: repeaterField,
|
|
@@ -7058,8 +7080,8 @@ class RepeatRenderManager {
|
|
|
7058
7080
|
onDeleteItem: onDeleteItem,
|
|
7059
7081
|
showRemove: showRemove,
|
|
7060
7082
|
...restProps
|
|
7061
|
-
})
|
|
7062
|
-
})
|
|
7083
|
+
}, itemIndex))
|
|
7084
|
+
}) : null]
|
|
7063
7085
|
});
|
|
7064
7086
|
}
|
|
7065
7087
|
RepeatFooter(props) {
|
|
@@ -7102,11 +7124,6 @@ class RepeatRenderManager {
|
|
|
7102
7124
|
});
|
|
7103
7125
|
updatedValues.push(newItem);
|
|
7104
7126
|
shouldScroll.current = true;
|
|
7105
|
-
this._eventBus.fire('repeatRenderManager.add', {
|
|
7106
|
-
dataPath,
|
|
7107
|
-
index: updatedValues.length - 1,
|
|
7108
|
-
item: newItem
|
|
7109
|
-
});
|
|
7110
7127
|
props.onChange({
|
|
7111
7128
|
value: updatedValues
|
|
7112
7129
|
});
|
|
@@ -7139,7 +7156,7 @@ class RepeatRenderManager {
|
|
|
7139
7156
|
class: "fjs-repeat-render-collapse",
|
|
7140
7157
|
onClick: toggle,
|
|
7141
7158
|
children: isCollapsed ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7142
|
-
children: [jsxRuntime.jsx(SvgExpand, {}), " ", `Expand all (${values.length
|
|
7159
|
+
children: [jsxRuntime.jsx(SvgExpand, {}), " ", `Expand all (${values.length})`]
|
|
7143
7160
|
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
7144
7161
|
children: [jsxRuntime.jsx(SvgCollapse, {}), " ", 'Collapse']
|
|
7145
7162
|
})
|
|
@@ -7163,7 +7180,7 @@ class RepeatRenderManager {
|
|
|
7163
7180
|
* @param {Object} props.itemValue
|
|
7164
7181
|
* @param {Object} props.parentExpressionContextInfo
|
|
7165
7182
|
* @param {Object} props.repeaterField
|
|
7166
|
-
* @param {
|
|
7183
|
+
* @param {import('preact').FunctionComponent} props.RowsRenderer
|
|
7167
7184
|
* @param {Object} props.indexes
|
|
7168
7185
|
* @param {Function} props.onDeleteItem
|
|
7169
7186
|
* @param {boolean} props.showRemove
|
|
@@ -7224,7 +7241,7 @@ const RepetitionScaffold = props => {
|
|
|
7224
7241
|
})]
|
|
7225
7242
|
});
|
|
7226
7243
|
};
|
|
7227
|
-
RepeatRenderManager.$inject = ['form', 'formFields', 'formFieldRegistry', 'pathRegistry'
|
|
7244
|
+
RepeatRenderManager.$inject = ['form', 'formFields', 'formFieldRegistry', 'pathRegistry'];
|
|
7228
7245
|
|
|
7229
7246
|
const RepeatRenderModule = {
|
|
7230
7247
|
__init__: ['repeatRenderManager'],
|
|
@@ -8047,7 +8064,7 @@ class FieldFactory {
|
|
|
8047
8064
|
this._pathRegistry = pathRegistry;
|
|
8048
8065
|
this._formFields = formFields;
|
|
8049
8066
|
}
|
|
8050
|
-
create(attrs,
|
|
8067
|
+
create(attrs, isNewField = true) {
|
|
8051
8068
|
const {
|
|
8052
8069
|
id,
|
|
8053
8070
|
type,
|
|
@@ -8086,13 +8103,12 @@ class FieldFactory {
|
|
|
8086
8103
|
})) {
|
|
8087
8104
|
throw new Error(`binding path '${[...parentPath, ...path.split('.')].join('.')}' is already claimed`);
|
|
8088
8105
|
}
|
|
8089
|
-
const labelAttrs = applyDefaults && config.label ? {
|
|
8090
|
-
label: config.label
|
|
8091
|
-
} : {};
|
|
8092
8106
|
const field = config.create({
|
|
8093
|
-
...
|
|
8107
|
+
...(config.label ? {
|
|
8108
|
+
label: config.label
|
|
8109
|
+
} : {}),
|
|
8094
8110
|
...attrs
|
|
8095
|
-
});
|
|
8111
|
+
}, isNewField);
|
|
8096
8112
|
this._ensureId(field);
|
|
8097
8113
|
if (config.keyed) {
|
|
8098
8114
|
this._ensureKey(field);
|
|
@@ -8615,52 +8631,39 @@ class FormFieldInstanceRegistry {
|
|
|
8615
8631
|
this._formFieldInstances = {};
|
|
8616
8632
|
eventBus.on('form.clear', () => this.clear());
|
|
8617
8633
|
}
|
|
8618
|
-
|
|
8634
|
+
add(instance) {
|
|
8619
8635
|
const {
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
...restInfo
|
|
8629
|
-
};
|
|
8630
|
-
this._eventBus.fire('formFieldInstance.added', {
|
|
8631
|
-
instanceId
|
|
8632
|
-
});
|
|
8633
|
-
} else if (!isInstanceExpected && doesInstanceExist) {
|
|
8634
|
-
delete this._formFieldInstances[instanceId];
|
|
8635
|
-
this._eventBus.fire('formFieldInstance.removed', {
|
|
8636
|
-
instanceId
|
|
8637
|
-
});
|
|
8638
|
-
} else if (isInstanceExpected && doesInstanceExist) {
|
|
8639
|
-
const wasInstanceChaged = Object.keys(restInfo).some(key => {
|
|
8640
|
-
return this._formFieldInstances[instanceId][key] !== restInfo[key];
|
|
8641
|
-
});
|
|
8642
|
-
if (wasInstanceChaged) {
|
|
8643
|
-
this._formFieldInstances[instanceId] = {
|
|
8644
|
-
instanceId,
|
|
8645
|
-
...restInfo
|
|
8646
|
-
};
|
|
8647
|
-
this._eventBus.fire('formFieldInstance.changed', {
|
|
8648
|
-
instanceId
|
|
8649
|
-
});
|
|
8650
|
-
}
|
|
8636
|
+
id,
|
|
8637
|
+
expressionContextInfo,
|
|
8638
|
+
valuePath,
|
|
8639
|
+
indexes
|
|
8640
|
+
} = instance;
|
|
8641
|
+
const instanceId = [id, ...Object.values(indexes || {})].join('_');
|
|
8642
|
+
if (this._formFieldInstances[instanceId]) {
|
|
8643
|
+
throw new Error('this form field instance is already registered');
|
|
8651
8644
|
}
|
|
8645
|
+
this._formFieldInstances[instanceId] = {
|
|
8646
|
+
id,
|
|
8647
|
+
instanceId,
|
|
8648
|
+
expressionContextInfo,
|
|
8649
|
+
valuePath,
|
|
8650
|
+
indexes
|
|
8651
|
+
};
|
|
8652
|
+
this._eventBus.fire('formFieldInstanceRegistry.changed', {
|
|
8653
|
+
instanceId,
|
|
8654
|
+
action: 'added'
|
|
8655
|
+
});
|
|
8652
8656
|
return instanceId;
|
|
8653
8657
|
}
|
|
8654
|
-
|
|
8655
|
-
if (this._formFieldInstances[instanceId]) {
|
|
8656
|
-
|
|
8657
|
-
this._eventBus.fire('formFieldInstance.removed', {
|
|
8658
|
-
instanceId
|
|
8659
|
-
});
|
|
8658
|
+
remove(instanceId) {
|
|
8659
|
+
if (!this._formFieldInstances[instanceId]) {
|
|
8660
|
+
return;
|
|
8660
8661
|
}
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8662
|
+
delete this._formFieldInstances[instanceId];
|
|
8663
|
+
this._eventBus.fire('formFieldInstanceRegistry.changed', {
|
|
8664
|
+
instanceId,
|
|
8665
|
+
action: 'removed'
|
|
8666
|
+
});
|
|
8664
8667
|
}
|
|
8665
8668
|
getAll() {
|
|
8666
8669
|
return Object.values(this._formFieldInstances);
|
|
@@ -8740,122 +8743,10 @@ function Renderer(config, eventBus, form, injector) {
|
|
|
8740
8743
|
}
|
|
8741
8744
|
Renderer.$inject = ['config.renderer', 'eventBus', 'form', 'injector'];
|
|
8742
8745
|
|
|
8743
|
-
/**
|
|
8744
|
-
* @typedef {Record<PropertyKey, unknown>} RemovedData
|
|
8745
|
-
* @param {RemovedData} removedData
|
|
8746
|
-
* @returns {string[]}
|
|
8747
|
-
*/
|
|
8748
|
-
const extractFileReferencesFromRemovedData = removedData => {
|
|
8749
|
-
/** @type {string[]} */
|
|
8750
|
-
const fileReferences = [];
|
|
8751
|
-
if (removedData === null) {
|
|
8752
|
-
return fileReferences;
|
|
8753
|
-
}
|
|
8754
|
-
Object.values(removedData).forEach(value => {
|
|
8755
|
-
if (value === null) {
|
|
8756
|
-
return;
|
|
8757
|
-
}
|
|
8758
|
-
if (typeof value === 'object') {
|
|
8759
|
-
fileReferences.push(...extractFileReferencesFromRemovedData( /** @type {RemovedData} */value));
|
|
8760
|
-
} else if (Array.isArray(value)) {
|
|
8761
|
-
fileReferences.push(...value.map(extractFileReferencesFromRemovedData).flat());
|
|
8762
|
-
} else if (typeof value === 'string' && value.startsWith(FILE_PICKER_FILE_KEY_PREFIX)) {
|
|
8763
|
-
fileReferences.push(value);
|
|
8764
|
-
}
|
|
8765
|
-
});
|
|
8766
|
-
return fileReferences;
|
|
8767
|
-
};
|
|
8768
|
-
|
|
8769
|
-
const fileRegistry = Symbol('fileRegistry');
|
|
8770
|
-
const eventBusSymbol = Symbol('eventBus');
|
|
8771
|
-
const formFieldRegistrySymbol = Symbol('formFieldRegistry');
|
|
8772
|
-
const formFieldInstanceRegistrySymbol = Symbol('formFieldInstanceRegistry');
|
|
8773
|
-
const EMPTY_ARRAY = [];
|
|
8774
|
-
class FileRegistry {
|
|
8775
|
-
/**
|
|
8776
|
-
* @param {import('../core/EventBus').EventBus} eventBus
|
|
8777
|
-
* @param {import('../core/FormFieldRegistry').FormFieldRegistry} formFieldRegistry
|
|
8778
|
-
* @param {import('../core/FormFieldInstanceRegistry').FormFieldInstanceRegistry} formFieldInstanceRegistry
|
|
8779
|
-
*/
|
|
8780
|
-
constructor(eventBus, formFieldRegistry, formFieldInstanceRegistry) {
|
|
8781
|
-
/** @type {Map<string, File[]>} */
|
|
8782
|
-
this[fileRegistry] = new Map();
|
|
8783
|
-
/** @type {import('../core/EventBus').EventBus} */
|
|
8784
|
-
this[eventBusSymbol] = eventBus;
|
|
8785
|
-
/** @type {import('../core/FormFieldRegistry').FormFieldRegistry} */
|
|
8786
|
-
this[formFieldRegistrySymbol] = formFieldRegistry;
|
|
8787
|
-
/** @type {import('../core/FormFieldInstanceRegistry').FormFieldInstanceRegistry} */
|
|
8788
|
-
this[formFieldInstanceRegistrySymbol] = formFieldInstanceRegistry;
|
|
8789
|
-
const removeFileHandler = ({
|
|
8790
|
-
item
|
|
8791
|
-
}) => {
|
|
8792
|
-
const fileReferences = extractFileReferencesFromRemovedData(item);
|
|
8793
|
-
|
|
8794
|
-
// Remove all file references from the registry
|
|
8795
|
-
fileReferences.forEach(fileReference => {
|
|
8796
|
-
this.deleteFiles(fileReference);
|
|
8797
|
-
});
|
|
8798
|
-
};
|
|
8799
|
-
eventBus.on('form.clear', () => this.clear());
|
|
8800
|
-
eventBus.on('conditionChecker.remove', removeFileHandler);
|
|
8801
|
-
eventBus.on('repeatRenderManager.remove', removeFileHandler);
|
|
8802
|
-
}
|
|
8803
|
-
|
|
8804
|
-
/**
|
|
8805
|
-
* @param {string} id
|
|
8806
|
-
* @param {File[]} files
|
|
8807
|
-
*/
|
|
8808
|
-
setFiles(id, files) {
|
|
8809
|
-
this[fileRegistry].set(id, files);
|
|
8810
|
-
}
|
|
8811
|
-
|
|
8812
|
-
/**
|
|
8813
|
-
* @param {string} id
|
|
8814
|
-
* @returns {File[]}
|
|
8815
|
-
*/
|
|
8816
|
-
getFiles(id) {
|
|
8817
|
-
return this[fileRegistry].get(id) || EMPTY_ARRAY;
|
|
8818
|
-
}
|
|
8819
|
-
|
|
8820
|
-
/**
|
|
8821
|
-
* @returns {string[]}
|
|
8822
|
-
*/
|
|
8823
|
-
getKeys() {
|
|
8824
|
-
return Array.from(this[fileRegistry].keys());
|
|
8825
|
-
}
|
|
8826
|
-
|
|
8827
|
-
/**
|
|
8828
|
-
* @param {string} id
|
|
8829
|
-
* @returns {boolean}
|
|
8830
|
-
*/
|
|
8831
|
-
hasKey(id) {
|
|
8832
|
-
return this[fileRegistry].has(id);
|
|
8833
|
-
}
|
|
8834
|
-
|
|
8835
|
-
/**
|
|
8836
|
-
* @param {string} id
|
|
8837
|
-
*/
|
|
8838
|
-
deleteFiles(id) {
|
|
8839
|
-
this[fileRegistry].delete(id);
|
|
8840
|
-
}
|
|
8841
|
-
|
|
8842
|
-
/**
|
|
8843
|
-
* @returns {Map<string, File[]>}
|
|
8844
|
-
*/
|
|
8845
|
-
getAllFiles() {
|
|
8846
|
-
return new Map(this[fileRegistry]);
|
|
8847
|
-
}
|
|
8848
|
-
clear() {
|
|
8849
|
-
this[fileRegistry].clear();
|
|
8850
|
-
}
|
|
8851
|
-
}
|
|
8852
|
-
FileRegistry.$inject = ['eventBus', 'formFieldRegistry', 'formFieldInstanceRegistry'];
|
|
8853
|
-
|
|
8854
8746
|
const RenderModule = {
|
|
8855
8747
|
__init__: ['formFields', 'renderer'],
|
|
8856
8748
|
formFields: ['type', FormFields],
|
|
8857
|
-
renderer: ['type', Renderer]
|
|
8858
|
-
fileRegistry: ['type', FileRegistry]
|
|
8749
|
+
renderer: ['type', Renderer]
|
|
8859
8750
|
};
|
|
8860
8751
|
|
|
8861
8752
|
const CoreModule = {
|
|
@@ -9008,7 +8899,7 @@ class Form {
|
|
|
9008
8899
|
/**
|
|
9009
8900
|
* Submit the form, triggering all field validations.
|
|
9010
8901
|
*
|
|
9011
|
-
* @returns { { data: Data, errors: Errors
|
|
8902
|
+
* @returns { { data: Data, errors: Errors } }
|
|
9012
8903
|
*/
|
|
9013
8904
|
submit() {
|
|
9014
8905
|
const {
|
|
@@ -9020,11 +8911,9 @@ class Form {
|
|
|
9020
8911
|
this._emit('presubmit');
|
|
9021
8912
|
const data = this._getSubmitData();
|
|
9022
8913
|
const errors = this.validate();
|
|
9023
|
-
const files = this.get('fileRegistry').getAllFiles();
|
|
9024
8914
|
const result = {
|
|
9025
8915
|
data,
|
|
9026
|
-
errors
|
|
9027
|
-
files
|
|
8916
|
+
errors
|
|
9028
8917
|
};
|
|
9029
8918
|
this._emit('submit', result);
|
|
9030
8919
|
return result;
|
|
@@ -9343,7 +9232,7 @@ class Form {
|
|
|
9343
9232
|
}
|
|
9344
9233
|
}
|
|
9345
9234
|
|
|
9346
|
-
const schemaVersion =
|
|
9235
|
+
const schemaVersion = 17;
|
|
9347
9236
|
|
|
9348
9237
|
/**
|
|
9349
9238
|
* @typedef { import('./types').CreateFormOptions } CreateFormOptions
|