@bpmn-io/form-js-viewer 1.11.0-alpha.0 → 1.11.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/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 +202 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +202 -125
- package/dist/index.es.js.map +1 -1
- package/dist/types/core/FieldFactory.d.ts +1 -1
- 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/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/package.json +8 -8
package/dist/index.es.js
CHANGED
|
@@ -571,6 +571,18 @@ function gridColumnClasses(formField) {
|
|
|
571
571
|
// always fall back to top-down on smallest screens
|
|
572
572
|
'cds--col-sm-16', 'cds--col-md-16');
|
|
573
573
|
}
|
|
574
|
+
function textToLabel(text) {
|
|
575
|
+
if (typeof text != 'string') return null;
|
|
576
|
+
for (const line of text.split('\n')) {
|
|
577
|
+
const displayLine = line.trim();
|
|
578
|
+
|
|
579
|
+
// we use the first non-whitespace line in the text as label
|
|
580
|
+
if (displayLine !== '') {
|
|
581
|
+
return displayLine;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
574
586
|
function prefixId(id, formId, indexes) {
|
|
575
587
|
let result = 'fjs-form';
|
|
576
588
|
if (formId) {
|
|
@@ -883,6 +895,7 @@ function useExpressionEvaluation(value) {
|
|
|
883
895
|
* @returns {T} - Returns the current state.
|
|
884
896
|
*/
|
|
885
897
|
function useDeepCompareMemoize(value) {
|
|
898
|
+
/** @type {import("preact").RefObject<T>} */
|
|
886
899
|
const ref = useRef();
|
|
887
900
|
if (!isEqual(value, ref.current)) {
|
|
888
901
|
ref.current = value;
|
|
@@ -1706,9 +1719,10 @@ function Button(props) {
|
|
|
1706
1719
|
Button.config = {
|
|
1707
1720
|
type: type$i,
|
|
1708
1721
|
keyed: false,
|
|
1709
|
-
|
|
1722
|
+
name: 'Button',
|
|
1710
1723
|
group: 'action',
|
|
1711
1724
|
create: (options = {}) => ({
|
|
1725
|
+
label: 'Button',
|
|
1712
1726
|
action: 'submit',
|
|
1713
1727
|
...options
|
|
1714
1728
|
})
|
|
@@ -1816,11 +1830,9 @@ function Checkbox(props) {
|
|
|
1816
1830
|
}), {
|
|
1817
1831
|
'fjs-checked': value
|
|
1818
1832
|
}),
|
|
1819
|
-
children: [
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
required: required,
|
|
1823
|
-
children: jsx("input", {
|
|
1833
|
+
children: [jsxs("div", {
|
|
1834
|
+
class: "fjs-inline-label",
|
|
1835
|
+
children: [jsx("input", {
|
|
1824
1836
|
checked: value,
|
|
1825
1837
|
class: "fjs-input",
|
|
1826
1838
|
disabled: disabled,
|
|
@@ -1833,7 +1845,11 @@ function Checkbox(props) {
|
|
|
1833
1845
|
required: required,
|
|
1834
1846
|
"aria-invalid": errors.length > 0,
|
|
1835
1847
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1836
|
-
})
|
|
1848
|
+
}), jsx(Label, {
|
|
1849
|
+
htmlFor: domId,
|
|
1850
|
+
label: label,
|
|
1851
|
+
required: required
|
|
1852
|
+
})]
|
|
1837
1853
|
}), jsx(Description, {
|
|
1838
1854
|
id: descriptionId,
|
|
1839
1855
|
description: description
|
|
@@ -1846,13 +1862,14 @@ function Checkbox(props) {
|
|
|
1846
1862
|
Checkbox.config = {
|
|
1847
1863
|
type: type$h,
|
|
1848
1864
|
keyed: true,
|
|
1849
|
-
|
|
1865
|
+
name: 'Checkbox',
|
|
1850
1866
|
group: 'selection',
|
|
1851
1867
|
emptyValue: false,
|
|
1852
1868
|
sanitizeValue: ({
|
|
1853
1869
|
value
|
|
1854
1870
|
}) => value === true,
|
|
1855
1871
|
create: (options = {}) => ({
|
|
1872
|
+
label: 'Checkbox',
|
|
1856
1873
|
...options
|
|
1857
1874
|
})
|
|
1858
1875
|
};
|
|
@@ -1874,6 +1891,8 @@ function Checklist(props) {
|
|
|
1874
1891
|
label,
|
|
1875
1892
|
validate = {}
|
|
1876
1893
|
} = field;
|
|
1894
|
+
|
|
1895
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
1877
1896
|
const outerDivRef = useRef();
|
|
1878
1897
|
const {
|
|
1879
1898
|
required
|
|
@@ -1919,31 +1938,32 @@ function Checklist(props) {
|
|
|
1919
1938
|
children: [jsx(Label, {
|
|
1920
1939
|
label: label,
|
|
1921
1940
|
required: required
|
|
1922
|
-
}), loadState == LOAD_STATES.LOADED && options.map((
|
|
1941
|
+
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
1923
1942
|
const itemDomId = `${domId}-${index}`;
|
|
1924
|
-
const isChecked = hasEqualValue(
|
|
1925
|
-
return
|
|
1926
|
-
|
|
1927
|
-
label: o.label,
|
|
1928
|
-
class: classNames({
|
|
1943
|
+
const isChecked = hasEqualValue(option.value, values);
|
|
1944
|
+
return jsxs("div", {
|
|
1945
|
+
className: classNames('fjs-inline-label', {
|
|
1929
1946
|
'fjs-checked': isChecked
|
|
1930
1947
|
}),
|
|
1931
|
-
|
|
1932
|
-
children: jsx("input", {
|
|
1948
|
+
children: [jsx("input", {
|
|
1933
1949
|
checked: isChecked,
|
|
1934
1950
|
class: "fjs-input",
|
|
1935
1951
|
disabled: disabled,
|
|
1936
1952
|
readOnly: readonly,
|
|
1937
1953
|
id: itemDomId,
|
|
1938
1954
|
type: "checkbox",
|
|
1939
|
-
onClick: () => toggleCheckbox(
|
|
1955
|
+
onClick: () => toggleCheckbox(option.value),
|
|
1940
1956
|
onBlur: onCheckboxBlur,
|
|
1941
1957
|
onFocus: onCheckboxFocus,
|
|
1942
1958
|
required: required,
|
|
1943
1959
|
"aria-invalid": errors.length > 0,
|
|
1944
1960
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1945
|
-
})
|
|
1946
|
-
|
|
1961
|
+
}), jsx(Label, {
|
|
1962
|
+
htmlFor: itemDomId,
|
|
1963
|
+
label: option.label,
|
|
1964
|
+
required: false
|
|
1965
|
+
})]
|
|
1966
|
+
}, option.value);
|
|
1947
1967
|
}), jsx(Description, {
|
|
1948
1968
|
id: descriptionId,
|
|
1949
1969
|
description: description
|
|
@@ -1956,11 +1976,14 @@ function Checklist(props) {
|
|
|
1956
1976
|
Checklist.config = {
|
|
1957
1977
|
type: type$g,
|
|
1958
1978
|
keyed: true,
|
|
1959
|
-
|
|
1979
|
+
name: 'Checkbox group',
|
|
1960
1980
|
group: 'selection',
|
|
1961
1981
|
emptyValue: [],
|
|
1962
1982
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
1963
|
-
create:
|
|
1983
|
+
create: (options = {}) => ({
|
|
1984
|
+
label: 'Checkbox group',
|
|
1985
|
+
...createEmptyOptions(options)
|
|
1986
|
+
})
|
|
1964
1987
|
};
|
|
1965
1988
|
|
|
1966
1989
|
const noop$1 = () => false;
|
|
@@ -2052,7 +2075,7 @@ function FormField(props) {
|
|
|
2052
2075
|
}, [eventBus, viewerCommands]);
|
|
2053
2076
|
useEffect(() => {
|
|
2054
2077
|
const hasInitialValue = initialValue && !isEqual(initialValue, []);
|
|
2055
|
-
if (initialValidationTrigger && hasInitialValue) {
|
|
2078
|
+
if (initialValidationTrigger && hasInitialValue && fieldInstance) {
|
|
2056
2079
|
setInitialValidationTrigger(false);
|
|
2057
2080
|
viewerCommands.updateFieldInstanceValidation(fieldInstance, initialValue);
|
|
2058
2081
|
}
|
|
@@ -2266,11 +2289,12 @@ Default.config = {
|
|
|
2266
2289
|
create: (options = {}) => ({
|
|
2267
2290
|
components: [],
|
|
2268
2291
|
...options
|
|
2269
|
-
})
|
|
2292
|
+
}),
|
|
2293
|
+
getSubheading: field => field.id
|
|
2270
2294
|
};
|
|
2271
2295
|
|
|
2272
2296
|
var _path$x;
|
|
2273
|
-
function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (
|
|
2297
|
+
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); }
|
|
2274
2298
|
var SvgCalendar = function SvgCalendar(props) {
|
|
2275
2299
|
return /*#__PURE__*/React.createElement("svg", _extends$y({
|
|
2276
2300
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2406,7 +2430,11 @@ function Datepicker(props) {
|
|
|
2406
2430
|
readonly,
|
|
2407
2431
|
setDate
|
|
2408
2432
|
} = props;
|
|
2433
|
+
|
|
2434
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
2409
2435
|
const dateInputRef = useRef();
|
|
2436
|
+
|
|
2437
|
+
/** @type {import("preact").RefObject<HTMLElement>} */
|
|
2410
2438
|
const focusScopeRef = useRef();
|
|
2411
2439
|
const [flatpickrInstance, setFlatpickrInstance] = useState(null);
|
|
2412
2440
|
const [isInputDirty, setIsInputDirty] = useState(false);
|
|
@@ -2544,7 +2572,7 @@ function Datepicker(props) {
|
|
|
2544
2572
|
}
|
|
2545
2573
|
|
|
2546
2574
|
var _path$w, _path2$4;
|
|
2547
|
-
function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (
|
|
2575
|
+
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); }
|
|
2548
2576
|
var SvgClock = function SvgClock(props) {
|
|
2549
2577
|
return /*#__PURE__*/React.createElement("svg", _extends$x({
|
|
2550
2578
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2578,7 +2606,11 @@ function DropdownList(props) {
|
|
|
2578
2606
|
const [mouseControl, setMouseControl] = useState(false);
|
|
2579
2607
|
const [focusedValueIndex, setFocusedValueIndex] = useState(initialFocusIndex);
|
|
2580
2608
|
const [smoothScrolling, setSmoothScrolling] = useState(false);
|
|
2609
|
+
|
|
2610
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2581
2611
|
const dropdownContainer = useRef();
|
|
2612
|
+
|
|
2613
|
+
/** @type {import("preact").RefObject<{ x: number, y: number }>} */
|
|
2582
2614
|
const mouseScreenPos = useRef();
|
|
2583
2615
|
const focusedItem = useMemo(() => values.length ? values[focusedValueIndex] : null, [focusedValueIndex, values]);
|
|
2584
2616
|
const changeFocusedValueIndex = useCallback(delta => {
|
|
@@ -2796,7 +2828,7 @@ function Timepicker(props) {
|
|
|
2796
2828
|
value: rawValue,
|
|
2797
2829
|
disabled: disabled,
|
|
2798
2830
|
readOnly: readonly,
|
|
2799
|
-
placeholder: use24h ? 'hh:mm' : 'hh:mm
|
|
2831
|
+
placeholder: use24h ? 'hh:mm' : 'hh:mm --',
|
|
2800
2832
|
autoComplete: "off",
|
|
2801
2833
|
onInput: e => {
|
|
2802
2834
|
// @ts-expect-error
|
|
@@ -2852,6 +2884,8 @@ function Datetime(props) {
|
|
|
2852
2884
|
const {
|
|
2853
2885
|
formId
|
|
2854
2886
|
} = useContext(FormContext);
|
|
2887
|
+
|
|
2888
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2855
2889
|
const dateTimeGroupRef = useRef();
|
|
2856
2890
|
const [dateTime, setDateTime] = useState(getNullDateTime());
|
|
2857
2891
|
const [dateTimeUpdateRequest, setDateTimeUpdateRequest] = useState(null);
|
|
@@ -3017,18 +3051,23 @@ function Datetime(props) {
|
|
|
3017
3051
|
Datetime.config = {
|
|
3018
3052
|
type: type$f,
|
|
3019
3053
|
keyed: true,
|
|
3020
|
-
|
|
3054
|
+
name: 'Date time',
|
|
3021
3055
|
group: 'basic-input',
|
|
3022
3056
|
emptyValue: null,
|
|
3023
3057
|
sanitizeValue: sanitizeDateTimePickerValue,
|
|
3024
|
-
create: (options = {}) => {
|
|
3058
|
+
create: (options = {}, isNewField) => {
|
|
3025
3059
|
const defaults = {};
|
|
3026
3060
|
set(defaults, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES.DATE);
|
|
3027
|
-
|
|
3061
|
+
if (isNewField) {
|
|
3062
|
+
set(defaults, DATE_LABEL_PATH, 'Date');
|
|
3063
|
+
}
|
|
3028
3064
|
return {
|
|
3029
3065
|
...defaults,
|
|
3030
3066
|
...options
|
|
3031
3067
|
};
|
|
3068
|
+
},
|
|
3069
|
+
getSubheading: field => {
|
|
3070
|
+
return field.dateLabel || field.timeLabel;
|
|
3032
3071
|
}
|
|
3033
3072
|
};
|
|
3034
3073
|
|
|
@@ -3066,9 +3105,10 @@ function Group(props) {
|
|
|
3066
3105
|
Group.config = {
|
|
3067
3106
|
type: 'group',
|
|
3068
3107
|
pathed: true,
|
|
3069
|
-
|
|
3108
|
+
name: 'Group',
|
|
3070
3109
|
group: 'container',
|
|
3071
3110
|
create: (options = {}) => ({
|
|
3111
|
+
label: 'Group',
|
|
3072
3112
|
components: [],
|
|
3073
3113
|
showOutline: true,
|
|
3074
3114
|
...options
|
|
@@ -3142,9 +3182,10 @@ function IFramePlaceholder(props) {
|
|
|
3142
3182
|
IFrame.config = {
|
|
3143
3183
|
type: type$e,
|
|
3144
3184
|
keyed: false,
|
|
3145
|
-
|
|
3185
|
+
name: 'iFrame',
|
|
3146
3186
|
group: 'container',
|
|
3147
3187
|
create: (options = {}) => ({
|
|
3188
|
+
label: 'iFrame',
|
|
3148
3189
|
security: {
|
|
3149
3190
|
allowScripts: true
|
|
3150
3191
|
},
|
|
@@ -3153,7 +3194,7 @@ IFrame.config = {
|
|
|
3153
3194
|
};
|
|
3154
3195
|
|
|
3155
3196
|
var _path$v;
|
|
3156
|
-
function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (
|
|
3197
|
+
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); }
|
|
3157
3198
|
var SvgButton = function SvgButton(props) {
|
|
3158
3199
|
return /*#__PURE__*/React.createElement("svg", _extends$w({
|
|
3159
3200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3167,7 +3208,7 @@ var SvgButton = function SvgButton(props) {
|
|
|
3167
3208
|
};
|
|
3168
3209
|
|
|
3169
3210
|
var _path$u;
|
|
3170
|
-
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (
|
|
3211
|
+
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); }
|
|
3171
3212
|
var SvgCheckbox = function SvgCheckbox(props) {
|
|
3172
3213
|
return /*#__PURE__*/React.createElement("svg", _extends$v({
|
|
3173
3214
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3180,7 +3221,7 @@ var SvgCheckbox = function SvgCheckbox(props) {
|
|
|
3180
3221
|
};
|
|
3181
3222
|
|
|
3182
3223
|
var _path$t;
|
|
3183
|
-
function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (
|
|
3224
|
+
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); }
|
|
3184
3225
|
var SvgChecklist = function SvgChecklist(props) {
|
|
3185
3226
|
return /*#__PURE__*/React.createElement("svg", _extends$u({
|
|
3186
3227
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3196,7 +3237,7 @@ var SvgChecklist = function SvgChecklist(props) {
|
|
|
3196
3237
|
};
|
|
3197
3238
|
|
|
3198
3239
|
var _path$s, _path2$3, _path3;
|
|
3199
|
-
function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (
|
|
3240
|
+
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); }
|
|
3200
3241
|
var SvgDatetime = function SvgDatetime(props) {
|
|
3201
3242
|
return /*#__PURE__*/React.createElement("svg", _extends$t({
|
|
3202
3243
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3215,7 +3256,7 @@ var SvgDatetime = function SvgDatetime(props) {
|
|
|
3215
3256
|
};
|
|
3216
3257
|
|
|
3217
3258
|
var _path$r, _path2$2;
|
|
3218
|
-
function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (
|
|
3259
|
+
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); }
|
|
3219
3260
|
var SvgTaglist = function SvgTaglist(props) {
|
|
3220
3261
|
return /*#__PURE__*/React.createElement("svg", _extends$s({
|
|
3221
3262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3231,7 +3272,7 @@ var SvgTaglist = function SvgTaglist(props) {
|
|
|
3231
3272
|
};
|
|
3232
3273
|
|
|
3233
3274
|
var _rect, _rect2, _rect3;
|
|
3234
|
-
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (
|
|
3275
|
+
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); }
|
|
3235
3276
|
var SvgForm = function SvgForm(props) {
|
|
3236
3277
|
return /*#__PURE__*/React.createElement("svg", _extends$r({
|
|
3237
3278
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3259,7 +3300,7 @@ var SvgForm = function SvgForm(props) {
|
|
|
3259
3300
|
};
|
|
3260
3301
|
|
|
3261
3302
|
var _path$q;
|
|
3262
|
-
function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (
|
|
3303
|
+
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); }
|
|
3263
3304
|
var SvgGroup = function SvgGroup(props) {
|
|
3264
3305
|
return /*#__PURE__*/React.createElement("svg", _extends$q({
|
|
3265
3306
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3275,7 +3316,7 @@ var SvgGroup = function SvgGroup(props) {
|
|
|
3275
3316
|
};
|
|
3276
3317
|
|
|
3277
3318
|
var _path$p;
|
|
3278
|
-
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (
|
|
3319
|
+
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); }
|
|
3279
3320
|
var SvgNumber = function SvgNumber(props) {
|
|
3280
3321
|
return /*#__PURE__*/React.createElement("svg", _extends$p({
|
|
3281
3322
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3289,7 +3330,7 @@ var SvgNumber = function SvgNumber(props) {
|
|
|
3289
3330
|
};
|
|
3290
3331
|
|
|
3291
3332
|
var _path$o;
|
|
3292
|
-
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (
|
|
3333
|
+
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); }
|
|
3293
3334
|
var SvgRadio = function SvgRadio(props) {
|
|
3294
3335
|
return /*#__PURE__*/React.createElement("svg", _extends$o({
|
|
3295
3336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3302,7 +3343,7 @@ var SvgRadio = function SvgRadio(props) {
|
|
|
3302
3343
|
};
|
|
3303
3344
|
|
|
3304
3345
|
var _path$n;
|
|
3305
|
-
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (
|
|
3346
|
+
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); }
|
|
3306
3347
|
var SvgSelect = function SvgSelect(props) {
|
|
3307
3348
|
return /*#__PURE__*/React.createElement("svg", _extends$n({
|
|
3308
3349
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3316,7 +3357,7 @@ var SvgSelect = function SvgSelect(props) {
|
|
|
3316
3357
|
};
|
|
3317
3358
|
|
|
3318
3359
|
var _path$m;
|
|
3319
|
-
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (
|
|
3360
|
+
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); }
|
|
3320
3361
|
var SvgSeparator = function SvgSeparator(props) {
|
|
3321
3362
|
return /*#__PURE__*/React.createElement("svg", _extends$m({
|
|
3322
3363
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3330,7 +3371,7 @@ var SvgSeparator = function SvgSeparator(props) {
|
|
|
3330
3371
|
};
|
|
3331
3372
|
|
|
3332
3373
|
var _path$l;
|
|
3333
|
-
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (
|
|
3374
|
+
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); }
|
|
3334
3375
|
var SvgSpacer = function SvgSpacer(props) {
|
|
3335
3376
|
return /*#__PURE__*/React.createElement("svg", _extends$l({
|
|
3336
3377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3344,7 +3385,7 @@ var SvgSpacer = function SvgSpacer(props) {
|
|
|
3344
3385
|
};
|
|
3345
3386
|
|
|
3346
3387
|
var _path$k;
|
|
3347
|
-
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (
|
|
3388
|
+
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); }
|
|
3348
3389
|
var SvgDynamicList = function SvgDynamicList(props) {
|
|
3349
3390
|
return /*#__PURE__*/React.createElement("svg", _extends$k({
|
|
3350
3391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3360,7 +3401,7 @@ var SvgDynamicList = function SvgDynamicList(props) {
|
|
|
3360
3401
|
};
|
|
3361
3402
|
|
|
3362
3403
|
var _path$j;
|
|
3363
|
-
function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (
|
|
3404
|
+
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); }
|
|
3364
3405
|
var SvgText = function SvgText(props) {
|
|
3365
3406
|
return /*#__PURE__*/React.createElement("svg", _extends$j({
|
|
3366
3407
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3373,7 +3414,7 @@ var SvgText = function SvgText(props) {
|
|
|
3373
3414
|
};
|
|
3374
3415
|
|
|
3375
3416
|
var _path$i;
|
|
3376
|
-
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (
|
|
3417
|
+
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); }
|
|
3377
3418
|
var SvgHtml = function SvgHtml(props) {
|
|
3378
3419
|
return /*#__PURE__*/React.createElement("svg", _extends$i({
|
|
3379
3420
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3389,7 +3430,7 @@ var SvgHtml = function SvgHtml(props) {
|
|
|
3389
3430
|
};
|
|
3390
3431
|
|
|
3391
3432
|
var _path$h;
|
|
3392
|
-
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (
|
|
3433
|
+
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); }
|
|
3393
3434
|
var SvgExpressionField = function SvgExpressionField(props) {
|
|
3394
3435
|
return /*#__PURE__*/React.createElement("svg", _extends$h({
|
|
3395
3436
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3405,7 +3446,7 @@ var SvgExpressionField = function SvgExpressionField(props) {
|
|
|
3405
3446
|
};
|
|
3406
3447
|
|
|
3407
3448
|
var _path$g;
|
|
3408
|
-
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (
|
|
3449
|
+
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); }
|
|
3409
3450
|
var SvgTextfield = function SvgTextfield(props) {
|
|
3410
3451
|
return /*#__PURE__*/React.createElement("svg", _extends$g({
|
|
3411
3452
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3419,7 +3460,7 @@ var SvgTextfield = function SvgTextfield(props) {
|
|
|
3419
3460
|
};
|
|
3420
3461
|
|
|
3421
3462
|
var _path$f;
|
|
3422
|
-
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (
|
|
3463
|
+
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); }
|
|
3423
3464
|
var SvgTextarea = function SvgTextarea(props) {
|
|
3424
3465
|
return /*#__PURE__*/React.createElement("svg", _extends$f({
|
|
3425
3466
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3433,7 +3474,7 @@ var SvgTextarea = function SvgTextarea(props) {
|
|
|
3433
3474
|
};
|
|
3434
3475
|
|
|
3435
3476
|
var _path$e;
|
|
3436
|
-
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (
|
|
3477
|
+
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); }
|
|
3437
3478
|
var SvgIFrame = function SvgIFrame(props) {
|
|
3438
3479
|
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
3439
3480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3449,7 +3490,7 @@ var SvgIFrame = function SvgIFrame(props) {
|
|
|
3449
3490
|
};
|
|
3450
3491
|
|
|
3451
3492
|
var _path$d, _path2$1;
|
|
3452
|
-
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (
|
|
3493
|
+
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); }
|
|
3453
3494
|
var SvgImage = function SvgImage(props) {
|
|
3454
3495
|
return /*#__PURE__*/React.createElement("svg", _extends$d({
|
|
3455
3496
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3468,7 +3509,7 @@ var SvgImage = function SvgImage(props) {
|
|
|
3468
3509
|
};
|
|
3469
3510
|
|
|
3470
3511
|
var _path$c;
|
|
3471
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (
|
|
3512
|
+
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); }
|
|
3472
3513
|
var SvgTable = function SvgTable(props) {
|
|
3473
3514
|
return /*#__PURE__*/React.createElement("svg", _extends$c({
|
|
3474
3515
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3483,7 +3524,7 @@ var SvgTable = function SvgTable(props) {
|
|
|
3483
3524
|
};
|
|
3484
3525
|
|
|
3485
3526
|
var _path$b;
|
|
3486
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (
|
|
3527
|
+
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); }
|
|
3487
3528
|
var SvgFilePicker = function SvgFilePicker(props) {
|
|
3488
3529
|
return /*#__PURE__*/React.createElement("svg", _extends$b({
|
|
3489
3530
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3574,11 +3615,10 @@ function Image(props) {
|
|
|
3574
3615
|
Image.config = {
|
|
3575
3616
|
type: type$d,
|
|
3576
3617
|
keyed: false,
|
|
3577
|
-
|
|
3618
|
+
name: 'Image view',
|
|
3578
3619
|
group: 'presentation',
|
|
3579
|
-
create: (options = {}) =>
|
|
3580
|
-
|
|
3581
|
-
})
|
|
3620
|
+
create: (options = {}) => options,
|
|
3621
|
+
getSubheading: field => field.alt
|
|
3582
3622
|
};
|
|
3583
3623
|
|
|
3584
3624
|
function TemplatedInputAdorner(props) {
|
|
@@ -3600,7 +3640,7 @@ function TemplatedInputAdorner(props) {
|
|
|
3600
3640
|
}
|
|
3601
3641
|
|
|
3602
3642
|
var _path$a;
|
|
3603
|
-
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (
|
|
3643
|
+
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); }
|
|
3604
3644
|
var SvgAngelDown = function SvgAngelDown(props) {
|
|
3605
3645
|
return /*#__PURE__*/React.createElement("svg", _extends$a({
|
|
3606
3646
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3617,7 +3657,7 @@ var SvgAngelDown = function SvgAngelDown(props) {
|
|
|
3617
3657
|
};
|
|
3618
3658
|
|
|
3619
3659
|
var _path$9;
|
|
3620
|
-
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (
|
|
3660
|
+
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); }
|
|
3621
3661
|
var SvgAngelUp = function SvgAngelUp(props) {
|
|
3622
3662
|
return /*#__PURE__*/React.createElement("svg", _extends$9({
|
|
3623
3663
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3689,6 +3729,8 @@ function Numberfield(props) {
|
|
|
3689
3729
|
const {
|
|
3690
3730
|
required
|
|
3691
3731
|
} = validate;
|
|
3732
|
+
|
|
3733
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
3692
3734
|
const inputRef = useRef();
|
|
3693
3735
|
const [cachedValue, setCachedValue] = useState(value);
|
|
3694
3736
|
const [displayValue, setDisplayValue] = useState(value);
|
|
@@ -3885,7 +3927,7 @@ function Numberfield(props) {
|
|
|
3885
3927
|
Numberfield.config = {
|
|
3886
3928
|
type: type$c,
|
|
3887
3929
|
keyed: true,
|
|
3888
|
-
|
|
3930
|
+
name: 'Number',
|
|
3889
3931
|
group: 'basic-input',
|
|
3890
3932
|
emptyValue: null,
|
|
3891
3933
|
sanitizeValue: ({
|
|
@@ -3899,6 +3941,7 @@ Numberfield.config = {
|
|
|
3899
3941
|
return formField.serializeToString ? value.toString() : Number(value);
|
|
3900
3942
|
},
|
|
3901
3943
|
create: (options = {}) => ({
|
|
3944
|
+
label: 'Number',
|
|
3902
3945
|
...options
|
|
3903
3946
|
})
|
|
3904
3947
|
};
|
|
@@ -3920,6 +3963,8 @@ function Radio(props) {
|
|
|
3920
3963
|
label,
|
|
3921
3964
|
validate = {}
|
|
3922
3965
|
} = field;
|
|
3966
|
+
|
|
3967
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
3923
3968
|
const outerDivRef = useRef();
|
|
3924
3969
|
const {
|
|
3925
3970
|
required
|
|
@@ -3967,18 +4012,16 @@ function Radio(props) {
|
|
|
3967
4012
|
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
3968
4013
|
const itemDomId = `${domId}-${index}`;
|
|
3969
4014
|
const isChecked = isEqual(option.value, value);
|
|
3970
|
-
return
|
|
3971
|
-
|
|
3972
|
-
label: option.label,
|
|
3973
|
-
class: classNames({
|
|
4015
|
+
return jsxs("div", {
|
|
4016
|
+
className: classNames('fjs-inline-label', {
|
|
3974
4017
|
'fjs-checked': isChecked
|
|
3975
4018
|
}),
|
|
3976
|
-
|
|
3977
|
-
children: jsx("input", {
|
|
4019
|
+
children: [jsx("input", {
|
|
3978
4020
|
checked: isChecked,
|
|
3979
4021
|
class: "fjs-input",
|
|
3980
4022
|
disabled: disabled,
|
|
3981
4023
|
readOnly: readonly,
|
|
4024
|
+
name: domId,
|
|
3982
4025
|
id: itemDomId,
|
|
3983
4026
|
type: "radio",
|
|
3984
4027
|
onClick: () => onChange(option.value),
|
|
@@ -3987,8 +4030,15 @@ function Radio(props) {
|
|
|
3987
4030
|
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
3988
4031
|
required: required,
|
|
3989
4032
|
"aria-invalid": errors.length > 0
|
|
3990
|
-
})
|
|
3991
|
-
|
|
4033
|
+
}), jsx(Label, {
|
|
4034
|
+
htmlFor: itemDomId,
|
|
4035
|
+
label: option.label,
|
|
4036
|
+
class: classNames({
|
|
4037
|
+
'fjs-checked': isChecked
|
|
4038
|
+
}),
|
|
4039
|
+
required: false
|
|
4040
|
+
})]
|
|
4041
|
+
}, option.value);
|
|
3992
4042
|
}), jsx(Description, {
|
|
3993
4043
|
id: descriptionId,
|
|
3994
4044
|
description: description
|
|
@@ -4001,15 +4051,18 @@ function Radio(props) {
|
|
|
4001
4051
|
Radio.config = {
|
|
4002
4052
|
type: type$b,
|
|
4003
4053
|
keyed: true,
|
|
4004
|
-
|
|
4054
|
+
name: 'Radio group',
|
|
4005
4055
|
group: 'selection',
|
|
4006
4056
|
emptyValue: null,
|
|
4007
4057
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4008
|
-
create:
|
|
4058
|
+
create: (options = {}) => ({
|
|
4059
|
+
label: 'Radio group',
|
|
4060
|
+
...createEmptyOptions(options)
|
|
4061
|
+
})
|
|
4009
4062
|
};
|
|
4010
4063
|
|
|
4011
4064
|
var _path$8;
|
|
4012
|
-
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (
|
|
4065
|
+
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); }
|
|
4013
4066
|
var SvgXMark = function SvgXMark(props) {
|
|
4014
4067
|
return /*#__PURE__*/React.createElement("svg", _extends$8({
|
|
4015
4068
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4040,6 +4093,8 @@ function SearchableSelect(props) {
|
|
|
4040
4093
|
const [isDropdownExpanded, setIsDropdownExpanded] = useState(false);
|
|
4041
4094
|
const [isFilterActive, setIsFilterActive] = useState(true);
|
|
4042
4095
|
const [isEscapeClosed, setIsEscapeClose] = useState(false);
|
|
4096
|
+
|
|
4097
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4043
4098
|
const searchbarRef = useRef();
|
|
4044
4099
|
const eventBus = useService('eventBus');
|
|
4045
4100
|
const {
|
|
@@ -4067,9 +4122,9 @@ function SearchableSelect(props) {
|
|
|
4067
4122
|
if (!filter || !isFilterActive) {
|
|
4068
4123
|
return options;
|
|
4069
4124
|
}
|
|
4070
|
-
return options.filter(
|
|
4125
|
+
return options.filter(option => option.label && option.value && option.label.toLowerCase().includes(filter.toLowerCase()));
|
|
4071
4126
|
}, [filter, loadState, options, isFilterActive]);
|
|
4072
|
-
const
|
|
4127
|
+
const pickOption = useCallback(option => {
|
|
4073
4128
|
setFilter(option && option.label || '');
|
|
4074
4129
|
props.onChange({
|
|
4075
4130
|
value: option && option.value || null
|
|
@@ -4167,7 +4222,7 @@ function SearchableSelect(props) {
|
|
|
4167
4222
|
}), displayState.displayCross && jsxs("span", {
|
|
4168
4223
|
class: "fjs-select-cross",
|
|
4169
4224
|
onMouseDown: e => {
|
|
4170
|
-
|
|
4225
|
+
pickOption(null);
|
|
4171
4226
|
e.preventDefault();
|
|
4172
4227
|
},
|
|
4173
4228
|
children: [jsx(SvgXMark, {}), ' ']
|
|
@@ -4180,9 +4235,9 @@ function SearchableSelect(props) {
|
|
|
4180
4235
|
class: "fjs-select-anchor",
|
|
4181
4236
|
children: displayState.displayDropdown && jsx(DropdownList, {
|
|
4182
4237
|
values: filteredOptions,
|
|
4183
|
-
getLabel:
|
|
4184
|
-
onValueSelected:
|
|
4185
|
-
|
|
4238
|
+
getLabel: option => option.label,
|
|
4239
|
+
onValueSelected: option => {
|
|
4240
|
+
pickOption(option);
|
|
4186
4241
|
setIsDropdownExpanded(false);
|
|
4187
4242
|
},
|
|
4188
4243
|
listenerElement: searchbarRef.current
|
|
@@ -4204,6 +4259,8 @@ function SimpleSelect(props) {
|
|
|
4204
4259
|
} = props;
|
|
4205
4260
|
const [isDropdownExpanded, setIsDropdownExpanded] = useState(false);
|
|
4206
4261
|
const selectRef = useRef();
|
|
4262
|
+
|
|
4263
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4207
4264
|
const inputRef = useRef();
|
|
4208
4265
|
const {
|
|
4209
4266
|
loadState,
|
|
@@ -4218,7 +4275,7 @@ function SimpleSelect(props) {
|
|
|
4218
4275
|
});
|
|
4219
4276
|
const getLabelCorrelation = useGetLabelCorrelation(options);
|
|
4220
4277
|
const valueLabel = useMemo(() => value && getLabelCorrelation(value), [value, getLabelCorrelation]);
|
|
4221
|
-
const
|
|
4278
|
+
const pickOption = useCallback(option => {
|
|
4222
4279
|
props.onChange({
|
|
4223
4280
|
value: option && option.value || null
|
|
4224
4281
|
});
|
|
@@ -4243,7 +4300,7 @@ function SimpleSelect(props) {
|
|
|
4243
4300
|
}
|
|
4244
4301
|
e.preventDefault();
|
|
4245
4302
|
}, [disabled, isDropdownExpanded]);
|
|
4246
|
-
const initialFocusIndex = useMemo(() => value && findIndex(options,
|
|
4303
|
+
const initialFocusIndex = useMemo(() => value && findIndex(options, option => option.value === value) || 0, [options, value]);
|
|
4247
4304
|
const onInputFocus = useCallback(() => {
|
|
4248
4305
|
if (!readonly) {
|
|
4249
4306
|
setIsDropdownExpanded(true);
|
|
@@ -4285,7 +4342,7 @@ function SimpleSelect(props) {
|
|
|
4285
4342
|
}), displayState.displayCross && jsx("span", {
|
|
4286
4343
|
class: "fjs-select-cross",
|
|
4287
4344
|
onMouseDown: e => {
|
|
4288
|
-
|
|
4345
|
+
pickOption(null);
|
|
4289
4346
|
e.stopPropagation();
|
|
4290
4347
|
},
|
|
4291
4348
|
children: jsx(SvgXMark, {})
|
|
@@ -4297,10 +4354,10 @@ function SimpleSelect(props) {
|
|
|
4297
4354
|
class: "fjs-select-anchor",
|
|
4298
4355
|
children: displayState.displayDropdown && jsx(DropdownList, {
|
|
4299
4356
|
values: options,
|
|
4300
|
-
getLabel:
|
|
4357
|
+
getLabel: option => option.label,
|
|
4301
4358
|
initialFocusIndex: initialFocusIndex,
|
|
4302
|
-
onValueSelected:
|
|
4303
|
-
|
|
4359
|
+
onValueSelected: option => {
|
|
4360
|
+
pickOption(option);
|
|
4304
4361
|
setIsDropdownExpanded(false);
|
|
4305
4362
|
},
|
|
4306
4363
|
listenerElement: selectRef.current
|
|
@@ -4379,11 +4436,14 @@ function Select(props) {
|
|
|
4379
4436
|
Select.config = {
|
|
4380
4437
|
type: type$a,
|
|
4381
4438
|
keyed: true,
|
|
4382
|
-
|
|
4439
|
+
name: 'Select',
|
|
4383
4440
|
group: 'selection',
|
|
4384
4441
|
emptyValue: null,
|
|
4385
4442
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4386
|
-
create:
|
|
4443
|
+
create: (options = {}) => ({
|
|
4444
|
+
label: 'Select',
|
|
4445
|
+
...createEmptyOptions(options)
|
|
4446
|
+
})
|
|
4387
4447
|
};
|
|
4388
4448
|
|
|
4389
4449
|
const type$9 = 'separator';
|
|
@@ -4396,7 +4456,7 @@ function Separator() {
|
|
|
4396
4456
|
Separator.config = {
|
|
4397
4457
|
type: type$9,
|
|
4398
4458
|
keyed: false,
|
|
4399
|
-
|
|
4459
|
+
name: 'Separator',
|
|
4400
4460
|
group: 'presentation',
|
|
4401
4461
|
create: (options = {}) => ({
|
|
4402
4462
|
...options
|
|
@@ -4421,7 +4481,7 @@ function Spacer(props) {
|
|
|
4421
4481
|
Spacer.config = {
|
|
4422
4482
|
type: type$8,
|
|
4423
4483
|
keyed: false,
|
|
4424
|
-
|
|
4484
|
+
name: 'Spacer',
|
|
4425
4485
|
group: 'presentation',
|
|
4426
4486
|
create: (options = {}) => ({
|
|
4427
4487
|
height: 60,
|
|
@@ -4467,9 +4527,10 @@ DynamicList.config = {
|
|
|
4467
4527
|
type: 'dynamiclist',
|
|
4468
4528
|
pathed: true,
|
|
4469
4529
|
repeatable: true,
|
|
4470
|
-
|
|
4530
|
+
name: 'Dynamic list',
|
|
4471
4531
|
group: 'container',
|
|
4472
4532
|
create: (options = {}) => ({
|
|
4533
|
+
label: 'Dynamic list',
|
|
4473
4534
|
components: [],
|
|
4474
4535
|
showOutline: true,
|
|
4475
4536
|
isRepeating: true,
|
|
@@ -4523,7 +4584,11 @@ function Taglist(props) {
|
|
|
4523
4584
|
const [filter, setFilter] = useState('');
|
|
4524
4585
|
const [isDropdownExpanded, setIsDropdownExpanded] = useState(false);
|
|
4525
4586
|
const [isEscapeClosed, setIsEscapeClose] = useState(false);
|
|
4587
|
+
|
|
4588
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
4526
4589
|
const focusScopeRef = useRef();
|
|
4590
|
+
|
|
4591
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4527
4592
|
const inputRef = useRef();
|
|
4528
4593
|
const eventBus = useService('eventBus');
|
|
4529
4594
|
const {
|
|
@@ -4712,8 +4777,8 @@ function Taglist(props) {
|
|
|
4712
4777
|
class: "fjs-taglist-anchor",
|
|
4713
4778
|
children: shouldDisplayDropdown && jsx(DropdownList, {
|
|
4714
4779
|
values: filteredOptions,
|
|
4715
|
-
getLabel:
|
|
4716
|
-
onValueSelected:
|
|
4780
|
+
getLabel: option => option.label,
|
|
4781
|
+
onValueSelected: option => selectValue(option.value),
|
|
4717
4782
|
emptyListMessage: hasOptionsLeft ? 'No results' : 'All values selected',
|
|
4718
4783
|
listenerElement: inputRef.current
|
|
4719
4784
|
})
|
|
@@ -4729,11 +4794,14 @@ function Taglist(props) {
|
|
|
4729
4794
|
Taglist.config = {
|
|
4730
4795
|
type: type$7,
|
|
4731
4796
|
keyed: true,
|
|
4732
|
-
|
|
4797
|
+
name: 'Tag list',
|
|
4733
4798
|
group: 'selection',
|
|
4734
4799
|
emptyValue: [],
|
|
4735
4800
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
4736
|
-
create:
|
|
4801
|
+
create: (options = {}) => ({
|
|
4802
|
+
label: 'Tag list',
|
|
4803
|
+
...createEmptyOptions(options)
|
|
4804
|
+
})
|
|
4737
4805
|
};
|
|
4738
4806
|
|
|
4739
4807
|
const NODE_TYPE_TEXT = 3,
|
|
@@ -4758,7 +4826,7 @@ function sanitizeHTML(html) {
|
|
|
4758
4826
|
doc.normalize();
|
|
4759
4827
|
const element = doc.body.firstChild;
|
|
4760
4828
|
if (element) {
|
|
4761
|
-
sanitizeNode(
|
|
4829
|
+
sanitizeNode(/** @type Element */element);
|
|
4762
4830
|
return /** @type Element */element.innerHTML;
|
|
4763
4831
|
} else {
|
|
4764
4832
|
// handle the case that document parsing
|
|
@@ -4815,7 +4883,7 @@ function sanitizeNode(node) {
|
|
|
4815
4883
|
node.setAttribute('rel', 'noopener');
|
|
4816
4884
|
}
|
|
4817
4885
|
for (let i = node.childNodes.length; i--;) {
|
|
4818
|
-
sanitizeNode(
|
|
4886
|
+
sanitizeNode(/** @type Element */node.childNodes[i]);
|
|
4819
4887
|
}
|
|
4820
4888
|
}
|
|
4821
4889
|
|
|
@@ -4902,12 +4970,15 @@ function Text(props) {
|
|
|
4902
4970
|
Text.config = {
|
|
4903
4971
|
type: type$6,
|
|
4904
4972
|
keyed: false,
|
|
4905
|
-
|
|
4973
|
+
name: 'Text view',
|
|
4906
4974
|
group: 'presentation',
|
|
4907
4975
|
create: (options = {}) => ({
|
|
4908
4976
|
text: '# Text',
|
|
4909
4977
|
...options
|
|
4910
|
-
})
|
|
4978
|
+
}),
|
|
4979
|
+
getSubheading: field => {
|
|
4980
|
+
textToLabel(field.text);
|
|
4981
|
+
}
|
|
4911
4982
|
};
|
|
4912
4983
|
|
|
4913
4984
|
const type$5 = 'html';
|
|
@@ -4968,7 +5039,7 @@ function Html(props) {
|
|
|
4968
5039
|
Html.config = {
|
|
4969
5040
|
type: type$5,
|
|
4970
5041
|
keyed: false,
|
|
4971
|
-
|
|
5042
|
+
name: 'HTML view',
|
|
4972
5043
|
group: 'presentation',
|
|
4973
5044
|
create: (options = {}) => ({
|
|
4974
5045
|
content: '',
|
|
@@ -5014,7 +5085,7 @@ function ExpressionField(props) {
|
|
|
5014
5085
|
}
|
|
5015
5086
|
ExpressionField.config = {
|
|
5016
5087
|
type: type$4,
|
|
5017
|
-
|
|
5088
|
+
name: 'Expression',
|
|
5018
5089
|
group: 'basic-input',
|
|
5019
5090
|
keyed: true,
|
|
5020
5091
|
emptyValue: null,
|
|
@@ -5107,7 +5178,7 @@ function Textfield(props) {
|
|
|
5107
5178
|
Textfield.config = {
|
|
5108
5179
|
type: type$3,
|
|
5109
5180
|
keyed: true,
|
|
5110
|
-
|
|
5181
|
+
name: 'Text field',
|
|
5111
5182
|
group: 'basic-input',
|
|
5112
5183
|
emptyValue: '',
|
|
5113
5184
|
sanitizeValue: ({
|
|
@@ -5124,6 +5195,7 @@ Textfield.config = {
|
|
|
5124
5195
|
return String(value);
|
|
5125
5196
|
},
|
|
5126
5197
|
create: (options = {}) => ({
|
|
5198
|
+
label: 'Text field',
|
|
5127
5199
|
...options
|
|
5128
5200
|
})
|
|
5129
5201
|
};
|
|
@@ -5212,13 +5284,14 @@ function Textarea(props) {
|
|
|
5212
5284
|
Textarea.config = {
|
|
5213
5285
|
type: type$2,
|
|
5214
5286
|
keyed: true,
|
|
5215
|
-
|
|
5287
|
+
name: 'Text area',
|
|
5216
5288
|
group: 'basic-input',
|
|
5217
5289
|
emptyValue: '',
|
|
5218
5290
|
sanitizeValue: ({
|
|
5219
5291
|
value
|
|
5220
5292
|
}) => isArray(value) || isObject(value) || isNil(value) ? '' : String(value),
|
|
5221
5293
|
create: (options = {}) => ({
|
|
5294
|
+
label: 'Text area',
|
|
5222
5295
|
...options
|
|
5223
5296
|
})
|
|
5224
5297
|
};
|
|
@@ -5242,7 +5315,7 @@ const autoSizeTextarea = textarea => {
|
|
|
5242
5315
|
};
|
|
5243
5316
|
|
|
5244
5317
|
var _path$7;
|
|
5245
|
-
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (
|
|
5318
|
+
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); }
|
|
5246
5319
|
var SvgArrowDown = function SvgArrowDown(props) {
|
|
5247
5320
|
return /*#__PURE__*/React.createElement("svg", _extends$7({
|
|
5248
5321
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5254,7 +5327,7 @@ var SvgArrowDown = function SvgArrowDown(props) {
|
|
|
5254
5327
|
};
|
|
5255
5328
|
|
|
5256
5329
|
var _path$6;
|
|
5257
|
-
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (
|
|
5330
|
+
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); }
|
|
5258
5331
|
var SvgArrowUp = function SvgArrowUp(props) {
|
|
5259
5332
|
return /*#__PURE__*/React.createElement("svg", _extends$6({
|
|
5260
5333
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5266,7 +5339,7 @@ var SvgArrowUp = function SvgArrowUp(props) {
|
|
|
5266
5339
|
};
|
|
5267
5340
|
|
|
5268
5341
|
var _path$5;
|
|
5269
|
-
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (
|
|
5342
|
+
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); }
|
|
5270
5343
|
var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
5271
5344
|
return /*#__PURE__*/React.createElement("svg", _extends$5({
|
|
5272
5345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5279,7 +5352,7 @@ var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
|
5279
5352
|
};
|
|
5280
5353
|
|
|
5281
5354
|
var _path$4;
|
|
5282
|
-
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (
|
|
5355
|
+
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); }
|
|
5283
5356
|
var SvgCaretRight = function SvgCaretRight(props) {
|
|
5284
5357
|
return /*#__PURE__*/React.createElement("svg", _extends$4({
|
|
5285
5358
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5330,9 +5403,7 @@ function Table(props) {
|
|
|
5330
5403
|
id,
|
|
5331
5404
|
label
|
|
5332
5405
|
} = field;
|
|
5333
|
-
|
|
5334
|
-
/** @type {[(null|Sorting), import("preact/hooks").StateUpdater<null|Sorting>]} */
|
|
5335
|
-
const [sortBy, setSortBy] = useState(null);
|
|
5406
|
+
const [sortBy, setSortBy] = useState(/** @type {Sorting | null} */null);
|
|
5336
5407
|
const evaluatedColumns = useEvaluatedColumns(columnsExpression || '', columns);
|
|
5337
5408
|
const columnKeys = evaluatedColumns.map(({
|
|
5338
5409
|
key
|
|
@@ -5348,6 +5419,12 @@ function Table(props) {
|
|
|
5348
5419
|
useEffect(() => {
|
|
5349
5420
|
setCurrentPage(0);
|
|
5350
5421
|
}, [rowCount, sortBy]);
|
|
5422
|
+
const serializeCellData = cellData => {
|
|
5423
|
+
if (cellData !== null && typeof cellData === 'object') {
|
|
5424
|
+
return JSON.stringify(cellData);
|
|
5425
|
+
}
|
|
5426
|
+
return cellData;
|
|
5427
|
+
};
|
|
5351
5428
|
|
|
5352
5429
|
/** @param {string} key */
|
|
5353
5430
|
function toggleSortBy(key) {
|
|
@@ -5431,7 +5508,7 @@ function Table(props) {
|
|
|
5431
5508
|
class: "fjs-table-tr",
|
|
5432
5509
|
children: columnKeys.map(key => jsx("td", {
|
|
5433
5510
|
class: "fjs-table-td",
|
|
5434
|
-
children: row[key]
|
|
5511
|
+
children: serializeCellData(row[key])
|
|
5435
5512
|
}, key))
|
|
5436
5513
|
}, index))
|
|
5437
5514
|
})]
|
|
@@ -5467,7 +5544,7 @@ function Table(props) {
|
|
|
5467
5544
|
Table.config = {
|
|
5468
5545
|
type: type$1,
|
|
5469
5546
|
keyed: false,
|
|
5470
|
-
|
|
5547
|
+
name: 'Table',
|
|
5471
5548
|
group: 'presentation',
|
|
5472
5549
|
create: (options = {}) => {
|
|
5473
5550
|
const {
|
|
@@ -5496,6 +5573,7 @@ Table.config = {
|
|
|
5496
5573
|
}
|
|
5497
5574
|
return {
|
|
5498
5575
|
...remainingOptions,
|
|
5576
|
+
label: 'Table',
|
|
5499
5577
|
rowCount: 10,
|
|
5500
5578
|
columns: [{
|
|
5501
5579
|
label: 'ID',
|
|
@@ -5929,7 +6007,7 @@ class FormFields {
|
|
|
5929
6007
|
}
|
|
5930
6008
|
}
|
|
5931
6009
|
|
|
5932
|
-
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'
|
|
6010
|
+
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'];
|
|
5933
6011
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url'];
|
|
5934
6012
|
|
|
5935
6013
|
/**
|
|
@@ -6893,7 +6971,7 @@ const ViewerCommandsModule = {
|
|
|
6893
6971
|
};
|
|
6894
6972
|
|
|
6895
6973
|
var _path$3;
|
|
6896
|
-
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (
|
|
6974
|
+
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); }
|
|
6897
6975
|
var SvgExpand = function SvgExpand(props) {
|
|
6898
6976
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
6899
6977
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6907,7 +6985,7 @@ var SvgExpand = function SvgExpand(props) {
|
|
|
6907
6985
|
};
|
|
6908
6986
|
|
|
6909
6987
|
var _path$2;
|
|
6910
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
6988
|
+
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); }
|
|
6911
6989
|
var SvgCollapse = function SvgCollapse(props) {
|
|
6912
6990
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
6913
6991
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6921,7 +6999,7 @@ var SvgCollapse = function SvgCollapse(props) {
|
|
|
6921
6999
|
};
|
|
6922
7000
|
|
|
6923
7001
|
var _path$1, _path2;
|
|
6924
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
7002
|
+
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); }
|
|
6925
7003
|
var SvgAdd = function SvgAdd(props) {
|
|
6926
7004
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
6927
7005
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6938,7 +7016,7 @@ var SvgAdd = function SvgAdd(props) {
|
|
|
6938
7016
|
};
|
|
6939
7017
|
|
|
6940
7018
|
var _path;
|
|
6941
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
7019
|
+
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); }
|
|
6942
7020
|
var SvgDelete = function SvgDelete(props) {
|
|
6943
7021
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
6944
7022
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7143,7 +7221,7 @@ class RepeatRenderManager {
|
|
|
7143
7221
|
* @param {Object} props.itemValue
|
|
7144
7222
|
* @param {Object} props.parentExpressionContextInfo
|
|
7145
7223
|
* @param {Object} props.repeaterField
|
|
7146
|
-
* @param {
|
|
7224
|
+
* @param {import('preact').FunctionComponent} props.RowsRenderer
|
|
7147
7225
|
* @param {Object} props.indexes
|
|
7148
7226
|
* @param {Function} props.onDeleteItem
|
|
7149
7227
|
* @param {boolean} props.showRemove
|
|
@@ -8027,7 +8105,7 @@ class FieldFactory {
|
|
|
8027
8105
|
this._pathRegistry = pathRegistry;
|
|
8028
8106
|
this._formFields = formFields;
|
|
8029
8107
|
}
|
|
8030
|
-
create(attrs,
|
|
8108
|
+
create(attrs, isNewField = true) {
|
|
8031
8109
|
const {
|
|
8032
8110
|
id,
|
|
8033
8111
|
type,
|
|
@@ -8066,13 +8144,12 @@ class FieldFactory {
|
|
|
8066
8144
|
})) {
|
|
8067
8145
|
throw new Error(`binding path '${[...parentPath, ...path.split('.')].join('.')}' is already claimed`);
|
|
8068
8146
|
}
|
|
8069
|
-
const labelAttrs = applyDefaults && config.label ? {
|
|
8070
|
-
label: config.label
|
|
8071
|
-
} : {};
|
|
8072
8147
|
const field = config.create({
|
|
8073
|
-
...
|
|
8148
|
+
...(config.label ? {
|
|
8149
|
+
label: config.label
|
|
8150
|
+
} : {}),
|
|
8074
8151
|
...attrs
|
|
8075
|
-
});
|
|
8152
|
+
}, isNewField);
|
|
8076
8153
|
this._ensureId(field);
|
|
8077
8154
|
if (config.keyed) {
|
|
8078
8155
|
this._ensureKey(field);
|
|
@@ -8616,10 +8693,10 @@ class FormFieldInstanceRegistry {
|
|
|
8616
8693
|
instanceId
|
|
8617
8694
|
});
|
|
8618
8695
|
} else if (isInstanceExpected && doesInstanceExist) {
|
|
8619
|
-
const
|
|
8696
|
+
const wasInstanceChanged = Object.keys(restInfo).some(key => {
|
|
8620
8697
|
return this._formFieldInstances[instanceId][key] !== restInfo[key];
|
|
8621
8698
|
});
|
|
8622
|
-
if (
|
|
8699
|
+
if (wasInstanceChanged) {
|
|
8623
8700
|
this._formFieldInstances[instanceId] = {
|
|
8624
8701
|
instanceId,
|
|
8625
8702
|
...restInfo
|
|
@@ -8736,7 +8813,7 @@ const extractFileReferencesFromRemovedData = removedData => {
|
|
|
8736
8813
|
return;
|
|
8737
8814
|
}
|
|
8738
8815
|
if (typeof value === 'object') {
|
|
8739
|
-
fileReferences.push(...extractFileReferencesFromRemovedData(
|
|
8816
|
+
fileReferences.push(...extractFileReferencesFromRemovedData(/** @type {RemovedData} */value));
|
|
8740
8817
|
} else if (Array.isArray(value)) {
|
|
8741
8818
|
fileReferences.push(...value.map(extractFileReferencesFromRemovedData).flat());
|
|
8742
8819
|
} else if (typeof value === 'string' && value.startsWith(FILE_PICKER_FILE_KEY_PREFIX)) {
|
|
@@ -9323,7 +9400,7 @@ class Form {
|
|
|
9323
9400
|
}
|
|
9324
9401
|
}
|
|
9325
9402
|
|
|
9326
|
-
const schemaVersion =
|
|
9403
|
+
const schemaVersion = 17;
|
|
9327
9404
|
|
|
9328
9405
|
/**
|
|
9329
9406
|
* @typedef { import('./types').CreateFormOptions } CreateFormOptions
|