VimUnDoHg">Ki9;aǂB(3G]9]\; else if not @isMounted() and @props.disableServerRender% Uu&_""" v T4Fn!#T* className: "image-wrapper"5_""" v T4Fo!#T% className: "-wrapper"5_vT4FT displayName: "ImageGrid"5_vT4FT displayName: "Grid"5_  #v#T4FT% displayName: "ComponentGalleryGrid"5_ 5 v T4G9 [imageWidth, imagesPerRow] = @calculateImageWidth()5_  v T4GU
5_  v T4G if imagesPerRow is 15_  v T4G< else if i isnt 0 and (i + 1) % imagesPerRow is 05_ $ v T4G #%* width: "#{imageWidth}px"5_  % v T4G $&C height: "#{imageWidth*@props.widthHeightRatio}px"5_ 7 v T4G683 # Calculate the # of images per row to place.5_8 v T4G798 imageCount = React.Children.count(@props.children)5_9 v T4G8:I imagesPerRow = Math.round(@state.componentWidth/@props.targetWidth)5_:2 v T4G9;6 imagesPerRow = imagesPerRow - adjustImagesPerRow5_< v T4G;=3 # There has to be at least one image per row.5_= v T4G<>. imagesPerRow = Math.max(imagesPerRow, 1)5_> v T4G=?" if imagesPerRow > imageCount5_? v T4G>@! imagesPerRow = imageCount5_A v T4G@B? # Calculate the per-image width with space for in-between5_B v T4GAC # images subtracted5_C v T4G BD5 rawWidth = @state.componentWidth / imagesPerRow5_D v T4G"CEY marginRightOffset = ((@props.margin * imagesPerRow) - @props.margin) / imagesPerRow5_E v T4G$DF6 imageWidth = rawWidth - marginRightOffset - 0.255_I v T4G&HJ1 imageWidth = Math.min(imageWidth, maxWidth)5_J v T4G'IK: return [imageWidth, imagesPerRow, marginRightOffset]5_LA v T4G*KME [imageWidth, imagesPerRow, marginRightOffset] = _calcImageWidth()5_N v T4G+MOR # If the total margin used in a row is greater than one image, drop the images5_ P v T4G-OQ4 if imageWidth < marginRightOffset * imagesPerRow5_! Q v T4G/PRJ adjustment = Math.round((marginRightOffset*imagesPerRow)/imageWidth)5_ "!RC v T4G2QSQ [imageWidth, imagesPerRow, marginRightOffset] = _calcImageWidth(adjustment)5_!#"T v T4G3SU% return [imageWidth, imagesPerRow]5_"$#5 5vT4G=A [componentWidth, componentsPerRow] = @calculateImageWidth()5_#%$55 5vT4G>46 calculateImageWidth: ->5_$&%65 5vT4G?571 _calcImageWidth = (adjustImagesPerRow = 0) =>5_%'&:5 5vT4G@9;> componentsPerRow = componentsPerRow - adjustImagesPerRow5_&('L5 5vT4GAKMM [componentWidth, componentsPerRow, marginRightOffset] = _calcImageWidth()5_')(R5 5vT4GBQSY [componentWidth, componentsPerRow, marginRightOffset] = _calcImageWidth(adjustment)5_(*)"5 5vT4GFTY
5_)+*TIIk"U !T5_*,+!")")3v3TIJ!#W !#V5_+-,"*"*3v3TIJ!#W console.log "#W5_,.-**"*3v3TIK)+W4 "margin-right": "#{marginRight}px"5_-/.**"*3v3TIK)+W3 "marginright": "#{marginRight}px"5_.0/**"*3v3TIK)+W2 "marginight": "#{marginRight}px"5_/10+*"*3v3TIK *,W7 "margin-bottom": "#{@props.margin}px"5_021+*"*3v3TIK *,W6 "marginbottom": "#{@props.margin}px"5_132+*"*3v3TIK *,W5 "marginottom": "#{@props.margin}px"5_243+*"*3v3TIK *,W6 "marginBottom": "#{@props.margin}px"5_354**"*3v3TIK )+W3 "marginRight": "#{marginRight}px"5_465**"*3v3TIK )+W2 marginRight": "#{marginRight}px"5_576+*"*3v3TIK *,W5 marginBottom": "#{@props.margin}px"5_687.*"*3v3TIK-/W) "vertical-align": "top"5_798.*"*3v3TIK-/W( "verticalalign": "top"5_8:9.*"*3v3TIK-/W' "verticallign": "top"5_9;: " VTIL0  # console.log marginRight% console.log @props.margin* console.log "#{marginRight}px"5_:<;  V T]4   getInitialState: -> width: 05_;=< T8 R  Q5_<>=#T8 R# if @state.componentWidth isnt 05_=H> T8 S R5_>I?H(+v+T:YSF if @state.componentWidth isnt 0 and not @props.disableServerRender5_HJI(+v+T:YSE if @state.componentWidth ist 0 and not @props.disableServerRender5_IKJ(+v+T:`SS5_JLK(+v+T:aU T5_KML (+v+T:yUU5_LNM(+v+T:zW V5_MON556VT:~45 else
5_NPO!!CvCT:UD if @state.componentWidth is 0 and not @props.disableServerRender5_OQP !CvCT:V U5_PRQ !CvCT: W V5_QTR !CvCT< W disableServerRender: false5_RUST  , vT< W- disableServerRender: React.PropTypes.bool5_TVU  , vT< W disableServerRender: 5_UWV1T?WK # If we're server rendering and the user has disalbed server rendering.5_VXW TeHXW5_WYX   vTeQ X, children: React.PropTypes.any.isRequired5_XZY   vTeS X- disableServerRender: React.PropTypes.bool5_Y[Z   vTeV X X5_Z\[   vTeW Y' disableServerRender: PropTypes.bool5_[]\   vTeZ Y margin: PropTypes.bool5_\^]   vTe_ Y Y5_]_^   vTe_ Z margin: PropTypes.number5_^`_   vTed Z Z5__a`  vTee [! targetWidth: PropTypes.number5_`ba%  vTe\ [5_acb![T "\\
5_bdcT]\5_cedT].CalculateLayout = require './calculate_layout'5_dfeT]5_egf@9^,@9V?T?@9 _calcComponentWidth = (adjustComponentsPerRow = 0) =>7 # Calculate the # of components per row to place.< componentCount = React.Children.count(@props.children)M componentsPerRow = Math.round(@state.componentWidth/@props.targetWidth)B componentsPerRow = componentsPerRow - adjustComponentsPerRow7 # There has to be at least one component per row.6 componentsPerRow = Math.max(componentsPerRow, 1)* if componentsPerRow > componentCount) componentsPerRow = componentCountC # Calculate the per-component width with space for in-between # components subtracted9 rawWidth = @state.componentWidth / componentsPerRowa marginRightOffset = ((@props.margin * componentsPerRow) - @props.margin) / componentsPerRow: componentWidth = rawWidth - marginRightOffset - 0.25 # Don't get too big.W maxWidth = if @props.maxWidth? then @props.maxWidth else @props.targetWidth * 1.59 componentWidth = Math.min(componentWidth, maxWidth)B return [componentWidth, componentsPerRow, marginRightOffset]Q [componentWidth, componentsPerRow, marginRightOffset] = _calcComponentWidth()Z # If the total margin used in a row is greater than one component, drop the components # per row.< if componentWidth < marginRightOffset * componentsPerRowR adjustment = Math.round((marginRightOffset*componentsPerRow)/componentWidth)] [componentWidth, componentsPerRow, marginRightOffset] = _calcComponentWidth(adjustment)- return [componentWidth, componentsPerRow]5_fhg?@,@9V?T? ?5_gih@A,A9V?T?@# calculateLayout(@props, @state)5_hji!@,@9V?T!#?!"?5_ikj"A,A9V?T "@E [componentWidth, componentsPerRow] = @calculateComponentWidth()calculateLayout(@props, @state)!#@# calculateLayout(@props, @state)5_jlk>?>V*T=> calculateComponentWidth: ->5_kml#[#f#[v[T0"$=h
5_lnm #f#[v[T> =5_mon $f$[v[T? >5_npo&!%f%[v[T5&(?5_oqp'%f%[v[T8&'5_prq& %f%[v[T<&*@ &(?5_qsr)%f%[v[T(*BQ numRows = React.Children.count(@props.children) / componentsPerRow)5_rts)!%f%[v[T)+C )+B5_sut*%f%[v[T)+C6 if i > (numRows - 1) * componentsPerRow)5_tvu*%f%[v[T*,D *,C5_uwv&%f%[v[T&(E &(D5_vxw''%f%[v[T')E5_wyx- %f%[v[T-/F5_xy>#%f%[v[T=?G4 marginBottom: "#{@props.margin}px"5_yz,%f%[v[TV+-G7 if i > ((numRows - 1) * componentsPerRow)5_,%f%[v[TX+-G; if i + 1 > ((numRows - 1) * componentsPerRow)5_,%f%[v[TZ+-G< if i + 1) > ((numRows - 1) * componentsPerRow)5_ %f%[v[T.H G5_&f&[v[T4 margin5_%f%[v[T5H G5_&f&[v[TDI H5_/'f'[v[TX/2J /1I5_1 'f'[v[T\01 i5_0'f'[v[T\02K 02J5_*'f'[v[Tb*,L *,K5_2'f'[v[Ty15L # 5_))'*VOT()( marginBottom = @props.margin5_2*2*2/v/T13LP marginBottom = @props.marginBottom * @props.marginRightBottomRatio5_2*2/v/T L, marginRightBottomRatio: PropTypes.number5_2*2/v/T  marginRightBottomRatio: 15_0 1*1/v/T /1K$ unless marginBottom is 05_01*1/v/T /1K! if marginBottom is 05_01*1/v/T /1K if marginBottom is 05_01*1/v/T /1K" if marginBottom isnt 05_0"1*1/v/T /1K6 if @props.marginBottom marginBottom isnt 05_111IvIT 02KJ marginBottom = @props.margin * @props.marginRightBottomRatio5_111IvIT 02K marginBottom = 5_'/11IvIT '*L ')K5_111#v#T "02M$ # Calculate marginBottom5_111#v#T %02M # 5_1"11#v#T ?02M3 # Set marginBottom if set specifically.5_11#v#T ?' disableServerRender: PropTypes.bool5_T짃M L5_T" console.log @state5_%>%ZvZUHM L5_&>&ZvZUH9MM5_'>'ZvZUH:N# galleryStyles: PropTypes.object5_'>'ZvZUH>N% componentStyles: PropTypes.object5_'>'ZvZUH?N# galleryStyles: PropTypes.object5_'>'ZvZUHAO N5_(>(ZvZUHEP O5_)>)ZvZUHMQP5_* *>*ZvZUHZ),Q\
5_+;*>*ZvZUH]*-RY className="component-gallery #{@props.className}" style={{overflow: "hidden"}}>5_,&*>*ZvZUH_+.S' style={{overflow: "hidden"}}>5_- *>*ZvZUH`,.T >5_,*>*ZvZUHd+.T& style={{overflow: "hidden"}}5_- *>*ZvZUHe,/U! {overflow: "hidden"}}5_,*>*ZvZUHh+.V style={5_.*>*ZvZUHm.0X .0W5_. *>*ZvZUHr-/X {overflow: "hidden"}5_/*>*ZvZUHu/1Y /1X5_1 *>*ZvZUHw01 }5_0 *>*ZvZUHx/1X )5_RHHvUI]QSX( "verticalAlign": "top"5_RHHvUI^QSX' verticalAlign": "top"5_JHHvUIbIMX style: {5_MMTVUIiLUZ. width: "#{componentWidth}px"G height: "#{componentWidth*@props.widthHeightRatio}px") display: "inline-block"1 marginRight: "#{marginRight}px"3 marginBottom: "#{marginBottom}px"$ overflow: "hidden"& position: "relative"& verticalAlign: "top"5_UMTVUIkTVZ }5_UMTVUIn%TXZ }5_% % %vUu$&\; else if not @isMounted() and @props.disableServerRender5_% % %vUu&$&\' else if @props.disableServerRender5_HHHvUHGIX ({5_HHHvUHGIX , child)5_THHvUHSUX >, child)5_THHvUHSUX > child)5_THHvUHSUX >child)5_THHvUHSUX > {child)5_UHHvUHTVY {child})5_UHHvUHTVY {child} )5_X HHvUHWYZ }5_U HHvUHUVZ UW[
5_VHHvUHUW[
5_IHHvUHHJ[- className "component-wrapper"5_IHHvUHHJ[, className"component-wrapper"5_IHHvUHHJ[- className="component-wrapper"5_JHHvUHIK[ style {5_JHHvUHIK[ style{5_JHHvUHIK[ style={5_JHHvUHIK[ style={assign(5_JHHvUHJK[ JL\ {},5_KMTVUHKL\ KM] {5_MMTVUHLU]0 width: "#{componentWidth}px"I height: "#{componentWidth*@props.widthHeightRatio}px"+ display: "inline-block"3 marginRight: "#{marginRight}px"5 marginBottom: "#{marginBottom}px"& overflow: "hidden"( position: "relative"* "verticalAlign": "top"5_TMTVUHSU]) verticalAlign": "top"5_T!MTVUHSU]( verticalAlign: "top"5_T!MTVUHTU] TV^ }5_UMTVUHTV^ },' @props.componentStyle5_V&MTVUHVW_ VX` )}5_XMTVUH#WY5_] MTVUI<\^_ )}5_\ MTVUI=$[]5_X HHvUHWY5_W HHvUHVX5_%>%>%ZvZUH!$&L?
5_y{z>/%f%[v[T=?G2 marginBottom: "#{marginBottompx"5_z|{>/%f%[v[T=?G1 marginBottom: "#{marginBottomx"5_{}|>/%f%[v[T=?G0 marginBottom: "#{marginBottom"5_|~}>/%f%[v[T=?G/ marginBottom: "#{marginBottom5_}~> %f%[v[T=?G. marginBottom: #{marginBottom5_~> %f%[v[T=?G- marginBottom: {marginBottom5_> %f%[v[T=?G, marginBottom: marginBottom5_= %f%[v[T<>G0 marginRight: "{marginRight}px"5_= %f%[v[T<>G/ marginRight: "marginRight}px"5_=%f%[v[T<>G. marginRight: marginRight}px"5_=%f%[v[T<>G- marginRight: arginRight}px"5_=%f%[v[T<>G. marginRight: marginRight}px"5_=-%f%[v[T<>G- marginRight: marginRight}px5_=,%f%[v[T<>G, marginRight: marginRight}p5_=+%f%[v[T<>G+ marginRight: marginRight}5_=*%f%[v[T<>G* marginRight: marginRight5_:*%f%[v[T9;G- width: "#{componentWidthpx"5_:*%f%[v[T9;G, width: "#{componentWidthx"5_:*%f%[v[T9;G+ width: "#{componentWidth"5_:*%f%[v[T9;G* width: "#{componentWidth5_:%f%[v[T9;G) width: #{componentWidth5_:%f%[v[T9;G( width: {componentWidth5_:%f%[v[T9;G' width: componentWidth5_;%f%[v[T:<GF height: "{componentWidth*@props.widthHeightRatio}px"5_;%f%[v[T:<GE height: {componentWidth*@props.widthHeightRatio}px"5_;%f%[v[T:<GD height: componentWidth*@props.widthHeightRatio}px"5_;%f%[v[T:<GE height: {componentWidth*@props.widthHeightRatio}px"5_RTS ,T< W  X React.PropTypes.bool5_>@H?((+v+T:SB if @state.componentWidth isnt 0 and @props.disableServerRender5_?A@((+v+T:SC if @state.componentWidth isnt 0 and (@props.disableServerRender5_@BA'(+v+T:SB if @state.componentWidth isnt 0 and(@props.disableServerRender5_ACB'(+v+T:S' if @state.componentWidth isnt 0 and# (@props.disableServerRender5_BDC (+v+T:"T/ (@isMounted()@props.disableServerRender5_CED (+v+T:'T3 (not @isMounted()@props.disableServerRender5_DFE(+v+T:)T8 (not @isMounted() not @props.disableServerRender5_EGF8(+v+T:.T9 (not @isMounted() not @props.disableServerRender)5_FG(+v+T:<T= (not @isMounted() and not @props.disableServerRender)5_ v T4F6 [itemWidth, itemsPerRow] = @calculateitemWidth()5_ v T4FT
5