Add `IInputModeFormField`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:16:46 +0000 (19:16 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 18:16:46 +0000 (19:16 +0100)
wcfsetup/install/files/lib/system/form/builder/field/IInputModeFormField.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IInputModeFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IInputModeFormField.class.php
new file mode 100644 (file)
index 0000000..f9c5005
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Represents a form field that supports the `inputmode` attribute.
+ *
+ * @author      Matthias Schmidt
+ * @copyright   2001-2020 WoltLab GmbH
+ * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package     WoltLabSuite\Core\System\Form\Builder\Field
+ * @see         https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute
+ * @since       5.4
+ */
+interface IInputModeFormField {
+       /**
+        * Returns the `inputmode` attribute of the form field.
+        *
+        * If `null` is returned, no `inputmode` attribute will be set.
+        */
+       public function getInputMode(): ?string;
+       
+       /**
+        * Sets the `inputmode` attribute of the form field.
+        *
+        * If `null` is given, the attribute is unset.
+        *
+        * @throws      \InvalidArgumentException       if an invalid `inputmode` token is included in the attribute value
+        */
+       public function inputMode(?string $inputMode): self;
+}