@abgov/jsonforms-components 1.33.1 → 1.33.2
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 +6 -5
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import React, { createContext, useContext, useReducer, useMemo, useEffect, useState,
|
|
2
|
+
import React, { createContext, useContext, useReducer, useMemo, useEffect, useState, useRef, useCallback } from 'react';
|
|
3
3
|
import { GoAFormItem, GoAInput, GoATextArea, GoACallout, GoAInputDate, GoAInputDateTime, GoAInputTime, GoARadioGroup, GoARadioItem, GoACheckbox, GoAGrid, GoAFormStepper, GoAFormStep, GoAPages, GoAButton, GoAModal, GoAButtonGroup, GoAIconButton, GoAFileUploadInput, GoACircularProgress, GoAContainer, GoADetails } from '@abgov/react-components';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import axios from 'axios';
|
|
@@ -4301,9 +4301,11 @@ const Dropdown = props => {
|
|
|
4301
4301
|
const trailingIcon = isOpen ? 'chevron-up' : 'chevron-down';
|
|
4302
4302
|
const [items, setItems] = useState(props.items);
|
|
4303
4303
|
const [inputText, setInputText] = useState(selected);
|
|
4304
|
+
const prevCountRef = useRef(props.items);
|
|
4304
4305
|
useEffect(() => {
|
|
4305
4306
|
setItems(props.items);
|
|
4306
|
-
|
|
4307
|
+
prevCountRef.current = props.items;
|
|
4308
|
+
}, [isEqual(props.items, prevCountRef.current)]);
|
|
4307
4309
|
return jsxs("div", {
|
|
4308
4310
|
"data-testid": id,
|
|
4309
4311
|
children: [jsx(GoAInput, {
|
|
@@ -4318,11 +4320,11 @@ const Dropdown = props => {
|
|
|
4318
4320
|
readonly: !isAutocompletion,
|
|
4319
4321
|
onChange: (name, value) => {
|
|
4320
4322
|
if (isAutocompletion) {
|
|
4321
|
-
setIsOpen(true);
|
|
4322
4323
|
const selectedItems = props.items.filter(item => {
|
|
4323
4324
|
return item.label.includes(value);
|
|
4324
4325
|
});
|
|
4325
4326
|
setItems(selectedItems);
|
|
4327
|
+
setIsOpen(true);
|
|
4326
4328
|
}
|
|
4327
4329
|
},
|
|
4328
4330
|
trailingIcon: trailingIcon,
|
|
@@ -4341,7 +4343,7 @@ const Dropdown = props => {
|
|
|
4341
4343
|
onClick: () => {
|
|
4342
4344
|
onChange(item.value);
|
|
4343
4345
|
setSelectedOption(item.value);
|
|
4344
|
-
setInputText(item.
|
|
4346
|
+
setInputText(item.label);
|
|
4345
4347
|
setIsOpen(false);
|
|
4346
4348
|
},
|
|
4347
4349
|
children: item.label
|
|
@@ -4407,7 +4409,6 @@ const EnumSelect = props => {
|
|
|
4407
4409
|
}
|
|
4408
4410
|
return newOptions.filter(option => option.value !== '');
|
|
4409
4411
|
}, [registerData, options]);
|
|
4410
|
-
console.log(mergedOptions);
|
|
4411
4412
|
useEffect(() => {
|
|
4412
4413
|
if (registerConfig) {
|
|
4413
4414
|
registerCtx === null || registerCtx === void 0 ? void 0 : registerCtx.fetchRegisterByUrl(registerConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.33.
|
|
3
|
+
"version": "1.33.2",
|
|
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",
|