diff --git a/example/demo_survey/src/survey/widgets/home.tsx b/example/demo_survey/src/survey/widgets/home.tsx index 97d2438b..e93d48c8 100644 --- a/example/demo_survey/src/survey/widgets/home.tsx +++ b/example/demo_survey/src/survey/widgets/home.tsx @@ -444,6 +444,7 @@ export const homePostalCode = { inputType: "string", path: "home.postalCode", datatype: "string", + textTransform: "uppercase", twoColumns: true, label: { fr: "Code postal", diff --git a/packages/evolution-common/src/services/widgets/WidgetConfig.ts b/packages/evolution-common/src/services/widgets/WidgetConfig.ts index bc816ae2..14125269 100644 --- a/packages/evolution-common/src/services/widgets/WidgetConfig.ts +++ b/packages/evolution-common/src/services/widgets/WidgetConfig.ts @@ -37,6 +37,7 @@ export type InputStringType = { diff --git a/packages/evolution-frontend/src/components/inputs/InputString.tsx b/packages/evolution-frontend/src/components/inputs/InputString.tsx index 59e72069..5d47ac22 100644 --- a/packages/evolution-frontend/src/components/inputs/InputString.tsx +++ b/packages/evolution-frontend/src/components/inputs/InputString.tsx @@ -47,6 +47,7 @@ export const InputString = { datatype: 'string' as const, maxLength: 20, defaultValue: 'test', + textTransform: 'lowercase' as const, containsHtml: true, label: { fr: `Texte en français`, @@ -194,4 +195,4 @@ test('Test update value through props', () => { updateKey: 1 }); expect(inputElement.getDOMNode().value).toBe(updateByServerVal); -}); \ No newline at end of file +}); diff --git a/packages/evolution-frontend/src/components/inputs/__tests__/__snapshots__/InputString.test.tsx.snap b/packages/evolution-frontend/src/components/inputs/__tests__/__snapshots__/InputString.test.tsx.snap index 9f830ed7..6c7e80bd 100644 --- a/packages/evolution-frontend/src/components/inputs/__tests__/__snapshots__/InputString.test.tsx.snap +++ b/packages/evolution-frontend/src/components/inputs/__tests__/__snapshots__/InputString.test.tsx.snap @@ -8,6 +8,11 @@ exports[`Should correctly render InputString with a value of 0 1`] = ` maxLength={255} name="test" onChange={[Function]} + style={ + Object { + "textTransform": "none", + } + } type="text" value={0} /> @@ -22,6 +27,11 @@ exports[`Should correctly render InputString with all parameters 1`] = ` name="test" onBlur={[Function]} onChange={[Function]} + style={ + Object { + "textTransform": "lowercase", + } + } type="text" value="test" /> @@ -35,6 +45,11 @@ exports[`Should correctly render InputString with base parameters 1`] = ` maxLength={255} name="test" onChange={[Function]} + style={ + Object { + "textTransform": "none", + } + } type="text" value="value" /> @@ -49,6 +64,11 @@ exports[`Should correctly render InputString with default value as function 1`] name="test" onBlur={[Function]} onChange={[Function]} + style={ + Object { + "textTransform": "none", + } + } type="text" value="fctDefault" />