@abgov/jsonforms-components 2.13.4 → 2.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -6,7 +6,7 @@ import styled from 'styled-components';
6
6
  import axios from 'axios';
7
7
  import get$1 from 'lodash/get';
8
8
  import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, getControlPath, toDataPath, deriveLabelForUISchemaElement, isEnabled, schemaTypeIs, formatIs, createDefaultValue, or, isObjectArrayControl, isPrimitiveArrayControl, Paths, schemaMatches, hasType, isControl, isCategorization, isLayout } from '@jsonforms/core';
9
- import { withJsonFormsControlProps, withJsonFormsRendererProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, useJsonForms, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsAllOfProps, withJsonFormsCellProps } from '@jsonforms/react';
9
+ import { withJsonFormsControlProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, useJsonForms, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsAllOfProps, withJsonFormsCellProps } from '@jsonforms/react';
10
10
  import * as _$b from 'lodash';
11
11
  import { isEqual, isEmpty as isEmpty$1, isObject as isObject$f } from 'lodash';
12
12
  import merge from 'lodash/merge';
@@ -5237,7 +5237,7 @@ styled.h4(_t8$2 || (_t8$2 = _$9`
5237
5237
  `));
5238
5238
 
5239
5239
  const GoAInputBaseControl = props => {
5240
- var _a, _b;
5240
+ var _a, _b, _c, _d, _e;
5241
5241
  const {
5242
5242
  uischema,
5243
5243
  visible,
@@ -5262,11 +5262,11 @@ const GoAInputBaseControl = props => {
5262
5262
  visible: visible,
5263
5263
  children: jsx(FormFieldWrapper, {
5264
5264
  children: jsx(GoAFormItem, {
5265
- requirement: required || getRequiredIfThen(props).length > 0 ? 'required' : undefined,
5265
+ requirement: (_c = (_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps) === null || _b === void 0 ? void 0 : _b.requirement) !== null && _c !== void 0 ? _c : required || getRequiredIfThen(props).length > 0 ? 'required' : undefined,
5266
5266
  error: isVisited === true ? modifiedErrors : undefined,
5267
5267
  testId: `${isStepperReview === true && 'review-base-'}${path}`,
5268
5268
  label: (props === null || props === void 0 ? void 0 : props.noLabel) === true ? '' : labelToUpdate,
5269
- helpText: typeof ((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.help) === 'string' && !isStepperReview ? (_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.help : '',
5269
+ helpText: typeof ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.help) === 'string' && !isStepperReview ? (_e = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _e === void 0 ? void 0 : _e.help : '',
5270
5270
  children: jsx(InnerComponent, Object.assign({}, props, {
5271
5271
  isVisited,
5272
5272
  errors: modifiedErrors,
@@ -5867,7 +5867,8 @@ const GoAInputText = props => {
5867
5867
  width: width,
5868
5868
  readonly: readOnly,
5869
5869
  maxLength: isSinField ? 11 : '',
5870
- placeholder: placeholder
5870
+ placeholder: placeholder,
5871
+ ariaLabel: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`
5871
5872
  }, (_p = uischema.options) === null || _p === void 0 ? void 0 : _p.componentProps, {
5872
5873
  // maxLength={appliedUiSchemaOptions?.maxLength}
5873
5874
  name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
@@ -5988,15 +5989,30 @@ const callout = props => {
5988
5989
  children: componentProps.message
5989
5990
  }));
5990
5991
  };
5991
- const CalloutControl = props => {
5992
- var _a, _b;
5993
- return callout(((_b = (_a = props === null || props === void 0 ? void 0 : props.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.componentProps) || {});
5992
+ const GoACalloutController = props => {
5993
+ var _a;
5994
+ const {
5995
+ uischema,
5996
+ visible,
5997
+ data
5998
+ } = props;
5999
+ let showCallout;
6000
+ if (data === undefined || Array.isArray(data) && data.length === 0) {
6001
+ showCallout = false;
6002
+ } else {
6003
+ showCallout = visible === true;
6004
+ }
6005
+ const calloutProps = ((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.componentProps) || {};
6006
+ return jsx(Visible, {
6007
+ visible: showCallout,
6008
+ children: callout(calloutProps)
6009
+ });
5994
6010
  };
5995
6011
  const CalloutReviewControl = () => {
5996
6012
  return jsx(Fragment, {});
5997
6013
  };
5998
6014
  const GoACalloutControlTester = rankWith(1, uiTypeIs('Callout'));
5999
- var GoACalloutControl = withJsonFormsRendererProps(CalloutControl);
6015
+ const GoACalloutControl = withJsonFormsControlProps(GoACalloutController);
6000
6016
 
6001
6017
  const errMalformedDate = (scope, type) => {
6002
6018
  return `${type}-date for variable '${scope}' has an incorrect format.`;
@@ -9477,7 +9493,7 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
9477
9493
  }
9478
9494
  });
9479
9495
  },
9480
- "aria-label": schemaName,
9496
+ ariaLabel: schemaName,
9481
9497
  width: "100%"
9482
9498
  }) : jsx(GoACallout, {
9483
9499
  type: "important",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.13.4",
3
+ "version": "2.13.5",
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",
@@ -9,5 +9,5 @@ export interface CalloutProps {
9
9
  export declare const callout: (props: CalloutProps) => JSX.Element;
10
10
  export declare const CalloutReviewControl: () => import("react/jsx-runtime").JSX.Element;
11
11
  export declare const GoACalloutControlTester: RankedTester;
12
- declare const _default: React.ComponentType<import("@jsonforms/core").OwnPropsOfJsonFormsRenderer>;
13
- export default _default;
12
+ export declare const GoACalloutControl: React.ComponentType<import("@jsonforms/core").OwnPropsOfControl>;
13
+ export default GoACalloutControl;