@abgov/jsonforms-components 1.53.6 → 1.53.8

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 +41 -66
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -2835,28 +2835,6 @@ const onKeyPressForTextControl = props => {
2835
2835
  handleChange(path, value);
2836
2836
  }
2837
2837
  };
2838
- /**
2839
- * Helper functions to process onKeyPress events for Numeric controls.
2840
- * @param props - EventKeyPressControlProps
2841
- */
2842
- const onKeyPressNumericControl = props => {
2843
- const {
2844
- value,
2845
- key,
2846
- controlProps
2847
- } = props;
2848
- const {
2849
- handleChange,
2850
- path
2851
- } = controlProps;
2852
- if (isNotKeyPressTabOrShift(key)) {
2853
- let newValue = '';
2854
- if (value !== '') {
2855
- newValue = +value;
2856
- }
2857
- handleChange(path, newValue);
2858
- }
2859
- };
2860
2838
  /**
2861
2839
  * Helper function to process onKeyPress events for Time controls
2862
2840
  * @param props - EventKeyPressControlProps
@@ -3013,9 +2991,7 @@ const onChangeForInputControl = props => {
3013
2991
  handleChange,
3014
2992
  path
3015
2993
  } = controlProps;
3016
- if (value && value !== null) {
3017
- handleChange(path, value);
3018
- }
2994
+ handleChange(path, value);
3019
2995
  };
3020
2996
  /**
3021
2997
  * Helper function to process onChange event for Date controls.
@@ -4086,7 +4062,7 @@ let _$8 = t => t,
4086
4062
  _t$8,
4087
4063
  _t2$5,
4088
4064
  _t3$4,
4089
- _t4$3;
4065
+ _t4$4;
4090
4066
  const GoADropdownTextbox = styled.div(_t$8 || (_t$8 = _$8`
4091
4067
  border-radius: var(--goa-space-2xs);
4092
4068
  box-shadow: ${0};
@@ -4126,7 +4102,7 @@ const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$8`
4126
4102
  scrollbar-color: #a8a8a8 var(--goa-color-greyscale-100) !important;
4127
4103
  }
4128
4104
  `), p => p.optionListMaxHeight || '272px');
4129
- const GoADropdownListOption = styled.div(_t4$3 || (_t4$3 = _$8`
4105
+ const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$8`
4130
4106
  padding: var(--goa-space-2xs) var(--goa-space-s);
4131
4107
  text-overflow: ellipsis;
4132
4108
  color: ${0} !important;
@@ -4508,14 +4484,7 @@ const GoAInputText = props => {
4508
4484
  controlProps: props
4509
4485
  });
4510
4486
  },
4511
- onKeyPress: (name, value, key) => {
4512
- onKeyPressForTextControl({
4513
- name,
4514
- value: autoCapitalize ? value.toUpperCase() : value,
4515
- key,
4516
- controlProps: props
4517
- });
4518
- },
4487
+ onKeyPress: (name, value, key) => {},
4519
4488
  onBlur: (name, value) => {
4520
4489
  onBlurForTextControl({
4521
4490
  name,
@@ -4741,14 +4710,7 @@ const GoANumberInput = props => {
4741
4710
  width: width,
4742
4711
  name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
4743
4712
  testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
4744
- onKeyPress: (name, value, key) => {
4745
- onKeyPressNumericControl({
4746
- name,
4747
- value,
4748
- key,
4749
- controlProps: props
4750
- });
4751
- },
4713
+ onKeyPress: (name, value, key) => {},
4752
4714
  onBlur: (name, value) => {
4753
4715
  onBlurForNumericControl({
4754
4716
  name,
@@ -4809,14 +4771,7 @@ const GoAInputInteger = props => {
4809
4771
  placeholder: placeholder,
4810
4772
  name: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
4811
4773
  testId: (appliedUiSchemaOptions === null || appliedUiSchemaOptions === void 0 ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`,
4812
- onKeyPress: (name, value, key) => {
4813
- onKeyPressNumericControl({
4814
- name,
4815
- value,
4816
- key,
4817
- controlProps: props
4818
- });
4819
- },
4774
+ onKeyPress: (name, value, key) => {},
4820
4775
  onBlur: (name, value) => {
4821
4776
  onBlurForNumericControl({
4822
4777
  name,
@@ -5408,7 +5363,7 @@ let _$5 = t => t,
5408
5363
  _t$5,
5409
5364
  _t2$4,
5410
5365
  _t3$3,
5411
- _t4$2,
5366
+ _t4$3,
5412
5367
  _t5$2,
5413
5368
  _t6$2,
5414
5369
  _t7$1,
@@ -5444,7 +5399,7 @@ const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$5`
5444
5399
  justify-content: space-between;
5445
5400
  margin-bottom: var(--goa-space-xl);
5446
5401
  `));
5447
- const ReviewItemTitle = styled.div(_t4$2 || (_t4$2 = _$5`
5402
+ const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$5`
5448
5403
  font-size: var(--goa-space-l);
5449
5404
  line-height: var(--goa-space-xl);
5450
5405
  font-weight: 300;
@@ -5817,15 +5772,15 @@ const pickPropertyValues = (obj, property, endWithType) => {
5817
5772
  } else if (_$b.isObject(obj[key])) {
5818
5773
  // if the object type is equal to end type, we are not going to continue the recursive approach
5819
5774
  if (endWithType && ((_a = obj[key]) === null || _a === void 0 ? void 0 : _a.type) === endWithType) {
5820
- if (obj[key]) {
5821
- values.push(obj[key]);
5775
+ if (property in obj[key]) {
5776
+ values.push(obj[key][property]);
5822
5777
  }
5823
5778
  } else {
5824
- values = [...values, ...pickPropertyValues(obj[key], property)];
5779
+ values = [...values, ...pickPropertyValues(obj[key], property, endWithType)];
5825
5780
  }
5826
5781
  } else if (_$b.isArray(obj[key])) {
5827
5782
  const nextValues = obj[key].map(function (arrayObj) {
5828
- return pickPropertyValues(arrayObj, property);
5783
+ return pickPropertyValues(arrayObj, property, endWithType);
5829
5784
  });
5830
5785
  values = [...values, ...nextValues];
5831
5786
  }
@@ -5945,8 +5900,14 @@ const subErrorInParent = (error, paths) => {
5945
5900
  For example: error with instance path /roadmap/0/when belongs to /roadmap
5946
5901
  */
5947
5902
  const errorPaths = error.instancePath.split('/');
5948
- if (errorPaths.length < 3) return false;
5949
- if (isNumber(errorPaths[errorPaths.length - 2])) {
5903
+ if (errorPaths.length < 2) return false;
5904
+ // For case /roadmap/0
5905
+ if (errorPaths.length > 1 && isNumber(errorPaths[errorPaths.length - 1])) {
5906
+ const parentPath = errorPaths.slice(0, errorPaths.length - 1).join('/');
5907
+ return paths.includes(parentPath);
5908
+ }
5909
+ // For case /roadmap/0/when
5910
+ if (errorPaths.length > 2 && isNumber(errorPaths[errorPaths.length - 2])) {
5950
5911
  const parentPath = errorPaths.slice(0, errorPaths.length - 2).join('/');
5951
5912
  return paths.includes(parentPath);
5952
5913
  }
@@ -6059,9 +6020,9 @@ const createStepperContextInitData = props => {
6059
6020
  const categorization = uischema;
6060
6021
  const valid = ajv.validate(schema, data || {});
6061
6022
  const categories = (_a = categorization.elements) === null || _a === void 0 ? void 0 : _a.map((c, id) => {
6062
- const scopes = pickPropertyValues(c, 'scope');
6023
+ const scopes = pickPropertyValues(c, 'scope', 'ListWithDetail');
6063
6024
  // ListWithDetail path might have conflicts with others. The errors in ListWithDetail will still be caught in the ctx.core.errors
6064
- const incompletePaths = getIncompletePaths(ajv, pickPropertyValues(c, 'scope', 'ListWithDetail'));
6025
+ const incompletePaths = getIncompletePaths(ajv, scopes);
6065
6026
  return {
6066
6027
  id,
6067
6028
  label: deriveLabelForUISchemaElement(c, t),
@@ -6424,7 +6385,8 @@ const DeleteFileModal = ({
6424
6385
  let _$3 = t => t,
6425
6386
  _t$3,
6426
6387
  _t2$3,
6427
- _t3$2;
6388
+ _t3$2,
6389
+ _t4$2;
6428
6390
  const DELAY_UPLOAD_TIMEOUT_MS = 5;
6429
6391
  const DELAY_DELETE_TIMEOUT_MS = 5;
6430
6392
  const FileUploaderReview = props => {
@@ -6433,7 +6395,7 @@ const FileUploaderReview = props => {
6433
6395
  }));
6434
6396
  };
6435
6397
  const FileUploader = _a => {
6436
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
6398
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
6437
6399
  var {
6438
6400
  data,
6439
6401
  path,
@@ -6506,6 +6468,7 @@ const FileUploader = _a => {
6506
6468
  if (!enumerators) {
6507
6469
  return jsx(Fragment, {});
6508
6470
  }
6471
+ const helpText = (_p = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _p === void 0 ? void 0 : _p.help;
6509
6472
  const sentenceCaseLabel = convertToSentenceCase(label);
6510
6473
  return jsxs(FileUploaderStyle, {
6511
6474
  id: "file-upload",
@@ -6524,6 +6487,8 @@ const FileUploader = _a => {
6524
6487
  maxFileSize: maxFileSize,
6525
6488
  accept: accept
6526
6489
  })
6490
+ }), helpText && jsx(HelpText, {
6491
+ children: helpText
6527
6492
  }), jsx("div", {
6528
6493
  children: Array.isArray(data) && data[0] === 'Loading' ? jsx(GoAModal, {
6529
6494
  open: Array.isArray(data) && data[0] === 'Loading',
@@ -6581,7 +6546,12 @@ const FileUploader = _a => {
6581
6546
  })]
6582
6547
  });
6583
6548
  };
6584
- const AttachmentBorderDisabled = styled.div(_t$3 || (_t$3 = _$3`
6549
+ const HelpText = styled.div(_t$3 || (_t$3 = _$3`
6550
+ margin-top: var(--goa-space-xs);
6551
+ font-size: var(--goa-font-size-3);
6552
+ color: var(--goa-color-text-secondary);
6553
+ `));
6554
+ const AttachmentBorderDisabled = styled.div(_t2$3 || (_t2$3 = _$3`
6585
6555
  display: flex;
6586
6556
  flex-direction: row;
6587
6557
  border: var(--goa-border-width-s) solid #dcdcdc;
@@ -6590,7 +6560,7 @@ const AttachmentBorderDisabled = styled.div(_t$3 || (_t$3 = _$3`
6590
6560
  width: fit-content;
6591
6561
  background-color: #f1f1f1;
6592
6562
  `));
6593
- const AttachmentBorder = styled.div(_t2$3 || (_t2$3 = _$3`
6563
+ const AttachmentBorder = styled.div(_t3$2 || (_t3$2 = _$3`
6594
6564
  display: flex;
6595
6565
  flex-direction: row;
6596
6566
  border: var(--goa-border-width-s) solid #dcdcdc;
@@ -6599,7 +6569,7 @@ const AttachmentBorder = styled.div(_t2$3 || (_t2$3 = _$3`
6599
6569
  width: fit-content;
6600
6570
  margin-top: var(--goa-space-2xs);
6601
6571
  `));
6602
- const FileUploaderStyle = styled.div(_t3$2 || (_t3$2 = _$3`
6572
+ const FileUploaderStyle = styled.div(_t4$2 || (_t4$2 = _$3`
6603
6573
  margin-bottom: var(--goa-space-l);
6604
6574
  .label {
6605
6575
  display: block;
@@ -6837,6 +6807,11 @@ const ToolBarHeader = styled.div(_t3$1 || (_t3$1 = _$2`
6837
6807
  `));
6838
6808
  const ObjectArrayTitle = styled.h3(_t4$1 || (_t4$1 = _$2`
6839
6809
  margin-bottom: var(--goa-space-l);
6810
+
6811
+ span {
6812
+ color: #666666;
6813
+ font-size: var(--goa-font-size-2);
6814
+ }
6840
6815
  `));
6841
6816
  const TextCenter = styled.div(_t5$1 || (_t5$1 = _$2`
6842
6817
  text-align: center;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.53.6",
3
+ "version": "1.53.8",
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",