{"version":3,"file":"style-helper.mjs","names":[],"sources":["../../../../../../../packages/components/table-v2/src/renderers/style-helper.ts"],"sourcesContent":["import { isString } from '@vue/shared'\nimport { tryCall } from '../utils'\n\nimport type { CSSProperties } from 'vue'\n\nconst parseStyleString = (styleStr: string): CSSProperties => {\n  const div = document.createElement('div')\n  div.setAttribute('style', styleStr)\n  const styleObj = div.style\n  const result: CSSProperties = {}\n\n  for (let i = 0; i < styleObj.length; i++) {\n    const propName = styleObj[i]\n    const propValue = styleObj.getPropertyValue(propName)\n    if (propValue) {\n      result[propName] = propValue\n    }\n  }\n  return result\n}\n\nexport const combineStyles = (\n  tStyle: CSSProperties,\n  customerStyle: any,\n  params: any\n): CSSProperties => {\n  let cusStyle: string | CSSProperties = tryCall(customerStyle, params, {})\n  if (isString(cusStyle)) {\n    cusStyle = parseStyleString(cusStyle)\n  }\n  if (cusStyle) {\n    return { ...tStyle, ...(cusStyle as CSSProperties) }\n  } else {\n    return tStyle\n  }\n}\n"],"mappings":";;;AAKA,MAAM,oBAAoB,aAAoC;CAC5D,MAAM,MAAM,SAAS,cAAc,KAAK;CACxC,IAAI,aAAa,SAAS,QAAQ;CAClC,MAAM,WAAW,IAAI;CACrB,MAAM,SAAwB,CAAC;CAE/B,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,WAAW,SAAS;EAC1B,MAAM,YAAY,SAAS,iBAAiB,QAAQ;EACpD,IAAI,WACF,OAAO,YAAY;CAEvB;CACA,OAAO;AACT;AAEA,MAAa,iBACX,QACA,eACA,WACkB;CAClB,IAAI,WAAmC,QAAQ,eAAe,QAAQ,CAAC,CAAC;CACxE,IAAI,SAAS,QAAQ,GACnB,WAAW,iBAAiB,QAAQ;CAEtC,IAAI,UACF,OAAO;EAAE,GAAG;EAAQ,GAAI;CAA2B;MAEnD,OAAO;AAEX"}