Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: add missing "autocomplete", "placeholder" and "readonly"… #63

Merged
merged 10 commits into from
Sep 6, 2016
2 changes: 1 addition & 1 deletion src/fields/fieldCheckbox.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input(type="checkbox", v-model="value", :disabled="disabled")
input(type="checkbox", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldCleave.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldColor.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="jade">
.wrapper
input(type="color", v-model="value", :disabled="disabled")
input(type="color", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled")
span.helper {{ value }}
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldDateTime.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="jade">
.input-group.date
input.form-control(type="text", v-model="value", :disabled="disabled")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
span.input-group-addon
span.glyphicon.glyphicon-calendar
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldEmail.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="email", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="email", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldGoogleAddress.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder", debounce="500", @focus="geolocate()")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly", debounce="500", @focus="geolocate()")
</template>

<script>
Expand Down
4 changes: 2 additions & 2 deletions src/fields/fieldImage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template lang="jade">
div.wrapper
input.form-control.link(type="text", v-model="wrappedValue", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control.file(type="file", :readonly="schema.readonly", :disabled="disabled", v-if="schema.browse !== false", @change="fileChanged")
input.form-control.link(type="text", v-model="wrappedValue", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
input.form-control.file(type="file", v-if="schema.browse !== false", :disabled="disabled", @change="fileChanged")
.preview(:style="previewStyle")
.remove(title="Remove image", @click="remove")
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldMasked.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldNumber.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="number", v-model="value", number, :min="schema.min", :max="schema.max", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="number", v-model="value", number, :autocomplete="schema.autocomplete", :disabled="disabled", :max="schema.max", :min="schema.min", :readonly="schema.readonly")
</template>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed the placeholder from here?


<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldPassword.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="password", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="password", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :readonly="schema.readonly")
</template>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removed the placeholder from here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry the french documentation was obsolete and wasn't listing password and number as compatible with placeholder. I will fix that.


<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldPikaday.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldRange.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template lang="jade">
.wrapper
input.form-control(type="range", v-model="value", :min="schema.min", :max="schema.max", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="range", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :max="schema.max", :min="schema.min")
.helpText {{ value }}
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldSelect.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
select.form-control(v-model="value", :disabled="disabled")
select.form-control(v-model="value", :disabled="disabled", :readonly="schema.readonly")
option(:disabled="schema.required", :value="null", :selected="value == undefined") &lt;Not selected&gt;
option(v-for="item in items", :value="getItemID(item)") {{ getItemName(item) }}
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldSlider.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input(type="text", :data-min="schema.min", :data-max="schema.max", :data-step="schema.step", :data-disable="disabled")
input(type="text", :autocomplete="schema.autocomplete", :data-disable="disabled", :data-max="schema.max", :data-min="schema.min", :data-step="schema.step", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldSpectrum.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input(type="text", :disabled="disabled", :placeholder="schema.placeholder")
input(type="text", :autocomplete="schema.autocomplete", :disabled="disabled", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldText.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
input.form-control(type="text", v-model="value", :maxlength="schema.max", :readonly="schema.readonly", :disabled="disabled", :placeholder="schema.placeholder")
input.form-control(type="text", v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :maxlength="schema.max", :placeholder="schema.placeholder", :readonly="schema.readonly")
</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion src/fields/fieldTextArea.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="jade">
textarea.form-control(v-model="value", :rows="schema.rows || 2", :readonly="schema.readonly", :placeholder="schema.placeholder", :disabled="disabled", :maxlength="schema.max")
textarea.form-control(v-model="value", :autocomplete="schema.autocomplete", :disabled="disabled", :maxlength="schema.max", :minlength="schema.min", :placeholder="schema.placeholder", :readonly="schema.readonly", :rows="schema.rows || 2")
</template>

<script>
Expand Down
1 change: 0 additions & 1 deletion test/unit/specs/fields/fieldNumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ describe("fieldNumber.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("number");
expect(input.classList.contains("form-control")).to.be.true;
expect(input.placeholder).to.be.equal(schema.placeholder);
expect(input.readOnly).to.be.false;
expect(input.min).to.be.equal("18");
expect(input.max).to.be.equal("100");
Expand Down
1 change: 0 additions & 1 deletion test/unit/specs/fields/fieldPassword.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("fieldPassword.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("password");
expect(input.classList.contains("form-control")).to.be.true;
expect(input.placeholder).to.be.equal(schema.placeholder);
expect(input.readOnly).to.be.false;
expect(input.disabled).to.be.false;
});
Expand Down
1 change: 0 additions & 1 deletion test/unit/specs/fields/fieldRange.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ describe("fieldRange.vue", function() {
expect(input).to.be.defined;
expect(input.type).to.be.equal("range");
expect(input.classList.contains("form-control")).to.be.true;
expect(input.placeholder).to.be.equal(schema.placeholder);
expect(input.min).to.be.equal("1");
expect(input.max).to.be.equal("10");
expect(input.disabled).to.be.false;
Expand Down