@actdim/dynstruct-mui 0.9.1 → 1.5.5
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/README.md +91 -91
- package/dist/Accordion.es.js +28 -21
- package/dist/Accordion.es.js.map +1 -1
- package/dist/Alert.es.js +26 -19
- package/dist/Alert.es.js.map +1 -1
- package/dist/Autocomplete.es.js +46 -39
- package/dist/Autocomplete.es.js.map +1 -1
- package/dist/Avatar.es.js +19 -12
- package/dist/Avatar.es.js.map +1 -1
- package/dist/Badge.es.js +31 -24
- package/dist/Badge.es.js.map +1 -1
- package/dist/Breadcrumbs.es.js +32 -25
- package/dist/Breadcrumbs.es.js.map +1 -1
- package/dist/Button.es.js +36 -29
- package/dist/Button.es.js.map +1 -1
- package/dist/Card.es.js +27 -20
- package/dist/Card.es.js.map +1 -1
- package/dist/Checkbox.es.js +39 -32
- package/dist/Checkbox.es.js.map +1 -1
- package/dist/Chip.es.js +30 -23
- package/dist/Chip.es.js.map +1 -1
- package/dist/CircularProgress.es.js +27 -20
- package/dist/CircularProgress.es.js.map +1 -1
- package/dist/Dialog.es.js +35 -28
- package/dist/Dialog.es.js.map +1 -1
- package/dist/Drawer.es.js +31 -24
- package/dist/Drawer.es.js.map +1 -1
- package/dist/Fab.es.js +33 -26
- package/dist/Fab.es.js.map +1 -1
- package/dist/IconButton.es.js +34 -27
- package/dist/IconButton.es.js.map +1 -1
- package/dist/LinearProgress.es.js +26 -19
- package/dist/LinearProgress.es.js.map +1 -1
- package/dist/List.es.js +23 -16
- package/dist/List.es.js.map +1 -1
- package/dist/Menu.es.js +32 -24
- package/dist/Menu.es.js.map +1 -1
- package/dist/Pagination.es.js +32 -25
- package/dist/Pagination.es.js.map +1 -1
- package/dist/RadioGroup.es.js +39 -32
- package/dist/RadioGroup.es.js.map +1 -1
- package/dist/Rating.es.js +30 -23
- package/dist/Rating.es.js.map +1 -1
- package/dist/Select.es.js +44 -37
- package/dist/Select.es.js.map +1 -1
- package/dist/Skeleton.es.js +26 -19
- package/dist/Skeleton.es.js.map +1 -1
- package/dist/Slider.es.js +36 -29
- package/dist/Slider.es.js.map +1 -1
- package/dist/Snackbar.es.js +31 -24
- package/dist/Snackbar.es.js.map +1 -1
- package/dist/SpeedDial.es.js +33 -26
- package/dist/SpeedDial.es.js.map +1 -1
- package/dist/Stepper.es.js +32 -25
- package/dist/Stepper.es.js.map +1 -1
- package/dist/Switch.es.js +37 -30
- package/dist/Switch.es.js.map +1 -1
- package/dist/Table.es.js +26 -19
- package/dist/Table.es.js.map +1 -1
- package/dist/Tabs.es.js +35 -28
- package/dist/Tabs.es.js.map +1 -1
- package/dist/TextField.es.js +42 -35
- package/dist/TextField.es.js.map +1 -1
- package/dist/ToggleButtonGroup.es.js +37 -30
- package/dist/ToggleButtonGroup.es.js.map +1 -1
- package/dist/Tooltip.es.js +21 -14
- package/dist/Tooltip.es.js.map +1 -1
- package/dist/index.es.js +99 -99
- package/dist/index.es.js.map +1 -1
- package/package.json +132 -134
- package/dist/Accordion.d.ts +0 -19
- package/dist/Accordion.d.ts.map +0 -1
- package/dist/Alert.d.ts +0 -18
- package/dist/Alert.d.ts.map +0 -1
- package/dist/Autocomplete.d.ts +0 -26
- package/dist/Autocomplete.d.ts.map +0 -1
- package/dist/Avatar.d.ts +0 -18
- package/dist/Avatar.d.ts.map +0 -1
- package/dist/Badge.d.ts +0 -21
- package/dist/Badge.d.ts.map +0 -1
- package/dist/Breadcrumbs.d.ts +0 -22
- package/dist/Breadcrumbs.d.ts.map +0 -1
- package/dist/Button.d.ts +0 -23
- package/dist/Button.d.ts.map +0 -1
- package/dist/Card.d.ts +0 -21
- package/dist/Card.d.ts.map +0 -1
- package/dist/Checkbox.d.ts +0 -22
- package/dist/Checkbox.d.ts.map +0 -1
- package/dist/Chip.d.ts +0 -21
- package/dist/Chip.d.ts.map +0 -1
- package/dist/CircularProgress.d.ts +0 -19
- package/dist/CircularProgress.d.ts.map +0 -1
- package/dist/Dialog.d.ts +0 -22
- package/dist/Dialog.d.ts.map +0 -1
- package/dist/Drawer.d.ts +0 -19
- package/dist/Drawer.d.ts.map +0 -1
- package/dist/Fab.d.ts +0 -21
- package/dist/Fab.d.ts.map +0 -1
- package/dist/IconButton.d.ts +0 -21
- package/dist/IconButton.d.ts.map +0 -1
- package/dist/LinearProgress.d.ts +0 -18
- package/dist/LinearProgress.d.ts.map +0 -1
- package/dist/List.d.ts +0 -25
- package/dist/List.d.ts.map +0 -1
- package/dist/Menu.d.ts +0 -24
- package/dist/Menu.d.ts.map +0 -1
- package/dist/Pagination.d.ts +0 -21
- package/dist/Pagination.d.ts.map +0 -1
- package/dist/RadioGroup.d.ts +0 -27
- package/dist/RadioGroup.d.ts.map +0 -1
- package/dist/Rating.d.ts +0 -20
- package/dist/Rating.d.ts.map +0 -1
- package/dist/Select.d.ts +0 -28
- package/dist/Select.d.ts.map +0 -1
- package/dist/Skeleton.d.ts +0 -18
- package/dist/Skeleton.d.ts.map +0 -1
- package/dist/Slider.d.ts +0 -24
- package/dist/Slider.d.ts.map +0 -1
- package/dist/Snackbar.d.ts +0 -20
- package/dist/Snackbar.d.ts.map +0 -1
- package/dist/SpeedDial.d.ts +0 -24
- package/dist/SpeedDial.d.ts.map +0 -1
- package/dist/Stepper.d.ts +0 -23
- package/dist/Stepper.d.ts.map +0 -1
- package/dist/Switch.d.ts +0 -21
- package/dist/Switch.d.ts.map +0 -1
- package/dist/Table.d.ts +0 -24
- package/dist/Table.d.ts.map +0 -1
- package/dist/Tabs.d.ts +0 -25
- package/dist/Tabs.d.ts.map +0 -1
- package/dist/TextField.d.ts +0 -27
- package/dist/TextField.d.ts.map +0 -1
- package/dist/ToggleButtonGroup.d.ts +0 -28
- package/dist/ToggleButtonGroup.d.ts.map +0 -1
- package/dist/Tooltip.d.ts +0 -17
- package/dist/Tooltip.d.ts.map +0 -1
- package/dist/index.d.ts +0 -34
- package/dist/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
# @actdim/dynstruct-mui
|
|
2
|
-
|
|
3
|
-
MUI component wrappers for [@actdim/dynstruct](https://github.com/actdim/dynstruct). Each component is a dynstruct hook-constructor — observable props, reactive rendering, MobX-backed state out of the box.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@actdim/dynstruct-mui)
|
|
6
|
-
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](LICENSE)
|
|
8
|
-
|
|
9
|
-
## Components
|
|
10
|
-
|
|
11
|
-
| Component | Import |
|
|
12
|
-
|---|---|
|
|
13
|
-
| Accordion | `@actdim/dynstruct-mui/Accordion` |
|
|
14
|
-
| Alert | `@actdim/dynstruct-mui/Alert` |
|
|
15
|
-
| Autocomplete | `@actdim/dynstruct-mui/Autocomplete` |
|
|
16
|
-
| Avatar | `@actdim/dynstruct-mui/Avatar` |
|
|
17
|
-
| Badge | `@actdim/dynstruct-mui/Badge` |
|
|
18
|
-
| Breadcrumbs | `@actdim/dynstruct-mui/Breadcrumbs` |
|
|
19
|
-
| Button | `@actdim/dynstruct-mui/Button` |
|
|
20
|
-
| Card | `@actdim/dynstruct-mui/Card` |
|
|
21
|
-
| Checkbox | `@actdim/dynstruct-mui/Checkbox` |
|
|
22
|
-
| Chip | `@actdim/dynstruct-mui/Chip` |
|
|
23
|
-
| CircularProgress | `@actdim/dynstruct-mui/CircularProgress` |
|
|
24
|
-
| Dialog | `@actdim/dynstruct-mui/Dialog` |
|
|
25
|
-
| Drawer | `@actdim/dynstruct-mui/Drawer` |
|
|
26
|
-
| Fab | `@actdim/dynstruct-mui/Fab` |
|
|
27
|
-
| IconButton | `@actdim/dynstruct-mui/IconButton` |
|
|
28
|
-
| LinearProgress | `@actdim/dynstruct-mui/LinearProgress` |
|
|
29
|
-
| List | `@actdim/dynstruct-mui/List` |
|
|
30
|
-
| Menu | `@actdim/dynstruct-mui/Menu` |
|
|
31
|
-
| Pagination | `@actdim/dynstruct-mui/Pagination` |
|
|
32
|
-
| RadioGroup | `@actdim/dynstruct-mui/RadioGroup` |
|
|
33
|
-
| Rating | `@actdim/dynstruct-mui/Rating` |
|
|
34
|
-
| Select | `@actdim/dynstruct-mui/Select` |
|
|
35
|
-
| Skeleton | `@actdim/dynstruct-mui/Skeleton` |
|
|
36
|
-
| Slider | `@actdim/dynstruct-mui/Slider` |
|
|
37
|
-
| Snackbar | `@actdim/dynstruct-mui/Snackbar` |
|
|
38
|
-
| SpeedDial | `@actdim/dynstruct-mui/SpeedDial` |
|
|
39
|
-
| Stepper | `@actdim/dynstruct-mui/Stepper` |
|
|
40
|
-
| Switch | `@actdim/dynstruct-mui/Switch` |
|
|
41
|
-
| Table | `@actdim/dynstruct-mui/Table` |
|
|
42
|
-
| Tabs | `@actdim/dynstruct-mui/Tabs` |
|
|
43
|
-
| TextField | `@actdim/dynstruct-mui/TextField` |
|
|
44
|
-
| ToggleButtonGroup | `@actdim/dynstruct-mui/ToggleButtonGroup` |
|
|
45
|
-
| Tooltip | `@actdim/dynstruct-mui/Tooltip` |
|
|
46
|
-
|
|
47
|
-
## Installation
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
npm install @actdim/dynstruct-mui
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Peer dependencies: `@actdim/dynstruct`, `@mui/material`, `react`, `mobx`, `mobx-react-lite` — see `package.json` for full list.
|
|
54
|
-
|
|
55
|
-
## Usage
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import { useButton } from '@actdim/dynstruct-mui/Button';
|
|
59
|
-
|
|
60
|
-
const saveBtn = useButton({
|
|
61
|
-
props: {
|
|
62
|
-
label: 'Save',
|
|
63
|
-
variant: 'contained',
|
|
64
|
-
onClick: () => handleSave(),
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// In JSX:
|
|
69
|
-
// <saveBtn.view />
|
|
70
|
-
// or via React adapter:
|
|
71
|
-
import { Button } from '@actdim/dynstruct-mui/Button';
|
|
72
|
-
// <Button label="Save" variant="contained" onClick={handleSave} />
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Development
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
pnpm storybook # run Storybook
|
|
79
|
-
pnpm build # build
|
|
80
|
-
pnpm typecheck # type check
|
|
81
|
-
pnpm lint # lint
|
|
82
|
-
pnpm format # format
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## License
|
|
86
|
-
|
|
87
|
-
Proprietary — see [LICENSE](LICENSE) for details.
|
|
88
|
-
|
|
89
|
-
## Author
|
|
90
|
-
|
|
91
|
-
Pavel Borodaev — [github.com/actdim/dynstruct-mui](https://github.com/actdim/dynstruct-mui)
|
|
1
|
+
# @actdim/dynstruct-mui
|
|
2
|
+
|
|
3
|
+
MUI component wrappers for [@actdim/dynstruct](https://github.com/actdim/dynstruct). Each component is a dynstruct hook-constructor — observable props, reactive rendering, MobX-backed state out of the box.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@actdim/dynstruct-mui)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
## Components
|
|
10
|
+
|
|
11
|
+
| Component | Import |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Accordion | `@actdim/dynstruct-mui/Accordion` |
|
|
14
|
+
| Alert | `@actdim/dynstruct-mui/Alert` |
|
|
15
|
+
| Autocomplete | `@actdim/dynstruct-mui/Autocomplete` |
|
|
16
|
+
| Avatar | `@actdim/dynstruct-mui/Avatar` |
|
|
17
|
+
| Badge | `@actdim/dynstruct-mui/Badge` |
|
|
18
|
+
| Breadcrumbs | `@actdim/dynstruct-mui/Breadcrumbs` |
|
|
19
|
+
| Button | `@actdim/dynstruct-mui/Button` |
|
|
20
|
+
| Card | `@actdim/dynstruct-mui/Card` |
|
|
21
|
+
| Checkbox | `@actdim/dynstruct-mui/Checkbox` |
|
|
22
|
+
| Chip | `@actdim/dynstruct-mui/Chip` |
|
|
23
|
+
| CircularProgress | `@actdim/dynstruct-mui/CircularProgress` |
|
|
24
|
+
| Dialog | `@actdim/dynstruct-mui/Dialog` |
|
|
25
|
+
| Drawer | `@actdim/dynstruct-mui/Drawer` |
|
|
26
|
+
| Fab | `@actdim/dynstruct-mui/Fab` |
|
|
27
|
+
| IconButton | `@actdim/dynstruct-mui/IconButton` |
|
|
28
|
+
| LinearProgress | `@actdim/dynstruct-mui/LinearProgress` |
|
|
29
|
+
| List | `@actdim/dynstruct-mui/List` |
|
|
30
|
+
| Menu | `@actdim/dynstruct-mui/Menu` |
|
|
31
|
+
| Pagination | `@actdim/dynstruct-mui/Pagination` |
|
|
32
|
+
| RadioGroup | `@actdim/dynstruct-mui/RadioGroup` |
|
|
33
|
+
| Rating | `@actdim/dynstruct-mui/Rating` |
|
|
34
|
+
| Select | `@actdim/dynstruct-mui/Select` |
|
|
35
|
+
| Skeleton | `@actdim/dynstruct-mui/Skeleton` |
|
|
36
|
+
| Slider | `@actdim/dynstruct-mui/Slider` |
|
|
37
|
+
| Snackbar | `@actdim/dynstruct-mui/Snackbar` |
|
|
38
|
+
| SpeedDial | `@actdim/dynstruct-mui/SpeedDial` |
|
|
39
|
+
| Stepper | `@actdim/dynstruct-mui/Stepper` |
|
|
40
|
+
| Switch | `@actdim/dynstruct-mui/Switch` |
|
|
41
|
+
| Table | `@actdim/dynstruct-mui/Table` |
|
|
42
|
+
| Tabs | `@actdim/dynstruct-mui/Tabs` |
|
|
43
|
+
| TextField | `@actdim/dynstruct-mui/TextField` |
|
|
44
|
+
| ToggleButtonGroup | `@actdim/dynstruct-mui/ToggleButtonGroup` |
|
|
45
|
+
| Tooltip | `@actdim/dynstruct-mui/Tooltip` |
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install @actdim/dynstruct-mui
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Peer dependencies: `@actdim/dynstruct`, `@mui/material`, `react`, `mobx`, `mobx-react-lite` — see `package.json` for full list.
|
|
54
|
+
|
|
55
|
+
## Usage
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { useButton } from '@actdim/dynstruct-mui/Button';
|
|
59
|
+
|
|
60
|
+
const saveBtn = useButton({
|
|
61
|
+
props: {
|
|
62
|
+
label: 'Save',
|
|
63
|
+
variant: 'contained',
|
|
64
|
+
onClick: () => handleSave(),
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// In JSX:
|
|
69
|
+
// <saveBtn.view />
|
|
70
|
+
// or via React adapter:
|
|
71
|
+
import { Button } from '@actdim/dynstruct-mui/Button';
|
|
72
|
+
// <Button label="Save" variant="contained" onClick={handleSave} />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Development
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pnpm storybook # run Storybook
|
|
79
|
+
pnpm build # build
|
|
80
|
+
pnpm typecheck # type check
|
|
81
|
+
pnpm lint # lint
|
|
82
|
+
pnpm format # format
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
Proprietary — see [LICENSE](LICENSE) for details.
|
|
88
|
+
|
|
89
|
+
## Author
|
|
90
|
+
|
|
91
|
+
Pavel Borodaev — [github.com/actdim/dynstruct-mui](https://github.com/actdim/dynstruct-mui)
|
package/dist/Accordion.es.js
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Accordion as Accordion$1, AccordionSummary, AccordionDetails } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useAccordion = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Accordion",
|
|
8
11
|
props: {
|
|
9
12
|
summary: "",
|
|
10
|
-
content: () => null,
|
|
13
|
+
content: /* @__PURE__ */ __name(() => null, "content"),
|
|
11
14
|
expanded: void 0,
|
|
12
15
|
onChange: void 0,
|
|
13
16
|
expandIcon: void 0,
|
|
14
17
|
sx: void 0
|
|
15
18
|
},
|
|
16
|
-
view: () => /* @__PURE__ */
|
|
17
|
-
|
|
19
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
20
|
+
Accordion$1,
|
|
18
21
|
{
|
|
19
|
-
expanded:
|
|
20
|
-
onChange:
|
|
21
|
-
disabled:
|
|
22
|
-
sx:
|
|
22
|
+
expanded: m.expanded,
|
|
23
|
+
onChange: m.onChange ? (_, v) => m.onChange(v) : void 0,
|
|
24
|
+
disabled: m.$.isDisabled,
|
|
25
|
+
sx: m.sx
|
|
23
26
|
},
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
/* @__PURE__ */ React.createElement(AccordionSummary, { expandIcon: m.expandIcon }, m.summary),
|
|
28
|
+
/* @__PURE__ */ React.createElement(AccordionDetails, null, /* @__PURE__ */ React.createElement(m.content, null))
|
|
29
|
+
), "view")
|
|
30
|
+
};
|
|
31
|
+
c = useComponent(def, params);
|
|
32
|
+
m = c.model;
|
|
33
|
+
return c;
|
|
34
|
+
}, "useAccordion");
|
|
35
|
+
const Accordion = toReact(useAccordion);
|
|
36
|
+
Accordion.displayName = "Accordion";
|
|
30
37
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
Accordion,
|
|
39
|
+
useAccordion
|
|
33
40
|
};
|
|
34
41
|
//# sourceMappingURL=Accordion.es.js.map
|
package/dist/Accordion.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Accordion.es.js","sources":["../src/Accordion.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Accordion as MuiAccordion,\r\n AccordionSummary,\r\n AccordionDetails,\r\n type AccordionProps as MuiAccordionProps,\r\n} from '@mui/material';\r\nimport {\r\n type ComponentStruct,\r\n type ComponentDef,\r\n type ComponentParams,\r\n type Component,\r\n type ComponentModel,\r\n} from '@actdim/dynstruct/componentModel/contracts';\r\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\r\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n summary: React.ReactNode;\r\n content: React.FC;\r\n expanded?: boolean;\r\n onChange?: (expanded: boolean) => void;\r\n expandIcon?: React.ReactNode;\r\n sx?: MuiAccordionProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useAccordion = (params: ComponentParams<Struct>): Component<Struct> => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const def: ComponentDef<Struct> = {\r\n regType: 'Accordion',\r\n props: {\r\n summary: '',\r\n content: () => null,\r\n expanded: undefined,\r\n onChange: undefined,\r\n expandIcon: undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiAccordion\r\n expanded={m.expanded}\r\n onChange={m.onChange ? (_, v) => m.onChange!(v) : undefined}\r\n disabled={m.$.isDisabled}\r\n sx={m.sx}\r\n >\r\n <AccordionSummary expandIcon={m.expandIcon}>\r\n {m.summary}\r\n </AccordionSummary>\r\n <AccordionDetails>\r\n <m.content />\r\n </AccordionDetails>\r\n </MuiAccordion>\r\n ),\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n return c;\r\n};\r\n\r\nexport type AccordionStruct = Struct;\r\n\r\nexport const Accordion = toReact(useAccordion);\r\nAccordion.displayName = 'Accordion';\r\n"],"names":["MuiAccordion"],"mappings":";;;;;AA+BO,MAAM,eAAe,wBAAC,WAAuD;AAChF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS;AAAA,MACT,SAAS,6BAAM,MAAN;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,UAAU,EAAE;AAAA,QACZ,UAAU,EAAE,WAAW,CAAC,GAAG,MAAM,EAAE,SAAU,CAAC,IAAI;AAAA,QAClD,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,0CAEL,kBAAA,EAAiB,YAAY,EAAE,WAAA,GAC3B,EAAE,OACP;AAAA,0CACC,kBAAA,MACG,sBAAA,cAAC,EAAE,SAAF,IAAU,CACf;AAAA,IAAA,GAZF;AAAA,EAaF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAlC4B;AAsCrB,MAAM,YAAY,QAAQ,YAAY;AAC7C,UAAU,cAAc;"}
|
package/dist/Alert.es.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Alert as Alert$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useAlert = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Alert",
|
|
8
11
|
props: {
|
|
9
12
|
message: "",
|
|
@@ -12,21 +15,25 @@ const i = (r) => {
|
|
|
12
15
|
onClose: void 0,
|
|
13
16
|
sx: void 0
|
|
14
17
|
},
|
|
15
|
-
view: () => /* @__PURE__ */
|
|
16
|
-
|
|
18
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
19
|
+
Alert$1,
|
|
17
20
|
{
|
|
18
|
-
severity:
|
|
19
|
-
variant:
|
|
20
|
-
onClose:
|
|
21
|
-
sx:
|
|
21
|
+
severity: m.severity,
|
|
22
|
+
variant: m.variant,
|
|
23
|
+
onClose: m.onClose,
|
|
24
|
+
sx: m.sx
|
|
22
25
|
},
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
m.message
|
|
27
|
+
), "view")
|
|
28
|
+
};
|
|
29
|
+
c = useComponent(def, params);
|
|
30
|
+
m = c.model;
|
|
31
|
+
return c;
|
|
32
|
+
}, "useAlert");
|
|
33
|
+
const Alert = toReact(useAlert);
|
|
34
|
+
Alert.displayName = "Alert";
|
|
28
35
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
Alert,
|
|
37
|
+
useAlert
|
|
31
38
|
};
|
|
32
39
|
//# sourceMappingURL=Alert.es.js.map
|
package/dist/Alert.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Alert.es.js","sources":["../src/Alert.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Alert as MuiAlert, type AlertProps as MuiAlertProps } from '@mui/material';\r\nimport {\r\n type ComponentStruct,\r\n type ComponentDef,\r\n type ComponentParams,\r\n type Component,\r\n type ComponentModel,\r\n} from '@actdim/dynstruct/componentModel/contracts';\r\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\r\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n message: string;\r\n severity?: MuiAlertProps['severity'];\r\n variant?: MuiAlertProps['variant'];\r\n onClose?: () => void;\r\n sx?: MuiAlertProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useAlert = (params: ComponentParams<Struct>): Component<Struct> => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const def: ComponentDef<Struct> = {\r\n regType: 'Alert',\r\n props: {\r\n message: '',\r\n severity: 'info',\r\n variant: 'standard',\r\n onClose: undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiAlert\r\n severity={m.severity}\r\n variant={m.variant}\r\n onClose={m.onClose}\r\n sx={m.sx}\r\n >\r\n {m.message}\r\n </MuiAlert>\r\n ),\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n return c;\r\n};\r\n\r\nexport type AlertStruct = Struct;\r\n\r\nexport const Alert = toReact(useAlert);\r\nAlert.displayName = 'Alert';\r\n"],"names":["MuiAlert"],"mappings":";;;;;AAyBO,MAAM,WAAW,wBAAC,WAAuD;AAC5E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,SAAS;AAAA,MACT,SAAS;AAAA,MACT,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,UAAU,EAAE;AAAA,QACZ,SAAS,EAAE;AAAA,QACX,SAAS,EAAE;AAAA,QACX,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE;AAAA,IAAA,GAPL;AAAA,EAQF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA5BwB;AAgCjB,MAAM,QAAQ,QAAQ,QAAQ;AACrC,MAAM,cAAc;"}
|
package/dist/Autocomplete.es.js
CHANGED
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Autocomplete as Autocomplete$1, TextField } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useAutocomplete = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Autocomplete",
|
|
8
11
|
props: {
|
|
9
12
|
value: null,
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
options: [],
|
|
13
16
|
label: void 0,
|
|
14
17
|
placeholder: void 0,
|
|
15
18
|
helperText: void 0,
|
|
16
|
-
error:
|
|
17
|
-
loading:
|
|
18
|
-
freeSolo:
|
|
19
|
-
fullWidth:
|
|
19
|
+
error: false,
|
|
20
|
+
loading: false,
|
|
21
|
+
freeSolo: false,
|
|
22
|
+
fullWidth: false,
|
|
20
23
|
variant: "outlined",
|
|
21
24
|
size: "medium",
|
|
22
25
|
sx: void 0
|
|
23
26
|
},
|
|
24
|
-
view: () => /* @__PURE__ */
|
|
25
|
-
|
|
27
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
28
|
+
Autocomplete$1,
|
|
26
29
|
{
|
|
27
|
-
value:
|
|
28
|
-
onChange: (
|
|
29
|
-
options:
|
|
30
|
-
loading:
|
|
31
|
-
freeSolo:
|
|
32
|
-
fullWidth:
|
|
33
|
-
size:
|
|
34
|
-
disabled:
|
|
35
|
-
readOnly:
|
|
36
|
-
sx:
|
|
37
|
-
renderInput: (
|
|
38
|
-
|
|
30
|
+
value: m.value,
|
|
31
|
+
onChange: /* @__PURE__ */ __name((_, newValue) => m.onChange(newValue), "onChange"),
|
|
32
|
+
options: m.options,
|
|
33
|
+
loading: m.loading,
|
|
34
|
+
freeSolo: m.freeSolo,
|
|
35
|
+
fullWidth: m.fullWidth,
|
|
36
|
+
size: m.size,
|
|
37
|
+
disabled: m.$.isDisabled,
|
|
38
|
+
readOnly: m.$.isReadOnly,
|
|
39
|
+
sx: m.sx,
|
|
40
|
+
renderInput: /* @__PURE__ */ __name((params2) => /* @__PURE__ */ React.createElement(
|
|
41
|
+
TextField,
|
|
39
42
|
{
|
|
40
|
-
...
|
|
41
|
-
label:
|
|
42
|
-
placeholder:
|
|
43
|
-
error:
|
|
44
|
-
helperText:
|
|
45
|
-
variant:
|
|
43
|
+
...params2,
|
|
44
|
+
label: m.label,
|
|
45
|
+
placeholder: m.placeholder,
|
|
46
|
+
error: m.error,
|
|
47
|
+
helperText: m.helperText,
|
|
48
|
+
variant: m.variant
|
|
46
49
|
}
|
|
47
|
-
)
|
|
50
|
+
), "renderInput")
|
|
48
51
|
}
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
m
|
|
52
|
+
), "view")
|
|
53
|
+
};
|
|
54
|
+
c = useComponent(def, params);
|
|
55
|
+
m = c.model;
|
|
56
|
+
return c;
|
|
57
|
+
}, "useAutocomplete");
|
|
58
|
+
const Autocomplete = toReact(useAutocomplete);
|
|
59
|
+
Autocomplete.displayName = "Autocomplete";
|
|
53
60
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
Autocomplete,
|
|
62
|
+
useAutocomplete
|
|
56
63
|
};
|
|
57
64
|
//# sourceMappingURL=Autocomplete.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Autocomplete.es.js","sources":["../src/Autocomplete.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Autocomplete as MuiAutocomplete,\r\n TextField as MuiTextField,\r\n type AutocompleteProps as MuiAutocompleteProps,\r\n type TextFieldProps as MuiTextFieldProps,\r\n} from '@mui/material';\r\nimport {\r\n type ComponentStruct,\r\n type ComponentDef,\r\n type ComponentParams,\r\n type Component,\r\n type ComponentModel,\r\n} from '@actdim/dynstruct/componentModel/contracts';\r\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\r\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n value: string | null;\r\n onChange: (value: string | null) => void;\r\n options: string[];\r\n label?: string;\r\n placeholder?: string;\r\n helperText?: string;\r\n error?: boolean;\r\n loading?: boolean;\r\n freeSolo?: boolean;\r\n fullWidth?: boolean;\r\n variant?: MuiTextFieldProps['variant'];\r\n size?: MuiAutocompleteProps<string, false, false, false>['size'];\r\n sx?: MuiAutocompleteProps<string, false, false, false>['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useAutocomplete = (params: ComponentParams<Struct>): Component<Struct> => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const def: ComponentDef<Struct> = {\r\n regType: 'Autocomplete',\r\n props: {\r\n value: null,\r\n onChange: () => {},\r\n options: [],\r\n label: undefined,\r\n placeholder: undefined,\r\n helperText: undefined,\r\n error: false,\r\n loading: false,\r\n freeSolo: false,\r\n fullWidth: false,\r\n variant: 'outlined',\r\n size: 'medium',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiAutocomplete\r\n value={m.value}\r\n onChange={(_, newValue) => m.onChange(newValue)}\r\n options={m.options}\r\n loading={m.loading}\r\n freeSolo={m.freeSolo}\r\n fullWidth={m.fullWidth}\r\n size={m.size}\r\n disabled={m.$.isDisabled}\r\n readOnly={m.$.isReadOnly}\r\n sx={m.sx}\r\n renderInput={(params) => (\r\n <MuiTextField\r\n {...params}\r\n label={m.label}\r\n placeholder={m.placeholder}\r\n error={m.error}\r\n helperText={m.helperText}\r\n variant={m.variant}\r\n />\r\n )}\r\n />\r\n ),\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n return c;\r\n};\r\n\r\nexport type AutocompleteStruct = Struct;\r\n\r\nexport const Autocomplete = toReact(useAutocomplete);\r\nAutocomplete.displayName = 'Autocomplete';\r\n"],"names":["MuiAutocomplete","params","MuiTextField"],"mappings":";;;;;AAsCO,MAAM,kBAAkB,wBAAC,WAAuD;AACnF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,SAAS,CAAA;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa,EAAE,SAAS,QAAQ,GAApC;AAAA,QACV,SAAS,EAAE;AAAA,QACX,SAAS,EAAE;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,UAAU,EAAE,EAAE;AAAA,QACd,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,QACN,aAAa,wBAACC,YACV,sBAAA;AAAA,UAACC;AAAAA,UAAA;AAAA,YACI,GAAGD;AAAAA,YACJ,OAAO,EAAE;AAAA,YACT,aAAa,EAAE;AAAA,YACf,OAAO,EAAE;AAAA,YACT,YAAY,EAAE;AAAA,YACd,SAAS,EAAE;AAAA,UAAA;AAAA,QAAA,GAPN;AAAA,MAQT;AAAA,IAAA,GApBN;AAAA,EAsBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAlD+B;AAsDxB,MAAM,eAAe,QAAQ,eAAe;AACnD,aAAa,cAAc;"}
|
package/dist/Avatar.es.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Avatar as Avatar$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useAvatar = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Avatar",
|
|
8
11
|
props: {
|
|
9
12
|
src: void 0,
|
|
@@ -12,12 +15,16 @@ const s = (t) => {
|
|
|
12
15
|
variant: "circular",
|
|
13
16
|
sx: void 0
|
|
14
17
|
},
|
|
15
|
-
view: () => /* @__PURE__ */
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(Avatar$1, { src: m.src, alt: m.alt, variant: m.variant, sx: m.sx }, m.children), "view")
|
|
19
|
+
};
|
|
20
|
+
c = useComponent(def, params);
|
|
21
|
+
m = c.model;
|
|
22
|
+
return c;
|
|
23
|
+
}, "useAvatar");
|
|
24
|
+
const Avatar = toReact(useAvatar);
|
|
25
|
+
Avatar.displayName = "Avatar";
|
|
19
26
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
Avatar,
|
|
28
|
+
useAvatar
|
|
22
29
|
};
|
|
23
30
|
//# sourceMappingURL=Avatar.es.js.map
|
package/dist/Avatar.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Avatar.es.js","sources":["../src/Avatar.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Avatar as MuiAvatar, type AvatarProps as MuiAvatarProps } from '@mui/material';\r\nimport {\r\n type ComponentStruct,\r\n type ComponentDef,\r\n type ComponentParams,\r\n type Component,\r\n type ComponentModel,\r\n} from '@actdim/dynstruct/componentModel/contracts';\r\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\r\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n src?: string;\r\n alt?: string;\r\n children?: React.ReactNode;\r\n variant?: MuiAvatarProps['variant'];\r\n sx?: MuiAvatarProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useAvatar = (params: ComponentParams<Struct>): Component<Struct> => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const def: ComponentDef<Struct> = {\r\n regType: 'Avatar',\r\n props: {\r\n src: undefined,\r\n alt: undefined,\r\n children: undefined,\r\n variant: 'circular',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiAvatar src={m.src} alt={m.alt} variant={m.variant} sx={m.sx}>\r\n {m.children}\r\n </MuiAvatar>\r\n ),\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n return c;\r\n};\r\n\r\nexport type AvatarStruct = Struct;\r\n\r\nexport const Avatar = toReact(useAvatar);\r\nAvatar.displayName = 'Avatar';\r\n"],"names":["MuiAvatar"],"mappings":";;;;;AAyBO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,KAAK;AAAA,MACL,KAAK;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA,cAACA,UAAA,EAAU,KAAK,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,SAAS,IAAI,EAAE,MACxD,EAAE,QACP,GAHE;AAAA,EAGF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAvByB;AA2BlB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Badge.es.js
CHANGED
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Badge as Badge$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useBadge = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Badge",
|
|
8
11
|
props: {
|
|
9
|
-
children: () => null,
|
|
12
|
+
children: /* @__PURE__ */ __name(() => null, "children"),
|
|
10
13
|
badgeContent: void 0,
|
|
11
14
|
color: "default",
|
|
12
15
|
variant: "standard",
|
|
13
16
|
max: 99,
|
|
14
|
-
invisible:
|
|
17
|
+
invisible: false,
|
|
15
18
|
anchorOrigin: void 0,
|
|
16
19
|
sx: void 0
|
|
17
20
|
},
|
|
18
|
-
view: () => /* @__PURE__ */
|
|
19
|
-
|
|
21
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
22
|
+
Badge$1,
|
|
20
23
|
{
|
|
21
|
-
badgeContent:
|
|
22
|
-
color:
|
|
23
|
-
variant:
|
|
24
|
-
max:
|
|
25
|
-
invisible:
|
|
26
|
-
anchorOrigin:
|
|
27
|
-
sx:
|
|
24
|
+
badgeContent: m.badgeContent,
|
|
25
|
+
color: m.color,
|
|
26
|
+
variant: m.variant,
|
|
27
|
+
max: m.max,
|
|
28
|
+
invisible: m.invisible,
|
|
29
|
+
anchorOrigin: m.anchorOrigin,
|
|
30
|
+
sx: m.sx
|
|
28
31
|
},
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
/* @__PURE__ */ React.createElement(m.children, null)
|
|
33
|
+
), "view")
|
|
34
|
+
};
|
|
35
|
+
c = useComponent(def, params);
|
|
36
|
+
m = c.model;
|
|
37
|
+
return c;
|
|
38
|
+
}, "useBadge");
|
|
39
|
+
const Badge = toReact(useBadge);
|
|
40
|
+
Badge.displayName = "Badge";
|
|
34
41
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
Badge,
|
|
43
|
+
useBadge
|
|
37
44
|
};
|
|
38
45
|
//# sourceMappingURL=Badge.es.js.map
|
package/dist/Badge.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Badge.es.js","sources":["../src/Badge.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Badge as MuiBadge, type BadgeProps as MuiBadgeProps } from '@mui/material';\r\nimport {\r\n type ComponentStruct,\r\n type ComponentDef,\r\n type ComponentParams,\r\n type Component,\r\n type ComponentModel,\r\n} from '@actdim/dynstruct/componentModel/contracts';\r\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\r\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n children: React.FC;\r\n badgeContent?: React.ReactNode;\r\n color?: MuiBadgeProps['color'];\r\n variant?: MuiBadgeProps['variant'];\r\n max?: number;\r\n invisible?: boolean;\r\n anchorOrigin?: MuiBadgeProps['anchorOrigin'];\r\n sx?: MuiBadgeProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useBadge = (params: ComponentParams<Struct>): Component<Struct> => {\r\n let c: Component<Struct>;\r\n let m: ComponentModel<Struct>;\r\n\r\n const def: ComponentDef<Struct> = {\r\n regType: 'Badge',\r\n props: {\r\n children: () => null,\r\n badgeContent: undefined,\r\n color: 'default',\r\n variant: 'standard',\r\n max: 99,\r\n invisible: false,\r\n anchorOrigin: undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiBadge\r\n badgeContent={m.badgeContent}\r\n color={m.color}\r\n variant={m.variant}\r\n max={m.max}\r\n invisible={m.invisible}\r\n anchorOrigin={m.anchorOrigin}\r\n sx={m.sx}\r\n >\r\n <m.children />\r\n </MuiBadge>\r\n ),\r\n };\r\n\r\n c = useComponent(def, params);\r\n m = c.model;\r\n return c;\r\n};\r\n\r\nexport type BadgeStruct = Struct;\r\n\r\nexport const Badge = toReact(useBadge);\r\nBadge.displayName = 'Badge';\r\n"],"names":["MuiBadge"],"mappings":";;;;;AA4BO,MAAM,WAAW,wBAAC,WAAuD;AAC5E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,UAAU,6BAAM,MAAN;AAAA,MACV,cAAc;AAAA,MACd,OAAO;AAAA,MACP,SAAS;AAAA,MACT,KAAK;AAAA,MACL,WAAW;AAAA,MACX,cAAc;AAAA,MACd,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,cAAc,EAAE;AAAA,QAChB,OAAO,EAAE;AAAA,QACT,SAAS,EAAE;AAAA,QACX,KAAK,EAAE;AAAA,QACP,WAAW,EAAE;AAAA,QACb,cAAc,EAAE;AAAA,QAChB,IAAI,EAAE;AAAA,MAAA;AAAA,MAEN,sBAAA,cAAC,EAAE,UAAF,IAAW;AAAA,IAAA,GAVd;AAAA,EAWF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAlCwB;AAsCjB,MAAM,QAAQ,QAAQ,QAAQ;AACrC,MAAM,cAAc;"}
|