PromoCursed/node_modules/.cache/babel-loader/9fbeb9e2a9515eb40f3f4c27be2883da5e29a4f2827790797f5b3f4df6668a74.json

1 line
6.8 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import { SHOW_CHILD } from \"./commonUtil\";\nexport function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {\n var valueSet = new Set(pathKeys);\n var keyPathEntities = getKeyPathEntities();\n return pathKeys.filter(function (key) {\n var entity = keyPathEntities[key];\n var parent = entity ? entity.parent : null;\n var children = entity ? entity.children : null;\n if (entity && entity.node.disabled) {\n return true;\n }\n return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {\n return child.key && valueSet.has(child.key);\n })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));\n });\n}\nexport function toPathOptions(valueCells, options, fieldNames) {\n var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var currentList = options;\n var valueOptions = [];\n var _loop = function _loop() {\n var _currentList, _currentList2, _foundOption$fieldNam;\n var valueCell = valueCells[i];\n var foundIndex = (_currentList = currentList) === null || _currentList === void 0 ? void 0 : _currentList.findIndex(function (option) {\n var val = option[fieldNames.value];\n return stringMode ? String(val) === String(valueCell) : val === valueCell;\n });\n var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _currentList2 === void 0 ? void 0 : _currentList2[foundIndex] : null;\n valueOptions.push({\n value: (_foundOption$fieldNam = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.value]) !== null && _foundOption$fieldNam !== void 0 ? _foundOption$fieldNam : valueCell,\n index: foundIndex,\n option: foundOption\n });\n currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];\n };\n for (var i = 0; i < valueCells.length; i += 1) {\n _loop();\n }\n return valueOptions;\n}","map":{"version":3,"names":["SHOW_CHILD","formatStrategyValues","pathKeys","getKeyPathEntities","showCheckedStrategy","valueSet","Set","keyPathEntities","filter","key","entity","parent","children","node","disabled","some","child","has","toPathOptions","valueCells","options","fieldNames","stringMode","arguments","length","undefined","currentList","valueOptions","_loop","_currentList","_currentList2","_foundOption$fieldNam","valueCell","i","foundIndex","findIndex","option","val","value","String","foundOption","push","index"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-cascader/es/utils/treeUtil.js"],"sourcesContent":["import { SHOW_CHILD } from \"./commonUtil\";\nexport function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedStrategy) {\n var valueSet = new Set(pathKeys);\n var keyPathEntities = getKeyPathEntities();\n return pathKeys.filter(function (key) {\n var entity = keyPathEntities[key];\n var parent = entity ? entity.parent : null;\n var children = entity ? entity.children : null;\n if (entity && entity.node.disabled) {\n return true;\n }\n return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(function (child) {\n return child.key && valueSet.has(child.key);\n })) : !(parent && !parent.node.disabled && valueSet.has(parent.key));\n });\n}\nexport function toPathOptions(valueCells, options, fieldNames) {\n var stringMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var currentList = options;\n var valueOptions = [];\n var _loop = function _loop() {\n var _currentList, _currentList2, _foundOption$fieldNam;\n var valueCell = valueCells[i];\n var foundIndex = (_currentList = currentList) === null || _currentList === void 0 ? void 0 : _currentList.findIndex(function (option) {\n var val = option[fieldNames.value];\n return stringMode ? String(val) === String(valueCell) : val === valueCell;\n });\n var foundOption = foundIndex !== -1 ? (_currentList2 = currentList) === null || _c