@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/SpeedDial.es.js
CHANGED
|
@@ -1,42 +1,49 @@
|
|
|
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 { SpeedDial as SpeedDial$1, SpeedDialIcon, SpeedDialAction } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSpeedDial = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "SpeedDial",
|
|
8
11
|
props: {
|
|
9
12
|
ariaLabel: "",
|
|
10
13
|
actions: [],
|
|
11
14
|
icon: void 0,
|
|
12
15
|
direction: "up",
|
|
13
|
-
hidden:
|
|
16
|
+
hidden: false,
|
|
14
17
|
sx: void 0
|
|
15
18
|
},
|
|
16
|
-
view: () => /* @__PURE__ */
|
|
17
|
-
|
|
19
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
20
|
+
SpeedDial$1,
|
|
18
21
|
{
|
|
19
|
-
ariaLabel:
|
|
20
|
-
icon:
|
|
21
|
-
direction:
|
|
22
|
-
hidden:
|
|
23
|
-
sx:
|
|
22
|
+
ariaLabel: m.ariaLabel,
|
|
23
|
+
icon: m.icon ? /* @__PURE__ */ React.createElement(m.icon, null) : /* @__PURE__ */ React.createElement(SpeedDialIcon, null),
|
|
24
|
+
direction: m.direction,
|
|
25
|
+
hidden: m.hidden,
|
|
26
|
+
sx: m.sx
|
|
24
27
|
},
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
m.actions.map((action) => /* @__PURE__ */ React.createElement(
|
|
29
|
+
SpeedDialAction,
|
|
27
30
|
{
|
|
28
|
-
key:
|
|
29
|
-
icon: /* @__PURE__ */
|
|
30
|
-
title:
|
|
31
|
-
onClick:
|
|
31
|
+
key: action.name,
|
|
32
|
+
icon: /* @__PURE__ */ React.createElement(action.icon, null),
|
|
33
|
+
title: action.name,
|
|
34
|
+
onClick: action.onClick
|
|
32
35
|
}
|
|
33
36
|
))
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
m
|
|
37
|
+
), "view")
|
|
38
|
+
};
|
|
39
|
+
c = useComponent(def, params);
|
|
40
|
+
m = c.model;
|
|
41
|
+
return c;
|
|
42
|
+
}, "useSpeedDial");
|
|
43
|
+
const SpeedDial = toReact(useSpeedDial);
|
|
44
|
+
SpeedDial.displayName = "SpeedDial";
|
|
38
45
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
SpeedDial,
|
|
47
|
+
useSpeedDial
|
|
41
48
|
};
|
|
42
49
|
//# sourceMappingURL=SpeedDial.es.js.map
|
package/dist/SpeedDial.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpeedDial.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"SpeedDial.es.js","sources":["../src/SpeedDial.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n SpeedDial as MuiSpeedDial,\r\n SpeedDialAction,\r\n SpeedDialIcon,\r\n type SpeedDialProps as MuiSpeedDialProps,\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 SpeedDialActionDef = {\r\n name: string;\r\n icon: React.FC;\r\n onClick?: () => void;\r\n};\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n ariaLabel: string;\r\n actions: SpeedDialActionDef[];\r\n icon?: React.FC;\r\n direction?: MuiSpeedDialProps['direction'];\r\n hidden?: boolean;\r\n sx?: MuiSpeedDialProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSpeedDial = (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: 'SpeedDial',\r\n props: {\r\n ariaLabel: '',\r\n actions: [],\r\n icon: undefined,\r\n direction: 'up',\r\n hidden: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiSpeedDial\r\n ariaLabel={m.ariaLabel}\r\n icon={m.icon ? <m.icon /> : <SpeedDialIcon />}\r\n direction={m.direction}\r\n hidden={m.hidden}\r\n sx={m.sx}\r\n >\r\n {m.actions.map((action) => (\r\n <SpeedDialAction\r\n key={action.name}\r\n icon={<action.icon />}\r\n title={action.name}\r\n onClick={action.onClick}\r\n />\r\n ))}\r\n </MuiSpeedDial>\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 SpeedDialStruct = Struct;\r\n\r\nexport const SpeedDial = toReact(useSpeedDial);\r\nSpeedDial.displayName = 'SpeedDial';\r\n"],"names":["MuiSpeedDial"],"mappings":";;;;;AAqCO,MAAM,eAAe,wBAAC,WAAuD;AAChF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,WAAW;AAAA,MACX,SAAS,CAAA;AAAA,MACT,MAAM;AAAA,MACN,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,WAAW,EAAE;AAAA,QACb,MAAM,EAAE,OAAO,sBAAA,cAAC,EAAE,MAAF,IAAO,IAAK,sBAAA,cAAC,eAAA,IAAc;AAAA,QAC3C,WAAW,EAAE;AAAA,QACb,QAAQ,EAAE;AAAA,QACV,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,QAAQ,IAAI,CAAC,WACZ,sBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,KAAK,OAAO;AAAA,UACZ,MAAM,sBAAA,cAAC,OAAO,MAAP,IAAY;AAAA,UACnB,OAAO,OAAO;AAAA,UACd,SAAS,OAAO;AAAA,QAAA;AAAA,MAAA,CAEvB;AAAA,IAAA,GAfH;AAAA,EAgBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GArC4B;AAyCrB,MAAM,YAAY,QAAQ,YAAY;AAC7C,UAAU,cAAc;"}
|
package/dist/Stepper.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 { Stepper as Stepper$1, Step, StepLabel, Typography } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useStepper = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Stepper",
|
|
8
11
|
props: {
|
|
9
12
|
activeStep: 0,
|
|
10
13
|
steps: [],
|
|
11
14
|
orientation: "horizontal",
|
|
12
|
-
alternativeLabel:
|
|
13
|
-
nonLinear:
|
|
15
|
+
alternativeLabel: false,
|
|
16
|
+
nonLinear: false,
|
|
14
17
|
sx: void 0
|
|
15
18
|
},
|
|
16
|
-
view: () => /* @__PURE__ */
|
|
17
|
-
|
|
19
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
20
|
+
Stepper$1,
|
|
18
21
|
{
|
|
19
|
-
activeStep:
|
|
20
|
-
orientation:
|
|
21
|
-
alternativeLabel:
|
|
22
|
-
nonLinear:
|
|
23
|
-
sx:
|
|
22
|
+
activeStep: m.activeStep,
|
|
23
|
+
orientation: m.orientation,
|
|
24
|
+
alternativeLabel: m.alternativeLabel,
|
|
25
|
+
nonLinear: m.nonLinear,
|
|
26
|
+
sx: m.sx
|
|
24
27
|
},
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
m.steps.map((step, i) => /* @__PURE__ */ React.createElement(Step, { key: i }, /* @__PURE__ */ React.createElement(
|
|
29
|
+
StepLabel,
|
|
27
30
|
{
|
|
28
|
-
optional:
|
|
31
|
+
optional: step.optional ? /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, step.optional) : void 0
|
|
29
32
|
},
|
|
30
|
-
|
|
33
|
+
step.label
|
|
31
34
|
)))
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
), "view")
|
|
36
|
+
};
|
|
37
|
+
c = useComponent(def, params);
|
|
38
|
+
m = c.model;
|
|
39
|
+
return c;
|
|
40
|
+
}, "useStepper");
|
|
41
|
+
const Stepper = toReact(useStepper);
|
|
42
|
+
Stepper.displayName = "Stepper";
|
|
36
43
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
Stepper,
|
|
45
|
+
useStepper
|
|
39
46
|
};
|
|
40
47
|
//# sourceMappingURL=Stepper.es.js.map
|
package/dist/Stepper.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stepper.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Stepper.es.js","sources":["../src/Stepper.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Stepper as MuiStepper,\r\n Step,\r\n StepLabel,\r\n Typography,\r\n type StepperProps as MuiStepperProps,\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 StepDef = {\r\n label: string;\r\n optional?: string;\r\n};\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n activeStep: number;\r\n steps: StepDef[];\r\n orientation?: MuiStepperProps['orientation'];\r\n alternativeLabel?: boolean;\r\n nonLinear?: boolean;\r\n sx?: MuiStepperProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useStepper = (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: 'Stepper',\r\n props: {\r\n activeStep: 0,\r\n steps: [],\r\n orientation: 'horizontal',\r\n alternativeLabel: false,\r\n nonLinear: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiStepper\r\n activeStep={m.activeStep}\r\n orientation={m.orientation}\r\n alternativeLabel={m.alternativeLabel}\r\n nonLinear={m.nonLinear}\r\n sx={m.sx}\r\n >\r\n {m.steps.map((step, i) => (\r\n <Step key={i}>\r\n <StepLabel\r\n optional={\r\n step.optional ? (\r\n <Typography variant=\"caption\">{step.optional}</Typography>\r\n ) : undefined\r\n }\r\n >\r\n {step.label}\r\n </StepLabel>\r\n </Step>\r\n ))}\r\n </MuiStepper>\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 StepperStruct = Struct;\r\n\r\nexport const Stepper = toReact(useStepper);\r\nStepper.displayName = 'Stepper';\r\n"],"names":["MuiStepper"],"mappings":";;;;;AAqCO,MAAM,aAAa,wBAAC,WAAuD;AAC9E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,YAAY;AAAA,MACZ,OAAO,CAAA;AAAA,MACP,aAAa;AAAA,MACb,kBAAkB;AAAA,MAClB,WAAW;AAAA,MACX,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,YAAY,EAAE;AAAA,QACd,aAAa,EAAE;AAAA,QACf,kBAAkB,EAAE;AAAA,QACpB,WAAW,EAAE;AAAA,QACb,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,MAAM,IAAI,CAAC,MAAM,MAChB,sBAAA,cAAC,MAAA,EAAK,KAAK,EAAA,GACP,sBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UACI,KAAK,WACD,sBAAA,cAAC,cAAW,SAAQ,UAAA,GAAW,KAAK,QAAS,IAC7C;AAAA,QAAA;AAAA,QAGP,KAAK;AAAA,MAAA,CAEd,CACH;AAAA,IAAA,GApBH;AAAA,EAqBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA1C0B;AA8CnB,MAAM,UAAU,QAAQ,UAAU;AACzC,QAAQ,cAAc;"}
|
package/dist/Switch.es.js
CHANGED
|
@@ -1,47 +1,54 @@
|
|
|
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 { Switch as Switch$1, FormControl, FormControlLabel, FormHelperText } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSwitch = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Switch",
|
|
8
11
|
props: {
|
|
9
|
-
checked:
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
12
|
+
checked: false,
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
label: void 0,
|
|
13
16
|
helperText: void 0,
|
|
14
|
-
error:
|
|
17
|
+
error: false,
|
|
15
18
|
color: "primary",
|
|
16
19
|
size: "medium",
|
|
17
20
|
sx: void 0
|
|
18
21
|
},
|
|
19
|
-
view: () => {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
+
view: /* @__PURE__ */ __name(() => {
|
|
23
|
+
const sw = /* @__PURE__ */ React.createElement(
|
|
24
|
+
Switch$1,
|
|
22
25
|
{
|
|
23
|
-
checked:
|
|
24
|
-
onChange: (
|
|
25
|
-
color:
|
|
26
|
-
size:
|
|
26
|
+
checked: m.checked,
|
|
27
|
+
onChange: /* @__PURE__ */ __name((e) => m.onChange(e.target.checked), "onChange"),
|
|
28
|
+
color: m.color,
|
|
29
|
+
size: m.size
|
|
27
30
|
}
|
|
28
31
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
|
|
32
|
+
return /* @__PURE__ */ React.createElement(
|
|
33
|
+
FormControl,
|
|
31
34
|
{
|
|
32
|
-
error:
|
|
33
|
-
disabled:
|
|
34
|
-
sx:
|
|
35
|
+
error: m.error,
|
|
36
|
+
disabled: m.$.isDisabled,
|
|
37
|
+
sx: m.sx
|
|
35
38
|
},
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
m.label != null ? /* @__PURE__ */ React.createElement(FormControlLabel, { control: sw, label: m.label }) : sw,
|
|
40
|
+
m.helperText && /* @__PURE__ */ React.createElement(FormHelperText, null, m.helperText)
|
|
38
41
|
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
}, "view")
|
|
43
|
+
};
|
|
44
|
+
c = useComponent(def, params);
|
|
45
|
+
m = c.model;
|
|
46
|
+
return c;
|
|
47
|
+
}, "useSwitch");
|
|
48
|
+
const Switch = toReact(useSwitch);
|
|
49
|
+
Switch.displayName = "Switch";
|
|
43
50
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
Switch,
|
|
52
|
+
useSwitch
|
|
46
53
|
};
|
|
47
54
|
//# sourceMappingURL=Switch.es.js.map
|
package/dist/Switch.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Switch.es.js","sources":["../src/Switch.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Switch as MuiSwitch,\r\n FormControl,\r\n FormControlLabel,\r\n FormHelperText,\r\n type SwitchProps as MuiSwitchProps,\r\n type FormControlProps as MuiFormControlProps,\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 checked: boolean;\r\n onChange: (checked: boolean) => void;\r\n label?: string;\r\n helperText?: string;\r\n error?: boolean;\r\n color?: MuiSwitchProps['color'];\r\n size?: MuiSwitchProps['size'];\r\n sx?: MuiFormControlProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSwitch = (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: 'Switch',\r\n props: {\r\n checked: false,\r\n onChange: () => {},\r\n label: undefined,\r\n helperText: undefined,\r\n error: false,\r\n color: 'primary',\r\n size: 'medium',\r\n sx: undefined,\r\n },\r\n view: () => {\r\n const sw = (\r\n <MuiSwitch\r\n checked={m.checked}\r\n onChange={(e) => m.onChange(e.target.checked)}\r\n color={m.color}\r\n size={m.size}\r\n />\r\n );\r\n return (\r\n <FormControl\r\n error={m.error}\r\n disabled={m.$.isDisabled}\r\n sx={m.sx}\r\n >\r\n {m.label != null ? (\r\n <FormControlLabel control={sw} label={m.label} />\r\n ) : (\r\n sw\r\n )}\r\n {m.helperText && <FormHelperText>{m.helperText}</FormHelperText>}\r\n </FormControl>\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 SwitchStruct = Struct;\r\n\r\nexport const Switch = toReact(useSwitch);\r\nSwitch.displayName = 'Switch';\r\n"],"names":["MuiSwitch"],"mappings":";;;;;AAmCO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS;AAAA,MACT,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BAAM;AACR,YAAM,KACF,sBAAA;AAAA,QAACA;AAAAA,QAAA;AAAA,UACG,SAAS,EAAE;AAAA,UACX,UAAU,wBAAC,MAAM,EAAE,SAAS,EAAE,OAAO,OAAO,GAAlC;AAAA,UACV,OAAO,EAAE;AAAA,UACT,MAAM,EAAE;AAAA,QAAA;AAAA,MAAA;AAGhB,aACI,sBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,OAAO,EAAE;AAAA,UACT,UAAU,EAAE,EAAE;AAAA,UACd,IAAI,EAAE;AAAA,QAAA;AAAA,QAEL,EAAE,SAAS,OACR,sBAAA,cAAC,kBAAA,EAAiB,SAAS,IAAI,OAAO,EAAE,MAAA,CAAO,IAE/C;AAAA,QAEH,EAAE,cAAc,sBAAA,cAAC,gBAAA,MAAgB,EAAE,UAAW;AAAA,MAAA;AAAA,IAG3D,GAvBM;AAAA,EAuBN;AAGJ,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA7CyB;AAiDlB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Table.es.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
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 { TableContainer, Paper, Table as Table$1, TableHead, TableRow, TableCell, TableBody } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useTable = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Table",
|
|
8
11
|
props: {
|
|
9
12
|
columns: [],
|
|
10
13
|
rows: [],
|
|
11
|
-
stickyHeader:
|
|
14
|
+
stickyHeader: false,
|
|
12
15
|
size: "medium",
|
|
13
16
|
sx: void 0
|
|
14
17
|
},
|
|
15
|
-
view: () => /* @__PURE__ */
|
|
16
|
-
|
|
18
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(TableContainer, { component: Paper, sx: m.sx }, /* @__PURE__ */ React.createElement(Table$1, { stickyHeader: m.stickyHeader, size: m.size }, /* @__PURE__ */ React.createElement(TableHead, null, /* @__PURE__ */ React.createElement(TableRow, null, m.columns.map((col) => /* @__PURE__ */ React.createElement(
|
|
19
|
+
TableCell,
|
|
17
20
|
{
|
|
18
|
-
key:
|
|
19
|
-
align:
|
|
20
|
-
style:
|
|
21
|
+
key: col.id,
|
|
22
|
+
align: col.align,
|
|
23
|
+
style: col.minWidth ? { minWidth: col.minWidth } : void 0
|
|
21
24
|
},
|
|
22
|
-
|
|
23
|
-
)))), /* @__PURE__ */
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
col.label
|
|
26
|
+
)))), /* @__PURE__ */ React.createElement(TableBody, null, m.rows.map((row, i) => /* @__PURE__ */ React.createElement(TableRow, { key: i, hover: true }, m.columns.map((col) => /* @__PURE__ */ React.createElement(TableCell, { key: col.id, align: col.align }, row[col.id]))))))), "view")
|
|
27
|
+
};
|
|
28
|
+
c = useComponent(def, params);
|
|
29
|
+
m = c.model;
|
|
30
|
+
return c;
|
|
31
|
+
}, "useTable");
|
|
32
|
+
const Table = toReact(useTable);
|
|
33
|
+
Table.displayName = "Table";
|
|
27
34
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
Table,
|
|
36
|
+
useTable
|
|
30
37
|
};
|
|
31
38
|
//# sourceMappingURL=Table.es.js.map
|
package/dist/Table.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Table.es.js","sources":["../src/Table.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n TableContainer,\r\n Table as MuiTable,\r\n TableHead,\r\n TableBody,\r\n TableRow,\r\n TableCell,\r\n Paper,\r\n type TableProps as MuiTableProps,\r\n type TableContainerProps as MuiTableContainerProps,\r\n type TableCellProps as MuiTableCellProps,\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 TableColumn = {\r\n id: string;\r\n label: string;\r\n align?: MuiTableCellProps['align'];\r\n minWidth?: number;\r\n};\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n columns: TableColumn[];\r\n rows: Record<string, React.ReactNode>[];\r\n stickyHeader?: boolean;\r\n size?: MuiTableProps['size'];\r\n sx?: MuiTableContainerProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useTable = (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: 'Table',\r\n props: {\r\n columns: [],\r\n rows: [],\r\n stickyHeader: false,\r\n size: 'medium',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <TableContainer component={Paper} sx={m.sx}>\r\n <MuiTable stickyHeader={m.stickyHeader} size={m.size}>\r\n <TableHead>\r\n <TableRow>\r\n {m.columns.map((col) => (\r\n <TableCell\r\n key={col.id}\r\n align={col.align}\r\n style={col.minWidth ? { minWidth: col.minWidth } : undefined}\r\n >\r\n {col.label}\r\n </TableCell>\r\n ))}\r\n </TableRow>\r\n </TableHead>\r\n <TableBody>\r\n {m.rows.map((row, i) => (\r\n <TableRow key={i} hover>\r\n {m.columns.map((col) => (\r\n <TableCell key={col.id} align={col.align}>\r\n {row[col.id]}\r\n </TableCell>\r\n ))}\r\n </TableRow>\r\n ))}\r\n </TableBody>\r\n </MuiTable>\r\n </TableContainer>\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 TableStruct = Struct;\r\n\r\nexport const Table = toReact(useTable);\r\nTable.displayName = 'Table';\r\n"],"names":["MuiTable"],"mappings":";;;;;AA2CO,MAAM,WAAW,wBAAC,WAAuD;AAC5E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS,CAAA;AAAA,MACT,MAAM,CAAA;AAAA,MACN,cAAc;AAAA,MACd,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA,cAAC,gBAAA,EAAe,WAAW,OAAO,IAAI,EAAE,GAAA,GACpC,sBAAA,cAACA,SAAA,EAAS,cAAc,EAAE,cAAc,MAAM,EAAE,KAAA,GAC5C,sBAAA,cAAC,WAAA,MACG,sBAAA,cAAC,UAAA,MACI,EAAE,QAAQ,IAAI,CAAC,QACZ,sBAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAK,IAAI;AAAA,QACT,OAAO,IAAI;AAAA,QACX,OAAO,IAAI,WAAW,EAAE,UAAU,IAAI,aAAa;AAAA,MAAA;AAAA,MAElD,IAAI;AAAA,IAAA,CAEZ,CACL,CACJ,GACA,sBAAA,cAAC,WAAA,MACI,EAAE,KAAK,IAAI,CAAC,KAAK,MACd,sBAAA,cAAC,UAAA,EAAS,KAAK,GAAG,OAAK,QAClB,EAAE,QAAQ,IAAI,CAAC,QACZ,sBAAA,cAAC,WAAA,EAAU,KAAK,IAAI,IAAI,OAAO,IAAI,MAAA,GAC9B,IAAI,IAAI,EAAE,CACf,CACH,CACL,CACH,CACL,CACJ,CACJ,GA5BE;AAAA,EA4BF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhDwB;AAoDjB,MAAM,QAAQ,QAAQ,QAAQ;AACrC,MAAM,cAAc;"}
|
package/dist/Tabs.es.js
CHANGED
|
@@ -1,44 +1,51 @@
|
|
|
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 { Box, Tabs as Tabs$1, Tab } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useTabs = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Tabs",
|
|
8
11
|
props: {
|
|
9
12
|
value: "",
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
tabs: [],
|
|
13
16
|
orientation: "horizontal",
|
|
14
17
|
variant: "standard",
|
|
15
18
|
sx: void 0
|
|
16
19
|
},
|
|
17
|
-
view: () =>
|
|
18
|
-
|
|
20
|
+
view: /* @__PURE__ */ __name(() => m.orientation === "vertical" ? /* @__PURE__ */ React.createElement(Box, { sx: { display: "flex" } }, /* @__PURE__ */ React.createElement(Box, { sx: { borderRight: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
21
|
+
Tabs$1,
|
|
19
22
|
{
|
|
20
|
-
value:
|
|
21
|
-
onChange: (
|
|
23
|
+
value: m.value,
|
|
24
|
+
onChange: /* @__PURE__ */ __name((_, v) => m.onChange(v), "onChange"),
|
|
22
25
|
orientation: "vertical",
|
|
23
|
-
variant:
|
|
24
|
-
sx:
|
|
26
|
+
variant: m.variant,
|
|
27
|
+
sx: m.sx
|
|
25
28
|
},
|
|
26
|
-
|
|
27
|
-
)), /* @__PURE__ */
|
|
28
|
-
|
|
29
|
+
m.tabs.map((tab) => /* @__PURE__ */ React.createElement(Tab, { key: tab.value, value: tab.value, label: tab.label, disabled: tab.disabled }))
|
|
30
|
+
)), /* @__PURE__ */ React.createElement(Box, { sx: { flex: 1 } }, m.tabs.map((tab) => /* @__PURE__ */ React.createElement("div", { key: tab.value, role: "tabpanel", hidden: m.value !== tab.value }, m.value === tab.value && tab.content && /* @__PURE__ */ React.createElement(tab.content, null))))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React.createElement(
|
|
31
|
+
Tabs$1,
|
|
29
32
|
{
|
|
30
|
-
value:
|
|
31
|
-
onChange: (
|
|
32
|
-
variant:
|
|
33
|
-
sx:
|
|
33
|
+
value: m.value,
|
|
34
|
+
onChange: /* @__PURE__ */ __name((_, v) => m.onChange(v), "onChange"),
|
|
35
|
+
variant: m.variant,
|
|
36
|
+
sx: m.sx
|
|
34
37
|
},
|
|
35
|
-
|
|
36
|
-
)),
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
m.tabs.map((tab) => /* @__PURE__ */ React.createElement(Tab, { key: tab.value, value: tab.value, label: tab.label, disabled: tab.disabled }))
|
|
39
|
+
)), m.tabs.map((tab) => /* @__PURE__ */ React.createElement("div", { key: tab.value, role: "tabpanel", hidden: m.value !== tab.value }, m.value === tab.value && tab.content && /* @__PURE__ */ React.createElement(tab.content, null)))), "view")
|
|
40
|
+
};
|
|
41
|
+
c = useComponent(def, params);
|
|
42
|
+
m = c.model;
|
|
43
|
+
return c;
|
|
44
|
+
}, "useTabs");
|
|
45
|
+
const Tabs = toReact(useTabs);
|
|
46
|
+
Tabs.displayName = "Tabs";
|
|
40
47
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
Tabs,
|
|
49
|
+
useTabs
|
|
43
50
|
};
|
|
44
51
|
//# sourceMappingURL=Tabs.es.js.map
|
package/dist/Tabs.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Tabs.es.js","sources":["../src/Tabs.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Tabs as MuiTabs, Tab as MuiTab, Box, type TabsProps as MuiTabsProps } 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 TabItem = {\r\n value: string;\r\n label: string;\r\n content?: React.FC;\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 value: string;\r\n onChange: (value: string) => void;\r\n tabs: TabItem[];\r\n orientation?: MuiTabsProps['orientation'];\r\n variant?: MuiTabsProps['variant'];\r\n sx?: MuiTabsProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useTabs = (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: 'Tabs',\r\n props: {\r\n value: '',\r\n onChange: () => {},\r\n tabs: [],\r\n orientation: 'horizontal',\r\n variant: 'standard',\r\n sx: undefined,\r\n },\r\n view: () =>\r\n m.orientation === 'vertical' ? (\r\n <Box sx={{ display: 'flex' }}>\r\n <Box sx={{ borderRight: 1, borderColor: 'divider' }}>\r\n <MuiTabs\r\n value={m.value}\r\n onChange={(_, v: string) => m.onChange(v)}\r\n orientation=\"vertical\"\r\n variant={m.variant}\r\n sx={m.sx}\r\n >\r\n {m.tabs.map((tab) => (\r\n <MuiTab key={tab.value} value={tab.value} label={tab.label} disabled={tab.disabled} />\r\n ))}\r\n </MuiTabs>\r\n </Box>\r\n <Box sx={{ flex: 1 }}>\r\n {m.tabs.map((tab) => (\r\n <div key={tab.value} role=\"tabpanel\" hidden={m.value !== tab.value}>\r\n {m.value === tab.value && tab.content && <tab.content />}\r\n </div>\r\n ))}\r\n </Box>\r\n </Box>\r\n ) : (\r\n <>\r\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\r\n <MuiTabs\r\n value={m.value}\r\n onChange={(_, v: string) => m.onChange(v)}\r\n variant={m.variant}\r\n sx={m.sx}\r\n >\r\n {m.tabs.map((tab) => (\r\n <MuiTab key={tab.value} value={tab.value} label={tab.label} disabled={tab.disabled} />\r\n ))}\r\n </MuiTabs>\r\n </Box>\r\n {m.tabs.map((tab) => (\r\n <div key={tab.value} role=\"tabpanel\" hidden={m.value !== tab.value}>\r\n {m.value === tab.value && tab.content && <tab.content />}\r\n </div>\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 TabsStruct = Struct;\r\n\r\nexport const Tabs = toReact(useTabs);\r\nTabs.displayName = 'Tabs';\r\n"],"names":["MuiTabs","MuiTab"],"mappings":";;;;;AAiCO,MAAM,UAAU,wBAAC,WAAuD;AAC3E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,MAAM,CAAA;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,MACT,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,EAAE,gBAAgB,aACd,sBAAA,cAAC,KAAA,EAAI,IAAI,EAAE,SAAS,YAChB,sBAAA,cAAC,OAAI,IAAI,EAAE,aAAa,GAAG,aAAa,YAAU,GAC9C,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,MAAc,EAAE,SAAS,CAAC,GAA9B;AAAA,QACV,aAAY;AAAA,QACZ,SAAS,EAAE;AAAA,QACX,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,KAAK,IAAI,CAAC,QACT,sBAAA,cAACC,OAAO,KAAK,IAAI,OAAO,OAAO,IAAI,OAAO,OAAO,IAAI,OAAO,UAAU,IAAI,UAAU,CACvF;AAAA,IAAA,CAET,GACA,sBAAA,cAAC,KAAA,EAAI,IAAI,EAAE,MAAM,EAAA,EAAE,GACd,EAAE,KAAK,IAAI,CAAC,QACT,sBAAA,cAAC,OAAA,EAAI,KAAK,IAAI,OAAO,MAAK,YAAW,QAAQ,EAAE,UAAU,IAAI,SACxD,EAAE,UAAU,IAAI,SAAS,IAAI,WAAW,sBAAA,cAAC,IAAI,SAAJ,IAAY,CAC1D,CACH,CACL,CACJ,IAEA,sBAAA,cAAA,MAAA,UAAA,MACI,sBAAA,cAAC,KAAA,EAAI,IAAI,EAAE,cAAc,GAAG,aAAa,UAAA,EAAU,GAC/C,sBAAA;AAAA,MAACD;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,MAAc,EAAE,SAAS,CAAC,GAA9B;AAAA,QACV,SAAS,EAAE;AAAA,QACX,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,KAAK,IAAI,CAAC,QACT,sBAAA,cAACC,OAAO,KAAK,IAAI,OAAO,OAAO,IAAI,OAAO,OAAO,IAAI,OAAO,UAAU,IAAI,UAAU,CACvF;AAAA,IAAA,CAET,GACC,EAAE,KAAK,IAAI,CAAC,QACT,sBAAA,cAAC,OAAA,EAAI,KAAK,IAAI,OAAO,MAAK,YAAW,QAAQ,EAAE,UAAU,IAAI,MAAA,GACxD,EAAE,UAAU,IAAI,SAAS,IAAI,WAAW,sBAAA,cAAC,IAAI,SAAJ,IAAY,CAC1D,CACH,CACL,GA3CF;AAAA,EA2CE;AAIZ,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhEuB;AAoEhB,MAAM,OAAO,QAAQ,OAAO;AACnC,KAAK,cAAc;"}
|
package/dist/TextField.es.js
CHANGED
|
@@ -1,53 +1,60 @@
|
|
|
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 { TextField as TextField$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useTextField = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "TextField",
|
|
8
11
|
props: {
|
|
9
12
|
value: "",
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
label: void 0,
|
|
13
16
|
placeholder: void 0,
|
|
14
17
|
helperText: void 0,
|
|
15
|
-
error:
|
|
18
|
+
error: false,
|
|
16
19
|
type: "text",
|
|
17
|
-
multiline:
|
|
20
|
+
multiline: false,
|
|
18
21
|
rows: void 0,
|
|
19
|
-
fullWidth:
|
|
22
|
+
fullWidth: false,
|
|
20
23
|
variant: "outlined",
|
|
21
24
|
size: "medium",
|
|
22
25
|
color: "primary",
|
|
23
26
|
sx: void 0
|
|
24
27
|
},
|
|
25
|
-
view: () => /* @__PURE__ */
|
|
26
|
-
|
|
28
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
29
|
+
TextField$1,
|
|
27
30
|
{
|
|
28
|
-
value:
|
|
29
|
-
onChange: (
|
|
30
|
-
label:
|
|
31
|
-
placeholder:
|
|
32
|
-
helperText:
|
|
33
|
-
error:
|
|
34
|
-
type:
|
|
35
|
-
multiline:
|
|
36
|
-
rows:
|
|
37
|
-
fullWidth:
|
|
38
|
-
variant:
|
|
39
|
-
size:
|
|
40
|
-
color:
|
|
41
|
-
disabled:
|
|
42
|
-
slotProps: { input: { readOnly:
|
|
43
|
-
sx:
|
|
31
|
+
value: m.value,
|
|
32
|
+
onChange: /* @__PURE__ */ __name((e) => m.onChange(e.target.value), "onChange"),
|
|
33
|
+
label: m.label,
|
|
34
|
+
placeholder: m.placeholder,
|
|
35
|
+
helperText: m.helperText,
|
|
36
|
+
error: m.error,
|
|
37
|
+
type: m.type,
|
|
38
|
+
multiline: m.multiline,
|
|
39
|
+
rows: m.rows,
|
|
40
|
+
fullWidth: m.fullWidth,
|
|
41
|
+
variant: m.variant,
|
|
42
|
+
size: m.size,
|
|
43
|
+
color: m.color,
|
|
44
|
+
disabled: m.$.isDisabled,
|
|
45
|
+
slotProps: { input: { readOnly: m.$.isReadOnly } },
|
|
46
|
+
sx: m.sx
|
|
44
47
|
}
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
), "view")
|
|
49
|
+
};
|
|
50
|
+
c = useComponent(def, params);
|
|
51
|
+
m = c.model;
|
|
52
|
+
return c;
|
|
53
|
+
}, "useTextField");
|
|
54
|
+
const TextField = toReact(useTextField);
|
|
55
|
+
TextField.displayName = "TextField";
|
|
49
56
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
TextField,
|
|
58
|
+
useTextField
|
|
52
59
|
};
|
|
53
60
|
//# sourceMappingURL=TextField.es.js.map
|
package/dist/TextField.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"TextField.es.js","sources":["../src/TextField.tsx"],"sourcesContent":["import React from 'react';\r\nimport { TextField as MuiTextField, type TextFieldProps as MuiTextFieldProps } 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;\r\n onChange: (value: string) => void;\r\n label?: string;\r\n placeholder?: string;\r\n helperText?: string;\r\n error?: boolean;\r\n type?: string;\r\n multiline?: boolean;\r\n rows?: number;\r\n fullWidth?: boolean;\r\n variant?: MuiTextFieldProps['variant'];\r\n size?: MuiTextFieldProps['size'];\r\n color?: MuiTextFieldProps['color'];\r\n sx?: MuiTextFieldProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useTextField = (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: 'TextField',\r\n props: {\r\n value: '',\r\n onChange: () => {},\r\n label: undefined,\r\n placeholder: undefined,\r\n helperText: undefined,\r\n error: false,\r\n type: 'text',\r\n multiline: false,\r\n rows: undefined,\r\n fullWidth: false,\r\n variant: 'outlined',\r\n size: 'medium',\r\n color: 'primary',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiTextField\r\n value={m.value}\r\n onChange={(e) => m.onChange(e.target.value)}\r\n label={m.label}\r\n placeholder={m.placeholder}\r\n helperText={m.helperText}\r\n error={m.error}\r\n type={m.type}\r\n multiline={m.multiline}\r\n rows={m.rows}\r\n fullWidth={m.fullWidth}\r\n variant={m.variant}\r\n size={m.size}\r\n color={m.color}\r\n disabled={m.$.isDisabled}\r\n slotProps={{ input: { readOnly: m.$.isReadOnly } }}\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 TextFieldStruct = Struct;\r\n\r\nexport const TextField = toReact(useTextField);\r\nTextField.displayName = 'TextField';\r\n"],"names":["MuiTextField"],"mappings":";;;;;AAkCO,MAAM,eAAe,wBAAC,WAAuD;AAChF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,OAAO;AAAA,MACP,aAAa;AAAA,MACb,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,MAAM;AAAA,MACN,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,GAAhC;AAAA,QACV,OAAO,EAAE;AAAA,QACT,aAAa,EAAE;AAAA,QACf,YAAY,EAAE;AAAA,QACd,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,WAAW,EAAE;AAAA,QACb,SAAS,EAAE;AAAA,QACX,MAAM,EAAE;AAAA,QACR,OAAO,EAAE;AAAA,QACT,UAAU,EAAE,EAAE;AAAA,QACd,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,aAAW;AAAA,QAC/C,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GAjBR;AAAA,EAkBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA/C4B;AAmDrB,MAAM,YAAY,QAAQ,YAAY;AAC7C,UAAU,cAAc;"}
|