diff --git a/source/import_documentation/Components/SiB-Form-Search.rst b/source/import_documentation/Components/SiB-Form-Search.rst new file mode 100644 index 0000000000000000000000000000000000000000..f5b510e6f82fe6d2b4908208db6f181a83c535c1 --- /dev/null +++ b/source/import_documentation/Components/SiB-Form-Search.rst @@ -0,0 +1,60 @@ +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 + id="my-filter" + fields="email" + label-email="search by email" + ></solid-form-search> + + <solid-display + data-src="http://example.com/users" + fields="username, last_name, email" + filtered-by="my-filter" + ></solid-display> + + +Mixins +------ + +This component uses the following mixins: + +- `widget-mixin <https://docs.startinblox.com/import_documentation/Mixins/widget-mixin.html>`__ + +Please check their documentation to know more about their capabilities. + +Attributes +---------- + +``fields`` +~~~~~~~~~~ + List of fields used to perform the search. + +``label-xyz`` +~~~~~~~~~~~~~ + 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"`` + +``range-xyz`` +~~~~~~~~~~~~~ + URL of a container which list the accepted values + for the field ``xyz``. It’s particularly useful with a dropdown + field. + +Widgets +------- +By default, the widget used is ``<solid-form-label-text>``. Cf the +`Widget Form <https://docs.startinblox.com/import_documentation/Widgets/form-widgets.html>`__ page for more info. + + +Events +------- + +``formChange`` +~~~~~~~~~~~~~~ + Triggered when the form values change diff --git a/source/import_documentation/Mixins/filter-mixin.rst b/source/import_documentation/Mixins/filter-mixin.rst index d86047145813e33a8ab462b1ced4b7c8899774be..1c2b984c59d48c6b9676080a3aa6297edc712d1f 100644 --- a/source/import_documentation/Mixins/filter-mixin.rst +++ b/source/import_documentation/Mixins/filter-mixin.rst @@ -14,8 +14,34 @@ Used by: Attributes ---------- -``search-fields`` +``filtered-by`` ~~~~~~~~~~~~~~~ + + Target a `<sib-form-search>` used to filter current list of resource. + + example: + + .. code:: html + + <solid-form-search + id="my-filter" + fields="email" + label-email="search by email" + ></solid-form-search> + + <solid-display + data-src="http://example.com/users" + fields="username, last_name, email" + filtered-by="my-filter" + ></solid-display> + + + +``search-fields`` **deprecated** +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + + The properties you want to use to filter the list of resources. You can add multiple fields, separated by a comma.