@xylabs/react-select 4.0.0 → 4.0.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.
package/dist/browser/index.mjs
CHANGED
|
@@ -3,7 +3,6 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
|
|
4
4
|
// src/components/SelectEx.tsx
|
|
5
5
|
import { Select, useTheme } from "@mui/material";
|
|
6
|
-
import { merge } from "@xylabs/lodash";
|
|
7
6
|
import React from "react";
|
|
8
7
|
var SelectEx = /* @__PURE__ */ __name(({ MenuProps, mode = "light", colorize, ...props }) => {
|
|
9
8
|
const theme = useTheme();
|
|
@@ -15,7 +14,10 @@ var SelectEx = /* @__PURE__ */ __name(({ MenuProps, mode = "light", colorize, ..
|
|
|
15
14
|
}
|
|
16
15
|
} : {};
|
|
17
16
|
return /* @__PURE__ */ React.createElement(Select, {
|
|
18
|
-
MenuProps:
|
|
17
|
+
MenuProps: {
|
|
18
|
+
...MenuProps,
|
|
19
|
+
...colorizeMenuProps
|
|
20
|
+
},
|
|
19
21
|
...props
|
|
20
22
|
});
|
|
21
23
|
}, "SelectEx");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/SelectEx.tsx"],"sourcesContent":["import { PaletteMode, Select, SelectProps, useTheme } from '@mui/material'\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/components/SelectEx.tsx"],"sourcesContent":["import { PaletteMode, Select, SelectProps, useTheme } from '@mui/material'\nimport React from 'react'\n\nexport type SelectExProps<T> = SelectProps<T> & {\n colorize?: 'primary' | 'secondary'\n mode?: PaletteMode\n}\n\nexport const SelectEx: <T>(props: SelectExProps<T>) => React.JSX.Element = ({ MenuProps, mode = 'light', colorize, ...props }) => {\n const theme = useTheme()\n const colorizeMenuProps = colorize ? { MenuListProps: { sx: { backgroundColor: theme.palette[colorize][mode] } } } : {}\n\n return <Select MenuProps={{ ...MenuProps, ...colorizeMenuProps }} {...props} />\n}\n"],"mappings":";;;;AAAA,SAAsBA,QAAqBC,gBAAgB;AAC3D,OAAOC,WAAW;AAOX,IAAMC,WAA8D,wBAAC,EAAEC,WAAWC,OAAO,SAASC,UAAU,GAAGC,MAAAA,MAAO;AAC3H,QAAMC,QAAQC,SAAAA;AACd,QAAMC,oBAAoBJ,WAAW;IAAEK,eAAe;MAAEC,IAAI;QAAEC,iBAAiBL,MAAMM,QAAQR,QAAAA,EAAUD,IAAAA;MAAM;IAAE;EAAE,IAAI,CAAC;AAEtH,SAAO,sBAAA,cAACU,QAAAA;IAAOX,WAAW;MAAE,GAAGA;MAAW,GAAGM;IAAkB;IAAI,GAAGH;;AACxE,GAL2E;","names":["Select","useTheme","React","SelectEx","MenuProps","mode","colorize","props","theme","useTheme","colorizeMenuProps","MenuListProps","sx","backgroundColor","palette","Select"]}
|
package/package.json
CHANGED
|
@@ -12,9 +12,6 @@
|
|
|
12
12
|
"workspaces": [
|
|
13
13
|
"packages/*"
|
|
14
14
|
],
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@xylabs/lodash": "^4.0.0"
|
|
17
|
-
},
|
|
18
15
|
"description": "Common React library for all XY Labs projects that use React",
|
|
19
16
|
"devDependencies": {
|
|
20
17
|
"@mui/icons-material": "^5.16.7",
|
|
@@ -54,6 +51,6 @@
|
|
|
54
51
|
"url": "https://github.com/xylabs/sdk-react.git"
|
|
55
52
|
},
|
|
56
53
|
"sideEffects": false,
|
|
57
|
-
"version": "4.0.
|
|
54
|
+
"version": "4.0.1",
|
|
58
55
|
"type": "module"
|
|
59
56
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PaletteMode, Select, SelectProps, useTheme } from '@mui/material'
|
|
2
|
-
import { merge } from '@xylabs/lodash'
|
|
3
2
|
import React from 'react'
|
|
4
3
|
|
|
5
4
|
export type SelectExProps<T> = SelectProps<T> & {
|
|
@@ -11,5 +10,5 @@ export const SelectEx: <T>(props: SelectExProps<T>) => React.JSX.Element = ({ Me
|
|
|
11
10
|
const theme = useTheme()
|
|
12
11
|
const colorizeMenuProps = colorize ? { MenuListProps: { sx: { backgroundColor: theme.palette[colorize][mode] } } } : {}
|
|
13
12
|
|
|
14
|
-
return <Select MenuProps={
|
|
13
|
+
return <Select MenuProps={{ ...MenuProps, ...colorizeMenuProps }} {...props} />
|
|
15
14
|
}
|