This repository was archived by the owner on Dec 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
94 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Number | ||
|
||
|
||
## A note on translating number | ||
|
||
Number formfields can be translatable as every other formfield. | ||
Due to the fact that translations are stored as JSON, your database column can **not** be `Integer` then. |
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 |
---|---|---|
|
@@ -20,3 +20,4 @@ | |
|
||
* [Introduction](formfields/introduction.md) | ||
* [Text](formfields/text.md) | ||
* [Number](formfields/number.md) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,67 @@ | ||
<template> | ||
<div v-if="view == 'browse'">{{ $parent.getValue().substring(0, options.length || 200) || getTranslation(options.value || '') }}</div> | ||
<div v-if="view == 'browse'"> | ||
{{ getTranslation(options.prefix || '') }} | ||
{{ number_format(($parent.getValue() || getTranslation(options.value || '')), (options.decimals || 0), (options.dec_point || ','), (options.thousands_sep || '.')) }} | ||
{{ getTranslation(options.suffix || '') }} | ||
</div> | ||
<div v-else-if="view == 'read'"> | ||
<p>{{ $parent.getValue() }}</p> | ||
<p> | ||
{{ getTranslation(options.prefix || '') }} | ||
{{ number_format(($parent.getValue() || getTranslation(options.value || '')), (options.decimals || 0), (options.dec_point || ','), (options.thousands_sep || '.')) }} | ||
{{ getTranslation(options.suffix || '') }} | ||
</p> | ||
</div> | ||
<div v-else-if="view == 'edit' || view == 'add' || view == 'mockup'"> | ||
<input type="text" class="form-control" | ||
<input type="number" class="form-control" | ||
v-bind:value="$parent.getValue() || getTranslation(options.value || '')" | ||
v-on:input="$parent.setValue($event.target.value)" | ||
:placeholder="getTranslation(options.placeholder || '')" | ||
:disabled="view == 'mockup'"> | ||
:disabled="view == 'mockup'" | ||
:min="options.min || 0" | ||
:max="options.max || Number.MAX_SAFE_INTEGER" | ||
:step="options.step || 1"> | ||
</div> | ||
<div v-else-if="view == 'options'"> | ||
<div v-if="layoutType == 'list'"> | ||
|
||
<div class="form-group"> | ||
<label>Prefix</label> | ||
<language-input classes="form-control" placeholder="Prefix" v-model="options.prefix" /> | ||
</div> | ||
<div v-else> | ||
|
||
<div class="form-group"> | ||
<label>Suffix</label> | ||
<language-input classes="form-control" placeholder="Suffix" v-model="options.suffix" /> | ||
</div> | ||
<div class="form-group"> | ||
<label>Min</label> | ||
<input type="number" class="form-control" v-model="options.min"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Max</label> | ||
<input type="number" class="form-control" v-model="options.max"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Step</label> | ||
<input type="number" class="form-control" v-model="options.step"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Decimals</label> | ||
<input type="number" class="form-control" v-model="options.decimals" min="0" max="100"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Decimal separator</label> | ||
<input type="text" class="form-control" v-model="options.dec_point"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Thousands separator</label> | ||
<input type="text" class="form-control" v-model="options.thousands_sep"> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: ['view', 'layoutType', 'options'] | ||
props: ['view', 'layoutType', 'options'], | ||
computed: { | ||
} | ||
}; | ||
</script> |
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
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