@eox/pages-theme-eox 0.5.4 → 0.5.5
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/PricingTable.vue +31 -15
package/package.json
CHANGED
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
<div
|
|
59
59
|
v-for="(plan, index) in localPlans"
|
|
60
60
|
:key="'head-' + index"
|
|
61
|
-
class="cell surface-container-low
|
|
61
|
+
class="cell surface-container-low top-cell bold top-margin"
|
|
62
62
|
:class="`orig-col-${index + 2}`"
|
|
63
63
|
>
|
|
64
|
-
<h6 class="primary-text bold">{{ plan.name }}</h6>
|
|
64
|
+
<h6 class="primary-text bold top-margin">{{ plan.name }}</h6>
|
|
65
65
|
</div>
|
|
66
66
|
|
|
67
67
|
<div class="cell orig-col-1 m l">Price (per month):</div>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
v-for="(plan, planIndex) in localPlans"
|
|
91
91
|
:key="`${planIndex}-${row}`"
|
|
92
92
|
class="bold surface-container-low"
|
|
93
|
-
:class="`cell orig-col-${planIndex + 2} ${rowIndex === getRowKeys(localPlans).length - 1 && !config.showSales ? '
|
|
93
|
+
:class="`cell orig-col-${planIndex + 2} ${rowIndex === getRowKeys(localPlans).length - 1 && !config.showSales ? 'bottom-cell' : ''}`"
|
|
94
94
|
>
|
|
95
95
|
<div
|
|
96
96
|
v-if="typeof plan.details[row] === 'string'"
|
|
@@ -108,7 +108,9 @@
|
|
|
108
108
|
<input
|
|
109
109
|
type="checkbox"
|
|
110
110
|
:id="`${plan.name}-${row}`"
|
|
111
|
+
v-model="plan.details[row].alternative.checked"
|
|
111
112
|
@input="$forceUpdate()"
|
|
113
|
+
@change="updatePrices"
|
|
112
114
|
/>
|
|
113
115
|
<span :for="`${plan.name}-${row}`"
|
|
114
116
|
><h6 class="small bold">
|
|
@@ -132,7 +134,7 @@
|
|
|
132
134
|
<div
|
|
133
135
|
v-for="(plan, index) in localPlans"
|
|
134
136
|
:key="'cta-' + index"
|
|
135
|
-
:class="`surface-container-low
|
|
137
|
+
:class="`surface-container-low cell bottom-cell orig-col-${index + 2} center-align`"
|
|
136
138
|
>
|
|
137
139
|
<a v-if="plan.link" :href="plan.link"
|
|
138
140
|
>See all features
|
|
@@ -154,7 +156,7 @@
|
|
|
154
156
|
v-if="showSales"
|
|
155
157
|
v-for="(plan, index) in localPlans"
|
|
156
158
|
:key="'cta-' + index"
|
|
157
|
-
:class="`surface-container-low
|
|
159
|
+
:class="`surface-container-low cell bottom-cell orig-col-${index + 2} center-align`"
|
|
158
160
|
>
|
|
159
161
|
<ClientOnly>
|
|
160
162
|
<a
|
|
@@ -183,7 +185,7 @@
|
|
|
183
185
|
<div
|
|
184
186
|
v-for="(plan, detailPlanIndex) in detail.plans"
|
|
185
187
|
:key="detailPlanIndex"
|
|
186
|
-
class="surface-container-low primary-text bold
|
|
188
|
+
class="surface-container-low primary-text bold top-margin top-cell"
|
|
187
189
|
:class="`cell orig-col-${detailPlanIndex + 2}`"
|
|
188
190
|
>
|
|
189
191
|
<h6 class="primary-text bold s">{{ plan.name }}</h6>
|
|
@@ -204,7 +206,7 @@
|
|
|
204
206
|
v-for="(plan, planIndex) in detail.plans"
|
|
205
207
|
:key="`${planIndex}-${row}`"
|
|
206
208
|
class="bold surface-container-low"
|
|
207
|
-
:class="`cell orig-col-${planIndex + 2} ${rowIndex === getRowKeys(detail.plans).length - 1 && !config.showSales ? '
|
|
209
|
+
:class="`cell orig-col-${planIndex + 2} ${rowIndex === getRowKeys(detail.plans).length - 1 && !config.showSales ? 'bottom-cell' : ''}`"
|
|
208
210
|
>
|
|
209
211
|
<div class="s grey-text" v-html="row + ':'"></div>
|
|
210
212
|
<template
|
|
@@ -278,11 +280,25 @@ export default {
|
|
|
278
280
|
methods: {
|
|
279
281
|
calculatePrice(plan) {
|
|
280
282
|
const basePrice = plan.basePrice;
|
|
281
|
-
const
|
|
283
|
+
const additionalOptionPrice = this.localOptions
|
|
282
284
|
.filter((option) => option.checked)
|
|
283
285
|
.reduce((sum, option) => sum + (option.modifier || 0), 0);
|
|
284
286
|
|
|
285
|
-
|
|
287
|
+
let additionalPlanModifier = 0;
|
|
288
|
+
if (plan.details) {
|
|
289
|
+
Object.values(plan.details).forEach((value) => {
|
|
290
|
+
if (value && typeof value === "object") {
|
|
291
|
+
if (
|
|
292
|
+
"alternative" in value &&
|
|
293
|
+
"modifier" in value.alternative &&
|
|
294
|
+
"checked" in value.alternative &&
|
|
295
|
+
value.alternative.checked
|
|
296
|
+
)
|
|
297
|
+
additionalPlanModifier += value.alternative.modifier;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
return basePrice + additionalOptionPrice + additionalPlanModifier;
|
|
286
302
|
},
|
|
287
303
|
getRowKeys(plansArray) {
|
|
288
304
|
const keys = new Set();
|
|
@@ -410,14 +426,14 @@ export default {
|
|
|
410
426
|
overflow: hidden;
|
|
411
427
|
}
|
|
412
428
|
|
|
413
|
-
.
|
|
414
|
-
border-top-left-radius:
|
|
415
|
-
border-top-right-radius:
|
|
429
|
+
.top-cell {
|
|
430
|
+
border-top-left-radius: 0.5rem;
|
|
431
|
+
border-top-right-radius: 0.5rem;
|
|
416
432
|
}
|
|
417
433
|
|
|
418
|
-
.
|
|
419
|
-
border-bottom-left-radius:
|
|
420
|
-
border-bottom-right-radius:
|
|
434
|
+
.bottom-cell {
|
|
435
|
+
border-bottom-left-radius: 0.5rem;
|
|
436
|
+
border-bottom-right-radius: 0.5rem;
|
|
421
437
|
}
|
|
422
438
|
|
|
423
439
|
@media screen and (min-width: 769px) {
|