rerobe-js-orm 3.1.3 → 3.1.4

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.
@@ -15,6 +15,7 @@ export default class ProductFormState extends FormState {
15
15
  brands: string[];
16
16
  colors: string[];
17
17
  sizes: string[];
18
+ materials: string[];
18
19
  clothingSizes: string[];
19
20
  jeanSizes: string[];
20
21
  shoeSizes: string[];
@@ -489,7 +489,7 @@ class ProductFormState extends FormState_1.default {
489
489
  }
490
490
  }
491
491
  fieldFactory(fieldType, fieldKey, fieldOptions) {
492
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
492
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
493
493
  let options = fieldOptions || [];
494
494
  let hidden = false;
495
495
  if (fieldType === 'singleSelect') {
@@ -527,6 +527,14 @@ class ProductFormState extends FormState_1.default {
527
527
  });
528
528
  }
529
529
  }
530
+ if ((_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.materials) === null || _b === void 0 ? void 0 : _b.length) {
531
+ const materialsOptions = this.opts.materials.map((t) => ({
532
+ label: t,
533
+ value: t,
534
+ key: t,
535
+ }));
536
+ options = this.utilities.uniqObjArray([...options, ...materialsOptions], 'value');
537
+ }
530
538
  }
531
539
  if (fieldKey === 'editorAuthorizations') {
532
540
  selectedValue = this.props[fieldKey] || {};
@@ -561,7 +569,7 @@ class ProductFormState extends FormState_1.default {
561
569
  options.splice(0, 0, ...selectedSizeOptions);
562
570
  }
563
571
  }
564
- if ((_b = (_a = this.opts) === null || _a === void 0 ? void 0 : _a.sizes) === null || _b === void 0 ? void 0 : _b.length) {
572
+ if ((_d = (_c = this.opts) === null || _c === void 0 ? void 0 : _c.sizes) === null || _d === void 0 ? void 0 : _d.length) {
565
573
  const sizesOptions = this.opts.sizes.map((t) => ({ label: t, value: t }));
566
574
  options = this.utilities.uniqObjArray([...selectedSizeOptions, ...sizesOptions], 'value');
567
575
  }
@@ -575,7 +583,7 @@ class ProductFormState extends FormState_1.default {
575
583
  options.splice(0, 0, ...selectedJeanSizeOptions);
576
584
  }
577
585
  }
578
- if ((_d = (_c = this.opts) === null || _c === void 0 ? void 0 : _c.jeanSizes) === null || _d === void 0 ? void 0 : _d.length) {
586
+ if ((_f = (_e = this.opts) === null || _e === void 0 ? void 0 : _e.jeanSizes) === null || _f === void 0 ? void 0 : _f.length) {
579
587
  const jeanSizesOptions = this.opts.jeanSizes.map((t) => ({ label: t, value: t }));
580
588
  options = this.utilities.uniqObjArray([...selectedJeanSizeOptions, ...jeanSizesOptions], 'value');
581
589
  }
@@ -589,7 +597,7 @@ class ProductFormState extends FormState_1.default {
589
597
  options.splice(0, 0, ...selectedShoeSizeOptions);
590
598
  }
591
599
  }
592
- if ((_f = (_e = this.opts) === null || _e === void 0 ? void 0 : _e.shoeSizes) === null || _f === void 0 ? void 0 : _f.length) {
600
+ if ((_h = (_g = this.opts) === null || _g === void 0 ? void 0 : _g.shoeSizes) === null || _h === void 0 ? void 0 : _h.length) {
593
601
  const shoeSizesOptions = this.opts.shoeSizes.map((t) => ({ label: t, value: t }));
594
602
  options = this.utilities.uniqObjArray([...selectedShoeSizeOptions, ...shoeSizesOptions], 'value');
595
603
  }
@@ -602,7 +610,7 @@ class ProductFormState extends FormState_1.default {
602
610
  options.splice(0, 0, ...selectedBrandOptions);
603
611
  }
604
612
  }
605
- if ((_h = (_g = this.opts) === null || _g === void 0 ? void 0 : _g.brands) === null || _h === void 0 ? void 0 : _h.length) {
613
+ if ((_k = (_j = this.opts) === null || _j === void 0 ? void 0 : _j.brands) === null || _k === void 0 ? void 0 : _k.length) {
606
614
  const brandsOptions = this.opts.brands.map((t) => ({ label: t, value: t }));
607
615
  options = this.utilities.uniqObjArray([...selectedBrandOptions, ...brandsOptions], 'value');
608
616
  }
@@ -615,7 +623,7 @@ class ProductFormState extends FormState_1.default {
615
623
  options.splice(0, 0, ...selectedColorOptions);
616
624
  }
617
625
  }
618
- if ((_k = (_j = this.opts) === null || _j === void 0 ? void 0 : _j.colors) === null || _k === void 0 ? void 0 : _k.length) {
626
+ if ((_m = (_l = this.opts) === null || _l === void 0 ? void 0 : _l.colors) === null || _m === void 0 ? void 0 : _m.length) {
619
627
  const colorsOptions = this.opts.colors.map((t) => ({ label: t, value: t }));
620
628
  options = this.utilities.uniqObjArray([...selectedColorOptions, ...colorsOptions], 'value');
621
629
  }
@@ -649,7 +657,7 @@ class ProductFormState extends FormState_1.default {
649
657
  options.splice(0, 0, ...selectedPrimaryAgeCategoryOptions);
650
658
  }
651
659
  }
652
- if ((_m = (_l = this.opts) === null || _l === void 0 ? void 0 : _l.primaryAgeCategories) === null || _m === void 0 ? void 0 : _m.length) {
660
+ if ((_p = (_o = this.opts) === null || _o === void 0 ? void 0 : _o.primaryAgeCategories) === null || _p === void 0 ? void 0 : _p.length) {
653
661
  const primaryAgeCategoryOptions = this.opts.primaryAgeCategories.map((t) => ({ label: t, value: t }));
654
662
  options = this.utilities.uniqObjArray([...selectedPrimaryAgeCategoryOptions, ...primaryAgeCategoryOptions], 'value');
655
663
  }
@@ -662,7 +670,7 @@ class ProductFormState extends FormState_1.default {
662
670
  options.splice(0, 0, ...selectedOptions);
663
671
  }
664
672
  }
665
- if ((_p = (_o = this.opts) === null || _o === void 0 ? void 0 : _o.conditions) === null || _p === void 0 ? void 0 : _p.length) {
673
+ if ((_r = (_q = this.opts) === null || _q === void 0 ? void 0 : _q.conditions) === null || _r === void 0 ? void 0 : _r.length) {
666
674
  const conditionsOptions = this.opts.conditions.map((t) => ({
667
675
  label: t.label || '',
668
676
  value: t.value || '',
@@ -717,7 +725,7 @@ class ProductFormState extends FormState_1.default {
717
725
  if (this.props.gender === 'Man') {
718
726
  options = options_1.manClothingSizeOptions;
719
727
  }
720
- if ((_r = (_q = this.opts) === null || _q === void 0 ? void 0 : _q.clothingSizes) === null || _r === void 0 ? void 0 : _r.length) {
728
+ if ((_t = (_s = this.opts) === null || _s === void 0 ? void 0 : _s.clothingSizes) === null || _t === void 0 ? void 0 : _t.length) {
721
729
  const clothingSizesOptions = this.opts.clothingSizes.map((t) => ({ label: t, value: t }));
722
730
  options = this.utilities.uniqObjArray(clothingSizesOptions, 'value');
723
731
  }
@@ -729,7 +737,7 @@ class ProductFormState extends FormState_1.default {
729
737
  selectedMajorDefectsOptions = this.props.majorDefects.map((t) => ({ label: t, value: t }));
730
738
  }
731
739
  let majorDefectsOptions = [];
732
- if ((_t = (_s = this.opts) === null || _s === void 0 ? void 0 : _s.majorDefects) === null || _t === void 0 ? void 0 : _t.length) {
740
+ if ((_v = (_u = this.opts) === null || _u === void 0 ? void 0 : _u.majorDefects) === null || _v === void 0 ? void 0 : _v.length) {
733
741
  majorDefectsOptions = this.opts.majorDefects.map((t) => ({ label: t, value: t }));
734
742
  }
735
743
  options = this.utilities.uniqObjArray([...selectedMajorDefectsOptions, ...majorDefectsOptions], 'value');
@@ -740,7 +748,7 @@ class ProductFormState extends FormState_1.default {
740
748
  selectedMinorDefectsOptions = this.props.minorDefects.map((t) => ({ label: t, value: t }));
741
749
  }
742
750
  let minorDefectsOptions = [];
743
- if ((_v = (_u = this.opts) === null || _u === void 0 ? void 0 : _u.minorDefects) === null || _v === void 0 ? void 0 : _v.length) {
751
+ if ((_x = (_w = this.opts) === null || _w === void 0 ? void 0 : _w.minorDefects) === null || _x === void 0 ? void 0 : _x.length) {
744
752
  minorDefectsOptions = this.opts.minorDefects.map((t) => ({ label: t, value: t }));
745
753
  }
746
754
  options = this.utilities.uniqObjArray([...selectedMinorDefectsOptions, ...minorDefectsOptions], 'value');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",