@wavelengthusaf/components 1.1.9 → 1.2.0
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/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3400,7 +3400,7 @@ var CustomPopper = (props) => {
|
|
|
3400
3400
|
name: "preventOverflow",
|
|
3401
3401
|
enabled: true,
|
|
3402
3402
|
options: {
|
|
3403
|
-
altAxis:
|
|
3403
|
+
altAxis: false,
|
|
3404
3404
|
altBoundary: true,
|
|
3405
3405
|
tether: true,
|
|
3406
3406
|
rootBoundary: "document",
|
|
@@ -3422,6 +3422,7 @@ function WavelengthSearch({
|
|
|
3422
3422
|
borderRadius: borderRadius2,
|
|
3423
3423
|
children,
|
|
3424
3424
|
placeholder,
|
|
3425
|
+
onEnter,
|
|
3425
3426
|
onSearchItemSelected,
|
|
3426
3427
|
options,
|
|
3427
3428
|
onChange,
|
|
@@ -3434,9 +3435,6 @@ function WavelengthSearch({
|
|
|
3434
3435
|
const palette2 = getPalette();
|
|
3435
3436
|
borderColor2 = borderColor2 ? borderColor2 : "#2D3140";
|
|
3436
3437
|
hoverColor = hoverColor ? hoverColor : palette2.primary;
|
|
3437
|
-
const onChangeHandler = () => {
|
|
3438
|
-
onChange;
|
|
3439
|
-
};
|
|
3440
3438
|
if (type == "search-bar" || type == void 0) {
|
|
3441
3439
|
if (mode == "automatic") {
|
|
3442
3440
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
@@ -3447,7 +3445,6 @@ function WavelengthSearch({
|
|
|
3447
3445
|
disableListWrap: true,
|
|
3448
3446
|
freeSolo: true,
|
|
3449
3447
|
onChange: (e, value) => {
|
|
3450
|
-
console.log(" AutoComplete value ", value);
|
|
3451
3448
|
if (value != null) {
|
|
3452
3449
|
if (typeof value != "string") {
|
|
3453
3450
|
if (onSearchItemSelected) onSearchItemSelected(value);
|
|
@@ -3507,6 +3504,7 @@ function WavelengthSearch({
|
|
|
3507
3504
|
}
|
|
3508
3505
|
));
|
|
3509
3506
|
} else if (mode == "manual") {
|
|
3507
|
+
const textRef = useRef();
|
|
3510
3508
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
3511
3509
|
Autocomplete2,
|
|
3512
3510
|
{
|
|
@@ -3515,9 +3513,7 @@ function WavelengthSearch({
|
|
|
3515
3513
|
freeSolo: true,
|
|
3516
3514
|
onChange: (e, value) => {
|
|
3517
3515
|
if (value != null) {
|
|
3518
|
-
if (typeof value
|
|
3519
|
-
console.log("String Input, No Selection");
|
|
3520
|
-
} else {
|
|
3516
|
+
if (typeof value !== "string") {
|
|
3521
3517
|
if (onSearchItemSelected) onSearchItemSelected(value);
|
|
3522
3518
|
}
|
|
3523
3519
|
}
|
|
@@ -3536,12 +3532,13 @@ function WavelengthSearch({
|
|
|
3536
3532
|
renderInput: (params) => /* @__PURE__ */ React9.createElement(
|
|
3537
3533
|
TextField2,
|
|
3538
3534
|
__spreadProps(__spreadValues({
|
|
3535
|
+
inputRef: textRef,
|
|
3539
3536
|
placeholder,
|
|
3540
3537
|
onKeyDown: (e) => {
|
|
3541
3538
|
if (e.key == "Enter") {
|
|
3542
|
-
()
|
|
3543
|
-
|
|
3544
|
-
}
|
|
3539
|
+
if (textRef.current && onEnter) {
|
|
3540
|
+
onEnter(textRef.current.value);
|
|
3541
|
+
}
|
|
3545
3542
|
}
|
|
3546
3543
|
}
|
|
3547
3544
|
}, params), {
|
|
@@ -3555,7 +3552,9 @@ function WavelengthSearch({
|
|
|
3555
3552
|
{
|
|
3556
3553
|
sx: { color: textColor },
|
|
3557
3554
|
onClick: () => {
|
|
3558
|
-
|
|
3555
|
+
if (textRef.current && onEnter) {
|
|
3556
|
+
onEnter(textRef.current.value);
|
|
3557
|
+
}
|
|
3559
3558
|
}
|
|
3560
3559
|
},
|
|
3561
3560
|
children
|
|
@@ -3673,8 +3672,8 @@ function WavelengthSearch({
|
|
|
3673
3672
|
}
|
|
3674
3673
|
},
|
|
3675
3674
|
disableCloseOnSelect: false,
|
|
3676
|
-
getOptionLabel: (
|
|
3677
|
-
const returnVal = typeof
|
|
3675
|
+
getOptionLabel: (options2) => {
|
|
3676
|
+
const returnVal = typeof options2 === "string" ? options2 : options2.title;
|
|
3678
3677
|
return returnVal;
|
|
3679
3678
|
},
|
|
3680
3679
|
options,
|
|
@@ -3690,7 +3689,9 @@ function WavelengthSearch({
|
|
|
3690
3689
|
inputRef: textRef,
|
|
3691
3690
|
onKeyDown: (e) => {
|
|
3692
3691
|
if (e.key == "Enter") {
|
|
3693
|
-
|
|
3692
|
+
if (textRef.current && onEnter) {
|
|
3693
|
+
onEnter(textRef.current.value);
|
|
3694
|
+
}
|
|
3694
3695
|
}
|
|
3695
3696
|
}
|
|
3696
3697
|
}, params), {
|