@abgov/jsonforms-components 2.49.1 → 2.50.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/index.esm.js CHANGED
@@ -5429,15 +5429,72 @@ const pickPropertyValues = (obj, property, endWithType) => {
5429
5429
  return values;
5430
5430
  };
5431
5431
 
5432
+ // a string of all valid unicode whitespaces
5433
+ var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
5434
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
5435
+
5432
5436
  var uncurryThis$f = functionUncurryThis;
5437
+ var requireObjectCoercible$5 = requireObjectCoercible$e;
5438
+ var toString$b = toString$m;
5439
+ var whitespaces$2 = whitespaces$3;
5440
+
5441
+ var replace$4 = uncurryThis$f(''.replace);
5442
+ var ltrim = RegExp('^[' + whitespaces$2 + ']+');
5443
+ var rtrim = RegExp('(^|[^' + whitespaces$2 + '])[' + whitespaces$2 + ']+$');
5444
+
5445
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
5446
+ var createMethod$1 = function (TYPE) {
5447
+ return function ($this) {
5448
+ var string = toString$b(requireObjectCoercible$5($this));
5449
+ if (TYPE & 1) string = replace$4(string, ltrim, '');
5450
+ if (TYPE & 2) string = replace$4(string, rtrim, '$1');
5451
+ return string;
5452
+ };
5453
+ };
5454
+
5455
+ var stringTrim = {
5456
+ // `String.prototype.trim` method
5457
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
5458
+ trim: createMethod$1(3)
5459
+ };
5460
+
5461
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
5462
+ var fails$5 = fails$x;
5463
+ var whitespaces$1 = whitespaces$3;
5464
+
5465
+ var non = '\u200B\u0085\u180E';
5466
+
5467
+ // check that a method works with the correct list
5468
+ // of whitespaces and has a correct name
5469
+ var stringTrimForced = function (METHOD_NAME) {
5470
+ return fails$5(function () {
5471
+ return !!whitespaces$1[METHOD_NAME]()
5472
+ || non[METHOD_NAME]() !== non
5473
+ || (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
5474
+ });
5475
+ };
5476
+
5477
+ var $$k = _export;
5478
+ var $trim = stringTrim.trim;
5479
+ var forcedStringTrimMethod = stringTrimForced;
5480
+
5481
+ // `String.prototype.trim` method
5482
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
5483
+ $$k({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
5484
+ trim: function trim() {
5485
+ return $trim(this);
5486
+ }
5487
+ });
5488
+
5489
+ var uncurryThis$e = functionUncurryThis;
5433
5490
  var hasOwn$4 = hasOwnProperty_1;
5434
5491
 
5435
5492
  var $SyntaxError = SyntaxError;
5436
5493
  var $parseInt$2 = parseInt;
5437
5494
  var fromCharCode$1 = String.fromCharCode;
5438
- var at$1 = uncurryThis$f(''.charAt);
5439
- var slice$2 = uncurryThis$f(''.slice);
5440
- var exec$4 = uncurryThis$f(/./.exec);
5495
+ var at$1 = uncurryThis$e(''.charAt);
5496
+ var slice$2 = uncurryThis$e(''.slice);
5497
+ var exec$4 = uncurryThis$e(/./.exec);
5441
5498
 
5442
5499
  var codePoints = {
5443
5500
  '\\"': '"',
@@ -5485,20 +5542,20 @@ var parseJsonString = function (source, i) {
5485
5542
  return { value: value, end: i };
5486
5543
  };
5487
5544
 
5488
- var $$k = _export;
5545
+ var $$j = _export;
5489
5546
  var DESCRIPTORS$5 = descriptors;
5490
5547
  var global$5 = global$t;
5491
5548
  var getBuiltIn$1 = getBuiltIn$b;
5492
- var uncurryThis$e = functionUncurryThis;
5549
+ var uncurryThis$d = functionUncurryThis;
5493
5550
  var call$9 = functionCall;
5494
5551
  var isCallable$2 = isCallable$t;
5495
5552
  var isObject$3 = isObject$h;
5496
5553
  var isArray$2 = isArray$5;
5497
5554
  var hasOwn$3 = hasOwnProperty_1;
5498
- var toString$b = toString$m;
5555
+ var toString$a = toString$m;
5499
5556
  var lengthOfArrayLike$4 = lengthOfArrayLike$a;
5500
5557
  var createProperty$2 = createProperty$4;
5501
- var fails$5 = fails$x;
5558
+ var fails$4 = fails$x;
5502
5559
  var parseJSONString = parseJsonString;
5503
5560
  var NATIVE_SYMBOL$1 = symbolConstructorDetection;
5504
5561
 
@@ -5509,10 +5566,10 @@ var nativeParse = JSON$1 && JSON$1.parse;
5509
5566
  var enumerableOwnProperties = getBuiltIn$1('Object', 'keys');
5510
5567
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
5511
5568
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
5512
- var at = uncurryThis$e(''.charAt);
5513
- var slice$1 = uncurryThis$e(''.slice);
5514
- var exec$3 = uncurryThis$e(/./.exec);
5515
- var push$5 = uncurryThis$e([].push);
5569
+ var at = uncurryThis$d(''.charAt);
5570
+ var slice$1 = uncurryThis$d(''.slice);
5571
+ var exec$3 = uncurryThis$d(/./.exec);
5572
+ var push$5 = uncurryThis$d([].push);
5516
5573
 
5517
5574
  var IS_DIGIT = /^\d$/;
5518
5575
  var IS_NON_ZERO_DIGIT = /^[1-9]$/;
@@ -5523,7 +5580,7 @@ var PRIMITIVE = 0;
5523
5580
  var OBJECT = 1;
5524
5581
 
5525
5582
  var $parse = function (source, reviver) {
5526
- source = toString$b(source);
5583
+ source = toString$a(source);
5527
5584
  var context = new Context(source, 0);
5528
5585
  var root = context.parse();
5529
5586
  var value = root.value;
@@ -5713,7 +5770,7 @@ Context.prototype = {
5713
5770
  }
5714
5771
  };
5715
5772
 
5716
- var NO_SOURCE_SUPPORT = fails$5(function () {
5773
+ var NO_SOURCE_SUPPORT = fails$4(function () {
5717
5774
  var unsafeInt = '9007199254740993';
5718
5775
  var source;
5719
5776
  nativeParse(unsafeInt, function (key, value, context) {
@@ -5722,7 +5779,7 @@ var NO_SOURCE_SUPPORT = fails$5(function () {
5722
5779
  return source !== unsafeInt;
5723
5780
  });
5724
5781
 
5725
- var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$5(function () {
5782
+ var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$4(function () {
5726
5783
  // Safari 9 bug
5727
5784
  return 1 / nativeParse('-0 \t') !== -Infinity;
5728
5785
  });
@@ -5730,13 +5787,13 @@ var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$5(function () {
5730
5787
  // `JSON.parse` method
5731
5788
  // https://tc39.es/ecma262/#sec-json.parse
5732
5789
  // https://github.com/tc39/proposal-json-parse-with-source
5733
- $$k({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
5790
+ $$j({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
5734
5791
  parse: function parse(text, reviver) {
5735
5792
  return PROPER_BASE_PARSE && !isCallable$2(reviver) ? nativeParse(text) : $parse(text, reviver);
5736
5793
  }
5737
5794
  });
5738
5795
 
5739
- var uncurryThis$d = functionUncurryThis;
5796
+ var uncurryThis$c = functionUncurryThis;
5740
5797
 
5741
5798
  // eslint-disable-next-line es/no-set -- safe
5742
5799
  var SetPrototype$1 = Set.prototype;
@@ -5744,9 +5801,9 @@ var SetPrototype$1 = Set.prototype;
5744
5801
  var setHelpers = {
5745
5802
  // eslint-disable-next-line es/no-set -- safe
5746
5803
  Set: Set,
5747
- add: uncurryThis$d(SetPrototype$1.add),
5748
- has: uncurryThis$d(SetPrototype$1.has),
5749
- remove: uncurryThis$d(SetPrototype$1['delete']),
5804
+ add: uncurryThis$c(SetPrototype$1.add),
5805
+ has: uncurryThis$c(SetPrototype$1.has),
5806
+ remove: uncurryThis$c(SetPrototype$1['delete']),
5750
5807
  proto: SetPrototype$1
5751
5808
  };
5752
5809
 
@@ -5770,14 +5827,14 @@ var iterateSimple$7 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
5770
5827
  }
5771
5828
  };
5772
5829
 
5773
- var uncurryThis$c = functionUncurryThis;
5830
+ var uncurryThis$b = functionUncurryThis;
5774
5831
  var iterateSimple$6 = iterateSimple$7;
5775
5832
  var SetHelpers$5 = setHelpers;
5776
5833
 
5777
5834
  var Set$3 = SetHelpers$5.Set;
5778
5835
  var SetPrototype = SetHelpers$5.proto;
5779
- var forEach$2 = uncurryThis$c(SetPrototype.forEach);
5780
- var keys = uncurryThis$c(SetPrototype.keys);
5836
+ var forEach$2 = uncurryThis$b(SetPrototype.forEach);
5837
+ var keys = uncurryThis$b(SetPrototype.keys);
5781
5838
  var next = keys(new Set$3()).next;
5782
5839
 
5783
5840
  var setIterate = function (set, fn, interruptible) {
@@ -5906,13 +5963,13 @@ var setMethodAcceptSetLike$7 = function (name) {
5906
5963
  }
5907
5964
  };
5908
5965
 
5909
- var $$j = _export;
5966
+ var $$i = _export;
5910
5967
  var difference = setDifference;
5911
5968
  var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7;
5912
5969
 
5913
5970
  // `Set.prototype.difference` method
5914
5971
  // https://github.com/tc39/proposal-set-methods
5915
- $$j({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
5972
+ $$i({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
5916
5973
  difference: difference
5917
5974
  });
5918
5975
 
@@ -5947,19 +6004,19 @@ var setIntersection = function intersection(other) {
5947
6004
  return result;
5948
6005
  };
5949
6006
 
5950
- var $$i = _export;
5951
- var fails$4 = fails$x;
6007
+ var $$h = _export;
6008
+ var fails$3 = fails$x;
5952
6009
  var intersection = setIntersection;
5953
6010
  var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7;
5954
6011
 
5955
- var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$4(function () {
6012
+ var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$3(function () {
5956
6013
  // eslint-disable-next-line es/no-array-from, es/no-set -- testing
5957
6014
  return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
5958
6015
  });
5959
6016
 
5960
6017
  // `Set.prototype.intersection` method
5961
6018
  // https://github.com/tc39/proposal-set-methods
5962
- $$i({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
6019
+ $$h({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
5963
6020
  intersection: intersection
5964
6021
  });
5965
6022
 
@@ -5985,13 +6042,13 @@ var setIsDisjointFrom = function isDisjointFrom(other) {
5985
6042
  }) !== false;
5986
6043
  };
5987
6044
 
5988
- var $$h = _export;
6045
+ var $$g = _export;
5989
6046
  var isDisjointFrom = setIsDisjointFrom;
5990
6047
  var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7;
5991
6048
 
5992
6049
  // `Set.prototype.isDisjointFrom` method
5993
6050
  // https://github.com/tc39/proposal-set-methods
5994
- $$h({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
6051
+ $$g({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
5995
6052
  isDisjointFrom: isDisjointFrom
5996
6053
  });
5997
6054
 
@@ -6011,13 +6068,13 @@ var setIsSubsetOf = function isSubsetOf(other) {
6011
6068
  }, true) !== false;
6012
6069
  };
6013
6070
 
6014
- var $$g = _export;
6071
+ var $$f = _export;
6015
6072
  var isSubsetOf = setIsSubsetOf;
6016
6073
  var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7;
6017
6074
 
6018
6075
  // `Set.prototype.isSubsetOf` method
6019
6076
  // https://github.com/tc39/proposal-set-methods
6020
- $$g({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
6077
+ $$f({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
6021
6078
  isSubsetOf: isSubsetOf
6022
6079
  });
6023
6080
 
@@ -6040,13 +6097,13 @@ var setIsSupersetOf = function isSupersetOf(other) {
6040
6097
  }) !== false;
6041
6098
  };
6042
6099
 
6043
- var $$f = _export;
6100
+ var $$e = _export;
6044
6101
  var isSupersetOf = setIsSupersetOf;
6045
6102
  var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7;
6046
6103
 
6047
6104
  // `Set.prototype.isSupersetOf` method
6048
6105
  // https://github.com/tc39/proposal-set-methods
6049
- $$f({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
6106
+ $$e({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
6050
6107
  isSupersetOf: isSupersetOf
6051
6108
  });
6052
6109
 
@@ -6073,13 +6130,13 @@ var setSymmetricDifference = function symmetricDifference(other) {
6073
6130
  return result;
6074
6131
  };
6075
6132
 
6076
- var $$e = _export;
6133
+ var $$d = _export;
6077
6134
  var symmetricDifference = setSymmetricDifference;
6078
6135
  var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7;
6079
6136
 
6080
6137
  // `Set.prototype.symmetricDifference` method
6081
6138
  // https://github.com/tc39/proposal-set-methods
6082
- $$e({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
6139
+ $$d({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
6083
6140
  symmetricDifference: symmetricDifference
6084
6141
  });
6085
6142
 
@@ -6101,13 +6158,13 @@ var setUnion = function union(other) {
6101
6158
  return result;
6102
6159
  };
6103
6160
 
6104
- var $$d = _export;
6161
+ var $$c = _export;
6105
6162
  var union = setUnion;
6106
6163
  var setMethodAcceptSetLike = setMethodAcceptSetLike$7;
6107
6164
 
6108
6165
  // `Set.prototype.union` method
6109
6166
  // https://github.com/tc39/proposal-set-methods
6110
- $$d({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
6167
+ $$c({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
6111
6168
  union: union
6112
6169
  });
6113
6170
 
@@ -6177,23 +6234,86 @@ function buildConditionalDeps(rootSchema) {
6177
6234
  return out;
6178
6235
  }
6179
6236
 
6237
+ function getValueAtPath(obj, path) {
6238
+ return path.split('.').reduce((acc, key) => acc == null ? void 0 : acc[key], obj);
6239
+ }
6240
+ function hasMeaningfulValue(val) {
6241
+ if (val === undefined || val === null) return false;
6242
+ if (typeof val === 'string') return val.trim() !== '';
6243
+ if (Array.isArray(val)) return val.length > 0;
6244
+ if (typeof val === 'object') return Object.keys(val).length > 0;
6245
+ return true;
6246
+ }
6247
+ function isStepStarted(normalizedScopes, data) {
6248
+ return normalizedScopes.some(path => {
6249
+ return hasMeaningfulValue(getValueAtPath(data, path));
6250
+ });
6251
+ }
6252
+ function getSubSchema(schema, path) {
6253
+ const parts = path.replace(/^#\//, '').split('/').filter(p => p !== 'properties') // remove 'properties' segments
6254
+ .slice(0, -1);
6255
+ let current = schema;
6256
+ for (const part of parts) {
6257
+ if (!current) return undefined;
6258
+ if (current.properties && current.properties[part]) {
6259
+ current = current.properties[part];
6260
+ } else if (current.items) {
6261
+ current = current.items;
6262
+ } else {
6263
+ return undefined;
6264
+ }
6265
+ }
6266
+ return current;
6267
+ }
6268
+ function anyRequiredFieldEmpty(scopes, data, required, schema) {
6269
+ for (const scope of scopes) {
6270
+ const path = scope.replace(/^#\//, '').split('/').filter(p => p !== 'properties');
6271
+ const subSchema = getSubSchema(schema, scope);
6272
+ let value = data;
6273
+ const requiredSubset = subSchema;
6274
+ for (const key of path) {
6275
+ if (value && key in value) {
6276
+ value = value[key];
6277
+ } else {
6278
+ value = undefined;
6279
+ break;
6280
+ }
6281
+ }
6282
+ required = required.concat((requiredSubset == null ? void 0 : requiredSubset.required) || []);
6283
+ if (value === undefined || value === null || typeof value === 'string' && value.trim() === '' || Array.isArray(value) && value.length === 0) {
6284
+ if (required.includes(path[path.length - 1])) {
6285
+ return true;
6286
+ }
6287
+ }
6288
+ }
6289
+ return false;
6290
+ }
6180
6291
  function getStepStatus(opts) {
6181
6292
  const {
6182
6293
  scopes,
6183
6294
  errors,
6184
- schema
6295
+ schema,
6296
+ data,
6297
+ visited
6185
6298
  } = opts;
6186
- const incompleteInStep = getIncompletePaths(errors, scopes);
6187
- if (incompleteInStep.length > 0) return 'InProgress';
6188
6299
  const normalizedScopes = scopes.map(normalizeSchemaPath).filter(Boolean);
6300
+ const started = isStepStarted(normalizedScopes, data);
6301
+ const incompleteInStep = getIncompletePaths(errors, scopes);
6302
+ if (incompleteInStep.length > 0) {
6303
+ return 'InProgress';
6304
+ }
6305
+ const required = schema.required || [];
6306
+ if (anyRequiredFieldEmpty(scopes, data, required, schema)) {
6307
+ return 'InProgress';
6308
+ }
6189
6309
  const deps = buildConditionalDeps(schema);
6190
6310
  const controllersInStep = normalizedScopes.filter(s => deps.has(s));
6191
- if (controllersInStep.length === 0) return 'Completed';
6311
+ if (controllersInStep.length === 0) return visited || started ? 'Completed' : 'NotStarted';
6192
6312
  const affected = new Set();
6193
6313
  for (const c of controllersInStep) {
6194
6314
  for (const p of deps.get(c) || []) affected.add(p);
6195
6315
  }
6196
- if (affected.size === 0) return 'Completed';
6316
+ if (affected.size === 0) return visited || started ? 'Completed' : 'NotStarted';
6197
6317
  const affectedPaths = [...affected];
6198
6318
  for (const err of errors || []) {
6199
6319
  for (const cand of collectErrorCandidates(err)) {
@@ -6202,7 +6322,7 @@ function getStepStatus(opts) {
6202
6322
  }
6203
6323
  }
6204
6324
  }
6205
- return 'Completed';
6325
+ return visited || started ? 'Completed' : 'NotStarted';
6206
6326
  }
6207
6327
  function collectErrorCandidates(e) {
6208
6328
  var _e$params;
@@ -6374,10 +6494,13 @@ const stepperReducer = (state, action) => {
6374
6494
  return cat;
6375
6495
  }
6376
6496
  const filteredErrors = ajv.errors && ajv.errors.filter(error => (error == null ? void 0 : error.data) != null);
6497
+ const visited = true;
6377
6498
  const status = getStepStatus({
6378
6499
  scopes: cat.scopes,
6500
+ data,
6379
6501
  errors: filteredErrors != null ? filteredErrors : [],
6380
- schema
6502
+ schema,
6503
+ visited
6381
6504
  });
6382
6505
  return Object.assign({}, cat, {
6383
6506
  isCompleted: status === 'Completed',
@@ -6436,10 +6559,13 @@ const createStepperContextInitData = props => {
6436
6559
  const categories = (_categorization$eleme = categorization.elements) == null ? void 0 : _categorization$eleme.map((c, id) => {
6437
6560
  var _deriveLabelForUISche;
6438
6561
  const scopes = pickPropertyValues(c, 'scope', 'ListWithDetail');
6562
+ const visited = false;
6439
6563
  const status = getStepStatus({
6440
6564
  scopes,
6565
+ data,
6441
6566
  errors: filteredErrors != null ? filteredErrors : [],
6442
- schema
6567
+ schema,
6568
+ visited
6443
6569
  });
6444
6570
  return {
6445
6571
  id,
@@ -6447,7 +6573,7 @@ const createStepperContextInitData = props => {
6447
6573
  scopes,
6448
6574
  isCompleted: status === 'Completed',
6449
6575
  isValid: status === 'Completed',
6450
- isVisited: status !== 'NotStarted',
6576
+ isVisited: status === 'Completed',
6451
6577
  status,
6452
6578
  uischema: c,
6453
6579
  isEnabled: isEnabled(c, data, '', ajv, undefined),
@@ -6600,7 +6726,7 @@ const JsonFormsStepperContextProvider = ({
6600
6726
  });
6601
6727
  };
6602
6728
 
6603
- var $$c = _export;
6729
+ var $$b = _export;
6604
6730
  var iterate$1 = iterate$a;
6605
6731
  var aCallable$2 = aCallable$j;
6606
6732
  var anObject$5 = anObject$t;
@@ -6608,7 +6734,7 @@ var getIteratorDirect$2 = getIteratorDirect$a;
6608
6734
 
6609
6735
  // `Iterator.prototype.every` method
6610
6736
  // https://github.com/tc39/proposal-iterator-helpers
6611
- $$c({ target: 'Iterator', proto: true, real: true }, {
6737
+ $$b({ target: 'Iterator', proto: true, real: true }, {
6612
6738
  every: function every(predicate) {
6613
6739
  anObject$5(this);
6614
6740
  aCallable$2(predicate);
@@ -6831,14 +6957,14 @@ const GoAInputBaseControl = props => {
6831
6957
  });
6832
6958
  };
6833
6959
 
6834
- var $$b = _export;
6960
+ var $$a = _export;
6835
6961
  var DESCRIPTORS$4 = descriptors;
6836
6962
  var global$4 = global$t;
6837
- var uncurryThis$b = functionUncurryThis;
6963
+ var uncurryThis$a = functionUncurryThis;
6838
6964
  var hasOwn$2 = hasOwnProperty_1;
6839
6965
  var isCallable$1 = isCallable$t;
6840
6966
  var isPrototypeOf = objectIsPrototypeOf;
6841
- var toString$a = toString$m;
6967
+ var toString$9 = toString$m;
6842
6968
  var defineBuiltInAccessor$3 = defineBuiltInAccessor$7;
6843
6969
  var copyConstructorProperties = copyConstructorProperties$3;
6844
6970
 
@@ -6852,7 +6978,7 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6852
6978
  var EmptyStringDescriptionStore = {};
6853
6979
  // wrap Symbol constructor for correct work with undefined description
6854
6980
  var SymbolWrapper = function Symbol() {
6855
- var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$a(arguments[0]);
6981
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$9(arguments[0]);
6856
6982
  var result = isPrototypeOf(SymbolPrototype, this)
6857
6983
  ? new NativeSymbol(description)
6858
6984
  // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
@@ -6866,11 +6992,11 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6866
6992
  SymbolPrototype.constructor = SymbolWrapper;
6867
6993
 
6868
6994
  var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
6869
- var thisSymbolValue = uncurryThis$b(SymbolPrototype.valueOf);
6870
- var symbolDescriptiveString = uncurryThis$b(SymbolPrototype.toString);
6995
+ var thisSymbolValue = uncurryThis$a(SymbolPrototype.valueOf);
6996
+ var symbolDescriptiveString = uncurryThis$a(SymbolPrototype.toString);
6871
6997
  var regexp = /^Symbol\((.*)\)[^)]+$/;
6872
- var replace$4 = uncurryThis$b(''.replace);
6873
- var stringSlice$4 = uncurryThis$b(''.slice);
6998
+ var replace$3 = uncurryThis$a(''.replace);
6999
+ var stringSlice$4 = uncurryThis$a(''.slice);
6874
7000
 
6875
7001
  defineBuiltInAccessor$3(SymbolPrototype, 'description', {
6876
7002
  configurable: true,
@@ -6878,12 +7004,12 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6878
7004
  var symbol = thisSymbolValue(this);
6879
7005
  if (hasOwn$2(EmptyStringDescriptionStore, symbol)) return '';
6880
7006
  var string = symbolDescriptiveString(symbol);
6881
- var desc = NATIVE_SYMBOL ? stringSlice$4(string, 7, -1) : replace$4(string, regexp, '$1');
7007
+ var desc = NATIVE_SYMBOL ? stringSlice$4(string, 7, -1) : replace$3(string, regexp, '$1');
6882
7008
  return desc === '' ? undefined : desc;
6883
7009
  }
6884
7010
  });
6885
7011
 
6886
- $$b({ global: true, constructor: true, forced: true }, {
7012
+ $$a({ global: true, constructor: true, forced: true }, {
6887
7013
  Symbol: SymbolWrapper
6888
7014
  });
6889
7015
  }
@@ -6893,8 +7019,8 @@ var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
6893
7019
  var anObject$4 = anObject$t;
6894
7020
  var isNullOrUndefined$1 = isNullOrUndefined$7;
6895
7021
  var toLength$3 = toLength$7;
6896
- var toString$9 = toString$m;
6897
- var requireObjectCoercible$5 = requireObjectCoercible$e;
7022
+ var toString$8 = toString$m;
7023
+ var requireObjectCoercible$4 = requireObjectCoercible$e;
6898
7024
  var getMethod$1 = getMethod$7;
6899
7025
  var advanceStringIndex$1 = advanceStringIndex$3;
6900
7026
  var regExpExec$1 = regexpExecAbstract;
@@ -6905,15 +7031,15 @@ fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCall
6905
7031
  // `String.prototype.match` method
6906
7032
  // https://tc39.es/ecma262/#sec-string.prototype.match
6907
7033
  function match(regexp) {
6908
- var O = requireObjectCoercible$5(this);
7034
+ var O = requireObjectCoercible$4(this);
6909
7035
  var matcher = isNullOrUndefined$1(regexp) ? undefined : getMethod$1(regexp, MATCH);
6910
- return matcher ? call$6(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$9(O));
7036
+ return matcher ? call$6(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$8(O));
6911
7037
  },
6912
7038
  // `RegExp.prototype[@@match]` method
6913
7039
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
6914
7040
  function (string) {
6915
7041
  var rx = anObject$4(this);
6916
- var S = toString$9(string);
7042
+ var S = toString$8(string);
6917
7043
  var res = maybeCallNative(nativeMatch, rx, S);
6918
7044
 
6919
7045
  if (res.done) return res.value;
@@ -6926,7 +7052,7 @@ fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCall
6926
7052
  var n = 0;
6927
7053
  var result;
6928
7054
  while ((result = regExpExec$1(rx, S)) !== null) {
6929
- var matchStr = toString$9(result[0]);
7055
+ var matchStr = toString$8(result[0]);
6930
7056
  A[n] = matchStr;
6931
7057
  if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
6932
7058
  n++;
@@ -6997,7 +7123,7 @@ const GoAInputText = props => {
6997
7123
  setIsVisited
6998
7124
  } = props;
6999
7125
  const [localValue, setLocalValue] = useState(data != null ? data : '');
7000
- const debouncedValue = useDebounce(localValue, 800);
7126
+ const debouncedValue = useDebounce(localValue, 300);
7001
7127
  useEffect(() => {
7002
7128
  setLocalValue(data != null ? data : '');
7003
7129
  }, [data]);
@@ -7181,15 +7307,15 @@ const MultiLineTextControlTester = rankWith(3, and(isStringControl, optionIs('mu
7181
7307
  const MultiLineTextControl = withJsonFormsControlProps(MultiLineTextControlInput);
7182
7308
 
7183
7309
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$9;
7184
- var toString$8 = toString$m;
7185
- var requireObjectCoercible$4 = requireObjectCoercible$e;
7310
+ var toString$7 = toString$m;
7311
+ var requireObjectCoercible$3 = requireObjectCoercible$e;
7186
7312
 
7187
7313
  var $RangeError$1 = RangeError;
7188
7314
 
7189
7315
  // `String.prototype.repeat` method implementation
7190
7316
  // https://tc39.es/ecma262/#sec-string.prototype.repeat
7191
7317
  var stringRepeat = function repeat(count) {
7192
- var str = toString$8(requireObjectCoercible$4(this));
7318
+ var str = toString$7(requireObjectCoercible$3(this));
7193
7319
  var result = '';
7194
7320
  var n = toIntegerOrInfinity$1(count);
7195
7321
  if (n < 0 || n === Infinity) throw new $RangeError$1('Wrong number of repetitions');
@@ -7198,23 +7324,23 @@ var stringRepeat = function repeat(count) {
7198
7324
  };
7199
7325
 
7200
7326
  // https://github.com/tc39/proposal-string-pad-start-end
7201
- var uncurryThis$a = functionUncurryThis;
7327
+ var uncurryThis$9 = functionUncurryThis;
7202
7328
  var toLength$2 = toLength$7;
7203
- var toString$7 = toString$m;
7329
+ var toString$6 = toString$m;
7204
7330
  var $repeat = stringRepeat;
7205
- var requireObjectCoercible$3 = requireObjectCoercible$e;
7331
+ var requireObjectCoercible$2 = requireObjectCoercible$e;
7206
7332
 
7207
- var repeat = uncurryThis$a($repeat);
7208
- var stringSlice$3 = uncurryThis$a(''.slice);
7333
+ var repeat = uncurryThis$9($repeat);
7334
+ var stringSlice$3 = uncurryThis$9(''.slice);
7209
7335
  var ceil = Math.ceil;
7210
7336
 
7211
7337
  // `String.prototype.{ padStart, padEnd }` methods implementation
7212
- var createMethod$1 = function (IS_END) {
7338
+ var createMethod = function (IS_END) {
7213
7339
  return function ($this, maxLength, fillString) {
7214
- var S = toString$7(requireObjectCoercible$3($this));
7340
+ var S = toString$6(requireObjectCoercible$2($this));
7215
7341
  var intMaxLength = toLength$2(maxLength);
7216
7342
  var stringLength = S.length;
7217
- var fillStr = fillString === undefined ? ' ' : toString$7(fillString);
7343
+ var fillStr = fillString === undefined ? ' ' : toString$6(fillString);
7218
7344
  var fillLen, stringFiller;
7219
7345
  if (intMaxLength <= stringLength || fillStr === '') return S;
7220
7346
  fillLen = intMaxLength - stringLength;
@@ -7227,20 +7353,20 @@ var createMethod$1 = function (IS_END) {
7227
7353
  var stringPad = {
7228
7354
  // `String.prototype.padStart` method
7229
7355
  // https://tc39.es/ecma262/#sec-string.prototype.padstart
7230
- start: createMethod$1(false)};
7356
+ start: createMethod(false)};
7231
7357
 
7232
7358
  // https://github.com/zloirock/core-js/issues/280
7233
7359
  var userAgent = engineUserAgent;
7234
7360
 
7235
7361
  var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
7236
7362
 
7237
- var $$a = _export;
7363
+ var $$9 = _export;
7238
7364
  var $padStart = stringPad.start;
7239
7365
  var WEBKIT_BUG = stringPadWebkitBug;
7240
7366
 
7241
7367
  // `String.prototype.padStart` method
7242
7368
  // https://tc39.es/ecma262/#sec-string.prototype.padstart
7243
- $$a({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
7369
+ $$9({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
7244
7370
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
7245
7371
  return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
7246
7372
  }
@@ -7367,7 +7493,7 @@ const GoANumberInput = props => {
7367
7493
  } = props;
7368
7494
  const InputValue = data && data !== undefined ? data : '';
7369
7495
  const [localValue, setLocalValue] = useState(InputValue);
7370
- const debouncedValue = useDebounce(localValue, 800);
7496
+ const debouncedValue = useDebounce(localValue, 300);
7371
7497
  useEffect(() => {
7372
7498
  const newValue = data !== undefined ? data : '';
7373
7499
  setLocalValue(newValue);
@@ -7444,7 +7570,7 @@ const GoabInputInteger = props => {
7444
7570
  } = props;
7445
7571
  const InputValue = data && data !== undefined ? data : '';
7446
7572
  const [localValue, setLocalValue] = useState(InputValue);
7447
- const debouncedValue = useDebounce(localValue, 800);
7573
+ const debouncedValue = useDebounce(localValue, 300);
7448
7574
  useEffect(() => {
7449
7575
  const newValue = data !== undefined ? data : '';
7450
7576
  setLocalValue(newValue);
@@ -8101,63 +8227,6 @@ const EnumCheckboxControl = props => {
8101
8227
  const GoAEnumCheckboxGroupControl = withJsonFormsEnumProps(withTranslateProps(EnumCheckboxControl), true);
8102
8228
  const GoACheckoutGroupControlTester = rankWith(18, and(optionIs('format', 'checkbox')));
8103
8229
 
8104
- // a string of all valid unicode whitespaces
8105
- var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
8106
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
8107
-
8108
- var uncurryThis$9 = functionUncurryThis;
8109
- var requireObjectCoercible$2 = requireObjectCoercible$e;
8110
- var toString$6 = toString$m;
8111
- var whitespaces$2 = whitespaces$3;
8112
-
8113
- var replace$3 = uncurryThis$9(''.replace);
8114
- var ltrim = RegExp('^[' + whitespaces$2 + ']+');
8115
- var rtrim = RegExp('(^|[^' + whitespaces$2 + '])[' + whitespaces$2 + ']+$');
8116
-
8117
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
8118
- var createMethod = function (TYPE) {
8119
- return function ($this) {
8120
- var string = toString$6(requireObjectCoercible$2($this));
8121
- if (TYPE & 1) string = replace$3(string, ltrim, '');
8122
- if (TYPE & 2) string = replace$3(string, rtrim, '$1');
8123
- return string;
8124
- };
8125
- };
8126
-
8127
- var stringTrim = {
8128
- // `String.prototype.trim` method
8129
- // https://tc39.es/ecma262/#sec-string.prototype.trim
8130
- trim: createMethod(3)
8131
- };
8132
-
8133
- var PROPER_FUNCTION_NAME = functionName.PROPER;
8134
- var fails$3 = fails$x;
8135
- var whitespaces$1 = whitespaces$3;
8136
-
8137
- var non = '\u200B\u0085\u180E';
8138
-
8139
- // check that a method works with the correct list
8140
- // of whitespaces and has a correct name
8141
- var stringTrimForced = function (METHOD_NAME) {
8142
- return fails$3(function () {
8143
- return !!whitespaces$1[METHOD_NAME]()
8144
- || non[METHOD_NAME]() !== non
8145
- || (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
8146
- });
8147
- };
8148
-
8149
- var $$9 = _export;
8150
- var $trim = stringTrim.trim;
8151
- var forcedStringTrimMethod = stringTrimForced;
8152
-
8153
- // `String.prototype.trim` method
8154
- // https://tc39.es/ecma262/#sec-string.prototype.trim
8155
- $$9({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
8156
- trim: function trim() {
8157
- return $trim(this);
8158
- }
8159
- });
8160
-
8161
8230
  const warningIcon = errorMessage => {
8162
8231
  return jsxs(WarningIconDiv, {
8163
8232
  children: [jsx(GoabIcon, {
@@ -13698,19 +13767,10 @@ const FormPagesView = props => {
13698
13767
  };
13699
13768
  if (categories.length + 1 === activeId) {
13700
13769
  var _props$uischema, _props$uischema2, _props$uischema3, _props$uischema4, _props$uischema5;
13701
- const patchedCategories = categories.map(c => {
13702
- const scopes = getCategoryScopes(c);
13703
- const hasData = hasDataInScopes(data, scopes);
13704
- return hasData ? c : Object.assign({}, c, {
13705
- isVisited: false,
13706
- isCompleted: false,
13707
- isValid: false
13708
- });
13709
- });
13710
- const visibleCats = patchedCategories.filter(c => c.visible);
13770
+ const visibleCats = categories.filter(c => c.visible);
13711
13771
  const completedCount = visibleCats.filter(c => c.isValid && c.isCompleted).length;
13712
13772
  const tocProps = {
13713
- categories: patchedCategories,
13773
+ categories: categories,
13714
13774
  onClick: handleGoToPage,
13715
13775
  title: (_props$uischema = props.uischema) == null || (_props$uischema = _props$uischema.options) == null ? void 0 : _props$uischema.title,
13716
13776
  subtitle: (_props$uischema2 = props.uischema) == null || (_props$uischema2 = _props$uischema2.options) == null ? void 0 : _props$uischema2.subtitle,
@@ -16116,27 +16176,26 @@ async function fetchAddressSuggestions(formUrl, query, isAlberta, opts) {
16116
16176
  url.searchParams.set('lastId', '');
16117
16177
  url.searchParams.set('maxSuggestions', isAlberta ? '50' : '10');
16118
16178
  url.searchParams.set('country', 'CAN');
16119
- const res = await fetch(url.toString(), {
16120
- signal: opts == null ? void 0 : opts.signal
16121
- });
16122
- if (!res.ok) throw new Error(`HTTP ${res.status}`);
16123
- const json = await res.json();
16124
- // Normalize common API shapes:
16125
- if (!json) return [];
16126
- // Direct array
16127
- if (Array.isArray(json)) {
16128
- return json;
16129
- }
16130
- if (typeof json === 'object') {
16131
- const obj = json;
16132
- const candidateKeys = ['suggestions', 'items', 'Items'];
16133
- for (const key of candidateKeys) {
16134
- if (Array.isArray(obj[key])) {
16135
- return obj[key];
16179
+ try {
16180
+ const res = await axios.get(url.toString(), {
16181
+ signal: opts == null ? void 0 : opts.signal
16182
+ });
16183
+ const json = res.data;
16184
+ if (!json) return [];
16185
+ if (Array.isArray(json)) return json;
16186
+ if (typeof json === 'object') {
16187
+ const obj = json;
16188
+ for (const key of ['suggestions', 'items', 'Items']) {
16189
+ if (Array.isArray(obj[key])) return obj[key];
16136
16190
  }
16137
16191
  }
16192
+ return [];
16193
+ // eslint-disable-next-line
16194
+ } catch (err) {
16195
+ // axios throws on abort too; treat as “no results”
16196
+ if ((err == null ? void 0 : err.code) === 'ERR_CANCELED') return [];
16197
+ throw err;
16138
16198
  }
16139
- return [];
16140
16199
  }
16141
16200
  const filterAlbertaAddresses = suggestions => {
16142
16201
  return suggestions.filter(suggestion => suggestion.Description.includes('AB')).slice(0, 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.49.1",
3
+ "version": "2.50.1",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
@@ -1,9 +1,11 @@
1
1
  import type { ErrorObject } from 'ajv';
2
+ export declare function hasMeaningfulValue(val: any): boolean;
2
3
  export declare function getStepStatus(opts: {
3
4
  scopes: string[];
4
5
  data: any;
5
6
  errors: AjvError[];
6
7
  schema: any;
8
+ visited: boolean;
7
9
  }): 'Completed' | 'InProgress' | 'NotStarted';
8
10
  export declare const isErrorPathIncluded: (errorPaths: string[], path: string) => boolean;
9
11
  type AjvError = ErrorObject & {