Skip to content

Commit e864d10

Browse files
author
Lionel Bijaoui
committed
enhancement: add global class .vue-form-generator. Rewriting of most selector for a more encapsulated style.
1 parent 778a9ff commit e864d10

19 files changed

+19
-36
lines changed

src/fields/fieldCheckbox.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</script>
1212

1313
<style lang="sass">
14-
input[type=checkbox] {
14+
.vue-form-generator .field-checkbox {
1515
margin-left: 12px;
1616
}
1717
</style>

src/fields/fieldColor.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
<style lang="sass">
15-
span {
15+
.vue-form-generator .field-color .helper {
1616
margin-left: 0.3em;
1717
}
1818
</style>

src/fields/fieldDateTime.vue

-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,4 @@
5656

5757

5858
<style lang="sass">
59-
input {
60-
width: 100%;
61-
}
6259
</style>

src/fields/fieldEmail.vue

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111

1212

1313
<style lang="sass">
14-
input {
15-
width: 100%;
16-
}
1714
</style>

src/fields/fieldImage.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@
6767
</script>
6868

6969
<style lang="sass">
70-
.wrapper, input {
70+
.vue-form-generator .field-image {
71+
&.wrapper {
7172
width: 100%;
7273
}
73-
7474
.preview {
7575
position: relative;
7676
margin-top: 5px;
@@ -100,4 +100,5 @@
100100
}
101101
}
102102
}
103+
}
103104
</style>

src/fields/fieldLabel.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</script>
1212

1313
<style lang="sass">
14-
span {
14+
.vue-form-generator .field-label {
1515
display: block;
1616
width: 100%;
1717
margin-left: 12px;

src/fields/fieldMasked.vue

-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,4 @@
1818
</script>
1919

2020
<style lang="sass">
21-
input {
22-
width: 100%;
23-
}
2421
</style>

src/fields/fieldNumber.vue

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111

1212

1313
<style lang="sass">
14-
input {
15-
width: 100%;
16-
}
1714
</style>

src/fields/fieldPassword.vue

-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,4 @@
1111
</script>
1212

1313
<style lang="sass">
14-
input {
15-
width: 100%;
16-
}
1714
</style>

src/fields/fieldRange.vue

+2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313

1414
<style lang="sass">
15+
.vue-form-generator .field-range {
1516
input {
1617
width: 100%;
1718
}
1819
1920
.helpText {
2021
margin: auto 0.5em;
2122
}
23+
}
2224
</style>

src/fields/fieldSelect.vue

-3
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,4 @@
4141

4242

4343
<style lang="sass">
44-
select {
45-
width: 100%;
46-
}
4744
</style>

src/fields/fieldSelectEx.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757

5858
<style lang="sass">
59-
.bootstrap-select {
59+
.vue-form-generator .field-selectEx .bootstrap-select {
6060
.dropdown-menu li.selected .text{
6161
font-weight: bold;
6262
}

src/fields/fieldSlider.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858

5959
<style lang="sass">
60-
.irs {
60+
.vue-form-generator .field-slider .irs {
6161
width: 100%;
6262
}
6363
</style>

src/fields/fieldStaticMap.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</script>
1919

2020
<style lang="sass">
21-
img {
21+
.vue-form-generator .field-staticMap img {
2222
display: block;
2323
width: auto;
2424
max-width: 100%;

src/fields/fieldSubmit.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</script>
2929

3030
<style lang="sass">
31-
input {
31+
.vue-form-generator .field-submit input {
3232
width: 100%;
3333
}
3434
</style>

src/fields/fieldSwitch.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@
3636

3737
<style lang="sass">
3838
39-
$width: 120px;
39+
$field-switch-width: 120px;
4040
41-
label {
41+
.vue-form-generator .field-switch {
42+
.field-wrap label {
4243
position: relative;
4344
display: block;
4445
vertical-align: top;
45-
width: $width;
46+
width: $field-switch-width;
4647
height: 30px;
4748
padding: 3px;
4849
margin: 0 10px 10px 0;
@@ -136,5 +137,5 @@
136137
.label, .handle {
137138
transition: all 0.3s ease;
138139
}
139-
140+
}
140141
</style>

src/fields/fieldText.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<style lang="sass">
15-
input {
15+
.vue-form-generator .field-text input {
1616
width: 100%;
1717
}
1818
</style>

src/fields/fieldTextArea.vue

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@
1313

1414

1515
<style lang="sass">
16-
textarea {
17-
width: 100%;
18-
}
1916
</style>

src/formGenerator.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template lang="jade">
2-
fieldset(v-if="schema != null")
2+
fieldset.vue-form-generator(v-if="schema != null")
33
.form-group(v-for="field in fields", v-if="fieldVisible(field)", :class="getFieldRowClasses(field)")
44
label {{ field.label }}
55
span.help(v-if="field.help")

0 commit comments

Comments
 (0)