-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ajout exemple champ numérique (#112)
Signed-off-by: Alexis Boulerice <[email protected]>
- Loading branch information
1 parent
1ce58f1
commit a36d964
Showing
31 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
source/_patterns/02-components/entree-de-donnees/01-inputs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
--- | ||
title: Champ de texte | ||
--- | ||
|
||
## Tailles | ||
|
||
Les inputs par défaut sont de taille médium. | ||
|
||
## Validation | ||
|
||
Seuls les inputs sans icônes peuvent avoir une icône de validation. Dans ce cas il faut ajouter un <code>div</code> avec la classe <code>feedback-icon</code> et la classe de la validation soit <code>.valid-feedback</code> ou bien <code>.invalid-feedback</code>. |
85 changes: 85 additions & 0 deletions
85
source/_patterns/02-components/entree-de-donnees/02-inputs-number.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"inputTextSize": [ | ||
{ | ||
"formGroupClass": "required", | ||
"formGroupInputID": "form-control-number-default-one", | ||
"formGroupInputRequired": true, | ||
"formGroupInputLabel": "Libellé", | ||
"formGroupPopover": true, | ||
"formGroupInputPlaceholder": { | ||
"text": "XX" | ||
}, | ||
"formGroupInputHelpText": { | ||
"id": "input-number-help-text-id", | ||
"text": "Texte d'assistance" | ||
}, | ||
"formGroupInputCounter": false | ||
}, | ||
{ | ||
"formGroupClass": "required", | ||
"formGroupInputID": "form-control-number-default-two", | ||
"formGroupInputRequired": true, | ||
"formGroupInputLabel": "Libellé", | ||
"formGroupPopover": false, | ||
"formGroupInputPlaceholder": { | ||
"text": "XX" | ||
}, | ||
"formGroupInputValue": "40", | ||
"formGroupInputHelpText": { | ||
"id": "input-number-help-text-id", | ||
"text": "Texte d'assistance" | ||
}, | ||
"formGroupInputCounter": { | ||
"id": "input-number-caracter-count", | ||
"text": "La valeur doit se situer entre 20 et 60" | ||
}, | ||
"boundary": { | ||
"min": 20, | ||
"max": 60, | ||
"step": 5 | ||
} | ||
} | ||
], | ||
"inputTextSizeValidation": [ | ||
{ | ||
"formGroupClass": "required", | ||
"formGroupInputID": "form-control-number-default-error-one", | ||
"formGroupInputClass": "is-invalid", | ||
"formGroupInputRequired": true, | ||
"formGroupInputLabel": "En erreur input vide", | ||
"formGroupInputPlaceholder": false, | ||
"formGroupInputHelpText": false, | ||
"formGroupInputError": { | ||
"id": "input-text-error-id", | ||
"text": "Texte d'erreur", | ||
"formAriaInputError": true | ||
}, | ||
"boundary": { | ||
"min": 10, | ||
"max": 100 | ||
} | ||
} | ||
], | ||
"inputTextState": [ | ||
{ | ||
"formGroupClass": false, | ||
"formGroupInputID": "form-control-input-number-disabled", | ||
"formGroupInputLabel": "Désactivé", | ||
"formGroupInputRequired": false, | ||
"formGroupInputPlaceholder": "désactivé", | ||
"formGroupInputHelpText": false, | ||
"formGroupInputState": "disabled" | ||
}, | ||
{ | ||
"formGroupClass": false, | ||
"formGroupInputID": "form-control-input-number-readonly", | ||
"formGroupInputLabel": "Read-only", | ||
"formGroupInputClass": false, | ||
"formGroupInputRequired": false, | ||
"formGroupInputPlaceholder": "read-only", | ||
"formGroupInputHelpText": false, | ||
"formGroupInputState": "readonly", | ||
"formGroupInputValue": "40" | ||
} | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
source/_patterns/02-components/entree-de-donnees/02-inputs-number.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: Champ numérique | ||
--- | ||
|
25 changes: 25 additions & 0 deletions
25
source/_patterns/02-components/entree-de-donnees/02-inputs-number.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="row"> | ||
{{# inputTextSize}} | ||
<div class="col-xs-6 col-md-4"> | ||
{{> components-input-number }} | ||
</div> | ||
{{/ inputTextSize}} | ||
</div> | ||
|
||
<h4 class="pl-pattern-subtitle">Validation</h4> | ||
<div class="row"> | ||
{{# inputTextSizeValidation}} | ||
<div class="col-xs-6 col-md-4"> | ||
{{> components-input-number }} | ||
</div> | ||
{{/ inputTextSizeValidation}} | ||
</div> | ||
|
||
<h4 class="pl-pattern-subtitle">États</h4> | ||
<div class="row"> | ||
{{# inputTextState}} | ||
<div class="col-xs-6 col-md-4"> | ||
{{> components-input-number}} | ||
</div> | ||
{{/ inputTextState}} | ||
</div> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
source/_patterns/02-components/entree-de-donnees/_input-number.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="form-group {{formGroupClass}}"> | ||
{{# formGroupPopover}}<div class="label-has-popover">{{/ formGroupPopover}} | ||
<label for="{{formGroupInputID}}">{{ formGroupInputLabel}}</label> | ||
{{# formGroupPopover}}<div class="form-popover" aria-hidden="true" data-toggle="popover" data-placement="auto" title="Lorem ipsum" data-content="Lorem ipsum dolor sit amet, consectetur adipiscing elit. In nec quam ut erat scelerisque efficitur."><span class="icon icon-help" aria-hidden="true"></span><span class="sr-only">Lorem ipsum dolor sit amet, consectetur adipiscing elit. In nec quam ut erat scelerisque efficitur.</span></div>{{/ formGroupPopover}} | ||
{{# formGroupPopover}}</div>{{/ formGroupPopover}} | ||
{{# formGroupInputHelpText}} | ||
<span id="{{id}}" class="form-text">{{ text }}</span> | ||
{{/ formGroupInputHelpText}} | ||
<input type="number" class="form-control {{formGroupInputClass}}" id="{{ formGroupInputID }}" {{# formGroupInputValue}}value="{{ formGroupInputValue}}"{{/ formGroupInputValue}}{{# formGroupInputPlaceholder}} placeholder="{{ formGroupInputPlaceholder.text}}"{{/ formGroupInputPlaceholder}}{{# formGroupInputHelpText}} aria-describedby="{{id}}"{{/ formGroupInputHelpText}}{{#formGroupInputError}} aria-describedby="{{id}}" {{#formAriaInputError}} aria-invalid="true" {{/formAriaInputError}}{{/formGroupInputError}}{{# formGroupInputState}} {{ formGroupInputState}}{{/ formGroupInputState}}{{# formGroupInputRequired}} required{{/ formGroupInputRequired}}{{# boundary}}{{#min}} min="{{min}}"{{/min}}{{#max}} max="{{max}}"{{/max}}{{#step}} step="{{step}}"{{/step}}{{/boundary}}> | ||
{{# formGroupInputCounter}} | ||
<span id="{{id}}" class="form-text">{{ text }}</span> | ||
{{/ formGroupInputCounter}} | ||
{{# formGroupInputError}} | ||
<div class="invalid-feedback" id={{formGroupInputError.id}}> | ||
<span class="icon icon-exclamation icon-xs" aria-hidden="true"></span> | ||
<span class="sr-only">Erreur</span> | ||
{{ formGroupInputError.text }} | ||
</div> | ||
{{/ formGroupInputError}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters