haya-select 1.0.55 → 1.0.56

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "haya-select",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -145,9 +145,9 @@ export default memo(shapeComponent(class HayaSelect extends ShapeComponent {
145
145
  getValues = () => ("values" in this.props) ? this.p.values : this.s.currentOptions.map((currentOption) => currentOption.value)
146
146
  getCurrentOptions = () => {
147
147
  if ("values" in this.props && typeof this.props.values != "undefined") {
148
- if (Array.isArray(this.props.options) && this.props.values) {
148
+ if (Array.isArray(this.props.options)) {
149
149
  return this.p.values.map((value) => this.p.options.find((option) => option.value == value))
150
- } else if (this.s.loadedOptions && this.props.values) {
150
+ } else if (this.s.loadedOptions) {
151
151
  return this.p.values.map((value) => {
152
152
  let foundOption = this.s.loadedOptions.find((option) => option.value == value)
153
153
 
@@ -164,9 +164,9 @@ export default memo(shapeComponent(class HayaSelect extends ShapeComponent {
164
164
 
165
165
  return foundOption
166
166
  })
167
- } else if (this.props.options == "function" && this.props.values) {
167
+ } else if (typeof this.props.options == "function") {
168
168
  this.setCurrentFromGivenValues()
169
- } else if (this.props.values) {
169
+ } else {
170
170
  return this.p.values.map((value) => ({value}))
171
171
  }
172
172
  }