Merge branch 'main' of github.com:sartography/spiff-arena

This commit is contained in:
jasquat 2024-03-29 13:56:30 -04:00
commit 826a16f0ea
No known key found for this signature in database
3 changed files with 85 additions and 66 deletions

View File

@ -21,10 +21,10 @@
"@monaco-editor/react": "^4.4.5",
"@mui/material": "^5.10.14",
"@react-icons/all-files": "^4.1.0",
"@rjsf/core": "5.0.0-beta.20",
"@rjsf/mui": "5.0.0-beta.20",
"@rjsf/utils": "5.0.0-beta.20",
"@rjsf/validator-ajv8": "5.0.0-beta.20",
"@rjsf/core": "5.18.1",
"@rjsf/mui": "5.18.1",
"@rjsf/utils": "5.18.1",
"@rjsf/validator-ajv8": "5.18.1",
"@tanstack/react-query": "^5.28.6",
"@tanstack/react-query-devtools": "^5.28.6",
"@testing-library/jest-dom": "^6.4.2",
@ -4945,27 +4945,28 @@
}
},
"node_modules/@rjsf/core": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.0.0-beta.20.tgz",
"integrity": "sha512-dPm7Wbm5ZT9y5frr0vtcr0MvpitbO6ApITmavIGN2tIdQveVVzavSJ4kZR7T17R6aw71TMtD3UOobwIh8IslLQ==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.18.1.tgz",
"integrity": "sha512-325fOPqupCkEkH4/ufeAbaezyknCTRQx8XeK9PhtWBSwpVggJg003C2RFL7g7HdFkz546KjEBGKeJ74HXC/kVg==",
"dependencies": {
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"nanoid": "^3.3.4",
"prop-types": "^15.7.2"
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"markdown-to-jsx": "^7.4.1",
"nanoid": "^3.3.7",
"prop-types": "^15.8.1"
},
"engines": {
"node": ">=14"
},
"peerDependencies": {
"@rjsf/utils": "^5.0.0-beta.1",
"@rjsf/utils": "^5.18.x",
"react": "^16.14.0 || >=17"
}
},
"node_modules/@rjsf/mui": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.0.0-beta.20.tgz",
"integrity": "sha512-DEZakIemrOSS4wQGTrvYVgwWXUCWaV4MQdPUC0rp7YQUKrB88V7Ys7rV2BLn5Iq/wcMyu35o+zwDAQv6YaEAEw==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.18.1.tgz",
"integrity": "sha512-QVu62jWmFLJD/16F11frSAIp6JpR5TGLsNbpgYp8r7d+SxnIfUPzzhlIplNBcVXqzBujWYkSd+cGQH8bevw/MA==",
"engines": {
"node": ">=14"
},
@ -4974,20 +4975,20 @@
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.2.0",
"@mui/material": "^5.2.2",
"@rjsf/core": "^5.0.0-beta.1",
"@rjsf/utils": "^5.0.0-beta.1",
"@rjsf/core": "^5.18.x",
"@rjsf/utils": "^5.18.x",
"react": ">=17"
}
},
"node_modules/@rjsf/utils": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.0.0-beta.20.tgz",
"integrity": "sha512-ToYHJj6s9TrcHULmx1nDEVOk+TxmpylsFBUnVV8Wm2e5SFqs4TQ5cJLD84h1BP8Cv5OeEdarq7Q6uhiNjs0Qxg==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.18.1.tgz",
"integrity": "sha512-BxXd5C8gxOSDCSgfDT+XZHpBZtu4F0jJZsnMQstWJ+9QKpmTiuvbkjk3c1J4zZ3CRNgGghVH5otU5gvzVWIxpQ==",
"dependencies": {
"json-schema-merge-allof": "^0.8.1",
"jsonpointer": "^5.0.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"react-is": "^18.2.0"
},
"engines": {
@ -4998,20 +4999,20 @@
}
},
"node_modules/@rjsf/validator-ajv8": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.20.tgz",
"integrity": "sha512-QzNX76ec7EoyazMZ/yJRo+DbSWKVLJghZxVOBYU8vm0jL7sK/lqROjeQUJuD2TVyT5zJC7QimFAIKSEKZQz/vg==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.18.1.tgz",
"integrity": "sha512-Cb4++kru+XL8q5FJDWMpongtY7zLUoNqZaHDbYdkPWLl0Q7duGMfYOIRAhPpWhaI9KAjj19kCpAjQicA8gEgaw==",
"dependencies": {
"ajv": "^8.11.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
"lodash": "^4.17.21",
"lodash-es": "^4.17.21"
},
"engines": {
"node": ">=14"
},
"peerDependencies": {
"@rjsf/utils": "^5.0.0-beta.16"
"@rjsf/utils": "^5.18.x"
}
},
"node_modules/@rollup/plugin-babel": {
@ -22121,6 +22122,17 @@
"url": "https://github.com/sponsors/wooorm"
}
},
"node_modules/markdown-to-jsx": {
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.5.tgz",
"integrity": "sha512-c8NB0H/ig+FOWssE9be0PKsYbCDhcWEkicxMnpdfUuHbFljnen4LAdgUShOyR/PgO3/qKvt9cwfQ0U/zQvZ44A==",
"engines": {
"node": ">= 10"
},
"peerDependencies": {
"react": ">= 0.14.0"
}
},
"node_modules/matcher": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
@ -23278,9 +23290,9 @@
"optional": true
},
"node_modules/nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
"funding": [
{
"type": "github",
@ -37810,43 +37822,44 @@
"integrity": "sha512-zcU0gM3z+3iqj8UX45AmWY810l3oUmXM7uH4dt5xtzvMhRtYVhKGOmgOd1877dOPPepfCjUv57w+syamWIYe7w=="
},
"@rjsf/core": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.0.0-beta.20.tgz",
"integrity": "sha512-dPm7Wbm5ZT9y5frr0vtcr0MvpitbO6ApITmavIGN2tIdQveVVzavSJ4kZR7T17R6aw71TMtD3UOobwIh8IslLQ==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/core/-/core-5.18.1.tgz",
"integrity": "sha512-325fOPqupCkEkH4/ufeAbaezyknCTRQx8XeK9PhtWBSwpVggJg003C2RFL7g7HdFkz546KjEBGKeJ74HXC/kVg==",
"requires": {
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"nanoid": "^3.3.4",
"prop-types": "^15.7.2"
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"markdown-to-jsx": "^7.4.1",
"nanoid": "^3.3.7",
"prop-types": "^15.8.1"
}
},
"@rjsf/mui": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.0.0-beta.20.tgz",
"integrity": "sha512-DEZakIemrOSS4wQGTrvYVgwWXUCWaV4MQdPUC0rp7YQUKrB88V7Ys7rV2BLn5Iq/wcMyu35o+zwDAQv6YaEAEw==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/mui/-/mui-5.18.1.tgz",
"integrity": "sha512-QVu62jWmFLJD/16F11frSAIp6JpR5TGLsNbpgYp8r7d+SxnIfUPzzhlIplNBcVXqzBujWYkSd+cGQH8bevw/MA==",
"requires": {}
},
"@rjsf/utils": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.0.0-beta.20.tgz",
"integrity": "sha512-ToYHJj6s9TrcHULmx1nDEVOk+TxmpylsFBUnVV8Wm2e5SFqs4TQ5cJLD84h1BP8Cv5OeEdarq7Q6uhiNjs0Qxg==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/utils/-/utils-5.18.1.tgz",
"integrity": "sha512-BxXd5C8gxOSDCSgfDT+XZHpBZtu4F0jJZsnMQstWJ+9QKpmTiuvbkjk3c1J4zZ3CRNgGghVH5otU5gvzVWIxpQ==",
"requires": {
"json-schema-merge-allof": "^0.8.1",
"jsonpointer": "^5.0.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"react-is": "^18.2.0"
}
},
"@rjsf/validator-ajv8": {
"version": "5.0.0-beta.20",
"resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.20.tgz",
"integrity": "sha512-QzNX76ec7EoyazMZ/yJRo+DbSWKVLJghZxVOBYU8vm0jL7sK/lqROjeQUJuD2TVyT5zJC7QimFAIKSEKZQz/vg==",
"version": "5.18.1",
"resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.18.1.tgz",
"integrity": "sha512-Cb4++kru+XL8q5FJDWMpongtY7zLUoNqZaHDbYdkPWLl0Q7duGMfYOIRAhPpWhaI9KAjj19kCpAjQicA8gEgaw==",
"requires": {
"ajv": "^8.11.0",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
"lodash": "^4.17.21",
"lodash-es": "^4.17.21"
}
},
"@rollup/plugin-babel": {
@ -50893,6 +50906,12 @@
"resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.3.tgz",
"integrity": "sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw=="
},
"markdown-to-jsx": {
"version": "7.4.5",
"resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.5.tgz",
"integrity": "sha512-c8NB0H/ig+FOWssE9be0PKsYbCDhcWEkicxMnpdfUuHbFljnen4LAdgUShOyR/PgO3/qKvt9cwfQ0U/zQvZ44A==",
"requires": {}
},
"matcher": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz",
@ -51690,9 +51709,9 @@
"optional": true
},
"nanoid": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA=="
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g=="
},
"nanolru": {
"version": "1.0.0",

View File

@ -16,10 +16,10 @@
"@monaco-editor/react": "^4.4.5",
"@mui/material": "^5.10.14",
"@react-icons/all-files": "^4.1.0",
"@rjsf/core": "5.0.0-beta.20",
"@rjsf/mui": "5.0.0-beta.20",
"@rjsf/utils": "5.0.0-beta.20",
"@rjsf/validator-ajv8": "5.0.0-beta.20",
"@rjsf/core": "5.18.1",
"@rjsf/mui": "5.18.1",
"@rjsf/utils": "5.18.1",
"@rjsf/validator-ajv8": "5.18.1",
"@tanstack/react-query": "^5.28.6",
"@tanstack/react-query-devtools": "^5.28.6",
"@testing-library/jest-dom": "^6.4.2",

View File

@ -1,5 +1,5 @@
import { Select, SelectItem } from '@carbon/react';
import { WidgetProps, processSelectValue } from '@rjsf/utils';
import { WidgetProps, enumOptionsValueForIndex } from '@rjsf/utils';
import { getCommonAttributes } from '../../helpers';
function SelectWidget({
@ -20,21 +20,21 @@ function SelectWidget({
placeholder,
rawErrors = [],
}: WidgetProps) {
const { enumOptions } = options;
const { enumOptions, emptyValue: optEmptyVal } = options;
let { enumDisabled } = options;
const emptyValue = multiple ? [] : '';
const _onChange = ({
target: { value },
}: React.ChangeEvent<{ name?: string; value: unknown }>) =>
onChange(processSelectValue(schema, value, options));
}: React.ChangeEvent<{ name?: string; value: string }>) =>
onChange(enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
const _onBlur = ({ target: { value } }: React.FocusEvent<HTMLInputElement>) =>
onBlur(id, processSelectValue(schema, value, options));
onBlur(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
const _onFocus = ({
target: { value },
}: React.FocusEvent<HTMLInputElement>) =>
onFocus(id, processSelectValue(schema, value, options));
onFocus(id, enumOptionsValueForIndex(value, enumOptions, optEmptyVal));
const commonAttributes = getCommonAttributes(
label,