@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/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":["
|
|
1
|
+
{"version":3,"file":"RadioGroup.es.js","sources":["../src/RadioGroup.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n FormControl,\r\n FormControlLabel,\r\n FormHelperText,\r\n FormLabel,\r\n Radio,\r\n RadioGroup as MuiRadioGroup,\r\n type RadioProps as MuiRadioProps,\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\nexport type RadioOption = {\r\n value: string;\r\n label: string;\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 options: RadioOption[];\r\n label?: string;\r\n helperText?: string;\r\n error?: boolean;\r\n row?: boolean;\r\n color?: MuiRadioProps['color'];\r\n size?: MuiRadioProps['size'];\r\n sx?: MuiFormControlProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useRadioGroup = (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: 'RadioGroup',\r\n props: {\r\n value: '',\r\n onChange: () => {},\r\n options: [],\r\n label: undefined,\r\n helperText: undefined,\r\n error: false,\r\n row: false,\r\n color: 'primary',\r\n size: 'medium',\r\n sx: undefined,\r\n },\r\n view: () => {\r\n const labelId = `${c.id}-label`;\r\n return (\r\n <FormControl error={m.error} disabled={m.$.isDisabled} sx={m.sx}>\r\n {m.label && <FormLabel id={labelId}>{m.label}</FormLabel>}\r\n <MuiRadioGroup\r\n aria-labelledby={m.label ? labelId : undefined}\r\n name={c.id}\r\n value={m.value}\r\n onChange={(e) => m.onChange(e.target.value)}\r\n row={m.row}\r\n >\r\n {m.options.map((opt) => (\r\n <FormControlLabel\r\n key={opt.value}\r\n value={opt.value}\r\n label={opt.label}\r\n control={<Radio color={m.color} size={m.size} />}\r\n />\r\n ))}\r\n </MuiRadioGroup>\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 RadioGroupStruct = Struct;\r\n\r\nexport const RadioGroup = toReact(useRadioGroup);\r\nRadioGroup.displayName = 'RadioGroup';\r\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":["
|
|
1
|
+
{"version":3,"file":"Rating.es.js","sources":["../src/Rating.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Rating as MuiRating, type RatingProps as MuiRatingProps } 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: number | null;\r\n onChange?: (value: number | null) => void;\r\n max?: number;\r\n precision?: number;\r\n size?: MuiRatingProps['size'];\r\n readOnly?: boolean;\r\n sx?: MuiRatingProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useRating = (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: 'Rating',\r\n props: {\r\n value: null,\r\n onChange: undefined,\r\n max: 5,\r\n precision: 1,\r\n size: 'medium',\r\n readOnly: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiRating\r\n value={m.value}\r\n onChange={(_, newValue) => m.onChange?.(newValue)}\r\n max={m.max}\r\n precision={m.precision}\r\n size={m.size}\r\n readOnly={m.readOnly}\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 RatingStruct = Struct;\r\n\r\nexport const Rating = toReact(useRating);\r\nRating.displayName = 'Rating';\r\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;"}
|
package/dist/Select.es.js
CHANGED
|
@@ -1,57 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { FormControl, InputLabel, Select as Select$1, MenuItem, FormHelperText } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSelect = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Select",
|
|
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
|
-
fullWidth:
|
|
18
|
+
error: false,
|
|
19
|
+
fullWidth: false,
|
|
17
20
|
variant: "outlined",
|
|
18
21
|
size: "medium",
|
|
19
22
|
color: "primary",
|
|
20
23
|
sx: void 0
|
|
21
24
|
},
|
|
22
|
-
view: () => {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
|
|
25
|
+
view: /* @__PURE__ */ __name(() => {
|
|
26
|
+
const labelId = `${c.id}-label`;
|
|
27
|
+
return /* @__PURE__ */ React.createElement(
|
|
28
|
+
FormControl,
|
|
26
29
|
{
|
|
27
|
-
fullWidth:
|
|
28
|
-
variant:
|
|
29
|
-
size:
|
|
30
|
-
error:
|
|
31
|
-
disabled:
|
|
32
|
-
sx:
|
|
30
|
+
fullWidth: m.fullWidth,
|
|
31
|
+
variant: m.variant,
|
|
32
|
+
size: m.size,
|
|
33
|
+
error: m.error,
|
|
34
|
+
disabled: m.$.isDisabled,
|
|
35
|
+
sx: m.sx
|
|
33
36
|
},
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
37
|
+
m.label && /* @__PURE__ */ React.createElement(InputLabel, { id: labelId }, m.label),
|
|
38
|
+
/* @__PURE__ */ React.createElement(
|
|
39
|
+
Select$1,
|
|
37
40
|
{
|
|
38
|
-
labelId:
|
|
39
|
-
label:
|
|
40
|
-
value:
|
|
41
|
-
onChange: (
|
|
42
|
-
color:
|
|
43
|
-
inputProps: { readOnly:
|
|
41
|
+
labelId: m.label ? labelId : void 0,
|
|
42
|
+
label: m.label,
|
|
43
|
+
value: m.value,
|
|
44
|
+
onChange: /* @__PURE__ */ __name((e) => m.onChange(e.target.value), "onChange"),
|
|
45
|
+
color: m.color,
|
|
46
|
+
inputProps: { readOnly: m.$.isReadOnly }
|
|
44
47
|
},
|
|
45
|
-
|
|
48
|
+
m.options.map((opt) => /* @__PURE__ */ React.createElement(MenuItem, { key: opt.value, value: opt.value }, opt.label))
|
|
46
49
|
),
|
|
47
|
-
|
|
50
|
+
m.helperText && /* @__PURE__ */ React.createElement(FormHelperText, null, m.helperText)
|
|
48
51
|
);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
}, "view")
|
|
53
|
+
};
|
|
54
|
+
c = useComponent(def, params);
|
|
55
|
+
m = c.model;
|
|
56
|
+
return c;
|
|
57
|
+
}, "useSelect");
|
|
58
|
+
const Select = toReact(useSelect);
|
|
59
|
+
Select.displayName = "Select";
|
|
53
60
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
Select,
|
|
62
|
+
useSelect
|
|
56
63
|
};
|
|
57
64
|
//# sourceMappingURL=Select.es.js.map
|
package/dist/Select.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Select.es.js","sources":["../src/Select.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n FormControl,\r\n FormHelperText,\r\n InputLabel,\r\n MenuItem,\r\n Select as MuiSelect,\r\n type SelectProps as MuiSelectProps,\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 SelectOption = {\r\n value: string;\r\n label: string;\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 options: SelectOption[];\r\n label?: string;\r\n helperText?: string;\r\n error?: boolean;\r\n fullWidth?: boolean;\r\n variant?: MuiSelectProps['variant'];\r\n size?: MuiSelectProps['size'];\r\n color?: MuiSelectProps['color'];\r\n sx?: MuiSelectProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSelect = (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: 'Select',\r\n props: {\r\n value: '',\r\n onChange: () => {},\r\n options: [],\r\n label: undefined,\r\n helperText: undefined,\r\n error: false,\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 const labelId = `${c.id}-label`;\r\n return (\r\n <FormControl\r\n fullWidth={m.fullWidth}\r\n variant={m.variant}\r\n size={m.size}\r\n error={m.error}\r\n disabled={m.$.isDisabled}\r\n sx={m.sx}\r\n >\r\n {m.label && <InputLabel id={labelId}>{m.label}</InputLabel>}\r\n <MuiSelect\r\n labelId={m.label ? labelId : undefined}\r\n label={m.label}\r\n value={m.value}\r\n onChange={(e) => m.onChange(e.target.value as string)}\r\n color={m.color}\r\n inputProps={{ readOnly: m.$.isReadOnly }}\r\n >\r\n {m.options.map((opt) => (\r\n <MenuItem key={opt.value} value={opt.value}>\r\n {opt.label}\r\n </MenuItem>\r\n ))}\r\n </MuiSelect>\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 SelectStruct = Struct;\r\n\r\nexport const Select = toReact(useSelect);\r\nSelect.displayName = 'Select';\r\n"],"names":["MuiSelect"],"mappings":";;;;;AA2CO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,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,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BAAM;AACR,YAAM,UAAU,GAAG,EAAE,EAAE;AACvB,aACI,sBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,WAAW,EAAE;AAAA,UACb,SAAS,EAAE;AAAA,UACX,MAAM,EAAE;AAAA,UACR,OAAO,EAAE;AAAA,UACT,UAAU,EAAE,EAAE;AAAA,UACd,IAAI,EAAE;AAAA,QAAA;AAAA,QAEL,EAAE,SAAS,sBAAA,cAAC,cAAW,IAAI,QAAA,GAAU,EAAE,KAAM;AAAA,QAC9C,sBAAA;AAAA,UAACA;AAAAA,UAAA;AAAA,YACG,SAAS,EAAE,QAAQ,UAAU;AAAA,YAC7B,OAAO,EAAE;AAAA,YACT,OAAO,EAAE;AAAA,YACT,UAAU,wBAAC,MAAM,EAAE,SAAS,EAAE,OAAO,KAAe,GAA1C;AAAA,YACV,OAAO,EAAE;AAAA,YACT,YAAY,EAAE,UAAU,EAAE,EAAE,WAAA;AAAA,UAAW;AAAA,UAEtC,EAAE,QAAQ,IAAI,CAAC,QACZ,sBAAA,cAAC,UAAA,EAAS,KAAK,IAAI,OAAO,OAAO,IAAI,MAAA,GAChC,IAAI,KACT,CACH;AAAA,QAAA;AAAA,QAEJ,EAAE,cAAc,sBAAA,cAAC,gBAAA,MAAgB,EAAE,UAAW;AAAA,MAAA;AAAA,IAG3D,GA7BM;AAAA,EA6BN;AAGJ,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAtDyB;AA0DlB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Skeleton.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 { Skeleton as Skeleton$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSkeleton = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Skeleton",
|
|
8
11
|
props: {
|
|
9
12
|
variant: "text",
|
|
@@ -12,21 +15,25 @@ const m = (o) => {
|
|
|
12
15
|
animation: "pulse",
|
|
13
16
|
sx: void 0
|
|
14
17
|
},
|
|
15
|
-
view: () => /* @__PURE__ */
|
|
16
|
-
|
|
18
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
19
|
+
Skeleton$1,
|
|
17
20
|
{
|
|
18
|
-
variant:
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
animation:
|
|
22
|
-
sx:
|
|
21
|
+
variant: m.variant,
|
|
22
|
+
width: m.width,
|
|
23
|
+
height: m.height,
|
|
24
|
+
animation: m.animation,
|
|
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
|
+
}, "useSkeleton");
|
|
33
|
+
const Skeleton = toReact(useSkeleton);
|
|
34
|
+
Skeleton.displayName = "Skeleton";
|
|
28
35
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
Skeleton,
|
|
37
|
+
useSkeleton
|
|
31
38
|
};
|
|
32
39
|
//# sourceMappingURL=Skeleton.es.js.map
|
package/dist/Skeleton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Skeleton.es.js","sources":["../src/Skeleton.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Skeleton as MuiSkeleton, type SkeletonProps as MuiSkeletonProps } 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?: MuiSkeletonProps['variant'];\r\n width?: number | string;\r\n height?: number | string;\r\n animation?: MuiSkeletonProps['animation'];\r\n sx?: MuiSkeletonProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSkeleton = (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: 'Skeleton',\r\n props: {\r\n variant: 'text',\r\n width: undefined,\r\n height: undefined,\r\n animation: 'pulse',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiSkeleton\r\n variant={m.variant}\r\n width={m.width}\r\n height={m.height}\r\n animation={m.animation}\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 SkeletonStruct = Struct;\r\n\r\nexport const Skeleton = toReact(useSkeleton);\r\nSkeleton.displayName = 'Skeleton';\r\n"],"names":["MuiSkeleton"],"mappings":";;;;;AAyBO,MAAM,cAAc,wBAAC,WAAuD;AAC/E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,SAAS;AAAA,MACT,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,SAAS,EAAE;AAAA,QACX,OAAO,EAAE;AAAA,QACT,QAAQ,EAAE;AAAA,QACV,WAAW,EAAE;AAAA,QACb,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GANR;AAAA,EAOF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA3B2B;AA+BpB,MAAM,WAAW,QAAQ,WAAW;AAC3C,SAAS,cAAc;"}
|
package/dist/Slider.es.js
CHANGED
|
@@ -1,46 +1,53 @@
|
|
|
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 { Slider as Slider$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSlider = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Slider",
|
|
8
11
|
props: {
|
|
9
12
|
value: 0,
|
|
10
|
-
onChange: () => {
|
|
11
|
-
},
|
|
13
|
+
onChange: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onChange"),
|
|
12
15
|
min: 0,
|
|
13
16
|
max: 100,
|
|
14
17
|
step: 1,
|
|
15
|
-
marks:
|
|
18
|
+
marks: false,
|
|
16
19
|
color: "primary",
|
|
17
20
|
size: "medium",
|
|
18
21
|
valueLabelDisplay: "auto",
|
|
19
22
|
track: "normal",
|
|
20
23
|
sx: void 0
|
|
21
24
|
},
|
|
22
|
-
view: () => /* @__PURE__ */
|
|
23
|
-
|
|
25
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
26
|
+
Slider$1,
|
|
24
27
|
{
|
|
25
|
-
value:
|
|
26
|
-
onChange: (
|
|
27
|
-
min:
|
|
28
|
-
max:
|
|
29
|
-
step:
|
|
30
|
-
marks:
|
|
31
|
-
color:
|
|
32
|
-
size:
|
|
33
|
-
valueLabelDisplay:
|
|
34
|
-
track:
|
|
35
|
-
disabled:
|
|
36
|
-
sx:
|
|
28
|
+
value: m.value,
|
|
29
|
+
onChange: /* @__PURE__ */ __name((_, newValue) => m.onChange(newValue), "onChange"),
|
|
30
|
+
min: m.min,
|
|
31
|
+
max: m.max,
|
|
32
|
+
step: m.step,
|
|
33
|
+
marks: m.marks,
|
|
34
|
+
color: m.color,
|
|
35
|
+
size: m.size,
|
|
36
|
+
valueLabelDisplay: m.valueLabelDisplay,
|
|
37
|
+
track: m.track,
|
|
38
|
+
disabled: m.$.isDisabled,
|
|
39
|
+
sx: m.sx
|
|
37
40
|
}
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
), "view")
|
|
42
|
+
};
|
|
43
|
+
c = useComponent(def, params);
|
|
44
|
+
m = c.model;
|
|
45
|
+
return c;
|
|
46
|
+
}, "useSlider");
|
|
47
|
+
const Slider = toReact(useSlider);
|
|
48
|
+
Slider.displayName = "Slider";
|
|
42
49
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
Slider,
|
|
51
|
+
useSlider
|
|
45
52
|
};
|
|
46
53
|
//# sourceMappingURL=Slider.es.js.map
|
package/dist/Slider.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Slider.es.js","sources":["../src/Slider.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Slider as MuiSlider, type SliderProps as MuiSliderProps } 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: number;\r\n onChange: (value: number) => void;\r\n min?: number;\r\n max?: number;\r\n step?: number;\r\n marks?: boolean;\r\n color?: MuiSliderProps['color'];\r\n size?: MuiSliderProps['size'];\r\n valueLabelDisplay?: MuiSliderProps['valueLabelDisplay'];\r\n track?: MuiSliderProps['track'];\r\n sx?: MuiSliderProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSlider = (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: 'Slider',\r\n props: {\r\n value: 0,\r\n onChange: () => {},\r\n min: 0,\r\n max: 100,\r\n step: 1,\r\n marks: false,\r\n color: 'primary',\r\n size: 'medium',\r\n valueLabelDisplay: 'auto',\r\n track: 'normal',\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiSlider\r\n value={m.value}\r\n onChange={(_, newValue) => m.onChange(newValue as number)}\r\n min={m.min}\r\n max={m.max}\r\n step={m.step}\r\n marks={m.marks}\r\n color={m.color}\r\n size={m.size}\r\n valueLabelDisplay={m.valueLabelDisplay}\r\n track={m.track}\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 SliderStruct = Struct;\r\n\r\nexport const Slider = toReact(useSlider);\r\nSlider.displayName = 'Slider';\r\n"],"names":["MuiSlider"],"mappings":";;;;;AA+BO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,KAAK;AAAA,MACL,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,MACP,OAAO;AAAA,MACP,MAAM;AAAA,MACN,mBAAmB;AAAA,MACnB,OAAO;AAAA,MACP,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa,EAAE,SAAS,QAAkB,GAA9C;AAAA,QACV,KAAK,EAAE;AAAA,QACP,KAAK,EAAE;AAAA,QACP,MAAM,EAAE;AAAA,QACR,OAAO,EAAE;AAAA,QACT,OAAO,EAAE;AAAA,QACT,MAAM,EAAE;AAAA,QACR,mBAAmB,EAAE;AAAA,QACrB,OAAO,EAAE;AAAA,QACT,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GAbR;AAAA,EAcF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAxCyB;AA4ClB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
|
package/dist/Snackbar.es.js
CHANGED
|
@@ -1,37 +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 { Snackbar as Snackbar$1 } from "@mui/material";
|
|
5
|
+
import { toReact, useComponent } from "@actdim/dynstruct/componentModel/react/hooks";
|
|
6
|
+
const useSnackbar = /* @__PURE__ */ __name((params) => {
|
|
7
|
+
let c;
|
|
8
|
+
let m;
|
|
9
|
+
const def = {
|
|
7
10
|
regType: "Snackbar",
|
|
8
11
|
props: {
|
|
9
|
-
open:
|
|
10
|
-
onClose: () => {
|
|
11
|
-
},
|
|
12
|
+
open: false,
|
|
13
|
+
onClose: /* @__PURE__ */ __name(() => {
|
|
14
|
+
}, "onClose"),
|
|
12
15
|
message: "",
|
|
13
16
|
autoHideDuration: 4e3,
|
|
14
17
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
15
18
|
action: void 0,
|
|
16
19
|
sx: void 0
|
|
17
20
|
},
|
|
18
|
-
view: () => /* @__PURE__ */
|
|
19
|
-
|
|
21
|
+
view: /* @__PURE__ */ __name(() => /* @__PURE__ */ React.createElement(
|
|
22
|
+
Snackbar$1,
|
|
20
23
|
{
|
|
21
|
-
open:
|
|
22
|
-
onClose:
|
|
23
|
-
message:
|
|
24
|
-
autoHideDuration:
|
|
25
|
-
anchorOrigin:
|
|
26
|
-
action:
|
|
27
|
-
sx:
|
|
24
|
+
open: m.open,
|
|
25
|
+
onClose: m.onClose,
|
|
26
|
+
message: m.message,
|
|
27
|
+
autoHideDuration: m.autoHideDuration,
|
|
28
|
+
anchorOrigin: m.anchorOrigin,
|
|
29
|
+
action: m.action,
|
|
30
|
+
sx: m.sx
|
|
28
31
|
}
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
), "view")
|
|
33
|
+
};
|
|
34
|
+
c = useComponent(def, params);
|
|
35
|
+
m = c.model;
|
|
36
|
+
return c;
|
|
37
|
+
}, "useSnackbar");
|
|
38
|
+
const Snackbar = toReact(useSnackbar);
|
|
39
|
+
Snackbar.displayName = "Snackbar";
|
|
33
40
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
Snackbar,
|
|
42
|
+
useSnackbar
|
|
36
43
|
};
|
|
37
44
|
//# sourceMappingURL=Snackbar.es.js.map
|
package/dist/Snackbar.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snackbar.es.js","sources":["
|
|
1
|
+
{"version":3,"file":"Snackbar.es.js","sources":["../src/Snackbar.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n Snackbar as MuiSnackbar,\r\n type SnackbarProps as MuiSnackbarProps,\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 message: string;\r\n autoHideDuration?: number | null;\r\n anchorOrigin?: MuiSnackbarProps['anchorOrigin'];\r\n action?: React.ReactNode;\r\n sx?: MuiSnackbarProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useSnackbar = (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: 'Snackbar',\r\n props: {\r\n open: false,\r\n onClose: () => {},\r\n message: '',\r\n autoHideDuration: 4000,\r\n anchorOrigin: { vertical: 'bottom', horizontal: 'left' },\r\n action: undefined,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiSnackbar\r\n open={m.open}\r\n onClose={m.onClose}\r\n message={m.message}\r\n autoHideDuration={m.autoHideDuration}\r\n anchorOrigin={m.anchorOrigin}\r\n action={m.action}\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 SnackbarStruct = Struct;\r\n\r\nexport const Snackbar = toReact(useSnackbar);\r\nSnackbar.displayName = 'Snackbar';\r\n"],"names":["MuiSnackbar"],"mappings":";;;;;AA8BO,MAAM,cAAc,wBAAC,WAAuD;AAC/E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,MAAM;AAAA,MACN,SAAS,6BAAM;AAAA,MAAC,GAAP;AAAA,MACT,SAAS;AAAA,MACT,kBAAkB;AAAA,MAClB,cAAc,EAAE,UAAU,UAAU,YAAY,OAAA;AAAA,MAChD,QAAQ;AAAA,MACR,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,MAAM,EAAE;AAAA,QACR,SAAS,EAAE;AAAA,QACX,SAAS,EAAE;AAAA,QACX,kBAAkB,EAAE;AAAA,QACpB,cAAc,EAAE;AAAA,QAChB,QAAQ,EAAE;AAAA,QACV,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GARR;AAAA,EASF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA/B2B;AAmCpB,MAAM,WAAW,QAAQ,WAAW;AAC3C,SAAS,cAAc;"}
|