@abgov/jsonforms-components 2.60.5 → 2.60.7

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
@@ -7291,7 +7291,7 @@ const GoAInputText = props => {
7291
7291
  });
7292
7292
  };
7293
7293
  const InnerGoAInputText = props => {
7294
- var _uischema$options$com, _uischema$options, _props$uischema, _props$uischema2, _uischema$options2, _uischema$options3, _uischema$options$com2, _uischema$options4, _uischema$options5, _uischema$options6;
7294
+ var _uischema$options$com, _uischema$options, _props$uischema, _uischema$options2, _uischema$options3, _uischema$options$pla, _uischema$options4, _props$uischema2, _uischema$options5, _uischema$options6, _uischema$options$com2, _uischema$options7, _uischema$options8, _uischema$options9;
7295
7295
  const {
7296
7296
  data,
7297
7297
  config,
@@ -7347,31 +7347,38 @@ const InnerGoAInputText = props => {
7347
7347
  if (registerConfig) {
7348
7348
  registerData = registerCtx == null ? void 0 : registerCtx.selectRegisterData(registerConfig);
7349
7349
  }
7350
+ const labelPath = (uischema == null || (_uischema$options2 = uischema.options) == null ? void 0 : _uischema$options2.label) || 'label';
7351
+ const valuePath = (uischema == null || (_uischema$options3 = uischema.options) == null ? void 0 : _uischema$options3.value) || 'value';
7352
+ const dropDownPlaceholder = (_uischema$options$pla = uischema == null || (_uischema$options4 = uischema.options) == null ? void 0 : _uischema$options4.placeholder) != null ? _uischema$options$pla : 'Select an option';
7350
7353
  const autoCompletion = ((_props$uischema2 = props.uischema) == null || (_props$uischema2 = _props$uischema2.options) == null ? void 0 : _props$uischema2.autoComplete) === true;
7351
7354
  const mergedOptions = useMemo(() => {
7352
7355
  var _registerData;
7353
- const newOptions = [...(((_registerData = registerData) == null ? void 0 : _registerData.map(d => {
7356
+ const dynamicOptions = ((_registerData = registerData) == null ? void 0 : _registerData.map(d => {
7354
7357
  if (typeof d === 'string') {
7355
7358
  return {
7356
7359
  value: d,
7357
7360
  label: d
7358
7361
  };
7359
- } else {
7360
- return Object.assign({}, d);
7361
7362
  }
7362
- })) || [])];
7363
- const hasNonEmptyOptions = newOptions.some(option => option.value !== '');
7364
- if (!hasNonEmptyOptions && newOptions.length === 1 && newOptions[0].value === '') {
7365
- return newOptions;
7366
- }
7367
- if (newOptions && newOptions.length === 0) {
7368
- newOptions.push({
7363
+ if (typeof d === 'object' && d !== null) {
7364
+ return {
7365
+ value: ___default.get(d, valuePath) || '',
7366
+ label: ___default.get(d, labelPath) || ''
7367
+ };
7368
+ }
7369
+ return {
7369
7370
  label: '',
7370
7371
  value: ''
7371
- });
7372
- }
7373
- return newOptions.filter(option => option.value !== '');
7374
- }, [registerData]);
7372
+ };
7373
+ })) || [];
7374
+ const filteredDynamicOptions = dynamicOptions.filter(item => !(item.value === '' && item.label.trim() === ''));
7375
+ const newOptions = [{
7376
+ label: dropDownPlaceholder,
7377
+ value: ''
7378
+ }, ...filteredDynamicOptions];
7379
+ return newOptions;
7380
+ // eslint-disable-next-line
7381
+ }, [registerData, valuePath, labelPath]);
7375
7382
  useEffect(() => {
7376
7383
  if (registerConfig) {
7377
7384
  registerCtx == null || registerCtx.fetchRegisterByUrl(registerConfig);
@@ -7380,10 +7387,10 @@ const InnerGoAInputText = props => {
7380
7387
  const appliedUiSchemaOptions = Object.assign({}, config, uischema == null ? void 0 : uischema.options);
7381
7388
  const placeholder = (appliedUiSchemaOptions == null ? void 0 : appliedUiSchemaOptions.placeholder) || (schema == null ? void 0 : schema.description) || '';
7382
7389
  const isSinField = schema.title === sinTitle;
7383
- const autoCapitalize = (uischema == null || (_uischema$options2 = uischema.options) == null || (_uischema$options2 = _uischema$options2.componentProps) == null ? void 0 : _uischema$options2.autoCapitalize) === true || (uischema == null || (_uischema$options3 = uischema.options) == null ? void 0 : _uischema$options3.autoCapitalize) === true;
7384
- const readOnly = (_uischema$options$com2 = uischema == null || (_uischema$options4 = uischema.options) == null || (_uischema$options4 = _uischema$options4.componentProps) == null ? void 0 : _uischema$options4.readOnly) != null ? _uischema$options$com2 : false;
7390
+ const autoCapitalize = (uischema == null || (_uischema$options5 = uischema.options) == null || (_uischema$options5 = _uischema$options5.componentProps) == null ? void 0 : _uischema$options5.autoCapitalize) === true || (uischema == null || (_uischema$options6 = uischema.options) == null ? void 0 : _uischema$options6.autoCapitalize) === true;
7391
+ const readOnly = (_uischema$options$com2 = uischema == null || (_uischema$options7 = uischema.options) == null || (_uischema$options7 = _uischema$options7.componentProps) == null ? void 0 : _uischema$options7.readOnly) != null ? _uischema$options$com2 : false;
7385
7392
  return jsx("div", {
7386
- children: mergedOptions.length > 0 ? jsx(GoabDropdown, {
7393
+ children: mergedOptions.length > 1 ? jsx(GoabDropdown, {
7387
7394
  name: `jsonforms-${path}-dropdown`,
7388
7395
  value: data,
7389
7396
  disabled: !enabled,
@@ -7408,8 +7415,7 @@ const InnerGoAInputText = props => {
7408
7415
  name: (appliedUiSchemaOptions == null ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
7409
7416
  ariaLabel: (appliedUiSchemaOptions == null ? void 0 : appliedUiSchemaOptions.name) || `${id || label}-input`,
7410
7417
  testId: (appliedUiSchemaOptions == null ? void 0 : appliedUiSchemaOptions.testId) || `${id}-input`
7411
- }, (_uischema$options5 = uischema.options) == null ? void 0 : _uischema$options5.componentProps, {
7412
- // maxLength={appliedUiSchemaOptions?.maxLength}
7418
+ }, (_uischema$options8 = uischema.options) == null ? void 0 : _uischema$options8.componentProps, {
7413
7419
  onChange: detail => {
7414
7420
  let formattedValue = detail.value;
7415
7421
  if (schema && schema.title === sinTitle && detail.value !== '') {
@@ -7431,7 +7437,7 @@ const InnerGoAInputText = props => {
7431
7437
  value: autoCapitalize ? detail.value.toUpperCase() : detail.value
7432
7438
  });
7433
7439
  }
7434
- }, uischema == null || (_uischema$options6 = uischema.options) == null ? void 0 : _uischema$options6.componentProps))
7440
+ }, uischema == null || (_uischema$options9 = uischema.options) == null ? void 0 : _uischema$options9.componentProps))
7435
7441
  });
7436
7442
  };
7437
7443
  const GoATextControl = props => jsx(GoAInputBaseControl, Object.assign({}, props, {
@@ -9057,6 +9063,8 @@ const EmptyList$1 = ({
9057
9063
  noDataMessage
9058
9064
  }) => jsx(GoabGrid, {
9059
9065
  minChildWidth: "60ch",
9066
+ mt: "l",
9067
+ mb: "l",
9060
9068
  children: jsx(TextCenter, {
9061
9069
  children: jsx("b", {
9062
9070
  children: noDataMessage
@@ -12810,25 +12818,34 @@ const GoAHorizontalLayoutComponent = ({
12810
12818
  enabled,
12811
12819
  visible
12812
12820
  }) => {
12813
- var _layout$elements, _uischema$options;
12821
+ var _uischema$options;
12814
12822
  const layout = uischema;
12815
- const hasHelpContent = (_layout$elements = layout.elements) == null ? void 0 : _layout$elements.some(element => element.type === 'HelpContent');
12823
+ const elements = layout.elements || [];
12824
+ const helpElements = elements.filter(element => element.type === 'HelpContent');
12825
+ const contentElements = elements.filter(element => element.type !== 'HelpContent');
12816
12826
  const childProps = {
12817
- elements: layout.elements,
12818
12827
  schema,
12819
12828
  path,
12820
12829
  enabled,
12821
- direction: hasHelpContent ? 'column' : 'row',
12822
12830
  visible,
12823
12831
  width: (uischema == null || (_uischema$options = uischema.options) == null ? void 0 : _uischema$options.width) || '300px',
12824
12832
  option: {
12825
12833
  space: 'xl'
12826
12834
  }
12827
12835
  };
12828
- return jsx(LayoutRenderer, Object.assign({}, childProps, {
12829
- renderers: renderers,
12830
- cells: cells
12831
- }));
12836
+ return jsxs(Fragment, {
12837
+ children: [helpElements.length > 0 && jsx(LayoutRenderer, Object.assign({}, childProps, {
12838
+ direction: "column",
12839
+ elements: helpElements,
12840
+ renderers: renderers,
12841
+ cells: cells
12842
+ })), contentElements.length > 0 && jsx(LayoutRenderer, Object.assign({}, childProps, {
12843
+ direction: "row",
12844
+ elements: contentElements,
12845
+ renderers: renderers,
12846
+ cells: cells
12847
+ }))]
12848
+ });
12832
12849
  };
12833
12850
  const GoAHorizontalReviewLayoutComponent = ({
12834
12851
  uischema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "2.60.5",
3
+ "version": "2.60.7",
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-04-16T21:11:38.005Z",
4
- "sourceCommit": "6201e03089bfd38b981d5a976a690f9985c2492d",
3
+ "generatedAt": "2026-04-17T18:52:26.336Z",
4
+ "sourceCommit": "717e95fb1c7f01c427aad1200eaeefe5bbd842c3",
5
5
  "sourcePath": "libs/jsonforms-components/src/index.ts",
6
6
  "rendererCount": 33,
7
7
  "renderers": [