-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
134 additions
and
42 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,64 @@ | ||
#nyaBsConfigProvider | ||
|
||
This provider help the developer configure the default text appearance of nya-bs-select base on user-agent localization. Default implementation of the locale text is `en-us`. | ||
|
||
There are three default text can be configured. Each one has two form, pure text and custom html template. The priority of template configuration is higher than pure text. | ||
|
||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th>Text</th> | ||
<th>Template</th> | ||
<th>Details</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>defaultNoneSelection</td> | ||
<td>defaultNoneSelectionTpl</td> | ||
<td>defaultNoneSelection is appeared on dropdown toggle when nothing is selected.</td> | ||
</tr> | ||
<tr> | ||
<td>noSearchResult</td> | ||
<td>noSearchResultTpl</td> | ||
<td>noSearchResult is appeared on dropdown menu when using live search and nothing match the filter text</td> | ||
</tr> | ||
<tr> | ||
<td>numberItemSelected</td> | ||
<td>numberItemSelectedTpl</td> | ||
<td> | ||
<p>numberItemSelected is appeared when <code>select-text-format</code> attribute is set to count or count>x and when user selected multiple items. dropdown button text will be replaced by this text.</p> | ||
|
||
<p>**To show a count of selected items. this text string or template should contains a `%d` which will be replaced with number**</p> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
>NOTE: You shouldn't use any angular directive or expression in template, it will not be parsed. | ||
###Methods | ||
|
||
####`setLocalizedText(localeId, configObj);` | ||
|
||
Register a new locale configuration or override an existing locale configuration. | ||
|
||
- `localeId` a string formatted as languageId-countryId, e.g. en-us | ||
- `configObj` a localized configuration object. should contain one of the three properties. | ||
|
||
```javascript | ||
{ | ||
defaultNoneSelection: 'Nothing selected', | ||
noSearchResult: 'NO SEARCH RESULT', | ||
numberItemSelected: '%d item selected' | ||
} | ||
``` | ||
|
||
####`useLocale(localeId);` | ||
|
||
Force to use a special locale configuration with given localeId. | ||
|
||
- `localeId` a string formatted as languageId-countryId, e.g. en-us | ||
|
||
|
||
|
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
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
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