{"version":3,"file":"index.es.min.js","sources":["../../../packages/helpers/src/props.helpers.js","../../../packages/components/src/layout-cards/layout-cards.js"],"sourcesContent":["const getData = attributes => attributes.find(attribute => attribute.nodeName === 'data')\n\nconst createProps = attributes => {\n const data = getData([...attributes])\n const props = [...attributes]\n .filter(attribute => attribute.nodeName !== 'data')\n .reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n if (isNil(data)) {\n return props\n }\n\n try {\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log('ERROR: No data', error, data?.nodeValue)\n }\n}\n\nconst isNil = obj => obj === undefined || obj === null\n\nexport const parseBool = value => (!value || value === 'false' ? false : true)\n\nexport default createProps\n","import createProps from '@kissui/helpers/src/props.helpers'\n\nclass LayoutCards extends HTMLElement {\n constructor() {\n super()\n this.slot = this.innerHTML\n }\n\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.classList.add('nb-layout-cards')\n this.render()\n }\n\n render() {\n const { layout } = this.props\n const slot = this.slot\n\n this.innerHTML = `\n <nb-container\n element_class=\"nb-layout-cards-inner\"\n contrast=\"${layout.contrast}\"\n background_color=\"${layout.background_color}\"\n classname='${layout.padding_top} ${layout.padding_bottom}'\n >\n ${slot}\n </nb-container>\n `\n }\n}\n\ncustomElements.get('nb-layout-cards') || customElements.define('nb-layout-cards', LayoutCards)\n\nexport default LayoutCards\n"],"names":["isNil","obj","LayoutCards","HTMLElement","constructor","this","slot","innerHTML","connectedCallback","props","attributes","data","find","attribute","nodeName","getData","filter","reduce","all","attr","nodeValue","JSON","parse","error","console","log","createProps","classList","add","render","layout","contrast","background_color","padding_top","padding_bottom","customElements","get","define"],"mappings":"AAAA,MAqBMA,EAAQC,GAAoC,MAARA,ECnB1C,MAAMC,UAAoBC,YACtBC,WAAAA,WAEIC,KAAKC,KAAOD,KAAKE,SACrB,CAEAC,iBAAAA,GACSC,KAAAA,MDPOC,CAAAA,IACVC,MAAAA,EAHMD,CAAAA,GAAcA,EAAWE,MAAKC,GAAoC,SAAvBA,EAAUC,WAGpDC,CAAQ,IAAIL,IACnBD,EAAQ,IAAIC,GACbM,QAAOH,GAAoC,SAAvBA,EAAUC,WAC9BG,QAAO,CAACC,EAAKC,KACH,IAAKD,EAAK,CAACC,EAAKL,UAAWK,EAAKC,aACxC,CAAE,GAET,GAAIpB,EAAMW,GACCF,OAAAA,EAGP,IACO,MAAA,IAAKA,KAAUY,KAAKC,MAAMX,EAAKS,WACzC,OAAQG,GACLC,QAAQC,IAAI,iBAAkBF,EAAOZ,GAAMS,UAC/C,GCTiBM,CAAYrB,KAAKK,YAC9BL,KAAKsB,UAAUC,IAAI,mBACnBvB,KAAKwB,QACT,CAEAA,MAAAA,GACU,MAAEC,OAAAA,GAAWzB,KAAKI,MAClBH,EAAOD,KAAKC,KAElBD,KAAKE,UAAY,iHAGGuB,EAAOC,gDACCD,EAAOE,iDACdF,EAAOG,eAAeH,EAAOI,iDAE1C5B,0CAGZ,EAGJ6B,eAAeC,IAAI,oBAAsBD,eAAeE,OAAO,kBAAmBnC"}