@mikezimm/npmfunctions
Version:
Functions used in my SPFx webparts
142 lines • 8.24 kB
JavaScript
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var links = __importStar(require("../../../Links/AllLinks"));
var office_ui_fabric_react_1 = require("office-ui-fabric-react");
var WebPartLinks = /** @class */ (function (_super) {
__extends(WebPartLinks, _super);
/***
* .o88b. .d88b. d8b db .d8888. d888888b d8888b. db db .o88b. d888888b .d88b. d8888b.
* d8P Y8 .8P Y8. 888o 88 88' YP `~~88~~' 88 `8D 88 88 d8P Y8 `~~88~~' .8P Y8. 88 `8D
* 8P 88 88 88V8o 88 `8bo. 88 88oobY' 88 88 8P 88 88 88 88oobY'
* 8b 88 88 88 V8o88 `Y8b. 88 88`8b 88 88 8b 88 88 88 88`8b
* Y8b d8 `8b d8' 88 V888 db 8D 88 88 `88. 88b d88 Y8b d8 88 `8b d8' 88 `88.
* `Y88P' `Y88P' VP V8P `8888Y' YP 88 YD ~Y8888P' `Y88P' YP `Y88P' 88 YD
*
*
*/
function WebPartLinks(props) {
var _this = _super.call(this, props) || this;
_this.parentListURL = _this.props.parentListURL;
_this.parentListName = _this.props.parentListName;
_this.childListURL = _this.props.childListURL;
_this.childListName = _this.props.childListName;
_this.state = {
selectedChoice: 'About',
lastChoice: '',
};
return _this;
}
// public componentDidMount() { }
/***
* d8888b. d888888b d8888b. db db d8888b. d8888b. .d8b. d888888b d88888b
* 88 `8D `88' 88 `8D 88 88 88 `8D 88 `8D d8' `8b `~~88~~' 88'
* 88 88 88 88 88 88 88 88oodD' 88 88 88ooo88 88 88ooooo
* 88 88 88 88 88 88 88 88~~~ 88 88 88~~~88 88 88~~~~~
* 88 .8D .88. 88 .8D 88b d88 88 88 .8D 88 88 88 88.
* Y8888D' Y888888P Y8888D' ~Y8888P' 88 Y8888D' YP YP YP Y88888P
*
*
*/
// public componentDidUpdate(prevProps : any){ }
/***
* d8888b. d88888b d8b db d8888b. d88888b d8888b.
* 88 `8D 88' 888o 88 88 `8D 88' 88 `8D
* 88oobY' 88ooooo 88V8o 88 88 88 88ooooo 88oobY'
* 88`8b 88~~~~~ 88 V8o88 88 88 88~~~~~ 88`8b
* 88 `88. 88. 88 V888 88 .8D 88. 88 `88.
* 88 YD Y88888P VP V8P Y8888D' Y88888P 88 YD
*
*
*/
WebPartLinks.prototype.render = function () {
/***
* d888888b db db d888888b .d8888. d8888b. .d8b. d888b d88888b
* `~~88~~' 88 88 `88' 88' YP 88 `8D d8' `8b 88' Y8b 88'
* 88 88ooo88 88 `8bo. 88oodD' 88ooo88 88 88ooooo
* 88 88~~~88 88 `Y8b. 88~~~ 88~~~88 88 ooo 88~~~~~
* 88 88 88 .88. db 8D 88 88 88 88. ~8~ 88.
* YP YP YP Y888888P `8888Y' 88 YP YP Y888P Y88888P
*
*
*/
var stackTokensBody = { childrenGap: 20 };
var thisPage = null;
var doParentList = this.parentListURL && this.parentListName && this.parentListURL.length > 0 && this.parentListName.length > 0 ? true : false;
var doChildList = this.childListURL && this.childListName && this.childListURL.length > 0 && this.childListName.length > 0 ? true : false;
var parentListURL = doParentList ? links.createLink(this.parentListURL, '_blank', this.parentListName) : null;
var childListURL = doChildList ? links.createLink(this.childListURL, '_blank', this.childListName) : null;
var showLists = doParentList === true || doChildList === true ? true : false;
var webpartInfo = this.props.showRepoLinks === true ? React.createElement("div", null,
this.props.repoObject ? React.createElement("div", { style: { paddingLeft: doChildList === true ? '30px' : '' } },
React.createElement("b", null, "Webpart info:")) : null,
this.props.repoObject ? this.props.repoObject.repo : null,
this.props.repoObject ? this.props.repoObject.issues : null,
this.props.repoObject ? this.props.repoObject.wiki : null)
: React.createElement("div", null);
thisPage = React.createElement("div", { style: { paddingTop: '30px' } },
React.createElement(office_ui_fabric_react_1.Stack, { horizontal: true, wrap: true, horizontalAlign: "stretch", tokens: stackTokensBody },
(showLists === true ? React.createElement("div", null,
React.createElement("b", null, "Your Lists:")) : null),
(doParentList === true ? parentListURL : null),
(doChildList === true ? childListURL : null),
(showLists === true ? React.createElement("span", { style: { width: '30px' } }, " ") : null),
this.props.repoObject && this.props.showRepoLinks === true ? React.createElement("div", { style: { paddingLeft: doChildList === true ? '30px' : '' } },
React.createElement("b", null, "Webpart info:")) : null,
this.props.repoObject && this.props.showRepoLinks === true ? this.props.repoObject.repo : null,
this.props.repoObject && this.props.showRepoLinks === true ? this.props.repoObject.issues : null,
this.props.repoObject && this.props.showRepoLinks === true ? this.props.repoObject.wiki : null));
/***
* d8888b. d88888b d888888b db db d8888b. d8b db
* 88 `8D 88' `~~88~~' 88 88 88 `8D 888o 88
* 88oobY' 88ooooo 88 88 88 88oobY' 88V8o 88
* 88`8b 88~~~~~ 88 88 88 88`8b 88 V8o88
* 88 `88. 88. 88 88b d88 88 `88. 88 V888
* 88 YD Y88888P YP ~Y8888P' 88 YD VP V8P
*
*
*/
return (thisPage);
};
return WebPartLinks;
}(React.Component));
exports.default = WebPartLinks;
//# sourceMappingURL=WebPartLinks.js.map