@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/dist/Dialog.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Dialog.es.js","sources":["../src/Dialog.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Dialog as MuiDialog,\r\n DialogTitle,\r\n DialogContent,\r\n DialogActions,\r\n type DialogProps as MuiDialogProps,\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 open: boolean;\r\n onClose: () => void;\r\n title?: string;\r\n content?: React.FC;\r\n actions?: React.FC;\r\n maxWidth?: MuiDialogProps['maxWidth'];\r\n fullWidth?: boolean;\r\n fullScreen?: boolean;\r\n sx?: MuiDialogProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useDialog = (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: 'Dialog',\r\n props: {\r\n open: false,\r\n onClose: () => {},\r\n title: undefined,\r\n content: undefined,\r\n actions: undefined,\r\n maxWidth: 'sm',\r\n fullWidth: true,\r\n fullScreen: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiDialog\r\n open={m.open}\r\n onClose={m.onClose}\r\n maxWidth={m.maxWidth}\r\n fullWidth={m.fullWidth}\r\n fullScreen={m.fullScreen}\r\n sx={m.sx}\r\n >\r\n {m.title && <DialogTitle>{m.title}</DialogTitle>}\r\n {m.content && (\r\n <DialogContent>\r\n <m.content />\r\n </DialogContent>\r\n )}\r\n {m.actions && (\r\n <DialogActions>\r\n <m.actions />\r\n </DialogActions>\r\n )}\r\n </MuiDialog>\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 DialogStruct = Struct;\r\n\r\nexport const Dialog = toReact(useDialog);\r\nDialog.displayName = 'Dialog';\r\n"],"names":["MuiDialog"],"mappings":";;;;;AAmCO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,OAAO;AAAA,MACP,SAAS;AAAA,MACT,SAAS;AAAA,MACT,UAAU;AAAA,MACV,WAAW;AAAA,MACX,YAAY;AAAA,MACZ,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,MAAM,EAAE;AAAA,QACR,SAAS,EAAE;AAAA,QACX,UAAU,EAAE;AAAA,QACZ,WAAW,EAAE;AAAA,QACb,YAAY,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,SAAS,sBAAA,cAAC,aAAA,MAAa,EAAE,KAAM;AAAA,MACjC,EAAE,WACC,sBAAA,cAAC,eAAA,0CACI,EAAE,SAAF,IAAU,CACf;AAAA,MAEH,EAAE,WACC,sBAAA,cAAC,eAAA,0CACI,EAAE,SAAF,IAAU,CACf;AAAA,IAAA,GAlBN;AAAA,EAoBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA5CyB;AAgDlB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Drawer.es.js
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
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 { Drawer as Drawer$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useDrawer = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Drawer",
|
|
8
11
|
props: {
|
|
9
|
-
open:
|
|
10
|
-
onClose: () => {
|
|
11
|
-
},
|
|
12
|
-
children: () => null,
|
|
12
|
+
open: false,
|
|
13
|
+
onClose: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onClose"),
|
|
15
|
+
children: /* @__PURE__ */ __name(() => null, "children"),
|
|
13
16
|
anchor: "left",
|
|
14
17
|
variant: "temporary",
|
|
15
18
|
sx: void 0
|
|
16
19
|
},
|
|
17
|
-
view: () => /* @__PURE__ */
|
|
18
|
-
|
|
20
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
21
|
+
Drawer$1,
|
|
19
22
|
{
|
|
20
|
-
open:
|
|
21
|
-
onClose:
|
|
22
|
-
anchor:
|
|
23
|
-
variant:
|
|
24
|
-
sx:
|
|
23
|
+
open: m.open,
|
|
24
|
+
onClose: m.onClose,
|
|
25
|
+
anchor: m.anchor,
|
|
26
|
+
variant: m.variant,
|
|
27
|
+
sx: m.sx
|
|
25
28
|
},
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
/* @__PURE__ */ React.createElement(m.children, null)
|
|
30
|
+
), "view")
|
|
31
|
+
};
|
|
32
|
+
c = useComponent(def, params);
|
|
33
|
+
m = c.model;
|
|
34
|
+
return c;
|
|
35
|
+
}, "useDrawer");
|
|
36
|
+
const Drawer = toReact(useDrawer);
|
|
37
|
+
Drawer.displayName = "Drawer";
|
|
31
38
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
Drawer,
|
|
40
|
+
useDrawer
|
|
34
41
|
};
|
|
35
42
|
//# sourceMappingURL=Drawer.es.js.map
|
package/dist/Drawer.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Drawer.es.js","sources":["../src/Drawer.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Drawer as MuiDrawer, type DrawerProps as MuiDrawerProps } 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 open: boolean;\r\n onClose: () => void;\r\n children: React.FC;\r\n anchor?: MuiDrawerProps['anchor'];\r\n variant?: MuiDrawerProps['variant'];\r\n sx?: MuiDrawerProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useDrawer = (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: 'Drawer',\r\n props: {\r\n open: false,\r\n onClose: () => {},\r\n children: () => null,\r\n anchor: 'left',\r\n variant: 'temporary',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiDrawer\r\n open={m.open}\r\n onClose={m.onClose}\r\n anchor={m.anchor}\r\n variant={m.variant}\r\n sx={m.sx}\r\n >\r\n <m.children />\r\n </MuiDrawer>\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 DrawerStruct = Struct;\r\n\r\nexport const Drawer = toReact(useDrawer);\r\nDrawer.displayName = 'Drawer';\r\n"],"names":["MuiDrawer"],"mappings":";;;;;AA0BO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,UAAU,6BAAM,MAAN;AAAA,MACV,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,MAAM,EAAE;AAAA,QACR,SAAS,EAAE;AAAA,QACX,QAAQ,EAAE;AAAA,QACV,SAAS,EAAE;AAAA,QACX,IAAI,EAAE;AAAA,MAAA;AAAA,MAEN,sBAAA,cAAC,EAAE,UAAF,IAAW;AAAA,IAAA,GARd;AAAA,EASF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA9ByB;AAkClB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Fab.es.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
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 { Fab as Fab$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useFab = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Fab",
|
|
8
11
|
props: {
|
|
9
|
-
icon: () => null,
|
|
10
|
-
onClick: () => {
|
|
11
|
-
},
|
|
12
|
+
icon: /* @__PURE__ */ __name(() => null, "icon"),
|
|
13
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onClick"),
|
|
12
15
|
ariaLabel: "",
|
|
13
16
|
color: "primary",
|
|
14
17
|
size: "large",
|
|
@@ -16,25 +19,29 @@ const n = (o) => {
|
|
|
16
19
|
label: void 0,
|
|
17
20
|
sx: void 0
|
|
18
21
|
},
|
|
19
|
-
view: () => /* @__PURE__ */
|
|
20
|
-
|
|
22
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
23
|
+
Fab$1,
|
|
21
24
|
{
|
|
22
|
-
color:
|
|
23
|
-
size:
|
|
24
|
-
variant:
|
|
25
|
-
"aria-label":
|
|
26
|
-
disabled:
|
|
27
|
-
onClick:
|
|
28
|
-
sx:
|
|
25
|
+
color: m.color,
|
|
26
|
+
size: m.size,
|
|
27
|
+
variant: m.variant,
|
|
28
|
+
"aria-label": m.ariaLabel,
|
|
29
|
+
disabled: m.$.isDisabled,
|
|
30
|
+
onClick: m.onClick,
|
|
31
|
+
sx: m.sx
|
|
29
32
|
},
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
/* @__PURE__ */ React.createElement(m.icon, null),
|
|
34
|
+
m.variant === "extended" && m.label
|
|
35
|
+
), "view")
|
|
36
|
+
};
|
|
37
|
+
c = useComponent(def, params);
|
|
38
|
+
m = c.model;
|
|
39
|
+
return c;
|
|
40
|
+
}, "useFab");
|
|
41
|
+
const Fab = toReact(useFab);
|
|
42
|
+
Fab.displayName = "Fab";
|
|
36
43
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
Fab,
|
|
45
|
+
useFab
|
|
39
46
|
};
|
|
40
47
|
//# sourceMappingURL=Fab.es.js.map
|
package/dist/Fab.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Fab.es.js","sources":["../src/Fab.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Fab as MuiFab, type FabProps as MuiFabProps } 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 icon: React.FC;\r\n onClick: () => void;\r\n ariaLabel: string;\r\n color?: MuiFabProps['color'];\r\n size?: MuiFabProps['size'];\r\n variant?: MuiFabProps['variant'];\r\n label?: string;\r\n sx?: MuiFabProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useFab = (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: 'Fab',\r\n props: {\r\n icon: () => null,\r\n onClick: () => {},\r\n ariaLabel: '',\r\n color: 'primary',\r\n size: 'large',\r\n variant: 'circular',\r\n label: undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiFab\r\n color={m.color}\r\n size={m.size}\r\n variant={m.variant}\r\n aria-label={m.ariaLabel}\r\n disabled={m.$.isDisabled}\r\n onClick={m.onClick}\r\n sx={m.sx}\r\n >\r\n <m.icon />\r\n {m.variant === 'extended' && m.label}\r\n </MuiFab>\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 FabStruct = Struct;\r\n\r\nexport const Fab = toReact(useFab);\r\nFab.displayName = 'Fab';\r\n"],"names":["MuiFab"],"mappings":";;;;;AA4BO,MAAM,SAAS,wBAAC,WAAuD;AAC1E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,MAAM,6BAAM,MAAN;AAAA,MACN,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,WAAW;AAAA,MACX,OAAO;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,MACT,OAAO;AAAA,MACP,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,SAAS,EAAE;AAAA,QACX,cAAY,EAAE;AAAA,QACd,UAAU,EAAE,EAAE;AAAA,QACd,SAAS,EAAE;AAAA,QACX,IAAI,EAAE;AAAA,MAAA;AAAA,MAEN,sBAAA,cAAC,EAAE,MAAF,IAAO;AAAA,MACP,EAAE,YAAY,cAAc,EAAE;AAAA,IAAA,GAXjC;AAAA,EAYF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAnCsB;AAuCf,MAAM,MAAM,QAAQ,MAAM;AACjC,IAAI,cAAc;"}
|
package/dist/IconButton.es.js
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
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 { IconButton as IconButton$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useIconButton = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "IconButton",
|
|
8
11
|
props: {
|
|
9
|
-
onClick: () => {
|
|
10
|
-
},
|
|
12
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
13
|
+
}, "onClick"),
|
|
11
14
|
icon: null,
|
|
12
15
|
color: "default",
|
|
13
16
|
size: "medium",
|
|
14
|
-
edge:
|
|
15
|
-
loading:
|
|
17
|
+
edge: false,
|
|
18
|
+
loading: false,
|
|
16
19
|
"aria-label": void 0,
|
|
17
20
|
sx: void 0
|
|
18
21
|
},
|
|
19
|
-
view: () => /* @__PURE__ */
|
|
20
|
-
|
|
22
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
23
|
+
IconButton$1,
|
|
21
24
|
{
|
|
22
|
-
onClick:
|
|
23
|
-
color:
|
|
24
|
-
size:
|
|
25
|
-
edge:
|
|
26
|
-
loading:
|
|
27
|
-
disabled:
|
|
28
|
-
"aria-label":
|
|
29
|
-
sx:
|
|
25
|
+
onClick: m.onClick,
|
|
26
|
+
color: m.color,
|
|
27
|
+
size: m.size,
|
|
28
|
+
edge: m.edge,
|
|
29
|
+
loading: m.loading,
|
|
30
|
+
disabled: m.$.isDisabled,
|
|
31
|
+
"aria-label": m["aria-label"],
|
|
32
|
+
sx: m.sx
|
|
30
33
|
},
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
m.icon
|
|
35
|
+
), "view")
|
|
36
|
+
};
|
|
37
|
+
c = useComponent(def, params);
|
|
38
|
+
m = c.model;
|
|
39
|
+
return c;
|
|
40
|
+
}, "useIconButton");
|
|
41
|
+
const IconButton = toReact(useIconButton);
|
|
42
|
+
IconButton.displayName = "IconButton";
|
|
36
43
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
IconButton,
|
|
45
|
+
useIconButton
|
|
39
46
|
};
|
|
40
47
|
//# sourceMappingURL=IconButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"IconButton.es.js","sources":["../src/IconButton.tsx"],"sourcesContent":["import React from 'react';\r\nimport { IconButton as MuiIconButton, type IconButtonProps as MuiIconButtonProps } 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 onClick: () => void;\r\n icon: React.ReactNode;\r\n color?: MuiIconButtonProps['color'];\r\n size?: MuiIconButtonProps['size'];\r\n edge?: MuiIconButtonProps['edge'];\r\n loading?: boolean;\r\n 'aria-label'?: string;\r\n sx?: MuiIconButtonProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useIconButton = (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: 'IconButton',\r\n props: {\r\n onClick: () => {},\r\n icon: null,\r\n color: 'default',\r\n size: 'medium',\r\n edge: false,\r\n loading: false,\r\n 'aria-label': undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiIconButton\r\n onClick={m.onClick}\r\n color={m.color}\r\n size={m.size}\r\n edge={m.edge}\r\n loading={m.loading}\r\n disabled={m.$.isDisabled}\r\n aria-label={m['aria-label']}\r\n sx={m.sx}\r\n >\r\n {m.icon}\r\n </MuiIconButton>\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 IconButtonStruct = Struct;\r\n\r\nexport const IconButton = toReact(useIconButton);\r\nIconButton.displayName = 'IconButton';\r\n"],"names":["MuiIconButton"],"mappings":";;;;;AA4BO,MAAM,gBAAgB,wBAAC,WAAuD;AACjF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,cAAc;AAAA,MACd,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,SAAS,EAAE;AAAA,QACX,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,MAAM,EAAE;AAAA,QACR,SAAS,EAAE;AAAA,QACX,UAAU,EAAE,EAAE;AAAA,QACd,cAAY,EAAE,YAAY;AAAA,QAC1B,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE;AAAA,IAAA,GAXL;AAAA,EAYF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAnC6B;AAuCtB,MAAM,aAAa,QAAQ,aAAa;AAC/C,WAAW,cAAc;"}
|
|
@@ -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 { LinearProgress as LinearProgress$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useLinearProgress = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "LinearProgress",
|
|
8
11
|
props: {
|
|
9
12
|
variant: "indeterminate",
|
|
@@ -12,21 +15,25 @@ const n = (o) => {
|
|
|
12
15
|
color: "primary",
|
|
13
16
|
sx: void 0
|
|
14
17
|
},
|
|
15
|
-
view: () => /* @__PURE__ */
|
|
16
|
-
|
|
18
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
19
|
+
LinearProgress$1,
|
|
17
20
|
{
|
|
18
|
-
variant:
|
|
19
|
-
value:
|
|
20
|
-
valueBuffer:
|
|
21
|
-
color:
|
|
22
|
-
sx:
|
|
21
|
+
variant: m.variant,
|
|
22
|
+
value: m.value,
|
|
23
|
+
valueBuffer: m.valueBuffer,
|
|
24
|
+
color: m.color,
|
|
25
|
+
sx: m.sx
|
|
23
26
|
}
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
), "view")
|
|
28
|
+
};
|
|
29
|
+
c = useComponent(def, params);
|
|
30
|
+
m = c.model;
|
|
31
|
+
return c;
|
|
32
|
+
}, "useLinearProgress");
|
|
33
|
+
const LinearProgress = toReact(useLinearProgress);
|
|
34
|
+
LinearProgress.displayName = "LinearProgress";
|
|
28
35
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
LinearProgress,
|
|
37
|
+
useLinearProgress
|
|
31
38
|
};
|
|
32
39
|
//# sourceMappingURL=LinearProgress.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinearProgress.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"LinearProgress.es.js","sources":["../src/LinearProgress.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n LinearProgress as MuiLinearProgress,\r\n type LinearProgressProps as MuiLinearProgressProps,\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 variant?: MuiLinearProgressProps['variant'];\r\n value?: number;\r\n valueBuffer?: number;\r\n color?: MuiLinearProgressProps['color'];\r\n sx?: MuiLinearProgressProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useLinearProgress = (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: 'LinearProgress',\r\n props: {\r\n variant: 'indeterminate',\r\n value: undefined,\r\n valueBuffer: undefined,\r\n color: 'primary',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiLinearProgress\r\n variant={m.variant}\r\n value={m.value}\r\n valueBuffer={m.valueBuffer}\r\n color={m.color}\r\n sx={m.sx}\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 LinearProgressStruct = Struct;\r\n\r\nexport const LinearProgress = toReact(useLinearProgress);\r\nLinearProgress.displayName = 'LinearProgress';\r\n"],"names":["MuiLinearProgress"],"mappings":";;;;;AA4BO,MAAM,oBAAoB,wBAAC,WAAuD;AACrF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS;AAAA,MACT,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;AAAA,MACP,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,SAAS,EAAE;AAAA,QACX,OAAO,EAAE;AAAA,QACT,aAAa,EAAE;AAAA,QACf,OAAO,EAAE;AAAA,QACT,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GANR;AAAA,EAOF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA3BiC;AA+B1B,MAAM,iBAAiB,QAAQ,iBAAiB;AACvD,eAAe,cAAc;"}
|
package/dist/List.es.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
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 { List as List$1, Divider, ListItem, ListItemButton, ListItemIcon, ListItemText } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useList = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "List",
|
|
8
11
|
props: {
|
|
9
12
|
items: [],
|
|
10
|
-
dense:
|
|
11
|
-
disablePadding:
|
|
13
|
+
dense: false,
|
|
14
|
+
disablePadding: false,
|
|
12
15
|
sx: void 0
|
|
13
16
|
},
|
|
14
|
-
view: () => /* @__PURE__ */
|
|
15
|
-
(
|
|
16
|
-
))
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(List$1, { dense: m.dense, disablePadding: m.disablePadding, sx: m.sx }, m.items.map(
|
|
18
|
+
(item, i) => item.divider ? /* @__PURE__ */ React.createElement(Divider, { key: i, component: "li" }) : item.onClick ? /* @__PURE__ */ React.createElement(ListItem, { key: i, disablePadding: true }, /* @__PURE__ */ React.createElement(ListItemButton, { onClick: item.onClick, disabled: item.disabled }, item.icon && /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(item.icon, null)), /* @__PURE__ */ React.createElement(ListItemText, { primary: item.primary, secondary: item.secondary }))) : /* @__PURE__ */ React.createElement(ListItem, { key: i }, item.icon && /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(item.icon, null)), /* @__PURE__ */ React.createElement(ListItemText, { primary: item.primary, secondary: item.secondary }))
|
|
19
|
+
)), "view")
|
|
20
|
+
};
|
|
21
|
+
c = useComponent(def, params);
|
|
22
|
+
m = c.model;
|
|
23
|
+
return c;
|
|
24
|
+
}, "useList");
|
|
25
|
+
const List = toReact(useList);
|
|
26
|
+
List.displayName = "List";
|
|
20
27
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
List,
|
|
29
|
+
useList
|
|
23
30
|
};
|
|
24
31
|
//# sourceMappingURL=List.es.js.map
|
package/dist/List.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"List.es.js","sources":["../src/List.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n List as MuiList,\r\n ListItem,\r\n ListItemButton,\r\n ListItemIcon,\r\n ListItemText,\r\n Divider,\r\n type ListProps as MuiListProps,\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\nexport type ListItemDef = {\r\n primary: React.ReactNode;\r\n secondary?: React.ReactNode;\r\n icon?: React.FC;\r\n onClick?: () => void;\r\n divider?: boolean;\r\n disabled?: boolean;\r\n};\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n items: ListItemDef[];\r\n dense?: boolean;\r\n disablePadding?: boolean;\r\n sx?: MuiListProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useList = (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: 'List',\r\n props: {\r\n items: [],\r\n dense: false,\r\n disablePadding: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiList dense={m.dense} disablePadding={m.disablePadding} sx={m.sx}>\r\n {m.items.map((item, i) =>\r\n item.divider ? (\r\n <Divider key={i} component=\"li\" />\r\n ) : item.onClick ? (\r\n <ListItem key={i} disablePadding>\r\n <ListItemButton onClick={item.onClick} disabled={item.disabled}>\r\n {item.icon && (\r\n <ListItemIcon>\r\n <item.icon />\r\n </ListItemIcon>\r\n )}\r\n <ListItemText primary={item.primary} secondary={item.secondary} />\r\n </ListItemButton>\r\n </ListItem>\r\n ) : (\r\n <ListItem key={i}>\r\n {item.icon && (\r\n <ListItemIcon>\r\n <item.icon />\r\n </ListItemIcon>\r\n )}\r\n <ListItemText primary={item.primary} secondary={item.secondary} />\r\n </ListItem>\r\n ),\r\n )}\r\n </MuiList>\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 ListStruct = Struct;\r\n\r\nexport const List = toReact(useList);\r\nList.displayName = 'List';\r\n"],"names":["MuiList"],"mappings":";;;;;AAyCO,MAAM,UAAU,wBAAC,WAAuD;AAC3E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO,CAAA;AAAA,MACP,OAAO;AAAA,MACP,gBAAgB;AAAA,MAChB,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA,cAACA,QAAA,EAAQ,OAAO,EAAE,OAAO,gBAAgB,EAAE,gBAAgB,IAAI,EAAE,MAC5D,EAAE,MAAM;AAAA,MAAI,CAAC,MAAM,MAChB,KAAK,UACD,sBAAA,cAAC,SAAA,EAAQ,KAAK,GAAG,WAAU,KAAA,CAAK,IAChC,KAAK,UACL,sBAAA,cAAC,UAAA,EAAS,KAAK,GAAG,gBAAc,KAAA,GAC5B,sBAAA,cAAC,gBAAA,EAAe,SAAS,KAAK,SAAS,UAAU,KAAK,YACjD,KAAK,QACF,sBAAA,cAAC,cAAA,0CACI,KAAK,MAAL,IAAU,CACf,GAEJ,sBAAA,cAAC,cAAA,EAAa,SAAS,KAAK,SAAS,WAAW,KAAK,UAAA,CAAW,CACpE,CACJ,IAEA,sBAAA,cAAC,UAAA,EAAS,KAAK,EAAA,GACV,KAAK,QACF,sBAAA,cAAC,cAAA,MACG,sBAAA,cAAC,KAAK,MAAL,IAAU,CACf,GAEJ,sBAAA,cAAC,cAAA,EAAa,SAAS,KAAK,SAAS,WAAW,KAAK,WAAW,CACpE;AAAA,IAAA,CAGZ,GA3BE;AAAA,EA2BF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA9CuB;AAkDhB,MAAM,OAAO,QAAQ,OAAO;AACnC,KAAK,cAAc;"}
|
package/dist/Menu.es.js
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
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 { Menu as Menu$1, Divider, MenuItem } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useMenu = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Menu",
|
|
8
11
|
props: {
|
|
9
|
-
open:
|
|
10
|
-
onClose: () => {
|
|
11
|
-
},
|
|
12
|
+
open: false,
|
|
13
|
+
onClose: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onClose"),
|
|
12
15
|
items: [],
|
|
13
16
|
anchorEl: null,
|
|
14
17
|
sx: void 0
|
|
15
18
|
},
|
|
16
|
-
view: () => /* @__PURE__ */
|
|
17
|
-
(
|
|
18
|
-
|
|
19
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(Menu$1, { open: m.open, onClose: m.onClose, anchorEl: m.anchorEl, sx: m.sx }, m.items.map(
|
|
20
|
+
(item, i) => item.divider ? /* @__PURE__ */ React.createElement(Divider, { key: i }) : /* @__PURE__ */ React.createElement(
|
|
21
|
+
MenuItem,
|
|
19
22
|
{
|
|
20
|
-
key:
|
|
21
|
-
onClick: () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
key: i,
|
|
24
|
+
onClick: /* @__PURE__ */ __name(() => {
|
|
25
|
+
item.onClick?.();
|
|
26
|
+
m.onClose();
|
|
27
|
+
}, "onClick"),
|
|
28
|
+
disabled: item.disabled
|
|
25
29
|
},
|
|
26
|
-
|
|
30
|
+
item.label
|
|
27
31
|
)
|
|
28
|
-
))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
)), "view")
|
|
33
|
+
};
|
|
34
|
+
c = useComponent(def, params);
|
|
35
|
+
m = c.model;
|
|
36
|
+
return c;
|
|
37
|
+
}, "useMenu");
|
|
38
|
+
const Menu = toReact(useMenu);
|
|
39
|
+
Menu.displayName = "Menu";
|
|
32
40
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
Menu,
|
|
42
|
+
useMenu
|
|
35
43
|
};
|
|
36
44
|
//# sourceMappingURL=Menu.es.js.map
|
package/dist/Menu.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Menu.es.js","sources":["../src/Menu.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Menu as MuiMenu,\r\n MenuItem as MuiMenuItem,\r\n Divider,\r\n type MenuProps as MuiMenuProps,\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\nexport type MenuItemDef = {\r\n label: string;\r\n onClick?: () => void;\r\n disabled?: boolean;\r\n divider?: boolean;\r\n};\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n open: boolean;\r\n onClose: () => void;\r\n items: MenuItemDef[];\r\n anchorEl?: HTMLElement | null; // ElementCSSInlineStyle etc to support KeyPath \"anchorEl.*\"\r\n sx?: MuiMenuProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useMenu = (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: 'Menu',\r\n props: {\r\n open: false,\r\n onClose: () => {},\r\n items: [],\r\n anchorEl: null,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiMenu open={m.open} onClose={m.onClose} anchorEl={m.anchorEl} sx={m.sx}>\r\n {m.items.map((item, i) =>\r\n item.divider ? (\r\n <Divider key={i} />\r\n ) : (\r\n <MuiMenuItem\r\n key={i}\r\n onClick={() => {\r\n item.onClick?.();\r\n m.onClose();\r\n }}\r\n disabled={item.disabled}\r\n >\r\n {item.label}\r\n </MuiMenuItem>\r\n ),\r\n )}\r\n </MuiMenu>\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 MenuStruct = Struct;\r\n\r\nexport const Menu = toReact(useMenu);\r\nMenu.displayName = 'Menu';\r\n"],"names":["MuiMenu","MuiMenuItem"],"mappings":";;;;;AAqCO,MAAM,UAAU,wBAAC,WAAuD;AAC3E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,OAAO,CAAA;AAAA,MACP,UAAU;AAAA,MACV,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA,cAACA,QAAA,EAAQ,MAAM,EAAE,MAAM,SAAS,EAAE,SAAS,UAAU,EAAE,UAAU,IAAI,EAAE,GAAA,GAClE,EAAE,MAAM;AAAA,MAAI,CAAC,MAAM,MAChB,KAAK,UACD,sBAAA,cAAC,SAAA,EAAQ,KAAK,GAAG,IAEjB,sBAAA;AAAA,QAACC;AAAAA,QAAA;AAAA,UACG,KAAK;AAAA,UACL,SAAS,6BAAM;AACX,iBAAK,UAAA;AACL,cAAE,QAAA;AAAA,UACN,GAHS;AAAA,UAIT,UAAU,KAAK;AAAA,QAAA;AAAA,QAEd,KAAK;AAAA,MAAA;AAAA,IACV,CAGZ,GAlBE;AAAA,EAkBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAtCuB;AA0ChB,MAAM,OAAO,QAAQ,OAAO;AACnC,KAAK,cAAc;"}
|
package/dist/Pagination.es.js
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
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 { Pagination as Pagination$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const usePagination = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Pagination",
|
|
8
11
|
props: {
|
|
9
12
|
count: 1,
|
|
10
13
|
page: 1,
|
|
11
|
-
onChange: () => {
|
|
12
|
-
},
|
|
14
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
15
|
+
}, "onChange"),
|
|
13
16
|
size: "medium",
|
|
14
17
|
color: "standard",
|
|
15
18
|
shape: "circular",
|
|
16
19
|
variant: "text",
|
|
17
20
|
sx: void 0
|
|
18
21
|
},
|
|
19
|
-
view: () => /* @__PURE__ */
|
|
20
|
-
|
|
22
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
23
|
+
Pagination$1,
|
|
21
24
|
{
|
|
22
|
-
count:
|
|
23
|
-
page:
|
|
24
|
-
onChange: (
|
|
25
|
-
size:
|
|
26
|
-
color:
|
|
27
|
-
shape:
|
|
28
|
-
variant:
|
|
29
|
-
disabled:
|
|
30
|
-
sx:
|
|
25
|
+
count: m.count,
|
|
26
|
+
page: m.page,
|
|
27
|
+
onChange: /* @__PURE__ */ __name((_, page) => m.onChange(page), "onChange"),
|
|
28
|
+
size: m.size,
|
|
29
|
+
color: m.color,
|
|
30
|
+
shape: m.shape,
|
|
31
|
+
variant: m.variant,
|
|
32
|
+
disabled: m.$.isDisabled,
|
|
33
|
+
sx: m.sx
|
|
31
34
|
}
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
), "view")
|
|
36
|
+
};
|
|
37
|
+
c = useComponent(def, params);
|
|
38
|
+
m = c.model;
|
|
39
|
+
return c;
|
|
40
|
+
}, "usePagination");
|
|
41
|
+
const Pagination = toReact(usePagination);
|
|
42
|
+
Pagination.displayName = "Pagination";
|
|
36
43
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
Pagination,
|
|
45
|
+
usePagination
|
|
39
46
|
};
|
|
40
47
|
//# sourceMappingURL=Pagination.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Pagination.es.js","sources":["../src/Pagination.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Pagination as MuiPagination, type PaginationProps as MuiPaginationProps } 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 count: number;\r\n page: number;\r\n onChange: (page: number) => void;\r\n size?: MuiPaginationProps['size'];\r\n color?: MuiPaginationProps['color'];\r\n shape?: MuiPaginationProps['shape'];\r\n variant?: MuiPaginationProps['variant'];\r\n sx?: MuiPaginationProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const usePagination = (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: 'Pagination',\r\n props: {\r\n count: 1,\r\n page: 1,\r\n onChange: () => {},\r\n size: 'medium',\r\n color: 'standard',\r\n shape: 'circular',\r\n variant: 'text',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiPagination\r\n count={m.count}\r\n page={m.page}\r\n onChange={(_, page) => m.onChange(page)}\r\n size={m.size}\r\n color={m.color}\r\n shape={m.shape}\r\n variant={m.variant}\r\n disabled={m.$.isDisabled}\r\n sx={m.sx}\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 PaginationStruct = Struct;\r\n\r\nexport const Pagination = toReact(usePagination);\r\nPagination.displayName = 'Pagination';\r\n"],"names":["MuiPagination"],"mappings":";;;;;AA4BO,MAAM,gBAAgB,wBAAC,WAAuD;AACjF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,MAAM;AAAA,MACN,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,SAAS;AAAA,MACT,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,UAAU,wBAAC,GAAG,SAAS,EAAE,SAAS,IAAI,GAA5B;AAAA,QACV,MAAM,EAAE;AAAA,QACR,OAAO,EAAE;AAAA,QACT,OAAO,EAAE;AAAA,QACT,SAAS,EAAE;AAAA,QACX,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GAVR;AAAA,EAWF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAlC6B;AAsCtB,MAAM,aAAa,QAAQ,aAAa;AAC/C,WAAW,cAAc;"}
|