@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,236 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="wrapperClass()" ref="wrapper">
|
|
3
|
+
<label v-if="needsLabel()" :class="`form-label${labelclass?` ${labelclass}`:''}`" :for="id" v-html="displayLabel()"></label>
|
|
4
|
+
|
|
5
|
+
<!-- Standard input field -->
|
|
6
|
+
<input v-if="isInput()" v-model="inputVal" :class="`form-control${size?` form-control-${size}`:``}${inputclass?` ${inputclass}`:``}`" :type="type" :name="name?name:id" :id="id" :pattern="needPattern()" :list="hasOptions()" v-bind="$attrs" v-on:keyup="inputKeyup" />
|
|
7
|
+
|
|
8
|
+
<!-- Textarea -->
|
|
9
|
+
<textarea v-if="type=='textarea'" v-model="inputVal" :class="`form-control${size?` form-control-${size}`:``}${inputclass?` ${inputclass}`:``}`" :type="type" :name="name?name:id" :id="id" :pattern="needPattern()" v-bind="$attrs"></textarea>
|
|
10
|
+
|
|
11
|
+
<!-- Range -->
|
|
12
|
+
<div class="input-group" v-if="type=='range'">
|
|
13
|
+
<input v-model="inputVal" :class="`form-range${inputclass?` ${inputclass}`:``}`" :type="type" :name="name?name:id" :id="id" :pattern="needPattern()" :list="hasOptions()" v-bind="$attrs" oninput="this.nextElementSibling.value=this.value;" />
|
|
14
|
+
<output class="input-group-text border-0 col-2 col-sm-1 px-0">{{value}}</output>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<!-- Color picker -->
|
|
18
|
+
<div class="input-group" v-if="type=='color'">
|
|
19
|
+
<input v-model="inputVal" :class="`form-control form-control-color${inputclass?` ${inputclass}`:``}`" :type="type" :name="name?name:id" :id="id" :pattern="needPattern()" :list="hasOptions()" v-bind="$attrs" oninput="this.nextElementSibling.value=this.value;" />
|
|
20
|
+
<output class="input-group-text flex-fill">{{value?vale:'#000000'}}</output>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<!-- Select/dropdown -->
|
|
24
|
+
<select v-if="type=='select'" v-model="inputVal" :class="`form-select${size?` form-select-${size}`:``}${inputclass?` ${inputclass}`:``}`" :type="type" :name="id" :id="id" :pattern="needPattern()" v-bind="$attrs">
|
|
25
|
+
<option v-for="(value,index) in options" :key="index" :value="value.value">{{value.display ? value.display : value.value}}</option>
|
|
26
|
+
</select>
|
|
27
|
+
|
|
28
|
+
<datalist v-if="allowDatalist()" :id="id+'-list'">
|
|
29
|
+
<option v-for="(value,index) in options" :key="index" :value="value.value">{{value.value}}</option>
|
|
30
|
+
</datalist>
|
|
31
|
+
|
|
32
|
+
<!-- Checkbox -->
|
|
33
|
+
<input v-if="type=='checkbox'||type=='radio'" class="form-check-input" :type="type" :name="name?name:id" :id="id" v-bind="$attrs" />
|
|
34
|
+
<label v-if="type=='checkbox'||type=='radio'" :class="`form-label form-check-label${labelclass?` ${labelclass}`:''}`" :for="id" v-html="label"></label>
|
|
35
|
+
|
|
36
|
+
<!-- Checkbox Button -->
|
|
37
|
+
<input v-if="type=='checkbox-btn'||type=='radio-btn'" :class="`btn-check${inputclass?` ${inputclass}`:``}`" :type="type.replace('-btn','')" autocomplete="off" :name="name?name:id" :id="id" v-bind="$attrs" />
|
|
38
|
+
<label v-if="type=='checkbox-btn'||type=='radio-btn'" :class="`btn${labelclass?` ${labelclass}`:''}`" :for="id" v-html="label" @click="clickEvent"></label>
|
|
39
|
+
|
|
40
|
+
<!-- Error message -->
|
|
41
|
+
<p v-if="errormsg" class="invalid-feedback mb-0" v-html="errormsg"></p>
|
|
42
|
+
<slot></slot>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'Input',
|
|
50
|
+
props: {
|
|
51
|
+
value: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
id: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true
|
|
58
|
+
},
|
|
59
|
+
name: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
63
|
+
list: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
label: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: false
|
|
70
|
+
},
|
|
71
|
+
labelclass: {
|
|
72
|
+
type: String,
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
inputclass: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: false
|
|
78
|
+
},
|
|
79
|
+
type: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false,
|
|
82
|
+
default: 'text'
|
|
83
|
+
},
|
|
84
|
+
size: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
errormsg: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
92
|
+
options: {
|
|
93
|
+
type: Array,
|
|
94
|
+
required: false
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
computed: {
|
|
98
|
+
displayLabel() {
|
|
99
|
+
return () => {
|
|
100
|
+
|
|
101
|
+
if(this.$attrs.multiple){
|
|
102
|
+
return this.label+`<span class="small d-block text-body font-body fw-normal">Hold down the Ctrl (windows) or Command (Mac) button to select multiple options.</span>`
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return this.label;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
wrapperClass () {
|
|
109
|
+
return () => {
|
|
110
|
+
switch(this.type) {
|
|
111
|
+
case 'radio':
|
|
112
|
+
case 'checkbox':
|
|
113
|
+
return 'form-check'
|
|
114
|
+
case 'radio-btn':
|
|
115
|
+
case 'checkbox-btn':
|
|
116
|
+
return false
|
|
117
|
+
default:
|
|
118
|
+
return 'form-control__wrapper'
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
needPattern () {
|
|
123
|
+
return () => {
|
|
124
|
+
|
|
125
|
+
if(this.pattern)
|
|
126
|
+
return this.pattern;
|
|
127
|
+
|
|
128
|
+
// Create fallback patterns for input types
|
|
129
|
+
switch(this.type) {
|
|
130
|
+
case 'datetime-local':
|
|
131
|
+
return '[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return false
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
needsLabel () {
|
|
138
|
+
return () => {
|
|
139
|
+
switch(this.type) {
|
|
140
|
+
case 'radio':
|
|
141
|
+
case 'radio-btn':
|
|
142
|
+
case 'checkbox':
|
|
143
|
+
case 'checkbox-btn':
|
|
144
|
+
return false
|
|
145
|
+
default:
|
|
146
|
+
return true
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
isInput () {
|
|
151
|
+
return () => {
|
|
152
|
+
switch(this.type) {
|
|
153
|
+
case 'textarea':
|
|
154
|
+
case 'select':
|
|
155
|
+
case 'radio':
|
|
156
|
+
case 'radio-btn':
|
|
157
|
+
case 'checkbox':
|
|
158
|
+
case 'checkbox-btn':
|
|
159
|
+
case 'range':
|
|
160
|
+
case 'color':
|
|
161
|
+
return false
|
|
162
|
+
default:
|
|
163
|
+
return true
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
allowDatalist () {
|
|
168
|
+
return () => {
|
|
169
|
+
switch(this.type) {
|
|
170
|
+
case 'select':
|
|
171
|
+
case 'radio':
|
|
172
|
+
case 'radio-btn':
|
|
173
|
+
case 'checkbox':
|
|
174
|
+
case 'checkbox-btn':
|
|
175
|
+
return false
|
|
176
|
+
default:
|
|
177
|
+
return true
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
hasOptions() {
|
|
182
|
+
return () => {
|
|
183
|
+
|
|
184
|
+
if(this.list)
|
|
185
|
+
return this.list;
|
|
186
|
+
|
|
187
|
+
if(this.options) {
|
|
188
|
+
return this.id+'-list'
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
inputVal: {
|
|
193
|
+
get() {
|
|
194
|
+
// Default to the first options if no value set for select field
|
|
195
|
+
if(this.value == undefined && this.options != undefined && this.type =="select"){
|
|
196
|
+
|
|
197
|
+
// Return an empty array if muliple attribute is set
|
|
198
|
+
if(this.$attrs.multiple){
|
|
199
|
+
return [];
|
|
200
|
+
}
|
|
201
|
+
return this.options[0].value;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return this.value;
|
|
205
|
+
},
|
|
206
|
+
set(val) {
|
|
207
|
+
|
|
208
|
+
this.$emit('input', val);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
mounted(){
|
|
213
|
+
|
|
214
|
+
this.$nextTick(function () {
|
|
215
|
+
|
|
216
|
+
let element = this.$refs.wrapper;
|
|
217
|
+
// Remove unnecessary divs that may get in the way of our CSS sibling selectors working
|
|
218
|
+
if(element.parentNode && element.parentNode.classList.contains('form-check') || element.classList.length == 0){
|
|
219
|
+
|
|
220
|
+
const fragment = document.createDocumentFragment();
|
|
221
|
+
Array.from(element.childNodes).forEach(child => fragment.appendChild(child));
|
|
222
|
+
element.parentNode.insertBefore(fragment, element);
|
|
223
|
+
element.parentNode.removeChild(element);
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
},
|
|
227
|
+
methods: {
|
|
228
|
+
inputKeyup(event){
|
|
229
|
+
this.$emit('keyupEvent',event);
|
|
230
|
+
},
|
|
231
|
+
clickEvent(){
|
|
232
|
+
this.$emit('bus');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
</script>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Input id="fieldid" label="Label"></Input>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
| Option | Type | Default Value | Description |
|
|
10
|
+
| ------ | ---- | ------------- | ----------- |
|
|
11
|
+
| id | String | - | Required |
|
|
12
|
+
| label | String | - | Not required but recommended |
|
|
13
|
+
| labelclass | String | - | Optional way of adding classes to the label, useful for assigning column class to label when usiong inline input fields. |
|
|
14
|
+
| inputclass | String | - | Optional way of adding classes to the input field, useful for assigning column class to label when usiong inline input fields. |
|
|
15
|
+
| type | String | text | Assign different types to the input fields like number, email and date. |
|
|
16
|
+
| size | String | - | Choose from either 'sm' and 'lg' |
|
|
17
|
+
| errormsg | String | - | Error message thats shown when the field fails form validation. |
|
|
18
|
+
| options | Array | - | Used for the select type input field to populate the dropdown. Can also be used to create a datalist when used in conjuction of any other input type than select. |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Table :fields="fields" :items="items"></Table>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
| Option | Type | Default Value | Description |
|
|
10
|
+
| ------ | ---- | ------------- | ----------- |
|
|
11
|
+
| items | Array | - | Table row data passed |
|
|
12
|
+
| fields | Array | - | Table header titles |
|
|
13
|
+
| sort | string | - | Choose from ascending or descending |
|
|
14
|
+
| sortBy | string | - | Needs to match a column name and will trigger sorting via that column on page load |
|
|
15
|
+
| show | number | - | Limits the number of results shown and will create pagination controls. |
|
|
16
|
+
| page | number | - | Starting page for the pagination. |
|
|
17
|
+
| reorder | bool | - | Create an order column and allow for the table rows to be reordered |
|
|
18
|
+
|
|
19
|
+
### Class modifiers
|
|
20
|
+
|
|
21
|
+
- **.table-fullwidth** - Prevents the table from stacking on mobile
|
|
22
|
+
- **.table-striped** - Add zebra-striping to the table
|
|
23
|
+
- **.table-hover** - Enable a hover state on table rows within a <tbody>
|
|
24
|
+
|
|
25
|
+
### Make columns filterable or sortable
|
|
26
|
+
|
|
27
|
+
To give a column some extra functionality extra values need to be set in the data.
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
fields: [
|
|
31
|
+
{
|
|
32
|
+
key: 'name',
|
|
33
|
+
filterable: true,
|
|
34
|
+
sortable: true
|
|
35
|
+
},
|
|
36
|
+
{ key: 'address' }
|
|
37
|
+
]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Custom JavaScript Events
|
|
41
|
+
|
|
42
|
+
A custom event can be hooked into when the table gets updated by one of it filters.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
this.$el.addEventListener('filtered', function (e) {
|
|
46
|
+
|
|
47
|
+
console.log('Table filtered')
|
|
48
|
+
}, false);
|
|
49
|
+
|
|
50
|
+
// Sorted
|
|
51
|
+
this.$el.addEventListener('sorted', function (e) {
|
|
52
|
+
|
|
53
|
+
console.log('Table sorted')
|
|
54
|
+
}, false);
|
|
55
|
+
```
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="table__wrapper" ref="wrapper" :data-sortby="sortby" :data-sort="sort" :data-show="show" :data-page="page" :data-reorder="reorder">
|
|
3
|
+
<table>
|
|
4
|
+
<thead v-if="fields">
|
|
5
|
+
<tr>
|
|
6
|
+
<th v-for="(field) in fields" :key="field.key" :data-sortable="field.sortable" :data-filterable="field.filterable">{{ cellHeading(field.key) }}</th>
|
|
7
|
+
</tr>
|
|
8
|
+
</thead>
|
|
9
|
+
<tbody v-if="items">
|
|
10
|
+
<tr v-for="(value,index) in items" :key="index">
|
|
11
|
+
<td :key="cellIndex" v-for="(cellValue,cellIndex) in value" v-html="cellValue" :data-label="cellHeading(cellIndex)" :data-numeric="numericValue(cellValue)"></td>
|
|
12
|
+
</tr>
|
|
13
|
+
</tbody>
|
|
14
|
+
</table>
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import { ucfirst, unsnake } from '../../helpers/strings'
|
|
21
|
+
import table from '../../../assets/js/modules/table.js'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'Table',
|
|
25
|
+
props: {
|
|
26
|
+
reorder: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: false
|
|
29
|
+
},
|
|
30
|
+
page: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
show: {
|
|
35
|
+
type: Number,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
sortby: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
sort: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: false
|
|
45
|
+
},
|
|
46
|
+
items: {
|
|
47
|
+
type: Array,
|
|
48
|
+
required: true
|
|
49
|
+
},
|
|
50
|
+
fields: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
computed: {
|
|
56
|
+
cellHeading () {
|
|
57
|
+
return (heading) => {
|
|
58
|
+
return `${ucfirst(unsnake(heading))}`
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
numericValue () {
|
|
62
|
+
return (value) => {
|
|
63
|
+
|
|
64
|
+
value = value.replace('£','')
|
|
65
|
+
value = value.replace('%','')
|
|
66
|
+
|
|
67
|
+
if (Number.isNaN(Number.parseFloat(value))) {
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return Number.parseFloat(value)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
mounted(){
|
|
76
|
+
|
|
77
|
+
this.$nextTick(function () {
|
|
78
|
+
|
|
79
|
+
table(this.$refs.wrapper);
|
|
80
|
+
|
|
81
|
+
// Listen for the event.
|
|
82
|
+
this.$el.addEventListener('sorted', function (e) {
|
|
83
|
+
|
|
84
|
+
console.log('Table sorted')
|
|
85
|
+
}, false);
|
|
86
|
+
|
|
87
|
+
this.$el.addEventListener('filtered', function (e) {
|
|
88
|
+
|
|
89
|
+
console.log('Table filtered')
|
|
90
|
+
}, false);
|
|
91
|
+
|
|
92
|
+
})
|
|
93
|
+
},
|
|
94
|
+
updated(){
|
|
95
|
+
this.$nextTick(function () {
|
|
96
|
+
|
|
97
|
+
// If the data gets updated we may need to recreate the tbody as it get detached when sorted in the table.js
|
|
98
|
+
let tbody = this.$refs.wrapper.querySelector('tbody');
|
|
99
|
+
|
|
100
|
+
let tbodyHTML = '';
|
|
101
|
+
this.items.forEach((row, index) => {
|
|
102
|
+
tbodyHTML += `<tr>${ Object.keys(row).map(col => `<td data-label="${ucfirst(unsnake(col))}">${row[col]}</td>` ).join("") }</tr>`;
|
|
103
|
+
});
|
|
104
|
+
tbody.innerHTML = tbodyHTML;
|
|
105
|
+
|
|
106
|
+
// Tell the framework that the table has been filtered so that it can re-sort it etc
|
|
107
|
+
const updatedEvent = new Event('filtered');
|
|
108
|
+
this.$refs.wrapper.dispatchEvent(updatedEvent);
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg class="icon">
|
|
3
|
+
<title>{{id}}</title>
|
|
4
|
+
<use :xlink:href="'#icon-'+id+'-bg'" class="icon__bg"></use>
|
|
5
|
+
<use :xlink:href="'#icon-'+id+'-fill'" class="icon__fill"></use>
|
|
6
|
+
<use :xlink:href="'#icon-'+id+'-outline'" class="icon__outline"></use>
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'Icon',
|
|
13
|
+
props: {
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false,
|
|
17
|
+
default: 'email'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Icon id="email"></Logo>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
| Option | Type | Default Value | Description |
|
|
10
|
+
| ------ | ---- | ------------- | ----------- |
|
|
11
|
+
| id | String | property | This property declares which icon to choose from. See icon listing. |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="className">
|
|
3
|
+
<svg>
|
|
4
|
+
<title>iam {{id}}</title>
|
|
5
|
+
<use :xlink:href="path+src"></use>
|
|
6
|
+
</svg>
|
|
7
|
+
<span v-if="desc" v-html="desc"></span>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'Logo',
|
|
13
|
+
props: {
|
|
14
|
+
id: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false,
|
|
17
|
+
default: 'property'
|
|
18
|
+
},
|
|
19
|
+
path: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
default: ''
|
|
23
|
+
},
|
|
24
|
+
desc: {
|
|
25
|
+
type: String
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
src: function () {
|
|
30
|
+
// `this` points to the vm instance
|
|
31
|
+
return '#logo-' + this.id
|
|
32
|
+
},
|
|
33
|
+
className: function () {
|
|
34
|
+
// `this` points to the vm instance
|
|
35
|
+
return 'brand brand--' + this.id
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<Logo id="property" desc="the founders<br/>of iamsold"></Logo>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
| Option | Type | Default Value | Description |
|
|
10
|
+
| ------ | ---- | ------------- | ----------- |
|
|
11
|
+
| id | String | property | This property declares which logo to choose from. |
|
|
12
|
+
| desc | String | | Optional description will be added to the right of logo. For eaxmple 'the founders of iamsold' can be added to the right of the IAM property logo. |
|
|
13
|
+
|
|
14
|
+
### ID Options
|
|
15
|
+
- property
|
|
16
|
+
- sold
|
|
17
|
+
- medwaylaw
|
|
18
|
+
- compliance
|
|
19
|
+
- movebutler
|
|
20
|
+
- key
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="youtube-embed ratio ratio-16x9" ref="wrapper">
|
|
3
|
+
<a :href="`https://www.youtube.com/watch?v=${video}`" target="_blank" title="Investments Video" :data-id="video">
|
|
4
|
+
<img :src="`https://img.youtube.com/vi/${video}/maxresdefault.jpg`" alt="">
|
|
5
|
+
<span class="btn btn-secondary">Play Video</span>
|
|
6
|
+
</a>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
import youtubeVideo from '../../../assets/js/modules/youtubevideo.js'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'YoutuveVideo',
|
|
14
|
+
props: {
|
|
15
|
+
video: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
mounted(){
|
|
21
|
+
new youtubeVideo(this.$refs.wrapper);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const ucfirst = (str) => str.charAt(0).toUpperCase() + str.slice(1)
|
|
2
|
+
export const ucwords = (str) => str.split(' ').map(s => ucfirst(s)).join(' ')
|
|
3
|
+
export const unsnake = (str) => str.replace(/_/g, ' ')
|
|
4
|
+
export const snake = (str) => str.replace(/ /g, '_')
|
|
5
|
+
export const safeID = function(str){
|
|
6
|
+
|
|
7
|
+
str = str.toLowerCase();
|
|
8
|
+
str = snake(str);
|
|
9
|
+
str = str.replace(/\W/g,'');
|
|
10
|
+
|
|
11
|
+
return str;
|
|
12
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
1
|
+
// Foundations
|
|
2
|
+
export { default as Icon } from './foundations/Icon/Icon.vue'
|
|
3
|
+
export { default as Logo } from './foundations/Logo/Logo.vue'
|
|
4
|
+
// Elements
|
|
5
|
+
export { default as Table } from './elements/Table/Table.vue'
|
|
6
|
+
export { default as Input } from './elements/Input/Input.vue'
|
|
7
|
+
// Components
|
|
8
|
+
export { default as Accordion } from './components/Accordion/Accordion.vue'
|
|
9
|
+
export { default as Banner } from './components/Banner/Banner.vue'
|
|
10
|
+
export { default as Card } from './components/Card/Card.vue'
|
|
11
|
+
export { default as CardDeck } from './components/CardDeck/CardDeck.vue'
|
|
12
|
+
export { default as Carousel } from './components/Carousel/Carousel.vue'
|
|
13
|
+
export { default as Header } from './components/Header/Header.vue'
|
|
14
|
+
export { default as Testimonial } from './components/Testimonial/Testimonial.vue'
|
|
15
|
+
export { default as PropertySearchbar } from './components/PropertySearchbar/PropertySearchbar.vue'
|
|
16
|
+
export { default as Nav } from './components/Nav/Nav.vue'
|
|
17
|
+
export { default as Drawer } from './components/Drawer/Drawer.vue'
|
|
18
|
+
export { default as Modal } from './components/Modal/Modal.vue'
|
|
19
|
+
|
|
20
|
+
export { default as Tabs } from './components/Tabs/Tabs.vue'
|
|
21
|
+
export { default as Tab } from './components/Tabs/Tab.vue'
|