
| Current Path : /var/www/html/c12park/web/modules/contrib/webform/src/Plugin/WebformElement/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/web/modules/contrib/webform/src/Plugin/WebformElement/Number.php |
<?php
namespace Drupal\webform\Plugin\WebformElement;
/**
* Provides a 'number' element.
*
* @WebformElement(
* id = "number",
* api = "https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Number.php/class/Number",
* label = @Translation("Number"),
* description = @Translation("Provides a form element for numeric input, with special numeric validation."),
* category = @Translation("Advanced elements"),
* )
*/
class Number extends NumericBase {
/**
* {@inheritdoc}
*/
protected function defineDefaultProperties() {
return [
// Number settings.
'min' => NULL,
'max' => NULL,
'step' => NULL,
] + parent::defineDefaultProperties()
+ $this->defineDefaultMultipleProperties();
}
/* ************************************************************************ */
/**
* {@inheritdoc}
*/
public function preview() {
return parent::preview() + [
'#min' => 0,
'#max' => 10,
'#step' => 1,
];
}
}