rerobe-js-orm 2.4.91 → 2.4.92

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.
@@ -18,6 +18,7 @@ export default class ProductFormState extends FormState {
18
18
  autoCreateDescription(): string;
19
19
  createProduct(): Product;
20
20
  private priceInputChangeHandler;
21
+ private setGenderFromPassedOptions;
21
22
  private genderSelectHandler;
22
23
  private conditionSelectHandler;
23
24
  private productCategorySelectHandler;
@@ -96,6 +96,14 @@ class ProductFormState extends FormState_1.default {
96
96
  // Recalculates salePrice
97
97
  this.props.salePrice = this.calculateSalePrice();
98
98
  }
99
+ setGenderFromPassedOptions() {
100
+ if (this.opts &&
101
+ this.opts.taxonomy &&
102
+ Object.keys(this.opts.taxonomy).length > 0) {
103
+ return Object.keys(this.opts.taxonomy).map((t) => ({ label: t, value: t }));
104
+ }
105
+ return options_1.gender;
106
+ }
99
107
  genderSelectHandler(value) {
100
108
  // Mutate gender selectedValue and valid prop
101
109
  this.fields.gender.selectedValue = value;
@@ -514,6 +522,7 @@ class ProductFormState extends FormState_1.default {
514
522
  valid = Object.keys(this.props[fieldKey]).length > 0;
515
523
  }
516
524
  if (fieldKey === 'gender') {
525
+ options = this.setGenderFromPassedOptions();
517
526
  onChangeHandler = (val) => this.genderSelectHandler(val);
518
527
  }
519
528
  if (fieldKey === 'productCategory') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "2.4.91",
3
+ "version": "2.4.92",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",