{"version":3,"file":"getLabelProps.mjs","sources":[""],"sourcesContent":["import type { ILabelProps, IGetLabelPropsParams } from \"../config/types\";\r\n\r\n/**\r\n * Получает свойства для компонента `Label`\r\n * @param {IGetLabelPropsParams} params - Параметры для получения свойств `label`\r\n * @returns {ILabelProps} Объект со свойствами для `Label`:\r\n */\r\nexport const getLabelProps = ({\r\n  label,\r\n  comp,\r\n  input,\r\n}: IGetLabelPropsParams = {}): ILabelProps => {\r\n  const getHtmlFor = (): string => {\r\n    if (label && typeof label === \"object\" && label.htmlFor) {\r\n      return label.htmlFor;\r\n    }\r\n    if (comp) {\r\n      return \"\";\r\n    }\r\n    if (input) {\r\n      return input.id || input.name || \"\";\r\n    }\r\n    return \"\";\r\n  };\r\n\r\n  return {\r\n    label: typeof label === \"string\" ? label : (label?.label ?? \"\"),\r\n    htmlFor: getHtmlFor(),\r\n  };\r\n};\r\n"],"names":["getLabelProps","label","comp","input","getHtmlFor","htmlFor","id","name"],"mappings":";;;;;AAOO,MAAMA,cAAgB,EAC3BC,YACAC,UACAC,aACwB,MACxB,MAAMC,WAAa,KACjB,GAAIH,cAAgBA,QAAU,UAAYA,MAAMI,QAC9C,OAAOJ,MAAMI,QAEf,GAAIH,KACF,MAAO,GAET,GAAIC,MACF,OAAOA,MAAMG,IAAMH,MAAMI,MAAQ,GAEnC,MAAO,IAGT,MAAO,CACLN,aAAcA,QAAU,SAAWA,MAASA,OAAOA,OAAS,GAC5DI,QAASD"}