react-ui-basics 0.0.231 → 0.0.232
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/AutocompleteSelect.js +8 -8
- package/AutocompleteSelect.js.map +1 -1
- package/TextField.d.ts +1 -1
- package/TextField.js +1 -0
- package/TextField.js.map +1 -1
- package/bundle.css +617 -617
- package/package.json +1 -1
- package/src/AutocompleteSelect.js +8 -5
- package/src/TextField.tsx +2 -1
package/package.json
CHANGED
|
@@ -410,8 +410,9 @@ class AutocompleteSelect extends PureComponent {
|
|
|
410
410
|
onSelect = (selectedId) => {
|
|
411
411
|
const {mode, required, allowCustom, onSelect, onChange, default: defaultValue} = __props(this);
|
|
412
412
|
const {filterValue, selected: currentSelection} = __state(this);
|
|
413
|
-
const {labels = {}, onFilterInputChange} = __props(this);
|
|
413
|
+
const {labels = {}, onFilterInputChange, withFilter} = __props(this);
|
|
414
414
|
|
|
415
|
+
// debugger
|
|
415
416
|
if (selectedId == null && (!!filterValue || !required) && allowCustom && (!this.input || !this.input.check()))
|
|
416
417
|
selectedId = filterValue.trim();
|
|
417
418
|
|
|
@@ -452,16 +453,16 @@ class AutocompleteSelect extends PureComponent {
|
|
|
452
453
|
customValue = label
|
|
453
454
|
}
|
|
454
455
|
|
|
455
|
-
let
|
|
456
|
+
let nextFilterValue = (!isMultipleSelect(mode) && withFilter && Object.values(selected)[0]) || ''
|
|
456
457
|
this.setState({
|
|
457
458
|
isActive: isActive,
|
|
458
459
|
selected: selected,
|
|
459
|
-
filterValue:
|
|
460
|
+
filterValue: nextFilterValue,
|
|
460
461
|
errored,
|
|
461
462
|
});
|
|
462
463
|
|
|
463
|
-
if (
|
|
464
|
-
orNoop(onFilterInputChange)(
|
|
464
|
+
if (nextFilterValue !== filterValue)
|
|
465
|
+
orNoop(onFilterInputChange)(nextFilterValue)
|
|
465
466
|
|
|
466
467
|
if (isActive && this.input)
|
|
467
468
|
this.input.getInput().focus()
|
|
@@ -504,6 +505,8 @@ class AutocompleteSelect extends PureComponent {
|
|
|
504
505
|
const data = __state(this).data || __props(this).data || []
|
|
505
506
|
if (data.indexOf(value) !== -1) {
|
|
506
507
|
this.list.selected(value)
|
|
508
|
+
} else {
|
|
509
|
+
this.list.reset()
|
|
507
510
|
}
|
|
508
511
|
|
|
509
512
|
__props(this).onFilterInputChange?.(value);
|
package/src/TextField.tsx
CHANGED
|
@@ -13,7 +13,7 @@ export interface TextAreaProps {
|
|
|
13
13
|
autoComplete?: string,
|
|
14
14
|
placeholder?: string,
|
|
15
15
|
label?: string | ReactElement,
|
|
16
|
-
check?: (value: string) => boolean,
|
|
16
|
+
check?: (value: string) => boolean | string | ReactElement,
|
|
17
17
|
onClick?: MouseEventHandler<HTMLInputElement>,
|
|
18
18
|
onMouseUp?: MouseEventHandler<HTMLInputElement>,
|
|
19
19
|
onKeyDown?: KeyboardEventHandler<HTMLInputElement>,
|
|
@@ -55,6 +55,7 @@ class TextField extends AbstractTextField {
|
|
|
55
55
|
const {required, check} = props();
|
|
56
56
|
const value = inputRef().value;
|
|
57
57
|
const error = (required && value === '') || (check && check(value));
|
|
58
|
+
debugger
|
|
58
59
|
errorState() !== error && setTimeout(errorState, 0, error);
|
|
59
60
|
return error;
|
|
60
61
|
};
|