haya-select 1.0.0 → 1.0.1

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.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/config.js ADDED
@@ -0,0 +1,15 @@
1
+ class HayaSelectConfiguration {
2
+ getBodyPortal() {
3
+ if (!this._bodyPortal) throw new Error("bodyPortal wasn't set")
4
+
5
+ return this._bodyPortal
6
+ }
7
+
8
+ setBodyPortal(newBodyPortal) {
9
+ this._bodyPortal = newBodyPortal
10
+ }
11
+ }
12
+
13
+ const configuration = new HayaSelectConfiguration()
14
+
15
+ export default configuration
@@ -1,6 +1,6 @@
1
1
  import "./style"
2
- import BodyPortal from "components/layout/body-portal"
3
2
  import classNames from "classnames"
3
+ import config from "../config.js"
4
4
  import {digg, digs} from "diggerize"
5
5
  import debounce from "debounce"
6
6
  import {idForComponent, nameForComponent} from "@kaspernj/api-maker-inputs"
@@ -100,6 +100,7 @@ export default class CustomSelect extends React.PureComponent {
100
100
  const {endOfSelectRef} = digs(this, "endOfSelectRef")
101
101
  const {attribute, className, defaultValues, model, multiple, onChange, options, search, ...restProps} = this.props
102
102
  const {currentOptions, opened} = digs(this.state, "currentOptions", "opened")
103
+ const BodyPortal = config.getBodyPortal()
103
104
 
104
105
  return (
105
106
  <div
@@ -121,7 +122,7 @@ export default class CustomSelect extends React.PureComponent {
121
122
  <input
122
123
  className="custom-select-search-text-input"
123
124
  onChange={digg(this, "onSearchTextInputChangedDebounced")}
124
- placeholder={I18n.t("js.components.custom_select.search_dot_dot_dot")} type="text"
125
+ placeholder={I18n.t("haya_select.search_dot_dot_dot")} type="text"
125
126
  ref={digg(this, "searchTextInputRef")}
126
127
  />
127
128
  }
@@ -129,7 +130,7 @@ export default class CustomSelect extends React.PureComponent {
129
130
  <>
130
131
  {currentOptions.length == 0 &&
131
132
  <div style={{color: "grey"}}>
132
- {I18n.t("js.components.custom_select.nothing_selected")}
133
+ {I18n.t("haya_select.nothing_selected")}
133
134
  </div>
134
135
  }
135
136
  {currentOptions.map((currentOption) =>
@@ -286,7 +287,7 @@ export default class CustomSelect extends React.PureComponent {
286
287
  )}
287
288
  {loadedOptions?.length === 0 &&
288
289
  <div className="custom-select-no-options-container">
289
- {I18n.t("js.components.custom_select.no_options_found")}
290
+ {I18n.t("haya_select.no_options_found")}
290
291
  </div>
291
292
  }
292
293
  </div>
@@ -29,6 +29,7 @@
29
29
 
30
30
  .custom-select-option {
31
31
  padding: 4px 8px;
32
+ color: #000;
32
33
 
33
34
  &[data-selected="true"] {
34
35
  background-color: #80b2ff;