@ecomplus/utils
Version:
JS utility functions to E-Com Plus (not only) related apps
23 lines • 837 B
TypeScript
export default gridTitle;
/**
* @method
* @memberof ecomUtils
* @name gridTitle
* @description Returns grid title by grid ID and lang.
* @param {string} gridId - The unique ID of the grid ('colors', 'size'...)
* @param {Array} grids - List of grid objects
* @param {string} [lang=$ecomConfig.get('lang')] - Snake case language code, eg.: 'en_us', 'pt_br'
* @returns {string}
*
* @example
* const gridId = 'canais'
* const grid1 = {title: 'Canais', grid_id: 'canais'}
* const grid2 = {title: 'Cores', grid_id: 'colors'}
* const grid3 = {title: 'Tamanho', grid_id: 'size'}
* const grids = [ grid1, grid2, grid3 ]
* const lang = 'pt_br'
* ecomUtils.gridTitle(gridId, grids, lang)
* // => "Canais"
*/
declare function gridTitle(gridId: string, grids: any[], lang?: string): string;
//# sourceMappingURL=grid-title.d.ts.map