Skip to content
Snippets Groups Projects
mixins.rst 2.2 KiB
Newer Older
Alice Poggioli's avatar
Alice Poggioli committed
Features
#########
We call "mixins" features for SIB components. Basicly they provide attribute to it.

Alice Poggioli's avatar
Alice Poggioli committed
.. warning::

   The section is a work in progress. It will be soon updated.

Alice Poggioli's avatar
Alice Poggioli committed
List
=====

    [Description]

    Attributes available:
    --------------------

Alice Poggioli's avatar
Alice Poggioli committed
        .. csv-table::  
Alice Poggioli's avatar
Alice Poggioli committed
            :header: "Name", "Expected", "Default", "Description"
Alice Poggioli's avatar
Alice Poggioli committed

Alice Poggioli's avatar
Alice Poggioli committed
            `order-by`, "test", "test", "test" 
            `counter`, "test", "test ", "test"
            `else`, "test", "test", "test"
Alice Poggioli's avatar
Alice Poggioli committed

Alice Poggioli's avatar
Alice Poggioli committed

    Used in components:
    -------------------

        * link to `Sib-Display <SiB-Display>`__
        * link to `Sib-Form <SiB-Form>`__

Store
=====

    [Description]

    Attributes available:
    --------------------

Alice Poggioli's avatar
Alice Poggioli committed
        .. csv-table::  
            :header: "Name", "Expected", "Default", "Description"

Alice Poggioli's avatar
Alice Poggioli committed
            `nested-field`, "test", "test", "test" 
Alice Poggioli's avatar
Alice Poggioli committed
            `counter`, "test", "test ", "test"
            `else`, "test", "test", "test"

Alice Poggioli's avatar
Alice Poggioli committed


    Used in components:
    -------------------

        * link to `Sib-Display <SiB-Display>`__
        * link to `Sib-Form <SiB-Form>`__

Events
######

    Some event are available on specific wiget. You'll find corresponding events for your components in its documentation.

Alice Poggioli's avatar
Alice Poggioli committed
        .. csv-table::  
            :header: "Event name ", "Parameters", "Fired by", "Fired when"

Alice Poggioli's avatar
Alice Poggioli committed
            `resourceSelect`, `{detail:{resource}}`, `sib-display` | `sib-calendar` | `sib-map`, "The user clicks an child in the list, with the resource as a detail of the event."
            `populate`, `{detail:{resource}}`,`sib-display` | `sib-form` | `sib-calendar` | `sib-map`, "The component got and displayed all its datas."
Alice Poggioli's avatar
Alice Poggioli committed
            `save`, `{detail:{resource}}`, `sib-form`, The form has saved successfully.
Alice Poggioli's avatar
Alice Poggioli committed


    Examples
    ========

    Populate
    --------
    Use to do something if and when the element is generated.

    .. code:: js

        element.addEventListener("populate", event => {
            // Do something when the element is generated.
        })


    Save
    ----
    Use to do something when a form is successfully saved.

    .. code:: js

        form.addEventListener("save", event => {
        // Do something when the form has been successfully saved. 
        });