@lancom/shared 0.0.278 → 0.0.280

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 (41) hide show
  1. package/assets/js/api/admin.js +3 -0
  2. package/assets/js/utils/order.js +1 -1
  3. package/assets/js/utils/quote.js +6 -1
  4. package/components/common/progress_steps/progress-steps.scss +3 -1
  5. package/components/common/progress_steps/progress-steps.vue +9 -1
  6. package/components/editor/editor.vue +18 -1
  7. package/components/editor/editor_wizard/editor-wizard.scss +22 -0
  8. package/components/editor/editor_wizard/editor-wizard.vue +66 -0
  9. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +1 -1
  10. package/components/product/related_products/related-products.vue +1 -1
  11. package/components/product/wizard/wizard.scss +222 -0
  12. package/components/product/wizard/wizard.vue +274 -0
  13. package/components/product/wizard/wizard_print/wizard-print.scss +94 -0
  14. package/components/product/wizard/wizard_print/wizard-print.vue +130 -0
  15. package/components/product/wizard/wizard_print_area/wizard-print-area.scss +101 -0
  16. package/components/product/wizard/wizard_print_area/wizard-print-area.vue +86 -0
  17. package/components/product/wizard/wizard_print_layers/wizard-print-layers.scss +60 -0
  18. package/components/product/wizard/wizard_print_layers/wizard-print-layers.vue +67 -0
  19. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.scss +47 -0
  20. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +210 -0
  21. package/components/product/wizard/wizard_print_review/wizard-print-review.scss +0 -0
  22. package/components/product/wizard/wizard_print_review/wizard-print-review.vue +71 -0
  23. package/components/product/wizard/wizard_print_size/wizard-print-size.scss +68 -0
  24. package/components/product/wizard/wizard_print_size/wizard-print-size.vue +49 -0
  25. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.scss +65 -0
  26. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +106 -0
  27. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.scss +65 -0
  28. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.vue +116 -0
  29. package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.scss +138 -0
  30. package/components/product/wizard/wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form.vue +157 -0
  31. package/components/product/wizard/wizard_print_type/wizard-print-type.scss +65 -0
  32. package/components/product/wizard/wizard_print_type/wizard-print-type.vue +49 -0
  33. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.scss +87 -0
  34. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +114 -0
  35. package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.scss +65 -0
  36. package/components/product/wizard/wizard_print_underbase/wizard-print-underbase.vue +49 -0
  37. package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.scss +87 -0
  38. package/components/product/wizard/wizard_print_underbase/wizard_print_area_print_underbase/wizard-print-area-print-underbase.vue +90 -0
  39. package/package.json +1 -1
  40. package/store/layers.js +6 -1
  41. package/store/product.js +42 -0
@@ -0,0 +1,274 @@
1
+ <template>
2
+ <div class="Wizard__wrapper">
3
+ <div
4
+ v-if="preSetPrint"
5
+ class="Wizard__header Wizard__header--active">
6
+ <div class="Wizard__header-name">
7
+ PRINT OPTIONS
8
+ </div>
9
+ <div
10
+ class="Wizard__header-state"
11
+ @click="removePreSetPrint()">
12
+ remove
13
+ </div>
14
+ </div>
15
+ <div
16
+ v-else
17
+ class="Wizard__header"
18
+ :class="{
19
+ 'Wizard__header--active': isVisible
20
+ }"
21
+ @click="toggleVisible()">
22
+ <div class="Wizard__header-name">
23
+ {{ product.prePrint ? 'CLICK TO ADD ADDITIONAL PRINT OR LOGO' : 'CLICK TO ADD LOGO OR PRINT TO ORDER' }}
24
+ </div>
25
+ <div
26
+ v-if="!product.printOnly"
27
+ class="Wizard__header-state">
28
+ {{ isVisible ? 'CANCEL PRINT' : 'ADD PRINT' }}
29
+ </div>
30
+ </div>
31
+ <div
32
+ v-if="isVisible"
33
+ class="Wizard__content"
34
+ :class="{
35
+ 'Wizard__content--visible': isVisible
36
+ }">
37
+ <div
38
+ v-if="hasLayers"
39
+ class="Wizard__layers">
40
+ <wizard-print-layers
41
+ :layers="layers"
42
+ :editable="true"
43
+ @edit="editLayer($event)"
44
+ @delete="removeTemplateLayer($event)" />
45
+ <div
46
+ v-if="!preSetPrint"
47
+ class="Wizard__layers-info">
48
+ <p>1. Note final print price will be calculated once garment quantity is finalised</p>
49
+ <p>2. PDF mockup will be provided for approval prior to printing</p>
50
+ </div>
51
+ </div>
52
+ <progress-steps
53
+ v-if="(visibleSteps || !hasLayers)"
54
+ ref="progressSteps"
55
+ :steps="steps"
56
+ :has-border="hasBorder"
57
+ :visible-current-step="false"
58
+ :hidden-done-step-number="hiddenDoneStepNumber"
59
+ :step-offset="1"
60
+ :hidden-steps="hiddenSteps"
61
+ step-label="Step"
62
+ @finish="setVisibleSteps(false)">
63
+ <div
64
+ slot="step-progress"
65
+ slot-scope="{ currentStepIndex, stepOffset, index, step }"
66
+ class="Wizard__step"
67
+ :class="{
68
+ 'Wizard__step--last': (steps.length - stepOffset) === (index + 1),
69
+ 'Wizard__step--active': index <= (currentStepIndex - stepOffset)
70
+ }">
71
+ <div class="Wizard__step-progress">
72
+ <div class="Wizard__step-number">
73
+ <i
74
+ v-if="index <= (currentStepIndex - stepOffset)"
75
+ class="icon-ok"></i>
76
+ Step {{ index + 1 }}
77
+ </div>
78
+ <div class="Wizard__step-name">
79
+ {{ step }}
80
+ </div>
81
+ </div>
82
+ </div>
83
+ <div slot-scope="{ currentStep }">
84
+ <transition>
85
+ <component
86
+ :is="stepComponents[currentStep]"
87
+ ref="steps"
88
+ @next="goToNextStep"
89
+ @prev="goToPrevStep"></component>
90
+ </transition>
91
+ <div class="Wizard__info">
92
+ <info
93
+ v-if="product.prePrint"
94
+ class="Wizard__info-item">
95
+ <template slot="text">
96
+ You can add your own logo to this product as well if you order 12 or more.
97
+ </template>
98
+ </info>
99
+ <info class="Wizard__info-item">
100
+ <template slot="text">
101
+ {{ product.prePrint ? 'Once we review your order and check the logo, we will send a you PDF mockup for approval' : 'Free PDF mockup for approval' }}
102
+ </template>
103
+ </info>
104
+ <info class="Wizard__info-item">
105
+ <template slot="text">
106
+ Express* prints in 3 days
107
+ </template>
108
+ </info>
109
+ </div>
110
+ </div>
111
+ </progress-steps>
112
+ </div>
113
+ </div>
114
+ </template>
115
+
116
+ <script>
117
+ import { mapGetters, mapMutations, mapActions } from 'vuex';
118
+ import gtm from '@lancom/shared/assets/js/utils/gtm';
119
+ import Info from '@lancom/shared/components/common/info-popover';
120
+ import { getPrintAreaSizes } from '@lancom/shared/assets/js/utils/prints';
121
+ import ProgressSteps from '@lancom/shared/components/common/progress_steps/progress-steps';
122
+ import WizardPrintArea from './wizard_print_area/wizard-print-area';
123
+ import WizardPrintSize from './wizard_print_size/wizard-print-size';
124
+ import WizardPrintType from './wizard_print_type/wizard-print-type';
125
+ import WizardPrintUnderbase from './wizard_print_underbase/wizard-print-underbase';
126
+ import WizardPrintTextOrLogo from './wizard_print_text_or_logo/wizard-print-text-or-logo';
127
+ import WizardPrintReview from './wizard_print_review/wizard-print-review';
128
+ import WizardPrintLayers from './wizard_print_layers/wizard-print-layers';
129
+ import WizardPrint from './wizard_print/wizard-print';
130
+
131
+ const WIZARD_STEPS = {
132
+ PRINT: 'Print',
133
+ PRINT_AREA: 'Printable area',
134
+ PRINT_SIZE: 'Print size',
135
+ PRINT_UNDERBASE: 'Print underbase',
136
+ PRINT_TYPE: 'Print type',
137
+ TEXT_OR_LOGO: 'Text or logo',
138
+ REVIEW: 'Print review'
139
+ };
140
+ const WIZARD_STEPS_LIST = Object.keys(WIZARD_STEPS).map(k => WIZARD_STEPS[k]);
141
+
142
+ export default {
143
+ name: 'Editor',
144
+ components: {
145
+ ProgressSteps,
146
+ WizardPrintArea,
147
+ WizardPrintSize,
148
+ WizardPrintType,
149
+ WizardPrintUnderbase,
150
+ WizardPrintTextOrLogo,
151
+ WizardPrintReview,
152
+ WizardPrintLayers,
153
+ WizardPrint,
154
+ Info
155
+ },
156
+ data() {
157
+ return {
158
+ isVisible: false,
159
+ hiddenSteps: [WIZARD_STEPS.PRINT],
160
+ stepComponents: {
161
+ [WIZARD_STEPS.PRINT]: 'wizard-print',
162
+ [WIZARD_STEPS.PRINT_AREA]: 'wizard-print-area',
163
+ [WIZARD_STEPS.PRINT_SIZE]: 'wizard-print-size',
164
+ [WIZARD_STEPS.PRINT_TYPE]: 'wizard-print-type',
165
+ [WIZARD_STEPS.PRINT_UNDERBASE]: 'wizard-print-underbase',
166
+ [WIZARD_STEPS.TEXT_OR_LOGO]: 'wizard-print-text-or-logo',
167
+ [WIZARD_STEPS.REVIEW]: 'wizard-print-review'
168
+ }
169
+ };
170
+ },
171
+ props: {
172
+ hiddenDoneStepNumber: {
173
+ type: Boolean,
174
+ default: false
175
+ },
176
+ hasBorder: {
177
+ type: Boolean,
178
+ default: true
179
+ }
180
+ },
181
+ computed: {
182
+ ...mapGetters(['shop']),
183
+ ...mapGetters('product', ['product', 'layers', 'visibleSteps', 'hasLayers', 'isPrintPricing', 'availablePrintTypes', 'preSetPrint']),
184
+ steps() {
185
+ const isScreenPrint = (this.availablePrintTypes || []).includes('screen print');
186
+ return isScreenPrint ? WIZARD_STEPS_LIST.filter(s => s !== WIZARD_STEPS.PRINT_SIZE) : WIZARD_STEPS_LIST.filter(s => s !== WIZARD_STEPS.PRINT_UNDERBASE);
187
+ },
188
+ printTypes() {
189
+ return this.product.printTypes || [];
190
+ },
191
+ productPrintAreas() {
192
+ return this.product.printAreas || [];
193
+ }
194
+ },
195
+ mounted() {
196
+ if (this.product.printOnly || this.preSetPrint || this.layers.length > 0) {
197
+ this.isVisible = true;
198
+ this.setIsPrintPricing(this.isVisible);
199
+ }
200
+
201
+ this.loadHelpMessages({
202
+ shop: this.shop._id,
203
+ group: 'wizard-steps'
204
+ });
205
+ },
206
+ methods: {
207
+ ...mapActions(['loadHelpMessages']),
208
+ ...mapMutations('product', [
209
+ 'removeTemplateLayer',
210
+ 'clearWizardData',
211
+ 'addEditablePrintArea',
212
+ 'setSelectedPrintArea',
213
+ 'setSelectedPrintType',
214
+ 'setVisibleSteps',
215
+ 'setIsPrintPricing',
216
+ 'clearTemplateLayers',
217
+ 'setPreSetPrint'
218
+ ]),
219
+ ...mapMutations('layers', ['setEditableLayers']),
220
+ goToNextStep() {
221
+ if (this.$refs.progressSteps) {
222
+ this.$refs.progressSteps.goToNextStep();
223
+ }
224
+ },
225
+ goToPrevStep() {
226
+ if (this.$refs.progressSteps) {
227
+ this.$refs.progressSteps.goToPrevStep();
228
+ }
229
+ },
230
+ editLayer(layer) {
231
+ this.clearWizardData();
232
+
233
+ this.setEditableLayers([layer]);
234
+ const printArea = this.productPrintAreas.find(pa => pa._id === layer.printArea);
235
+ this.addEditablePrintArea(printArea);
236
+ const sizes = getPrintAreaSizes(printArea);
237
+ const size = sizes.find(s => s._id === layer.printSize);
238
+ this.setSelectedPrintArea({ printArea: printArea._id, size });
239
+ const type = this.product.printTypes.find(pt => pt._id === layer.printType);
240
+ this.setSelectedPrintType({ printArea: printArea._id, type });
241
+ this.setVisibleSteps(true);
242
+ },
243
+ toggleVisible() {
244
+ if (!this.product.printOnly) {
245
+ if (this.isVisible && this.visibleSteps) {
246
+ this.setVisibleSteps(false);
247
+ this.$nextTick(() => {
248
+ this.setEditableLayers([]);
249
+ this.clearWizardData();
250
+ });
251
+ } else {
252
+ this.isVisible = !this.isVisible;
253
+ this.setIsPrintPricing(this.isVisible);
254
+ this.clearTemplateLayers();
255
+ gtm.push({
256
+ event: this.isVisible ? 'start_printing_wizard' : 'cancel_printing_wizard',
257
+ item_id: this.product.SKU,
258
+ item_name: this.product.name,
259
+ item_brand: this.product.brand.name
260
+ });
261
+ }
262
+ }
263
+ },
264
+ removePreSetPrint() {
265
+ this.setPreSetPrint(null);
266
+ this.clearTemplateLayers();
267
+ }
268
+ }
269
+ };
270
+ </script>
271
+
272
+ <style lang="scss">
273
+ @import 'wizard';
274
+ </style>
@@ -0,0 +1,94 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrint {
4
+ &__title {
5
+ font-weight: 800;
6
+ font-size: 28px;
7
+ line-height: 38px;
8
+ color: $black;
9
+ margin-bottom: 26px;
10
+ }
11
+ &__items {
12
+ display: flex;
13
+ justify-content: space-around;
14
+ flex-wrap: wrap;
15
+ margin: -10px 0 0 -10px;
16
+ width: calc(100% + 10px);
17
+ }
18
+ &__item {
19
+ width: 190px;
20
+ margin: 10px 0 0 4px;
21
+ border: 1px solid $grey_3;
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: center;
25
+ justify-content: center;
26
+ cursor: pointer;
27
+ position: relative;
28
+ @media (max-width: $bp-large-max) {
29
+ width: 175px;
30
+ }
31
+ &::after {
32
+ content: ' ';
33
+ position: absolute;
34
+ top: 10px;
35
+ right: 10px;
36
+ width: 20px;
37
+ height: 20px;
38
+ background: $gray;
39
+ border: 1px solid $grey_2;
40
+ border-radius: 10px;
41
+ }
42
+ &:hover {
43
+ border: 1px solid $green;
44
+ }
45
+ &--selected {
46
+ border: 1px solid $green;
47
+ &::after {
48
+ background-color: $green;
49
+ border: 1px solid $green;
50
+ background-image: url(/static/icons/checked.svg);
51
+ background-repeat: no-repeat;
52
+ background-position: center center;
53
+ }
54
+ }
55
+ &-name {
56
+ font-size: 16px;
57
+ line-height: 22px;
58
+ font-weight: bold;
59
+ text-transform: uppercase;
60
+ padding: 30px 15px 15px 15px;
61
+ display: flex;
62
+ flex-direction: column;
63
+ @media (max-width: $bp-large-max) {
64
+ padding: 30px 12px 15px 12px;
65
+ }
66
+ small {
67
+ font-size: 10px;
68
+ text-align: center;
69
+ }
70
+ }
71
+ &-description {
72
+ padding: 15px;
73
+ border-top: 1px solid $grey_2;
74
+ &--selected {
75
+ border-top: 1px solid $green;
76
+ }
77
+ ul {
78
+ list-style: circle;
79
+ margin-left: 13px;
80
+ li {
81
+ margin-bottom: 8px;
82
+ }
83
+ }
84
+ }
85
+ &-info {
86
+ position: absolute;
87
+ left: 10px;
88
+ top: 10px;
89
+ .Info__content {
90
+ font-size: 17px;
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,130 @@
1
+ <template>
2
+ <div class="WizardPrint__wrapper">
3
+ <div class="WizardPrint__items">
4
+ <div
5
+ v-for="(orderPrintType, index) in avilableOrderPrintTypes"
6
+ :key="index"
7
+ class="WizardPrint__item"
8
+ :class="{
9
+ 'WizardPrint__item--selected': isSelectedPrintTypes(orderPrintType.types)
10
+ }"
11
+ @click="setAvailablePrintTypes(orderPrintType.types)">
12
+ <info
13
+ v-if="orderPrintType.info"
14
+ :has-popover="true"
15
+ icon-color="black"
16
+ class="WizardPrint__item-info">
17
+ <template slot="info">
18
+ {{ orderPrintType.info }}
19
+ </template>
20
+ </info>
21
+ <div
22
+ class="WizardPrint__item-name lc_subtitle1">
23
+ <div
24
+ v-if="orderPrintType.icon"
25
+ :class="`WizardPrint__item-icon Wizard__item-icon--${orderPrintType.icon}`"></div>
26
+ <span>{{ orderPrintType.name }}</span>
27
+ <small>{{ orderPrintType.subName }}</small>
28
+ </div>
29
+ <div
30
+ class="WizardPrint__item-description"
31
+ :class="{
32
+ 'WizardPrint__item-description--selected': isSelectedPrintTypes(orderPrintType.types)
33
+ }">
34
+ <ul class="lc_regular12">
35
+ <li
36
+ v-for="(description, dIndex) in orderPrintType.description"
37
+ :key="`${index}-${dIndex}`">
38
+ {{ description }}
39
+ </li>
40
+ </ul>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class="ProgressSteps__controls">
45
+ <btn
46
+ :btn-block="true"
47
+ :btn-disabled="!availablePrintTypes"
48
+ btn-class="green"
49
+ btn-label="NEXT"
50
+ @onclick="$emit('next')">
51
+ <i
52
+ slot="icon-after"
53
+ class="icon-arrow-right"></i>
54
+ </btn>
55
+ </div>
56
+ </div>
57
+ </template>
58
+
59
+ <script>
60
+ import { mapGetters, mapMutations } from 'vuex';
61
+ import Info from '@lancom/shared/components/common/info-popover';
62
+
63
+ export default {
64
+ name: 'WizardPrint',
65
+ components: {
66
+ Info
67
+ },
68
+ data() {
69
+ return {
70
+ orderPrintTypes: [{
71
+ types: ['black print', 'full colour print'],
72
+ icon: 'printed',
73
+ name: 'DIGITAL',
74
+ subName: 'Minimum 12',
75
+ description: [
76
+ 'Free Setup on all orders',
77
+ 'Standard turn around time of 5 days',
78
+ 'Same or next day rush service available'
79
+ ]
80
+ // info: 'DIGITAL - minimum 12'
81
+ }, {
82
+ types: ['embroidery'],
83
+ name: 'Embroidery',
84
+ subName: 'Minimum 20',
85
+ description: [
86
+ 'Free setup on orders over 50 items',
87
+ 'Best for polo or high vis shirts',
88
+ 'Standard turn around time of 8-10 days'
89
+ ],
90
+ info: 'Embroidery'
91
+ }, {
92
+ types: ['screen print'],
93
+ name: 'Screen Printing',
94
+ subName: 'Minimum 25',
95
+ description: [
96
+ 'Setup cost of $50 per colour',
97
+ 'Most economical for large orders(over 250)',
98
+ 'Free repeat setups for 1 year on same design'
99
+ ]
100
+ }]
101
+ };
102
+ },
103
+ computed: {
104
+ ...mapGetters('product', ['product', 'availablePrintTypes', 'hasUnprintedPrice']),
105
+ avilableOrderPrintTypes() {
106
+ return this.orderPrintTypes.filter(orderPrintType => {
107
+ return (!orderPrintType.types && this.hasUnprintedPrice) || (orderPrintType.types || []).find(type => this.product.printTypes.find(printType => printType.type === type));
108
+ });
109
+ }
110
+ },
111
+ mounted() {
112
+ const [defaultPrintTypes] = this.avilableOrderPrintTypes;
113
+ if (defaultPrintTypes) {
114
+ this.setAvailablePrintTypes(defaultPrintTypes.types);
115
+ }
116
+ },
117
+ methods: {
118
+ ...mapMutations('product', [
119
+ 'setAvailablePrintTypes'
120
+ ]),
121
+ isSelectedPrintTypes(types) {
122
+ return (!types && !this.availablePrintTypes) || (types || []).find(type => (this.availablePrintTypes || []).includes(type));
123
+ }
124
+ }
125
+ };
126
+ </script>
127
+
128
+ <style lang="scss">
129
+ @import 'wizard-print';
130
+ </style>
@@ -0,0 +1,101 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrintArea {
4
+ &__title {
5
+ font-weight: 800;
6
+ font-size: 28px;
7
+ line-height: 38px;
8
+ color: $black;
9
+ margin-bottom: 26px;
10
+ }
11
+ &__areas {
12
+ display: flex;
13
+ justify-content: space-around;
14
+ flex-wrap: wrap;
15
+ margin: -10px 0 0 -10px;
16
+ width: calc(100% + 10px);
17
+ }
18
+ &__area {
19
+ width: 140px;
20
+ height: 122px;
21
+ margin: 10px 0 0 10px;
22
+ border: 1px solid $grey_3;
23
+ display: flex;
24
+ flex-direction: column;
25
+ align-items: center;
26
+ justify-content: center;
27
+ cursor: pointer;
28
+ position: relative;
29
+ &::after {
30
+ content: ' ';
31
+ position: absolute;
32
+ top: 10px;
33
+ right: 10px;
34
+ width: 20px;
35
+ height: 20px;
36
+ background: $gray;
37
+ border: 1px solid $grey_2;
38
+ border-radius: 10px;
39
+ }
40
+ &:hover {
41
+ border: 1px solid $green;
42
+ }
43
+ &--selected {
44
+ border: 1px solid $green;
45
+ &::after {
46
+ background-color: $green;
47
+ border: 1px solid $green;
48
+ background-image: url(~/static/icons/checked.svg);
49
+ background-repeat: no-repeat;
50
+ background-position: center center;
51
+ }
52
+ }
53
+ &--disabled {
54
+ pointer-events: none !important;
55
+ opacity: 0.4;
56
+ }
57
+
58
+ &-icon {
59
+ width: 60px;
60
+ height: 55px;
61
+ background-repeat: no-repeat;
62
+ background-size: contain;
63
+ background-position: center;
64
+
65
+ @each $type in tee {
66
+ @each $side in front, back, sleeve-left, sleeve-right {
67
+ &.#{$side}.#{$type} {
68
+ background-image: url(~/static/icons/#{$side}_#{$type}.svg);
69
+ }
70
+ }
71
+ }
72
+
73
+ // TEE - FRONT
74
+ @each $position in center, left, right {
75
+ &.front.tee.#{$position} {
76
+ background-image: url(~/static/icons/front_tee_#{$position}.svg);
77
+ }
78
+ }
79
+ // TEE - BACK
80
+ @each $position in center, top, bottom {
81
+ &.back.tee.#{$position} {
82
+ background-image: url(~/static/icons/back_tee_#{$position}.svg);
83
+ }
84
+ }
85
+ // TEE - SLEEVE LEFT
86
+ &.sleeve-left.tee.left {
87
+ background-image: url(~/static/icons/sleeve-left_tee_left.svg);
88
+ }
89
+ &.sleeve-right.tee.right {
90
+ background-image: url(~/static/icons/sleeve-right_tee_right.svg);
91
+ }
92
+ }
93
+ &-name {
94
+ font-size: 16px;
95
+ line-height: 22px;
96
+ margin-top: 10px;
97
+ font-weight: bold;
98
+ text-transform: uppercase;
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div class="WizardPrintArea__wrapper">
3
+ <div class="WizardPrintArea__areas">
4
+ <div
5
+ v-for="(area, index) in productPrintAreas"
6
+ :key="index"
7
+ class="WizardPrintArea__area"
8
+ :class="{
9
+ 'WizardPrintArea__area--selected': isSelectedPrintArea(area),
10
+ 'WizardPrintArea__area--disabled': isDisabledPrintArea(area)
11
+ }"
12
+ @click="toggleEditablePrintArea(area)">
13
+ <div
14
+ class="WizardPrintArea__area-icon"
15
+ :class="{
16
+ [area.alias]: true,
17
+ [area.side]: true,
18
+ [productType]: true
19
+ }">
20
+ </div>
21
+ <div class="WizardPrintArea__area-name">
22
+ {{ area.name }}
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <div class="ProgressSteps__controls">
27
+ <btn
28
+ btn-class="white"
29
+ btn-label="BACK"
30
+ @onclick="$emit('prev')">
31
+ </btn>
32
+ <btn
33
+ btn-class="green"
34
+ btn-label="NEXT"
35
+ @onclick="$emit('next')">
36
+ <i
37
+ slot="icon-after"
38
+ class="icon-arrow-right"></i>
39
+ </btn>
40
+ </div>
41
+ </div>
42
+ </template>
43
+
44
+ <script>
45
+ import { mapGetters, mapMutations } from 'vuex';
46
+
47
+ export default {
48
+ name: 'WizardPrintArea',
49
+ data() {
50
+ return {
51
+ printAreas: []
52
+ };
53
+ },
54
+ computed: {
55
+ ...mapGetters('layers', ['editableLayer']),
56
+ ...mapGetters('product', ['product', 'editablePrintAreas', 'selectedPrintAreas', 'layers']),
57
+ productType() {
58
+ return 'tee' || this.product.productType.alias;
59
+ },
60
+ productPrintAreas() {
61
+ return this.product.printAreas || [];
62
+ }
63
+ },
64
+ mounted() {
65
+ if (!this.editablePrintAreas.length) {
66
+ const first = this.productPrintAreas.find(pa => !this.isDisabledPrintArea(pa));
67
+ if (first) {
68
+ this.addEditablePrintArea(first);
69
+ }
70
+ }
71
+ },
72
+ methods: {
73
+ ...mapMutations('product', ['addEditablePrintArea', 'toggleEditablePrintArea']),
74
+ isSelectedPrintArea(printArea) {
75
+ return this.editablePrintAreas.some(pa => pa._id === printArea._id);
76
+ },
77
+ isDisabledPrintArea(printArea) {
78
+ return !this.isSelectedPrintArea(printArea) && this.editableLayer?.printArea !== printArea._id && this.layers.find(layer => layer.printArea === printArea._id);
79
+ }
80
+ }
81
+ };
82
+ </script>
83
+
84
+ <style lang="scss">
85
+ @import 'wizard-print-area';
86
+ </style>