From 2279a7be07769d69e46165a39c9e775282bec511 Mon Sep 17 00:00:00 2001
From: Manon Bourgognon <manon.bourgognon@epitech.eu>
Date: Wed, 16 Dec 2020 15:15:20 +0100
Subject: [PATCH] start-value-[field], end-value-[field] attributes

---
 .../Components/Solid-Form-Search.rst          | 23 +++++++++++++++----
 .../Widgets/Reference.rst                     |  6 +++--
 .../import_documentation/attributes-list.rst  |  8 +++++++
 3 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/source/import_documentation/Components/Solid-Form-Search.rst b/source/import_documentation/Components/Solid-Form-Search.rst
index 5fdeac0..ca871b7 100644
--- a/source/import_documentation/Components/Solid-Form-Search.rst
+++ b/source/import_documentation/Components/Solid-Form-Search.rst
@@ -37,26 +37,26 @@ Attributes
    List of fields used to perform the search.
 
 ``label-[field]``
-~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~
    When displaying a form, the default labels are the fields names of the model.
    If you want something fancier, you can set this attribute.
    i.e. ``label-username="Your name"``
 
 ``submit-button``
-~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~
    *Available from version 0.13*
 
    Text of the submit button to create in the search form. If the attribute is not defined,
    no button will be added and the form will trigger the search on change.
 
 ``range-[field]``
-~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~
    URL of a container which list the accepted values
    for the field ``[field]``. It’s particularly useful with a dropdown
    field.
 
 ``enum-[field]``
-~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~
    *Available from version 0.13*
 
    List of values of your choice for the field ``[field]``. 
@@ -70,6 +70,21 @@ Attributes
       * ``enum-[field]="value1 = a, value2 = b, value3 = c"``: each value will be displayed 
       and "a", "b", "c" will be loaded in value attribute.
 
+``start-value-[field]``
+~~~~~~~~~~~~~~~~~~~~~~~
+   *Available from version 0.15*
+
+   Allows to define the value of the first ``<input>`` to filter data.
+   Only usable with ``solid-form-rangedate`` and ``solid-form-rangenumber``.
+   In ``solid-form-rangedate``, start-value can be defined to ``today``.
+
+``end-value-[field]``
+~~~~~~~~~~~~~~~~~~~~~
+   *Available from version 0.15*
+
+   Allows to define the value of the second ``<input>`` to filter data.
+   Only usable with ``solid-form-rangedate`` and ``solid-form-rangenumber``.
+
 Widgets
 -------
 By default, the widget used is ``<solid-form-label-text>``. Cf the
diff --git a/source/import_documentation/Widgets/Reference.rst b/source/import_documentation/Widgets/Reference.rst
index 604314c..d9c89aa 100644
--- a/source/import_documentation/Widgets/Reference.rst
+++ b/source/import_documentation/Widgets/Reference.rst
@@ -40,9 +40,11 @@ A widget is built like this.
       -  ``richtext``: set ``value`` in an ``<div>`` and initialize a light rich text editor by using ``Quill``.
       -  ``checkbox``: create a checkbox, which is checked if ``value == true``.
       -  ``date``: set ``value`` in an ``<input>`` of type ``date``.
-      -  ``rangedate``: set 2 values in 2 ``<input>`` of type ``date``. Used for filtering with min and max.
+      -  ``rangedate``: set 2 values in 2 ``<input>`` of type ``date``. Used for filtering with min and max. 
+         Possible to add ``start-value-[field]`` and ``end-value-[field]`` attributes to set min and max values. Date format to follow : "YYYY-MM-DD". Possible to set the start-value to ``today``.
       -  ``number``: set ``value`` in an ``<input>`` of type ``number``.
-      -  ``rangenumber``: set 2 values in 2 ``<input>`` of type ``number``. Used for filtering with min and max.
+      -  ``rangenumber``: set 2 values in 2 ``<input>`` of type ``number``. Used for filtering with min and max. 
+         Possible to add ``start-value-[field]`` and ``end-value-[field]`` attributes to set min and max values.
       -  ``hidden``: set ``value`` in an ``<input>`` of type ``hidden``.
       -  ``dropdown``: set ``value`` in a ``<select>``. The list is provided via the ``range`` attribute, which expects a container’s URL, or via the ``enum`` attribute, which takes a list of the values separated by commas.
       -  ``radio``: set ``value`` in a list of radio buttons. The list is provided via the ``range`` attribute, which expects a container’s URL, or via the ``enum`` attribute, which takes a list of the values separated by commas.
diff --git a/source/import_documentation/attributes-list.rst b/source/import_documentation/attributes-list.rst
index 9cc0c99..7c9e6c8 100644
--- a/source/import_documentation/attributes-list.rst
+++ b/source/import_documentation/attributes-list.rst
@@ -51,6 +51,10 @@ List of attributes (core framework)
 ~~~~~~~~~~~~~~~~
    * :ref:`list-mixin <list-mixin>`
 
+``end-value-[field]``
+~~~~~~~~~~~~~~~~~~~~~
+   * :ref:`solid-form-search <solid-form-search>`
+
 ``enum-[field]``
 ~~~~~~~~~~~~~~~~
    * :ref:`solid-form <solid-form>`
@@ -183,6 +187,10 @@ List of attributes (core framework)
 ~~~~~~~~~~~~~~~~~~~~
    * :ref:`required-mixin <required-mixin>`
 
+``start-value-[field]``
+~~~~~~~~~~~~~~~~~~~~~~~
+   * :ref:`solid-form-search <solid-form-search>`
+
 ``(search-fields)`` deprecated
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    * :ref:`filter-mixin <filter-mixin>`
-- 
GitLab