@abgov/jsonforms-components 2.79.5 → 2.81.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
@@ -6170,6 +6170,9 @@ const OPTION_DEFINITIONS = defineFields({
6170
6170
  mainTitle: {
6171
6171
  schema: 'Main form title'
6172
6172
  },
6173
+ summaryPageTitle: {
6174
+ schema: 'Summary page title'
6175
+ },
6173
6176
  enableEmail: {
6174
6177
  schema: true
6175
6178
  },
@@ -14576,10 +14579,12 @@ const RightAlignmentDiv = styled.div(_t14 || (_t14 = _$5`
14576
14579
  `));
14577
14580
  const FormStepperSummaryH3 = styled.h3(_t15 || (_t15 = _$5`
14578
14581
  flex: 1;
14582
+ max-width: 100%;
14579
14583
  margin-bottom: var(--goa-space-m);
14580
14584
  font-size: var(--goa-font-size-7);
14581
14585
  line-height: var(--goa-line-height-4);
14582
- font-weight: var(--goa-font-weight-regular);
14586
+ font-weight: var(--goa-font-weight-bold);
14587
+ overflow-wrap: anywhere;
14583
14588
  `));
14584
14589
  const PageRenderPadding = styled.div(_t16 || (_t16 = _$5`
14585
14590
  margin-top: var(--goa-space-2xl);
@@ -17879,7 +17884,7 @@ const GoABaseTableReviewRenderers$1 = [
17879
17884
  renderer: CalloutReviewControl
17880
17885
  }];
17881
17886
  const FormStepperReviewer = props => {
17882
- var _uischema$options$com, _uischema$options;
17887
+ var _uischema$options$com, _uischema$options, _uischema$options2;
17883
17888
  const {
17884
17889
  uischema,
17885
17890
  data,
@@ -17888,7 +17893,10 @@ const FormStepperReviewer = props => {
17888
17893
  cells,
17889
17894
  enabled
17890
17895
  } = props;
17891
- (_uischema$options$com = (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.componentProps) != null ? _uischema$options$com : {};
17896
+ const componentProps = (_uischema$options$com = (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.componentProps) != null ? _uischema$options$com : {};
17897
+ const {
17898
+ summaryPageTitle
17899
+ } = (_uischema$options2 = uischema.options) != null ? _uischema$options2 : {};
17892
17900
  const categorization = uischema;
17893
17901
  const categories = categorization.elements;
17894
17902
  const rescopeMaps = ['#/properties/albertaAddress', '#/properties/canadianAddress', '#/properties/sin'];
@@ -17906,8 +17914,10 @@ const FormStepperReviewer = props => {
17906
17914
  }
17907
17915
  return true;
17908
17916
  };
17909
- return jsx(ReviewItem, {
17910
- children: categories.map((category, categoryIndex) => {
17917
+ return jsxs(ReviewItem, {
17918
+ children: [summaryPageTitle && !componentProps.readOnly && jsx(FormStepperSummaryH3, {
17919
+ children: summaryPageTitle
17920
+ }), categories.map((category, categoryIndex) => {
17911
17921
  // Preserve index stability
17912
17922
  if (!isVisible(category, data, '', ajv, undefined)) {
17913
17923
  return null;
@@ -17957,13 +17967,11 @@ const FormStepperReviewer = props => {
17957
17967
  }, elementIndex);
17958
17968
  })]
17959
17969
  }, categoryIndex);
17960
- })
17970
+ })]
17961
17971
  });
17962
17972
  };
17963
17973
  const FormStepperReviewControl = withAjvProps(withTranslateProps(withJsonFormsLayoutProps(FormStepperReviewer)));
17964
17974
 
17965
- const summaryLabel = 'Summary';
17966
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
17967
17975
  const FormStepper = props => {
17968
17976
  const formStepperCtx = useContext(JsonFormsStepperContext);
17969
17977
  const memoStepperProps = useMemo(() => Object.assign({}, props), [props]);
@@ -18070,13 +18078,11 @@ const FormStepperView = props => {
18070
18078
  },
18071
18079
  children: jsx(RenderStepElements, Object.assign({}, props))
18072
18080
  }, `${category.label}`);
18073
- }), jsxs("div", {
18081
+ }), jsx("div", {
18074
18082
  "data-testid": "summary_step-content",
18075
- children: [jsx(FormStepperSummaryH3, {
18076
- children: summaryLabel
18077
- }), jsx(FormStepperReviewer, Object.assign({}, props, {
18083
+ children: jsx(FormStepperReviewer, Object.assign({}, props, {
18078
18084
  navigationFunc: goToPage
18079
- }))]
18085
+ }))
18080
18086
  })]
18081
18087
  }), jsxs(GoabGrid, {
18082
18088
  minChildWidth: "100px",
@@ -21163,6 +21169,21 @@ const FullNameDobControl = props => {
21163
21169
  function escapeRegExp(s) {
21164
21170
  return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
21165
21171
  }
21172
+ const NUMERIC_STRING = /^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i;
21173
+ /**
21174
+ * A referenced value as a finite number, or undefined. Computed fields store their result as a numeric string, so
21175
+ * those are read as numbers to let one computed field reference another.
21176
+ */
21177
+ function toFiniteNumber(value) {
21178
+ if (typeof value === 'number') {
21179
+ return Number.isFinite(value) ? value : undefined;
21180
+ }
21181
+ if (typeof value === 'string' && NUMERIC_STRING.test(value.trim())) {
21182
+ const parsed = Number(value.trim());
21183
+ return Number.isFinite(parsed) ? parsed : undefined;
21184
+ }
21185
+ return undefined;
21186
+ }
21166
21187
  /**
21167
21188
  * Resolve a JSON Pointer–style scope like "#/properties/x" or "#/properties/arr/c3"
21168
21189
  */
@@ -21231,9 +21252,10 @@ function evaluateSum(scope, data, opts) {
21231
21252
  for (const row of cur) {
21232
21253
  if (row == null || typeof row !== 'object') continue;
21233
21254
  const v = row[colKey];
21234
- if (typeof v === 'number' && Number.isFinite(v)) {
21255
+ const num = toFiniteNumber(v);
21256
+ if (num !== undefined) {
21235
21257
  anyValue = true;
21236
- sum += v;
21258
+ sum += num;
21237
21259
  } else if (v !== undefined && v !== null) {
21238
21260
  anyMissing = true;
21239
21261
  }
@@ -21293,8 +21315,8 @@ function evaluateExpression(expression, data, opts) {
21293
21315
  let anyValuePresent = false;
21294
21316
  uniqueScopes.forEach((scope, idx) => {
21295
21317
  const normalized = scope.replace(/^#\/(properties\/)?/, '#/properties/');
21296
- const val = resolveScope(scope, data);
21297
- if (typeof val === 'number' && Number.isFinite(val)) {
21318
+ const val = toFiniteNumber(resolveScope(scope, data));
21319
+ if (val !== undefined) {
21298
21320
  anyValuePresent = true;
21299
21321
  const varName = `v${idx}`;
21300
21322
  vars[varName] = val;
@@ -21390,7 +21412,9 @@ const GoACalculation = props => {
21390
21412
  });
21391
21413
  useEffect(() => {
21392
21414
  if (computedValue !== undefined && typeof handleChange === 'function' && path) {
21393
- handleChange(path, computedValue);
21415
+ // Computed fields are declared as strings (the tester requires it), so a number would fail validation and the
21416
+ // page could never be completed or submitted.
21417
+ handleChange(path, String(computedValue));
21394
21418
  }
21395
21419
  }, [computedValue, handleChange, path]);
21396
21420
  const isConfigError = !!error && (error.toLowerCase().includes('invalid scope') || error.toLowerCase().includes('expression syntax'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.79.5",
3
+ "version": "2.81.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,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-10-28T22:02:18.611Z",
4
- "sourceCommit": "4deb6ade452a4284e6040a3e593012528c5fcd8f",
3
+ "generatedAt": "2026-10-29T22:49:15.258Z",
4
+ "sourceCommit": "9af2e48b5da50c3da9f7c86a79bcdcecee35ce31",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 23,
7
7
  "renderers": [
@@ -1,6 +1,6 @@
1
1
  import { GoabButtonType } from '@abgov/ui-components-common';
2
- import { CategorizationStepperLayoutRendererProps } from './types';
3
- export interface FormStepperOptionProps {
2
+ import { CategorizationStepperLayoutRendererProps, FormStepperOptions } from './types';
3
+ export interface FormStepperOptionProps extends FormStepperOptions {
4
4
  nextButtonLabel?: string;
5
5
  nextButtonType?: GoabButtonType;
6
6
  previousButtonLabel?: string;
@@ -11,4 +11,7 @@ export interface FormStepperComponentProps {
11
11
  controlledNav?: number;
12
12
  readOnly?: boolean;
13
13
  }
14
+ export interface FormStepperOptions {
15
+ summaryPageTitle?: string;
16
+ }
14
17
  export type CategorizationElement = Category | Categorization;
@@ -2,6 +2,9 @@ export declare const OPTION_DEFINITIONS: {
2
2
  mainTitle: {
3
3
  schema: string;
4
4
  };
5
+ summaryPageTitle: {
6
+ schema: string;
7
+ };
5
8
  enableEmail: {
6
9
  schema: boolean;
7
10
  };