41688012d76c242e664a005b48a3ca34.json
3.93 KB
{"ast":null,"code":"import * as React from 'react';\nimport { getRawValueLabeled } from '../utils/valueUtil';\nimport { formatStrategyKeys } from '../utils/strategyUtil';\n/** Return */\n\nexport default function useSelectValues(rawValues, _ref) {\n var value = _ref.value,\n getEntityByValue = _ref.getEntityByValue,\n getEntityByKey = _ref.getEntityByKey,\n treeConduction = _ref.treeConduction,\n showCheckedStrategy = _ref.showCheckedStrategy,\n conductKeyEntities = _ref.conductKeyEntities,\n getLabelProp = _ref.getLabelProp;\n return React.useMemo(function () {\n var mergedRawValues = rawValues;\n\n if (treeConduction) {\n var rawKeys = formatStrategyKeys(rawValues.map(function (val) {\n var entity = getEntityByValue(val);\n return entity ? entity.key : val;\n }), showCheckedStrategy, conductKeyEntities);\n mergedRawValues = rawKeys.map(function (key) {\n var entity = getEntityByKey(key);\n return entity ? entity.data.value : key;\n });\n }\n\n return getRawValueLabeled(mergedRawValues, value, getEntityByValue, getLabelProp);\n }, [rawValues, value, treeConduction, showCheckedStrategy, getEntityByValue]);\n}","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-tree-select/es/hooks/useSelectValues.js"],"names":["React","getRawValueLabeled","formatStrategyKeys","useSelectValues","rawValues","_ref","value","getEntityByValue","getEntityByKey","treeConduction","showCheckedStrategy","conductKeyEntities","getLabelProp","useMemo","mergedRawValues","rawKeys","map","val","entity","key","data"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,kBAAT,QAAmC,oBAAnC;AACA,SAASC,kBAAT,QAAmC,uBAAnC;AACA;;AAEA,eAAe,SAASC,eAAT,CAAyBC,SAAzB,EAAoCC,IAApC,EAA0C;AACvD,MAAIC,KAAK,GAAGD,IAAI,CAACC,KAAjB;AAAA,MACIC,gBAAgB,GAAGF,IAAI,CAACE,gBAD5B;AAAA,MAEIC,cAAc,GAAGH,IAAI,CAACG,cAF1B;AAAA,MAGIC,cAAc,GAAGJ,IAAI,CAACI,cAH1B;AAAA,MAIIC,mBAAmB,GAAGL,IAAI,CAACK,mBAJ/B;AAAA,MAKIC,kBAAkB,GAAGN,IAAI,CAACM,kBAL9B;AAAA,MAMIC,YAAY,GAAGP,IAAI,CAACO,YANxB;AAOA,SAAOZ,KAAK,CAACa,OAAN,CAAc,YAAY;AAC/B,QAAIC,eAAe,GAAGV,SAAtB;;AAEA,QAAIK,cAAJ,EAAoB;AAClB,UAAIM,OAAO,GAAGb,kBAAkB,CAACE,SAAS,CAACY,GAAV,CAAc,UAAUC,GAAV,EAAe;AAC5D,YAAIC,MAAM,GAAGX,gBAAgB,CAACU,GAAD,CAA7B;AACA,eAAOC,MAAM,GAAGA,MAAM,CAACC,GAAV,GAAgBF,GAA7B;AACD,OAHgC,CAAD,EAG5BP,mBAH4B,EAGPC,kBAHO,CAAhC;AAIAG,MAAAA,eAAe,GAAGC,OAAO,CAACC,GAAR,CAAY,UAAUG,GAAV,EAAe;AAC3C,YAAID,MAAM,GAAGV,cAAc,CAACW,GAAD,CAA3B;AACA,eAAOD,MAAM,GAAGA,MAAM,CAACE,IAAP,CAAYd,KAAf,GAAuBa,GAApC;AACD,OAHiB,CAAlB;AAID;;AAED,WAAOlB,kBAAkB,CAACa,eAAD,EAAkBR,KAAlB,EAAyBC,gBAAzB,EAA2CK,YAA3C,CAAzB;AACD,GAfM,EAeJ,CAACR,SAAD,EAAYE,KAAZ,EAAmBG,cAAnB,EAAmCC,mBAAnC,EAAwDH,gBAAxD,CAfI,CAAP;AAgBD","sourcesContent":["import * as React from 'react';\nimport { getRawValueLabeled } from '../utils/valueUtil';\nimport { formatStrategyKeys } from '../utils/strategyUtil';\n/** Return */\n\nexport default function useSelectValues(rawValues, _ref) {\n var value = _ref.value,\n getEntityByValue = _ref.getEntityByValue,\n getEntityByKey = _ref.getEntityByKey,\n treeConduction = _ref.treeConduction,\n showCheckedStrategy = _ref.showCheckedStrategy,\n conductKeyEntities = _ref.conductKeyEntities,\n getLabelProp = _ref.getLabelProp;\n return React.useMemo(function () {\n var mergedRawValues = rawValues;\n\n if (treeConduction) {\n var rawKeys = formatStrategyKeys(rawValues.map(function (val) {\n var entity = getEntityByValue(val);\n return entity ? entity.key : val;\n }), showCheckedStrategy, conductKeyEntities);\n mergedRawValues = rawKeys.map(function (key) {\n var entity = getEntityByKey(key);\n return entity ? entity.data.value : key;\n });\n }\n\n return getRawValueLabeled(mergedRawValues, value, getEntityByValue, getLabelProp);\n }, [rawValues, value, treeConduction, showCheckedStrategy, getEntityByValue]);\n}"]},"metadata":{},"sourceType":"module"}