@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.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) {
|
|
@@ -903,6 +915,7 @@ function useExpressionEvaluation(value) {
|
|
|
903
915
|
* @returns {T} - Returns the current state.
|
|
904
916
|
*/
|
|
905
917
|
function useDeepCompareMemoize(value) {
|
|
918
|
+
/** @type {import("preact").RefObject<T>} */
|
|
906
919
|
const ref = hooks.useRef();
|
|
907
920
|
if (!isEqual(value, ref.current)) {
|
|
908
921
|
ref.current = value;
|
|
@@ -1726,9 +1739,10 @@ function Button(props) {
|
|
|
1726
1739
|
Button.config = {
|
|
1727
1740
|
type: type$i,
|
|
1728
1741
|
keyed: false,
|
|
1729
|
-
|
|
1742
|
+
name: 'Button',
|
|
1730
1743
|
group: 'action',
|
|
1731
1744
|
create: (options = {}) => ({
|
|
1745
|
+
label: 'Button',
|
|
1732
1746
|
action: 'submit',
|
|
1733
1747
|
...options
|
|
1734
1748
|
})
|
|
@@ -1836,11 +1850,9 @@ function Checkbox(props) {
|
|
|
1836
1850
|
}), {
|
|
1837
1851
|
'fjs-checked': value
|
|
1838
1852
|
}),
|
|
1839
|
-
children: [jsxRuntime.
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
required: required,
|
|
1843
|
-
children: jsxRuntime.jsx("input", {
|
|
1853
|
+
children: [jsxRuntime.jsxs("div", {
|
|
1854
|
+
class: "fjs-inline-label",
|
|
1855
|
+
children: [jsxRuntime.jsx("input", {
|
|
1844
1856
|
checked: value,
|
|
1845
1857
|
class: "fjs-input",
|
|
1846
1858
|
disabled: disabled,
|
|
@@ -1853,7 +1865,11 @@ function Checkbox(props) {
|
|
|
1853
1865
|
required: required,
|
|
1854
1866
|
"aria-invalid": errors.length > 0,
|
|
1855
1867
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1856
|
-
})
|
|
1868
|
+
}), jsxRuntime.jsx(Label, {
|
|
1869
|
+
htmlFor: domId,
|
|
1870
|
+
label: label,
|
|
1871
|
+
required: required
|
|
1872
|
+
})]
|
|
1857
1873
|
}), jsxRuntime.jsx(Description, {
|
|
1858
1874
|
id: descriptionId,
|
|
1859
1875
|
description: description
|
|
@@ -1866,13 +1882,14 @@ function Checkbox(props) {
|
|
|
1866
1882
|
Checkbox.config = {
|
|
1867
1883
|
type: type$h,
|
|
1868
1884
|
keyed: true,
|
|
1869
|
-
|
|
1885
|
+
name: 'Checkbox',
|
|
1870
1886
|
group: 'selection',
|
|
1871
1887
|
emptyValue: false,
|
|
1872
1888
|
sanitizeValue: ({
|
|
1873
1889
|
value
|
|
1874
1890
|
}) => value === true,
|
|
1875
1891
|
create: (options = {}) => ({
|
|
1892
|
+
label: 'Checkbox',
|
|
1876
1893
|
...options
|
|
1877
1894
|
})
|
|
1878
1895
|
};
|
|
@@ -1894,6 +1911,8 @@ function Checklist(props) {
|
|
|
1894
1911
|
label,
|
|
1895
1912
|
validate = {}
|
|
1896
1913
|
} = field;
|
|
1914
|
+
|
|
1915
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
1897
1916
|
const outerDivRef = hooks.useRef();
|
|
1898
1917
|
const {
|
|
1899
1918
|
required
|
|
@@ -1939,31 +1958,32 @@ function Checklist(props) {
|
|
|
1939
1958
|
children: [jsxRuntime.jsx(Label, {
|
|
1940
1959
|
label: label,
|
|
1941
1960
|
required: required
|
|
1942
|
-
}), loadState == LOAD_STATES.LOADED && options.map((
|
|
1961
|
+
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
1943
1962
|
const itemDomId = `${domId}-${index}`;
|
|
1944
|
-
const isChecked = hasEqualValue(
|
|
1945
|
-
return jsxRuntime.
|
|
1946
|
-
|
|
1947
|
-
label: o.label,
|
|
1948
|
-
class: classNames({
|
|
1963
|
+
const isChecked = hasEqualValue(option.value, values);
|
|
1964
|
+
return jsxRuntime.jsxs("div", {
|
|
1965
|
+
className: classNames('fjs-inline-label', {
|
|
1949
1966
|
'fjs-checked': isChecked
|
|
1950
1967
|
}),
|
|
1951
|
-
|
|
1952
|
-
children: jsxRuntime.jsx("input", {
|
|
1968
|
+
children: [jsxRuntime.jsx("input", {
|
|
1953
1969
|
checked: isChecked,
|
|
1954
1970
|
class: "fjs-input",
|
|
1955
1971
|
disabled: disabled,
|
|
1956
1972
|
readOnly: readonly,
|
|
1957
1973
|
id: itemDomId,
|
|
1958
1974
|
type: "checkbox",
|
|
1959
|
-
onClick: () => toggleCheckbox(
|
|
1975
|
+
onClick: () => toggleCheckbox(option.value),
|
|
1960
1976
|
onBlur: onCheckboxBlur,
|
|
1961
1977
|
onFocus: onCheckboxFocus,
|
|
1962
1978
|
required: required,
|
|
1963
1979
|
"aria-invalid": errors.length > 0,
|
|
1964
1980
|
"aria-describedby": [descriptionId, errorMessageId].join(' ')
|
|
1965
|
-
})
|
|
1966
|
-
|
|
1981
|
+
}), jsxRuntime.jsx(Label, {
|
|
1982
|
+
htmlFor: itemDomId,
|
|
1983
|
+
label: option.label,
|
|
1984
|
+
required: false
|
|
1985
|
+
})]
|
|
1986
|
+
}, option.value);
|
|
1967
1987
|
}), jsxRuntime.jsx(Description, {
|
|
1968
1988
|
id: descriptionId,
|
|
1969
1989
|
description: description
|
|
@@ -1976,11 +1996,14 @@ function Checklist(props) {
|
|
|
1976
1996
|
Checklist.config = {
|
|
1977
1997
|
type: type$g,
|
|
1978
1998
|
keyed: true,
|
|
1979
|
-
|
|
1999
|
+
name: 'Checkbox group',
|
|
1980
2000
|
group: 'selection',
|
|
1981
2001
|
emptyValue: [],
|
|
1982
2002
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
1983
|
-
create:
|
|
2003
|
+
create: (options = {}) => ({
|
|
2004
|
+
label: 'Checkbox group',
|
|
2005
|
+
...createEmptyOptions(options)
|
|
2006
|
+
})
|
|
1984
2007
|
};
|
|
1985
2008
|
|
|
1986
2009
|
const noop$1 = () => false;
|
|
@@ -2072,7 +2095,7 @@ function FormField(props) {
|
|
|
2072
2095
|
}, [eventBus, viewerCommands]);
|
|
2073
2096
|
hooks.useEffect(() => {
|
|
2074
2097
|
const hasInitialValue = initialValue && !isEqual(initialValue, []);
|
|
2075
|
-
if (initialValidationTrigger && hasInitialValue) {
|
|
2098
|
+
if (initialValidationTrigger && hasInitialValue && fieldInstance) {
|
|
2076
2099
|
setInitialValidationTrigger(false);
|
|
2077
2100
|
viewerCommands.updateFieldInstanceValidation(fieldInstance, initialValue);
|
|
2078
2101
|
}
|
|
@@ -2286,11 +2309,12 @@ Default.config = {
|
|
|
2286
2309
|
create: (options = {}) => ({
|
|
2287
2310
|
components: [],
|
|
2288
2311
|
...options
|
|
2289
|
-
})
|
|
2312
|
+
}),
|
|
2313
|
+
getSubheading: field => field.id
|
|
2290
2314
|
};
|
|
2291
2315
|
|
|
2292
2316
|
var _path$x;
|
|
2293
|
-
function _extends$y() { _extends$y = Object.assign ? Object.assign.bind() : function (
|
|
2317
|
+
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
2318
|
var SvgCalendar = function SvgCalendar(props) {
|
|
2295
2319
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
|
|
2296
2320
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2426,7 +2450,11 @@ function Datepicker(props) {
|
|
|
2426
2450
|
readonly,
|
|
2427
2451
|
setDate
|
|
2428
2452
|
} = props;
|
|
2453
|
+
|
|
2454
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
2429
2455
|
const dateInputRef = hooks.useRef();
|
|
2456
|
+
|
|
2457
|
+
/** @type {import("preact").RefObject<HTMLElement>} */
|
|
2430
2458
|
const focusScopeRef = hooks.useRef();
|
|
2431
2459
|
const [flatpickrInstance, setFlatpickrInstance] = hooks.useState(null);
|
|
2432
2460
|
const [isInputDirty, setIsInputDirty] = hooks.useState(false);
|
|
@@ -2564,7 +2592,7 @@ function Datepicker(props) {
|
|
|
2564
2592
|
}
|
|
2565
2593
|
|
|
2566
2594
|
var _path$w, _path2$4;
|
|
2567
|
-
function _extends$x() { _extends$x = Object.assign ? Object.assign.bind() : function (
|
|
2595
|
+
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
2596
|
var SvgClock = function SvgClock(props) {
|
|
2569
2597
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
|
|
2570
2598
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2598,7 +2626,11 @@ function DropdownList(props) {
|
|
|
2598
2626
|
const [mouseControl, setMouseControl] = hooks.useState(false);
|
|
2599
2627
|
const [focusedValueIndex, setFocusedValueIndex] = hooks.useState(initialFocusIndex);
|
|
2600
2628
|
const [smoothScrolling, setSmoothScrolling] = hooks.useState(false);
|
|
2629
|
+
|
|
2630
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2601
2631
|
const dropdownContainer = hooks.useRef();
|
|
2632
|
+
|
|
2633
|
+
/** @type {import("preact").RefObject<{ x: number, y: number }>} */
|
|
2602
2634
|
const mouseScreenPos = hooks.useRef();
|
|
2603
2635
|
const focusedItem = hooks.useMemo(() => values.length ? values[focusedValueIndex] : null, [focusedValueIndex, values]);
|
|
2604
2636
|
const changeFocusedValueIndex = hooks.useCallback(delta => {
|
|
@@ -2816,7 +2848,7 @@ function Timepicker(props) {
|
|
|
2816
2848
|
value: rawValue,
|
|
2817
2849
|
disabled: disabled,
|
|
2818
2850
|
readOnly: readonly,
|
|
2819
|
-
placeholder: use24h ? 'hh:mm' : 'hh:mm
|
|
2851
|
+
placeholder: use24h ? 'hh:mm' : 'hh:mm --',
|
|
2820
2852
|
autoComplete: "off",
|
|
2821
2853
|
onInput: e => {
|
|
2822
2854
|
// @ts-expect-error
|
|
@@ -2872,6 +2904,8 @@ function Datetime(props) {
|
|
|
2872
2904
|
const {
|
|
2873
2905
|
formId
|
|
2874
2906
|
} = hooks.useContext(FormContext);
|
|
2907
|
+
|
|
2908
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
2875
2909
|
const dateTimeGroupRef = hooks.useRef();
|
|
2876
2910
|
const [dateTime, setDateTime] = hooks.useState(getNullDateTime());
|
|
2877
2911
|
const [dateTimeUpdateRequest, setDateTimeUpdateRequest] = hooks.useState(null);
|
|
@@ -3037,18 +3071,23 @@ function Datetime(props) {
|
|
|
3037
3071
|
Datetime.config = {
|
|
3038
3072
|
type: type$f,
|
|
3039
3073
|
keyed: true,
|
|
3040
|
-
|
|
3074
|
+
name: 'Date time',
|
|
3041
3075
|
group: 'basic-input',
|
|
3042
3076
|
emptyValue: null,
|
|
3043
3077
|
sanitizeValue: sanitizeDateTimePickerValue,
|
|
3044
|
-
create: (options = {}) => {
|
|
3078
|
+
create: (options = {}, isNewField) => {
|
|
3045
3079
|
const defaults = {};
|
|
3046
3080
|
minDash.set(defaults, DATETIME_SUBTYPE_PATH, DATETIME_SUBTYPES.DATE);
|
|
3047
|
-
|
|
3081
|
+
if (isNewField) {
|
|
3082
|
+
minDash.set(defaults, DATE_LABEL_PATH, 'Date');
|
|
3083
|
+
}
|
|
3048
3084
|
return {
|
|
3049
3085
|
...defaults,
|
|
3050
3086
|
...options
|
|
3051
3087
|
};
|
|
3088
|
+
},
|
|
3089
|
+
getSubheading: field => {
|
|
3090
|
+
return field.dateLabel || field.timeLabel;
|
|
3052
3091
|
}
|
|
3053
3092
|
};
|
|
3054
3093
|
|
|
@@ -3086,9 +3125,10 @@ function Group(props) {
|
|
|
3086
3125
|
Group.config = {
|
|
3087
3126
|
type: 'group',
|
|
3088
3127
|
pathed: true,
|
|
3089
|
-
|
|
3128
|
+
name: 'Group',
|
|
3090
3129
|
group: 'container',
|
|
3091
3130
|
create: (options = {}) => ({
|
|
3131
|
+
label: 'Group',
|
|
3092
3132
|
components: [],
|
|
3093
3133
|
showOutline: true,
|
|
3094
3134
|
...options
|
|
@@ -3162,9 +3202,10 @@ function IFramePlaceholder(props) {
|
|
|
3162
3202
|
IFrame.config = {
|
|
3163
3203
|
type: type$e,
|
|
3164
3204
|
keyed: false,
|
|
3165
|
-
|
|
3205
|
+
name: 'iFrame',
|
|
3166
3206
|
group: 'container',
|
|
3167
3207
|
create: (options = {}) => ({
|
|
3208
|
+
label: 'iFrame',
|
|
3168
3209
|
security: {
|
|
3169
3210
|
allowScripts: true
|
|
3170
3211
|
},
|
|
@@ -3173,7 +3214,7 @@ IFrame.config = {
|
|
|
3173
3214
|
};
|
|
3174
3215
|
|
|
3175
3216
|
var _path$v;
|
|
3176
|
-
function _extends$w() { _extends$w = Object.assign ? Object.assign.bind() : function (
|
|
3217
|
+
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
3218
|
var SvgButton = function SvgButton(props) {
|
|
3178
3219
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
|
|
3179
3220
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3187,7 +3228,7 @@ var SvgButton = function SvgButton(props) {
|
|
|
3187
3228
|
};
|
|
3188
3229
|
|
|
3189
3230
|
var _path$u;
|
|
3190
|
-
function _extends$v() { _extends$v = Object.assign ? Object.assign.bind() : function (
|
|
3231
|
+
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
3232
|
var SvgCheckbox = function SvgCheckbox(props) {
|
|
3192
3233
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
|
|
3193
3234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3200,7 +3241,7 @@ var SvgCheckbox = function SvgCheckbox(props) {
|
|
|
3200
3241
|
};
|
|
3201
3242
|
|
|
3202
3243
|
var _path$t;
|
|
3203
|
-
function _extends$u() { _extends$u = Object.assign ? Object.assign.bind() : function (
|
|
3244
|
+
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
3245
|
var SvgChecklist = function SvgChecklist(props) {
|
|
3205
3246
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
|
|
3206
3247
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3216,7 +3257,7 @@ var SvgChecklist = function SvgChecklist(props) {
|
|
|
3216
3257
|
};
|
|
3217
3258
|
|
|
3218
3259
|
var _path$s, _path2$3, _path3;
|
|
3219
|
-
function _extends$t() { _extends$t = Object.assign ? Object.assign.bind() : function (
|
|
3260
|
+
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
3261
|
var SvgDatetime = function SvgDatetime(props) {
|
|
3221
3262
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
|
|
3222
3263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3235,7 +3276,7 @@ var SvgDatetime = function SvgDatetime(props) {
|
|
|
3235
3276
|
};
|
|
3236
3277
|
|
|
3237
3278
|
var _path$r, _path2$2;
|
|
3238
|
-
function _extends$s() { _extends$s = Object.assign ? Object.assign.bind() : function (
|
|
3279
|
+
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
3280
|
var SvgTaglist = function SvgTaglist(props) {
|
|
3240
3281
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
|
|
3241
3282
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3251,7 +3292,7 @@ var SvgTaglist = function SvgTaglist(props) {
|
|
|
3251
3292
|
};
|
|
3252
3293
|
|
|
3253
3294
|
var _rect, _rect2, _rect3;
|
|
3254
|
-
function _extends$r() { _extends$r = Object.assign ? Object.assign.bind() : function (
|
|
3295
|
+
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
3296
|
var SvgForm = function SvgForm(props) {
|
|
3256
3297
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
|
|
3257
3298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3279,7 +3320,7 @@ var SvgForm = function SvgForm(props) {
|
|
|
3279
3320
|
};
|
|
3280
3321
|
|
|
3281
3322
|
var _path$q;
|
|
3282
|
-
function _extends$q() { _extends$q = Object.assign ? Object.assign.bind() : function (
|
|
3323
|
+
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
3324
|
var SvgGroup = function SvgGroup(props) {
|
|
3284
3325
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
|
|
3285
3326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3295,7 +3336,7 @@ var SvgGroup = function SvgGroup(props) {
|
|
|
3295
3336
|
};
|
|
3296
3337
|
|
|
3297
3338
|
var _path$p;
|
|
3298
|
-
function _extends$p() { _extends$p = Object.assign ? Object.assign.bind() : function (
|
|
3339
|
+
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
3340
|
var SvgNumber = function SvgNumber(props) {
|
|
3300
3341
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
|
|
3301
3342
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3309,7 +3350,7 @@ var SvgNumber = function SvgNumber(props) {
|
|
|
3309
3350
|
};
|
|
3310
3351
|
|
|
3311
3352
|
var _path$o;
|
|
3312
|
-
function _extends$o() { _extends$o = Object.assign ? Object.assign.bind() : function (
|
|
3353
|
+
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
3354
|
var SvgRadio = function SvgRadio(props) {
|
|
3314
3355
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
|
|
3315
3356
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3322,7 +3363,7 @@ var SvgRadio = function SvgRadio(props) {
|
|
|
3322
3363
|
};
|
|
3323
3364
|
|
|
3324
3365
|
var _path$n;
|
|
3325
|
-
function _extends$n() { _extends$n = Object.assign ? Object.assign.bind() : function (
|
|
3366
|
+
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
3367
|
var SvgSelect = function SvgSelect(props) {
|
|
3327
3368
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
|
|
3328
3369
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3336,7 +3377,7 @@ var SvgSelect = function SvgSelect(props) {
|
|
|
3336
3377
|
};
|
|
3337
3378
|
|
|
3338
3379
|
var _path$m;
|
|
3339
|
-
function _extends$m() { _extends$m = Object.assign ? Object.assign.bind() : function (
|
|
3380
|
+
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
3381
|
var SvgSeparator = function SvgSeparator(props) {
|
|
3341
3382
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
|
|
3342
3383
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3350,7 +3391,7 @@ var SvgSeparator = function SvgSeparator(props) {
|
|
|
3350
3391
|
};
|
|
3351
3392
|
|
|
3352
3393
|
var _path$l;
|
|
3353
|
-
function _extends$l() { _extends$l = Object.assign ? Object.assign.bind() : function (
|
|
3394
|
+
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
3395
|
var SvgSpacer = function SvgSpacer(props) {
|
|
3355
3396
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
|
|
3356
3397
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3364,7 +3405,7 @@ var SvgSpacer = function SvgSpacer(props) {
|
|
|
3364
3405
|
};
|
|
3365
3406
|
|
|
3366
3407
|
var _path$k;
|
|
3367
|
-
function _extends$k() { _extends$k = Object.assign ? Object.assign.bind() : function (
|
|
3408
|
+
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
3409
|
var SvgDynamicList = function SvgDynamicList(props) {
|
|
3369
3410
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
|
|
3370
3411
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3380,7 +3421,7 @@ var SvgDynamicList = function SvgDynamicList(props) {
|
|
|
3380
3421
|
};
|
|
3381
3422
|
|
|
3382
3423
|
var _path$j;
|
|
3383
|
-
function _extends$j() { _extends$j = Object.assign ? Object.assign.bind() : function (
|
|
3424
|
+
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
3425
|
var SvgText = function SvgText(props) {
|
|
3385
3426
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
|
|
3386
3427
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3393,7 +3434,7 @@ var SvgText = function SvgText(props) {
|
|
|
3393
3434
|
};
|
|
3394
3435
|
|
|
3395
3436
|
var _path$i;
|
|
3396
|
-
function _extends$i() { _extends$i = Object.assign ? Object.assign.bind() : function (
|
|
3437
|
+
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
3438
|
var SvgHtml = function SvgHtml(props) {
|
|
3398
3439
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
|
|
3399
3440
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3409,7 +3450,7 @@ var SvgHtml = function SvgHtml(props) {
|
|
|
3409
3450
|
};
|
|
3410
3451
|
|
|
3411
3452
|
var _path$h;
|
|
3412
|
-
function _extends$h() { _extends$h = Object.assign ? Object.assign.bind() : function (
|
|
3453
|
+
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
3454
|
var SvgExpressionField = function SvgExpressionField(props) {
|
|
3414
3455
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
|
|
3415
3456
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3425,7 +3466,7 @@ var SvgExpressionField = function SvgExpressionField(props) {
|
|
|
3425
3466
|
};
|
|
3426
3467
|
|
|
3427
3468
|
var _path$g;
|
|
3428
|
-
function _extends$g() { _extends$g = Object.assign ? Object.assign.bind() : function (
|
|
3469
|
+
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
3470
|
var SvgTextfield = function SvgTextfield(props) {
|
|
3430
3471
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
|
|
3431
3472
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3439,7 +3480,7 @@ var SvgTextfield = function SvgTextfield(props) {
|
|
|
3439
3480
|
};
|
|
3440
3481
|
|
|
3441
3482
|
var _path$f;
|
|
3442
|
-
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (
|
|
3483
|
+
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
3484
|
var SvgTextarea = function SvgTextarea(props) {
|
|
3444
3485
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
|
|
3445
3486
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3453,7 +3494,7 @@ var SvgTextarea = function SvgTextarea(props) {
|
|
|
3453
3494
|
};
|
|
3454
3495
|
|
|
3455
3496
|
var _path$e;
|
|
3456
|
-
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (
|
|
3497
|
+
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
3498
|
var SvgIFrame = function SvgIFrame(props) {
|
|
3458
3499
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
|
|
3459
3500
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3469,7 +3510,7 @@ var SvgIFrame = function SvgIFrame(props) {
|
|
|
3469
3510
|
};
|
|
3470
3511
|
|
|
3471
3512
|
var _path$d, _path2$1;
|
|
3472
|
-
function _extends$d() { _extends$d = Object.assign ? Object.assign.bind() : function (
|
|
3513
|
+
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
3514
|
var SvgImage = function SvgImage(props) {
|
|
3474
3515
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
|
|
3475
3516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3488,7 +3529,7 @@ var SvgImage = function SvgImage(props) {
|
|
|
3488
3529
|
};
|
|
3489
3530
|
|
|
3490
3531
|
var _path$c;
|
|
3491
|
-
function _extends$c() { _extends$c = Object.assign ? Object.assign.bind() : function (
|
|
3532
|
+
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
3533
|
var SvgTable = function SvgTable(props) {
|
|
3493
3534
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
|
|
3494
3535
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3503,7 +3544,7 @@ var SvgTable = function SvgTable(props) {
|
|
|
3503
3544
|
};
|
|
3504
3545
|
|
|
3505
3546
|
var _path$b;
|
|
3506
|
-
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (
|
|
3547
|
+
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
3548
|
var SvgFilePicker = function SvgFilePicker(props) {
|
|
3508
3549
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
3509
3550
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3594,11 +3635,10 @@ function Image(props) {
|
|
|
3594
3635
|
Image.config = {
|
|
3595
3636
|
type: type$d,
|
|
3596
3637
|
keyed: false,
|
|
3597
|
-
|
|
3638
|
+
name: 'Image view',
|
|
3598
3639
|
group: 'presentation',
|
|
3599
|
-
create: (options = {}) =>
|
|
3600
|
-
|
|
3601
|
-
})
|
|
3640
|
+
create: (options = {}) => options,
|
|
3641
|
+
getSubheading: field => field.alt
|
|
3602
3642
|
};
|
|
3603
3643
|
|
|
3604
3644
|
function TemplatedInputAdorner(props) {
|
|
@@ -3620,7 +3660,7 @@ function TemplatedInputAdorner(props) {
|
|
|
3620
3660
|
}
|
|
3621
3661
|
|
|
3622
3662
|
var _path$a;
|
|
3623
|
-
function _extends$a() { _extends$a = Object.assign ? Object.assign.bind() : function (
|
|
3663
|
+
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
3664
|
var SvgAngelDown = function SvgAngelDown(props) {
|
|
3625
3665
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
|
|
3626
3666
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3637,7 +3677,7 @@ var SvgAngelDown = function SvgAngelDown(props) {
|
|
|
3637
3677
|
};
|
|
3638
3678
|
|
|
3639
3679
|
var _path$9;
|
|
3640
|
-
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (
|
|
3680
|
+
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
3681
|
var SvgAngelUp = function SvgAngelUp(props) {
|
|
3642
3682
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
3643
3683
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3709,6 +3749,8 @@ function Numberfield(props) {
|
|
|
3709
3749
|
const {
|
|
3710
3750
|
required
|
|
3711
3751
|
} = validate;
|
|
3752
|
+
|
|
3753
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
3712
3754
|
const inputRef = hooks.useRef();
|
|
3713
3755
|
const [cachedValue, setCachedValue] = hooks.useState(value);
|
|
3714
3756
|
const [displayValue, setDisplayValue] = hooks.useState(value);
|
|
@@ -3905,7 +3947,7 @@ function Numberfield(props) {
|
|
|
3905
3947
|
Numberfield.config = {
|
|
3906
3948
|
type: type$c,
|
|
3907
3949
|
keyed: true,
|
|
3908
|
-
|
|
3950
|
+
name: 'Number',
|
|
3909
3951
|
group: 'basic-input',
|
|
3910
3952
|
emptyValue: null,
|
|
3911
3953
|
sanitizeValue: ({
|
|
@@ -3919,6 +3961,7 @@ Numberfield.config = {
|
|
|
3919
3961
|
return formField.serializeToString ? value.toString() : Number(value);
|
|
3920
3962
|
},
|
|
3921
3963
|
create: (options = {}) => ({
|
|
3964
|
+
label: 'Number',
|
|
3922
3965
|
...options
|
|
3923
3966
|
})
|
|
3924
3967
|
};
|
|
@@ -3940,6 +3983,8 @@ function Radio(props) {
|
|
|
3940
3983
|
label,
|
|
3941
3984
|
validate = {}
|
|
3942
3985
|
} = field;
|
|
3986
|
+
|
|
3987
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
3943
3988
|
const outerDivRef = hooks.useRef();
|
|
3944
3989
|
const {
|
|
3945
3990
|
required
|
|
@@ -3987,18 +4032,16 @@ function Radio(props) {
|
|
|
3987
4032
|
}), loadState == LOAD_STATES.LOADED && options.map((option, index) => {
|
|
3988
4033
|
const itemDomId = `${domId}-${index}`;
|
|
3989
4034
|
const isChecked = isEqual(option.value, value);
|
|
3990
|
-
return jsxRuntime.
|
|
3991
|
-
|
|
3992
|
-
label: option.label,
|
|
3993
|
-
class: classNames({
|
|
4035
|
+
return jsxRuntime.jsxs("div", {
|
|
4036
|
+
className: classNames('fjs-inline-label', {
|
|
3994
4037
|
'fjs-checked': isChecked
|
|
3995
4038
|
}),
|
|
3996
|
-
|
|
3997
|
-
children: jsxRuntime.jsx("input", {
|
|
4039
|
+
children: [jsxRuntime.jsx("input", {
|
|
3998
4040
|
checked: isChecked,
|
|
3999
4041
|
class: "fjs-input",
|
|
4000
4042
|
disabled: disabled,
|
|
4001
4043
|
readOnly: readonly,
|
|
4044
|
+
name: domId,
|
|
4002
4045
|
id: itemDomId,
|
|
4003
4046
|
type: "radio",
|
|
4004
4047
|
onClick: () => onChange(option.value),
|
|
@@ -4007,8 +4050,15 @@ function Radio(props) {
|
|
|
4007
4050
|
"aria-describedby": [descriptionId, errorMessageId].join(' '),
|
|
4008
4051
|
required: required,
|
|
4009
4052
|
"aria-invalid": errors.length > 0
|
|
4010
|
-
})
|
|
4011
|
-
|
|
4053
|
+
}), jsxRuntime.jsx(Label, {
|
|
4054
|
+
htmlFor: itemDomId,
|
|
4055
|
+
label: option.label,
|
|
4056
|
+
class: classNames({
|
|
4057
|
+
'fjs-checked': isChecked
|
|
4058
|
+
}),
|
|
4059
|
+
required: false
|
|
4060
|
+
})]
|
|
4061
|
+
}, option.value);
|
|
4012
4062
|
}), jsxRuntime.jsx(Description, {
|
|
4013
4063
|
id: descriptionId,
|
|
4014
4064
|
description: description
|
|
@@ -4021,15 +4071,18 @@ function Radio(props) {
|
|
|
4021
4071
|
Radio.config = {
|
|
4022
4072
|
type: type$b,
|
|
4023
4073
|
keyed: true,
|
|
4024
|
-
|
|
4074
|
+
name: 'Radio group',
|
|
4025
4075
|
group: 'selection',
|
|
4026
4076
|
emptyValue: null,
|
|
4027
4077
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4028
|
-
create:
|
|
4078
|
+
create: (options = {}) => ({
|
|
4079
|
+
label: 'Radio group',
|
|
4080
|
+
...createEmptyOptions(options)
|
|
4081
|
+
})
|
|
4029
4082
|
};
|
|
4030
4083
|
|
|
4031
4084
|
var _path$8;
|
|
4032
|
-
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (
|
|
4085
|
+
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
4086
|
var SvgXMark = function SvgXMark(props) {
|
|
4034
4087
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
|
|
4035
4088
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4060,6 +4113,8 @@ function SearchableSelect(props) {
|
|
|
4060
4113
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4061
4114
|
const [isFilterActive, setIsFilterActive] = hooks.useState(true);
|
|
4062
4115
|
const [isEscapeClosed, setIsEscapeClose] = hooks.useState(false);
|
|
4116
|
+
|
|
4117
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4063
4118
|
const searchbarRef = hooks.useRef();
|
|
4064
4119
|
const eventBus = useService('eventBus');
|
|
4065
4120
|
const {
|
|
@@ -4087,9 +4142,9 @@ function SearchableSelect(props) {
|
|
|
4087
4142
|
if (!filter || !isFilterActive) {
|
|
4088
4143
|
return options;
|
|
4089
4144
|
}
|
|
4090
|
-
return options.filter(
|
|
4145
|
+
return options.filter(option => option.label && option.value && option.label.toLowerCase().includes(filter.toLowerCase()));
|
|
4091
4146
|
}, [filter, loadState, options, isFilterActive]);
|
|
4092
|
-
const
|
|
4147
|
+
const pickOption = hooks.useCallback(option => {
|
|
4093
4148
|
setFilter(option && option.label || '');
|
|
4094
4149
|
props.onChange({
|
|
4095
4150
|
value: option && option.value || null
|
|
@@ -4187,7 +4242,7 @@ function SearchableSelect(props) {
|
|
|
4187
4242
|
}), displayState.displayCross && jsxRuntime.jsxs("span", {
|
|
4188
4243
|
class: "fjs-select-cross",
|
|
4189
4244
|
onMouseDown: e => {
|
|
4190
|
-
|
|
4245
|
+
pickOption(null);
|
|
4191
4246
|
e.preventDefault();
|
|
4192
4247
|
},
|
|
4193
4248
|
children: [jsxRuntime.jsx(SvgXMark, {}), ' ']
|
|
@@ -4200,9 +4255,9 @@ function SearchableSelect(props) {
|
|
|
4200
4255
|
class: "fjs-select-anchor",
|
|
4201
4256
|
children: displayState.displayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4202
4257
|
values: filteredOptions,
|
|
4203
|
-
getLabel:
|
|
4204
|
-
onValueSelected:
|
|
4205
|
-
|
|
4258
|
+
getLabel: option => option.label,
|
|
4259
|
+
onValueSelected: option => {
|
|
4260
|
+
pickOption(option);
|
|
4206
4261
|
setIsDropdownExpanded(false);
|
|
4207
4262
|
},
|
|
4208
4263
|
listenerElement: searchbarRef.current
|
|
@@ -4224,6 +4279,8 @@ function SimpleSelect(props) {
|
|
|
4224
4279
|
} = props;
|
|
4225
4280
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4226
4281
|
const selectRef = hooks.useRef();
|
|
4282
|
+
|
|
4283
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4227
4284
|
const inputRef = hooks.useRef();
|
|
4228
4285
|
const {
|
|
4229
4286
|
loadState,
|
|
@@ -4238,7 +4295,7 @@ function SimpleSelect(props) {
|
|
|
4238
4295
|
});
|
|
4239
4296
|
const getLabelCorrelation = useGetLabelCorrelation(options);
|
|
4240
4297
|
const valueLabel = hooks.useMemo(() => value && getLabelCorrelation(value), [value, getLabelCorrelation]);
|
|
4241
|
-
const
|
|
4298
|
+
const pickOption = hooks.useCallback(option => {
|
|
4242
4299
|
props.onChange({
|
|
4243
4300
|
value: option && option.value || null
|
|
4244
4301
|
});
|
|
@@ -4263,7 +4320,7 @@ function SimpleSelect(props) {
|
|
|
4263
4320
|
}
|
|
4264
4321
|
e.preventDefault();
|
|
4265
4322
|
}, [disabled, isDropdownExpanded]);
|
|
4266
|
-
const initialFocusIndex = hooks.useMemo(() => value && minDash.findIndex(options,
|
|
4323
|
+
const initialFocusIndex = hooks.useMemo(() => value && minDash.findIndex(options, option => option.value === value) || 0, [options, value]);
|
|
4267
4324
|
const onInputFocus = hooks.useCallback(() => {
|
|
4268
4325
|
if (!readonly) {
|
|
4269
4326
|
setIsDropdownExpanded(true);
|
|
@@ -4305,7 +4362,7 @@ function SimpleSelect(props) {
|
|
|
4305
4362
|
}), displayState.displayCross && jsxRuntime.jsx("span", {
|
|
4306
4363
|
class: "fjs-select-cross",
|
|
4307
4364
|
onMouseDown: e => {
|
|
4308
|
-
|
|
4365
|
+
pickOption(null);
|
|
4309
4366
|
e.stopPropagation();
|
|
4310
4367
|
},
|
|
4311
4368
|
children: jsxRuntime.jsx(SvgXMark, {})
|
|
@@ -4317,10 +4374,10 @@ function SimpleSelect(props) {
|
|
|
4317
4374
|
class: "fjs-select-anchor",
|
|
4318
4375
|
children: displayState.displayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4319
4376
|
values: options,
|
|
4320
|
-
getLabel:
|
|
4377
|
+
getLabel: option => option.label,
|
|
4321
4378
|
initialFocusIndex: initialFocusIndex,
|
|
4322
|
-
onValueSelected:
|
|
4323
|
-
|
|
4379
|
+
onValueSelected: option => {
|
|
4380
|
+
pickOption(option);
|
|
4324
4381
|
setIsDropdownExpanded(false);
|
|
4325
4382
|
},
|
|
4326
4383
|
listenerElement: selectRef.current
|
|
@@ -4399,11 +4456,14 @@ function Select(props) {
|
|
|
4399
4456
|
Select.config = {
|
|
4400
4457
|
type: type$a,
|
|
4401
4458
|
keyed: true,
|
|
4402
|
-
|
|
4459
|
+
name: 'Select',
|
|
4403
4460
|
group: 'selection',
|
|
4404
4461
|
emptyValue: null,
|
|
4405
4462
|
sanitizeValue: sanitizeSingleSelectValue,
|
|
4406
|
-
create:
|
|
4463
|
+
create: (options = {}) => ({
|
|
4464
|
+
label: 'Select',
|
|
4465
|
+
...createEmptyOptions(options)
|
|
4466
|
+
})
|
|
4407
4467
|
};
|
|
4408
4468
|
|
|
4409
4469
|
const type$9 = 'separator';
|
|
@@ -4416,7 +4476,7 @@ function Separator() {
|
|
|
4416
4476
|
Separator.config = {
|
|
4417
4477
|
type: type$9,
|
|
4418
4478
|
keyed: false,
|
|
4419
|
-
|
|
4479
|
+
name: 'Separator',
|
|
4420
4480
|
group: 'presentation',
|
|
4421
4481
|
create: (options = {}) => ({
|
|
4422
4482
|
...options
|
|
@@ -4441,7 +4501,7 @@ function Spacer(props) {
|
|
|
4441
4501
|
Spacer.config = {
|
|
4442
4502
|
type: type$8,
|
|
4443
4503
|
keyed: false,
|
|
4444
|
-
|
|
4504
|
+
name: 'Spacer',
|
|
4445
4505
|
group: 'presentation',
|
|
4446
4506
|
create: (options = {}) => ({
|
|
4447
4507
|
height: 60,
|
|
@@ -4487,9 +4547,10 @@ DynamicList.config = {
|
|
|
4487
4547
|
type: 'dynamiclist',
|
|
4488
4548
|
pathed: true,
|
|
4489
4549
|
repeatable: true,
|
|
4490
|
-
|
|
4550
|
+
name: 'Dynamic list',
|
|
4491
4551
|
group: 'container',
|
|
4492
4552
|
create: (options = {}) => ({
|
|
4553
|
+
label: 'Dynamic list',
|
|
4493
4554
|
components: [],
|
|
4494
4555
|
showOutline: true,
|
|
4495
4556
|
isRepeating: true,
|
|
@@ -4543,7 +4604,11 @@ function Taglist(props) {
|
|
|
4543
4604
|
const [filter, setFilter] = hooks.useState('');
|
|
4544
4605
|
const [isDropdownExpanded, setIsDropdownExpanded] = hooks.useState(false);
|
|
4545
4606
|
const [isEscapeClosed, setIsEscapeClose] = hooks.useState(false);
|
|
4607
|
+
|
|
4608
|
+
/** @type {import("preact").RefObject<HTMLDivElement>} */
|
|
4546
4609
|
const focusScopeRef = hooks.useRef();
|
|
4610
|
+
|
|
4611
|
+
/** @type {import("preact").RefObject<HTMLInputElement>} */
|
|
4547
4612
|
const inputRef = hooks.useRef();
|
|
4548
4613
|
const eventBus = useService('eventBus');
|
|
4549
4614
|
const {
|
|
@@ -4732,8 +4797,8 @@ function Taglist(props) {
|
|
|
4732
4797
|
class: "fjs-taglist-anchor",
|
|
4733
4798
|
children: shouldDisplayDropdown && jsxRuntime.jsx(DropdownList, {
|
|
4734
4799
|
values: filteredOptions,
|
|
4735
|
-
getLabel:
|
|
4736
|
-
onValueSelected:
|
|
4800
|
+
getLabel: option => option.label,
|
|
4801
|
+
onValueSelected: option => selectValue(option.value),
|
|
4737
4802
|
emptyListMessage: hasOptionsLeft ? 'No results' : 'All values selected',
|
|
4738
4803
|
listenerElement: inputRef.current
|
|
4739
4804
|
})
|
|
@@ -4749,11 +4814,14 @@ function Taglist(props) {
|
|
|
4749
4814
|
Taglist.config = {
|
|
4750
4815
|
type: type$7,
|
|
4751
4816
|
keyed: true,
|
|
4752
|
-
|
|
4817
|
+
name: 'Tag list',
|
|
4753
4818
|
group: 'selection',
|
|
4754
4819
|
emptyValue: [],
|
|
4755
4820
|
sanitizeValue: sanitizeMultiSelectValue,
|
|
4756
|
-
create:
|
|
4821
|
+
create: (options = {}) => ({
|
|
4822
|
+
label: 'Tag list',
|
|
4823
|
+
...createEmptyOptions(options)
|
|
4824
|
+
})
|
|
4757
4825
|
};
|
|
4758
4826
|
|
|
4759
4827
|
const NODE_TYPE_TEXT = 3,
|
|
@@ -4778,7 +4846,7 @@ function sanitizeHTML(html) {
|
|
|
4778
4846
|
doc.normalize();
|
|
4779
4847
|
const element = doc.body.firstChild;
|
|
4780
4848
|
if (element) {
|
|
4781
|
-
sanitizeNode(
|
|
4849
|
+
sanitizeNode(/** @type Element */element);
|
|
4782
4850
|
return /** @type Element */element.innerHTML;
|
|
4783
4851
|
} else {
|
|
4784
4852
|
// handle the case that document parsing
|
|
@@ -4835,7 +4903,7 @@ function sanitizeNode(node) {
|
|
|
4835
4903
|
node.setAttribute('rel', 'noopener');
|
|
4836
4904
|
}
|
|
4837
4905
|
for (let i = node.childNodes.length; i--;) {
|
|
4838
|
-
sanitizeNode(
|
|
4906
|
+
sanitizeNode(/** @type Element */node.childNodes[i]);
|
|
4839
4907
|
}
|
|
4840
4908
|
}
|
|
4841
4909
|
|
|
@@ -4922,12 +4990,15 @@ function Text(props) {
|
|
|
4922
4990
|
Text.config = {
|
|
4923
4991
|
type: type$6,
|
|
4924
4992
|
keyed: false,
|
|
4925
|
-
|
|
4993
|
+
name: 'Text view',
|
|
4926
4994
|
group: 'presentation',
|
|
4927
4995
|
create: (options = {}) => ({
|
|
4928
4996
|
text: '# Text',
|
|
4929
4997
|
...options
|
|
4930
|
-
})
|
|
4998
|
+
}),
|
|
4999
|
+
getSubheading: field => {
|
|
5000
|
+
textToLabel(field.text);
|
|
5001
|
+
}
|
|
4931
5002
|
};
|
|
4932
5003
|
|
|
4933
5004
|
const type$5 = 'html';
|
|
@@ -4988,7 +5059,7 @@ function Html(props) {
|
|
|
4988
5059
|
Html.config = {
|
|
4989
5060
|
type: type$5,
|
|
4990
5061
|
keyed: false,
|
|
4991
|
-
|
|
5062
|
+
name: 'HTML view',
|
|
4992
5063
|
group: 'presentation',
|
|
4993
5064
|
create: (options = {}) => ({
|
|
4994
5065
|
content: '',
|
|
@@ -5034,7 +5105,7 @@ function ExpressionField(props) {
|
|
|
5034
5105
|
}
|
|
5035
5106
|
ExpressionField.config = {
|
|
5036
5107
|
type: type$4,
|
|
5037
|
-
|
|
5108
|
+
name: 'Expression',
|
|
5038
5109
|
group: 'basic-input',
|
|
5039
5110
|
keyed: true,
|
|
5040
5111
|
emptyValue: null,
|
|
@@ -5127,7 +5198,7 @@ function Textfield(props) {
|
|
|
5127
5198
|
Textfield.config = {
|
|
5128
5199
|
type: type$3,
|
|
5129
5200
|
keyed: true,
|
|
5130
|
-
|
|
5201
|
+
name: 'Text field',
|
|
5131
5202
|
group: 'basic-input',
|
|
5132
5203
|
emptyValue: '',
|
|
5133
5204
|
sanitizeValue: ({
|
|
@@ -5144,6 +5215,7 @@ Textfield.config = {
|
|
|
5144
5215
|
return String(value);
|
|
5145
5216
|
},
|
|
5146
5217
|
create: (options = {}) => ({
|
|
5218
|
+
label: 'Text field',
|
|
5147
5219
|
...options
|
|
5148
5220
|
})
|
|
5149
5221
|
};
|
|
@@ -5232,13 +5304,14 @@ function Textarea(props) {
|
|
|
5232
5304
|
Textarea.config = {
|
|
5233
5305
|
type: type$2,
|
|
5234
5306
|
keyed: true,
|
|
5235
|
-
|
|
5307
|
+
name: 'Text area',
|
|
5236
5308
|
group: 'basic-input',
|
|
5237
5309
|
emptyValue: '',
|
|
5238
5310
|
sanitizeValue: ({
|
|
5239
5311
|
value
|
|
5240
5312
|
}) => minDash.isArray(value) || minDash.isObject(value) || minDash.isNil(value) ? '' : String(value),
|
|
5241
5313
|
create: (options = {}) => ({
|
|
5314
|
+
label: 'Text area',
|
|
5242
5315
|
...options
|
|
5243
5316
|
})
|
|
5244
5317
|
};
|
|
@@ -5262,7 +5335,7 @@ const autoSizeTextarea = textarea => {
|
|
|
5262
5335
|
};
|
|
5263
5336
|
|
|
5264
5337
|
var _path$7;
|
|
5265
|
-
function _extends$7() { _extends$7 = Object.assign ? Object.assign.bind() : function (
|
|
5338
|
+
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
5339
|
var SvgArrowDown = function SvgArrowDown(props) {
|
|
5267
5340
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
|
|
5268
5341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5274,7 +5347,7 @@ var SvgArrowDown = function SvgArrowDown(props) {
|
|
|
5274
5347
|
};
|
|
5275
5348
|
|
|
5276
5349
|
var _path$6;
|
|
5277
|
-
function _extends$6() { _extends$6 = Object.assign ? Object.assign.bind() : function (
|
|
5350
|
+
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
5351
|
var SvgArrowUp = function SvgArrowUp(props) {
|
|
5279
5352
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
|
|
5280
5353
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5286,7 +5359,7 @@ var SvgArrowUp = function SvgArrowUp(props) {
|
|
|
5286
5359
|
};
|
|
5287
5360
|
|
|
5288
5361
|
var _path$5;
|
|
5289
|
-
function _extends$5() { _extends$5 = Object.assign ? Object.assign.bind() : function (
|
|
5362
|
+
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
5363
|
var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
5291
5364
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
5292
5365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5299,7 +5372,7 @@ var SvgCaretLeft = function SvgCaretLeft(props) {
|
|
|
5299
5372
|
};
|
|
5300
5373
|
|
|
5301
5374
|
var _path$4;
|
|
5302
|
-
function _extends$4() { _extends$4 = Object.assign ? Object.assign.bind() : function (
|
|
5375
|
+
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
5376
|
var SvgCaretRight = function SvgCaretRight(props) {
|
|
5304
5377
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
5305
5378
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5350,9 +5423,7 @@ function Table(props) {
|
|
|
5350
5423
|
id,
|
|
5351
5424
|
label
|
|
5352
5425
|
} = field;
|
|
5353
|
-
|
|
5354
|
-
/** @type {[(null|Sorting), import("preact/hooks").StateUpdater<null|Sorting>]} */
|
|
5355
|
-
const [sortBy, setSortBy] = hooks.useState(null);
|
|
5426
|
+
const [sortBy, setSortBy] = hooks.useState(/** @type {Sorting | null} */null);
|
|
5356
5427
|
const evaluatedColumns = useEvaluatedColumns(columnsExpression || '', columns);
|
|
5357
5428
|
const columnKeys = evaluatedColumns.map(({
|
|
5358
5429
|
key
|
|
@@ -5368,6 +5439,12 @@ function Table(props) {
|
|
|
5368
5439
|
hooks.useEffect(() => {
|
|
5369
5440
|
setCurrentPage(0);
|
|
5370
5441
|
}, [rowCount, sortBy]);
|
|
5442
|
+
const serializeCellData = cellData => {
|
|
5443
|
+
if (cellData !== null && typeof cellData === 'object') {
|
|
5444
|
+
return JSON.stringify(cellData);
|
|
5445
|
+
}
|
|
5446
|
+
return cellData;
|
|
5447
|
+
};
|
|
5371
5448
|
|
|
5372
5449
|
/** @param {string} key */
|
|
5373
5450
|
function toggleSortBy(key) {
|
|
@@ -5451,7 +5528,7 @@ function Table(props) {
|
|
|
5451
5528
|
class: "fjs-table-tr",
|
|
5452
5529
|
children: columnKeys.map(key => jsxRuntime.jsx("td", {
|
|
5453
5530
|
class: "fjs-table-td",
|
|
5454
|
-
children: row[key]
|
|
5531
|
+
children: serializeCellData(row[key])
|
|
5455
5532
|
}, key))
|
|
5456
5533
|
}, index))
|
|
5457
5534
|
})]
|
|
@@ -5487,7 +5564,7 @@ function Table(props) {
|
|
|
5487
5564
|
Table.config = {
|
|
5488
5565
|
type: type$1,
|
|
5489
5566
|
keyed: false,
|
|
5490
|
-
|
|
5567
|
+
name: 'Table',
|
|
5491
5568
|
group: 'presentation',
|
|
5492
5569
|
create: (options = {}) => {
|
|
5493
5570
|
const {
|
|
@@ -5516,6 +5593,7 @@ Table.config = {
|
|
|
5516
5593
|
}
|
|
5517
5594
|
return {
|
|
5518
5595
|
...remainingOptions,
|
|
5596
|
+
label: 'Table',
|
|
5519
5597
|
rowCount: 10,
|
|
5520
5598
|
columns: [{
|
|
5521
5599
|
label: 'ID',
|
|
@@ -5949,7 +6027,7 @@ class FormFields {
|
|
|
5949
6027
|
}
|
|
5950
6028
|
}
|
|
5951
6029
|
|
|
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'
|
|
6030
|
+
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
6031
|
const TEMPLATE_PROPERTIES = ['alt', 'appearance.prefixAdorner', 'appearance.suffixAdorner', 'description', 'label', 'source', 'text', 'content', 'url'];
|
|
5954
6032
|
|
|
5955
6033
|
/**
|
|
@@ -6913,7 +6991,7 @@ const ViewerCommandsModule = {
|
|
|
6913
6991
|
};
|
|
6914
6992
|
|
|
6915
6993
|
var _path$3;
|
|
6916
|
-
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (
|
|
6994
|
+
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
6995
|
var SvgExpand = function SvgExpand(props) {
|
|
6918
6996
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
6919
6997
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6927,7 +7005,7 @@ var SvgExpand = function SvgExpand(props) {
|
|
|
6927
7005
|
};
|
|
6928
7006
|
|
|
6929
7007
|
var _path$2;
|
|
6930
|
-
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
7008
|
+
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
7009
|
var SvgCollapse = function SvgCollapse(props) {
|
|
6932
7010
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
6933
7011
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6941,7 +7019,7 @@ var SvgCollapse = function SvgCollapse(props) {
|
|
|
6941
7019
|
};
|
|
6942
7020
|
|
|
6943
7021
|
var _path$1, _path2;
|
|
6944
|
-
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (
|
|
7022
|
+
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
7023
|
var SvgAdd = function SvgAdd(props) {
|
|
6946
7024
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
6947
7025
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6958,7 +7036,7 @@ var SvgAdd = function SvgAdd(props) {
|
|
|
6958
7036
|
};
|
|
6959
7037
|
|
|
6960
7038
|
var _path;
|
|
6961
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
7039
|
+
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
7040
|
var SvgDelete = function SvgDelete(props) {
|
|
6963
7041
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
6964
7042
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7163,7 +7241,7 @@ class RepeatRenderManager {
|
|
|
7163
7241
|
* @param {Object} props.itemValue
|
|
7164
7242
|
* @param {Object} props.parentExpressionContextInfo
|
|
7165
7243
|
* @param {Object} props.repeaterField
|
|
7166
|
-
* @param {
|
|
7244
|
+
* @param {import('preact').FunctionComponent} props.RowsRenderer
|
|
7167
7245
|
* @param {Object} props.indexes
|
|
7168
7246
|
* @param {Function} props.onDeleteItem
|
|
7169
7247
|
* @param {boolean} props.showRemove
|
|
@@ -8047,7 +8125,7 @@ class FieldFactory {
|
|
|
8047
8125
|
this._pathRegistry = pathRegistry;
|
|
8048
8126
|
this._formFields = formFields;
|
|
8049
8127
|
}
|
|
8050
|
-
create(attrs,
|
|
8128
|
+
create(attrs, isNewField = true) {
|
|
8051
8129
|
const {
|
|
8052
8130
|
id,
|
|
8053
8131
|
type,
|
|
@@ -8086,13 +8164,12 @@ class FieldFactory {
|
|
|
8086
8164
|
})) {
|
|
8087
8165
|
throw new Error(`binding path '${[...parentPath, ...path.split('.')].join('.')}' is already claimed`);
|
|
8088
8166
|
}
|
|
8089
|
-
const labelAttrs = applyDefaults && config.label ? {
|
|
8090
|
-
label: config.label
|
|
8091
|
-
} : {};
|
|
8092
8167
|
const field = config.create({
|
|
8093
|
-
...
|
|
8168
|
+
...(config.label ? {
|
|
8169
|
+
label: config.label
|
|
8170
|
+
} : {}),
|
|
8094
8171
|
...attrs
|
|
8095
|
-
});
|
|
8172
|
+
}, isNewField);
|
|
8096
8173
|
this._ensureId(field);
|
|
8097
8174
|
if (config.keyed) {
|
|
8098
8175
|
this._ensureKey(field);
|
|
@@ -8636,10 +8713,10 @@ class FormFieldInstanceRegistry {
|
|
|
8636
8713
|
instanceId
|
|
8637
8714
|
});
|
|
8638
8715
|
} else if (isInstanceExpected && doesInstanceExist) {
|
|
8639
|
-
const
|
|
8716
|
+
const wasInstanceChanged = Object.keys(restInfo).some(key => {
|
|
8640
8717
|
return this._formFieldInstances[instanceId][key] !== restInfo[key];
|
|
8641
8718
|
});
|
|
8642
|
-
if (
|
|
8719
|
+
if (wasInstanceChanged) {
|
|
8643
8720
|
this._formFieldInstances[instanceId] = {
|
|
8644
8721
|
instanceId,
|
|
8645
8722
|
...restInfo
|
|
@@ -8756,7 +8833,7 @@ const extractFileReferencesFromRemovedData = removedData => {
|
|
|
8756
8833
|
return;
|
|
8757
8834
|
}
|
|
8758
8835
|
if (typeof value === 'object') {
|
|
8759
|
-
fileReferences.push(...extractFileReferencesFromRemovedData(
|
|
8836
|
+
fileReferences.push(...extractFileReferencesFromRemovedData(/** @type {RemovedData} */value));
|
|
8760
8837
|
} else if (Array.isArray(value)) {
|
|
8761
8838
|
fileReferences.push(...value.map(extractFileReferencesFromRemovedData).flat());
|
|
8762
8839
|
} else if (typeof value === 'string' && value.startsWith(FILE_PICKER_FILE_KEY_PREFIX)) {
|
|
@@ -9343,7 +9420,7 @@ class Form {
|
|
|
9343
9420
|
}
|
|
9344
9421
|
}
|
|
9345
9422
|
|
|
9346
|
-
const schemaVersion =
|
|
9423
|
+
const schemaVersion = 17;
|
|
9347
9424
|
|
|
9348
9425
|
/**
|
|
9349
9426
|
* @typedef { import('./types').CreateFormOptions } CreateFormOptions
|