@iamproperty/components 2.7.7 → 2.9.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 +136 -136
- package/assets/css/core.min.css +1 -1
- package/assets/css/core.min.css.map +1 -1
- package/assets/css/email.min.css +1 -1
- package/assets/css/email.min.css.map +1 -1
- package/assets/css/error.min.css +1 -1
- package/assets/css/error.min.css.map +1 -1
- package/assets/css/style.min.css +1 -1
- package/assets/css/style.min.css.map +1 -1
- package/assets/js/modules/accordion.js +32 -36
- package/assets/js/modules/alert.js +56 -56
- package/assets/js/modules/carousel.js +101 -101
- package/assets/js/modules/chart.js +216 -216
- package/assets/js/modules/drawer.js +15 -15
- package/assets/js/modules/form.js +158 -158
- package/assets/js/modules/helpers.js +119 -97
- package/assets/js/modules/modal.js +89 -89
- package/assets/js/modules/nav.js +26 -26
- package/assets/js/modules/table.js +584 -584
- package/assets/js/modules/testimonial.js +82 -82
- package/assets/js/modules/youtubevideo.js +145 -145
- package/assets/js/scripts.bundle.js +174 -85
- package/assets/js/scripts.bundle.js.map +1 -1
- package/assets/js/scripts.bundle.min.js +2 -2
- package/assets/js/scripts.bundle.min.js.map +1 -1
- package/assets/sass/_components.scss +14 -14
- package/assets/sass/_corefiles.scss +40 -40
- package/assets/sass/_fonts.scss +16 -16
- package/assets/sass/_forms.scss +9 -9
- package/assets/sass/_func.scss +12 -10
- package/assets/sass/_functions/functions.scss +141 -141
- package/assets/sass/_functions/mixins.scss +170 -170
- package/assets/sass/_functions/utilities.scss +250 -250
- package/assets/sass/_functions/variables.scss +466 -462
- package/assets/sass/_print.scss +61 -61
- package/assets/sass/components/accordion.scss +197 -197
- package/assets/sass/components/alert.scss +98 -98
- package/assets/sass/components/cardDeck.scss +107 -107
- package/assets/sass/components/carousel.scss +234 -234
- package/assets/sass/components/charts.scss +569 -569
- package/assets/sass/components/drawer.scss +46 -46
- package/assets/sass/components/header.scss +63 -63
- package/assets/sass/components/modal.scss +136 -136
- package/assets/sass/components/nav.scss +916 -820
- package/assets/sass/components/property-searchbar.scss +143 -143
- package/assets/sass/components/snapshot.scss +70 -70
- package/assets/sass/components/stepper.scss +164 -164
- package/assets/sass/components/tabs.scss +87 -74
- package/assets/sass/components/testimonial.scss +132 -132
- package/assets/sass/components/timeline.scss +95 -95
- package/assets/sass/core.scss +6 -6
- package/assets/sass/elements/buttons.scss +209 -209
- package/assets/sass/elements/card.scss +177 -177
- package/assets/sass/elements/container.scss +225 -225
- package/assets/sass/elements/forms.scss +194 -194
- package/assets/sass/elements/links.scss +96 -96
- package/assets/sass/elements/lists.scss +112 -112
- package/assets/sass/elements/panel.scss +161 -161
- package/assets/sass/elements/tables.scss +290 -290
- package/assets/sass/elements/tooltips.scss +84 -84
- package/assets/sass/elements/type.scss +136 -136
- package/assets/sass/email.scss +65 -65
- package/assets/sass/error.scss +4 -4
- package/assets/sass/foundations/brand.scss +72 -72
- package/assets/sass/foundations/circles.scss +74 -74
- package/assets/sass/foundations/icons.scss +72 -72
- package/assets/sass/foundations/media.scss +50 -50
- package/assets/sass/foundations/reboot.scss +130 -129
- package/assets/sass/foundations/root.scss +106 -104
- package/assets/sass/main.scss +7 -7
- package/assets/svg/icons.svg +598 -588
- package/assets/svg/logo.svg +42 -42
- package/assets/{js/main.js → ts/main.ts} +68 -67
- package/assets/ts/modules/accordion.ts +43 -0
- package/dist/components.common.js +148 -98
- package/dist/components.common.js.map +1 -1
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/components.umd.js +182 -132
- 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 +108 -103
- package/src/components/Accordion/Accordion.vue +22 -22
- package/src/components/Accordion/AccordionItem.vue +52 -52
- package/src/components/Accordion/README.md +34 -34
- package/src/components/Alert/Alert.vue +39 -39
- package/src/components/Alert/README.md +28 -28
- package/src/components/Banner/Banner.vue +38 -38
- package/src/components/Banner/README.md +23 -23
- package/src/components/CardDeck/CardDeck.vue +77 -77
- package/src/components/CardDeck/README.md +24 -24
- package/src/components/Carousel/Carousel.vue +85 -85
- package/src/components/Carousel/README.md +19 -19
- package/src/components/Chart/Chart.vue +88 -88
- package/src/components/Chart/README.md +17 -17
- package/src/components/Drawer/Drawer.vue +53 -53
- package/src/components/Drawer/README.md +22 -22
- package/src/components/Header/Header.vue +38 -38
- package/src/components/Header/README.md +27 -27
- package/src/components/Modal/Modal.vue +43 -43
- package/src/components/Modal/README.md +19 -19
- package/src/components/Nav/Nav.vue +212 -189
- package/src/components/Nav/README.md +22 -22
- package/src/components/NoteFeed/NoteFeed.vue +79 -79
- package/src/components/NoteFeed/README.md +16 -16
- package/src/components/PropertySearchbar/PropertySearchbar.vue +204 -204
- package/src/components/PropertySearchbar/README.md +25 -25
- package/src/components/Snapshot/README.md +20 -20
- package/src/components/Snapshot/Snapshot.vue +32 -32
- package/src/components/Stepper/README.md +32 -32
- package/src/components/Stepper/Step.vue +28 -28
- package/src/components/Stepper/Stepper.vue +33 -33
- package/src/components/Tabs/README.md +27 -27
- package/src/components/Tabs/Tab.vue +26 -26
- package/src/components/Tabs/Tabs.vue +75 -75
- package/src/components/Testimonial/README.md +25 -25
- package/src/components/Testimonial/Testimonial.vue +60 -60
- package/src/components/Timeline/README.md +18 -18
- package/src/components/Timeline/Timeline.vue +24 -24
- package/src/elements/Card/Card.vue +113 -113
- package/src/elements/Card/README.md +24 -24
- package/src/elements/FileUploads/FileUploads.vue +48 -48
- package/src/elements/FileUploads/README.md +24 -24
- package/src/elements/Input/Input.vue +268 -268
- package/src/elements/Input/README.md +19 -19
- package/src/elements/Table/README.md +62 -62
- package/src/elements/Table/Table.vue +126 -116
- package/src/foundations/Icon/Icon.vue +24 -24
- package/src/foundations/Icon/README.md +11 -11
- package/src/foundations/Logo/Logo.vue +39 -39
- package/src/foundations/Logo/README.md +20 -20
- package/src/foundations/YoutubeVideo/README.md +11 -11
- package/src/foundations/YoutubeVideo/YoutubeVideo.vue +24 -24
- package/src/helpers/strings.js +12 -12
- package/src/index.js +27 -27
- package/assets/.DS_Store +0 -0
- package/src/.DS_Store +0 -0
|
@@ -1,189 +1,212 @@
|
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
</
|
|
101
|
-
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
type: String,
|
|
139
|
-
required: false
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
type: String,
|
|
143
|
-
required: false
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
type: String,
|
|
147
|
-
required: false
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
type: String,
|
|
151
|
-
required: false
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
+
<input type="checkbox" name="showAccount" id="showAccount" class="d-none" />
|
|
7
|
+
|
|
8
|
+
<!-- Mobile bar -->
|
|
9
|
+
<div class="nav__mobile-bar">
|
|
10
|
+
<div class="container">
|
|
11
|
+
<div class="row">
|
|
12
|
+
<div class="col mw-md-fit-content nav__logo" v-if="hasLogoSlot">
|
|
13
|
+
<slot name="logo"></slot>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="col mw-md-fit-content nav__logo" v-else>
|
|
16
|
+
<a href="/" class="text-decoration-none mb-0">
|
|
17
|
+
<Logo :id="logo" :path="logopath" :desc="logotext" class="pb-0"></Logo>
|
|
18
|
+
</a>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn">
|
|
22
|
+
<label for="showMenu">Menu</label>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="nav__inner">
|
|
29
|
+
<div class="container">
|
|
30
|
+
<div class="row">
|
|
31
|
+
<div class="col mw-md-fit-content nav__logo" v-if="hasLogoSlot">
|
|
32
|
+
<slot name="logo"></slot>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="col mw-md-fit-content nav__logo" v-else>
|
|
35
|
+
<a href="/" class="text-decoration-none mb-0">
|
|
36
|
+
<Logo :id="logo" :path="logopath" :desc="logotext" class="pb-0"></Logo>
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="col mw-fit-content nav__search-btn flex-row align-items-center" v-if="hasSearchSlot">
|
|
41
|
+
<label for="showSearch">
|
|
42
|
+
<svg class="icon" viewBox="0 0 32 32">
|
|
43
|
+
<title>Search</title>
|
|
44
|
+
<ellipse cx="14.92" cy="13.81" rx="11.92" ry="11.81" class="icon__outline" />
|
|
45
|
+
<line x1="22.68" y1="22.75" x2="30" y2="30" class="icon__outline" />
|
|
46
|
+
</svg>
|
|
47
|
+
</label>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn">
|
|
51
|
+
<label for="showMenu">Menu</label>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<!-- Main menu -->
|
|
55
|
+
<div class="col-12 col-md nav__menu ms-auto flex-row align-items-center">
|
|
56
|
+
<slot></slot>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="col nav__account-btn flex-row align-items-center" v-if="hasAccountSlot">
|
|
60
|
+
<label for="showAccount">
|
|
61
|
+
<svg class="icon" viewBox="0 0 28 28">
|
|
62
|
+
<use xlink:href="/svg/icons.svg#icon-account"></use>
|
|
63
|
+
</svg>
|
|
64
|
+
<span>My account</span>
|
|
65
|
+
</label>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="col-12 col-md nav__btn mw-md-fit-content flex-row align-items-center" v-if="btnlink">
|
|
69
|
+
<a :href="btnlink" class="btn me-0" v-html="btntext"></a>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="nav__menu--secondary" v-if="hasSecondarySlot">
|
|
77
|
+
<div class="container">
|
|
78
|
+
<slot name="secondary"></slot>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="nav__menu--search" v-if="hasSearchSlot">
|
|
82
|
+
<div class="bg-gradient pt-4">
|
|
83
|
+
<div class="container">
|
|
84
|
+
<slot name="search"></slot>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div class="nav__menu--account" v-if="hasAccountSlot">
|
|
91
|
+
<div class="container">
|
|
92
|
+
<div class="row mb-4">
|
|
93
|
+
<div class="col mw-md-fit-content nav__logo" v-if="hasLogoSlot">
|
|
94
|
+
<slot name="logo"></slot>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="col mw-md-fit-content nav__logo" v-else>
|
|
97
|
+
<a href="/" class="text-decoration-none mb-0">
|
|
98
|
+
<Logo :id="logo" :path="logopath" :desc="logotext" class="pb-0"></Logo>
|
|
99
|
+
</a>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div class="col mw-fit-content d-md-none flex-row align-items-center nav__menu-btn">
|
|
103
|
+
<label for="showAccount">Account</label>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="container">
|
|
109
|
+
<slot name="account"></slot>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<span class="nav__bg"></span>
|
|
115
|
+
</nav>
|
|
116
|
+
</template>
|
|
117
|
+
|
|
118
|
+
<style lang="scss">
|
|
119
|
+
@import "../../../assets/sass/components/nav.scss";
|
|
120
|
+
</style>
|
|
121
|
+
|
|
122
|
+
<script>
|
|
123
|
+
import nav from '../../../assets/js/modules/nav.js'
|
|
124
|
+
import Logo from '../../foundations/Logo/Logo.vue'
|
|
125
|
+
import Input from '../../elements/Input/Input.vue'
|
|
126
|
+
import Icon from '../../foundations/Icon/Icon.vue'
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
export default {
|
|
130
|
+
components: {
|
|
131
|
+
Input,
|
|
132
|
+
Logo,
|
|
133
|
+
Icon
|
|
134
|
+
},
|
|
135
|
+
name: 'Nav',
|
|
136
|
+
props: {
|
|
137
|
+
logo: {
|
|
138
|
+
type: String,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
logotext: {
|
|
142
|
+
type: String,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
logopath: {
|
|
146
|
+
type: String,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
search: {
|
|
150
|
+
type: String,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
btnlink: {
|
|
154
|
+
type: String,
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
btntext: {
|
|
158
|
+
type: String,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
propertylink: {
|
|
162
|
+
type: String,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
movebutlerlink: {
|
|
166
|
+
type: String,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
iamsoldlink: {
|
|
170
|
+
type: String,
|
|
171
|
+
required: false
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
data () {
|
|
175
|
+
return {
|
|
176
|
+
locationSave: ''
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
methods: {
|
|
180
|
+
subIsActive (input) {
|
|
181
|
+
const paths = Array.isArray(input) ? input : [input]
|
|
182
|
+
return paths.some(path => {
|
|
183
|
+
return this.$route.path.indexOf(path) === 0 // current path starts with this path string
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
computed: {
|
|
188
|
+
hasLogoSlot() {
|
|
189
|
+
return !!this.$slots.logo
|
|
190
|
+
},
|
|
191
|
+
hasSecondarySlot() {
|
|
192
|
+
return !!this.$slots.secondary
|
|
193
|
+
},
|
|
194
|
+
hasSearchSlot() {
|
|
195
|
+
return !!this.$slots.search
|
|
196
|
+
},
|
|
197
|
+
hasAccountSlot() {
|
|
198
|
+
return !!this.$slots.account
|
|
199
|
+
},
|
|
200
|
+
isMarketplace() {
|
|
201
|
+
return this.$vnode.data.staticClass && this.$vnode.data.staticClass.includes('nav--marketplace') ? true : false;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
mounted(){
|
|
205
|
+
|
|
206
|
+
this.$nextTick(function () {
|
|
207
|
+
|
|
208
|
+
nav(this.$refs.wrapper);
|
|
209
|
+
})
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
</script>
|
|
@@ -1,23 +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 |
|
|
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
23
|
| search | - | Populates the search featured area area |
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="container note-feed mb-2">
|
|
3
|
-
<span class="h3" v-html="title" v-if="title"></span>
|
|
4
|
-
|
|
5
|
-
<Table :fields="[{ key: 'date_added' },{ key: 'user' },{ key: 'note' }]" :items="itemsData" v-bind="$props" class="mb-0"></Table>
|
|
6
|
-
<form :action="action" :method="method" @submit.prevent="submitForm(...arguments)">
|
|
7
|
-
<input type="hidden" :value="user" name="user" />
|
|
8
|
-
<Input id="addNote" type="textarea" label="Add note" required class="mw-100"></Input>
|
|
9
|
-
<button class="btn btn-tertiary">Submit note</button>
|
|
10
|
-
</form>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import Input from '../../elements/Input/Input.vue'
|
|
16
|
-
import Table from '../../elements/Table/Table.vue'
|
|
17
|
-
let tableProps = Table.props;
|
|
18
|
-
tableProps.fields.required = false;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
components: {
|
|
23
|
-
Table,
|
|
24
|
-
Input
|
|
25
|
-
},
|
|
26
|
-
data () {
|
|
27
|
-
return {
|
|
28
|
-
itemsData: [...this.items] // Redefine data to avoid bleeding of data to other components
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
methods: {
|
|
32
|
-
submitForm: function(event){
|
|
33
|
-
|
|
34
|
-
console.log(this)
|
|
35
|
-
|
|
36
|
-
const data = new FormData(event.target);
|
|
37
|
-
|
|
38
|
-
let today = new Date();
|
|
39
|
-
const yyyy = today.getFullYear();
|
|
40
|
-
let mm = today.getMonth() + 1; // Months start at 0!
|
|
41
|
-
let dd = today.getDate();
|
|
42
|
-
|
|
43
|
-
if (dd < 10) dd = '0' + dd;
|
|
44
|
-
if (mm < 10) mm = '0' + mm;
|
|
45
|
-
|
|
46
|
-
today = dd + '/' + mm + '/' + yyyy;
|
|
47
|
-
|
|
48
|
-
this.itemsData.unshift({
|
|
49
|
-
date_added: today,
|
|
50
|
-
user: data.get('user'),
|
|
51
|
-
note: data.get('addNote')
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
this.$emit('formSubmitted',event);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
name: 'NoteFeed',
|
|
58
|
-
props: {
|
|
59
|
-
user: {
|
|
60
|
-
type: String,
|
|
61
|
-
required: true
|
|
62
|
-
},
|
|
63
|
-
...tableProps,
|
|
64
|
-
title: {
|
|
65
|
-
type: String,
|
|
66
|
-
required: false
|
|
67
|
-
},
|
|
68
|
-
method: {
|
|
69
|
-
type: String,
|
|
70
|
-
required: false,
|
|
71
|
-
default: 'post'
|
|
72
|
-
},
|
|
73
|
-
action: {
|
|
74
|
-
type: String,
|
|
75
|
-
required: false
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container note-feed mb-2">
|
|
3
|
+
<span class="h3" v-html="title" v-if="title"></span>
|
|
4
|
+
|
|
5
|
+
<Table :fields="[{ key: 'date_added' },{ key: 'user' },{ key: 'note' }]" :items="itemsData" v-bind="$props" class="mb-0"></Table>
|
|
6
|
+
<form :action="action" :method="method" @submit.prevent="submitForm(...arguments)">
|
|
7
|
+
<input type="hidden" :value="user" name="user" />
|
|
8
|
+
<Input id="addNote" type="textarea" label="Add note" required class="mw-100"></Input>
|
|
9
|
+
<button class="btn btn-tertiary">Submit note</button>
|
|
10
|
+
</form>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import Input from '../../elements/Input/Input.vue'
|
|
16
|
+
import Table from '../../elements/Table/Table.vue'
|
|
17
|
+
let tableProps = Table.props;
|
|
18
|
+
tableProps.fields.required = false;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
components: {
|
|
23
|
+
Table,
|
|
24
|
+
Input
|
|
25
|
+
},
|
|
26
|
+
data () {
|
|
27
|
+
return {
|
|
28
|
+
itemsData: [...this.items] // Redefine data to avoid bleeding of data to other components
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
methods: {
|
|
32
|
+
submitForm: function(event){
|
|
33
|
+
|
|
34
|
+
console.log(this)
|
|
35
|
+
|
|
36
|
+
const data = new FormData(event.target);
|
|
37
|
+
|
|
38
|
+
let today = new Date();
|
|
39
|
+
const yyyy = today.getFullYear();
|
|
40
|
+
let mm = today.getMonth() + 1; // Months start at 0!
|
|
41
|
+
let dd = today.getDate();
|
|
42
|
+
|
|
43
|
+
if (dd < 10) dd = '0' + dd;
|
|
44
|
+
if (mm < 10) mm = '0' + mm;
|
|
45
|
+
|
|
46
|
+
today = dd + '/' + mm + '/' + yyyy;
|
|
47
|
+
|
|
48
|
+
this.itemsData.unshift({
|
|
49
|
+
date_added: today,
|
|
50
|
+
user: data.get('user'),
|
|
51
|
+
note: data.get('addNote')
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
this.$emit('formSubmitted',event);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
name: 'NoteFeed',
|
|
58
|
+
props: {
|
|
59
|
+
user: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true
|
|
62
|
+
},
|
|
63
|
+
...tableProps,
|
|
64
|
+
title: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: false
|
|
67
|
+
},
|
|
68
|
+
method: {
|
|
69
|
+
type: String,
|
|
70
|
+
required: false,
|
|
71
|
+
default: 'post'
|
|
72
|
+
},
|
|
73
|
+
action: {
|
|
74
|
+
type: String,
|
|
75
|
+
required: false
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
### Usage
|
|
2
|
-
|
|
3
|
-
```
|
|
4
|
-
<NoteFeed user="User name" :fields="fields" :items="items" :show="3" @formSubmitted="submitForm(...arguments)"></NoteFeed>
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
<p class="note"><strong>Note:</strong> See the tables documentation for the table props which are inherited here</p>
|
|
10
|
-
|
|
11
|
-
| Option | Type | Default Value | Description |
|
|
12
|
-
| ------ | ---- | ------------- | ----------- |
|
|
13
|
-
| user | String | - | Required |
|
|
14
|
-
| title | String | - | Optional as we may want to add the title outside of the note feed. |
|
|
15
|
-
| method | String | post | Form method of posting the data, post or get |
|
|
16
|
-
| action | String| | Optional URL to submit the form too, not really usefull for Vue JS. |
|
|
1
|
+
### Usage
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
<NoteFeed user="User name" :fields="fields" :items="items" :show="3" @formSubmitted="submitForm(...arguments)"></NoteFeed>
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
<p class="note"><strong>Note:</strong> See the tables documentation for the table props which are inherited here</p>
|
|
10
|
+
|
|
11
|
+
| Option | Type | Default Value | Description |
|
|
12
|
+
| ------ | ---- | ------------- | ----------- |
|
|
13
|
+
| user | String | - | Required |
|
|
14
|
+
| title | String | - | Optional as we may want to add the title outside of the note feed. |
|
|
15
|
+
| method | String | post | Form method of posting the data, post or get |
|
|
16
|
+
| action | String| | Optional URL to submit the form too, not really usefull for Vue JS. |
|