@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,60 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrintLayers {
4
+ &__wrapper {
5
+ position: relative;
6
+ }
7
+ &__title {
8
+ font-weight: 800;
9
+ font-size: 28px;
10
+ line-height: 38px;
11
+ color: $black;
12
+ margin-bottom: 26px;
13
+ }
14
+ &__table {
15
+ text-align: center;
16
+ @media (max-width: $bp-extra-small-max) {
17
+ width: 100%;
18
+ }
19
+ thead {
20
+ @media (max-width: $bp-extra-small-max) {
21
+ display: none;
22
+ }
23
+ }
24
+ tr {
25
+ @media (max-width: $bp-extra-small-max) {
26
+ border-top: 1px solid $gray;
27
+ padding-top: 20px;
28
+ display: flex;
29
+ flex-direction: column;
30
+ }
31
+ }
32
+ td,
33
+ th {
34
+ padding: 3px 6px;
35
+ }
36
+ th {
37
+ font-weight: 600;
38
+ font-size: 14px;
39
+ line-height: 22px;
40
+ color: $black;
41
+ }
42
+ td {
43
+ font-weight: bold;
44
+ font-size: 17px;
45
+ line-height: 27px;
46
+ color: $black;
47
+ }
48
+ }
49
+ &__modify {
50
+ position: absolute;
51
+ top: 0;
52
+ right: 0;
53
+ display: flex;
54
+ align-items: center;
55
+ &-delete {
56
+ cursor: pointer;
57
+ margin-left: 10px;
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,67 @@
1
+ <template>
2
+ <div class="WizardPrintLayers__wrapper">
3
+ <table class="WizardPrintLayers__table">
4
+ <thead>
5
+ <tr>
6
+ <th>
7
+ Printable area
8
+ </th>
9
+ <th>
10
+ Print size
11
+ </th>
12
+ <th>
13
+ Print type
14
+ </th>
15
+ <th>
16
+ Print option
17
+ </th>
18
+ <th>
19
+ Price
20
+ </th>
21
+ <th></th>
22
+ </tr>
23
+ </thead>
24
+ <wizard-print-layer
25
+ v-for="(layer, index) in layers"
26
+ :key="index"
27
+ :layer="layer"
28
+ :editable="editable"
29
+ @edit="$emit('edit', layer)"
30
+ @delete="$emit('delete', layer)">
31
+ </wizard-print-layer>
32
+ <slot name="see-pricing"></slot>
33
+ </table>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import WizardPrintLayer from './wizard_print_layer/wizard-print-layer';
39
+
40
+ export default {
41
+ name: 'WizardPrintLayers',
42
+ components: {
43
+ WizardPrintLayer
44
+ },
45
+ props: {
46
+ layers: {
47
+ type: Array,
48
+ required: true
49
+ },
50
+ editable: {
51
+ type: Boolean
52
+ }
53
+ },
54
+ computed: {
55
+ hasSingleLayer() {
56
+ return this.layers.length === 1;
57
+ },
58
+ isMultipleLayers() {
59
+ return this.layers.length > 1;
60
+ }
61
+ }
62
+ };
63
+ </script>
64
+
65
+ <style lang="scss">
66
+ @import 'wizard-print-layers';
67
+ </style>
@@ -0,0 +1,47 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrintLayer {
4
+ &__wrapper {
5
+ a {
6
+ text-decoration: none;
7
+ color: $black;
8
+ }
9
+ }
10
+ &__info {
11
+ width: 300px;
12
+ &-type {
13
+ text-transform: uppercase;
14
+ }
15
+ &-text {
16
+ &-item {
17
+ margin-bottom: 10px;
18
+ text-align: left;
19
+ }
20
+ &-title {
21
+ font-size: 12px;
22
+ color: $grey_1;
23
+ margin-bottom: 5px;
24
+ }
25
+ &-content {
26
+ font-size: 14px;
27
+ color: $black;
28
+ white-space: pre;
29
+ }
30
+ }
31
+ &-art {
32
+ img {
33
+ width: 100%;
34
+ margin: 10px 0;
35
+ }
36
+ a {
37
+ text-decoration: none;
38
+ color: $black;
39
+ }
40
+ }
41
+ }
42
+ &__layer-form {
43
+ margin: 20px 0;
44
+ // padding-bottom: 20px;
45
+ // border-bottom: 1px solid $gray;
46
+ }
47
+ }
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <div style="display: contents">
3
+ <tr class="WizardPrintLayer__wrapper">
4
+ <td>
5
+ <div class="lc_regular14 hidden-sm-and-up">
6
+ Printable area
7
+ </div>
8
+ {{ layerPrintArea.name }}
9
+ </td>
10
+ <td>
11
+ <div class="lc_regular14 hidden-sm-and-up">
12
+ Print size
13
+ </div>
14
+ {{ layerPrintSize ? layerPrintSize.name : '-' }}
15
+ </td>
16
+ <td>
17
+ <div class="lc_regular14 hidden-sm-and-up">
18
+ Print type
19
+ </div>
20
+ {{ layerPrintType.name }}
21
+ </td>
22
+ <td>
23
+ <div class="lc_regular14 hidden-sm-and-up">
24
+ Print option
25
+ </div>
26
+ <v-popover
27
+ ref="popover"
28
+ trigger="hover"
29
+ :delay="{ show: 200, hide: 400 }"
30
+ popover-class="tooltip popover white">
31
+ <span
32
+ v-if="type === 'art'"
33
+ class="WizardPrintLayer__info-type">
34
+ <a
35
+ v-if="layer.file"
36
+ :href="layer.file.origin"
37
+ target="_blank">
38
+ Logo
39
+ </a>
40
+ <span v-else>
41
+ Logo
42
+ </span>
43
+ </span>
44
+ <span
45
+ v-else
46
+ class="WizardPrintLayer__info-type">
47
+ Text
48
+ </span>
49
+ <template slot="popover">
50
+ <div class="WizardPrintLayer__info">
51
+ <div
52
+ v-if="layer.type === 'text'"
53
+ class="WizardPrintLayer__info-text">
54
+ <div class="WizardPrintLayer__info-text-item">
55
+ <div class="WizardPrintLayer__info-text-title">
56
+ Text
57
+ </div>
58
+ <div class="WizardPrintLayer__info-text-content">
59
+ <span>{{ layer.copy }}</span>
60
+ </div>
61
+ </div>
62
+ <div
63
+ v-if="layer.notes"
64
+ class="WizardPrintLayer__info-text-item">
65
+ <div class="WizardPrintLayer__info-text-title">
66
+ Notes
67
+ </div>
68
+ <div class="WizardPrintLayer__info-text-content">
69
+ <span>{{ layer.notes }}</span>
70
+ </div>
71
+ </div>
72
+ </div>
73
+ <div
74
+ v-else-if="layer.type === 'art'">
75
+ <div class="WizardPrintLayer__info-art">
76
+ <a
77
+ :href="layer.file.origin"
78
+ target="_blank">
79
+ <img
80
+ v-if="layer.url"
81
+ :src="layer.url" />
82
+ <span v-else>
83
+ <i class="icon-blank"></i> Download logo
84
+ </span>
85
+ </a>
86
+ </div>
87
+ <div
88
+ v-if="layer.notes"
89
+ class="WizardPrintLayer__info-text">
90
+ <div class="WizardPrintLayer__info-text-item">
91
+ <div class="WizardPrintLayer__info-text-title">
92
+ Notes
93
+ </div>
94
+ <div class="WizardPrintLayer__info-text-content">
95
+ <span>{{ layer.notes }}</span>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ </template>
102
+ </v-popover>
103
+ </td>
104
+ <td>
105
+ <div class="lc_regular14 hidden-sm-and-up">
106
+ Price
107
+ </div>
108
+ <div>
109
+ {{ layerPrintPricing | pricingRange }}
110
+ </div>
111
+ <v-popover
112
+ ref="popover"
113
+ trigger="hover"
114
+ :delay="{ show: 200, hide: 400 }"
115
+ popover-class="tooltip popover white"
116
+ class="WizardPrintLayer__layer-price">
117
+ <slot name="see-pricing">
118
+ <span class="lc_regular12 lc_gray-main">
119
+ see prices
120
+ </span>
121
+ </slot>
122
+ <template slot="popover">
123
+ <pricing-discounts-table :prices="layerPrintPricing" />
124
+ </template>
125
+ </v-popover>
126
+ </td>
127
+ <td v-if="editable && !layer.required">
128
+ <span
129
+ class="WizardPrintLayer__control"
130
+ @click="$emit('edit')">
131
+ <i class="icon-edit"></i>
132
+ </span>
133
+ <span
134
+ class="WizardPrintLayer__control"
135
+ @click="$emit('delete')">
136
+ <i class="icon-delete"></i>
137
+ </span>
138
+ </td>
139
+ </tr>
140
+ <tr v-if="layer.required">
141
+ <td colspan="6">
142
+ <div class="WizardPrintLayer__layer-form">
143
+ <wizard-text-or-logo-form :layer="layer" />
144
+ </div>
145
+ </td>
146
+ </tr>
147
+ </div>
148
+ </template>
149
+
150
+ <script>
151
+ import { mapGetters } from 'vuex';
152
+ import { pricingRange } from '@lancom/shared/assets/js/utils/filters';
153
+ import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
154
+ import WizardTextOrLogoForm from './../../wizard_print_text_or_logo/wizard_text_or_logo_form/wizard-text-or-logo-form';
155
+
156
+ export default {
157
+ name: 'WizardPrintLayer',
158
+ components: {
159
+ PricingDiscountsTable,
160
+ WizardTextOrLogoForm
161
+ },
162
+ filters: {
163
+ pricingRange
164
+ },
165
+ props: {
166
+ layer: {
167
+ type: Object,
168
+ required: true
169
+ },
170
+ editable: {
171
+ type: Boolean
172
+ }
173
+ },
174
+ computed: {
175
+ ...mapGetters('product', ['product']),
176
+ type() {
177
+ return this.layer.type;
178
+ },
179
+ productPrintAreas() {
180
+ return this.product.printAreas || [];
181
+ },
182
+ layerPrintArea() {
183
+ return this.productPrintAreas.find(({ _id }) => _id === this.layer.printArea);
184
+ },
185
+ layerPrintSizes() {
186
+ const { printSize, sizes = [] } = this.layerPrintArea;
187
+ return [
188
+ printSize,
189
+ ...sizes
190
+ .map(({ printSize }) => printSize)
191
+ .filter(({ _id }) => _id !== printSize._id)
192
+ ];
193
+ },
194
+ layerPrintType() {
195
+ return this.product.printTypes.find(({ _id }) => _id === this.layer.printType);
196
+ },
197
+ layerPrintSize() {
198
+ return this.layerPrintSizes.find(({ _id }) => _id === this.layer.printSize);
199
+ },
200
+ layerPrintPricing() {
201
+ const printArea = this.layerPrintType.printAreas.find(({ printSizes }) => printSizes.map(({ _id }) => _id).includes(this.layer.printSize)) || this.layerPrintType.printAreas[0];
202
+ return printArea.printCost;
203
+ }
204
+ }
205
+ };
206
+ </script>
207
+
208
+ <style lang="scss">
209
+ @import 'wizard-print-layer';
210
+ </style>
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <div class="WizardPrintReview__wrapper">
3
+ <wizard-print-layers :layers="layers">
4
+ <template #see-pricing>
5
+ <span
6
+ style="position: absolute; left: 0; line-height: 16px; right: 0; font-style: italic; margin-top: -5px;"
7
+ class="lc_regular12 lc_gray-main lc_bold">
8
+ The final price is based on quantity of products printed, and will be calculated once product quantities are added below
9
+ </span>
10
+ </template>
11
+ </wizard-print-layers>
12
+ <div class="ProgressSteps__controls">
13
+ <btn
14
+ btn-class="white"
15
+ btn-label="BACK"
16
+ @onclick="$emit('prev')">
17
+ </btn>
18
+ <btn
19
+ btn-class="green"
20
+ btn-label="Add to order"
21
+ @onclick="goNext">
22
+ <i
23
+ slot="icon-after"
24
+ class="icon-arrow-right"></i>
25
+ </btn>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script>
31
+ import { mapGetters, mapMutations } from 'vuex';
32
+ import gtm from '@lancom/shared/assets/js/utils/gtm';
33
+ import WizardPrintLayers from './../wizard_print_layers/wizard-print-layers';
34
+
35
+ export default {
36
+ name: 'WizardPrintReview',
37
+ components: {
38
+ WizardPrintLayers
39
+ },
40
+ computed: {
41
+ ...mapGetters('layers', ['editableLayers']),
42
+ layers() {
43
+ return this.editableLayers;
44
+ }
45
+ },
46
+ methods: {
47
+ ...mapMutations('product', ['addTemplateLayer', 'clearWizardData']),
48
+ ...mapMutations('layers', ['setEditableLayers']),
49
+ goNext() {
50
+ this.editableLayers.forEach(editableLayer => {
51
+ gtm.push({
52
+ event: 'complete_printing_wizard',
53
+ type: editableLayer.type,
54
+ text: editableLayer.copy,
55
+ file: editableLayer.file,
56
+ notes: editableLayer.notes
57
+ });
58
+ this.addTemplateLayer(editableLayer);
59
+ });
60
+ this.clearWizardData();
61
+ this.setEditableLayers([]);
62
+
63
+ this.$emit('next');
64
+ }
65
+ }
66
+ };
67
+ </script>
68
+
69
+ <style lang="scss">
70
+ @import 'wizard-print-review';
71
+ </style>
@@ -0,0 +1,68 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrintSize {
4
+ &__title {
5
+ font-weight: 800;
6
+ font-size: 28px;
7
+ line-height: 38px;
8
+ color: $black;
9
+ margin-bottom: 26px;
10
+ }
11
+ &__area {
12
+ margin-bottom: 20px;
13
+ }
14
+ &__sizes {
15
+ display: flex;
16
+ justify-content: space-around;
17
+ flex-wrap: wrap;
18
+ margin: -10px 0 0 -10px;
19
+ width: calc(100% + 10px);
20
+ }
21
+ &__size {
22
+ width: 140px;
23
+ height: 122px;
24
+ margin: 10px 0 0 10px;
25
+ border: 1px solid $grey_3;
26
+ display: flex;
27
+ flex-direction: column;
28
+ align-items: center;
29
+ justify-content: center;
30
+ cursor: pointer;
31
+ position: relative;
32
+ &::after {
33
+ content: ' ';
34
+ position: absolute;
35
+ top: 10px;
36
+ right: 10px;
37
+ width: 20px;
38
+ height: 20px;
39
+ background: $gray;
40
+ border: 1px solid $grey_2;
41
+ border-radius: 10px;
42
+ }
43
+ &:hover {
44
+ border: 1px solid $green;
45
+ }
46
+ &--selected {
47
+ border: 1px solid $green;
48
+ &::after {
49
+ background-color: $green;
50
+ border: 1px solid $green;
51
+ background-image: url(/static/icons/checked.svg);
52
+ background-repeat: no-repeat;
53
+ background-position: center center;
54
+ }
55
+ }
56
+ &-name {
57
+ font-size: 16px;
58
+ line-height: 22px;
59
+ margin-top: 10px;
60
+ font-weight: bold;
61
+ }
62
+ }
63
+ &__see-price {
64
+ margin-top: 5px;
65
+ font-size: 12px;
66
+ color: $gray_main;
67
+ }
68
+ }
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div class="WizardPrintSize__wrapper">
3
+ <div class="WizardPrintSize__areas">
4
+ <div
5
+ v-for="(editablePrintArea, index) in editablePrintAreas"
6
+ :key="index"
7
+ class="WizardPrintSize__area">
8
+ <div class="WizardPrintSize__title">
9
+ {{ editablePrintArea.name }}
10
+ </div>
11
+ <wizard-print-area-print-size :editable-print-area="editablePrintArea" />
12
+ </div>
13
+ </div>
14
+ <div class="ProgressSteps__controls">
15
+ <btn
16
+ btn-class="white"
17
+ btn-label="BACK"
18
+ @onclick="$emit('prev')">
19
+ </btn>
20
+ <btn
21
+ btn-class="green"
22
+ btn-label="NEXT"
23
+ @onclick="$emit('next')">
24
+ <i
25
+ slot="icon-after"
26
+ class="icon-arrow-right"></i>
27
+ </btn>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+ import { mapGetters } from 'vuex';
34
+ import WizardPrintAreaPrintSize from './wizard_print_area_print_size/wizard-print-area-print-size';
35
+
36
+ export default {
37
+ name: 'WizardPrintSize',
38
+ components: {
39
+ WizardPrintAreaPrintSize
40
+ },
41
+ computed: {
42
+ ...mapGetters('product', ['editablePrintAreas'])
43
+ }
44
+ };
45
+ </script>
46
+
47
+ <style lang="scss">
48
+ @import 'wizard-print-size';
49
+ </style>
@@ -0,0 +1,65 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .WizardPrintAreaPrintSize {
4
+ &__title {
5
+ font-weight: 800;
6
+ font-size: 28px;
7
+ line-height: 38px;
8
+ color: $black;
9
+ margin-bottom: 26px;
10
+ }
11
+ &__sizes {
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
+ &__size {
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
+ &-name {
54
+ font-size: 16px;
55
+ line-height: 22px;
56
+ margin-top: 10px;
57
+ font-weight: bold;
58
+ }
59
+ }
60
+ &__see-price {
61
+ margin-top: 5px;
62
+ font-size: 12px;
63
+ color: $gray_main;
64
+ }
65
+ }