@gridsuite/commons-ui 0.69.0 → 0.69.1

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.
@@ -1,3 +1,3 @@
1
1
  import { ValueSelectorProps } from 'react-querybuilder';
2
2
 
3
- export declare function FieldSelector({ options, className, value, disabled, handleOnChange, title, }: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function FieldSelector(props: Readonly<ValueSelectorProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,35 +1,17 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { toFlatOptionArray } from "react-querybuilder";
3
- import { Autocomplete, TextField } from "@mui/material";
4
- function FieldSelector({
5
- options,
6
- className,
7
- value,
8
- disabled,
9
- handleOnChange,
10
- title
11
- }) {
12
- const optionList = toFlatOptionArray(options);
13
- return /* @__PURE__ */ jsx(
14
- Autocomplete,
15
- {
16
- onChange: (event, newValue) => {
17
- if (newValue) {
18
- handleOnChange(newValue.name);
19
- }
20
- },
21
- value: optionList.find((option) => option.name === value),
22
- disabled,
23
- className,
24
- options: optionList,
25
- disableClearable: true,
26
- size: "small",
27
- title,
28
- renderInput: (params) => /* @__PURE__ */ jsx(TextField, { ...params, label: "", variant: "standard" }),
29
- autoHighlight: true,
30
- getOptionLabel: (option) => option.label
2
+ import { MaterialValueSelector } from "@react-querybuilder/material";
3
+ const ITEM_HEIGHT = 32;
4
+ const ITEM_PADDING = 4;
5
+ const ITEMS_COUNT = 10;
6
+ const MenuProps = {
7
+ PaperProps: {
8
+ style: {
9
+ maxHeight: (ITEM_HEIGHT + ITEM_PADDING) * ITEMS_COUNT + ITEM_PADDING
31
10
  }
32
- );
11
+ }
12
+ };
13
+ function FieldSelector(props) {
14
+ return /* @__PURE__ */ jsx(MaterialValueSelector, { ...props, MenuProps });
33
15
  }
34
16
  export {
35
17
  FieldSelector
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.69.0",
3
+ "version": "0.69.1",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "npm": ">=9",