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.
@@ -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
- variants: props.fields.variants.selectedValue,
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.variants = this.fieldFactory('singleSelect', 'variants');
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
  }
@@ -156,3 +156,7 @@ export const productIsOnSaleOptions: {
156
156
  label: string;
157
157
  value: string;
158
158
  }[];
159
+ export const productOptions: {
160
+ value: string;
161
+ label: string;
162
+ }[];
@@ -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;
@@ -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
- variants: (props === null || props === void 0 ? void 0 : props.variants) || {},
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
- variants?: Variants | null;
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
- variants: SingleSelectFormField<Variants>;
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 Variants = {
202
+ declare type ProductOptions = {
203
203
  size?: string[];
204
204
  color?: string[];
205
205
  material?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.4.89",
3
+ "version": "2.4.90",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",