@worksafevictoria/wcl7.5 1.8.0-beta.8 → 1.8.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/package.json +1 -1
- package/src/components/Common/CardGridItem/index.vue +0 -1
- package/src/components/Containers/Subheader/index.vue +19 -25
- package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.stories.js +30 -0
- package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +182 -0
- package/src/components/Paragraphs/Directory/Asbestos/Records/index.stories.js +19 -0
- package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +259 -0
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +1 -1
- package/src/components/Paragraphs/Map/index.vue +3 -1
- package/src/index.js +2 -0
- package/src/mock/asbestos-removalists.js +226 -0
- package/src/components/Paragraphs/Map/postcode_location.json +0 -3543
package/package.json
CHANGED
|
@@ -11,12 +11,11 @@
|
|
|
11
11
|
:is-selectable="true"
|
|
12
12
|
:row-spacing="isSingleColumn && !singleLineCards ? 'large' : 'small'"
|
|
13
13
|
@selected="selectedCard"
|
|
14
|
-
@gridColumnSize="
|
|
15
|
-
(gridColumnSize) => (isSingleColumn = gridColumnSize === 1)
|
|
16
|
-
"
|
|
14
|
+
@gridColumnSize="(gridColumnSize) => (isSingleColumn = gridColumnSize === 1)"
|
|
17
15
|
>
|
|
18
16
|
<template v-slot:cardItem="{ card }">
|
|
19
17
|
<card-grid-item
|
|
18
|
+
v-if="card.description"
|
|
20
19
|
:show-divider="!singleLineCards"
|
|
21
20
|
:card-header-title="singleLineCards ? null : card.title"
|
|
22
21
|
:header-size="card.titleSize"
|
|
@@ -38,10 +37,7 @@
|
|
|
38
37
|
[`w-100 text-left`]: alignLeft,
|
|
39
38
|
}"
|
|
40
39
|
>
|
|
41
|
-
<strong
|
|
42
|
-
v-if="singleLineCards && card.title"
|
|
43
|
-
v-html="card.title + ': '"
|
|
44
|
-
>
|
|
40
|
+
<strong v-if="singleLineCards && card.title" v-html="card.title + ': '">
|
|
45
41
|
</strong>
|
|
46
42
|
<span v-html="card.description"></span>
|
|
47
43
|
</div>
|
|
@@ -51,12 +47,12 @@
|
|
|
51
47
|
</card-grid>
|
|
52
48
|
</template>
|
|
53
49
|
<script>
|
|
54
|
-
import { navigateToPath, isGovSite } from
|
|
55
|
-
import CardGrid from
|
|
56
|
-
import CardGridItem from
|
|
50
|
+
import { navigateToPath, isGovSite } from "../../../../lib/utility";
|
|
51
|
+
import CardGrid from "../../Common/CardGrid/index.vue";
|
|
52
|
+
import CardGridItem from "../../Common/CardGridItem/index.vue";
|
|
57
53
|
|
|
58
54
|
export default {
|
|
59
|
-
name:
|
|
55
|
+
name: "Subheader",
|
|
60
56
|
components: { CardGrid, CardGridItem },
|
|
61
57
|
props: {
|
|
62
58
|
itemList: {
|
|
@@ -72,11 +68,11 @@ export default {
|
|
|
72
68
|
},
|
|
73
69
|
background: {
|
|
74
70
|
type: String,
|
|
75
|
-
default:
|
|
71
|
+
default: "none",
|
|
76
72
|
},
|
|
77
73
|
heading: {
|
|
78
74
|
type: String,
|
|
79
|
-
default:
|
|
75
|
+
default: "",
|
|
80
76
|
},
|
|
81
77
|
alignLeft: {
|
|
82
78
|
type: Boolean,
|
|
@@ -91,48 +87,46 @@ export default {
|
|
|
91
87
|
},
|
|
92
88
|
type: {
|
|
93
89
|
type: String,
|
|
94
|
-
default:
|
|
90
|
+
default: "",
|
|
95
91
|
},
|
|
96
92
|
},
|
|
97
93
|
data() {
|
|
98
94
|
return {
|
|
99
95
|
isSingleColumn: false,
|
|
100
|
-
}
|
|
96
|
+
};
|
|
101
97
|
},
|
|
102
98
|
methods: {
|
|
103
99
|
selectedCard(card) {
|
|
104
100
|
// Some custom logic for gov caretaker logic
|
|
105
101
|
if (
|
|
106
|
-
(this.$config
|
|
107
|
-
? this.$config.public.caretaker
|
|
108
|
-
: process.env.CARETAKER) === 'true'
|
|
102
|
+
(this.$config ? this.$config.public.caretaker : process.env.CARETAKER) === "true"
|
|
109
103
|
) {
|
|
110
104
|
if (!isGovSite(card?.selectedCard?.linkHref)) {
|
|
111
105
|
// this.$store.commit('page/SET_CARETAKER_REF', 'subheader')
|
|
112
106
|
// this.$root.$emit('caretaker-open', card?.selectedCard?.linkHref)
|
|
113
107
|
if (this.$pageStore) {
|
|
114
|
-
this.$pageStore.caretaker.referrer =
|
|
108
|
+
this.$pageStore.caretaker.referrer = "subheader";
|
|
115
109
|
}
|
|
116
110
|
if (this.$bus) {
|
|
117
|
-
this.$bus.$emit(
|
|
111
|
+
this.$bus.$emit("caretaker-open", card?.selectedCard?.linkHref);
|
|
118
112
|
}
|
|
119
113
|
} else {
|
|
120
114
|
navigateToPath.call(
|
|
121
115
|
this,
|
|
122
116
|
card?.selectedCard?.linkHref,
|
|
123
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
124
|
-
)
|
|
117
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
118
|
+
);
|
|
125
119
|
}
|
|
126
120
|
} else {
|
|
127
121
|
navigateToPath.call(
|
|
128
122
|
this,
|
|
129
123
|
card?.selectedCard?.linkHref,
|
|
130
|
-
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
131
|
-
)
|
|
124
|
+
card?.ev?.ctrlKey === true || card?.ev?.metaKey === true
|
|
125
|
+
);
|
|
132
126
|
}
|
|
133
127
|
},
|
|
134
128
|
},
|
|
135
|
-
}
|
|
129
|
+
};
|
|
136
130
|
</script>
|
|
137
131
|
<style lang="scss" scoped>
|
|
138
132
|
.subheader {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import arRecord from './index.vue'
|
|
2
|
+
|
|
3
|
+
const arData =
|
|
4
|
+
{
|
|
5
|
+
title: 'Ventia Utility Services Pty Limited',
|
|
6
|
+
fullAddress: 'Ventia - Cardinia Building, 25 Lucknow Street MITCHAM VIC 3132',
|
|
7
|
+
workPhone: '0438531164',
|
|
8
|
+
mobilePhone: '0438531164',
|
|
9
|
+
email: 'daniel.dehaan@ventia.com',
|
|
10
|
+
website: 'http://www.ventia.com.au',
|
|
11
|
+
contact1: 'Daniel DeHaan',
|
|
12
|
+
phone1: '0438531164',
|
|
13
|
+
email1: 'daniel.dehaan@ventia.com',
|
|
14
|
+
mobile1: '0438531164',
|
|
15
|
+
serviceCategory: 'Class B - Restricted - Asbestos Removalists',
|
|
16
|
+
services: 'Bituminous coal tar coatings,Non-friable Asbestos Cement Water Pipes and Associated Fittings ONLY,Non-friable Asbetos Containing Bituminous Coating on Mild Steel Pipes',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
title: 'Paragraphs/Directory/Asbestos/SingleRecord',
|
|
22
|
+
component: arRecord,
|
|
23
|
+
tags: ['autodocs']
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Removalist = {}
|
|
27
|
+
|
|
28
|
+
Removalist.args = {
|
|
29
|
+
item: arData,
|
|
30
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="paragraph--directory__records--dir">
|
|
3
|
+
<!-- Main details -->
|
|
4
|
+
<container>
|
|
5
|
+
<row class="records">
|
|
6
|
+
<column md="2" sm="12" class="title" >
|
|
7
|
+
<a name="titleLink" v-if="item.title" href="javascript:void(0)" :aria-expanded="visible ? 'true' : 'false'" @click="this.visible = !this.visible">
|
|
8
|
+
{{ item.title }}
|
|
9
|
+
</a>
|
|
10
|
+
</column>
|
|
11
|
+
<column md="2" sm="12" class="address" >
|
|
12
|
+
<div class="label">Office address</div>
|
|
13
|
+
<a v-if="item.fullAddress" target="_blank" :href="gMapLink"><span class="sr-only visually-hidden">Address</span>
|
|
14
|
+
{{ item.fullAddress }}
|
|
15
|
+
</a>
|
|
16
|
+
</column>
|
|
17
|
+
<column md="2" sm="12" class="coldata longstring" >
|
|
18
|
+
<div class="label">Email</div>
|
|
19
|
+
<a v-if="item.email" target="_blank" :href="`mailto:${item.email}`"><span class="sr-only visually-hidden">Email address</span>
|
|
20
|
+
{{ item.email }}
|
|
21
|
+
</a>
|
|
22
|
+
</column>
|
|
23
|
+
<column md="3" sm="12" class="coldata longstring" >
|
|
24
|
+
<div class="label">Website</div>
|
|
25
|
+
<a v-if="item.website" target="_blank" :href="`${item.website}`"><span class="sr-only visually-hidden">Website address</span>
|
|
26
|
+
{{ item.website }}
|
|
27
|
+
</a>
|
|
28
|
+
</column>
|
|
29
|
+
<column md="2" sm="12" class="coldata" >
|
|
30
|
+
<div class="label">Phone</div>
|
|
31
|
+
<a v-if="item.workPhone || item.mobilePhone" :href="`tel:${item.workPhone || item.mobilePhone}`"><span class="sr-only visually-hidden">Phone number</span>
|
|
32
|
+
{{ item.workPhone || item.mobilePhone }}
|
|
33
|
+
</a>
|
|
34
|
+
</column>
|
|
35
|
+
</row>
|
|
36
|
+
<div class="dir-caret" >
|
|
37
|
+
<a v-if="visible" href="javascript:void(0)" @click="this.visible = false">
|
|
38
|
+
<img
|
|
39
|
+
:src="CaretUp"
|
|
40
|
+
height="12"
|
|
41
|
+
width="17"
|
|
42
|
+
alt="Expand Detail">
|
|
43
|
+
</a>
|
|
44
|
+
<a v-if="!visible" href="javascript:void(0)" @click="this.visible = true">
|
|
45
|
+
<img
|
|
46
|
+
:src="CaretDown"
|
|
47
|
+
height="12"
|
|
48
|
+
width="17"
|
|
49
|
+
alt="Expand Detail">
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
</container>
|
|
53
|
+
|
|
54
|
+
<!-- Additional Content -->
|
|
55
|
+
<container>
|
|
56
|
+
<div v-if="this.visible">
|
|
57
|
+
<div style="padding-top: 20px;">
|
|
58
|
+
<hr>
|
|
59
|
+
</div>
|
|
60
|
+
<!-- Contacts, if any -->
|
|
61
|
+
<div v-if="validContacts">
|
|
62
|
+
<row >
|
|
63
|
+
<column >
|
|
64
|
+
<h4>Contact Information</h4>
|
|
65
|
+
</column>
|
|
66
|
+
</row>
|
|
67
|
+
<row v-if="item.contact1 !== ''">
|
|
68
|
+
<column sm="2" class="label" >
|
|
69
|
+
Contact
|
|
70
|
+
</column>
|
|
71
|
+
<column sm="4" class="dir-additional-records">
|
|
72
|
+
{{item.contact1}}
|
|
73
|
+
</column>
|
|
74
|
+
</row>
|
|
75
|
+
<row v-if="item.phone1 !== ''">
|
|
76
|
+
<column sm="2" class="label" >
|
|
77
|
+
Phone
|
|
78
|
+
</column>
|
|
79
|
+
<column sm="4" class="dir-additional-records" >
|
|
80
|
+
{{item.phone1}}
|
|
81
|
+
</column>
|
|
82
|
+
</row>
|
|
83
|
+
<row v-if="item.mobile1 !== ''">
|
|
84
|
+
<column sm="2" class="label" >
|
|
85
|
+
Mobile
|
|
86
|
+
</column>
|
|
87
|
+
<column sm="4" class="dir-additional-records" >
|
|
88
|
+
{{item.mobile1}}
|
|
89
|
+
</column>
|
|
90
|
+
</row>
|
|
91
|
+
<row v-if="item.email1 !== ''">
|
|
92
|
+
<column sm="2" class="label" >
|
|
93
|
+
Email
|
|
94
|
+
</column>
|
|
95
|
+
<column sm="4" class="dir-additional-records">
|
|
96
|
+
{{item.email1}}
|
|
97
|
+
</column>
|
|
98
|
+
</row>
|
|
99
|
+
</div>
|
|
100
|
+
<div v-if="item.serviceCategory">
|
|
101
|
+
<row class="row-dir-additional">
|
|
102
|
+
<column>
|
|
103
|
+
<h4> {{ item.serviceCategory }}</h4>
|
|
104
|
+
</column>
|
|
105
|
+
</row>
|
|
106
|
+
<row class="dir-additional-records">
|
|
107
|
+
<column >
|
|
108
|
+
<ul>
|
|
109
|
+
<li v-for="(serv) in item.services.split(',')" :key="serv.id">
|
|
110
|
+
{{serv}}
|
|
111
|
+
</li>
|
|
112
|
+
</ul>
|
|
113
|
+
</column>
|
|
114
|
+
</row>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</container>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
<script>
|
|
121
|
+
import Container from '../../../../../Containers/Container/index.vue'
|
|
122
|
+
import Row from '../../../../../Containers/Row/index.vue'
|
|
123
|
+
import Column from '../../../../../Containers/Column/index.vue'
|
|
124
|
+
import CaretUp from './../../../../../../assets/icons/caret-up.svg?url'
|
|
125
|
+
import CaretDown from './../../../../../../assets/icons/caret-down.svg?url'
|
|
126
|
+
|
|
127
|
+
export default {
|
|
128
|
+
components: {
|
|
129
|
+
Container,
|
|
130
|
+
Row,
|
|
131
|
+
Column,
|
|
132
|
+
},
|
|
133
|
+
props: {
|
|
134
|
+
item: {
|
|
135
|
+
type: Object,
|
|
136
|
+
required: true
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
data() {
|
|
140
|
+
return {
|
|
141
|
+
visible: false,
|
|
142
|
+
CaretUp,
|
|
143
|
+
CaretDown,
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
computed: {
|
|
147
|
+
gMapLink() {
|
|
148
|
+
return `https://google.com/maps?q=${this.item.title}%20${this.item.fullAddress}`
|
|
149
|
+
},
|
|
150
|
+
validContacts() {
|
|
151
|
+
if (this.item.contact1 === '' && this.item.phone1 === '' && this.item.email1 === '' && this.item.mobile1 === '') {
|
|
152
|
+
return false
|
|
153
|
+
} else {
|
|
154
|
+
return true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
},
|
|
159
|
+
methods: {
|
|
160
|
+
handleClick(title) {
|
|
161
|
+
this.visible = !this.visible
|
|
162
|
+
if (this.$gtm) {
|
|
163
|
+
if (this.visible) {
|
|
164
|
+
this.$gtm.push({ event: 'custom.search.prs.open', title })
|
|
165
|
+
} else {
|
|
166
|
+
this.$gtm.push({
|
|
167
|
+
event: 'custom.search.prs.close',
|
|
168
|
+
title
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
</script>
|
|
176
|
+
|
|
177
|
+
<style lang="scss" scoped>
|
|
178
|
+
|
|
179
|
+
@import '../../../HSCP/Records/SingleRecord/styles.scss'
|
|
180
|
+
|
|
181
|
+
</style>
|
|
182
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Records from './index.vue'
|
|
2
|
+
import { arData } from '../../../../../mock/asbestos-removalists'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Paragraphs/Directory/Asbestos/Records',
|
|
7
|
+
component: Records,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
data() {
|
|
10
|
+
return {
|
|
11
|
+
arData
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
items: arData,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const Removalists = {}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section-group class="paragraph--directory dir-filters">
|
|
3
|
+
<!-- Filters -->
|
|
4
|
+
<row style="column-gap: 16px;">
|
|
5
|
+
<!-- Keyword Filters -->
|
|
6
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
7
|
+
<label class="visually-hidden" for="search-directory">
|
|
8
|
+
Search by keyword (typed keyword automatically filters below results)
|
|
9
|
+
</label>
|
|
10
|
+
<input type="text" v-model="searchRem" placeholder="Removalist" class="search">
|
|
11
|
+
</column>
|
|
12
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
13
|
+
<label class="visually-hidden" for="search-directory">
|
|
14
|
+
Search by suburb (typed suburb automatically filters below results)
|
|
15
|
+
</label>
|
|
16
|
+
<input type="text" v-model="searchSub" placeholder="Address" class="search">
|
|
17
|
+
</column>
|
|
18
|
+
<!-- Other Filters -->
|
|
19
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
20
|
+
<select id="filterType" v-model="searchClass" name="filter" class="selectClass">
|
|
21
|
+
<option class="placeholder" value="" disabled hidden selected>Service class</option>
|
|
22
|
+
<option value="Class A Asbestos Removalists">Class A Asbestos Removalists</option>
|
|
23
|
+
<option value="Class B Asbestos Removalists">Class B Asbestos Removalists</option>
|
|
24
|
+
<option value="Class A - Restricted - Asbestos Removalists">Class A - Restricted - Asbestos Removalists</option>
|
|
25
|
+
<option value="Class B - Restricted - Asbestos Removalists">Class B - Restricted - Asbestos Removalists</option>
|
|
26
|
+
</select>
|
|
27
|
+
</column>
|
|
28
|
+
<column xxl="2" xl="3" md="4" sm="6">
|
|
29
|
+
<label class="visually-hidden" for="search-directory">
|
|
30
|
+
Search by suburb (typed suburb automatically filters below results)
|
|
31
|
+
</label>
|
|
32
|
+
<input type="text" v-model="searchServices" placeholder="Services" class="search">
|
|
33
|
+
</column>
|
|
34
|
+
<column md="2">
|
|
35
|
+
<filter-button
|
|
36
|
+
v-if="!hideReset"
|
|
37
|
+
filter-button="!hideReset"
|
|
38
|
+
:is-reset="true"
|
|
39
|
+
class="filterButton__button filterButton__button--reset"
|
|
40
|
+
@clicked="reset"
|
|
41
|
+
/>
|
|
42
|
+
</column>
|
|
43
|
+
</row>
|
|
44
|
+
<!-- AR Records -->
|
|
45
|
+
<div class="dirRecords" >
|
|
46
|
+
<template v-for="(item, index) in resultChunks[page]" >
|
|
47
|
+
<ar-record v-if="item.type === 'ar'" :key="index" :item="item"/>
|
|
48
|
+
</template>
|
|
49
|
+
</div>
|
|
50
|
+
<div v-if="filteredRecords.length > 0" align-items="center">
|
|
51
|
+
<pagination
|
|
52
|
+
:total-pages="totalPages"
|
|
53
|
+
:total="totalResults"
|
|
54
|
+
:per-page="perPage"
|
|
55
|
+
:current-page="page + 1"
|
|
56
|
+
@pagechanged="pageChanged($event)"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
<h4 v-if="filteredRecords.length === 0">No records found</h4>
|
|
60
|
+
|
|
61
|
+
</section-group>
|
|
62
|
+
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script>
|
|
66
|
+
|
|
67
|
+
import arRecord from './SingleRecord/index.vue'
|
|
68
|
+
import searchIcon from './../../../../../assets/icons/search.svg?url'
|
|
69
|
+
import SectionGroup from '../../../../Containers/SectionGroup/index.vue'
|
|
70
|
+
import FilterButton from '../../../../Common/FilterButton/index.vue' //Reset
|
|
71
|
+
import Pagination from '../../HSCP/Records/pagination.vue'
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
name: 'Asbestos',
|
|
75
|
+
components: {
|
|
76
|
+
arRecord,
|
|
77
|
+
SectionGroup,
|
|
78
|
+
FilterButton,
|
|
79
|
+
Pagination
|
|
80
|
+
},
|
|
81
|
+
data() {
|
|
82
|
+
return {
|
|
83
|
+
searchRem: '',
|
|
84
|
+
searchSub: '',
|
|
85
|
+
searchClass: '',
|
|
86
|
+
searchServices: '',
|
|
87
|
+
filteredItems: null,
|
|
88
|
+
perPage: 10,
|
|
89
|
+
page: 0,
|
|
90
|
+
searchIcon,
|
|
91
|
+
hideReset: true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
props: {
|
|
95
|
+
items: {
|
|
96
|
+
type: Array,
|
|
97
|
+
required: true,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
computed: {
|
|
102
|
+
|
|
103
|
+
filteredRecords() {
|
|
104
|
+
let results = this.flatRecords
|
|
105
|
+
|
|
106
|
+
if (this.searchRem.length) {
|
|
107
|
+
this.hideReset = false
|
|
108
|
+
results = results.filter(item => item.title.toLowerCase().includes(this.searchRem.toLowerCase()))
|
|
109
|
+
}
|
|
110
|
+
if (this.searchSub.length) {
|
|
111
|
+
this.hideReset = false
|
|
112
|
+
results = results.filter(item => item.fullAddress.toLowerCase().includes(this.searchSub.toLowerCase()))
|
|
113
|
+
}
|
|
114
|
+
if (this.searchClass.length) {
|
|
115
|
+
this.hideReset = false
|
|
116
|
+
results = results.filter(item => item.serviceCategory.toLowerCase().includes(this.searchClass.toLowerCase()))
|
|
117
|
+
}
|
|
118
|
+
if (this.searchServices.length) {
|
|
119
|
+
this.hideReset = false
|
|
120
|
+
results = results.filter(item => item.services.toLowerCase().includes(this.searchServices.toLowerCase()))
|
|
121
|
+
}
|
|
122
|
+
this.filteredItems = results
|
|
123
|
+
|
|
124
|
+
if (this.searchRem.length || this.searchSub.length || this.searchClass.length || this.searchServices.length) {
|
|
125
|
+
this.pageChanged(1)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return results
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
flatRecords() {
|
|
132
|
+
let flatRecords = []
|
|
133
|
+
const sortedItems = this.items.sort((a, b) => a.ResourceName.localeCompare(b.ResourceName, 'en', {'sensitivity': 'base'}))
|
|
134
|
+
|
|
135
|
+
sortedItems.forEach((record) => {
|
|
136
|
+
flatRecords.push({
|
|
137
|
+
type: 'ar',
|
|
138
|
+
title: record.ResourceName,
|
|
139
|
+
fullAddress: record.CompanyAddress + ' ' + record.AddressLine2,
|
|
140
|
+
workPhone: record.Phone,
|
|
141
|
+
mobilePhone: record.CompanyMobile,
|
|
142
|
+
email: record.CompanyEmailDisp,
|
|
143
|
+
website: this.formatWebsite(record.CompanyWebURLDisp),
|
|
144
|
+
contact1: this.returnContact(record.ContactFirstName, record.ContactLastName),
|
|
145
|
+
email1: record.ContactEmail,
|
|
146
|
+
phone1: record.ContactPhoneDisp,
|
|
147
|
+
mobile1: record.ContactMobileDisp,
|
|
148
|
+
services: record.ServicesAll.replace(/,$/, ''),
|
|
149
|
+
serviceCategory: record.ServiceAll
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
return flatRecords
|
|
153
|
+
},
|
|
154
|
+
resultChunks() {
|
|
155
|
+
return this.chunkify(this.filteredItems || this.items, this.perPage)
|
|
156
|
+
},
|
|
157
|
+
noRecordsFound() {
|
|
158
|
+
return this.resultChunks[0].length === 0
|
|
159
|
+
},
|
|
160
|
+
totalResults() {
|
|
161
|
+
return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
|
|
162
|
+
},
|
|
163
|
+
totalPages() {
|
|
164
|
+
return this.resultChunks.length
|
|
165
|
+
},
|
|
166
|
+
pageResultCount() {
|
|
167
|
+
return this.resultChunks[this.page].length
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
methods: {
|
|
172
|
+
|
|
173
|
+
formatWebsite(url) {
|
|
174
|
+
let startUrl = url.slice(0, 3)
|
|
175
|
+
if (startUrl.toLowerCase() === 'www') {
|
|
176
|
+
return 'https://' + url
|
|
177
|
+
} else {
|
|
178
|
+
return url
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
returnContact(firstN, lastN) {
|
|
183
|
+
let retContact = [firstN, lastN].filter(Boolean).join(' ')
|
|
184
|
+
return retContact
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
chunkify(arr, n) {
|
|
188
|
+
if (arr) {
|
|
189
|
+
const chunked = arr.reduce(
|
|
190
|
+
(chunk, val) => {
|
|
191
|
+
if (chunk[chunk.length - 1].length === n) chunk.push([])
|
|
192
|
+
chunk[chunk.length - 1].push(val)
|
|
193
|
+
return chunk
|
|
194
|
+
},
|
|
195
|
+
[[]]
|
|
196
|
+
)
|
|
197
|
+
return chunked
|
|
198
|
+
}
|
|
199
|
+
return [[]]
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
reset() {
|
|
203
|
+
this.collapseOrgs('No')
|
|
204
|
+
this.hideReset = true
|
|
205
|
+
this.searchRem = ''
|
|
206
|
+
this.searchClass = ''
|
|
207
|
+
this.searchSub = ''
|
|
208
|
+
this.searchServices = ''
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
pageChanged(ev) {
|
|
212
|
+
this.page = ev - 1
|
|
213
|
+
|
|
214
|
+
if (this.searchRem.length || this.searchSub.length || this.searchClass.length || this.searchServices.length) {
|
|
215
|
+
// don't set focus
|
|
216
|
+
// don't collapseOrgs
|
|
217
|
+
} else {
|
|
218
|
+
// set focus to top element - used instead of scrollTo
|
|
219
|
+
this.collapseOrgs('Yes')
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
collapseOrgs(focusLink) {
|
|
224
|
+
// called by pageChanged and reset. pageChanged called by filter and by pagination links
|
|
225
|
+
const aLinks = document.getElementsByName('titleLink')
|
|
226
|
+
// Convert nodelist to array
|
|
227
|
+
let linksArr = Array.from(aLinks)
|
|
228
|
+
if (Array.isArray(linksArr) && linksArr.length > 0) {
|
|
229
|
+
linksArr
|
|
230
|
+
.filter((link) => link.getAttribute('aria-expanded') === 'true')
|
|
231
|
+
.forEach((link) => link.click())
|
|
232
|
+
|
|
233
|
+
if (focusLink === 'Yes') {
|
|
234
|
+
linksArr[0].focus()
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
toTitleCase(strVal) {
|
|
241
|
+
|
|
242
|
+
let retVal = strVal.trim()
|
|
243
|
+
|
|
244
|
+
const firstChar = retVal.charAt(0)
|
|
245
|
+
const firstCharU = firstChar.toUpperCase()
|
|
246
|
+
const remChar = retVal.slice(1)
|
|
247
|
+
|
|
248
|
+
retVal = firstCharU + remChar
|
|
249
|
+
|
|
250
|
+
return retVal
|
|
251
|
+
},
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
</script>
|
|
255
|
+
|
|
256
|
+
<style lang="scss" scoped>
|
|
257
|
+
@import '../../HSCP/styles.scss'
|
|
258
|
+
|
|
259
|
+
</style>
|
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
/>
|
|
41
41
|
<CustomControl position="BOTTOM_CENTER">
|
|
42
42
|
<h4 v-if="unknownLGA">
|
|
43
|
-
<BBadge variant="light">
|
|
43
|
+
<BBadge variant="light">
|
|
44
|
+
Unspecified locations {{ unknownLGA }}
|
|
45
|
+
</BBadge>
|
|
44
46
|
</h4>
|
|
45
47
|
</CustomControl>
|
|
46
48
|
<AdvancedMarker
|
package/src/index.js
CHANGED
|
@@ -31,6 +31,7 @@ import ListGroup from './components/Paragraphs/ListGroup/index.vue'
|
|
|
31
31
|
import ScrollSpy from './components/Paragraphs/ScrollSpy/index.vue'
|
|
32
32
|
import Directory from './components/Paragraphs/Directory/index.vue'
|
|
33
33
|
import HscpDirectory from './components/Paragraphs/Directory/HSCP/Records/index.vue'
|
|
34
|
+
import ArDirectory from './components/Paragraphs/Directory/Asbestos/Records/index.vue'
|
|
34
35
|
import SelectableCards from './components/Paragraphs/SelectableCards/index.vue'
|
|
35
36
|
import VideoMedia from './components/Paragraphs/VideoPlayer/index.vue'
|
|
36
37
|
import VideoGrid from './components/Paragraphs/VideoGrid/index.vue'
|
|
@@ -99,6 +100,7 @@ export {
|
|
|
99
100
|
ScrollSpy,
|
|
100
101
|
Directory,
|
|
101
102
|
HscpDirectory,
|
|
103
|
+
ArDirectory,
|
|
102
104
|
SelectableCards,
|
|
103
105
|
Statistics,
|
|
104
106
|
ProofPoints,
|