@abgov/jsonforms-components 2.49.0 → 2.50.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
@@ -3561,8 +3561,19 @@ const ensureGoaDatePointerCursor = host => {
3561
3561
  const style = document.createElement('style');
3562
3562
  style.id = 'goa-date-cursor-style';
3563
3563
  style.textContent = `
3564
- input[type="date"] { cursor: pointer !important; }
3565
- input[type="date"]:disabled { cursor: not-allowed !important; }
3564
+ /* keep text cursor in field */
3565
+ input[type="date"] {
3566
+ cursor: text;
3567
+ }
3568
+
3569
+ /* 👇 hand cursor ONLY on calendar icon */
3570
+ input[type="date"]::-webkit-calendar-picker-indicator {
3571
+ cursor: pointer;
3572
+ }
3573
+
3574
+ input[type="date"]:disabled::-webkit-calendar-picker-indicator {
3575
+ cursor: not-allowed;
3576
+ }
3566
3577
  `;
3567
3578
  sr.appendChild(style);
3568
3579
  };
@@ -5418,15 +5429,72 @@ const pickPropertyValues = (obj, property, endWithType) => {
5418
5429
  return values;
5419
5430
  };
5420
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
+
5421
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;
5422
5490
  var hasOwn$4 = hasOwnProperty_1;
5423
5491
 
5424
5492
  var $SyntaxError = SyntaxError;
5425
5493
  var $parseInt$2 = parseInt;
5426
5494
  var fromCharCode$1 = String.fromCharCode;
5427
- var at$1 = uncurryThis$f(''.charAt);
5428
- var slice$2 = uncurryThis$f(''.slice);
5429
- 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);
5430
5498
 
5431
5499
  var codePoints = {
5432
5500
  '\\"': '"',
@@ -5474,20 +5542,20 @@ var parseJsonString = function (source, i) {
5474
5542
  return { value: value, end: i };
5475
5543
  };
5476
5544
 
5477
- var $$k = _export;
5545
+ var $$j = _export;
5478
5546
  var DESCRIPTORS$5 = descriptors;
5479
5547
  var global$5 = global$t;
5480
5548
  var getBuiltIn$1 = getBuiltIn$b;
5481
- var uncurryThis$e = functionUncurryThis;
5549
+ var uncurryThis$d = functionUncurryThis;
5482
5550
  var call$9 = functionCall;
5483
5551
  var isCallable$2 = isCallable$t;
5484
5552
  var isObject$3 = isObject$h;
5485
5553
  var isArray$2 = isArray$5;
5486
5554
  var hasOwn$3 = hasOwnProperty_1;
5487
- var toString$b = toString$m;
5555
+ var toString$a = toString$m;
5488
5556
  var lengthOfArrayLike$4 = lengthOfArrayLike$a;
5489
5557
  var createProperty$2 = createProperty$4;
5490
- var fails$5 = fails$x;
5558
+ var fails$4 = fails$x;
5491
5559
  var parseJSONString = parseJsonString;
5492
5560
  var NATIVE_SYMBOL$1 = symbolConstructorDetection;
5493
5561
 
@@ -5498,10 +5566,10 @@ var nativeParse = JSON$1 && JSON$1.parse;
5498
5566
  var enumerableOwnProperties = getBuiltIn$1('Object', 'keys');
5499
5567
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
5500
5568
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
5501
- var at = uncurryThis$e(''.charAt);
5502
- var slice$1 = uncurryThis$e(''.slice);
5503
- var exec$3 = uncurryThis$e(/./.exec);
5504
- 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);
5505
5573
 
5506
5574
  var IS_DIGIT = /^\d$/;
5507
5575
  var IS_NON_ZERO_DIGIT = /^[1-9]$/;
@@ -5512,7 +5580,7 @@ var PRIMITIVE = 0;
5512
5580
  var OBJECT = 1;
5513
5581
 
5514
5582
  var $parse = function (source, reviver) {
5515
- source = toString$b(source);
5583
+ source = toString$a(source);
5516
5584
  var context = new Context(source, 0);
5517
5585
  var root = context.parse();
5518
5586
  var value = root.value;
@@ -5702,7 +5770,7 @@ Context.prototype = {
5702
5770
  }
5703
5771
  };
5704
5772
 
5705
- var NO_SOURCE_SUPPORT = fails$5(function () {
5773
+ var NO_SOURCE_SUPPORT = fails$4(function () {
5706
5774
  var unsafeInt = '9007199254740993';
5707
5775
  var source;
5708
5776
  nativeParse(unsafeInt, function (key, value, context) {
@@ -5711,7 +5779,7 @@ var NO_SOURCE_SUPPORT = fails$5(function () {
5711
5779
  return source !== unsafeInt;
5712
5780
  });
5713
5781
 
5714
- var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$5(function () {
5782
+ var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$4(function () {
5715
5783
  // Safari 9 bug
5716
5784
  return 1 / nativeParse('-0 \t') !== -Infinity;
5717
5785
  });
@@ -5719,13 +5787,13 @@ var PROPER_BASE_PARSE = NATIVE_SYMBOL$1 && !fails$5(function () {
5719
5787
  // `JSON.parse` method
5720
5788
  // https://tc39.es/ecma262/#sec-json.parse
5721
5789
  // https://github.com/tc39/proposal-json-parse-with-source
5722
- $$k({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
5790
+ $$j({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
5723
5791
  parse: function parse(text, reviver) {
5724
5792
  return PROPER_BASE_PARSE && !isCallable$2(reviver) ? nativeParse(text) : $parse(text, reviver);
5725
5793
  }
5726
5794
  });
5727
5795
 
5728
- var uncurryThis$d = functionUncurryThis;
5796
+ var uncurryThis$c = functionUncurryThis;
5729
5797
 
5730
5798
  // eslint-disable-next-line es/no-set -- safe
5731
5799
  var SetPrototype$1 = Set.prototype;
@@ -5733,9 +5801,9 @@ var SetPrototype$1 = Set.prototype;
5733
5801
  var setHelpers = {
5734
5802
  // eslint-disable-next-line es/no-set -- safe
5735
5803
  Set: Set,
5736
- add: uncurryThis$d(SetPrototype$1.add),
5737
- has: uncurryThis$d(SetPrototype$1.has),
5738
- 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']),
5739
5807
  proto: SetPrototype$1
5740
5808
  };
5741
5809
 
@@ -5759,14 +5827,14 @@ var iterateSimple$7 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
5759
5827
  }
5760
5828
  };
5761
5829
 
5762
- var uncurryThis$c = functionUncurryThis;
5830
+ var uncurryThis$b = functionUncurryThis;
5763
5831
  var iterateSimple$6 = iterateSimple$7;
5764
5832
  var SetHelpers$5 = setHelpers;
5765
5833
 
5766
5834
  var Set$3 = SetHelpers$5.Set;
5767
5835
  var SetPrototype = SetHelpers$5.proto;
5768
- var forEach$2 = uncurryThis$c(SetPrototype.forEach);
5769
- var keys = uncurryThis$c(SetPrototype.keys);
5836
+ var forEach$2 = uncurryThis$b(SetPrototype.forEach);
5837
+ var keys = uncurryThis$b(SetPrototype.keys);
5770
5838
  var next = keys(new Set$3()).next;
5771
5839
 
5772
5840
  var setIterate = function (set, fn, interruptible) {
@@ -5895,13 +5963,13 @@ var setMethodAcceptSetLike$7 = function (name) {
5895
5963
  }
5896
5964
  };
5897
5965
 
5898
- var $$j = _export;
5966
+ var $$i = _export;
5899
5967
  var difference = setDifference;
5900
5968
  var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7;
5901
5969
 
5902
5970
  // `Set.prototype.difference` method
5903
5971
  // https://github.com/tc39/proposal-set-methods
5904
- $$j({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
5972
+ $$i({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
5905
5973
  difference: difference
5906
5974
  });
5907
5975
 
@@ -5936,19 +6004,19 @@ var setIntersection = function intersection(other) {
5936
6004
  return result;
5937
6005
  };
5938
6006
 
5939
- var $$i = _export;
5940
- var fails$4 = fails$x;
6007
+ var $$h = _export;
6008
+ var fails$3 = fails$x;
5941
6009
  var intersection = setIntersection;
5942
6010
  var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7;
5943
6011
 
5944
- var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$4(function () {
6012
+ var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$3(function () {
5945
6013
  // eslint-disable-next-line es/no-array-from, es/no-set -- testing
5946
6014
  return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
5947
6015
  });
5948
6016
 
5949
6017
  // `Set.prototype.intersection` method
5950
6018
  // https://github.com/tc39/proposal-set-methods
5951
- $$i({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
6019
+ $$h({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
5952
6020
  intersection: intersection
5953
6021
  });
5954
6022
 
@@ -5974,13 +6042,13 @@ var setIsDisjointFrom = function isDisjointFrom(other) {
5974
6042
  }) !== false;
5975
6043
  };
5976
6044
 
5977
- var $$h = _export;
6045
+ var $$g = _export;
5978
6046
  var isDisjointFrom = setIsDisjointFrom;
5979
6047
  var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7;
5980
6048
 
5981
6049
  // `Set.prototype.isDisjointFrom` method
5982
6050
  // https://github.com/tc39/proposal-set-methods
5983
- $$h({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
6051
+ $$g({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
5984
6052
  isDisjointFrom: isDisjointFrom
5985
6053
  });
5986
6054
 
@@ -6000,13 +6068,13 @@ var setIsSubsetOf = function isSubsetOf(other) {
6000
6068
  }, true) !== false;
6001
6069
  };
6002
6070
 
6003
- var $$g = _export;
6071
+ var $$f = _export;
6004
6072
  var isSubsetOf = setIsSubsetOf;
6005
6073
  var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7;
6006
6074
 
6007
6075
  // `Set.prototype.isSubsetOf` method
6008
6076
  // https://github.com/tc39/proposal-set-methods
6009
- $$g({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
6077
+ $$f({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
6010
6078
  isSubsetOf: isSubsetOf
6011
6079
  });
6012
6080
 
@@ -6029,13 +6097,13 @@ var setIsSupersetOf = function isSupersetOf(other) {
6029
6097
  }) !== false;
6030
6098
  };
6031
6099
 
6032
- var $$f = _export;
6100
+ var $$e = _export;
6033
6101
  var isSupersetOf = setIsSupersetOf;
6034
6102
  var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7;
6035
6103
 
6036
6104
  // `Set.prototype.isSupersetOf` method
6037
6105
  // https://github.com/tc39/proposal-set-methods
6038
- $$f({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
6106
+ $$e({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
6039
6107
  isSupersetOf: isSupersetOf
6040
6108
  });
6041
6109
 
@@ -6062,13 +6130,13 @@ var setSymmetricDifference = function symmetricDifference(other) {
6062
6130
  return result;
6063
6131
  };
6064
6132
 
6065
- var $$e = _export;
6133
+ var $$d = _export;
6066
6134
  var symmetricDifference = setSymmetricDifference;
6067
6135
  var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7;
6068
6136
 
6069
6137
  // `Set.prototype.symmetricDifference` method
6070
6138
  // https://github.com/tc39/proposal-set-methods
6071
- $$e({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
6139
+ $$d({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
6072
6140
  symmetricDifference: symmetricDifference
6073
6141
  });
6074
6142
 
@@ -6090,13 +6158,13 @@ var setUnion = function union(other) {
6090
6158
  return result;
6091
6159
  };
6092
6160
 
6093
- var $$d = _export;
6161
+ var $$c = _export;
6094
6162
  var union = setUnion;
6095
6163
  var setMethodAcceptSetLike = setMethodAcceptSetLike$7;
6096
6164
 
6097
6165
  // `Set.prototype.union` method
6098
6166
  // https://github.com/tc39/proposal-set-methods
6099
- $$d({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
6167
+ $$c({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
6100
6168
  union: union
6101
6169
  });
6102
6170
 
@@ -6166,23 +6234,86 @@ function buildConditionalDeps(rootSchema) {
6166
6234
  return out;
6167
6235
  }
6168
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
+ }
6169
6291
  function getStepStatus(opts) {
6170
6292
  const {
6171
6293
  scopes,
6172
6294
  errors,
6173
- schema
6295
+ schema,
6296
+ data,
6297
+ visited
6174
6298
  } = opts;
6175
- const incompleteInStep = getIncompletePaths(errors, scopes);
6176
- if (incompleteInStep.length > 0) return 'InProgress';
6177
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
+ }
6178
6309
  const deps = buildConditionalDeps(schema);
6179
6310
  const controllersInStep = normalizedScopes.filter(s => deps.has(s));
6180
- if (controllersInStep.length === 0) return 'Completed';
6311
+ if (controllersInStep.length === 0) return visited || started ? 'Completed' : 'NotStarted';
6181
6312
  const affected = new Set();
6182
6313
  for (const c of controllersInStep) {
6183
6314
  for (const p of deps.get(c) || []) affected.add(p);
6184
6315
  }
6185
- if (affected.size === 0) return 'Completed';
6316
+ if (affected.size === 0) return visited || started ? 'Completed' : 'NotStarted';
6186
6317
  const affectedPaths = [...affected];
6187
6318
  for (const err of errors || []) {
6188
6319
  for (const cand of collectErrorCandidates(err)) {
@@ -6191,7 +6322,7 @@ function getStepStatus(opts) {
6191
6322
  }
6192
6323
  }
6193
6324
  }
6194
- return 'Completed';
6325
+ return visited || started ? 'Completed' : 'NotStarted';
6195
6326
  }
6196
6327
  function collectErrorCandidates(e) {
6197
6328
  var _e$params;
@@ -6363,10 +6494,13 @@ const stepperReducer = (state, action) => {
6363
6494
  return cat;
6364
6495
  }
6365
6496
  const filteredErrors = ajv.errors && ajv.errors.filter(error => (error == null ? void 0 : error.data) != null);
6497
+ const visited = true;
6366
6498
  const status = getStepStatus({
6367
6499
  scopes: cat.scopes,
6500
+ data,
6368
6501
  errors: filteredErrors != null ? filteredErrors : [],
6369
- schema
6502
+ schema,
6503
+ visited
6370
6504
  });
6371
6505
  return Object.assign({}, cat, {
6372
6506
  isCompleted: status === 'Completed',
@@ -6425,10 +6559,13 @@ const createStepperContextInitData = props => {
6425
6559
  const categories = (_categorization$eleme = categorization.elements) == null ? void 0 : _categorization$eleme.map((c, id) => {
6426
6560
  var _deriveLabelForUISche;
6427
6561
  const scopes = pickPropertyValues(c, 'scope', 'ListWithDetail');
6562
+ const visited = false;
6428
6563
  const status = getStepStatus({
6429
6564
  scopes,
6565
+ data,
6430
6566
  errors: filteredErrors != null ? filteredErrors : [],
6431
- schema
6567
+ schema,
6568
+ visited
6432
6569
  });
6433
6570
  return {
6434
6571
  id,
@@ -6436,7 +6573,7 @@ const createStepperContextInitData = props => {
6436
6573
  scopes,
6437
6574
  isCompleted: status === 'Completed',
6438
6575
  isValid: status === 'Completed',
6439
- isVisited: status !== 'NotStarted',
6576
+ isVisited: status === 'Completed',
6440
6577
  status,
6441
6578
  uischema: c,
6442
6579
  isEnabled: isEnabled(c, data, '', ajv, undefined),
@@ -6589,7 +6726,7 @@ const JsonFormsStepperContextProvider = ({
6589
6726
  });
6590
6727
  };
6591
6728
 
6592
- var $$c = _export;
6729
+ var $$b = _export;
6593
6730
  var iterate$1 = iterate$a;
6594
6731
  var aCallable$2 = aCallable$j;
6595
6732
  var anObject$5 = anObject$t;
@@ -6597,7 +6734,7 @@ var getIteratorDirect$2 = getIteratorDirect$a;
6597
6734
 
6598
6735
  // `Iterator.prototype.every` method
6599
6736
  // https://github.com/tc39/proposal-iterator-helpers
6600
- $$c({ target: 'Iterator', proto: true, real: true }, {
6737
+ $$b({ target: 'Iterator', proto: true, real: true }, {
6601
6738
  every: function every(predicate) {
6602
6739
  anObject$5(this);
6603
6740
  aCallable$2(predicate);
@@ -6820,14 +6957,14 @@ const GoAInputBaseControl = props => {
6820
6957
  });
6821
6958
  };
6822
6959
 
6823
- var $$b = _export;
6960
+ var $$a = _export;
6824
6961
  var DESCRIPTORS$4 = descriptors;
6825
6962
  var global$4 = global$t;
6826
- var uncurryThis$b = functionUncurryThis;
6963
+ var uncurryThis$a = functionUncurryThis;
6827
6964
  var hasOwn$2 = hasOwnProperty_1;
6828
6965
  var isCallable$1 = isCallable$t;
6829
6966
  var isPrototypeOf = objectIsPrototypeOf;
6830
- var toString$a = toString$m;
6967
+ var toString$9 = toString$m;
6831
6968
  var defineBuiltInAccessor$3 = defineBuiltInAccessor$7;
6832
6969
  var copyConstructorProperties = copyConstructorProperties$3;
6833
6970
 
@@ -6841,7 +6978,7 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6841
6978
  var EmptyStringDescriptionStore = {};
6842
6979
  // wrap Symbol constructor for correct work with undefined description
6843
6980
  var SymbolWrapper = function Symbol() {
6844
- 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]);
6845
6982
  var result = isPrototypeOf(SymbolPrototype, this)
6846
6983
  ? new NativeSymbol(description)
6847
6984
  // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
@@ -6855,11 +6992,11 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6855
6992
  SymbolPrototype.constructor = SymbolWrapper;
6856
6993
 
6857
6994
  var NATIVE_SYMBOL = String(NativeSymbol('description detection')) === 'Symbol(description detection)';
6858
- var thisSymbolValue = uncurryThis$b(SymbolPrototype.valueOf);
6859
- var symbolDescriptiveString = uncurryThis$b(SymbolPrototype.toString);
6995
+ var thisSymbolValue = uncurryThis$a(SymbolPrototype.valueOf);
6996
+ var symbolDescriptiveString = uncurryThis$a(SymbolPrototype.toString);
6860
6997
  var regexp = /^Symbol\((.*)\)[^)]+$/;
6861
- var replace$4 = uncurryThis$b(''.replace);
6862
- var stringSlice$4 = uncurryThis$b(''.slice);
6998
+ var replace$3 = uncurryThis$a(''.replace);
6999
+ var stringSlice$4 = uncurryThis$a(''.slice);
6863
7000
 
6864
7001
  defineBuiltInAccessor$3(SymbolPrototype, 'description', {
6865
7002
  configurable: true,
@@ -6867,12 +7004,12 @@ if (DESCRIPTORS$4 && isCallable$1(NativeSymbol) && (!('description' in SymbolPro
6867
7004
  var symbol = thisSymbolValue(this);
6868
7005
  if (hasOwn$2(EmptyStringDescriptionStore, symbol)) return '';
6869
7006
  var string = symbolDescriptiveString(symbol);
6870
- 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');
6871
7008
  return desc === '' ? undefined : desc;
6872
7009
  }
6873
7010
  });
6874
7011
 
6875
- $$b({ global: true, constructor: true, forced: true }, {
7012
+ $$a({ global: true, constructor: true, forced: true }, {
6876
7013
  Symbol: SymbolWrapper
6877
7014
  });
6878
7015
  }
@@ -6882,8 +7019,8 @@ var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
6882
7019
  var anObject$4 = anObject$t;
6883
7020
  var isNullOrUndefined$1 = isNullOrUndefined$7;
6884
7021
  var toLength$3 = toLength$7;
6885
- var toString$9 = toString$m;
6886
- var requireObjectCoercible$5 = requireObjectCoercible$e;
7022
+ var toString$8 = toString$m;
7023
+ var requireObjectCoercible$4 = requireObjectCoercible$e;
6887
7024
  var getMethod$1 = getMethod$7;
6888
7025
  var advanceStringIndex$1 = advanceStringIndex$3;
6889
7026
  var regExpExec$1 = regexpExecAbstract;
@@ -6894,15 +7031,15 @@ fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCall
6894
7031
  // `String.prototype.match` method
6895
7032
  // https://tc39.es/ecma262/#sec-string.prototype.match
6896
7033
  function match(regexp) {
6897
- var O = requireObjectCoercible$5(this);
7034
+ var O = requireObjectCoercible$4(this);
6898
7035
  var matcher = isNullOrUndefined$1(regexp) ? undefined : getMethod$1(regexp, MATCH);
6899
- 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));
6900
7037
  },
6901
7038
  // `RegExp.prototype[@@match]` method
6902
7039
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@match
6903
7040
  function (string) {
6904
7041
  var rx = anObject$4(this);
6905
- var S = toString$9(string);
7042
+ var S = toString$8(string);
6906
7043
  var res = maybeCallNative(nativeMatch, rx, S);
6907
7044
 
6908
7045
  if (res.done) return res.value;
@@ -6915,7 +7052,7 @@ fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCall
6915
7052
  var n = 0;
6916
7053
  var result;
6917
7054
  while ((result = regExpExec$1(rx, S)) !== null) {
6918
- var matchStr = toString$9(result[0]);
7055
+ var matchStr = toString$8(result[0]);
6919
7056
  A[n] = matchStr;
6920
7057
  if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
6921
7058
  n++;
@@ -7170,15 +7307,15 @@ const MultiLineTextControlTester = rankWith(3, and(isStringControl, optionIs('mu
7170
7307
  const MultiLineTextControl = withJsonFormsControlProps(MultiLineTextControlInput);
7171
7308
 
7172
7309
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$9;
7173
- var toString$8 = toString$m;
7174
- var requireObjectCoercible$4 = requireObjectCoercible$e;
7310
+ var toString$7 = toString$m;
7311
+ var requireObjectCoercible$3 = requireObjectCoercible$e;
7175
7312
 
7176
7313
  var $RangeError$1 = RangeError;
7177
7314
 
7178
7315
  // `String.prototype.repeat` method implementation
7179
7316
  // https://tc39.es/ecma262/#sec-string.prototype.repeat
7180
7317
  var stringRepeat = function repeat(count) {
7181
- var str = toString$8(requireObjectCoercible$4(this));
7318
+ var str = toString$7(requireObjectCoercible$3(this));
7182
7319
  var result = '';
7183
7320
  var n = toIntegerOrInfinity$1(count);
7184
7321
  if (n < 0 || n === Infinity) throw new $RangeError$1('Wrong number of repetitions');
@@ -7187,23 +7324,23 @@ var stringRepeat = function repeat(count) {
7187
7324
  };
7188
7325
 
7189
7326
  // https://github.com/tc39/proposal-string-pad-start-end
7190
- var uncurryThis$a = functionUncurryThis;
7327
+ var uncurryThis$9 = functionUncurryThis;
7191
7328
  var toLength$2 = toLength$7;
7192
- var toString$7 = toString$m;
7329
+ var toString$6 = toString$m;
7193
7330
  var $repeat = stringRepeat;
7194
- var requireObjectCoercible$3 = requireObjectCoercible$e;
7331
+ var requireObjectCoercible$2 = requireObjectCoercible$e;
7195
7332
 
7196
- var repeat = uncurryThis$a($repeat);
7197
- var stringSlice$3 = uncurryThis$a(''.slice);
7333
+ var repeat = uncurryThis$9($repeat);
7334
+ var stringSlice$3 = uncurryThis$9(''.slice);
7198
7335
  var ceil = Math.ceil;
7199
7336
 
7200
7337
  // `String.prototype.{ padStart, padEnd }` methods implementation
7201
- var createMethod$1 = function (IS_END) {
7338
+ var createMethod = function (IS_END) {
7202
7339
  return function ($this, maxLength, fillString) {
7203
- var S = toString$7(requireObjectCoercible$3($this));
7340
+ var S = toString$6(requireObjectCoercible$2($this));
7204
7341
  var intMaxLength = toLength$2(maxLength);
7205
7342
  var stringLength = S.length;
7206
- var fillStr = fillString === undefined ? ' ' : toString$7(fillString);
7343
+ var fillStr = fillString === undefined ? ' ' : toString$6(fillString);
7207
7344
  var fillLen, stringFiller;
7208
7345
  if (intMaxLength <= stringLength || fillStr === '') return S;
7209
7346
  fillLen = intMaxLength - stringLength;
@@ -7216,20 +7353,20 @@ var createMethod$1 = function (IS_END) {
7216
7353
  var stringPad = {
7217
7354
  // `String.prototype.padStart` method
7218
7355
  // https://tc39.es/ecma262/#sec-string.prototype.padstart
7219
- start: createMethod$1(false)};
7356
+ start: createMethod(false)};
7220
7357
 
7221
7358
  // https://github.com/zloirock/core-js/issues/280
7222
7359
  var userAgent = engineUserAgent;
7223
7360
 
7224
7361
  var stringPadWebkitBug = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
7225
7362
 
7226
- var $$a = _export;
7363
+ var $$9 = _export;
7227
7364
  var $padStart = stringPad.start;
7228
7365
  var WEBKIT_BUG = stringPadWebkitBug;
7229
7366
 
7230
7367
  // `String.prototype.padStart` method
7231
7368
  // https://tc39.es/ecma262/#sec-string.prototype.padstart
7232
- $$a({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
7369
+ $$9({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
7233
7370
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
7234
7371
  return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
7235
7372
  }
@@ -8090,63 +8227,6 @@ const EnumCheckboxControl = props => {
8090
8227
  const GoAEnumCheckboxGroupControl = withJsonFormsEnumProps(withTranslateProps(EnumCheckboxControl), true);
8091
8228
  const GoACheckoutGroupControlTester = rankWith(18, and(optionIs('format', 'checkbox')));
8092
8229
 
8093
- // a string of all valid unicode whitespaces
8094
- var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
8095
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
8096
-
8097
- var uncurryThis$9 = functionUncurryThis;
8098
- var requireObjectCoercible$2 = requireObjectCoercible$e;
8099
- var toString$6 = toString$m;
8100
- var whitespaces$2 = whitespaces$3;
8101
-
8102
- var replace$3 = uncurryThis$9(''.replace);
8103
- var ltrim = RegExp('^[' + whitespaces$2 + ']+');
8104
- var rtrim = RegExp('(^|[^' + whitespaces$2 + '])[' + whitespaces$2 + ']+$');
8105
-
8106
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
8107
- var createMethod = function (TYPE) {
8108
- return function ($this) {
8109
- var string = toString$6(requireObjectCoercible$2($this));
8110
- if (TYPE & 1) string = replace$3(string, ltrim, '');
8111
- if (TYPE & 2) string = replace$3(string, rtrim, '$1');
8112
- return string;
8113
- };
8114
- };
8115
-
8116
- var stringTrim = {
8117
- // `String.prototype.trim` method
8118
- // https://tc39.es/ecma262/#sec-string.prototype.trim
8119
- trim: createMethod(3)
8120
- };
8121
-
8122
- var PROPER_FUNCTION_NAME = functionName.PROPER;
8123
- var fails$3 = fails$x;
8124
- var whitespaces$1 = whitespaces$3;
8125
-
8126
- var non = '\u200B\u0085\u180E';
8127
-
8128
- // check that a method works with the correct list
8129
- // of whitespaces and has a correct name
8130
- var stringTrimForced = function (METHOD_NAME) {
8131
- return fails$3(function () {
8132
- return !!whitespaces$1[METHOD_NAME]()
8133
- || non[METHOD_NAME]() !== non
8134
- || (PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME);
8135
- });
8136
- };
8137
-
8138
- var $$9 = _export;
8139
- var $trim = stringTrim.trim;
8140
- var forcedStringTrimMethod = stringTrimForced;
8141
-
8142
- // `String.prototype.trim` method
8143
- // https://tc39.es/ecma262/#sec-string.prototype.trim
8144
- $$9({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
8145
- trim: function trim() {
8146
- return $trim(this);
8147
- }
8148
- });
8149
-
8150
8230
  const warningIcon = errorMessage => {
8151
8231
  return jsxs(WarningIconDiv, {
8152
8232
  children: [jsx(GoabIcon, {
@@ -13687,19 +13767,10 @@ const FormPagesView = props => {
13687
13767
  };
13688
13768
  if (categories.length + 1 === activeId) {
13689
13769
  var _props$uischema, _props$uischema2, _props$uischema3, _props$uischema4, _props$uischema5;
13690
- const patchedCategories = categories.map(c => {
13691
- const scopes = getCategoryScopes(c);
13692
- const hasData = hasDataInScopes(data, scopes);
13693
- return hasData ? c : Object.assign({}, c, {
13694
- isVisited: false,
13695
- isCompleted: false,
13696
- isValid: false
13697
- });
13698
- });
13699
- const visibleCats = patchedCategories.filter(c => c.visible);
13770
+ const visibleCats = categories.filter(c => c.visible);
13700
13771
  const completedCount = visibleCats.filter(c => c.isValid && c.isCompleted).length;
13701
13772
  const tocProps = {
13702
- categories: patchedCategories,
13773
+ categories: categories,
13703
13774
  onClick: handleGoToPage,
13704
13775
  title: (_props$uischema = props.uischema) == null || (_props$uischema = _props$uischema.options) == null ? void 0 : _props$uischema.title,
13705
13776
  subtitle: (_props$uischema2 = props.uischema) == null || (_props$uischema2 = _props$uischema2.options) == null ? void 0 : _props$uischema2.subtitle,
@@ -16105,27 +16176,26 @@ async function fetchAddressSuggestions(formUrl, query, isAlberta, opts) {
16105
16176
  url.searchParams.set('lastId', '');
16106
16177
  url.searchParams.set('maxSuggestions', isAlberta ? '50' : '10');
16107
16178
  url.searchParams.set('country', 'CAN');
16108
- const res = await fetch(url.toString(), {
16109
- signal: opts == null ? void 0 : opts.signal
16110
- });
16111
- if (!res.ok) throw new Error(`HTTP ${res.status}`);
16112
- const json = await res.json();
16113
- // Normalize common API shapes:
16114
- if (!json) return [];
16115
- // Direct array
16116
- if (Array.isArray(json)) {
16117
- return json;
16118
- }
16119
- if (typeof json === 'object') {
16120
- const obj = json;
16121
- const candidateKeys = ['suggestions', 'items', 'Items'];
16122
- for (const key of candidateKeys) {
16123
- if (Array.isArray(obj[key])) {
16124
- 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];
16125
16190
  }
16126
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;
16127
16198
  }
16128
- return [];
16129
16199
  }
16130
16200
  const filterAlbertaAddresses = suggestions => {
16131
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.0",
3
+ "version": "2.50.0",
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 & {