@abgov/jsonforms-components 2.10.0 → 2.11.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.
Files changed (2) hide show
  1. package/index.esm.js +28 -13
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -6647,7 +6647,7 @@ const warningIcon = errorMessage => {
6647
6647
  });
6648
6648
  };
6649
6649
  const GoABaseInputReviewComponent = props => {
6650
- var _a, _b, _c;
6650
+ var _a, _b, _c, _d, _e;
6651
6651
  // eslint-disable-next-line
6652
6652
  const {
6653
6653
  data,
@@ -6696,11 +6696,7 @@ const GoABaseInputReviewComponent = props => {
6696
6696
  if (((_c = uischema.options) === null || _c === void 0 ? void 0 : _c.radio) === true) {
6697
6697
  reviewText = data ? `Yes` : `No`;
6698
6698
  } else {
6699
- if (label !== '' || typeof label === 'boolean') {
6700
- reviewText = data ? `Yes` : `No`;
6701
- } else {
6702
- reviewText = data ? `Yes (${checkboxLabel.trim()})` : `No (${checkboxLabel.trim()})`;
6703
- }
6699
+ reviewText = data ? `Yes (${checkboxLabel.trim()})` : `No (${checkboxLabel.trim()})`;
6704
6700
  }
6705
6701
  }
6706
6702
  if (isTime) {
@@ -6709,6 +6705,24 @@ const GoABaseInputReviewComponent = props => {
6709
6705
  if (isDateTime) {
6710
6706
  reviewText = reviewText && UTCToFullLocalTime(reviewText);
6711
6707
  }
6708
+ if (Array.isArray(data) && data.length > 0) {
6709
+ reviewText = jsx("ul", {
6710
+ children: data.map((checkbox, index) => {
6711
+ var _a, _b;
6712
+ const checkboxLabel = ((_b = (_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.trim()) || convertToSentenceCase(getLastSegmentFromPointer(uischema.scope));
6713
+ return jsx("li", {
6714
+ children: checkbox.trim() || checkboxLabel.trim()
6715
+ }, index);
6716
+ })
6717
+ });
6718
+ } else if (data === undefined || data === false) {
6719
+ const checkboxLabel = ((_e = (_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.trim()) || convertToSentenceCase(getLastSegmentFromPointer(uischema.scope));
6720
+ reviewText = jsx("ul", {
6721
+ children: jsx("li", {
6722
+ children: `No (${checkboxLabel.trim()})`
6723
+ })
6724
+ });
6725
+ }
6712
6726
  return jsxs("div", {
6713
6727
  style: {
6714
6728
  fontWeight: '400',
@@ -8586,7 +8600,7 @@ const FileUploader = _ref => {
8586
8600
  uischema
8587
8601
  } = _ref,
8588
8602
  props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
8589
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
8603
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
8590
8604
  const enumerators = useContext(JsonFormContext);
8591
8605
  const uploadTriggerFunction = (_a = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _a === void 0 ? void 0 : _a.get('upload-file');
8592
8606
  const uploadTrigger = uploadTriggerFunction && uploadTriggerFunction();
@@ -8609,9 +8623,10 @@ const FileUploader = _ref => {
8609
8623
  } = props;
8610
8624
  const propertyId = i18nKeyPrefix;
8611
8625
  const variant = ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.variant) || 'button';
8626
+ const noDownloadButton = (_f = (_e = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _e === void 0 ? void 0 : _e.format) === null || _f === void 0 ? void 0 : _f.noDownloadButton;
8612
8627
  const multiFileUploader = variant === 'dragdrop';
8613
8628
  const [deleteHide, setDeleteHide] = useState(false);
8614
- const fileListLength = fileList && ((_e = fileList[props.i18nKeyPrefix]) === null || _e === void 0 ? void 0 : _e.length) || 0;
8629
+ const fileListLength = fileList && ((_g = fileList[props.i18nKeyPrefix]) === null || _g === void 0 ? void 0 : _g.length) || 0;
8615
8630
  function uploadFile(file) {
8616
8631
  if (uploadTrigger) {
8617
8632
  if (!multiFileUploader) {
@@ -8667,13 +8682,13 @@ const FileUploader = _ref => {
8667
8682
  const timeoutId = setTimeout(delayedFunction, 1);
8668
8683
  return () => clearTimeout(timeoutId);
8669
8684
  }, [handleChange, fileList, propertyId]);
8670
- const readOnly = ((_g = (_f = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _f === void 0 ? void 0 : _f.componentProps) === null || _g === void 0 ? void 0 : _g.readOnly) === true || (props === null || props === void 0 ? void 0 : props.isStepperReview) === true || user === null;
8671
- const maxFileSize = (_k = (_j = (_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.componentProps) === null || _j === void 0 ? void 0 : _j.maxFileSize) !== null && _k !== void 0 ? _k : '';
8672
- const accept = (_o = (_m = (_l = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _l === void 0 ? void 0 : _l.componentProps) === null || _m === void 0 ? void 0 : _m.accept) !== null && _o !== void 0 ? _o : '';
8685
+ const readOnly = ((_j = (_h = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _h === void 0 ? void 0 : _h.componentProps) === null || _j === void 0 ? void 0 : _j.readOnly) === true || (props === null || props === void 0 ? void 0 : props.isStepperReview) === true || user === null;
8686
+ const maxFileSize = (_m = (_l = (_k = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _k === void 0 ? void 0 : _k.componentProps) === null || _l === void 0 ? void 0 : _l.maxFileSize) !== null && _m !== void 0 ? _m : '';
8687
+ const accept = (_q = (_p = (_o = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _o === void 0 ? void 0 : _o.componentProps) === null || _p === void 0 ? void 0 : _p.accept) !== null && _q !== void 0 ? _q : '';
8673
8688
  if (!enumerators) {
8674
8689
  return jsx(Fragment, {});
8675
8690
  }
8676
- const helpText = (_p = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _p === void 0 ? void 0 : _p.help;
8691
+ const helpText = (_r = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _r === void 0 ? void 0 : _r.help;
8677
8692
  const sentenceCaseLabel = convertToSentenceCase(label);
8678
8693
  const DownloadFileWidget = ({
8679
8694
  index
@@ -8697,7 +8712,7 @@ const FileUploader = _ref => {
8697
8712
  title: "Download",
8698
8713
  type: "download",
8699
8714
  onClick: () => downloadFile(getFile(index))
8700
- }), jsx(GoAContextMenuIcon, {
8715
+ }), noDownloadButton !== true && jsx(GoAContextMenuIcon, {
8701
8716
  "data-testid": "delete-icon",
8702
8717
  title: "Delete",
8703
8718
  type: "trash",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.10.0",
3
+ "version": "2.11.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",