@actdim/dynstruct-mui 0.9.2 → 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.
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/RadioGroup.tsx"],"sourcesContent":["import React from 'react';\nimport {\n FormControl,\n FormControlLabel,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup as MuiRadioGroup,\n type RadioProps as MuiRadioProps,\n type FormControlProps as MuiFormControlProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type RadioOption = {\n value: string;\n label: string;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string;\n onChange: (value: string) => void;\n options: RadioOption[];\n label?: string;\n helperText?: string;\n error?: boolean;\n row?: boolean;\n color?: MuiRadioProps['color'];\n size?: MuiRadioProps['size'];\n sx?: MuiFormControlProps['sx'];\n };\n }\n>;\n\nexport const useRadioGroup = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'RadioGroup',\n props: {\n value: '',\n onChange: () => {},\n options: [],\n label: undefined,\n helperText: undefined,\n error: false,\n row: false,\n color: 'primary',\n size: 'medium',\n sx: undefined,\n },\n view: () => {\n const labelId = `${c.id}-label`;\n return (\n <FormControl error={m.error} disabled={m.$.isDisabled} sx={m.sx}>\n {m.label && <FormLabel id={labelId}>{m.label}</FormLabel>}\n <MuiRadioGroup\n aria-labelledby={m.label ? labelId : undefined}\n name={c.id}\n value={m.value}\n onChange={(e) => m.onChange(e.target.value)}\n row={m.row}\n >\n {m.options.map((opt) => (\n <FormControlLabel\n key={opt.value}\n value={opt.value}\n label={opt.label}\n control={<Radio color={m.color} size={m.size} />}\n />\n ))}\n </MuiRadioGroup>\n {m.helperText && <FormHelperText>{m.helperText}</FormHelperText>}\n </FormControl>\n );\n },\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type RadioGroupStruct = Struct;\n\nexport const RadioGroup = toReact(useRadioGroup);\nRadioGroup.displayName = 'RadioGroup';\n"],"names":["MuiRadioGroup"],"mappings":";;;;;AA4CO,MAAM,gBAAgB,wBAAC,WAAuD;AACjF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,SAAS,CAAA;AAAA,MACT,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,KAAK;AAAA,MACL,OAAO;AAAA,MACP,MAAM;AAAA,MACN,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BAAM;AACR,YAAM,UAAU,GAAG,EAAE,EAAE;AACvB,aACI,sBAAA,cAAC,eAAY,OAAO,EAAE,OAAO,UAAU,EAAE,EAAE,YAAY,IAAI,EAAE,GAAA,GACxD,EAAE,SAAS,sBAAA,cAAC,WAAA,EAAU,IAAI,QAAA,GAAU,EAAE,KAAM,GAC7C,sBAAA;AAAA,QAACA;AAAAA,QAAA;AAAA,UACG,mBAAiB,EAAE,QAAQ,UAAU;AAAA,UACrC,MAAM,EAAE;AAAA,UACR,OAAO,EAAE;AAAA,UACT,UAAU,wBAAC,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,GAAhC;AAAA,UACV,KAAK,EAAE;AAAA,QAAA;AAAA,QAEN,EAAE,QAAQ,IAAI,CAAC,QACZ,sBAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,KAAK,IAAI;AAAA,YACT,OAAO,IAAI;AAAA,YACX,OAAO,IAAI;AAAA,YACX,6CAAU,OAAA,EAAM,OAAO,EAAE,OAAO,MAAM,EAAE,KAAA,CAAM;AAAA,UAAA;AAAA,QAAA,CAErD;AAAA,MAAA,GAEJ,EAAE,kDAAe,gBAAA,MAAgB,EAAE,UAAW,CACnD;AAAA,IAER,GAxBM;AAAA,EAwBN;AAGJ,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhD6B;AAoDtB,MAAM,aAAa,QAAQ,aAAa;AAC/C,WAAW,cAAc;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Rating.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Rating.tsx"],"sourcesContent":["import React from 'react';\nimport { Rating as MuiRating, type RatingProps as MuiRatingProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: number | null;\n onChange?: (value: number | null) => void;\n max?: number;\n precision?: number;\n size?: MuiRatingProps['size'];\n readOnly?: boolean;\n sx?: MuiRatingProps['sx'];\n };\n }\n>;\n\nexport const useRating = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Rating',\n props: {\n value: null,\n onChange: undefined,\n max: 5,\n precision: 1,\n size: 'medium',\n readOnly: false,\n sx: undefined,\n },\n view: () => (\n <MuiRating\n value={m.value}\n onChange={(_, newValue) => m.onChange?.(newValue)}\n max={m.max}\n precision={m.precision}\n size={m.size}\n readOnly={m.readOnly}\n disabled={m.$.isDisabled}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type RatingStruct = Struct;\n\nexport const Rating = toReact(useRating);\nRating.displayName = 'Rating';\n"],"names":["MuiRating"],"mappings":";;;;;AA2BO,MAAM,YAAY,wBAAC,WAAuD;AAC7E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa,EAAE,WAAW,QAAQ,GAAtC;AAAA,QACV,KAAK,EAAE;AAAA,QACP,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,UAAU,EAAE;AAAA,QACZ,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,IAAA,GATR;AAAA,EAUF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAhCyB;AAoClB,MAAM,SAAS,QAAQ,SAAS;AACvC,OAAO,cAAc;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Select.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Select.tsx"],"sourcesContent":["import React from 'react';\nimport {\n FormControl,\n FormHelperText,\n InputLabel,\n MenuItem,\n Select as MuiSelect,\n type SelectProps as MuiSelectProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type SelectOption = {\n value: string;\n label: string;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string;\n onChange: (value: string) => void;\n options: SelectOption[];\n label?: string;\n helperText?: string;\n error?: boolean;\n fullWidth?: boolean;\n variant?: MuiSelectProps['variant'];\n size?: MuiSelectProps['size'];\n color?: MuiSelectProps['color'];\n sx?: MuiSelectProps['sx'];\n };\n }\n>;\n\nexport const useSelect = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Select',\n props: {\n value: '',\n onChange: () => {},\n options: [],\n label: undefined,\n helperText: undefined,\n error: false,\n fullWidth: false,\n variant: 'outlined',\n size: 'medium',\n color: 'primary',\n sx: undefined,\n },\n view: () => {\n const labelId = `${c.id}-label`;\n return (\n <FormControl\n fullWidth={m.fullWidth}\n variant={m.variant}\n size={m.size}\n error={m.error}\n disabled={m.$.isDisabled}\n sx={m.sx}\n >\n {m.label && <InputLabel id={labelId}>{m.label}</InputLabel>}\n <MuiSelect\n labelId={m.label ? labelId : undefined}\n label={m.label}\n value={m.value}\n onChange={(e) => m.onChange(e.target.value as string)}\n color={m.color}\n inputProps={{ readOnly: m.$.isReadOnly }}\n >\n {m.options.map((opt) => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </MuiSelect>\n {m.helperText && <FormHelperText>{m.helperText}</FormHelperText>}\n </FormControl>\n );\n },\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SelectStruct = Struct;\n\nexport const Select = toReact(useSelect);\nSelect.displayName = 'Select';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Skeleton.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Skeleton.tsx"],"sourcesContent":["import React from 'react';\nimport { Skeleton as MuiSkeleton, type SkeletonProps as MuiSkeletonProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n variant?: MuiSkeletonProps['variant'];\n width?: number | string;\n height?: number | string;\n animation?: MuiSkeletonProps['animation'];\n sx?: MuiSkeletonProps['sx'];\n };\n }\n>;\n\nexport const useSkeleton = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Skeleton',\n props: {\n variant: 'text',\n width: undefined,\n height: undefined,\n animation: 'pulse',\n sx: undefined,\n },\n view: () => (\n <MuiSkeleton\n variant={m.variant}\n width={m.width}\n height={m.height}\n animation={m.animation}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SkeletonStruct = Struct;\n\nexport const Skeleton = toReact(useSkeleton);\nSkeleton.displayName = 'Skeleton';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Slider.tsx"],"sourcesContent":["import React from 'react';\nimport { Slider as MuiSlider, type SliderProps as MuiSliderProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: number;\n onChange: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n marks?: boolean;\n color?: MuiSliderProps['color'];\n size?: MuiSliderProps['size'];\n valueLabelDisplay?: MuiSliderProps['valueLabelDisplay'];\n track?: MuiSliderProps['track'];\n sx?: MuiSliderProps['sx'];\n };\n }\n>;\n\nexport const useSlider = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Slider',\n props: {\n value: 0,\n onChange: () => {},\n min: 0,\n max: 100,\n step: 1,\n marks: false,\n color: 'primary',\n size: 'medium',\n valueLabelDisplay: 'auto',\n track: 'normal',\n sx: undefined,\n },\n view: () => (\n <MuiSlider\n value={m.value}\n onChange={(_, newValue) => m.onChange(newValue as number)}\n min={m.min}\n max={m.max}\n step={m.step}\n marks={m.marks}\n color={m.color}\n size={m.size}\n valueLabelDisplay={m.valueLabelDisplay}\n track={m.track}\n disabled={m.$.isDisabled}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SliderStruct = Struct;\n\nexport const Slider = toReact(useSlider);\nSlider.displayName = 'Slider';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Snackbar.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Snackbar as MuiSnackbar,\n type SnackbarProps as MuiSnackbarProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n open: boolean;\n onClose: () => void;\n message: string;\n autoHideDuration?: number | null;\n anchorOrigin?: MuiSnackbarProps['anchorOrigin'];\n action?: React.ReactNode;\n sx?: MuiSnackbarProps['sx'];\n };\n }\n>;\n\nexport const useSnackbar = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Snackbar',\n props: {\n open: false,\n onClose: () => {},\n message: '',\n autoHideDuration: 4000,\n anchorOrigin: { vertical: 'bottom', horizontal: 'left' },\n action: undefined,\n sx: undefined,\n },\n view: () => (\n <MuiSnackbar\n open={m.open}\n onClose={m.onClose}\n message={m.message}\n autoHideDuration={m.autoHideDuration}\n anchorOrigin={m.anchorOrigin}\n action={m.action}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SnackbarStruct = Struct;\n\nexport const Snackbar = toReact(useSnackbar);\nSnackbar.displayName = 'Snackbar';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SpeedDial.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/SpeedDial.tsx"],"sourcesContent":["import React from 'react';\nimport {\n SpeedDial as MuiSpeedDial,\n SpeedDialAction,\n SpeedDialIcon,\n type SpeedDialProps as MuiSpeedDialProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type SpeedDialActionDef = {\n name: string;\n icon: React.FC;\n onClick?: () => void;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n ariaLabel: string;\n actions: SpeedDialActionDef[];\n icon?: React.FC;\n direction?: MuiSpeedDialProps['direction'];\n hidden?: boolean;\n sx?: MuiSpeedDialProps['sx'];\n };\n }\n>;\n\nexport const useSpeedDial = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'SpeedDial',\n props: {\n ariaLabel: '',\n actions: [],\n icon: undefined,\n direction: 'up',\n hidden: false,\n sx: undefined,\n },\n view: () => (\n <MuiSpeedDial\n ariaLabel={m.ariaLabel}\n icon={m.icon ? <m.icon /> : <SpeedDialIcon />}\n direction={m.direction}\n hidden={m.hidden}\n sx={m.sx}\n >\n {m.actions.map((action) => (\n <SpeedDialAction\n key={action.name}\n icon={<action.icon />}\n title={action.name}\n onClick={action.onClick}\n />\n ))}\n </MuiSpeedDial>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SpeedDialStruct = Struct;\n\nexport const SpeedDial = toReact(useSpeedDial);\nSpeedDial.displayName = 'SpeedDial';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Stepper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Stepper as MuiStepper,\n Step,\n StepLabel,\n Typography,\n type StepperProps as MuiStepperProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type StepDef = {\n label: string;\n optional?: string;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n activeStep: number;\n steps: StepDef[];\n orientation?: MuiStepperProps['orientation'];\n alternativeLabel?: boolean;\n nonLinear?: boolean;\n sx?: MuiStepperProps['sx'];\n };\n }\n>;\n\nexport const useStepper = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Stepper',\n props: {\n activeStep: 0,\n steps: [],\n orientation: 'horizontal',\n alternativeLabel: false,\n nonLinear: false,\n sx: undefined,\n },\n view: () => (\n <MuiStepper\n activeStep={m.activeStep}\n orientation={m.orientation}\n alternativeLabel={m.alternativeLabel}\n nonLinear={m.nonLinear}\n sx={m.sx}\n >\n {m.steps.map((step, i) => (\n <Step key={i}>\n <StepLabel\n optional={\n step.optional ? (\n <Typography variant=\"caption\">{step.optional}</Typography>\n ) : undefined\n }\n >\n {step.label}\n </StepLabel>\n </Step>\n ))}\n </MuiStepper>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type StepperStruct = Struct;\n\nexport const Stepper = toReact(useStepper);\nStepper.displayName = 'Stepper';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Switch.tsx"],"sourcesContent":["import React from 'react';\nimport {\n Switch as MuiSwitch,\n FormControl,\n FormControlLabel,\n FormHelperText,\n type SwitchProps as MuiSwitchProps,\n type FormControlProps as MuiFormControlProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: string;\n helperText?: string;\n error?: boolean;\n color?: MuiSwitchProps['color'];\n size?: MuiSwitchProps['size'];\n sx?: MuiFormControlProps['sx'];\n };\n }\n>;\n\nexport const useSwitch = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Switch',\n props: {\n checked: false,\n onChange: () => {},\n label: undefined,\n helperText: undefined,\n error: false,\n color: 'primary',\n size: 'medium',\n sx: undefined,\n },\n view: () => {\n const sw = (\n <MuiSwitch\n checked={m.checked}\n onChange={(e) => m.onChange(e.target.checked)}\n color={m.color}\n size={m.size}\n />\n );\n return (\n <FormControl\n error={m.error}\n disabled={m.$.isDisabled}\n sx={m.sx}\n >\n {m.label != null ? (\n <FormControlLabel control={sw} label={m.label} />\n ) : (\n sw\n )}\n {m.helperText && <FormHelperText>{m.helperText}</FormHelperText>}\n </FormControl>\n );\n },\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type SwitchStruct = Struct;\n\nexport const Switch = toReact(useSwitch);\nSwitch.displayName = 'Switch';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Table.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Table.tsx"],"sourcesContent":["import React from 'react';\nimport {\n TableContainer,\n Table as MuiTable,\n TableHead,\n TableBody,\n TableRow,\n TableCell,\n Paper,\n type TableProps as MuiTableProps,\n type TableContainerProps as MuiTableContainerProps,\n type TableCellProps as MuiTableCellProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type TableColumn = {\n id: string;\n label: string;\n align?: MuiTableCellProps['align'];\n minWidth?: number;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n columns: TableColumn[];\n rows: Record<string, React.ReactNode>[];\n stickyHeader?: boolean;\n size?: MuiTableProps['size'];\n sx?: MuiTableContainerProps['sx'];\n };\n }\n>;\n\nexport const useTable = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Table',\n props: {\n columns: [],\n rows: [],\n stickyHeader: false,\n size: 'medium',\n sx: undefined,\n },\n view: () => (\n <TableContainer component={Paper} sx={m.sx}>\n <MuiTable stickyHeader={m.stickyHeader} size={m.size}>\n <TableHead>\n <TableRow>\n {m.columns.map((col) => (\n <TableCell\n key={col.id}\n align={col.align}\n style={col.minWidth ? { minWidth: col.minWidth } : undefined}\n >\n {col.label}\n </TableCell>\n ))}\n </TableRow>\n </TableHead>\n <TableBody>\n {m.rows.map((row, i) => (\n <TableRow key={i} hover>\n {m.columns.map((col) => (\n <TableCell key={col.id} align={col.align}>\n {row[col.id]}\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </MuiTable>\n </TableContainer>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type TableStruct = Struct;\n\nexport const Table = toReact(useTable);\nTable.displayName = 'Table';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Tabs.tsx"],"sourcesContent":["import React from 'react';\nimport { Tabs as MuiTabs, Tab as MuiTab, Box, type TabsProps as MuiTabsProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type TabItem = {\n value: string;\n label: string;\n content?: React.FC;\n disabled?: boolean;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string;\n onChange: (value: string) => void;\n tabs: TabItem[];\n orientation?: MuiTabsProps['orientation'];\n variant?: MuiTabsProps['variant'];\n sx?: MuiTabsProps['sx'];\n };\n }\n>;\n\nexport const useTabs = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Tabs',\n props: {\n value: '',\n onChange: () => {},\n tabs: [],\n orientation: 'horizontal',\n variant: 'standard',\n sx: undefined,\n },\n view: () =>\n m.orientation === 'vertical' ? (\n <Box sx={{ display: 'flex' }}>\n <Box sx={{ borderRight: 1, borderColor: 'divider' }}>\n <MuiTabs\n value={m.value}\n onChange={(_, v: string) => m.onChange(v)}\n orientation=\"vertical\"\n variant={m.variant}\n sx={m.sx}\n >\n {m.tabs.map((tab) => (\n <MuiTab key={tab.value} value={tab.value} label={tab.label} disabled={tab.disabled} />\n ))}\n </MuiTabs>\n </Box>\n <Box sx={{ flex: 1 }}>\n {m.tabs.map((tab) => (\n <div key={tab.value} role=\"tabpanel\" hidden={m.value !== tab.value}>\n {m.value === tab.value && tab.content && <tab.content />}\n </div>\n ))}\n </Box>\n </Box>\n ) : (\n <>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <MuiTabs\n value={m.value}\n onChange={(_, v: string) => m.onChange(v)}\n variant={m.variant}\n sx={m.sx}\n >\n {m.tabs.map((tab) => (\n <MuiTab key={tab.value} value={tab.value} label={tab.label} disabled={tab.disabled} />\n ))}\n </MuiTabs>\n </Box>\n {m.tabs.map((tab) => (\n <div key={tab.value} role=\"tabpanel\" hidden={m.value !== tab.value}>\n {m.value === tab.value && tab.content && <tab.content />}\n </div>\n ))}\n </>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type TabsStruct = Struct;\n\nexport const Tabs = toReact(useTabs);\nTabs.displayName = 'Tabs';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/TextField.tsx"],"sourcesContent":["import React from 'react';\nimport { TextField as MuiTextField, type TextFieldProps as MuiTextFieldProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string;\n onChange: (value: string) => void;\n label?: string;\n placeholder?: string;\n helperText?: string;\n error?: boolean;\n type?: string;\n multiline?: boolean;\n rows?: number;\n fullWidth?: boolean;\n variant?: MuiTextFieldProps['variant'];\n size?: MuiTextFieldProps['size'];\n color?: MuiTextFieldProps['color'];\n sx?: MuiTextFieldProps['sx'];\n };\n }\n>;\n\nexport const useTextField = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'TextField',\n props: {\n value: '',\n onChange: () => {},\n label: undefined,\n placeholder: undefined,\n helperText: undefined,\n error: false,\n type: 'text',\n multiline: false,\n rows: undefined,\n fullWidth: false,\n variant: 'outlined',\n size: 'medium',\n color: 'primary',\n sx: undefined,\n },\n view: () => (\n <MuiTextField\n value={m.value}\n onChange={(e) => m.onChange(e.target.value)}\n label={m.label}\n placeholder={m.placeholder}\n helperText={m.helperText}\n error={m.error}\n type={m.type}\n multiline={m.multiline}\n rows={m.rows}\n fullWidth={m.fullWidth}\n variant={m.variant}\n size={m.size}\n color={m.color}\n disabled={m.$.isDisabled}\n slotProps={{ input: { readOnly: m.$.isReadOnly } }}\n sx={m.sx}\n />\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type TextFieldStruct = Struct;\n\nexport const TextField = toReact(useTextField);\nTextField.displayName = 'TextField';\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;"}
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;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButtonGroup.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/ToggleButtonGroup.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ToggleButtonGroup as MuiToggleButtonGroup,\n ToggleButton as MuiToggleButton,\n type ToggleButtonGroupProps as MuiToggleButtonGroupProps,\n} from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\n\nexport type ToggleItem = {\n value: string;\n label?: React.ReactNode;\n icon?: React.FC;\n disabled?: boolean;\n};\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n value: string | string[];\n onChange: (value: string | string[]) => void;\n items: ToggleItem[];\n exclusive?: boolean;\n size?: MuiToggleButtonGroupProps['size'];\n color?: MuiToggleButtonGroupProps['color'];\n orientation?: MuiToggleButtonGroupProps['orientation'];\n fullWidth?: boolean;\n sx?: MuiToggleButtonGroupProps['sx'];\n };\n }\n>;\n\nexport const useToggleButtonGroup = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'ToggleButtonGroup',\n props: {\n value: [],\n onChange: () => {},\n items: [],\n exclusive: false,\n size: 'medium',\n color: 'standard',\n orientation: 'horizontal',\n fullWidth: false,\n sx: undefined,\n },\n view: () => (\n <MuiToggleButtonGroup\n value={m.value}\n onChange={(_, newValue) => {\n if (newValue !== null) m.onChange(newValue);\n }}\n exclusive={m.exclusive}\n size={m.size}\n color={m.color}\n orientation={m.orientation}\n fullWidth={m.fullWidth}\n disabled={m.$.isDisabled}\n sx={m.sx}\n >\n {m.items.map((item) => (\n <MuiToggleButton key={item.value} value={item.value} disabled={item.disabled}>\n {item.icon && <item.icon />}\n {item.label}\n </MuiToggleButton>\n ))}\n </MuiToggleButtonGroup>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type ToggleButtonGroupStruct = Struct;\n\nexport const ToggleButtonGroup = toReact(useToggleButtonGroup);\nToggleButtonGroup.displayName = 'ToggleButtonGroup';\n"],"names":["MuiToggleButtonGroup","MuiToggleButton"],"mappings":";;;;;AAwCO,MAAM,uBAAuB,wBAAC,WAAuD;AACxF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO,CAAA;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,OAAO,CAAA;AAAA,MACP,WAAW;AAAA,MACX,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,WAAW;AAAA,MACX,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa;AACvB,cAAI,aAAa,KAAM,GAAE,SAAS,QAAQ;AAAA,QAC9C,GAFU;AAAA,QAGV,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,OAAO,EAAE;AAAA,QACT,aAAa,EAAE;AAAA,QACf,WAAW,EAAE;AAAA,QACb,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,MAAM,IAAI,CAAC,6CACTC,cAAA,EAAgB,KAAK,KAAK,OAAO,OAAO,KAAK,OAAO,UAAU,KAAK,YAC/D,KAAK,QAAQ,sBAAA,cAAC,KAAK,MAAL,IAAU,GACxB,KAAK,KACV,CACH;AAAA,IAAA,GAnBH;AAAA,EAoBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA5CoC;AAgD7B,MAAM,oBAAoB,QAAQ,oBAAoB;AAC7D,kBAAkB,cAAc;"}
1
+ {"version":3,"file":"ToggleButtonGroup.es.js","sources":["../src/ToggleButtonGroup.tsx"],"sourcesContent":["import React from 'react';\r\nimport {\r\n ToggleButtonGroup as MuiToggleButtonGroup,\r\n ToggleButton as MuiToggleButton,\r\n type ToggleButtonGroupProps as MuiToggleButtonGroupProps,\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 ToggleItem = {\r\n value: string;\r\n label?: React.ReactNode;\r\n icon?: 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 | string[];\r\n onChange: (value: string | string[]) => void;\r\n items: ToggleItem[];\r\n exclusive?: boolean;\r\n size?: MuiToggleButtonGroupProps['size'];\r\n color?: MuiToggleButtonGroupProps['color'];\r\n orientation?: MuiToggleButtonGroupProps['orientation'];\r\n fullWidth?: boolean;\r\n sx?: MuiToggleButtonGroupProps['sx'];\r\n };\r\n }\r\n>;\r\n\r\nexport const useToggleButtonGroup = (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: 'ToggleButtonGroup',\r\n props: {\r\n value: [],\r\n onChange: () => {},\r\n items: [],\r\n exclusive: false,\r\n size: 'medium',\r\n color: 'standard',\r\n orientation: 'horizontal',\r\n fullWidth: false,\r\n sx: undefined,\r\n },\r\n view: () => (\r\n <MuiToggleButtonGroup\r\n value={m.value}\r\n onChange={(_, newValue) => {\r\n if (newValue !== null) m.onChange(newValue);\r\n }}\r\n exclusive={m.exclusive}\r\n size={m.size}\r\n color={m.color}\r\n orientation={m.orientation}\r\n fullWidth={m.fullWidth}\r\n disabled={m.$.isDisabled}\r\n sx={m.sx}\r\n >\r\n {m.items.map((item) => (\r\n <MuiToggleButton key={item.value} value={item.value} disabled={item.disabled}>\r\n {item.icon && <item.icon />}\r\n {item.label}\r\n </MuiToggleButton>\r\n ))}\r\n </MuiToggleButtonGroup>\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 ToggleButtonGroupStruct = Struct;\r\n\r\nexport const ToggleButtonGroup = toReact(useToggleButtonGroup);\r\nToggleButtonGroup.displayName = 'ToggleButtonGroup';\r\n"],"names":["MuiToggleButtonGroup","MuiToggleButton"],"mappings":";;;;;AAwCO,MAAM,uBAAuB,wBAAC,WAAuD;AACxF,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO,CAAA;AAAA,MACP,UAAU,6BAAM;AAAA,MAAC,GAAP;AAAA,MACV,OAAO,CAAA;AAAA,MACP,WAAW;AAAA,MACX,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,WAAW;AAAA,MACX,IAAI;AAAA,IAAA;AAAA,IAER,MAAM,6BACF,sBAAA;AAAA,MAACA;AAAAA,MAAA;AAAA,QACG,OAAO,EAAE;AAAA,QACT,UAAU,wBAAC,GAAG,aAAa;AACvB,cAAI,aAAa,KAAM,GAAE,SAAS,QAAQ;AAAA,QAC9C,GAFU;AAAA,QAGV,WAAW,EAAE;AAAA,QACb,MAAM,EAAE;AAAA,QACR,OAAO,EAAE;AAAA,QACT,aAAa,EAAE;AAAA,QACf,WAAW,EAAE;AAAA,QACb,UAAU,EAAE,EAAE;AAAA,QACd,IAAI,EAAE;AAAA,MAAA;AAAA,MAEL,EAAE,MAAM,IAAI,CAAC,6CACTC,cAAA,EAAgB,KAAK,KAAK,OAAO,OAAO,KAAK,OAAO,UAAU,KAAK,YAC/D,KAAK,QAAQ,sBAAA,cAAC,KAAK,MAAL,IAAU,GACxB,KAAK,KACV,CACH;AAAA,IAAA,GAnBH;AAAA,EAoBF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GA5CoC;AAgD7B,MAAM,oBAAoB,QAAQ,oBAAoB;AAC7D,kBAAkB,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.es.js","sources":["D:/Src/my/actdim/public/dynstruct-mui/src/Tooltip.tsx"],"sourcesContent":["import React from 'react';\nimport { Tooltip as MuiTooltip, type TooltipProps as MuiTooltipProps } from '@mui/material';\nimport {\n type ComponentStruct,\n type ComponentDef,\n type ComponentParams,\n type Component,\n type ComponentModel,\n} from '@actdim/dynstruct/componentModel/contracts';\nimport { useComponent, toReact } from '@actdim/dynstruct/componentModel/react/hooks';\nimport { type BaseAppMsgStruct } from '@actdim/dynstruct/appDomain/appContracts';\nimport { KeyPath } from '@actdim/utico/typeCore';\n\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\n TMsgStruct,\n {\n props: {\n title: React.ReactNode;\n children: React.FC;\n placement?: MuiTooltipProps['placement'];\n arrow?: boolean;\n };\n }\n>;\n\nexport const useTooltip = (params: ComponentParams<Struct>): Component<Struct> => {\n let c: Component<Struct>;\n let m: ComponentModel<Struct>;\n\n const def: ComponentDef<Struct> = {\n regType: 'Tooltip',\n props: {\n title: '',\n children: () => null,\n placement: 'bottom',\n arrow: false,\n },\n view: () => (\n <MuiTooltip title={m.title} placement={m.placement} arrow={m.arrow}>\n <span>\n <m.children />\n </span>\n </MuiTooltip>\n ),\n };\n\n c = useComponent(def, params);\n m = c.model;\n return c;\n};\n\nexport type TooltipStruct = Struct;\n\nexport const Tooltip = toReact(useTooltip);\nTooltip.displayName = 'Tooltip';\n"],"names":["MuiTooltip"],"mappings":";;;;;AAyBO,MAAM,aAAa,wBAAC,WAAuD;AAC9E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM,MAAN;AAAA,MACV,WAAW;AAAA,MACX,OAAO;AAAA,IAAA;AAAA,IAEX,MAAM,6BACF,sBAAA,cAACA,WAAA,EAAW,OAAO,EAAE,OAAO,WAAW,EAAE,WAAW,OAAO,EAAE,MAAA,uCACxD,QAAA,MACG,sBAAA,cAAC,EAAE,UAAF,IAAW,CAChB,CACJ,GALE;AAAA,EAKF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAxB0B;AA4BnB,MAAM,UAAU,QAAQ,UAAU;AACzC,QAAQ,cAAc;"}
1
+ {"version":3,"file":"Tooltip.es.js","sources":["../src/Tooltip.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Tooltip as MuiTooltip, type TooltipProps as MuiTooltipProps } 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\nimport { KeyPath } from '@actdim/utico/typeCore';\r\n\r\ntype Struct<TMsgStruct extends BaseAppMsgStruct = BaseAppMsgStruct> = ComponentStruct<\r\n TMsgStruct,\r\n {\r\n props: {\r\n title: React.ReactNode;\r\n children: React.FC;\r\n placement?: MuiTooltipProps['placement'];\r\n arrow?: boolean;\r\n };\r\n }\r\n>;\r\n\r\nexport const useTooltip = (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: 'Tooltip',\r\n props: {\r\n title: '',\r\n children: () => null,\r\n placement: 'bottom',\r\n arrow: false,\r\n },\r\n view: () => (\r\n <MuiTooltip title={m.title} placement={m.placement} arrow={m.arrow}>\r\n <span>\r\n <m.children />\r\n </span>\r\n </MuiTooltip>\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 TooltipStruct = Struct;\r\n\r\nexport const Tooltip = toReact(useTooltip);\r\nTooltip.displayName = 'Tooltip';\r\n"],"names":["MuiTooltip"],"mappings":";;;;;AAyBO,MAAM,aAAa,wBAAC,WAAuD;AAC9E,MAAI;AACJ,MAAI;AAEJ,QAAM,MAA4B;AAAA,IAC9B,SAAS;AAAA,IACT,OAAO;AAAA,MACH,OAAO;AAAA,MACP,UAAU,6BAAM,MAAN;AAAA,MACV,WAAW;AAAA,MACX,OAAO;AAAA,IAAA;AAAA,IAEX,MAAM,6BACF,sBAAA,cAACA,WAAA,EAAW,OAAO,EAAE,OAAO,WAAW,EAAE,WAAW,OAAO,EAAE,MAAA,uCACxD,QAAA,MACG,sBAAA,cAAC,EAAE,UAAF,IAAW,CAChB,CACJ,GALE;AAAA,EAKF;AAIR,MAAI,aAAa,KAAK,MAAM;AAC5B,MAAI,EAAE;AACN,SAAO;AACX,GAxB0B;AA4BnB,MAAM,UAAU,QAAQ,UAAU;AACzC,QAAQ,cAAc;"}