@wavelengthusaf/components 1.1.4 → 1.1.6

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.mjs CHANGED
@@ -40,6 +40,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
40
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
41
41
  mod
42
42
  ));
43
+ var __async = (__this, __arguments, generator) => {
44
+ return new Promise((resolve, reject) => {
45
+ var fulfilled = (value) => {
46
+ try {
47
+ step(generator.next(value));
48
+ } catch (e) {
49
+ reject(e);
50
+ }
51
+ };
52
+ var rejected = (value) => {
53
+ try {
54
+ step(generator.throw(value));
55
+ } catch (e) {
56
+ reject(e);
57
+ }
58
+ };
59
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
60
+ step((generator = generator.apply(__this, __arguments)).next());
61
+ });
62
+ };
43
63
 
44
64
  // node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
45
65
  var require_react_is_production_min = __commonJS({
@@ -3368,12 +3388,43 @@ function WavelengthExampleComponent({ width: width2 = 100, height: height2 = 100
3368
3388
 
3369
3389
  // src/components/search/WavelengthSearch.tsx
3370
3390
  import React9, { useState as useState2 } from "react";
3371
- import { Autocomplete as Autocomplete2, ListItemText } from "@mui/material";
3391
+ import { Autocomplete as Autocomplete2, ListItemText, Popper } from "@mui/material";
3372
3392
  import TextField2 from "@mui/material/TextField";
3373
3393
  import InputAdornment from "@mui/material/InputAdornment";
3374
3394
  import IconButton from "@mui/material/IconButton";
3375
3395
  import { useRef } from "react";
3376
3396
  import ListItem from "@mui/material/ListItem";
3397
+ var CustomPopper = (props) => {
3398
+ return /* @__PURE__ */ React9.createElement(
3399
+ Popper,
3400
+ __spreadProps(__spreadValues({}, props), {
3401
+ placement: "right-start",
3402
+ disablePortal: false,
3403
+ modifiers: [
3404
+ {
3405
+ name: "flip",
3406
+ enabled: true,
3407
+ options: {
3408
+ altBoundary: true,
3409
+ rootBoundary: "document",
3410
+ padding: 8
3411
+ }
3412
+ },
3413
+ {
3414
+ name: "preventOverflow",
3415
+ enabled: true,
3416
+ options: {
3417
+ altAxis: true,
3418
+ altBoundary: true,
3419
+ tether: false,
3420
+ rootBoundary: "document",
3421
+ padding: 8
3422
+ }
3423
+ }
3424
+ ]
3425
+ })
3426
+ );
3427
+ };
3377
3428
  function WavelengthSearch({
3378
3429
  id,
3379
3430
  mode,
@@ -3401,7 +3452,9 @@ function WavelengthSearch({
3401
3452
  {
3402
3453
  filterOptions: (x) => x,
3403
3454
  loading: true,
3455
+ disableListWrap: true,
3404
3456
  freeSolo: true,
3457
+ disablePortal: true,
3405
3458
  onChange: (e, value) => {
3406
3459
  if (value != null) {
3407
3460
  if (typeof value == "string") {
@@ -3453,15 +3506,16 @@ function WavelengthSearch({
3453
3506
  }
3454
3507
  },
3455
3508
  label,
3456
- onChange: (e) => {
3509
+ onChange: (e) => __async(this, null, function* () {
3457
3510
  if (searchFunction) {
3458
- const response = searchFunction(e.target.value);
3511
+ const response = yield searchFunction(e.target.value);
3459
3512
  console.log(response);
3460
- setResults(response);
3513
+ yield setResults(response);
3461
3514
  }
3462
- }
3515
+ })
3463
3516
  })
3464
- )
3517
+ ),
3518
+ PopperComponent: CustomPopper
3465
3519
  }
3466
3520
  ));
3467
3521
  } else if (mode == "manual") {
@@ -3587,7 +3641,7 @@ import React11, { useState as useState3 } from "react";
3587
3641
  import { Box, List, ListItem as ListItem2, Typography, Collapse } from "@mui/material";
3588
3642
  import { KeyboardArrowDownRounded, KeyboardArrowRightRounded } from "@mui/icons-material";
3589
3643
  import { useNavigate } from "react-router-dom";
3590
- function WavelengthSideBar({ sections, txtColor, bgColor, labelColor, arrowColor, marginTop, marginLeft, width: width2 = 243, height: height2 = 300 }) {
3644
+ function WavelengthSideBar({ sections, txtColor, bgColor, labelColor, arrowColor, marginTop, marginLeft, width: width2 = "fit-content", height: height2 = 300 }) {
3591
3645
  const [openSections, setOpenSections] = useState3({});
3592
3646
  const navigate = useNavigate();
3593
3647
  const palette2 = getPalette();
@@ -3610,7 +3664,8 @@ function WavelengthSideBar({ sections, txtColor, bgColor, labelColor, arrowColor
3610
3664
  marginBottom: 5,
3611
3665
  marginTop,
3612
3666
  marginLeft,
3613
- borderRadius: "12px"
3667
+ borderRadius: "12px",
3668
+ position: "relative"
3614
3669
  }
3615
3670
  },
3616
3671
  /* @__PURE__ */ React11.createElement(List, { component: "nav" }, sections.map((section, index) => {