rerobe-js-orm 2.4.89 → 2.4.90
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/lib/factories/Product/ProductFromFormState.js +1 -1
- package/lib/form-states/Product/ProductFormState.js +5 -1
- package/lib/form-states/Product/options.d.ts +4 -0
- package/lib/form-states/Product/options.js +8 -1
- package/lib/models/Product.js +1 -1
- package/lib/types/rerobe-product-types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -22,7 +22,7 @@ class ProductFromFormState extends ProductFactory_1.default {
|
|
|
22
22
|
weight: props.fields.weight.inputValue,
|
|
23
23
|
variantId: ((_j = props.props) === null || _j === void 0 ? void 0 : _j.variantId) || '',
|
|
24
24
|
reservedBy: ((_k = props.props) === null || _k === void 0 ? void 0 : _k.reservedBy) || [],
|
|
25
|
-
|
|
25
|
+
options: props.fields.options.selectedValue,
|
|
26
26
|
costPerItem: props.fields.costPerItem.inputValue,
|
|
27
27
|
compareAtPrice: props.fields.compareAtPrice.inputValue,
|
|
28
28
|
quantity: props.fields.quantity.inputValue,
|
|
@@ -20,7 +20,7 @@ class ProductFormState extends FormState_1.default {
|
|
|
20
20
|
valid: false,
|
|
21
21
|
onChangeHandler: (fileArr) => this.multiSelectMediaChangeHandler('officialFilesToUpload', fileArr),
|
|
22
22
|
};
|
|
23
|
-
this.fields.
|
|
23
|
+
this.fields.options = this.fieldFactory('singleSelect', 'options', options_1.productOptions);
|
|
24
24
|
this.fields.costPerItem = this.fieldFactory('textInput', 'costPerItem');
|
|
25
25
|
this.fields.compareAtPrice = this.fieldFactory('textInput', 'compareAtPrice');
|
|
26
26
|
this.fields.quantity = this.fieldFactory('textInput', 'quantity');
|
|
@@ -465,6 +465,10 @@ class ProductFormState extends FormState_1.default {
|
|
|
465
465
|
selectedValue = this.props[fieldKey] || {};
|
|
466
466
|
valid = Object.keys(this.props[fieldKey]).length > 0;
|
|
467
467
|
}
|
|
468
|
+
if (fieldKey === 'options') {
|
|
469
|
+
selectedValue = this.props[fieldKey] || {};
|
|
470
|
+
valid = Object.keys(this.props[fieldKey]).length > 0;
|
|
471
|
+
}
|
|
468
472
|
if (fieldKey === 'gender') {
|
|
469
473
|
onChangeHandler = (val) => this.genderSelectHandler(val);
|
|
470
474
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.conditionTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.clothingSizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
|
|
3
|
+
exports.productOptions = exports.productIsOnSaleOptions = exports.discountTypeOptions = exports.conditionTypeOptions = exports.salesChannelOptions = exports.unisexJewelry = exports.mensJewelry = exports.jewelry = exports.unisexAccessories = exports.mensAccessories = exports.accessories = exports.unisexBags = exports.mensBags = exports.bags = exports.unisexShoes = exports.mensShoes = exports.shoes = exports.unisexClothing = exports.mensClothing = exports.clothing = exports.productCategories = exports.clothingMaterials = exports.shoeSizes = exports.jeanSizes = exports.gender = exports.conditions = exports.colors = exports.brands = exports.sizeCommentOptions = exports.clothingSizeOptions = exports.statusOptions = exports.publishTypeOptions = exports.availableForSaleOptions = void 0;
|
|
4
4
|
const availableForSaleOptions = [
|
|
5
5
|
{
|
|
6
6
|
label: 'Zero',
|
|
@@ -3453,3 +3453,10 @@ const productIsOnSaleOptions = [
|
|
|
3453
3453
|
},
|
|
3454
3454
|
];
|
|
3455
3455
|
exports.productIsOnSaleOptions = productIsOnSaleOptions;
|
|
3456
|
+
const productOptions = [
|
|
3457
|
+
{ value: 'size', label: 'Size' },
|
|
3458
|
+
{ value: 'color', label: 'Color' },
|
|
3459
|
+
{ value: 'style', label: 'Style' },
|
|
3460
|
+
{ value: 'material', label: 'Material' },
|
|
3461
|
+
];
|
|
3462
|
+
exports.productOptions = productOptions;
|
package/lib/models/Product.js
CHANGED
|
@@ -23,7 +23,7 @@ class Product extends Base_1.default {
|
|
|
23
23
|
vendorName: (props === null || props === void 0 ? void 0 : props.vendorName) || '',
|
|
24
24
|
variantId: (props === null || props === void 0 ? void 0 : props.variantId) || '',
|
|
25
25
|
reservedBy: (props === null || props === void 0 ? void 0 : props.reservedBy) || [],
|
|
26
|
-
|
|
26
|
+
options: (props === null || props === void 0 ? void 0 : props.options) || {},
|
|
27
27
|
costPerItem: (props === null || props === void 0 ? void 0 : props.costPerItem) || '',
|
|
28
28
|
compareAtPrice: (props === null || props === void 0 ? void 0 : props.compareAtPrice) || '',
|
|
29
29
|
quantity: (props === null || props === void 0 ? void 0 : props.quantity) || 0,
|
|
@@ -15,7 +15,7 @@ declare type ProductAttributes = {
|
|
|
15
15
|
vendorName?: string;
|
|
16
16
|
variantId: string;
|
|
17
17
|
reservedBy: string[];
|
|
18
|
-
|
|
18
|
+
options?: ProductOptions | null;
|
|
19
19
|
costPerItem?: string;
|
|
20
20
|
compareAtPrice?: string;
|
|
21
21
|
quantity?: number | string;
|
|
@@ -140,7 +140,7 @@ declare type ProductAttributesFormFields = {
|
|
|
140
140
|
price: TextInputFormField<string>;
|
|
141
141
|
weight: TextInputFormField<string>;
|
|
142
142
|
officialFilesToUpload: MultiMediaSelectFormField;
|
|
143
|
-
|
|
143
|
+
options: SingleSelectFormField<ProductOptions>;
|
|
144
144
|
costPerItem: TextInputFormField<string>;
|
|
145
145
|
compareAtPrice: TextInputFormField<string>;
|
|
146
146
|
quantity: TextInputFormField<string | number>;
|
|
@@ -199,7 +199,7 @@ interface ParamsForBuildProductInputObjForShopify {
|
|
|
199
199
|
productShopifyId?: string;
|
|
200
200
|
}
|
|
201
201
|
declare type ConditionTypes = 'NEW' | 'USED';
|
|
202
|
-
declare type
|
|
202
|
+
declare type ProductOptions = {
|
|
203
203
|
size?: string[];
|
|
204
204
|
color?: string[];
|
|
205
205
|
material?: string[];
|