Add `TTextAutoCompleteFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sat, 19 Dec 2020 12:15:15 +0000 (13:15 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 17:51:23 +0000 (18:51 +0100)
wcfsetup/install/files/lib/system/form/builder/field/TTextAutoCompleteFormField.class.php [new file with mode: 0644]

diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TTextAutoCompleteFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TTextAutoCompleteFormField.class.php
new file mode 100644 (file)
index 0000000..e712986
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Provides default implementations of `IAutoCompleteFormField` methods for text fields.
+ *
+ * @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
+ * @since       5.4
+ */
+trait TTextAutoCompleteFormField {
+       use TAutoCompleteFormField;
+       
+       /**
+        * @inerhitDoc
+        */
+       protected function getValidAutoCompleteTokens(): array {
+               return [
+                       'name',
+                               'honorific-prefix',
+                               'given-name',
+                               'additional-name',
+                               'family-name',
+                               'honorific-suffix',
+                       'nickname',
+                       'organization-title',
+                       'organization',
+                       'address-line1',
+                       'address-line2',
+                       'address-line3',
+                       'address-level4',
+                       'address-level3',
+                       'address-level3',
+                       'address-level2',
+                       'address-level1',
+                       'country',
+                       'country-name',
+                       'postal-code',
+                       'cc-name',
+                               'cc-given-name',
+                               'cc-additional-name',
+                               'cc-family-name',
+                               'cc-number',
+                       'cc-csc',
+                       'cc-type',
+                       'transaction-currency',
+                       'language',
+                       'sex',
+                       'tel-country-code',
+                       'tel-national',
+                               'tel-area-code',
+                               'tel-local',
+                                       'tel-local-prefix',
+                                       'tel-local-suffix',
+                       'tel-extension',
+               ];
+       }
+}