{% import "_includes/forms" as forms %}

{{ forms.textField({
  label: 'Min {type}'|t('app', {
    type: 'Addresses'|t('app'),
  }),
  instructions: 'The minimum number of {type} the field is allowed to have.'|t('app', {
    type: 'addresses'|t('app'),
  }),
  id: 'min-addresses',
  name: 'minAddresses',
  value: field.minAddresses,
  size: 3,
  errors: field.getErrors('minAddresses'),
  data: {'error-key': 'minAddresses'},
  disabled: readOnly,
}) }}

{{ forms.textField({
  label: 'Max {type}'|t('app', {
    type: 'Addresses'|t('app'),
  }),
  instructions: 'The maximum number of {type} the field is allowed to have.'|t('app', {
    type: 'addresses'|t('app'),
  }),
  id: 'max-addresses',
  name: 'maxAddresses',
  value: field.maxAddresses,
  size: 3,
  errors: field.getErrors('maxAddresses'),
  data: {'error-key': 'maxAddresses'},
  disabled: readOnly,
}) }}

{{ forms.selectField({
  label: 'View Mode'|t('app'),
  instructions: 'Choose how nested {type} should be presented to authors.'|t('app', {
    type: 'addresses'|t('app'),
  }),
  id: 'view-mode',
  name: 'viewMode',
  options: [
    {label: 'As cards'|t('app'), value: constant('VIEW_MODE_CARDS', field)},
    {label: 'As an element index'|t('app'), value: constant('VIEW_MODE_INDEX', field)},
  ],
  value: field.viewMode,
  disabled: readOnly,
}) }}
