PromoCursed/node_modules/.cache/babel-loader/904f4f4531b830ed93f839d065c6b08ebf34b367e545e388e4063b2ac79a42d5.json
2024-08-20 23:25:37 +04:00

1 line
17 KiB
JSON

{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport { useEvent, useMergedState } from 'rc-util';\nimport * as React from 'react';\nimport CascaderContext from \"./context\";\nimport useMissingValues from \"./hooks/useMissingValues\";\nimport useOptions from \"./hooks/useOptions\";\nimport useSelect from \"./hooks/useSelect\";\nimport useValues from \"./hooks/useValues\";\nimport RawOptionList from \"./OptionList/List\";\nimport { fillFieldNames, toRawValues } from \"./utils/commonUtil\";\nimport { toPathOptions } from \"./utils/treeUtil\";\nfunction noop() {}\nexport default function Panel(props) {\n var _ref = props,\n _ref$prefixCls = _ref.prefixCls,\n prefixCls = _ref$prefixCls === void 0 ? 'rc-cascader' : _ref$prefixCls,\n style = _ref.style,\n className = _ref.className,\n options = _ref.options,\n checkable = _ref.checkable,\n defaultValue = _ref.defaultValue,\n value = _ref.value,\n fieldNames = _ref.fieldNames,\n changeOnSelect = _ref.changeOnSelect,\n onChange = _ref.onChange,\n showCheckedStrategy = _ref.showCheckedStrategy,\n loadData = _ref.loadData,\n expandTrigger = _ref.expandTrigger,\n _ref$expandIcon = _ref.expandIcon,\n expandIcon = _ref$expandIcon === void 0 ? '>' : _ref$expandIcon,\n loadingIcon = _ref.loadingIcon,\n direction = _ref.direction,\n _ref$notFoundContent = _ref.notFoundContent,\n notFoundContent = _ref$notFoundContent === void 0 ? 'Not Found' : _ref$notFoundContent;\n\n // ======================== Multiple ========================\n var multiple = !!checkable;\n\n // ========================= Values =========================\n var _useMergedState = useMergedState(defaultValue, {\n value: value,\n postState: toRawValues\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n rawValues = _useMergedState2[0],\n setRawValues = _useMergedState2[1];\n\n // ========================= FieldNames =========================\n var mergedFieldNames = React.useMemo(function () {\n return fillFieldNames(fieldNames);\n }, /* eslint-disable react-hooks/exhaustive-deps */\n [JSON.stringify(fieldNames)]\n /* eslint-enable react-hooks/exhaustive-deps */);\n\n // =========================== Option ===========================\n var _useOptions = useOptions(mergedFieldNames, options),\n _useOptions2 = _slicedToArray(_useOptions, 3),\n mergedOptions = _useOptions2[0],\n getPathKeyEntities = _useOptions2[1],\n getValueByKeyPath = _useOptions2[2];\n\n // ========================= Values =========================\n var getMissingValues = useMissingValues(mergedOptions, mergedFieldNames);\n\n // Fill `rawValues` with checked conduction values\n var _useValues = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues),\n _useValues2 = _slicedToArray(_useValues, 3),\n checkedValues = _useValues2[0],\n halfCheckedValues = _useValues2[1],\n missingCheckedValues = _useValues2[2];\n\n // =========================== Change ===========================\n var triggerChange = useEvent(function (nextValues) {\n setRawValues(nextValues);\n\n // Save perf if no need trigger event\n if (onChange) {\n var nextRawValues = toRawValues(nextValues);\n var valueOptions = nextRawValues.map(function (valueCells) {\n return toPathOptions(valueCells, mergedOptions, mergedFieldNames).map(function (valueOpt) {\n return valueOpt.option;\n });\n });\n var triggerValues = multiple ? nextRawValues : nextRawValues[0];\n var triggerOptions = multiple ? valueOptions : valueOptions[0];\n onChange(triggerValues, triggerOptions);\n }\n });\n\n // =========================== Select ===========================\n var handleSelection = useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);\n var onInternalSelect = useEvent(function (valuePath) {\n handleSelection(valuePath);\n });\n\n // ======================== Context =========================\n var cascaderContext = React.useMemo(function () {\n return {\n options: mergedOptions,\n fieldNames: mergedFieldNames,\n values: checkedValues,\n halfValues: halfCheckedValues,\n changeOnSelect: changeOnSelect,\n onSelect: onInternalSelect,\n checkable: checkable,\n searchOptions: [],\n dropdownPrefixCls: undefined,\n loadData: loadData,\n expandTrigger: expandTrigger,\n expandIcon: expandIcon,\n loadingIcon: loadingIcon,\n dropdownMenuColumnStyle: undefined\n };\n }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, loadData, expandTrigger, expandIcon, loadingIcon]);\n\n // ========================= Render =========================\n var panelPrefixCls = \"\".concat(prefixCls, \"-panel\");\n var isEmpty = !mergedOptions.length;\n return /*#__PURE__*/React.createElement(CascaderContext.Provider, {\n value: cascaderContext\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(panelPrefixCls, _defineProperty(_defineProperty({}, \"\".concat(panelPrefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(panelPrefixCls, \"-empty\"), isEmpty), className),\n style: style\n }, isEmpty ? notFoundContent : /*#__PURE__*/React.createElement(RawOptionList, {\n prefixCls: prefixCls,\n searchValue: \"\",\n multiple: multiple,\n toggleOpen: noop,\n open: true,\n direction: direction\n })));\n}","map":{"version":3,"names":["_defineProperty","_slicedToArray","classNames","useEvent","useMergedState","React","CascaderContext","useMissingValues","useOptions","useSelect","useValues","RawOptionList","fillFieldNames","toRawValues","toPathOptions","noop","Panel","props","_ref","_ref$prefixCls","prefixCls","style","className","options","checkable","defaultValue","value","fieldNames","changeOnSelect","onChange","showCheckedStrategy","loadData","expandTrigger","_ref$expandIcon","expandIcon","loadingIcon","direction","_ref$notFoundContent","notFoundContent","multiple","_useMergedState","postState","_useMergedState2","rawValues","setRawValues","mergedFieldNames","useMemo","JSON","stringify","_useOptions","_useOptions2","mergedOptions","getPathKeyEntities","getValueByKeyPath","getMissingValues","_useValues","_useValues2","checkedValues","halfCheckedValues","missingCheckedValues","triggerChange","nextValues","nextRawValues","valueOptions","map","valueCells","valueOpt","option","triggerValues","triggerOptions","handleSelection","onInternalSelect","valuePath","cascaderContext","values","halfValues","onSelect","searchOptions","dropdownPrefixCls","undefined","dropdownMenuColumnStyle","panelPrefixCls","concat","isEmpty","length","createElement","Provider","searchValue","toggleOpen","open"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-cascader/es/Panel.js"],"sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport classNames from 'classnames';\nimport { useEvent, useMergedState } from 'rc-util';\nimport * as React from 'react';\nimport CascaderContext from \"./context\";\nimport useMissingValues from \"./hooks/useMissingValues\";\nimport useOptions from \"./hooks/useOptions\";\nimport useSelect from \"./hooks/useSelect\";\nimport useValues from \"./hooks/useValues\";\nimport RawOptionList from \"./OptionList/List\";\nimport { fillFieldNames, toRawValues } from \"./utils/commonUtil\";\nimport { toPathOptions } from \"./utils/treeUtil\";\nfunction noop() {}\nexport default function Panel(props) {\n var _ref = props,\n _ref$prefixCls = _ref.prefixCls,\n prefixCls = _ref$prefixCls === void 0 ? 'rc-cascader' : _ref$prefixCls,\n style = _ref.style,\n className = _ref.className,\n options = _ref.options,\n checkable = _ref.checkable,\n defaultValue = _ref.defaultValue,\n value = _ref.value,\n fieldNames = _ref.fieldNames,\n changeOnSelect = _ref.changeOnSelect,\n onChange = _ref.onChange,\n showCheckedStrategy = _ref.showCheckedStrategy,\n loadData = _ref.loadData,\n expandTrigger = _ref.expandTrigger,\n _ref$expandIcon = _ref.expandIcon,\n expandIcon = _ref$expandIcon === void 0 ? '>' : _ref$expandIcon,\n loadingIcon = _ref.loadingIcon,\n direction = _ref.direction,\n _ref$notFoundContent = _ref.notFoundContent,\n notFoundContent = _ref$notFoundContent === void 0 ? 'Not Found' : _ref$notFoundContent;\n\n // ======================== Multiple ========================\n var multiple = !!checkable;\n\n // ========================= Values =========================\n var _useMergedState = useMergedState(defaultValue, {\n value: value,\n postState: toRawValues\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n rawValues = _useMergedState2[0],\n setRawValues = _useMergedState2[1];\n\n // ========================= FieldNames =========================\n var mergedFieldNames = React.useMemo(function () {\n return fillFieldNames(fieldNames);\n }, /* eslint-disable react-hooks/exhaustive-deps */\n [JSON.stringify(fieldNames)]\n /* eslint-enable react-hooks/exhaustive-deps */);\n\n // =========================== Option ===========================\n var _useOptions = useOptions(mergedFieldNames, options),\n _useOptions2 = _slicedToArray(_useOptions, 3),\n mergedOptions = _useOptions2[0],\n getPathKeyEntities = _useOptions2[1],\n getValueByKeyPath = _useOptions2[2];\n\n // ========================= Values =========================\n var getMissingValues = useMissingValues(mergedOptions, mergedFieldNames);\n\n // Fill `rawValues` with checked conduction values\n var _useValues = useValues(multiple, rawValues, getPathKeyEntities, getValueByKeyPath, getMissingValues),\n _useValues2 = _slicedToArray(_useValues, 3),\n checkedValues = _useValues2[0],\n halfCheckedValues = _useValues2[1],\n missingCheckedValues = _useValues2[2];\n\n // =========================== Change ===========================\n var triggerChange = useEvent(function (nextValues) {\n setRawValues(nextValues);\n\n // Save perf if no need trigger event\n if (onChange) {\n var nextRawValues = toRawValues(nextValues);\n var valueOptions = nextRawValues.map(function (valueCells) {\n return toPathOptions(valueCells, mergedOptions, mergedFieldNames).map(function (valueOpt) {\n return valueOpt.option;\n });\n });\n var triggerValues = multiple ? nextRawValues : nextRawValues[0];\n var triggerOptions = multiple ? valueOptions : valueOptions[0];\n onChange(triggerValues, triggerOptions);\n }\n });\n\n // =========================== Select ===========================\n var handleSelection = useSelect(multiple, triggerChange, checkedValues, halfCheckedValues, missingCheckedValues, getPathKeyEntities, getValueByKeyPath, showCheckedStrategy);\n var onInternalSelect = useEvent(function (valuePath) {\n handleSelection(valuePath);\n });\n\n // ======================== Context =========================\n var cascaderContext = React.useMemo(function () {\n return {\n options: mergedOptions,\n fieldNames: mergedFieldNames,\n values: checkedValues,\n halfValues: halfCheckedValues,\n changeOnSelect: changeOnSelect,\n onSelect: onInternalSelect,\n checkable: checkable,\n searchOptions: [],\n dropdownPrefixCls: undefined,\n loadData: loadData,\n expandTrigger: expandTrigger,\n expandIcon: expandIcon,\n loadingIcon: loadingIcon,\n dropdownMenuColumnStyle: undefined\n };\n }, [mergedOptions, mergedFieldNames, checkedValues, halfCheckedValues, changeOnSelect, onInternalSelect, checkable, loadData, expandTrigger, expandIcon, loadingIcon]);\n\n // ========================= Render =========================\n var panelPrefixCls = \"\".concat(prefixCls, \"-panel\");\n var isEmpty = !mergedOptions.length;\n return /*#__PURE__*/React.createElement(CascaderContext.Provider, {\n value: cascaderContext\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: classNames(panelPrefixCls, _defineProperty(_defineProperty({}, \"\".concat(panelPrefixCls, \"-rtl\"), direction === 'rtl'), \"\".concat(panelPrefixCls, \"-empty\"), isEmpty), className),\n style: style\n }, isEmpty ? notFoundContent : /*#__PURE__*/React.createElement(RawOptionList, {\n prefixCls: prefixCls,\n searchValue: \"\",\n multiple: multiple,\n toggleOpen: noop,\n open: true,\n direction: direction\n })));\n}"],"mappings":"AAAA,OAAOA,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,EAAEC,cAAc,QAAQ,SAAS;AAClD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,MAAM,WAAW;AACvC,OAAOC,gBAAgB,MAAM,0BAA0B;AACvD,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,SAAS,MAAM,mBAAmB;AACzC,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,cAAc,EAAEC,WAAW,QAAQ,oBAAoB;AAChE,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,IAAIA,CAAA,EAAG,CAAC;AACjB,eAAe,SAASC,KAAKA,CAACC,KAAK,EAAE;EACnC,IAAIC,IAAI,GAAGD,KAAK;IACdE,cAAc,GAAGD,IAAI,CAACE,SAAS;IAC/BA,SAAS,GAAGD,cAAc,KAAK,KAAK,CAAC,GAAG,aAAa,GAAGA,cAAc;IACtEE,KAAK,GAAGH,IAAI,CAACG,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