sp-dev-fx-webparts/samples/jquery-photopile/lib/webparts/photopileWebPart/components/PhotopileWebPart.js.map

1 line
12 KiB
Plaintext

{"version":3,"sources":["webparts/photopileWebPart/components/PhotopileWebPart.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;GAOG;AACH,6BAA+B;AAC/B,8DAA0E;AAG1E,mCAAqC;AACrC,gFAAqD;AACrD,kEAAiE;AAEjE,2CAA6C;AAE7C,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClB,OAAO,CAAC,UAAU,CAAC,CAAC;AACpB,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACjC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAW3B;;;GAGG;AACH;IAA8C,oCAAwD;IAKpG;;;OAGG;IACH,0BAAY,KAA6B,EAAE,OAAwB;QAAnE,YACE,kBAAM,KAAK,EAAE,OAAO,CAAC,SAQvB;QAPE,kBAAkB;QAClB,KAAI,CAAC,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC;QACnC,0BAA0B;QAC1B,KAAI,CAAC,KAAK,GAAG;YACd,OAAO,EAAE,EAAE;YACR,MAAM,EAAE,KAAK;SAChB,CAAC;;IACH,CAAC;IAAA,CAAC;IAED;;;OAGG;IACI,iCAAM,GAAb;QAEE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC;YAC7D,+BAA+B;YAC/B,MAAM,CAAC,CACL,6BAAK,SAAS,EAAC,eAAe;gBAC5B,6BAAK,SAAS,EAAC,uBAAuB;oBACpC,6BAAK,SAAS,EAAC,oBAAoB;wBACjC,2BAAG,SAAS,EAAC,6BAA6B,GAAK,CAC3C;oBACN,6BAAK,SAAS,EAAC,oBAAoB,IAChC,OAAO,CAAC,eAAe,CACpB,CACF,CACF,CACP,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,C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I,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YACvD,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjD,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;YACjD,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC3D,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC3C,SAAS,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YACzD,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAErD,gBAAgB;YAChB,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAEH,uBAAC;AAAD,CApKA,AAoKC,CApK6C,KAAK,CAAC,SAAS,GAoK5D","file":"webparts/photopileWebPart/components/PhotopileWebPart.js","sourcesContent":["/**\n * @file\n * Photopile Web Part React JSX component.\n *\n * Contains JSX code to render the web part with HTML templates.\n *\n * Author: Olivier Carpentier\n */\nimport * as React from 'react';\nimport { Spinner, SpinnerType } from 'office-ui-fabric-react/lib/Spinner';\nimport { IPhotopileWebPartProps } from '../IPhotopileWebPartProps';\nimport { IWebPartContext } from '@microsoft/sp-webpart-base';\nimport * as strings from 'mystrings';\nimport styles from '../PhotopileWebPart.module.scss';\nimport { SPPicturesListService } from '../SPPicturesListService';\nimport { ISPListItem } from '../ISPList';\nimport * as photopile from 'photopileModule';\n\nrequire('jquery');\nrequire('jqueryui');\nrequire('../css/photopile.scss');\nrequire('photopileModule');\n\n/**\n * @interface\n * Defines Photopile web part state.\n */\nexport interface IPhotopileState {\n\tresults?: ISPListItem[];\n loaded: boolean;\n}\n\n/**\n * @class\n * Defines Photopile web part class.\n */\nexport default class PhotopileWebPart extends React.Component<IPhotopileWebPartProps, IPhotopileState> {\n\n //page context\n private myPageContext: IWebPartContext;\n\n /**\n * @function\n * Photopile web part contructor.\n */\n constructor(props: IPhotopileWebPartProps, context: IWebPartContext) {\n super(props, context);\n //Save the context\n this.myPageContext = props.context;\n //Init the component state\n \tthis.state = {\n\t\t\tresults: [],\n loaded: false\n\t\t};\n\t};\n\n /**\n * @function\n * JSX Element render method\n */\n public render(): JSX.Element {\n\n if (this.props.listName == null || this.props.listName == '') {\n //Display select a list message\n return (\n <div className=\"ms-MessageBar\">\n <div className=\"ms-MessageBar-content\">\n <div className=\"ms-MessageBar-icon\">\n <i className=\"ms-Icon ms-Icon--infoCircle\"></i>\n </div>\n <div className=\"ms-MessageBar-text\">\n {strings.ErrorSelectList}\n </div>\n </div>\n </div>\n );\n }\n else {\n if (this.state.loaded == false) {\n //Display the loading spinner with the Office UI Fabric Spinner control\n return (\n <div className={ styles.photopileWebPart }>\n <div className={ styles.workingOnItSpinner }>\n <Spinner type={ SpinnerType.normal } />\n <div className={ styles.loadingLabel }>\n <label className=\"ms-Label\"> {strings.Loading}</label>\n </div>\n </div>\n </div>\n );\n }\n else if (this.state.results.length == 0) {\n //Display message no items\n return (\n <div className=\"ms-MessageBar ms-MessageBar--error\">\n <div className=\"ms-MessageBar-content\">\n <div className=\"ms-MessageBar-icon\">\n <i className=\"ms-Icon ms-Icon--xCircle\"></i>\n </div>\n <div className=\"ms-MessageBar-text\">\n {strings.ErrorNoItems}\n </div>\n </div>\n </div>\n );\n }\n else {\n //Display the items list\n return (\n <div className='photopile-wrapper'>\n <ul className='photopile'>\n {this.state.results.map((object:ISPListItem, i:number) => {\n //Select the best Alt text with title, description or file's name\n var altText: string = object.Title;\n if (altText == null || altText == '')\n altText = object.Description;\n if (altText == null || altText == '')\n altText = object.File.Name;\n //Render the item\n return (\n <li>\n <a href={object.File.ServerRelativeUrl}>\n <img src={object.File.ThumbnailServerUrl} alt={altText} width=\"133\" height=\"100\"/>\n </a>\n </li>\n );\n })}\n </ul>\n </div>\n );\n }\n }\n }\n\n\n /**\n * @function\n * Function called when the component did mount\n */\n public componentDidMount(): void {\n if (this.props.listName != null && this.props.listName != '') {\n //Init the Picture list service\n const picturesListService: SPPicturesListService = new SPPicturesListService(this.props, this.myPageContext);\n //Load the list of pictures from the current lib\n picturesListService.getPictures(this.props.listName)\n .then((response) => {\n //Modify the component state with the json result\n this.setState({ results: response.value, loaded: true});\n });\n }\n }\n\n /**\n * @function\n * Function called when the web part properties has changed\n */\n\tpublic componentWillReceiveProps(nextProps: IPhotopileWebPartProps): void {\n //Define the state with empty results\n this.setState({ results: [], loaded: false});\n if (nextProps.listName != null && nextProps.listName != '') {\n //Init the Picture list service\n const picturesListService: SPPicturesListService = new SPPicturesListService(nextProps, this.myPageContext);\n //Load the list of pictures from the current lib\n picturesListService.getPictures(nextProps.listName)\n .then((response) => {\n //Modify the component state with the json result\n this.setState({ results: response.value, loaded: true});\n });\n }\n\t}\n\n /**\n * @function\n * Function called when the component has been rendered (ie HTML code is ready)\n */\n public componentDidUpdate(prevProps: IPhotopileWebPartProps, prevState: IPhotopileState): void {\n\n if (this.state.loaded) {\n //Init photopile options\n photopile.setNumLayers(this.props.numLayers);\n photopile.setThumbOverlap(this.props.thumbOverlap);\n photopile.setThumbRotation(this.props.thumbRotation);\n photopile.setThumbBorderWidth(this.props.thumbBorderWidth);\n photopile.setThumbBorderColor(this.props.thumbBorderColor);\n photopile.setThumbBorderHover(this.props.thumbBorderHover);\n photopile.setDraggable(this.props.draggable);\n photopile.setFadeDuration(this.props.fadeDuration);\n photopile.setPickupDuration(this.props.pickupDuration);\n photopile.setPhotoZIndex(this.props.photoZIndex);\n photopile.setPhotoBorder(this.props.photoBorder);\n photopile.setPhotoBorderColor(this.props.photoBorderColor);\n photopile.setShowInfo(this.props.showInfo);\n photopile.setAutoplayGallery(this.props.autoplayGallery);\n photopile.setAutoplaySpeed(this.props.autoplaySpeed);\n\n //Init photopile\n photopile.scatter();\n }\n }\n\n}\n"],"sourceRoot":"..\\..\\..\\..\\src"}