@iamproperty/components 2.7.0 → 2.7.1

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.
Files changed (48) hide show
  1. package/assets/css/core.min.css +1 -1
  2. package/assets/css/core.min.css.map +1 -1
  3. package/assets/css/style.min.css +1 -1
  4. package/assets/css/style.min.css.map +1 -1
  5. package/assets/js/modules/form.js +110 -0
  6. package/assets/js/modules/table.js +16 -8
  7. package/assets/js/scripts.bundle.js +85 -5
  8. package/assets/js/scripts.bundle.js.map +1 -1
  9. package/assets/js/scripts.bundle.min.js +2 -2
  10. package/assets/js/scripts.bundle.min.js.map +1 -1
  11. package/assets/sass/_corefiles.scss +1 -0
  12. package/assets/sass/_functions/mixins.scss +1 -1
  13. package/assets/sass/_functions/utilities.scss +9 -0
  14. package/assets/sass/_functions/variables.scss +35 -2
  15. package/assets/sass/components/accordion.scss +2 -2
  16. package/assets/sass/components/alert.scss +3 -3
  17. package/assets/sass/components/charts.scss +5 -9
  18. package/assets/sass/components/drawer.scss +3 -3
  19. package/assets/sass/components/header.scss +2 -1
  20. package/assets/sass/components/modal.scss +3 -3
  21. package/assets/sass/components/nav.scss +217 -20
  22. package/assets/sass/components/stepper.scss +1 -1
  23. package/assets/sass/components/tabs.scss +28 -2
  24. package/assets/sass/elements/container.scss +1 -1
  25. package/assets/sass/elements/forms.scss +66 -0
  26. package/assets/sass/elements/lists.scss +63 -0
  27. package/assets/sass/elements/panel.scss +162 -0
  28. package/assets/sass/elements/tables.scss +31 -0
  29. package/assets/sass/elements/tooltips.scss +29 -18
  30. package/assets/sass/foundations/media.scss +3 -3
  31. package/assets/sass/foundations/root.scss +11 -2
  32. package/dist/components.common.js +371 -36
  33. package/dist/components.common.js.map +1 -1
  34. package/dist/components.css +1 -1
  35. package/dist/components.css.map +1 -1
  36. package/dist/components.umd.js +371 -36
  37. package/dist/components.umd.js.map +1 -1
  38. package/dist/components.umd.min.js +1 -1
  39. package/dist/components.umd.min.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/Nav/Nav.vue +120 -5
  42. package/src/components/NoteFeed/NoteFeed.vue +79 -0
  43. package/src/components/NoteFeed/README.md +16 -0
  44. package/src/elements/FileUploads/FileUploads.vue +48 -0
  45. package/src/elements/FileUploads/README.md +24 -0
  46. package/src/elements/Input/Input.vue +33 -1
  47. package/src/elements/Input/README.md +1 -0
  48. package/src/index.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamproperty/components",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "private": false,
5
5
  "description": "Component library for iamproperty",
6
6
  "author": {
@@ -4,10 +4,13 @@
4
4
  <input type="checkbox" name="showMenu" id="showMenu" class="d-none" />
5
5
  <input type="checkbox" name="showSearch" id="showSearch" class="d-none" />
6
6
 
7
- <div class="nav__inner">
7
+ <div class="nav__inner" v-if="isMarketplace === false">
8
8
  <div class="container">
9
9
  <div class="row">
10
- <div class="col mw-md-fit-content nav__logo">
10
+ <div class="col mw-md-fit-content nav__logo" v-if="hasLogoSlot">
11
+ <slot name="logo"></slot>
12
+ </div>
13
+ <div class="col mw-md-fit-content nav__logo" v-else>
11
14
  <a href="/" class="text-decoration-none mb-0">
12
15
  <Logo :id="logo" :path="logopath" :desc="logotext" class="pb-0"></Logo>
13
16
  </a>
@@ -38,7 +41,7 @@
38
41
 
39
42
  </div>
40
43
  </div>
41
- <div class="nav__menu--secondary bg-primary" v-if="hasSecondarySlot">
44
+ <div class="nav__menu--secondary" v-if="hasSecondarySlot">
42
45
  <div class="container">
43
46
  <slot name="secondary"></slot>
44
47
  </div>
@@ -52,7 +55,108 @@
52
55
  </div>
53
56
  </div>
54
57
 
55
-
58
+ <div class="nav__inner" v-else>
59
+ <div class="container">
60
+ <div class="row">
61
+ <div class="col nav__logo">
62
+ <a href="/standalone/marketplace" :class="`text-decoration-none mb-0 ${logo=='property'?'current':''}`">
63
+ <Logo id="property" class="pb-0 pe-0"></Logo>
64
+ </a>
65
+
66
+ <a href="/standalone/movebutler" :class="`text-decoration-none mb-0 ${logo=='movebutler'?'current':''}`">
67
+ <Logo id="movebutler" class="pb-0 pe-0"></Logo>
68
+ </a>
69
+
70
+ <a href="/standalone/agent" :class="`text-decoration-none mb-0 ${logo=='sold'?'current':''}`">
71
+ <Logo id="sold" class="pb-0 pe-0"></Logo>
72
+ </a>
73
+ </div>
74
+
75
+ <div class="col mw-fit-content flex-row align-items-center nav__menu-btn">
76
+ <label for="showMenu">Menu</label>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ <div class="nav__menu--secondary bg-primary" v-if="hasSecondarySlot">
81
+ <div class="container">
82
+ <slot name="secondary"></slot>
83
+ </div>
84
+ </div>
85
+ <div class="nav__menu flex-row">
86
+ <span class="h6 text-muted">Services</span>
87
+
88
+ <a href="/standalone/marketplace" class="text-decoration-none mb-4 d-flex justify-content-between align-items-center">
89
+ <Logo id="property" class="pb-0 pe-0 fs-2"></Logo>
90
+ <span class="text-success">Active</span>
91
+ </a>
92
+
93
+ <a href="/standalone/movebutler" class="text-decoration-none mb-4 d-flex justify-content-between align-items-center">
94
+ <Logo id="movebutler" class="pb-0 pe-0 fs-2"></Logo>
95
+ <span class="text-success">Active</span>
96
+ </a>
97
+
98
+ <a href="/standalone/agent" class="text-decoration-none mb-5 d-flex justify-content-between align-items-center">
99
+ <Logo id="sold" class="pb-0 pe-0 fs-2"></Logo>
100
+ <span class="text-success">Active</span>
101
+ </a>
102
+
103
+ <span class="h6 text-muted">My Branches</span>
104
+
105
+ <form>
106
+ <Input type="select" id="test1" label="Today, you're at" :options="[{display:'Branch 1',value:'1'},{display:'Branch Two',value:'2'},{display:'Create new branch',value:'new'}]" data-value-if="new" data-redirect="/cp/company/branches/create"></Input>
107
+ </form>
108
+
109
+ <span class="h6 text-muted">Menu</span>
110
+
111
+ <a href="/" class="nav__featured-link text-decoration-none pb-3 d-block mb-0">
112
+ <span class="row">
113
+ <span class="col mw-fit-content"><i class="icon fs-1 fa-user"></i></span>
114
+ <span class="col">
115
+ <span Class="h5 mb-1">Control panel</span>
116
+ <span class="text-muted small">
117
+ Manage your iamproperty account, branches, staff, billing and invoices
118
+ </span>
119
+ </span>
120
+ </span>
121
+ </a>
122
+
123
+ <a href="/" class="nav__featured-link text-decoration-none pb-3 border-top pt-3 d-block mb-0">
124
+ <span class="row">
125
+ <span class="col mw-fit-content"><Icon id="tick-list" class="fs-1 m-0"></Icon></span>
126
+ <span class="col">
127
+ <span Class="h5 mb-1">Quick start guide & FAQ</span>
128
+ <span class="text-muted small">
129
+ Download a guide on how to manage your account
130
+ </span>
131
+ </span>
132
+ </span>
133
+ </a>
134
+
135
+ <a href="/" class="nav__featured-link text-decoration-none pb-3 border-top pt-3 d-block mb-0">
136
+ <span class="row">
137
+ <span class="col mw-fit-content"><Icon id="chat" class="fs-1 m-0 p-1"></Icon></span>
138
+ <span class="col">
139
+ <span Class="h5 mb-1">Contact us</span>
140
+ <span class="text-muted small">
141
+ Get in touch
142
+ </span>
143
+ </span>
144
+ </span>
145
+ </a>
146
+
147
+ <a href="/" class="nav__featured-link text-decoration-none pb-3 border-top pt-3 d-block mb-0">
148
+ <span class="row">
149
+ <span class="col mw-fit-content"><i class="icon fs-1 fa-sign-out"></i></span>
150
+ <span class="col">
151
+ <span Class="h5 mb-1">Log out</span>
152
+ <span class="text-muted small">
153
+ Martin Critchlow<br> Watson-Clark
154
+ </span>
155
+ </span>
156
+ </span>
157
+ </a>
158
+ </div>
159
+ </div>
56
160
  </nav>
57
161
  </template>
58
162
 
@@ -63,10 +167,15 @@
63
167
  <script>
64
168
  import nav from '../../../assets/js/modules/nav.js'
65
169
  import Logo from '../../foundations/Logo/Logo.vue'
170
+ import Input from '../../elements/Input/Input.vue'
171
+ import Icon from '../../foundations/Icon/Icon.vue'
172
+
66
173
 
67
174
  export default {
68
175
  components: {
69
- Logo
176
+ Input,
177
+ Logo,
178
+ Icon
70
179
  },
71
180
  name: 'Nav',
72
181
  props: {
@@ -109,11 +218,17 @@ export default {
109
218
  }
110
219
  },
111
220
  computed: {
221
+ hasLogoSlot() {
222
+ return !!this.$slots.logo
223
+ },
112
224
  hasSecondarySlot() {
113
225
  return !!this.$slots.secondary
114
226
  },
115
227
  hasSearchSlot() {
116
228
  return !!this.$slots.search
229
+ },
230
+ isMarketplace() {
231
+ return this.$vnode.data.staticClass && this.$vnode.data.staticClass.includes('nav--marketplace') ? true : false;
117
232
  }
118
233
  },
119
234
  mounted(){
@@ -0,0 +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>
@@ -0,0 +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. |
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <div class="multiple-file-uploads mb-4">
3
+
4
+ <div class="row">
5
+ <div :class="`${inputcolclass ? inputcolclass : 'col-12 col-sm-4'}`">
6
+ <Input type="file" :id="id" :name="`${id}[]`" label="Add new file" labelclass="d-none" class="form-control-inline col" required :data-filesize="maxfilesize"></Input>
7
+ </div>
8
+ <div class="col-12 col-md me-auto">
9
+ <slot></slot>
10
+ </div>
11
+ <div class="col mw-fit-content">
12
+ <button type="button" class="btn btn-tertiary me-0" data-delete>Delete</button>
13
+ </div>
14
+ </div>
15
+
16
+ <button type="button" class="btn btn-secondary me-0" data-add :data-maxfiles="maxfiles">+ Add file</button>
17
+
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import Input from '../../elements/Input/Input.vue'
23
+
24
+ export default {
25
+ components: {
26
+ Input
27
+ },
28
+ name: 'FileUploads',
29
+ props: {
30
+ id: {
31
+ type: String,
32
+ required: true
33
+ },
34
+ inputcolclass: {
35
+ type: String,
36
+ required: false
37
+ },
38
+ maxfilesize: {
39
+ type: Number,
40
+ required: false
41
+ },
42
+ maxfiles: {
43
+ type: Number,
44
+ required: false
45
+ }
46
+ }
47
+ }
48
+ </script>
@@ -0,0 +1,24 @@
1
+ ### Usage
2
+
3
+ ```
4
+ <Card :title="value.title" :content="value.content" :link="value.link"></Card>
5
+ ```
6
+
7
+ ### Properties
8
+
9
+ | Option | Type | Default Value | Description |
10
+ | ------ | ---- | ------------- | ----------- |
11
+ | title | String | - | Used for the card heading |
12
+ | titleclass | String | h2 | Update the class of the title from being a h2 |
13
+ | subtitle | String | - | Optional sub heading |
14
+ | content | HTML | - | Card content |
15
+ | link | String | - | Card link |
16
+ | type | String | - | Change the type of card (simple,quick)|
17
+ | btntype | String | secondary | Change the type of button at the bottom of the card (primary,secondary,tertairy, link) |
18
+ | ctatext | String | Find out more | Update the cta text within the button at the bottom of the card |
19
+ | details | Object | - | Build up the card content with pre-defined bits of data |
20
+ | - detail.tags | Array of strings | - | Add tags above the card header |
21
+ | - detail.guideprice | String | - | Property guide price |
22
+ | - detail.auctiontime | String | - | Auction time left |
23
+ | - detail.readtime | String | - | How long it will take to read |
24
+ | - detail.status | String | - | Display a status badge at the top of the card |
@@ -1,7 +1,11 @@
1
1
  <template>
2
2
  <div :class="wrapperClass()" ref="wrapper">
3
- <label v-if="needsLabel()" :class="`form-label${labelclass?` ${labelclass}`:''}`" :for="id" v-html="displayLabel()"></label>
3
+ <label v-if="needsLabel()" :class="`form-label${labelclass?` ${labelclass}`:''}`" :for="id" v-html="displayLabel()" :title="title"></label>
4
4
 
5
+ <!-- Prefix and Suffix -->
6
+ <span :class="`prefix ${this.prefixClass} ${size?`prefix-${size}`:''}`" v-html="prefix" v-if="prefix" role="presentation"></span>
7
+ <span :class="`suffix ${this.suffixClass} ${size?`suffix-${size}`:''}`" v-html="suffix" v-if="suffix" role="presentation"></span>
8
+
5
9
  <!-- Standard input field -->
6
10
  <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
11
 
@@ -92,6 +96,30 @@ export default {
92
96
  options: {
93
97
  type: Array,
94
98
  required: false
99
+ },
100
+ prefix: {
101
+ type: String,
102
+ required: false
103
+ },
104
+ prefixClass: {
105
+ type: String,
106
+ required: false
107
+ },
108
+ suffix: {
109
+ type: String,
110
+ required: false
111
+ },
112
+ suffixClass: {
113
+ type: String,
114
+ required: false
115
+ },
116
+ title: {
117
+ type: String,
118
+ required: false
119
+ },
120
+ hint: {
121
+ type: String,
122
+ required: false
95
123
  }
96
124
  },
97
125
  computed: {
@@ -101,6 +129,10 @@ export default {
101
129
  if(this.$attrs.multiple){
102
130
  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
131
  }
132
+
133
+ if(this.hint){
134
+ return this.label+`<span class="small d-block text-body font-body fw-normal">${this.hint}</span>`
135
+ }
104
136
 
105
137
  return this.label;
106
138
  }
@@ -16,3 +16,4 @@
16
16
  | size | String | - | Choose from either 'sm' and 'lg' |
17
17
  | errormsg | String | - | Error message thats shown when the field fails form validation. |
18
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. |
19
+ | prefix | String | - | Display a character or two in front of the input field |
package/src/index.js CHANGED
@@ -4,6 +4,7 @@ export { default as Logo } from './foundations/Logo/Logo.vue'
4
4
  // Elements
5
5
  export { default as Table } from './elements/Table/Table.vue'
6
6
  export { default as Input } from './elements/Input/Input.vue'
7
+ export { default as FileUploads } from './elements/FileUploads/FileUploads.vue'
7
8
  // Components
8
9
  export { default as Accordion } from './components/Accordion/Accordion.vue'
9
10
  export { default as AccordionItem } from './components/Accordion/AccordionItem.vue'
@@ -23,3 +24,4 @@ export { default as Step } from './components/Stepper/Step.vue'
23
24
  export { default as Tabs } from './components/Tabs/Tabs.vue'
24
25
  export { default as Tab } from './components/Tabs/Tab.vue'
25
26
  export { default as Alert } from './components/Alert/Alert.vue'
27
+ export { default as NoteFeed } from './components/NoteFeed/NoteFeed.vue'