From f96b0ee8881432f01f92911cb038d99332b98e79 Mon Sep 17 00:00:00 2001
From: Manon Bourgognon <manon.bourgognon@epitech.eu>
Date: Thu, 1 Oct 2020 14:37:14 +0200
Subject: [PATCH] attribute enum added

---
 .../Components/Solid-Form-Search.rst                | 13 +++++++++++++
 .../import_documentation/Components/Solid-Form.rst  | 12 ++++++++++++
 source/import_documentation/Widgets/Reference.rst   |  6 +++---
 source/index.rst                                    |  1 +
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/source/import_documentation/Components/Solid-Form-Search.rst b/source/import_documentation/Components/Solid-Form-Search.rst
index 4f0ffac..6c9aa55 100644
--- a/source/import_documentation/Components/Solid-Form-Search.rst
+++ b/source/import_documentation/Components/Solid-Form-Search.rst
@@ -4,6 +4,7 @@ solid-form-search
 
 Allows you to filter the contents of a component that uses the ``filter-mixin`` such as ``solid-display`` or ``solid-map``.
 This must have a ``filtered-by`` attribute set to the id of the current ``solid-form-search``.
+
 .. code:: html
 
    <solid-form-search
@@ -47,6 +48,18 @@ Attributes
    for the field ``xyz``. It’s particularly useful with a dropdown
    field.
 
+``enum-xyz``
+~~~~~~~~~~~~~
+   List of values of your choice for the field ``xyz``. 
+   They have to be filled manually and must be separated by commas. 
+   It’s particularly useful with a dropdown or radio field.
+
+   Two formats are possible:
+      * ``enum-xyz="value1, value2, value3"`` : each value will be displayed 
+      and loaded in value attribute
+      * ``enum-xyz="value1 = a, value2 = b, value3 = c"``: each value will be displayed 
+      and "a", "b", "c" will be loaded in value attribute.
+
 Widgets
 -------
 By default, the widget used is ``<solid-form-label-text>``. Cf the
diff --git a/source/import_documentation/Components/Solid-Form.rst b/source/import_documentation/Components/Solid-Form.rst
index d04f7ad..160be47 100644
--- a/source/import_documentation/Components/Solid-Form.rst
+++ b/source/import_documentation/Components/Solid-Form.rst
@@ -52,6 +52,18 @@ Attributes
    for the field ``xyz``. It’s particularly useful with a dropdown
    field.
 
+``enum-xyz``
+~~~~~~~~~~~~~
+   List of values of your choice for the field ``xyz``. 
+   They have to be filled manually and must be separated by commas. 
+   It’s particularly useful with a dropdown or radio field.
+
+   Two formats are possible:
+      * ``enum-xyz="value1, value2, value3"`` : each value will be displayed 
+      and loaded in value attribute
+      * ``enum-xyz="value1 = a, value2 = b, value3 = c"``: each value will be displayed 
+      and "a", "b", "c" will be loaded in value attribute.
+
 ``order-asc-xyz`` or ``order-desc-xyz``
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Name of the field used to order the range list ``xyz``.
diff --git a/source/import_documentation/Widgets/Reference.rst b/source/import_documentation/Widgets/Reference.rst
index a402e39..38c91a6 100644
--- a/source/import_documentation/Widgets/Reference.rst
+++ b/source/import_documentation/Widgets/Reference.rst
@@ -1,5 +1,5 @@
 Widgets API Reference
-==================
+======================
 
 Widgets are created at the moment you ask for it for the first time.
 The name of the widget is analyzed to build a widget which uses the features and template you want.
@@ -43,8 +43,8 @@ A widget is built like this.
       -  ``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.
       -  ``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.
-      -  ``radio``: set ``value`` in a list of radio buttons. The list is provided via the ``range`` attribute, which expects a container’s URL.
+      -  ``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.
       -  ``multiple``: Accept a container URI as a ``value``, and inserts one widget per resource with a “remove” button for each widget, and an “add” button.
       -  ``multipleselect``: Accept a container URI as a ``value``, and inserts a dropdown widget with the ``multiple`` attribute.
       -  ``file``: Inserts an ``<input/>`` and an ``<input type="file"/>``.
diff --git a/source/index.rst b/source/index.rst
index 1a38802..0beec3b 100644
--- a/source/index.rst
+++ b/source/index.rst
@@ -27,6 +27,7 @@ Welcome to Startinblox's documentation
 
    import_documentation/Components/Solid-Display
    import_documentation/Components/Solid-Form
+   import_documentation/Components/Solid-Form-Search
    import_documentation/Components/Solid-Delete
    import_documentation/Components/Solid-Calendar
    import_documentation/Components/Solid-Map
-- 
GitLab