From e0c542cc778932eef39f349d1c0bec3bce48e360 Mon Sep 17 00:00:00 2001 From: Nikita Hovratov Date: Wed, 6 Apr 2022 20:10:59 +0200 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20Feature:=20#97193=20-=20New=20TCA?= =?UTF-8?q?=20type=20=E2=80=9Cnumber=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-97193-NewTCATypeNumber.html refs https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/issues/1624 --- .../Type/Link/Properties/ValuePicker.rst | 4 +- .../ColumnsConfig/Type/Number/Index.rst | 8 +- .../Type/Number/Properties/Autocomplete.rst | 8 +- .../Type/Number/Properties/Eval.rst | 4 - .../Type/Number/Properties/Format.rst | 4 + .../Type/Number/Properties/Index.rst | 5 -- .../Type/Number/Properties/Range.rst | 22 +++--- .../Type/Number/Properties/Size.rst | 2 +- .../Type/Number/Properties/Slider.rst | 75 ++++++++++--------- .../Type/Number/Properties/ValuePicker.rst | 12 +-- 10 files changed, 70 insertions(+), 74 deletions(-) diff --git a/Documentation/ColumnsConfig/Type/Link/Properties/ValuePicker.rst b/Documentation/ColumnsConfig/Type/Link/Properties/ValuePicker.rst index e27787af..3c758e05 100644 --- a/Documentation/ColumnsConfig/Type/Link/Properties/ValuePicker.rst +++ b/Documentation/ColumnsConfig/Type/Link/Properties/ValuePicker.rst @@ -38,8 +38,8 @@ Example 'mode' => 'prepend' 'valuePicker' => [ 'items' => [ - ['https://', 'HTTPS'], - ['http://', 'HTTP'], + ['HTTPS', 'https://'], + ['HTTP', 'http://'], ], ], ], diff --git a/Documentation/ColumnsConfig/Type/Number/Index.rst b/Documentation/ColumnsConfig/Type/Number/Index.rst index 43ad7589..b8c5e22d 100644 --- a/Documentation/ColumnsConfig/Type/Number/Index.rst +++ b/Documentation/ColumnsConfig/Type/Number/Index.rst @@ -36,7 +36,7 @@ is done like following: // Before - 'int_field => [ + 'int_field' => [ 'label' => 'Int field', 'config' => [ 'type' => 'input', @@ -46,7 +46,7 @@ is done like following: // After - 'int_field => [ + 'int_field' => [ 'label' => 'Int field', 'config' => [ 'type' => 'number', @@ -63,7 +63,7 @@ is done like following: // Before - 'double2_field => [ + 'double2_field' => [ 'label' => 'double2 field', 'config' => [ 'type' => 'input', @@ -73,7 +73,7 @@ is done like following: // After - 'double2_field => [ + 'double2_field' => [ 'label' => 'double2 field', 'config' => [ 'type' => 'number', diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Autocomplete.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Autocomplete.rst index 6a814995..93469158 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Autocomplete.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Autocomplete.rst @@ -11,14 +11,14 @@ autocomplete :type: boolean :Scope: Display - Controls the `autocomplete` attribute of a given email field. If set to true (default false), - adds attribute :php:`autocomplete="on"` to the email input field allowing browser auto filling the field: + Controls the `autocomplete` attribute of a given number field. If set to true (default false), + adds attribute :php:`autocomplete="on"` to the number input field allowing browser auto filling the field: .. code-block:: php :emphasize-lines: 7 - 'email' => [ - 'label' => 'number', + 'integer_field' => [ + 'label' => 'Integer field', 'config' => [ 'type' => 'number', 'size' => 20, diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Eval.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Eval.rst index 08f2e2a8..bc873238 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Eval.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Eval.rst @@ -13,10 +13,6 @@ eval Configuration of field evaluation. - Some of these evaluation keywords will trigger a JavaScript pre- evaluation - in the form. Other evaluations will be performed in the backend. The - evaluation functions will be executed in the list-order. - Keywords: null diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Format.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Format.rst index 86adc3e5..ae234b73 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Format.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Format.rst @@ -12,3 +12,7 @@ format :Scope: Display Keywords: :php:`integer`, :php:`decimal` + + The format property defines, which type of number should be handled. The + :php:`integer` format is a simple number, whereas the :php:`decimal` format + is a float value with two decimal places. diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Index.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Index.rst index d9ea733e..87325890 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Index.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Index.rst @@ -31,8 +31,3 @@ Common properties * :ref:`placeholder ` * :ref:`readOnly ` * :ref:`required ` - -.. note:: - - The softref definition :php:`softref=>email[subst]` is automatically applied - to all :php:`email` fields. diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Range.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Range.rst index 9ea033ec..165f68cb 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Range.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Range.rst @@ -5,7 +5,7 @@ range ===== -.. confval:: range +.. confval:: range ('type' => 'number') :Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] :type: array @@ -29,13 +29,13 @@ Limit an integer to be within the range 10 to 1000 .. code-block:: php - 'aField' => [ - 'label' => 'aLabel', - 'config' => [ - 'type' => 'number' - 'range' => [ - 'lower' => 10, - 'upper' => 1000 - ], - ], - ], + 'aField' => [ + 'label' => 'aLabel', + 'config' => [ + 'type' => 'number', + 'range' => [ + 'lower' => 10, + 'upper' => 1000 + ], + ], + ], diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Size.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Size.rst index 4e70e33a..56452fb9 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Size.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Size.rst @@ -11,6 +11,6 @@ size :type: integer :Scope: Display - Abstract value for the width of the :code:`` field. To set the email + Abstract value for the width of the :code:`` field. To set the number field to the full width of the form area, use the value 50. Minimum is 10. Default is 30. diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/Slider.rst b/Documentation/ColumnsConfig/Type/Number/Properties/Slider.rst index accfb963..6a878d53 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/Slider.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/Slider.rst @@ -1,11 +1,12 @@ .. include:: /Includes.rst.txt +.. _columns-input-properties-slider: .. _columns-number-properties-slider: ====== slider ====== -.. confval:: slider ('type' => 'number') +.. confval:: slider :Path: $GLOBALS['TCA'][$table]['columns'][$field]['config'] :type: array @@ -31,51 +32,51 @@ Integer slider between 0 and 100 .. code-block:: php - 'aField' => [ - 'label' => 'percent', - 'config' => [ - 'type' => 'number' - 'range' => [ - 'lower' => 0, - 'upper' => 100 - ], - 'slider' => [ - 'step' => 1 - ] - ], - ], + 'aField' => [ + 'label' => 'percent', + 'config' => [ + 'type' => 'number', + 'range' => [ + 'lower' => 0, + 'upper' => 100 + ], + 'slider' => [ + 'step' => 1 + ] + ], + ], Integer slider between 0 and 10 000 ----------------------------------- .. code-block:: php - 'aField' => [ - 'label' => 'percent', - 'config' => [ - 'type' => 'number' - 'slider' => [ - 'step' => 1 - ] - ], - ], + 'aField' => [ + 'label' => 'percent', + 'config' => [ + 'type' => 'number', + 'slider' => [ + 'step' => 1 + ] + ], + ], Decimal slider between 0 and 1 ------------------------------ .. code-block:: php - 'aField' => [ - 'label' => 'aLabel', - 'config' => [ - 'type' => 'number' - 'format' => 'decimal' - 'range' => [ - 'lower' => 0, - 'upper' => 1 - ], - 'slider' => [ - 'step' => 0.1 - ] - ], - ], + 'aField' => [ + 'label' => 'aLabel', + 'config' => [ + 'type' => 'number', + 'format' => 'decimal', + 'range' => [ + 'lower' => 0, + 'upper' => 1 + ], + 'slider' => [ + 'step' => 0.1 + ] + ], + ], diff --git a/Documentation/ColumnsConfig/Type/Number/Properties/ValuePicker.rst b/Documentation/ColumnsConfig/Type/Number/Properties/ValuePicker.rst index 6eb49e1c..37e49abb 100644 --- a/Documentation/ColumnsConfig/Type/Number/Properties/ValuePicker.rst +++ b/Documentation/ColumnsConfig/Type/Number/Properties/ValuePicker.rst @@ -31,15 +31,15 @@ Example .. code-block:: php - 'input_33' => [ - 'label' => 'input_33', + 'number_field' => [ + 'label' => 'Number field', 'config' => [ - 'type' => 'link', - 'mode' => 'prepend' + 'type' => 'number', + 'mode' => '' 'valuePicker' => [ 'items' => [ - ['https://', 'HTTPS'], - ['http://', 'HTTP'], + ['One', '1'], + ['Two', '2'], ], ], ],