@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
@@ -167,6 +167,9 @@ export default {
167
167
  createOrderRefund(order, refund, shop) {
168
168
  return _post(`shop/${shop}/order/${order}/refund`, refund);
169
169
  },
170
+ createOrderReturn(order, refund, shop) {
171
+ return _post(`shop/${shop}/order/${order}/return`, refund);
172
+ },
170
173
  sendOrderRefundRequest(order, refund, shop) {
171
174
  return _post(`shop/${shop}/order/${order}/refund/${refund}/send`);
172
175
  },
@@ -73,7 +73,7 @@ export function populateProductsFields(products, pricing) {
73
73
  });
74
74
  };
75
75
 
76
- function populatePrints(products) {
76
+ export function populatePrints(products) {
77
77
  return products.reduce((prints, { guid, product }) => {
78
78
  return [
79
79
  ...prints,
@@ -1,3 +1,5 @@
1
+ import { populatePrints } from './order';
2
+
1
3
  export function convertQuoteToOrder(quote, option) {
2
4
  const files = [quote.file, ...(quote.files || [])].filter(f => !!f);
3
5
  return {
@@ -13,7 +15,10 @@ export function convertQuoteToOrder(quote, option) {
13
15
  ...p,
14
16
  prints: p.prints.filter(print => !(option.prints || []).some(({ _id }) => print._id === _id))
15
17
  })),
16
- prints: option.prints,
18
+ prints: [
19
+ ...(option.prints || []),
20
+ ...populatePrints(option.products)
21
+ ],
17
22
  total: option.total,
18
23
  totalGST: option.totalGST,
19
24
  productsTotal: option.productsTotal,
@@ -2,7 +2,9 @@
2
2
 
3
3
  .ProgressSteps {
4
4
  &__wrapper {
5
- border: 2px solid $gray;
5
+ &--border {
6
+ border: 2px solid $gray;
7
+ }
6
8
  }
7
9
  &__steps-wrapper {
8
10
  position: relative;
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <div class="ProgressSteps__wrapper">
2
+ <div
3
+ class="ProgressSteps__wrapper"
4
+ :class="{
5
+ 'ProgressSteps__wrapper--border': hasBorder
6
+ }">
3
7
  <div class="ProgressSteps__steps-wrapper">
4
8
  <div
5
9
  class="ProgressSteps__progress"
@@ -89,6 +93,10 @@ export default {
89
93
  type: Boolean,
90
94
  default: true
91
95
  },
96
+ hasBorder: {
97
+ type: Boolean,
98
+ default: true
99
+ },
92
100
  visibleStepName: {
93
101
  type: Boolean,
94
102
  default: false
@@ -13,7 +13,7 @@
13
13
  @select="selectTab">
14
14
  <template v-slot:default="{ currentTab }">
15
15
  <component
16
- :is="`editor-${currentTab === 'product' ? 'product-details' : 'layers'}`"
16
+ :is="editorCurrentTabComponent(currentTab)"
17
17
  v-if="currentTab">
18
18
  </component>
19
19
  </template>
@@ -83,6 +83,7 @@ import EditorWorkspace from './editor_workspace/editor-workspace';
83
83
  import EditorProductDetails from './editor_product_details/editor-product-details';
84
84
  import MobileEditorProductDetails from './mobile_editor_product_details/mobile-editor-product-details';
85
85
  import EditorLayers from './editor_layers/editor-layers';
86
+ import EditorWizard from './editor_wizard/editor-wizard';
86
87
 
87
88
  const MIN_SCREEN_AMOUNT = 125;
88
89
 
@@ -92,6 +93,7 @@ export default {
92
93
  EditorWorkspace,
93
94
  EditorProductDetails,
94
95
  EditorLayers,
96
+ EditorWizard,
95
97
  MobileEditorProductDetails,
96
98
  ProductsListDropdown,
97
99
  Tabs
@@ -112,6 +114,11 @@ export default {
112
114
  icon: 'icon-edit',
113
115
  value: 'design',
114
116
  description: 'Add text and upload images'
117
+ }, {
118
+ label: 'Easy Design Wizard',
119
+ icon: 'icon-edit',
120
+ value: 'wizard',
121
+ description: 'Create Custom Designs'
115
122
  }],
116
123
  offerScreenPrintingAmount: 0
117
124
  };
@@ -168,6 +175,16 @@ export default {
168
175
  'setSelectedTab'
169
176
  ]),
170
177
  ...mapMutations('layers', ['resetLayers']),
178
+ editorCurrentTabComponent(currentTab) {
179
+ switch(currentTab) {
180
+ case 'product':
181
+ return 'editor-product-details';
182
+ case 'wizard':
183
+ return 'editor-wizard';
184
+ default:
185
+ return 'editor-layers';
186
+ }
187
+ },
171
188
  selectTab(tab) {
172
189
  this.setSelectedTab(tab);
173
190
  this.setEditModeSelectedLayer(false);
@@ -0,0 +1,22 @@
1
+ @import "@/assets/scss/variables";
2
+
3
+ .EditorWizard {
4
+ &__wrapper {
5
+ padding: 20px 0;
6
+ }
7
+ &__list-header {
8
+ padding: 12px 0;
9
+ margin-top: 24px;
10
+ border-top: 1px solid #E5E5E5;
11
+ }
12
+ &__close-editable {
13
+ color: $grey_1;
14
+ cursor: pointer;
15
+ &-icon {
16
+ color: $grey_5;
17
+ }
18
+ }
19
+ &__pricing {
20
+ margin-top: 30px;
21
+ }
22
+ }
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div class="EditorWizard__wrapper">
3
+ <wizard
4
+ :hidden-done-step-number="false"
5
+ :has-border="false" />
6
+ <div
7
+ v-if="hasLayers && isPrintPricing"
8
+ class="EditorWizard__add-btn">
9
+ <btn
10
+ btn-class="green"
11
+ btn-label="Add Another Print"
12
+ @onclick="addAnotherPrint()">
13
+ <i
14
+ slot="icon-before"
15
+ class="icon-plus"></i>
16
+ </btn>
17
+ </div>
18
+ <editor-pricing
19
+ v-if="hasPricing"
20
+ class="EditorWizard__pricing" />
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ import { mapGetters, mapMutations } from 'vuex';
26
+ import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
27
+ import Wizard from '@lancom/shared/components/product/wizard/wizard';
28
+
29
+ export default {
30
+ name: 'EditorWizard',
31
+ components: {
32
+ EditorPricing,
33
+ Wizard
34
+ },
35
+ props: {
36
+ hasPricing: {
37
+ type: Boolean,
38
+ default: true
39
+ }
40
+ },
41
+ computed: {
42
+ ...mapGetters('product', ['hasLayers', 'isPrintPricing'])
43
+ },
44
+ methods: {
45
+ ...mapMutations('product', [
46
+ 'setVisibleSteps',
47
+ 'clearWizardData'
48
+ ]),
49
+ ...mapMutations('layers', [
50
+ 'setEditableLayers'
51
+ ]),
52
+ addAnotherPrint() {
53
+ this.setVisibleSteps(false);
54
+ this.$nextTick(() => {
55
+ this.setEditableLayers();
56
+ this.clearWizardData();
57
+ this.setVisibleSteps(true);
58
+ });
59
+ },
60
+ }
61
+ };
62
+ </script>
63
+
64
+ <style lang="scss" scoped>
65
+ @import 'editor-wizard.scss';
66
+ </style>
@@ -151,7 +151,7 @@ export default {
151
151
  );
152
152
  },
153
153
  printAreaIsSmall() {
154
- return this.printAreaSize.alias === 'rect10';
154
+ return this.printAreaSize?.alias === 'rect10';
155
155
  },
156
156
  backgroundColor() {
157
157
  return this.backgroundImageLoaded && this.editableColor?.rgb;
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  <product-list
9
9
  :products="products"
10
- :lazy="true" />
10
+ :lazy="false" />
11
11
  </div>
12
12
  </template>
13
13
 
@@ -0,0 +1,222 @@
1
+ @import '@/assets/scss/variables';
2
+
3
+ .Wizard {
4
+ &__header {
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: space-between;
8
+ padding: 22px;
9
+ background-color: $wizard_primary;
10
+ font-weight: 800;
11
+ font-size: 16px;
12
+ line-height: 22px;
13
+ text-transform: uppercase;
14
+ color: $wizard_primary_text;
15
+ cursor: pointer;
16
+ @media (max-width: $bp-extra-small-max) {
17
+ padding: 14px;
18
+ font-size: 13px;
19
+ flex-direction: column;
20
+ align-items: baseline;
21
+ }
22
+ &:hover,
23
+ &--active {
24
+ background-color: $green;
25
+ background-color: $wizard_primary_active;
26
+ }
27
+ &-state {
28
+ text-decoration: underline;
29
+ }
30
+ }
31
+ &__print-types {
32
+ display: flex;
33
+ margin: 31px 0 36px -5px;
34
+ width: calc(100% + 5px);
35
+ }
36
+ &__print-type {
37
+ margin: 5px 0 0 5px;
38
+ cursor: pointer;
39
+ &-name {
40
+ display: flex;
41
+ text-transform: uppercase;
42
+ align-items: center;
43
+ justify-content: center;
44
+ height: 60px;
45
+ background-color: $gray;
46
+ color: $black;
47
+ &--selected {
48
+ background-color: $green;
49
+ }
50
+ }
51
+ &-description {
52
+ padding: 12px 16px;
53
+ border: 1px solid $gray;
54
+ color: $gray_main;
55
+ &--selected {
56
+ border: 1px solid $green;
57
+ color: $black;
58
+ }
59
+ ul {
60
+ list-style: circle;
61
+ margin-left: 13px;
62
+ li {
63
+ margin-bottom: 8px;
64
+ }
65
+ }
66
+ }
67
+ &-icon {
68
+ width: 22px;
69
+ height: 22px;
70
+ background-position: center;
71
+ background-size: cover;
72
+ margin-right: 10px;
73
+ &--blank {
74
+ background-image: url(~/static/images/blank_tee.svg);
75
+ }
76
+ &--printed {
77
+ background-image: url(~/static/images/printed_tee.svg);
78
+ }
79
+ }
80
+ }
81
+ &__add-btn {
82
+ margin-top: 15px;
83
+ width: 100%;
84
+ display: flex;
85
+ .Btn__wrapper {
86
+ flex-grow: 1;
87
+ }
88
+ }
89
+ &__layers {
90
+ border: 2px solid $gray;
91
+ background-color: #FCFCFC;
92
+ padding: 30px;
93
+ margin-bottom: 20px;
94
+ &-info {
95
+ margin-top: 20px;
96
+ padding-top: 20px;
97
+ border-top: 2px solid $gray;
98
+ font-size: 14px;
99
+ line-height: 19px;
100
+ color: $gray_main;
101
+ p {
102
+ margin-bottom: 10px;
103
+ }
104
+ }
105
+ }
106
+ &__info {
107
+ display: flex;
108
+ margin-top: 11px;
109
+ flex-direction: column;
110
+ &-item {
111
+ margin-right: 0;
112
+ margin: 7px 0;
113
+ }
114
+ }
115
+ &__step {
116
+ height: 68px;
117
+ padding: 0 20px;
118
+ display: flex;
119
+ justify-content: center;
120
+ flex-direction: column;
121
+ width: 100%;
122
+ position: relative;
123
+ @media (max-width: $bp-large-max) {
124
+ padding: 0 10px;
125
+ }
126
+ &::after {
127
+ content: '';
128
+ position: absolute;
129
+ top: -3px;
130
+ right: 0px;
131
+ bottom: -3px;
132
+ width: 16px;
133
+ background-image: url(~/static/images/step-arrow.svg);
134
+ background-position: top right;
135
+ background-repeat: no-repeat;
136
+ background-size: cover;
137
+ z-index: 3;
138
+ }
139
+ &::before {
140
+ content: '';
141
+ position: absolute;
142
+ left: -14px;
143
+ top: 0px;
144
+ right: 15px;
145
+ bottom: 0px;
146
+ background-color: #f4f4f4;
147
+ z-index: 1;
148
+ }
149
+ &--last {
150
+ &::before {
151
+ right: 0;
152
+ }
153
+ &::after {
154
+ display: none;
155
+ }
156
+ }
157
+ &-progress {
158
+ position: relative;
159
+ z-index: 2;
160
+ }
161
+ &-number {
162
+ font-weight: 800;
163
+ font-size: 16px;
164
+ color: $black;
165
+ }
166
+ &--active {
167
+ .Wizard__step-number {
168
+ color: $wizard_primary_text;
169
+ }
170
+ &::before {
171
+ background-color: $wizard_primary_secondary;
172
+ }
173
+ &::after {
174
+ background-image: url(~/static/images/step-arrow--success.svg);
175
+ }
176
+ }
177
+ &-name {
178
+ font-weight: bold;
179
+ font-size: 14px;
180
+ color: $gray_main;
181
+ margin-top: 4px;
182
+ @media (max-width: $bp-large-max) {
183
+ font-size: 11px;
184
+ }
185
+ }
186
+ &-success {
187
+ font-size: 19px;
188
+ width: 40px;
189
+ height: 40px;
190
+ background-color: $green;
191
+ border-radius: 20px;
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: center;
195
+ }
196
+ }
197
+ &__content {
198
+ display: none;
199
+ &--visible {
200
+ display: block;
201
+ }
202
+ .ProgressSteps {
203
+ &__wrapper {
204
+ margin-top: 12px;
205
+ }
206
+ &__steps-wrapper {
207
+ padding: 0 !important;
208
+ border-bottom: none;
209
+ @media (max-width: $bp-extra-small-max) {
210
+ display: none;
211
+ }
212
+ }
213
+ &__steps {
214
+ overflow: hidden;
215
+ padding-left: 15px;
216
+ }
217
+ &__step {
218
+ height: auto;
219
+ }
220
+ }
221
+ }
222
+ }