barbican-reset 3.15.0 → 3.16.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.
- package/components/AccountTitle.vue +5 -5
- package/components/BrCardSubTitle.vue +2 -2
- package/components/BrFormBlock.vue +6 -5
- package/components/BrFormCheckbox.vue +5 -9
- package/components/BrFormCheckboxGroup.vue +19 -19
- package/components/BrFormDate.vue +6 -4
- package/components/BrFormEmail.vue +2 -8
- package/components/BrFormFieldset.vue +4 -6
- package/components/BrFormInput.vue +71 -7
- package/components/BrFormLabel.vue +11 -18
- package/components/BrFormPassword.vue +28 -36
- package/components/BrFormRadio.vue +5 -9
- package/components/BrFormRadioGroup.vue +12 -19
- package/components/BrFormRow.vue +50 -36
- package/components/BrFormTel.vue +2 -8
- package/components/BrFormTextarea.vue +23 -6
- package/components/BrFormUpdate.vue +18 -20
- package/components/BrFormVisible.vue +8 -17
- package/components/EventSummary.vue +22 -26
- package/components/FluidIframe.vue +1 -1
- package/components/SeeInside.vue +19 -21
- package/components/VideoContent.vue +12 -12
- package/icons/barbican.vue +5 -6
- package/package.json +11 -6
- package/scripts/helpers/compareArrays.js +8 -0
- package/scripts/helpers/formatKebabCase.js +11 -0
- package/scripts/helpers/logObject.js +5 -0
- package/scripts/helpers.js +4 -3
- package/scss/__vars/_alerts.scss +6 -0
- package/scss/__vars/_columns.scss +9 -0
- package/scss/__vars/_layout.scss +15 -0
- package/scss/__vars/_typography.scss +11 -0
- package/scss/__vars/colors/_brand.scss +13 -0
- package/scss/__vars/colors/_docs.scss +11 -0
- package/scss/__vars/colors/_grey.scss +10 -0
- package/scss/__vars/colors/_status.scss +9 -0
- package/scss/_app.scss +0 -2
- package/scss/_atomic.scss +5 -28
- package/scss/_br-alert.scss +10 -11
- package/scss/_br-button.scss +7 -5
- package/scss/_br-checkbox.scss +16 -15
- package/scss/_br-container.scss +17 -18
- package/scss/_br-footer.scss +1 -1
- package/scss/_br-form-edit.scss +1 -1
- package/scss/_br-form-row.scss +1 -1
- package/scss/_br-form-update.scss +2 -2
- package/scss/_br-form-visible.scss +1 -1
- package/scss/_br-loader.scss +11 -12
- package/scss/_br-promo.scss +3 -3
- package/scss/_br-radio.scss +7 -12
- package/scss/_br-select.scss +1 -1
- package/scss/_br-skiplink.scss +1 -1
- package/scss/_br-wrap.scss +4 -6
- package/scss/_card-deck.scss +7 -9
- package/scss/_city-of-london.scss +1 -1
- package/scss/_close-icon.scss +5 -7
- package/scss/_form.scss +2 -2
- package/scss/_helpers.scss +2 -3
- package/scss/_input.scss +8 -16
- package/scss/_table.scss +16 -19
- package/scss/atomic/_colors.scss +40 -0
- package/scss/atomic/_font-sizes.scss +15 -0
- package/scss/atomic/_font-weights.scss +7 -0
- package/scss/atomic/_margins.scss +23 -0
- package/scss/atomic/_min-heights.scss +19 -0
- package/scss/atomic/_min-widths.scss +19 -0
- package/scss/atomic/{paddings.scss → _paddings.scss} +15 -8
- package/scss/atomic/_text-aligns.scss +7 -0
- package/scss/card/_account.scss +5 -5
- package/scss/card/_block.scss +2 -4
- package/scss/card/_confirm.scss +4 -4
- package/scss/card/_login.scss +1 -3
- package/scss/card/_membership.scss +18 -23
- package/scss/card/_password.scss +2 -2
- package/scss/card/_related.scss +9 -9
- package/scss/card/_slim.scss +2 -2
- package/scss/card/_video-help.scss +3 -7
- package/scss/card/index.scss +1 -1
- package/scss/{helpers/functions → functions}/index.scss +0 -4
- package/scss/index.scss +189 -5
- package/scss/lists.scss +10 -4
- package/scss/{helpers/mixins → mixins}/_basket.scss +1 -1
- package/scss/{helpers/mixins → mixins}/_br-alert.scss +11 -14
- package/scss/mixins/_br-card.scss +65 -0
- package/scss/{helpers/mixins → mixins}/_br-footer.scss +6 -6
- package/scss/{helpers/mixins → mixins}/_br-form-row.scss +11 -8
- package/scss/{helpers/mixins → mixins}/_br-form-visible.scss +1 -1
- package/scss/mixins/_br-gap.scss +4 -0
- package/scss/mixins/_br-skiplink.scss +18 -0
- package/scss/{helpers/mixins → mixins}/_city-of-london.scss +1 -1
- package/scss/{helpers/mixins → mixins}/_content.scss +12 -13
- package/scss/{helpers/mixins → mixins}/_core.scss +9 -6
- package/scss/mixins/_festival.scss +49 -0
- package/scss/{helpers/mixins → mixins}/_focus.scss +11 -18
- package/scss/{helpers/mixins → mixins}/_headings.scss +5 -6
- package/scss/{helpers/mixins → mixins}/_loading.scss +2 -3
- package/scss/{helpers/mixins → mixins}/account/_orders.scss +1 -1
- package/scss/{helpers/mixins → mixins}/buttons/_custom.scss +59 -61
- package/scss/mixins/buttons/_outline.scss +54 -0
- package/scss/{helpers/mixins → mixins}/buttons/_setup.scss +11 -13
- package/scss/{helpers/mixins → mixins}/buttons/_solid.scss +6 -7
- package/scss/{helpers/mixins → mixins}/buttons/_spektrix.scss +4 -6
- package/scss/mixins/drupal/_br-border-reset.scss +30 -0
- package/scss/{helpers/mixins → mixins}/drupal/_br-column.scss +3 -4
- package/scss/{helpers/mixins → mixins}/drupal/_br-container.scss +2 -3
- package/scss/{helpers/mixins → mixins}/drupal/_br-inner.scss +2 -3
- package/scss/{helpers/mixins → mixins}/drupal/_br-search-form.scss +23 -18
- package/scss/{helpers/mixins → mixins}/drupal/_br-site-logo.scss +4 -2
- package/scss/{helpers/mixins → mixins}/input/_generic.scss +15 -14
- package/scss/{helpers/mixins → mixins}/input/_radio.scss +1 -1
- package/scss/mixins/input/_select.scss +33 -0
- package/scss/mixins/input/_status.scss +19 -0
- package/scss/{helpers/mixins → mixins}/input/_text.scss +9 -11
- package/scss/{helpers/mixins → mixins}/table/_basket.scss +5 -6
- package/scss/{helpers/mixins → mixins}/table/_details.scss +9 -12
- package/scss/{helpers/mixins → mixins}/table/_etickets.scss +8 -11
- package/scss/{helpers/mixins → mixins}/table/_generic.scss +5 -7
- package/scss/{helpers/mixins → mixins}/table/_gifts.scss +10 -13
- package/scss/{helpers/mixins/table/_simple.scss → mixins/table/_membership.scss} +1 -2
- package/scss/{helpers/mixins → mixins}/table/_orders.scss +6 -8
- package/scss/{helpers/mixins → mixins}/table/_preferences.scss +9 -13
- package/scss/mixins/table/_resale.scss +27 -0
- package/scss/{helpers/mixins → mixins}/table/_section.scss +3 -3
- package/scss/mixins/table/_simple.scss +9 -0
- package/scss/{helpers/mixins → mixins}/table/_tickets.scss +10 -13
- package/scss/mixins/table/row/_disabled.scss +20 -0
- package/scss/reset.scss +3 -5
- package/scss/typography.scss +6 -8
- package/css/index.css +0 -4720
- package/css/lists.css +0 -12
- package/css/reset.css +0 -19
- package/css/supreme.css +0 -37
- package/css/typography.css +0 -35
- package/scss/_main.scss +0 -20
- package/scss/atomic/font-weights.scss +0 -11
- package/scss/atomic/margins.scss +0 -17
- package/scss/atomic/min-heights.scss +0 -9
- package/scss/atomic/text-aligns.scss +0 -11
- package/scss/helpers/mixins/_br-card.scss +0 -68
- package/scss/helpers/mixins/_br-gap.scss +0 -4
- package/scss/helpers/mixins/_br-skiplink.scss +0 -19
- package/scss/helpers/mixins/_festival.scss +0 -51
- package/scss/helpers/mixins/buttons/_outline.scss +0 -50
- package/scss/helpers/mixins/drupal/_br-border-reset.scss +0 -25
- package/scss/helpers/mixins/input/_select.scss +0 -36
- package/scss/helpers/mixins/input/_status.scss +0 -19
- package/scss/helpers/mixins/table/_membership.scss +0 -10
- package/scss/helpers/mixins/table/_resale.scss +0 -28
- package/scss/helpers/mixins/table/row/_disabled.scss +0 -22
- package/scss/helpers/variables/_alerts.scss +0 -9
- package/scss/helpers/variables/_columns.scss +0 -9
- package/scss/helpers/variables/_layout.scss +0 -26
- package/scss/helpers/variables/_typography.scss +0 -33
- package/scss/helpers/variables/colors/_brand.scss +0 -102
- package/scss/helpers/variables/colors/_docs.scss +0 -12
- package/scss/helpers/variables/colors/_grey.scss +0 -6
- package/scss/helpers/variables/colors/_llf.scss +0 -10
- package/scss/helpers/variables/colors/_status.scss +0 -30
- package/scss/helpers/variables/colors/_wgp.scss +0 -5
- package/scss/helpers/variables/colors/index.scss +0 -11
- package/scss/helpers/variables/index.scss +0 -16
- /package/scss/{helpers/mixins → mixins}/_br-form-edit.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/_breakpoints.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/_buttons.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/_input.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/_table.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/drupal/index.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/index.scss +0 -0
- /package/scss/{helpers/mixins → mixins}/input/_checkbox.scss +0 -0
|
@@ -14,20 +14,20 @@ export default {
|
|
|
14
14
|
},
|
|
15
15
|
computed: {
|
|
16
16
|
styleTitle() {
|
|
17
|
-
return this.placeholder ? this.$style.placeholder : this.$style.title
|
|
17
|
+
return this.placeholder ? this.$style.placeholder : this.$style.title
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<style lang="scss" module>
|
|
24
|
-
@use
|
|
24
|
+
@use '#styles/helpers' as *;
|
|
25
25
|
|
|
26
26
|
@mixin title {
|
|
27
|
-
margin-bottom:
|
|
27
|
+
margin-bottom: var(--margin-xl);
|
|
28
28
|
|
|
29
29
|
@include medium-up {
|
|
30
|
-
font-size:
|
|
30
|
+
font-size: var(--font-size-h1);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<style lang="scss" module>
|
|
8
|
-
@use
|
|
8
|
+
@use '#styles/helpers' as *;
|
|
9
9
|
|
|
10
10
|
.container {
|
|
11
|
-
padding:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
padding: var(--padding-lg) var(--padding-md) var(--padding-sm) var(--padding-md);
|
|
12
|
+
background: var(--color-black-5-lighten);
|
|
13
|
+
margin-bottom: var(--margin-lg);
|
|
14
|
+
border-left-width: 0.25rem;
|
|
15
|
+
border-left-style: solid;
|
|
15
16
|
font-weight: bold;
|
|
16
17
|
}
|
|
17
18
|
</style>
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="br-checkbox">
|
|
3
|
-
<
|
|
3
|
+
<BrFormInput v-bind="$attrs" type="checkbox">
|
|
4
4
|
<slot />
|
|
5
|
-
</
|
|
5
|
+
</BrFormInput>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script>
|
|
9
|
+
<script setup>
|
|
10
10
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
props: ['data'],
|
|
12
|
+
defineOptions({
|
|
14
13
|
inheritAttrs: false,
|
|
15
|
-
|
|
16
|
-
BrFormInput,
|
|
17
|
-
},
|
|
18
|
-
}
|
|
14
|
+
})
|
|
19
15
|
</script>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div role="group">
|
|
3
|
-
<
|
|
3
|
+
<BrFormCheckbox
|
|
4
4
|
v-for="(option, index) in options"
|
|
5
5
|
:data-test="option['data-test']"
|
|
6
|
+
:key="'checkbox-option-' + index"
|
|
6
7
|
:disabled="option.disabled"
|
|
7
|
-
:
|
|
8
|
-
|
|
9
|
-
v-model="value"
|
|
8
|
+
:value="option.value"
|
|
9
|
+
v-model="model"
|
|
10
10
|
:name="name">
|
|
11
11
|
<slot v-if="$slots.default" v-bind="option" />
|
|
12
12
|
<template v-else>{{ option.text }}</template>
|
|
13
|
-
</
|
|
13
|
+
</BrFormCheckbox>
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<script>
|
|
18
|
-
import inputs from '#mixins/inputs'
|
|
17
|
+
<script setup>
|
|
19
18
|
import BrFormCheckbox from '#components/BrFormCheckbox.vue'
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
const model = defineModel()
|
|
21
|
+
|
|
22
|
+
// @name props.options
|
|
23
|
+
// @description {object[]} array of checkbox options data
|
|
24
|
+
// @param {string} [options[]['data-test']] - optional string used in testing
|
|
25
|
+
// @param {boolean} [options[].disabled] - optional boolean for disabling the input
|
|
26
|
+
// @param {boolean | string | number} options[].value - the input value
|
|
27
|
+
// @param {string} options[].text - string displayed inside the input
|
|
28
|
+
|
|
29
|
+
const props = defineProps({
|
|
30
|
+
options: Array,
|
|
31
|
+
name: String,
|
|
32
|
+
})
|
|
33
33
|
</script>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BrFormInput v-bind="$attrs" type="date" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
6
|
-
|
|
5
|
+
<script setup>
|
|
6
|
+
import BrFormInput from '#components/BrFormInput.vue'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
7
9
|
inheritAttrs: false,
|
|
8
|
-
}
|
|
10
|
+
})
|
|
9
11
|
</script>
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BrFormInput type="email" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
5
|
+
<script setup>
|
|
6
6
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
components: {
|
|
10
|
-
BrFormInput,
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
7
|
</script>
|
|
@@ -5,10 +5,8 @@
|
|
|
5
5
|
</fieldset>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
props: ['label'],
|
|
13
|
-
}
|
|
8
|
+
<script setup>
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
label: String,
|
|
11
|
+
})
|
|
14
12
|
</script>
|
|
@@ -4,17 +4,81 @@
|
|
|
4
4
|
:data-test="generateDataTest"
|
|
5
5
|
:type="generateType"
|
|
6
6
|
:id="generateID"
|
|
7
|
-
v-model="
|
|
7
|
+
v-model="model"
|
|
8
8
|
v-bind="$attrs" />
|
|
9
9
|
<label v-if="$slots.default" :for="generateID"><slot /></label>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
-
<script>
|
|
13
|
-
import
|
|
12
|
+
<script setup>
|
|
13
|
+
import { computed } from 'vue'
|
|
14
|
+
import formatKebabCase from '#helpers/formatKebabCase'
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const model = defineModel()
|
|
17
|
+
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
id: String,
|
|
20
|
+
type: String,
|
|
21
|
+
dataTest: String,
|
|
22
|
+
autocomplete: String,
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
defineOptions({
|
|
17
26
|
inheritAttrs: false,
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// @description Returns either a string or undefined for the "autocomplete" attribute
|
|
30
|
+
// @returns {string | undefined} result - string or undefined based on preceeding conditions
|
|
31
|
+
|
|
32
|
+
const generateAutoComplete = computed(() => {
|
|
33
|
+
let result = undefined
|
|
34
|
+
|
|
35
|
+
if (props.id == 'first-name') result = 'given-name'
|
|
36
|
+
|
|
37
|
+
if (props.id == 'last-name') result = 'family-name'
|
|
38
|
+
|
|
39
|
+
if (props.type == 'email') result = 'email'
|
|
40
|
+
|
|
41
|
+
if (props.autocomplete) result = props.autocomplete
|
|
42
|
+
|
|
43
|
+
return result && formatKebabCase(result)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// @description Returns either a string or undefined for the "data-test" attribute
|
|
47
|
+
// @returns {string | undefined} result - string or undefined based on preceeding conditions
|
|
48
|
+
|
|
49
|
+
const generateDataTest = computed(() => {
|
|
50
|
+
let result = undefined
|
|
51
|
+
|
|
52
|
+
if (props.id) result = props.id
|
|
53
|
+
|
|
54
|
+
if (props.dataTest) result = props.dataTest
|
|
55
|
+
|
|
56
|
+
return result && formatKebabCase(result)
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// @description Returns a string for the "type" attribute
|
|
60
|
+
// @returns {string} result - string based on preceeding conditions
|
|
61
|
+
|
|
62
|
+
const generateType = computed(() => {
|
|
63
|
+
let result = 'text'
|
|
64
|
+
|
|
65
|
+
if (props.type) result = props.type
|
|
66
|
+
|
|
67
|
+
return formatKebabCase(result)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
// @description Returns a string for the "id" attribute
|
|
71
|
+
// @returns {string} result - string based on preceeding conditions
|
|
72
|
+
|
|
73
|
+
const generateID = computed(() => {
|
|
74
|
+
let result
|
|
75
|
+
|
|
76
|
+
if (props.id) {
|
|
77
|
+
result = props.id
|
|
78
|
+
} else {
|
|
79
|
+
result = 'random-' + Math.ceil(Math.random() * 1000000)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return formatKebabCase(result)
|
|
83
|
+
})
|
|
20
84
|
</script>
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<component :is="!disabled ? 'label' : 'div'" :for="!disabled ? id : null" class="br-form-label">
|
|
3
3
|
<strong>
|
|
4
4
|
<slot />
|
|
5
5
|
</strong>
|
|
6
6
|
<span v-if="required"> (required)</span>
|
|
7
7
|
<span v-if="optional"> (optional)</span>
|
|
8
|
-
</
|
|
9
|
-
<div v-else class="br-label">
|
|
10
|
-
<strong>
|
|
11
|
-
<slot />
|
|
12
|
-
</strong>
|
|
13
|
-
<span v-if="required"> (required)</span>
|
|
14
|
-
<span v-if="optional"> (optional)</span>
|
|
15
|
-
</div>
|
|
8
|
+
</component>
|
|
16
9
|
</template>
|
|
17
10
|
|
|
18
|
-
<script>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
<script setup>
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
disabled: Boolean,
|
|
15
|
+
required: Boolean,
|
|
16
|
+
optional: Boolean,
|
|
17
|
+
id: String,
|
|
18
|
+
})
|
|
19
|
+
|
|
27
20
|
</script>
|
|
@@ -1,49 +1,41 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BrFormVisible
|
|
3
3
|
@visible="showPassword = !showPassword"
|
|
4
|
-
:visible="showPassword"
|
|
5
|
-
|
|
6
|
-
<br-form-input
|
|
4
|
+
:visible="showPassword">
|
|
5
|
+
<BrFormInput
|
|
7
6
|
:autocomplete="generateAutocomplete"
|
|
8
7
|
:type="generateType"
|
|
9
8
|
v-bind="$attrs"
|
|
10
9
|
required />
|
|
11
|
-
</
|
|
12
|
-
<br-form-input
|
|
13
|
-
:autocomplete="generateAutocomplete"
|
|
14
|
-
:type="generateType"
|
|
15
|
-
v-bind="$attrs"
|
|
16
|
-
required
|
|
17
|
-
v-else />
|
|
10
|
+
</BrFormVisible>
|
|
18
11
|
</template>
|
|
19
12
|
|
|
20
|
-
<script>
|
|
13
|
+
<script setup>
|
|
14
|
+
import { ref, computed } from 'vue'
|
|
21
15
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
22
16
|
import BrFormVisible from '#components/BrFormVisible.vue'
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
toggle: Boolean,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
defineOptions({
|
|
25
23
|
inheritAttrs: false,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
generateAutocomplete() {
|
|
45
|
-
return this.showPassword ? 'off' : 'current-password'
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
let showPassword = ref(false)
|
|
27
|
+
|
|
28
|
+
// @description Returns a string for the "type" attribute based on the showPassword boolean
|
|
29
|
+
// @returns {string} conditional string
|
|
30
|
+
|
|
31
|
+
const generateType = computed(() => {
|
|
32
|
+
return showPassword.value ? 'text' : 'password'
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// @description Returns a string for the "autocomplete" attribute based on the showPassword boolean
|
|
36
|
+
// @returns {string} conditional string
|
|
37
|
+
|
|
38
|
+
const generateAutocomplete = computed(() => {
|
|
39
|
+
return showPassword.value ? 'off' : 'current-password'
|
|
40
|
+
})
|
|
49
41
|
</script>
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="br-radio">
|
|
3
|
-
<
|
|
3
|
+
<BrFormInput v-bind="$attrs" type="radio">
|
|
4
4
|
<slot />
|
|
5
|
-
</
|
|
5
|
+
</BrFormInput>
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script>
|
|
9
|
+
<script setup>
|
|
10
10
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
props: ['data'],
|
|
12
|
+
defineOptions({
|
|
14
13
|
inheritAttrs: false,
|
|
15
|
-
|
|
16
|
-
BrFormInput,
|
|
17
|
-
},
|
|
18
|
-
}
|
|
14
|
+
})
|
|
19
15
|
</script>
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div role="radiogroup">
|
|
3
|
-
<
|
|
3
|
+
<BrFormRadio
|
|
4
4
|
v-for="(option, index) in options"
|
|
5
5
|
:data-test="option['data-test']"
|
|
6
|
+
:key="'radio-option-' + index"
|
|
6
7
|
:disabled="option.disabled"
|
|
7
|
-
:
|
|
8
|
-
|
|
9
|
-
v-model="value"
|
|
8
|
+
:value="option.value"
|
|
9
|
+
v-model="model"
|
|
10
10
|
:name="name">
|
|
11
11
|
<slot v-if="$slots.default" v-bind="option" />
|
|
12
12
|
<template v-else>{{ option.text }}</template>
|
|
13
|
-
</
|
|
13
|
+
</BrFormRadio>
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
|
-
<script>
|
|
18
|
-
import inputs from '#mixins/inputs'
|
|
17
|
+
<script setup>
|
|
19
18
|
import BrFormRadio from '#components/BrFormRadio.vue'
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
methods: {
|
|
28
|
-
generateKey(index) {
|
|
29
|
-
return 'radio-option-' + index
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
}
|
|
20
|
+
const model = defineModel()
|
|
21
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
options: Array,
|
|
24
|
+
name: String,
|
|
25
|
+
})
|
|
33
26
|
</script>
|
package/components/BrFormRow.vue
CHANGED
|
@@ -1,49 +1,63 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="generateClasses">
|
|
3
|
-
<
|
|
3
|
+
<BrFormLabel
|
|
4
|
+
v-if="label"
|
|
5
|
+
:id="generateFor"
|
|
6
|
+
:required="required"
|
|
7
|
+
v-bind="$attrs">
|
|
4
8
|
{{ label }}
|
|
5
|
-
</
|
|
9
|
+
</BrFormLabel>
|
|
6
10
|
<div :class="[`content`, { label }, { submit }, { radios }]">
|
|
7
11
|
<slot />
|
|
8
12
|
</div>
|
|
9
13
|
</div>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
12
|
-
<script>
|
|
13
|
-
import
|
|
16
|
+
<script setup>
|
|
17
|
+
import { computed } from 'vue'
|
|
18
|
+
import formatKebabCase from '#helpers/formatKebabCase'
|
|
14
19
|
import BrFormLabel from '#components/BrFormLabel.vue'
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
label: String,
|
|
23
|
+
id: String,
|
|
24
|
+
required: Boolean,
|
|
25
|
+
submit: Boolean,
|
|
26
|
+
class: String,
|
|
27
|
+
radios: Boolean,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
defineOptions({
|
|
17
31
|
inheritAttrs: false,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
// @description Returns a string array of classnames
|
|
35
|
+
// @returns {string[]} result - contains default classname and optional prop-based classnames
|
|
36
|
+
|
|
37
|
+
const generateClasses = computed(() => {
|
|
38
|
+
let result = ['br-form-row']
|
|
39
|
+
|
|
40
|
+
if (props.class) result.push(props.class)
|
|
41
|
+
|
|
42
|
+
return result
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
// @description Returns either a string or null for the "for" attribute
|
|
46
|
+
// @returns {string | null} result - string or null based on preceeding conditions
|
|
47
|
+
|
|
48
|
+
const generateFor = computed(() => {
|
|
49
|
+
let result = null
|
|
50
|
+
|
|
51
|
+
// return null if there is no label value to click on
|
|
52
|
+
|
|
53
|
+
if (!props.label) return result
|
|
54
|
+
|
|
55
|
+
if (props.label) result = props.label
|
|
56
|
+
|
|
57
|
+
// override label value if a custom id is also set
|
|
58
|
+
|
|
59
|
+
if (props.id) result = props.id
|
|
60
|
+
|
|
61
|
+
return result && formatKebabCase(result)
|
|
62
|
+
})
|
|
49
63
|
</script>
|
package/components/BrFormTel.vue
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<BrFormInput autocomplete="tel" inputmode="tel" type="tel" />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
<script>
|
|
5
|
+
<script setup>
|
|
6
6
|
import BrFormInput from '#components/BrFormInput.vue'
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
components: {
|
|
10
|
-
BrFormInput,
|
|
11
|
-
},
|
|
12
|
-
}
|
|
13
7
|
</script>
|
|
@@ -6,11 +6,28 @@
|
|
|
6
6
|
wrap="soft" />
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
|
-
<script>
|
|
10
|
-
import
|
|
9
|
+
<script setup>
|
|
10
|
+
import { computed } from 'vue'
|
|
11
|
+
import formatKebabCase from '#helpers/formatKebabCase'
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
13
|
+
const value = defineModel()
|
|
14
|
+
|
|
15
|
+
// @description Returns a string for the "id" attribute
|
|
16
|
+
// @returns {string} result - string based on preceeding conditions
|
|
17
|
+
|
|
18
|
+
const generateID = computed(() => {
|
|
19
|
+
let result
|
|
20
|
+
|
|
21
|
+
if (props.id) {
|
|
22
|
+
result = props.id
|
|
23
|
+
} else {
|
|
24
|
+
result = 'random-' + Math.ceil(Math.random() * 1000000)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return formatKebabCase(result)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
id: String,
|
|
32
|
+
})
|
|
16
33
|
</script>
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="generateClasses">
|
|
3
3
|
<slot />
|
|
4
|
-
<
|
|
4
|
+
<BrButton v-if="active" @click="emit('update')" data-test="update">
|
|
5
5
|
update
|
|
6
|
-
</
|
|
6
|
+
</BrButton>
|
|
7
7
|
</div>
|
|
8
8
|
</template>
|
|
9
9
|
|
|
10
|
-
<script>
|
|
10
|
+
<script setup>
|
|
11
|
+
import { computed } from 'vue'
|
|
11
12
|
import BrButton from '#components/BrButton.vue'
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
type: Boolean,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
components: {
|
|
20
|
-
BrButton,
|
|
21
|
-
},
|
|
22
|
-
computed: {
|
|
23
|
-
generateClasses() {
|
|
24
|
-
let result = ['br-form-update']
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
active: Boolean,
|
|
16
|
+
})
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
const emit = defineEmits(['update'])
|
|
27
19
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
// @description Returns a string array of classnames
|
|
21
|
+
// @returns {string[]} result - contains default classname and optional active classname
|
|
22
|
+
|
|
23
|
+
const generateClasses = computed(() => {
|
|
24
|
+
let result = ['br-form-update']
|
|
25
|
+
|
|
26
|
+
if (props.active) result.push('active')
|
|
27
|
+
|
|
28
|
+
return result
|
|
29
|
+
})
|
|
32
30
|
</script>
|