@nethru/ui 1.0.48 → 1.0.49

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,5 +1,5 @@
1
1
  import React from "react";
2
- import { Box, Button, IconButton, Stack, Tooltip, Typography } from "@mui/material";
2
+ import { Button, IconButton, Stack, Tooltip, Typography } from "@mui/material";
3
3
  import AddIcon from "@mui/icons-material/Add";
4
4
  import DeleteIcon from "@mui/icons-material/Delete";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -8,6 +8,7 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
8
8
  export default function AppendableFormList({
9
9
  forms,
10
10
  gap = 1,
11
+ addOns,
11
12
  onAppend,
12
13
  onRemove,
13
14
  readOnly
@@ -40,13 +41,15 @@ export default function AppendableFormList({
40
41
  },
41
42
  children: "\uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"
42
43
  })]
43
- }), !readOnly && /*#__PURE__*/_jsx(Box, {
44
- children: /*#__PURE__*/_jsx(Button, {
44
+ }), !readOnly && /*#__PURE__*/_jsxs(Stack, {
45
+ direction: "row",
46
+ gap: 1,
47
+ children: [/*#__PURE__*/_jsx(Button, {
45
48
  variant: "text",
46
49
  startIcon: /*#__PURE__*/_jsx(AddIcon, {}),
47
50
  onClick: onAppend,
48
51
  children: "\uCD94\uAC00"
49
- })
52
+ }), addOns]
50
53
  })]
51
54
  });
52
55
  }
@@ -12,10 +12,12 @@ export default function ListItemText({
12
12
  }) {
13
13
  const [hover, setHover] = useState(false);
14
14
  return /*#__PURE__*/_jsx(MuiListItemText, {
15
- primary: /*#__PURE__*/_jsx(Typography, {
15
+ primary: typeof primary === 'string' ? /*#__PURE__*/_jsx(Typography, {
16
16
  fontSize: 17,
17
17
  fontWeight: 600,
18
18
  children: primary
19
+ }) : /*#__PURE__*/_jsx(Box, {
20
+ children: primary
19
21
  }),
20
22
  secondary: /*#__PURE__*/_jsxs(Stack, {
21
23
  direction: "row",
@@ -0,0 +1,35 @@
1
+ import { Autocomplete, Box, Divider } from "@mui/material";
2
+ import { TextField } from "@nethru/ui";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
+ export default function SearchableSelect({
6
+ label,
7
+ options,
8
+ ...props
9
+ }) {
10
+ return /*#__PURE__*/_jsx(Autocomplete, {
11
+ autoHighlight: true,
12
+ disableClearable: true,
13
+ options: options,
14
+ renderInput: params => /*#__PURE__*/_jsx(TextField, {
15
+ variant: "standard",
16
+ label: label,
17
+ ...params
18
+ }),
19
+ renderOption: (props, option) => /*#__PURE__*/_jsx(_Fragment, {
20
+ children: option.type === 'divider' ? /*#__PURE__*/_jsx(Divider, {
21
+ ...props,
22
+ sx: {
23
+ mb: 0.5
24
+ }
25
+ }) : /*#__PURE__*/_jsx(Box, {
26
+ component: "li",
27
+ ...props,
28
+ children: option.label
29
+ })
30
+ }),
31
+ getOptionDisabled: option => option.type === 'divider',
32
+ isOptionEqualToValue: (option, value) => option.id === value.id,
33
+ ...props
34
+ });
35
+ }
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export { default as ListItemText } from "./ListItemText";
23
23
  export { default as MainHeader } from "./MainHeader";
24
24
  export { default as PropertyTable } from "./PropertyTable";
25
25
  export { default as ReferenceChipList } from "./ReferenceChipList";
26
+ export { default as SearchableSelect } from "./SearchableSelect";
26
27
  export { default as SearchTextField } from "./SearchTextField";
27
28
  export { default as Section } from "./Section";
28
29
  export { default as Select } from "./Select";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nethru/ui",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "/dist"