1 line
9.5 KiB
JSON
1 line
9.5 KiB
JSON
|
{"ast":null,"code":"import { NotificationPlacements } from '../interface';\nconst placementAlignProperty = {\n topLeft: 'left',\n topRight: 'right',\n bottomLeft: 'left',\n bottomRight: 'right',\n top: 'left',\n bottom: 'left'\n};\nconst genPlacementStackStyle = (token, placement) => {\n const {\n componentCls\n } = token;\n return {\n [`${componentCls}-${placement}`]: {\n [`&${componentCls}-stack > ${componentCls}-notice-wrapper`]: {\n [placement.startsWith('top') ? 'top' : 'bottom']: 0,\n [placementAlignProperty[placement]]: {\n value: 0,\n _skip_check_: true\n }\n }\n }\n };\n};\nconst genStackChildrenStyle = token => {\n const childrenStyle = {};\n for (let i = 1; i < token.notificationStackLayer; i++) {\n childrenStyle[`&:nth-last-child(${i + 1})`] = {\n overflow: 'hidden',\n [`& > ${token.componentCls}-notice`]: {\n opacity: 0,\n transition: `opacity ${token.motionDurationMid}`\n }\n };\n }\n return Object.assign({\n [`&:not(:nth-last-child(-n+${token.notificationStackLayer}))`]: {\n opacity: 0,\n overflow: 'hidden',\n color: 'transparent',\n pointerEvents: 'none'\n }\n }, childrenStyle);\n};\nconst genStackedNoticeStyle = token => {\n const childrenStyle = {};\n for (let i = 1; i < token.notificationStackLayer; i++) {\n childrenStyle[`&:nth-last-child(${i + 1})`] = {\n background: token.colorBgBlur,\n backdropFilter: 'blur(10px)',\n '-webkit-backdrop-filter': 'blur(10px)'\n };\n }\n return Object.assign({}, childrenStyle);\n};\nconst genStackStyle = token => {\n const {\n componentCls\n } = token;\n return Object.assign({\n [`${componentCls}-stack`]: {\n [`& > ${componentCls}-notice-wrapper`]: Object.assign({\n transition: `all ${token.motionDurationSlow}, backdrop-filter 0s`,\n position: 'absolute'\n }, genStackChildrenStyle(token))\n },\n [`${componentCls}-stack:not(${componentCls}-stack-expanded)`]: {\n [`& > ${componentCls}-notice-wrapper`]: Object.assign({}, genStackedNoticeStyle(token))\n },\n [`${componentCls}-stack${componentCls}-stack-expanded`]: {\n [`& > ${componentCls}-notice-wrapper`]: {\n '&:not(:nth-last-child(-n + 1))': {\n opacity: 1,\n overflow: 'unset',\n color: 'inherit',\n pointerEvents: 'auto',\n [`& > ${token.componentCls}-notice`]: {\n opacity: 1\n }\n },\n '&:after': {\n content: '\"\"',\n position: 'absolute',\n height: token.margin,\n width: '100%',\n insetInline: 0,\n bottom: token.calc(token.margin).mul(-1).equal(),\n background: 'transparent',\n pointerEvents: 'auto'\n }\n }\n }\n }, NotificationPlacements.map(placement => genPlacementStackStyle(token, placement)).reduce((acc, cur) => Object.assign(Object.assign({}, acc), cur), {}));\n};\nexport default genStackStyle;","map":{"version":3,"names":["NotificationPlacements","placementAlignProperty","topLeft","topRight","bottomLeft","bottomRight","top","bottom","genPlacementStackStyle","token","placement","componentCls","startsWith","value","_skip_check_","genStackChildrenStyle","childrenStyle","i","notificationStackLayer","overflow","opacity","transition","motionDurationMid","Object","assign","color","pointerEvents","genStackedNoticeStyle","background","colorBgBlur","backdropFilter","genStackStyle","motionDurationSlow","position","content","height","margin","width","insetInline","calc","mul","equal","map","reduce","acc","cur"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/notification/style/stack.js"],"sourcesContent":["import { NotificationPlacements } from '../interface';\nconst placementAlignProperty = {\n topLeft: 'left',\n topRight: 'right',\n bottomLeft: 'left',\n bottomRight: 'right',\n top: 'left',\n bottom: 'left'\n};\nconst genPlacementStackStyle = (token, placement) => {\n const {\n componentCls\n } = token;\
|