UNPKG

gd-sprest-js

Version:

SharePoint 2013/Online js components.

32 lines (31 loc) 948 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _1 = require("."); /** * Command Bar */ exports.CommandBar = function (props) { // Render the button var renderButtons = function (buttonProps) { if (buttonProps === void 0) { buttonProps = []; } var buttons = []; // Parse the buttons for (var i = 0; i < buttonProps.length; i++) { // Add the button buttons.push(_1.CommandButton(buttonProps[i])); } // Return the buttons return buttons.join('\n'); }; // Return the template return [ '<div class="ms-CommandBar ' + (props.className || "") + '">', '<div class="ms-CommandBar-sideCommands">', renderButtons(props.sideCommands), '</div>', '<div class="ms-CommandBar-mainArea">', renderButtons(props.mainCommands), '</div>', '</div>' ].join('\n'); };