@wavelengthusaf/components 1.2.0 → 1.2.2
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 +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +160 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +160 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3430,13 +3430,14 @@ function WavelengthSearch({
|
|
|
3430
3430
|
hoverColor,
|
|
3431
3431
|
textColor,
|
|
3432
3432
|
fontSize,
|
|
3433
|
-
backgroundColor: backgroundColor2
|
|
3433
|
+
backgroundColor: backgroundColor2,
|
|
3434
|
+
iconPos = "end"
|
|
3434
3435
|
}) {
|
|
3435
3436
|
const palette2 = getPalette();
|
|
3436
3437
|
borderColor2 = borderColor2 ? borderColor2 : "#2D3140";
|
|
3437
3438
|
hoverColor = hoverColor ? hoverColor : palette2.primary;
|
|
3438
3439
|
if (type == "search-bar" || type == void 0) {
|
|
3439
|
-
if (mode == "automatic") {
|
|
3440
|
+
if (mode == "automatic" && iconPos == "end") {
|
|
3440
3441
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
3441
3442
|
Autocomplete2,
|
|
3442
3443
|
{
|
|
@@ -3503,7 +3504,74 @@ function WavelengthSearch({
|
|
|
3503
3504
|
PopperComponent: CustomPopper
|
|
3504
3505
|
}
|
|
3505
3506
|
));
|
|
3506
|
-
} else if (mode == "
|
|
3507
|
+
} else if (mode == "automatic" && iconPos == "start") {
|
|
3508
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
3509
|
+
Autocomplete2,
|
|
3510
|
+
{
|
|
3511
|
+
filterOptions: (x) => x,
|
|
3512
|
+
loading: true,
|
|
3513
|
+
disableListWrap: true,
|
|
3514
|
+
freeSolo: true,
|
|
3515
|
+
onChange: (e, value) => {
|
|
3516
|
+
if (value != null) {
|
|
3517
|
+
if (typeof value != "string") {
|
|
3518
|
+
if (onSearchItemSelected) onSearchItemSelected(value);
|
|
3519
|
+
}
|
|
3520
|
+
}
|
|
3521
|
+
},
|
|
3522
|
+
disableCloseOnSelect: false,
|
|
3523
|
+
getOptionLabel: (options2) => {
|
|
3524
|
+
const returnVal = typeof options2 === "string" ? options2 : options2.title;
|
|
3525
|
+
return returnVal;
|
|
3526
|
+
},
|
|
3527
|
+
options,
|
|
3528
|
+
sx: { width: width2 },
|
|
3529
|
+
renderOption: (props, results) => (
|
|
3530
|
+
// @ts-expect-error boneless chicken
|
|
3531
|
+
/* @__PURE__ */ React9.createElement(ListItem, __spreadValues({ key: results.id }, props), /* @__PURE__ */ React9.createElement(ListItemText, { primary: results.title, secondary: results.subtitle }))
|
|
3532
|
+
),
|
|
3533
|
+
renderInput: (params) => /* @__PURE__ */ React9.createElement(
|
|
3534
|
+
TextField2,
|
|
3535
|
+
__spreadProps(__spreadValues({
|
|
3536
|
+
placeholder
|
|
3537
|
+
}, params), {
|
|
3538
|
+
id,
|
|
3539
|
+
size,
|
|
3540
|
+
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
3541
|
+
style: { borderRadius: borderRadius2, color: textColor, backgroundColor: backgroundColor2, height: height2, fontSize },
|
|
3542
|
+
type: "search",
|
|
3543
|
+
startAdornment: /* @__PURE__ */ React9.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React9.createElement(IconButton, { sx: { color: textColor, paddingRight: "0px" } }, children))
|
|
3544
|
+
}),
|
|
3545
|
+
sx: {
|
|
3546
|
+
"& .MuiInputBase-root": {
|
|
3547
|
+
height: height2
|
|
3548
|
+
},
|
|
3549
|
+
"&.MuiTextField-root": {
|
|
3550
|
+
"& label": { color: `${textColor}` },
|
|
3551
|
+
"& label.Mui-focused": {
|
|
3552
|
+
color: `${hoverColor}`
|
|
3553
|
+
},
|
|
3554
|
+
"& .MuiOutlinedInput-root": {
|
|
3555
|
+
"& fieldset": {
|
|
3556
|
+
borderColor: `${borderColor2}`
|
|
3557
|
+
},
|
|
3558
|
+
"&:hover fieldset": {
|
|
3559
|
+
borderColor: `${hoverColor}`
|
|
3560
|
+
},
|
|
3561
|
+
"&.Mui-focused fieldset": {
|
|
3562
|
+
borderColor: `${hoverColor}`
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
},
|
|
3567
|
+
label,
|
|
3568
|
+
onChange
|
|
3569
|
+
})
|
|
3570
|
+
),
|
|
3571
|
+
PopperComponent: CustomPopper
|
|
3572
|
+
}
|
|
3573
|
+
));
|
|
3574
|
+
} else if (mode == "manual" && iconPos == "end") {
|
|
3507
3575
|
const textRef = useRef();
|
|
3508
3576
|
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
3509
3577
|
Autocomplete2,
|
|
@@ -3587,6 +3655,90 @@ function WavelengthSearch({
|
|
|
3587
3655
|
)
|
|
3588
3656
|
}
|
|
3589
3657
|
));
|
|
3658
|
+
} else if (mode == "manual" && iconPos == "start") {
|
|
3659
|
+
const textRef = useRef();
|
|
3660
|
+
return /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(
|
|
3661
|
+
Autocomplete2,
|
|
3662
|
+
{
|
|
3663
|
+
filterOptions: (x) => x,
|
|
3664
|
+
loading: true,
|
|
3665
|
+
freeSolo: true,
|
|
3666
|
+
onChange: (e, value) => {
|
|
3667
|
+
if (value != null) {
|
|
3668
|
+
if (typeof value !== "string") {
|
|
3669
|
+
if (onSearchItemSelected) onSearchItemSelected(value);
|
|
3670
|
+
}
|
|
3671
|
+
}
|
|
3672
|
+
},
|
|
3673
|
+
disableCloseOnSelect: false,
|
|
3674
|
+
getOptionLabel: (options2) => {
|
|
3675
|
+
const returnVal = typeof options2 === "string" ? options2 : options2.title;
|
|
3676
|
+
return returnVal;
|
|
3677
|
+
},
|
|
3678
|
+
options,
|
|
3679
|
+
sx: { width: width2 },
|
|
3680
|
+
renderOption: (props, options2) => (
|
|
3681
|
+
// @ts-expect-error boneless chicken
|
|
3682
|
+
/* @__PURE__ */ React9.createElement(ListItem, __spreadValues({ key: options2.id }, props), /* @__PURE__ */ React9.createElement(ListItemText, { primary: options2.title, secondary: options2.subtitle }))
|
|
3683
|
+
),
|
|
3684
|
+
renderInput: (params) => /* @__PURE__ */ React9.createElement(
|
|
3685
|
+
TextField2,
|
|
3686
|
+
__spreadProps(__spreadValues({
|
|
3687
|
+
inputRef: textRef,
|
|
3688
|
+
placeholder,
|
|
3689
|
+
onKeyDown: (e) => {
|
|
3690
|
+
if (e.key == "Enter") {
|
|
3691
|
+
if (textRef.current && onEnter) {
|
|
3692
|
+
onEnter(textRef.current.value);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
}
|
|
3696
|
+
}, params), {
|
|
3697
|
+
id,
|
|
3698
|
+
size,
|
|
3699
|
+
InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
|
|
3700
|
+
style: { borderRadius: borderRadius2, color: textColor, fontSize },
|
|
3701
|
+
type: "search",
|
|
3702
|
+
startAdornment: /* @__PURE__ */ React9.createElement(InputAdornment, { position: "start" }, /* @__PURE__ */ React9.createElement(
|
|
3703
|
+
IconButton,
|
|
3704
|
+
{
|
|
3705
|
+
sx: { color: textColor, paddingRight: "0px" },
|
|
3706
|
+
onClick: () => {
|
|
3707
|
+
if (textRef.current && onEnter) {
|
|
3708
|
+
onEnter(textRef.current.value);
|
|
3709
|
+
}
|
|
3710
|
+
}
|
|
3711
|
+
},
|
|
3712
|
+
children
|
|
3713
|
+
))
|
|
3714
|
+
}),
|
|
3715
|
+
sx: {
|
|
3716
|
+
"& .MuiInputBase-root": {
|
|
3717
|
+
height: height2
|
|
3718
|
+
},
|
|
3719
|
+
"&.MuiTextField-root": {
|
|
3720
|
+
"& label": { color: `${textColor}`, verticalAlign: "bottom" },
|
|
3721
|
+
"& label.Mui-focused": {
|
|
3722
|
+
color: `${hoverColor}`
|
|
3723
|
+
},
|
|
3724
|
+
"& .MuiOutlinedInput-root": {
|
|
3725
|
+
"& fieldset": {
|
|
3726
|
+
borderColor: `${borderColor2}`
|
|
3727
|
+
},
|
|
3728
|
+
"&:hover fieldset": {
|
|
3729
|
+
borderColor: `${hoverColor}`
|
|
3730
|
+
},
|
|
3731
|
+
"&.Mui-focused fieldset": {
|
|
3732
|
+
borderColor: `${hoverColor}`
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
},
|
|
3737
|
+
label
|
|
3738
|
+
})
|
|
3739
|
+
)
|
|
3740
|
+
}
|
|
3741
|
+
));
|
|
3590
3742
|
}
|
|
3591
3743
|
} else if (type == "text-box") {
|
|
3592
3744
|
if (mode == "automatic") {
|
|
@@ -4843,8 +4995,10 @@ import Snackbar2 from "@mui/material/Snackbar";
|
|
|
4843
4995
|
import IconButton5 from "@mui/material/IconButton";
|
|
4844
4996
|
import CloseIcon3 from "@mui/icons-material/Close";
|
|
4845
4997
|
import SnackbarContent2 from "@mui/material/SnackbarContent";
|
|
4846
|
-
|
|
4847
|
-
|
|
4998
|
+
var WavelengthStandardSnackbar = (props) => {
|
|
4999
|
+
console.log(props.show);
|
|
5000
|
+
const show = props.show;
|
|
5001
|
+
const setShow = props.setShow;
|
|
4848
5002
|
const handleClose = () => {
|
|
4849
5003
|
setShow(false);
|
|
4850
5004
|
};
|
|
@@ -4894,7 +5048,7 @@ function WavelengthStandardSnackbar(props) {
|
|
|
4894
5048
|
}
|
|
4895
5049
|
)
|
|
4896
5050
|
);
|
|
4897
|
-
}
|
|
5051
|
+
};
|
|
4898
5052
|
export {
|
|
4899
5053
|
AceOfSpadesComponent,
|
|
4900
5054
|
AppLogo,
|