@pinuts/bsr-uikit-relaunch 0.2.19 → 0.2.21

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.
@@ -17,6 +17,7 @@ declare namespace BSRAutocompleteField {
17
17
  labelText: PropTypes.Requireable<string>;
18
18
  viewMode: PropTypes.Requireable<boolean>;
19
19
  disabled: PropTypes.Requireable<boolean>;
20
+ suggestionsAmount: PropTypes.Requireable<number>;
20
21
  }>>>;
21
22
  }
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BSRAutocompleteField.d.ts","sourceRoot":"","sources":["../../../src/items/BSRAddressSelector/BSRAutocompleteField.jsx"],"names":[],"mappings":";AA8CA;;QA2QC;;;;;;;;;;;;;;;;;;;sBAzTqB,YAAY"}
1
+ {"version":3,"file":"BSRAutocompleteField.d.ts","sourceRoot":"","sources":["../../../src/items/BSRAddressSelector/BSRAutocompleteField.jsx"],"names":[],"mappings":";AA8CA;;QAkRC;;;;;;;;;;;;;;;;;;;;sBAhUqB,YAAY"}
@@ -54,7 +54,8 @@ const BSRAutocompleteField = _ref => {
54
54
  viewMode,
55
55
  labelText,
56
56
  disabled,
57
- readOnly
57
+ readOnly,
58
+ suggestionsAmount = undefined
58
59
  } = config;
59
60
  const {
60
61
  prevSelection,
@@ -100,15 +101,20 @@ const BSRAutocompleteField = _ref => {
100
101
  if (mountedRef) {
101
102
  const loadData = async () => {
102
103
  const searchQuery = selectedOptionId || searchInput;
103
- const url = `${controllerPath}streetNames/?searchQuery=${encodeURIComponent(searchQuery)}`;
104
- try {
105
- const dataArr = await fetchOptions(url);
106
- // Nur State verändern, wenn Komponente gemounted ist
107
- if (mountedRef && dataArr) {
108
- setFetchedOptions(dataArr);
104
+ if (searchQuery.length > 2) {
105
+ const url = `${controllerPath}streetNames/?searchQuery=${encodeURIComponent(searchQuery)}`;
106
+ try {
107
+ const dataArr = await fetchOptions(url);
108
+ // Nur State verändern, wenn Komponente gemounted ist
109
+ if (mountedRef && dataArr) {
110
+ if (suggestionsAmount && dataArr.length > suggestionsAmount) {
111
+ dataArr.length = suggestionsAmount;
112
+ }
113
+ setFetchedOptions(dataArr);
114
+ }
115
+ } catch (error) {
116
+ console.error(error);
109
117
  }
110
- } catch (error) {
111
- console.error(error);
112
118
  }
113
119
  };
114
120
  if (debounceTimeout) {
@@ -180,10 +186,8 @@ const BSRAutocompleteField = _ref => {
180
186
  }
181
187
  }, 50);
182
188
  }, [key, setFieldValue, labelFieldKey, groupKey, setSelectedOptionId, setPrevSelection]);
183
- const className = (0, _react.useMemo)(() => [_BSRAddressSelectorModule.default.comboboxWrapper, 'ariakit-combobox', 'form-control px-2 py-1', isFocused && 'focused', isInvalid && 'is-invalid'].filter(Boolean).join(' '), [isFocused, isInvalid]);
184
- const formControlClassNames = (0, _index.getFormControlClassNames)(disabled, readOnly, disabled, 'w-75',
185
- // 'combobox w-75',
186
- ['input', field.className].filter(Boolean));
189
+ const className = (0, _react.useMemo)(() => [_BSRAddressSelectorModule.default.comboboxWrapper, _BSRAddressSelectorModule.default.formControl, _BSRAddressSelectorModule.default.ariakitCombobox, 'ariakit-combobox', 'form-control py-1 px-0', isFocused && 'focused', isInvalid && 'is-invalid'].filter(Boolean).join(' '), [isFocused, isInvalid]);
190
+ const formControlClassNames = (0, _index.getFormControlClassNames)(disabled, readOnly, disabled, ['input', field.className].filter(Boolean));
187
191
  const getPreviousSelectedItem = (0, _react.useCallback)(() => {
188
192
  return prevSelection?.value ? prevSelection.value : field.value;
189
193
  }, [prevSelection, field.value]);
@@ -259,7 +263,8 @@ BSRAutocompleteField.propTypes = {
259
263
  readOnly: _propTypes.default.bool,
260
264
  labelText: _propTypes.default.string,
261
265
  viewMode: _propTypes.default.bool,
262
- disabled: _propTypes.default.bool
266
+ disabled: _propTypes.default.bool,
267
+ suggestionsAmount: _propTypes.default.number
263
268
  }).isRequired
264
269
  };
265
270
  const HigherOrderAutocompleteField = (0, _withFieldGroup.default)(BSRAutocompleteField);
@@ -107,7 +107,7 @@ const NumberInputField = _ref => {
107
107
  stroke: "white",
108
108
  fill: "white"
109
109
  })), /*#__PURE__*/_react.default.createElement("input", _extends({
110
- className: getClassNames(['input mx-2 ps-4', formControlClassNames]),
110
+ className: getClassNames(['input ps-3', formControlClassNames]),
111
111
  type: "number",
112
112
  step: step
113
113
  }, field, ariaAttributes, inputProps, {
@@ -105,16 +105,13 @@
105
105
 
106
106
  div[role="listbox"] {
107
107
  overflow-x: hidden;
108
- // border-radius: $border-radius;
109
108
  background: $bsr-white-100;
110
109
  border-top-left-radius: 0;
111
110
  border-top-right-radius: 0;
112
111
  border-top: none;
113
- // border-color: currentColor;
114
- //max-height: min(var(--popover-available-height, $popover-max-height), $popover-max-height);
115
- //max-height: $popover-max-height;
116
- padding: 0.3rem;
117
- transform: translatey(0.6rem) translatex(-1rem);
112
+ padding-inline: 0;
113
+ padding-block: 4px;
114
+ transform: translateY(0.6rem);
118
115
 
119
116
  div[role="option"] {
120
117
  font-weight: $fontweight-normal;
@@ -138,17 +135,13 @@
138
135
  }
139
136
 
140
137
  &[aria-selected="true"].selected {
141
- background-color: $primary !important;
142
- color: $white;
138
+ background-color: $bsr-black-30 !important;
139
+ color: $bsr-black-90;
143
140
  }
144
141
  &.selected {
145
142
  box-shadow: none;
146
- background-color: $primary !important;
147
- color: $white;
148
-
149
- &:hover {
150
- color: $white !important;
151
- }
143
+ background-color: $bsr-black-30 !important;
144
+ color: $bsr-black-90;
152
145
  }
153
146
  }
154
147
  }
@@ -258,7 +251,7 @@
258
251
 
259
252
  &:focus,
260
253
  &:hover {
261
- background-color: $bsr-black-30;
254
+ background-color: $bsr-black-10;
262
255
  color: $bsr-black-90;
263
256
  cursor: pointer;
264
257
  }
@@ -252,6 +252,15 @@ fieldset.formInput {
252
252
  }
253
253
  }
254
254
 
255
+ #addressSelector .row .col div.form-control.ariakit-combobox {
256
+ padding: $base-gap * 2 0 $base-gap * 3 0 !important;
257
+
258
+ input[role="combobox"] {
259
+ padding-inline: $base-gap * 4 !important;
260
+ width: 100% !important;
261
+ }
262
+ }
263
+
255
264
  /* RADIO INPUT */
256
265
  input[type="radio"] {
257
266
  display: flex;
@@ -489,7 +498,6 @@ form input[type="checkbox"] + label:before {
489
498
  &:focus {
490
499
  &:is(button):not(.disabled) {
491
500
  background-color: $secondary;
492
- color: $text-light;
493
501
 
494
502
  .closeBtn {
495
503
  color: $text-light;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinuts/bsr-uikit-relaunch",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "private": false,
5
5
  "description": "BSR UI-KIT Relaunch",
6
6
  "main": "dist/index.js",