1 line
12 KiB
JSON
1 line
12 KiB
JSON
{"ast":null,"code":"\"use client\";\n\nimport React from 'react';\nimport HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport initCollapseMotion from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport SwitcherIconCom from './utils/iconUtil';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n var _a;\n const {\n getPrefixCls,\n direction,\n virtual,\n tree\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n className,\n showIcon = false,\n showLine,\n switcherIcon,\n switcherLoadingIcon,\n blockNode = false,\n children,\n checkable = false,\n selectable = true,\n draggable,\n motion: customMotion,\n style\n } = props;\n const prefixCls = getPrefixCls('tree', customizePrefixCls);\n const rootPrefixCls = getPrefixCls();\n const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n motionAppear: false\n });\n const newProps = Object.assign(Object.assign({}, props), {\n checkable,\n selectable,\n showIcon,\n motion,\n blockNode,\n showLine: Boolean(showLine),\n dropIndicatorRender\n });\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const [, token] = useToken();\n const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);\n const draggableConfig = React.useMemo(() => {\n if (!draggable) {\n return false;\n }\n let mergedDraggable = {};\n switch (typeof draggable) {\n case 'function':\n mergedDraggable.nodeDraggable = draggable;\n break;\n case 'object':\n mergedDraggable = Object.assign({}, draggable);\n break;\n default:\n break;\n // Do nothing\n }\n if (mergedDraggable.icon !== false) {\n mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n }\n return mergedDraggable;\n }, [draggable]);\n const renderSwitcherIcon = nodeProps => ( /*#__PURE__*/React.createElement(SwitcherIconCom, {\n prefixCls: prefixCls,\n switcherIcon: switcherIcon,\n switcherLoadingIcon: switcherLoadingIcon,\n treeNodeProps: nodeProps,\n showLine: showLine\n }));\n return wrapCSSVar( /*#__PURE__*/\n // @ts-ignore\n React.createElement(RcTree, Object.assign({\n itemHeight: itemHeight,\n ref: ref,\n virtual: virtual\n }, newProps, {\n // newProps may contain style so declare style below it\n style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),\n prefixCls: prefixCls,\n className: classNames({\n [`${prefixCls}-icon-hide`]: !showIcon,\n [`${prefixCls}-block-node`]: blockNode,\n [`${prefixCls}-unselectable`]: !selectable,\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),\n direction: direction,\n checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-checkbox-inner`\n }) : checkable,\n selectable: selectable,\n switcherIcon: renderSwitcherIcon,\n draggable: draggableConfig\n }), children));\n});\nif (process.env.NODE_ENV !== 'production') {\n Tree.displayName = 'Tree';\n}\nexport default Tree;","map":{"version":3,"names":["React","HolderOutlined","classNames","RcTree","initCollapseMotion","ConfigContext","useToken","useStyle","dropIndicatorRender","SwitcherIconCom","Tree","forwardRef","props","ref","_a","getPrefixCls","direction","virtual","tree","useContext","prefixCls","customizePrefixCls","className","showIcon","showLine","switcherIcon","switcherLoadingIcon","blockNode","children","checkable","selectable","draggable","motion","customMotion","style","rootPrefixCls","Object","assign","motionAppear","newProps","Boolean","wrapCSSVar","hashId","cssVarCls","token","itemHeight","paddingXS","titleHeight","controlHeightSM","draggableConfig","useMemo","mergedDraggable","nodeDraggable","icon","createElement","renderSwitcherIcon","nodeProps","treeNodeProps","process","env","NODE_ENV","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/antd/es/tree/Tree.js"],"sourcesContent":["\"use client\";\n\nimport React from 'react';\nimport HolderOutlined from \"@ant-design/icons/es/icons/HolderOutlined\";\nimport classNames from 'classnames';\nimport RcTree from 'rc-tree';\nimport initCollapseMotion from '../_util/motion';\nimport { ConfigContext } from '../config-provider';\nimport { useToken } from '../theme/internal';\nimport useStyle from './style';\nimport dropIndicatorRender from './utils/dropIndicator';\nimport SwitcherIconCom from './utils/iconUtil';\nconst Tree = /*#__PURE__*/React.forwardRef((props, ref) => {\n var _a;\n const {\n getPrefixCls,\n direction,\n virtual,\n tree\n } = React.useContext(ConfigContext);\n const {\n prefixCls: customizePrefixCls,\n className,\n showIcon = false,\n showLine,\n switcherIcon,\n switcherLoadingIcon,\n blockNode = false,\n children,\n checkable = false,\n selectable = true,\n draggable,\n motion: customMotion,\n style\n } = props;\n const prefixCls = getPrefixCls('tree', customizePrefixCls);\n const rootPrefixCls = getPrefixCls();\n const motion = customMotion !== null && customMotion !== void 0 ? customMotion : Object.assign(Object.assign({}, initCollapseMotion(rootPrefixCls)), {\n motionAppear: false\n });\n const newProps = Object.assign(Object.assign({}, props), {\n checkable,\n selectable,\n showIcon,\n motion,\n blockNode,\n showLine: Boolean(showLine),\n dropIndicatorRender\n });\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);\n const [, token] = useToken();\n const itemHeight = token.paddingXS / 2 + (((_a = token.Tree) === null || _a === void 0 ? void 0 : _a.titleHeight) || token.controlHeightSM);\n const draggableConfig = React.useMemo(() => {\n if (!draggable) {\n return false;\n }\n let mergedDraggable = {};\n switch (typeof draggable) {\n case 'function':\n mergedDraggable.nodeDraggable = draggable;\n break;\n case 'object':\n mergedDraggable = Object.assign({}, draggable);\n break;\n default:\n break;\n // Do nothing\n }\n if (mergedDraggable.icon !== false) {\n mergedDraggable.icon = mergedDraggable.icon || /*#__PURE__*/React.createElement(HolderOutlined, null);\n }\n return mergedDraggable;\n }, [draggable]);\n const renderSwitcherIcon = nodeProps => ( /*#__PURE__*/React.createElement(SwitcherIconCom, {\n prefixCls: prefixCls,\n switcherIcon: switcherIcon,\n switcherLoadingIcon: switcherLoadingIcon,\n treeNodeProps: nodeProps,\n showLine: showLine\n }));\n return wrapCSSVar(\n /*#__PURE__*/\n // @ts-ignore\n React.createElement(RcTree, Object.assign({\n itemHeight: itemHeight,\n ref: ref,\n virtual: virtual\n }, newProps, {\n // newProps may contain style so declare style below it\n style: Object.assign(Object.assign({}, tree === null || tree === void 0 ? void 0 : tree.style), style),\n prefixCls: prefixCls,\n className: classNames({\n [`${prefixCls}-icon-hide`]: !showIcon,\n [`${prefixCls}-block-node`]: blockNode,\n [`${prefixCls}-unselectable`]: !selectable,\n [`${prefixCls}-rtl`]: direction === 'rtl'\n }, tree === null || tree === void 0 ? void 0 : tree.className, className, hashId, cssVarCls),\n direction: direction,\n checkable: checkable ? /*#__PURE__*/React.createElement(\"span\", {\n className: `${prefixCls}-checkbox-inner`\n }) : checkable,\n selectable: selectable,\n switcherIcon: renderSwitcherIcon,\n draggable: draggableConfig\n }), children));\n});\nif (process.env.NODE_ENV !== 'production') {\n Tree.displayName = 'Tree';\n}\nexport default Tree;"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,cAAc,MAAM,2CAA2C;AACtE,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAM,SAAS;AAC5B,OAAOC,kBAAkB,MAAM,iBAAiB;AAChD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,OAAOC,QAAQ,MAAM,SAAS;AAC9B,OAAOC,mBAAmB,MAAM,uBAAuB;AACvD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,MAAMC,IAAI,GAAG,aAAaV,KAAK,CAACW,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACzD,IAAIC,EAAE;EACN,MAAM;IACJC,YAAY;IACZC,SAAS;IACTC,OAAO;IACPC;EACF,CAAC,GAAGlB,KAAK,CAACmB,UAAU,C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