@wavelengthusaf/components 1.1.6 → 1.1.8

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 CHANGED
@@ -119,17 +119,21 @@ interface SearchProps {
119
119
  borderRadius?: number | string;
120
120
  label?: string;
121
121
  width?: string;
122
- height?: string;
122
+ height?: string | number;
123
123
  children?: ReactNode;
124
124
  borderColor?: string;
125
125
  hoverColor?: string;
126
126
  textColor?: string;
127
127
  backgroundColor?: string;
128
128
  placeholder?: string;
129
+ size?: "small" | "medium";
130
+ fontSize?: string;
131
+ options: SearchResult[];
132
+ onChange?: React__default.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
129
133
  searchFunction: (value: string) => SearchResult[];
130
134
  onSearchItemSelected: (selectedItem: SearchResult | string) => void;
131
135
  }
132
- declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
136
+ declare function WavelengthSearch({ id, mode, width, height, label, size, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, options, onChange, borderColor, hoverColor, textColor, fontSize, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
133
137
 
134
138
  declare function SearchTextField(): React__default.JSX.Element;
135
139
 
package/dist/index.d.ts CHANGED
@@ -119,17 +119,21 @@ interface SearchProps {
119
119
  borderRadius?: number | string;
120
120
  label?: string;
121
121
  width?: string;
122
- height?: string;
122
+ height?: string | number;
123
123
  children?: ReactNode;
124
124
  borderColor?: string;
125
125
  hoverColor?: string;
126
126
  textColor?: string;
127
127
  backgroundColor?: string;
128
128
  placeholder?: string;
129
+ size?: "small" | "medium";
130
+ fontSize?: string;
131
+ options: SearchResult[];
132
+ onChange?: React__default.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
129
133
  searchFunction: (value: string) => SearchResult[];
130
134
  onSearchItemSelected: (selectedItem: SearchResult | string) => void;
131
135
  }
132
- declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
136
+ declare function WavelengthSearch({ id, mode, width, height, label, size, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, options, onChange, borderColor, hoverColor, textColor, fontSize, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
133
137
 
134
138
  declare function SearchTextField(): React__default.JSX.Element;
135
139
 
package/dist/index.js CHANGED
@@ -46,26 +46,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
46
46
  mod
47
47
  ));
48
48
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
49
- var __async = (__this, __arguments, generator) => {
50
- return new Promise((resolve, reject) => {
51
- var fulfilled = (value) => {
52
- try {
53
- step(generator.next(value));
54
- } catch (e) {
55
- reject(e);
56
- }
57
- };
58
- var rejected = (value) => {
59
- try {
60
- step(generator.throw(value));
61
- } catch (e) {
62
- reject(e);
63
- }
64
- };
65
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
66
- step((generator = generator.apply(__this, __arguments)).next());
67
- });
68
- };
69
49
 
70
50
  // node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
71
51
  var require_react_is_production_min = __commonJS({
@@ -3447,9 +3427,15 @@ var import_ListItem = __toESM(require("@mui/material/ListItem"));
3447
3427
  var CustomPopper = (props) => {
3448
3428
  return /* @__PURE__ */ import_react12.default.createElement(
3449
3429
  import_material5.Popper,
3450
- __spreadProps(__spreadValues({}, props), {
3451
- placement: "right-start",
3452
- disablePortal: false,
3430
+ __spreadProps(__spreadValues({
3431
+ sx: {
3432
+ "&.MuiAutocomplete-popper": {
3433
+ zIndex: 5
3434
+ }
3435
+ }
3436
+ }, props), {
3437
+ placement: "bottom",
3438
+ disablePortal: true,
3453
3439
  modifiers: [
3454
3440
  {
3455
3441
  name: "flip",
@@ -3466,7 +3452,7 @@ var CustomPopper = (props) => {
3466
3452
  options: {
3467
3453
  altAxis: true,
3468
3454
  altBoundary: true,
3469
- tether: false,
3455
+ tether: true,
3470
3456
  rootBoundary: "document",
3471
3457
  padding: 8
3472
3458
  }
@@ -3481,14 +3467,18 @@ function WavelengthSearch({
3481
3467
  width: width2,
3482
3468
  height: height2,
3483
3469
  label,
3470
+ size,
3484
3471
  borderRadius: borderRadius2,
3485
3472
  children,
3486
3473
  placeholder,
3487
3474
  searchFunction,
3488
3475
  onSearchItemSelected,
3476
+ options,
3477
+ onChange,
3489
3478
  borderColor: borderColor2,
3490
3479
  hoverColor,
3491
3480
  textColor,
3481
+ fontSize,
3492
3482
  backgroundColor: backgroundColor2
3493
3483
  }) {
3494
3484
  const palette2 = getPalette();
@@ -3504,8 +3494,8 @@ function WavelengthSearch({
3504
3494
  loading: true,
3505
3495
  disableListWrap: true,
3506
3496
  freeSolo: true,
3507
- disablePortal: true,
3508
3497
  onChange: (e, value) => {
3498
+ console.log(" AutoComplete value ", value);
3509
3499
  if (value != null) {
3510
3500
  if (typeof value == "string") {
3511
3501
  console.log("String Input, No Selection");
@@ -3515,11 +3505,11 @@ function WavelengthSearch({
3515
3505
  }
3516
3506
  },
3517
3507
  disableCloseOnSelect: false,
3518
- getOptionLabel: (results2) => {
3519
- const returnVal = typeof results2 === "string" ? results2 : results2.title;
3508
+ getOptionLabel: (options2) => {
3509
+ const returnVal = typeof options2 === "string" ? options2 : options2.title;
3520
3510
  return returnVal;
3521
3511
  },
3522
- options: results,
3512
+ options,
3523
3513
  sx: { width: width2 },
3524
3514
  renderOption: (props, results2) => (
3525
3515
  // @ts-expect-error boneless chicken
@@ -3531,8 +3521,9 @@ function WavelengthSearch({
3531
3521
  placeholder
3532
3522
  }, params), {
3533
3523
  id,
3524
+ size,
3534
3525
  InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
3535
- style: { borderRadius: borderRadius2, height: height2, color: textColor, backgroundColor: backgroundColor2 },
3526
+ style: { borderRadius: borderRadius2, color: textColor, backgroundColor: backgroundColor2, height: height2, fontSize },
3536
3527
  type: "search",
3537
3528
  endAdornment: /* @__PURE__ */ import_react12.default.createElement(import_InputAdornment.default, { position: "end" }, /* @__PURE__ */ import_react12.default.createElement(import_IconButton.default, { sx: { color: textColor } }, children))
3538
3529
  }),
@@ -3556,13 +3547,7 @@ function WavelengthSearch({
3556
3547
  }
3557
3548
  },
3558
3549
  label,
3559
- onChange: (e) => __async(this, null, function* () {
3560
- if (searchFunction) {
3561
- const response = yield searchFunction(e.target.value);
3562
- console.log(response);
3563
- yield setResults(response);
3564
- }
3565
- })
3550
+ onChange
3566
3551
  })
3567
3552
  ),
3568
3553
  PopperComponent: CustomPopper
@@ -3613,8 +3598,9 @@ function WavelengthSearch({
3613
3598
  }
3614
3599
  }, params), {
3615
3600
  id,
3601
+ size,
3616
3602
  InputProps: __spreadProps(__spreadValues({}, params.InputProps), {
3617
- style: { borderRadius: borderRadius2, height: height2, color: textColor },
3603
+ style: { borderRadius: borderRadius2, height: height2, color: textColor, fontSize },
3618
3604
  type: "search",
3619
3605
  endAdornment: /* @__PURE__ */ import_react12.default.createElement(import_InputAdornment.default, { position: "end" }, /* @__PURE__ */ import_react12.default.createElement(
3620
3606
  import_IconButton.default,