rerobe-js-orm 3.0.14 → 3.0.15

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.
@@ -573,13 +573,20 @@ class ProductFormState extends FormState_1.default {
573
573
  }
574
574
  }
575
575
  if (fieldKey === 'condition') {
576
+ let selectedOptions = [];
577
+ if (this.props.condition) {
578
+ selectedOptions = [{ label: this.props.condition, value: this.props.condition, description: '' }];
579
+ if (!options.map((o) => o.value).includes(this.props.condition)) {
580
+ options.splice(0, 0, ...selectedOptions);
581
+ }
582
+ }
576
583
  if ((_p = (_o = this.opts) === null || _o === void 0 ? void 0 : _o.conditions) === null || _p === void 0 ? void 0 : _p.length) {
577
584
  const conditionsOptions = this.opts.conditions.map((t) => ({
578
585
  label: t.label || '',
579
586
  value: t.value || '',
580
587
  description: t.description || '',
581
588
  }));
582
- options = this.utilities.uniqObjArray(conditionsOptions, 'value');
589
+ options = this.utilities.uniqObjArray([...selectedOptions, ...conditionsOptions], 'value');
583
590
  }
584
591
  onChangeHandler = (val) => this.conditionSelectHandler(val);
585
592
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "3.0.14",
3
+ "version": "3.0.15",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",