diff --git a/source/_static/images/import_documentation/framework-basic-use/bind-resources.png b/source/_static/images/import_documentation/framework-basic-use/bind-resources.png new file mode 100644 index 0000000000000000000000000000000000000000..b475225c24b1b7a426ecc4d4e0b4e891a14731e6 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/bind-resources.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/data-filtered.png b/source/_static/images/import_documentation/framework-basic-use/data-filtered.png new file mode 100644 index 0000000000000000000000000000000000000000..d831d49eb19e30b81e6cb73f2261ee487c6a3dec Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/data-filtered.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/default-(widget)-field.png b/source/_static/images/import_documentation/framework-basic-use/default-(widget)-field.png new file mode 100644 index 0000000000000000000000000000000000000000..35f3517f2aa7cabbf2066aa8762f38336d0df238 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/default-(widget)-field.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/default-field-data.png b/source/_static/images/import_documentation/framework-basic-use/default-field-data.png new file mode 100644 index 0000000000000000000000000000000000000000..fd79beb0950364bd46d1aa13bda2d9d0ed37248c Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/default-field-data.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/default-widget.png b/source/_static/images/import_documentation/framework-basic-use/default-widget.png new file mode 100644 index 0000000000000000000000000000000000000000..bf19b85f9ac42c830345a667ecb9a7675727f4f1 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/default-widget.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/display-data.png b/source/_static/images/import_documentation/framework-basic-use/display-data.png new file mode 100644 index 0000000000000000000000000000000000000000..e407491a4681bde33bccac4db347476a13a2c332 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/display-data.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/empty-set-data.png b/source/_static/images/import_documentation/framework-basic-use/empty-set-data.png new file mode 100644 index 0000000000000000000000000000000000000000..14bf874cc82dd871036f4aa5eef9f2a7d5c3ce1c Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/empty-set-data.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/empty-set.png b/source/_static/images/import_documentation/framework-basic-use/empty-set.png new file mode 100644 index 0000000000000000000000000000000000000000..6a60995ae4288d76ee94b19e4805962549cba6b6 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/empty-set.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/empty-widget-data.png b/source/_static/images/import_documentation/framework-basic-use/empty-widget-data.png new file mode 100644 index 0000000000000000000000000000000000000000..baab6b16f99039faa6454ed863522a749ef951be Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/empty-widget-data.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/empty-widget.png b/source/_static/images/import_documentation/framework-basic-use/empty-widget.png new file mode 100644 index 0000000000000000000000000000000000000000..837dbcb94fbf54b7458c9907d0629e4bb1fa53f4 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/empty-widget.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/jsonld-container.png b/source/_static/images/import_documentation/framework-basic-use/jsonld-container.png new file mode 100644 index 0000000000000000000000000000000000000000..00daee00ee270f61053f33cf321561d66d8d327b Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/jsonld-container.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/jsonld-nested-data-list.png b/source/_static/images/import_documentation/framework-basic-use/jsonld-nested-data-list.png new file mode 100644 index 0000000000000000000000000000000000000000..da39cf61ab987825f4beacb7daaa6131056238f8 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/jsonld-nested-data-list.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/jsonld-resource.png b/source/_static/images/import_documentation/framework-basic-use/jsonld-resource.png new file mode 100644 index 0000000000000000000000000000000000000000..e9d51f5a57e9851e1bfca7feaef332002d16c24f Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/jsonld-resource.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/jsonld-solid-table.png b/source/_static/images/import_documentation/framework-basic-use/jsonld-solid-table.png new file mode 100644 index 0000000000000000000000000000000000000000..eac476978b3af9383133243e23357f806625b723 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/jsonld-solid-table.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/nested-data-list.png b/source/_static/images/import_documentation/framework-basic-use/nested-data-list.png new file mode 100644 index 0000000000000000000000000000000000000000..db19de99cc3beef6ae97d3af5e9ff06ab5b09fa2 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/nested-data-list.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/nested-data.png b/source/_static/images/import_documentation/framework-basic-use/nested-data.png new file mode 100644 index 0000000000000000000000000000000000000000..2a390f1bbd85d4e75cbbe636efb1e40927912c49 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/nested-data.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/solid-form-addable.png b/source/_static/images/import_documentation/framework-basic-use/solid-form-addable.png new file mode 100644 index 0000000000000000000000000000000000000000..90c7ce578cb94b336573eca51a8fd3f12a534dc5 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/solid-form-addable.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/solid-form-nested.png b/source/_static/images/import_documentation/framework-basic-use/solid-form-nested.png new file mode 100644 index 0000000000000000000000000000000000000000..a49deadebe662be31ca97f49d9ae00213d0c929e Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/solid-form-nested.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/solid-form-search.png b/source/_static/images/import_documentation/framework-basic-use/solid-form-search.png new file mode 100644 index 0000000000000000000000000000000000000000..569b79af3f3d29f93135f2659752f92a7473d830 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/solid-form-search.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/solid-form.png b/source/_static/images/import_documentation/framework-basic-use/solid-form.png new file mode 100644 index 0000000000000000000000000000000000000000..3ccb765cbb17a5f9337d6c6ae3de6eb7fc6741d0 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/solid-form.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/solid-table.png b/source/_static/images/import_documentation/framework-basic-use/solid-table.png new file mode 100644 index 0000000000000000000000000000000000000000..c4d0a45d35742bb52150c415eed9274e4c99ddcb Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/solid-table.png differ diff --git a/source/_static/images/import_documentation/framework-basic-use/store-use.png b/source/_static/images/import_documentation/framework-basic-use/store-use.png new file mode 100644 index 0000000000000000000000000000000000000000..4fd02dc800f442603305237fa29a309d50aa7f98 Binary files /dev/null and b/source/_static/images/import_documentation/framework-basic-use/store-use.png differ diff --git a/source/import_documentation/Components/Solid-Ac-Checker2.rst b/source/import_documentation/Components/Solid-Ac-Checker2.rst deleted file mode 100644 index e557c754c5896d30548e9793a6929019c8a1baba..0000000000000000000000000000000000000000 --- a/source/import_documentation/Components/Solid-Ac-Checker2.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. _solid-ac-checker: -solid-ac-checker -================ - -Hides an element from the page if the current user doesn’t have the -required permissions on it. - -.. code:: html - - <solid-ac-checker permission="acl:Write" bind-resources> - <solid-route name="member-edit"> - <div>Edit</div> - </solid-route> - </solid-ac-checker> - -Mixins ------- - -This component uses the following mixins: - * :ref:`store-mixin <store-mixin>` - -Please check their documentation to know more about their capabilities. - -Personnal attributes --------------------- - -``permission`` -~~~~~~~~~~~~~~ - Displays the element if the user has the specified right - -``no-permission`` -~~~~~~~~~~~~~~~~~ - Displays the element if the user has not the specified right - -Possible values: - -- `acl:Read <https://github.com/solid/web-access-control-spec#aclread>`__ -- `acl:Write <https://github.com/solid/web-access-control-spec#aclwrite>`__ -- `acl:Append <https://github.com/solid/web-access-control-spec#aclappend>`__ -- `acl:Control <https://github.com/solid/web-access-control-spec#aclcontrol>`__ - - -Mixin attributes ------------------ - -From store-mixin -~~~~~~~~~~~~~~~~ - -.. include:: ../Mixins/store-mixin.rst - :start-line: 21 - :end-line: 122 diff --git a/source/import_documentation/Components/Solid-Router.rst b/source/import_documentation/Components/Solid-Router.rst index b2ceb0a28d66b88aaed6847d111d3173e955c3d5..9ee395169b31c8f5221add5c898837071f290002 100644 --- a/source/import_documentation/Components/Solid-Router.rst +++ b/source/import_documentation/Components/Solid-Router.rst @@ -85,7 +85,7 @@ solid-link - ``data-src``: The resource you want to use in your view. Often used to show more details about this resource, by adding the - ``bind-resource`` attribute to a component (more details about ``bind-resources`` below). + ``bind-resources`` attribute to a component (more details about ``bind-resources`` below). Example: diff --git a/source/import_documentation/Mixins/store-mixin.rst b/source/import_documentation/Mixins/store-mixin.rst index a3ba70b5a4f4ce389770ec141795eb82b7f20707..348b98082b5cb9597fecb19bdbd5a97a5d24b3e6 100644 --- a/source/import_documentation/Mixins/store-mixin.rst +++ b/source/import_documentation/Mixins/store-mixin.rst @@ -115,8 +115,9 @@ Attributes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *Available from version 0.13* - This mixin decode all attribute values starting by ``store://resource`` or - ``store://user`` and replace them by the values fetched from the store. + This mixin decode all attribute values starting by ``store://resource``, + ``store://container`` or ``store://user`` and replace them by the values fetched + from the store. It can be a value fetched from the current resource or the current logged in user (works with ``sib-auth``). diff --git a/source/import_documentation/framework_guide/attributes-list.rst b/source/import_documentation/framework_guide/attributes-list.rst index 734ea3c9db0ef949504ec5dea0502e00fc469df2..70d02b79443efc20cde2ef0d96a6fce55e881695 100644 --- a/source/import_documentation/framework_guide/attributes-list.rst +++ b/source/import_documentation/framework_guide/attributes-list.rst @@ -9,6 +9,10 @@ Attributes are specific to base components or they depend on mixins (they can be ~~~~~~~~~~~~~~~~~~ * :ref:`widget-mixin <action-field>` +``addable-[field]`` +~~~~~~~~~~~~~~~~~~ + * :ref:`widget API reference <reference>` + ``alt-[field]`` ~~~~~~~~~~~~~~~ * :ref:`widget-mixin <alt-field>` @@ -75,9 +79,14 @@ Attributes are specific to base components or they depend on mixins (they can be ~~~~~~~~~~~~~~~~~~~~ * :ref:`counter-mixin <counter-mixin>` +``data-holder`` +~~~~~~~~~~~~~~~ + * :ref:`solid-widget <solid-widget>` + ``data-src`` ~~~~~~~~~~~~ * :ref:`store-mixin <data-src>` + * :ref:`solid-widget <solid-widget>` ``data-label`` ~~~~~~~~~~~~~~ diff --git a/source/import_documentation/framework_guide/attributes-list2.rst b/source/import_documentation/framework_guide/attributes-list2.rst deleted file mode 100644 index c6a3c57169c3a1726b57d207a0e80d2d1fcd5bbe..0000000000000000000000000000000000000000 --- a/source/import_documentation/framework_guide/attributes-list2.rst +++ /dev/null @@ -1,331 +0,0 @@ -List of attributes (core framework) -=================================== - -Below are listed all the attributes of the core framework. -They allow to add, to specify functionalities for base components. -Attributes are specific to base components or they depend on mixins (they can be used by several components). - -``action-[field]`` -~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <action-[field]>` - * :ref:`widget-mixin:action-[field]` - * :ref:`action-field` - * :ref:`action-[field]` - -``alt-[field]`` -~~~~~~~~~~~~~~~ - * :ref:`widget-mixin<alt-field>` - * :ref:`widget-mixin:alt-field` - * :ref:`alt-field` - -``autocomplete-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <autocomplete-field-sf>` - * :ref:`solid-form-search <autocomplete-field-sfs>` - * :ref:`Solid-Form-Search:autocomplete-[field]` - * :ref:`solid-form <Solid-Form-Search:autocomplete-[field]>` - -``auto-range-[field]`` -~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form-search <auto-range-field>` - -``autosave`` -~~~~~~~~~~~~ - * :ref:`solid-form <autosave>` - -``child-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-display <solid-display>` - -``class-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <class-field>` - -``class-submit-button`` -~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <class-submit-button-sf>` - * :ref:`solid-form-search <class-submit-button-sfs>` - -``clustering`` -~~~~~~~~~~~~~~ - * :ref:`solid-map <solid-map>` - -``confirmation-cancel-text`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-cancel-text>` - -``confirmation-cancel-class`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-cancel-class>` - -``confirmation-message`` -~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-message>` - -``confirmation-type`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-type>` - -``confirmation-submit-class`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-submit-class>` - -``confirmation-submit-text`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-submit-text>` - -``confirmation-widget`` -~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`validation-mixin <confirmation-widget>` - -``counter-template`` -~~~~~~~~~~~~~~~~~~~~ - * :ref:`counter-mixin <counter-mixin>` - -``data-src`` -~~~~~~~~~~~~ - * :ref:`store-mixin <data-src>` - -``data-label`` -~~~~~~~~~~~~~~ - * :ref:`solid-delete <solid-delete>` - * :ref:`solid-lang <solid-lang>` - -``default-[field]`` -~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <default-field>` - -``default-widget`` -~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <default-widget>` - -``default-widget-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <default-widget-field>` - -``editable-[field]`` -~~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <editable-field-wm>` - * :ref:`solid-table <solid-table>` - -``empty-[set]`` -~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <empty-set>` - -``empty-[set]-value`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <empty-set-value>` - -``empty-value`` -~~~~~~~~~~~~~~~ - * :ref:`list-mixin <list-mixin>` - -``empty-widget`` -~~~~~~~~~~~~~~~~ - * :ref:`list-mixin <list-mixin>` - -``end-value-[field]`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form-search <end-value-field>` - -``enum-[field]`` -~~~~~~~~~~~~~~~~ - * :ref:`solid-form <enum-field-sf>` - * :ref:`solid-form-search <enum-field-sfs>` - -``extra-context`` -~~~~~~~~~~~~~~~~~ - * :ref:`store-mixin <extra-context>` - -``fields`` -~~~~~~~~~~ - * :ref:`widget-mixin <fields>` - -``filtered-by`` -~~~~~~~~~~~~~~~ - * :ref:`filter-mixin <filter-mixin>` - -``group-by`` -~~~~~~~~~~~~ - * :ref:`grouper-mixin <grouper-mixin>` - -``group-widget`` -~~~~~~~~~~~~~~~~ - * :ref:`grouper-mixin <grouper-mixin>` - -``group-class`` -~~~~~~~~~~~~~~~ - * :ref:`grouper-mixin <grouper-mixin>` - -``header`` -~~~~~~~~~~ - * :ref:`solid-table <solid-table>` - -``hightlight-[field]`` -~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`highlighter-mixin <highlighter-mixin>` - -``label-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <label-field-sf>` - * :ref:`solid-form-search <label-field-sfs>` - * :ref:`widget-mixin <label-field-wm>` - -``lang`` -~~~~~~~~ - * :ref:`solid-lang <solid-lang>` - -``loader-id`` -~~~~~~~~~~~~~ - * :ref:`store-mixin <loader-id>` - -``max-[field]`` -~~~~~~~~~~~~~~~ - * :ref:`solid-form <max-field>` - -``maxlength-[field]`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <maxlength-field>` - -``min-[field]`` -~~~~~~~~~~~~~~~ - * :ref:`solid-form <min-field>` - -``minlength-[field]`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <minlength-field>` - -``multiple-[field]`` -~~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <multiple-field>` - -``naked`` -~~~~~~~~~ - * :ref:`solid-form <naked>` - -``name`` -~~~~~~~~~ - * :ref:`solid-widget <solid-widget>` - -``nested-field`` -~~~~~~~~~~~~~~~~ - * :ref:`store-mixin <nested-field>` - -``next`` -~~~~~~~~ - * :ref:`next-mixin <next-mixin>` - -``no-permission`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-ac-checker <solid-ac-checker>` - -``no-render`` -~~~~~~~~~~~~~ - * :ref:`store-mixin <no-render>` - -``order-asc`` -~~~~~~~~~~~~~ - * :ref:`sorter-mixin <sorter-mixin>` - -``order-asc-[field]`` -~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <order-asc-field>` - -``order-by-random`` -~~~~~~~~~~~~~~~~~~~ - * :ref:`sorter-mixin <sorter-mixin>` - -``order-desc`` -~~~~~~~~~~~~~~ - * :ref:`sorter-mixin <sorter-mixin>` - -``order-desc-[field]`` -~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <order-desc-field>` - -``paginate-by`` -~~~~~~~~~~~~~~~ - * :ref:`paginate-mixin <paginate-mixin>` - -``paginate-loop`` -~~~~~~~~~~~~~~~~~ - * :ref:`paginate-mixin <paginate-mixin>` - -``partial`` -~~~~~~~~~~~ - * :ref:`solid-form <partial>` - -``pattern-[field]`` -~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <pattern-field>` - -``permission`` -~~~~~~~~~~~~~~ - * :ref:`solid-ac-checker <solid-ac-checker>` - -``placeholder-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <placeholder-field>` - -``range-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <range-field-sf>` - * :ref:`solid-form-search <range-field-sfs>` - -``required-[field]`` -~~~~~~~~~~~~~~~~~~~~ - * :ref:`required-mixin <required-mixin>` - * :ref:`solid-form <solid-form>` - -``selectable`` -~~~~~~~~~~~~~~ - * :ref:`solid-table <solid-table>` - -``sorted-by`` -~~~~~~~~~~~~~~~ - * :ref:`sorter-mixin <sorter-mixin>` - -``start-value-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form-search <start-value-field>` - -``step-[field]`` -~~~~~~~~~~~~~~~~ - * :ref:`solid-form <step-field>` - -``(search-fields)`` deprecated -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`filter-mixin <filter-mixin>` - -``search-placeholder-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form-search <search-placeholder-field>` - -``search-text-[field]`` -~~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form-search <search-text-field>` - -``src-[field]`` -~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <src-field>` - -``submit-button`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <submit-button-sf>` - * :ref:`solid-form-search <submit-button-sfs>` - -``title-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <title-field>` - -``upload-url-[field]`` -~~~~~~~~~~~~~~~~~~~~~~ - * :ref:`solid-form <upload-url-field>` - -``value-[field]`` -~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <value-field>` - -``widget-[field]`` -~~~~~~~~~~~~~~~~~~ - * :ref:`widget-mixin <widget-field>` diff --git a/source/import_documentation/framework_guide/how-to-use-SIB.rst b/source/import_documentation/framework_guide/how-to-use-SIB.rst new file mode 100644 index 0000000000000000000000000000000000000000..43cf6cbd1268b3f17b3fb6680f5e401b1dd5b9b6 --- /dev/null +++ b/source/import_documentation/framework_guide/how-to-use-SIB.rst @@ -0,0 +1,475 @@ +.. _framework-guide-frequent-questions: + +Examples of Startin'blox use cases +================================== + +This page contains frequently asked questions about the use of the framework, +with a link to the appropriate page or the presentation of an example with the html code and the rendering. + +How to display data +------------------- + +The :ref:`podcast tutorial <podcast-tutorial>` illustrates with details how to display data. + +To present it really simply, a ``solid-display`` component with a ``data-src`` attribute whose value is jsonld file with dataset to work on (the ``fields`` attribute precise the fields to display): + +.. code-block:: html + + <solid-display + data-src="data/documentation/users.jsonld" + fields="first_name, last_name" + ></solid-display> + <solid-display + data-src="data/documentation/user-1.jsonld" + fields="first_name, last_name" + ></solid-display> + +The first solid-display displays data for a **container** (several resources), the second from a **resource**. + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/display-data.png + :alt: 2 examples of solid-display use + +Here is the jsonld data structure used for the example (container and resource): + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/jsonld-container.png + :alt: Example of jsonld data container + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/jsonld-resource.png + :alt: Example of jsonld data resource + + +How to display nested data +-------------------------- + +Nested data is a data linked to another but not stored in the same place. +They are related by a "call" from the first data to the stored place of the second one. + +Startin'blox proposes 2 ways to display it: + * **period** syntax + * ``nested-field`` attribute + +.. code-block:: html + + <solid-display + data-src="data/documentation/user-1.jsonld" + fields="profile.address, profile.birthdate" + widget-profile.address="solid-display-div-multiline" + widget-profile.birthdate="solid-display-div-date" + ></solid-display> + + <solid-display + data-src="data/documentation/user-1.jsonld" + nested-field="profile" + fields="address, birthdate" + widget-address="solid-display-div-multiline" + widget-birthdate="solid-display-div-date" + ></solid-display> + +The widgets are used to specify how data is displayed. Their use is detailed in :ref:`widgets API <reference>` and :ref:`examples <widgets-examples>` of use are presented. + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/nested-data.png + :alt: nested-data + + +How to create a form +-------------------- + +To create a form, indicate in ``data-src`` attribute the data model to which it corresponds. If the data model is a **resource**, the form will be used to edit data. If it's a **container**, the form will create a new resource. + +The solid-form component is automatically linked to the data, it takes care of adding or editing them. + +Then, add attributes and widgets to change label values, precise inputs type, etc. + +.. code-block:: html + + <solid-form + data-src="data/documentation/user-1.jsonld" + fields="first_name, last_name, email" + + label-first_name="First name:" + label-last_name="Last name:" + label-email="Email:" + ></solid-form> + + <solid-form + data-src="data/documentation/concerts.jsonld" + fields="date, artist, start_time, end_time, scene, gauge" + + label-date="Date:" + label-artist="Artist:" + label-start_time="Start time:" + label-end_time="End time:" + label-scene="Scene:" + label-gauge="Gauge:" + + widget-date="solid-form-date-label" + widget-start_time="solid-form-time-label" + widget-end_time="solid-form-time-label" + widget-gauge="solid-form-number-label" + ></solid-form> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/solid-form.png + :alt: Example of solid-form use + +Example with addable feature +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The feature ``addable`` adds a solid-form to add a value to a field. Here, hobbies is concerned: + +.. code-block:: html + + <solid-form + class="form" + data-src="data/documentation/users.jsonld" + fields="first_name, last_name, hobbies" + + label-first_name="First name:" + label-last_name="Last name:" + label-hobbies="Hobbies:" + + widget-hobbies="solid-form-dropdown-addable-label" + range-hobbies="data/documentation/hobbies.jsonld" + + addable-hobbies-fields="name" + addable-hobbies-widget-name="solid-form-text-label" + addable-hobbies-label-name="Add a new hobby:" + addable-hobbies-naked + ></solid-form> + +The red frame represents the widget tag ``solid-form-dropdown-addable-label``, +the blue frame represents the ``<solid-form>`` created by ``addable`` attribute: + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/solid-form-addable.png + :alt: Example of solid-form with addable feature + + +Specific case - data-holder attribute +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To modify or add data including data linked, adding a second solid-form is necessary. It can be done thanks to a custom solid-widget. The second-form can also contain attributes: + +.. code-block:: html + + <solid-form + data-src="data/documentation/users.jsonld" + fields="first_name, last_name, email, profile" + + label-first_name="First name:" + label-last_name="Last name:" + label-email="Email:" + + widget-profile="profile-form" + ></solid-form> + + <solid-widget name="profile-form"> + <template> + <b>Profile form</b> + <solid-form + data-holder + data-src="${value}" + naked + fields="birthdate, address, phone" + + label-birthdate="Birthdate:" + label-address="Address:" + label-phone="Phone number:" + ></solid-form> + </template> + </solid-widget> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/solid-form-nested.png + :alt: Example of solid-form nested + +For more informations, ``data-holder``, ``data-src="${value}"`` attributes are detailed in :ref:`solid-widget<solid-widget>` +and ``naked`` attribute in :ref:`solid-form<solid-form>`. + + +How to display data in a table +------------------------------ + +To display data in a table, instead of a ``solid-display``, use a ``solid-table``, specific attributes are detailed on its :ref:`presentation page <solid-table>`. + +The ``order-asc`` attribute allows to sort data elements by date. It is presented on :ref:`sorter-mixin page <sorter-mixin>`. + +.. code-block:: html + + <solid-table + data-src="data/documentation/concerts.jsonld" + fields="artist, date, start_time, end_time, scene" + ></solid-table> + + <solid-table + data-src="data/documentation/concerts.jsonld" + fields="artist, date, start_time, end_time, scene" + + widget-date="solid-display-div-date" + widget-start_time="solid-display-div-time" + widget-end="solid-display-div-time" + + header + label-artist="Artist" + label-date="Date" + label-start_time="Start time" + label-end_time="End time" + label-scene="Scene" + + order-asc="date" + ></solid-table> + + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/solid-table.png + :alt: 2 examples of solid-table use + +Jsonld data structure used for the example: + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/jsonld-solid-table.png + :alt: Example of jsonld data container + + +How to use solid-form-search +---------------------------- + +From the example above, by adding ``filtered-by`` attribute reffering to a ``solid-form-search`` component, data displayed can be filtered: + +.. code-block:: html + + <solid-form-search + id="test" + fields="artist" + label-artist="Search by artist :" + ></solid-form-search> + + <solid-table + data-src="data/documentation/concerts.jsonld" + fields="artist, date, start_time, end_time, scene" + + widget-date="solid-display-div-date" + widget-start_time="solid-display-div-time" + widget-end="solid-display-div-time" + + header + label-artist="Artist" + label-date="Date" + label-start_time="Start time" + label-end_time="End time" + label-scene="Scene" + + order-asc="date" + + filtered-by="test" + ></solid-table> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/solid-form-search.png + :alt: Solid-form-search example + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/data-filtered.png + :alt: Data filtered example + + +How to display a list of nested data - ``multiple`` attribute use +----------------------------------------------------------------- + +To display a list of data, they have to be in a container. +If the data to be listed are nested, add ``multiple-[field]`` attribute from :ref:`widget-mixin <widget-mixin>` to precise which field to display. + +.. code-block:: html + + <solid-display + data-src="data/documentation/user-5.jsonld" + fields="first_name, last_name, email, hobbies" + ></solid-display> + + <solid-display + data-src="data/documentation/user-5.jsonld" + fields="first_name, last_name, email, hobbies" + multiple-hobbies + multiple-hobbies-fields="name" + ></solid-display> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/nested-data-list.png + :alt: List of nested data in a container + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/jsonld-nested-data-list.png + :alt: Jsonld file used for nested data list + +File hobby-1.jsonld content: + +.. code-block:: json + + { + "@id": "/examples/data/documentation/hobby-1.jsonld", + "name": "Comics", + "@context": "https://cdn.happy-dev.fr/owl/hdcontext.jsonld" + } + + +How to use default and empty attributes +--------------------------------------- + +* **default-widget** defines the widget used by default for all the fields if none is specified: + +Here, default-widget is applied to ``email`` and ``last_name`` (``first_name`` has its own one). + +.. code-block:: html + + <solid-display + data-src="data/documentation/user-1.jsonld" + fields="first_name, last_name, email" + ></solid-display> + + <solid-display + data-src="data/documentation/user-1.jsonld" + fields="first_name, last_name, email" + widget-first_name="b" + default-widget="solid-display-link" + ></solid-display> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/default-widget.png + :alt: default-widget example + + +* **default-[field]** defines the ``value`` by default, **default-widget-[field]** defines a widget by default for an empty or undefined ``[field]``: + +.. code-block:: html + + <solid-display + data-src="data/documentation/profile-2.jsonld" + fields="birthdate, phone" + default-phone="No phone number" + ></solid-display> + + <solid-display + data-src="data/documentation/profile-2.jsonld" + fields="birthdate, phone" + default-widget-phone="default-widget-phone" + ></solid-display> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/default-(widget)-field.png + :alt: default-[field] and default-widget-[field] example + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/default-field-data.png + :alt: data for default-[field] example + + +* **empty-widget** and **empty-value** allow to display a widget with a value if there is no data in a container : + +.. code-block:: html + + <solid-display + data-src="data/documentation/user-3-hobbies.jsonld" + fields="name" + empty-value="No hobby" + empty-widget="no-hobby" + ></solid-display> + + <solid-widget name="no-hobby"> + <template> + <b>Empty container</b> + ${value} + </template> + </solid-widget> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/empty-widget.png + :alt: empty-widget and empty-value example + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/empty-widget-data.png + :alt: data for empty-widget example + + +* **empty-[set]** and **empty-[set]-value** allow to display a widget with a value if all fields in a :ref:`set<widget-mixin>` are empty: + +.. code-block:: html + + <solid-display + data-src="data/documentation/profile-4.jsonld" + fields="fullname, contact(address, phone)" + empty-contact="empty-set" + empty-contact-value="No contact information" + ></solid-display> + + <solid-widget name="empty-set"> + <template> + <b>Contact :</b> + <p>${value}</p> + </template> + </solid-widget> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/empty-set.png + :alt: empty-[set] and empty-[set]-value example + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/empty-set-data.png + :alt: data for empty-[set] example + +How to use special attributes, values +------------------------------------- + +store://... +~~~~~~~~~~~ +It allows to fetch and display values from the :ref:`store <store-mixin>`. + +*Here, without it, the field's name is displayed by default.* + +.. code-block:: html + + <solid-display + data-src="data/documentation/users.jsonld" + fields="full_name" + action-full_name="user-details" + ></solid-display> + + <solid-display + data-src="data/documentation/users.jsonld" + fields="full_name" + action-full_name="user-details" + link-text-full_name="store://resource.full_name" + ></solid-display> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/store-use.png + :alt: Example of store://... value use + + +bind-resources +~~~~~~~~~~~~~~ +It allows to keep and pass the resource data-src between views when a :ref:`solid-router <solid-router>` is used. + +*Here, it ensures the personal informations of user clicked are displayed.* + +.. code-block:: html + + <solid-router use-hash> + <solid-route + hidden + use-id + name="user-details" + ></solid-route> + </solid-router> + + <solid-display + data-src="data/documentation/users.jsonld" + fields="full_name" + action-full_name="user-details" + link-text-full_name="store://resource.full_name" + ></solid-display> + + <div data-view="user-details" hidden> + <solid-display + bind-resources + fields="first_name, last_name, email, profile.birthdate, profile.address, profile.phone" + label-first_name="First name :" + label-last_name="Last name :" + label-email="Email :" + label-profile.birthdate="Birthdate :" + label-profile.address="Address :" + label-profile.phone="Phone number :" + default-widget="solid-display-value-label" + ></solid-display> + </div> + +.. figure:: ../../_static/images/import_documentation/framework-basic-use/bind-resources.png + :alt: Example of bind-resources use + +data-holder - ${value} +~~~~~~~~~~~~~~~~~~~~~~ + +These elements have already been introduced on examples above, for more information, please visit :ref:`solid-widget<solid-widget>`, :ref:`list-mixin<list-mixin>`, :ref:`widget-mixin<widget-mixin>` pages. + + diff --git a/source/index.rst b/source/index.rst index 33f4a791fb8051bae89f62164e89de0e612b4f18..88925ed96a9bf80719bfad9ebed08c73f812e586 100644 --- a/source/index.rst +++ b/source/index.rst @@ -26,10 +26,11 @@ Welcome to Startinblox's documentation import_documentation/framework_guide/how-to-use-the-documentation import_documentation/framework_guide/list-base-components import_documentation/framework_guide/list-external-components - import_documentation/framework_guide/list-mixins import_documentation/framework_guide/attributes-list import_documentation/framework_guide/list-widgets + import_documentation/framework_guide/list-mixins import_documentation/framework_guide/javascript-API + import_documentation/framework_guide/how-to-use-SIB .. toctree:: :maxdepth: 2