Skip to content

Instantly share code, notes, and snippets.

@pierr
Last active August 29, 2015 14:15
Show Gist options
  • Save pierr/2c0d007142b2ac977637 to your computer and use it in GitHub Desktop.
Save pierr/2c0d007142b2ac977637 to your computer and use it in GitHub Desktop.
ComponentSpec
export PYTHONPATH=/c/Python27/
export GYP_MSVS_VERSION=2013
#Define the proxy variables.
export HTTPS_PROXY=http://proxy:port
export HTTP_PROXY=http://proxy:port
export no_proxy=localhost,otherdomain.lan.net
registry = http://registry.npmjs.com
http_proxy = http://yourproxy:port
https_proxy =http://yourproxy:port
https-proxy = http://yourproxy:port
proxy = http://yourproxy:port

Component specs

  • A component must have a displayName property
  • A component must have a propTypes property to validate incoming attributes
  • A component must expose a mixin property and a component property , the latter being a React component.
  • A component shoud have an associated style file or its parent if the component is a part of a bigger component.
  • A component must have a test directory inside it to be unit tested.
component/
        /index.js
        /package.json (optional)
        /___tests__ (unit tests)
        /style/
        /assets/
               /img/
        /example/
                index.html
                /style/
                   component.css
                /js/
                    component.js
                /img/
                

alt

Ce composant est un composant élémentaire de Focus.

#Interface

Cas d'usage

Ce composant peut être utilisé dans les cas suivants :

  • Recherche rapide
  • Recherche contuextualisée

Maquettes

recherche par défaut

alt

Recherche contextualisée

alt alt

Interactions

Erreurs

Le composant ne lève pas d'erreur :

  • La saisie est libre.
  • Le choix du contexte est libre.

Aide

Si un contexte de recherche est définissable, une aide textuelle est affichée sous le composant pour guider l'utilisateur.

alt

Feedback

  • Le contexte de recherche est sélectionné est affiché à gauche du champ de saisie.
  • Lorsqu'une recherche est lancée par le composant, un spinner est affiché dans le champ de recherche, sur la droite.
  • Lorsqu'aucun texte de recherche n'est défini, le composant affiche du texte qui indique à l'utilisateur ce qu'il peut saisir.

Inspiration

Linkedin alt

Technical Configuration

The configuration is processed by the component reading the metadata from the data-binding and the attributes from the component. The metadata are in the domain.

Attributes

Attribute Options Possible Default Description
type string text, date, hour text Define the type of input for the rendering.

Methods

If the component exposes methods in order to be able to interact with it.

Method Parameters Returns Description
validate() None. boolean Validate the input content depending on its metadata.
getValue() None. object get the input's depending on its metadata.

Events

Which events are triggered by the user.

Event Description
change The input calue changed.

Example

<input type='date'/>

Test

Demo

Input

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment