diff --git a/source/import_documentation/Components/SiB-Ac-Checker.rst b/source/import_documentation/Components/SiB-Ac-Checker.rst index 321909c7435cda123fe684f8c5080bb64cc26ac1..ff6102c34816f482e44bf2ec6f6e4be72d5f6bca 100644 --- a/source/import_documentation/Components/SiB-Ac-Checker.rst +++ b/source/import_documentation/Components/SiB-Ac-Checker.rst @@ -1,29 +1,34 @@ -sib-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 - <sib-ac-checker permission="acl:Write" bind-resources> - <sib-route name="member-edit"> + <solid-ac-checker permission="acl:Write" bind-resources> + <solid-route name="member-edit"> <div>Edit</div> - </sib-route> - </sib-ac-checker> - -**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>`__ + </solid-route> + </solid-ac-checker> + + +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>`__ diff --git a/source/import_documentation/Components/SiB-Delete.rst b/source/import_documentation/Components/SiB-Delete.rst index 3c47f3fd2432b96f1325d0c2d89786f33876ffab..027e3b06cf07de0b7af171237007c8810431a4dc 100644 --- a/source/import_documentation/Components/SiB-Delete.rst +++ b/source/import_documentation/Components/SiB-Delete.rst @@ -1,19 +1,28 @@ -sib-delete -=========== +solid-delete +============ Receives the URL of a resource or of a container of resources via its ``data-src`` attribute, and displays a button to delete it when clicked. .. code:: html - <sib-delete data-src="http://localhost:8000/conversations/9/"></sib-delete> + <solid-delete data-src="http://localhost:8000/conversations/9/"></solid-delete> -**Attributes:** +Attributes +---------- -- **``data-src``**: The uri of the LDP resource you want to delete. -- **``data-label``**: The text to display on the delete button. +``data-src`` +~~~~~~~~~~~~ + The uri of the LDP resource you want to delete. -**Events:** +``data-label`` +~~~~~~~~~~~~~~ + The text to display on the delete button. -- **``resourceDeleted``**: triggered when the resource is successfully - deleted. + +Events +------- + +``resourceDeleted`` +~~~~~~~~~~~~~~~~~~~ + Triggered when the resource is successfully deleted. diff --git a/source/import_documentation/Components/SiB-Display.rst b/source/import_documentation/Components/SiB-Display.rst index 8ec8dea2bf861901daf18080708c8c1ff2def6e6..fad947c72efc708295dadd246fcff27a21bca5fb 100644 --- a/source/import_documentation/Components/SiB-Display.rst +++ b/source/import_documentation/Components/SiB-Display.rst @@ -1,4 +1,4 @@ -sib-display +solid-display =========== Receives the URL of a resource or of a container of resources via its @@ -15,10 +15,10 @@ added to interact with the list of data being displayed. <script type="module" src="https://unpkg.com/@startinblox/core@0.9"></script> <!--body--> - <sib-display + <solid-display data-src="https://api.startinblox.com/users/" fields="first_name, last_name" - ></sib-display> + ></solid-display> Attributes @@ -28,24 +28,24 @@ data-src ~~~~~~~~ The uri of the LDP resource you want to display. - If this resource is a container, ``<sib-display>`` will create a child - ``<sib-display>`` for each resource it contains, and ``<sib-form>`` + If this resource is a container, ``<solid-display>`` will create a child + ``<solid-display>`` for each resource it contains, and ``<solid-form>`` will display a blank form with appropriate fields to create a new resource. value-xyz -~~~~~~~~ +~~~~~~~~~ To display a string not contained within the data. fields -~~~~~~~~ +~~~~~~ The ordered list of fields to be displayed, separated by commas. By default, all the fields of the resource are displayed. To not show any fields, put an empty fields (eg. - ``<sib-display fields />)`` + ``<solid-display fields />)`` To group fields within a ``<div>`` tag that will have the ``name`` attribute set up to ``xyz``, enclose some fields in parenthesis. For @@ -54,13 +54,13 @@ fields section below for more info. By default, all displayed fields are direct children of - ``<sib-display>``. Make sure you don’t give your set the same name as + ``<solid-display>``. Make sure you don’t give your set the same name as a field as it would result in an infinite loop. widget-xyz ~~~~~~~~ The widget to be used to display the ``xyz`` - field. By default, the widget used is ``<sib-display-div>``. Cf the + field. By default, the widget used is ``<solid-display-div>``. Cf the `Display widgets <#display-widgets>`__ section below for more info. default-widget @@ -108,13 +108,13 @@ search-fields ``search-fields="name"``. This will display a form with the appropriate inputs to filter the list. - - **``search-value-xyz``**: The default value of the search field + - ``search-value-xyz``: The default value of the search field ``xyz`` - - **``search-label-xyz``**: Set the label for the search field + - ``search-label-xyz``: Set the label for the search field ``xyz`` - - **``search-widget-xyz``**: The form widget of the search field + - ``search-widget-xyz``: The form widget of the search field ``xyz`` - - **``search-range-xyz``**: The range of values of the search field + - ``search-range-xyz``: The range of values of the search field ``xyz`` paginate-by @@ -143,9 +143,9 @@ group by next ~~~~~~~~~~~~~~~~ - ``name`` attribute of the ``<sib-route>`` that should - be accessed when a ``<sib-display>`` element is clicked. See the - documentation of ``<sib-router>`` for more details. + ``name`` attribute of the ``<solid-route>`` that should + be accessed when a ``<solid-display>`` element is clicked. See the + documentation of ``<solid-router>`` for more details. action-xyz ~~~~~~~~~~~~~~~~ @@ -159,13 +159,13 @@ editable-xyz Add an “edit†button next to the ``xyz`` field to let the user edit it. The changes are saved as soon as the field loses focus. The editable attribute works with the following widgets: - ``sib-display-div``, ``sib-display-labelled-div``, - ``sib-display-mailto`` and ``sib-display-tel`` + ``solid-display-div``, ``solid-display-labelled-div``, + ``solid-display-mailto`` and ``solid-display-tel`` counter-template ~~~~~~~~~~~~~~~~ To display the number of resources fetched - by the ``sib-display``. It takes a string in which you can use HTML + by the ``solid-display``. It takes a string in which you can use HTML tags, and the ``counter`` variable to add the number. i.e. ``"<strong>${counter} results</strong>"`` @@ -220,8 +220,11 @@ empty-value To display a value in the empty widget. It can be accessed in the widget like this: ``${value}`` -**API:** In Javascript, you have access to different variables and -methods on a ``sib-display`` element: - ``sibDisplay.resource``: returns -the Proxy of the current resource - ``sibDisplay.resource.clearCache()`` -(async): clears the cache of the store for this resource - -``sibDisplay.resourceId``: returns the id of the current resource + +API +--- + +In Javascript, you have access to different variables and methods on a ``solid-display`` element: +- ``sibDisplay.resource``: returns the Proxy of the current resource +- ``sibDisplay.resource.clearCache()`` (async): clears the cache of the store for this resource +- ``sibDisplay.resourceId``: returns the id of the current resource diff --git a/source/import_documentation/Components/SiB-Form.rst b/source/import_documentation/Components/SiB-Form.rst index b1eb377e857b7fed9a55a352c60918d11125bdd1..fcc3c9f47b19c0556dbe2a80516c09257626da61 100644 --- a/source/import_documentation/Components/SiB-Form.rst +++ b/source/import_documentation/Components/SiB-Form.rst @@ -1,5 +1,5 @@ -sib-form -========= +solid-form +========== Receives the URL of a ressource via its ``data-src`` attribute, and displays a form to edit the resource. If given the URL of a container of @@ -8,22 +8,40 @@ container. .. code:: html - <sib-form data-src="http://localhost:8000/todos/"></sib-form> + <solid-form data-src="http://localhost:8000/todos/"></solid-form> -**Attributes:** +Attributes +---------- -- **``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"`` -- **``naked``**: When the attribute is set, the submit button will be +``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"`` + +``naked`` +~~~~~~~~~ + When the attribute is set, the submit button will be removed. It’s particularly useful to prevent the nested forms to display their own submit button. -- **``upload-url-xyz``**: URL to upload file for field ``xyz``, it - automatically set ``widget-xyz`` to ``sib-form-file`` if net defined. + +``upload-url-xyz`` +~~~~~~~~~~~~~~~~~~ + URL to upload file for field ``xyz``, it + automatically set ``widget-xyz`` to ``solid-form-file`` if net defined. It’s particularly useful with a dropdown field. -- **``submit-button``**: Text of the submit button of the form. -- **``range-xyz``**: URL of a container which list the accepted values + +``submit-button`` +~~~~~~~~~~~~~~~~~ + Text of the submit button of the form. + +``range-xyz`` +~~~~~~~~~~~~~ + URL of a container which list the accepted values for the field ``xyz``. It’s particularly useful with a dropdown field. -- **``partial``**: Add this attribute when the form does not include + +``partial`` +~~~~~~~~~~~ + Add this attribute when the form does not include all the fields of the resource to update. diff --git a/source/import_documentation/Components/SiB-Map.rst b/source/import_documentation/Components/SiB-Map.rst index c66ae4f00bff6a3981bb11f82df94d8ce8f5f648..33c84e1c10aed80f94a4ef03ff0ce8c2152dc547 100644 --- a/source/import_documentation/Components/SiB-Map.rst +++ b/source/import_documentation/Components/SiB-Map.rst @@ -1,5 +1,5 @@ -sib-map -======== +solid-map +========= Receives the URL of a resource or of a container of resources via its ``data-src`` attribute, and displays it on a **map**. Here is the list @@ -9,5 +9,5 @@ of fields needed to display the resources properly: - ``lat``: latitude on which the resource will be displayed - ``lng``: longitude on which the resource will be displayed -Like for sib-display, filters and searching capabilities can be easily +Like for solid-display, filters and searching capabilities can be easily added to interact with the list of data being displayed. diff --git a/source/import_documentation/Components/SiB-Widget.rst b/source/import_documentation/Components/SiB-Widget.rst index 76252c9d713615b6cd2f8752ce3075ed5dbf1ba8..7ef364e39d3a799a5d24648335ec6151030ef0a0 100644 --- a/source/import_documentation/Components/SiB-Widget.rst +++ b/source/import_documentation/Components/SiB-Widget.rst @@ -1,5 +1,5 @@ -sib-widget -=========== +solid-widget +============ Take a ``name`` as an attribute and a HTML template, and create an HTML custom element you can use as a widget. i.e. @@ -7,26 +7,26 @@ custom element you can use as a widget. i.e. .. code:: html <!-- Your custom widget to display a customer... --> - <sib-widget name="my-custom-widget"> + <solid-widget name="my-custom-widget"> <template> <h2>Customer name: ${value.name}</h2> </template> - </sib-widget> + </solid-widget> - <!-- ... used in a sib-display --> - <sib-display + <!-- ... used in a solid-display --> + <solid-display data-src="http://server/projects/" fields="name, customer" widget-customer="my-custom-widget" - ></sib-display> + ></solid-display> -In a ``sib-widget``, you have access to these values: +In a ``solid-widget``, you have access to these values: -- **``id``**: id of the displayed resource -- **``value``**: all the values of the current resources -- **``name``**: name of the current field -- **``label``**: if defined, label of the current field -- **``range``**: if defined, range of the current field +- ``id``: id of the displayed resource +- ``value``: all the values of the current resources +- ``name``: name of the current field +- ``label``: if defined, label of the current field +- ``range``: if defined, range of the current field .. @@ -41,92 +41,92 @@ The following widgets are available: Display widgets ~~~~~~~~~~~~~~~ -- **``sib-display-value``** (default): Displays the value. -- **``sib-display-div``**: Displays the ``value`` inside a ``<div>`` +- ``solid-display-value`` (default): Displays the value. +- ``solid-display-div``: Displays the ``value`` inside a ``<div>`` HTML tag. -- **``sib-display-labelled-div``**: Displays the ``value`` inside a +- ``solid-display-labelled-div``: Displays the ``value`` inside a ``<div>`` HTML tag, after the ``label`` contained in a ``<label>`` HTML tag -- **``sib-display-multiline``**:Displays the ``value`` inside a +- ``solid-display-multiline``:Displays the ``value`` inside a ``<div>``, ``\n`` are replaced by ``<br>``. -- **``sib-display-labelled-boolean``**: Displays the ``label`` inside a +- ``solid-display-labelled-boolean``: Displays the ``label`` inside a ``<label>`` HTML tag if the ``value`` is true -- **``sib-display-img``**: Inserts the ``value`` as the src attribute +- ``solid-display-img``: Inserts the ``value`` as the src attribute value of an ``<img>`` HTML tag. -- **``sib-display-mailto``**: Displays a link inside a ``<a>`` HTML tag +- ``solid-display-mailto``: Displays a link inside a ``<a>`` HTML tag with a ``mailto:value`` as path. If a label is defined for this field, it’s displayed as the content of the link. -- **``sib-display-tel``**: Displays a link inside a ``<a>`` HTML tag +- ``solid-display-tel``: Displays a link inside a ``<a>`` HTML tag with a ``tel:value`` as path -- **``sib-display-link``**: Displays a link inside a ``<a>`` HTML tag +- ``solid-display-link``: Displays a link inside a ``<a>`` HTML tag with the value as path, and the label as text content -- **``sib-display-date``**: Displays a date in the browser’s default +- ``solid-display-date``: Displays a date in the browser’s default locale format -- **``sib-display-date-time``**: Displays a date and a time in the +- ``solid-display-date-time``: Displays a date and a time in the browser’s default locale format Form widgets ~~~~~~~~~~~~ -- **``sib-form-label-text``**: Inserts an ``<input/>`` HTML tag of type +- ``solid-form-label-text``: Inserts an ``<input/>`` HTML tag of type “textâ€, in a ``<label>`` HTML tag. -- **``sib-form-checkbox``**: Inserts an ``<input/>`` HTML tag of type +- ``solid-form-checkbox``: Inserts an ``<input/>`` HTML tag of type “checkboxâ€, in a ``<label>`` HTML tag. -- **``sib-form-date``**: Inserts an ``<input/>`` HTML tag of type +- ``solid-form-date``: Inserts an ``<input/>`` HTML tag of type “dateâ€, in a ``<label>`` HTML tag. -- **``sib-form-range-date``**: -- **``sib-form-json``**: Inserts an ``<input/>`` HTML tag of type +- ``solid-form-range-date``: +- ``solid-form-json``: Inserts an ``<input/>`` HTML tag of type “textâ€, in a ``<label>`` HTML tag, and with its ``value`` converted from JSON to string -- **``sib-form-placeholder-text``**: Inserts an ``<input/>`` HTML tag +- ``solid-form-placeholder-text``: Inserts an ``<input/>`` HTML tag of type “textâ€, with the ``label`` as placeholder. -- **``sib-form-textarea``**: Inserts an ``<textarea>`` HTML tag in a +- ``solid-form-textarea``: Inserts an ``<textarea>`` HTML tag in a ``<label>`` HTML tag. -- **``sib-form-dropdown``**: Inserts a ``<select>`` HTML tag to select +- ``solid-form-dropdown``: Inserts a ``<select>`` HTML tag to select a unique value from a list. The list is provided via the ``range-xyz``, which expects a container’s URL. **xyz** is the name - of the field using the ``sib-form-dropdown`` widget. -- **``sib-form-placeholder-dropdown``**: Inserts a ``<select>`` HTML + of the field using the ``solid-form-dropdown`` widget. +- ``solid-form-placeholder-dropdown``: Inserts a ``<select>`` HTML tag to select a unique value from a list. It has no label but a default disabled value as a label -- **``sib-form-auto-completion``**: Inserts a ``<input />`` HTML tag +- ``solid-form-auto-completion``: Inserts a ``<input />`` HTML tag and load an autocomplete plugin. The list is provided via the ``range-xyz``, which expects a container’s URL. **xyz** is the name - of the field using the ``sib-form-auto-completion`` widget. -- **``sib-form-number``**: Inserts an ``<input/>`` HTML tag of type + of the field using the ``solid-form-auto-completion`` widget. +- ``solid-form-number``: Inserts an ``<input/>`` HTML tag of type “numberâ€, in a ``<label>`` HTML tag. -- **``sib-form-range-number``**: -- **``sib-form-file``**: Inserts an ``<input/>`` and an +- ``solid-form-range-number``: +- ``solid-form-file``: Inserts an ``<input/>`` and an ``<input type="file"/>``. when a file is selected it’s uploaded, URL of file is returned by request and set as the ``<input/>`` value. The upload URL is provided via the ``upload-url`` attribute. -- **``sib-form-hidden``**: Inserts an ``<input/>`` HTML tag of type +- ``solid-form-hidden``: Inserts an ``<input/>`` HTML tag of type “hiddenâ€, in a ``<label>`` HTML tag. Multiple widgets ~~~~~~~~~~~~~~~~ -- **``sib-multiple``** (default for display): Inserts all the widgets - in a ``<sib-multiple>`` tag. -- **``sib-multiple-form``** (default for forms): Inserts all the - widgets in a ``<sib-multiple-form>`` tag, with a “remove†button for +- ``solid-multiple`` (default for display): Inserts all the widgets + in a ``<solid-multiple>`` tag. +- ``solid-multiple-form`` (default for forms): Inserts all the + widgets in a ``<solid-multiple-form>`` tag, with a “remove†button for each widget, and an “add†button. -- **``sib-multiple-select``**: Inserts all the values as ``<option>`` +- ``solid-multiple-select``: Inserts all the values as ``<option>`` in a ``<select>`` tag with a ``multiple`` attribute. Set widgets ~~~~~~~~~~~ -- **``sib-set-default``** (default): Inserts content directly in the +- ``solid-set-default`` (default): Inserts content directly in the set tag. -- **``sib-set-div``**: Inserts content in a ``<div/>`` HTML tag -- **``sib-set-ul``**: Inserts content in a ``<ul/>`` HTML tag -- **``sib-set-fieldset``**: Inserts content in a ``<fieldset/>`` HTML +- ``solid-set-div``: Inserts content in a ``<div/>`` HTML tag +- ``solid-set-ul``: Inserts content in a ``<ul/>`` HTML tag +- ``solid-set-fieldset``: Inserts content in a ``<fieldset/>`` HTML tag Actions widgets ~~~~~~~~~~~~~~~ -- **``sib-action``**: Displays a link inside a ``<sib-link>`` tag with +- ``solid-action``: Displays a link inside a ``<solid-link>`` tag with ``src`` for the ``data-src`` attribute, ``value`` for the ``next`` attribute and ``label`` as text content diff --git a/source/import_documentation/Components/Sib-Calendar.rst b/source/import_documentation/Components/Sib-Calendar.rst index 2e356ae172fd963fb87d698ede7fadf2dc4f234f..0cfdbca8ffa531305f574e8991128424f53bc1be 100644 --- a/source/import_documentation/Components/Sib-Calendar.rst +++ b/source/import_documentation/Components/Sib-Calendar.rst @@ -1,5 +1,5 @@ -sib-calendar -============ +solid-calendar +============== Receives the URL of a resource or of a container of resources via its ``data-src`` attribute, and displays it in a **calendar**. Here is the @@ -8,5 +8,5 @@ list of fields needed to display the resources properly: - ``name``: name of the event displayed on the calendar - ``date``: date on which the resource will be displayed -Like for sib-display, filters and searching capabilities can be easily +Like for solid-display, filters and searching capabilities can be easily added to interact with the list of data being displayed. diff --git a/source/import_documentation/Events.rst b/source/import_documentation/Events.rst index 120d6cc552dc965033cc941a084fa0e06724f7fc..0f47672bec0d6661320c761a29d69bda25b95084 100644 --- a/source/import_documentation/Events.rst +++ b/source/import_documentation/Events.rst @@ -10,18 +10,18 @@ But for now, here are some events that will be useful to you. | vent | ameters | | | | name | | | | +======+=========+========================+===========================+ -| `` | `` | ``sib-display``, | The user clicks an child | -| reso | {detail | ``sib-calendar``, | in the list, with the | -| urce | :{resou | ``sib-map`` | resource as a detail of | +| `` | `` | ``solid-display``, | The user clicks an child | +| reso | {detail | ``solid-calendar``, | in the list, with the | +| urce | :{resou | ``solid-map`` | resource as a detail of | | Sele | rce}}`` | | the event. | | ct`` | | | | +------+---------+------------------------+---------------------------+ -| ``po | `` | ``sib-display``, | The component got and | -| pula | {detail | ``sib-form``, | displayed all its datas. | -| te`` | :{resou | ``sib-calendar``, | | -| | rce}}`` | ``sib-map`` | | +| ``po | `` | ``solid-display``, | The component got and | +| pula | {detail | ``solid-form``, | displayed all its datas. | +| te`` | :{resou | ``solid-calendar``, | | +| | rce}}`` | ``solid-map`` | | +------+---------+------------------------+---------------------------+ -| ``sa | `` | ``sib-form`` | The form has saved | +| ``sa | `` | ``solid-form`` | The form has saved | | ve`` | {detail | | successfully. | | | :{resou | | | | | rce}}`` | | |