/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define([ "sap/ui/core/Renderer", "sap/ui/core/library", "sap/ui/Device", "./library", "./ListItemBaseRenderer", "./Label", "sap/base/Log", "sap/base/security/encodeXML" ], function(Renderer, coreLibrary, Device, library, ListItemBaseRenderer, Label, Log, encodeXML) { "use strict"; // shortcut for sap.m.PopinDisplay var PopinDisplay = library.PopinDisplay; // shortcut for sap.ui.core.VerticalAlign var VerticalAlign = coreLibrary.VerticalAlign; // shortcut for sap.m.PopinLayout var PopinLayout = library.PopinLayout; /** * ColumnListItem renderer. * @namespace */ var ColumnListItemRenderer = Renderer.extend(ListItemBaseRenderer); ColumnListItemRenderer.render = function(rm, oLI) { var oTable = oLI.getTable(); if (!oTable) { return; } ListItemBaseRenderer.render.apply(this, arguments); if (oLI.getVisible() && oTable.hasPopin()) { this.renderPopin(rm, oLI, oTable); } }; // render type highlight always within a cell ColumnListItemRenderer.renderHighlight = function(rm, oLI) { rm.write('
'); }; // render type content always within a cell ColumnListItemRenderer.renderType = function(rm, oLI) { rm.write(' '); }; // wrap mode content with a cell ColumnListItemRenderer.renderModeContent = function(rm, oLI) { rm.write(' '); }; // ColumnListItem does not respect counter property of the LIB ColumnListItemRenderer.renderCounter = function(rm, oLI) { }; // Returns aria accessibility role ColumnListItemRenderer.getAriaRole = function(oLI) { return ""; }; /** * Renders the HTML for the given control, using the provided * {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} * oRenderManager the RenderManager that can be used for writing to * the Render-Output-Buffer * @param {sap.ui.core.Control} * oControl an object representation of the control that should be * rendered */ ColumnListItemRenderer.renderLIAttributes = function(rm, oLI) { rm.addClass("sapMListTblRow"); var vAlign = oLI.getVAlign(); if (vAlign != VerticalAlign.Inherit) { rm.addClass("sapMListTblRow" + vAlign); } var oTable = oLI.getTable(); if (oTable && oTable.getAlternateRowColors()) { var iPos = oTable.indexOfItem(oLI); if (iPos % 2 == 0) { rm.addClass("sapMListTblRowAlternate"); } } }; /** * Overwriting hook method of ListItemBase * * @public * * @param {sap.ui.core.RenderManager} rm RenderManager * @param {sap.m.ListItemBase} oLI List item */ ColumnListItemRenderer.renderLIContentWrapper = function(rm, oLI) { var oTable = oLI.getTable(); if (!oTable) { return; } var aColumns = oTable.getColumns(true), aCells = oLI.getCells(); // remove cloned headers oLI._destroyClonedHeaders(); aColumns.forEach(function(oColumn, i) { var cls, oHeader, bRenderCell = true, oCell = aCells[oColumn.getInitialOrder()]; if (!oCell || !oColumn.getVisible() || oColumn.isPopin()) { // update the visible index of the column oColumn.setIndex(-1); return; } rm.write("