From 30b7512776fd71c48a580ee1f6b89249fdf2ca04 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Thu, 5 Feb 2026 13:56:08 +0100 Subject: [PATCH 1/3] fix(common): relax base typings --- packages/common/package.json | 2 +- packages/common/src/form-template/form-template.tsx | 4 ++-- packages/common/src/select/select.tsx | 3 +++ packages/common/src/wizard/enter-handler.ts | 1 + packages/common/src/wizard/wizard.tsx | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/common/package.json b/packages/common/package.json index 36d6162d0..838aea1bc 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -20,7 +20,7 @@ }, "devDependencies": {}, "dependencies": { - "@data-driven-forms/react-form-renderer": "^4.1.8", + "@data-driven-forms/react-form-renderer": "^4.1.10", "clsx": "^1.0.4", "lodash": "^4.17.23" }, diff --git a/packages/common/src/form-template/form-template.tsx b/packages/common/src/form-template/form-template.tsx index 3fae8cd6b..e7a49d524 100644 --- a/packages/common/src/form-template/form-template.tsx +++ b/packages/common/src/form-template/form-template.tsx @@ -5,8 +5,8 @@ import { useFormApi, FormSpy, AnyObject } from '@data-driven-forms/react-form-re interface FormTemplateRenderProps extends AnyObject { formFields: React.ReactNode[]; schema: { - title?: string; - description?: string; + title?: React.ReactNode; + description?: React.ReactNode; label?: string; }; } diff --git a/packages/common/src/select/select.tsx b/packages/common/src/select/select.tsx index 52850767c..c5743c7c6 100644 --- a/packages/common/src/select/select.tsx +++ b/packages/common/src/select/select.tsx @@ -37,6 +37,9 @@ export interface SelectProps { menuPortalTarget?: Element; showMoreLabel?: string; showLessLabel?: string; + // Allow any additional props to be passed through to SelectComponent + // Different mappers may need different props for their SelectComponent implementations + [key: string]: any; } const Select = ({ diff --git a/packages/common/src/wizard/enter-handler.ts b/packages/common/src/wizard/enter-handler.ts index 9788e970e..c6e605392 100644 --- a/packages/common/src/wizard/enter-handler.ts +++ b/packages/common/src/wizard/enter-handler.ts @@ -1,3 +1,4 @@ +import { KeyboardEvent } from 'react'; import selectNext, { NextStep } from './select-next'; import { AnyObject } from '@data-driven-forms/react-form-renderer'; diff --git a/packages/common/src/wizard/wizard.tsx b/packages/common/src/wizard/wizard.tsx index c4f3debd0..0c7948ee3 100644 --- a/packages/common/src/wizard/wizard.tsx +++ b/packages/common/src/wizard/wizard.tsx @@ -1,4 +1,4 @@ -import React, { useReducer, useEffect } from 'react'; +import React, { useReducer, useEffect, KeyboardEventHandler, KeyboardEvent } from 'react'; import { useFormApi, WizardContext, AnyObject, Field } from '@data-driven-forms/react-form-renderer'; import get from 'lodash/get'; From 05179fd2845f152ea7a4f3ea7389835aa472d829 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Thu, 5 Feb 2026 13:56:48 +0100 Subject: [PATCH 2/3] fix(renderer): improve schema type inference --- .../src/form-renderer/form-renderer.tsx | 12 ++++++------ packages/react-form-renderer/src/index.ts | 2 +- .../src/wizard-context/wizard-context.ts | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/react-form-renderer/src/form-renderer/form-renderer.tsx b/packages/react-form-renderer/src/form-renderer/form-renderer.tsx index f2f068b32..d457d3721 100644 --- a/packages/react-form-renderer/src/form-renderer/form-renderer.tsx +++ b/packages/react-form-renderer/src/form-renderer/form-renderer.tsx @@ -29,7 +29,7 @@ export interface FormRendererProps< onReset?: () => void; onError?: (...args: any[]) => void; onSubmit?: FormProps['onSubmit']; - schema: Schema; + schema: Schema | (Record & { fields: Array> }); clearOnUnmount?: boolean; clearedValue?: any; componentMapper: ComponentMapper; @@ -107,7 +107,7 @@ function FormRenderer< ...props }: FormRendererProps): ReactElement { const [fileInputs, setFileInputs] = useState([]); - const formFields = useMemo(() => renderForm(schema.fields), [schema]); + const formFields = useMemo(() => renderForm(schema.fields as any), [schema]); const registeredFields = useRef>({}); const focusDecorator = useRef(createFocusDecorator()); const validatorMapperMerged = useMemo(() => { @@ -187,7 +187,7 @@ function FormRenderer< const validatorTypes = Object.keys(validatorMapperMerged); const actionTypes = actionMapper ? Object.keys(actionMapper) : []; - defaultSchemaValidator(schema, componentMapper, validatorTypes, actionTypes, schemaValidatorMapper); + defaultSchemaValidator(schema as any, componentMapper, validatorTypes, actionTypes, schemaValidatorMapper); } catch (error: any) { handleErrorCallback('schema-error', error); return ; @@ -230,13 +230,13 @@ function FormRenderer< ffGetRegisteredFields: form.getRegisteredFields, getRegisteredFields: internalGetRegisteredFields, initialValues, - schema, + schema: schema as any, }, }} > - {FormTemplate && } + {FormTemplate && } - {children && renderChildren(children, { formFields, schema })} + {children && renderChildren(children, { formFields, schema: schema as any })} )} {...props} diff --git a/packages/react-form-renderer/src/index.ts b/packages/react-form-renderer/src/index.ts index 6ebd22782..c2f5278a8 100644 --- a/packages/react-form-renderer/src/index.ts +++ b/packages/react-form-renderer/src/index.ts @@ -44,4 +44,4 @@ export * from './use-form-api'; export * from './validator-mapper'; export * from './validator-types'; export * from './validators'; -export * from './wizard-context'; \ No newline at end of file +export * from './wizard-context'; diff --git a/packages/react-form-renderer/src/wizard-context/wizard-context.ts b/packages/react-form-renderer/src/wizard-context/wizard-context.ts index 08f90d7b3..b13878d43 100644 --- a/packages/react-form-renderer/src/wizard-context/wizard-context.ts +++ b/packages/react-form-renderer/src/wizard-context/wizard-context.ts @@ -1,4 +1,4 @@ -import { createContext } from 'react'; +import { createContext, KeyboardEvent } from 'react'; import { Field } from '../common-types'; import { FormOptions } from '../renderer-context'; @@ -19,7 +19,7 @@ export interface WizardContextValue { crossroads: string[]; currentStep: { fields?: Field[]; name: string; title?: string; nextStep?: NextStep; isProgressAfterSubmissionStep?: boolean } | undefined; handlePrev: Function; - onKeyDown: Function; + onKeyDown?: (e: KeyboardEvent) => void; jumpToStep: Function; setPrevSteps: () => void; handleNext: Function; From 36b60b6d744cb164cba8870622886e126064e6a3 Mon Sep 17 00:00:00 2001 From: Martin Marosi Date: Thu, 5 Feb 2026 13:57:10 +0100 Subject: [PATCH 3/3] feat(mui): migrate to TS --- .eslintrc.json | 2 +- package-lock.json | 736 ++++--- package.json | 3 +- packages/mui-component-mapper/.eslintrc.json | 27 + packages/mui-component-mapper/.gitignore | 4 + packages/mui-component-mapper/babel.config.js | 238 -- .../config/rspack.config.js | 90 + .../config/webpack.config.js | 1 - .../demo/compositeMapper.ts | 12 + ...-array-schema.js => field-array-schema.ts} | 43 +- .../demo/demo-schemas/miq-schema.js | 1949 ----------------- .../demo/demo-schemas/widget-schema.js | 86 - .../{wizard-schema.js => wizard-schema.ts} | 49 +- .../demo/{index.js => index.tsx} | 32 +- .../demo/test-wizard-types.ts | 69 + packages/mui-component-mapper/package.json | 16 +- packages/mui-component-mapper/project.json | 5 +- .../src/checkbox/checkbox.d.ts | 18 - .../checkbox/{checkbox.js => checkbox.tsx} | 48 +- .../src/checkbox/index.js | 2 - .../src/checkbox/{index.d.ts => index.ts} | 0 .../component-mapper/component-mapper.d.ts | 41 - ...omponent-mapper.js => component-mapper.ts} | 5 +- .../src/component-mapper/index.js | 2 - .../component-mapper/{index.d.ts => index.ts} | 0 .../src/date-picker/date-picker.d.ts | 12 - .../{date-picker.js => date-picker.tsx} | 26 +- .../src/date-picker/index.js | 2 - .../src/date-picker/{index.d.ts => index.ts} | 0 .../dual-list-select/dual-list-select.d.ts | 111 - ...al-list-select.js => dual-list-select.tsx} | 171 +- .../src/dual-list-select/index.js | 2 - .../dual-list-select/{index.d.ts => index.ts} | 0 .../src/field-array/field-array.d.ts | 40 - .../{field-array.js => field-array.tsx} | 81 +- .../src/field-array/index.js | 2 - .../src/field-array/{index.d.ts => index.ts} | 0 .../src/form-field-grid/form-field-grid.d.ts | 6 - ...form-field-grid.js => form-field-grid.tsx} | 9 +- .../src/form-field-grid/index.js | 1 - .../form-field-grid/{index.d.ts => index.ts} | 0 .../src/form-template/form-template.d.ts | 5 - .../{form-template.js => form-template.tsx} | 64 +- .../src/form-template/index.js | 2 - .../form-template/{index.d.ts => index.ts} | 0 .../src/{index.js => index.ts} | 17 +- .../src/multiple-choice-list/index.js | 2 - .../{index.d.ts => index.ts} | 0 .../multiple-choice-list.d.ts | 26 - .../multiple-choice-list.js | 60 - .../multiple-choice-list.tsx | 112 + .../src/plain-text/index.js | 2 - .../src/plain-text/{index.d.ts => index.ts} | 0 .../src/plain-text/plain-text.d.ts | 12 - .../src/plain-text/plain-text.js | 17 - .../src/plain-text/plain-text.tsx | 29 + .../mui-component-mapper/src/radio/index.js | 2 - .../src/radio/{index.d.ts => index.ts} | 0 .../mui-component-mapper/src/radio/radio.d.ts | 27 - .../src/radio/{radio.js => radio.tsx} | 62 +- .../mui-component-mapper/src/select/index.js | 2 - .../src/select/{index.d.ts => index.ts} | 0 .../src/select/select.d.ts | 29 - .../src/select/{select.js => select.tsx} | 106 +- .../mui-component-mapper/src/slider/index.js | 2 - .../src/slider/{index.d.ts => index.ts} | 0 .../src/slider/slider.d.ts | 30 - .../src/slider/{slider.js => slider.tsx} | 57 +- .../src/sub-form/index.js | 2 - .../src/sub-form/{index.d.ts => index.ts} | 0 .../src/sub-form/sub-form.d.ts | 18 - .../sub-form/{sub-form.js => sub-form.tsx} | 27 +- .../mui-component-mapper/src/switch/index.js | 2 - .../src/switch/{index.d.ts => index.ts} | 0 .../src/switch/switch.d.ts | 28 - .../src/switch/{switch.js => switch.tsx} | 31 +- .../mui-component-mapper/src/tabs/index.js | 2 - .../src/tabs/{index.d.ts => index.ts} | 0 .../mui-component-mapper/src/tabs/tabs.d.ts | 15 - .../src/tabs/{tabs.js => tabs.tsx} | 43 +- .../src/tests/dependencies.test.js | 9 +- .../src/text-field/index.js | 2 - .../src/text-field/{index.d.ts => index.ts} | 0 .../src/text-field/text-field.d.ts | 18 - .../{text-field.js => text-field.tsx} | 16 +- .../src/textarea/index.js | 2 - .../src/textarea/{index.d.ts => index.ts} | 0 .../src/textarea/textarea.d.ts | 19 - .../textarea/{textarea.js => textarea.tsx} | 22 +- .../src/time-picker/index.js | 2 - .../src/time-picker/{index.d.ts => index.ts} | 0 .../src/time-picker/time-picker.d.ts | 18 - .../{time-picker.js => time-picker.tsx} | 26 +- .../src/validation-error/index.js | 2 - .../validation-error/{index.d.ts => index.ts} | 0 .../validation-error/validation-error.d.ts | 5 - .../src/validation-error/validation-error.js | 9 - .../src/validation-error/validation-error.ts | 15 + .../mui-component-mapper/src/wizard/index.js | 2 - .../src/wizard/{index.d.ts => index.ts} | 0 .../{step-buttons.js => step-buttons.tsx} | 65 +- .../wizard/{wizard-nav.js => wizard-nav.tsx} | 18 +- .../src/wizard/wizard.d.ts | 28 - .../src/wizard/{wizard.js => wizard.tsx} | 39 +- .../mui-component-mapper/tsconfig.cjs.json | 8 + .../mui-component-mapper/tsconfig.demo.json | 31 + .../mui-component-mapper/tsconfig.esm.json | 8 + packages/mui-component-mapper/tsconfig.json | 26 +- packages/pf4-component-mapper/.eslintrc.json | 27 + packages/pf4-component-mapper/.gitignore | 1 + packages/pf4-component-mapper/demo/index.tsx | 49 +- 111 files changed, 1809 insertions(+), 3432 deletions(-) create mode 100644 packages/mui-component-mapper/.eslintrc.json delete mode 100644 packages/mui-component-mapper/babel.config.js create mode 100644 packages/mui-component-mapper/config/rspack.config.js delete mode 120000 packages/mui-component-mapper/config/webpack.config.js create mode 100644 packages/mui-component-mapper/demo/compositeMapper.ts rename packages/mui-component-mapper/demo/demo-schemas/{field-array-schema.js => field-array-schema.ts} (75%) delete mode 100644 packages/mui-component-mapper/demo/demo-schemas/miq-schema.js delete mode 100644 packages/mui-component-mapper/demo/demo-schemas/widget-schema.js rename packages/mui-component-mapper/demo/demo-schemas/{wizard-schema.js => wizard-schema.ts} (74%) rename packages/mui-component-mapper/demo/{index.js => index.tsx} (84%) create mode 100644 packages/mui-component-mapper/demo/test-wizard-types.ts delete mode 100644 packages/mui-component-mapper/src/checkbox/checkbox.d.ts rename packages/mui-component-mapper/src/checkbox/{checkbox.js => checkbox.tsx} (53%) delete mode 100644 packages/mui-component-mapper/src/checkbox/index.js rename packages/mui-component-mapper/src/checkbox/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/component-mapper/component-mapper.d.ts rename packages/mui-component-mapper/src/component-mapper/{component-mapper.js => component-mapper.ts} (98%) delete mode 100644 packages/mui-component-mapper/src/component-mapper/index.js rename packages/mui-component-mapper/src/component-mapper/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/date-picker/date-picker.d.ts rename packages/mui-component-mapper/src/date-picker/{date-picker.js => date-picker.tsx} (67%) delete mode 100644 packages/mui-component-mapper/src/date-picker/index.js rename packages/mui-component-mapper/src/date-picker/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts rename packages/mui-component-mapper/src/dual-list-select/{dual-list-select.js => dual-list-select.tsx} (74%) delete mode 100644 packages/mui-component-mapper/src/dual-list-select/index.js rename packages/mui-component-mapper/src/dual-list-select/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/field-array/field-array.d.ts rename packages/mui-component-mapper/src/field-array/{field-array.js => field-array.tsx} (76%) delete mode 100644 packages/mui-component-mapper/src/field-array/index.js rename packages/mui-component-mapper/src/field-array/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/form-field-grid/form-field-grid.d.ts rename packages/mui-component-mapper/src/form-field-grid/{form-field-grid.js => form-field-grid.tsx} (63%) delete mode 100644 packages/mui-component-mapper/src/form-field-grid/index.js rename packages/mui-component-mapper/src/form-field-grid/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/form-template/form-template.d.ts rename packages/mui-component-mapper/src/form-template/{form-template.js => form-template.tsx} (50%) delete mode 100644 packages/mui-component-mapper/src/form-template/index.js rename packages/mui-component-mapper/src/form-template/{index.d.ts => index.ts} (100%) rename packages/mui-component-mapper/src/{index.js => index.ts} (71%) delete mode 100644 packages/mui-component-mapper/src/multiple-choice-list/index.js rename packages/mui-component-mapper/src/multiple-choice-list/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.d.ts delete mode 100644 packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.js create mode 100644 packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.tsx delete mode 100644 packages/mui-component-mapper/src/plain-text/index.js rename packages/mui-component-mapper/src/plain-text/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/plain-text/plain-text.d.ts delete mode 100644 packages/mui-component-mapper/src/plain-text/plain-text.js create mode 100644 packages/mui-component-mapper/src/plain-text/plain-text.tsx delete mode 100644 packages/mui-component-mapper/src/radio/index.js rename packages/mui-component-mapper/src/radio/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/radio/radio.d.ts rename packages/mui-component-mapper/src/radio/{radio.js => radio.tsx} (59%) delete mode 100644 packages/mui-component-mapper/src/select/index.js rename packages/mui-component-mapper/src/select/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/select/select.d.ts rename packages/mui-component-mapper/src/select/{select.js => select.tsx} (60%) delete mode 100644 packages/mui-component-mapper/src/slider/index.js rename packages/mui-component-mapper/src/slider/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/slider/slider.d.ts rename packages/mui-component-mapper/src/slider/{slider.js => slider.tsx} (53%) delete mode 100644 packages/mui-component-mapper/src/sub-form/index.js rename packages/mui-component-mapper/src/sub-form/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/sub-form/sub-form.d.ts rename packages/mui-component-mapper/src/sub-form/{sub-form.js => sub-form.tsx} (63%) delete mode 100644 packages/mui-component-mapper/src/switch/index.js rename packages/mui-component-mapper/src/switch/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/switch/switch.d.ts rename packages/mui-component-mapper/src/switch/{switch.js => switch.tsx} (65%) delete mode 100644 packages/mui-component-mapper/src/tabs/index.js rename packages/mui-component-mapper/src/tabs/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/tabs/tabs.d.ts rename packages/mui-component-mapper/src/tabs/{tabs.js => tabs.tsx} (54%) delete mode 100644 packages/mui-component-mapper/src/text-field/index.js rename packages/mui-component-mapper/src/text-field/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/text-field/text-field.d.ts rename packages/mui-component-mapper/src/text-field/{text-field.js => text-field.tsx} (67%) delete mode 100644 packages/mui-component-mapper/src/textarea/index.js rename packages/mui-component-mapper/src/textarea/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/textarea/textarea.d.ts rename packages/mui-component-mapper/src/textarea/{textarea.js => textarea.tsx} (58%) delete mode 100644 packages/mui-component-mapper/src/time-picker/index.js rename packages/mui-component-mapper/src/time-picker/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/time-picker/time-picker.d.ts rename packages/mui-component-mapper/src/time-picker/{time-picker.js => time-picker.tsx} (65%) delete mode 100644 packages/mui-component-mapper/src/validation-error/index.js rename packages/mui-component-mapper/src/validation-error/{index.d.ts => index.ts} (100%) delete mode 100644 packages/mui-component-mapper/src/validation-error/validation-error.d.ts delete mode 100644 packages/mui-component-mapper/src/validation-error/validation-error.js create mode 100644 packages/mui-component-mapper/src/validation-error/validation-error.ts delete mode 100644 packages/mui-component-mapper/src/wizard/index.js rename packages/mui-component-mapper/src/wizard/{index.d.ts => index.ts} (100%) rename packages/mui-component-mapper/src/wizard/{step-buttons.js => step-buttons.tsx} (61%) rename packages/mui-component-mapper/src/wizard/{wizard-nav.js => wizard-nav.tsx} (56%) delete mode 100644 packages/mui-component-mapper/src/wizard/wizard.d.ts rename packages/mui-component-mapper/src/wizard/{wizard.js => wizard.tsx} (61%) create mode 100644 packages/mui-component-mapper/tsconfig.cjs.json create mode 100644 packages/mui-component-mapper/tsconfig.demo.json create mode 100644 packages/mui-component-mapper/tsconfig.esm.json create mode 100644 packages/pf4-component-mapper/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json index fb830d1c5..79a5e02e7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,7 +22,7 @@ "arguments": true }, "plugins": ["react", "jest"], - "extends": ["react-app", "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended", "prettier"], + "extends": ["eslint-config-react-app", "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended", "prettier"], "env": { "es6": true, "browser": true, diff --git a/package-lock.json b/package-lock.json index 5671361cc..5f1384a04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -245,7 +245,6 @@ "resolved": "https://registry.npmjs.org/@algolia/client-search/-/client-search-5.47.0.tgz", "integrity": "sha512-b5hlU69CuhnS2Rqgsz7uSW0t4VqrLMLTPbUpEl0QVz56rsSwr1Sugyogrjb493sWDA+XU1FU5m9eB8uH7MoI0g==", "license": "MIT", - "peer": true, "dependencies": { "@algolia/client-common": "5.47.0", "@algolia/requester-browser-xhr": "5.47.0", @@ -453,7 +452,6 @@ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", @@ -499,9 +497,9 @@ } }, "node_modules/@babel/generator": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.0.tgz", - "integrity": "sha512-vSH118/wwM/pLR38g/Sgk05sNtro6TlTJKuiMXDaZqPUfjTFcudpCOt00IhOfj+1BFAX+UFAlzCU+6WXr3GLFQ==", + "version": "7.29.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz", + "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==", "license": "MIT", "dependencies": { "@babel/parser": "^7.29.0", @@ -903,9 +901,9 @@ } }, "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.28.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.28.6.tgz", - "integrity": "sha512-RVdFPPyY9fCRAX68haPmOk2iyKW8PKJFthmm8NeSI3paNxKWGZIn99+VbIf0FrtCpFnPgnpF/L48tadi617ULg==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.29.0.tgz", + "integrity": "sha512-CVBVv3VY/XRMxRYq5dwr2DS7/MvqPm23cOCjbwNnVrfOqcWlnefua1uUs0sjdKOGjvPUG633o07uWzJq4oI6dA==", "dev": true, "license": "MIT", "dependencies": { @@ -1096,7 +1094,6 @@ "integrity": "sha512-D+OrJumc9McXNEBI/JmFnc/0uCM2/Y3PEBG3gfV3QIYkKv5pvnpzFrl1kYCrcHJP8nOeFB/SHi1IHz29pNGuew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-plugin-utils": "^7.28.6" }, @@ -2022,7 +2019,6 @@ "integrity": "sha512-61bxqhiRfAACulXSLd/GxqmAedUSrRZIu/cbaT18T1CetkTmtDN15it7i80ru4DVqRK1WMxQhXs+Lf9kajm5Ow==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.27.3", "@babel/helper-module-imports": "^7.28.6", @@ -3029,9 +3025,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.39.11", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.11.tgz", - "integrity": "sha512-bWdeR8gWM87l4DB/kYSF9A+dVackzDb/V56Tq7QVrQ7rn86W0rgZFtlL3g3pem6AeGcb9NQNoy3ao4WpW4h5tQ==", + "version": "6.39.12", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.39.12.tgz", + "integrity": "sha512-f+/VsHVn/kOA9lltk/GFzuYwVVAKmOnNjxbrhkk3tPHntFqjWeI2TbIXx006YkBkqC10wZ4NsnWXCQiFPeAISQ==", "license": "MIT", "dependencies": { "@codemirror/state": "^6.5.0", @@ -3323,7 +3319,6 @@ "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", "license": "MIT", - "peer": true, "dependencies": { "@emotion/memoize": "^0.9.0", "@emotion/sheet": "^1.4.0", @@ -3358,7 +3353,6 @@ "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.14.0.tgz", "integrity": "sha512-O000MLDBDdk/EohJPFUqvnp4qnHeYkVP5B0xEG0D/L7cOKP9kefu2DXn8dj74cQfsEzUqh+sr1RzFqiL1o+PpA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -3396,7 +3390,6 @@ "resolved": "https://registry.npmjs.org/@emotion/server/-/server-11.11.0.tgz", "integrity": "sha512-6q89fj2z8VBTx9w93kJ5n51hsmtYuFPtZgnc1L8VzRx9ti4EU6EyvF6Nn1H1x3vcCQCF7u2dB2lY4AYJwUW4PA==", "license": "MIT", - "peer": true, "dependencies": { "@emotion/utils": "^1.2.1", "html-tokenize": "^2.0.0", @@ -3423,7 +3416,6 @@ "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.14.1.tgz", "integrity": "sha512-qEEJt42DuToa3gurlH4Qqc1kVpNq8wO8cJtDzU46TjlzWjDlsVyevtYCRijVq3SrHsROS+gVQ8Fnea108GnKzw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.13.5", @@ -4432,9 +4424,9 @@ } }, "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", + "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -4828,9 +4820,9 @@ } }, "node_modules/@jest/core/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -5557,9 +5549,9 @@ } }, "node_modules/@jest/globals/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -5798,6 +5790,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -6484,9 +6477,9 @@ "license": "MIT" }, "node_modules/@lezer/common": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.0.tgz", - "integrity": "sha512-PNGcolp9hr4PJdXR4ix7XtixDrClScvtSCYW3rQG106oVMOOI+jFb+0+J3mbeL/53g1Zd6s0kJzaw6Ri68GmAA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.5.1.tgz", + "integrity": "sha512-6YRVG9vBkaY7p1IVxL4s44n5nUnaNnGM2/AckNgYOnxTG2kWh1vR8BMxPseWPjRNpb5VtXnMpeYAEAADoRV1Iw==", "license": "MIT" }, "node_modules/@lezer/css": { @@ -6793,7 +6786,6 @@ "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.18.0.tgz", "integrity": "sha512-bbH/HaJZpFtXGvWg3TsBWG4eyt3gah3E7nCNU8GLyRjVoWcA91Vm/T+sjHfUcwgJSw9iLtucfHBoq+qW/T30aA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.23.9", "@mui/core-downloads-tracker": "^5.18.0", @@ -6943,7 +6935,6 @@ "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.18.0.tgz", "integrity": "sha512-ojZGVcRWqWhu557cdO3pWHloIGJdzVtxs3rk0F9L+x55LsUjcMUVkEhiF7E4TMxZoF9MmIHGGs0ZX3FDLAf0Xw==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.23.9", "@mui/private-theming": "^5.17.1", @@ -7132,9 +7123,9 @@ } }, "node_modules/@next/bundle-analyzer": { - "version": "15.5.11", - "resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.5.11.tgz", - "integrity": "sha512-G9JIdFJGvQuIXIkDImoTFQQjas0Hx2FKDHk/8lsSxPNhv/9aye5t1z0sA4U0VmyPKbIPRh+/yxhoDUiMsTreSw==", + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/bundle-analyzer/-/bundle-analyzer-15.5.12.tgz", + "integrity": "sha512-tDkdfvuKz9JlH+B/CEIY0+XqQ5gymVZZWvDer5HJI68rPI0EYfbSadbvIUvHTugYnMkyxSBf8u0P2yGOSQ4h+w==", "license": "MIT", "dependencies": { "webpack-bundle-analyzer": "4.10.1" @@ -7358,6 +7349,19 @@ "eslint-scope": "5.1.1" } }, + "node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -7397,9 +7401,9 @@ } }, "node_modules/@nx/devkit": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-22.4.3.tgz", - "integrity": "sha512-xTMD5znnLjI+ABFD1ePuc1PSJUH93DXNfNKk03d6rC+SWjweAwxvp+Fro+b0MUhN0gqGbS4plU2eLO2MdoyrcA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/devkit/-/devkit-22.4.5.tgz", + "integrity": "sha512-mw5G6k/XTkL675eVIcFpyZdfdIc3wQMSSGWzfA6tQGmANDYc/NFGeZR9wDqXDceHXnYKoRO6g6GhKTOHUCW23Q==", "dev": true, "license": "MIT", "dependencies": { @@ -7429,16 +7433,16 @@ } }, "node_modules/@nx/jest": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/jest/-/jest-22.4.3.tgz", - "integrity": "sha512-peDxqQP06ZFKWJPo+n4ZsWUfNYJ/d+j0qoqcRr0oLeTcFnfBmZJOXnFyf8UoMSIHG0Ky6gjH5U+eNnzByHTnkw==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/jest/-/jest-22.4.5.tgz", + "integrity": "sha512-qlEJc0Jbp8E14g7+piHH8DXsAm6C3w1CLuvtE57+LFMhM2zbBDiQ8oeXBdFPEHLCfpbSK/4yCSEmkUj1Yyrs2A==", "dev": true, "license": "MIT", "dependencies": { "@jest/reporters": "^30.0.2", "@jest/test-result": "^30.0.2", - "@nx/devkit": "22.4.3", - "@nx/js": "22.4.3", + "@nx/devkit": "22.4.5", + "@nx/js": "22.4.5", "@phenomnomnominal/tsquery": "~6.1.4", "identity-obj-proxy": "3.0.0", "jest-config": "^30.0.2", @@ -7466,9 +7470,9 @@ } }, "node_modules/@nx/js": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/js/-/js-22.4.3.tgz", - "integrity": "sha512-nTgVgUtF04imNxytupBfeanpVHIMya4ANCKLNWE1GZGLnxWCEpZoFxoA1UyttYPEW5ITN+/ECGfQF94JZD9YAA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/js/-/js-22.4.5.tgz", + "integrity": "sha512-t8972z2uF6X5i4FFmTlnvSwwxfHkk87zBpKQK0yMH5CzOENViVFNbiPnbvCIJcGNrgVUSALL3f2ngwKcTZObmA==", "dev": true, "license": "MIT", "dependencies": { @@ -7479,8 +7483,8 @@ "@babel/preset-env": "^7.23.2", "@babel/preset-typescript": "^7.22.5", "@babel/runtime": "^7.22.6", - "@nx/devkit": "22.4.3", - "@nx/workspace": "22.4.3", + "@nx/devkit": "22.4.5", + "@nx/workspace": "22.4.5", "@zkochan/js-yaml": "0.0.7", "babel-plugin-const-enum": "^1.0.1", "babel-plugin-macros": "^3.1.0", @@ -7522,9 +7526,9 @@ } }, "node_modules/@nx/nx-darwin-arm64": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-22.4.3.tgz", - "integrity": "sha512-xETC62B3BdcWa9GzNmCh7PZy1edv6OxIsuR2ksLkcu3W8fQg5zcwLtbo29n0M/oBGiNNZutPOfWmIeaDDeMhdw==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-22.4.5.tgz", + "integrity": "sha512-zdRHZv1AMvzgp+5g2VZNXXuqk0/n1wOFksOeZ6BRyKg6hC2YkjGyn5xle/UK668MDAwe9KKm4jizvztK/LlPuA==", "cpu": [ "arm64" ], @@ -7536,9 +7540,9 @@ ] }, "node_modules/@nx/nx-darwin-x64": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-22.4.3.tgz", - "integrity": "sha512-srEM3RFYl9mCy2nXz6/muUH/SqX3m2pyCeRlJheWSlHO+ByrpEBJn51LqUD+ssaCL751rByufSzm7bfPdd0zWA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-darwin-x64/-/nx-darwin-x64-22.4.5.tgz", + "integrity": "sha512-1NVWaSgpa8yawi2UILX4NE9UcMuNzAAGh95JSV2yJovRfKxFQgQSB6hj0gpJu+TLLVCroTqy4woSQ2a0SPodeQ==", "cpu": [ "x64" ], @@ -7550,9 +7554,9 @@ ] }, "node_modules/@nx/nx-freebsd-x64": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-22.4.3.tgz", - "integrity": "sha512-GfxvwdsM7DM42S4yO6FJvadoH800KluvNP7mHX8kFA3eI3o8bJt9pDGVXP1tf4G5ktdBFJE1edZLspzJpoe5gw==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-freebsd-x64/-/nx-freebsd-x64-22.4.5.tgz", + "integrity": "sha512-baaLz53wr/HsVfSJ7ZgIFCPAb/OtP7yPPasb3eIu65oVhSswGfgvz9+YINhuInUgW7x7STmRnhGeR8pj6iqFqw==", "cpu": [ "x64" ], @@ -7564,9 +7568,9 @@ ] }, "node_modules/@nx/nx-linux-arm-gnueabihf": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-22.4.3.tgz", - "integrity": "sha512-vRhEYCOVF30uuofnMc/Bq/lGmOb218DbMCpSOXroIJ+n3JXeCNGNeCLxKHnnrHk06ghdWfRf2iwTWfURz0e47A==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-22.4.5.tgz", + "integrity": "sha512-wRBPv/l39tz+sQjZUH4hygCsd/DoUXUbDYkR6lnNXWHAVyPUh48/27JozM8hD3o/G3O2Vd8PFQasIXtvy2GS0Q==", "cpu": [ "arm" ], @@ -7578,9 +7582,9 @@ ] }, "node_modules/@nx/nx-linux-arm64-gnu": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-22.4.3.tgz", - "integrity": "sha512-AIzZz705IKVxmSmEgw9KyPNxUKlfAENGiwYRE3OPwdFahO2Vx4IdC9mfxrhPLFW0XOY/Oe34XWM3S42cYHvZVg==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-22.4.5.tgz", + "integrity": "sha512-6B/yCFiqjvV2Bkz6MKUtfFWjwtiF53DN07K1BFksMpQef+h2yE1IrGaG/OCl6VaVl4VRzQgLOluqP96M1yhDgg==", "cpu": [ "arm64" ], @@ -7592,9 +7596,9 @@ ] }, "node_modules/@nx/nx-linux-arm64-musl": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-22.4.3.tgz", - "integrity": "sha512-f8VP1trPYrebTcuyjWSDA/COkd4HmjDzgKwRqWWYfj7oEk7h5I+8+90mJajPgZkAsq3bcWarzOBa0oDQbLI4xw==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-22.4.5.tgz", + "integrity": "sha512-n0v60vRYn7BDHWB588snPZntLO2XC8/pvLd+QunneM2VGEPf51n5llX5U3AwTt/ybaZHWhbuHv0sJBIbT4I0GA==", "cpu": [ "arm64" ], @@ -7606,9 +7610,9 @@ ] }, "node_modules/@nx/nx-linux-x64-gnu": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-22.4.3.tgz", - "integrity": "sha512-JBQvKA9y5CKs2cemgm6pesAkk/52t7MAqnDT/9saGUXHCw5t1QZ3c6XkdoEqaknrFC8QkwqPOXplwkzYGDfoOA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-22.4.5.tgz", + "integrity": "sha512-zT7nb1PRE3NcW/HFnbgKJ9ZPtCOeVDpbJ5J4ZhHj36ZAUWZVXFEIPq9VTIZFy5+0pioLUIClQQY7OUfwnV/Zig==", "cpu": [ "x64" ], @@ -7620,9 +7624,9 @@ ] }, "node_modules/@nx/nx-linux-x64-musl": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-22.4.3.tgz", - "integrity": "sha512-4sSFo0a6SdxLtC4SIC0p1w8MMC/pOYj+PdNtNgZLNRWHDLej5i9Qo2xg/PXZ0zu1twhu2vDQ1WfKA+1/AUdkYA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-22.4.5.tgz", + "integrity": "sha512-r8Rls5BS7lGQbUNX1Z1S370XrOacOU1bQ/dxY8i7qahFQKnMwpFo0W8odhgzjk+vrC/WLf9jOgz5/JPzehQBIw==", "cpu": [ "x64" ], @@ -7634,9 +7638,9 @@ ] }, "node_modules/@nx/nx-win32-arm64-msvc": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-22.4.3.tgz", - "integrity": "sha512-HLiBWfprdMru/+Bx7zYZXENwoO0wKOwWjrPQq39ds8qj47BvfD6HNHE6yErPn6Np/PrXG9gGrQ/mUxHXC5Vonw==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-22.4.5.tgz", + "integrity": "sha512-Lv81LTnG6sSvBOq2vDSeyfzpF9X0cTGlJdzJOJzPZXCZGFhTV1ig9TdLiij/GM2JwV4Kvq5Co6YzA5dxtGUphQ==", "cpu": [ "arm64" ], @@ -7648,9 +7652,9 @@ ] }, "node_modules/@nx/nx-win32-x64-msvc": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-22.4.3.tgz", - "integrity": "sha512-L5BcuWzLKk7oudOy25jjV3wy7d1X1bldMDekMucohLENVI3KeGM/DmbDTP796y0xI4l0yoMxd8B9P8pu/DeBbA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-22.4.5.tgz", + "integrity": "sha512-52RfBcq9PXt76soCAZAJcNmCYrdsg6BvhBmjf0IFTMZ8IaeqZ9ktxAy1TZf/gCkOaM3ly4htbYMStiZ4MHX7Eg==", "cpu": [ "x64" ], @@ -7662,17 +7666,17 @@ ] }, "node_modules/@nx/workspace": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/@nx/workspace/-/workspace-22.4.3.tgz", - "integrity": "sha512-JXaaBzYVT8uv1DBl7uaRbekBj86EMmnSoFoUbCgFqFnqpWpOvVqYlOjdgVfEpm2CsmL1bsmyy/1fy1T4NBZUnA==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/@nx/workspace/-/workspace-22.4.5.tgz", + "integrity": "sha512-QGapABrqBnRpEWbnd5UpbVCBzsYD+RlC1lWShXPpCM+dosR3qkGb+pSmxeSCsKbNVtCwYyyuRW+PvlF5Q5sU9A==", "dev": true, "license": "MIT", "dependencies": { - "@nx/devkit": "22.4.3", + "@nx/devkit": "22.4.5", "@zkochan/js-yaml": "0.0.7", "chalk": "^4.1.0", "enquirer": "~2.3.6", - "nx": "22.4.3", + "nx": "22.4.5", "picomatch": "4.0.2", "semver": "^7.6.3", "tslib": "^2.3.0", @@ -8066,6 +8070,165 @@ "dev": true, "license": "MIT" }, + "node_modules/@peculiar/asn1-cms": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-cms/-/asn1-cms-2.6.0.tgz", + "integrity": "sha512-2uZqP+ggSncESeUF/9Su8rWqGclEfEiz1SyU02WX5fUONFfkjzS2Z/F1Li0ofSmf4JqYXIOdCAZqIXAIBAT1OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "@peculiar/asn1-x509-attr": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-csr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-csr/-/asn1-csr-2.6.0.tgz", + "integrity": "sha512-BeWIu5VpTIhfRysfEp73SGbwjjoLL/JWXhJ/9mo4vXnz3tRGm+NGm3KNcRzQ9VMVqwYS2RHlolz21svzRXIHPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-ecc": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-ecc/-/asn1-ecc-2.6.0.tgz", + "integrity": "sha512-FF3LMGq6SfAOwUG2sKpPXblibn6XnEIKa+SryvUl5Pik+WR9rmRA3OCiwz8R3lVXnYnyRkSZsSLdml8H3UiOcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-pfx": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pfx/-/asn1-pfx-2.6.0.tgz", + "integrity": "sha512-rtUvtf+tyKGgokHHmZzeUojRZJYPxoD/jaN1+VAB4kKR7tXrnDCA/RAWXAIhMJJC+7W27IIRGe9djvxKgsldCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-pkcs8": "^2.6.0", + "@peculiar/asn1-rsa": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-pkcs8": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs8/-/asn1-pkcs8-2.6.0.tgz", + "integrity": "sha512-KyQ4D8G/NrS7Fw3XCJrngxmjwO/3htnA0lL9gDICvEQ+GJ+EPFqldcJQTwPIdvx98Tua+WjkdKHSC0/Km7T+lA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-pkcs9": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-pkcs9/-/asn1-pkcs9-2.6.0.tgz", + "integrity": "sha512-b78OQ6OciW0aqZxdzliXGYHASeCvvw5caqidbpQRYW2mBtXIX2WhofNXTEe7NyxTb0P6J62kAAWLwn0HuMF1Fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-pfx": "^2.6.0", + "@peculiar/asn1-pkcs8": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "@peculiar/asn1-x509-attr": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-rsa": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-rsa/-/asn1-rsa-2.6.0.tgz", + "integrity": "sha512-Nu4C19tsrTsCp9fDrH+sdcOKoVfdfoQQ7S3VqjJU6vedR7tY3RLkQ5oguOIB3zFW33USDUuYZnPEQYySlgha4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-schema": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.6.0.tgz", + "integrity": "sha512-xNLYLBFTBKkCzEZIw842BxytQQATQv+lDTCEMZ8C196iJcJJMBUZxrhSTxLaohMyKK8QlzRNTRkUmanucnDSqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1js": "^3.0.6", + "pvtsutils": "^1.3.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-x509": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.6.0.tgz", + "integrity": "sha512-uzYbPEpoQiBoTq0/+jZtpM6Gq6zADBx+JNFP3yqRgziWBxQ/Dt/HcuvRfm9zJTPdRcBqPNdaRHTVwpyiq6iNMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "asn1js": "^3.0.6", + "pvtsutils": "^1.3.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/asn1-x509-attr": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509-attr/-/asn1-x509-attr-2.6.0.tgz", + "integrity": "sha512-MuIAXFX3/dc8gmoZBkwJWxUWOSvG4MMDntXhrOZpJVMkYX+MYc/rUAU2uJOved9iJEoiUx7//3D8oG83a78UJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "asn1js": "^3.0.6", + "tslib": "^2.8.1" + } + }, + "node_modules/@peculiar/x509": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@peculiar/x509/-/x509-1.14.3.tgz", + "integrity": "sha512-C2Xj8FZ0uHWeCXXqX5B4/gVFQmtSkiuOolzAgutjTfseNOHT3pUjljDZsTSxXFGgio54bCzVFqmEOUrIVk8RDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@peculiar/asn1-cms": "^2.6.0", + "@peculiar/asn1-csr": "^2.6.0", + "@peculiar/asn1-ecc": "^2.6.0", + "@peculiar/asn1-pkcs9": "^2.6.0", + "@peculiar/asn1-rsa": "^2.6.0", + "@peculiar/asn1-schema": "^2.6.0", + "@peculiar/asn1-x509": "^2.6.0", + "pvtsutils": "^1.3.6", + "reflect-metadata": "^0.2.2", + "tslib": "^2.8.1", + "tsyringe": "^4.10.0" + }, + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/@phenomnomnominal/tsquery": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-6.1.4.tgz", @@ -8115,7 +8278,6 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/popperjs" @@ -8163,28 +8325,28 @@ } }, "node_modules/@rspack/binding": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-1.7.4.tgz", - "integrity": "sha512-BOACDXd9aTrdJgqa88KGxnTGdUdVLAClTCLhSvdNvQZIcaVLOB1qtW0TvqjZ19MxuQB/Cba5u/ILc5DNXxuDhg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding/-/binding-1.7.5.tgz", + "integrity": "sha512-tlZfDHfGu765FBL3hIyjrr8slJZztv7rCM+KIczZS7UlJQDl1+WsDKUe/+E1Fw9SlmorLWK40+y3rLTHmMrN2A==", "dev": true, "license": "MIT", "optionalDependencies": { - "@rspack/binding-darwin-arm64": "1.7.4", - "@rspack/binding-darwin-x64": "1.7.4", - "@rspack/binding-linux-arm64-gnu": "1.7.4", - "@rspack/binding-linux-arm64-musl": "1.7.4", - "@rspack/binding-linux-x64-gnu": "1.7.4", - "@rspack/binding-linux-x64-musl": "1.7.4", - "@rspack/binding-wasm32-wasi": "1.7.4", - "@rspack/binding-win32-arm64-msvc": "1.7.4", - "@rspack/binding-win32-ia32-msvc": "1.7.4", - "@rspack/binding-win32-x64-msvc": "1.7.4" + "@rspack/binding-darwin-arm64": "1.7.5", + "@rspack/binding-darwin-x64": "1.7.5", + "@rspack/binding-linux-arm64-gnu": "1.7.5", + "@rspack/binding-linux-arm64-musl": "1.7.5", + "@rspack/binding-linux-x64-gnu": "1.7.5", + "@rspack/binding-linux-x64-musl": "1.7.5", + "@rspack/binding-wasm32-wasi": "1.7.5", + "@rspack/binding-win32-arm64-msvc": "1.7.5", + "@rspack/binding-win32-ia32-msvc": "1.7.5", + "@rspack/binding-win32-x64-msvc": "1.7.5" } }, "node_modules/@rspack/binding-darwin-arm64": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.7.4.tgz", - "integrity": "sha512-d4FTW/TkqvU9R1PsaK2tbLG1uY0gAlxy3rEiQYrFRAOVTMOFkPasypmvhwD5iWrPIhkjIi79IkgrSzRJaP2ZwA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-arm64/-/binding-darwin-arm64-1.7.5.tgz", + "integrity": "sha512-dg2/IrF+g498NUt654N8LFWfIiUsHlTankWieE1S3GWEQM6jweeRbNuu1Py1nWIUsjR2yQtv7ziia7c9Q8UTaQ==", "cpu": [ "arm64" ], @@ -8196,9 +8358,9 @@ ] }, "node_modules/@rspack/binding-darwin-x64": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.7.4.tgz", - "integrity": "sha512-Oq65S5szs3+In9hVWfPksdL6EUu1+SFZK3oQINP3kMJ5zPzrdyiue+L5ClpTU/VMKVxfQTdCBsI6OVJNnaLBiA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-darwin-x64/-/binding-darwin-x64-1.7.5.tgz", + "integrity": "sha512-RQJX4boQJUu3lo1yiN344+y8W6iSO08ARXIZqFPg66coOgfX1lhsXQSRJGQEQG4PAcYuC0GmrYFzErliifbc1Q==", "cpu": [ "x64" ], @@ -8210,9 +8372,9 @@ ] }, "node_modules/@rspack/binding-linux-arm64-gnu": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.7.4.tgz", - "integrity": "sha512-sTpfCraAtYZBhdw9Xx5a19OgJ/mBELTi61utZzrO3bV6BFEulvOdmnNjpgb0xv1KATtNI8YxECohUzekk1WsOA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.7.5.tgz", + "integrity": "sha512-R7CO1crkJQLIQpJQzf+6DMHjvcvH/VxsatS5CG897IIT2aAfBeQuQAO+ERJko/UwSZam2K8Rxjuopcu5A2jsTQ==", "cpu": [ "arm64" ], @@ -8224,9 +8386,9 @@ ] }, "node_modules/@rspack/binding-linux-arm64-musl": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.7.4.tgz", - "integrity": "sha512-sw8jZbUe13Ry0/tnUt1pSdwkaPtSzKuveq+b6/CUT26I3DKfJQoG0uJbjj2quMe4ks3jDmoGlxuRe4D/fWUoSg==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.7.5.tgz", + "integrity": "sha512-moDVFD06ISZi+wCIjJLzQSr8WO8paViacSHk+rOKQxwKI96cPoC4JFkz0+ibT2uks4i2ecs4Op48orsoguiXxw==", "cpu": [ "arm64" ], @@ -8238,9 +8400,9 @@ ] }, "node_modules/@rspack/binding-linux-x64-gnu": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.7.4.tgz", - "integrity": "sha512-1W6LU0wR/TxB+8pogt0pn0WRwbQmKfu9839p/VBuSkNdWR4aljAhYO6RxsLQLCLrDAqEyrpeYWsWJBvAJ4T/pA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.7.5.tgz", + "integrity": "sha512-LGtdsdhtA5IxdMptj2NDVEbuZF4aqM99BVn3saHp92A4Fn20mW9UtQ+19PtaOFdbQBUN1GcP+cosrJ1wY56hOg==", "cpu": [ "x64" ], @@ -8252,9 +8414,9 @@ ] }, "node_modules/@rspack/binding-linux-x64-musl": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.7.4.tgz", - "integrity": "sha512-rkmu8qLnm/q8J14ZQZ04SnPNzdRNgzAoKJCTbnhCzcuL5k5e20LUFfGuS6j7Io1/UdVMOjz/u7R6b9h/qA1Scw==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-linux-x64-musl/-/binding-linux-x64-musl-1.7.5.tgz", + "integrity": "sha512-V1HTvuj0XF/e4Xnixqf7FrxdCtTkYqn26EKwH7ExUFuVBh4SsLGr29EK5SOXBG0xdy5TSEUokMup7cuONPb3Hw==", "cpu": [ "x64" ], @@ -8266,9 +8428,9 @@ ] }, "node_modules/@rspack/binding-wasm32-wasi": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-1.7.4.tgz", - "integrity": "sha512-6BQvLbDtUVkTN5o1QYLYKAYuXavC4ER5Vn/amJEoecbM9F25MNAv28inrXs7BQ4cHSU4WW/F4yZPGnA+jUZLyw==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-wasm32-wasi/-/binding-wasm32-wasi-1.7.5.tgz", + "integrity": "sha512-rGNHrk2QuLFfwOTib91skuLh2aMYeTP4lgM4zanDhtt95DLDlwioETFY7FzY1WmS+Z3qnEyrgQIRp8osy0NKTw==", "cpu": [ "wasm32" ], @@ -8280,9 +8442,9 @@ } }, "node_modules/@rspack/binding-win32-arm64-msvc": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.7.4.tgz", - "integrity": "sha512-kipggu7xVPhnAkAV7koSDVbBuuMDMA4hX60DNJKTS6fId3XNHcZqWKIsWGOt0yQ6KV7I3JRRBDotKLx6uYaRWw==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.7.5.tgz", + "integrity": "sha512-eLyD9URS9M2pYa7sPICu9S0OuDAMnnGfuqrZYlrtgnEOEgimaG39gX6ENLwHvlNulaVMMFTNbDnS/2MELZ7r7g==", "cpu": [ "arm64" ], @@ -8294,9 +8456,9 @@ ] }, "node_modules/@rspack/binding-win32-ia32-msvc": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.7.4.tgz", - "integrity": "sha512-9Zdozc13AUQHqagDDHxHml1FnZZWuSj/uP+SxtlTlQaiIE9GDH3n0cUio1GUq+cBKbcXeiE3dJMGJxhiFaUsxA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.7.5.tgz", + "integrity": "sha512-ZT4eC8hHWzweA6S4Tl2c/z/fvhbU7Wnh+l76z+qmDy8wuA8uNrHgIb1mHLPli/wsqcjmIy8rDO9gkIBitg5I+w==", "cpu": [ "ia32" ], @@ -8308,9 +8470,9 @@ ] }, "node_modules/@rspack/binding-win32-x64-msvc": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.7.4.tgz", - "integrity": "sha512-3a/jZTUrvU340IuRcxul+ccsDtdrMaGq/vi4HNcWalL0H2xeOeuieBAV8AZqaRjmxMu8OyRcpcSrkHtN1ol/eA==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.7.5.tgz", + "integrity": "sha512-a2j10QS3dZvW+gdu+FXteAkChxsK2g9BRUOmpt13w22LkiGrdmOkMQyDWRgJNxUGJTlqIUqtXxs72nTTlzo2Sw==", "cpu": [ "x64" ], @@ -8322,9 +8484,9 @@ ] }, "node_modules/@rspack/cli": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/cli/-/cli-1.7.4.tgz", - "integrity": "sha512-YYRE/m8TqKJdv2UvyXMECZZl93Z/R2/EonpIS/gEmuq+3eu5YDwgbrKqvtbqr7LFfrghYcTYz/V1EPOiseUr3w==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/cli/-/cli-1.7.5.tgz", + "integrity": "sha512-z4JqxYiEb4iDbJa2Y232qmMbVEwh7c3DTZ52DQpFHDcOxxh9C7DNZTFpz5TPsv15IYxTXnC8M/wJ7gqfaU3W1g==", "dev": true, "license": "MIT", "dependencies": { @@ -8419,15 +8581,14 @@ } }, "node_modules/@rspack/core": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.7.4.tgz", - "integrity": "sha512-6QNqcsRSy1WbAGvjA2DAEx4yyAzwrvT6vd24Kv4xdZHdvF6FmcUbr5J+mLJ1jSOXvpNhZ+RzN37JQ8fSmytEtw==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/@rspack/core/-/core-1.7.5.tgz", + "integrity": "sha512-W1ChLhjBxGg6y4AHjEVjhcww/FZJ2O9obR0EOlYcfrfQGojCAUMeQjbmaF2sse5g5m0vSCaPtNYkycZ0qVRk1A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@module-federation/runtime-tools": "0.22.0", - "@rspack/binding": "1.7.4", + "@rspack/binding": "1.7.5", "@rspack/lite-tapable": "1.1.0" }, "engines": { @@ -8555,7 +8716,6 @@ "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -9057,11 +9217,10 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.1.0.tgz", - "integrity": "sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA==", + "version": "25.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.0.tgz", + "integrity": "sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==", "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -9109,11 +9268,10 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "19.2.10", - "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.10.tgz", - "integrity": "sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==", + "version": "19.2.12", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.12.tgz", + "integrity": "sha512-22v4srzdW0RP/o1SSBaDEoid99oodPAY6zx9xYj0GnJQP0YXgBpwi2zrEN6iamB6EijL9H9QsgsNeSK8rFBJtA==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -9447,7 +9605,6 @@ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.54.0", "@typescript-eslint/types": "8.54.0", @@ -10250,7 +10407,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -10330,7 +10486,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -10395,7 +10550,6 @@ "resolved": "https://registry.npmjs.org/algoliasearch/-/algoliasearch-5.47.0.tgz", "integrity": "sha512-AGtz2U7zOV4DlsuYV84tLp2tBbA7RPtLA44jbVH4TTpDcc1dIWmULjHSsunlhscbzDydnjuFlNhflR3nV4VJaQ==", "license": "MIT", - "peer": true, "dependencies": { "@algolia/abtesting": "1.13.0", "@algolia/client-abtesting": "5.47.0", @@ -10794,6 +10948,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/asn1js": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.7.tgz", + "integrity": "sha512-uLvq6KJu04qoQM6gvBfKFjlh6Gl0vOKQuR5cJMDHQkmwfMOQeN3F3SHCv9SNYSL+CRoHvOGFfllDlVz03GQjvQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/ast-types-flow": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", @@ -10980,9 +11149,9 @@ } }, "node_modules/babel-jest/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -11614,7 +11783,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -11709,6 +11877,16 @@ "node": ">= 0.8" } }, + "node_modules/bytestreamjs": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz", + "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/call-bind": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", @@ -11790,9 +11968,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001766", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001766.tgz", - "integrity": "sha512-4C0lfJ0/YPjJQHagaE9x2Elb69CIqEPZeG0anQt9SIvIoOH4a4uaRl73IavyO+0qZh6MDLH//DrXThEYKHkmYA==", + "version": "1.0.30001768", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001768.tgz", + "integrity": "sha512-qY3aDRZC5nWPgHUgIB84WL+nySuo19wk0VJpp/XI9T34lrvkyhRvNVOFJOp2kxClQhiFBu+TaUSudf6oa3vkSA==", "funding": [ { "type": "opencollective", @@ -12616,9 +12794,9 @@ } }, "node_modules/create-jest/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -13420,9 +13598,9 @@ } }, "node_modules/default-browser": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.4.0.tgz", - "integrity": "sha512-XDuvSq38Hr1MdN47EDvYtx3U0MTqpCEn+F6ft8z2vYDzMrvQhVp0ui9oQdqW3MvK3vqUETglt1tVGgjLuJ5izg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", + "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==", "dev": true, "license": "MIT", "dependencies": { @@ -13831,12 +14009,6 @@ "react": ">=16.8.0" } }, - "node_modules/downshift/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "license": "MIT" - }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -13934,9 +14106,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.283", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.283.tgz", - "integrity": "sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==", + "version": "1.5.286", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.286.tgz", + "integrity": "sha512-9tfDXhJ4RKFNerfjdCcZfufu49vg620741MNs26a9+bhLThdB+plgMeou98CAaHu/WATj2iHOOHTp1hWtABj2A==", "license": "ISC" }, "node_modules/emittery": { @@ -13989,13 +14161,13 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.18.4", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", - "integrity": "sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==", + "version": "5.19.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz", + "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" + "tapable": "^2.3.0" }, "engines": { "node": ">=10.13.0" @@ -14346,7 +14518,6 @@ "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -14445,7 +14616,6 @@ "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", "@typescript-eslint/scope-manager": "5.62.0", @@ -14481,7 +14651,6 @@ "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", "@typescript-eslint/types": "5.62.0", @@ -15947,7 +16116,6 @@ "resolved": "https://registry.npmjs.org/final-form/-/final-form-4.20.10.tgz", "integrity": "sha512-TL48Pi1oNHeMOHrKv1bCJUrWZDcD3DIG6AGYVNOnyZPr7Bd/pStN0pL+lfzF5BNoj/FclaoiaLenk4XUIFVYng==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.10.0" }, @@ -15964,7 +16132,6 @@ "resolved": "https://registry.npmjs.org/final-form-arrays/-/final-form-arrays-3.1.0.tgz", "integrity": "sha512-TWBvun+AopgBLw9zfTFHBllnKMVNEwCEyDawphPuBGGqNsuhGzhT7yewHys64KFFwzIs6KEteGLpKOwvTQEscQ==", "license": "MIT", - "peer": true, "peerDependencies": { "final-form": "^4.20.8" } @@ -16433,16 +16600,16 @@ } }, "node_modules/github-buttons": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/github-buttons/-/github-buttons-2.30.0.tgz", - "integrity": "sha512-8LysiSd/6I0dIsVnI0tJp0NDNWpFXPYjx8o4BsOZcvLER4CV3Vd8/+uXCMZnQwHSXHBayDbYq0IZrwFJd1GxRA==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/github-buttons/-/github-buttons-2.31.0.tgz", + "integrity": "sha512-XaR6cZEvVkLMnHv8K3j6FmZLAEH8AMuEkiBPj/vSHU8nt0iW5vYxhIa70ZPc4DsKAg7Latg3CcfIju/KunFaTQ==", "license": "BSD-2-Clause" }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -18345,7 +18512,6 @@ "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", @@ -18425,9 +18591,9 @@ } }, "node_modules/jest-changed-files/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -18559,6 +18725,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -18874,9 +19041,9 @@ } }, "node_modules/jest-cli/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -19461,6 +19628,7 @@ "version": "10.5.0", "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "dev": true, "license": "ISC", "dependencies": { @@ -19892,9 +20060,9 @@ } }, "node_modules/jest-environment-jsdom/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -20154,9 +20322,9 @@ } }, "node_modules/jest-leak-detector/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -20607,9 +20775,9 @@ } }, "node_modules/jest-runner/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -21068,9 +21236,9 @@ } }, "node_modules/jest-runtime/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -21430,9 +21598,9 @@ } }, "node_modules/jest-snapshot/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -21798,9 +21966,9 @@ } }, "node_modules/jest-validate/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -21931,9 +22099,9 @@ } }, "node_modules/jest-watcher/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -22092,9 +22260,9 @@ } }, "node_modules/jest/node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", "dev": true, "license": "MIT" }, @@ -24160,7 +24328,6 @@ "resolved": "https://registry.npmjs.org/next/-/next-15.5.12.tgz", "integrity": "sha512-Fi/wQ4Etlrn60rz78bebG1i1SR20QxvV8tVp6iJspjLUSHcZoeUXCt+vmWoEcza85ElZzExK/jJ/F6SvtGktjA==", "license": "MIT", - "peer": true, "dependencies": { "@next/env": "15.5.12", "@swc/helpers": "0.5.15", @@ -24351,13 +24518,12 @@ "license": "MIT" }, "node_modules/nx": { - "version": "22.4.3", - "resolved": "https://registry.npmjs.org/nx/-/nx-22.4.3.tgz", - "integrity": "sha512-5ZBxw4dIif5AvrtV2k29aYYcxuq/XqKGa7ygFumf87q78PRubANCh8Nh8v02f/SbzqsTcIdq1kD4RDgqs2aIow==", + "version": "22.4.5", + "resolved": "https://registry.npmjs.org/nx/-/nx-22.4.5.tgz", + "integrity": "sha512-l68kzhnemXXGCDS9/W8eccZ7Bzse9pw1oJ466pzDM89MbA6hEaOQ0p+eDXZI++iWl0T+lYJ56EDhO23syKzt9g==", "dev": true, "hasInstallScript": true, "license": "MIT", - "peer": true, "dependencies": { "@napi-rs/wasm-runtime": "0.2.4", "@yarnpkg/lockfile": "^1.1.0", @@ -24400,16 +24566,16 @@ "nx-cloud": "bin/nx-cloud.js" }, "optionalDependencies": { - "@nx/nx-darwin-arm64": "22.4.3", - "@nx/nx-darwin-x64": "22.4.3", - "@nx/nx-freebsd-x64": "22.4.3", - "@nx/nx-linux-arm-gnueabihf": "22.4.3", - "@nx/nx-linux-arm64-gnu": "22.4.3", - "@nx/nx-linux-arm64-musl": "22.4.3", - "@nx/nx-linux-x64-gnu": "22.4.3", - "@nx/nx-linux-x64-musl": "22.4.3", - "@nx/nx-win32-arm64-msvc": "22.4.3", - "@nx/nx-win32-x64-msvc": "22.4.3" + "@nx/nx-darwin-arm64": "22.4.5", + "@nx/nx-darwin-x64": "22.4.5", + "@nx/nx-freebsd-x64": "22.4.5", + "@nx/nx-linux-arm-gnueabihf": "22.4.5", + "@nx/nx-linux-arm64-gnu": "22.4.5", + "@nx/nx-linux-arm64-musl": "22.4.5", + "@nx/nx-linux-x64-gnu": "22.4.5", + "@nx/nx-linux-x64-musl": "22.4.5", + "@nx/nx-win32-arm64-msvc": "22.4.5", + "@nx/nx-win32-x64-msvc": "22.4.5" }, "peerDependencies": { "@swc-node/register": "^1.8.0", @@ -25235,6 +25401,24 @@ "node": ">=8" } }, + "node_modules/pkijs": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.3.3.tgz", + "integrity": "sha512-+KD8hJtqQMYoTuL1bbGOqxb4z+nZkTAwVdNtWwe8Tc2xNbEmdJYIYoc6Qt0uF55e6YW6KuTHw1DjQ18gMhzepw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@noble/hashes": "1.4.0", + "asn1js": "^3.0.6", + "bytestreamjs": "^2.0.1", + "pvtsutils": "^1.3.6", + "pvutils": "^1.1.3", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/popper.js": { "version": "1.16.1", "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz", @@ -25277,7 +25461,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -25387,7 +25570,6 @@ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin-prettier.js" }, @@ -25507,7 +25689,6 @@ "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -25594,6 +25775,26 @@ ], "license": "MIT" }, + "node_modules/pvtsutils": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz", + "integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.8.1" + } + }, + "node_modules/pvutils": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.5.tgz", + "integrity": "sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/qs": { "version": "6.14.1", "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", @@ -26376,7 +26577,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz", "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -26427,7 +26627,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz", "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -26465,7 +26664,6 @@ "resolved": "https://registry.npmjs.org/react-final-form/-/react-final-form-6.5.9.tgz", "integrity": "sha512-x3XYvozolECp3nIjly+4QqxdjSSWfcnpGEL5K8OBT6xmGrq5kBqbA6+/tOqoom9NwqIPPbxPNsOViFlbKgowbA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/runtime": "^7.15.4" }, @@ -26534,11 +26732,10 @@ } }, "node_modules/react-is": { - "version": "19.2.3", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.3.tgz", - "integrity": "sha512-qJNJfu81ByyabuG7hPFEbXqNcWSU3+eVus+KJs+0ncpGfMyYdvSmxiJxbWR65lYi1I+/0HBcliO029gc4F+PnA==", - "license": "MIT", - "peer": true + "version": "19.2.4", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz", + "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==", + "license": "MIT" }, "node_modules/react-jss": { "version": "10.10.0", @@ -26692,6 +26889,13 @@ "node": ">=8" } }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -27212,7 +27416,6 @@ "integrity": "sha512-fDz1zJpd5GycprAbu4Q2PV/RprsRtKC/0z82z0JLgdytmcq0+ujJbJ/09bPGDxCLkKY3Np5cRAOcWiVkLXJURg==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -27340,7 +27543,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -29082,7 +29284,6 @@ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "license": "MIT", - "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -29161,8 +29362,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tsutils": { "version": "3.21.0", @@ -29187,6 +29387,26 @@ "dev": true, "license": "0BSD" }, + "node_modules/tsyringe": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/tsyringe/-/tsyringe-4.10.0.tgz", + "integrity": "sha512-axr3IdNuVIxnaK5XGEUFTu3YmAQ6lllgrvqfEoR16g/HGnYY/6We4oWENtAnzK6/LpJ2ur9PAb80RBt7/U4ugw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.9.3" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tsyringe/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, "node_modules/type": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz", @@ -29333,7 +29553,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -29899,11 +30118,10 @@ } }, "node_modules/webpack": { - "version": "5.104.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.104.1.tgz", - "integrity": "sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA==", + "version": "5.105.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.0.tgz", + "integrity": "sha512-gX/dMkRQc7QOMzgTe6KsYFM7DxeIONQSui1s0n/0xht36HvrgbxtM1xBlgx596NbpHuQU8P7QpKwrZYwUX48nw==", "license": "MIT", - "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.8", @@ -29915,7 +30133,7 @@ "acorn-import-phases": "^1.0.3", "browserslist": "^4.28.1", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.4", + "enhanced-resolve": "^5.19.0", "es-module-lexer": "^2.0.0", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -29928,7 +30146,7 @@ "schema-utils": "^4.3.3", "tapable": "^2.3.0", "terser-webpack-plugin": "^5.3.16", - "watchpack": "^2.4.4", + "watchpack": "^2.5.1", "webpack-sources": "^3.3.3" }, "bin": { @@ -30012,7 +30230,6 @@ "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@discoveryjs/json-ext": "^0.5.0", "@webpack-cli/configtest": "^2.1.1", @@ -30175,10 +30392,11 @@ "dev": true, "license": "MIT", "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*", - "@types/send": "*" + "@peculiar/x509": "^1.14.2", + "pkijs": "^3.3.3" + }, + "engines": { + "node": ">=18" } }, "node_modules/webpack-merge": { @@ -30727,7 +30945,7 @@ "version": "4.1.11", "license": "Apache-2.0", "dependencies": { - "@data-driven-forms/react-form-renderer": "^4.1.8", + "@data-driven-forms/react-form-renderer": "^4.1.10", "clsx": "^1.0.4", "lodash": "^4.17.23" }, @@ -30742,7 +30960,8 @@ "version": "4.1.13", "license": "Apache-2.0", "dependencies": { - "@data-driven-forms/common": "*", + "@data-driven-forms/common": "^4.1.10", + "@data-driven-forms/react-form-renderer": "^4.1.10", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/system": "^5.10.4", @@ -30757,7 +30976,6 @@ "react-intl": "^6.4.6" }, "peerDependencies": { - "@data-driven-forms/react-form-renderer": "*", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.18.0", "@mui/x-date-pickers": "^5.0.1 || ^6.13.0", diff --git a/package.json b/package.json index 7f41145bc..6a7179a33 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "start-demo": "nx run @data-driven-forms/react-renderer-demo:start", "lint": "npm run lint:js && npm run lint:typescript", "lint:js": "npx eslint ./packages/*/src --ext .js", - "lint:typescript": "eslint packages/react-form-renderer/src/**/* packages/react-form-renderer/demo/**/* packages/pf4-component-mapper/src/**/* packages/pf4-component-mapper/demo/**/* --ext .ts,.tsx,.js,.jsx", + "lint:typescript": "eslint packages/react-form-renderer/src/**/* packages/react-form-renderer/demo/**/* packages/pf4-component-mapper/src/**/* packages/pf4-component-mapper/demo/**/* packages/mui-component-mapper/src/**/* packages/mui-component-mapper/demo/**/* --ext .ts,.tsx,.js,.jsx", "generate-template": "node ./scripts/generate-mapper.js", "clean-build": "node ./scripts/clean-build.js", "prebuild": "node ./scripts/clean-build.js" @@ -60,7 +60,6 @@ "@types/react-dom": "^19.1.3", "@typescript-eslint/eslint-plugin": "^8.54.0", "@typescript-eslint/parser": "^8.54.0", - "@babel/eslint-parser": "^7.28.6", "babel-jest": "^29.7.0", "babel-loader": "^8.4.1", "babel-plugin-transform-imports": "^2.0.0", diff --git a/packages/mui-component-mapper/.eslintrc.json b/packages/mui-component-mapper/.eslintrc.json new file mode 100644 index 000000000..feed4fff7 --- /dev/null +++ b/packages/mui-component-mapper/.eslintrc.json @@ -0,0 +1,27 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["**/*.html", "**/*.css", "**/*.scss"], + "overrides": [ + { + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + }, + "project": ["packages/mui-component-mapper/tsconfig.json", "packages/mui-component-mapper/tsconfig.demo.json"] + }, + "rules": { + "@typescript-eslint/no-unused-vars": "error", + "no-unused-vars": "off", + "@typescript-eslint/no-use-before-define": ["error", { "functions": false }], + "no-use-before-define": "off", + "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], + "react/prop-types": "off", + "react/no-unused-prop-types": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/mui-component-mapper/.gitignore b/packages/mui-component-mapper/.gitignore index 1c2f0fd54..0d3a8a756 100644 --- a/packages/mui-component-mapper/.gitignore +++ b/packages/mui-component-mapper/.gitignore @@ -88,6 +88,9 @@ vendor !README.md !tsconfig.json !tsconfig.spec.json +!tsconfig.demo.json +!tsconfig.cjs.json +!tsconfig.esm.json !jest.config.ts !generate-typings.js !rollup.config.js @@ -95,5 +98,6 @@ vendor !firebae.json !firebaseFunctions.js !scripts/ +!.eslintrc.json .DS_STORE diff --git a/packages/mui-component-mapper/babel.config.js b/packages/mui-component-mapper/babel.config.js deleted file mode 100644 index 8de97ee7b..000000000 --- a/packages/mui-component-mapper/babel.config.js +++ /dev/null @@ -1,238 +0,0 @@ -require.extensions['.css'] = () => undefined; -const path = require('path'); -const glob = require('glob'); - -const mapper = { - ContentVariants: 'Content', - ButtonVariant: 'Button', - TextListVariants: 'TextList', - TextListItemVariants: 'TextListItem', - FlexItem: 'Flex', - FormFieldGroup: 'Form', - FormFieldGroupHeader: 'Form', - FormHelperText: 'Form', - FormGroup: 'Form', - GridItem: 'Grid', - Content: 'Content', - HelperTextItem: 'HelperText', - ActionGroup: 'Form', - Tab: 'Tabs', - TabTitleText: 'Tabs', - WizardNavItem: 'Wizard', - WizardNav: 'Wizard', - WizardBody: 'Wizard', - WizardHeader: 'Wizard', - ActionListGroup: 'ActionList', - ActionListItem: 'ActionList', -}; - -const blueprintMapper = { - Checkbox: 'components/forms/controls', - FormGroup: 'components/forms/formGroup', - Intent: 'common/intent', - Button: 'components/button/buttons', - H1: 'components/html/html', - H2: 'components/html/html', - H3: 'components/html/html', - H4: 'components/html/html', - RadioGroup: 'components/forms/radioGroup', - MenuItem: 'components/menu/menuItem', - Switch: 'components/forms/controls', - Tab: 'components/tabs/tab', - InputGroup: 'components/forms/inputGroup', - TextArea: 'components/forms/textArea', - Menu: 'components/menu/menu', - ButtonGroup: 'components/button/buttonGroup', - ControlGroup: 'components/forms/controlGroup' -}; - -const pascaltoCamelCase = (name) => name.charAt(0).toLowerCase() + name.slice(1); -const pascalToKebabCase = (name) => - name.charAt(0).toLowerCase() + - name - .slice(1) - .replace(/([A-Z])/, '-$1') - .toLowerCase(); - -const pascalToKebabCaseCarbonIcons = (name) => - name.charAt(0).toLowerCase() + - name - .slice(1) - .replace(/([A-Z])/g, '--$1') - .toLowerCase(); - -const createSuirCJSTransform = (env = 'commonjs') => [ - 'transform-imports', - { - 'semantic-ui-react': { - transform: (importName) => { - let res; - const files = glob.sync(path.resolve(__dirname, `../{..,suir-component-mapper}/node_modules/semantic-ui-react/dist/${env}/**/${importName}.js`)); - - if (files.length > 0) { - res = files[0]; - } else { - throw new Error(`File with importName ${importName} does not exist`); - } - - res = res.replace(/^.*node_modules\//, ''); - res = res.replace(/^\//, ''); - return res; - }, - preventFullImport: false, - skipDefaultConversion: false - } - }, - `semantic-ui-react-${env}` -]; - -const createMuiTransform = (env) => [ - 'transform-imports', - { - '@mui/x-date-pickers': { - transform: (importName) => (env ? `@mui/x-date-pickers/${env}/${importName}` : `@mui/x-date-pickers/${importName}`), - preventFullImport: false, - skipDefaultConversion: true - }, - '@mui/material': { - transform: (importName) => (env ? `@mui/material/${env}/${importName}` : `@mui/material/${importName}`), - preventFullImport: false, - skipDefaultConversion: false - } - }, - `MUI-${env || 'commonjs'}` -]; - -const createPfReactTransform = (env) => [ - 'transform-imports', - { - '@patternfly/react-core': { - transform: (importName) => { - let res; - const files = glob.sync( - path.resolve(__dirname, `../{..,pf4-component-mapper}//node_modules/@patternfly/react-core/dist/dynamic/**/${mapper[importName] || importName}`) - ); - if (files.length > 0) { - res = files[0]; - } else { - throw new Error(`File with importName ${importName} does not exist`); - } - - res = res.replace(/^.*node_modules\//, ''); - res = res.replace(/^\//, ''); - return res; - }, - preventFullImport: false, - skipDefaultConversion: true - }, - '@patternfly/react-icons': { - transform: (importName) => - `@patternfly/react-icons/dist/dynamic/icons/${importName - .split(/(?=[A-Z])/) - .join('-') - .toLowerCase()}`, - preventFullImport: true - }, - }, - `pf-react-${env}` -]; - -const createBluePrintTransform = (env) => [ - 'transform-imports', - { - '@blueprintjs/core': { - transform: (importName) => - `@blueprintjs/core/lib/${env}/${blueprintMapper[importName] || - `components/${pascalToKebabCase(importName)}/${pascaltoCamelCase(importName)}`}.js`, - preventFullImport: false, - skipDefaultConversion: true - } - }, - `BLUEPRINT-${env}` -]; - -const createAntTransform = (env) => [ - 'transform-imports', - { - antd: { - transform: (importName) => { - let res; - const files = glob.sync( - path.resolve( - __dirname, - `../{..,ant-component-mapper}/node_modules/antd/${env === 'cjs' ? 'lib' : 'es'}/${importName - .split(/(?=[A-Z])/) - .join('-') - .toLowerCase()}/index.js` - ) - ); - if (files.length > 0) { - res = files[0]; - } else { - throw new Error(`File with importName ${importName} does not exist`); - } - - res = res.replace(/^.*node_modules\//, ''); - res = res.replace(/^\//, ''); - return res; - } - } - }, - `ant-${env}` -]; - -const createReactJSSTransform = (env) => [ - 'transform-imports', - { - 'react-jss': { - skipDefaultConversion: true, - transform: (importName) => { - let res; - const files = glob.sync( - path.resolve( - __dirname, - `../../node_modules/react-jss/dist/react-jss.${env}.js` - ) - ); - if (files.length > 0) { - res = files[0]; - } else { - throw new Error(`File with importName ${importName} does not exist`); - } - - res = res.replace(path.resolve(__dirname, '../../node_modules/'), ''); - res = res.replace(/^\//, ''); - return res; - } - } - }, - `react-jss-${env}` -]; - -module.exports = { - extends: '../../babel.config.js', - env: { - cjs: { - presets: [['@babel/preset-env', { modules: 'commonjs' }]], - plugins: [ - createSuirCJSTransform('commonjs'), - createMuiTransform(), - createPfReactTransform('js'), - createBluePrintTransform('cjs'), - createAntTransform('cjs'), - createReactJSSTransform('cjs') - ] - }, - esm: { - presets: [['@babel/preset-env', { modules: false }]], - plugins: [ - createSuirCJSTransform('es'), - createMuiTransform(), - createPfReactTransform('esm'), - createBluePrintTransform('esm'), - createAntTransform('esm'), - createReactJSSTransform('esm') - ] - } - } -}; \ No newline at end of file diff --git a/packages/mui-component-mapper/config/rspack.config.js b/packages/mui-component-mapper/config/rspack.config.js new file mode 100644 index 000000000..29bb6a98b --- /dev/null +++ b/packages/mui-component-mapper/config/rspack.config.js @@ -0,0 +1,90 @@ +//@ts-check + +const { defineConfig } = require('@rspack/cli'); +const { HtmlRspackPlugin, DefinePlugin, ProvidePlugin } = require('@rspack/core'); +const resolve = require('path').resolve; + +module.exports = defineConfig({ + mode: 'development', + entry: { app: resolve('./demo/index.tsx') }, + output: { + path: resolve('../dist'), + filename: '[name].[hash].js' + }, + devtool: 'eval-source-map', + resolve: { + extensions: ['.ts', '.tsx', '.js', '.jsx'], + }, + plugins: [ + new HtmlRspackPlugin({ + template: './demo/index.html', + filename: './index.html' + }), + new DefinePlugin({ + 'process.env.NODE_ENV': '"development"', + }), + new ProvidePlugin({ + process: 'process/browser.js' + }) + ], + devServer: { + port: 8003, // Keep original MUI demo port + hot: true, + open: true, + }, + module: { + rules: [ + // TypeScript files with ts-loader for proper config support + { + test: /\.(ts|tsx)$/, + exclude: /node_modules/, + use: { + loader: 'ts-loader', + options: { + configFile: 'tsconfig.demo.json' + } + }, + }, + // JavaScript files (if any remain) + { + test: /\.js$/, + exclude: /(node_modules)/, + use: { + loader: 'builtin:swc-loader', + options: { + sourceMap: true, + jsc: { + parser: { + syntax: 'ecmascript', + jsx: true, + }, + transform: { + react: { + runtime: 'automatic', + }, + }, + }, + }, + }, + }, + // CSS/SCSS - using RSpack built-in support + { + test: /\.css$/, + type: 'css' + }, + { + test: /\.(sa|sc)ss$/, + use: ['sass-loader'], + type: 'css' + }, + // Assets + { + test: /\.(png|jpg|gif|svg|woff|ttf|eot)$/, + type: 'asset/resource' + }, + ] + }, + experiments: { + css: true, + } +}); \ No newline at end of file diff --git a/packages/mui-component-mapper/config/webpack.config.js b/packages/mui-component-mapper/config/webpack.config.js deleted file mode 120000 index bccde58a6..000000000 --- a/packages/mui-component-mapper/config/webpack.config.js +++ /dev/null @@ -1 +0,0 @@ -../../common/config/webpack.config.js \ No newline at end of file diff --git a/packages/mui-component-mapper/demo/compositeMapper.ts b/packages/mui-component-mapper/demo/compositeMapper.ts new file mode 100644 index 000000000..ecd8a0cd8 --- /dev/null +++ b/packages/mui-component-mapper/demo/compositeMapper.ts @@ -0,0 +1,12 @@ +import { componentTypes } from '@data-driven-forms/react-form-renderer'; +import { componentMapper, Switch } from '../src'; + +export const compositeMapper = { + ...componentMapper, + [componentTypes.SWITCH]: { + component: Switch, + FormControlLabelProps: { + labelPlacement: 'end', + }, + }, +} as const; diff --git a/packages/mui-component-mapper/demo/demo-schemas/field-array-schema.js b/packages/mui-component-mapper/demo/demo-schemas/field-array-schema.ts similarity index 75% rename from packages/mui-component-mapper/demo/demo-schemas/field-array-schema.js rename to packages/mui-component-mapper/demo/demo-schemas/field-array-schema.ts index 5167baee1..8d23f2277 100644 --- a/packages/mui-component-mapper/demo/demo-schemas/field-array-schema.js +++ b/packages/mui-component-mapper/demo/demo-schemas/field-array-schema.ts @@ -1,4 +1,7 @@ -const arraySchemaDDF = { +import { Schema } from '@data-driven-forms/react-form-renderer'; +import { compositeMapper } from '../compositeMapper'; + +const arraySchemaDDF: Schema = { title: 'FieldArray', fields: [ { @@ -17,17 +20,17 @@ const arraySchemaDDF = { isRequired: true, validate: [ { - type: 'required' - } - ] + type: 'required', + }, + ], }, { component: 'text-field', name: 'lastName', label: 'Last Name', - placeholder: 'Stavitel' - } - ] + placeholder: 'Stavitel', + }, + ], }, { component: 'field-array', @@ -37,9 +40,9 @@ const arraySchemaDDF = { fields: [ { component: 'text-field', - label: 'Item' - } - ] + label: 'Item', + }, + ], }, { component: 'field-array', @@ -50,9 +53,9 @@ const arraySchemaDDF = { { component: 'text-field', label: 'Item', - type: 'number' - } - ] + type: 'number', + }, + ], }, { component: 'field-array', @@ -66,13 +69,13 @@ const arraySchemaDDF = { isRequired: true, validate: [ { - type: 'required' - } - ] - } - ] - } - ] + type: 'required', + }, + ], + }, + ], + }, + ], }; export default arraySchemaDDF; diff --git a/packages/mui-component-mapper/demo/demo-schemas/miq-schema.js b/packages/mui-component-mapper/demo/demo-schemas/miq-schema.js deleted file mode 100644 index d457b3ffb..000000000 --- a/packages/mui-component-mapper/demo/demo-schemas/miq-schema.js +++ /dev/null @@ -1,1949 +0,0 @@ -/* eslint-disable camelcase */ -const input = { - href: 'http://localhost:3000/api/service_dialogs/57', - id: '57', - description: 'Description of testing Dialog', - buttons: 'submit,cancel', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Testing dialog', - content: [ - { - href: 'http://localhost:3000/api/service_dialogs/57', - id: '57', - description: 'Description of testing Dialog', - buttons: 'submit,cancel', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Testing dialog', - dialog_tabs: [ - { - href: 'http://localhost:3000/api/service_dialogs/553', - id: '553', - description: 'Text boxes and text areas', - display: null, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Tab 1', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 0, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/637', - id: '637', - description: null, - display: null, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text boxes', - display_method: null, - display_method_options: null, - dialog_tab_id: '553', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4327', - id: '4327', - name: 'text_box_1', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box', - dialog_group_id: '637', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4328', - id: '4328', - name: 'text_box_2', - description: 'Helper text', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box with help', - dialog_group_id: '637', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4329', - id: '4329', - name: 'text_box_3', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: true, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box required', - dialog_group_id: '637', - position: 2, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4330', - id: '4330', - name: 'text_box_4', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box readonly', - dialog_group_id: '637', - position: 3, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: true, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4331', - id: '4331', - name: 'text_box_5', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '"hello"', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box default', - dialog_group_id: '637', - position: 4, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4332', - id: '4332', - name: 'text_box_6', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box unvisible', - dialog_group_id: '637', - position: 5, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: false, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4333', - id: '4333', - name: 'text_box_7', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box with validator', - dialog_group_id: '637', - position: 6, - validator_type: null, - validator_rule: '[0-9]', - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4334', - id: '4334', - name: 'text_box_8', - description: '', - data_type: 'integer', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box integer value', - dialog_group_id: '637', - position: 7, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4335', - id: '4335', - name: 'text_box_9', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box string value', - dialog_group_id: '637', - position: 8, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/638', - id: '638', - description: '', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text areas', - display_method: null, - display_method_options: null, - dialog_tab_id: '553', - position: 1, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4336', - id: '4336', - name: 'textarea_box_1', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Area', - dialog_group_id: '638', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextAreaBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/554', - id: '554', - description: 'Checks', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Tab 2', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 1, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/639', - id: '639', - description: '', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Check boxes', - display_method: null, - display_method_options: null, - dialog_tab_id: '554', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4337', - id: '4337', - name: 'check_box_1', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Check Box', - dialog_group_id: '639', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldCheckBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4338', - id: '4338', - name: 'check_box_2', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: 't', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Check Box checked', - dialog_group_id: '639', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldCheckBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/640', - id: '640', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Radios', - display_method: null, - display_method_options: null, - dialog_tab_id: '554', - position: 1, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4339', - id: '4339', - name: 'radio_button_1', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - ['1', 'One'], - ['2', 'Two'], - ['3', 'Three'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Radio Button', - dialog_group_id: '640', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldRadioButton', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4340', - id: '4340', - name: 'radio_button_2', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - ['1', 'One'], - ['2', 'Two'], - ['3', 'Three'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'value', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Radio Button sorted by', - dialog_group_id: '640', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldRadioButton', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4341', - id: '4341', - name: 'radio_button_4', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '2', - values: [ - ['1', 'One'], - ['2', 'Two'], - ['3', 'Three'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:29:03Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Radio Button default', - dialog_group_id: '640', - position: 2, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldRadioButton', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/555', - id: '555', - description: '', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Tab 3', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 2, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/641', - id: '641', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdowns', - display_method: null, - display_method_options: null, - dialog_tab_id: '555', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4342', - id: '4342', - name: 'dropdown_list_1', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - [null, ''], - ['1', 'One'], - ['3', 'Three'], - ['2', 'Two'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending', - force_multi_value: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdown', - dialog_group_id: '641', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDropDownList', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4343', - id: '4343', - name: 'dropdown_list_2', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '2', - values: [ - [null, ''], - ['1', 'One'], - ['3', 'Three'], - ['2', 'Two'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending', - force_multi_value: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdown default value', - dialog_group_id: '641', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDropDownList', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4344', - id: '4344', - name: 'dropdown_list_3', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - [null, ''], - ['1', 'One'], - ['3', 'Three'], - ['2', 'Two'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending', - force_multi_value: true - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdown multiselect', - dialog_group_id: '641', - position: 2, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDropDownList', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4345', - id: '4345', - name: 'dropdown_list_4', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - [null, ''], - ['1', 'One'], - ['2', 'Two'], - ['3', 'Three'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'value', - sort_order: 'ascending', - force_multi_value: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdown sort by value', - dialog_group_id: '641', - position: 3, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDropDownList', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/556', - id: '556', - description: '', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Tab 4', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 3, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/642', - id: '642', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Datepickers', - display_method: null, - display_method_options: null, - dialog_tab_id: '556', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4346', - id: '4346', - name: 'date_control_1', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - show_past_dates: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Datepicker', - dialog_group_id: '642', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDateControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4347', - id: '4347', - name: 'date_control_2', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - show_past_dates: true - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Datepicker with past days', - dialog_group_id: '642', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDateControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/643', - id: '643', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Timepickers', - display_method: null, - display_method_options: null, - dialog_tab_id: '556', - position: 1, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4348', - id: '4348', - name: 'date_time_control_1', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - show_past_dates: false - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Timepicker', - dialog_group_id: '643', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDateTimeControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4349', - id: '4349', - name: 'date_time_control_2', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - show_past_dates: true - }, - created_at: '2018-10-23T14:26:49Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Timepicker with past days', - dialog_group_id: '643', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDateTimeControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/557', - id: '557', - description: 'New tab 4', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Tab 5', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 4, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/644', - id: '644', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Tag control', - display_method: null, - display_method_options: null, - dialog_tab_id: '557', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4350', - id: '4350', - name: 'tag_control_1', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [], - values_method: null, - values_method_options: {}, - options: { - category_id: null, - force_single_value: false, - sort_by: 'description', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Tag Control', - dialog_group_id: '644', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTagControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4351', - id: '4351', - name: 'tag_control_2', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [], - values_method: null, - values_method_options: {}, - options: { - category_id: null, - force_single_value: true, - sort_by: 'description', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Tag Control single value', - dialog_group_id: '644', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTagControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4352', - id: '4352', - name: 'tag_control_3', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - { - id: null, - name: '', - description: '' - }, - { - id: 36, - name: 'gold', - description: 'Gold' - }, - { - id: 37, - name: 'platinum', - description: 'Platinum' - }, - { - id: 35, - name: 'silver', - description: 'Silver' - } - ], - values_method: null, - values_method_options: {}, - options: { - category_id: '34', - force_single_value: true, - sort_by: 'description', - sort_order: 'ascending', - category_description: 'Service Level', - category_name: 'service_level', - category_single_value: true - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Tag Control category', - dialog_group_id: '644', - position: 2, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTagControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - }, - { - href: 'http://localhost:3000/api/service_dialogs/558', - id: '558', - description: '', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:26:50Z', - label: 'Mixed', - display_method: null, - display_method_options: null, - dialog_id: '57', - position: 5, - dialog_groups: [ - { - href: 'http://localhost:3000/api/service_dialogs/645', - id: '645', - description: 'Description', - display: 'edit', - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'New Section', - display_method: null, - display_method_options: null, - dialog_tab_id: '558', - position: 0, - dialog_fields: [ - { - href: 'http://localhost:3000/api/service_dialogs/4353', - id: '4353', - name: 'text_box_10', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Box', - dialog_group_id: '645', - position: 0, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4354', - id: '4354', - name: 'textarea_box_2', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Text Area', - dialog_group_id: '645', - position: 1, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldTextAreaBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4355', - id: '4355', - name: 'check_box_3', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Check Box', - dialog_group_id: '645', - position: 2, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldCheckBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4356', - id: '4356', - name: 'check_box_4', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - protected: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Check Box', - dialog_group_id: '645', - position: 3, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldCheckBox', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4357', - id: '4357', - name: 'dropdown_list_5', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - [null, ''], - ['1', 'One'], - ['3', 'Three'], - ['2', 'Two'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending', - force_multi_value: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Dropdown', - dialog_group_id: '645', - position: 4, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDropDownList', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4358', - id: '4358', - name: 'radio_button_3', - description: '', - data_type: 'string', - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: [ - ['1', 'One'], - ['2', 'Two'], - ['3', 'Three'] - ], - values_method: null, - values_method_options: {}, - options: { - sort_by: 'description', - sort_order: 'ascending' - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Radio Button', - dialog_group_id: '645', - position: 5, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldRadioButton', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - }, - { - href: 'http://localhost:3000/api/service_dialogs/4359', - id: '4359', - name: 'date_time_control_3', - description: '', - data_type: null, - notes: null, - notes_display: null, - display: 'edit', - display_method: null, - display_method_options: {}, - required: false, - required_method: null, - required_method_options: {}, - default_value: '', - values: null, - values_method: null, - values_method_options: {}, - options: { - show_past_dates: false - }, - created_at: '2018-10-23T14:26:50Z', - updated_at: '2018-10-23T14:29:03Z', - label: 'Timepicker', - dialog_group_id: '645', - position: 6, - validator_type: null, - validator_rule: null, - reconfigurable: false, - dynamic: false, - show_refresh_button: false, - load_values_on_init: false, - read_only: false, - auto_refresh: false, - trigger_auto_refresh: false, - visible: true, - type: 'DialogFieldDateTimeControl', - resource_action: { - action: null, - resource_type: 'DialogField', - ae_namespace: null, - ae_class: null, - ae_instance: null, - ae_message: null, - ae_attributes: {} - }, - dialog_field_responders: [] - } - ] - } - ] - } - ] - } - ], - actions: [ - { - name: 'refresh_dialog_fields', - method: 'post', - href: 'http://localhost:3000/api/service_dialogs/57' - }, - { - name: 'delete', - method: 'post', - href: 'http://localhost:3000/api/service_dialogs/57' - }, - { - name: 'edit', - method: 'post', - href: 'http://localhost:3000/api/service_dialogs/57' - }, - { - name: 'copy', - method: 'post', - href: 'http://localhost:3000/api/service_dialogs/57' - }, - { - name: 'delete', - method: 'delete', - href: 'http://localhost:3000/api/service_dialogs/57' - } - ] -}; - -export default input; diff --git a/packages/mui-component-mapper/demo/demo-schemas/widget-schema.js b/packages/mui-component-mapper/demo/demo-schemas/widget-schema.js deleted file mode 100644 index 7c6ced75e..000000000 --- a/packages/mui-component-mapper/demo/demo-schemas/widget-schema.js +++ /dev/null @@ -1,86 +0,0 @@ -/*eslint camelcase: "off" */ -export const schema = { - title: 'Widgets', - type: 'object', - properties: { - stringFormats: { - type: 'object', - title: 'String formats', - properties: { - email: { - type: 'string', - format: 'email' - }, - uri: { - type: 'string', - format: 'uri' - } - } - }, - boolean: { - type: 'object', - title: 'Boolean field', - properties: { - defaultCheckbox: { - type: 'boolean', - title: 'checkbox (default)', - description: 'This is the checkbox-description' - }, - radio: { - type: 'boolean', - title: 'radio buttons', - description: 'This is the radio-description' - }, - select: { - type: 'boolean', - title: 'select box', - description: 'This is the select-description' - } - } - }, - string: { - type: 'object', - title: 'String field', - properties: { - defaultInput: { - type: 'string', - title: 'text input (default)' - }, - textarea: { - type: 'string', - title: 'textarea' - }, - color: { - type: 'string', - title: 'color picker', - default: '#151ce6' - } - } - }, - secret: { - type: 'string', - default: 'I m a hidden string.' - }, - disabled: { - type: 'string', - title: 'A disabled field', - default: 'I am disabled.' - }, - readonly: { - type: 'string', - title: 'A readonly field', - default: 'I am read-only.' - }, - widgetOptions: { - title: 'Custom widget with options', - type: 'string', - default: 'I am yellow' - }, - selectWidgetOptions: { - title: 'Custom select widget with options', - type: 'string', - enum: ['foo', 'bar'], - enumNames: ['Foo', 'Bar'] - } - } -}; diff --git a/packages/mui-component-mapper/demo/demo-schemas/wizard-schema.js b/packages/mui-component-mapper/demo/demo-schemas/wizard-schema.ts similarity index 74% rename from packages/mui-component-mapper/demo/demo-schemas/wizard-schema.js rename to packages/mui-component-mapper/demo/demo-schemas/wizard-schema.ts index 27c75f53e..8fe9069bd 100644 --- a/packages/mui-component-mapper/demo/demo-schemas/wizard-schema.js +++ b/packages/mui-component-mapper/demo/demo-schemas/wizard-schema.ts @@ -1,5 +1,6 @@ import { componentTypes, validatorTypes } from '@data-driven-forms/react-form-renderer'; +// Use flexible schema type that allows wizard steps (which aren't form components) const wizardSchema = { fields: [ { @@ -16,15 +17,15 @@ const wizardSchema = { when: 'source-type', stepMapper: { aws: 'aws', - google: 'google' - } + google: 'google', + }, }, fields: [ { component: componentTypes.TEXTAREA, name: 'source-name', type: 'text', - label: 'Source name' + label: 'Source name', }, { component: componentTypes.SELECT, @@ -34,20 +35,20 @@ const wizardSchema = { options: [ { value: 'aws', - label: 'Aws' + label: 'Aws', }, { value: 'google', - label: 'Google' - } + label: 'Google', + }, ], validate: [ { - type: validatorTypes.REQUIRED - } - ] - } - ] + type: validatorTypes.REQUIRED, + }, + ], + }, + ], }, { title: 'Configure AWS', @@ -57,9 +58,9 @@ const wizardSchema = { { component: componentTypes.TEXT_FIELD, name: 'aws-field', - label: 'Aws field part' - } - ] + label: 'Aws field part', + }, + ], }, { name: 'google', @@ -69,9 +70,9 @@ const wizardSchema = { { component: componentTypes.TEXT_FIELD, name: 'google-field', - label: 'Google field part' - } - ] + label: 'Google field part', + }, + ], }, { fields: [ @@ -79,14 +80,14 @@ const wizardSchema = { name: 'summary', component: componentTypes.TEXT_FIELD, isDisabled: true, - label: 'Summary' - } + label: 'Summary', + }, ], - name: 'summary' - } - ] - } - ] + name: 'summary', + }, + ], + }, + ], }; export default wizardSchema; diff --git a/packages/mui-component-mapper/demo/index.js b/packages/mui-component-mapper/demo/index.tsx similarity index 84% rename from packages/mui-component-mapper/demo/index.js rename to packages/mui-component-mapper/demo/index.tsx index c6c56aa6a..ee21bd9b1 100644 --- a/packages/mui-component-mapper/demo/index.js +++ b/packages/mui-component-mapper/demo/index.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; import { createRoot } from 'react-dom/client'; import { FormRenderer, componentTypes } from '@data-driven-forms/react-form-renderer'; +import type { Schema } from '@data-driven-forms/react-form-renderer'; import Grid from '@mui/material/Grid'; -import { componentMapper, FormTemplate } from '../src'; +import { FormTemplate } from '../src'; import { createTheme } from '@mui/material/styles'; import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles'; import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; @@ -15,19 +16,10 @@ import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; import Button from '@mui/material/Button'; import wizardSchema from './demo-schemas/wizard-schema'; import validatorTypes from '@data-driven-forms/react-form-renderer/validator-types'; +import { compositeMapper } from './compositeMapper'; const theme = createTheme(); -const compositeMapper = { - ...componentMapper, - [componentTypes.SWITCH]: { - component: componentMapper[componentTypes.SWITCH], - FormControlLabelProps: { - labelPlacement: 'end', - }, - }, -}; - const options = [ { label: 'One', @@ -71,8 +63,8 @@ const options = [ }, ]; -const loadOptions = (filter) => - new Promise((res) => +const loadOptions = (filter?: string) => + new Promise>((res) => setTimeout(() => { console.log('filter', filter); if (filter && filter.length > 0) { @@ -83,7 +75,7 @@ const loadOptions = (filter) => }, 1500) ); -const selectSchema = { +const selectSchema: Schema = { fields: [ { name: 'searchable-async-select', @@ -139,8 +131,8 @@ const selectSchema = { ], }; -const App = () => { - const [schema, setSchema] = useState(wizardSchema); +const App: React.FC = () => { + const [schema, setSchema] = useState>(wizardSchema as any); return ( @@ -151,15 +143,15 @@ const App = () => { Material UI component mapper - + - + } + FormTemplate={FormTemplate} schema={schema} onCancel={() => console.log('canceling')} /> @@ -171,5 +163,5 @@ const App = () => { }; const container = document.getElementById('root'); -const root = createRoot(container); +const root = createRoot(container!); root.render(); diff --git a/packages/mui-component-mapper/demo/test-wizard-types.ts b/packages/mui-component-mapper/demo/test-wizard-types.ts new file mode 100644 index 000000000..de23334c7 --- /dev/null +++ b/packages/mui-component-mapper/demo/test-wizard-types.ts @@ -0,0 +1,69 @@ +// Type test to verify wizard schema typing works correctly +import { componentTypes, validatorTypes, Schema } from '@data-driven-forms/react-form-renderer'; +import { compositeMapper } from './compositeMapper'; + +// Test 1: Basic wizard schema should work +const testSchema1: Schema = { + fields: [ + { + component: componentTypes.WIZARD, + name: 'test-wizard', + fields: [ + { + name: 'step-1', + title: 'Step 1', + nextStep: 'step-2', + fields: [ + { + component: componentTypes.TEXT_FIELD, + name: 'field1', + label: 'Field 1', + }, + ], + }, + ], + }, + ], +}; + +// Test 2: Wizard with nextStep object should work +const testSchema2: Schema = { + fields: [ + { + component: componentTypes.WIZARD, + name: 'test-wizard-2', + fields: [ + { + name: 'step-1', + nextStep: { + when: 'fieldName', + stepMapper: { + value1: 'step-2', + value2: 'step-3', + }, + }, + fields: [ + { + component: componentTypes.SELECT, + name: 'fieldName', + label: 'Select', + }, + ], + }, + ], + }, + ], +}; + +// Test 3: Regular (non-wizard) field should still work +const testSchema3: Schema = { + fields: [ + { + component: componentTypes.TEXT_FIELD, + name: 'regular-field', + label: 'Regular Field', + }, + ], +}; + +console.log('Type tests passed!', testSchema1, testSchema2, testSchema3); diff --git a/packages/mui-component-mapper/package.json b/packages/mui-component-mapper/package.json index 13a409aae..72d229851 100644 --- a/packages/mui-component-mapper/package.json +++ b/packages/mui-component-mapper/package.json @@ -7,13 +7,11 @@ "typings": "index.d.ts", "license": "Apache-2.0", "scripts": { - "start": "webpack-dev-server --config ./config/webpack.config.js --open --hot --port=8003", - "build": "npm run build:cjs && npm run build:esm && npm run build:typings && npm run build:packages", - "build:cjs": "BABEL_ENV=cjs babel src --out-dir ./ --ignore \"src/tests/*\"", - "build:esm": "BABEL_ENV=esm babel src --out-dir ./esm --ignore \"src/tests/*\"", - "build:typings": "node ../../scripts/generate-typings.js", - "build:packages": "node ../../scripts/generate-packages.js", - "vendor": "webpack --env vendor --config ./config/webpack.config.js" + "start": "rspack serve --config ./config/rspack.config.js", + "build": "npm run build:cjs && npm run build:esm && npm run build:packages", + "build:cjs": "tsc -p tsconfig.cjs.json", + "build:esm": "tsc -p tsconfig.esm.json", + "build:packages": "node ../../scripts/generate-packages.js" }, "homepage": "https://data-driven-forms.org/", "bugs": "https://github.com/data-driven-forms/react-forms/issues", @@ -29,7 +27,6 @@ "react-intl": "^6.4.6" }, "peerDependencies": { - "@data-driven-forms/react-form-renderer": "*", "@mui/icons-material": "^5.10.3", "@mui/material": "^5.18.0", "@mui/x-date-pickers": "^5.0.1 || ^6.13.0", @@ -37,7 +34,8 @@ "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0" }, "dependencies": { - "@data-driven-forms/common": "*", + "@data-driven-forms/common": "^4.1.10", + "@data-driven-forms/react-form-renderer": "^4.1.10", "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@mui/system": "^5.10.4", diff --git a/packages/mui-component-mapper/project.json b/packages/mui-component-mapper/project.json index dd8a7bcac..d83204756 100644 --- a/packages/mui-component-mapper/project.json +++ b/packages/mui-component-mapper/project.json @@ -23,8 +23,7 @@ "cwd": "packages/mui-component-mapper" }, "dependsOn": [ - "@data-driven-forms/common:build", - "@data-driven-forms/react-form-renderer:build" + "^build" ], "cache": true }, @@ -62,7 +61,7 @@ "typecheck": { "executor": "@nx/js:tsc", "options": { - "main": "packages/mui-component-mapper/src/index.js", + "main": "packages/mui-component-mapper/src/index.ts", "tsConfig": "packages/mui-component-mapper/tsconfig.json", "outputPath": "packages/mui-component-mapper/dist" }, diff --git a/packages/mui-component-mapper/src/checkbox/checkbox.d.ts b/packages/mui-component-mapper/src/checkbox/checkbox.d.ts deleted file mode 100644 index 8906fa872..000000000 --- a/packages/mui-component-mapper/src/checkbox/checkbox.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { UseFieldApiComponentConfig } from '@data-driven-forms/react-form-renderer'; -import { CheckboxProps as MuiCheckboxProps, GridProps, FormControlProps, FormGroupProps, FormControlLabelProps, FormLabelProps, FormHelperTextProps } from '@mui/material'; - -interface InternalCheckboxProps extends MuiCheckboxProps { - FormFieldGridProps?: GridProps; - FormControlProps?: FormControlProps; - FormGroupProps?: FormGroupProps; - FormControlLabelProps: FormControlLabelProps; - CheckboxProps: MuiCheckboxProps; - FormLabelProps: FormLabelProps; - FormHelperTextProps: FormHelperTextProps; -} - -export type CheckboxProps = InternalCheckboxProps & UseFieldApiComponentConfig; - -declare const Checkbox: React.ComponentType; - -export default Checkbox; diff --git a/packages/mui-component-mapper/src/checkbox/checkbox.js b/packages/mui-component-mapper/src/checkbox/checkbox.tsx similarity index 53% rename from packages/mui-component-mapper/src/checkbox/checkbox.js rename to packages/mui-component-mapper/src/checkbox/checkbox.tsx index 54ea662e1..8882a81e1 100644 --- a/packages/mui-component-mapper/src/checkbox/checkbox.js +++ b/packages/mui-component-mapper/src/checkbox/checkbox.tsx @@ -1,12 +1,49 @@ import React from 'react'; import { Checkbox as MUICheckbox, FormControl, FormControlLabel, FormHelperText, FormGroup, FormLabel } from '@mui/material'; +import type { + CheckboxProps as MUICheckboxProps, + FormControlProps, + FormControlLabelProps, + FormHelperTextProps, + FormGroupProps, + FormLabelProps, +} from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; +import type { SelectOption, OptionValue } from '@data-driven-forms/common'; import FormFieldGrid from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; import MultipleChoiceList from '../multiple-choice-list/multiple-choice-list'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; + +export interface SingleCheckboxProps extends BaseFieldProps { + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + FormGroupProps?: FormGroupProps; + FormControlLabelProps?: FormControlLabelProps; + CheckboxProps?: MUICheckboxProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + inputProps?: Record; + [key: string]: any; +} -export const SingleCheckbox = (props) => { +export interface CheckboxProps extends BaseFieldProps { + options?: SelectOption[]; + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + FormGroupProps?: FormGroupProps; + FormControlLabelProps?: FormControlLabelProps; + CheckboxProps?: MUICheckboxProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + inputProps?: Record; + [key: string]: any; +} + +export const SingleCheckbox: React.FC = (props) => { const { input, isReadOnly, @@ -30,8 +67,9 @@ export const SingleCheckbox = (props) => { ...props, type: 'checkbox', }); - const invalid = validationError(meta, validateOnMount); + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description; + return ( @@ -61,6 +99,8 @@ export const SingleCheckbox = (props) => { ); }; -const Checkbox = ({ options, ...props }) => (options ? : ); +function Checkbox({ options, ...props }: CheckboxProps) { + return options ? : ; +} export default Checkbox; diff --git a/packages/mui-component-mapper/src/checkbox/index.js b/packages/mui-component-mapper/src/checkbox/index.js deleted file mode 100644 index 3f0e00717..000000000 --- a/packages/mui-component-mapper/src/checkbox/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './checkbox'; -export * from './checkbox'; diff --git a/packages/mui-component-mapper/src/checkbox/index.d.ts b/packages/mui-component-mapper/src/checkbox/index.ts similarity index 100% rename from packages/mui-component-mapper/src/checkbox/index.d.ts rename to packages/mui-component-mapper/src/checkbox/index.ts diff --git a/packages/mui-component-mapper/src/component-mapper/component-mapper.d.ts b/packages/mui-component-mapper/src/component-mapper/component-mapper.d.ts deleted file mode 100644 index c0b16827e..000000000 --- a/packages/mui-component-mapper/src/component-mapper/component-mapper.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ComponentTypes, ComponentMapper } from '@data-driven-forms/react-form-renderer'; - -interface Components { - TextField: React.ComponentType; - Textarea: React.ComponentType; - Select: React.ComponentType; - Checkbox: React.ComponentType; - Radio: React.ComponentType; - Switch: React.ComponentType; - DatePicker: React.ComponentType; - TimePicker: React.ComponentType; - PlainText: React.ComponentType; - SubForm: React.ComponentType; - Wizard: React.ComponentType; - DualListSelect: React.ComponentType; - Slider: React.ComponentType; -} - -interface componentMapper extends ComponentMapper { - [ComponentTypes.TEXT_FIELD]: React.ComponentType; - [ComponentTypes.TEXTAREA]: React.ComponentType; - [ComponentTypes.SELECT]: React.ComponentType; - [ComponentTypes.CHECKBOX]: React.ComponentType; - [ComponentTypes.SUB_FORM]: React.ComponentType; - [ComponentTypes.RADIO]: React.ComponentType; - [ComponentTypes.TABS]: React.ComponentType; - [ComponentTypes.DATE_PICKER]: React.ComponentType; - [ComponentTypes.TIME_PICKER]: React.ComponentType; - [ComponentTypes.SWITCH]: React.ComponentType; - [ComponentTypes.PLAIN_TEXT]: React.ComponentType; - [ComponentTypes.WIZARD]: React.ComponentType; - [ComponentTypes.FIELD_ARRAY]: React.ComponentType; - [ComponentTypes.DUAL_LIST_SELECT]: React.ComponentType; - [ComponentTypes.SLIDER]: React.ComponentType; -} - -declare const componentMapper: componentMapper; - -export const Components: Components; - -export default componentMapper; diff --git a/packages/mui-component-mapper/src/component-mapper/component-mapper.js b/packages/mui-component-mapper/src/component-mapper/component-mapper.ts similarity index 98% rename from packages/mui-component-mapper/src/component-mapper/component-mapper.js rename to packages/mui-component-mapper/src/component-mapper/component-mapper.ts index 9fd80d9ba..888e4e369 100644 --- a/packages/mui-component-mapper/src/component-mapper/component-mapper.js +++ b/packages/mui-component-mapper/src/component-mapper/component-mapper.ts @@ -1,4 +1,5 @@ import { componentTypes } from '@data-driven-forms/react-form-renderer'; + import SubForm from '../sub-form'; import Tabs from '../tabs'; import TextField from '../text-field'; @@ -29,7 +30,7 @@ export const components = { Wizard, DualListSelect, Slider, -}; +} as const; const componentMapper = { [componentTypes.TEXT_FIELD]: TextField, @@ -47,6 +48,6 @@ const componentMapper = { [componentTypes.FIELD_ARRAY]: FieldArray, [componentTypes.DUAL_LIST_SELECT]: DualListSelect, [componentTypes.SLIDER]: Slider, -}; +} as const; export default componentMapper; diff --git a/packages/mui-component-mapper/src/component-mapper/index.js b/packages/mui-component-mapper/src/component-mapper/index.js deleted file mode 100644 index 0e792fa43..000000000 --- a/packages/mui-component-mapper/src/component-mapper/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './component-mapper'; -export * from './component-mapper'; diff --git a/packages/mui-component-mapper/src/component-mapper/index.d.ts b/packages/mui-component-mapper/src/component-mapper/index.ts similarity index 100% rename from packages/mui-component-mapper/src/component-mapper/index.d.ts rename to packages/mui-component-mapper/src/component-mapper/index.ts diff --git a/packages/mui-component-mapper/src/date-picker/date-picker.d.ts b/packages/mui-component-mapper/src/date-picker/date-picker.d.ts deleted file mode 100644 index 19b6af078..000000000 --- a/packages/mui-component-mapper/src/date-picker/date-picker.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { DatePickerProps as MuiDatePickerProps } from "@mui/x-date-pickers/DatePicker"; -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { GridProps } from "@mui/material"; -type InternalDatePickerProps = MuiDatePickerProps & { - FormFieldGridProps: GridProps; -} - -export type DatePickerProps = InternalDatePickerProps & UseFieldApiComponentConfig; - -declare const DatePicker: React.ComponentType>; - -export default DatePicker; diff --git a/packages/mui-component-mapper/src/date-picker/date-picker.js b/packages/mui-component-mapper/src/date-picker/date-picker.tsx similarity index 67% rename from packages/mui-component-mapper/src/date-picker/date-picker.js rename to packages/mui-component-mapper/src/date-picker/date-picker.tsx index ae13b440b..214b3d9a9 100644 --- a/packages/mui-component-mapper/src/date-picker/date-picker.js +++ b/packages/mui-component-mapper/src/date-picker/date-picker.tsx @@ -1,13 +1,24 @@ import React from 'react'; - import { DatePicker as MUIDatePicker } from '@mui/x-date-pickers'; +import type { DatePickerProps as MUIDatePickerProps } from '@mui/x-date-pickers'; +import { TextField } from '@mui/material'; +import type { TextFieldProps } from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; -import { TextField } from '@mui/material'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +export interface DatePickerProps extends BaseFieldProps { + placeholder?: string; + FormFieldGridProps?: FormFieldGridProps; + DatePickerProps?: Omit, 'value' | 'onChange' | 'disabled' | 'readOnly'>; + [key: string]: any; +} -const DatePicker = (props) => { +const DatePicker: React.FC = (props) => { const { input, isReadOnly, @@ -21,8 +32,10 @@ const DatePicker = (props) => { meta, FormFieldGridProps = {}, DatePickerProps = {}, + ...rest } = useFieldApi(props); - const invalid = validationError(meta, validateOnMount); + + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); return ( @@ -38,7 +51,7 @@ const DatePicker = (props) => { error: !!invalid, onBlur: input.onBlur, onFocus: input.onFocus, - }, + } as TextFieldProps, }} // legacy version renderInput={(props) => ( @@ -58,6 +71,7 @@ const DatePicker = (props) => { {...input} value={input.value || null} {...DatePickerProps} + {...rest} /> ); diff --git a/packages/mui-component-mapper/src/date-picker/index.js b/packages/mui-component-mapper/src/date-picker/index.js deleted file mode 100644 index 921dafa84..000000000 --- a/packages/mui-component-mapper/src/date-picker/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './date-picker'; -export * from './date-picker'; diff --git a/packages/mui-component-mapper/src/date-picker/index.d.ts b/packages/mui-component-mapper/src/date-picker/index.ts similarity index 100% rename from packages/mui-component-mapper/src/date-picker/index.d.ts rename to packages/mui-component-mapper/src/date-picker/index.ts diff --git a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts deleted file mode 100644 index e695b05e0..000000000 --- a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { UseFieldApiComponentConfig, AnyObject } from "@data-driven-forms/react-form-renderer"; -import { ReactNode } from "react"; -import { - GridProps, - ListProps, - ButtonProps, - IconProps, - ListItemProps, - ListItemIconProps, - ListItemTextProps, - ListItemSecondaryActionProps, - FormControlProps, - FormLabelProps, - FormHelperTextProps, - TypographyProps, - ToolbarProps, - TextFieldProps, - PaperProps, -} from "@mui/material"; - -export interface DualListOption extends AnyObject { - value: any; - label: ReactNode; -} - -interface InternalDualListSelectProps { - leftTitle?: ReactNode; - rightTitle?: ReactNode; - moveLeftTitle?: ReactNode; - moveRightTitle?: ReactNode; - allToLeft?: boolean; - allToRight?: boolean; - checkboxVariant?: boolean; - validateOnMount?: boolean; - moveAllLeftTitle?: ReactNode; - moveAllRightTitle?: ReactNode; - label?: ReactNode; - isRequired?: boolean; - helperText?: ReactNode; - noValueTitle?: ReactNode; - noOptionsTitle?: ReactNode; - filterOptionsTitle?: ReactNode; - filterValueTitle?: ReactNode; - filterValueText?: ReactNode; - filterOptionsText?: ReactNode; - description?: ReactNode; - hideLabel?: boolean; - id?: string; - leftValues?: DualListOption[]; - rightValues?: DualListOption[]; - FormFieldGridProps?: GridProps; - InternalGridProps?: GridProps; - ListGridProps?: GridProps; - LeftListGridProps?: GridProps; - ListProps?: ListProps; - LeftListProps?: ListProps; - ButtonsGridProps?: GridProps; - ButtonsInternalGridProps?: GridProps; - ButtonGridProps?: GridProps; - ToRightGridProps?: GridProps; - ButtonProps?: ButtonProps; - ToRightIconButtonProps?: ButtonProps; - AllToRightGridProps?: GridProps; - AllToRightIconButtonProps?: ButtonProps; - AllToLeftGridProps?: GridProps; - AllToLeftIconButtonProps?: ButtonProps; - ToLeftGridProps?: GridProps; - ToLeftIconButtonProps?: ButtonProps; - RightListGridProps?: GridProps; - RightListProps?: ListProps; - ListItemProps?: ListItemProps; - ListItemIconProps?: ListItemIconProps; - ListItemTextProps?: ListItemTextProps; - ListItemSecondaryActionProps?: ListItemSecondaryActionProps; - LeftListItemProps?: ListItemProps; - LeftListItemIconProps?: ListItemIconProps; - LeftItemTextProps?: ListItemTextProps; - LeftItemSecondaryActionProps?: ListItemSecondaryActionProps; - RightListItemProps?: ListItemProps; - RightListItemIconProps?: ListItemIconProps; - RightItemTextProps?: ListItemTextProps; - RightItemSecondaryActionProps?: ListItemSecondaryActionProps; - FormControlProps?: FormControlProps; - FormLabelProps?: FormLabelProps; - FormHelperTextProps?: FormHelperTextProps; - TitleProps?: TypographyProps; - ToolbarProps?: ToolbarProps; - FilterFieldProps?: TextFieldProps; - SortIconButtonProps?: ButtonProps; - SortIconProps?: IconProps; - LeftToolbarProps?: ToolbarProps; - LeftFilterFieldProps?: TextFieldProps; - LeftSortIconButtonProps?: ButtonProps; - LeftSortIconProps?: IconProps; - LeftTitleProps?: TypographyProps; - RightToolbarProps?: ToolbarProps; - RightFilterFieldProps?: TextFieldProps; - RightSortIconButtonProps?: ButtonProps; - RightSortIconProps?: IconProps; - RightTitleProps?: TypographyProps; - isFilterable?: Boolean; - PaperProps?: PaperProps; - LeftPaperProps?: PaperProps; - RightPaperProps?: PaperProps; -} - -export type DualListSelectProps = InternalDualListSelectProps & UseFieldApiComponentConfig; - -declare const DualListSelect: React.ComponentType; - -export default DualListSelect; diff --git a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.tsx similarity index 74% rename from packages/mui-component-mapper/src/dual-list-select/dual-list-select.js rename to packages/mui-component-mapper/src/dual-list-select/dual-list-select.tsx index 694bf3221..ec818bfec 100644 --- a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js +++ b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.tsx @@ -20,6 +20,23 @@ import { Paper, Button, } from '@mui/material'; +import type { + GridProps, + ListProps, + ListItemProps, + ListItemTextProps, + ListItemIconProps, + ListItemSecondaryActionProps, + IconButtonProps, + FormControlProps, + FormLabelProps, + FormHelperTextProps, + ToolbarProps, + TextFieldProps, + TypographyProps, + PaperProps, + ButtonProps, +} from '@mui/material'; import SortIcon from '@mui/icons-material/ArrowUpward'; @@ -75,7 +92,36 @@ const StyledDualListSelect = styled(FormFieldGrid)(({ theme }) => ({ }, })); -const ListInternal = ({ +interface ListOption { + value: any; + label: string; + icon?: React.ReactNode; + isCheckbox?: boolean; + secondaryActions?: React.ReactNode; + ListItemProps?: ListItemProps; + ListItemIconProps?: ListItemIconProps; + ListItemTextProps?: ListItemTextProps; + ListItemSecondaryActionProps?: ListItemSecondaryActionProps; +} + +interface ListInternalProps { + value?: ListOption[]; + optionClick: (e: any, value: any) => void; + noOptionsTitle: string; + filterValue: any; + filterValueText: string; + selectedValues: any[]; + ListProps?: ListProps; + ListItemProps?: ListItemProps; + ListItemIconProps?: ListItemIconProps; + ListItemTextProps?: ListItemTextProps; + ListItemSecondaryActionProps?: ListItemSecondaryActionProps; + checkboxVariant?: boolean; + PaperProps?: PaperProps; + LeftPaperProps?: PaperProps; +} + +const ListInternal: React.FC = ({ value = [], optionClick, noOptionsTitle, @@ -94,6 +140,8 @@ const ListInternal = ({ {value.length < 1 && ( + // Need to be migrated to ListItemButton + // @ts-ignore @@ -112,10 +160,13 @@ const ListInternal = ({ ListItemSecondaryActionProps: ListItemSecondaryActionPropsItem, }) => ( optionClick(isCheckbox || checkboxVariant ? { ...e, ctrlKey: true } : e, value)} + sx={{ cursor: 'pointer' }} {...ListItemProps} {...ListItemPropsItem} > @@ -141,7 +192,24 @@ const ListInternal = ({ ); -const ToolbarInternal = ({ +interface ToolbarInternalProps { + ToolbarProps?: ToolbarProps; + LeftToolbarProps?: ToolbarProps; + filterOptions: (value: string) => void; + filterOptionsTitle: string; + FilterFieldProps?: TextFieldProps; + sortOptions: () => void; + SortIconButtonProps?: IconButtonProps; + SortIconProps?: any; + LeftSortIconProps?: any; + LeftFilterFieldProps?: TextFieldProps; + LeftSortIconButtonProps?: IconButtonProps; + filter: any; + sortDesc: any; + isValue?: boolean; +} + +const ToolbarInternal: React.FC = ({ ToolbarProps, LeftToolbarProps, filterOptions, @@ -155,7 +223,7 @@ const ToolbarInternal = ({ LeftSortIconButtonProps, filter, sortDesc, - isValue, + isValue = false, }) => ( filterOptions(value)} @@ -192,7 +259,99 @@ const ToolbarInternal = ({ ); -const DualListSelect = ({ +interface DualListSelectProps { + handleOptionsClick: (e: any, value: any) => void; + rightValues: any[]; + noValueTitle?: string; + filterValueText?: string; + leftValues: any[]; + noOptionsTitle?: string; + state: any; + filterOptionsText?: string; + handleValuesClick: (e: any, value: any) => void; + handleMoveRight: () => void; + moveRightTitle?: string; + handleClearLeftValues: () => void; + moveAllRightTitle?: string; + handleClearRightValues: () => void; + moveAllLeftTitle?: string; + handleMoveLeft: () => void; + moveLeftTitle?: string; + allToRight?: boolean; + allToLeft?: boolean; + checkboxVariant?: boolean; + isRequired?: boolean; + meta: any; + validateOnMount?: boolean; + label?: string; + helperText?: string; + description?: string; + filterOptionsTitle?: string; + leftTitle?: string; + filterOptions: (value: string) => void; + sortOptions: () => void; + sortValues: () => void; + filterValueTitle?: string; + filterValues: (value: string) => void; + rightTitle?: string; + isFilterable?: boolean; + // MUI component props + FormFieldGridProps?: any; + InternalGridProps?: GridProps; + ListGridProps?: GridProps; + LeftListGridProps?: GridProps; + ListProps?: ListProps; + LeftListProps?: ListProps; + ButtonsGridProps?: GridProps; + ButtonsInternalGridProps?: GridProps; + ButtonGridProps?: GridProps; + ToRightGridProps?: GridProps; + IconButtonProps?: ButtonProps; + ToRightIconButtonProps?: ButtonProps; + AllToRightGridProps?: GridProps; + AllToRightIconButtonProps?: ButtonProps; + AllToLeftGridProps?: GridProps; + AllToLeftIconButtonProps?: ButtonProps; + ToLeftGridProps?: GridProps; + ToLeftIconButtonProps?: ButtonProps; + RightListGridProps?: GridProps; + RightListProps?: ListProps; + ListItemProps?: ListItemProps; + ListItemIconProps?: ListItemIconProps; + ListItemTextProps?: ListItemTextProps; + ListItemSecondaryActionProps?: ListItemSecondaryActionProps; + LeftListItemProps?: ListItemProps; + LeftListItemIconProps?: ListItemIconProps; + LeftItemTextProps?: ListItemTextProps; + LeftItemSecondaryActionProps?: ListItemSecondaryActionProps; + RightListItemProps?: ListItemProps; + RightListItemIconProps?: ListItemIconProps; + RightItemTextProps?: ListItemTextProps; + RightItemSecondaryActionProps?: ListItemSecondaryActionProps; + FormControlProps?: FormControlProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + TitleProps?: TypographyProps; + ToolbarProps?: ToolbarProps; + FilterFieldProps?: TextFieldProps; + SortIconButtonProps?: IconButtonProps; + SortIconProps?: any; + LeftToolbarProps?: ToolbarProps; + LeftFilterFieldProps?: TextFieldProps; + LeftSortIconButtonProps?: IconButtonProps; + LeftSortIconProps?: any; + LeftTitleProps?: TypographyProps; + RightToolbarProps?: ToolbarProps; + RightFilterFieldProps?: TextFieldProps; + RightSortIconButtonProps?: IconButtonProps; + RightSortIconProps?: any; + RightTitleProps?: TypographyProps; + PaperProps?: PaperProps; + LeftPaperProps?: PaperProps; + RightPaperProps?: PaperProps; +} + +const DualListSelect: React.FC = ({ handleOptionsClick, rightValues, noValueTitle = 'No selected', @@ -473,6 +632,6 @@ const DualListSelect = ({ ); }; -const DualListSelectWrapper = (props) => ; +const DualListSelectWrapper: React.FC = (props) => ; export default DualListSelectWrapper; diff --git a/packages/mui-component-mapper/src/dual-list-select/index.js b/packages/mui-component-mapper/src/dual-list-select/index.js deleted file mode 100644 index 34150f77b..000000000 --- a/packages/mui-component-mapper/src/dual-list-select/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './dual-list-select'; -export * from './dual-list-select'; diff --git a/packages/mui-component-mapper/src/dual-list-select/index.d.ts b/packages/mui-component-mapper/src/dual-list-select/index.ts similarity index 100% rename from packages/mui-component-mapper/src/dual-list-select/index.d.ts rename to packages/mui-component-mapper/src/dual-list-select/index.ts diff --git a/packages/mui-component-mapper/src/field-array/field-array.d.ts b/packages/mui-component-mapper/src/field-array/field-array.d.ts deleted file mode 100644 index 0fb1ee35c..000000000 --- a/packages/mui-component-mapper/src/field-array/field-array.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { ReactNode } from "react"; -import { FieldArrayField } from "@data-driven-forms/react-form-renderer"; -import { FormControlProps, GridProps, ButtonProps, FormHelperTextProps, TypographyProps } from "@mui/material"; - -export interface FieldArrayButtonLabels { - add?: ReactNode; - remove?: ReactNode; -} - -export interface FieldArrayProps { - label?: ReactNode; - description?: ReactNode; - fields: FieldArrayField[]; - defaultItem?: any; - minItems?: number; - maxItems?: number; - noItemsMessage?: ReactNode; - FormControlProps?: FormControlProps; - FormFieldGridProps?: GridProps; - buttonLabels?: FieldArrayButtonLabels; - GridContainerProps: GridProps; - HeaderGridProps: GridProps; - HeaderProps: TypographyProps; - UndoButtonProps: ButtonProps; - RedoButtonProps: ButtonProps; - AddButtonProps: ButtonProps; - DescriptionGridProps: GridProps; - DescriptionProps: TypographyProps; - BodyGridProps: GridProps; - NoItemsProps: TypographyProps; - FormHelperTextGridProps: GridProps; - FormHelperTextProps: FormHelperTextProps; - FieldContainerProps: GridProps; - FieldGroupGridProps: GridProps; - RemoveButtonGridProps: GridProps; - RemoveButtonProps: ButtonProps; -} - -declare const FieldArray: React.ComponentType; -export default FieldArray; diff --git a/packages/mui-component-mapper/src/field-array/field-array.js b/packages/mui-component-mapper/src/field-array/field-array.tsx similarity index 76% rename from packages/mui-component-mapper/src/field-array/field-array.js rename to packages/mui-component-mapper/src/field-array/field-array.tsx index 07c1c61e3..48b7f0773 100644 --- a/packages/mui-component-mapper/src/field-array/field-array.js +++ b/packages/mui-component-mapper/src/field-array/field-array.tsx @@ -1,9 +1,11 @@ import React, { memo, useReducer } from 'react'; import { styled } from '@mui/material/styles'; import { useFormApi, FieldArray } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps, AnyObject } from '@data-driven-forms/react-form-renderer'; import isEqual from 'lodash/isEqual'; import { Grid, Button, Typography, FormControl, FormHelperText, IconButton } from '@mui/material'; +import type { GridProps, ButtonProps, TypographyProps, FormControlProps, FormHelperTextProps, IconButtonProps } from '@mui/material'; import RedoIcon from '@mui/icons-material/Redo'; import UndoIcon from '@mui/icons-material/Undo'; @@ -11,6 +13,7 @@ import UndoIcon from '@mui/icons-material/Undo'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import clsx from 'clsx'; const PREFIX = 'DynamicArray'; @@ -47,7 +50,21 @@ const StyledFormFieldGrid = styled(FormFieldGrid)({ }, }); -const ArrayItem = memo( +interface ArrayItemProps { + fields: (AnyObject & { name?: string; component: string })[]; + fieldIndex: number; + name: string; + remove: (index: number) => void; + length: number; + minItems: number; + removeLabel: string; + FieldContainerProps?: GridProps; + FieldGroupGridProps?: GridProps; + RemoveButtonGridProps?: GridProps; + RemoveButtonProps?: ButtonProps; +} + +const ArrayItem = memo( ({ fields, fieldIndex, @@ -72,7 +89,7 @@ const ArrayItem = memo( - {renderForm([editedFields])} + {renderForm(editedFields)} @@ -86,17 +103,35 @@ const ArrayItem = memo( ({ remove: _prevRemove, ...prev }, { remove: _nextRemove, ...next }) => isEqual(prev, next) ); -const defaultButtonLabels = { +interface ButtonLabels { + add?: string; + remove?: string; +} + +const defaultButtonLabels: Required = { add: 'ADD', remove: 'REMOVE', }; -const initialState = { +interface HistoryAction { + action: 'remove'; + value: any; +} + +interface HistoryState { + index: number; + history: HistoryAction[]; +} + +type ReducerAction = { type: 'redo' } | { type: 'undo' } | { type: 'action'; action: HistoryAction } | { type: 'resetHistory' }; + +const initialState: HistoryState = { index: 0, history: [], }; -export const reducer = (state, { type, action }) => { +export const reducer = (state: HistoryState, actionObj: ReducerAction): HistoryState => { + const { type } = actionObj; switch (type) { case 'redo': return { @@ -106,7 +141,7 @@ export const reducer = (state, { type, action }) => { case 'action': return { index: state.index + 1, - history: [...state.history.slice(0, state.index), action], + history: [...state.history.slice(0, state.index), (actionObj as { type: 'action'; action: HistoryAction }).action], }; case 'undo': return { @@ -123,7 +158,35 @@ export const reducer = (state, { type, action }) => { } }; -const DynamicArray = ({ ...props }) => { +export interface DynamicArrayProps extends BaseFieldProps { + arrayValidator?: (value: any[]) => string | undefined; + fields: AnyObject[]; + defaultItem?: any; + minItems?: number; + maxItems?: number; + noItemsMessage?: string; + buttonLabels?: ButtonLabels; + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + GridContainerProps?: GridProps; + HeaderGridProps?: GridProps; + HeaderProps?: TypographyProps; + UndoButtonProps?: IconButtonProps; + RedoButtonProps?: IconButtonProps; + AddButtonProps?: ButtonProps; + DescriptionGridProps?: GridProps; + DescriptionProps?: TypographyProps; + BodyGridProps?: GridProps; + NoItemsProps?: TypographyProps; + FormHelperTextGridProps?: GridProps; + FormHelperTextProps?: FormHelperTextProps; + FieldContainerProps?: GridProps; + FieldGroupGridProps?: GridProps; + RemoveButtonGridProps?: GridProps; + RemoveButtonProps?: ButtonProps; +} + +const DynamicArray: React.FC = ({ ...props }) => { const { arrayValidator, label, @@ -166,7 +229,7 @@ const DynamicArray = ({ ...props }) => { const isError = (dirty || submitFailed) && error && typeof error === 'string'; return ( - + { push(defaultItem); }; - const removeWrapper = (index) => { + const removeWrapper = (index: number) => { dispatch({ type: 'action', action: { action: 'remove', value: value[index] } }); remove(index); }; diff --git a/packages/mui-component-mapper/src/field-array/index.js b/packages/mui-component-mapper/src/field-array/index.js deleted file mode 100644 index 2dbda3dc9..000000000 --- a/packages/mui-component-mapper/src/field-array/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './field-array'; -export * from './field-array'; diff --git a/packages/mui-component-mapper/src/field-array/index.d.ts b/packages/mui-component-mapper/src/field-array/index.ts similarity index 100% rename from packages/mui-component-mapper/src/field-array/index.d.ts rename to packages/mui-component-mapper/src/field-array/index.ts diff --git a/packages/mui-component-mapper/src/form-field-grid/form-field-grid.d.ts b/packages/mui-component-mapper/src/form-field-grid/form-field-grid.d.ts deleted file mode 100644 index 96fa70010..000000000 --- a/packages/mui-component-mapper/src/form-field-grid/form-field-grid.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { AnyObject } from '@data-driven-forms/react-form-renderer'; -import { GridProps } from '@mui/material'; - -declare const FormFieldGrid: React.ComponentType; - -export default FormFieldGrid; diff --git a/packages/mui-component-mapper/src/form-field-grid/form-field-grid.js b/packages/mui-component-mapper/src/form-field-grid/form-field-grid.tsx similarity index 63% rename from packages/mui-component-mapper/src/form-field-grid/form-field-grid.js rename to packages/mui-component-mapper/src/form-field-grid/form-field-grid.tsx index fe88f12f2..398dacb07 100644 --- a/packages/mui-component-mapper/src/form-field-grid/form-field-grid.js +++ b/packages/mui-component-mapper/src/form-field-grid/form-field-grid.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { styled } from '@mui/material/styles'; - import { Grid } from '@mui/material'; +import type { GridProps } from '@mui/material'; import clsx from 'clsx'; const PREFIX = 'FormFieldGrid'; @@ -16,7 +16,12 @@ const StyledGrid = styled(Grid)({ }, }); -const FormFieldGrid = ({ children, className, ...props }) => ( +export interface FormFieldGridProps extends Omit { + children: React.ReactNode; + className?: string; +} + +const FormFieldGrid: React.FC = ({ children, className, ...props }) => ( {children} diff --git a/packages/mui-component-mapper/src/form-field-grid/index.js b/packages/mui-component-mapper/src/form-field-grid/index.js deleted file mode 100644 index abcf4bafa..000000000 --- a/packages/mui-component-mapper/src/form-field-grid/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default } from './form-field-grid'; diff --git a/packages/mui-component-mapper/src/form-field-grid/index.d.ts b/packages/mui-component-mapper/src/form-field-grid/index.ts similarity index 100% rename from packages/mui-component-mapper/src/form-field-grid/index.d.ts rename to packages/mui-component-mapper/src/form-field-grid/index.ts diff --git a/packages/mui-component-mapper/src/form-template/form-template.d.ts b/packages/mui-component-mapper/src/form-template/form-template.d.ts deleted file mode 100644 index 79708949f..000000000 --- a/packages/mui-component-mapper/src/form-template/form-template.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import FormTemplateCommonProps from "@data-driven-forms/common/form-template"; - -declare const FormTemplate: React.ComponentType; - -export default FormTemplate; diff --git a/packages/mui-component-mapper/src/form-template/form-template.js b/packages/mui-component-mapper/src/form-template/form-template.tsx similarity index 50% rename from packages/mui-component-mapper/src/form-template/form-template.js rename to packages/mui-component-mapper/src/form-template/form-template.tsx index 887a39a9b..e75033a94 100644 --- a/packages/mui-component-mapper/src/form-template/form-template.js +++ b/packages/mui-component-mapper/src/form-template/form-template.tsx @@ -1,9 +1,12 @@ import React from 'react'; import { styled } from '@mui/material/styles'; import { Grid, Button as MUIButton, Typography } from '@mui/material'; +import type { GridProps, ButtonProps, TypographyProps } from '@mui/material'; import { Alert, AlertTitle } from '@mui/material'; +import type { AlertProps, AlertTitleProps } from '@mui/material'; import FormTemplate from '@data-driven-forms/common/form-template'; +import type { FormTemplateCommonProps } from '@data-driven-forms/common/form-template'; import clsx from 'clsx'; const PREFIX = 'MuiFormTemplate'; @@ -22,7 +25,13 @@ const StyledButtonGroup = styled(Grid)(() => ({ }, })); -const Form = ({ children, GridContainerProps, GridProps, ...props }) => ( +interface FormProps extends React.FormHTMLAttributes { + children: React.ReactNode; + GridContainerProps?: GridProps; + GridProps?: GridProps; +} + +const Form: React.FC = ({ children, GridContainerProps, GridProps, ...props }) => (
@@ -32,7 +41,12 @@ const Form = ({ children, GridContainerProps, GridProps, ...props }) => ( ); -const Description = ({ children, GridProps, ...props }) => ( +interface DescriptionProps extends TypographyProps { + children: React.ReactNode; + GridProps?: GridProps; +} + +const Description: React.FC = ({ children, GridProps, ...props }) => ( {children} @@ -40,7 +54,12 @@ const Description = ({ children, GridProps, ...props }) => ( ); -const Title = ({ children, GridProps, ...props }) => ( +interface TitleProps extends TypographyProps { + children: React.ReactNode; + GridProps?: GridProps; +} + +const Title: React.FC = ({ children, GridProps, ...props }) => ( {children} @@ -48,7 +67,12 @@ const Title = ({ children, GridProps, ...props }) => ( ); -const ButtonGroup = ({ children, GridProps, ...props }) => ( +interface ButtonGroupProps extends React.HTMLAttributes { + children: React.ReactNode; + GridProps?: GridProps; +} + +const ButtonGroup: React.FC = ({ children, GridProps, ...props }) => (
{children} @@ -56,8 +80,15 @@ const ButtonGroup = ({ children, GridProps, ...props }) => ( ); -const Button = ({ label, variant, children, buttonType, ...props }) => ( - +interface CustomButtonProps extends Omit { + label?: React.ReactNode; + variant?: 'primary' | 'secondary' | ButtonProps['color']; + children?: React.ReactNode; + buttonType?: string; +} + +const Button: React.FC = ({ label, variant, children, buttonType, ...props }) => ( + {label || children} ); @@ -69,8 +100,21 @@ const StyledAlert = styled(Alert)(() => ({ }, })); -export const FormError = ({ formError, alertProps }) => { - if (typeof formError === 'object' && (formError.title || formError.title)) { +interface FormErrorObject { + title?: React.ReactNode; + description?: React.ReactNode; + TitleProps?: AlertTitleProps; + className?: string; + [key: string]: any; +} + +interface FormErrorProps { + formError?: string | FormErrorObject; + alertProps?: AlertProps; +} + +export const FormError: React.FC = ({ formError, alertProps }) => { + if (typeof formError === 'object' && formError && (formError.title || formError.description)) { const { title, description, TitleProps, className, ...props } = formError; return ( @@ -81,7 +125,7 @@ export const FormError = ({ formError, alertProps }) => { ); } - if (formError) { + if (typeof formError === 'string' && formError) { return ( {formError} @@ -92,7 +136,7 @@ export const FormError = ({ formError, alertProps }) => { return null; }; -const MuiFormTemplate = (props) => ( +const MuiFormTemplate: React.FC = (props) => ( ; - -export default MultipleChoiceList; diff --git a/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.js b/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.js deleted file mode 100644 index fcf7e329a..000000000 --- a/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.js +++ /dev/null @@ -1,60 +0,0 @@ -import React, { createContext, useContext } from 'react'; - -import { Grid, Checkbox, FormControlLabel, FormLabel, FormGroup, FormControl, FormHelperText } from '@mui/material'; - -import MultipleChoiceListCommon from '@data-driven-forms/common/multiple-choice-list'; -import { validationError } from '../validation-error/validation-error'; - -const CheckboxContext = createContext({}); - -const FinalCheckbox = ({ label, isDisabled: _isDisabled, ...rest }) => { - const { - FormControlLabelProps, - CheckboxProps, - props: { initialValue, isRequired, isReadOnly, helperText, validate, isDisabled, component, ...props }, - } = useContext(CheckboxContext); - return ( - - {label} - - } - label={label} - /> - ); -}; - -const Wrapper = ({ label, isRequired, children, meta, validateOnMount, helperText, description }) => { - const invalid = validationError(meta, validateOnMount); - const { FormFieldGridProps, FormControlProps, FormLabelProps, FormGroupProps, FormHelperTextProps } = useContext(CheckboxContext); - return ( - - - {label} - {children} - {(invalid || helperText || description) && {invalid || helperText || description}} - - - ); -}; - -const MultipleChoiceList = ({ - FormControlProps = {}, - FormLabelProps = {}, - FormGroupProps = {}, - FormHelperTextProps = {}, - FormFieldGridProps = {}, - FormControlLabelProps = {}, - CheckboxProps = {}, - ...props -}) => ( - - - -); - -export default MultipleChoiceList; diff --git a/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.tsx b/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.tsx new file mode 100644 index 000000000..0f130a2b3 --- /dev/null +++ b/packages/mui-component-mapper/src/multiple-choice-list/multiple-choice-list.tsx @@ -0,0 +1,112 @@ +import React, { createContext, useContext } from 'react'; +import { Grid, Checkbox, FormControlLabel, FormLabel, FormGroup, FormControl, FormHelperText } from '@mui/material'; +import type { + GridProps, + CheckboxProps as MUICheckboxProps, + FormControlLabelProps, + FormLabelProps, + FormGroupProps, + FormControlProps, + FormHelperTextProps, +} from '@mui/material'; + +import { MultipleChoiceList as MultipleChoiceListCommon } from '@data-driven-forms/common'; +import type { MultipleChoiceListProps, MultipleChoiceWrapperProps, MultipleChoiceCheckboxProps } from '@data-driven-forms/common'; +import type { OptionValue } from '@data-driven-forms/common'; +import { validationError } from '../validation-error/validation-error'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +interface CheckboxContextValue { + FormControlLabelProps?: Omit; + CheckboxProps?: MUICheckboxProps; + FormFieldGridProps?: GridProps; + FormControlProps?: FormControlProps; + FormLabelProps?: FormLabelProps; + FormGroupProps?: FormGroupProps; + FormHelperTextProps?: FormHelperTextProps; + props: Record; +} + +const CheckboxContext = createContext({ + props: {}, +}); + +interface FinalCheckboxProps extends MultipleChoiceCheckboxProps { + isDisabled?: boolean; +} + +const FinalCheckbox = ({ label, isDisabled: _isDisabled, checked, onChange, value }: FinalCheckboxProps) => { + const { + FormControlLabelProps, + CheckboxProps, + props: { isDisabled }, + } = useContext(CheckboxContext); + + return ( + onChange && onChange(value)} disabled={isDisabled} {...CheckboxProps} />} + label={label} + /> + ); +}; + +interface WrapperProps extends MultipleChoiceWrapperProps { + meta: ExtendedFieldMeta; + validateOnMount?: boolean; +} + +const Wrapper: React.FC = ({ label, isRequired, children, meta, validateOnMount, helperText, description }) => { + const invalid = validationError(meta, validateOnMount); + const { FormFieldGridProps, FormControlProps, FormLabelProps, FormGroupProps, FormHelperTextProps } = useContext(CheckboxContext); + + return ( + + + {label} + {children} + {(invalid || helperText || description) && {invalid || helperText || description}} + + + ); +}; + +export interface MUIMultipleChoiceListProps extends Omit, 'Wrapper' | 'Checkbox'> { + FormControlProps?: FormControlProps; + FormLabelProps?: FormLabelProps; + FormGroupProps?: FormGroupProps; + FormHelperTextProps?: FormHelperTextProps; + FormFieldGridProps?: GridProps; + FormControlLabelProps?: Omit; + CheckboxProps?: MUICheckboxProps; +} + +const MultipleChoiceList = ({ + FormControlProps = {}, + FormLabelProps = {}, + FormGroupProps = {}, + FormHelperTextProps = {}, + FormFieldGridProps = {}, + FormControlLabelProps = {}, + CheckboxProps = {}, + name, + options, + ...props +}: MUIMultipleChoiceListProps) => ( + + name={name} options={options} {...props} Wrapper={Wrapper} Checkbox={FinalCheckbox} /> + +); + +export default MultipleChoiceList; diff --git a/packages/mui-component-mapper/src/plain-text/index.js b/packages/mui-component-mapper/src/plain-text/index.js deleted file mode 100644 index f4ac5b13c..000000000 --- a/packages/mui-component-mapper/src/plain-text/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './plain-text'; -export * from './plain-text'; diff --git a/packages/mui-component-mapper/src/plain-text/index.d.ts b/packages/mui-component-mapper/src/plain-text/index.ts similarity index 100% rename from packages/mui-component-mapper/src/plain-text/index.d.ts rename to packages/mui-component-mapper/src/plain-text/index.ts diff --git a/packages/mui-component-mapper/src/plain-text/plain-text.d.ts b/packages/mui-component-mapper/src/plain-text/plain-text.d.ts deleted file mode 100644 index f208b6799..000000000 --- a/packages/mui-component-mapper/src/plain-text/plain-text.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { TypographyProps } from "@mui/material"; -import { ElementType, ReactNode } from "react"; - -export interface PlainTextProps extends Omit { - label: ReactNode; - name: string; - element?: ElementType; -} - -declare const PlainText: React.ComponentType; - -export default PlainText; diff --git a/packages/mui-component-mapper/src/plain-text/plain-text.js b/packages/mui-component-mapper/src/plain-text/plain-text.js deleted file mode 100644 index dfd94baac..000000000 --- a/packages/mui-component-mapper/src/plain-text/plain-text.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import { Typography } from '@mui/material'; - -const PlainText = ({ label, name, component, element, variant = 'body1', gutterBottom = true, ...props }) => - typeof label === 'string' ? ( - label.split('\n').map((paragraph, index) => ( - - {paragraph} - - )) - ) : ( - - {label} - - ); - -export default PlainText; diff --git a/packages/mui-component-mapper/src/plain-text/plain-text.tsx b/packages/mui-component-mapper/src/plain-text/plain-text.tsx new file mode 100644 index 000000000..41d7c0be2 --- /dev/null +++ b/packages/mui-component-mapper/src/plain-text/plain-text.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { Typography } from '@mui/material'; +import type { TypographyProps } from '@mui/material'; + +export interface PlainTextProps extends Omit { + label?: React.ReactNode; + name?: string; + component?: React.ElementType; + element?: React.ElementType; + variant?: TypographyProps['variant']; + gutterBottom?: boolean; +} + +const PlainText: React.FC = ({ label, name, component, element, variant = 'body1', gutterBottom = true, ...props }) => + typeof label === 'string' ? ( + <> + {label.split('\n').map((paragraph, index) => ( + + {paragraph} + + ))} + + ) : ( + + {label} + + ); + +export default PlainText; diff --git a/packages/mui-component-mapper/src/radio/index.js b/packages/mui-component-mapper/src/radio/index.js deleted file mode 100644 index b42f424d1..000000000 --- a/packages/mui-component-mapper/src/radio/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './radio'; -export * from './radio'; diff --git a/packages/mui-component-mapper/src/radio/index.d.ts b/packages/mui-component-mapper/src/radio/index.ts similarity index 100% rename from packages/mui-component-mapper/src/radio/index.d.ts rename to packages/mui-component-mapper/src/radio/index.ts diff --git a/packages/mui-component-mapper/src/radio/radio.d.ts b/packages/mui-component-mapper/src/radio/radio.d.ts deleted file mode 100644 index 4677dcc0b..000000000 --- a/packages/mui-component-mapper/src/radio/radio.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { UseFieldApiComponentConfig, AnyObject } from "@data-driven-forms/react-form-renderer"; -import { RadioProps as MuiRadioProps, GridProps, FormControlProps, FormControlLabelProps, FormLabelProps, FormHelperTextProps } from '@mui/material'; -import { ReactNode } from "react"; - -export interface RadioOption extends AnyObject { - label: ReactNode; - value?: any; -} -interface InternalRadioProps extends MuiRadioProps { - options?: RadioOption[]; - FormFieldGridProps?: GridProps; - FormControlProps?: FormControlProps; - FormControlLabelProps?: FormControlLabelProps; - RadioProps?: MuiRadioProps; - FormLabelProps?: FormLabelProps; - FormHelperTextProps?: FormHelperTextProps; - isDisabled?: boolean; - description?: ReactNode; - helperText?: ReactNode; - validateOnMount?: boolean; -} - -export type RadioProps = InternalRadioProps & UseFieldApiComponentConfig; - -declare const Radio: React.ComponentType; - -export default Radio; diff --git a/packages/mui-component-mapper/src/radio/radio.js b/packages/mui-component-mapper/src/radio/radio.tsx similarity index 59% rename from packages/mui-component-mapper/src/radio/radio.js rename to packages/mui-component-mapper/src/radio/radio.tsx index 0caf3811b..059cecb89 100644 --- a/packages/mui-component-mapper/src/radio/radio.js +++ b/packages/mui-component-mapper/src/radio/radio.tsx @@ -1,10 +1,15 @@ import React from 'react'; import { styled } from '@mui/material/styles'; import { Radio as MUIRadio, FormControlLabel, FormControl, FormLabel, FormHelperText } from '@mui/material'; +import type { FormControlLabelProps, FormControlProps, FormLabelProps, FormHelperTextProps } from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; +import type { SelectOption, OptionValue } from '@data-driven-forms/common'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; const PREFIX = 'Radio'; @@ -20,11 +25,33 @@ const StyledFormFieldGrid = styled(FormFieldGrid)(() => ({ }, })); -const RadioOption = ({ name, option, isDisabled, isReadOnly, FormControlLabelProps, RadioProps: { inputProps, ...RadioProps }, ...props }) => { +interface RadioOptionProps { + name: string; + option: SelectOption; + isDisabled?: boolean; + isReadOnly?: boolean; + FormControlLabelProps?: FormControlLabelProps; + RadioProps?: { + inputProps?: Record; + [key: string]: any; + }; + [key: string]: any; +} + +function RadioOption({ + name, + option, + isDisabled, + isReadOnly, + FormControlLabelProps, + RadioProps: { inputProps, ...RadioProps } = {}, + ...props +}: RadioOptionProps) { const { input } = useFieldApi({ name, type: 'radio', value: option.value }); + return ( ); -}; +} + +export interface RadioProps extends BaseFieldProps { + options: SelectOption[]; + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + FormControlLabelProps?: FormControlLabelProps; + RadioProps?: { + inputProps?: Record; + [key: string]: any; + }; + [key: string]: any; +} -const Radio = ({ name, ...props }) => { +function Radio({ name, ...props }: RadioProps) { const { options = [], isDisabled, @@ -69,8 +110,9 @@ const Radio = ({ name, ...props }) => { type: 'radio', }); - const invalid = validationError(meta, validateOnMount); + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description; + return ( @@ -78,9 +120,9 @@ const Radio = ({ name, ...props }) => { {label} {options.map((option) => ( - + key={String(option.value)} + name={name || ''} option={option} isDisabled={isDisabled} isReadOnly={isReadOnly} @@ -93,6 +135,6 @@ const Radio = ({ name, ...props }) => { ); -}; +} export default Radio; diff --git a/packages/mui-component-mapper/src/select/index.js b/packages/mui-component-mapper/src/select/index.js deleted file mode 100644 index 27caaa296..000000000 --- a/packages/mui-component-mapper/src/select/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './select'; -export * from './select'; diff --git a/packages/mui-component-mapper/src/select/index.d.ts b/packages/mui-component-mapper/src/select/index.ts similarity index 100% rename from packages/mui-component-mapper/src/select/index.d.ts rename to packages/mui-component-mapper/src/select/index.ts diff --git a/packages/mui-component-mapper/src/select/select.d.ts b/packages/mui-component-mapper/src/select/select.d.ts deleted file mode 100644 index c4f2130c7..000000000 --- a/packages/mui-component-mapper/src/select/select.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { AutocompleteProps } from '@mui/material/Autocomplete'; -import { ReactNode } from "react"; -import { GridProps, TextFieldProps, InputProps } from "@mui/material"; - -interface InternalSelectProps extends AutocompleteProps { - isRequired?: boolean; - isDisabled?: boolean; - isReadOnly?: boolean; - disabled?: boolean; - multiple?: boolean; - isMulti?: boolean; - isClearable?: boolean; - disableClearable?: boolean; - loadingMessage?: ReactNode; - loadingText?: ReactNode; - noOptionsMessage?: ReactNode; - noOptionsText?: ReactNode; - closeMenuOnSelect?: boolean; - FormFieldGridProps?: GridProps; - TextFieldProps?: TextFieldProps; - inputProps?: InputProps; -} - -export type SelectProps = InternalSelectProps & UseFieldApiComponentConfig; - -declare const Select: React.ComponentType>; - -export default Select; diff --git a/packages/mui-component-mapper/src/select/select.js b/packages/mui-component-mapper/src/select/select.tsx similarity index 60% rename from packages/mui-component-mapper/src/select/select.js rename to packages/mui-component-mapper/src/select/select.tsx index c5b2b0b25..6f5dc3219 100644 --- a/packages/mui-component-mapper/src/select/select.js +++ b/packages/mui-component-mapper/src/select/select.tsx @@ -1,21 +1,52 @@ import React, { useMemo } from 'react'; - -import FormFieldGrid from '../form-field-grid/form-field-grid'; -import { validationError } from '../validation-error/validation-error'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import DDFSelect from '@data-driven-forms/common/select'; import parseInternalValue from '@data-driven-forms/common/select/parse-internal-value'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { SelectOption, OptionValue, SelectValue } from '@data-driven-forms/common'; import { TextField, CircularProgress } from '@mui/material'; import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown'; import { Autocomplete } from '@mui/material'; +import FormFieldGrid from '../form-field-grid/form-field-grid'; +import { validationError } from '../validation-error/validation-error'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +export interface SelectProps extends BaseFieldProps { + options?: SelectOption[]; + loadOptions?: (inputValue: string) => Promise[]>; + isSearchable?: boolean; + isMulti?: boolean; + multiple?: boolean; + isClearable?: boolean; + disableClearable?: boolean; + hideSelectedOptions?: boolean; + closeMenuOnSelect?: boolean; + isFetching?: boolean; + noOptionsMessage?: () => string; + noOptionsText?: () => string; + loadingMessage?: string; + loadingText?: string; + placeholder?: string; + FormFieldGridProps?: Record; + TextFieldProps?: { + inputProps?: Record; + [key: string]: any; + }; + inputProps?: Record; + classNamePrefix?: string; + onInputChange?: (value: string) => void; + // Allow additional Autocomplete props + [key: string]: any; +} + /** * Returns label of selected option * @param {Object|Array} option currently selected option - * @param {Array} options all options avaiable + * @param {Array} options all options available * @returns {String} */ -export const getOptionLabel = (option, options) => { +export function getOptionLabel(option: T | SelectOption | undefined, options: SelectOption[]): string { if (typeof option === 'undefined') { return ''; } @@ -29,12 +60,12 @@ export const getOptionLabel = (option, options) => { } if (typeof option === 'object') { - return option.label; + return String((option as SelectOption).label); } const item = options.find(({ value }) => value === option); - return (item && item.label) || ''; -}; + return (item && String(item.label)) || ''; +} /** * Function that creates correct DDF select value format @@ -42,15 +73,51 @@ export const getOptionLabel = (option, options) => { * @param {Boolean} isMulti multiple select flag * @returns {Object|Array} */ -export const createValue = (option, isMulti) => { +export function createValue( + option: T | SelectOption | (T | SelectOption)[] | null, + isMulti: boolean +): T | SelectOption | (T | SelectOption)[] | undefined { if (isMulti) { - return Array.isArray(option) ? option.map((item) => (typeof item === 'object' ? item : { value: item })) : option; + return Array.isArray(option) ? option.map((item) => (typeof item === 'object' ? item : ({ value: item } as SelectOption))) : option; } return option; -}; +} -const InternalSelect = ({ +interface InternalSelectProps { + value: SelectValue; + options: SelectOption[]; + label?: string; + helperText?: string; + validateOnMount?: boolean; + meta: ExtendedFieldMeta; + isSearchable?: boolean; + description?: string; + classNamePrefix?: string; + isMulti?: boolean; + placeholder?: string; + onInputChange?: (value: string) => void; + isFetching?: boolean; + noOptionsMessage?: () => string; + hideSelectedOptions?: boolean; + closeMenuOnSelect?: boolean; + required?: boolean; + onChange: (value: any) => void; + onFocus?: () => void; + onBlur?: () => void; + FormFieldGridProps?: Record; + TextFieldProps?: { + inputProps?: Record; + [key: string]: any; + }; + inputProps?: Record; + isClearable?: boolean; + isDisabled?: boolean; + loadingText?: string; + [key: string]: any; +} + +function InternalSelect({ value, options, label, @@ -78,7 +145,7 @@ const InternalSelect = ({ isDisabled, loadingText = 'Loading...', ...rest -}) => { +}: InternalSelectProps) { const invalid = validationError(meta, validateOnMount); // When isMulti is true, the "parseInternalValue" always creates new value array, we need to memoize it to not create new array instance // Memo is required to fix https://github.com/data-driven-forms/react-forms/issues/1366 @@ -110,11 +177,11 @@ const InternalSelect = ({ ...textFieldInputProps, ...inputProps, readOnly: !isSearchable, - placeholder: !internalValue || internalValue.length === 0 ? placeholder : undefined, + placeholder: !internalValue || (internalValue as any).length === 0 ? placeholder : undefined, }} /> )} - noOptionsText={noOptionsMessage()} + noOptionsText={noOptionsMessage && noOptionsMessage()} onInputChange={(_event, value) => onInputChange(value)} options={options} multiple={isMulti} @@ -125,9 +192,9 @@ const InternalSelect = ({ /> ); -}; +} -const Select = (props) => { +function Select(props: SelectProps) { const { input, isRequired, @@ -145,6 +212,7 @@ const Select = (props) => { closeMenuOnSelect, ...rest } = useFieldApi(props); + return ( { SelectComponent={InternalSelect} /> ); -}; +} export default Select; diff --git a/packages/mui-component-mapper/src/slider/index.js b/packages/mui-component-mapper/src/slider/index.js deleted file mode 100644 index 67fbfdaf0..000000000 --- a/packages/mui-component-mapper/src/slider/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './slider'; -export * from './slider'; diff --git a/packages/mui-component-mapper/src/slider/index.d.ts b/packages/mui-component-mapper/src/slider/index.ts similarity index 100% rename from packages/mui-component-mapper/src/slider/index.d.ts rename to packages/mui-component-mapper/src/slider/index.ts diff --git a/packages/mui-component-mapper/src/slider/slider.d.ts b/packages/mui-component-mapper/src/slider/slider.d.ts deleted file mode 100644 index 5aba2fc6e..000000000 --- a/packages/mui-component-mapper/src/slider/slider.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { SliderProps as MuiSliderProps, GridProps, FormControlProps, FormGroupProps, FormLabelProps, FormHelperTextProps } from '@mui/material'; -import { ReactNode } from "react"; - -interface InternalSliderProps extends MuiSliderProps { - isReadOnly?: boolean; - isDisabled?: boolean; - isRequired?: boolean; - label?: ReactNode; - helperText?: ReactNode; - description?: ReactNode; - validateOnMount?: boolean; - FormFieldGridProps?: GridProps; - FormControlProps?: FormControlProps; - FormGroupProps?: FormGroupProps; - FormLabelProps?: FormLabelProps; - FormHelperTextProps?: FormHelperTextProps; - before?: ReactNode; - after?: ReactNode; - InputGridProps?: GridProps; - BeforeGridProps?: GridProps; - SliderGridProps?: GridProps; - AfterGridProps?: GridProps; -} - -export type SliderProps = InternalSliderProps & UseFieldApiComponentConfig; - -declare const Slider: React.ComponentType; - -export default Slider; diff --git a/packages/mui-component-mapper/src/slider/slider.js b/packages/mui-component-mapper/src/slider/slider.tsx similarity index 53% rename from packages/mui-component-mapper/src/slider/slider.js rename to packages/mui-component-mapper/src/slider/slider.tsx index ea3217959..41272178f 100644 --- a/packages/mui-component-mapper/src/slider/slider.js +++ b/packages/mui-component-mapper/src/slider/slider.tsx @@ -1,11 +1,34 @@ import React from 'react'; import { FormControl, FormGroup, FormHelperText, Slider as MUISlider, FormLabel, Grid } from '@mui/material'; +import type { FormControlProps, FormGroupProps, FormHelperTextProps, SliderProps as MUISliderProps, FormLabelProps, GridProps } from '@mui/material'; import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; -const Slider = (props) => { +export interface SliderProps extends BaseFieldProps { + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + FormGroupProps?: FormGroupProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + before?: React.ReactNode; + after?: React.ReactNode; + InputGridProps?: GridProps; + BeforeGridProps?: GridProps; + SliderGridProps?: GridProps; + AfterGridProps?: GridProps; + min?: number; + max?: number; + step?: number; + SliderProps?: Omit; + [key: string]: any; +} + +const Slider: React.FC = (props) => { const { input, isReadOnly, @@ -16,23 +39,28 @@ const Slider = (props) => { description, validateOnMount, meta, - FormFieldGridProps, - FormControlProps, - FormGroupProps, - FormLabelProps, - FormHelperTextProps, + FormFieldGridProps = {}, + FormControlProps = {}, + FormGroupProps = {}, + FormLabelProps = {}, + FormHelperTextProps = {}, before, after, - InputGridProps, - BeforeGridProps, - SliderGridProps, - AfterGridProps, + InputGridProps = {}, + BeforeGridProps = {}, + SliderGridProps = {}, + AfterGridProps = {}, + min = 0, + max = 100, + SliderProps = {}, ...rest } = useFieldApi(props); - const invalid = validationError(meta, validateOnMount); + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description; + const defaultValue = (max + min) / 2; + return ( @@ -49,10 +77,13 @@ const Slider = (props) => { input.onChange(value)} + {...SliderProps} + {...rest} /> {after && ( diff --git a/packages/mui-component-mapper/src/sub-form/index.js b/packages/mui-component-mapper/src/sub-form/index.js deleted file mode 100644 index e5c265b70..000000000 --- a/packages/mui-component-mapper/src/sub-form/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './sub-form'; -export * from './sub-form'; diff --git a/packages/mui-component-mapper/src/sub-form/index.d.ts b/packages/mui-component-mapper/src/sub-form/index.ts similarity index 100% rename from packages/mui-component-mapper/src/sub-form/index.d.ts rename to packages/mui-component-mapper/src/sub-form/index.ts diff --git a/packages/mui-component-mapper/src/sub-form/sub-form.d.ts b/packages/mui-component-mapper/src/sub-form/sub-form.d.ts deleted file mode 100644 index 1f710f8bb..000000000 --- a/packages/mui-component-mapper/src/sub-form/sub-form.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { Field } from "@data-driven-forms/react-form-renderer"; -import { GridProps, TypographyProps } from "@mui/material"; -import { ReactNode } from "react"; - -export interface SubFormProps { - fields: Field[] | Field; - title?: ReactNode; - description?: ReactNode; - TitleGridProps?: GridProps; - TitleProps?: TypographyProps; - DescriptionProps?: TypographyProps; - DescriptionGridProps?: GridProps; - ItemsGridProps?: GridProps; -} - -declare const SubForm: React.ComponentType; - -export default SubForm; diff --git a/packages/mui-component-mapper/src/sub-form/sub-form.js b/packages/mui-component-mapper/src/sub-form/sub-form.tsx similarity index 63% rename from packages/mui-component-mapper/src/sub-form/sub-form.js rename to packages/mui-component-mapper/src/sub-form/sub-form.tsx index e84a161c0..c8657d425 100644 --- a/packages/mui-component-mapper/src/sub-form/sub-form.js +++ b/packages/mui-component-mapper/src/sub-form/sub-form.tsx @@ -1,8 +1,10 @@ import React from 'react'; import { styled } from '@mui/material/styles'; import { Typography, Grid } from '@mui/material'; +import type { TypographyProps, GridProps } from '@mui/material'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; +import type { Field } from '@data-driven-forms/react-form-renderer'; const PREFIX = 'SubForm'; @@ -17,19 +19,32 @@ const StyledGrid = styled(Grid)(() => ({ }, })); -const SubForm = ({ +export interface SubFormProps extends Omit { + fields: Field[]; + title?: React.ReactNode; + description?: React.ReactNode; + component?: string; + TitleGridProps?: GridProps; + TitleProps?: TypographyProps; + DescriptionProps?: TypographyProps; + DescriptionGridProps?: GridProps; + ItemsGridProps?: GridProps; +} + +const SubForm: React.FC = ({ fields, title, description, component, - TitleGridProps, - TitleProps, - DescriptionProps, - DescriptionGridProps, - ItemsGridProps, + TitleGridProps = {}, + TitleProps = {}, + DescriptionProps = {}, + DescriptionGridProps = {}, + ItemsGridProps = {}, ...rest }) => { const { renderForm } = useFormApi(); + return ( {title && ( diff --git a/packages/mui-component-mapper/src/switch/index.js b/packages/mui-component-mapper/src/switch/index.js deleted file mode 100644 index 064e75db6..000000000 --- a/packages/mui-component-mapper/src/switch/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './switch'; -export * from './switch'; diff --git a/packages/mui-component-mapper/src/switch/index.d.ts b/packages/mui-component-mapper/src/switch/index.ts similarity index 100% rename from packages/mui-component-mapper/src/switch/index.d.ts rename to packages/mui-component-mapper/src/switch/index.ts diff --git a/packages/mui-component-mapper/src/switch/switch.d.ts b/packages/mui-component-mapper/src/switch/switch.d.ts deleted file mode 100644 index fedd02972..000000000 --- a/packages/mui-component-mapper/src/switch/switch.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { SwitchProps as MuiSwitchProps, GridProps, FormControlProps, FormGroupProps, FormControlLabelProps, FormLabelProps, FormHelperTextProps } from '@mui/material'; -import { ReactNode } from "react"; - -interface InternalSwitchProps extends MuiSwitchProps { - isReadOnly?: boolean; - isDisabled?: boolean; - isRequired?: boolean; - label?: ReactNode; - helperText?: ReactNode; - description?: ReactNode; - validateOnMount?: boolean; - onText?: ReactNode; - offText?: ReactNode; - FormFieldGridProps?: GridProps; - FormControlProps?: FormControlProps; - FormGroupProps?: FormGroupProps; - FormControlLabelProps?: FormControlLabelProps; - SwitchProps?: MuiSwitchProps; - FormLabelProps?: FormLabelProps; - FormHelperTextProps?: FormHelperTextProps; -} - -export type SwitchProps = InternalSwitchProps & UseFieldApiComponentConfig; - -declare const Switch: React.ComponentType; - -export default Switch; diff --git a/packages/mui-component-mapper/src/switch/switch.js b/packages/mui-component-mapper/src/switch/switch.tsx similarity index 65% rename from packages/mui-component-mapper/src/switch/switch.js rename to packages/mui-component-mapper/src/switch/switch.tsx index 04c1a038e..4f1ef702a 100644 --- a/packages/mui-component-mapper/src/switch/switch.js +++ b/packages/mui-component-mapper/src/switch/switch.tsx @@ -1,11 +1,35 @@ import React from 'react'; import { FormControlLabel, FormHelperText, FormControl, FormGroup, FormLabel, Switch as MUISwitch } from '@mui/material'; +import type { + FormControlLabelProps, + FormHelperTextProps, + FormControlProps, + FormGroupProps, + FormLabelProps, + SwitchProps as MUISwitchProps, +} from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; -export const Switch = (props) => { +export interface SwitchProps extends BaseFieldProps { + onText?: string; + offText?: string; + FormFieldGridProps?: FormFieldGridProps; + FormControlProps?: FormControlProps; + FormGroupProps?: FormGroupProps; + FormControlLabelProps?: FormControlLabelProps; + SwitchProps?: MUISwitchProps; + FormLabelProps?: FormLabelProps; + FormHelperTextProps?: FormHelperTextProps; + [key: string]: any; +} + +export const Switch: React.FC = (props) => { const { input, isReadOnly, @@ -30,7 +54,8 @@ export const Switch = (props) => { ...props, type: 'checkbox', }); - const invalid = validationError(meta, validateOnMount); + + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); const text = invalid || ((meta.touched || validateOnMount) && meta.warning) || helperText || description; return ( diff --git a/packages/mui-component-mapper/src/tabs/index.js b/packages/mui-component-mapper/src/tabs/index.js deleted file mode 100644 index ee0f9467c..000000000 --- a/packages/mui-component-mapper/src/tabs/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './tabs'; -export * from './tabs'; diff --git a/packages/mui-component-mapper/src/tabs/index.d.ts b/packages/mui-component-mapper/src/tabs/index.ts similarity index 100% rename from packages/mui-component-mapper/src/tabs/index.d.ts rename to packages/mui-component-mapper/src/tabs/index.ts diff --git a/packages/mui-component-mapper/src/tabs/tabs.d.ts b/packages/mui-component-mapper/src/tabs/tabs.d.ts deleted file mode 100644 index 3887c7389..000000000 --- a/packages/mui-component-mapper/src/tabs/tabs.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Field } from "@data-driven-forms/react-form-renderer"; -import { AppBarProps, GridProps, TabProps } from "@mui/material"; - -export interface TabsProps { - fields: Field[]; - AppBarProps?: AppBarProps; - TabsProps?: TabsProps; - TabProps?: TabProps; - FormFieldGridProps?: GridProps, - GridItemProps?: GridProps, -} - -declare const Tabs: React.ComponentType; - -export default Tabs; diff --git a/packages/mui-component-mapper/src/tabs/tabs.js b/packages/mui-component-mapper/src/tabs/tabs.tsx similarity index 54% rename from packages/mui-component-mapper/src/tabs/tabs.js rename to packages/mui-component-mapper/src/tabs/tabs.tsx index 75e5112f3..5d9c25f5f 100644 --- a/packages/mui-component-mapper/src/tabs/tabs.js +++ b/packages/mui-component-mapper/src/tabs/tabs.tsx @@ -1,11 +1,36 @@ import React, { useState } from 'react'; import { AppBar, Grid, Tab, Tabs } from '@mui/material'; +import type { AppBarProps, GridProps, TabProps as MUITabProps, TabsProps } from '@mui/material'; import FormFieldGrid from '../form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { useFormApi } from '@data-driven-forms/react-form-renderer'; +import type { Field } from '@data-driven-forms/react-form-renderer'; -const FormTabs = ({ fields, AppBarProps = {}, TabsProps = {}, TabProps = {}, FormFieldGridProps = {}, GridItemProps = {} }) => { +interface TabField { + fields: Field[]; + title?: string; + name?: string; +} + +export interface FormTabsProps { + fields: TabField[]; + AppBarProps?: AppBarProps; + TabsProps?: TabsProps; + TabProps?: MUITabProps; + FormFieldGridProps?: FormFieldGridProps; + GridItemProps?: GridProps; +} + +const FormTabs: React.FC = ({ + fields, + AppBarProps = {}, + TabsProps = {}, + TabProps = {}, + FormFieldGridProps = {}, + GridItemProps = {}, +}) => { const formOptions = useFormApi(); const [activeTab, setActiveTab] = useState(0); @@ -13,8 +38,8 @@ const FormTabs = ({ fields, AppBarProps = {}, TabsProps = {}, TabProps = {}, For setActiveTab(tabIndex)} {...TabsProps}> - {fields.map(({ title, name }) => ( - + {fields.map(({ title, name }, index) => ( + ))} @@ -36,15 +61,3 @@ const FormTabs = ({ fields, AppBarProps = {}, TabsProps = {}, TabProps = {}, For }; export default FormTabs; - -/* - {fields.map(({ fields }, index) => - index === activeTab ? ( - formOptions.renderForm(fields) - ) : ( - - {formOptions.renderForm(fields)} - - ) - )} - */ diff --git a/packages/mui-component-mapper/src/tests/dependencies.test.js b/packages/mui-component-mapper/src/tests/dependencies.test.js index bedd7dbde..7a8a92c5e 100644 --- a/packages/mui-component-mapper/src/tests/dependencies.test.js +++ b/packages/mui-component-mapper/src/tests/dependencies.test.js @@ -1,9 +1,10 @@ import MUIJson from '../../package.json'; -import DEMOJson from '../../../react-renderer-demo/package.json'; describe('package.json', () => { - it('mui-mapper has the same version as react-renderer-demo', () => { - expect(MUIJson.devDependencies['@mui/material']).toEqual(DEMOJson.dependencies['@mui/material']); - expect(MUIJson.devDependencies['@mui/icons-material']).toEqual(DEMOJson.dependencies['@mui/icons-material']); + it('mui-mapper has required dependencies', () => { + expect(MUIJson.devDependencies['@mui/material']).toBeDefined(); + expect(MUIJson.devDependencies['@mui/icons-material']).toBeDefined(); + expect(MUIJson.peerDependencies['@mui/material']).toBeDefined(); + expect(MUIJson.peerDependencies['@mui/icons-material']).toBeDefined(); }); }); diff --git a/packages/mui-component-mapper/src/text-field/index.js b/packages/mui-component-mapper/src/text-field/index.js deleted file mode 100644 index 7a43eb624..000000000 --- a/packages/mui-component-mapper/src/text-field/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './text-field'; -export * from './text-field'; diff --git a/packages/mui-component-mapper/src/text-field/index.d.ts b/packages/mui-component-mapper/src/text-field/index.ts similarity index 100% rename from packages/mui-component-mapper/src/text-field/index.d.ts rename to packages/mui-component-mapper/src/text-field/index.ts diff --git a/packages/mui-component-mapper/src/text-field/text-field.d.ts b/packages/mui-component-mapper/src/text-field/text-field.d.ts deleted file mode 100644 index 117a5d153..000000000 --- a/packages/mui-component-mapper/src/text-field/text-field.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { TextFieldProps as MuiTextFieldProps, GridProps } from '@mui/material'; -import { ReactNode } from "react"; - -interface InternalTextFieldProps { - isReadOnly?: boolean; - isDisabled?: boolean; - isRequired?: boolean; - description?: ReactNode; - validateOnMount?: boolean; - FormFieldGridProps?: GridProps; -} - -export type TextFieldProps = InternalTextFieldProps & MuiTextFieldProps & UseFieldApiComponentConfig; - -declare const TextField: React.ComponentType; - -export default TextField; diff --git a/packages/mui-component-mapper/src/text-field/text-field.js b/packages/mui-component-mapper/src/text-field/text-field.tsx similarity index 67% rename from packages/mui-component-mapper/src/text-field/text-field.js rename to packages/mui-component-mapper/src/text-field/text-field.tsx index e81519e94..5922ef937 100644 --- a/packages/mui-component-mapper/src/text-field/text-field.js +++ b/packages/mui-component-mapper/src/text-field/text-field.tsx @@ -1,11 +1,21 @@ import React from 'react'; import { TextField as MuiTextField } from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +export interface TextFieldProps extends BaseFieldProps { + placeholder?: string; + inputProps?: Record; + FormFieldGridProps?: Record; + // Allow any additional MUI TextField props + [key: string]: any; +} -const TextField = (props) => { +const TextField: React.FC = (props) => { const { input, isReadOnly, @@ -21,7 +31,7 @@ const TextField = (props) => { FormFieldGridProps, ...rest } = useFieldApi(props); - const invalid = validationError(meta, validateOnMount); + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); return ( diff --git a/packages/mui-component-mapper/src/textarea/index.js b/packages/mui-component-mapper/src/textarea/index.js deleted file mode 100644 index a3366cc62..000000000 --- a/packages/mui-component-mapper/src/textarea/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './textarea'; -export * from './textarea'; diff --git a/packages/mui-component-mapper/src/textarea/index.d.ts b/packages/mui-component-mapper/src/textarea/index.ts similarity index 100% rename from packages/mui-component-mapper/src/textarea/index.d.ts rename to packages/mui-component-mapper/src/textarea/index.ts diff --git a/packages/mui-component-mapper/src/textarea/textarea.d.ts b/packages/mui-component-mapper/src/textarea/textarea.d.ts deleted file mode 100644 index e56de4c64..000000000 --- a/packages/mui-component-mapper/src/textarea/textarea.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { TextFieldProps, GridProps, InputProps } from "@mui/material"; -import { ReactNode } from "react"; - -interface InternalTextareaProps { - isReadOnly?: boolean; - isDisabled?: boolean; - isRequired?: boolean; - validateOnMount?: boolean; - desciption?: ReactNode; - FormFieldGridProps?: GridProps; - inputProps?: InputProps; -} - -export type TextareaProps = InternalTextareaProps & TextFieldProps & UseFieldApiComponentConfig; - -declare const Textarea: React.ComponentType; - -export default Textarea; diff --git a/packages/mui-component-mapper/src/textarea/textarea.js b/packages/mui-component-mapper/src/textarea/textarea.tsx similarity index 58% rename from packages/mui-component-mapper/src/textarea/textarea.js rename to packages/mui-component-mapper/src/textarea/textarea.tsx index c8dc74d59..b0bd10eef 100644 --- a/packages/mui-component-mapper/src/textarea/textarea.js +++ b/packages/mui-component-mapper/src/textarea/textarea.tsx @@ -1,11 +1,23 @@ import React from 'react'; import { TextField as MuiTextField } from '@mui/material'; +import type { TextFieldProps as MuiTextFieldProps } from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +export interface TextareaProps extends BaseFieldProps { + placeholder?: string; + inputProps?: Record; + FormFieldGridProps?: FormFieldGridProps; + TextFieldProps?: Omit; + [key: string]: any; +} -const Textarea = (props) => { +const Textarea: React.FC = (props) => { const { input, isReadOnly, @@ -19,9 +31,12 @@ const Textarea = (props) => { meta, FormFieldGridProps = {}, inputProps = {}, + TextFieldProps = {}, ...rest } = useFieldApi(props); - const invalid = validationError(meta, validateOnMount); + + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); + return ( { readOnly: isReadOnly, ...inputProps, }} + {...TextFieldProps} {...rest} multiline /> diff --git a/packages/mui-component-mapper/src/time-picker/index.js b/packages/mui-component-mapper/src/time-picker/index.js deleted file mode 100644 index c68e6eff2..000000000 --- a/packages/mui-component-mapper/src/time-picker/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './time-picker'; -export * from './time-picker'; diff --git a/packages/mui-component-mapper/src/time-picker/index.d.ts b/packages/mui-component-mapper/src/time-picker/index.ts similarity index 100% rename from packages/mui-component-mapper/src/time-picker/index.d.ts rename to packages/mui-component-mapper/src/time-picker/index.ts diff --git a/packages/mui-component-mapper/src/time-picker/time-picker.d.ts b/packages/mui-component-mapper/src/time-picker/time-picker.d.ts deleted file mode 100644 index c3cc7cac4..000000000 --- a/packages/mui-component-mapper/src/time-picker/time-picker.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer"; -import { TimePickerProps as MuiTimePickerProps } from '@mui/x-date-pickers'; -import { ReactNode } from "react"; -import { GridProps } from "@mui/material"; -interface InternalTimePickerProps extends MuiTimePickerProps { - isReadOnly?: boolean; - isDisabled?: boolean; - isRequired?: boolean; - description?: ReactNode; - validateOnMount?: boolean; - FormFieldGridProps?: GridProps; -} - -export type TimePickerProps = InternalTimePickerProps & UseFieldApiComponentConfig; - -declare const TimePicker: React.ComponentType; - -export default TimePicker; diff --git a/packages/mui-component-mapper/src/time-picker/time-picker.js b/packages/mui-component-mapper/src/time-picker/time-picker.tsx similarity index 65% rename from packages/mui-component-mapper/src/time-picker/time-picker.js rename to packages/mui-component-mapper/src/time-picker/time-picker.tsx index 3e344f7db..6e082a225 100644 --- a/packages/mui-component-mapper/src/time-picker/time-picker.js +++ b/packages/mui-component-mapper/src/time-picker/time-picker.tsx @@ -1,12 +1,25 @@ import React from 'react'; import { TimePicker as MUITimePicker } from '@mui/x-date-pickers'; +import type { TimePickerProps as MUITimePickerProps } from '@mui/x-date-pickers'; +import { TextField } from '@mui/material'; +import type { TextFieldProps } from '@mui/material'; +import { useFieldApi } from '@data-driven-forms/react-form-renderer'; +import type { BaseFieldProps } from '@data-driven-forms/react-form-renderer'; import FormFieldGrid from '../form-field-grid/form-field-grid'; +import type { FormFieldGridProps } from '../form-field-grid/form-field-grid'; import { validationError } from '../validation-error/validation-error'; -import { useFieldApi } from '@data-driven-forms/react-form-renderer'; -import { TextField } from '@mui/material'; +import type { ExtendedFieldMeta } from '../validation-error/validation-error'; + +export interface TimePickerProps extends BaseFieldProps { + placeholder?: string; + FormFieldGridProps?: FormFieldGridProps; + TimePickerProps?: Omit, 'value' | 'onChange' | 'disabled' | 'readOnly'>; + MuiPickersUtilsProviderProps?: any; // Legacy prop for backward compatibility + [key: string]: any; +} -const TimePicker = (props) => { +const TimePicker: React.FC = (props) => { const { input, isReadOnly, @@ -20,9 +33,11 @@ const TimePicker = (props) => { meta, MuiPickersUtilsProviderProps, FormFieldGridProps = {}, + TimePickerProps = {}, ...rest } = useFieldApi(props); - const invalid = validationError(meta, validateOnMount); + + const invalid = validationError(meta as ExtendedFieldMeta, validateOnMount); return ( @@ -38,7 +53,7 @@ const TimePicker = (props) => { error: !!invalid, onBlur: input.onBlur, onFocus: input.onFocus, - }, + } as TextFieldProps, }} // legacy version renderInput={(props) => ( @@ -57,6 +72,7 @@ const TimePicker = (props) => { disabled={isDisabled || isReadOnly} {...input} value={input.value || null} + {...TimePickerProps} {...rest} /> diff --git a/packages/mui-component-mapper/src/validation-error/index.js b/packages/mui-component-mapper/src/validation-error/index.js deleted file mode 100644 index a04644952..000000000 --- a/packages/mui-component-mapper/src/validation-error/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './validation-error'; -export * from './validation-error'; diff --git a/packages/mui-component-mapper/src/validation-error/index.d.ts b/packages/mui-component-mapper/src/validation-error/index.ts similarity index 100% rename from packages/mui-component-mapper/src/validation-error/index.d.ts rename to packages/mui-component-mapper/src/validation-error/index.ts diff --git a/packages/mui-component-mapper/src/validation-error/validation-error.d.ts b/packages/mui-component-mapper/src/validation-error/validation-error.d.ts deleted file mode 100644 index acb784add..000000000 --- a/packages/mui-component-mapper/src/validation-error/validation-error.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Meta } from "@data-driven-forms/react-form-renderer"; - -export function validationError(meta: Meta, validateOnMount?: boolean): boolean | any | undefined; - -export default validationError; diff --git a/packages/mui-component-mapper/src/validation-error/validation-error.js b/packages/mui-component-mapper/src/validation-error/validation-error.js deleted file mode 100644 index 960853499..000000000 --- a/packages/mui-component-mapper/src/validation-error/validation-error.js +++ /dev/null @@ -1,9 +0,0 @@ -export const validationError = (meta, validateOnMount) => { - if (validateOnMount) { - return meta.error || meta.submitError; - } - - return meta.touched && (meta.error || meta.submitError); -}; - -export default validationError; diff --git a/packages/mui-component-mapper/src/validation-error/validation-error.ts b/packages/mui-component-mapper/src/validation-error/validation-error.ts new file mode 100644 index 000000000..e30a6931b --- /dev/null +++ b/packages/mui-component-mapper/src/validation-error/validation-error.ts @@ -0,0 +1,15 @@ +import type { FieldMetaState } from 'react-final-form'; + +export interface ExtendedFieldMeta extends FieldMetaState, Record { + warning?: any; +} + +export const validationError = (meta: ExtendedFieldMeta, validateOnMount?: boolean): string | undefined => { + if (validateOnMount) { + return meta.error || meta.submitError; + } + + return meta.touched && (meta.error || meta.submitError); +}; + +export default validationError; diff --git a/packages/mui-component-mapper/src/wizard/index.js b/packages/mui-component-mapper/src/wizard/index.js deleted file mode 100644 index 06ceeafc1..000000000 --- a/packages/mui-component-mapper/src/wizard/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { default } from './wizard'; -export * from './wizard'; diff --git a/packages/mui-component-mapper/src/wizard/index.d.ts b/packages/mui-component-mapper/src/wizard/index.ts similarity index 100% rename from packages/mui-component-mapper/src/wizard/index.d.ts rename to packages/mui-component-mapper/src/wizard/index.ts diff --git a/packages/mui-component-mapper/src/wizard/step-buttons.js b/packages/mui-component-mapper/src/wizard/step-buttons.tsx similarity index 61% rename from packages/mui-component-mapper/src/wizard/step-buttons.js rename to packages/mui-component-mapper/src/wizard/step-buttons.tsx index e201dd1a5..c69984998 100644 --- a/packages/mui-component-mapper/src/wizard/step-buttons.js +++ b/packages/mui-component-mapper/src/wizard/step-buttons.tsx @@ -2,9 +2,11 @@ import React from 'react'; import { styled } from '@mui/material/styles'; import clsx from 'clsx'; -import selectNext from '@data-driven-forms/common/wizard/select-next'; +import { selectNext } from '@data-driven-forms/common'; import { FormSpy } from '@data-driven-forms/react-form-renderer'; +import type { AnyObject, FormOptions } from '@data-driven-forms/react-form-renderer'; import { Button, Grid } from '@mui/material'; +import type { GridProps } from '@mui/material'; const PREFIX = 'WizardStepButtons'; @@ -35,9 +37,37 @@ const StyledGrid = styled(Grid)(() => ({ }, })); -const NextButton = ({ nextStep, valid, handleNext, nextLabel, getState, handleSubmit, submitLabel, conditionalSubmitFlag }) => { +interface FormState { + values: AnyObject; + valid: boolean; + validating: boolean; + submitting: boolean; +} + +interface NextButtonProps { + nextStep?: any; + valid: boolean; + handleNext: (nextStep?: any) => void; + nextLabel: string; + getState: () => FormState; + handleSubmit: () => void; + submitLabel: string; + conditionalSubmitFlag?: any; +} + +const NextButton: React.FC = ({ + nextStep, + valid, + handleNext, + nextLabel, + getState, + handleSubmit, + submitLabel, + conditionalSubmitFlag, +}) => { const nextResult = nextStep ? selectNext(nextStep, getState) : nextStep; const progressNext = nextResult !== conditionalSubmitFlag && nextStep; + return ( + - ({ }, })); -const WizardNav = ({ StepperProps = {}, stepsInfo, activeStepIndex }) => ( +interface StepInfo { + title?: string; + label?: string; + StepLabelProps?: StepLabelProps; + StepProps?: StepProps; +} + +interface WizardNavProps { + StepperProps?: StepperProps; + stepsInfo: StepInfo[]; + activeStepIndex: number; +} + +const WizardNav: React.FC = ({ StepperProps = {}, stepsInfo, activeStepIndex }) => ( - {stepsInfo.map(({ title, label, StepLabelProps, StepProps }, idx) => ( + {stepsInfo.map(({ title, label, StepLabelProps = {}, StepProps = {} }, idx) => ( {title || label} diff --git a/packages/mui-component-mapper/src/wizard/wizard.d.ts b/packages/mui-component-mapper/src/wizard/wizard.d.ts deleted file mode 100644 index 98af000c4..000000000 --- a/packages/mui-component-mapper/src/wizard/wizard.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ReactNode } from "react"; -import { StepLabelProps, StepProps, GridProps, StepperProps } from "@mui/material"; - -export interface WizardButtonLabels { - next?: ReactNode; - submit?: ReactNode; - cancel?: ReactNode; - back?: ReactNode; -} - -export interface WizardStepInfo { - title?: ReactNode; - label?: ReactNode; - StepLabelProps?: StepLabelProps; - StepProps?: StepProps; -} - -export interface WizardProps { - buttonLabels?: WizardButtonLabels; - stepsInfo?: WizardStepInfo[]; - ButtonContainerProps?: GridProps; - StepperProps?: StepperProps; - WizardBodyProps?: GridProps; - WizardProps?: GridProps; -} - -declare const Wizard: React.ComponentType; -export default Wizard; diff --git a/packages/mui-component-mapper/src/wizard/wizard.js b/packages/mui-component-mapper/src/wizard/wizard.tsx similarity index 61% rename from packages/mui-component-mapper/src/wizard/wizard.js rename to packages/mui-component-mapper/src/wizard/wizard.tsx index fab6f988b..29e7d4b6d 100644 --- a/packages/mui-component-mapper/src/wizard/wizard.js +++ b/packages/mui-component-mapper/src/wizard/wizard.tsx @@ -5,8 +5,10 @@ import clsx from 'clsx'; import { WizardContext } from '@data-driven-forms/react-form-renderer'; import { Grid } from '@mui/material'; +import type { GridProps, StepperProps } from '@mui/material'; -import Wizard from '@data-driven-forms/common/wizard'; +import { Wizard } from '@data-driven-forms/common'; +import type { WizardProps as CommonWizardProps } from '@data-driven-forms/common'; import WizardNav from './wizard-nav'; import WizardStepButtons from './step-buttons'; @@ -23,8 +25,31 @@ const StyledWizard = styled(Grid)(() => ({ }, })); -const WizardInternal = ({ - buttonLabels, +interface StepInfo { + title?: string; + label?: string; + [key: string]: any; +} + +interface ButtonLabels { + next?: string; + submit?: string; + cancel?: string; + back?: string; +} + +interface WizardInternalProps { + buttonLabels?: ButtonLabels; + stepsInfo?: StepInfo[]; + ButtonContainerProps?: GridProps; + StepperProps?: StepperProps; + WizardBodyProps?: GridProps; + WizardProps?: GridProps; + conditionalSubmitFlag?: any; +} + +const WizardInternal: React.FC = ({ + buttonLabels = {}, stepsInfo, ButtonContainerProps, StepperProps, @@ -46,13 +71,13 @@ const WizardInternal = ({ {stepsInfo && } - {currentStep.fields.map((item) => formOptions.renderForm([item], formOptions))} + {currentStep.fields.map((item: any) => formOptions.renderForm([item]))} handleNext(nextStep)} + handlePrev={() => handlePrev()} disableBack={prevSteps.length === 0} conditionalSubmitFlag={conditionalSubmitFlag} ButtonContainerProps={ButtonContainerProps} @@ -62,6 +87,6 @@ const WizardInternal = ({ ); }; -const MuiWizard = (props) => ; +const MuiWizard: React.FC = (props) => ; export default MuiWizard; diff --git a/packages/mui-component-mapper/tsconfig.cjs.json b/packages/mui-component-mapper/tsconfig.cjs.json new file mode 100644 index 000000000..cdff53ee6 --- /dev/null +++ b/packages/mui-component-mapper/tsconfig.cjs.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./", + "module": "commonjs", + "target": "es5" + } +} \ No newline at end of file diff --git a/packages/mui-component-mapper/tsconfig.demo.json b/packages/mui-component-mapper/tsconfig.demo.json new file mode 100644 index 000000000..f37217b80 --- /dev/null +++ b/packages/mui-component-mapper/tsconfig.demo.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "sourceMap": true, + "module": "esnext", + "moduleResolution": "node", + "target": "es5", + "lib": ["es6", "dom"], + "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, + "noErrorTruncation": true, + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "strict": false, + "noEmit": false, + "isolatedModules": false, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitThis": false, + "rootDir": "." + }, + "include": [ + "./demo/**/*", + "./src/**/*" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/mui-component-mapper/tsconfig.esm.json b/packages/mui-component-mapper/tsconfig.esm.json new file mode 100644 index 000000000..bcc35146f --- /dev/null +++ b/packages/mui-component-mapper/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./esm", + "module": "es2015", + "target": "es2015" + } +} \ No newline at end of file diff --git a/packages/mui-component-mapper/tsconfig.json b/packages/mui-component-mapper/tsconfig.json index da332a59e..0b336591f 100644 --- a/packages/mui-component-mapper/tsconfig.json +++ b/packages/mui-component-mapper/tsconfig.json @@ -1,17 +1,25 @@ { "compilerOptions": { "sourceMap": true, - "module": "es6", + "module": "esnext", "moduleResolution": "node", "target": "es5", - "lib": ["es2020", "dom"], - "jsx": "preserve", + "lib": ["es6", "dom"], + "jsx": "react-jsx", "allowSyntheticDefaultImports": true, "noErrorTruncation": true, - "allowJs": true, - "strict": true, - "noEmit": true + "allowJs": false, + "strict": false, + "declaration": true, + "emitDeclarationOnly": false, + "outDir": "./dist", + "rootDir": "./src", + "skipLibCheck": true, + "esModuleInterop": true, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitThis": false, }, - "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"], - "exclude": ["./dist"] -} \ No newline at end of file + "include": ["./src/**/*.ts", "./src/**/*.tsx"], + "exclude": ["./dist", "./src/tests/**/*", "./node_modules", "../*/node_modules", "../../node_modules"] +} diff --git a/packages/pf4-component-mapper/.eslintrc.json b/packages/pf4-component-mapper/.eslintrc.json new file mode 100644 index 000000000..011e6035b --- /dev/null +++ b/packages/pf4-component-mapper/.eslintrc.json @@ -0,0 +1,27 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["**/*.html", "**/*.css", "**/*.scss"], + "overrides": [ + { + "files": ["**/*.ts", "**/*.tsx"], + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true + }, + "project": ["packages/pf4-component-mapper/tsconfig.json", "packages/pf4-component-mapper/tsconfig.demo.json"] + }, + "rules": { + "@typescript-eslint/no-unused-vars": "error", + "no-unused-vars": "off", + "@typescript-eslint/no-use-before-define": ["error", { "functions": false }], + "no-use-before-define": "off", + "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], + "react/prop-types": "off", + "react/no-unused-prop-types": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/pf4-component-mapper/.gitignore b/packages/pf4-component-mapper/.gitignore index f38734f9b..48e084c4c 100644 --- a/packages/pf4-component-mapper/.gitignore +++ b/packages/pf4-component-mapper/.gitignore @@ -100,5 +100,6 @@ vendor !firebaseFunctions.js !scripts/ !dynamic-import-transform.ts +!.eslintrc.json .DS_STORE diff --git a/packages/pf4-component-mapper/demo/index.tsx b/packages/pf4-component-mapper/demo/index.tsx index 9102346bf..10cfee9d5 100644 --- a/packages/pf4-component-mapper/demo/index.tsx +++ b/packages/pf4-component-mapper/demo/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React from 'react'; import { createRoot } from 'react-dom/client'; import { FormRenderer, WizardContext } from '@data-driven-forms/react-form-renderer'; import { arraySchemaDDF } from './demo-schemas/widget-schema'; @@ -14,7 +14,7 @@ import { EmptyStateFooter, EmptyStateActions, Progress, - Bullseye + Bullseye, } from '@patternfly/react-core'; import { CogsIcon } from '@patternfly/react-icons'; import { @@ -39,7 +39,7 @@ const ProgressStepContent = () => { const tick = React.useCallback(() => { if (percentValidated < 100) { - setPercentValidated(prevValue => prevValue + 20); + setPercentValidated((prevValue) => prevValue + 20); } }, [percentValidated]); @@ -60,8 +60,7 @@ const ProgressStepContent = () => { - Description can be used to further elaborate on the validation step, or give the user a better idea of how - long the process will take. + Description can be used to further elaborate on the validation step, or give the user a better idea of how long the process will take. @@ -221,44 +220,4 @@ class App extends React.Component<{}, AppState> { const container = document.getElementById('root'); const root = createRoot(container!); - -const NEW_OPTIONS = [{ label: 'Different label', value: 2 }]; -const asyncLoadingNew = () => Promise.resolve(NEW_OPTIONS); - -function SelectApp() { - const onChange = (value: any) => { - console.log('Selected:', value); - } - const initialProps = { - onChange, - name: 'test-select', - id: 'select', - options: [ - { - label: 'First option', - value: 1, - }, - { - label: 'Second option', - value: 2, - }, - ], - }; - const asyncLoading = () => Promise.resolve([{ label: 'labelxxx', value: '123' }]); - - const [al, setAl] = useState(() => asyncLoading); - return ( -