@actdim/dynstruct-mui 0.9.0 → 0.9.2
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/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 +101 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +6 -7
- 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 -1
- package/dist/index.d.ts.map +0 -1
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":["D:/Src/my/actdim/public/dynstruct-mui/src/IconButton.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"IconButton.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/IconButton.tsx"],"sourcesContent":["import React from 'react';\nimport { IconButton as MuiIconButton, type IconButtonProps as MuiIconButtonProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n onClick: () => void;\n icon: React.ReactNode;\n color?: MuiIconButtonProps['color'];\n size?: MuiIconButtonProps['size'];\n edge?: MuiIconButtonProps['edge'];\n loading?: boolean;\n 'aria-label'?: string;\n sx?: MuiIconButtonProps['sx'];\n };\n }\n>;\n\nexport const useIconButton = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'IconButton',\n props: {\n onClick: () => {},\n icon: null,\n color: 'default',\n size: 'medium',\n edge: false,\n loading: false,\n 'aria-label': undefined,\n sx: undefined,\n },\n view: () => (\n <MuiIconButton\n onClick={m.onClick}\n color={m.color}\n size={m.size}\n edge={m.edge}\n loading={m.loading}\n disabled={m.$.isDisabled}\n aria-label={m['aria-label']}\n sx={m.sx}\n >\n {m.icon}\n </MuiIconButton>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type IconButtonStruct = Struct;\n\nexport const IconButton = toReact(useIconButton);\nIconButton.displayName = 'IconButton';\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":["D:/Src/my/actdim/public/dynstruct-mui/src/LinearProgress.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"LinearProgress.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/LinearProgress.tsx"],"sourcesContent":["import React from 'react';\nimport {\n LinearProgress as MuiLinearProgress,\n type LinearProgressProps as MuiLinearProgressProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n variant?: MuiLinearProgressProps['variant'];\n value?: number;\n valueBuffer?: number;\n color?: MuiLinearProgressProps['color'];\n sx?: MuiLinearProgressProps['sx'];\n };\n }\n>;\n\nexport const useLinearProgress = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'LinearProgress',\n props: {\n variant: 'indeterminate',\n value: undefined,\n valueBuffer: undefined,\n color: 'primary',\n sx: undefined,\n },\n view: () => (\n <MuiLinearProgress\n variant={m.variant}\n value={m.value}\n valueBuffer={m.valueBuffer}\n color={m.color}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type LinearProgressStruct = Struct;\n\nexport const LinearProgress = toReact(useLinearProgress);\nLinearProgress.displayName = 'LinearProgress';\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":["D:/Src/my/actdim/public/dynstruct-mui/src/List.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"List.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/List.tsx"],"sourcesContent":["import React from 'react';\nimport {\n List as MuiList,\n ListItem,\n ListItemButton,\n ListItemIcon,\n ListItemText,\n Divider,\n type ListProps as MuiListProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type ListItemDef = {\n primary: React.ReactNode;\n secondary?: React.ReactNode;\n icon?: React.FC;\n onClick?: () => void;\n divider?: boolean;\n disabled?: boolean;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n items: ListItemDef[];\n dense?: boolean;\n disablePadding?: boolean;\n sx?: MuiListProps['sx'];\n };\n }\n>;\n\nexport const useList = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'List',\n props: {\n items: [],\n dense: false,\n disablePadding: false,\n sx: undefined,\n },\n view: () => (\n <MuiList dense={m.dense} disablePadding={m.disablePadding} sx={m.sx}>\n {m.items.map((item, i) =>\n item.divider ? (\n <Divider key={i} component=\"li\" />\n ) : item.onClick ? (\n <ListItem key={i} disablePadding>\n <ListItemButton onClick={item.onClick} disabled={item.disabled}>\n {item.icon && (\n <ListItemIcon>\n <item.icon />\n </ListItemIcon>\n )}\n <ListItemText primary={item.primary} secondary={item.secondary} />\n </ListItemButton>\n </ListItem>\n ) : (\n <ListItem key={i}>\n {item.icon && (\n <ListItemIcon>\n <item.icon />\n </ListItemIcon>\n )}\n <ListItemText primary={item.primary} secondary={item.secondary} />\n </ListItem>\n ),\n )}\n </MuiList>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type ListStruct = Struct;\n\nexport const List = toReact(useList);\nList.displayName = 'List';\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":["D:/Src/my/actdim/public/dynstruct-mui/src/Menu.tsx"],"sourcesContent":null
|
|
1
|
+
{"version":3,"file":"Menu.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/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":["D:/Src/my/actdim/public/dynstruct-mui/src/Pagination.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"Pagination.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Pagination.tsx"],"sourcesContent":["import React from 'react';\nimport { Pagination as MuiPagination, type PaginationProps as MuiPaginationProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n count: number;\n page: number;\n onChange: (page: number) => void;\n size?: MuiPaginationProps['size'];\n color?: MuiPaginationProps['color'];\n shape?: MuiPaginationProps['shape'];\n variant?: MuiPaginationProps['variant'];\n sx?: MuiPaginationProps['sx'];\n };\n }\n>;\n\nexport const usePagination = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Pagination',\n props: {\n count: 1,\n page: 1,\n onChange: () => {},\n size: 'medium',\n color: 'standard',\n shape: 'circular',\n variant: 'text',\n sx: undefined,\n },\n view: () => (\n <MuiPagination\n count={m.count}\n page={m.page}\n onChange={(_, page) => m.onChange(page)}\n size={m.size}\n color={m.color}\n shape={m.shape}\n variant={m.variant}\n disabled={m.$.isDisabled}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type PaginationStruct = Struct;\n\nexport const Pagination = toReact(usePagination);\nPagination.displayName = 'Pagination';\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;"}
|
package/dist/RadioGroup.es.js
CHANGED
|
@@ -1,50 +1,57 @@
|
|
|
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 { FormControl, FormLabel, RadioGroup as RadioGroup$1, FormControlLabel, Radio, FormHelperText } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useRadioGroup = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "RadioGroup",
|
|
8
11
|
props: {
|
|
9
12
|
value: "",
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
options: [],
|
|
13
16
|
label: void 0,
|
|
14
17
|
helperText: void 0,
|
|
15
|
-
error:
|
|
16
|
-
row:
|
|
18
|
+
error: false,
|
|
19
|
+
row: false,
|
|
17
20
|
color: "primary",
|
|
18
21
|
size: "medium",
|
|
19
22
|
sx: void 0
|
|
20
23
|
},
|
|
21
|
-
view: () => {
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
|
|
24
|
+
view: /* @__PURE__ */ __name(() => {
|
|
25
|
+
const labelId = `${c.id}-label`;
|
|
26
|
+
return /* @__PURE__ */ React.createElement(FormControl, { error: m.error, disabled: m.$.isDisabled, sx: m.sx }, m.label && /* @__PURE__ */ React.createElement(FormLabel, { id: labelId }, m.label), /* @__PURE__ */ React.createElement(
|
|
27
|
+
RadioGroup$1,
|
|
25
28
|
{
|
|
26
|
-
"aria-labelledby":
|
|
27
|
-
name:
|
|
28
|
-
value:
|
|
29
|
-
onChange: (
|
|
30
|
-
row:
|
|
29
|
+
"aria-labelledby": m.label ? labelId : void 0,
|
|
30
|
+
name: c.id,
|
|
31
|
+
value: m.value,
|
|
32
|
+
onChange: /* @__PURE__ */ __name((e) => m.onChange(e.target.value), "onChange"),
|
|
33
|
+
row: m.row
|
|
31
34
|
},
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
m.options.map((opt) => /* @__PURE__ */ React.createElement(
|
|
36
|
+
FormControlLabel,
|
|
34
37
|
{
|
|
35
|
-
key:
|
|
36
|
-
value:
|
|
37
|
-
label:
|
|
38
|
-
control: /* @__PURE__ */
|
|
38
|
+
key: opt.value,
|
|
39
|
+
value: opt.value,
|
|
40
|
+
label: opt.label,
|
|
41
|
+
control: /* @__PURE__ */ React.createElement(Radio, { color: m.color, size: m.size })
|
|
39
42
|
}
|
|
40
43
|
))
|
|
41
|
-
),
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
), m.helperText && /* @__PURE__ */ React.createElement(FormHelperText, null, m.helperText));
|
|
45
|
+
}, "view")
|
|
46
|
+
};
|
|
47
|
+
c = useComponent(def, params);
|
|
48
|
+
m = c.model;
|
|
49
|
+
return c;
|
|
50
|
+
}, "useRadioGroup");
|
|
51
|
+
const RadioGroup = toReact(useRadioGroup);
|
|
52
|
+
RadioGroup.displayName = "RadioGroup";
|
|
46
53
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
RadioGroup,
|
|
55
|
+
useRadioGroup
|
|
49
56
|
};
|
|
50
57
|
//# sourceMappingURL=RadioGroup.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/RadioGroup.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"RadioGroup.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/RadioGroup.tsx"],"sourcesContent":["import React from 'react';\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup as MuiRadioGroup,\n type RadioProps as MuiRadioProps,\n type FormControlProps as MuiFormControlProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type RadioOption = {\n value: string;\n label: string;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string;\n onChange: (value: string) => void;\n options: RadioOption[];\n label?: string;\n helperText?: string;\n error?: boolean;\n row?: boolean;\n color?: MuiRadioProps['color'];\n size?: MuiRadioProps['size'];\n sx?: MuiFormControlProps['sx'];\n };\n }\n>;\n\nexport const useRadioGroup = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'RadioGroup',\n props: {\n value: '',\n onChange: () => {},\n options: [],\n label: undefined,\n helperText: undefined,\n error: false,\n row: false,\n color: 'primary',\n size: 'medium',\n sx: undefined,\n },\n view: () => {\n const labelId = `${c.id}-label`;\n return (\n <FormControl error={m.error} disabled={m.$.isDisabled} sx={m.sx}>\n {m.label && <FormLabel id={labelId}>{m.label}</FormLabel>}\n <MuiRadioGroup\n aria-labelledby={m.label ? labelId : undefined}\n name={c.id}\n value={m.value}\n onChange={(e) => m.onChange(e.target.value)}\n row={m.row}\n >\n {m.options.map((opt) => (\n <FormControlLabel\n key={opt.value}\n value={opt.value}\n label={opt.label}\n control={<Radio color={m.color} size={m.size} />}\n />\n ))}\n </MuiRadioGroup>\n {m.helperText && <FormHelperText>{m.helperText}</FormHelperText>}\n </FormControl>\n );\n },\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type RadioGroupStruct = Struct;\n\nexport const RadioGroup = toReact(useRadioGroup);\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["MuiRadioGroup"],"mappings":";;;;;AA4CO,MAAM,gBAAgB,wBAAC,WAAuD;AACjF,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,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BAAM;AACR,YAAM,UAAU,GAAG,EAAE,EAAE;AACvB,aACI,sBAAA,cAAC,eAAY,OAAO,EAAE,OAAO,UAAU,EAAE,EAAE,YAAY,IAAI,EAAE,GAAA,GACxD,EAAE,SAAS,sBAAA,cAAC,WAAA,EAAU,IAAI,QAAA,GAAU,EAAE,KAAM,GAC7C,sBAAA;AAAA,QAACA;AAAAA,QAAA;AAAA,UACG,mBAAiB,EAAE,QAAQ,UAAU;AAAA,UACrC,MAAM,EAAE;AAAA,UACR,OAAO,EAAE;AAAA,UACT,UAAU,wBAAC,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,GAAhC;AAAA,UACV,KAAK,EAAE;AAAA,QAAA;AAAA,QAEN,EAAE,QAAQ,IAAI,CAAC,QACZ,sBAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,KAAK,IAAI;AAAA,YACT,OAAO,IAAI;AAAA,YACX,OAAO,IAAI;AAAA,YACX,6CAAU,OAAA,EAAM,OAAO,EAAE,OAAO,MAAM,EAAE,KAAA,CAAM;AAAA,UAAA;AAAA,QAAA,CAErD;AAAA,MAAA,GAEJ,EAAE,kDAAe,gBAAA,MAAgB,EAAE,UAAW,CACnD;AAAA,IAER,GAxBM;AAAA,EAwBN;AAGJ,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhD6B;AAoDtB,MAAM,aAAa,QAAQ,aAAa;AAC/C,WAAW,cAAc;"}
|
package/dist/Rating.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 { Rating as Rating$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useRating = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Rating",
|
|
8
11
|
props: {
|
|
9
12
|
value: null,
|
|
@@ -11,27 +14,31 @@ const l = (i) => {
|
|
|
11
14
|
max: 5,
|
|
12
15
|
precision: 1,
|
|
13
16
|
size: "medium",
|
|
14
|
-
readOnly:
|
|
17
|
+
readOnly: false,
|
|
15
18
|
sx: void 0
|
|
16
19
|
},
|
|
17
|
-
view: () => /* @__PURE__ */
|
|
18
|
-
|
|
20
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
21
|
+
Rating$1,
|
|
19
22
|
{
|
|
20
|
-
value:
|
|
21
|
-
onChange: (
|
|
22
|
-
max:
|
|
23
|
-
precision:
|
|
24
|
-
size:
|
|
25
|
-
readOnly:
|
|
26
|
-
disabled:
|
|
27
|
-
sx:
|
|
23
|
+
value: m.value,
|
|
24
|
+
onChange: /* @__PURE__ */ __name((_, newValue) => m.onChange?.(newValue), "onChange"),
|
|
25
|
+
max: m.max,
|
|
26
|
+
precision: m.precision,
|
|
27
|
+
size: m.size,
|
|
28
|
+
readOnly: m.readOnly,
|
|
29
|
+
disabled: m.$.isDisabled,
|
|
30
|
+
sx: m.sx
|
|
28
31
|
}
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
m
|
|
32
|
+
), "view")
|
|
33
|
+
};
|
|
34
|
+
c = useComponent(def, params);
|
|
35
|
+
m = c.model;
|
|
36
|
+
return c;
|
|
37
|
+
}, "useRating");
|
|
38
|
+
const Rating = toReact(useRating);
|
|
39
|
+
Rating.displayName = "Rating";
|
|
33
40
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
Rating,
|
|
42
|
+
useRating
|
|
36
43
|
};
|
|
37
44
|
//# sourceMappingURL=Rating.es.js.map
|
package/dist/Rating.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rating.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Rating.tsx"],"sourcesContent":
|
|
1
|
+
{"version":3,"file":"Rating.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Rating.tsx"],"sourcesContent":["import React from 'react';\nimport { Rating as MuiRating, type RatingProps as MuiRatingProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: number | null;\n onChange?: (value: number | null) => void;\n max?: number;\n precision?: number;\n size?: MuiRatingProps['size'];\n readOnly?: boolean;\n sx?: MuiRatingProps['sx'];\n };\n }\n>;\n\nexport const useRating = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Rating',\n props: {\n value: null,\n onChange: undefined,\n max: 5,\n precision: 1,\n size: 'medium',\n readOnly: false,\n sx: undefined,\n },\n view: () => (\n <MuiRating\n value={m.value}\n onChange={(_, newValue) => m.onChange?.(newValue)}\n max={m.max}\n precision={m.precision}\n size={m.size}\n readOnly={m.readOnly}\n disabled={m.$.isDisabled}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type RatingStruct = Struct;\n\nexport const Rating = toReact(useRating);\nRating.displayName = 'Rating';\n"],"names":["MuiRating"],"mappings":";;;;;AA2BO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa,EAAE,WAAW,QAAQ,GAAtC;AAAA,QACV,KAAK,EAAE;AAAA,QACP,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,UAAU,EAAE;AAAA,QACZ,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GATR;AAAA,EAUF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhCyB;AAoClB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|