haya-select 1.0.3 → 1.0.6

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.3",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -15,15 +15,15 @@ const nameForComponentWithMultiple = (component) => {
15
15
  }
16
16
 
17
17
  const presentOption = (currentValue) => {
18
- if (currentValue.text) return currentValue.text
18
+ if ("text" in currentValue) return currentValue.text
19
19
 
20
- if (currentValue.html) {
20
+ if ("html" in currentValue) {
21
21
  return (
22
22
  <div dangerouslySetInnerHTML={{__html: digg(currentValue, "html")}} />
23
23
  )
24
24
  }
25
25
 
26
- throw new Error("Couldn't figure out how to present option")
26
+ throw new Error(`Couldn't figure out how to present option from the given keys: ${Object.keys(currentValue, ", ")}`)
27
27
  }
28
28
 
29
29
  const LoadedOption = class LoadedOption extends BaseComponent {
@@ -172,15 +172,11 @@ export default class CustomSelect extends React.PureComponent {
172
172
  defaultValues () {
173
173
  const {attribute, defaultValuesFromOptions, model} = this.props
174
174
 
175
- console.log("defaultValues")
176
-
177
175
  if (defaultValuesFromOptions) return defaultValuesFromOptions
178
176
 
179
177
  if (attribute && model) {
180
178
  if (!(attribute in model)) throw new Error(`No such attribute on ${model.modelClassData().name}: ${attribute}`)
181
179
 
182
- console.log(`Default value from ${attribute}: ${model[attribute]()}`)
183
-
184
180
  return model[attribute]()
185
181
  }
186
182
  }