@wavelengthusaf/components 1.1.5 → 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 -32
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -32
- 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({
|
|
@@ -3455,6 +3435,8 @@ function WavelengthSearch({
|
|
|
3455
3435
|
placeholder,
|
|
3456
3436
|
searchFunction,
|
|
3457
3437
|
onSearchItemSelected,
|
|
3438
|
+
options,
|
|
3439
|
+
onChange,
|
|
3458
3440
|
borderColor: borderColor2,
|
|
3459
3441
|
hoverColor,
|
|
3460
3442
|
textColor,
|
|
@@ -3473,8 +3455,8 @@ function WavelengthSearch({
|
|
|
3473
3455
|
loading: true,
|
|
3474
3456
|
disableListWrap: true,
|
|
3475
3457
|
freeSolo: true,
|
|
3476
|
-
disablePortal: true,
|
|
3477
3458
|
onChange: (e, value) => {
|
|
3459
|
+
console.log(" AutoComplete value ", value);
|
|
3478
3460
|
if (value != null) {
|
|
3479
3461
|
if (typeof value == "string") {
|
|
3480
3462
|
console.log("String Input, No Selection");
|
|
@@ -3484,15 +3466,15 @@ function WavelengthSearch({
|
|
|
3484
3466
|
}
|
|
3485
3467
|
},
|
|
3486
3468
|
disableCloseOnSelect: false,
|
|
3487
|
-
getOptionLabel: (
|
|
3488
|
-
const returnVal = typeof
|
|
3469
|
+
getOptionLabel: (options2) => {
|
|
3470
|
+
const returnVal = typeof options2 === "string" ? options2 : options2.title;
|
|
3489
3471
|
return returnVal;
|
|
3490
3472
|
},
|
|
3491
|
-
options
|
|
3473
|
+
options,
|
|
3492
3474
|
sx: { width: width2 },
|
|
3493
3475
|
renderOption: (props, results2) => (
|
|
3494
3476
|
// @ts-expect-error boneless chicken
|
|
3495
|
-
/* @__PURE__ */ import_react12.default.createElement(import_ListItem.default,
|
|
3477
|
+
/* @__PURE__ */ import_react12.default.createElement(import_ListItem.default, __spreadValues({ key: results2.id }, props), /* @__PURE__ */ import_react12.default.createElement(import_material5.ListItemText, { primary: results2.title, secondary: results2.subtitle }))
|
|
3496
3478
|
),
|
|
3497
3479
|
renderInput: (params) => /* @__PURE__ */ import_react12.default.createElement(
|
|
3498
3480
|
import_TextField.default,
|
|
@@ -3525,13 +3507,7 @@ function WavelengthSearch({
|
|
|
3525
3507
|
}
|
|
3526
3508
|
},
|
|
3527
3509
|
label,
|
|
3528
|
-
onChange
|
|
3529
|
-
if (searchFunction) {
|
|
3530
|
-
const response = yield searchFunction(e.target.value);
|
|
3531
|
-
console.log(response);
|
|
3532
|
-
yield setResults(response);
|
|
3533
|
-
}
|
|
3534
|
-
})
|
|
3510
|
+
onChange
|
|
3535
3511
|
})
|
|
3536
3512
|
)
|
|
3537
3513
|
}
|