dinocollab-shared 1.2.19 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-license/action-group.js +2 -0
- package/dist/action-license/action-group.js.map +1 -0
- package/dist/action-license/area.group.js +2 -0
- package/dist/action-license/area.group.js.map +1 -0
- package/dist/action-license/btn.icon.add-to-cart.js +2 -0
- package/dist/action-license/btn.icon.add-to-cart.js.map +1 -0
- package/dist/action-license/btn.icon.add-to-package.js +2 -0
- package/dist/action-license/btn.icon.add-to-package.js.map +1 -0
- package/dist/action-license/buttons.js +2 -0
- package/dist/action-license/buttons.js.map +1 -0
- package/dist/action-license/index.js +2 -0
- package/dist/action-license/index.js.map +1 -0
- package/dist/action-license/modal.add-to-cart.js +2 -0
- package/dist/action-license/modal.add-to-cart.js.map +1 -0
- package/dist/action-license/quickly-add-to-cart/content.js +2 -0
- package/dist/action-license/quickly-add-to-cart/content.js.map +1 -0
- package/dist/action-license/quickly-add-to-cart/form.js +2 -0
- package/dist/action-license/quickly-add-to-cart/form.js.map +1 -0
- package/dist/action-license/quickly-add-to-cart/index.js +2 -0
- package/dist/action-license/quickly-add-to-cart/index.js.map +1 -0
- package/dist/action-license/quickly-add-to-cart/type.js +2 -0
- package/dist/action-license/quickly-add-to-cart/type.js.map +1 -0
- package/dist/cart/styled.js.map +1 -1
- package/dist/media-right/group-selector/index.js +1 -1
- package/dist/media-right/group-selector/index.js.map +1 -1
- package/dist/types/action-license/action-group.d.ts +10 -0
- package/dist/types/action-license/action-group.d.ts.map +1 -0
- package/dist/types/action-license/area.group.d.ts +11 -0
- package/dist/types/action-license/area.group.d.ts.map +1 -0
- package/dist/types/action-license/btn.icon.add-to-cart.d.ts +10 -0
- package/dist/types/action-license/btn.icon.add-to-cart.d.ts.map +1 -0
- package/dist/types/action-license/btn.icon.add-to-package.d.ts +15 -0
- package/dist/types/action-license/btn.icon.add-to-package.d.ts.map +1 -0
- package/dist/types/action-license/buttons.d.ts +6 -0
- package/dist/types/action-license/buttons.d.ts.map +1 -0
- package/dist/types/action-license/index.d.ts +8 -0
- package/dist/types/action-license/index.d.ts.map +1 -0
- package/dist/types/action-license/modal.add-to-cart.d.ts +18 -0
- package/dist/types/action-license/modal.add-to-cart.d.ts.map +1 -0
- package/dist/types/action-license/quickly-add-to-cart/content.d.ts +24 -0
- package/dist/types/action-license/quickly-add-to-cart/content.d.ts.map +1 -0
- package/dist/types/action-license/quickly-add-to-cart/form.d.ts +12 -0
- package/dist/types/action-license/quickly-add-to-cart/form.d.ts.map +1 -0
- package/dist/types/action-license/quickly-add-to-cart/index.d.ts +14 -0
- package/dist/types/action-license/quickly-add-to-cart/index.d.ts.map +1 -0
- package/dist/types/action-license/quickly-add-to-cart/type.d.ts +27 -0
- package/dist/types/action-license/quickly-add-to-cart/type.d.ts.map +1 -0
- package/dist/types/action-license/types.d.ts +7 -0
- package/dist/types/action-license/types.d.ts.map +1 -0
- package/dist/types/cart/styled.d.ts.map +1 -1
- package/dist/types/media-right/group-selector/index.d.ts +1 -1
- package/dist/types/media-right/group-selector/index.d.ts.map +1 -1
- package/package.json +8 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as a}from"react/jsx-runtime";import{Stack as e}from"@mui/material";import{ButtonIconAddToCart as i}from"./btn.icon.add-to-cart.js";import{ButtonIconAddToPackage as p}from"./btn.icon.add-to-package.js";var c=["packageProps","cartProps"],m=function(m){var s=m.packageProps,n=m.cartProps,l=r(m,c);return t(e,o(o({direction:"row",gap:1},l),{},{children:[s&&a(p,o({},s)),n&&a(i,o({},n))]}))};export{m as ActionGroup,m as default};
|
|
2
|
+
//# sourceMappingURL=action-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-group.js","sources":["../../src/action-license/action-group.tsx"],"sourcesContent":["import { Stack } from '@mui/material'\r\nimport { ButtonIconAddToCart } from './btn.icon.add-to-cart'\r\nimport { ButtonIconAddToPackage } from './btn.icon.add-to-package'\r\nimport type { StackProps } from '@mui/material'\r\nimport type { ButtonIconAddToCartProps } from './btn.icon.add-to-cart'\r\nimport type { BtnIconAddToPackageProps } from './btn.icon.add-to-package'\r\n\r\nexport interface IActionGroupsProps<TProduct> extends StackProps {\r\n packageProps?: BtnIconAddToPackageProps<TProduct>\r\n cartProps?: ButtonIconAddToCartProps<TProduct>\r\n}\r\n\r\nexport const ActionGroup = <T,>({ packageProps, cartProps, ...stackProps }: IActionGroupsProps<T>) => {\r\n return (\r\n <Stack direction={'row'} gap={1} {...stackProps}>\r\n {packageProps && <ButtonIconAddToPackage {...packageProps} />}\r\n {cartProps && <ButtonIconAddToCart {...cartProps} />}\r\n </Stack>\r\n )\r\n}\r\n\r\nexport default ActionGroup\r\n"],"names":["ActionGroup","_ref","packageProps","cartProps","stackProps","_objectWithoutProperties","_excluded","_jsxs","Stack","_objectSpread","direction","gap","children","_jsx","ButtonIconAddToPackage","ButtonIconAddToCart"],"mappings":"uWAYaA,EAAc,SAAHC,GAA6E,IAAnEC,EAAYD,EAAZC,aAAcC,EAASF,EAATE,UAAcC,EAAUC,EAAAJ,EAAAK,GACtE,OACEC,EAACC,EAAKC,EAAAA,EAAA,CAACC,UAAW,MAAOC,IAAK,GAAOP,GAAU,GAAA,CAC5CQ,SAAA,CAAAV,GAAgBW,EAACC,EAAsBL,EAAA,CAAA,EAAKP,IAC5CC,GAAaU,EAACE,EAAmBN,EAAA,CAAA,EAAKN,OAG7C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectWithoutProperties as r,objectSpread2 as o}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as t,jsx as e}from"react/jsx-runtime";import{Stack as a,Typography as i,Box as c}from"@mui/material";import{ButtonIconAddToPackage as d,EBtnAddToPackage as n}from"./btn.icon.add-to-package.js";import{AreaQuicklyAddToCart as u}from"./quickly-add-to-cart/index.js";var l=["product","packageProps","cartProps"],p=function(p){var s=p.product,m=p.packageProps,b=p.cartProps,g=r(p,l);return t(a,o(o({gap:1},g),{},{sx:o({padding:2,border:1,borderRadius:3,boxShadow:2,borderColor:function(r){return r.palette.divider},backgroundColor:function(r){return r.palette.background.default}},g.sx||{}),children:[e(a,{sx:{flex:1},children:e(i,{variant:"body2",sx:{color:"var(--color-text-2)"},children:"For social media, YouTube, blogs & educational use."})}),t(a,{gap:3,children:[m&&t(c,{children:[e(i,{variant:"body1",fontWeight:600,gutterBottom:!0,children:"License Package:"}),e(d,o(o({product:s},m),{},{kind:n.Button}))]}),b&&t(c,{children:[e(i,{variant:"body1",fontWeight:600,gutterBottom:!0,children:"Quick Purchase:"}),e(u,o({product:s},b))]})]})]}))};export{p as AreaActionGroups};
|
|
2
|
+
//# sourceMappingURL=area.group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.group.js","sources":["../../src/action-license/area.group.tsx"],"sourcesContent":["import { Box, Stack, Typography } from '@mui/material'\r\nimport { ButtonIconAddToPackage } from './btn.icon.add-to-package'\r\nimport { AreaQuicklyAddToCart } from './quickly-add-to-cart'\r\nimport { EBtnAddToPackage } from './btn.icon.add-to-package'\r\nimport type { StackProps } from '@mui/material'\r\nimport type { AreaQuicklyAddToCartProps } from './quickly-add-to-cart'\r\nimport type { BtnIconAddToPackageProps } from './btn.icon.add-to-package'\r\nimport { IPricePackage } from './types'\r\n\r\nexport interface IAreaActionGroupsProps<TProduct, TPrices extends IPricePackage> extends StackProps {\r\n product: TProduct\r\n packageProps?: Omit<BtnIconAddToPackageProps<TProduct>, 'product'>\r\n cartProps?: Omit<AreaQuicklyAddToCartProps<TProduct, TPrices>, 'product'>\r\n}\r\n\r\nexport const AreaActionGroups = <TProduct, TPrices extends IPricePackage>({\r\n product,\r\n packageProps,\r\n cartProps,\r\n ...stackProps\r\n}: IAreaActionGroupsProps<TProduct, TPrices>) => {\r\n return (\r\n <Stack\r\n gap={1}\r\n {...stackProps}\r\n sx={{\r\n padding: 2,\r\n border: 1,\r\n borderRadius: 3,\r\n boxShadow: 2,\r\n borderColor: (theme) => theme.palette.divider,\r\n backgroundColor: (theme) => theme.palette.background.default,\r\n ...(stackProps.sx || {})\r\n }}\r\n >\r\n <Stack sx={{ flex: 1 }}>\r\n <Typography variant='body2' sx={{ color: 'var(--color-text-2)' }}>\r\n For social media, YouTube, blogs & educational use.\r\n </Typography>\r\n </Stack>\r\n <Stack gap={3}>\r\n {packageProps && (\r\n <Box>\r\n <Typography variant='body1' fontWeight={600} gutterBottom>\r\n License Package:\r\n </Typography>\r\n <ButtonIconAddToPackage product={product} {...packageProps} kind={EBtnAddToPackage.Button} />\r\n </Box>\r\n )}\r\n {cartProps && (\r\n <Box>\r\n <Typography variant='body1' fontWeight={600} gutterBottom>\r\n Quick Purchase:\r\n </Typography>\r\n <AreaQuicklyAddToCart<TProduct, TPrices> product={product} {...cartProps} />\r\n </Box>\r\n )}\r\n </Stack>\r\n </Stack>\r\n )\r\n}\r\n"],"names":["AreaActionGroups","_ref","product","packageProps","cartProps","stackProps","_objectWithoutProperties","_excluded","_jsxs","Stack","_objectSpread","gap","sx","padding","border","borderRadius","boxShadow","borderColor","theme","palette","divider","backgroundColor","background","children","_jsx","flex","Typography","variant","color","Box","fontWeight","gutterBottom","ButtonIconAddToPackage","kind","EBtnAddToPackage","Button","AreaQuicklyAddToCart"],"mappings":"saAeaA,EAAmB,SAAHC,GAKmB,IAJ9CC,EAAOD,EAAPC,QACAC,EAAYF,EAAZE,aACAC,EAASH,EAATG,UACGC,EAAUC,EAAAL,EAAAM,GAEb,OACEC,EAACC,EAAKC,EAAAA,EAAA,CACJC,IAAK,GACDN,GAAU,GAAA,CACdO,GAAEF,EAAA,CACAG,QAAS,EACTC,OAAQ,EACRC,aAAc,EACdC,UAAW,EACXC,YAAa,SAACC,GAAK,OAAKA,EAAMC,QAAQC,OAAO,EAC7CC,gBAAiB,SAACH,GAAK,OAAKA,EAAMC,QAAQG,WAAkB,OAAA,GACxDjB,EAAWO,IAAM,IAGvBW,SAAA,CAAAC,EAACf,EAAM,CAAAG,GAAI,CAAEa,KAAM,GAAGF,SACpBC,EAACE,EAAU,CAACC,QAAQ,QAAQf,GAAI,CAAEgB,MAAO,0FAI3CpB,EAACC,EAAM,CAAAE,IAAK,EAACY,SAAA,CACVpB,GACCK,EAACqB,EACC,CAAAN,SAAA,CAAAC,EAACE,EAAU,CAACC,QAAQ,QAAQG,WAAY,IAAKC,8CAG7CP,EAACQ,EAAsBtB,EAAAA,EAAA,CAACR,QAASA,GAAaC,GAAY,GAAA,CAAE8B,KAAMC,EAAiBC,aAGtF/B,GACCI,EAACqB,EAAG,CAAAN,SAAA,CACFC,EAACE,GAAWC,QAAQ,QAAQG,WAAY,IAAKC,cAEhC,EAAAR,SAAA,oBACbC,EAACY,EAAoB1B,EAAA,CAAoBR,QAASA,GAAaE,aAM3E"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectSpread2 as o}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as r}from"react/jsx-runtime";import{Tooltip as t,IconButton as i}from"@mui/material";import a from"@mui/icons-material/AddShoppingCart";var n=function(n){var e=n.product,l=n.tooltipProps,p=n.onClick,m=n.buttonProps;return r(t,o(o({title:"Add to Cart",arrow:!0,placement:"top"},l),{},{children:r(i,o(o({variant:"contained",color:"inherit",size:"small",onClick:function(o){o.stopPropagation(),p(e,o)}},m),{},{children:r(a,{fontSize:"small",sx:{fontSize:18}})}))}))};export{n as ButtonIconAddToCart};
|
|
2
|
+
//# sourceMappingURL=btn.icon.add-to-cart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.icon.add-to-cart.js","sources":["../../src/action-license/btn.icon.add-to-cart.tsx"],"sourcesContent":["import { IconButton, Tooltip } from '@mui/material'\r\nimport AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart'\r\nimport type { ButtonProps, TooltipProps } from '@mui/material'\r\n\r\nexport interface ButtonIconAddToCartProps<T> extends Omit<ButtonProps, 'onClick'> {\r\n product: T\r\n tooltipProps?: TooltipProps\r\n buttonProps?: ButtonProps\r\n onClick: (item: T, e: React.MouseEvent<HTMLButtonElement>) => void\r\n}\r\n\r\nexport const ButtonIconAddToCart = <T,>({ product, tooltipProps, onClick, buttonProps }: ButtonIconAddToCartProps<T>) => {\r\n return (\r\n <Tooltip title='Add to Cart' arrow placement={'top'} {...tooltipProps}>\r\n <IconButton\r\n variant='contained'\r\n color='inherit'\r\n size='small'\r\n onClick={(e) => {\r\n e.stopPropagation()\r\n onClick(product, e)\r\n }}\r\n {...buttonProps}\r\n >\r\n <AddShoppingCartIcon fontSize='small' sx={{ fontSize: 18 }} />\r\n </IconButton>\r\n </Tooltip>\r\n )\r\n}\r\n"],"names":["ButtonIconAddToCart","_ref","product","tooltipProps","onClick","buttonProps","_jsx","Tooltip","_objectSpread","title","arrow","placement","IconButton","variant","color","size","e","stopPropagation","children","AddShoppingCartIcon","fontSize","sx"],"mappings":"gOAWaA,EAAsB,SAAHC,GAAwF,IAA9EC,EAAOD,EAAPC,QAASC,EAAYF,EAAZE,aAAcC,EAAOH,EAAPG,QAASC,EAAWJ,EAAXI,YACxE,OACEC,EAACC,EAAOC,EAAAA,EAAA,CAACC,MAAM,cAAcC,OAAK,EAACC,UAAW,OAAWR,GAAY,GAAA,UACnEG,EAACM,EAAUJ,EAAAA,EAAA,CACTK,QAAQ,YACRC,MAAM,UACNC,KAAK,QACLX,QAAS,SAACY,GACRA,EAAEC,kBACFb,EAAQF,EAASc,EACnB,GACIX,GAAW,GAAA,CAEfa,SAAAZ,EAACa,EAAoB,CAAAC,SAAS,QAAQC,GAAI,CAAED,SAAU,WAI9D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectSpread2 as o}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as t,jsxs as r}from"react/jsx-runtime";import{Tooltip as n,IconButton as e,Stack as i,Button as a,alpha as l}from"@mui/material";import c from"@mui/icons-material/BookmarkAddOutlined";import{HelpOutlinePulseIcon as u}from"dinocollab-core/components";var p;!function(o){o.Icon="icon",o.Button="button"}(p||(p={}));var s=function(s){var d=s.product,m=s.buttonProps,f=s.tooltipProps,b=s.helpProps,k=s.kind,h=void 0===k?p.Icon:k,g=s.addToCart;return d?h===p.Button?r(i,{direction:"row",justifyContent:"space-between",alignItems:"center",position:"relative",children:[t(a,o(o({startIcon:t(c,{fontSize:"small"}),fullWidth:!0,type:"submit",variant:"contained",color:"success",onClick:function(){return g(d)}},m),{},{children:"Add to Package"})),t(n,{title:"Read more about our services",placement:"left",children:t(e,o(o({sx:{position:"absolute",right:"-11px",bottom:"-11px",color:function(o){return l(o.palette.primary.main,.8)},backgroundColor:function(o){return o.palette.background.paper},"&:hover":{backgroundColor:function(o){return o.palette.background.paper}}},size:"small",onClick:function(o){return o.stopPropagation()}},b),{},{children:t(u,{})}))})]}):t(n,o(o({title:"Add to Package",arrow:!0,placement:"top"},f),{},{children:t(e,o(o({variant:"contained",color:"inherit",size:"small",onClick:function(){return g(d)}},m),{},{children:t(c,{fontSize:"small",sx:{fontSize:18}})}))})):null};export{s as ButtonIconAddToPackage,p as EBtnAddToPackage};
|
|
2
|
+
//# sourceMappingURL=btn.icon.add-to-package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.icon.add-to-package.js","sources":["../../src/action-license/btn.icon.add-to-package.tsx"],"sourcesContent":["import { alpha, Button, IconButton, Stack, Tooltip } from '@mui/material'\r\nimport BookmarkAddOutlinedIcon from '@mui/icons-material/BookmarkAddOutlined'\r\nimport { HelpOutlinePulseIcon } from 'dinocollab-core/components'\r\nimport type { ButtonProps, IconButtonProps, TooltipProps } from '@mui/material'\r\n\r\nexport enum EBtnAddToPackage {\r\n Icon = 'icon',\r\n Button = 'button'\r\n}\r\nexport interface BtnIconAddToPackageProps<T> {\r\n product: T\r\n buttonProps?: ButtonProps\r\n tooltipProps?: TooltipProps\r\n helpProps?: Partial<IconButtonProps> & Record<string, any>\r\n kind?: EBtnAddToPackage\r\n addToCart: (item: T) => void\r\n}\r\n\r\nexport const ButtonIconAddToPackage = <T,>({\r\n product,\r\n buttonProps,\r\n tooltipProps,\r\n helpProps,\r\n kind = EBtnAddToPackage.Icon,\r\n addToCart\r\n}: BtnIconAddToPackageProps<T>) => {\r\n if (!product) return null\r\n switch (kind) {\r\n case EBtnAddToPackage.Button:\r\n return (\r\n <Stack direction='row' justifyContent='space-between' alignItems='center' position={'relative'}>\r\n <Button\r\n startIcon={<BookmarkAddOutlinedIcon fontSize='small' />}\r\n fullWidth\r\n type='submit'\r\n variant='contained'\r\n color='success'\r\n onClick={() => addToCart(product)}\r\n {...buttonProps}\r\n >\r\n Add to Package\r\n </Button>\r\n <Tooltip title='Read more about our services' placement='left'>\r\n <IconButton\r\n sx={{\r\n position: 'absolute',\r\n right: '-11px',\r\n bottom: '-11px',\r\n color: (theme) => alpha(theme.palette.primary.main, 0.8),\r\n backgroundColor: (theme) => theme.palette.background.paper,\r\n '&:hover': {\r\n backgroundColor: (theme) => theme.palette.background.paper\r\n }\r\n }}\r\n size='small'\r\n onClick={(e) => e.stopPropagation()}\r\n {...helpProps}\r\n >\r\n <HelpOutlinePulseIcon />\r\n </IconButton>\r\n </Tooltip>\r\n </Stack>\r\n )\r\n default:\r\n return (\r\n <Tooltip title='Add to Package' arrow placement={'top'} {...tooltipProps}>\r\n <IconButton variant='contained' color='inherit' size='small' onClick={() => addToCart(product)} {...buttonProps}>\r\n <BookmarkAddOutlinedIcon fontSize='small' sx={{ fontSize: 18 }} />\r\n </IconButton>\r\n </Tooltip>\r\n )\r\n }\r\n}\r\n"],"names":["EBtnAddToPackage","ButtonIconAddToPackage","_ref","product","buttonProps","tooltipProps","helpProps","_ref$kind","kind","Icon","addToCart","Button","_jsxs","Stack","direction","justifyContent","alignItems","position","_jsx","_objectSpread","startIcon","BookmarkAddOutlinedIcon","fontSize","fullWidth","type","variant","color","onClick","children","Tooltip","title","placement","IconButton","sx","right","bottom","theme","alpha","palette","primary","main","backgroundColor","background","paper","size","e","stopPropagation","HelpOutlinePulseIcon","arrow"],"mappings":"kVAKYA,GAAZ,SAAYA,GACVA,EAAA,KAAA,OACAA,EAAA,OAAA,QACD,CAHD,CAAYA,IAAAA,EAGX,CAAA,QAUYC,EAAyB,SAAHC,GAOD,IANhCC,EAAOD,EAAPC,QACAC,EAAWF,EAAXE,YACAC,EAAYH,EAAZG,aACAC,EAASJ,EAATI,UAASC,EAAAL,EACTM,KAAAA,OAAI,IAAAD,EAAGP,EAAiBS,KAAIF,EAC5BG,EAASR,EAATQ,UAEA,OAAKP,EACGK,IACDR,EAAiBW,OAElBC,EAACC,EAAK,CAACC,UAAU,MAAMC,eAAe,gBAAgBC,WAAW,SAASC,SAAU,qBAClFC,EAACP,EAAMQ,EAAAA,EAAA,CACLC,UAAWF,EAACG,EAAwB,CAAAC,SAAS,UAC7CC,aACAC,KAAK,SACLC,QAAQ,YACRC,MAAM,UACNC,QAAS,WAAF,OAAQjB,EAAUP,EAAQ,GAC7BC,GAAW,GAAA,CAAAwB,SAAA,oBAIjBV,EAACW,EAAQ,CAAAC,MAAM,+BAA+BC,UAAU,OACtDH,SAAAV,EAACc,EAAUb,EAAAA,EAAA,CACTc,GAAI,CACFhB,SAAU,WACViB,MAAO,QACPC,OAAQ,QACRT,MAAO,SAACU,GAAK,OAAKC,EAAMD,EAAME,QAAQC,QAAQC,KAAM,GAAI,EACxDC,gBAAiB,SAACL,GAAK,OAAKA,EAAME,QAAQI,WAAWC,KAAK,EAC1D,UAAW,CACTF,gBAAiB,SAACL,GAAK,OAAKA,EAAME,QAAQI,WAAWC,KAAK,IAG9DC,KAAK,QACLjB,QAAS,SAACkB,GAAC,OAAKA,EAAEC,iBAAiB,GAC/BxC,GAAS,GAAA,CAEbsB,SAAAV,EAAC6B,EAAoB,CAAA,WAO3B7B,EAACW,EAAOV,EAAAA,EAAA,CAACW,MAAM,iBAAiBkB,OAAK,EAACjB,UAAW,OAAW1B,GAAY,GAAA,CAAAuB,SACtEV,EAACc,EAAUb,EAAAA,EAAA,CAACM,QAAQ,YAAYC,MAAM,UAAUkB,KAAK,QAAQjB,QAAS,WAAF,OAAQjB,EAAUP,EAAQ,GAAMC,GAAW,GAAA,CAC7GwB,SAAAV,EAACG,EAAuB,CAACC,SAAS,QAAQW,GAAI,CAAEX,SAAU,YAzC/C,IA8CvB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{styled as a,Button as e}from"@mui/material";var r=a(e)(function(a){return{color:"#fff",padding:"6px 16px",borderRadius:"6px",fontWeight:"bold",border:"none",minWidth:"120px",minHeight:"36px",boxShadow:"0 2px 8px rgba(27, 25, 24, 0.2)",background:a.bg||"linear-gradient(45deg, #d32f2f 0%, #f9a925 70%, #d32f2f 100%)",backgroundSize:"200% auto",transition:"background 0.5s, background-position 0.5s ease, box-shadow 0.3s ease, color 0.25s ease","&, .MuiTypography-root":{fontSize:"0.9rem",lineHeight:1,fontWeight:500},"&:hover":{backgroundPosition:"100% 0",boxShadow:"0 4px 16px rgba(252, 228, 19, 0.23)"},"&.Mui-disabled":{background:"rgba(0, 0, 0, 0.12)",boxShadow:"none"},"&:not(:hover).animate-bounce":{animation:"gentleBounceY 3s cubic-bezier(0.4, 0.8, 0.4, 1) infinite"},"@keyframes gentleBounceY":{"0%":{transform:"translateY(0) scale(1)"},"5%":{transform:"translateY(0) scale(1)"},"20%":{transform:"translateY(-3px) scale(1.02)"},"30%":{transform:"translateY(-2px) scale(1.01)"},"40%":{transform:"translateY(-3px) scale(1.02)"},"50%":{transform:"translateY(-2px) scale(1.01)"},"75%":{transform:"translateY(0) scale(1)"},"100%":{transform:"translateY(0) scale(1)"}}}});export{r as AppButtonOrange};
|
|
2
|
+
//# sourceMappingURL=buttons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons.js","sources":["../../src/action-license/buttons.tsx"],"sourcesContent":["import { Button, ButtonProps, styled } from '@mui/material'\r\n\r\nexport const AppButtonOrange: React.ComponentType<ButtonProps & { bg?: string }> = styled(Button)<{ bg?: string }>(({ bg }) => ({\r\n color: '#fff',\r\n padding: '6px 16px',\r\n borderRadius: '6px',\r\n fontWeight: 'bold',\r\n border: 'none',\r\n minWidth: '120px',\r\n minHeight: '36px',\r\n boxShadow: '0 2px 8px rgba(27, 25, 24, 0.2)',\r\n background: bg || 'linear-gradient(45deg, #d32f2f 0%, #f9a925 70%, #d32f2f 100%)',\r\n backgroundSize: '200% auto',\r\n transition: 'background 0.5s, background-position 0.5s ease, box-shadow 0.3s ease, color 0.25s ease',\r\n '&, .MuiTypography-root': {\r\n fontSize: '0.9rem',\r\n lineHeight: 1,\r\n fontWeight: 500\r\n },\r\n '&:hover': {\r\n backgroundPosition: '100% 0',\r\n boxShadow: '0 4px 16px rgba(252, 228, 19, 0.23)'\r\n },\r\n '&.Mui-disabled': {\r\n background: 'rgba(0, 0, 0, 0.12)',\r\n boxShadow: 'none'\r\n },\r\n '&:not(:hover).animate-bounce': {\r\n animation: 'gentleBounceY 3s cubic-bezier(0.4, 0.8, 0.4, 1) infinite'\r\n },\r\n '@keyframes gentleBounceY': {\r\n '0%': { transform: 'translateY(0) scale(1)' },\r\n '5%': { transform: 'translateY(0) scale(1)' },\r\n '20%': { transform: 'translateY(-3px) scale(1.02)' },\r\n '30%': { transform: 'translateY(-2px) scale(1.01)' },\r\n '40%': { transform: 'translateY(-3px) scale(1.02)' },\r\n '50%': { transform: 'translateY(-2px) scale(1.01)' },\r\n '75%': { transform: 'translateY(0) scale(1)' },\r\n '100%': { transform: 'translateY(0) scale(1)' }\r\n }\r\n}))\r\n"],"names":["AppButtonOrange","styled","Button","_ref","color","padding","borderRadius","fontWeight","border","minWidth","minHeight","boxShadow","background","bg","backgroundSize","transition","fontSize","lineHeight","backgroundPosition","animation","transform"],"mappings":"mDAEO,IAAMA,EAAsEC,EAAOC,EAAPD,CAAgC,SAAAE,GAAK,MAAQ,CAC9HC,MAAO,OACPC,QAAS,WACTC,aAAc,MACdC,WAAY,OACZC,OAAQ,OACRC,SAAU,QACVC,UAAW,OACXC,UAAW,kCACXC,WATsHT,EAAFU,IASlG,gEAClBC,eAAgB,YAChBC,WAAY,yFACZ,yBAA0B,CACxBC,SAAU,SACVC,WAAY,EACZV,WAAY,KAEd,UAAW,CACTW,mBAAoB,SACpBP,UAAW,uCAEb,iBAAkB,CAChBC,WAAY,sBACZD,UAAW,QAEb,+BAAgC,CAC9BQ,UAAW,4DAEb,2BAA4B,CAC1B,KAAM,CAAEC,UAAW,0BACnB,KAAM,CAAEA,UAAW,0BACnB,MAAO,CAAEA,UAAW,gCACpB,MAAO,CAAEA,UAAW,gCACpB,MAAO,CAAEA,UAAW,gCACpB,MAAO,CAAEA,UAAW,gCACpB,MAAO,CAAEA,UAAW,0BACpB,OAAQ,CAAEA,UAAW,2BAExB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{AreaQuicklyAddToCart}from"./quickly-add-to-cart/index.js";export{ButtonIconAddToCart}from"./btn.icon.add-to-cart.js";export{ButtonIconAddToPackage,EBtnAddToPackage}from"./btn.icon.add-to-package.js";export{AreaAddToCart,ModalAddToCart}from"./modal.add-to-cart.js";export{ActionGroup}from"./action-group.js";export{AreaActionGroups}from"./area.group.js";export{quickToCartClasses}from"./quickly-add-to-cart/type.js";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectSpread2 as r}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as e,jsx as i}from"react/jsx-runtime";import{Dialog as o,DialogTitle as l,Box as t,Avatar as n,Typography as a,IconButton as d,DialogContent as s,Button as c}from"@mui/material";import m from"@mui/icons-material/VideoLibraryOutlined";import p from"@mui/icons-material/Close";import{AreaQuicklyAddToCart as u}from"./quickly-add-to-cart/index.js";var h=function(r){var c=r.open,u=r.onClose,h=r.name,f=r.pictureUrl,x=r.children;return e(o,{open:c,onClose:u,maxWidth:"xs",sx:{borderRadius:4},PaperProps:{sx:{borderRadius:4}},fullWidth:!0,disableScrollLock:!0,keepMounted:!1,scroll:"paper",children:[i(l,{children:e(t,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e(t,{sx:{display:"flex",alignItems:"center",gap:1},children:[f?i(n,{src:f,alt:h,sx:{width:60,height:60,borderRadius:2}}):i(m,{}),e(t,{children:[i(a,{variant:"h6",children:"Add to Cart"}),i(a,{variant:"body2",color:"text.secondary",children:h})]})]}),u&&i(d,{onClick:u,size:"small",children:i(p,{})})]})}),i(s,{dividers:!0,children:x})]})},f=function(e){var o=e.title,l=e.imageUrl,t=e.addToCartProps,n=e.onClose;return i(h,{open:!0,onClose:n,name:o,pictureUrl:l,children:t?i(u,r(r({},t),{},{onSuccess:n})):i(c,{fullWidth:!0,type:"submit",variant:"contained",color:"success",children:"Add to Cart"})})};export{h as AreaAddToCart,f as ModalAddToCart};
|
|
2
|
+
//# sourceMappingURL=modal.add-to-cart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.add-to-cart.js","sources":["../../src/action-license/modal.add-to-cart.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from 'react'\r\nimport { Avatar, Box, Button, Dialog, DialogContent, DialogTitle, IconButton, Typography } from '@mui/material'\r\nimport VideoLibraryOutlinedIcon from '@mui/icons-material/VideoLibraryOutlined'\r\nimport CloseIcon from '@mui/icons-material/Close'\r\nimport { AreaQuicklyAddToCart } from './quickly-add-to-cart'\r\nimport type { AreaQuicklyAddToCartProps } from './quickly-add-to-cart/index'\r\nimport { IPricePackage } from './types'\r\n\r\nexport interface IGroupSelectorModalProps extends PropsWithChildren {\r\n open: boolean\r\n onClose?: () => void\r\n name: string\r\n pictureUrl?: string\r\n}\r\n\r\nexport const AreaAddToCart: FC<IGroupSelectorModalProps> = ({ open, onClose, name, pictureUrl, children }) => {\r\n return (\r\n <Dialog\r\n open={open}\r\n onClose={onClose}\r\n maxWidth='xs'\r\n sx={{ borderRadius: 4 }}\r\n PaperProps={{\r\n sx: { borderRadius: 4 }\r\n }}\r\n fullWidth\r\n disableScrollLock={true}\r\n keepMounted={false}\r\n scroll='paper'\r\n >\r\n <DialogTitle>\r\n <Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>\r\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>\r\n {pictureUrl ? <Avatar src={pictureUrl} alt={name} sx={{ width: 60, height: 60, borderRadius: 2 }} /> : <VideoLibraryOutlinedIcon />}\r\n <Box>\r\n <Typography variant='h6'>Add to Cart</Typography>\r\n <Typography variant='body2' color='text.secondary'>\r\n {name}\r\n </Typography>\r\n </Box>\r\n </Box>\r\n {onClose && (\r\n <IconButton onClick={onClose} size='small'>\r\n <CloseIcon />\r\n </IconButton>\r\n )}\r\n </Box>\r\n </DialogTitle>\r\n <DialogContent dividers>\r\n {/* Content for adding to cart goes here */}\r\n {children}\r\n </DialogContent>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport interface ModalAddToCartProps<TProduct, TPrices extends IPricePackage> {\r\n title: string\r\n imageUrl?: string\r\n addToCartProps: AreaQuicklyAddToCartProps<TProduct, TPrices>\r\n onClose?: () => void\r\n}\r\n\r\nexport const ModalAddToCart = <TProduct, TPrices extends IPricePackage>({ title, imageUrl, addToCartProps, onClose }: ModalAddToCartProps<TProduct, TPrices>) => {\r\n return (\r\n <AreaAddToCart open={true} onClose={onClose} name={title} pictureUrl={imageUrl}>\r\n {addToCartProps ? (\r\n <AreaQuicklyAddToCart<TProduct, TPrices> {...addToCartProps} onSuccess={onClose} />\r\n ) : (\r\n <Button fullWidth type='submit' variant='contained' color='success'>\r\n Add to Cart\r\n </Button>\r\n )}\r\n </AreaAddToCart>\r\n )\r\n}\r\n"],"names":["AreaAddToCart","_ref","open","onClose","name","pictureUrl","children","_jsxs","Dialog","maxWidth","sx","borderRadius","PaperProps","fullWidth","disableScrollLock","keepMounted","scroll","_jsx","DialogTitle","Box","display","alignItems","justifyContent","gap","Avatar","src","alt","width","height","VideoLibraryOutlinedIcon","Typography","variant","color","IconButton","onClick","size","CloseIcon","DialogContent","dividers","ModalAddToCart","_ref2","title","imageUrl","addToCartProps","AreaQuicklyAddToCart","_objectSpread","onSuccess","Button","type"],"mappings":"kbAeaA,EAA8C,SAAjCC,GAAmF,IAA/CC,EAAID,EAAJC,KAAMC,EAAOF,EAAPE,QAASC,EAAIH,EAAJG,KAAMC,EAAUJ,EAAVI,WAAYC,EAAQL,EAARK,SAC7F,OACEC,EAACC,EACC,CAAAN,KAAMA,EACNC,QAASA,EACTM,SAAS,KACTC,GAAI,CAAEC,aAAc,GACpBC,WAAY,CACVF,GAAI,CAAEC,aAAc,IAEtBE,WAAS,EACTC,mBAAmB,EACnBC,aAAa,EACbC,OAAO,QAAOV,SAAA,CAEdW,EAACC,EAAW,CAAAZ,SACVC,EAACY,EAAI,CAAAT,GAAI,CAAEU,QAAS,OAAQC,WAAY,SAAUC,eAAgB,iBAAiBhB,SAAA,CACjFC,EAACY,EAAI,CAAAT,GAAI,CAAEU,QAAS,OAAQC,WAAY,SAAUE,IAAK,GAAGjB,SAAA,CACvDD,EAAaY,EAACO,EAAM,CAACC,IAAKpB,EAAYqB,IAAKtB,EAAMM,GAAI,CAAEiB,MAAO,GAAIC,OAAQ,GAAIjB,aAAc,KAAUM,EAACY,MACxGtB,EAACY,EAAG,CAAAb,SAAA,CACFW,EAACa,EAAU,CAACC,QAAQ,KAA6BzB,SAAA,gBACjDW,EAACa,GAAWC,QAAQ,QAAQC,MAAM,iBAC/B1B,SAAAF,UAIND,GACCc,EAACgB,GAAWC,QAAS/B,EAASgC,KAAK,QACjC7B,SAAAW,EAACmB,EAAY,CAAA,UAKrBnB,EAACoB,EAAa,CAACC,UAEZ,EAAAhC,SAAAA,MAIT,EASaiC,EAAiB,SAAHC,GAAqI,IAAtFC,EAAKD,EAALC,MAAOC,EAAQF,EAARE,SAAUC,EAAcH,EAAdG,eAAgBxC,EAAOqC,EAAPrC,QACzG,OACEc,EAACjB,EAAc,CAAAE,MAAM,EAAMC,QAASA,EAASC,KAAMqC,EAAOpC,WAAYqC,EACnEpC,SAAAqC,EACC1B,EAAC2B,EAAoBC,EAAAA,EAAA,CAAA,EAAwBF,GAAc,GAAA,CAAEG,UAAW3C,KAExEc,EAAC8B,EAAO,CAAAlC,WAAU,EAAAmC,KAAK,SAASjB,QAAQ,YAAYC,MAAM,UAEjD1B,SAAA,iBAIjB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{defineProperty as e,inherits as o,createClass as t,objectSpread2 as r,classCallCheck as i,callSuper as a}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as l,jsx as n}from"react/jsx-runtime";import{Component as c}from"react";import{styled as s,Box as d,alpha as p,Stack as u,Tooltip as m,IconButton as h,RadioGroup as f,FormControlLabel as v,Typography as x,Radio as g}from"@mui/material";import{CheckCircle as b}from"@mui/icons-material";import C from"@mui/icons-material/HelpOutline";import I from"@mui/icons-material/AddShoppingCart";import{quickToCartClasses as P}from"./type.js";import{AppButtonOrange as k}from"../buttons.js";var y=function(){function s(o){var t,r,c,d,p;i(this,s),p=a(this,s,[o]),e(p,"renderRadioGroup",function(){var e,o,t,r,i=null!==(e=null===(o=p.props.data)||void 0===o?void 0:o.Prices)&&void 0!==e?e:[],a=p.props.config;return n(f,{name:"PriceSelectedId",value:null!==(t=null===(r=p.state.Value)||void 0===r?void 0:r.toString())&&void 0!==t?t:null,onChange:p.handleChange,sx:{padding:"0",margin:"0",flexDirection:"row",gap:1},children:i.map(function(e,o){var t,r=p.state.Value===e.Id;return n(v,{value:e.Id,control:n(g,{sx:{display:"none"}}),className:P.itemWrap,sx:{border:"1px solid ".concat(e.Color+"70"),boxShadow:"0 2px 4px ".concat(e.Color+"20")},label:l(u,{className:P.item,px:.5,flexDirection:{sx:"column",md:"column"},children:[r&&n(b,{className:P.checkCircle}),n(x,{className:P.itemName,sx:{color:e.Color},children:e.Name}),n(x,{className:P.itemPrice,children:(null===(t=a.formatPrice)||void 0===t?void 0:t.call(a,e.Price))||"$".concat(e.Price)})]})},o)})})}),e(p,"handleChange",function(e,o){var t=null!=o?o:"";p.setState({Value:t})}),p.priceIdOld=p.props.currentPricePackageId;var m=null!==(t=null===(r=p.props.data)||void 0===r?void 0:r.Prices)&&void 0!==t?t:[],h=null===(c=m[Math.floor(m.length/2)])||void 0===c?void 0:c.Id;return p.state={Value:p.priceIdOld||h||(null===(d=m[0])||void 0===d?void 0:d.Id)},p}return o(s,c),t(s,[{key:"render",value:function(){var e=this.props.disabled||!!this.priceIdOld&&this.priceIdOld===this.state.Value,o=[P.root,"form-quickly-add-to-cart"].join(" "),t=this.props.config;return l(S,{className:o,children:[this.renderRadioGroup(),l(u,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:P.content,children:[n(k,{startIcon:t.buttonIcon||n(I,{fontSize:"small"}),fullWidth:!0,type:"submit",variant:"contained",color:"success",disabled:e,children:this.priceIdOld?t.updateButtonText||"Update Cart":t.addButtonText||"Add to Cart"}),n(m,{title:t.helpTooltip||"Read more about our services",placement:"left",children:n(h,r(r({className:P.helpIcon,size:"small"},t.helpProps||{}),{},{children:n(C,{})}))})]})]})}}])}(),N=function(e,o){return"".concat("",".").concat(P[e]).concat("")},S=s(d)(function(o){var t=o.theme;return e(e(e(e(e(e(e({},N("content"),{marginTop:"12px",position:"relative"}),N("helpIcon"),{position:"absolute",right:"-11px",bottom:"-11px",color:p(t.palette.primary.main,.8),backgroundColor:t.palette.background.paper,"&:hover":{backgroundColor:t.palette.background.paper}}),N("checkCircle"),{position:"absolute",top:-8,right:-8,fontSize:"18px",color:"#4caf50",zIndex:1,backgroundColor:"white",borderRadius:"50%"}),N("itemWrap"),{marginInline:0,padding:"5px",borderRadius:"10px",flexGrow:1,position:"relative","& .MuiFormControlLabel-label":{flexGrow:1}}),N("item"),{display:"flex",alignItems:"center",justifyContent:"space-between",flexGrow:1}),N("itemName"),{fontSize:"12px",fontWeight:700}),N("itemPrice"),{fontSize:"12px",color:"dark"===t.palette.mode?t.palette.text.secondary:"#606060"})});export{y as FormContentBase,S as QuickAddToCartStyled};
|
|
2
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../src/action-license/quickly-add-to-cart/content.tsx"],"sourcesContent":["import { Component, ComponentType } from 'react'\r\nimport { styled, alpha, Box, FormControlLabel, IconButton, Radio, RadioGroup, Stack, Tooltip, Typography } from '@mui/material'\r\nimport { CheckCircle } from '@mui/icons-material'\r\nimport HelpOutlineIcon from '@mui/icons-material/HelpOutline'\r\nimport AddShoppingCartIcon from '@mui/icons-material/AddShoppingCart'\r\nimport type { BoxProps } from '@mui/material'\r\nimport type { IFormBase } from 'dinocollab-core/form'\r\nimport { IPricePackage } from '../types'\r\nimport { quickToCartClasses } from './type'\r\nimport { AppButtonOrange } from '../buttons'\r\nimport type { IFormQuicklyAddToCartData, IQuicklyAddToCartConfig } from './type'\r\n\r\ninterface IState {\r\n Value?: string\r\n}\r\n\r\ninterface IFormContentProps<TProduct, TPrices extends IPricePackage> extends IFormBase<IFormQuicklyAddToCartData<TProduct, TPrices>> {\r\n currentPricePackageId?: string\r\n config: IQuicklyAddToCartConfig\r\n}\r\n\r\nexport class FormContentBase<TProduct, TPrices extends IPricePackage> extends Component<IFormContentProps<TProduct, TPrices>, IState> {\r\n priceIdOld?: string\r\n constructor(props: IFormContentProps<TProduct, TPrices>) {\r\n super(props)\r\n this.priceIdOld = this.props.currentPricePackageId\r\n const prices = this.props.data?.Prices ?? []\r\n const middleIndex = Math.floor(prices.length / 2)\r\n const middlePrice = prices[middleIndex]?.Id\r\n\r\n this.state = { Value: this.priceIdOld || middlePrice || prices[0]?.Id }\r\n }\r\n\r\n render() {\r\n const disabled = this.props.disabled || (!!this.priceIdOld && this.priceIdOld === this.state.Value)\r\n const classes = [quickToCartClasses.root, 'form-quickly-add-to-cart'].join(' ')\r\n const { config } = this.props\r\n\r\n return (\r\n <QuickAddToCartStyled className={classes}>\r\n {this.renderRadioGroup()}\r\n <Stack flexDirection='row' justifyContent='space-between' alignItems='center' className={quickToCartClasses.content}>\r\n <AppButtonOrange\r\n startIcon={config.buttonIcon || <AddShoppingCartIcon fontSize='small' />}\r\n fullWidth\r\n type='submit'\r\n variant='contained'\r\n color='success'\r\n disabled={disabled}\r\n >\r\n {this.priceIdOld ? config.updateButtonText || 'Update Cart' : config.addButtonText || 'Add to Cart'}\r\n </AppButtonOrange>\r\n <Tooltip title={config.helpTooltip || 'Read more about our services'} placement='left'>\r\n <IconButton className={quickToCartClasses.helpIcon} size='small' {...(config.helpProps || {})}>\r\n <HelpOutlineIcon />\r\n </IconButton>\r\n </Tooltip>\r\n </Stack>\r\n </QuickAddToCartStyled>\r\n )\r\n }\r\n\r\n renderRadioGroup = () => {\r\n const list = this.props.data?.Prices ?? []\r\n const { config } = this.props\r\n\r\n return (\r\n <RadioGroup\r\n name='PriceSelectedId'\r\n value={this.state.Value?.toString() ?? null}\r\n onChange={this.handleChange}\r\n sx={{ padding: '0', margin: '0', flexDirection: 'row', gap: 1 }}\r\n >\r\n {list.map((e, i) => {\r\n const isSelected = this.state.Value === e.Id\r\n return (\r\n <FormControlLabel\r\n key={i}\r\n value={e.Id}\r\n control={<Radio sx={{ display: 'none' }} />}\r\n className={quickToCartClasses.itemWrap}\r\n sx={{ border: `1px solid ${e.Color + '70'}`, boxShadow: `0 2px 4px ${e.Color + '20'}` }}\r\n label={\r\n <Stack className={quickToCartClasses.item} px={0.5} flexDirection={{ sx: 'column', md: 'column' }}>\r\n {isSelected && <CheckCircle className={quickToCartClasses.checkCircle} />}\r\n <Typography className={quickToCartClasses.itemName} sx={{ color: e.Color }}>\r\n {e.Name}\r\n </Typography>\r\n <Typography className={quickToCartClasses.itemPrice}>{config.formatPrice?.(e.Price) || `$${e.Price}`}</Typography>\r\n </Stack>\r\n }\r\n />\r\n )\r\n })}\r\n </RadioGroup>\r\n )\r\n }\r\n\r\n handleChange = (_: React.ChangeEvent<HTMLInputElement>, value: string) => {\r\n const id: string = value ?? ''\r\n this.setState({ Value: id })\r\n }\r\n}\r\n\r\nconst getClass = (key: keyof typeof quickToCartClasses, options?: { prefix?: string; suffix?: string }) => {\r\n return `${options?.prefix || ''}.${quickToCartClasses[key]}${options?.suffix || ''}`\r\n}\r\n\r\nexport const QuickAddToCartStyled: ComponentType<BoxProps & { [key: string]: any }> = styled(Box)(({ theme }) => ({\r\n // [getClass('root', { prefix: '&' })]: {\r\n // // paddingTop: '10px'\r\n // },\r\n [getClass('content')]: {\r\n marginTop: '12px',\r\n position: 'relative'\r\n },\r\n [getClass('helpIcon')]: {\r\n position: 'absolute',\r\n right: '-11px',\r\n bottom: '-11px',\r\n color: alpha(theme.palette.primary.main, 0.8),\r\n backgroundColor: theme.palette.background.paper,\r\n '&:hover': {\r\n backgroundColor: theme.palette.background.paper\r\n }\r\n },\r\n [getClass('checkCircle')]: {\r\n position: 'absolute',\r\n top: -8,\r\n right: -8,\r\n fontSize: '18px',\r\n color: '#4caf50',\r\n zIndex: 1,\r\n backgroundColor: 'white',\r\n borderRadius: '50%'\r\n },\r\n [getClass('itemWrap')]: {\r\n marginInline: 0,\r\n padding: '5px',\r\n borderRadius: '10px',\r\n flexGrow: 1,\r\n position: 'relative',\r\n '& .MuiFormControlLabel-label': { flexGrow: 1 }\r\n },\r\n [getClass('item')]: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n flexGrow: 1\r\n },\r\n [getClass('itemName')]: {\r\n fontSize: '12px',\r\n fontWeight: 700\r\n },\r\n [getClass('itemPrice')]: {\r\n fontSize: '12px',\r\n color: theme.palette.mode === 'dark' ? theme.palette.text.secondary : '#606060'\r\n }\r\n}))\r\n"],"names":["FormContentBase","props","_this$props$data$Pric2","_this$props$data2","_prices$middleIndex","_prices$","_this","_classCallCheck","_callSuper","_defineProperty","_this$props$data$Pric","_this$props$data","_this$state$Value$toS","_this$state$Value","list","data","Prices","config","_jsx","RadioGroup","name","value","state","Value","toString","onChange","handleChange","sx","padding","margin","flexDirection","gap","children","map","e","i","_config$formatPrice","isSelected","Id","FormControlLabel","control","Radio","display","className","quickToCartClasses","itemWrap","border","concat","Color","boxShadow","label","_jsxs","Stack","item","px","md","CheckCircle","checkCircle","Typography","itemName","color","Name","itemPrice","formatPrice","call","Price","_","id","setState","priceIdOld","currentPricePackageId","prices","middlePrice","Math","floor","length","_inherits","Component","_createClass","key","disabled","this","classes","root","join","QuickAddToCartStyled","renderRadioGroup","justifyContent","alignItems","content","AppButtonOrange","startIcon","buttonIcon","AddShoppingCartIcon","fontSize","fullWidth","type","variant","updateButtonText","addButtonText","Tooltip","title","helpTooltip","placement","IconButton","_objectSpread","helpIcon","size","helpProps","HelpOutlineIcon","getClass","options","styled","Box","_ref","theme","marginTop","position","right","bottom","alpha","palette","primary","main","backgroundColor","background","paper","top","zIndex","borderRadius","marginInline","flexGrow","fontWeight","mode","text","secondary"],"mappings":"6oBAqBaA,IAAAA,aAEX,SAAAA,EAAYC,GAA2C,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,OAAAP,GACrDM,EAAAE,EAAAR,KAAAA,GAAMC,IAAMQ,EAAAH,EAAA,mBAsCK,WAAK,IAAAI,EAAAC,EAAAC,EAAAC,EAChBC,UAAIJ,UAAAC,EAAGL,EAAKL,MAAMc,YAAI,IAAAJ,OAAA,EAAfA,EAAiBK,cAAM,IAAAN,EAAAA,EAAI,GAChCO,EAAWX,EAAKL,MAAhBgB,OAER,OACEC,EAACC,EACC,CAAAC,KAAK,kBACLC,cAAKT,EAAkB,QAAlBC,EAAEP,EAAKgB,MAAMC,aAAXV,IAAgBA,OAAhBA,EAAAA,EAAkBW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AIhC,OAAsB,GAClF,EAEasC,EAAyE2B,EAAOC,EAAPD,CAAY,SAAAE,GAAA,IAAGC,EAAKD,EAALC,MAAK,OAAA1G,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,EAAA,CAAA,EAIvGqG,EAAS,WAAa,CACrBM,UAAW,OACXC,SAAU,aAEXP,EAAS,YAAc,CACtBO,SAAU,WACVC,MAAO,QACPC,OAAQ,QACR3D,MAAO4D,EAAML,EAAMM,QAAQC,QAAQC,KAAM,IACzCC,gBAAiBT,EAAMM,QAAQI,WAAWC,MAC1C,UAAW,CACTF,gBAAiBT,EAAMM,QAAQI,WAAWC,SAG7ChB,EAAS,eAAiB,CACzBO,SAAU,WACVU,KAAO,EACPT,OAAS,EACTxB,SAAU,OACVlC,MAAO,UACPoE,OAAQ,EACRJ,gBAAiB,QACjBK,aAAc,QAEfnB,EAAS,YAAc,CACtBoB,aAAc,EACdtG,QAAS,MACTqG,aAAc,OACdE,SAAU,EACVd,SAAU,WACV,+BAAgC,CAAEc,SAAU,KAE7CrB,EAAS,QAAU,CAClBpE,QAAS,OACT8C,WAAY,SACZD,eAAgB,gBAChB4C,SAAU,IAEXrB,EAAS,YAAc,CACtBhB,SAAU,OACVsC,WAAY,MAEbtB,EAAS,aAAe,CACvBhB,SAAU,OACVlC,MAA8B,SAAvBuD,EAAMM,QAAQY,KAAkBlB,EAAMM,QAAQa,KAAKC,UAAY,WACvE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{asyncToGenerator as r,regenerator as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n}from"react/jsx-runtime";import{FormValidator as t,SingleRuleValidate as o,DinoForm as c}from"dinocollab-core/form";import{FormContentBase as i}from"./content.js";var a=function(a){var u=new t({PriceSelectedId:{Rules:[{rule:o.Required}]}}),s=c.createFormBase({validate:u});function l(){return(l=r(e().m(function r(n){var t,o,c,i;return e().w(function(r){for(;;)switch(r.n){case 0:if(c=null!==(t=null===(o=n.PriceSelectedId)||void 0===o?void 0:o.toString())&&void 0!==t?t:"",!(i=a.prices.find(function(r){return r.Id===c}))){r.n=2;break}return r.n=1,a.onSubmit(a.product,i);case 1:r.n=3;break;case 2:console.error("Price not found for the selected ID:",c);case 3:return r.a(2)}},r)}))).apply(this,arguments)}return n(s.Form,{onSubmit:function(r){return function(r){return l.apply(this,arguments)}(r)},children:s.mapContext(function(r){return n(i,{currentPricePackageId:a.currentPricePackageId,onBlur:r.onBlur,messageErrors:r.messageErrors,data:{Data:a.product,Prices:a.prices},config:a.config},a.currentPricePackageId+JSON.stringify(a.prices))})})};export{a as QuicklyAddToCartForm};
|
|
2
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.js","sources":["../../../src/action-license/quickly-add-to-cart/form.tsx"],"sourcesContent":["import { DinoForm, FormValidator, SingleRuleValidate } from 'dinocollab-core/form'\r\nimport { FormContentBase } from './content'\r\nimport type { IFormQuicklyAddToCartData, IQuicklyAddToCartConfig } from './type'\r\nimport type { IPricePackage } from '../types'\r\n\r\ninterface IQuicklyAddToCartFormProps<TProduct, TPrices extends IPricePackage> {\r\n prices: TPrices[]\r\n product: TProduct\r\n currentPricePackageId?: string\r\n config: IQuicklyAddToCartConfig\r\n onSubmit: (product: TProduct, price: TPrices) => void | Promise<void>\r\n}\r\n\r\nexport const QuicklyAddToCartForm = <TProduct, TPrices extends IPricePackage>(props: IQuicklyAddToCartFormProps<TProduct, TPrices>) => {\r\n const formValitate = new FormValidator<Partial<IFormQuicklyAddToCartData<TProduct, TPrices>>>({\r\n PriceSelectedId: { Rules: [{ rule: SingleRuleValidate.Required }] }\r\n })\r\n\r\n const FromBaseInstance = DinoForm.createFormBase<IFormQuicklyAddToCartData<TProduct, TPrices>>({ validate: formValitate })\r\n\r\n async function mapSubmit(value: Partial<IFormQuicklyAddToCartData<TProduct, TPrices>>): Promise<void> {\r\n const priceId = value.PriceSelectedId?.toString() ?? ''\r\n const price = props.prices.find((x) => x.Id === priceId)\r\n if (price) {\r\n await props.onSubmit(props.product, price)\r\n } else {\r\n console.error('Price not found for the selected ID:', priceId)\r\n }\r\n }\r\n\r\n return (\r\n <FromBaseInstance.Form onSubmit={(value) => mapSubmit(value)}>\r\n {FromBaseInstance.mapContext((context) => (\r\n <FormContentBase<TProduct, TPrices>\r\n key={props.currentPricePackageId + JSON.stringify(props.prices)}\r\n currentPricePackageId={props.currentPricePackageId}\r\n onBlur={context.onBlur as (keyName: string | number | symbol) => void}\r\n messageErrors={context.messageErrors}\r\n data={{ Data: props.product, Prices: props.prices }}\r\n config={props.config}\r\n />\r\n ))}\r\n </FromBaseInstance.Form>\r\n )\r\n}"],"names":["QuicklyAddToCartForm","props","formValitate","FormValidator","PriceSelectedId","Rules","rule","SingleRuleValidate","Required","FromBaseInstance","DinoForm","createFormBase","validate","_mapSubmit","_asyncToGenerator","_regenerator","m","_callee","value","_value$PriceSelectedI","_value$PriceSelectedI2","priceId","price","w","_context","n","toString","prices","find","x","Id","onSubmit","product","console","error","a","apply","this","arguments","_jsx","Form","_x","mapSubmit","children","mapContext","context","FormContentBase","currentPricePackageId","onBlur","messageErrors","data","Data","Prices","config","JSON","stringify"],"mappings":"sRAaaA,EAAuB,SAA0CC,GAC5E,IAAMC,EAAe,IAAIC,EAAqE,CAC5FC,gBAAiB,CAAEC,MAAO,CAAC,CAAEC,KAAMC,EAAmBC,cAGlDC,EAAmBC,EAASC,eAA6D,CAAEC,SAAUV,IAEnF,SAAAW,IAQvB,OARuBA,EAAAC,EAAAC,IAAAC,EAAxB,SAAAC,EAAyBC,GAA4D,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAP,IAAAQ,EAAA,SAAAC,GAAA,cAAAA,EAAAC,GAAA,KAAA,EAE3B,GADlDJ,UAAOF,EAAwBC,QAAxBA,EAAGF,EAAMd,2BAAegB,SAArBA,EAAuBM,kBAAU,IAAAP,EAAAA,EAAI,KAC/CG,EAAQrB,EAAM0B,OAAOC,KAAK,SAACC,GAAC,OAAKA,EAAEC,KAAOT,KACvC,CAAAG,EAAAC,EAAA,EAAA,KAAA,CAAA,OAAAD,EAAAC,EAAA,EACDxB,EAAM8B,SAAS9B,EAAM+B,QAASV,GAAM,KAAA,EAAAE,EAAAC,EAAA,EAAA,MAAA,KAAA,EAE1CQ,QAAQC,MAAM,uCAAwCb,GAAQ,KAAA,EAAA,OAAAG,EAAAW,EAAA,GAAA,EAAAlB,OAEjEmB,MAAAC,KAAAC,UAAA,CAED,OACEC,EAAC9B,EAAiB+B,KAAI,CAACT,SAAU,SAACb,GAAK,OAbiF,SAElGuB,GAAA,OAAA5B,EAAAuB,MAAAC,KAAAC,UAAA,CAWsBI,CAAUxB,EAAM,EAAAyB,SACzDlC,EAAiBmC,WAAW,SAACC,GAAO,OACnCN,EAACO,EAEC,CAAAC,sBAAuB9C,EAAM8C,sBAC7BC,OAAQH,EAAQG,OAChBC,cAAeJ,EAAQI,cACvBC,KAAM,CAAEC,KAAMlD,EAAM+B,QAASoB,OAAQnD,EAAM0B,QAC3C0B,OAAQpD,EAAMoD,QALTpD,EAAM8C,sBAAwBO,KAAKC,UAAUtD,EAAM0B,QAO3D,IAGP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectSpread2 as r,asyncToGenerator as t,regenerator as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as o}from"react/jsx-runtime";import{QuicklyAddToCartForm as n}from"./form.js";var a=function(a){var c=r(r({},{addButtonText:"Add to Cart",updateButtonText:"Update Cart",helpTooltip:"Read more about our services"}),a.config);function u(){return(u=t(e().m(function r(t,o){var n;return e().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,a.onAddToCart(t,o);case 1:null===(n=a.onSuccess)||void 0===n||n.call(a);case 2:return r.a(2)}},r)}))).apply(this,arguments)}return o(n,{prices:a.prices,product:a.product,currentPricePackageId:a.currentPricePackageId,config:c,onSubmit:function(r,t){return u.apply(this,arguments)}})};export{a as AreaQuicklyAddToCart};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/action-license/quickly-add-to-cart/index.tsx"],"sourcesContent":["import { QuicklyAddToCartForm } from './form'\r\nimport type{ IPricePackage } from '../types'\r\nimport type { IQuicklyAddToCartConfig } from './type'\r\n\r\nexport interface AreaQuicklyAddToCartProps<TProduct, TPrices extends IPricePackage> {\r\n prices: TPrices[]\r\n product: TProduct\r\n currentPricePackageId?: string\r\n onAddToCart: (product: TProduct, price: IPricePackage) => void | Promise<void>\r\n onSuccess?: () => void\r\n config?: IQuicklyAddToCartConfig\r\n}\r\n\r\nexport const AreaQuicklyAddToCart = <TProduct, TPrices extends IPricePackage>(props: AreaQuicklyAddToCartProps<TProduct, TPrices>) => {\r\n const defaultConfig: IQuicklyAddToCartConfig = {\r\n addButtonText: 'Add to Cart',\r\n updateButtonText: 'Update Cart',\r\n helpTooltip: 'Read more about our services'\r\n }\r\n\r\n const config = { ...defaultConfig, ...props.config }\r\n\r\n async function handleSubmit(product: TProduct, price: TPrices): Promise<void> {\r\n await props.onAddToCart(product, price)\r\n props.onSuccess?.()\r\n }\r\n\r\n return (\r\n <QuicklyAddToCartForm<TProduct, TPrices>\r\n prices={props.prices}\r\n product={props.product}\r\n currentPricePackageId={props.currentPricePackageId}\r\n config={config}\r\n onSubmit={handleSubmit}\r\n />\r\n )\r\n}\r\n\r\n// Re-export types for convenience\r\nexport type { IQuicklyAddToCartConfig } from './type'\r\nexport { quickToCartClasses } from './type'"],"names":["AreaQuicklyAddToCart","props","config","_objectSpread","defaultConfig","addButtonText","updateButtonText","helpTooltip","_handleSubmit","_asyncToGenerator","_regenerator","m","_callee","product","price","_props$onSuccess","w","_context","n","onAddToCart","onSuccess","call","a","apply","this","arguments","_jsx","QuicklyAddToCartForm","prices","currentPricePackageId","onSubmit","_x","_x2"],"mappings":"gNAaaA,EAAuB,SAA0CC,GAC5E,IAMMC,EAAMC,EAAAA,EAAQC,CAAAA,EAN2B,CAC7CC,cAAe,cACfC,iBAAkB,cAClBC,YAAa,iCAGuBN,EAAMC,QAEjB,SAAAM,IAG1B,OAH0BA,EAAAC,EAAAC,IAAAC,EAA3B,SAAAC,EAA4BC,EAAmBC,GAAc,IAAAC,EAAA,OAAAL,IAAAM,EAAA,SAAAC,GAAA,cAAAA,EAAAC,GAAA,KAAA,EAAA,OAAAD,EAAAC,EAAA,EACrDjB,EAAMkB,YAAYN,EAASC,GAAM,KAAA,EACxB,QAAfC,EAAAd,EAAMmB,iBAAS,IAAAL,GAAfA,EAAAM,KAAApB,GAAmB,KAAA,EAAA,OAAAgB,EAAAK,EAAA,GAAA,EAAAV,OACpBW,MAAAC,KAAAC,UAAA,CAED,OACEC,EAACC,EAAoB,CACnBC,OAAQ3B,EAAM2B,OACdf,QAASZ,EAAMY,QACfgB,sBAAuB5B,EAAM4B,sBAC7B3B,OAAQA,EACR4B,SAbgD,SAEzBC,EAAAC,GAAA,OAAAxB,EAAAe,MAAAC,KAAAC,UAAA,GAc7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sources":["../../../src/action-license/quickly-add-to-cart/type.tsx"],"sourcesContent":["import { ReactNode } from 'react'\r\nimport type { IPricePackage } from '../types'\r\nimport { IconButtonProps } from '@mui/material'\r\n\r\nexport interface IFormQuicklyAddToCartData<TProduct, TPrices extends IPricePackage> {\r\n PriceSelectedId?: string\r\n Prices?: TPrices[]\r\n Data?: TProduct\r\n}\r\n\r\nexport interface IQuicklyAddToCartConfig {\r\n // Button configuration\r\n addButtonText?: string\r\n updateButtonText?: string\r\n buttonIcon?: ReactNode\r\n // Help button configuration\r\n helpTooltip?: string\r\n helpProps?: Partial<IconButtonProps> & Record<string, any>\r\n // Price formatting\r\n formatPrice?: (price: number) => string\r\n}\r\n\r\nexport const quickToCartClasses = {\r\n root: 'qatc-root',\r\n content: 'qatc-content',\r\n helpIcon: 'qatc-help-icon',\r\n checkCircle: 'qatc-check-circle',\r\n itemWrap: 'qatc-item-wrap',\r\n item: 'qatc-item',\r\n itemName: 'qatc-item-name',\r\n itemPrice: 'qatc-item-price'\r\n}\r\n"],"names":["quickToCartClasses","root","content","helpIcon","checkCircle","itemWrap","item","itemName","itemPrice"],"mappings":"AAsBO,IAAMA,EAAqB,CAChCC,KAAM,YACNC,QAAS,eACTC,SAAU,iBACVC,YAAa,oBACbC,SAAU,iBACVC,KAAM,YACNC,SAAU,iBACVC,UAAW"}
|
package/dist/cart/styled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../src/cart/styled.tsx"],"sourcesContent":["import { alpha, Box, Menu, styled } from '@mui/material'\r\nimport type { ComponentType } from 'react'\r\nimport type { BoxProps, MenuProps } from '@mui/material'\r\
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../src/cart/styled.tsx"],"sourcesContent":["import { alpha, Box, Menu, styled } from '@mui/material'\r\nimport type { ComponentType } from 'react'\r\nimport type { BoxProps, MenuProps } from '@mui/material'\r\n\r\nexport const MenuStyled: ComponentType<MenuProps> = styled(Menu)(({ theme }) => ({\r\n '--color-bg': theme.palette.mode === 'dark' ? '#323234' : theme.palette.background.paper,\r\n '--color-text': theme.palette.text.primary,\r\n\r\n marginTop: '45px',\r\n '.MuiPaper-root': {\r\n position: 'relative',\r\n overflow: 'visible',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n backgroundColor: 'var(--color-bg, #000000)',\r\n borderRadius: theme.shape.borderRadius,\r\n minWidth: '280px',\r\n maxWidth: '550px',\r\n boxShadow: `0 1px 1px rgba(0, 0, 0, 0.05), 0 2px 2px rgba(0, 0, 0, 0.2), 0 4px 4px rgba(0, 0, 0, 0.15), 0 8px 8px rgba(0, 0, 0, 0.05)`,\r\n animation: 'fadeInDown 0.3s ease-out',\r\n marginTop: '8px',\r\n color: 'var(--color-text, #000000)',\r\n\r\n '@keyframes fadeInDown': {\r\n '0%': { opacity: 0, transform: 'translateY(-10px)' },\r\n '100%': { opacity: 1, transform: 'translateY(0)' }\r\n },\r\n\r\n '&::before': {\r\n content: '\"\"',\r\n position: 'absolute',\r\n backgroundColor: 'var(--color-bg, #ffffff)',\r\n width: '10px',\r\n height: '10px',\r\n top: '-4px',\r\n right: theme.spacing(1),\r\n transform: 'translateX(-50%) rotate(45deg)',\r\n zIndex: 0\r\n }\r\n },\r\n '.MuiBackdrop-root': { backgroundColor: 'transparent' },\r\n '.MuiList-root': {\r\n padding: 0,\r\n height: '100%',\r\n overflowY: 'auto',\r\n '&::-webkit-scrollbar': { width: '8px', height: '8px', background: 'transparent' },\r\n '&::-webkit-scrollbar-thumb': { background: '#e0e0e0', borderRadius: '8px' },\r\n '&::-webkit-scrollbar-thumb:hover': { background: '#bdbdbd' },\r\n '&': { scrollbarWidth: 'thin', scrollbarColor: '#e0e0e0 transparent' }\r\n }\r\n}))\r\n\r\nexport const cartContentClasses = {\r\n root: 'CartContent-root',\r\n header: 'CartContent-header',\r\n footer: 'CartContent-footer',\r\n items: 'CartContent-items',\r\n item: 'CartContent-item',\r\n itemContent: 'CartContent-itemContent',\r\n itemImg: 'CartContent-itemImg',\r\n itemTitle: 'CartContent-itemTitle',\r\n itemPrice: 'CartContent-itemPrice',\r\n itemTag: 'CartContent-itemTag'\r\n}\r\n\r\nconst getCartContentClasses = (key: keyof typeof cartContentClasses, options?: { prefix?: string; suffix?: string }) => {\r\n return `${options?.prefix || ''}.${cartContentClasses[key]}${options?.suffix || ''}`\r\n}\r\n\r\nexport const CartContentStyled: ComponentType<BoxProps> = styled(Box)(({ theme }) => ({\r\n '--height-item': '80px',\r\n [getCartContentClasses('root', { prefix: '&' })]: {\r\n height: '100%',\r\n flex: '1',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n minHeight: 0\r\n },\r\n [getCartContentClasses('header')]: {\r\n padding: '12px 16px',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n gap: theme.spacing(5),\r\n position: 'sticky',\r\n top: 0,\r\n background: 'var(--color-bg, #323234)',\r\n zIndex: 2,\r\n boxShadow: '0px 0.5px 5px 0px rgba(0, 0, 0, 0.15)'\r\n },\r\n [getCartContentClasses('footer')]: {\r\n padding: '6px 12px',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n position: 'sticky',\r\n bottom: 0,\r\n background: 'var(--color-bg, #323234)',\r\n zIndex: 1,\r\n boxShadow: '0px 0.5px 5px 0px rgba(0, 0, 0, 0.15)'\r\n },\r\n [getCartContentClasses('items')]: {\r\n overflowY: 'auto',\r\n minHeight: 0,\r\n '&::-webkit-scrollbar': { width: '8px', height: '8px', background: 'transparent' },\r\n '&::-webkit-scrollbar-thumb': { background: '#e0e0e0', borderRadius: '8px' },\r\n '&::-webkit-scrollbar-thumb:hover': { background: '#bdbdbd' },\r\n '&': { scrollbarWidth: 'thin', scrollbarColor: '#e0e0e0 transparent' }\r\n },\r\n [getCartContentClasses('item')]: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n padding: '8px 12px',\r\n transition: '0.3s',\r\n height: 'var(--height-item)',\r\n '& a': { textDecoration: 'none' },\r\n '&:hover': { background: theme.palette.action.hover },\r\n '&:hover a': { textDecoration: 'underline' }\r\n },\r\n [getCartContentClasses('itemImg')]: {\r\n width: '60px',\r\n height: '60px',\r\n borderRadius: '6px',\r\n objectFit: 'cover',\r\n marginRight: '12px',\r\n flex: '0 0 auto',\r\n backgroundColor: alpha(theme.palette.grey[400], 0.2)\r\n },\r\n [getCartContentClasses('itemContent')]: {\r\n flex: 1,\r\n display: 'flex',\r\n alignItems: 'center',\r\n minWidth: 0,\r\n position: 'relative',\r\n marginRight: theme.spacing(1.5)\r\n },\r\n [getCartContentClasses('itemTitle')]: {\r\n color: 'var(--color-text, #fff)',\r\n fontWeight: 600,\r\n flex: 1,\r\n width: '100%',\r\n marginRight: theme.spacing(1),\r\n padding: theme.spacing(2, 0),\r\n minWidth: 0,\r\n maxWidth: '300px'\r\n },\r\n [getCartContentClasses('itemTitle', { prefix: 'a' })]: {\r\n textDecoration: 'none',\r\n '&:hover': { textDecoration: 'underline' }\r\n },\r\n [getCartContentClasses('itemTag')]: {\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n fontWeight: 600\r\n }\r\n}))\r\n"],"names":["MenuStyled","styled","Menu","_ref","theme","palette","mode","background","paper","text","primary","marginTop","position","overflow","display","flexDirection","backgroundColor","borderRadius","shape","minWidth","maxWidth","boxShadow","animation","color","opacity","transform","content","width","height","top","right","spacing","zIndex","padding","overflowY","scrollbarWidth","scrollbarColor","cartContentClasses","root","header","footer","items","item","itemContent","itemImg","itemTitle","itemPrice","itemTag","getCartContentClasses","key","options","concat","prefix","suffix","CartContentStyled","Box","_ref2","_defineProperty","flex","minHeight","justifyContent","alignItems","gap","bottom","transition","textDecoration","action","hover","objectFit","marginRight","alpha","grey","fontWeight","left"],"mappings":"+IAIO,IAAMA,EAAuCC,EAAOC,EAAPD,CAAa,SAAAE,GAAA,IAAGC,EAAKD,EAALC,MAAK,MAAQ,CAC/E,aAAqC,SAAvBA,EAAMC,QAAQC,KAAkB,UAAYF,EAAMC,QAAQE,WAAWC,MACnF,eAAgBJ,EAAMC,QAAQI,KAAKC,QAEnCC,UAAW,OACX,iBAAkB,CAChBC,SAAU,WACVC,SAAU,UACVC,QAAS,OACTC,cAAe,SACfC,gBAAiB,2BACjBC,aAAcb,EAAMc,MAAMD,aAC1BE,SAAU,QACVC,SAAU,QACVC,UAAsI,4HACtIC,UAAW,2BACXX,UAAW,MACXY,MAAO,6BAEP,wBAAyB,CACvB,KAAM,CAAEC,QAAS,EAAGC,UAAW,qBAC/B,OAAQ,CAAED,QAAS,EAAGC,UAAW,kBAGnC,YAAa,CACXC,QAAS,KACTd,SAAU,WACVI,gBAAiB,2BACjBW,MAAO,OACPC,OAAQ,OACRC,IAAK,OACLC,MAAO1B,EAAM2B,QAAQ,GACrBN,UAAW,iCACXO,OAAQ,IAGZ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C,OAAQ,MAAOrB,WAAY,eACnE,6BAA8B,CAAEA,WAAY,UAAWU,aAAc,OACrE,mCAAoC,CAAEV,WAAY,WAClD,IAAK,CAAE4B,eAAgB,OAAQC,eAAgB,yBAEhDY,EAAsB,QAAU,CAC/BlC,QAAS,OACT+C,WAAY,SACZ5B,QAAS,WACT+B,WAAY,OACZpC,OAAQ,qBACR,MAAO,CAAEqC,eAAgB,QACzB,UAAW,CAAE1D,WAAYH,EAAMC,QAAQ6D,OAAOC,OAC9C,YAAa,CAAEF,eAAgB,eAEhCjB,EAAsB,WAAa,CAClCrB,MAAO,OACPC,OAAQ,OACRX,aAAc,MACdmD,UAAW,QACXC,YAAa,OACbX,KAAM,WACN1C,gBAAiBsD,EAAMlE,EAAMC,QAAQkE,KAAK,KAAM,MAEjDvB,EAAsB,eAAiB,CACtCU,KAAM,EACN5C,QAAS,OACT+C,WAAY,SACZ1C,SAAU,EACVP,SAAU,WACVyD,YAAajE,EAAM2B,QAAQ,OAE5BiB,EAAsB,aAAe,CACpCzB,MAAO,0BACPiD,WAAY,IACZd,KAAM,EACN/B,MAAO,OACP0C,YAAajE,EAAM2B,QAAQ,GAC3BE,QAAS7B,EAAM2B,QAAQ,EAAG,GAC1BZ,SAAU,EACVC,SAAU,UAEX4B,EAAsB,YAAa,CAAEI,OAAQ,MAAS,CACrDa,eAAgB,OAChB,UAAW,CAAEA,eAAgB,eAE9BjB,EAAsB,WAAa,CAClCpC,SAAU,WACViB,IAAK,EACL4C,KAAM,EACND,WAAY,KACb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as r,
|
|
1
|
+
import{slicedToArray as r,toConsumableArray as t,objectSpread2 as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{jsxs as o,jsx as n}from"react/jsx-runtime";import{createRoot as i}from"react-dom/client";import{useMemo as u,useState as c,useEffect as l}from"react";import{Dialog as d,Box as a,DialogContent as m,Typography as s,DialogActions as f,Button as p}from"@mui/material";import{CollectionsList as h}from"./units.js";import{GuideSteps as v}from"../guide-steps/index.js";import{ModalHeader as g}from"./modal-header.js";import{canAddGroup as C,generateGroupId as b}from"../helpers.js";import{NewCollectionButton as I,NewCollectionInput as x}from"../unit.control.js";var P=function(i){var b=i.open,P=i.onClose,y=i.onConfirm,S=i.groups,j=i.guideStepsProps,k=i.cartItem,G=u(function(){return null!=k&&k.ProductId?S.filter(function(r){var t;return null===(t=r.items)||void 0===t?void 0:t.some(function(r){return r.ProductId===k.ProductId})}).map(function(r){return r.id}).sort():[]},[S,k]),W=G.length>0?G:S.length>0?[S[0].id]:[],A=c(W),E=r(A,2),B=E[0],M=E[1],_=c(!1),D=r(_,2),H=D[0],K=D[1],L=c(""),O=r(L,2),R=O[0],T=O[1];l(function(){if(b){var r=G.length>0?G:S.length>0?[S[0].id]:[];M(r),K(!1),T("")}},[b,G,S.length]);var Y=u(function(){if(H&&R.trim())return!0;var r=t(B).sort();return G.length!==r.length||G.some(function(t,e){return t!==r[e]})},[H,R,B,G]),q=function(){M([]),K(!1),T(""),P()};return o(d,{open:b,onClose:q,maxWidth:"xs",fullWidth:!0,disableScrollLock:!0,keepMounted:!1,scroll:"paper",children:[n(g,{cartItem:k,onClose:q}),o(a,{component:"form",onSubmit:function(r){if(r.preventDefault(),Y)if(H&&R.trim())y([],[],R.trim());else{var t=B.filter(function(r){return!G.includes(r)}),e=G.filter(function(r){return!B.includes(r)});y(t,e)}else q()},children:[o(m,{children:[n(s,{variant:"subtitle1",sx:{mb:1,fontWeight:600},children:"Your Media Rights Package"}),C(S)&&(H?n(x,{value:R,onChange:T}):n(I,{onClick:function(){K(!0)}})),n(h,{groups:S,selectedGroupIds:B,onGroupSelect:function(r){M(function(e){return e.includes(r)?e.filter(function(t){return t!==r}):[].concat(t(e),[r])}),K(!1)}})]}),o(f,{sx:{px:3,pb:3},children:[j&&n(v,e({iconButtonProps:{color:"primary",sx:{mr:"auto"}}},j)),n(p,{onClick:q,variant:"text",type:"button",color:"inherit",children:"Cancel"}),n(p,{type:"submit",variant:Y?"contained":"outlined",disabled:!!H&&!R.trim(),color:"primary",sx:{minWidth:100},children:H?"Create & Add":G.length>0?Y?"Save Changes":"OK":"Save"})]})]})]})},y=function(r){var t=r.cartItem,o=r.groups,u=r.guideStepsProps,c=r.addGroup,l=r.addItem,d=r.removeItem,a=document.createElement("div");document.body.appendChild(a);var m=i(a);m.render(n(P,{open:!0,onClose:function(){m.unmount(),document.body.removeChild(a)},onConfirm:function(r,o,n){if(t){if(n){var i=b();c({id:i,name:n});var u=e(e({},t),{},{GroupId:i});l(u)}else o.forEach(function(r){t.ProductId&&d(r,t.ProductId)}),r.forEach(function(r){var o=e(e({},t),{},{GroupId:r});l(o)});m.unmount(),document.body.removeChild(a)}},guideStepsProps:u,groups:o,cartItem:t}))};export{P as GroupSelectorModal,y as showGroupSelectorModal};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/media-right/group-selector/index.tsx"],"sourcesContent":["import { useState, useEffect, useMemo } from 'react'\r\nimport type { FC, FormEvent } from 'react'\r\nimport { createRoot } from 'react-dom/client'\r\nimport { Dialog, DialogContent, DialogActions, Button, Typography, Box } from '@mui/material'\r\nimport type { IMediaRightGroup, IMediaRightItem } from '../types'\r\nimport { CollectionsList } from './units'\r\nimport { ModalHeader } from './modal-header'\r\nimport { canAddGroup, generateGroupId } from '../helpers'\r\nimport { NewCollectionButton, NewCollectionInput } from '../unit.control'\r\nimport { GuideSteps } from '../guide-steps'\r\nimport type { IGuideStepsProps } from '../guide-steps'\r\n\r\nexport interface IGroupSelectorModalProps {\r\n open: boolean\r\n guideStepsProps?: IGuideStepsProps\r\n onClose: () => void\r\n onConfirm: (groupIdsToAdd: string[], groupIdsToRemove: string[], newGroupName?: string) => void\r\n groups: IMediaRightGroup[]\r\n cartItem: IMediaRightItem | null\r\n}\r\n\r\nexport const GroupSelectorModal: FC<IGroupSelectorModalProps> = ({ open, onClose, onConfirm, groups, guideStepsProps, cartItem }) => {\r\n // Find all groups that contain this item\r\n const currentGroupIds = useMemo(() => {\r\n if (!cartItem?.ProductId) return []\r\n const l = groups.filter((g) => g.items?.some((item) => item.ProductId === cartItem.ProductId))\r\n return l.map((g) => g.id).sort()\r\n }, [groups, cartItem])\r\n\r\n // Auto-select: all current groups if exists, otherwise first group if available\r\n const initialGroupIds = currentGroupIds.length > 0 ? currentGroupIds : groups.length > 0 ? [groups[0].id] : []\r\n\r\n const [selectedGroupIds, setSelectedGroupIds] = useState<string[]>(initialGroupIds)\r\n const [showNewGroupInput, setShowNewGroupInput] = useState(false)\r\n const [newName, setNewName] = useState<string>('')\r\n\r\n // Update selection when modal opens or groups/cartItem changes\r\n useEffect(() => {\r\n if (open) {\r\n const newInitialGroupIds = currentGroupIds.length > 0 ? currentGroupIds : groups.length > 0 ? [groups[0].id] : []\r\n setSelectedGroupIds(newInitialGroupIds)\r\n setShowNewGroupInput(false)\r\n setNewName('')\r\n }\r\n }, [open, currentGroupIds, groups.length])\r\n\r\n // Check if there's any change\r\n const hasChanges = () => {\r\n if (showNewGroupInput && newName.trim()) return true\r\n\r\n // Sort and compare arrays (currentGroupIds is already sorted)\r\n const sortedSelected = [...selectedGroupIds].sort()\r\n\r\n // Check if arrays are different\r\n if (currentGroupIds.length !== sortedSelected.length) return true\r\n\r\n return currentGroupIds.some((id, index) => id !== sortedSelected[index])\r\n }\r\n\r\n const handleSubmit = (e: FormEvent) => {\r\n e.preventDefault()\r\n\r\n // Only proceed if there are changes\r\n if (!hasChanges()) {\r\n handleClose()\r\n return\r\n }\r\n\r\n if (showNewGroupInput && newName.trim()) {\r\n // Create new group and add item to it\r\n onConfirm([], [], newName.trim())\r\n } else {\r\n // Calculate changes\r\n const groupIdsToAdd = selectedGroupIds.filter((id) => !currentGroupIds.includes(id))\r\n const groupIdsToRemove = currentGroupIds.filter((id) => !selectedGroupIds.includes(id))\r\n onConfirm(groupIdsToAdd, groupIdsToRemove)\r\n }\r\n }\r\n\r\n const handleClose = () => {\r\n setSelectedGroupIds([])\r\n setShowNewGroupInput(false)\r\n setNewName('')\r\n onClose()\r\n }\r\n\r\n const handleNewGroupClick = () => {\r\n setShowNewGroupInput(true)\r\n }\r\n\r\n const handleGroupSelect = (groupId: string) => {\r\n setSelectedGroupIds((prev) => {\r\n if (prev.includes(groupId)) {\r\n // Uncheck: remove from selection\r\n return prev.filter((id) => id !== groupId)\r\n } else {\r\n // Check: add to selection\r\n return [...prev, groupId]\r\n }\r\n })\r\n setShowNewGroupInput(false)\r\n }\r\n\r\n const isConfirmDisabled = () => {\r\n if (showNewGroupInput) return !newName.trim()\r\n // Allow unchecking all groups (to remove item from all groups)\r\n return false\r\n }\r\n\r\n const getButtonText = () => {\r\n if (showNewGroupInput) return 'Create & Add'\r\n\r\n const changes = hasChanges()\r\n\r\n // Case 1: Item already exists in some groups\r\n if (currentGroupIds.length > 0) {\r\n return changes ? 'Save Changes' : 'OK'\r\n }\r\n\r\n // Case 2: Item doesn't exist in any group yet\r\n return 'Save'\r\n }\r\n\r\n return (\r\n <Dialog open={open} onClose={handleClose} maxWidth='xs' fullWidth disableScrollLock={true} keepMounted={false} scroll='paper'>\r\n <ModalHeader cartItem={cartItem} onClose={handleClose} />\r\n <Box component='form' onSubmit={handleSubmit}>\r\n <DialogContent>\r\n <Typography variant='subtitle1' sx={{ mb: 1, fontWeight: 600 }}>\r\n Your Media Rights Package\r\n </Typography>\r\n {canAddGroup(groups) &&\r\n (!showNewGroupInput ? (\r\n <NewCollectionButton onClick={handleNewGroupClick} />\r\n ) : (\r\n <NewCollectionInput value={newName} onChange={setNewName} />\r\n ))}\r\n <CollectionsList groups={groups} selectedGroupIds={selectedGroupIds} onGroupSelect={handleGroupSelect} />\r\n </DialogContent>\r\n\r\n <DialogActions sx={{ px: 3, pb: 3 }}>\r\n {guideStepsProps && <GuideSteps iconButtonProps={{ color: 'primary', sx: { mr: 'auto' } }} {...guideStepsProps} />}\r\n <Button onClick={handleClose} variant='outlined' type='button'>\r\n Cancel\r\n </Button>\r\n <Button type='submit' variant='contained' disabled={isConfirmDisabled()} sx={{ minWidth: 100 }}>\r\n {getButtonText()}\r\n </Button>\r\n </DialogActions>\r\n </Box>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport interface IShowGroupSelectorModalProps {\r\n cartItem: IMediaRightItem | null\r\n groups: IMediaRightGroup[]\r\n guideStepsProps?: IGuideStepsProps\r\n addGroup: (group: Omit<IMediaRightGroup, 'createdAt' | 'items' | 'channels'>) => void\r\n addItem: (item: IMediaRightItem) => void\r\n removeItem: (groupId: string, productId: string) => void\r\n}\r\n\r\nexport const showGroupSelectorModal = ({ cartItem, groups, guideStepsProps, addGroup, addItem, removeItem }: IShowGroupSelectorModalProps) => {\r\n const modalContainer = document.createElement('div')\r\n document.body.appendChild(modalContainer)\r\n const root = createRoot(modalContainer)\r\n\r\n const handleModalConfirmInModal = (groupIdsToAdd: string[], groupIdsToRemove: string[], newGroupName?: string) => {\r\n if (!cartItem) return\r\n\r\n // Create new group if needed\r\n if (newGroupName) {\r\n const newGroupId = generateGroupId()\r\n addGroup({\r\n id: newGroupId,\r\n name: newGroupName\r\n })\r\n // Add item to the new group\r\n const cartItemWithGroup: IMediaRightItem = {\r\n ...cartItem,\r\n GroupId: newGroupId\r\n }\r\n addItem(cartItemWithGroup)\r\n } else {\r\n // Remove from groups\r\n groupIdsToRemove.forEach((groupId) => {\r\n if (cartItem.ProductId) {\r\n removeItem(groupId, cartItem.ProductId)\r\n }\r\n })\r\n\r\n // Add to groups\r\n groupIdsToAdd.forEach((groupId) => {\r\n const cartItemWithGroup: IMediaRightItem = {\r\n ...cartItem,\r\n GroupId: groupId\r\n }\r\n addItem(cartItemWithGroup)\r\n })\r\n }\r\n\r\n root.unmount()\r\n document.body.removeChild(modalContainer)\r\n }\r\n root.render(\r\n <GroupSelectorModal\r\n open={true}\r\n onClose={() => {\r\n root.unmount()\r\n document.body.removeChild(modalContainer)\r\n }}\r\n onConfirm={handleModalConfirmInModal}\r\n guideStepsProps={guideStepsProps}\r\n groups={groups}\r\n cartItem={cartItem}\r\n />\r\n )\r\n}\r\n"],"names":["GroupSelectorModal","_ref","open","onClose","onConfirm","groups","guideStepsProps","cartItem","currentGroupIds","useMemo","ProductId","filter","g","_g$items","items","some","item","map","id","sort","initialGroupIds","length","_useState","useState","_useState2","_slicedToArray","selectedGroupIds","setSelectedGroupIds","_useState3","_useState4","showNewGroupInput","setShowNewGroupInput","_useState5","_useState6","newName","setNewName","useEffect","newInitialGroupIds","hasChanges","trim","sortedSelected","_toConsumableArray","index","handleClose","_jsxs","Dialog","maxWidth","fullWidth","disableScrollLock","keepMounted","scroll","children","_jsx","ModalHeader","Box","component","onSubmit","e","preventDefault","groupIdsToAdd","includes","groupIdsToRemove","DialogContent","Typography","variant","sx","mb","fontWeight","canAddGroup","NewCollectionInput","value","onChange","NewCollectionButton","onClick","CollectionsList","onGroupSelect","groupId","prev","concat","DialogActions","px","pb","GuideSteps","_objectSpread","iconButtonProps","color","mr","Button","type","disabled","minWidth","changes","getButtonText","showGroupSelectorModal","_ref2","addGroup","addItem","removeItem","modalContainer","document","createElement","body","appendChild","root","createRoot","render","unmount","removeChild","newGroupName","newGroupId","generateGroupId","name","cartItemWithGroup","GroupId","forEach"],"mappings":"6qBAqBaA,EAAmD,SAAjCC,GAAqG,IAAjEC,EAAID,EAAJC,KAAMC,EAAOF,EAAPE,QAASC,EAASH,EAATG,UAAWC,EAAMJ,EAANI,OAAQC,EAAeL,EAAfK,gBAAiBC,EAAQN,EAARM,SAE9GC,EAAkBC,EAAQ,WAC9B,OAAKF,SAAAA,EAAUG,UACLL,EAAOM,OAAO,SAACC,GAAC,IAAAC,EAAA,OAAY,QAAZA,EAAKD,EAAEE,aAAK,IAAAD,OAAA,EAAPA,EAASE,KAAK,SAACC,GAAI,OAAKA,EAAKN,YAAcH,EAASG,cAC1EO,IAAI,SAACL,GAAC,OAAKA,EAAEM,EAAG,GAACC,O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U,eAAiB,KAI7B,MACR,CAyBUC,aAMb,EAWaC,EAAyB,SAAHC,GAA0G,IAApGvF,EAAQuF,EAARvF,SAAUF,EAAMyF,EAANzF,OAAQC,EAAewF,EAAfxF,gBAAiByF,EAAQD,EAARC,SAAUC,EAAOF,EAAPE,QAASC,EAAUH,EAAVG,WACvFC,EAAiBC,SAASC,cAAc,OAC9CD,SAASE,KAAKC,YAAYJ,GAC1B,IAAMK,EAAOC,EAAWN,GAuCxBK,EAAKE,OACHrD,EAACpD,EAAkB,CACjBE,MAAM,EACNC,QAAS,WACPoG,EAAKG,UACLP,SAASE,KAAKM,YAAYT,EAC3B,EACD9F,UA5C8B,SAACuD,EAAyBE,EAA4B+C,GACtF,GAAKrG,EAAL,CAGA,GAAIqG,EAAc,CAChB,IAAMC,EAAaC,IACnBf,EAAS,CACP7E,GAAI2F,EACJE,KAAMH,IAGR,IAAMI,EAAiB7B,EAAAA,KAClB5E,GAAQ,GAAA,CACX0G,QAASJ,IAEXb,EAAQgB,EACT,MAECnD,EAAiBqD,QAAQ,SAACtC,GACpBrE,EAASG,WACXuF,EAAWrB,EAASrE,EAASG,UAEjC,GAGAiD,EAAcuD,QAAQ,SAACtC,GACrB,IAAMoC,EAAiB7B,EAAAA,KAClB5E,GAAQ,GAAA,CACX0G,QAASrC,IAEXoB,EAAQgB,EACV,GAGFT,EAAKG,UACLP,SAASE,KAAKM,YAAYT,EAlCX,CAmChB,EASG5F,gBAAiBA,EACjBD,OAAQA,EACRE,SAAUA,IAGhB"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/media-right/group-selector/index.tsx"],"sourcesContent":["import { createRoot } from 'react-dom/client'\r\nimport { useState, useEffect, useMemo } from 'react'\r\nimport { Dialog, DialogContent, DialogActions, Button, Typography, Box } from '@mui/material'\r\nimport type { FC, FormEvent } from 'react'\r\nimport { CollectionsList } from './units'\r\nimport { GuideSteps } from '../guide-steps'\r\nimport { ModalHeader } from './modal-header'\r\nimport { canAddGroup, generateGroupId } from '../helpers'\r\nimport { NewCollectionButton, NewCollectionInput } from '../unit.control'\r\nimport type { IGuideStepsProps } from '../guide-steps'\r\nimport type { IMediaRightGroup, IMediaRightItem } from '../types'\r\n\r\nexport interface IGroupSelectorModalProps {\r\n open: boolean\r\n guideStepsProps?: IGuideStepsProps\r\n onClose: () => void\r\n onConfirm: (groupIdsToAdd: string[], groupIdsToRemove: string[], newGroupName?: string) => void\r\n groups: IMediaRightGroup[]\r\n cartItem: IMediaRightItem | null\r\n}\r\n\r\nexport const GroupSelectorModal: FC<IGroupSelectorModalProps> = ({ open, onClose, onConfirm, groups, guideStepsProps, cartItem }) => {\r\n // Find all groups that contain this item\r\n const currentGroupIds = useMemo(() => {\r\n if (!cartItem?.ProductId) return []\r\n const l = groups.filter((g) => g.items?.some((item) => item.ProductId === cartItem.ProductId))\r\n return l.map((g) => g.id).sort()\r\n }, [groups, cartItem])\r\n\r\n // Auto-select: all current groups if exists, otherwise first group if available\r\n const initialGroupIds = currentGroupIds.length > 0 ? currentGroupIds : groups.length > 0 ? [groups[0].id] : []\r\n\r\n const [selectedGroupIds, setSelectedGroupIds] = useState<string[]>(initialGroupIds)\r\n const [showNewGroupInput, setShowNewGroupInput] = useState(false)\r\n const [newName, setNewName] = useState<string>('')\r\n\r\n // Update selection when modal opens or groups/cartItem changes\r\n useEffect(() => {\r\n if (open) {\r\n const newInitialGroupIds = currentGroupIds.length > 0 ? currentGroupIds : groups.length > 0 ? [groups[0].id] : []\r\n setSelectedGroupIds(newInitialGroupIds)\r\n setShowNewGroupInput(false)\r\n setNewName('')\r\n }\r\n }, [open, currentGroupIds, groups.length])\r\n\r\n // Check if there's any change\r\n // const hasChanges = () => {\r\n // if (showNewGroupInput && newName.trim()) return true\r\n\r\n // // Sort and compare arrays (currentGroupIds is already sorted)\r\n // const sortedSelected = [...selectedGroupIds].sort()\r\n\r\n // // Check if arrays are different\r\n // if (currentGroupIds.length !== sortedSelected.length) return true\r\n\r\n // return currentGroupIds.some((id, index) => id !== sortedSelected[index])\r\n // }\r\n\r\n const isChanged = useMemo(() => {\r\n if (showNewGroupInput && newName.trim()) return true\r\n\r\n // Sort and compare arrays (currentGroupIds is already sorted)\r\n const sortedSelected = [...selectedGroupIds].sort()\r\n\r\n // Check if arrays are different\r\n if (currentGroupIds.length !== sortedSelected.length) return true\r\n return currentGroupIds.some((id, index) => id !== sortedSelected[index])\r\n }, [showNewGroupInput, newName, selectedGroupIds, currentGroupIds])\r\n\r\n const handleSubmit = (e: FormEvent) => {\r\n e.preventDefault()\r\n\r\n // Only proceed if there are changes\r\n if (!isChanged) {\r\n handleClose()\r\n return\r\n }\r\n\r\n if (showNewGroupInput && newName.trim()) {\r\n // Create new group and add item to it\r\n onConfirm([], [], newName.trim())\r\n } else {\r\n // Calculate changes\r\n const groupIdsToAdd = selectedGroupIds.filter((id) => !currentGroupIds.includes(id))\r\n const groupIdsToRemove = currentGroupIds.filter((id) => !selectedGroupIds.includes(id))\r\n onConfirm(groupIdsToAdd, groupIdsToRemove)\r\n }\r\n }\r\n\r\n const handleClose = () => {\r\n setSelectedGroupIds([])\r\n setShowNewGroupInput(false)\r\n setNewName('')\r\n onClose()\r\n }\r\n\r\n const handleNewGroupClick = () => {\r\n setShowNewGroupInput(true)\r\n }\r\n\r\n const handleGroupSelect = (groupId: string) => {\r\n setSelectedGroupIds((prev) => {\r\n if (prev.includes(groupId)) {\r\n // Uncheck: remove from selection\r\n return prev.filter((id) => id !== groupId)\r\n } else {\r\n // Check: add to selection\r\n return [...prev, groupId]\r\n }\r\n })\r\n setShowNewGroupInput(false)\r\n }\r\n\r\n const isConfirmDisabled = () => {\r\n if (showNewGroupInput) return !newName.trim()\r\n // Allow unchecking all groups (to remove item from all groups)\r\n return false\r\n }\r\n\r\n const getButtonText = () => {\r\n if (showNewGroupInput) return 'Create & Add'\r\n\r\n // Case 1: Item already exists in some groups\r\n if (currentGroupIds.length > 0) {\r\n return isChanged ? 'Save Changes' : 'OK'\r\n }\r\n\r\n // Case 2: Item doesn't exist in any group yet\r\n return 'Save'\r\n }\r\n\r\n return (\r\n <Dialog open={open} onClose={handleClose} maxWidth='xs' fullWidth disableScrollLock={true} keepMounted={false} scroll='paper'>\r\n <ModalHeader cartItem={cartItem} onClose={handleClose} />\r\n <Box component='form' onSubmit={handleSubmit}>\r\n <DialogContent>\r\n <Typography variant='subtitle1' sx={{ mb: 1, fontWeight: 600 }}>\r\n Your Media Rights Package\r\n </Typography>\r\n {canAddGroup(groups) &&\r\n (!showNewGroupInput ? (\r\n <NewCollectionButton onClick={handleNewGroupClick} />\r\n ) : (\r\n <NewCollectionInput value={newName} onChange={setNewName} />\r\n ))}\r\n <CollectionsList groups={groups} selectedGroupIds={selectedGroupIds} onGroupSelect={handleGroupSelect} />\r\n </DialogContent>\r\n\r\n <DialogActions sx={{ px: 3, pb: 3 }}>\r\n {guideStepsProps && <GuideSteps iconButtonProps={{ color: 'primary', sx: { mr: 'auto' } }} {...guideStepsProps} />}\r\n <Button onClick={handleClose} variant='text' type='button' color='inherit'>\r\n Cancel\r\n </Button>\r\n <Button type='submit' variant={isChanged ? 'contained' : 'outlined'} disabled={isConfirmDisabled()} color='primary' sx={{ minWidth: 100 }}>\r\n {getButtonText()}\r\n </Button>\r\n </DialogActions>\r\n </Box>\r\n </Dialog>\r\n )\r\n}\r\n\r\nexport interface IShowGroupSelectorModalProps {\r\n cartItem: IMediaRightItem | null\r\n groups: IMediaRightGroup[]\r\n guideStepsProps?: IGuideStepsProps\r\n addGroup: (group: Omit<IMediaRightGroup, 'createdAt' | 'items' | 'channels'>) => void\r\n addItem: (item: IMediaRightItem) => void\r\n removeItem: (groupId: string, productId: string) => void\r\n}\r\n\r\nexport const showGroupSelectorModal = ({ cartItem, groups, guideStepsProps, addGroup, addItem, removeItem }: IShowGroupSelectorModalProps) => {\r\n const modalContainer = document.createElement('div')\r\n document.body.appendChild(modalContainer)\r\n const root = createRoot(modalContainer)\r\n\r\n const handleModalConfirmInModal = (groupIdsToAdd: string[], groupIdsToRemove: string[], newGroupName?: string) => {\r\n if (!cartItem) return\r\n\r\n // Create new group if needed\r\n if (newGroupName) {\r\n const newGroupId = generateGroupId()\r\n addGroup({ id: newGroupId, name: newGroupName })\r\n // Add item to the new group\r\n const cartItemWithGroup: IMediaRightItem = { ...cartItem, GroupId: newGroupId }\r\n addItem(cartItemWithGroup)\r\n } else {\r\n // Remove from groups\r\n groupIdsToRemove.forEach((groupId) => {\r\n if (cartItem.ProductId) {\r\n removeItem(groupId, cartItem.ProductId)\r\n }\r\n })\r\n\r\n // Add to groups\r\n groupIdsToAdd.forEach((groupId) => {\r\n const cartItemWithGroup: IMediaRightItem = { ...cartItem, GroupId: groupId }\r\n addItem(cartItemWithGroup)\r\n })\r\n }\r\n\r\n root.unmount()\r\n document.body.removeChild(modalContainer)\r\n }\r\n root.render(\r\n <GroupSelectorModal\r\n open={true}\r\n onClose={() => {\r\n root.unmount()\r\n document.body.removeChild(modalContainer)\r\n }}\r\n onConfirm={handleModalConfirmInModal}\r\n guideStepsProps={guideStepsProps}\r\n groups={groups}\r\n cartItem={cartItem}\r\n />\r\n )\r\n}\r\n"],"names":["GroupSelectorModal","_ref","open","onClose","onConfirm","groups","guideStepsProps","cartItem","currentGroupIds","useMemo","ProductId","filter","g","_g$items","items","some","item","map","id","sort","initialGroupIds","length","_useState","useState","_useState2","_slicedToArray","selectedGroupIds","setSelectedGroupIds","_useState3","_useState4","showNewGroupInput","setShowNewGroupInput","_useState5","_useState6","newName","setNewName","useEffect","newInitialGroupIds","isChanged","trim","sortedSelected","_toConsumableArray","index","handleClose","_jsxs","Dialog","maxWidth","fullWidth","disableScrollLock","keepMounted","scroll","children","_jsx","ModalHeader","Box","component","onSubmit","e","preventDefault","groupIdsToAdd","includes","groupIdsToRemove","DialogContent","Typography","variant","sx","mb","fontWeight","canAddGroup","NewCollectionInput","value","onChange","NewCollectionButton","onClick","CollectionsList","onGroupSelect","groupId","prev","concat","DialogActions","px","pb","GuideSteps","_objectSpread","iconButtonProps","color","mr","Button","type","disabled","minWidth","showGroupSelectorModal","_ref2","addGroup","addItem","removeItem","modalContainer","document","createElement","body","appendChild","root","createRoot","render","unmount","removeChild","newGroupName","newGroupId","generateGroupId","name","cartItemWithGroup","GroupId","forEach"],"mappings":"6qBAqBaA,EAAmD,SAAjCC,GAAqG,IAAjEC,EAAID,EAAJC,KAAMC,EAAOF,EAAPE,QAASC,EAASH,EAATG,UAAWC,EAAMJ,EAANI,OAAQC,EAAeL,EAAfK,gBAAiBC,EAAQN,EAARM,SAE9GC,EAAkBC,EAAQ,WAC9B,OAAKF,SAAAA,EAAUG,UACLL,EAAOM,OAAO,SAACC,GAAC,IAAAC,EAAA,OAAY,QAAZA,EAAKD,EAAEE,aAAK,IAAAD,OAAA,EAAPA,EAASE,KAAK,SAACC,GAAI,OAAKA,EAAKN,YAAcH,EAASG,cAC1EO,IAAI,SAACL,GAAC,OAAKA,EAAEM,EAAG,GAACC,OAFO,EAGnC,EAAG,CAACd,EAAQE,IAGNa,EAAkBZ,EAAgBa,OAAS,EAAIb,EAAkBH,EAAOgB,OAAS,EAAI,CAAChB,EAAO,GAAGa,IAAM,GAE5GI,EAAgDC,EAAmBH,GAAgBI,EAAAC,EAAAH,EAAA,GAA5EI,EAAgBF,EAAA,GAAEG,EAAmBH,EAAA,GAC5CI,EAAkDL,GAAS,GAAMM,EAAAJ,EAAAG,EAAA,GAA1DE,EAAiBD,EAAA,GAAEE,EAAoBF,EAAA,GAC9CG,EAA8BT,EAAiB,IAAGU,EAAAR,EAAAO,EAAA,GAA3CE,EAAOD,EAAA,GAAEE,EAAUF,EAAA,GAG1BG,EAAU,WACR,GAAIlC,EAAM,CACR,IAAMmC,EAAqB7B,EAAgBa,OAAS,EAAIb,EAAkBH,EAAOgB,OAAS,EAAI,CAAChB,EAAO,GAAGa,IAAM,GAC/GS,EAAoBU,GACpBN,GAAqB,GACrBI,EAAW,GACZ,CACF,EAAE,CAACjC,EAAMM,EAAiBH,EAAOgB,SAelC,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QgB,EACT,MAECjD,EAAiBmD,QAAQ,SAACpC,GACpBrE,EAASG,WACXqF,EAAWnB,EAASrE,EAASG,UAEjC,GAGAiD,EAAcqD,QAAQ,SAACpC,GACrB,IAAMkC,EAAiB3B,EAAAA,KAAyB5E,GAAQ,GAAA,CAAEwG,QAASnC,IACnEkB,EAAQgB,EACV,GAGFT,EAAKG,UACLP,SAASE,KAAKM,YAAYT,EAzBX,CA0BhB,EASG1F,gBAAiBA,EACjBD,OAAQA,EACRE,SAAUA,IAGhB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import type { ButtonIconAddToCartProps } from './btn.icon.add-to-cart';
|
|
3
|
+
import type { BtnIconAddToPackageProps } from './btn.icon.add-to-package';
|
|
4
|
+
export interface IActionGroupsProps<TProduct> extends StackProps {
|
|
5
|
+
packageProps?: BtnIconAddToPackageProps<TProduct>;
|
|
6
|
+
cartProps?: ButtonIconAddToCartProps<TProduct>;
|
|
7
|
+
}
|
|
8
|
+
export declare const ActionGroup: <T>({ packageProps, cartProps, ...stackProps }: IActionGroupsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default ActionGroup;
|
|
10
|
+
//# sourceMappingURL=action-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-group.d.ts","sourceRoot":"","sources":["../../../src/action-license/action-group.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAEzE,MAAM,WAAW,kBAAkB,CAAC,QAAQ,CAAE,SAAQ,UAAU;IAC9D,YAAY,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;IACjD,SAAS,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;CAC/C;AAED,eAAO,MAAM,WAAW,mHAOvB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { StackProps } from '@mui/material';
|
|
2
|
+
import type { AreaQuicklyAddToCartProps } from './quickly-add-to-cart';
|
|
3
|
+
import type { BtnIconAddToPackageProps } from './btn.icon.add-to-package';
|
|
4
|
+
import { IPricePackage } from './types';
|
|
5
|
+
export interface IAreaActionGroupsProps<TProduct, TPrices extends IPricePackage> extends StackProps {
|
|
6
|
+
product: TProduct;
|
|
7
|
+
packageProps?: Omit<BtnIconAddToPackageProps<TProduct>, 'product'>;
|
|
8
|
+
cartProps?: Omit<AreaQuicklyAddToCartProps<TProduct, TPrices>, 'product'>;
|
|
9
|
+
}
|
|
10
|
+
export declare const AreaActionGroups: <TProduct, TPrices extends IPricePackage>({ product, packageProps, cartProps, ...stackProps }: IAreaActionGroupsProps<TProduct, TPrices>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=area.group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.group.d.ts","sourceRoot":"","sources":["../../../src/action-license/area.group.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,sBAAsB,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa,CAAE,SAAQ,UAAU;IACjG,OAAO,EAAE,QAAQ,CAAA;IACjB,YAAY,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAA;IAClE,SAAS,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,CAAA;CAC1E;AAED,eAAO,MAAM,gBAAgB,sLA6C5B,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ButtonProps, TooltipProps } from '@mui/material';
|
|
3
|
+
export interface ButtonIconAddToCartProps<T> extends Omit<ButtonProps, 'onClick'> {
|
|
4
|
+
product: T;
|
|
5
|
+
tooltipProps?: TooltipProps;
|
|
6
|
+
buttonProps?: ButtonProps;
|
|
7
|
+
onClick: (item: T, e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ButtonIconAddToCart: <T>({ product, tooltipProps, onClick, buttonProps }: ButtonIconAddToCartProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=btn.icon.add-to-cart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.icon.add-to-cart.d.ts","sourceRoot":"","sources":["../../../src/action-license/btn.icon.add-to-cart.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE9D,MAAM,WAAW,wBAAwB,CAAC,CAAC,CAAE,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/E,OAAO,EAAE,CAAC,CAAA;IACV,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;CACnE;AAED,eAAO,MAAM,mBAAmB,8HAiB/B,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ButtonProps, IconButtonProps, TooltipProps } from '@mui/material';
|
|
2
|
+
export declare enum EBtnAddToPackage {
|
|
3
|
+
Icon = "icon",
|
|
4
|
+
Button = "button"
|
|
5
|
+
}
|
|
6
|
+
export interface BtnIconAddToPackageProps<T> {
|
|
7
|
+
product: T;
|
|
8
|
+
buttonProps?: ButtonProps;
|
|
9
|
+
tooltipProps?: TooltipProps;
|
|
10
|
+
helpProps?: Partial<IconButtonProps> & Record<string, any>;
|
|
11
|
+
kind?: EBtnAddToPackage;
|
|
12
|
+
addToCart: (item: T) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const ButtonIconAddToPackage: <T>({ product, buttonProps, tooltipProps, helpProps, kind, addToCart }: BtnIconAddToPackageProps<T>) => import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=btn.icon.add-to-package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.icon.add-to-package.d.ts","sourceRoot":"","sources":["../../../src/action-license/btn.icon.add-to-package.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE/E,oBAAY,gBAAgB;IAC1B,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AACD,MAAM,WAAW,wBAAwB,CAAC,CAAC;IACzC,OAAO,EAAE,CAAC,CAAA;IACV,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1D,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAA;CAC7B;AAED,eAAO,MAAM,sBAAsB,wJAsDlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../../src/action-license/buttons.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAU,WAAW,EAAU,MAAM,eAAe,CAAA;AAE3D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,CAsC5E,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './quickly-add-to-cart';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './btn.icon.add-to-cart';
|
|
4
|
+
export * from './btn.icon.add-to-package';
|
|
5
|
+
export * from './modal.add-to-cart';
|
|
6
|
+
export * from './action-group';
|
|
7
|
+
export * from './area.group';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/action-license/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,cAAc,SAAS,CAAA;AAEvB,cAAc,wBAAwB,CAAA;AAEtC,cAAc,2BAA2B,CAAA;AAEzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import type { AreaQuicklyAddToCartProps } from './quickly-add-to-cart/index';
|
|
3
|
+
import { IPricePackage } from './types';
|
|
4
|
+
export interface IGroupSelectorModalProps extends PropsWithChildren {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
name: string;
|
|
8
|
+
pictureUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const AreaAddToCart: FC<IGroupSelectorModalProps>;
|
|
11
|
+
export interface ModalAddToCartProps<TProduct, TPrices extends IPricePackage> {
|
|
12
|
+
title: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
addToCartProps: AreaQuicklyAddToCartProps<TProduct, TPrices>;
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ModalAddToCart: <TProduct, TPrices extends IPricePackage>({ title, imageUrl, addToCartProps, onClose }: ModalAddToCartProps<TProduct, TPrices>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=modal.add-to-cart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal.add-to-cart.d.ts","sourceRoot":"","sources":["../../../src/action-license/modal.add-to-cart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAKlD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,wBAAwB,CAuCtD,CAAA;AAED,MAAM,WAAW,mBAAmB,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa;IAC1E,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC5D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,eAAO,MAAM,cAAc,4KAY1B,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Component, ComponentType } from 'react';
|
|
2
|
+
import type { BoxProps } from '@mui/material';
|
|
3
|
+
import type { IFormBase } from 'dinocollab-core/form';
|
|
4
|
+
import { IPricePackage } from '../types';
|
|
5
|
+
import type { IFormQuicklyAddToCartData, IQuicklyAddToCartConfig } from './type';
|
|
6
|
+
interface IState {
|
|
7
|
+
Value?: string;
|
|
8
|
+
}
|
|
9
|
+
interface IFormContentProps<TProduct, TPrices extends IPricePackage> extends IFormBase<IFormQuicklyAddToCartData<TProduct, TPrices>> {
|
|
10
|
+
currentPricePackageId?: string;
|
|
11
|
+
config: IQuicklyAddToCartConfig;
|
|
12
|
+
}
|
|
13
|
+
export declare class FormContentBase<TProduct, TPrices extends IPricePackage> extends Component<IFormContentProps<TProduct, TPrices>, IState> {
|
|
14
|
+
priceIdOld?: string;
|
|
15
|
+
constructor(props: IFormContentProps<TProduct, TPrices>);
|
|
16
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
renderRadioGroup: () => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
handleChange: (_: React.ChangeEvent<HTMLInputElement>, value: string) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare const QuickAddToCartStyled: ComponentType<BoxProps & {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/action-license/quickly-add-to-cart/content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAKhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAGxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAEhF,UAAU,MAAM;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,iBAAiB,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa,CAAE,SAAQ,SAAS,CAAC,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAClI,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,MAAM,EAAE,uBAAuB,CAAA;CAChC;AAED,qBAAa,eAAe,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa,CAAE,SAAQ,SAAS,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IACnI,UAAU,CAAC,EAAE,MAAM,CAAA;gBACP,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;IAUvD,MAAM;IA6BN,gBAAgB,gDAkCf;IAED,YAAY,MAAO,MAAM,WAAW,CAAC,gBAAgB,CAAC,SAAS,MAAM,UAGpE;CACF;AAMD,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,QAAQ,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAkD/E,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IQuicklyAddToCartConfig } from './type';
|
|
2
|
+
import type { IPricePackage } from '../types';
|
|
3
|
+
interface IQuicklyAddToCartFormProps<TProduct, TPrices extends IPricePackage> {
|
|
4
|
+
prices: TPrices[];
|
|
5
|
+
product: TProduct;
|
|
6
|
+
currentPricePackageId?: string;
|
|
7
|
+
config: IQuicklyAddToCartConfig;
|
|
8
|
+
onSubmit: (product: TProduct, price: TPrices) => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const QuicklyAddToCartForm: <TProduct, TPrices extends IPricePackage>(props: IQuicklyAddToCartFormProps<TProduct, TPrices>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../src/action-license/quickly-add-to-cart/form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA6B,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,UAAU,0BAA0B,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa;IAC1E,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB,OAAO,EAAE,QAAQ,CAAA;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,MAAM,EAAE,uBAAuB,CAAA;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE;AAED,eAAO,MAAM,oBAAoB,4IA+BhC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IPricePackage } from '../types';
|
|
2
|
+
import type { IQuicklyAddToCartConfig } from './type';
|
|
3
|
+
export interface AreaQuicklyAddToCartProps<TProduct, TPrices extends IPricePackage> {
|
|
4
|
+
prices: TPrices[];
|
|
5
|
+
product: TProduct;
|
|
6
|
+
currentPricePackageId?: string;
|
|
7
|
+
onAddToCart: (product: TProduct, price: IPricePackage) => void | Promise<void>;
|
|
8
|
+
onSuccess?: () => void;
|
|
9
|
+
config?: IQuicklyAddToCartConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare const AreaQuicklyAddToCart: <TProduct, TPrices extends IPricePackage>(props: AreaQuicklyAddToCartProps<TProduct, TPrices>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export type { IQuicklyAddToCartConfig } from './type';
|
|
13
|
+
export { quickToCartClasses } from './type';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/action-license/quickly-add-to-cart/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAI,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAErD,MAAM,WAAW,yBAAyB,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa;IAChF,MAAM,EAAE,OAAO,EAAE,CAAA;IACjB,OAAO,EAAE,QAAQ,CAAA;IACjB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,WAAW,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9E,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,MAAM,CAAC,EAAE,uBAAuB,CAAA;CACjC;AAED,eAAO,MAAM,oBAAoB,2IAuBhC,CAAA;AAGD,YAAY,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import type { IPricePackage } from '../types';
|
|
3
|
+
import { IconButtonProps } from '@mui/material';
|
|
4
|
+
export interface IFormQuicklyAddToCartData<TProduct, TPrices extends IPricePackage> {
|
|
5
|
+
PriceSelectedId?: string;
|
|
6
|
+
Prices?: TPrices[];
|
|
7
|
+
Data?: TProduct;
|
|
8
|
+
}
|
|
9
|
+
export interface IQuicklyAddToCartConfig {
|
|
10
|
+
addButtonText?: string;
|
|
11
|
+
updateButtonText?: string;
|
|
12
|
+
buttonIcon?: ReactNode;
|
|
13
|
+
helpTooltip?: string;
|
|
14
|
+
helpProps?: Partial<IconButtonProps> & Record<string, any>;
|
|
15
|
+
formatPrice?: (price: number) => string;
|
|
16
|
+
}
|
|
17
|
+
export declare const quickToCartClasses: {
|
|
18
|
+
root: string;
|
|
19
|
+
content: string;
|
|
20
|
+
helpIcon: string;
|
|
21
|
+
checkCircle: string;
|
|
22
|
+
itemWrap: string;
|
|
23
|
+
item: string;
|
|
24
|
+
itemName: string;
|
|
25
|
+
itemPrice: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/action-license/quickly-add-to-cart/type.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,WAAW,yBAAyB,CAAC,QAAQ,EAAE,OAAO,SAAS,aAAa;IAChF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;CAChB;AAED,MAAM,WAAW,uBAAuB;IAEtC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,SAAS,CAAA;IAEtB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE1D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CACxC;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;CAS9B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/action-license/types.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/cart/styled.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"styled.d.ts","sourceRoot":"","sources":["../../../src/cart/styled.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAExD,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,SAAS,CA8C7C,CAAA;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;CAW9B,CAAA;AAMD,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,QAAQ,CAsFnD,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type { IMediaRightGroup, IMediaRightItem } from '../types';
|
|
3
2
|
import type { IGuideStepsProps } from '../guide-steps';
|
|
3
|
+
import type { IMediaRightGroup, IMediaRightItem } from '../types';
|
|
4
4
|
export interface IGroupSelectorModalProps {
|
|
5
5
|
open: boolean;
|
|
6
6
|
guideStepsProps?: IGuideStepsProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/media-right/group-selector/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/media-right/group-selector/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,EAAa,MAAM,OAAO,CAAA;AAM1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEjE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAA;IACb,eAAe,CAAC,EAAE,gBAAgB,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/F,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;CACjC;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,CA4I3D,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;IAChC,MAAM,EAAE,gBAAgB,EAAE,CAAA;IAC1B,eAAe,CAAC,EAAE,gBAAgB,CAAA;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC,KAAK,IAAI,CAAA;IACrF,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAA;CACzD;AAED,eAAO,MAAM,sBAAsB,yEAA0E,4BAA4B,SA8CxI,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinocollab-shared",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.21",
|
|
4
4
|
"description": "DinoCollab shared utilities and components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
],
|
|
41
41
|
"editor-kit": [
|
|
42
42
|
"./dist/types/editor-kit/index.d.ts"
|
|
43
|
+
],
|
|
44
|
+
"action-license": [
|
|
45
|
+
"./dist/types/action-license/index.d.ts"
|
|
43
46
|
]
|
|
44
47
|
}
|
|
45
48
|
},
|
|
@@ -79,6 +82,10 @@
|
|
|
79
82
|
"./editor-kit": {
|
|
80
83
|
"import": "./dist/editor-kit/index.js",
|
|
81
84
|
"types": "./dist/types/editor-kit/index.d.ts"
|
|
85
|
+
},
|
|
86
|
+
"./action-license": {
|
|
87
|
+
"import": "./dist/action-license/index.js",
|
|
88
|
+
"types": "./dist/types/action-license/index.d.ts"
|
|
82
89
|
}
|
|
83
90
|
},
|
|
84
91
|
"peerDependencies": {
|