UNPKG

12.6 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.semon=t(require("react")):e.semon=t(e.react)}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=33)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(9)()},function(e,t,n){"use strict";t.a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return"string"==typeof e||""===e}).map(function(e){return e.trim()}).join(" ")}},,function(e,t,n){e.exports=n(16)},,,,,function(e,t,n){"use strict";var r=n(10);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,u){if(u!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},,,,,,function(e,t,n){"use strict";function r(){return null}function o(){return r}r.isRequired=r,e.exports={and:o,between:o,booleanSome:o,childrenHavePropXorChildren:o,childrenOf:o,childrenOfType:o,childrenSequenceOf:o,componentWithName:o,disallowedIf:o,elementType:o,empty:o,explicitNull:o,forbidExtraProps:Object,integer:o,keysOf:o,mutuallyExclusiveProps:o,mutuallyExclusiveTrueProps:o,nChildren:o,nonNegativeInteger:r,nonNegativeNumber:o,numericString:o,object:o,or:o,range:o,requiredBy:o,restrictedProp:o,sequenceOf:o,shape:o,stringStartsWith:o,uniqueArray:o,uniqueArrayOf:o,valuesOf:o,withShape:o}},,,,function(e,t,n){e.exports={layout:"s-layout","has-sider":"s-has-sider"}},,,,,function(e,t,n){e.exports={"layout-content":"s-layout-content"}},function(e,t,n){e.exports={"layout-footer":"s-layout-footer"}},function(e,t,n){e.exports={"layout-header":"s-layout-header"}},function(e,t,n){e.exports={"layout-sider":"s-layout-sider"}},,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(25),i=n.n(o),u=n(2),a=n(1);var c=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};c.style=a.objectOf(a.oneOfType([a.number,a.string]));var l=c;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),p(this,y(t).apply(this,arguments))}var n,o,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,r["Component"]),n=t,(o=[{key:"parentValidate",value:function(){this.props.__PARENT__||console.warn("存在Content组件的父组件不是Layout!")}},{key:"componentWillMount",value:function(){this.parentValidate()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=Object(u.a)(t,i.a["layout-content"]);return r.createElement("div",{className:o,style:n},this.props.children)}}])&&f(n.prototype,o),a&&f(n,a),t}();h.displayName="Content",h.propTypes={className:a.string,style:l.style};var m=h,d=n(26),v=n.n(d);function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function j(e,t){return!t||"object"!==O(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var S=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),j(this,w(t).apply(this,arguments))}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(t,r["Component"]),n=t,(o=[{key:"parentValidate",value:function(){this.props.__PARENT__||console.warn("存在Footer组件的父组件不是Layout!")}},{key:"componentWillMount",value:function(){this.parentValidate()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=Object(u.a)(t,v.a["layout-footer"]);return r.createElement("div",{className:o,style:n},this.props.children)}}])&&_(n.prototype,o),i&&_(n,i),t}();S.displayName="Footer",S.propTypes={className:a.string,style:l.style};var P=S,E=n(27),T=n.n(E);function N(e){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function x(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function k(e,t){return!t||"object"!==N(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function C(e){return(C=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var A=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),k(this,C(t).apply(this,arguments))}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(t,r["Component"]),n=t,(o=[{key:"parentValidate",value:function(){this.props.__PARENT__||console.warn("存在Header组件的父组件不是Layout!")}},{key:"componentWillMount",value:function(){this.parentValidate()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=e.children,i=Object(u.a)(t,T.a["layout-header"]);return r.createElement("div",{className:i,style:n},o)}}])&&x(n.prototype,o),i&&x(n,i),t}();A.displayName="Header",A.propTypes={className:a.string,style:l.style};var q=A,V=n(28),W=n.n(V);function M(e){return(M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function I(e,t){return!t||"object"!==M(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var B=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),I(this,H(t).apply(this,arguments))}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&F(e,t)}(t,r["Component"]),n=t,(o=[{key:"parentValidate",value:function(){this.props.__PARENT__||console.warn("存在Sider组件的父组件不是Layout!")}},{key:"componentWillMount",value:function(){this.parentValidate()}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=Object(u.a)(t,W.a["layout-sider"]);return r.createElement("div",{className:o,style:n},this.props.children)}}])&&L(n.prototype,o),i&&L(n,i),t}();B.displayName="Sidebar",B.propTypes={className:a.string,style:l.style};var D=B,U=n(20),X=n.n(U),Y=n(4);function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function J(e,t){return!t||"object"!==z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function K(e){return(K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Z=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),J(this,K(t).apply(this,arguments))}var n,o,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Q(e,t)}(t,r["Component"]),n=t,(o=[{key:"hasSider",value:function(){return!!this.props.hasSider||r.Children.toArray(this.props.children).some(function(e){return e.type===r.createElement(D,null).type})}},{key:"renderChildren",value:function(){return r.Children.map(this.props.children,function(e){return e.type===r.createElement(D,null).type||e.type===r.createElement(P,null).type||e.type===r.createElement(m,null).type||e.type===r.createElement(q,null).type?r.cloneElement(e,{__PARENT__:!0}):e})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,o=Object(u.a)(t,X.a.layout,this.hasSider()&&X.a["has-sider"]);return r.createElement("div",{className:o,style:n},this.renderChildren())}}])&&G(n.prototype,o),i&&G(n,i),t}();Z.displayName="Layout",Z.Content=m,Z.Footer=P,Z.Header=q,Z.Sider=D,Z.propTypes={className:a.string,hasSider:a.bool,style:l.style,children:Object(Y.childrenOfType)(Z,m,q,P,D)};var $=Z;t.default=$}])});
\No newline at end of file