@iamproperty/components 1.0.14 → 2.3.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/README.md +120 -12
- package/assets/.DS_Store +0 -0
- package/assets/css/core.min.css +1 -0
- package/assets/css/core.min.css.map +1 -0
- package/assets/css/style.min.css +1 -0
- package/assets/css/style.min.css.map +1 -0
- package/assets/favicons/android-chrome-192x192.png +0 -0
- package/assets/favicons/android-chrome-512x512.png +0 -0
- package/assets/favicons/apple-touch-icon.png +0 -0
- package/assets/favicons/favicon-16x16.png +0 -0
- package/assets/favicons/favicon-32x32.png +0 -0
- package/assets/favicons/favicon.ico +0 -0
- package/assets/fonts/qanelas-medium-webfont.woff +0 -0
- package/assets/fonts/qanelas-medium-webfont.woff2 +0 -0
- package/assets/fonts/qanelassoft-extrabold-webfont.woff +0 -0
- package/assets/fonts/qanelassoft-extrabold-webfont.woff2 +0 -0
- package/{src/assets → assets}/img/logo.png +0 -0
- package/assets/js/main.js +67 -0
- package/assets/js/modules/accordion.js +36 -0
- package/assets/js/modules/carousel.js +102 -0
- package/assets/js/modules/drawer.js +16 -0
- package/assets/js/modules/form.js +49 -0
- package/assets/js/modules/helpers.js +93 -0
- package/assets/js/modules/modal.js +90 -0
- package/assets/js/modules/nav.js +27 -0
- package/assets/js/modules/table.js +573 -0
- package/assets/js/modules/testimonial.js +83 -0
- package/assets/js/modules/youtubevideo.js +145 -0
- package/assets/js/scripts.bundle.js +871 -0
- package/assets/js/scripts.bundle.js.map +1 -0
- package/assets/js/scripts.bundle.min.js +7 -0
- package/assets/js/scripts.bundle.min.js.map +1 -0
- package/assets/sass/_components.scss +35 -0
- package/assets/sass/_corefiles.scss +58 -0
- package/assets/sass/_func.scss +9 -0
- package/assets/sass/_functions/functions.scss +95 -0
- package/assets/sass/_functions/mixins.scss +109 -0
- package/assets/sass/_functions/utilities.scss +238 -0
- package/assets/sass/_functions/variables.scss +418 -0
- package/assets/sass/components/accordion.scss +195 -0
- package/assets/sass/components/card.scss +168 -0
- package/assets/sass/components/cardDeck.scss +107 -0
- package/assets/sass/components/carousel.scss +265 -0
- package/assets/sass/components/charts.scss +562 -0
- package/assets/sass/components/drawer.scss +45 -0
- package/assets/sass/components/header.scss +57 -0
- package/assets/sass/components/modal.scss +133 -0
- package/assets/sass/components/nav.scss +619 -0
- package/assets/sass/components/property-searchbar.scss +138 -0
- package/assets/sass/components/snapshot.scss +69 -0
- package/assets/sass/components/tabs.scss +46 -0
- package/assets/sass/components/testimonial.scss +131 -0
- package/assets/sass/components/timeline.scss +93 -0
- package/assets/sass/core.scss +4 -0
- package/assets/sass/elements/buttons.scss +263 -0
- package/assets/sass/elements/container.scss +222 -0
- package/assets/sass/elements/forms.scss +128 -0
- package/assets/sass/elements/links.scss +95 -0
- package/assets/sass/elements/lists.scss +26 -0
- package/assets/sass/elements/tables.scss +247 -0
- package/assets/sass/elements/tooltips.scss +71 -0
- package/assets/sass/elements/type.scss +114 -0
- package/assets/sass/foundations/brand.scss +74 -0
- package/assets/sass/foundations/circles.scss +73 -0
- package/assets/sass/foundations/fonts.scss +17 -0
- package/assets/sass/foundations/icons.scss +46 -0
- package/assets/sass/foundations/media.scss +47 -0
- package/assets/sass/foundations/reboot.scss +120 -0
- package/assets/sass/foundations/root.scss +45 -0
- package/assets/sass/main.scss +5 -0
- package/assets/svg/flat/agreed.svg +1 -0
- package/assets/svg/flat/alert.svg +1 -0
- package/assets/svg/flat/asset-37.svg +1 -0
- package/assets/svg/flat/asset-73.svg +1 -0
- package/assets/svg/flat/asset-82.svg +1 -0
- package/assets/svg/flat/award.svg +1 -0
- package/assets/svg/flat/bath.svg +1 -0
- package/assets/svg/flat/bed.svg +1 -0
- package/assets/svg/flat/calculate.svg +1 -0
- package/assets/svg/flat/calendar.svg +1 -0
- package/assets/svg/flat/celebrate.svg +1 -0
- package/assets/svg/flat/chat-house.svg +1 -0
- package/assets/svg/flat/chat.svg +1 -0
- package/assets/svg/flat/circle.svg +1 -0
- package/assets/svg/flat/clean.svg +1 -0
- package/assets/svg/flat/clock.svg +1 -0
- package/assets/svg/flat/computer.svg +1 -0
- package/assets/svg/flat/down.svg +1 -0
- package/assets/svg/flat/edit.svg +1 -0
- package/assets/svg/flat/email.svg +1 -0
- package/assets/svg/flat/event.svg +1 -0
- package/assets/svg/flat/family.svg +1 -0
- package/assets/svg/flat/file.svg +1 -0
- package/assets/svg/flat/find.svg +1 -0
- package/assets/svg/flat/fireworks.svg +1 -0
- package/assets/svg/flat/fist-left.svg +1 -0
- package/assets/svg/flat/fist.svg +1 -0
- package/assets/svg/flat/folder.svg +1 -0
- package/assets/svg/flat/footprints.svg +1 -0
- package/assets/svg/flat/hand.svg +1 -0
- package/assets/svg/flat/hands.svg +1 -0
- package/assets/svg/flat/house-2.svg +1 -0
- package/assets/svg/flat/house.svg +1 -0
- package/assets/svg/flat/idea.svg +1 -0
- package/assets/svg/flat/judge-house.svg +1 -0
- package/assets/svg/flat/judge.svg +1 -0
- package/assets/svg/flat/keys-house.svg +1 -0
- package/assets/svg/flat/lock.svg +1 -0
- package/assets/svg/flat/mobile.svg +1 -0
- package/assets/svg/flat/money.svg +1 -0
- package/assets/svg/flat/monument.svg +1 -0
- package/assets/svg/flat/online-judgement.svg +1 -0
- package/assets/svg/flat/paint.svg +1 -0
- package/assets/svg/flat/person-2.svg +1 -0
- package/assets/svg/flat/person.svg +1 -0
- package/assets/svg/flat/phone.svg +1 -0
- package/assets/svg/flat/pin.svg +1 -0
- package/assets/svg/flat/pound.svg +1 -0
- package/assets/svg/flat/present.svg +1 -0
- package/assets/svg/flat/qualification.svg +1 -0
- package/assets/svg/flat/rocket.svg +1 -0
- package/assets/svg/flat/sale.svg +1 -0
- package/assets/svg/flat/save.svg +1 -0
- package/assets/svg/flat/scale.svg +1 -0
- package/assets/svg/flat/send.svg +1 -0
- package/assets/svg/flat/share.svg +1 -0
- package/assets/svg/flat/sofa.svg +1 -0
- package/assets/svg/flat/sold.svg +1 -0
- package/assets/svg/flat/star.svg +1 -0
- package/assets/svg/flat/stopwatch.svg +1 -0
- package/assets/svg/flat/task.svg +1 -0
- package/assets/svg/flat/telescope.svg +1 -0
- package/assets/svg/flat/thumb.svg +1 -0
- package/assets/svg/flat/time.svg +1 -0
- package/assets/svg/flat/up.svg +1 -0
- package/assets/svg/flat/valuation.svg +1 -0
- package/assets/svg/flat/value-house.svg +1 -0
- package/assets/svg/flat/warning.svg +1 -0
- package/assets/svg/flat/water.svg +1 -0
- package/assets/svg/icons.svg +51 -0
- package/assets/svg/illustrations/commuter1.svg +1 -0
- package/assets/svg/illustrations/commuter2.svg +1 -0
- package/assets/svg/illustrations/commuter3.svg +1 -0
- package/assets/svg/logo.svg +43 -0
- package/dist/components.common.js +2825 -252
- package/dist/components.common.js.map +1 -1
- package/dist/components.css +2 -1
- package/dist/components.css.map +1 -0
- package/dist/components.umd.js +2825 -252
- package/dist/components.umd.js.map +1 -1
- package/dist/components.umd.min.js +1 -1
- package/dist/components.umd.min.js.map +1 -1
- package/package.json +90 -57
- package/src/.DS_Store +0 -0
- package/src/components/Accordion/Accordion.vue +24 -0
- package/src/components/Accordion/AccordionItem.vue +43 -0
- package/src/components/Accordion/README.md +34 -0
- package/src/components/Banner/Banner.vue +38 -0
- package/src/components/Banner/README.md +24 -0
- package/src/components/Card/Card.vue +115 -0
- package/src/components/Card/README.md +24 -0
- package/src/components/CardDeck/CardDeck.vue +78 -0
- package/src/components/CardDeck/README.md +25 -0
- package/src/components/Carousel/Carousel.vue +86 -0
- package/src/components/Carousel/README.md +20 -0
- package/src/components/Chart/Chart.vue +246 -0
- package/src/components/Chart/README.md +18 -0
- package/src/components/Drawer/Drawer.vue +54 -0
- package/src/components/Drawer/README.md +23 -0
- package/src/components/Header/Header.vue +39 -0
- package/src/components/Header/README.md +28 -0
- package/src/components/Modal/Modal.vue +44 -0
- package/src/components/Modal/README.md +20 -0
- package/src/components/Nav/Nav.vue +129 -0
- package/src/components/Nav/README.md +23 -0
- package/src/components/PropertySearchbar/PropertySearchbar.vue +206 -0
- package/src/components/PropertySearchbar/README.md +26 -0
- package/src/components/Snapshot/README.md +21 -0
- package/src/components/Snapshot/Snapshot.vue +33 -0
- package/src/components/Tabs/README.md +27 -0
- package/src/components/Tabs/Tab.vue +17 -0
- package/src/components/Tabs/Tabs.vue +59 -0
- package/src/components/Testimonial/README.md +26 -0
- package/src/components/Testimonial/Testimonial.vue +61 -0
- package/src/components/Timeline/README.md +18 -0
- package/src/components/Timeline/Timeline.vue +25 -0
- package/src/elements/Input/Input.vue +236 -0
- package/src/elements/Input/README.md +18 -0
- package/src/elements/Table/README.md +55 -0
- package/src/elements/Table/Table.vue +112 -0
- package/src/foundations/Icon/Icon.vue +21 -0
- package/src/foundations/Icon/README.md +11 -0
- package/src/foundations/Logo/Logo.vue +39 -0
- package/src/foundations/Logo/README.md +20 -0
- package/src/foundations/YoutubeVideo/README.md +11 -0
- package/src/foundations/YoutubeVideo/YoutubeVideo.vue +24 -0
- package/src/helpers/strings.js +12 -0
- package/src/index.js +21 -6
- package/src/assets/css/default.css +0 -99
- package/src/assets/logo.png +0 -0
- package/src/assets/scss/_variables.scss +0 -13
- package/src/components/KeyFacts/KeyFact.vue +0 -45
- package/src/components/KeyFacts/KeyFactGroup.vue +0 -44
- package/src/components/KeyFacts/README.md +0 -23
- package/src/components/KeyInformation/KeyInformation.vue +0 -23
- package/src/components/KeyInformation/README.md +0 -32
- package/src/components/PropertyTaskIntro/PropertyTaskIntro.vue +0 -74
- package/src/components/PropertyTaskIntro/README.md +0 -27
- package/src/components/TaskTitle/README.md +0 -24
- package/src/components/TaskTitle/TaskTitle.vue +0 -68
- package/src/components/VendorTable/README.md +0 -63
- package/src/components/VendorTable/VendorTable.vue +0 -30
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Carousel :items="items" type="card"></Carousel>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
**The carousel props inherit the card deck props** - this is so that when we use cards in the carousel we can still pass the same options.
|
|
10
|
+
|
|
11
|
+
| Option | Type | Default Value | Description |
|
|
12
|
+
| ------ | ---- | ------------- | ----------- |
|
|
13
|
+
| type | String | - | Can be used to indicate that cards should be displayed in the carousel by giving the value 'card' |
|
|
14
|
+
| colclass | String | - | Pass utility classes to the columns in the carousel. For example 'd-flex align-items-center' will align the items n the middle. |
|
|
15
|
+
|
|
16
|
+
### Slots
|
|
17
|
+
|
|
18
|
+
| Option | Default Value | Description |
|
|
19
|
+
| ------ | ------------- | ----------- |
|
|
20
|
+
| default | - | Will display before the carousel |
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container" ref="wrapper">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<figure class="chart__wrapper">
|
|
5
|
+
<figcaption v-html="caption"></figcaption>
|
|
6
|
+
<div :class="`chart__key chart__key--${type} h5`" role="presentation">
|
|
7
|
+
<div :key="index" v-for="(item,index) in fields" class="key">{{item.key}}</div>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div :class="`chart chart--${type}`" ref="chart">
|
|
11
|
+
|
|
12
|
+
<div class="chart__yaxis" role="presentation">
|
|
13
|
+
<div :key="index" v-for="(point,index) in yaxis" :style="`--value: ${point.value};--percent:${((point.value-min)/(max-min))*100}%;`" class="axis__point">
|
|
14
|
+
<span>{{point.display}}</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<Table v-bind="$props">
|
|
18
|
+
|
|
19
|
+
<div class="chart__guidelines" role="presentation">
|
|
20
|
+
<div :key="index" v-for="(point,index) in yaxis" :data-value="point.value" :style="`--percent:${((point.value-min)/(max-min))*100}%;`" class="guideline">
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<span v-html="drawLines()" class="lines" v-if="type == 'line'"></span>
|
|
24
|
+
</Table>
|
|
25
|
+
<div v-html="drawPie()" class="pies" v-if="type == 'pie'"></div>
|
|
26
|
+
</div>
|
|
27
|
+
</figure>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style lang="scss">
|
|
32
|
+
@import "../../../assets/sass/_func.scss";
|
|
33
|
+
@import "../../../assets/sass/components/charts.scss";
|
|
34
|
+
</style>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import { ucfirst, unsnake } from '../../helpers/strings'
|
|
38
|
+
import Table from '@/elements/Table/Table.vue'
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
name: 'Tabs',
|
|
42
|
+
components: {
|
|
43
|
+
Table
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
type: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: false,
|
|
49
|
+
default: 'bar'
|
|
50
|
+
},
|
|
51
|
+
caption: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
max: {
|
|
56
|
+
type: Number,
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
min: {
|
|
60
|
+
type: Number,
|
|
61
|
+
required: false,
|
|
62
|
+
default: 0
|
|
63
|
+
},
|
|
64
|
+
yaxis: {
|
|
65
|
+
type: Array,
|
|
66
|
+
required: false
|
|
67
|
+
},
|
|
68
|
+
items: {
|
|
69
|
+
type: Array,
|
|
70
|
+
required: true
|
|
71
|
+
},
|
|
72
|
+
fields: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
computed: {
|
|
78
|
+
drawLines (){
|
|
79
|
+
return () => {
|
|
80
|
+
|
|
81
|
+
let lines = Array();
|
|
82
|
+
let spacer = 200/(Object.keys(this.items).length - 1);
|
|
83
|
+
const max = this.max - this.min;
|
|
84
|
+
|
|
85
|
+
// Creates the lines array from the fields array
|
|
86
|
+
this.fields.forEach((field, index) => {
|
|
87
|
+
|
|
88
|
+
if(index != 0){
|
|
89
|
+
|
|
90
|
+
lines[index-1] = '';
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// populate the lines array from the items array
|
|
95
|
+
this.items.forEach((item, index) => {
|
|
96
|
+
|
|
97
|
+
Object.keys(item).forEach((key, subindex) => {
|
|
98
|
+
|
|
99
|
+
if(subindex != 0){
|
|
100
|
+
|
|
101
|
+
let value = item[key]
|
|
102
|
+
|
|
103
|
+
value = value.replace('£','');
|
|
104
|
+
value = value.replace('%','');
|
|
105
|
+
value = Number.parseFloat(value) - this.min;
|
|
106
|
+
|
|
107
|
+
const percent = (value/max) * 100;
|
|
108
|
+
let command = index == 0 ? 'M' : 'L';
|
|
109
|
+
|
|
110
|
+
lines[subindex-1] += `${command} ${spacer * index} ${100-percent} `;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Create the line strings
|
|
116
|
+
let returnString = '';
|
|
117
|
+
|
|
118
|
+
lines.forEach((line, index) => {
|
|
119
|
+
|
|
120
|
+
returnString += `
|
|
121
|
+
<svg viewBox="0 0 200 100" class="line" preserveAspectRatio="none">
|
|
122
|
+
<path fill="none" d="${line}"></path>
|
|
123
|
+
</svg>`
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
return returnString;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
drawPie (){
|
|
130
|
+
return () => {
|
|
131
|
+
|
|
132
|
+
let returnString = '';
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
this.items.forEach((item, index) => {
|
|
136
|
+
|
|
137
|
+
let paths = '';
|
|
138
|
+
let tooltips = '';
|
|
139
|
+
|
|
140
|
+
let cumulativePercent = 0;
|
|
141
|
+
|
|
142
|
+
function getCoordinatesForPercent(percent) {
|
|
143
|
+
const x = Math.cos(2 * Math.PI * percent);
|
|
144
|
+
const y = Math.sin(2 * Math.PI * percent);
|
|
145
|
+
return [x*100, y*100];
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
let total = 0;
|
|
149
|
+
|
|
150
|
+
let titleKey = Object.keys(item)[0]
|
|
151
|
+
let title = item[titleKey]
|
|
152
|
+
|
|
153
|
+
Object.keys(item).forEach((key, subindex) => {
|
|
154
|
+
|
|
155
|
+
if(subindex != 0){
|
|
156
|
+
let value = item[key]
|
|
157
|
+
|
|
158
|
+
value = value.replace('£','');
|
|
159
|
+
value = value.replace('%','');
|
|
160
|
+
value = Number.parseInt(value);
|
|
161
|
+
|
|
162
|
+
total += value;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
Object.keys(item).forEach((key, subindex) => {
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
if(subindex != 0){
|
|
170
|
+
|
|
171
|
+
let value = item[key]
|
|
172
|
+
|
|
173
|
+
value = value.replace('£','');
|
|
174
|
+
value = value.replace('%','');
|
|
175
|
+
value = Number.parseInt(value);
|
|
176
|
+
|
|
177
|
+
let percent = value/total;
|
|
178
|
+
|
|
179
|
+
//lines[subindex-1] += `${command} ${spacer * index} ${100-percent} `;
|
|
180
|
+
const [startX, startY] = getCoordinatesForPercent(cumulativePercent);
|
|
181
|
+
|
|
182
|
+
// each slice starts where the last slice ended, so keep a cumulative percent
|
|
183
|
+
cumulativePercent += percent;
|
|
184
|
+
|
|
185
|
+
const [endX, endY] = getCoordinatesForPercent(cumulativePercent);
|
|
186
|
+
|
|
187
|
+
// if the slice is more than 50%, take the large arc (the long way around)
|
|
188
|
+
const largeArcFlag = percent > .5 ? 1 : 0;
|
|
189
|
+
|
|
190
|
+
// create an array and join it just for code readability
|
|
191
|
+
const pathData = [
|
|
192
|
+
`M ${startX} ${startY}`, // Move
|
|
193
|
+
`A 100 100 0 ${largeArcFlag} 1 ${endX} ${endY}`, // Arc
|
|
194
|
+
`L 0 0`, // Line
|
|
195
|
+
].join(' ');
|
|
196
|
+
|
|
197
|
+
paths += `<path d="${pathData}"></path>`;
|
|
198
|
+
tooltips += `<foreignObject x="-70" y="-70" width="140" height="140" style="transform: rotate(90deg)"><div><span class="h5 mb-0">${ucfirst(unsnake(title))}<br/> ${ucfirst(unsnake(key))}<br/> ${item[key]}</span></div></foreignObject>`;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
returnString += `<div class="pie"><svg viewBox="-105 -105 210 210" style="transform: rotate(-90deg)" preserveAspectRatio="none">${paths}<foreignObject x="-70" y="-70" width="140" height="140" style="transform: rotate(90deg)"><div><span class="h5 mb-0">${title}</span></div></foreignObject>${tooltips}</svg></div>`
|
|
203
|
+
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
return returnString;
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
mounted(){
|
|
213
|
+
this.$nextTick(function () {
|
|
214
|
+
|
|
215
|
+
// If the data gets updated we may need to recreate the tbody as it get detached when sorted in the table.js
|
|
216
|
+
let chart = this.$refs.chart;
|
|
217
|
+
const max = this.max - this.min;
|
|
218
|
+
|
|
219
|
+
Array.from(chart.querySelectorAll('tbody tr')).forEach((tr, index) => {
|
|
220
|
+
|
|
221
|
+
let group = tr.querySelector('td:first-child').innerHTML;
|
|
222
|
+
|
|
223
|
+
Array.from(tr.querySelectorAll('td[data-numeric]:not([data-numeric="0"]):not(:first-child)')).forEach((td, index) => {
|
|
224
|
+
|
|
225
|
+
const value = Number.parseFloat(td.getAttribute('data-numeric'));
|
|
226
|
+
let percent = ((value - this.min)/(max)) * 100;
|
|
227
|
+
const content = td.innerHTML;
|
|
228
|
+
const label = td.getAttribute('data-label');
|
|
229
|
+
let bottom = 0;
|
|
230
|
+
|
|
231
|
+
// If the value is negative the position below the 0 line
|
|
232
|
+
if(this.min < 0){
|
|
233
|
+
bottom = Math.abs((this.min)/(max)*100);
|
|
234
|
+
if(value < 0){
|
|
235
|
+
bottom = bottom - percent;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
td.setAttribute("style",`--bottom:${bottom}%;--percent:${percent}%;`);
|
|
239
|
+
|
|
240
|
+
td.innerHTML = `<span data-group="${group}" data-label="${label}">${content}</span>`;
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
})
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Chart :max="100" :min="0" :fields="fields" :items="items" :yaxis="yaxis"></Chart>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
**The charts props inherit the table props** - As charts are an extension of the tables.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
| Option | Type | Default Value | Description |
|
|
13
|
+
| ------ | ---- | ------------- | ----------- |
|
|
14
|
+
| type | String | bar | Changes the type of chart shown (bar, line or pie) or by passing none a table is shown. |
|
|
15
|
+
| caption | String | - | Optional but recommended for accessibility concerns. Describes and summarizes the chart and the data inside it. |
|
|
16
|
+
| max | Number | - | Required numeric value to be used to work out the size/position of the chart elements. |
|
|
17
|
+
| min | Number | 0 | Optional (deaults to 0) numeric value to be used to work out the size/position of the chart elements. |
|
|
18
|
+
| yaxis | Array | - | Array of labels to be shown along the y-axis |
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="wrapper">
|
|
3
|
+
<input type="checkbox" name="showDrawer" id="showDrawer" class="d-none">
|
|
4
|
+
<div class="drawer__btn pb-0">
|
|
5
|
+
<div class="container text-end pb-0">
|
|
6
|
+
<label for="showDrawer" class="btn btn-secondary me-0">{{label}}</label>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="drawer" id="drawer" ref="drawer">
|
|
10
|
+
<div class="container text-end pb-0">
|
|
11
|
+
<label for="showDrawer" class="btn btn-tertiary mb-0 me-0 py-1 px-2"><span class="visually-hidden">Close</span>✕</label>
|
|
12
|
+
</div>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<hr id="drawer-end" />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<style lang="scss">
|
|
21
|
+
@import "../../../assets/sass/_func.scss";
|
|
22
|
+
@import "../../../assets/sass/components/drawer.scss";
|
|
23
|
+
</style>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
import drawer from '../../../assets/js/modules/drawer.js'
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'Header',
|
|
30
|
+
props: {
|
|
31
|
+
label: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mounted(){
|
|
37
|
+
|
|
38
|
+
this.$nextTick(function () {
|
|
39
|
+
|
|
40
|
+
let element = this.$refs.wrapper;
|
|
41
|
+
|
|
42
|
+
const fragment = document.createDocumentFragment();
|
|
43
|
+
Array.from(element.childNodes).forEach(child => fragment.appendChild(child));
|
|
44
|
+
element.parentNode.insertBefore(fragment, element);
|
|
45
|
+
element.parentNode.removeChild(element);
|
|
46
|
+
|
|
47
|
+
this.$nextTick(function () {
|
|
48
|
+
|
|
49
|
+
drawer(this.$refs.drawer);
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Drawer label="Open drawer">
|
|
5
|
+
<div class="container">
|
|
6
|
+
<h2>Drawer contentent</h2>
|
|
7
|
+
</div>
|
|
8
|
+
</Drawer>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Properties
|
|
12
|
+
|
|
13
|
+
| Option | Type | Default Value | Description |
|
|
14
|
+
| ------ | ---- | ------------- | ----------- |
|
|
15
|
+
| label | String | - | Required text for the button |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Slots
|
|
20
|
+
|
|
21
|
+
| Option | Default Value | Description |
|
|
22
|
+
| ------ | ------------- | ----------- |
|
|
23
|
+
| default | - | Will display within the drawer |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<header class="header-banner">
|
|
3
|
+
<div class="container">
|
|
4
|
+
<!-- Space for a breadcrumb trail -->
|
|
5
|
+
<slot name="breadcrumb"></slot>
|
|
6
|
+
<div class="header-banner__inner">
|
|
7
|
+
<h1 v-html="title"></h1>
|
|
8
|
+
<slot></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<picture v-if="image">
|
|
12
|
+
<!-- Actual image only loaded on desktops -->
|
|
13
|
+
<source :srcset="image" media="(min-width: 62em)">
|
|
14
|
+
<!-- Placeholder image -->
|
|
15
|
+
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" alt="" />
|
|
16
|
+
</picture>
|
|
17
|
+
</header>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style lang="scss">
|
|
21
|
+
@import "../../../assets/sass/_func.scss";
|
|
22
|
+
@import "../../../assets/sass/components/header.scss";
|
|
23
|
+
</style>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
name: 'Header',
|
|
28
|
+
props: {
|
|
29
|
+
title: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true
|
|
32
|
+
},
|
|
33
|
+
image: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Header title="Page title" :image="require('../../assets/code.jpeg')">
|
|
5
|
+
<template v-slot:breadcrumb>
|
|
6
|
+
<ul class="breadcrumb">
|
|
7
|
+
<li><a href="/">Home</a></li>
|
|
8
|
+
<li><a href="/top">Top level</a></li>
|
|
9
|
+
</ul>
|
|
10
|
+
</template>
|
|
11
|
+
<p>Page description</p>
|
|
12
|
+
</Header>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Properties
|
|
16
|
+
|
|
17
|
+
| Option | Type | Default Value | Description |
|
|
18
|
+
| ------ | ---- | ------------- | ----------- |
|
|
19
|
+
| title | String | - | Required |
|
|
20
|
+
| image | String | - | Optional image url to display in the background |
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
| Option | Default Value | Description |
|
|
26
|
+
| ------ | ------------- | ----------- |
|
|
27
|
+
| default | - | Will display underneath the heading inside of the white box |
|
|
28
|
+
| breadcrumb | - | An optional space to add a breadcrumb trail list. |
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="modal" :id="id" role="dialog" modal="true" ref="modal">
|
|
3
|
+
<a :href="`#${returnid?returnid:''}`" tabindex="-1"><span class="visually-hidden">Close</span></a>
|
|
4
|
+
<div class="modal__outer">
|
|
5
|
+
<a :href="`#${returnid?returnid:''}`" class="btn btn-tertiary py-1 px-2"><span class="visually-hidden">Close</span>✕</a>
|
|
6
|
+
<div class="modal__inner">
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
<button class="modal__dock--left btn btn-prev" tabindex="-1">Left</button>
|
|
11
|
+
<button class="modal__dock--right btn btn-next" tabindex="-1">Right</button>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style lang="scss">
|
|
16
|
+
@import "../../../assets/sass/_func.scss";
|
|
17
|
+
@import "../../../assets/sass/components/modal.scss";
|
|
18
|
+
</style>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import modal from '../../../assets/js/modules/modal.js'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'Modal',
|
|
25
|
+
props: {
|
|
26
|
+
id: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
returnid: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: 'close',
|
|
33
|
+
required: false
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mounted(){
|
|
37
|
+
|
|
38
|
+
this.$nextTick(function () {
|
|
39
|
+
|
|
40
|
+
modal(this.$refs.modal);
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Modal id="modal">
|
|
5
|
+
<!-- content -->
|
|
6
|
+
</Modal>
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
### Properties
|
|
10
|
+
|
|
11
|
+
| Option | Type | Default Value | Description |
|
|
12
|
+
| ------ | ---- | ------------- | ----------- |
|
|
13
|
+
| id | String | - | Required |
|
|
14
|
+
| returnid | String | close | Override the default id so that it will anchor to a specific location on the page. |
|
|
15
|
+
|
|
16
|
+
### Slots
|
|
17
|
+
|
|
18
|
+
| Option | Default Value | Description |
|
|
19
|
+
| ------ | ------------- | ----------- |
|
|
20
|
+
| default | - | Will display within the modal |
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<nav :class="`nav${hasSecondarySlot?` has-secondary`:''}`" ref="wrapper">
|
|
3
|
+
|
|
4
|
+
<input type="checkbox" name="showMenu" id="showMenu" class="d-none" />
|
|
5
|
+
<input type="checkbox" name="showSearch" id="showSearch" class="d-none" />
|
|
6
|
+
|
|
7
|
+
<div class="nav__inner">
|
|
8
|
+
<div class="container">
|
|
9
|
+
<div class="row">
|
|
10
|
+
<div class="col mw-md-fit-content nav__logo">
|
|
11
|
+
<a href="/" class="text-decoration-none mb-0">
|
|
12
|
+
<Logo :id="logo" :path="logopath" :desc="logotext" class="pb-0"></Logo>
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="col mw-fit-content nav__search-btn flex-row align-items-center" v-if="hasSearchSlot">
|
|
17
|
+
<label for="showSearch">
|
|
18
|
+
<svg class="icon" viewBox="0 0 32 32">
|
|
19
|
+
<title>Search</title>
|
|
20
|
+
<ellipse cx="14.92" cy="13.81" rx="11.92" ry="11.81" class="icon__outline" />
|
|
21
|
+
<line x1="22.68" y1="22.75" x2="30" y2="30" class="icon__outline" />
|
|
22
|
+
</svg>
|
|
23
|
+
</label>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn">
|
|
27
|
+
<label for="showMenu">Menu</label>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="col-12 col-md nav__menu ms-auto flex-row align-items-center">
|
|
31
|
+
<slot></slot>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="col-12 col-md nav__btn mw-md-fit-content flex-row align-items-center" v-if="btnlink">
|
|
35
|
+
<a :href="btnlink" class="btn me-0" v-html="btntext"></a>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
<div class="nav__menu--secondary bg-primary" v-if="hasSecondarySlot">
|
|
42
|
+
<div class="container">
|
|
43
|
+
<slot name="secondary"></slot>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="nav__menu--search" v-if="hasSearchSlot">
|
|
47
|
+
<div class="bg-gradient pt-4">
|
|
48
|
+
<div class="container">
|
|
49
|
+
<slot name="search"></slot>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
</nav>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<style lang="scss">
|
|
60
|
+
@import "../../../assets/sass/_func.scss";
|
|
61
|
+
//@import "../../../node_modules/bootstrap/scss/nav";
|
|
62
|
+
@import "../../../assets/sass/components/nav.scss";
|
|
63
|
+
</style>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
import nav from '../../../assets/js/modules/nav.js'
|
|
67
|
+
import Logo from '../../foundations/Logo/Logo.vue'
|
|
68
|
+
|
|
69
|
+
export default {
|
|
70
|
+
components: {
|
|
71
|
+
Logo
|
|
72
|
+
},
|
|
73
|
+
name: 'Nav',
|
|
74
|
+
props: {
|
|
75
|
+
logo: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
logotext: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false
|
|
82
|
+
},
|
|
83
|
+
logopath: {
|
|
84
|
+
type: String,
|
|
85
|
+
required: false
|
|
86
|
+
},
|
|
87
|
+
search: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: false
|
|
90
|
+
},
|
|
91
|
+
btnlink: {
|
|
92
|
+
type: String,
|
|
93
|
+
required: false
|
|
94
|
+
},
|
|
95
|
+
btntext: {
|
|
96
|
+
type: String,
|
|
97
|
+
required: false
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
data () {
|
|
101
|
+
return {
|
|
102
|
+
locationSave: ''
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
subIsActive (input) {
|
|
107
|
+
const paths = Array.isArray(input) ? input : [input]
|
|
108
|
+
return paths.some(path => {
|
|
109
|
+
return this.$route.path.indexOf(path) === 0 // current path starts with this path string
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
computed: {
|
|
114
|
+
hasSecondarySlot() {
|
|
115
|
+
return !!this.$slots.secondary
|
|
116
|
+
},
|
|
117
|
+
hasSearchSlot() {
|
|
118
|
+
return !!this.$slots.search
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
mounted(){
|
|
122
|
+
|
|
123
|
+
this.$nextTick(function () {
|
|
124
|
+
|
|
125
|
+
nav(this.$refs.wrapper);
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</script>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Nav></Nav>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
| Option | Type | Default Value | Description |
|
|
10
|
+
| ------ | ---- | ------------- | ----------- |
|
|
11
|
+
| logo | String | property | Update which logo is shown |
|
|
12
|
+
| logotext | String | - | Optional logo text |
|
|
13
|
+
| btnlink | String | - | Optional button can be added, used mainly for links relating to user accounts. |
|
|
14
|
+
| btntext | String | - | Text used within the above button |
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Slots
|
|
18
|
+
|
|
19
|
+
| Option | Default Value | Description |
|
|
20
|
+
| ------ | ------------- | ----------- |
|
|
21
|
+
| default | - | Populates the main nav area, use a ul.list-unstyled element |
|
|
22
|
+
| secondary | - |Populates the secondary nav area (top bar when on desktop), use a ul.list-unstyled element |
|
|
23
|
+
| search | - | Populates the search featured area area |
|