# SiFormContainerComponent documentation

**Kind:** component

**Selector:** `si-form-container`

```
import { SiFormContainerComponent } from '@siemens/element-ng/form';
```

Deprecated: This component should no longer be used.

When providing a form wide error mapper, use the [provideFormValidationErrorMapper](<../../types/provideFormValidationErrorMapper/index.html#t:provideFormValidationErrorMapper>).

```ts
import { provideFormValidationErrorMapper } form '@siemens/element-ng/forms'

@Component({
  template: `<form>...</form>`
  providers: [provideFormValidationErrorMapper({
    'name.required': 'CUSTOM_REQUIRED_ERROR'
  })]
})
class MyFormComponent {}
```

When using the column layout, use the `form-col-layout` classes.

```html
<!-- Responsive column layout -->
<form class="responsive-form-col-layout">...</form>
<!-- Always column layout -->
<form class="form-col-layout">...</form>
```

For a custom breakpoint use the SCSS mixin:

```scss
@use '@siemens/element-theme/src/styles/bootstrap/mixins/form-layout';

// Custom responsive breakpoint
.custom-form-col-layout {
  // Above 400px the column layout is used
  @include form-layout.responsive-form-col-layout(400px);
}
```

```
component SiFormContainerComponent<TControl extends { [K in keyof TControl]: AbstractControl }>
```

#### Input Properties

<table><thead><tr><th>Name</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr id="SiFormContainerComponent.contentContainerBreakpoints"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.contentContainerBreakpoints" id="t:SiFormContainerComponent.contentContainerBreakpoints"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L96-L96">contentContainerBreakpoints</a></td> <td class="api-column-type"><code><a href="index.html#t:Breakpoints">Breakpoints</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>The container hosts the form within a siResizeContainer to configure the breakpoint for different screen sizes. Optionally, change the container breakpoints with the contentContainerBreakpoints input.</p></td></tr><tr id="SiFormContainerComponent.controlNameTranslateKeyMap"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.controlNameTranslateKeyMap" id="t:SiFormContainerComponent.controlNameTranslateKeyMap"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L128-L128">controlNameTranslateKeyMap</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a>&lt;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt;</code></td> <td class="api-column-default"><code>new Map&lt;string, string&gt;()</code></td><td class="api-column-description"><p>A map the maps from control names of the form to their translate keys. The initial map is empty and the user is responsible to add the required translate keys.</p></td></tr><tr id="SiFormContainerComponent.disableContainerBreakpoints"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.disableContainerBreakpoints" id="t:SiFormContainerComponent.disableContainerBreakpoints"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L105-L105">disableContainerBreakpoints</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>In some scenarios, one may not want the form container to be responsible for the layout relevant <code>si-container-[xs|...]</code> classes, but let this be done by a different, nested component, e.g. by a group box. In these cases, the property should be set to true.</p></td></tr><tr id="SiFormContainerComponent.disableErrorPrinting"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.disableErrorPrinting" id="t:SiFormContainerComponent.disableErrorPrinting"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L135-L135">disableErrorPrinting</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>Disables the automatic error printing in all nested <a href="../SiFormItemComponent/index.html#SiFormItemComponent">SiFormItemComponent</a>. Error printing will be enabled by default in v46.</p></td></tr><tr id="SiFormContainerComponent.errorCodeTranslateKeyMap"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.errorCodeTranslateKeyMap" id="t:SiFormContainerComponent.errorCodeTranslateKeyMap"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L114-L116">errorCodeTranslateKeyMap</a></td> <td class="api-column-type"><code><a href="index.html#t:SiFormValidationErrorMapper">SiFormValidationErrorMapper</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map">Map</a>&lt;<a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>&gt; | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>Every validation error has an errorCode. This map holds translate keys for error codes. The keys can be used to display a translated message for each validation error. The defaults old english readable key defaults for the Angular standard validators of the <code>Validators</code> class like <code>min</code>, <code>max</code> or <code>required</code>.</p><p>Use the input to set your own translate keys for the form validators you need.</p></td></tr><tr id="SiFormContainerComponent.form"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.form" id="t:SiFormContainerComponent.form"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L80-L80">form</a></td> <td class="api-column-type"><code><a href="https://angular.dev/api/forms/FormGroup">FormGroup</a>&lt;TControl&gt; | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>Set the form entity to the container to enable the overall form validation on in the form container edit panel.</p></td></tr><tr id="SiFormContainerComponent.labelWidth"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.labelWidth" id="t:SiFormContainerComponent.labelWidth"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L142-L142">labelWidth</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>A custom width value to be applied to all labels.</p><p>Example:</p><pre><code>labelWidth=&quot;100px&quot;.</code></pre></td></tr><tr id="SiFormContainerComponent.readonly"> <td class="api-column-name"><span data-api-type-target-for="SiFormContainerComponent.readonly" id="t:SiFormContainerComponent.readonly"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L89-L89">readonly</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>A form container in readonly mode is only displaying the form content without ability to change it. The edit panel with typically save and cancel buttons is hidden. Set to true to display the edit panel.</p></td></tr></tbody></table>

#### Attributes and Methods

##### invalidFormContainerMessage

[Source for invalidFormContainerMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L191-L193>)

**Modifiers:** readonly

**Type:** `boolean`

Indicates whether the content editor message shall be styled as warning.

Returns: `true`, if [SiFormContainerComponent.userInteractedWithForm](<index.html#SiFormContainerComponent.userInteractedWithForm>) is true and the form is invalid.

##### userInteractedWithForm

[Source for userInteractedWithForm](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L172-L175>)

**Modifiers:** readonly

**Type:** `boolean`

Indicates whether the user interacted with the form.

Returns: `true`, if the user selected at least one form element and \[blurred\][https://developer.mozilla.org/en-US/docs/Web/API/Element/blur\_event](<https://developer.mozilla.org/en-US/docs/Web/API/Element/blur_event>) by losing focus again (e.g. by setting focus on another element), or by editing the content of a form element. Otherwise `false`.

##### validFormContainerMessage

[Source for validFormContainerMessage](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-container/si-form-container.component.ts#L182-L184>)

**Modifiers:** readonly

**Type:** `boolean`

Indicates whether content editor message shall be styled as success.

Returns: `true`, if [SiFormContainerComponent.userInteractedWithForm](<index.html#SiFormContainerComponent.userInteractedWithForm>) is true and the form is valid.

### Types Documentation

### [Breakpoints](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L10-L16>)

**Kind:** interface

```
import type { Breakpoints } from '@siemens/element-ng/resize-observer';
```

```
interface Breakpoints
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [lgMinimum](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L13-L13>) | `number` |  |
| [mdMinimum](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L12-L12>) | `number` |  |
| [smMinimum](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L11-L11>) | `number` |  |
| [xlMinimum](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L14-L14>) | `number` |  |
| [xxlMinimum](<https://github.com/siemens/element/blob/main/projects/element-ng/resize-observer/si-responsive-container.directive.ts#L15-L15>) | `number` |  |

### [SiFormValidationErrorMapper](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L12-L31>)

**Kind:** interface

```
import type { SiFormValidationErrorMapper } from '@siemens/element-ng/form';
```

Interface for form error mapper. It resolves a key to either a translatable string or function which is called with the validation error for its key and should return a translatable string.

```
interface SiFormValidationErrorMapper
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [dateFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L26-L26>) (optional) | `TranslatableString \| ((error: { format: string; }) => TranslatableString)` |  |
| [email](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L15-L15>) (optional) | `TranslatableString \| ((error: { email: boolean; }) => TranslatableString)` |  |
| [max](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L17-L17>) (optional) | `TranslatableString \| ((error: { max: number; actual: number; }) => TranslatableString)` |  |
| [maxDate](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L27-L27>) (optional) | `TranslatableString \| ((error: { max: Date; actual: Date; }) => TranslatableString)` |  |
| [maxLength](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L21-L23>) (optional) | `TranslatableString \| ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)` |  |
| [min](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L16-L16>) (optional) | `TranslatableString \| ((error: { min: number; actual: number; }) => TranslatableString)` |  |
| [minDate](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L28-L28>) (optional) | `TranslatableString \| ((error: { min: Date; actual: Date; }) => TranslatableString)` |  |
| [minLength](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L18-L20>) (optional) | `TranslatableString \| ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)` |  |
| [numberFormat](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L25-L25>) (optional) | `TranslatableString \| ((error: { numberFormat: boolean; }) => TranslatableString)` |  |
| [pattern](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L24-L24>) (optional) | `TranslatableString \| ((error: { pattern: string \| RegExp; }) => TranslatableString)` |  |
| [required](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L13-L13>) (optional) | `TranslatableString \| ((error: { required: boolean; }) => TranslatableString)` |  |
| [requiredTrue](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L14-L14>) (optional) | `TranslatableString \| ((error: { required: boolean; }) => TranslatableString)` |  |

#### Index Signatures

| Name | Type | Description |
| --- | --- | --- |
| [\[key: string\]](<https://github.com/siemens/element/blob/main/projects/element-ng/form/si-form-validation-error.model.ts#L30-L30>) | `string \| ((error: any) => string) \| undefined` |  |

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
