@abgov/jsonforms-components 2.70.4 → 2.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js
CHANGED
|
@@ -6,7 +6,8 @@ import axios from 'axios';
|
|
|
6
6
|
import get$1 from 'lodash/get';
|
|
7
7
|
import { toDataPath, INIT, UPDATE_CORE, isVisible, isEnabled, deriveLabelForUISchemaElement, rankWith, isStringControl, and, optionIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, uiTypeIs, isControl as isControl$1, isEnumControl, or, isOneOfEnumControl, isBooleanControl, createDefaultValue, Paths, Resolve, schemaTypeIs, formatIs, getAjv, schemaMatches, isObjectArrayControl, isPrimitiveArrayControl, composePaths, hasType, isCategorization, isLayout } from '@jsonforms/core';
|
|
8
8
|
import * as _$c from 'lodash';
|
|
9
|
-
import ___default, { isEqual, isEmpty, isObject as isObject$i } from 'lodash';
|
|
9
|
+
import ___default, { isEqual as isEqual$1, isEmpty, isObject as isObject$i } from 'lodash';
|
|
10
|
+
import isEqual from 'lodash/isEqual';
|
|
10
11
|
import { useJsonForms, withJsonFormsControlProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, withJsonFormsAllOfProps, withJsonFormsArrayLayoutProps, withJsonFormsLayoutProps, withJsonFormsCellProps } from '@jsonforms/react';
|
|
11
12
|
import dompurify from 'dompurify';
|
|
12
13
|
import * as xss from 'xss';
|
|
@@ -6811,20 +6812,192 @@ $$f({ target: 'Array', proto: true, forced: FORCED$3 }, {
|
|
|
6811
6812
|
}
|
|
6812
6813
|
});
|
|
6813
6814
|
|
|
6815
|
+
var tryToString = tryToString$5;
|
|
6816
|
+
|
|
6817
|
+
var $TypeError$1 = TypeError;
|
|
6818
|
+
|
|
6819
|
+
var deletePropertyOrThrow$2 = function (O, P) {
|
|
6820
|
+
if (!delete O[P]) throw new $TypeError$1('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
|
6821
|
+
};
|
|
6822
|
+
|
|
6823
|
+
var arraySlice$1 = arraySlice$4;
|
|
6824
|
+
|
|
6825
|
+
var floor$2 = Math.floor;
|
|
6826
|
+
|
|
6827
|
+
var sort = function (array, comparefn) {
|
|
6828
|
+
var length = array.length;
|
|
6829
|
+
|
|
6830
|
+
if (length < 8) {
|
|
6831
|
+
// insertion sort
|
|
6832
|
+
var i = 1;
|
|
6833
|
+
var element, j;
|
|
6834
|
+
|
|
6835
|
+
while (i < length) {
|
|
6836
|
+
j = i;
|
|
6837
|
+
element = array[i];
|
|
6838
|
+
while (j && comparefn(array[j - 1], element) > 0) {
|
|
6839
|
+
array[j] = array[--j];
|
|
6840
|
+
}
|
|
6841
|
+
if (j !== i++) array[j] = element;
|
|
6842
|
+
}
|
|
6843
|
+
} else {
|
|
6844
|
+
// merge sort
|
|
6845
|
+
var middle = floor$2(length / 2);
|
|
6846
|
+
var left = sort(arraySlice$1(array, 0, middle), comparefn);
|
|
6847
|
+
var right = sort(arraySlice$1(array, middle), comparefn);
|
|
6848
|
+
var llength = left.length;
|
|
6849
|
+
var rlength = right.length;
|
|
6850
|
+
var lindex = 0;
|
|
6851
|
+
var rindex = 0;
|
|
6852
|
+
|
|
6853
|
+
while (lindex < llength || rindex < rlength) {
|
|
6854
|
+
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
6855
|
+
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
6856
|
+
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
6857
|
+
}
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
return array;
|
|
6861
|
+
};
|
|
6862
|
+
|
|
6863
|
+
var arraySort$1 = sort;
|
|
6864
|
+
|
|
6865
|
+
var userAgent$2 = engineUserAgent;
|
|
6866
|
+
|
|
6867
|
+
var firefox = userAgent$2.match(/firefox\/(\d+)/i);
|
|
6868
|
+
|
|
6869
|
+
var engineFfVersion = !!firefox && +firefox[1];
|
|
6870
|
+
|
|
6871
|
+
var UA = engineUserAgent;
|
|
6872
|
+
|
|
6873
|
+
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
|
6874
|
+
|
|
6875
|
+
var userAgent$1 = engineUserAgent;
|
|
6876
|
+
|
|
6877
|
+
var webkit = userAgent$1.match(/AppleWebKit\/(\d+)\./);
|
|
6878
|
+
|
|
6879
|
+
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
6880
|
+
|
|
6814
6881
|
var $$e = _export;
|
|
6815
|
-
var
|
|
6882
|
+
var uncurryThis$d = functionUncurryThis;
|
|
6816
6883
|
var aCallable$3 = aCallable$k;
|
|
6884
|
+
var toObject$4 = toObject$c;
|
|
6885
|
+
var lengthOfArrayLike$6 = lengthOfArrayLike$c;
|
|
6886
|
+
var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
|
|
6887
|
+
var toString$b = toString$n;
|
|
6888
|
+
var fails$4 = fails$y;
|
|
6889
|
+
var internalSort = arraySort$1;
|
|
6890
|
+
var arrayMethodIsStrict = arrayMethodIsStrict$2;
|
|
6891
|
+
var FF = engineFfVersion;
|
|
6892
|
+
var IE_OR_EDGE = engineIsIeOrEdge;
|
|
6893
|
+
var V8 = engineV8Version;
|
|
6894
|
+
var WEBKIT = engineWebkitVersion;
|
|
6895
|
+
|
|
6896
|
+
var test = [];
|
|
6897
|
+
var nativeSort = uncurryThis$d(test.sort);
|
|
6898
|
+
var push$6 = uncurryThis$d(test.push);
|
|
6899
|
+
|
|
6900
|
+
// IE8-
|
|
6901
|
+
var FAILS_ON_UNDEFINED = fails$4(function () {
|
|
6902
|
+
test.sort(undefined);
|
|
6903
|
+
});
|
|
6904
|
+
// V8 bug
|
|
6905
|
+
var FAILS_ON_NULL = fails$4(function () {
|
|
6906
|
+
test.sort(null);
|
|
6907
|
+
});
|
|
6908
|
+
// Old WebKit
|
|
6909
|
+
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
6910
|
+
|
|
6911
|
+
var STABLE_SORT = !fails$4(function () {
|
|
6912
|
+
// feature detection can be too slow, so check engines versions
|
|
6913
|
+
if (V8) return V8 < 70;
|
|
6914
|
+
if (FF && FF > 3) return;
|
|
6915
|
+
if (IE_OR_EDGE) return true;
|
|
6916
|
+
if (WEBKIT) return WEBKIT < 603;
|
|
6917
|
+
|
|
6918
|
+
var result = '';
|
|
6919
|
+
var code, chr, value, index;
|
|
6920
|
+
|
|
6921
|
+
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
6922
|
+
for (code = 65; code < 76; code++) {
|
|
6923
|
+
chr = String.fromCharCode(code);
|
|
6924
|
+
|
|
6925
|
+
switch (code) {
|
|
6926
|
+
case 66: case 69: case 70: case 72: value = 3; break;
|
|
6927
|
+
case 68: case 71: value = 4; break;
|
|
6928
|
+
default: value = 2;
|
|
6929
|
+
}
|
|
6930
|
+
|
|
6931
|
+
for (index = 0; index < 47; index++) {
|
|
6932
|
+
test.push({ k: chr + index, v: value });
|
|
6933
|
+
}
|
|
6934
|
+
}
|
|
6935
|
+
|
|
6936
|
+
test.sort(function (a, b) { return b.v - a.v; });
|
|
6937
|
+
|
|
6938
|
+
for (index = 0; index < test.length; index++) {
|
|
6939
|
+
chr = test[index].k.charAt(0);
|
|
6940
|
+
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
6941
|
+
}
|
|
6942
|
+
|
|
6943
|
+
return result !== 'DGBEFHACIJK';
|
|
6944
|
+
});
|
|
6945
|
+
|
|
6946
|
+
var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
|
6947
|
+
|
|
6948
|
+
var getSortCompare = function (comparefn) {
|
|
6949
|
+
return function (x, y) {
|
|
6950
|
+
if (y === undefined) return -1;
|
|
6951
|
+
if (x === undefined) return 1;
|
|
6952
|
+
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
6953
|
+
return toString$b(x) > toString$b(y) ? 1 : -1;
|
|
6954
|
+
};
|
|
6955
|
+
};
|
|
6956
|
+
|
|
6957
|
+
// `Array.prototype.sort` method
|
|
6958
|
+
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
6959
|
+
$$e({ target: 'Array', proto: true, forced: FORCED$2 }, {
|
|
6960
|
+
sort: function sort(comparefn) {
|
|
6961
|
+
if (comparefn !== undefined) aCallable$3(comparefn);
|
|
6962
|
+
|
|
6963
|
+
var array = toObject$4(this);
|
|
6964
|
+
|
|
6965
|
+
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
|
6966
|
+
|
|
6967
|
+
var items = [];
|
|
6968
|
+
var arrayLength = lengthOfArrayLike$6(array);
|
|
6969
|
+
var itemsLength, index;
|
|
6970
|
+
|
|
6971
|
+
for (index = 0; index < arrayLength; index++) {
|
|
6972
|
+
if (index in array) push$6(items, array[index]);
|
|
6973
|
+
}
|
|
6974
|
+
|
|
6975
|
+
internalSort(items, getSortCompare(comparefn));
|
|
6976
|
+
|
|
6977
|
+
itemsLength = lengthOfArrayLike$6(items);
|
|
6978
|
+
index = 0;
|
|
6979
|
+
|
|
6980
|
+
while (index < itemsLength) array[index] = items[index++];
|
|
6981
|
+
while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
|
|
6982
|
+
|
|
6983
|
+
return array;
|
|
6984
|
+
}
|
|
6985
|
+
});
|
|
6986
|
+
|
|
6987
|
+
var $$d = _export;
|
|
6988
|
+
var iterate$1 = iterate$a;
|
|
6989
|
+
var aCallable$2 = aCallable$k;
|
|
6817
6990
|
var anObject$5 = anObject$t;
|
|
6818
6991
|
var getIteratorDirect$2 = getIteratorDirect$a;
|
|
6819
6992
|
|
|
6820
|
-
var $TypeError
|
|
6993
|
+
var $TypeError = TypeError;
|
|
6821
6994
|
|
|
6822
6995
|
// `Iterator.prototype.reduce` method
|
|
6823
6996
|
// https://github.com/tc39/proposal-iterator-helpers
|
|
6824
|
-
$$
|
|
6997
|
+
$$d({ target: 'Iterator', proto: true, real: true }, {
|
|
6825
6998
|
reduce: function reduce(reducer /* , initialValue */) {
|
|
6826
6999
|
anObject$5(this);
|
|
6827
|
-
aCallable$
|
|
7000
|
+
aCallable$2(reducer);
|
|
6828
7001
|
var record = getIteratorDirect$2(this);
|
|
6829
7002
|
var noInitial = arguments.length < 2;
|
|
6830
7003
|
var accumulator = noInitial ? undefined : arguments[1];
|
|
@@ -6838,7 +7011,7 @@ $$e({ target: 'Iterator', proto: true, real: true }, {
|
|
|
6838
7011
|
}
|
|
6839
7012
|
counter++;
|
|
6840
7013
|
}, { IS_RECORD: true });
|
|
6841
|
-
if (noInitial) throw new $TypeError
|
|
7014
|
+
if (noInitial) throw new $TypeError('Reduce of empty iterator with no initial value');
|
|
6842
7015
|
return accumulator;
|
|
6843
7016
|
}
|
|
6844
7017
|
});
|
|
@@ -6869,15 +7042,15 @@ const pickPropertyValues = (obj, property, endWithType) => {
|
|
|
6869
7042
|
return values;
|
|
6870
7043
|
};
|
|
6871
7044
|
|
|
6872
|
-
var uncurryThis$
|
|
7045
|
+
var uncurryThis$c = functionUncurryThis;
|
|
6873
7046
|
var hasOwn$4 = hasOwnProperty_1;
|
|
6874
7047
|
|
|
6875
7048
|
var $SyntaxError = SyntaxError;
|
|
6876
7049
|
var $parseInt$2 = parseInt;
|
|
6877
7050
|
var fromCharCode$1 = String.fromCharCode;
|
|
6878
|
-
var at$1 = uncurryThis$
|
|
6879
|
-
var slice$2 = uncurryThis$
|
|
6880
|
-
var exec$4 = uncurryThis$
|
|
7051
|
+
var at$1 = uncurryThis$c(''.charAt);
|
|
7052
|
+
var slice$2 = uncurryThis$c(''.slice);
|
|
7053
|
+
var exec$4 = uncurryThis$c(/./.exec);
|
|
6881
7054
|
|
|
6882
7055
|
var codePoints = {
|
|
6883
7056
|
'\\"': '"',
|
|
@@ -6925,20 +7098,20 @@ var parseJsonString = function (source, i) {
|
|
|
6925
7098
|
return { value: value, end: i };
|
|
6926
7099
|
};
|
|
6927
7100
|
|
|
6928
|
-
var $$
|
|
7101
|
+
var $$c = _export;
|
|
6929
7102
|
var DESCRIPTORS$5 = descriptors;
|
|
6930
7103
|
var global$5 = global$t;
|
|
6931
7104
|
var getBuiltIn = getBuiltIn$b;
|
|
6932
|
-
var uncurryThis$
|
|
7105
|
+
var uncurryThis$b = functionUncurryThis;
|
|
6933
7106
|
var call$7 = functionCall;
|
|
6934
7107
|
var isCallable$2 = isCallable$t;
|
|
6935
7108
|
var isObject$2 = isObject$h;
|
|
6936
7109
|
var isArray$2 = isArray$5;
|
|
6937
7110
|
var hasOwn$3 = hasOwnProperty_1;
|
|
6938
|
-
var toString$
|
|
6939
|
-
var lengthOfArrayLike$
|
|
7111
|
+
var toString$a = toString$n;
|
|
7112
|
+
var lengthOfArrayLike$5 = lengthOfArrayLike$c;
|
|
6940
7113
|
var createProperty$2 = createProperty$4;
|
|
6941
|
-
var fails$
|
|
7114
|
+
var fails$3 = fails$y;
|
|
6942
7115
|
var parseJSONString = parseJsonString;
|
|
6943
7116
|
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
6944
7117
|
|
|
@@ -6949,10 +7122,10 @@ var nativeParse = JSON$1 && JSON$1.parse;
|
|
|
6949
7122
|
var enumerableOwnProperties = getBuiltIn('Object', 'keys');
|
|
6950
7123
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
6951
7124
|
var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
|
6952
|
-
var at = uncurryThis$
|
|
6953
|
-
var slice$1 = uncurryThis$
|
|
6954
|
-
var exec$3 = uncurryThis$
|
|
6955
|
-
var push$
|
|
7125
|
+
var at = uncurryThis$b(''.charAt);
|
|
7126
|
+
var slice$1 = uncurryThis$b(''.slice);
|
|
7127
|
+
var exec$3 = uncurryThis$b(/./.exec);
|
|
7128
|
+
var push$5 = uncurryThis$b([].push);
|
|
6956
7129
|
|
|
6957
7130
|
var IS_DIGIT = /^\d$/;
|
|
6958
7131
|
var IS_NON_ZERO_DIGIT = /^[1-9]$/;
|
|
@@ -6963,7 +7136,7 @@ var PRIMITIVE = 0;
|
|
|
6963
7136
|
var OBJECT = 1;
|
|
6964
7137
|
|
|
6965
7138
|
var $parse = function (source, reviver) {
|
|
6966
|
-
source = toString$
|
|
7139
|
+
source = toString$a(source);
|
|
6967
7140
|
var context = new Context(source, 0);
|
|
6968
7141
|
var root = context.parse();
|
|
6969
7142
|
var value = root.value;
|
|
@@ -6984,13 +7157,13 @@ var internalize = function (holder, name, reviver, node) {
|
|
|
6984
7157
|
var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};
|
|
6985
7158
|
if (nodeIsArray) {
|
|
6986
7159
|
elementRecordsLen = nodes.length;
|
|
6987
|
-
len = lengthOfArrayLike$
|
|
7160
|
+
len = lengthOfArrayLike$5(val);
|
|
6988
7161
|
for (i = 0; i < len; i++) {
|
|
6989
7162
|
internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));
|
|
6990
7163
|
}
|
|
6991
7164
|
} else {
|
|
6992
7165
|
keys = enumerableOwnProperties(val);
|
|
6993
|
-
len = lengthOfArrayLike$
|
|
7166
|
+
len = lengthOfArrayLike$5(keys);
|
|
6994
7167
|
for (i = 0; i < len; i++) {
|
|
6995
7168
|
P = keys[i];
|
|
6996
7169
|
internalizeProperty(val, P, internalize(val, P, reviver, hasOwn$3(nodes, P) ? nodes[P] : undefined));
|
|
@@ -7097,8 +7270,8 @@ Context.prototype = {
|
|
|
7097
7270
|
break;
|
|
7098
7271
|
}
|
|
7099
7272
|
var result = this.fork(i).parse();
|
|
7100
|
-
push$
|
|
7101
|
-
push$
|
|
7273
|
+
push$5(nodes, result);
|
|
7274
|
+
push$5(array, result.value);
|
|
7102
7275
|
i = this.until([',', ']'], result.end);
|
|
7103
7276
|
if (at(source, i) === ',') {
|
|
7104
7277
|
expectElement = true;
|
|
@@ -7153,7 +7326,7 @@ Context.prototype = {
|
|
|
7153
7326
|
}
|
|
7154
7327
|
};
|
|
7155
7328
|
|
|
7156
|
-
var NO_SOURCE_SUPPORT = fails$
|
|
7329
|
+
var NO_SOURCE_SUPPORT = fails$3(function () {
|
|
7157
7330
|
var unsafeInt = '9007199254740993';
|
|
7158
7331
|
var source;
|
|
7159
7332
|
nativeParse(unsafeInt, function (key, value, context) {
|
|
@@ -7162,7 +7335,7 @@ var NO_SOURCE_SUPPORT = fails$4(function () {
|
|
|
7162
7335
|
return source !== unsafeInt;
|
|
7163
7336
|
});
|
|
7164
7337
|
|
|
7165
|
-
var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$
|
|
7338
|
+
var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$3(function () {
|
|
7166
7339
|
// Safari 9 bug
|
|
7167
7340
|
return 1 / nativeParse('-0 \t') !== -Infinity;
|
|
7168
7341
|
});
|
|
@@ -7170,7 +7343,7 @@ var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$4(function () {
|
|
|
7170
7343
|
// `JSON.parse` method
|
|
7171
7344
|
// https://tc39.es/ecma262/#sec-json.parse
|
|
7172
7345
|
// https://github.com/tc39/proposal-json-parse-with-source
|
|
7173
|
-
$$
|
|
7346
|
+
$$c({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
|
|
7174
7347
|
parse: function parse(text, reviver) {
|
|
7175
7348
|
return PROPER_BASE_PARSE && !isCallable$2(reviver) ? nativeParse(text) : $parse(text, reviver);
|
|
7176
7349
|
}
|
|
@@ -7343,6 +7516,9 @@ function anyRequiredFieldEmpty(scopes, data, required, schema) {
|
|
|
7343
7516
|
}
|
|
7344
7517
|
return false;
|
|
7345
7518
|
}
|
|
7519
|
+
// Auto-populate targets reach us either as schema scopes (#/properties/firstName) or as the data
|
|
7520
|
+
// paths toDataPath produces (firstName). Normalize both to the dot form used for value lookups.
|
|
7521
|
+
const toNormalizedPath = pathOrScope => pathOrScope != null && pathOrScope.startsWith('#/') ? normalizeSchemaPath(pathOrScope) : pathOrScope || '';
|
|
7346
7522
|
function getStepStatus(opts) {
|
|
7347
7523
|
const {
|
|
7348
7524
|
scopes,
|
|
@@ -7350,7 +7526,8 @@ function getStepStatus(opts) {
|
|
|
7350
7526
|
schema,
|
|
7351
7527
|
data,
|
|
7352
7528
|
visited,
|
|
7353
|
-
autoPopulatedScopes = []
|
|
7529
|
+
autoPopulatedScopes = [],
|
|
7530
|
+
autoPopulatedValues = []
|
|
7354
7531
|
} = opts;
|
|
7355
7532
|
const normalizedScopes = scopes.map(normalizeSchemaPath).filter(Boolean);
|
|
7356
7533
|
const requiredForScopes = getRequiredForScopes(scopes, schema);
|
|
@@ -7359,9 +7536,32 @@ function getStepStatus(opts) {
|
|
|
7359
7536
|
// Auto-populated values (system-filled from the user profile) are excluded, so:
|
|
7360
7537
|
// - a page the user has never opened is NotStarted even when auto-populated, and
|
|
7361
7538
|
// - a saved form the user actually filled still shows its status when resumed.
|
|
7362
|
-
const autoPopulatedSet = new Set(autoPopulatedScopes.map(
|
|
7539
|
+
const autoPopulatedSet = new Set(autoPopulatedScopes.map(toNormalizedPath).filter(Boolean));
|
|
7540
|
+
const autoPopulatedValueByPath = new Map();
|
|
7541
|
+
autoPopulatedValues.forEach(({
|
|
7542
|
+
path,
|
|
7543
|
+
value
|
|
7544
|
+
}) => {
|
|
7545
|
+
const normalized = toNormalizedPath(path);
|
|
7546
|
+
if (normalized) {
|
|
7547
|
+
autoPopulatedSet.add(normalized);
|
|
7548
|
+
autoPopulatedValueByPath.set(normalized, value);
|
|
7549
|
+
}
|
|
7550
|
+
});
|
|
7551
|
+
// Still system-filled only while the value matches what auto-populate would write. Without a
|
|
7552
|
+
// known value we can't tell an edit from the original, so assume it is untouched.
|
|
7553
|
+
const isStillAutoPopulated = path => {
|
|
7554
|
+
if (!autoPopulatedValueByPath.has(path)) {
|
|
7555
|
+
return true;
|
|
7556
|
+
}
|
|
7557
|
+
return isEqual(get$1(data || {}, path), autoPopulatedValueByPath.get(path));
|
|
7558
|
+
};
|
|
7559
|
+
// Editing or clearing an auto-populated field is user activity in its own right, even when what
|
|
7560
|
+
// is left behind is empty — otherwise clearing a pre-filled field would send the step back to
|
|
7561
|
+
// NotStarted.
|
|
7562
|
+
const userEditedAutoPopulated = normalizedScopes.some(path => autoPopulatedSet.has(path) && !isStillAutoPopulated(path));
|
|
7363
7563
|
const userDataScopes = normalizedScopes.filter(path => !autoPopulatedSet.has(path));
|
|
7364
|
-
const stepHasUserData = userDataScopes.
|
|
7564
|
+
const stepHasUserData = userDataScopes.some(path => hasMeaningfulValue(get$1(data || {}, path))) || userEditedAutoPopulated;
|
|
7365
7565
|
const started = (visited != null ? visited : false) || stepHasUserData;
|
|
7366
7566
|
if (!started) {
|
|
7367
7567
|
return {
|
|
@@ -7499,6 +7699,37 @@ function getIncompletePaths(errors, scopePaths) {
|
|
|
7499
7699
|
const getLocalStorageKeyPrefix = () => {
|
|
7500
7700
|
return window.location.href + '_' + new Date().toISOString().slice(0, 10);
|
|
7501
7701
|
};
|
|
7702
|
+
// Steps the user has opened, persisted per form so the status survives a resume.
|
|
7703
|
+
//
|
|
7704
|
+
// Whether a step was opened cannot be recovered from the form data: a user who edits an
|
|
7705
|
+
// auto-populated field and then puts the original value back leaves data identical to the
|
|
7706
|
+
// untouched case. The visit has to be recorded when it happens, or it is lost.
|
|
7707
|
+
//
|
|
7708
|
+
// Deliberately keyed on the form id rather than the URL+date used by the cacheStatus cache above,
|
|
7709
|
+
// so resuming a draft tomorrow — or from a different route to the same form — still restores it.
|
|
7710
|
+
const getVisitedStepsKey = formId => `adsp.form.${formId}.visitedSteps`;
|
|
7711
|
+
const saveVisitedSteps = (formId, ids) => {
|
|
7712
|
+
if (!formId) return;
|
|
7713
|
+
try {
|
|
7714
|
+
localStorage.setItem(getVisitedStepsKey(formId), JSON.stringify(ids));
|
|
7715
|
+
} catch (err) {
|
|
7716
|
+
// Private browsing and full quotas both throw here. Losing the cache only costs the user the
|
|
7717
|
+
// restored status on resume, so it must never take the form down with it.
|
|
7718
|
+
console.warn(`Could not persist visited steps: ${err}`);
|
|
7719
|
+
}
|
|
7720
|
+
};
|
|
7721
|
+
const getVisitedSteps = formId => {
|
|
7722
|
+
if (!formId) return undefined;
|
|
7723
|
+
try {
|
|
7724
|
+
const value = localStorage.getItem(getVisitedStepsKey(formId));
|
|
7725
|
+
if (!value || !isJson(value)) return undefined;
|
|
7726
|
+
const parsed = JSON.parse(value);
|
|
7727
|
+
return Array.isArray(parsed) ? parsed.filter(id => typeof id === 'number') : undefined;
|
|
7728
|
+
} catch (err) {
|
|
7729
|
+
console.warn(`Could not read visited steps: ${err}`);
|
|
7730
|
+
return undefined;
|
|
7731
|
+
}
|
|
7732
|
+
};
|
|
7502
7733
|
function isJson(str) {
|
|
7503
7734
|
try {
|
|
7504
7735
|
JSON.parse(str);
|
|
@@ -7670,7 +7901,7 @@ const stepperReducer = (state, action) => {
|
|
|
7670
7901
|
};
|
|
7671
7902
|
|
|
7672
7903
|
var isArray$1 = isArray$5;
|
|
7673
|
-
var lengthOfArrayLike$
|
|
7904
|
+
var lengthOfArrayLike$4 = lengthOfArrayLike$c;
|
|
7674
7905
|
var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$3;
|
|
7675
7906
|
var bind$3 = functionBindContext;
|
|
7676
7907
|
|
|
@@ -7687,7 +7918,7 @@ var flattenIntoArray$2 = function (target, original, source, sourceLen, start, d
|
|
|
7687
7918
|
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
|
7688
7919
|
|
|
7689
7920
|
if (depth > 0 && isArray$1(element)) {
|
|
7690
|
-
elementLen = lengthOfArrayLike$
|
|
7921
|
+
elementLen = lengthOfArrayLike$4(element);
|
|
7691
7922
|
targetIndex = flattenIntoArray$2(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
|
7692
7923
|
} else {
|
|
7693
7924
|
doesNotExceedSafeInteger$1(targetIndex + 1);
|
|
@@ -7734,21 +7965,21 @@ var arraySpeciesCreate$2 = function (originalArray, length) {
|
|
|
7734
7965
|
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
|
7735
7966
|
};
|
|
7736
7967
|
|
|
7737
|
-
var $$
|
|
7968
|
+
var $$b = _export;
|
|
7738
7969
|
var flattenIntoArray$1 = flattenIntoArray_1;
|
|
7739
|
-
var aCallable$
|
|
7740
|
-
var toObject$
|
|
7741
|
-
var lengthOfArrayLike$
|
|
7970
|
+
var aCallable$1 = aCallable$k;
|
|
7971
|
+
var toObject$3 = toObject$c;
|
|
7972
|
+
var lengthOfArrayLike$3 = lengthOfArrayLike$c;
|
|
7742
7973
|
var arraySpeciesCreate$1 = arraySpeciesCreate$2;
|
|
7743
7974
|
|
|
7744
7975
|
// `Array.prototype.flatMap` method
|
|
7745
7976
|
// https://tc39.es/ecma262/#sec-array.prototype.flatmap
|
|
7746
|
-
$$
|
|
7977
|
+
$$b({ target: 'Array', proto: true }, {
|
|
7747
7978
|
flatMap: function flatMap(callbackfn /* , thisArg */) {
|
|
7748
|
-
var O = toObject$
|
|
7749
|
-
var sourceLen = lengthOfArrayLike$
|
|
7979
|
+
var O = toObject$3(this);
|
|
7980
|
+
var sourceLen = lengthOfArrayLike$3(O);
|
|
7750
7981
|
var A;
|
|
7751
|
-
aCallable$
|
|
7982
|
+
aCallable$1(callbackfn);
|
|
7752
7983
|
A = arraySpeciesCreate$1(O, 0);
|
|
7753
7984
|
A.length = flattenIntoArray$1(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
|
7754
7985
|
return A;
|
|
@@ -7763,7 +7994,7 @@ var addToUnscopables$1 = addToUnscopables$5;
|
|
|
7763
7994
|
addToUnscopables$1('flatMap');
|
|
7764
7995
|
|
|
7765
7996
|
var call$6 = functionCall;
|
|
7766
|
-
var uncurryThis$
|
|
7997
|
+
var uncurryThis$a = functionUncurryThis;
|
|
7767
7998
|
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
|
|
7768
7999
|
var anObject$4 = anObject$t;
|
|
7769
8000
|
var isNullOrUndefined$1 = isNullOrUndefined$7;
|
|
@@ -7771,21 +8002,21 @@ var requireObjectCoercible$4 = requireObjectCoercible$e;
|
|
|
7771
8002
|
var speciesConstructor = speciesConstructor$2;
|
|
7772
8003
|
var advanceStringIndex$1 = advanceStringIndex$3;
|
|
7773
8004
|
var toLength$3 = toLength$7;
|
|
7774
|
-
var toString$
|
|
8005
|
+
var toString$9 = toString$n;
|
|
7775
8006
|
var getMethod$1 = getMethod$7;
|
|
7776
8007
|
var regExpExec$1 = regexpExecAbstract;
|
|
7777
8008
|
var stickyHelpers = regexpStickyHelpers;
|
|
7778
|
-
var fails$
|
|
8009
|
+
var fails$2 = fails$y;
|
|
7779
8010
|
|
|
7780
8011
|
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
|
7781
8012
|
var MAX_UINT32 = 0xFFFFFFFF;
|
|
7782
8013
|
var min$1 = Math.min;
|
|
7783
|
-
var push$
|
|
7784
|
-
var stringSlice$4 = uncurryThis$
|
|
8014
|
+
var push$4 = uncurryThis$a([].push);
|
|
8015
|
+
var stringSlice$4 = uncurryThis$a(''.slice);
|
|
7785
8016
|
|
|
7786
8017
|
// Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
|
|
7787
8018
|
// Weex JS has frozen built-in prototypes, so use try / catch wrapper
|
|
7788
|
-
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$
|
|
8019
|
+
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails$2(function () {
|
|
7789
8020
|
// eslint-disable-next-line regexp/no-empty-group -- required for testing
|
|
7790
8021
|
var re = /(?:)/;
|
|
7791
8022
|
var originalExec = re.exec;
|
|
@@ -7817,7 +8048,7 @@ fixRegExpWellKnownSymbolLogic$1('split', function (SPLIT, nativeSplit, maybeCall
|
|
|
7817
8048
|
var splitter = isNullOrUndefined$1(separator) ? undefined : getMethod$1(separator, SPLIT);
|
|
7818
8049
|
return splitter
|
|
7819
8050
|
? call$6(splitter, separator, O, limit)
|
|
7820
|
-
: call$6(internalSplit, toString$
|
|
8051
|
+
: call$6(internalSplit, toString$9(O), separator, limit);
|
|
7821
8052
|
},
|
|
7822
8053
|
// `RegExp.prototype[@@split]` method
|
|
7823
8054
|
// https://tc39.es/ecma262/#sec-regexp.prototype-@@split
|
|
@@ -7826,7 +8057,7 @@ fixRegExpWellKnownSymbolLogic$1('split', function (SPLIT, nativeSplit, maybeCall
|
|
|
7826
8057
|
// the 'y' flag.
|
|
7827
8058
|
function (string, limit) {
|
|
7828
8059
|
var rx = anObject$4(this);
|
|
7829
|
-
var S = toString$
|
|
8060
|
+
var S = toString$9(string);
|
|
7830
8061
|
|
|
7831
8062
|
if (!BUGGY) {
|
|
7832
8063
|
var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
|
@@ -7858,16 +8089,16 @@ fixRegExpWellKnownSymbolLogic$1('split', function (SPLIT, nativeSplit, maybeCall
|
|
|
7858
8089
|
) {
|
|
7859
8090
|
q = advanceStringIndex$1(S, q, unicodeMatching);
|
|
7860
8091
|
} else {
|
|
7861
|
-
push$
|
|
8092
|
+
push$4(A, stringSlice$4(S, p, q));
|
|
7862
8093
|
if (A.length === lim) return A;
|
|
7863
8094
|
for (var i = 1; i <= z.length - 1; i++) {
|
|
7864
|
-
push$
|
|
8095
|
+
push$4(A, z[i]);
|
|
7865
8096
|
if (A.length === lim) return A;
|
|
7866
8097
|
}
|
|
7867
8098
|
q = p = e;
|
|
7868
8099
|
}
|
|
7869
8100
|
}
|
|
7870
|
-
push$
|
|
8101
|
+
push$4(A, stringSlice$4(S, p));
|
|
7871
8102
|
return A;
|
|
7872
8103
|
}
|
|
7873
8104
|
];
|
|
@@ -7884,9 +8115,9 @@ var getIteratorFlattenable$1 = function (obj, stringHandling) {
|
|
|
7884
8115
|
return getIteratorDirect$1(anObject$3(method !== undefined ? call$5(method, obj) : obj));
|
|
7885
8116
|
};
|
|
7886
8117
|
|
|
7887
|
-
var $$
|
|
8118
|
+
var $$a = _export;
|
|
7888
8119
|
var call$4 = functionCall;
|
|
7889
|
-
var aCallable
|
|
8120
|
+
var aCallable = aCallable$k;
|
|
7890
8121
|
var anObject$2 = anObject$t;
|
|
7891
8122
|
var getIteratorDirect = getIteratorDirect$a;
|
|
7892
8123
|
var getIteratorFlattenable = getIteratorFlattenable$1;
|
|
@@ -7918,10 +8149,10 @@ var IteratorProxy = createIteratorProxy(function () {
|
|
|
7918
8149
|
|
|
7919
8150
|
// `Iterator.prototype.flatMap` method
|
|
7920
8151
|
// https://github.com/tc39/proposal-iterator-helpers
|
|
7921
|
-
$$
|
|
8152
|
+
$$a({ target: 'Iterator', proto: true, real: true, forced: IS_PURE$1 }, {
|
|
7922
8153
|
flatMap: function flatMap(mapper) {
|
|
7923
8154
|
anObject$2(this);
|
|
7924
|
-
aCallable
|
|
8155
|
+
aCallable(mapper);
|
|
7925
8156
|
return new IteratorProxy(getIteratorDirect(this), {
|
|
7926
8157
|
mapper: mapper,
|
|
7927
8158
|
inner: null
|
|
@@ -8087,49 +8318,226 @@ const createAutoPopulateMiddleware = (uischema, user) => (state, action, default
|
|
|
8087
8318
|
*/
|
|
8088
8319
|
const autoPopulatePropertiesMonaco = [];
|
|
8089
8320
|
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8098
|
-
|
|
8099
|
-
|
|
8100
|
-
|
|
8101
|
-
|
|
8102
|
-
|
|
8103
|
-
|
|
8104
|
-
|
|
8105
|
-
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
//
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8321
|
+
class ContextProviderClass {
|
|
8322
|
+
async addDataByUrl(key, url, processDataFunction, token) {
|
|
8323
|
+
let header = {};
|
|
8324
|
+
const [requestId, axiosWithConfig] = this.getAxiosInterceptorConfig(axios);
|
|
8325
|
+
if (token) {
|
|
8326
|
+
header = Object.assign({}, header, {
|
|
8327
|
+
Authorization: `Bearer ${token}`
|
|
8328
|
+
});
|
|
8329
|
+
}
|
|
8330
|
+
await axiosWithConfig.get(url, header).then(response => {
|
|
8331
|
+
const processedData = processDataFunction(response.data);
|
|
8332
|
+
this.enumValues.set(key, () => processedData);
|
|
8333
|
+
}).catch(err => {
|
|
8334
|
+
if (err.message.includes('CORS')) {
|
|
8335
|
+
console.warn(err.message);
|
|
8336
|
+
} else {
|
|
8337
|
+
console.warn(`addDataByUrl: ${err.message}`);
|
|
8338
|
+
}
|
|
8339
|
+
});
|
|
8340
|
+
axiosWithConfig.interceptors.request.eject(requestId);
|
|
8341
|
+
}
|
|
8342
|
+
constructor() {
|
|
8343
|
+
this.selfProps = void 0;
|
|
8344
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8345
|
+
this.enumValues = new Map();
|
|
8346
|
+
this.enumFunctions = new Map();
|
|
8347
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8348
|
+
this.enumSubmitFunctions = new Map();
|
|
8349
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8350
|
+
this.enumSaveFunctions = new Map();
|
|
8351
|
+
this.baseEnumerator = void 0;
|
|
8352
|
+
this.addFormContextData = (key, data) => {
|
|
8353
|
+
this.enumValues.set(key, () => data);
|
|
8354
|
+
};
|
|
8355
|
+
this.setup = props => {
|
|
8356
|
+
var _props$isFormSubmitte, _props$autoPopulatedD, _this$selfProps;
|
|
8357
|
+
this.selfProps = props;
|
|
8358
|
+
if (props.fileManagement) {
|
|
8359
|
+
const {
|
|
8360
|
+
fileList,
|
|
8361
|
+
uploadFile,
|
|
8362
|
+
downloadFile,
|
|
8363
|
+
deleteFile
|
|
8364
|
+
} = props.fileManagement;
|
|
8365
|
+
this.enumValues.set('file-list', () => fileList);
|
|
8366
|
+
this.enumFunctions.set('upload-file', () => uploadFile);
|
|
8367
|
+
this.enumFunctions.set('download-file', () => downloadFile);
|
|
8368
|
+
this.enumFunctions.set('delete-file', () => deleteFile);
|
|
8369
|
+
}
|
|
8370
|
+
if (props.submit) {
|
|
8371
|
+
const {
|
|
8372
|
+
submitForm,
|
|
8373
|
+
saveForm
|
|
8374
|
+
} = props.submit;
|
|
8375
|
+
const submitFunction = submitForm;
|
|
8376
|
+
const saveFormFunction = saveForm;
|
|
8377
|
+
this.enumSubmitFunctions.set('submit-form', () => submitFunction);
|
|
8378
|
+
this.enumSaveFunctions.set('save-form', () => saveFormFunction);
|
|
8379
|
+
}
|
|
8380
|
+
if (props.data) {
|
|
8381
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8382
|
+
Object.keys(props.data).forEach(item => {
|
|
8383
|
+
this.enumValues.set(item, () => props.data[item]);
|
|
8384
|
+
});
|
|
8385
|
+
}
|
|
8386
|
+
if (!props.children) {
|
|
8387
|
+
return null;
|
|
8388
|
+
}
|
|
8389
|
+
if (props.formUrl) {
|
|
8390
|
+
this.baseEnumerator.formUrl = props.formUrl;
|
|
8391
|
+
}
|
|
8392
|
+
this.baseEnumerator.isFormSubmitted = (_props$isFormSubmitte = props.isFormSubmitted) != null ? _props$isFormSubmitte : false;
|
|
8393
|
+
this.baseEnumerator.autoPopulatedData = (_props$autoPopulatedD = props.autoPopulatedData) != null ? _props$autoPopulatedD : [];
|
|
8394
|
+
this.baseEnumerator.formId = props.formId;
|
|
8395
|
+
return jsx(JsonFormContext.Provider, {
|
|
8396
|
+
value: this.baseEnumerator,
|
|
8397
|
+
children: (_this$selfProps = this.selfProps) == null ? void 0 : _this$selfProps.children
|
|
8398
|
+
});
|
|
8399
|
+
};
|
|
8400
|
+
this.getContextProvider = () => {
|
|
8401
|
+
var _this$selfProps2;
|
|
8402
|
+
return jsx(JsonFormContext.Provider, {
|
|
8403
|
+
value: this.baseEnumerator,
|
|
8404
|
+
children: (_this$selfProps2 = this.selfProps) == null ? void 0 : _this$selfProps2.children
|
|
8405
|
+
});
|
|
8406
|
+
};
|
|
8407
|
+
this.getFormUrl = () => {
|
|
8408
|
+
var _this$selfProps3;
|
|
8409
|
+
return (_this$selfProps3 = this.selfProps) == null ? void 0 : _this$selfProps3.formUrl;
|
|
8410
|
+
};
|
|
8411
|
+
this.getAxiosInterceptorConfig = axios => {
|
|
8412
|
+
const requestId = axios.interceptors.request.use(req => {
|
|
8413
|
+
if (req.data === undefined) {
|
|
8414
|
+
throw new Error(`The URL: ${req.url} encountered a CORS error.`);
|
|
8415
|
+
}
|
|
8416
|
+
return req;
|
|
8417
|
+
});
|
|
8418
|
+
return [requestId, axios];
|
|
8419
|
+
};
|
|
8420
|
+
/**
|
|
8421
|
+
* Grabs data stored under a given key
|
|
8422
|
+
*
|
|
8423
|
+
*/
|
|
8424
|
+
this.getFormContextData = key => {
|
|
8425
|
+
const dataFunction = this.baseEnumerator.data.get(key);
|
|
8426
|
+
return dataFunction && dataFunction();
|
|
8427
|
+
};
|
|
8428
|
+
/**
|
|
8429
|
+
* Grabs all data
|
|
8430
|
+
*
|
|
8431
|
+
*/
|
|
8432
|
+
this.getAllFormContextData = () => {
|
|
8433
|
+
const allData = [];
|
|
8434
|
+
this.baseEnumerator.data.forEach((d, key) => {
|
|
8435
|
+
allData.push({
|
|
8436
|
+
[key]: d()
|
|
8437
|
+
});
|
|
8438
|
+
});
|
|
8439
|
+
return allData;
|
|
8440
|
+
};
|
|
8441
|
+
this.baseEnumerator = {
|
|
8442
|
+
data: this.enumValues,
|
|
8443
|
+
functions: this.enumFunctions,
|
|
8444
|
+
submitFunction: this.enumSubmitFunctions,
|
|
8445
|
+
saveFunction: this.enumSaveFunctions,
|
|
8446
|
+
addFormContextData: this.addFormContextData,
|
|
8447
|
+
getFormContextData: this.getFormContextData,
|
|
8448
|
+
getAllFormContextData: this.getAllFormContextData,
|
|
8449
|
+
formUrl: this.getFormUrl()
|
|
8450
|
+
};
|
|
8451
|
+
this.selfProps = {};
|
|
8452
|
+
}
|
|
8453
|
+
}
|
|
8454
|
+
const ContextProviderC = new ContextProviderClass();
|
|
8455
|
+
const ContextProviderFactory = () => new ContextProviderClass().setup;
|
|
8456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8457
|
+
const JsonFormContext = /*#__PURE__*/createContext(null);
|
|
8458
|
+
|
|
8459
|
+
const REVIEW_CHANGE_ACTION = 'jsonforms/review/change';
|
|
8460
|
+
function reviewReducer(_state, action) {
|
|
8461
|
+
if (action.type === REVIEW_CHANGE_ACTION) {
|
|
8462
|
+
return action.payload;
|
|
8463
|
+
}
|
|
8464
|
+
return null;
|
|
8465
|
+
}
|
|
8466
|
+
const ReviewRenderContext = /*#__PURE__*/createContext(undefined);
|
|
8467
|
+
const ReviewRenderProvider = ({
|
|
8468
|
+
children,
|
|
8469
|
+
onReviewChange
|
|
8470
|
+
}) => {
|
|
8471
|
+
const [reviewChange, dispatch] = useReducer(reviewReducer, null);
|
|
8472
|
+
const onChangeDispatch = useCallback((stepId, scope) => {
|
|
8473
|
+
dispatch({
|
|
8474
|
+
type: REVIEW_CHANGE_ACTION,
|
|
8475
|
+
payload: {
|
|
8476
|
+
stepId,
|
|
8477
|
+
scope
|
|
8478
|
+
}
|
|
8479
|
+
});
|
|
8480
|
+
onReviewChange == null || onReviewChange(stepId, scope);
|
|
8481
|
+
}, [onReviewChange]);
|
|
8482
|
+
const context = useMemo(() => ({
|
|
8483
|
+
isProvided: true,
|
|
8484
|
+
onChangeDispatch,
|
|
8485
|
+
reviewChange
|
|
8486
|
+
}), [onChangeDispatch, reviewChange]);
|
|
8487
|
+
return jsx(ReviewRenderContext.Provider, {
|
|
8488
|
+
value: context,
|
|
8489
|
+
children: children
|
|
8490
|
+
});
|
|
8491
|
+
};
|
|
8492
|
+
const useReviewContext = () => {
|
|
8493
|
+
return useContext(ReviewRenderContext);
|
|
8494
|
+
};
|
|
8495
|
+
|
|
8496
|
+
const createStepperContextInitData = (props, options) => {
|
|
8497
|
+
var _uischema$options, _uischema$options2, _categorization$eleme;
|
|
8498
|
+
const {
|
|
8499
|
+
uischema,
|
|
8500
|
+
data,
|
|
8501
|
+
schema,
|
|
8502
|
+
ajv,
|
|
8503
|
+
t,
|
|
8504
|
+
path
|
|
8505
|
+
} = props;
|
|
8506
|
+
const categorization = uischema;
|
|
8507
|
+
const filteredErrors = ajv.errors && ajv.errors.filter(error => (error == null ? void 0 : error.data) != null);
|
|
8508
|
+
// run validation once, capture errors
|
|
8509
|
+
const valid = ajv.validate(schema, data || {});
|
|
8510
|
+
const isPage = (uischema == null || (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.variant) === 'pages';
|
|
8511
|
+
//TODO: Determine if cachedStatus is still being used by anything in the library
|
|
8512
|
+
// If not, do a proper clean up.
|
|
8513
|
+
const isCacheStatus = (_uischema$options2 = uischema.options) == null ? void 0 : _uischema$options2.cacheStatus;
|
|
8514
|
+
isCacheStatus && getIsVisitFromLocalStorage() || [];
|
|
8515
|
+
const categories = (_categorization$eleme = categorization.elements) == null ? void 0 : _categorization$eleme.map((c, id) => {
|
|
8516
|
+
var _options$visitedIds$h, _options$visitedIds, _deriveLabelForUISche;
|
|
8517
|
+
const scopes = pickPropertyValues(c, 'scope', 'ListWithDetail');
|
|
8518
|
+
// On first mount nothing is visited, so status is driven by whether the step already holds
|
|
8519
|
+
// user-entered data. Auto-populated fields (system-filled from the user profile) are excluded
|
|
8520
|
+
// so an unopened page with only auto-populated values stays NotStarted, while a resumed form
|
|
8521
|
+
// the user actually filled still shows its saved status. On the recomputes that follow every
|
|
8522
|
+
// data change, pages the user has already opened keep their visited state.
|
|
8523
|
+
let visited = (_options$visitedIds$h = options == null || (_options$visitedIds = options.visitedIds) == null ? void 0 : _options$visitedIds.has(id)) != null ? _options$visitedIds$h : false;
|
|
8524
|
+
const autoPopulatedScopes = getAutoPopulateControls(c).map(control => control.scope);
|
|
8525
|
+
const {
|
|
8526
|
+
status,
|
|
8527
|
+
hasRequiredFields
|
|
8528
|
+
} = getStepStatus({
|
|
8529
|
+
scopes,
|
|
8530
|
+
data,
|
|
8531
|
+
errors: filteredErrors != null ? filteredErrors : [],
|
|
8532
|
+
schema,
|
|
8533
|
+
visited,
|
|
8534
|
+
autoPopulatedScopes,
|
|
8535
|
+
autoPopulatedValues: options == null ? void 0 : options.autoPopulatedValues
|
|
8536
|
+
});
|
|
8537
|
+
//If the step has all conditional fields, set visited to true so that the step status will be
|
|
8538
|
+
//completed to enable form to be saved.
|
|
8539
|
+
if (!hasRequiredFields) {
|
|
8540
|
+
visited = true;
|
|
8133
8541
|
}
|
|
8134
8542
|
return {
|
|
8135
8543
|
id,
|
|
@@ -8174,7 +8582,21 @@ const JsonFormsStepperContextProvider = ({
|
|
|
8174
8582
|
data,
|
|
8175
8583
|
uischema
|
|
8176
8584
|
} = StepperProps;
|
|
8177
|
-
const
|
|
8585
|
+
const formCtx = useContext(JsonFormContext);
|
|
8586
|
+
const autoPopulatedValues = formCtx == null ? void 0 : formCtx.autoPopulatedData;
|
|
8587
|
+
const formId = formCtx == null ? void 0 : formCtx.formId;
|
|
8588
|
+
// Steps opened in an earlier session. Seeding these on first mount is what keeps a step the user
|
|
8589
|
+
// has been through from dropping back to NotStarted on resume — including the case where they
|
|
8590
|
+
// edited an auto-populated field and then restored the original value, which leaves nothing in
|
|
8591
|
+
// the data to distinguish it from a step that was never opened.
|
|
8592
|
+
const persistedVisitedIds = useMemo(() => {
|
|
8593
|
+
var _getVisitedSteps;
|
|
8594
|
+
return new Set((_getVisitedSteps = getVisitedSteps(formId)) != null ? _getVisitedSteps : []);
|
|
8595
|
+
}, [formId]);
|
|
8596
|
+
const [stepperState, dispatch] = useReducer(stepperReducer, createStepperContextInitData(StepperProps, {
|
|
8597
|
+
visitedIds: persistedVisitedIds,
|
|
8598
|
+
autoPopulatedValues
|
|
8599
|
+
}));
|
|
8178
8600
|
const stepperDispatch = (StepperProps == null ? void 0 : StepperProps.customDispatch) || dispatch;
|
|
8179
8601
|
const isCacheStatus = (_uischema$options3 = uischema.options) == null ? void 0 : _uischema$options3.cacheStatus;
|
|
8180
8602
|
//prevents infinite loop refresh
|
|
@@ -8276,12 +8698,31 @@ const JsonFormsStepperContextProvider = ({
|
|
|
8276
8698
|
});
|
|
8277
8699
|
//eslint-disable-next-line
|
|
8278
8700
|
}, [ctx == null || (_ctx$core5 = ctx.core) == null ? void 0 : _ctx$core5.errors]);
|
|
8701
|
+
// Persist as the user goes rather than on unload: a draft resumed on another tab, or after a
|
|
8702
|
+
// crash or a killed mobile tab, never fires beforeunload and would otherwise lose the visits.
|
|
8703
|
+
// The categories array is rebuilt on every data change, so this effect runs on each keystroke —
|
|
8704
|
+
// only touch storage when the set has actually grown.
|
|
8705
|
+
const lastPersistedVisited = useRef(null);
|
|
8706
|
+
useEffect(() => {
|
|
8707
|
+
var _stepperState$categor3, _stepperState$categor4;
|
|
8708
|
+
const visitedIds = (_stepperState$categor3 = stepperState == null || (_stepperState$categor4 = stepperState.categories) == null ? void 0 : _stepperState$categor4.filter(c => c.isVisited).map(c => c.id)) != null ? _stepperState$categor3 : [];
|
|
8709
|
+
const merged = [...new Set([...persistedVisitedIds, ...visitedIds])].sort((a, b) => a - b);
|
|
8710
|
+
if (merged.length === 0) {
|
|
8711
|
+
return;
|
|
8712
|
+
}
|
|
8713
|
+
const serialized = JSON.stringify(merged);
|
|
8714
|
+
if (serialized === lastPersistedVisited.current) {
|
|
8715
|
+
return;
|
|
8716
|
+
}
|
|
8717
|
+
lastPersistedVisited.current = serialized;
|
|
8718
|
+
saveVisitedSteps(formId, merged);
|
|
8719
|
+
}, [formId, persistedVisitedIds, stepperState == null ? void 0 : stepperState.categories]);
|
|
8279
8720
|
/* istanbul ignore next */
|
|
8280
8721
|
useEffect(() => {
|
|
8281
8722
|
const handleBeforeUnload = () => {
|
|
8282
8723
|
if (isCacheStatus) {
|
|
8283
|
-
var _stepperState$
|
|
8284
|
-
saveIsVisitFromLocalStorage((stepperState == null || (_stepperState$
|
|
8724
|
+
var _stepperState$categor5;
|
|
8725
|
+
saveIsVisitFromLocalStorage((stepperState == null || (_stepperState$categor5 = stepperState.categories) == null ? void 0 : _stepperState$categor5.map(c => c == null ? void 0 : c.isVisited)) || []);
|
|
8285
8726
|
}
|
|
8286
8727
|
};
|
|
8287
8728
|
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
@@ -8292,13 +8733,17 @@ const JsonFormsStepperContextProvider = ({
|
|
|
8292
8733
|
}, [stepperState]);
|
|
8293
8734
|
useEffect(() => {
|
|
8294
8735
|
if ((context == null ? void 0 : context.isProvided) === true) {
|
|
8736
|
+
var _stepperState$categor6, _stepperState$categor7;
|
|
8295
8737
|
/* The block is used to cache the state for the tenant web app review editor */
|
|
8296
8738
|
stepperDispatch({
|
|
8297
8739
|
type: 'update/uischema',
|
|
8298
8740
|
payload: {
|
|
8299
8741
|
state: createStepperContextInitData(Object.assign({}, StepperProps, {
|
|
8300
8742
|
activeId: Math.min(stepperState == null ? void 0 : stepperState.activeId, stepperState.maxReachedStep)
|
|
8301
|
-
})
|
|
8743
|
+
}), {
|
|
8744
|
+
visitedIds: new Set([...persistedVisitedIds, ...((_stepperState$categor6 = stepperState == null || (_stepperState$categor7 = stepperState.categories) == null ? void 0 : _stepperState$categor7.filter(c => c.isVisited).map(c => c.id)) != null ? _stepperState$categor6 : [])]),
|
|
8745
|
+
autoPopulatedValues
|
|
8746
|
+
})
|
|
8302
8747
|
}
|
|
8303
8748
|
});
|
|
8304
8749
|
if (stepperState.activeId !== stepperState.categories.length + 1) {
|
|
@@ -8467,14 +8912,14 @@ const GoAInputBaseControl = props => {
|
|
|
8467
8912
|
});
|
|
8468
8913
|
};
|
|
8469
8914
|
|
|
8470
|
-
var $$
|
|
8915
|
+
var $$9 = _export;
|
|
8471
8916
|
var DESCRIPTORS$4 = descriptors;
|
|
8472
8917
|
var global$4 = global$t;
|
|
8473
|
-
var uncurryThis$
|
|
8918
|
+
var uncurryThis$9 = functionUncurryThis;
|
|
8474
8919
|
var hasOwn$2 = hasOwnProperty_1;
|
|
8475
8920
|
var isCallable$1 = isCallable$t;
|
|
8476
8921
|
var isPrototypeOf = objectIsPrototypeOf;
|
|
8477
|
-
var toString$
|
|
8922
|
+
var toString$8 = toString$n;
|
|
8478
8923
|
var defineBuiltInAccessor$3 = defineBuiltInAccessor$7;
|
|
8479
8924
|
var copyConstructorProperties = copyConstructorProperties$3;
|
|
8480
8925
|
|
|
@@ -8488,7 +8933,7 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
|
|
|
8488
8933
|
var EmptyStringDescriptionStore = {};
|
|
8489
8934
|
// wrap Symbol constructor for correct work with undefined description
|
|
8490
8935
|
var SymbolWrapper = function Symbol() {
|
|
8491
|
-
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$
|
|
8936
|
+
var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$8(arguments[0]);
|
|
8492
8937
|
var result = isPrototypeOf(SymbolPrototype, this)
|
|
8493
8938
|
? new NativeSymbol(description)
|
|
8494
8939
|
// in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
|
|
@@ -8502,11 +8947,11 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
|
|
|
8502
8947
|
SymbolPrototype.constructor = SymbolWrapper;
|
|
8503
8948
|
|
|
8504
8949
|
var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
|
|
8505
|
-
var thisSymbolValue = uncurryThis$
|
|
8506
|
-
var symbolDescriptiveString = uncurryThis$
|
|
8950
|
+
var thisSymbolValue = uncurryThis$9(SymbolPrototype.valueOf);
|
|
8951
|
+
var symbolDescriptiveString = uncurryThis$9(SymbolPrototype.toString);
|
|
8507
8952
|
var regexp = /^Symbol\((.*)\)[^)]+$/;
|
|
8508
|
-
var replace$3 = uncurryThis$
|
|
8509
|
-
var stringSlice$3 = uncurryThis$
|
|
8953
|
+
var replace$3 = uncurryThis$9(''.replace);
|
|
8954
|
+
var stringSlice$3 = uncurryThis$9(''.slice);
|
|
8510
8955
|
|
|
8511
8956
|
defineBuiltInAccessor$3(SymbolPrototype, 'description', {
|
|
8512
8957
|
configurable: true,
|
|
@@ -8519,7 +8964,7 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
|
|
|
8519
8964
|
}
|
|
8520
8965
|
});
|
|
8521
8966
|
|
|
8522
|
-
$$
|
|
8967
|
+
$$9({ global: true, constructor: true, forced: true }, {
|
|
8523
8968
|
Symbol: SymbolWrapper
|
|
8524
8969
|
});
|
|
8525
8970
|
}
|
|
@@ -8529,7 +8974,7 @@ var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
|
|
|
8529
8974
|
var anObject$1 = anObject$t;
|
|
8530
8975
|
var isNullOrUndefined = isNullOrUndefined$7;
|
|
8531
8976
|
var toLength$2 = toLength$7;
|
|
8532
|
-
var toString$
|
|
8977
|
+
var toString$7 = toString$n;
|
|
8533
8978
|
var requireObjectCoercible$3 = requireObjectCoercible$e;
|
|
8534
8979
|
var getMethod = getMethod$7;
|
|
8535
8980
|
var advanceStringIndex = advanceStringIndex$3;
|
|
@@ -8543,13 +8988,13 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
|
|
|
8543
8988
|
function match(regexp) {
|
|
8544
8989
|
var O = requireObjectCoercible$3(this);
|
|
8545
8990
|
var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);
|
|
8546
|
-
return matcher ? call$3(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$
|
|
8991
|
+
return matcher ? call$3(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$7(O));
|
|
8547
8992
|
},
|
|
8548
8993
|
// `RegExp.prototype[@@match]` method
|
|
8549
8994
|
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
|
|
8550
8995
|
function (string) {
|
|
8551
8996
|
var rx = anObject$1(this);
|
|
8552
|
-
var S = toString$
|
|
8997
|
+
var S = toString$7(string);
|
|
8553
8998
|
var res = maybeCallNative(nativeMatch, rx, S);
|
|
8554
8999
|
|
|
8555
9000
|
if (res.done) return res.value;
|
|
@@ -8562,7 +9007,7 @@ fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNa
|
|
|
8562
9007
|
var n = 0;
|
|
8563
9008
|
var result;
|
|
8564
9009
|
while ((result = regExpExec(rx, S)) !== null) {
|
|
8565
|
-
var matchStr = toString$
|
|
9010
|
+
var matchStr = toString$7(result[0]);
|
|
8566
9011
|
A[n] = matchStr;
|
|
8567
9012
|
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
|
|
8568
9013
|
n++;
|
|
@@ -8876,7 +9321,7 @@ function useDebouncedCommit(externalValue, commit, delay = COMMIT_DELAY) {
|
|
|
8876
9321
|
if (pendingRef.current !== null) {
|
|
8877
9322
|
return;
|
|
8878
9323
|
}
|
|
8879
|
-
setLocalValue(current => isEqual(current, externalValue) ? current : externalValue);
|
|
9324
|
+
setLocalValue(current => isEqual$1(current, externalValue) ? current : externalValue);
|
|
8880
9325
|
}, [externalValue]);
|
|
8881
9326
|
// Don't drop the tail of what was typed when the control goes away, e.g. on stepper navigation.
|
|
8882
9327
|
useEffect(() => flush, [flush]);
|
|
@@ -8968,7 +9413,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
8968
9413
|
}
|
|
8969
9414
|
|
|
8970
9415
|
var toIntegerOrInfinity$1 = toIntegerOrInfinity$9;
|
|
8971
|
-
var toString$
|
|
9416
|
+
var toString$6 = toString$n;
|
|
8972
9417
|
var requireObjectCoercible$2 = requireObjectCoercible$e;
|
|
8973
9418
|
|
|
8974
9419
|
var $RangeError$1 = RangeError;
|
|
@@ -8976,7 +9421,7 @@ var $RangeError$1 = RangeError;
|
|
|
8976
9421
|
// `String.prototype.repeat` method implementation
|
|
8977
9422
|
// https://tc39.es/ecma262/#sec-string.prototype.repeat
|
|
8978
9423
|
var stringRepeat = function repeat(count) {
|
|
8979
|
-
var str = toString$
|
|
9424
|
+
var str = toString$6(requireObjectCoercible$2(this));
|
|
8980
9425
|
var result = '';
|
|
8981
9426
|
var n = toIntegerOrInfinity$1(count);
|
|
8982
9427
|
if (n < 0 || n === Infinity) throw new $RangeError$1('Wrong number of repetitions');
|
|
@@ -8985,23 +9430,23 @@ var stringRepeat = function repeat(count) {
|
|
|
8985
9430
|
};
|
|
8986
9431
|
|
|
8987
9432
|
// https://github.com/tc39/proposal-string-pad-start-end
|
|
8988
|
-
var uncurryThis$
|
|
9433
|
+
var uncurryThis$8 = functionUncurryThis;
|
|
8989
9434
|
var toLength$1 = toLength$7;
|
|
8990
|
-
var toString$
|
|
9435
|
+
var toString$5 = toString$n;
|
|
8991
9436
|
var $repeat = stringRepeat;
|
|
8992
9437
|
var requireObjectCoercible$1 = requireObjectCoercible$e;
|
|
8993
9438
|
|
|
8994
|
-
var repeat = uncurryThis$
|
|
8995
|
-
var stringSlice$2 = uncurryThis$
|
|
9439
|
+
var repeat = uncurryThis$8($repeat);
|
|
9440
|
+
var stringSlice$2 = uncurryThis$8(''.slice);
|
|
8996
9441
|
var ceil = Math.ceil;
|
|
8997
9442
|
|
|
8998
9443
|
// `String.prototype.{ padStart, padEnd }` methods implementation
|
|
8999
9444
|
var createMethod = function (IS_END) {
|
|
9000
9445
|
return function ($this, maxLength, fillString) {
|
|
9001
|
-
var S = toString$
|
|
9446
|
+
var S = toString$5(requireObjectCoercible$1($this));
|
|
9002
9447
|
var intMaxLength = toLength$1(maxLength);
|
|
9003
9448
|
var stringLength = S.length;
|
|
9004
|
-
var fillStr = fillString === undefined ? ' ' : toString$
|
|
9449
|
+
var fillStr = fillString === undefined ? ' ' : toString$5(fillString);
|
|
9005
9450
|
var fillLen, stringFiller;
|
|
9006
9451
|
if (intMaxLength <= stringLength || fillStr === '') return S;
|
|
9007
9452
|
fillLen = intMaxLength - stringLength;
|
|
@@ -9017,17 +9462,17 @@ var stringPad = {
|
|
|
9017
9462
|
start: createMethod(false)};
|
|
9018
9463
|
|
|
9019
9464
|
// https://github.com/zloirock/core-js/issues/280
|
|
9020
|
-
var userAgent
|
|
9465
|
+
var userAgent = engineUserAgent;
|
|
9021
9466
|
|
|
9022
|
-
var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent
|
|
9467
|
+
var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
|
|
9023
9468
|
|
|
9024
|
-
var $$
|
|
9469
|
+
var $$8 = _export;
|
|
9025
9470
|
var $padStart = stringPad.start;
|
|
9026
9471
|
var WEBKIT_BUG = stringPadWebkitBug;
|
|
9027
9472
|
|
|
9028
9473
|
// `String.prototype.padStart` method
|
|
9029
9474
|
// https://tc39.es/ecma262/#sec-string.prototype.padstart
|
|
9030
|
-
$$
|
|
9475
|
+
$$8({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
|
9031
9476
|
padStart: function padStart(maxLength /* , fillString = ' ' */) {
|
|
9032
9477
|
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
|
9033
9478
|
}
|
|
@@ -10028,19 +10473,11 @@ const GoInputBaseReview = props => jsx(GoAInputBaseControl, Object.assign({}, pr
|
|
|
10028
10473
|
}));
|
|
10029
10474
|
const GoAInputBaseReviewControl = withJsonFormsControlProps(GoInputBaseReview);
|
|
10030
10475
|
|
|
10031
|
-
var
|
|
10032
|
-
|
|
10033
|
-
var $
|
|
10034
|
-
|
|
10035
|
-
var deletePropertyOrThrow$2 = function (O, P) {
|
|
10036
|
-
if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
|
10037
|
-
};
|
|
10038
|
-
|
|
10039
|
-
var $$8 = _export;
|
|
10040
|
-
var toObject$3 = toObject$c;
|
|
10041
|
-
var lengthOfArrayLike$3 = lengthOfArrayLike$c;
|
|
10476
|
+
var $$7 = _export;
|
|
10477
|
+
var toObject$2 = toObject$c;
|
|
10478
|
+
var lengthOfArrayLike$2 = lengthOfArrayLike$c;
|
|
10042
10479
|
var setArrayLength = arraySetLength;
|
|
10043
|
-
var deletePropertyOrThrow
|
|
10480
|
+
var deletePropertyOrThrow = deletePropertyOrThrow$2;
|
|
10044
10481
|
var doesNotExceedSafeInteger = doesNotExceedSafeInteger$3;
|
|
10045
10482
|
|
|
10046
10483
|
// IE8-
|
|
@@ -10056,15 +10493,15 @@ var properErrorOnNonWritableLength = function () {
|
|
|
10056
10493
|
}
|
|
10057
10494
|
};
|
|
10058
10495
|
|
|
10059
|
-
var FORCED$
|
|
10496
|
+
var FORCED$1 = INCORRECT_RESULT || !properErrorOnNonWritableLength();
|
|
10060
10497
|
|
|
10061
10498
|
// `Array.prototype.unshift` method
|
|
10062
10499
|
// https://tc39.es/ecma262/#sec-array.prototype.unshift
|
|
10063
|
-
$$
|
|
10500
|
+
$$7({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
|
|
10064
10501
|
// eslint-disable-next-line no-unused-vars -- required for `.length`
|
|
10065
10502
|
unshift: function unshift(item) {
|
|
10066
|
-
var O = toObject$
|
|
10067
|
-
var len = lengthOfArrayLike$
|
|
10503
|
+
var O = toObject$2(this);
|
|
10504
|
+
var len = lengthOfArrayLike$2(O);
|
|
10068
10505
|
var argCount = arguments.length;
|
|
10069
10506
|
if (argCount) {
|
|
10070
10507
|
doesNotExceedSafeInteger(len + argCount);
|
|
@@ -10072,7 +10509,7 @@ $$8({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
|
|
|
10072
10509
|
while (k--) {
|
|
10073
10510
|
var to = k + argCount;
|
|
10074
10511
|
if (k in O) O[to] = O[k];
|
|
10075
|
-
else deletePropertyOrThrow
|
|
10512
|
+
else deletePropertyOrThrow(O, to);
|
|
10076
10513
|
}
|
|
10077
10514
|
for (var j = 0; j < argCount; j++) {
|
|
10078
10515
|
O[j] = arguments[j];
|
|
@@ -11511,43 +11948,6 @@ class ListWithDetailControl extends React.Component {
|
|
|
11511
11948
|
}
|
|
11512
11949
|
}
|
|
11513
11950
|
|
|
11514
|
-
const REVIEW_CHANGE_ACTION = 'jsonforms/review/change';
|
|
11515
|
-
function reviewReducer(_state, action) {
|
|
11516
|
-
if (action.type === REVIEW_CHANGE_ACTION) {
|
|
11517
|
-
return action.payload;
|
|
11518
|
-
}
|
|
11519
|
-
return null;
|
|
11520
|
-
}
|
|
11521
|
-
const ReviewRenderContext = /*#__PURE__*/createContext(undefined);
|
|
11522
|
-
const ReviewRenderProvider = ({
|
|
11523
|
-
children,
|
|
11524
|
-
onReviewChange
|
|
11525
|
-
}) => {
|
|
11526
|
-
const [reviewChange, dispatch] = useReducer(reviewReducer, null);
|
|
11527
|
-
const onChangeDispatch = useCallback((stepId, scope) => {
|
|
11528
|
-
dispatch({
|
|
11529
|
-
type: REVIEW_CHANGE_ACTION,
|
|
11530
|
-
payload: {
|
|
11531
|
-
stepId,
|
|
11532
|
-
scope
|
|
11533
|
-
}
|
|
11534
|
-
});
|
|
11535
|
-
onReviewChange == null || onReviewChange(stepId, scope);
|
|
11536
|
-
}, [onReviewChange]);
|
|
11537
|
-
const context = useMemo(() => ({
|
|
11538
|
-
isProvided: true,
|
|
11539
|
-
onChangeDispatch,
|
|
11540
|
-
reviewChange
|
|
11541
|
-
}), [onChangeDispatch, reviewChange]);
|
|
11542
|
-
return jsx(ReviewRenderContext.Provider, {
|
|
11543
|
-
value: context,
|
|
11544
|
-
children: children
|
|
11545
|
-
});
|
|
11546
|
-
};
|
|
11547
|
-
const useReviewContext = () => {
|
|
11548
|
-
return useContext(ReviewRenderContext);
|
|
11549
|
-
};
|
|
11550
|
-
|
|
11551
11951
|
const GoAInputBaseTableReview = props => {
|
|
11552
11952
|
var _uischema$options, _uischema$scope2, _jsonForms$core, _uischema$options4, _uischema$options5, _uischema$options6;
|
|
11553
11953
|
const {
|
|
@@ -12206,142 +12606,6 @@ const SummaryTd = styled.td(_t28 || (_t28 = _$6`
|
|
|
12206
12606
|
padding: 0 !important;
|
|
12207
12607
|
`));
|
|
12208
12608
|
|
|
12209
|
-
class ContextProviderClass {
|
|
12210
|
-
async addDataByUrl(key, url, processDataFunction, token) {
|
|
12211
|
-
let header = {};
|
|
12212
|
-
const [requestId, axiosWithConfig] = this.getAxiosInterceptorConfig(axios);
|
|
12213
|
-
if (token) {
|
|
12214
|
-
header = Object.assign({}, header, {
|
|
12215
|
-
Authorization: `Bearer ${token}`
|
|
12216
|
-
});
|
|
12217
|
-
}
|
|
12218
|
-
await axiosWithConfig.get(url, header).then(response => {
|
|
12219
|
-
const processedData = processDataFunction(response.data);
|
|
12220
|
-
this.enumValues.set(key, () => processedData);
|
|
12221
|
-
}).catch(err => {
|
|
12222
|
-
if (err.message.includes('CORS')) {
|
|
12223
|
-
console.warn(err.message);
|
|
12224
|
-
} else {
|
|
12225
|
-
console.warn(`addDataByUrl: ${err.message}`);
|
|
12226
|
-
}
|
|
12227
|
-
});
|
|
12228
|
-
axiosWithConfig.interceptors.request.eject(requestId);
|
|
12229
|
-
}
|
|
12230
|
-
constructor() {
|
|
12231
|
-
this.selfProps = void 0;
|
|
12232
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12233
|
-
this.enumValues = new Map();
|
|
12234
|
-
this.enumFunctions = new Map();
|
|
12235
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12236
|
-
this.enumSubmitFunctions = new Map();
|
|
12237
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12238
|
-
this.enumSaveFunctions = new Map();
|
|
12239
|
-
this.baseEnumerator = void 0;
|
|
12240
|
-
this.addFormContextData = (key, data) => {
|
|
12241
|
-
this.enumValues.set(key, () => data);
|
|
12242
|
-
};
|
|
12243
|
-
this.setup = props => {
|
|
12244
|
-
var _props$isFormSubmitte, _this$selfProps;
|
|
12245
|
-
this.selfProps = props;
|
|
12246
|
-
if (props.fileManagement) {
|
|
12247
|
-
const {
|
|
12248
|
-
fileList,
|
|
12249
|
-
uploadFile,
|
|
12250
|
-
downloadFile,
|
|
12251
|
-
deleteFile
|
|
12252
|
-
} = props.fileManagement;
|
|
12253
|
-
this.enumValues.set('file-list', () => fileList);
|
|
12254
|
-
this.enumFunctions.set('upload-file', () => uploadFile);
|
|
12255
|
-
this.enumFunctions.set('download-file', () => downloadFile);
|
|
12256
|
-
this.enumFunctions.set('delete-file', () => deleteFile);
|
|
12257
|
-
}
|
|
12258
|
-
if (props.submit) {
|
|
12259
|
-
const {
|
|
12260
|
-
submitForm,
|
|
12261
|
-
saveForm
|
|
12262
|
-
} = props.submit;
|
|
12263
|
-
const submitFunction = submitForm;
|
|
12264
|
-
const saveFormFunction = saveForm;
|
|
12265
|
-
this.enumSubmitFunctions.set('submit-form', () => submitFunction);
|
|
12266
|
-
this.enumSaveFunctions.set('save-form', () => saveFormFunction);
|
|
12267
|
-
}
|
|
12268
|
-
if (props.data) {
|
|
12269
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12270
|
-
Object.keys(props.data).forEach(item => {
|
|
12271
|
-
this.enumValues.set(item, () => props.data[item]);
|
|
12272
|
-
});
|
|
12273
|
-
}
|
|
12274
|
-
if (!props.children) {
|
|
12275
|
-
return null;
|
|
12276
|
-
}
|
|
12277
|
-
if (props.formUrl) {
|
|
12278
|
-
this.baseEnumerator.formUrl = props.formUrl;
|
|
12279
|
-
}
|
|
12280
|
-
this.baseEnumerator.isFormSubmitted = (_props$isFormSubmitte = props.isFormSubmitted) != null ? _props$isFormSubmitte : false;
|
|
12281
|
-
return jsx(JsonFormContext.Provider, {
|
|
12282
|
-
value: this.baseEnumerator,
|
|
12283
|
-
children: (_this$selfProps = this.selfProps) == null ? void 0 : _this$selfProps.children
|
|
12284
|
-
});
|
|
12285
|
-
};
|
|
12286
|
-
this.getContextProvider = () => {
|
|
12287
|
-
var _this$selfProps2;
|
|
12288
|
-
return jsx(JsonFormContext.Provider, {
|
|
12289
|
-
value: this.baseEnumerator,
|
|
12290
|
-
children: (_this$selfProps2 = this.selfProps) == null ? void 0 : _this$selfProps2.children
|
|
12291
|
-
});
|
|
12292
|
-
};
|
|
12293
|
-
this.getFormUrl = () => {
|
|
12294
|
-
var _this$selfProps3;
|
|
12295
|
-
return (_this$selfProps3 = this.selfProps) == null ? void 0 : _this$selfProps3.formUrl;
|
|
12296
|
-
};
|
|
12297
|
-
this.getAxiosInterceptorConfig = axios => {
|
|
12298
|
-
const requestId = axios.interceptors.request.use(req => {
|
|
12299
|
-
if (req.data === undefined) {
|
|
12300
|
-
throw new Error(`The URL: ${req.url} encountered a CORS error.`);
|
|
12301
|
-
}
|
|
12302
|
-
return req;
|
|
12303
|
-
});
|
|
12304
|
-
return [requestId, axios];
|
|
12305
|
-
};
|
|
12306
|
-
/**
|
|
12307
|
-
* Grabs data stored under a given key
|
|
12308
|
-
*
|
|
12309
|
-
*/
|
|
12310
|
-
this.getFormContextData = key => {
|
|
12311
|
-
const dataFunction = this.baseEnumerator.data.get(key);
|
|
12312
|
-
return dataFunction && dataFunction();
|
|
12313
|
-
};
|
|
12314
|
-
/**
|
|
12315
|
-
* Grabs all data
|
|
12316
|
-
*
|
|
12317
|
-
*/
|
|
12318
|
-
this.getAllFormContextData = () => {
|
|
12319
|
-
const allData = [];
|
|
12320
|
-
this.baseEnumerator.data.forEach((d, key) => {
|
|
12321
|
-
allData.push({
|
|
12322
|
-
[key]: d()
|
|
12323
|
-
});
|
|
12324
|
-
});
|
|
12325
|
-
return allData;
|
|
12326
|
-
};
|
|
12327
|
-
this.baseEnumerator = {
|
|
12328
|
-
data: this.enumValues,
|
|
12329
|
-
functions: this.enumFunctions,
|
|
12330
|
-
submitFunction: this.enumSubmitFunctions,
|
|
12331
|
-
saveFunction: this.enumSaveFunctions,
|
|
12332
|
-
addFormContextData: this.addFormContextData,
|
|
12333
|
-
getFormContextData: this.getFormContextData,
|
|
12334
|
-
getAllFormContextData: this.getAllFormContextData,
|
|
12335
|
-
formUrl: this.getFormUrl()
|
|
12336
|
-
};
|
|
12337
|
-
this.selfProps = {};
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
const ContextProviderC = new ContextProviderClass();
|
|
12341
|
-
const ContextProviderFactory = () => new ContextProviderClass().setup;
|
|
12342
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12343
|
-
const JsonFormContext = /*#__PURE__*/createContext(null);
|
|
12344
|
-
|
|
12345
12609
|
const RenderStepElements = props => {
|
|
12346
12610
|
var _props$category;
|
|
12347
12611
|
const memoizedSchema = useMemo(() => Object.assign({}, props.schema), [props.schema]);
|
|
@@ -12363,20 +12627,20 @@ const RenderStepElements = props => {
|
|
|
12363
12627
|
});
|
|
12364
12628
|
};
|
|
12365
12629
|
|
|
12366
|
-
var $$
|
|
12630
|
+
var $$6 = _export;
|
|
12367
12631
|
var flattenIntoArray = flattenIntoArray_1;
|
|
12368
|
-
var toObject$
|
|
12369
|
-
var lengthOfArrayLike$
|
|
12632
|
+
var toObject$1 = toObject$c;
|
|
12633
|
+
var lengthOfArrayLike$1 = lengthOfArrayLike$c;
|
|
12370
12634
|
var toIntegerOrInfinity = toIntegerOrInfinity$9;
|
|
12371
12635
|
var arraySpeciesCreate = arraySpeciesCreate$2;
|
|
12372
12636
|
|
|
12373
12637
|
// `Array.prototype.flat` method
|
|
12374
12638
|
// https://tc39.es/ecma262/#sec-array.prototype.flat
|
|
12375
|
-
$$
|
|
12639
|
+
$$6({ target: 'Array', proto: true }, {
|
|
12376
12640
|
flat: function flat(/* depthArg = 1 */) {
|
|
12377
12641
|
var depthArg = arguments.length ? arguments[0] : undefined;
|
|
12378
|
-
var O = toObject$
|
|
12379
|
-
var sourceLen = lengthOfArrayLike$
|
|
12642
|
+
var O = toObject$1(this);
|
|
12643
|
+
var sourceLen = lengthOfArrayLike$1(O);
|
|
12380
12644
|
var A = arraySpeciesCreate(O, 0);
|
|
12381
12645
|
A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
|
|
12382
12646
|
return A;
|
|
@@ -12904,170 +13168,6 @@ const GoAContractInfoControlReview = withJsonFormsAllOfProps(ContractInfoControl
|
|
|
12904
13168
|
const isContactInformation = createSchemaMatchTester(['email', 'phone', 'preferredContactMethod']);
|
|
12905
13169
|
const ContactInformationTester = rankWith(4, isContactInformation);
|
|
12906
13170
|
|
|
12907
|
-
var arraySlice$1 = arraySlice$4;
|
|
12908
|
-
|
|
12909
|
-
var floor$2 = Math.floor;
|
|
12910
|
-
|
|
12911
|
-
var sort = function (array, comparefn) {
|
|
12912
|
-
var length = array.length;
|
|
12913
|
-
|
|
12914
|
-
if (length < 8) {
|
|
12915
|
-
// insertion sort
|
|
12916
|
-
var i = 1;
|
|
12917
|
-
var element, j;
|
|
12918
|
-
|
|
12919
|
-
while (i < length) {
|
|
12920
|
-
j = i;
|
|
12921
|
-
element = array[i];
|
|
12922
|
-
while (j && comparefn(array[j - 1], element) > 0) {
|
|
12923
|
-
array[j] = array[--j];
|
|
12924
|
-
}
|
|
12925
|
-
if (j !== i++) array[j] = element;
|
|
12926
|
-
}
|
|
12927
|
-
} else {
|
|
12928
|
-
// merge sort
|
|
12929
|
-
var middle = floor$2(length / 2);
|
|
12930
|
-
var left = sort(arraySlice$1(array, 0, middle), comparefn);
|
|
12931
|
-
var right = sort(arraySlice$1(array, middle), comparefn);
|
|
12932
|
-
var llength = left.length;
|
|
12933
|
-
var rlength = right.length;
|
|
12934
|
-
var lindex = 0;
|
|
12935
|
-
var rindex = 0;
|
|
12936
|
-
|
|
12937
|
-
while (lindex < llength || rindex < rlength) {
|
|
12938
|
-
array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
|
12939
|
-
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
|
12940
|
-
: lindex < llength ? left[lindex++] : right[rindex++];
|
|
12941
|
-
}
|
|
12942
|
-
}
|
|
12943
|
-
|
|
12944
|
-
return array;
|
|
12945
|
-
};
|
|
12946
|
-
|
|
12947
|
-
var arraySort$1 = sort;
|
|
12948
|
-
|
|
12949
|
-
var userAgent$1 = engineUserAgent;
|
|
12950
|
-
|
|
12951
|
-
var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
|
12952
|
-
|
|
12953
|
-
var engineFfVersion = !!firefox && +firefox[1];
|
|
12954
|
-
|
|
12955
|
-
var UA = engineUserAgent;
|
|
12956
|
-
|
|
12957
|
-
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
|
12958
|
-
|
|
12959
|
-
var userAgent = engineUserAgent;
|
|
12960
|
-
|
|
12961
|
-
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
|
12962
|
-
|
|
12963
|
-
var engineWebkitVersion = !!webkit && +webkit[1];
|
|
12964
|
-
|
|
12965
|
-
var $$6 = _export;
|
|
12966
|
-
var uncurryThis$8 = functionUncurryThis;
|
|
12967
|
-
var aCallable = aCallable$k;
|
|
12968
|
-
var toObject$1 = toObject$c;
|
|
12969
|
-
var lengthOfArrayLike$1 = lengthOfArrayLike$c;
|
|
12970
|
-
var deletePropertyOrThrow = deletePropertyOrThrow$2;
|
|
12971
|
-
var toString$5 = toString$n;
|
|
12972
|
-
var fails$2 = fails$y;
|
|
12973
|
-
var internalSort = arraySort$1;
|
|
12974
|
-
var arrayMethodIsStrict = arrayMethodIsStrict$2;
|
|
12975
|
-
var FF = engineFfVersion;
|
|
12976
|
-
var IE_OR_EDGE = engineIsIeOrEdge;
|
|
12977
|
-
var V8 = engineV8Version;
|
|
12978
|
-
var WEBKIT = engineWebkitVersion;
|
|
12979
|
-
|
|
12980
|
-
var test = [];
|
|
12981
|
-
var nativeSort = uncurryThis$8(test.sort);
|
|
12982
|
-
var push$4 = uncurryThis$8(test.push);
|
|
12983
|
-
|
|
12984
|
-
// IE8-
|
|
12985
|
-
var FAILS_ON_UNDEFINED = fails$2(function () {
|
|
12986
|
-
test.sort(undefined);
|
|
12987
|
-
});
|
|
12988
|
-
// V8 bug
|
|
12989
|
-
var FAILS_ON_NULL = fails$2(function () {
|
|
12990
|
-
test.sort(null);
|
|
12991
|
-
});
|
|
12992
|
-
// Old WebKit
|
|
12993
|
-
var STRICT_METHOD = arrayMethodIsStrict('sort');
|
|
12994
|
-
|
|
12995
|
-
var STABLE_SORT = !fails$2(function () {
|
|
12996
|
-
// feature detection can be too slow, so check engines versions
|
|
12997
|
-
if (V8) return V8 < 70;
|
|
12998
|
-
if (FF && FF > 3) return;
|
|
12999
|
-
if (IE_OR_EDGE) return true;
|
|
13000
|
-
if (WEBKIT) return WEBKIT < 603;
|
|
13001
|
-
|
|
13002
|
-
var result = '';
|
|
13003
|
-
var code, chr, value, index;
|
|
13004
|
-
|
|
13005
|
-
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
|
|
13006
|
-
for (code = 65; code < 76; code++) {
|
|
13007
|
-
chr = String.fromCharCode(code);
|
|
13008
|
-
|
|
13009
|
-
switch (code) {
|
|
13010
|
-
case 66: case 69: case 70: case 72: value = 3; break;
|
|
13011
|
-
case 68: case 71: value = 4; break;
|
|
13012
|
-
default: value = 2;
|
|
13013
|
-
}
|
|
13014
|
-
|
|
13015
|
-
for (index = 0; index < 47; index++) {
|
|
13016
|
-
test.push({ k: chr + index, v: value });
|
|
13017
|
-
}
|
|
13018
|
-
}
|
|
13019
|
-
|
|
13020
|
-
test.sort(function (a, b) { return b.v - a.v; });
|
|
13021
|
-
|
|
13022
|
-
for (index = 0; index < test.length; index++) {
|
|
13023
|
-
chr = test[index].k.charAt(0);
|
|
13024
|
-
if (result.charAt(result.length - 1) !== chr) result += chr;
|
|
13025
|
-
}
|
|
13026
|
-
|
|
13027
|
-
return result !== 'DGBEFHACIJK';
|
|
13028
|
-
});
|
|
13029
|
-
|
|
13030
|
-
var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
|
13031
|
-
|
|
13032
|
-
var getSortCompare = function (comparefn) {
|
|
13033
|
-
return function (x, y) {
|
|
13034
|
-
if (y === undefined) return -1;
|
|
13035
|
-
if (x === undefined) return 1;
|
|
13036
|
-
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
|
13037
|
-
return toString$5(x) > toString$5(y) ? 1 : -1;
|
|
13038
|
-
};
|
|
13039
|
-
};
|
|
13040
|
-
|
|
13041
|
-
// `Array.prototype.sort` method
|
|
13042
|
-
// https://tc39.es/ecma262/#sec-array.prototype.sort
|
|
13043
|
-
$$6({ target: 'Array', proto: true, forced: FORCED$1 }, {
|
|
13044
|
-
sort: function sort(comparefn) {
|
|
13045
|
-
if (comparefn !== undefined) aCallable(comparefn);
|
|
13046
|
-
|
|
13047
|
-
var array = toObject$1(this);
|
|
13048
|
-
|
|
13049
|
-
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
|
13050
|
-
|
|
13051
|
-
var items = [];
|
|
13052
|
-
var arrayLength = lengthOfArrayLike$1(array);
|
|
13053
|
-
var itemsLength, index;
|
|
13054
|
-
|
|
13055
|
-
for (index = 0; index < arrayLength; index++) {
|
|
13056
|
-
if (index in array) push$4(items, array[index]);
|
|
13057
|
-
}
|
|
13058
|
-
|
|
13059
|
-
internalSort(items, getSortCompare(comparefn));
|
|
13060
|
-
|
|
13061
|
-
itemsLength = lengthOfArrayLike$1(items);
|
|
13062
|
-
index = 0;
|
|
13063
|
-
|
|
13064
|
-
while (index < itemsLength) array[index] = items[index++];
|
|
13065
|
-
while (index < arrayLength) deletePropertyOrThrow(array, index++);
|
|
13066
|
-
|
|
13067
|
-
return array;
|
|
13068
|
-
}
|
|
13069
|
-
});
|
|
13070
|
-
|
|
13071
13171
|
var $$5 = _export;
|
|
13072
13172
|
var iterate = iterate$a;
|
|
13073
13173
|
var createProperty$1 = createProperty$4;
|