rerobe-js-orm 3.0.28 → 3.0.30

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.
@@ -27,3 +27,289 @@ export namespace PRODUCT_STATES {
27
27
  const reservationQueue: string;
28
28
  const availableInStore: string;
29
29
  }
30
+ export namespace MEASUREMENT_CATEGORY {
31
+ const SuitsNBlazers: string;
32
+ const Bottoms: string;
33
+ const Shirts: string;
34
+ const Shoes: string;
35
+ const Accessories: string;
36
+ const Coats: string;
37
+ const Dresses: string;
38
+ const Hats: string;
39
+ const Gloves: string;
40
+ const Eyewear: string;
41
+ const GeneralItems: string;
42
+ }
43
+ export const CATEGORY_ITEM_LABEL: {
44
+ [x: string]: {
45
+ width: string;
46
+ height: string;
47
+ depth: string;
48
+ lensWidth?: undefined;
49
+ bridgeWidth?: undefined;
50
+ templeLength?: undefined;
51
+ handLength?: undefined;
52
+ handCircumference?: undefined;
53
+ fingerLength?: undefined;
54
+ headCircumference?: undefined;
55
+ brimWidth?: undefined;
56
+ crownHeight?: undefined;
57
+ bustCircumference?: undefined;
58
+ waistCircumference?: undefined;
59
+ hipCircumference?: undefined;
60
+ length?: undefined;
61
+ shoulderWidth?: undefined;
62
+ sleeveLength?: undefined;
63
+ footLength?: undefined;
64
+ footWidth?: undefined;
65
+ heelHeight?: undefined;
66
+ shaftHeight?: undefined;
67
+ calfCircumference?: undefined;
68
+ chestCircumference?: undefined;
69
+ neckCircumference?: undefined;
70
+ collarLength?: undefined;
71
+ innerLeg?: undefined;
72
+ outerLeg?: undefined;
73
+ footCircumference?: undefined;
74
+ } | {
75
+ lensWidth: string;
76
+ bridgeWidth: string;
77
+ templeLength: string;
78
+ width?: undefined;
79
+ height?: undefined;
80
+ depth?: undefined;
81
+ handLength?: undefined;
82
+ handCircumference?: undefined;
83
+ fingerLength?: undefined;
84
+ headCircumference?: undefined;
85
+ brimWidth?: undefined;
86
+ crownHeight?: undefined;
87
+ bustCircumference?: undefined;
88
+ waistCircumference?: undefined;
89
+ hipCircumference?: undefined;
90
+ length?: undefined;
91
+ shoulderWidth?: undefined;
92
+ sleeveLength?: undefined;
93
+ footLength?: undefined;
94
+ footWidth?: undefined;
95
+ heelHeight?: undefined;
96
+ shaftHeight?: undefined;
97
+ calfCircumference?: undefined;
98
+ chestCircumference?: undefined;
99
+ neckCircumference?: undefined;
100
+ collarLength?: undefined;
101
+ innerLeg?: undefined;
102
+ outerLeg?: undefined;
103
+ footCircumference?: undefined;
104
+ } | {
105
+ handLength: string;
106
+ handCircumference: string;
107
+ fingerLength: string;
108
+ width?: undefined;
109
+ height?: undefined;
110
+ depth?: undefined;
111
+ lensWidth?: undefined;
112
+ bridgeWidth?: undefined;
113
+ templeLength?: undefined;
114
+ headCircumference?: undefined;
115
+ brimWidth?: undefined;
116
+ crownHeight?: undefined;
117
+ bustCircumference?: undefined;
118
+ waistCircumference?: undefined;
119
+ hipCircumference?: undefined;
120
+ length?: undefined;
121
+ shoulderWidth?: undefined;
122
+ sleeveLength?: undefined;
123
+ footLength?: undefined;
124
+ footWidth?: undefined;
125
+ heelHeight?: undefined;
126
+ shaftHeight?: undefined;
127
+ calfCircumference?: undefined;
128
+ chestCircumference?: undefined;
129
+ neckCircumference?: undefined;
130
+ collarLength?: undefined;
131
+ innerLeg?: undefined;
132
+ outerLeg?: undefined;
133
+ footCircumference?: undefined;
134
+ } | {
135
+ headCircumference: string;
136
+ brimWidth: string;
137
+ crownHeight: string;
138
+ width?: undefined;
139
+ height?: undefined;
140
+ depth?: undefined;
141
+ lensWidth?: undefined;
142
+ bridgeWidth?: undefined;
143
+ templeLength?: undefined;
144
+ handLength?: undefined;
145
+ handCircumference?: undefined;
146
+ fingerLength?: undefined;
147
+ bustCircumference?: undefined;
148
+ waistCircumference?: undefined;
149
+ hipCircumference?: undefined;
150
+ length?: undefined;
151
+ shoulderWidth?: undefined;
152
+ sleeveLength?: undefined;
153
+ footLength?: undefined;
154
+ footWidth?: undefined;
155
+ heelHeight?: undefined;
156
+ shaftHeight?: undefined;
157
+ calfCircumference?: undefined;
158
+ chestCircumference?: undefined;
159
+ neckCircumference?: undefined;
160
+ collarLength?: undefined;
161
+ innerLeg?: undefined;
162
+ outerLeg?: undefined;
163
+ footCircumference?: undefined;
164
+ } | {
165
+ bustCircumference: string;
166
+ waistCircumference: string;
167
+ hipCircumference: string;
168
+ length: string;
169
+ shoulderWidth: string;
170
+ sleeveLength: string;
171
+ width?: undefined;
172
+ height?: undefined;
173
+ depth?: undefined;
174
+ lensWidth?: undefined;
175
+ bridgeWidth?: undefined;
176
+ templeLength?: undefined;
177
+ handLength?: undefined;
178
+ handCircumference?: undefined;
179
+ fingerLength?: undefined;
180
+ headCircumference?: undefined;
181
+ brimWidth?: undefined;
182
+ crownHeight?: undefined;
183
+ footLength?: undefined;
184
+ footWidth?: undefined;
185
+ heelHeight?: undefined;
186
+ shaftHeight?: undefined;
187
+ calfCircumference?: undefined;
188
+ chestCircumference?: undefined;
189
+ neckCircumference?: undefined;
190
+ collarLength?: undefined;
191
+ innerLeg?: undefined;
192
+ outerLeg?: undefined;
193
+ footCircumference?: undefined;
194
+ } | {
195
+ footLength: string;
196
+ footWidth: string;
197
+ heelHeight: string;
198
+ shaftHeight: string;
199
+ calfCircumference: string;
200
+ width?: undefined;
201
+ height?: undefined;
202
+ depth?: undefined;
203
+ lensWidth?: undefined;
204
+ bridgeWidth?: undefined;
205
+ templeLength?: undefined;
206
+ handLength?: undefined;
207
+ handCircumference?: undefined;
208
+ fingerLength?: undefined;
209
+ headCircumference?: undefined;
210
+ brimWidth?: undefined;
211
+ crownHeight?: undefined;
212
+ bustCircumference?: undefined;
213
+ waistCircumference?: undefined;
214
+ hipCircumference?: undefined;
215
+ length?: undefined;
216
+ shoulderWidth?: undefined;
217
+ sleeveLength?: undefined;
218
+ chestCircumference?: undefined;
219
+ neckCircumference?: undefined;
220
+ collarLength?: undefined;
221
+ innerLeg?: undefined;
222
+ outerLeg?: undefined;
223
+ footCircumference?: undefined;
224
+ } | {
225
+ chestCircumference: string;
226
+ waistCircumference: string;
227
+ length: string;
228
+ shoulderWidth: string;
229
+ sleeveLength: string;
230
+ width?: undefined;
231
+ height?: undefined;
232
+ depth?: undefined;
233
+ lensWidth?: undefined;
234
+ bridgeWidth?: undefined;
235
+ templeLength?: undefined;
236
+ handLength?: undefined;
237
+ handCircumference?: undefined;
238
+ fingerLength?: undefined;
239
+ headCircumference?: undefined;
240
+ brimWidth?: undefined;
241
+ crownHeight?: undefined;
242
+ bustCircumference?: undefined;
243
+ hipCircumference?: undefined;
244
+ footLength?: undefined;
245
+ footWidth?: undefined;
246
+ heelHeight?: undefined;
247
+ shaftHeight?: undefined;
248
+ calfCircumference?: undefined;
249
+ neckCircumference?: undefined;
250
+ collarLength?: undefined;
251
+ innerLeg?: undefined;
252
+ outerLeg?: undefined;
253
+ footCircumference?: undefined;
254
+ } | {
255
+ neckCircumference: string;
256
+ collarLength: string;
257
+ sleeveLength: string;
258
+ chestCircumference: string;
259
+ width?: undefined;
260
+ height?: undefined;
261
+ depth?: undefined;
262
+ lensWidth?: undefined;
263
+ bridgeWidth?: undefined;
264
+ templeLength?: undefined;
265
+ handLength?: undefined;
266
+ handCircumference?: undefined;
267
+ fingerLength?: undefined;
268
+ headCircumference?: undefined;
269
+ brimWidth?: undefined;
270
+ crownHeight?: undefined;
271
+ bustCircumference?: undefined;
272
+ waistCircumference?: undefined;
273
+ hipCircumference?: undefined;
274
+ length?: undefined;
275
+ shoulderWidth?: undefined;
276
+ footLength?: undefined;
277
+ footWidth?: undefined;
278
+ heelHeight?: undefined;
279
+ shaftHeight?: undefined;
280
+ calfCircumference?: undefined;
281
+ innerLeg?: undefined;
282
+ outerLeg?: undefined;
283
+ footCircumference?: undefined;
284
+ } | {
285
+ waistCircumference: string;
286
+ innerLeg: string;
287
+ outerLeg: string;
288
+ footCircumference: string;
289
+ width?: undefined;
290
+ height?: undefined;
291
+ depth?: undefined;
292
+ lensWidth?: undefined;
293
+ bridgeWidth?: undefined;
294
+ templeLength?: undefined;
295
+ handLength?: undefined;
296
+ handCircumference?: undefined;
297
+ fingerLength?: undefined;
298
+ headCircumference?: undefined;
299
+ brimWidth?: undefined;
300
+ crownHeight?: undefined;
301
+ bustCircumference?: undefined;
302
+ hipCircumference?: undefined;
303
+ length?: undefined;
304
+ shoulderWidth?: undefined;
305
+ sleeveLength?: undefined;
306
+ footLength?: undefined;
307
+ footWidth?: undefined;
308
+ heelHeight?: undefined;
309
+ shaftHeight?: undefined;
310
+ calfCircumference?: undefined;
311
+ chestCircumference?: undefined;
312
+ neckCircumference?: undefined;
313
+ collarLength?: undefined;
314
+ };
315
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRODUCT_STATES = void 0;
3
+ exports.CATEGORY_ITEM_LABEL = exports.MEASUREMENT_CATEGORY = exports.PRODUCT_STATES = void 0;
4
4
  exports.PRODUCT_STATES = {
5
5
  archived: 'ARCHIVED',
6
6
  sellRequestReview: 'SELL_REQUEST_REVIEW',
@@ -30,3 +30,84 @@ exports.PRODUCT_STATES = {
30
30
  reservationQueue: 'IN_RESERVATION_QUEUE',
31
31
  availableInStore: 'AVAILABLE_IN_STORE',
32
32
  };
33
+ exports.MEASUREMENT_CATEGORY = {
34
+ SuitsNBlazers: 'Suits & Blazers',
35
+ Bottoms: 'Bottoms',
36
+ Shirts: 'Shirts',
37
+ Shoes: 'Shoes',
38
+ Accessories: 'Accessories',
39
+ Coats: 'Coats',
40
+ Dresses: 'Dresses',
41
+ Hats: 'Hats',
42
+ Gloves: 'Gloves',
43
+ Eyewear: 'Eyewear',
44
+ GeneralItems: 'General Items',
45
+ };
46
+ exports.CATEGORY_ITEM_LABEL = {
47
+ [exports.MEASUREMENT_CATEGORY.GeneralItems]: {
48
+ width: 'Width',
49
+ height: 'Height',
50
+ depth: 'Depth',
51
+ },
52
+ [exports.MEASUREMENT_CATEGORY.Accessories]: {
53
+ width: 'Width',
54
+ height: 'Height',
55
+ depth: 'Depth',
56
+ },
57
+ [exports.MEASUREMENT_CATEGORY.Eyewear]: {
58
+ lensWidth: 'Lens Width',
59
+ bridgeWidth: 'Bridge Width',
60
+ templeLength: 'Temple Width',
61
+ },
62
+ [exports.MEASUREMENT_CATEGORY.Gloves]: {
63
+ handLength: 'Hand Length',
64
+ handCircumference: 'Hand Circumference',
65
+ fingerLength: 'Finger Length',
66
+ },
67
+ [exports.MEASUREMENT_CATEGORY.Hats]: {
68
+ headCircumference: 'Head Circumference',
69
+ brimWidth: 'Brim Width',
70
+ crownHeight: 'Crown Height',
71
+ },
72
+ [exports.MEASUREMENT_CATEGORY.Dresses]: {
73
+ bustCircumference: 'Bust Circumference',
74
+ waistCircumference: 'Waist Circumference',
75
+ hipCircumference: 'Hip Circumference',
76
+ length: 'Length',
77
+ shoulderWidth: 'Shoulder Width',
78
+ sleeveLength: 'Sleeve Length',
79
+ },
80
+ [exports.MEASUREMENT_CATEGORY.Shoes]: {
81
+ footLength: 'Foot Length',
82
+ footWidth: 'Foot Width',
83
+ heelHeight: 'Heel Height',
84
+ shaftHeight: 'Shaft Height',
85
+ calfCircumference: 'Calf Circumference',
86
+ },
87
+ [exports.MEASUREMENT_CATEGORY.Coats]: {
88
+ chestCircumference: 'Chest Circumference',
89
+ waistCircumference: 'Waist Circumference',
90
+ length: 'Length',
91
+ shoulderWidth: 'Shoulder Width',
92
+ sleeveLength: 'Sleeve Length',
93
+ },
94
+ [exports.MEASUREMENT_CATEGORY.Shirts]: {
95
+ neckCircumference: 'Neck Circumference',
96
+ collarLength: 'Collar Length',
97
+ sleeveLength: 'Sleeve Length',
98
+ chestCircumference: 'Chest Circumference',
99
+ },
100
+ [exports.MEASUREMENT_CATEGORY.Bottoms]: {
101
+ waistCircumference: 'Waist Circumference',
102
+ innerLeg: 'Inner Leg',
103
+ outerLeg: 'Outer Leg',
104
+ footCircumference: 'Foot Circumference',
105
+ },
106
+ [exports.MEASUREMENT_CATEGORY.SuitsNBlazers]: {
107
+ chestCircumference: 'Chest Circumference',
108
+ waistCircumference: 'Waist Circumference',
109
+ length: 'Length',
110
+ shoulderWidth: 'Shoulder Width',
111
+ sleeveLength: 'Sleeve Length',
112
+ },
113
+ };
@@ -93,7 +93,7 @@ class OrderFromFormState extends OrderFactory_1.default {
93
93
  originalTotalPrice: { amount: fs.fields.originalTotalPrice.inputValue || 0, currencyCode },
94
94
  };
95
95
  const statusesAttr = {
96
- state: ((_h = fs.props) === null || _h === void 0 ? void 0 : _h.state) || Order_1.default.ORDER_STATES.draft,
96
+ state: ((_h = fs.fields) === null || _h === void 0 ? void 0 : _h.state.selectedValue) || Order_1.default.ORDER_STATES.draft,
97
97
  financialStatus: fs.fields.financialStatus.selectedValue,
98
98
  fulfillmentStatus: fs.fields.fulfillmentStatus.selectedValue,
99
99
  statusUrl: ((_j = fs.props) === null || _j === void 0 ? void 0 : _j.statusUrl) || '',
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const Base_1 = require("../Base");
4
+ const product_constants_1 = require("../constants/product-constants");
4
5
  const options_1 = require("../form-states/Product/options");
5
6
  class Product extends Base_1.default {
6
7
  constructor(props) {
@@ -833,19 +834,20 @@ class Product extends Base_1.default {
833
834
  .join(', ');
834
835
  }
835
836
  measurementsJoinedString(measurementsObj) {
836
- if (Object.keys(measurementsObj).length > 0) {
837
- const measurementStr = Object.keys(measurementsObj).reduce((acc, cur) => {
838
- let result = acc;
839
- if (cur !== 'unit') {
840
- result = acc
841
- ? `${measurementsObj[cur]} ${measurementsObj.unit} ${cur} x ${acc}`
842
- : `${measurementsObj[cur]} ${measurementsObj.unit} ${cur}`;
843
- }
844
- return result;
845
- }, '');
846
- return measurementStr;
837
+ if (typeof measurementsObj !== 'object' || measurementsObj == null) {
838
+ return '';
839
+ }
840
+ if (Object.keys(measurementsObj).length === 0) {
841
+ return '';
847
842
  }
848
- return '';
843
+ return Object.keys(measurementsObj)
844
+ .filter((key) => key !== 'unit')
845
+ .map((key) => {
846
+ const label = product_constants_1.CATEGORY_ITEM_LABEL[key] || key;
847
+ return `${measurementsObj[key]} ${measurementsObj.unit} ${label}`;
848
+ })
849
+ .reverse()
850
+ .join(' x ');
849
851
  }
850
852
  convertMaterialCompJoinedStrToObj(materialCompJoinedString) {
851
853
  let materialObj = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.28",
3
+ "version": "3.0.30",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",