barbican-reset 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <div :class="styleComponent">
3
+ <div :class="styleOuter">
4
+ <div :class="styleInner">
5
+ <slot />
6
+ </div>
7
+ </div>
8
+ <div class="br-container--image">
9
+ <slot name="image" />
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ props: {
17
+ splash: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ masthead: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+ thin: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ header: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ footer: {
34
+ type: Boolean,
35
+ default: false,
36
+ },
37
+ },
38
+ computed: {
39
+ styleComponent() {
40
+ let classNames = ['br-container']
41
+
42
+ if (this.masthead) {
43
+ classNames.push('masthead')
44
+ }
45
+
46
+ return classNames
47
+ },
48
+ styleOuter() {
49
+ let classNames = ['br-container--outer']
50
+
51
+ if (this.masthead) {
52
+ classNames.push('masthead')
53
+ }
54
+
55
+ if (this.splash) {
56
+ classNames.push('splash')
57
+ }
58
+
59
+ return classNames
60
+ },
61
+ styleInner() {
62
+ let classNames = ['br-container--inner']
63
+
64
+ if (this.masthead) {
65
+ classNames.push('masthead')
66
+ }
67
+
68
+ if (this.thin) {
69
+ classNames.push('thin')
70
+ }
71
+
72
+ if (this.header) {
73
+ classNames.push('header')
74
+ }
75
+
76
+ if (this.footer) {
77
+ classNames.push('footer')
78
+ }
79
+
80
+ return classNames
81
+ },
82
+ },
83
+ }
84
+ </script>
@@ -1,10 +1,17 @@
1
1
  <template>
2
- <div class="br-form-row">
3
- <label v-if="label" :for="id">
4
- <strong>{{ label }}</strong>
5
- <span v-if="label && required">&nbsp;(required)</span
6
- ><span v-if="label && optional">&nbsp;(optional)</span>
7
- </label>
2
+ <div :class="styleRow">
3
+ <template v-if="label">
4
+ <label v-if="input_active" :for="generateInputID">
5
+ <strong>{{ label }}</strong>
6
+ <span v-if="required"> (required)</span>
7
+ <span v-if="optional"> (optional)</span>
8
+ </label>
9
+ <div class="fake-label" v-else>
10
+ <strong>
11
+ {{ label }}
12
+ </strong>
13
+ </div>
14
+ </template>
8
15
  <div :class="[`content`, { editable }, { label }, { submit }, { radios }]">
9
16
  <br-button v-if="editable" variant="input-edit" @click="$emit('edit')">
10
17
  <edit-icon />
@@ -15,8 +22,8 @@
15
22
  </template>
16
23
 
17
24
  <script>
18
- import BrButton from "#components/BrButton.vue";
19
- import EditIcon from "#icons/account/edit.vue";
25
+ import BrButton from '#components/BrButton.vue'
26
+ import EditIcon from '#icons/account/edit.vue'
20
27
 
21
28
  export default {
22
29
  components: {
@@ -27,6 +34,13 @@ export default {
27
34
  label: {
28
35
  type: String,
29
36
  },
37
+ input_id: {
38
+ type: String,
39
+ },
40
+ input_active: {
41
+ type: Boolean,
42
+ default: true,
43
+ },
30
44
  required: {
31
45
  type: Boolean,
32
46
  },
@@ -42,11 +56,32 @@ export default {
42
56
  radios: {
43
57
  type: Boolean,
44
58
  },
59
+ class: {
60
+ type: String,
61
+ },
62
+ },
63
+ methods: {
64
+ createKebabCase(value = '') {
65
+ return value.toLowerCase().split(' ').join('-')
66
+ },
45
67
  },
46
68
  computed: {
47
- id() {
48
- return this.label.toLowerCase().split(" ").join("_");
69
+ generateInputID() {
70
+ if (!this.label) {
71
+ return 'undefined'
72
+ }
73
+
74
+ return this.input_id ? this.input_id : this.createKebabCase(this.label)
75
+ },
76
+ styleRow() {
77
+ let styles = ['br-form-row']
78
+
79
+ if (this.class) {
80
+ styles.push(this.class)
81
+ }
82
+
83
+ return styles.join(' ')
49
84
  },
50
85
  },
51
- };
86
+ }
52
87
  </script>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="br-form-update">
3
3
  <div class="br-form-update--input" data-test="email"><slot /></div>
4
- <br-button @click.prevent="$emit('update')" data-test="update">
4
+ <br-button @click="$emit('update')" data-test="update">
5
5
  update
6
6
  </br-button>
7
7
  </div>