1 line
16 KiB
JSON
1 line
16 KiB
JSON
{"ast":null,"code":"\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { isPresetSize, isValidGapNumber } from '../_util/gapSize';\nimport { ConfigContext } from '../config-provider';\nimport Compact from './Compact';\nimport { SpaceContextProvider } from './context';\nimport Item from './Item';\nimport useStyle from './style';\nexport { SpaceContext } from './context';\nconst InternalSpace = /*#__PURE__*/React.forwardRef((props, ref) => {\n var _a, _b, _c;\n const {\n getPrefixCls,\n space,\n direction: directionConfig\n } = React.useContext(ConfigContext);\n const {\n size = (_a = space === null || space === void 0 ? void 0 : space.size) !== null && _a !== void 0 ? _a : 'small',\n align,\n className,\n rootClassName,\n children,\n direction = 'horizontal',\n prefixCls: customizePrefixCls,\n split,\n style,\n wrap = false,\n classNames: customClassNames,\n styles\n } = props,\n otherProps = __rest(props, [\"size\", \"align\", \"className\", \"rootClassName\", \"children\", \"direction\", \"prefixCls\", \"split\", \"style\", \"wrap\", \"classNames\", \"styles\"]);\n const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];\n const isPresetVerticalSize = isPresetSize(verticalSize);\n const isPresetHorizontalSize = isPresetSize(horizontalSize);\n const isValidVerticalSize = isValidGapNumber(verticalSize);\n const isValidHorizontalSize = isValidGapNumber(horizontalSize);\n const childNodes = toArray(children, {\n keepEmpty: true\n });\n const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;\n const prefixCls = getPrefixCls('space', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const cls = classNames(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {\n [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n [`${prefixCls}-align-${mergedAlign}`]: mergedAlign,\n [`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,\n [`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize\n }, className, rootClassName, cssVarCls);\n const itemClassName = classNames(`${prefixCls}-item`, (_b = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _b !== void 0 ? _b : (_c = space === null || space === void 0 ? void 0 : space.classNames) === null || _c === void 0 ? void 0 : _c.item);\n // Calculate latest one\n let latestIndex = 0;\n const nodes = childNodes.map((child, i) => {\n var _a, _b;\n if (child !== null && child !== undefined) {\n latestIndex = i;\n }\n const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;\n return /*#__PURE__*/React.createElement(Item, {\n className: itemClassName,\n key: key,\n index: i,\n split: split,\n style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item\n }, child);\n });\n const spaceContext = React.useMemo(() => ({\n latestIndex\n }), [latestIndex]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n const gapStyle = {};\n if (wrap) {\n gapStyle.flexWrap = 'wrap';\n }\n if (!isPresetHorizontalSize && isValidHorizontalSize) {\n gapStyle.columnGap = horizontalSize;\n }\n if (!isPresetVerticalSize && isValidVerticalSize) {\n gapStyle.rowGap = verticalSize;\n }\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({\n ref: ref,\n className: cls,\n style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)\n }, otherProps), /*#__PURE__*/React.createElement(SpaceContextProvider, {\n value: spaceContext\n }, nodes)));\n});\nconst Space = InternalSpace;\nSpace.Compact = Compact;\nif (process.env.NODE_ENV !== 'production') {\n Space.displayName = 'Space';\n}\nexport default Space;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","toArray","isPresetSize","isValidGapNumber","ConfigContext","Compact","SpaceContextProvider","Item","useStyle","SpaceContext","InternalSpace","forwardRef","props","ref","_a","_b","_c","getPrefixCls","space","direction","directionConfig","useContext","size","align","className","rootClassName","children","prefixCls","customizePrefixCls","split","style","wrap","customClassNames","styles","otherProps","horizontalSize","verticalSize","Array","isArray","isPresetVerticalSize","isPresetHorizontalSize","isValidVerticalSize","isValidHorizontalSize","childNodes","keepEmpty","mergedAlign","undefined","wrapCSSVar","hashId","cssVarCls","cls","itemClassName","item","latestIndex","nodes","map","child","key","createElement","index","spaceContext","useMemo","gapStyle","flexWrap","columnGap","rowGap","assign","value","Space","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/space/index.js"],"sourcesContent":["\"use client\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport { isPresetSize, isValidGapNumber } from '../_util/gapSize';\nimport { ConfigContext } from '../config-provider';\nimport Compact from './Compact';\nimport { SpaceContextProvider } from './context';\nimport Item from './Item';\nimport useStyle from './style';\nexport { SpaceContext } from './context';\nconst InternalSpace = /*#__PURE__*/React.forwardRef((props, ref) => {\n var _a, _b, _c;\n const {\n getPrefixCls,\n space,\n direction: directionConfig\n } = React.useContext(ConfigContext);\n const {\n size = (_a = space === null || space === void 0 ? void 0 : space.size) !== null && _a !== void 0 ? _a : 'small',\n align,\n className,\n rootClassName,\n children,\n direction = 'horizontal',\n prefixCls: customizePrefixCls,\n split,\n style,\n wrap = false,\n classNames: customClassNames,\n styles\n } = props,\n otherProps = __rest(props, [\"size\", \"align\", \"className\", \"rootClassName\", \"children\", \"direction\", \"prefixCls\", \"split\", \"style\", \"wrap\", \"classNames\", \"styles\"]);\n const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];\n const isPresetVerticalSize = isPresetSize(verticalSize);\n const isPresetHorizontalSize = isPresetSize(horizontalSize);\n const isValidVerticalSize = isValidGapNumber(verticalSize);\n const isValidHorizontalSize = isValidGapNumber(horizontalSize);\n const childNodes = toArray(children, {\n keepEmpty: true\n });\n const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;\n const prefixCls = getPrefixCls('space', customizePrefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const cls = classNames(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {\n [`${prefixCls}-rtl`]: directionConfig === 'rtl',\n [`${prefixCls}-align-${mergedAlign}`]: mergedAlign,\n [`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,\n [`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize\n }, className, rootClassName, cssVarCls);\n const itemClassName = classNames(`${prefixCls}-item`, (_b = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _b !== void 0 ? _b : (_c = space === null || space === void 0 ? void 0 : space.classNames) === null || _c === void 0 ? void 0 : _c.item);\n // Calculate latest one\n let latestIndex = 0;\n const nodes = childNodes.map((child, i) => {\n var _a, _b;\n if (child !== null && child !== undefined) {\n latestIndex = i;\n }\n const key = (child === null || child === void 0 ? void 0 : child.key) || `${itemClassName}-${i}`;\n return /*#__PURE__*/React.createElement(Item, {\n className: itemClassName,\n key: key,\n index: i,\n split: split,\n style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item\n }, child);\n });\n const spaceContext = React.useMemo(() => ({\n latestIndex\n }), [latestIndex]);\n // =========================== Render ===========================\n if (childNodes.length === 0) {\n return null;\n }\n const gapStyle = {};\n if (wrap) {\n gapStyle.flexWrap = 'wrap';\n }\n if (!isPresetHorizontalSize && isValidHorizontalSize) {\n gapStyle.columnGap = horizontalSize;\n }\n if (!isPresetVerticalSize && isValidVerticalSize) {\n gapStyle.rowGap = verticalSize;\n }\n return wrapCSSVar( /*#__PURE__*/React.createElement(\"div\", Object.assign({\n ref: ref,\n className: cls,\n style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)\n }, otherProps), /*#__PURE__*/React.createElement(SpaceContextProvider, {\n value: spaceContext\n }, nodes)));\n});\nconst Space = InternalSpace;\nSpace.Compact = Compact;\nif (process.env.NODE_ENV !== 'production') {\n Space.displayName = 'Space';\n}\nexport default Space;"],"mappings":"AAAA,YAAY;;AAEZ,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC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