haya-select 1.0.9 → 1.0.12
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 +1 -1
- package/src/select/index.jsx +6 -4
package/package.json
CHANGED
package/src/select/index.jsx
CHANGED
|
@@ -3,7 +3,9 @@ import classNames from "classnames"
|
|
|
3
3
|
import config from "../config.js"
|
|
4
4
|
import {digg, digs} from "diggerize"
|
|
5
5
|
import debounce from "debounce"
|
|
6
|
-
import
|
|
6
|
+
import EventListener from "@kaspernj/api-maker/src/event-listener"
|
|
7
|
+
import idForComponent from "@kaspernj/api-maker-inputs/src/id-for-component.mjs"
|
|
8
|
+
import nameForComponent from "@kaspernj/api-maker-inputs/src/id-for-component.mjs"
|
|
7
9
|
import PropTypes from "prop-types"
|
|
8
10
|
|
|
9
11
|
const nameForComponentWithMultiple = (component) => {
|
|
@@ -399,14 +401,14 @@ export default class HayaSelect extends React.PureComponent {
|
|
|
399
401
|
}
|
|
400
402
|
|
|
401
403
|
presentOption = (currentValue) => {
|
|
402
|
-
const {toggleOptions} = this.props
|
|
404
|
+
const {toggleOptions} = this.props || {}
|
|
403
405
|
const {toggled} = digs(this.state, "toggled")
|
|
404
406
|
|
|
405
407
|
return (
|
|
406
408
|
<div
|
|
407
409
|
className="haya-select-option-presentation"
|
|
408
|
-
data-toggle-icon={toggleOptions[toggled[currentValue.value]]?.icon}
|
|
409
|
-
data-toggle-value={toggleOptions[toggled[currentValue.value]]?.value}
|
|
410
|
+
data-toggle-icon={toggleOptions && toggled && toggleOptions[toggled[currentValue.value]]?.icon}
|
|
411
|
+
data-toggle-value={toggleOptions && toggled && toggleOptions[toggled[currentValue.value]]?.value}
|
|
410
412
|
data-value={currentValue.value}
|
|
411
413
|
>
|
|
412
414
|
{toggleOptions && !(currentValue.value in toggled) &&
|