@actdim/dynstruct-mui 0.9.2 → 1.5.6
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.d.ts +19 -0
- package/dist/Accordion.d.ts.map +1 -0
- package/dist/Accordion.es.js.map +1 -1
- package/dist/Alert.d.ts +18 -0
- package/dist/Alert.d.ts.map +1 -0
- package/dist/Alert.es.js.map +1 -1
- package/dist/Autocomplete.d.ts +26 -0
- package/dist/Autocomplete.d.ts.map +1 -0
- package/dist/Autocomplete.es.js.map +1 -1
- package/dist/Avatar.d.ts +18 -0
- package/dist/Avatar.d.ts.map +1 -0
- package/dist/Avatar.es.js.map +1 -1
- package/dist/Badge.d.ts +21 -0
- package/dist/Badge.d.ts.map +1 -0
- package/dist/Badge.es.js.map +1 -1
- package/dist/Breadcrumbs.d.ts +22 -0
- package/dist/Breadcrumbs.d.ts.map +1 -0
- package/dist/Breadcrumbs.es.js.map +1 -1
- package/dist/Button.d.ts +23 -0
- package/dist/Button.d.ts.map +1 -0
- package/dist/Button.es.js.map +1 -1
- package/dist/Card.d.ts +21 -0
- package/dist/Card.d.ts.map +1 -0
- package/dist/Card.es.js.map +1 -1
- package/dist/Checkbox.d.ts +22 -0
- package/dist/Checkbox.d.ts.map +1 -0
- package/dist/Checkbox.es.js.map +1 -1
- package/dist/Chip.d.ts +21 -0
- package/dist/Chip.d.ts.map +1 -0
- package/dist/Chip.es.js.map +1 -1
- package/dist/CircularProgress.d.ts +19 -0
- package/dist/CircularProgress.d.ts.map +1 -0
- package/dist/CircularProgress.es.js.map +1 -1
- package/dist/Dialog.d.ts +22 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.es.js.map +1 -1
- package/dist/Drawer.d.ts +19 -0
- package/dist/Drawer.d.ts.map +1 -0
- package/dist/Drawer.es.js.map +1 -1
- package/dist/Fab.d.ts +21 -0
- package/dist/Fab.d.ts.map +1 -0
- package/dist/Fab.es.js.map +1 -1
- package/dist/IconButton.d.ts +21 -0
- package/dist/IconButton.d.ts.map +1 -0
- package/dist/IconButton.es.js.map +1 -1
- package/dist/LinearProgress.d.ts +18 -0
- package/dist/LinearProgress.d.ts.map +1 -0
- package/dist/LinearProgress.es.js.map +1 -1
- package/dist/List.d.ts +25 -0
- package/dist/List.d.ts.map +1 -0
- package/dist/List.es.js.map +1 -1
- package/dist/Menu.d.ts +24 -0
- package/dist/Menu.d.ts.map +1 -0
- package/dist/Menu.es.js.map +1 -1
- package/dist/Pagination.d.ts +21 -0
- package/dist/Pagination.d.ts.map +1 -0
- package/dist/Pagination.es.js.map +1 -1
- package/dist/RadioGroup.d.ts +27 -0
- package/dist/RadioGroup.d.ts.map +1 -0
- package/dist/RadioGroup.es.js.map +1 -1
- package/dist/Rating.d.ts +20 -0
- package/dist/Rating.d.ts.map +1 -0
- package/dist/Rating.es.js.map +1 -1
- package/dist/Select.d.ts +28 -0
- package/dist/Select.d.ts.map +1 -0
- package/dist/Select.es.js.map +1 -1
- package/dist/Skeleton.d.ts +18 -0
- package/dist/Skeleton.d.ts.map +1 -0
- package/dist/Skeleton.es.js.map +1 -1
- package/dist/Slider.d.ts +24 -0
- package/dist/Slider.d.ts.map +1 -0
- package/dist/Slider.es.js.map +1 -1
- package/dist/Snackbar.d.ts +20 -0
- package/dist/Snackbar.d.ts.map +1 -0
- package/dist/Snackbar.es.js.map +1 -1
- package/dist/SpeedDial.d.ts +24 -0
- package/dist/SpeedDial.d.ts.map +1 -0
- package/dist/SpeedDial.es.js.map +1 -1
- package/dist/Stepper.d.ts +23 -0
- package/dist/Stepper.d.ts.map +1 -0
- package/dist/Stepper.es.js.map +1 -1
- package/dist/Switch.d.ts +21 -0
- package/dist/Switch.d.ts.map +1 -0
- package/dist/Switch.es.js.map +1 -1
- package/dist/Table.d.ts +24 -0
- package/dist/Table.d.ts.map +1 -0
- package/dist/Table.es.js.map +1 -1
- package/dist/Tabs.d.ts +25 -0
- package/dist/Tabs.d.ts.map +1 -0
- package/dist/Tabs.es.js.map +1 -1
- package/dist/TextField.d.ts +27 -0
- package/dist/TextField.d.ts.map +1 -0
- package/dist/TextField.es.js.map +1 -1
- package/dist/Toast.d.ts +36 -0
- package/dist/Toast.d.ts.map +1 -0
- package/dist/Toast.es.js +135 -0
- package/dist/Toast.es.js.map +1 -0
- package/dist/ToggleButtonGroup.d.ts +28 -0
- package/dist/ToggleButtonGroup.d.ts.map +1 -0
- package/dist/ToggleButtonGroup.es.js.map +1 -1
- package/dist/Tooltip.d.ts +17 -0
- package/dist/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip.es.js.map +1 -1
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +3 -0
- package/dist/index.es.js.map +1 -1
- package/package.json +132 -133
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.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectProps as MuiSelectProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type SelectOption = {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
10
|
+
props: {
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
options: SelectOption[];
|
|
14
|
+
label?: string;
|
|
15
|
+
helperText?: string;
|
|
16
|
+
error?: boolean;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
variant?: MuiSelectProps['variant'];
|
|
19
|
+
size?: MuiSelectProps['size'];
|
|
20
|
+
color?: MuiSelectProps['color'];
|
|
21
|
+
sx?: MuiSelectProps['sx'];
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
export declare const useSelect: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
25
|
+
export type SelectStruct = Struct;
|
|
26
|
+
export declare const Select: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../src/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAMH,KAAK,WAAW,IAAI,cAAc,EACrC,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,OAAO,EAAE,YAAY,EAAE,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAC9B,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,EAAE,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;KAC7B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CAsD3E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,MAAM,qDAAqB,CAAC"}
|
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;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SkeletonProps as MuiSkeletonProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
6
|
+
props: {
|
|
7
|
+
variant?: MuiSkeletonProps['variant'];
|
|
8
|
+
width?: number | string;
|
|
9
|
+
height?: number | string;
|
|
10
|
+
animation?: MuiSkeletonProps['animation'];
|
|
11
|
+
sx?: MuiSkeletonProps['sx'];
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
export declare const useSkeleton: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
15
|
+
export type SkeletonStruct = Struct;
|
|
16
|
+
export declare const Skeleton: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Skeleton.d.ts","sourceRoot":"","sources":["../src/Skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA2B,KAAK,aAAa,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACtC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAC1C,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;KAC/B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CA2B7E,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,eAAO,MAAM,QAAQ,qDAAuB,CAAC"}
|
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.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SliderProps as MuiSliderProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
6
|
+
props: {
|
|
7
|
+
value: number;
|
|
8
|
+
onChange: (value: number) => void;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number;
|
|
12
|
+
marks?: boolean;
|
|
13
|
+
color?: MuiSliderProps['color'];
|
|
14
|
+
size?: MuiSliderProps['size'];
|
|
15
|
+
valueLabelDisplay?: MuiSliderProps['valueLabelDisplay'];
|
|
16
|
+
track?: MuiSliderProps['track'];
|
|
17
|
+
sx?: MuiSliderProps['sx'];
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useSlider: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
21
|
+
export type SliderStruct = Struct;
|
|
22
|
+
export declare const Slider: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=Slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../src/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,KAAK,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAC9B,iBAAiB,CAAC,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAC;QACxD,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,EAAE,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;KAC7B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CAwC3E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,MAAM,qDAAqB,CAAC"}
|
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;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SnackbarProps as MuiSnackbarProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
6
|
+
props: {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
message: string;
|
|
10
|
+
autoHideDuration?: number | null;
|
|
11
|
+
anchorOrigin?: MuiSnackbarProps['anchorOrigin'];
|
|
12
|
+
action?: React.ReactNode;
|
|
13
|
+
sx?: MuiSnackbarProps['sx'];
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
export declare const useSnackbar: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
17
|
+
export type SnackbarStruct = Struct;
|
|
18
|
+
export declare const Snackbar: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=Snackbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Snackbar.d.ts","sourceRoot":"","sources":["../src/Snackbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEH,KAAK,aAAa,IAAI,gBAAgB,EACzC,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,IAAI,EAAE,OAAO,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAChD,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;QACzB,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;KAC/B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CA+B7E,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,eAAO,MAAM,QAAQ,qDAAuB,CAAC"}
|
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;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SpeedDialProps as MuiSpeedDialProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type SpeedDialActionDef = {
|
|
6
|
+
name: string;
|
|
7
|
+
icon: React.FC;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
};
|
|
10
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
11
|
+
props: {
|
|
12
|
+
ariaLabel: string;
|
|
13
|
+
actions: SpeedDialActionDef[];
|
|
14
|
+
icon?: React.FC;
|
|
15
|
+
direction?: MuiSpeedDialProps['direction'];
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
sx?: MuiSpeedDialProps['sx'];
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useSpeedDial: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
21
|
+
export type SpeedDialStruct = Struct;
|
|
22
|
+
export declare const SpeedDial: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=SpeedDial.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpeedDial.d.ts","sourceRoot":"","sources":["../src/SpeedDial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIH,KAAK,cAAc,IAAI,iBAAiB,EAC3C,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAChB,SAAS,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,EAAE,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;KAChC,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CAqC9E,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,eAAO,MAAM,SAAS,qDAAwB,CAAC"}
|
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;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StepperProps as MuiStepperProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type StepDef = {
|
|
6
|
+
label: string;
|
|
7
|
+
optional?: string;
|
|
8
|
+
};
|
|
9
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
10
|
+
props: {
|
|
11
|
+
activeStep: number;
|
|
12
|
+
steps: StepDef[];
|
|
13
|
+
orientation?: MuiStepperProps['orientation'];
|
|
14
|
+
alternativeLabel?: boolean;
|
|
15
|
+
nonLinear?: boolean;
|
|
16
|
+
sx?: MuiStepperProps['sx'];
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export declare const useStepper: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
20
|
+
export type StepperStruct = Struct;
|
|
21
|
+
export declare const Stepper: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../src/Stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKH,KAAK,YAAY,IAAI,eAAe,EACvC,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;QAC7C,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,EAAE,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;KAC9B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CA0C5E,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,eAAO,MAAM,OAAO,qDAAsB,CAAC"}
|
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.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SwitchProps as MuiSwitchProps, FormControlProps as MuiFormControlProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
6
|
+
props: {
|
|
7
|
+
checked: boolean;
|
|
8
|
+
onChange: (checked: boolean) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
helperText?: string;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
color?: MuiSwitchProps['color'];
|
|
13
|
+
size?: MuiSwitchProps['size'];
|
|
14
|
+
sx?: MuiFormControlProps['sx'];
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
export declare const useSwitch: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
18
|
+
export type SwitchStruct = Struct;
|
|
19
|
+
export declare const Switch: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../src/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKH,KAAK,WAAW,IAAI,cAAc,EAClC,KAAK,gBAAgB,IAAI,mBAAmB,EAC/C,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;QACrC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAC9B,EAAE,CAAC,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC;KAClC,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CA6C3E,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,MAAM,qDAAqB,CAAC"}
|
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.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableProps as MuiTableProps, TableContainerProps as MuiTableContainerProps, TableCellProps as MuiTableCellProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type TableColumn = {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
align?: MuiTableCellProps['align'];
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
};
|
|
11
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
12
|
+
props: {
|
|
13
|
+
columns: TableColumn[];
|
|
14
|
+
rows: Record<string, React.ReactNode>[];
|
|
15
|
+
stickyHeader?: boolean;
|
|
16
|
+
size?: MuiTableProps['size'];
|
|
17
|
+
sx?: MuiTableContainerProps['sx'];
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export declare const useTable: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
21
|
+
export type TableStruct = Struct;
|
|
22
|
+
export declare const Table: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../src/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAQH,KAAK,UAAU,IAAI,aAAa,EAChC,KAAK,mBAAmB,IAAI,sBAAsB,EAClD,KAAK,cAAc,IAAI,iBAAiB,EAC3C,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,WAAW,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,OAAO,EAAE,WAAW,EAAE,CAAC;QACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7B,EAAE,CAAC,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;KACrC,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CAgD1E,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,eAAO,MAAM,KAAK,qDAAoB,CAAC"}
|
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.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TabsProps as MuiTabsProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type TabItem = {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
content?: React.FC;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
12
|
+
props: {
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
tabs: TabItem[];
|
|
16
|
+
orientation?: MuiTabsProps['orientation'];
|
|
17
|
+
variant?: MuiTabsProps['variant'];
|
|
18
|
+
sx?: MuiTabsProps['sx'];
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
export declare const useTabs: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
22
|
+
export type TabsStruct = Struct;
|
|
23
|
+
export declare const Tabs: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=Tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../src/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuC,KAAK,SAAS,IAAI,YAAY,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,MAAM,MAAM,OAAO,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,IAAI,EAAE,OAAO,EAAE,CAAC;QAChB,WAAW,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;QAC1C,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;QAClC,EAAE,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;KAC3B,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CAgEzE,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,eAAO,MAAM,IAAI,qDAAmB,CAAC"}
|
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;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
6
|
+
props: {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
label?: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
helperText?: string;
|
|
12
|
+
error?: boolean;
|
|
13
|
+
type?: string;
|
|
14
|
+
multiline?: boolean;
|
|
15
|
+
rows?: number;
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
variant?: MuiTextFieldProps['variant'];
|
|
18
|
+
size?: MuiTextFieldProps['size'];
|
|
19
|
+
color?: MuiTextFieldProps['color'];
|
|
20
|
+
sx?: MuiTextFieldProps['sx'];
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
export declare const useTextField: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
24
|
+
export type TextFieldStruct = Struct;
|
|
25
|
+
export declare const TextField: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../src/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA6B,KAAK,cAAc,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,KAAK,SAAS,EAEjB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,KAAK,MAAM,CAAC,UAAU,SAAS,gBAAgB,GAAG,gBAAgB,IAAI,eAAe,CACjF,UAAU,EACV;IACI,KAAK,EAAE;QACH,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAClC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;QACjC,KAAK,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACnC,EAAE,CAAC,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;KAChC,CAAC;CACL,CACJ,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,QAAQ,eAAe,CAAC,MAAM,CAAC,KAAG,SAAS,CAAC,MAAM,CA+C9E,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,eAAO,MAAM,SAAS,qDAAwB,CAAC"}
|
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;"}
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SnackbarProps as MuiSnackbarProps, AlertProps as MuiAlertProps } from '@mui/material';
|
|
3
|
+
import { ComponentStruct, ComponentParams, Component } from '@actdim/dynstruct/componentModel/contracts';
|
|
4
|
+
import { BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';
|
|
5
|
+
export type ToastItem = {
|
|
6
|
+
id: string;
|
|
7
|
+
message: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
severity?: MuiAlertProps['severity'];
|
|
10
|
+
variant?: MuiAlertProps['variant'];
|
|
11
|
+
autoHideDuration?: number | null;
|
|
12
|
+
action?: React.ReactNode;
|
|
13
|
+
alertSx?: MuiAlertProps['sx'];
|
|
14
|
+
};
|
|
15
|
+
type Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<TMsgStruct, {
|
|
16
|
+
props: {
|
|
17
|
+
items?: ToastItem[];
|
|
18
|
+
onDismiss?: (id: string) => void;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
message?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
severity?: MuiAlertProps['severity'];
|
|
24
|
+
variant?: MuiAlertProps['variant'];
|
|
25
|
+
autoHideDuration?: number | null;
|
|
26
|
+
anchorOrigin?: MuiSnackbarProps['anchorOrigin'];
|
|
27
|
+
action?: React.ReactNode;
|
|
28
|
+
sx?: MuiSnackbarProps['sx'];
|
|
29
|
+
alertSx?: MuiAlertProps['sx'];
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
export declare const useToast: (params: ComponentParams<Struct>) => Component<Struct>;
|
|
33
|
+
export type ToastStruct = Struct;
|
|
34
|
+
export declare const Toast: React.FC<ComponentParams<Struct<BaseAppMsgStruct>>>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=Toast.d.ts.map
|