@abgov/jsonforms-components 2.2.0 → 2.3.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
@@ -1,7 +1,7 @@
1
1
  import * as runtime from 'react/jsx-runtime';
2
2
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
3
3
  import React, { createContext, useContext, useReducer, useMemo, useEffect, useState, useRef, useCallback } from 'react';
4
- import { GoAFormItem, GoAInput, GoATextArea, GoACallout, GoAInputDate, GoAInputDateTime, GoAInputTime, GoARadioGroup, GoARadioItem, GoACheckbox, GoAIcon, GoAGrid, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoATable, GoABadge, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAContainer, GoADropdown, GoADropdownItem, GoADetails, GoASpinner } from '@abgov/react-components';
4
+ import { GoAFormItem, GoAInput, GoATextArea, GoACallout, GoAInputDate, GoAInputDateTime, GoAInputTime, GoARadioGroup, GoARadioItem, GoACheckbox, GoAIcon, GoAGrid, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoABadge, GoATable, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAContainer, GoADropdown, GoADropdownItem, GoADetails, GoASpinner } from '@abgov/react-components';
5
5
  import styled from 'styled-components';
6
6
  import axios from 'axios';
7
7
  import get$1 from 'lodash/get';
@@ -5437,7 +5437,10 @@ let _$6 = t => t,
5437
5437
  _t16$1,
5438
5438
  _t17$1,
5439
5439
  _t18$1,
5440
- _t19$1;
5440
+ _t19$1,
5441
+ _t20,
5442
+ _t21,
5443
+ _t22;
5441
5444
  const ReviewItem = styled.div(_t$6 || (_t$6 = _$6`
5442
5445
  display: flex;
5443
5446
  flex-direction: column;
@@ -5538,13 +5541,30 @@ const TableReviewPageTitleRow = styled.div(_t16$1 || (_t16$1 = _$6`
5538
5541
  const TableReviewCategoryLabel = styled.h3(_t17$1 || (_t17$1 = _$6`
5539
5542
  color: var(--goa-color-text-secondary) !important;
5540
5543
  `));
5541
- const TocStatus = styled.td(_t18$1 || (_t18$1 = _$6`
5544
+ const CategoryStatus = styled.td(_t18$1 || (_t18$1 = _$6`
5542
5545
  width: var(--goa-space-xl);
5543
5546
  padding-right: var(--goa-space-xl);
5544
5547
  `));
5545
5548
  const TocPageRef = styled.td(_t19$1 || (_t19$1 = _$6`
5546
5549
  padding-left: var(--goa-space-xl);
5547
5550
  `));
5551
+ const TocTitle = styled.h1(_t20 || (_t20 = _$6`
5552
+ padding: 0;
5553
+ margin: 0;
5554
+ padding-left: var(--goa-space-xl);
5555
+ padding-bottom: var(--goa-space-3xl);
5556
+ `));
5557
+ const TocSubtitle = styled.h2(_t21 || (_t21 = _$6`
5558
+ padding: 0;
5559
+ margin: 0;
5560
+ padding-left: var(--goa-space-xl);
5561
+ `));
5562
+ const CompletionStatus = styled.div(_t22 || (_t22 = _$6`
5563
+ padding: 0;
5564
+ margin: 0;
5565
+ padding-left: var(--goa-space-xl);
5566
+ padding-bottom: var(--goa-space-xl);
5567
+ `));
5548
5568
 
5549
5569
  class ContextProviderClass {
5550
5570
  addDataByUrl(key, url, processDataFunction, token) {
@@ -6494,14 +6514,98 @@ const BackButton = ({
6494
6514
  });
6495
6515
  };
6496
6516
 
6517
+ var aCallable$5 = aCallable$9;
6518
+ var toObject = toObject$8;
6519
+ var IndexedObject = indexedObject;
6520
+ var lengthOfArrayLike$1 = lengthOfArrayLike$7;
6521
+
6522
+ var $TypeError$6 = TypeError;
6523
+
6524
+ var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
6525
+
6526
+ // `Array.prototype.{ reduce, reduceRight }` methods implementation
6527
+ var createMethod = function (IS_RIGHT) {
6528
+ return function (that, callbackfn, argumentsLength, memo) {
6529
+ var O = toObject(that);
6530
+ var self = IndexedObject(O);
6531
+ var length = lengthOfArrayLike$1(O);
6532
+ aCallable$5(callbackfn);
6533
+ if (length === 0 && argumentsLength < 2) throw new $TypeError$6(REDUCE_EMPTY);
6534
+ var index = IS_RIGHT ? length - 1 : 0;
6535
+ var i = IS_RIGHT ? -1 : 1;
6536
+ if (argumentsLength < 2) while (true) {
6537
+ if (index in self) {
6538
+ memo = self[index];
6539
+ index += i;
6540
+ break;
6541
+ }
6542
+ index += i;
6543
+ if (IS_RIGHT ? index < 0 : length <= index) {
6544
+ throw new $TypeError$6(REDUCE_EMPTY);
6545
+ }
6546
+ }
6547
+ for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
6548
+ memo = callbackfn(memo, self[index], index, O);
6549
+ }
6550
+ return memo;
6551
+ };
6552
+ };
6553
+
6554
+ var arrayReduce = {
6555
+ // `Array.prototype.reduce` method
6556
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
6557
+ left: createMethod(false),
6558
+ // `Array.prototype.reduceRight` method
6559
+ // https://tc39.es/ecma262/#sec-array.prototype.reduceright
6560
+ right: createMethod(true)
6561
+ };
6562
+
6563
+ var fails$2 = fails$s;
6564
+
6565
+ var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
6566
+ var method = [][METHOD_NAME];
6567
+ return !!method && fails$2(function () {
6568
+ // eslint-disable-next-line no-useless-call -- required for testing
6569
+ method.call(null, argument || function () { return 1; }, 1);
6570
+ });
6571
+ };
6572
+
6573
+ var global$8 = global$p;
6574
+ var classof$1 = classofRaw$2;
6575
+
6576
+ var engineIsNode = classof$1(global$8.process) === 'process';
6577
+
6578
+ var $$9 = _export;
6579
+ var $reduce = arrayReduce.left;
6580
+ var arrayMethodIsStrict = arrayMethodIsStrict$1;
6581
+ var CHROME_VERSION = engineV8Version;
6582
+ var IS_NODE$4 = engineIsNode;
6583
+
6584
+ // Chrome 80-82 has a critical bug
6585
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
6586
+ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
6587
+ var FORCED$1 = CHROME_BUG || !arrayMethodIsStrict('reduce');
6588
+
6589
+ // `Array.prototype.reduce` method
6590
+ // https://tc39.es/ecma262/#sec-array.prototype.reduce
6591
+ $$9({ target: 'Array', proto: true, forced: FORCED$1 }, {
6592
+ reduce: function reduce(callbackfn /* , initialValue */) {
6593
+ var length = arguments.length;
6594
+ return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
6595
+ }
6596
+ });
6597
+
6497
6598
  var PageStatus;
6498
6599
  (function (PageStatus) {
6499
6600
  PageStatus["Complete"] = "Completed";
6500
6601
  PageStatus["Incomplete"] = "Incomplete";
6501
6602
  PageStatus["NotStarted"] = "Not started";
6502
6603
  })(PageStatus || (PageStatus = {}));
6503
- const getPageStatus = category => {
6504
- const status = category.isVisited ? category.isCompleted && category.isValid ? PageStatus.Complete : PageStatus.Incomplete : PageStatus.NotStarted;
6604
+ const getCategoryStatus = category => {
6605
+ return category.isVisited ? category.isCompleted && category.isValid ? PageStatus.Complete : PageStatus.Incomplete : PageStatus.NotStarted;
6606
+ };
6607
+ const getCategoryStatusBadge = category => {
6608
+ const status = getCategoryStatus(category);
6505
6609
  const badgeType = status === PageStatus.Complete ? 'success' : 'information';
6506
6610
  return jsx(GoABadge, {
6507
6611
  type: badgeType,
@@ -6509,14 +6613,40 @@ const getPageStatus = category => {
6509
6613
  ariaLabel: status
6510
6614
  });
6511
6615
  };
6616
+
6617
+ const ApplicationStatus = ({
6618
+ categories
6619
+ }) => {
6620
+ const total = categories.length;
6621
+ const completed = categories.reduce((acc, cat) => acc + (getCategoryStatus(cat) === PageStatus.Complete ? 1 : 0), 0);
6622
+ const type = total === completed ? 'success' : 'important';
6623
+ const heading = total === completed ? 'Application complete' : 'Application incomplete';
6624
+ const message = `You have completed ${completed} of ${total} sections.`;
6625
+ return jsx(CompletionStatus, {
6626
+ children: jsx(GoACallout, {
6627
+ type: type,
6628
+ heading: heading,
6629
+ size: "medium",
6630
+ maxWidth: '50%',
6631
+ children: message
6632
+ })
6633
+ });
6634
+ };
6635
+
6512
6636
  /* eslint-disable jsx-a11y/anchor-is-valid */
6513
6637
  const TableOfContents = props => {
6514
6638
  var _a;
6515
6639
  const testid = 'table-of-contents';
6516
6640
  return jsx(PageBorder, {
6517
- children: jsx("div", {
6641
+ children: jsxs("div", {
6518
6642
  "data-testid": testid,
6519
- children: jsx(GoATable, {
6643
+ children: [props.title && jsx(TocTitle, {
6644
+ children: props.title
6645
+ }), jsx(ApplicationStatus, {
6646
+ categories: props.categories
6647
+ }), props.subtitle && jsx(TocSubtitle, {
6648
+ children: props.subtitle
6649
+ }), jsx(GoATable, {
6520
6650
  width: "100%",
6521
6651
  children: jsx("tbody", {
6522
6652
  children: (_a = props.categories) === null || _a === void 0 ? void 0 : _a.map((category, index) => {
@@ -6531,13 +6661,13 @@ const TableOfContents = props => {
6531
6661
  },
6532
6662
  children: category.label
6533
6663
  })
6534
- }), jsx(TocStatus, {
6535
- children: getPageStatus(category)
6664
+ }), jsx(CategoryStatus, {
6665
+ children: getCategoryStatusBadge(category)
6536
6666
  })]
6537
6667
  });
6538
6668
  })
6539
6669
  })
6540
- })
6670
+ })]
6541
6671
  })
6542
6672
  });
6543
6673
  };
@@ -6777,6 +6907,7 @@ const FormPageStepper = props => {
6777
6907
  });
6778
6908
  };
6779
6909
  const FormPagesView = props => {
6910
+ var _a, _b, _c, _d;
6780
6911
  const data = props.data;
6781
6912
  const formStepperCtx = useContext(JsonFormsStepperContext);
6782
6913
  const {
@@ -6813,7 +6944,9 @@ const FormPagesView = props => {
6813
6944
  if (showTOC) {
6814
6945
  const tocProps = {
6815
6946
  categories,
6816
- onClick: handleGoToPage
6947
+ onClick: handleGoToPage,
6948
+ title: (_b = (_a = props.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.title,
6949
+ subtitle: (_d = (_c = props.uischema) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.subtitle
6817
6950
  };
6818
6951
  return jsx(TableOfContents, Object.assign({}, tocProps));
6819
6952
  } else {
@@ -7126,7 +7259,7 @@ var isArrayIteratorMethod$1 = function (it) {
7126
7259
  return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
7127
7260
  };
7128
7261
 
7129
- var classof$1 = classof$9;
7262
+ var classof = classof$9;
7130
7263
  var getMethod$1 = getMethod$5;
7131
7264
  var isNullOrUndefined$1 = isNullOrUndefined$6;
7132
7265
  var Iterators = iterators;
@@ -7137,21 +7270,21 @@ var ITERATOR$2 = wellKnownSymbol$3('iterator');
7137
7270
  var getIteratorMethod$2 = function (it) {
7138
7271
  if (!isNullOrUndefined$1(it)) return getMethod$1(it, ITERATOR$2)
7139
7272
  || getMethod$1(it, '@@iterator')
7140
- || Iterators[classof$1(it)];
7273
+ || Iterators[classof(it)];
7141
7274
  };
7142
7275
 
7143
7276
  var call$5 = functionCall;
7144
- var aCallable$5 = aCallable$9;
7277
+ var aCallable$4 = aCallable$9;
7145
7278
  var anObject$4 = anObject$f;
7146
7279
  var tryToString$2 = tryToString$4;
7147
7280
  var getIteratorMethod$1 = getIteratorMethod$2;
7148
7281
 
7149
- var $TypeError$6 = TypeError;
7282
+ var $TypeError$5 = TypeError;
7150
7283
 
7151
7284
  var getIterator$1 = function (argument, usingIterator) {
7152
7285
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
7153
- if (aCallable$5(iteratorMethod)) return anObject$4(call$5(iteratorMethod, argument));
7154
- throw new $TypeError$6(tryToString$2(argument) + ' is not iterable');
7286
+ if (aCallable$4(iteratorMethod)) return anObject$4(call$5(iteratorMethod, argument));
7287
+ throw new $TypeError$5(tryToString$2(argument) + ' is not iterable');
7155
7288
  };
7156
7289
 
7157
7290
  var call$4 = functionCall;
@@ -7183,13 +7316,13 @@ var call$3 = functionCall;
7183
7316
  var anObject$2 = anObject$f;
7184
7317
  var tryToString$1 = tryToString$4;
7185
7318
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
7186
- var lengthOfArrayLike$1 = lengthOfArrayLike$7;
7319
+ var lengthOfArrayLike = lengthOfArrayLike$7;
7187
7320
  var isPrototypeOf$1 = objectIsPrototypeOf;
7188
7321
  var getIterator = getIterator$1;
7189
7322
  var getIteratorMethod = getIteratorMethod$2;
7190
7323
  var iteratorClose = iteratorClose$1;
7191
7324
 
7192
- var $TypeError$5 = TypeError;
7325
+ var $TypeError$4 = TypeError;
7193
7326
 
7194
7327
  var Result = function (stopped, result) {
7195
7328
  this.stopped = stopped;
@@ -7225,10 +7358,10 @@ var iterate$3 = function (iterable, unboundFunction, options) {
7225
7358
  iterator = iterable;
7226
7359
  } else {
7227
7360
  iterFn = getIteratorMethod(iterable);
7228
- if (!iterFn) throw new $TypeError$5(tryToString$1(iterable) + ' is not iterable');
7361
+ if (!iterFn) throw new $TypeError$4(tryToString$1(iterable) + ' is not iterable');
7229
7362
  // optimisation for array iterators
7230
7363
  if (isArrayIteratorMethod(iterFn)) {
7231
- for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
7364
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
7232
7365
  result = callFn(iterable[index]);
7233
7366
  if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
7234
7367
  } return new Result(false);
@@ -7256,13 +7389,13 @@ var createProperty$1 = function (object, key, value) {
7256
7389
  else object[key] = value;
7257
7390
  };
7258
7391
 
7259
- var $$9 = _export;
7392
+ var $$8 = _export;
7260
7393
  var iterate$2 = iterate$3;
7261
7394
  var createProperty = createProperty$1;
7262
7395
 
7263
7396
  // `Object.fromEntries` method
7264
7397
  // https://github.com/tc39/proposal-object-from-entries
7265
- $$9({ target: 'Object', stat: true }, {
7398
+ $$8({ target: 'Object', stat: true }, {
7266
7399
  fromEntries: function fromEntries(iterable) {
7267
7400
  var obj = {};
7268
7401
  iterate$2(iterable, function (k, v) {
@@ -7272,35 +7405,35 @@ $$9({ target: 'Object', stat: true }, {
7272
7405
  }
7273
7406
  });
7274
7407
 
7275
- var global$8 = global$p;
7276
- var fails$2 = fails$s;
7408
+ var global$7 = global$p;
7409
+ var fails$1 = fails$s;
7277
7410
  var uncurryThis$1 = functionUncurryThis;
7278
7411
  var toString$1 = toString$f;
7279
7412
  var trim = stringTrim.trim;
7280
7413
  var whitespaces = whitespaces$3;
7281
7414
 
7282
- var $parseInt$1 = global$8.parseInt;
7283
- var Symbol$1 = global$8.Symbol;
7415
+ var $parseInt$1 = global$7.parseInt;
7416
+ var Symbol$1 = global$7.Symbol;
7284
7417
  var ITERATOR$1 = Symbol$1 && Symbol$1.iterator;
7285
7418
  var hex = /^[+-]?0x/i;
7286
7419
  var exec = uncurryThis$1(hex.exec);
7287
- var FORCED$1 = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
7420
+ var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
7288
7421
  // MS Edge 18- broken with boxed symbols
7289
- || (ITERATOR$1 && !fails$2(function () { $parseInt$1(Object(ITERATOR$1)); }));
7422
+ || (ITERATOR$1 && !fails$1(function () { $parseInt$1(Object(ITERATOR$1)); }));
7290
7423
 
7291
7424
  // `parseInt` method
7292
7425
  // https://tc39.es/ecma262/#sec-parseint-string-radix
7293
- var numberParseInt = FORCED$1 ? function parseInt(string, radix) {
7426
+ var numberParseInt = FORCED ? function parseInt(string, radix) {
7294
7427
  var S = trim(toString$1(string));
7295
7428
  return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
7296
7429
  } : $parseInt$1;
7297
7430
 
7298
- var $$8 = _export;
7431
+ var $$7 = _export;
7299
7432
  var $parseInt = numberParseInt;
7300
7433
 
7301
7434
  // `parseInt` method
7302
7435
  // https://tc39.es/ecma262/#sec-parseint-string-radix
7303
- $$8({ global: true, forced: parseInt !== $parseInt }, {
7436
+ $$7({ global: true, forced: parseInt !== $parseInt }, {
7304
7437
  parseInt: $parseInt
7305
7438
  });
7306
7439
 
@@ -8542,7 +8675,12 @@ class ListWithDetailControl extends React.Component {
8542
8675
  constructor() {
8543
8676
  super(...arguments);
8544
8677
  // eslint-disable-next-line
8545
- this.addItem = (path, value) => this.props.addItem(path, value);
8678
+ this.addItem = (path, value) => {
8679
+ const pathIdValue = (path === null || path === void 0 ? void 0 : path.split('.')) || '';
8680
+ if (pathIdValue.length > 1 && +this.props.data === 0 || pathIdValue.length === 1) {
8681
+ this.props.addItem(path, value)();
8682
+ }
8683
+ };
8546
8684
  }
8547
8685
  render() {
8548
8686
  var _a;
@@ -8577,7 +8715,9 @@ class ListWithDetailControl extends React.Component {
8577
8715
  }), jsx(ObjectArrayToolBar, {
8578
8716
  errors: errors,
8579
8717
  label: label,
8580
- addItem: this.addItem,
8718
+ addItem: (path, value) => () => {
8719
+ this.addItem(path, value);
8720
+ },
8581
8721
  numColumns: 0,
8582
8722
  path: path,
8583
8723
  uischema: controlElement,
@@ -8870,7 +9010,7 @@ const AddressInputs = ({
8870
9010
  });
8871
9011
  };
8872
9012
 
8873
- var $$7 = _export;
9013
+ var $$6 = _export;
8874
9014
  var uncurryThis = functionUncurryThisClause;
8875
9015
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
8876
9016
  var toLength = toLength$5;
@@ -8891,7 +9031,7 @@ var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
8891
9031
 
8892
9032
  // `String.prototype.endsWith` method
8893
9033
  // https://tc39.es/ecma262/#sec-string.prototype.endswith
8894
- $$7({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
9034
+ $$6({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
8895
9035
  endsWith: function endsWith(searchString /* , endPosition = @length */) {
8896
9036
  var that = toString(requireObjectCoercible(this));
8897
9037
  notARegExp(searchString);
@@ -10333,87 +10473,6 @@ const createDefaultAjv = (...schemas) => {
10333
10473
  return ajv;
10334
10474
  };
10335
10475
 
10336
- var aCallable$4 = aCallable$9;
10337
- var toObject = toObject$8;
10338
- var IndexedObject = indexedObject;
10339
- var lengthOfArrayLike = lengthOfArrayLike$7;
10340
-
10341
- var $TypeError$4 = TypeError;
10342
-
10343
- var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
10344
-
10345
- // `Array.prototype.{ reduce, reduceRight }` methods implementation
10346
- var createMethod = function (IS_RIGHT) {
10347
- return function (that, callbackfn, argumentsLength, memo) {
10348
- var O = toObject(that);
10349
- var self = IndexedObject(O);
10350
- var length = lengthOfArrayLike(O);
10351
- aCallable$4(callbackfn);
10352
- if (length === 0 && argumentsLength < 2) throw new $TypeError$4(REDUCE_EMPTY);
10353
- var index = IS_RIGHT ? length - 1 : 0;
10354
- var i = IS_RIGHT ? -1 : 1;
10355
- if (argumentsLength < 2) while (true) {
10356
- if (index in self) {
10357
- memo = self[index];
10358
- index += i;
10359
- break;
10360
- }
10361
- index += i;
10362
- if (IS_RIGHT ? index < 0 : length <= index) {
10363
- throw new $TypeError$4(REDUCE_EMPTY);
10364
- }
10365
- }
10366
- for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
10367
- memo = callbackfn(memo, self[index], index, O);
10368
- }
10369
- return memo;
10370
- };
10371
- };
10372
-
10373
- var arrayReduce = {
10374
- // `Array.prototype.reduce` method
10375
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
10376
- left: createMethod(false),
10377
- // `Array.prototype.reduceRight` method
10378
- // https://tc39.es/ecma262/#sec-array.prototype.reduceright
10379
- right: createMethod(true)
10380
- };
10381
-
10382
- var fails$1 = fails$s;
10383
-
10384
- var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
10385
- var method = [][METHOD_NAME];
10386
- return !!method && fails$1(function () {
10387
- // eslint-disable-next-line no-useless-call -- required for testing
10388
- method.call(null, argument || function () { return 1; }, 1);
10389
- });
10390
- };
10391
-
10392
- var global$7 = global$p;
10393
- var classof = classofRaw$2;
10394
-
10395
- var engineIsNode = classof(global$7.process) === 'process';
10396
-
10397
- var $$6 = _export;
10398
- var $reduce = arrayReduce.left;
10399
- var arrayMethodIsStrict = arrayMethodIsStrict$1;
10400
- var CHROME_VERSION = engineV8Version;
10401
- var IS_NODE$4 = engineIsNode;
10402
-
10403
- // Chrome 80-82 has a critical bug
10404
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
10405
- var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
10406
- var FORCED = CHROME_BUG || !arrayMethodIsStrict('reduce');
10407
-
10408
- // `Array.prototype.reduce` method
10409
- // https://tc39.es/ecma262/#sec-array.prototype.reduce
10410
- $$6({ target: 'Array', proto: true, forced: FORCED }, {
10411
- reduce: function reduce(callbackfn /* , initialValue */) {
10412
- var length = arguments.length;
10413
- return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
10414
- }
10415
- });
10416
-
10417
10476
  var isPrototypeOf = objectIsPrototypeOf;
10418
10477
 
10419
10478
  var $TypeError$3 = TypeError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.2.0",
3
+ "version": "2.3.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",
@@ -0,0 +1,5 @@
1
+ import { CategoriesState } from './context';
2
+ export interface ApplicationStatusProps {
3
+ categories: CategoriesState;
4
+ }
5
+ export declare const ApplicationStatus: ({ categories }: ApplicationStatusProps) => JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { CategoryState } from './context';
2
+ export declare enum PageStatus {
3
+ Complete = "Completed",
4
+ Incomplete = "Incomplete",
5
+ NotStarted = "Not started"
6
+ }
7
+ export declare const getCategoryStatus: (category: CategoryState) => string;
8
+ export declare const getCategoryStatusBadge: (category: CategoryState) => JSX.Element;
@@ -3,6 +3,8 @@ import { CategoriesState } from './context';
3
3
  export interface TocProps {
4
4
  categories: CategoriesState;
5
5
  onClick: (id: number) => void;
6
+ title: string | undefined;
7
+ subtitle: string | undefined;
6
8
  }
7
9
  export declare const TableOfContents: (props: TocProps) => JSX.Element;
8
10
  export declare const TableOfContentsTester: RankedTester;
@@ -16,5 +16,8 @@ export declare const TableReviewItemSection: import("styled-components/dist/type
16
16
  export declare const TableReviewItem: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
17
17
  export declare const TableReviewPageTitleRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
18
18
  export declare const TableReviewCategoryLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
19
- export declare const TocStatus: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, never>> & string;
19
+ export declare const CategoryStatus: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, never>> & string;
20
20
  export declare const TocPageRef: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, never>> & string;
21
+ export declare const TocTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
22
+ export declare const TocSubtitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
23
+ export declare const CompletionStatus: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -33,7 +33,7 @@ interface NonEmptyRowProps {
33
33
  }
34
34
  export declare const NonEmptyList: React.MemoExoticComponent<({ childPath, schema, enabled, cells, uischema, }: NonEmptyRowProps & WithDeleteDialogSupport) => import("react/jsx-runtime").JSX.Element>;
35
35
  export declare class ListWithDetailControl extends React.Component<ObjectArrayControlProps, any> {
36
- addItem: (path: string, value: any) => () => void;
36
+ addItem: (path: string, value: any) => void;
37
37
  render(): import("react/jsx-runtime").JSX.Element;
38
38
  }
39
39
  export {};