@wavelengthusaf/components 1.1.6 → 1.1.7
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 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -126,10 +126,12 @@ interface SearchProps {
|
|
|
126
126
|
textColor?: string;
|
|
127
127
|
backgroundColor?: string;
|
|
128
128
|
placeholder?: string;
|
|
129
|
+
options: SearchResult[];
|
|
130
|
+
onChange?: React__default.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
129
131
|
searchFunction: (value: string) => SearchResult[];
|
|
130
132
|
onSearchItemSelected: (selectedItem: SearchResult | string) => void;
|
|
131
133
|
}
|
|
132
|
-
declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
|
|
134
|
+
declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, options, onChange, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
|
|
133
135
|
|
|
134
136
|
declare function SearchTextField(): React__default.JSX.Element;
|
|
135
137
|
|
package/dist/index.d.ts
CHANGED
|
@@ -126,10 +126,12 @@ interface SearchProps {
|
|
|
126
126
|
textColor?: string;
|
|
127
127
|
backgroundColor?: string;
|
|
128
128
|
placeholder?: string;
|
|
129
|
+
options: SearchResult[];
|
|
130
|
+
onChange?: React__default.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
129
131
|
searchFunction: (value: string) => SearchResult[];
|
|
130
132
|
onSearchItemSelected: (selectedItem: SearchResult | string) => void;
|
|
131
133
|
}
|
|
132
|
-
declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
|
|
134
|
+
declare function WavelengthSearch({ id, mode, width, height, label, borderRadius, children, placeholder, searchFunction, onSearchItemSelected, options, onChange, borderColor, hoverColor, textColor, backgroundColor, }: SearchProps): React__default.JSX.Element | undefined;
|
|
133
135
|
|
|
134
136
|
declare function SearchTextField(): React__default.JSX.Element;
|
|
135
137
|
|
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({
|
|
@@ -3444,37 +3424,6 @@ var import_InputAdornment = __toESM(require("@mui/material/InputAdornment"));
|
|
|
3444
3424
|
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
3445
3425
|
var import_react13 = require("react");
|
|
3446
3426
|
var import_ListItem = __toESM(require("@mui/material/ListItem"));
|
|
3447
|
-
var CustomPopper = (props) => {
|
|
3448
|
-
return /* @__PURE__ */ import_react12.default.createElement(
|
|
3449
|
-
import_material5.Popper,
|
|
3450
|
-
__spreadProps(__spreadValues({}, props), {
|
|
3451
|
-
placement: "right-start",
|
|
3452
|
-
disablePortal: false,
|
|
3453
|
-
modifiers: [
|
|
3454
|
-
{
|
|
3455
|
-
name: "flip",
|
|
3456
|
-
enabled: true,
|
|
3457
|
-
options: {
|
|
3458
|
-
altBoundary: true,
|
|
3459
|
-
rootBoundary: "document",
|
|
3460
|
-
padding: 8
|
|
3461
|
-
}
|
|
3462
|
-
},
|
|
3463
|
-
{
|
|
3464
|
-
name: "preventOverflow",
|
|
3465
|
-
enabled: true,
|
|
3466
|
-
options: {
|
|
3467
|
-
altAxis: true,
|
|
3468
|
-
altBoundary: true,
|
|
3469
|
-
tether: false,
|
|
3470
|
-
rootBoundary: "document",
|
|
3471
|
-
padding: 8
|
|
3472
|
-
}
|
|
3473
|
-
}
|
|
3474
|
-
]
|
|
3475
|
-
})
|
|
3476
|
-
);
|
|
3477
|
-
};
|
|
3478
3427
|
function WavelengthSearch({
|
|
3479
3428
|
id,
|
|
3480
3429
|
mode,
|
|
@@ -3486,6 +3435,8 @@ function WavelengthSearch({
|
|
|
3486
3435
|
placeholder,
|
|
3487
3436
|
searchFunction,
|
|
3488
3437
|
onSearchItemSelected,
|
|
3438
|
+
options,
|
|
3439
|
+
onChange,
|
|
3489
3440
|
borderColor: borderColor2,
|
|
3490
3441
|
hoverColor,
|
|
3491
3442
|
textColor,
|
|
@@ -3504,8 +3455,8 @@ function WavelengthSearch({
|
|
|
3504
3455
|
loading: true,
|
|
3505
3456
|
disableListWrap: true,
|
|
3506
3457
|
freeSolo: true,
|
|
3507
|
-
disablePortal: true,
|
|
3508
3458
|
onChange: (e, value) => {
|
|
3459
|
+
console.log(" AutoComplete value ", value);
|
|
3509
3460
|
if (value != null) {
|
|
3510
3461
|
if (typeof value == "string") {
|
|
3511
3462
|
console.log("String Input, No Selection");
|
|
@@ -3515,11 +3466,11 @@ function WavelengthSearch({
|
|
|
3515
3466
|
}
|
|
3516
3467
|
},
|
|
3517
3468
|
disableCloseOnSelect: false,
|
|
3518
|
-
getOptionLabel: (
|
|
3519
|
-
const returnVal = typeof
|
|
3469
|
+
getOptionLabel: (options2) => {
|
|
3470
|
+
const returnVal = typeof options2 === "string" ? options2 : options2.title;
|
|
3520
3471
|
return returnVal;
|
|
3521
3472
|
},
|
|
3522
|
-
options
|
|
3473
|
+
options,
|
|
3523
3474
|
sx: { width: width2 },
|
|
3524
3475
|
renderOption: (props, results2) => (
|
|
3525
3476
|
// @ts-expect-error boneless chicken
|
|
@@ -3556,16 +3507,9 @@ function WavelengthSearch({
|
|
|
3556
3507
|
}
|
|
3557
3508
|
},
|
|
3558
3509
|
label,
|
|
3559
|
-
onChange
|
|
3560
|
-
if (searchFunction) {
|
|
3561
|
-
const response = yield searchFunction(e.target.value);
|
|
3562
|
-
console.log(response);
|
|
3563
|
-
yield setResults(response);
|
|
3564
|
-
}
|
|
3565
|
-
})
|
|
3510
|
+
onChange
|
|
3566
3511
|
})
|
|
3567
|
-
)
|
|
3568
|
-
PopperComponent: CustomPopper
|
|
3512
|
+
)
|
|
3569
3513
|
}
|
|
3570
3514
|
));
|
|
3571
3515
|
} else if (mode == "manual") {
|