@abgov/jsonforms-components 2.10.0 → 2.11.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.
Files changed (2) hide show
  1. package/index.esm.js +20 -12
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -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,17 @@ 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
+ }
6712
6719
  return jsxs("div", {
6713
6720
  style: {
6714
6721
  fontWeight: '400',
@@ -8586,7 +8593,7 @@ const FileUploader = _ref => {
8586
8593
  uischema
8587
8594
  } = _ref,
8588
8595
  props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
8589
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
8596
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
8590
8597
  const enumerators = useContext(JsonFormContext);
8591
8598
  const uploadTriggerFunction = (_a = enumerators === null || enumerators === void 0 ? void 0 : enumerators.functions) === null || _a === void 0 ? void 0 : _a.get('upload-file');
8592
8599
  const uploadTrigger = uploadTriggerFunction && uploadTriggerFunction();
@@ -8609,9 +8616,10 @@ const FileUploader = _ref => {
8609
8616
  } = props;
8610
8617
  const propertyId = i18nKeyPrefix;
8611
8618
  const variant = ((_d = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _d === void 0 ? void 0 : _d.variant) || 'button';
8619
+ 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
8620
  const multiFileUploader = variant === 'dragdrop';
8613
8621
  const [deleteHide, setDeleteHide] = useState(false);
8614
- const fileListLength = fileList && ((_e = fileList[props.i18nKeyPrefix]) === null || _e === void 0 ? void 0 : _e.length) || 0;
8622
+ const fileListLength = fileList && ((_g = fileList[props.i18nKeyPrefix]) === null || _g === void 0 ? void 0 : _g.length) || 0;
8615
8623
  function uploadFile(file) {
8616
8624
  if (uploadTrigger) {
8617
8625
  if (!multiFileUploader) {
@@ -8667,13 +8675,13 @@ const FileUploader = _ref => {
8667
8675
  const timeoutId = setTimeout(delayedFunction, 1);
8668
8676
  return () => clearTimeout(timeoutId);
8669
8677
  }, [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 : '';
8678
+ 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;
8679
+ 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 : '';
8680
+ 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
8681
  if (!enumerators) {
8674
8682
  return jsx(Fragment, {});
8675
8683
  }
8676
- const helpText = (_p = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _p === void 0 ? void 0 : _p.help;
8684
+ const helpText = (_r = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _r === void 0 ? void 0 : _r.help;
8677
8685
  const sentenceCaseLabel = convertToSentenceCase(label);
8678
8686
  const DownloadFileWidget = ({
8679
8687
  index
@@ -8697,7 +8705,7 @@ const FileUploader = _ref => {
8697
8705
  title: "Download",
8698
8706
  type: "download",
8699
8707
  onClick: () => downloadFile(getFile(index))
8700
- }), jsx(GoAContextMenuIcon, {
8708
+ }), noDownloadButton !== true && jsx(GoAContextMenuIcon, {
8701
8709
  "data-testid": "delete-icon",
8702
8710
  title: "Delete",
8703
8711
  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.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",