@worksafevictoria/wcl7.5 1.17.0-beta.2 → 1.17.0-beta.4
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/assets/icons/chevron-right-icon.svg +14 -0
- package/src/assets/icons/notepad.svg +93 -0
- package/src/assets/icons/question.svg +7 -0
- package/src/components/Common/CardGrid/index.vue +83 -74
- package/src/components/Common/CardGridItem/index.vue +31 -4
- package/src/components/Containers/SectionGroup/index.stories.js +28 -27
- package/src/components/Containers/SectionGroup/index.vue +6 -0
- package/src/components/Global/AppHeaderNew/mobile.scss +1 -0
- package/src/components/Global/AppHeaderNew/styles.scss +6 -5
- package/src/components/Global/HeroHeader/index.vue +74 -57
- package/src/components/Paragraphs/Calculator/CardContainer/index.vue +68 -60
- package/src/components/Paragraphs/Calculator/index.vue +24 -22
- package/src/components/Paragraphs/RTWPlanner/CardContainer/index.vue +133 -0
- package/src/components/Paragraphs/RTWPlanner/Constants.js +410 -0
- package/src/components/Paragraphs/RTWPlanner/Footer/index.vue +32 -0
- package/src/components/Paragraphs/RTWPlanner/{NavBar → Header}/index.vue +20 -9
- package/src/components/Paragraphs/RTWPlanner/HomePage/index.vue +72 -0
- package/src/components/Paragraphs/RTWPlanner/Injuries/index.vue +174 -0
- package/src/components/Paragraphs/RTWPlanner/index.stories.js +68 -15
- package/src/components/Paragraphs/RTWPlanner/index.vue +99 -31
- package/src/components/Paragraphs/SelectableCards/Control/index.stories.js +31 -11
- package/src/components/Paragraphs/SelectableCards/cardbody.vue +9 -10
- package/src/components/Paragraphs/SelectableCards/cardtop.vue +23 -16
- package/src/components/Paragraphs/SelectableCards/index.stories.js +29 -8
- package/src/components/Paragraphs/SelectableCards/index.vue +124 -50
- package/src/components/SubComponents/Breadcrumb/index.vue +40 -7
- package/src/includes/scss/vars/src/colors.module.scss +3 -0
- package/src/includes/scss/vars/src/colors.scss +3 -0
- package/src/mock/control-selectable-cards.js +68 -25
- package/src/components/Paragraphs/RTWPlanner/Home/index.vue +0 -83
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
z-index: 27;
|
|
6
6
|
position: relative;
|
|
7
7
|
padding: 0px;
|
|
8
|
-
width:
|
|
8
|
+
width: 100%;
|
|
9
9
|
font-size: 14px;
|
|
10
|
+
overflow-x: hidden;
|
|
10
11
|
|
|
11
12
|
&__wrap {
|
|
12
13
|
position: relative;
|
|
@@ -386,11 +387,11 @@
|
|
|
386
387
|
|
|
387
388
|
.logo {
|
|
388
389
|
height: 85px;
|
|
389
|
-
padding: 15px
|
|
390
|
+
padding: 15px 10px 15px 0px;
|
|
390
391
|
width: 100%;
|
|
391
392
|
display: flex;
|
|
392
393
|
align-items: center;
|
|
393
|
-
margin-right:
|
|
394
|
+
margin-right: 0;
|
|
394
395
|
margin-left: -10px;
|
|
395
396
|
background-color: white;
|
|
396
397
|
width: 100vw;
|
|
@@ -398,12 +399,12 @@
|
|
|
398
399
|
&__nav {
|
|
399
400
|
display:inline-block;
|
|
400
401
|
margin-left: 15px;
|
|
401
|
-
margin-right:
|
|
402
|
+
margin-right: 0;
|
|
402
403
|
color: #000;
|
|
403
404
|
width: 100%;
|
|
404
405
|
text-align: right;
|
|
405
406
|
font-weight: bold;
|
|
406
|
-
overflow-y:auto;
|
|
407
|
+
overflow-y: auto;
|
|
407
408
|
|
|
408
409
|
a:focus {
|
|
409
410
|
border: 1px solid #BABABA !important;
|
|
@@ -12,8 +12,14 @@
|
|
|
12
12
|
: false
|
|
13
13
|
"
|
|
14
14
|
>
|
|
15
|
-
<row
|
|
16
|
-
|
|
15
|
+
<row
|
|
16
|
+
v-if="type === 'hero'"
|
|
17
|
+
class="wcl-hero-header__wrap wcl-hero-header__showmore"
|
|
18
|
+
>
|
|
19
|
+
<container
|
|
20
|
+
class="wcl-hero-header__content-wrapper__content"
|
|
21
|
+
:class="{ rtl }"
|
|
22
|
+
>
|
|
17
23
|
<row>
|
|
18
24
|
<column class="wcl-hero-header__content-wrapper__content-col">
|
|
19
25
|
<div>
|
|
@@ -37,14 +43,18 @@
|
|
|
37
43
|
</row>
|
|
38
44
|
<row class="wcl-hero-header__wrap">
|
|
39
45
|
<div class="wcl-hero-header__content-wrapper">
|
|
40
|
-
<container
|
|
46
|
+
<container
|
|
47
|
+
class="wcl-hero-header__content-wrapper__content"
|
|
48
|
+
:class="{ rtl }"
|
|
49
|
+
>
|
|
41
50
|
<row>
|
|
42
51
|
<column
|
|
43
52
|
:xs="generateGridValue(type)"
|
|
44
53
|
class="wcl-hero-header__content-wrapper__content-col"
|
|
45
54
|
:md="7"
|
|
46
55
|
:class="{
|
|
47
|
-
[`wcl-hero-header__content-wrapper__content-col--split`]:
|
|
56
|
+
[`wcl-hero-header__content-wrapper__content-col--split`]:
|
|
57
|
+
$slots.side,
|
|
48
58
|
}"
|
|
49
59
|
>
|
|
50
60
|
<breadcrumb
|
|
@@ -59,7 +69,10 @@
|
|
|
59
69
|
:content="strippedTitle"
|
|
60
70
|
class="wcl-hero-header__title"
|
|
61
71
|
/>
|
|
62
|
-
<div
|
|
72
|
+
<div
|
|
73
|
+
v-if="subTitle || $slots.description"
|
|
74
|
+
class="header-rich-text-wrap"
|
|
75
|
+
>
|
|
63
76
|
<rich-text
|
|
64
77
|
v-if="subTitle"
|
|
65
78
|
:content="subTitle"
|
|
@@ -96,7 +109,7 @@
|
|
|
96
109
|
</div>
|
|
97
110
|
<!-- Type Default -->
|
|
98
111
|
<column
|
|
99
|
-
v-if="type === 'default'
|
|
112
|
+
v-if="type === 'default'"
|
|
100
113
|
:md="'5'"
|
|
101
114
|
:xs="'5'"
|
|
102
115
|
class="wcl-hero-header__right"
|
|
@@ -104,7 +117,7 @@
|
|
|
104
117
|
:offset-md="rtl ? 0 : 7"
|
|
105
118
|
:offset-xs="rtl ? 0 : 7"
|
|
106
119
|
>
|
|
107
|
-
<div class="wcl-hero-header__mask">
|
|
120
|
+
<div class="wcl-hero-header__mask" v-if="showMask">
|
|
108
121
|
<hero-header-chevron />
|
|
109
122
|
</div>
|
|
110
123
|
</column>
|
|
@@ -112,7 +125,9 @@
|
|
|
112
125
|
<column
|
|
113
126
|
v-if="type === 'collection' && showMask"
|
|
114
127
|
:sm="'7'"
|
|
115
|
-
:style="
|
|
128
|
+
:style="
|
|
129
|
+
image && image.url ? `background-image:url(${image.url})` : false
|
|
130
|
+
"
|
|
116
131
|
class="wcl-hero-header__right type-collection"
|
|
117
132
|
:class="{ 'rtl-flip': rtl }"
|
|
118
133
|
:offset-sm="rtl ? 0 : 5"
|
|
@@ -134,7 +149,9 @@
|
|
|
134
149
|
:class="{ 'rtl-flip': rtl }"
|
|
135
150
|
:offset-md="rtl ? 0 : 7"
|
|
136
151
|
:offset-xs="rtl ? 0 : 7"
|
|
137
|
-
:style="
|
|
152
|
+
:style="
|
|
153
|
+
image && image.url ? `background-image:url(${image.url})` : false
|
|
154
|
+
"
|
|
138
155
|
>
|
|
139
156
|
|
|
140
157
|
</column>
|
|
@@ -144,19 +161,19 @@
|
|
|
144
161
|
</container>
|
|
145
162
|
</template>
|
|
146
163
|
<script>
|
|
147
|
-
import SocialShare from
|
|
148
|
-
import Container from
|
|
149
|
-
import Row from
|
|
150
|
-
import Column from
|
|
151
|
-
import Breadcrumb from
|
|
152
|
-
import CtaButton from
|
|
153
|
-
import Icon from
|
|
154
|
-
import HeroHeaderChevron from
|
|
155
|
-
import CaretDown from
|
|
156
|
-
import RichText from
|
|
164
|
+
import SocialShare from './../SocialShare/index.vue'
|
|
165
|
+
import Container from './../../Containers/Container/index.vue'
|
|
166
|
+
import Row from './../../Containers/Row/index.vue'
|
|
167
|
+
import Column from './../../Containers/Column/index.vue'
|
|
168
|
+
import Breadcrumb from './../../SubComponents/Breadcrumb/index.vue'
|
|
169
|
+
import CtaButton from './../../SubComponents/CtaButton/index.vue'
|
|
170
|
+
import Icon from './../../SubComponents/Icon/index.vue'
|
|
171
|
+
import HeroHeaderChevron from './../../../assets/images/hero-header-chevron.svg?component'
|
|
172
|
+
import CaretDown from './../../../assets/icons/chev-down-white.svg?url'
|
|
173
|
+
import RichText from './../../Paragraphs/RichText/index.vue'
|
|
157
174
|
|
|
158
175
|
export default {
|
|
159
|
-
name:
|
|
176
|
+
name: 'HeroHeader',
|
|
160
177
|
components: {
|
|
161
178
|
Container,
|
|
162
179
|
Row,
|
|
@@ -171,15 +188,15 @@ export default {
|
|
|
171
188
|
props: {
|
|
172
189
|
type: {
|
|
173
190
|
type: String,
|
|
174
|
-
default:
|
|
191
|
+
default: 'default',
|
|
175
192
|
},
|
|
176
193
|
title: {
|
|
177
194
|
type: String,
|
|
178
|
-
default:
|
|
195
|
+
default: '',
|
|
179
196
|
},
|
|
180
197
|
description: {
|
|
181
198
|
type: String,
|
|
182
|
-
default:
|
|
199
|
+
default: '',
|
|
183
200
|
},
|
|
184
201
|
image: {
|
|
185
202
|
type: Object,
|
|
@@ -223,33 +240,33 @@ export default {
|
|
|
223
240
|
socialShareToggle: false,
|
|
224
241
|
HeroHeaderChevron,
|
|
225
242
|
CaretDown,
|
|
226
|
-
}
|
|
243
|
+
}
|
|
227
244
|
},
|
|
228
245
|
computed: {
|
|
229
246
|
generatedClass() {
|
|
230
|
-
let c = `wcl-hero-header type-${this.type}
|
|
247
|
+
let c = `wcl-hero-header type-${this.type}`
|
|
231
248
|
if (this.bgColor) {
|
|
232
|
-
c = c +
|
|
249
|
+
c = c + ' -with-bg'
|
|
233
250
|
}
|
|
234
|
-
return c
|
|
251
|
+
return c
|
|
235
252
|
},
|
|
236
253
|
subTitle() {
|
|
237
|
-
let content = undefined
|
|
254
|
+
let content = undefined
|
|
238
255
|
if (this.description) {
|
|
239
|
-
if (typeof this.description ===
|
|
240
|
-
content = this.description
|
|
241
|
-
} else if (typeof this.description ===
|
|
242
|
-
content = this.description.processed
|
|
256
|
+
if (typeof this.description === 'string') {
|
|
257
|
+
content = this.description
|
|
258
|
+
} else if (typeof this.description === 'object') {
|
|
259
|
+
content = this.description.processed
|
|
243
260
|
}
|
|
244
261
|
}
|
|
245
|
-
if (content && !content.startsWith(
|
|
246
|
-
content = `<p class="intro">${content}</p
|
|
262
|
+
if (content && !content.startsWith('<') && !this.tag?.startsWith('h')) {
|
|
263
|
+
content = `<p class="intro">${content}</p>`
|
|
247
264
|
}
|
|
248
|
-
return content
|
|
265
|
+
return content
|
|
249
266
|
},
|
|
250
267
|
strippedTitle() {
|
|
251
|
-
if (this.type ===
|
|
252
|
-
return this.title.slice(0, 122) +
|
|
268
|
+
if (this.type === 'hero' && this.title.length > 122) {
|
|
269
|
+
return this.title.slice(0, 122) + '...'
|
|
253
270
|
}
|
|
254
271
|
// Will reintroduce if business requirement
|
|
255
272
|
// if (this.title?.includes('.')) {
|
|
@@ -258,7 +275,7 @@ export default {
|
|
|
258
275
|
// return sentences.map((sentence) => sentence.trim()).join('.<br/>')
|
|
259
276
|
// }
|
|
260
277
|
// }
|
|
261
|
-
return this.title
|
|
278
|
+
return this.title
|
|
262
279
|
},
|
|
263
280
|
// Will reintroduce if business requirement
|
|
264
281
|
// strippedDescription() {
|
|
@@ -271,57 +288,57 @@ export default {
|
|
|
271
288
|
},
|
|
272
289
|
mounted() {
|
|
273
290
|
if (this.$bus) {
|
|
274
|
-
this.$bus.$on(
|
|
291
|
+
this.$bus.$on('scrollToTop', () => {
|
|
275
292
|
setTimeout(() => {
|
|
276
|
-
const title = this.$refs.title
|
|
293
|
+
const title = this.$refs.title
|
|
277
294
|
if (title) {
|
|
278
|
-
title.$el.setAttribute(
|
|
279
|
-
title.$el.focus()
|
|
295
|
+
title.$el.setAttribute('tabindex', 0)
|
|
296
|
+
title.$el.focus()
|
|
280
297
|
}
|
|
281
|
-
}, 500)
|
|
282
|
-
})
|
|
298
|
+
}, 500)
|
|
299
|
+
})
|
|
283
300
|
}
|
|
284
301
|
},
|
|
285
302
|
beforeDestroy() {
|
|
286
303
|
if (this.$bus) {
|
|
287
|
-
this.$bus.$off(
|
|
304
|
+
this.$bus.$off('scrollToTop')
|
|
288
305
|
}
|
|
289
306
|
},
|
|
290
307
|
methods: {
|
|
291
308
|
generateGridValue(type) {
|
|
292
309
|
switch (type) {
|
|
293
310
|
//the prop type default
|
|
294
|
-
case
|
|
295
|
-
return
|
|
296
|
-
case
|
|
297
|
-
return
|
|
311
|
+
case 'default':
|
|
312
|
+
return '6'
|
|
313
|
+
case 'image':
|
|
314
|
+
return '6'
|
|
298
315
|
default:
|
|
299
|
-
return
|
|
316
|
+
return '7'
|
|
300
317
|
}
|
|
301
318
|
},
|
|
302
319
|
showMore(ev) {
|
|
303
320
|
if (ev?.target?.scrollIntoView) {
|
|
304
321
|
ev.target.scrollIntoView({
|
|
305
|
-
behavior:
|
|
322
|
+
behavior: 'smooth',
|
|
306
323
|
alignToTop: true,
|
|
307
|
-
block:
|
|
308
|
-
})
|
|
324
|
+
block: 'start',
|
|
325
|
+
})
|
|
309
326
|
}
|
|
310
327
|
},
|
|
311
328
|
fireGTM() {
|
|
312
329
|
let attrs = {
|
|
313
330
|
label: this.cta.uri,
|
|
314
331
|
document_title: this.cta.filename,
|
|
315
|
-
}
|
|
332
|
+
}
|
|
316
333
|
if (this.$gtm) {
|
|
317
|
-
this.$gtm.push({ event:
|
|
334
|
+
this.$gtm.push({ event: 'custom.interaction.download', ...attrs })
|
|
318
335
|
}
|
|
319
336
|
},
|
|
320
337
|
},
|
|
321
|
-
}
|
|
338
|
+
}
|
|
322
339
|
</script>
|
|
323
340
|
<style lang="scss" scoped>
|
|
324
|
-
@import
|
|
341
|
+
@import './styles';
|
|
325
342
|
|
|
326
343
|
.wysiwyg {
|
|
327
344
|
:deep(.cta-button:last-child) {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
:cards="cards"
|
|
8
8
|
class="ffh-card-container control-selectablecards"
|
|
9
9
|
:card-type="typeCard"
|
|
10
|
+
:button-role="'radio'"
|
|
10
11
|
:icon-is-bordered="iconIsBordered"
|
|
11
12
|
:card-text-align="cardItemTextAlign"
|
|
12
13
|
@selected="selectedCardChangeFocus"
|
|
@@ -87,18 +88,18 @@
|
|
|
87
88
|
</template>
|
|
88
89
|
|
|
89
90
|
<script>
|
|
90
|
-
import Container from
|
|
91
|
-
import Column from
|
|
92
|
-
import Row from
|
|
93
|
-
import CtaButton from
|
|
94
|
-
import SelectableCards from
|
|
95
|
-
import CaretDown from
|
|
96
|
-
import CaretUp from
|
|
97
|
-
import CaretRight from
|
|
98
|
-
import CaretLeft from
|
|
91
|
+
import Container from '../../../Containers/Container/index.vue'
|
|
92
|
+
import Column from '../../../Containers/Column/index.vue'
|
|
93
|
+
import Row from '../../../Containers/Row/index.vue'
|
|
94
|
+
import CtaButton from '../../../SubComponents/CtaButton/index.vue'
|
|
95
|
+
import SelectableCards from '../../SelectableCards/index.vue'
|
|
96
|
+
import CaretDown from '../../../../assets/icons/caret-down.svg?url'
|
|
97
|
+
import CaretUp from '../../../../assets/icons/caret-up.svg?url'
|
|
98
|
+
import CaretRight from '../../../../assets/icons/caret-right.svg?url'
|
|
99
|
+
import CaretLeft from '../../../../assets/icons/caret-left.svg?url'
|
|
99
100
|
|
|
100
101
|
export default {
|
|
101
|
-
name:
|
|
102
|
+
name: 'CardContainer',
|
|
102
103
|
components: {
|
|
103
104
|
Column,
|
|
104
105
|
Container,
|
|
@@ -131,6 +132,10 @@ export default {
|
|
|
131
132
|
type: Array,
|
|
132
133
|
default: () => [],
|
|
133
134
|
},
|
|
135
|
+
buttonRole: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: 'radio',
|
|
138
|
+
},
|
|
134
139
|
},
|
|
135
140
|
data() {
|
|
136
141
|
return {
|
|
@@ -138,108 +143,111 @@ export default {
|
|
|
138
143
|
CaretDown,
|
|
139
144
|
CaretRight,
|
|
140
145
|
CaretLeft,
|
|
141
|
-
typeCard:
|
|
142
|
-
cardItemTextAlign:
|
|
146
|
+
typeCard: 'control-selectcards',
|
|
147
|
+
cardItemTextAlign: 'center',
|
|
143
148
|
title: null,
|
|
144
149
|
cards: null,
|
|
145
150
|
cardUnit: null,
|
|
146
|
-
placeHolder:
|
|
151
|
+
placeHolder: '000',
|
|
147
152
|
inputValueDisplay: null,
|
|
148
153
|
minValue: 0.25,
|
|
149
154
|
maxValue: 500,
|
|
150
155
|
selectedCard: null,
|
|
151
156
|
selectedInput: null,
|
|
152
|
-
}
|
|
157
|
+
}
|
|
153
158
|
},
|
|
154
159
|
computed: {
|
|
155
160
|
isButtonDisabled() {
|
|
156
161
|
// Call the function to get its result, then check if either selectedCard is null or inputValueDisplay is null
|
|
157
|
-
return this.getValueWithoutUnits === null
|
|
162
|
+
return this.getValueWithoutUnits === null
|
|
158
163
|
},
|
|
159
164
|
getValueWithoutUnits() {
|
|
160
165
|
// Ensure that inputValueDisplay is not null before attempting to replace
|
|
161
166
|
if (this.inputValueDisplay !== null) {
|
|
162
167
|
// Remove units (e.g., 'kg' or 'meters') from the input value
|
|
163
|
-
const valueWithoutUnits = this.inputValueDisplay.replace(
|
|
168
|
+
const valueWithoutUnits = this.inputValueDisplay.replace(
|
|
169
|
+
/kg|meters/i,
|
|
170
|
+
'',
|
|
171
|
+
)
|
|
164
172
|
// Convert the remaining value to a numeric representation
|
|
165
|
-
const numericValue = parseFloat(valueWithoutUnits)
|
|
173
|
+
const numericValue = parseFloat(valueWithoutUnits)
|
|
166
174
|
// Check if numericValue is a valid number
|
|
167
175
|
if (!isNaN(numericValue)) {
|
|
168
176
|
// Use toFixed(2) to display the number with two decimal places
|
|
169
|
-
return parseFloat(numericValue.toFixed(2))
|
|
177
|
+
return parseFloat(numericValue.toFixed(2))
|
|
170
178
|
} else {
|
|
171
|
-
return null
|
|
179
|
+
return null
|
|
172
180
|
}
|
|
173
181
|
} else {
|
|
174
|
-
return null
|
|
182
|
+
return null
|
|
175
183
|
}
|
|
176
184
|
},
|
|
177
185
|
},
|
|
178
186
|
mounted() {
|
|
179
|
-
this.inputValueDisplay = null
|
|
187
|
+
this.inputValueDisplay = null
|
|
180
188
|
if (this.isWeight) {
|
|
181
|
-
this.title = this.titles.weight
|
|
182
|
-
this.cards = this.weights
|
|
183
|
-
this.cardUnit =
|
|
184
|
-
this.placeHolder = this.placeHolder + this.cardUnit
|
|
185
|
-
this.minValue = 0.25
|
|
186
|
-
this.maxValue = 500
|
|
189
|
+
this.title = this.titles.weight
|
|
190
|
+
this.cards = this.weights
|
|
191
|
+
this.cardUnit = ' kg'
|
|
192
|
+
this.placeHolder = this.placeHolder + this.cardUnit
|
|
193
|
+
this.minValue = 0.25
|
|
194
|
+
this.maxValue = 500
|
|
187
195
|
} else {
|
|
188
|
-
this.title = this.titles.height
|
|
189
|
-
this.cards = this.heights
|
|
190
|
-
this.cardUnit =
|
|
191
|
-
this.placeHolder = this.placeHolder + this.cardUnit
|
|
192
|
-
this.minValue = 2
|
|
193
|
-
this.maxValue = 250
|
|
196
|
+
this.title = this.titles.height
|
|
197
|
+
this.cards = this.heights
|
|
198
|
+
this.cardUnit = ' meters'
|
|
199
|
+
this.placeHolder = this.placeHolder + this.cardUnit
|
|
200
|
+
this.minValue = 2
|
|
201
|
+
this.maxValue = 250
|
|
194
202
|
}
|
|
195
203
|
},
|
|
196
204
|
methods: {
|
|
197
205
|
handlePrevScreen() {
|
|
198
|
-
this.$emit(
|
|
206
|
+
this.$emit('prevScreen')
|
|
199
207
|
},
|
|
200
208
|
handleNextScreen() {
|
|
201
209
|
// Only emit the 'nextScreen' event if the button is not disabled
|
|
202
210
|
if (!this.isButtonDisabled) {
|
|
203
|
-
this.selectedInput = { value: this.getValueWithoutUnits }
|
|
211
|
+
this.selectedInput = { value: this.getValueWithoutUnits }
|
|
204
212
|
|
|
205
|
-
this.inputValueDisplay = null
|
|
206
|
-
this.$emit(
|
|
213
|
+
this.inputValueDisplay = null
|
|
214
|
+
this.$emit('nextScreen', this.selectedInput)
|
|
207
215
|
}
|
|
208
216
|
},
|
|
209
217
|
selectedCardChangeFocus(card) {
|
|
210
218
|
// if statement added to overcome issue of lost values when function is called twice
|
|
211
219
|
if (card.value !== undefined) {
|
|
212
|
-
this.selectedCard = card
|
|
213
|
-
this.selectedInput = null
|
|
214
|
-
this.inputValueDisplay = card.value +
|
|
215
|
-
this.$nextTick(() => this.$refs.calNextBtn.$el.focus())
|
|
220
|
+
this.selectedCard = card
|
|
221
|
+
this.selectedInput = null
|
|
222
|
+
this.inputValueDisplay = card.value + ' ' + this.cardUnit
|
|
223
|
+
this.$nextTick(() => this.$refs.calNextBtn.$el.focus())
|
|
216
224
|
}
|
|
217
225
|
},
|
|
218
226
|
clearCard() {
|
|
219
|
-
this.selectedInput = null
|
|
227
|
+
this.selectedInput = null
|
|
220
228
|
|
|
221
|
-
this.selectedCard = null
|
|
222
|
-
this.$refs.cardDeck.clearCard()
|
|
229
|
+
this.selectedCard = null
|
|
230
|
+
this.$refs.cardDeck.clearCard()
|
|
223
231
|
},
|
|
224
232
|
incrementValue() {
|
|
225
233
|
if (this.selectedCard !== null) {
|
|
226
|
-
this.$refs.cardDeck.clearCard()
|
|
234
|
+
this.$refs.cardDeck.clearCard()
|
|
227
235
|
}
|
|
228
236
|
|
|
229
|
-
let newValue = Math.min(this.getValueWithoutUnits + 1, this.maxValue)
|
|
230
|
-
this.inputValueDisplay = newValue + this.cardUnit
|
|
237
|
+
let newValue = Math.min(this.getValueWithoutUnits + 1, this.maxValue)
|
|
238
|
+
this.inputValueDisplay = newValue + this.cardUnit
|
|
231
239
|
|
|
232
|
-
this.selectedInput = { value: newValue }
|
|
240
|
+
this.selectedInput = { value: newValue }
|
|
233
241
|
},
|
|
234
242
|
decrementValue() {
|
|
235
243
|
if (this.selectedCard !== null) {
|
|
236
|
-
this.$refs.cardDeck.clearCard()
|
|
244
|
+
this.$refs.cardDeck.clearCard()
|
|
237
245
|
}
|
|
238
246
|
|
|
239
|
-
let newValue = Math.max(this.getValueWithoutUnits - 1, this.minValue)
|
|
240
|
-
this.inputValueDisplay = newValue + this.cardUnit
|
|
247
|
+
let newValue = Math.max(this.getValueWithoutUnits - 1, this.minValue)
|
|
248
|
+
this.inputValueDisplay = newValue + this.cardUnit
|
|
241
249
|
|
|
242
|
-
this.selectedInput = { value: newValue }
|
|
250
|
+
this.selectedInput = { value: newValue }
|
|
243
251
|
},
|
|
244
252
|
// Validate the input value on blur
|
|
245
253
|
validateInput() {
|
|
@@ -250,28 +258,28 @@ export default {
|
|
|
250
258
|
this.getValueWithoutUnits <= this.maxValue
|
|
251
259
|
) {
|
|
252
260
|
// Value is within the range, update the input value
|
|
253
|
-
this.inputValueDisplay = this.getValueWithoutUnits + this.cardUnit
|
|
261
|
+
this.inputValueDisplay = this.getValueWithoutUnits + this.cardUnit
|
|
254
262
|
|
|
255
263
|
// alternate..
|
|
256
|
-
this.selectedInput = { value: this.getValueWithoutUnits }
|
|
264
|
+
this.selectedInput = { value: this.getValueWithoutUnits }
|
|
257
265
|
} else {
|
|
258
266
|
// Value is outside the range, leave the input blank
|
|
259
|
-
this.inputValueDisplay = null
|
|
267
|
+
this.inputValueDisplay = null
|
|
260
268
|
|
|
261
|
-
this.selectedInput = null
|
|
269
|
+
this.selectedInput = null
|
|
262
270
|
}
|
|
263
271
|
},
|
|
264
272
|
// Handle input focus
|
|
265
273
|
handleInputFocus() {
|
|
266
274
|
if (this.selectedCard !== null) {
|
|
267
|
-
this.$refs.cardDeck.clearCard()
|
|
275
|
+
this.$refs.cardDeck.clearCard()
|
|
268
276
|
}
|
|
269
277
|
},
|
|
270
278
|
},
|
|
271
|
-
}
|
|
279
|
+
}
|
|
272
280
|
</script>
|
|
273
281
|
|
|
274
282
|
<style lang="scss" scoped>
|
|
275
|
-
@import
|
|
276
|
-
@import
|
|
283
|
+
@import '../../../../includes/scss/all';
|
|
284
|
+
@import './styles';
|
|
277
285
|
</style>
|