@worksafevictoria/wcl7.5 1.8.0 → 1.9.0-beta.10
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/.storybook/preview.js +1 -1
- package/lib/utility.js +0 -2
- package/package.json +1 -1
- package/src/components/Common/CardGrid/index.vue +0 -3
- package/src/components/Common/CardGridItem/card-grid-item-caret.vue +39 -45
- package/src/components/Common/CardGridItem/card-grid-item-icon.vue +29 -32
- package/src/components/Common/CardGridItem/index.vue +6 -5
- package/src/components/Containers/Carousel/index.stories.js +6 -4
- package/src/components/Containers/Carousel/index.vue +131 -120
- package/src/components/Containers/HomepageHeader/index.stories.js +1 -1
- package/src/components/Containers/HomepageHeaderNew/index.stories.js +3 -15
- package/src/components/Containers/HomepageHeaderNew/index.vue +0 -5
- package/src/components/Global/AppFooter/index.vue +130 -133
- package/src/components/Global/AppHeader/ModalSearch/index.vue +7 -1
- package/src/components/Global/AppHeader/index.stories.js +2 -2
- package/src/components/Global/AppHeaderNew/ModalSearch/index.vue +21 -17
- package/src/components/Global/AppHeaderNew/index.stories.js +2 -2
- package/src/components/Global/AppHeaderNew/index.vue +53 -24
- package/src/components/Global/AppHeaderNew/styles.scss +1 -4
- package/src/components/Global/BackToTop/index.vue +16 -16
- package/src/components/Global/ContrastMode/index.stories.js +1 -1
- package/src/components/Global/HeroHeader/index.vue +62 -73
- package/src/components/Global/SocialShare/index.vue +62 -66
- package/src/components/Global/Strip/index.vue +82 -70
- package/src/components/Paragraphs/Accordion/AccordionItem/index.vue +21 -23
- package/src/components/Paragraphs/Accordion/StepperItem/index.vue +15 -15
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +74 -75
- package/src/components/Paragraphs/Calculator/RiskLevel/index.vue +31 -39
- package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.stories.js +1 -1
- package/src/components/Paragraphs/Directory/Asbestos/Records/SingleRecord/index.vue +105 -108
- package/src/components/Paragraphs/Directory/Asbestos/Records/index.vue +152 -117
- package/src/components/Paragraphs/Directory/HSCP/Records/SingleRecord/index.vue +127 -133
- package/src/components/Paragraphs/Directory/HSCP/Records/index.vue +157 -124
- package/src/components/Paragraphs/ScrollSpy/index.stories.js +23 -25
- package/src/components/Paragraphs/ScrollSpy/index.vue +33 -40
- package/src/components/Paragraphs/TabulatedData/index.vue +3 -2
- package/src/components/SubComponents/CtaButton/index.vue +47 -44
- package/src/components/SubComponents/Icon/README.md +2 -2
- package/src/components/SubComponents/Icon/example.js +1 -0
- package/src/components/SubComponents/Icon/index.stories.js +1 -1
- package/src/components/SubComponents/Icon/index.vue +47 -47
- package/src/components/SubComponents/ResourceGroup/cardbody.vue +49 -61
- package/src/components/SubComponents/ResourceGroup/index.vue +2 -1
- package/src/components/SubComponents/Search/SearchListing/index.vue +0 -2
- package/src/components/SubComponents/Search/index.vue +4 -2
- package/src/components/SubComponents/VideoThumbnail/index.vue +29 -28
- package/src/index.js +1 -1
- package/src/mock/asbestos-removalists.js +1 -1
- package/src/mock/carousel-items.js +46 -81
- package/src/mock/course-provider.js +2 -2
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section-group class="paragraph--directory dir-filters">
|
|
3
3
|
<!-- Filters -->
|
|
4
|
-
<row style="column-gap: 16px
|
|
4
|
+
<row style="column-gap: 16px">
|
|
5
5
|
<!-- Keyword Filters -->
|
|
6
6
|
<column xxl="2" xl="3" md="4" sm="6">
|
|
7
7
|
<label class="visually-hidden" for="search-directory">
|
|
8
8
|
Search by keyword (typed keyword automatically filters below results)
|
|
9
9
|
</label>
|
|
10
|
-
<input
|
|
10
|
+
<input
|
|
11
|
+
type="text"
|
|
12
|
+
v-model="searchOrg"
|
|
13
|
+
placeholder="Organisation"
|
|
14
|
+
class="search"
|
|
15
|
+
/>
|
|
11
16
|
</column>
|
|
12
17
|
<column xxl="2" xl="3" md="4" sm="6">
|
|
13
18
|
<label class="visually-hidden" for="search-directory">
|
|
14
19
|
Search by suburb (typed suburb automatically filters below results)
|
|
15
20
|
</label>
|
|
16
|
-
<input
|
|
21
|
+
<input
|
|
22
|
+
type="text"
|
|
23
|
+
v-model="searchSub"
|
|
24
|
+
placeholder="Training location"
|
|
25
|
+
class="search"
|
|
26
|
+
/>
|
|
17
27
|
</column>
|
|
18
28
|
<!-- Other Filters -->
|
|
19
29
|
<column xxl="2" xl="3" md="4" sm="6">
|
|
30
|
+
<label class="visually-hidden" for="filterType"> Filter Type </label>
|
|
20
31
|
<select id="filterType" v-model="searchCourse" name="filter" class="selectClass">
|
|
21
|
-
<option class="placeholder" value="" disabled hidden selected>
|
|
32
|
+
<option class="placeholder" value="" disabled hidden selected>
|
|
33
|
+
Course type
|
|
34
|
+
</option>
|
|
22
35
|
<option value="HSR Initial">HSR Initial</option>
|
|
23
36
|
<option value="HSR Refresher">HSR Refresher</option>
|
|
24
37
|
</select>
|
|
25
38
|
</column>
|
|
26
39
|
<column xxl="2" xl="3" md="4" sm="6">
|
|
27
|
-
<select
|
|
40
|
+
<select
|
|
41
|
+
id="filterTheme"
|
|
42
|
+
v-model="searchThemes"
|
|
43
|
+
name="filter1"
|
|
44
|
+
class="selectClass"
|
|
45
|
+
>
|
|
28
46
|
<option class="placeholder" value="" disabled hidden selected>Theme</option>
|
|
29
47
|
<option v-for="(opt, i) in themeOptions" :key="i" :value="opt">
|
|
30
48
|
{{ opt }}
|
|
@@ -42,54 +60,51 @@
|
|
|
42
60
|
</column>
|
|
43
61
|
</row>
|
|
44
62
|
<!-- HSCP Records -->
|
|
45
|
-
<div class="dirRecords"
|
|
46
|
-
<template v-for="(item, index) in resultChunks[page]"
|
|
47
|
-
<hscp-record v-if="item.type === 'hscp'" :key="index" :item="item"/>
|
|
63
|
+
<div class="dirRecords">
|
|
64
|
+
<template v-for="(item, index) in resultChunks[page]">
|
|
65
|
+
<hscp-record v-if="item.type === 'hscp'" :key="index" :item="item" />
|
|
48
66
|
</template>
|
|
49
67
|
</div>
|
|
50
68
|
<div v-if="filteredRecords.length > 0" align-items="center">
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
<pagination
|
|
70
|
+
:total-pages="totalPages"
|
|
71
|
+
:total="totalResults"
|
|
72
|
+
:per-page="perPage"
|
|
73
|
+
:current-page="page + 1"
|
|
74
|
+
@pagechanged="pageChanged($event)"
|
|
75
|
+
/>
|
|
76
|
+
</div>
|
|
59
77
|
<h4 v-if="filteredRecords.length === 0">No records found</h4>
|
|
60
|
-
|
|
61
78
|
</section-group>
|
|
62
|
-
|
|
63
79
|
</template>
|
|
64
80
|
|
|
65
81
|
<script>
|
|
66
|
-
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import Pagination from './pagination.vue'
|
|
82
|
+
import hscpRecord from "./SingleRecord/index.vue";
|
|
83
|
+
import searchIcon from "./../../../../../assets/icons/search.svg?url";
|
|
84
|
+
import SectionGroup from "../../../../Containers/SectionGroup/index.vue";
|
|
85
|
+
import FilterButton from "../../../../Common/FilterButton/index.vue"; //Reset
|
|
86
|
+
import Pagination from "./pagination.vue";
|
|
72
87
|
|
|
73
88
|
export default {
|
|
74
|
-
name:
|
|
89
|
+
name: "HSCP",
|
|
75
90
|
components: {
|
|
76
91
|
hscpRecord,
|
|
77
92
|
SectionGroup,
|
|
78
93
|
FilterButton,
|
|
79
|
-
Pagination
|
|
94
|
+
Pagination,
|
|
80
95
|
},
|
|
81
96
|
data() {
|
|
82
97
|
return {
|
|
83
|
-
searchOrg:
|
|
84
|
-
searchSub:
|
|
85
|
-
searchCourse:
|
|
86
|
-
searchThemes:
|
|
98
|
+
searchOrg: "",
|
|
99
|
+
searchSub: "",
|
|
100
|
+
searchCourse: "",
|
|
101
|
+
searchThemes: "",
|
|
87
102
|
filteredItems: null,
|
|
88
103
|
perPage: 10,
|
|
89
104
|
page: 0,
|
|
90
105
|
searchIcon,
|
|
91
|
-
hideReset: true
|
|
92
|
-
}
|
|
106
|
+
hideReset: true,
|
|
107
|
+
};
|
|
93
108
|
},
|
|
94
109
|
props: {
|
|
95
110
|
items: {
|
|
@@ -97,23 +112,22 @@ export default {
|
|
|
97
112
|
required: true,
|
|
98
113
|
},
|
|
99
114
|
},
|
|
100
|
-
|
|
101
|
-
computed: {
|
|
102
115
|
|
|
116
|
+
computed: {
|
|
103
117
|
themeOptions() {
|
|
104
118
|
// Concatenate all themes, remove duplicates, sort and use for a drop-down list
|
|
105
|
-
let allThemes = this.flatRecords.map(a => a.themes)
|
|
106
|
-
allThemes = allThemes.join(
|
|
107
|
-
allThemes = allThemes.trim()
|
|
108
|
-
allThemes = allThemes.split(
|
|
119
|
+
let allThemes = this.flatRecords.map((a) => a.themes);
|
|
120
|
+
allThemes = allThemes.join(",");
|
|
121
|
+
allThemes = allThemes.trim();
|
|
122
|
+
allThemes = allThemes.split(",");
|
|
109
123
|
// Change all themes to title case
|
|
110
124
|
for (var i = 0; i < allThemes.length; i++) {
|
|
111
|
-
let newVal = this.toTitleCase(allThemes[i])
|
|
112
|
-
allThemes[i] = newVal
|
|
125
|
+
let newVal = this.toTitleCase(allThemes[i]);
|
|
126
|
+
allThemes[i] = newVal;
|
|
113
127
|
}
|
|
114
128
|
// Remove duplicates
|
|
115
|
-
let s = new Set(allThemes)
|
|
116
|
-
allThemes = [...s]
|
|
129
|
+
let s = new Set(allThemes);
|
|
130
|
+
allThemes = [...s];
|
|
117
131
|
|
|
118
132
|
// Sort the themes
|
|
119
133
|
let sortedThemes = allThemes.sort((a, b) => {
|
|
@@ -124,42 +138,55 @@ export default {
|
|
|
124
138
|
return 1;
|
|
125
139
|
}
|
|
126
140
|
return 0;
|
|
127
|
-
})
|
|
128
|
-
allThemes = sortedThemes
|
|
141
|
+
});
|
|
142
|
+
allThemes = sortedThemes;
|
|
129
143
|
|
|
130
|
-
return allThemes
|
|
144
|
+
return allThemes;
|
|
131
145
|
},
|
|
132
146
|
|
|
133
147
|
filteredRecords() {
|
|
134
|
-
let results = this.flatRecords
|
|
135
|
-
|
|
148
|
+
let results = this.flatRecords;
|
|
149
|
+
|
|
136
150
|
if (this.searchOrg.length) {
|
|
137
|
-
this.hideReset = false
|
|
138
|
-
results = results.filter(item =>
|
|
151
|
+
this.hideReset = false;
|
|
152
|
+
results = results.filter((item) =>
|
|
153
|
+
item.title.toLowerCase().includes(this.searchOrg.toLowerCase())
|
|
154
|
+
);
|
|
139
155
|
}
|
|
140
156
|
if (this.searchSub.length) {
|
|
141
|
-
this.hideReset = false
|
|
142
|
-
results = results.filter(item =>
|
|
157
|
+
this.hideReset = false;
|
|
158
|
+
results = results.filter((item) =>
|
|
159
|
+
item.trainingVenues.toLowerCase().includes(this.searchSub.toLowerCase())
|
|
160
|
+
);
|
|
143
161
|
}
|
|
144
162
|
if (this.searchCourse.length) {
|
|
145
|
-
this.hideReset = false
|
|
146
|
-
results = results.filter(item =>
|
|
163
|
+
this.hideReset = false;
|
|
164
|
+
results = results.filter((item) =>
|
|
165
|
+
item.courses.toLowerCase().includes(this.searchCourse.toLowerCase())
|
|
166
|
+
);
|
|
147
167
|
}
|
|
148
168
|
if (this.searchThemes.length) {
|
|
149
|
-
this.hideReset = false
|
|
150
|
-
results = results.filter(item =>
|
|
169
|
+
this.hideReset = false;
|
|
170
|
+
results = results.filter((item) =>
|
|
171
|
+
item.themes.toLowerCase().includes(this.searchThemes.toLowerCase())
|
|
172
|
+
);
|
|
151
173
|
}
|
|
152
|
-
this.filteredItems = results
|
|
174
|
+
this.filteredItems = results;
|
|
153
175
|
|
|
154
|
-
if (
|
|
155
|
-
this.
|
|
176
|
+
if (
|
|
177
|
+
this.searchOrg.length ||
|
|
178
|
+
this.searchSub.length ||
|
|
179
|
+
this.searchCourse.length ||
|
|
180
|
+
this.searchThemes.length
|
|
181
|
+
) {
|
|
182
|
+
this.pageChanged(1);
|
|
156
183
|
}
|
|
157
184
|
|
|
158
|
-
return results
|
|
185
|
+
return results;
|
|
159
186
|
},
|
|
160
|
-
|
|
187
|
+
|
|
161
188
|
flatRecords() {
|
|
162
|
-
let flatRecords = []
|
|
189
|
+
let flatRecords = [];
|
|
163
190
|
const sortedItems = this.items.sort((a, b) => {
|
|
164
191
|
if (a.Organisation < b.Organisation) {
|
|
165
192
|
return -1;
|
|
@@ -168,10 +195,10 @@ export default {
|
|
|
168
195
|
return 1;
|
|
169
196
|
}
|
|
170
197
|
return 0;
|
|
171
|
-
})
|
|
172
|
-
|
|
198
|
+
});
|
|
199
|
+
sortedItems.forEach((record) => {
|
|
173
200
|
flatRecords.push({
|
|
174
|
-
type:
|
|
201
|
+
type: "hscp",
|
|
175
202
|
title: record.Organisation,
|
|
176
203
|
fullAddress: record.Main_office_address,
|
|
177
204
|
orgAcronym: record.Organisation_acronym,
|
|
@@ -185,113 +212,119 @@ export default {
|
|
|
185
212
|
contact2: record.Contact_2_Name,
|
|
186
213
|
email2: record.Contact_2_Email,
|
|
187
214
|
phone2: record.Contact_2_Phone,
|
|
188
|
-
courses: record.Training_courses.replace(/,$/,
|
|
189
|
-
themes: record.Themes.replace(/,$/,
|
|
190
|
-
trainingVenues: record.Training_venues
|
|
191
|
-
})
|
|
192
|
-
})
|
|
193
|
-
return flatRecords
|
|
215
|
+
courses: record.Training_courses.replace(/,$/, ""),
|
|
216
|
+
themes: record.Themes.replace(/,$/, ""),
|
|
217
|
+
trainingVenues: record.Training_venues,
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
return flatRecords;
|
|
194
221
|
},
|
|
195
222
|
resultChunks() {
|
|
196
|
-
return this.chunkify(this.filteredItems || this.items, this.perPage)
|
|
223
|
+
return this.chunkify(this.filteredItems || this.items, this.perPage);
|
|
197
224
|
},
|
|
198
225
|
noRecordsFound() {
|
|
199
|
-
return this.resultChunks[0].length === 0
|
|
226
|
+
return this.resultChunks[0].length === 0;
|
|
200
227
|
},
|
|
201
228
|
totalResults() {
|
|
202
|
-
return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0
|
|
229
|
+
return Array.isArray(this.filteredItems) ? this.filteredItems.length : 0;
|
|
203
230
|
},
|
|
204
231
|
totalPages() {
|
|
205
|
-
return this.resultChunks.length
|
|
232
|
+
return this.resultChunks.length;
|
|
206
233
|
},
|
|
207
234
|
pageResultCount() {
|
|
208
|
-
return this.resultChunks[this.page].length
|
|
209
|
-
}
|
|
235
|
+
return this.resultChunks[this.page].length;
|
|
236
|
+
},
|
|
210
237
|
},
|
|
211
|
-
|
|
212
|
-
methods: {
|
|
213
238
|
|
|
239
|
+
methods: {
|
|
214
240
|
formatWebsite(url) {
|
|
215
|
-
let startUrl = url.slice(0, 3)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
241
|
+
let startUrl = url.slice(0, 3);
|
|
242
|
+
let returnUrl = url;
|
|
243
|
+
if (startUrl.toLowerCase() === "www") {
|
|
244
|
+
returnUrl = "https://" + url;
|
|
245
|
+
}
|
|
246
|
+
if (
|
|
247
|
+
startUrl.toLowerCase() !== "htt" &&
|
|
248
|
+
startUrl.toLowerCase() !== "www" &&
|
|
249
|
+
url !== ""
|
|
250
|
+
) {
|
|
251
|
+
returnUrl = "https://www." + url;
|
|
220
252
|
}
|
|
253
|
+
return returnUrl;
|
|
221
254
|
},
|
|
222
255
|
|
|
223
256
|
chunkify(arr, n) {
|
|
224
257
|
if (arr) {
|
|
225
258
|
const chunked = arr.reduce(
|
|
226
259
|
(chunk, val) => {
|
|
227
|
-
if (chunk[chunk.length - 1].length === n) chunk.push([])
|
|
228
|
-
chunk[chunk.length - 1].push(val)
|
|
229
|
-
return chunk
|
|
260
|
+
if (chunk[chunk.length - 1].length === n) chunk.push([]);
|
|
261
|
+
chunk[chunk.length - 1].push(val);
|
|
262
|
+
return chunk;
|
|
230
263
|
},
|
|
231
264
|
[[]]
|
|
232
|
-
)
|
|
233
|
-
return chunked
|
|
265
|
+
);
|
|
266
|
+
return chunked;
|
|
234
267
|
}
|
|
235
|
-
return [[]]
|
|
268
|
+
return [[]];
|
|
236
269
|
},
|
|
237
|
-
|
|
270
|
+
|
|
238
271
|
reset() {
|
|
239
|
-
this.collapseOrgs(
|
|
240
|
-
this.hideReset = true
|
|
241
|
-
this.searchOrg =
|
|
242
|
-
this.searchCourse =
|
|
243
|
-
this.searchSub =
|
|
244
|
-
this.searchThemes =
|
|
272
|
+
this.collapseOrgs("No");
|
|
273
|
+
this.hideReset = true;
|
|
274
|
+
this.searchOrg = "";
|
|
275
|
+
this.searchCourse = "";
|
|
276
|
+
this.searchSub = "";
|
|
277
|
+
this.searchThemes = "";
|
|
245
278
|
},
|
|
246
279
|
|
|
247
280
|
pageChanged(ev) {
|
|
248
|
-
this.page = ev - 1
|
|
281
|
+
this.page = ev - 1;
|
|
249
282
|
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
283
|
+
if (
|
|
284
|
+
this.searchOrg.length ||
|
|
285
|
+
this.searchSub.length ||
|
|
286
|
+
this.searchCourse.length ||
|
|
287
|
+
this.searchThemes.length
|
|
288
|
+
) {
|
|
289
|
+
// don't set focus
|
|
290
|
+
// don't collapseOrgs
|
|
291
|
+
} else {
|
|
292
|
+
// set focus to top element - used instead of scrollTo
|
|
293
|
+
this.collapseOrgs("Yes");
|
|
294
|
+
}
|
|
257
295
|
},
|
|
258
296
|
|
|
259
297
|
collapseOrgs(focusLink) {
|
|
260
298
|
// called by pageChanged and reset. pageChanged called by filter and by pagination links
|
|
261
|
-
const aLinks = document.getElementsByName(
|
|
299
|
+
const aLinks = document.getElementsByName("titleLink");
|
|
262
300
|
// Convert nodelist to array
|
|
263
|
-
let linksArr = Array.from(aLinks)
|
|
301
|
+
let linksArr = Array.from(aLinks);
|
|
264
302
|
if (Array.isArray(linksArr) && linksArr.length > 0) {
|
|
265
303
|
linksArr
|
|
266
|
-
.filter((link) => link.getAttribute(
|
|
267
|
-
.forEach((link) => link.click())
|
|
304
|
+
.filter((link) => link.getAttribute("aria-expanded") === "true")
|
|
305
|
+
.forEach((link) => link.click());
|
|
268
306
|
|
|
269
|
-
if (focusLink ===
|
|
270
|
-
linksArr[0].focus()
|
|
307
|
+
if (focusLink === "Yes") {
|
|
308
|
+
linksArr[0].focus();
|
|
271
309
|
}
|
|
272
310
|
}
|
|
273
|
-
|
|
274
311
|
},
|
|
275
312
|
|
|
276
313
|
toTitleCase(strVal) {
|
|
314
|
+
let retVal = strVal.trim();
|
|
277
315
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
const firstCharU = firstChar.toUpperCase()
|
|
282
|
-
const remChar = retVal.slice(1)
|
|
316
|
+
const firstChar = retVal.charAt(0);
|
|
317
|
+
const firstCharU = firstChar.toUpperCase();
|
|
318
|
+
const remChar = retVal.slice(1);
|
|
283
319
|
|
|
284
|
-
retVal = firstCharU + remChar
|
|
320
|
+
retVal = firstCharU + remChar;
|
|
285
321
|
|
|
286
|
-
return retVal
|
|
322
|
+
return retVal;
|
|
287
323
|
},
|
|
288
|
-
}
|
|
289
|
-
}
|
|
324
|
+
},
|
|
325
|
+
};
|
|
290
326
|
</script>
|
|
291
327
|
|
|
292
328
|
<style lang="scss" scoped>
|
|
293
|
-
|
|
294
|
-
@import '../styles.scss'
|
|
295
|
-
|
|
296
|
-
|
|
329
|
+
@import "../styles.scss";
|
|
297
330
|
</style>
|
|
@@ -4,40 +4,38 @@ import { BCol, BRow, BContainer } from 'bootstrap-vue-next'
|
|
|
4
4
|
const englishItemList = [
|
|
5
5
|
{
|
|
6
6
|
text: 'Section one heading',
|
|
7
|
-
id: 'item-1'
|
|
7
|
+
id: 'item-1',
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
text: 'Section two heading spans over two lines',
|
|
11
|
-
id: 'item-2'
|
|
11
|
+
id: 'item-2',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
text:
|
|
15
|
-
|
|
16
|
-
id: 'item-3'
|
|
14
|
+
text: 'Section three heading spans over three lines and is active yellow or green',
|
|
15
|
+
id: 'item-3',
|
|
17
16
|
},
|
|
18
17
|
{
|
|
19
18
|
text: 'Section four heading',
|
|
20
|
-
id: 'item-4'
|
|
21
|
-
}
|
|
19
|
+
id: 'item-4',
|
|
20
|
+
},
|
|
22
21
|
]
|
|
23
22
|
const arabicItemList = [
|
|
24
23
|
{
|
|
25
24
|
text: 'عنوان القسم الأول',
|
|
26
|
-
id: 'item-1'
|
|
25
|
+
id: 'item-1',
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
text: 'يمتد عنوان القسم الثاني على سطرين',
|
|
30
|
-
id: 'item-2'
|
|
29
|
+
id: 'item-2',
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
|
-
text:
|
|
34
|
-
|
|
35
|
-
id: 'item-3'
|
|
32
|
+
text: 'يمتد عنوان القسم الثالث على ثلاثة أسطر ويكون نشطًا باللون الأصفر أو الأخضر',
|
|
33
|
+
id: 'item-3',
|
|
36
34
|
},
|
|
37
35
|
{
|
|
38
36
|
text: 'عنوان الباب الرابع',
|
|
39
|
-
id: 'item-4'
|
|
40
|
-
}
|
|
37
|
+
id: 'item-4',
|
|
38
|
+
},
|
|
41
39
|
]
|
|
42
40
|
export default {
|
|
43
41
|
title: 'Paragraphs/ScrollSpy',
|
|
@@ -45,16 +43,16 @@ export default {
|
|
|
45
43
|
tags: ['autodocs'],
|
|
46
44
|
argTypes: {
|
|
47
45
|
itemList: {
|
|
48
|
-
table: {disable: true}
|
|
49
|
-
}
|
|
46
|
+
table: { disable: true },
|
|
47
|
+
},
|
|
50
48
|
},
|
|
51
49
|
args: {
|
|
52
50
|
title: 'On this page',
|
|
53
|
-
itemListEnglish:
|
|
51
|
+
itemListEnglish: englishItemList,
|
|
54
52
|
itemListArabic: arabicItemList,
|
|
55
53
|
rtl: false,
|
|
56
|
-
scrollSpy: { element: 'scrollspy-nested', offset: 100, method: 'auto' }
|
|
57
|
-
|
|
54
|
+
scrollSpy: { element: 'scrollspy-nested', offset: 100, method: 'auto' },
|
|
55
|
+
},
|
|
58
56
|
}
|
|
59
57
|
const DefaultContent = (args) => ({
|
|
60
58
|
components: { ScrollSpy, BCol, BRow, BContainer },
|
|
@@ -75,7 +73,7 @@ const DefaultContent = (args) => ({
|
|
|
75
73
|
`,
|
|
76
74
|
arabicText: `هنالك العديد من الأنواع المتوفرة لنصوص لوريم إيبسوم، ولكن الغالبية تم تعديلها بشكل ما عبر إدخال بعض النوادر أو الكلمات العشوائية إلى النص. إن كنت تريد أن تستخدم نص لوريم إيبسوم ما، عليك أن تتحقق أولاً أن ليس هناك أي كلمات أو عبارات محرجة أو غير لائقة مخبأة في هذا النص. بينما تعمل جميع مولّدات نصوص لوريم إيبسوم على الإنترنت على إعادة تكرار مقاطع من نص لوريم إيبسوم نفسه عدة مرات بما تتطلبه الحاجة، يقوم مولّدنا هذا باستخدام كلمات من قاموس يحوي على أكثر من 200 كلمة لا تينية، مضاف إليها مجموعة من الجمل النموذجية، لتكوين نص لوريم إيبسوم ذو شكل منطقي قريب إلى النص الحقيقي. وبالتالي يكون النص الناتح خالي من التكرار، أو أي كلمات أو عبارات غير لائقة أو ما شابه. وهذا ما يجعله أول مولّد نص لوريم إيبسوم حقيقي على الإنترنت.`,
|
|
77
75
|
englishItemList,
|
|
78
|
-
arabicItemList
|
|
76
|
+
arabicItemList,
|
|
79
77
|
}
|
|
80
78
|
},
|
|
81
79
|
template: `
|
|
@@ -85,7 +83,7 @@ const DefaultContent = (args) => ({
|
|
|
85
83
|
<div
|
|
86
84
|
id="scrollspy-nested"
|
|
87
85
|
>
|
|
88
|
-
<
|
|
86
|
+
<h2 id="item-1">Section one heading</h2>
|
|
89
87
|
<p>{{ text }}</p>
|
|
90
88
|
<p>{{ text }}</p>
|
|
91
89
|
<p>{{ text }}</p>
|
|
@@ -94,7 +92,7 @@ const DefaultContent = (args) => ({
|
|
|
94
92
|
<p>{{ text }}</p>
|
|
95
93
|
<p>{{ text }}</p>
|
|
96
94
|
<p>{{ text }}</p>
|
|
97
|
-
<
|
|
95
|
+
<h2 id="item-2">Section two heading spans over two lines</h2>
|
|
98
96
|
<p>{{ text }}</p>
|
|
99
97
|
<p>{{ text }}</p>
|
|
100
98
|
<p>{{ text }}</p>
|
|
@@ -102,7 +100,7 @@ const DefaultContent = (args) => ({
|
|
|
102
100
|
<p>{{ text }}</p>
|
|
103
101
|
<p>{{ text }}</p>
|
|
104
102
|
<p>{{ text }}</p>
|
|
105
|
-
<
|
|
103
|
+
<h2 id="item-3">Section three heading spans over three lines and is active yellow or green</h2>
|
|
106
104
|
<p>{{ text }}</p>
|
|
107
105
|
<p>{{ text }}</p>
|
|
108
106
|
<p>{{ text }}</p>
|
|
@@ -110,7 +108,7 @@ const DefaultContent = (args) => ({
|
|
|
110
108
|
<p>{{ text }}</p>
|
|
111
109
|
<p>{{ text }}</p>
|
|
112
110
|
<p>{{ text }}</p>
|
|
113
|
-
<
|
|
111
|
+
<h2 id="item-4">Section four heading</h2>
|
|
114
112
|
<p>{{ text }}</p>
|
|
115
113
|
<p>{{ text }}</p>
|
|
116
114
|
<p>{{ text }}</p>
|
|
@@ -172,7 +170,7 @@ const DefaultContent = (args) => ({
|
|
|
172
170
|
<scroll-spy v-bind="args" :item-list="args.arabicItemList" />
|
|
173
171
|
</b-col>
|
|
174
172
|
</b-row>
|
|
175
|
-
</b-container
|
|
173
|
+
</b-container>`,
|
|
176
174
|
})
|
|
177
175
|
|
|
178
176
|
export const Default = DefaultContent.bind({})
|
|
@@ -17,55 +17,48 @@
|
|
|
17
17
|
</section-group>
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
|
-
<script>
|
|
20
|
+
<script setup>
|
|
21
21
|
import SectionGroup from '../../Containers/SectionGroup/index.vue'
|
|
22
|
+
import { defineProps } from 'vue'
|
|
22
23
|
import {
|
|
23
24
|
BNavbar,
|
|
24
25
|
BListGroup,
|
|
25
26
|
BListGroupItem,
|
|
26
|
-
vBScrollspy,
|
|
27
|
+
vBScrollspy as vBScrollspy,
|
|
27
28
|
} from 'bootstrap-vue-next'
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
props: {
|
|
34
|
-
title: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: 'On this page',
|
|
37
|
-
},
|
|
38
|
-
itemList: {
|
|
39
|
-
type: Array,
|
|
40
|
-
required: true,
|
|
41
|
-
},
|
|
42
|
-
rtl: {
|
|
43
|
-
type: Boolean,
|
|
44
|
-
default: false,
|
|
45
|
-
},
|
|
46
|
-
scrollSpy: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default: () => {
|
|
49
|
-
return {
|
|
50
|
-
element: 'body',
|
|
51
|
-
offset: 100,
|
|
52
|
-
method: 'auto',
|
|
53
|
-
contentQuery: '[id]',
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
},
|
|
30
|
+
const { title, itemList, rtl, scrollSpy } = defineProps({
|
|
31
|
+
title: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'On this page',
|
|
57
34
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
itemList: {
|
|
36
|
+
type: Array,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
rtl: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
scrollSpy: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({
|
|
46
|
+
element: 'body',
|
|
47
|
+
offset: 100,
|
|
48
|
+
method: 'auto',
|
|
49
|
+
contentQuery: 'h2[id]',
|
|
50
|
+
}),
|
|
68
51
|
},
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const scrollToAnchor = (anchor) => {
|
|
55
|
+
const anchorElement = document.getElementById(anchor)
|
|
56
|
+
if (anchorElement) {
|
|
57
|
+
anchorElement.focus()
|
|
58
|
+
anchorElement.scrollIntoView({
|
|
59
|
+
behavior: 'smooth',
|
|
60
|
+
})
|
|
61
|
+
}
|
|
69
62
|
}
|
|
70
63
|
</script>
|
|
71
64
|
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
<span
|
|
23
23
|
class="iconHeader table-active"
|
|
24
24
|
tabindex="0"
|
|
25
|
+
role="button"
|
|
25
26
|
@keypress.enter="accessSort(data.field)"
|
|
26
27
|
scope="colgroup"
|
|
27
28
|
>
|
|
@@ -31,13 +32,13 @@
|
|
|
31
32
|
v-if="data.field.thAttr['aria-sort'] === 'ascending'"
|
|
32
33
|
:src="CaretUp"
|
|
33
34
|
alt="image indicating ascending sort"
|
|
34
|
-
class="
|
|
35
|
+
class="collapse icon"
|
|
35
36
|
/>
|
|
36
37
|
<img
|
|
37
38
|
v-else-if="data.field.thAttr['aria-sort'] === 'descending'"
|
|
38
39
|
:src="CaretDown"
|
|
39
40
|
alt="image indicating descending sort"
|
|
40
|
-
class="
|
|
41
|
+
class="expand icon"
|
|
41
42
|
/>
|
|
42
43
|
</span>
|
|
43
44
|
</span>
|