From bae06e3e04c384fada74adc338ddef1bbe15a8f4 Mon Sep 17 00:00:00 2001 From: Kutase Date: Fri, 6 Jul 2018 18:43:16 +0500 Subject: [PATCH] build fixed version --- .gitignore | 5 +- dist/rc-tabs.css | 497 ++++++ dist/rc-tabs.css.map | 1 + dist/rc-tabs.js | 2958 ++++++++++++++++++++++++++++++++++ dist/rc-tabs.js.map | 1 + dist/rc-tabs.min.css | 497 ++++++ dist/rc-tabs.min.css.map | 1 + dist/rc-tabs.min.js | 1 + es/InkTabBar.js | 16 + es/InkTabBarMixin.js | 152 ++ es/KeyCode.js | 18 + es/RefMixin.js | 9 + es/ScrollableInkTabBar.js | 18 + es/ScrollableTabBar.js | 17 + es/ScrollableTabBarMixin.js | 296 ++++ es/SwipeableInkTabBar.js | 74 + es/SwipeableTabBarMixin.js | 211 +++ es/SwipeableTabContent.js | 176 ++ es/TabBar.js | 14 + es/TabBarMixin.js | 103 ++ es/TabContent.js | 81 + es/TabPane.js | 54 + es/Tabs.js | 225 +++ es/index.js | 6 + es/utils.js | 83 + lib/InkTabBar.js | 36 + lib/InkTabBarMixin.js | 171 ++ lib/KeyCode.js | 24 + lib/RefMixin.js | 15 + lib/ScrollableInkTabBar.js | 41 + lib/ScrollableTabBar.js | 37 + lib/ScrollableTabBarMixin.js | 326 ++++ lib/SwipeableInkTabBar.js | 109 ++ lib/SwipeableTabBarMixin.js | 238 +++ lib/SwipeableTabContent.js | 206 +++ lib/TabBar.js | 31 + lib/TabBarMixin.js | 130 ++ lib/TabContent.js | 108 ++ lib/TabPane.js | 84 + lib/Tabs.js | 268 +++ lib/index.js | 24 + lib/utils.js | 110 ++ src/Tabs.js | 7 + 43 files changed, 7476 insertions(+), 3 deletions(-) create mode 100644 dist/rc-tabs.css create mode 100644 dist/rc-tabs.css.map create mode 100644 dist/rc-tabs.js create mode 100644 dist/rc-tabs.js.map create mode 100644 dist/rc-tabs.min.css create mode 100644 dist/rc-tabs.min.css.map create mode 100644 dist/rc-tabs.min.js create mode 100755 es/InkTabBar.js create mode 100755 es/InkTabBarMixin.js create mode 100755 es/KeyCode.js create mode 100644 es/RefMixin.js create mode 100755 es/ScrollableInkTabBar.js create mode 100755 es/ScrollableTabBar.js create mode 100755 es/ScrollableTabBarMixin.js create mode 100755 es/SwipeableInkTabBar.js create mode 100755 es/SwipeableTabBarMixin.js create mode 100755 es/SwipeableTabContent.js create mode 100755 es/TabBar.js create mode 100755 es/TabBarMixin.js create mode 100755 es/TabContent.js create mode 100755 es/TabPane.js create mode 100755 es/Tabs.js create mode 100755 es/index.js create mode 100755 es/utils.js create mode 100755 lib/InkTabBar.js create mode 100755 lib/InkTabBarMixin.js create mode 100755 lib/KeyCode.js create mode 100644 lib/RefMixin.js create mode 100755 lib/ScrollableInkTabBar.js create mode 100755 lib/ScrollableTabBar.js create mode 100755 lib/ScrollableTabBarMixin.js create mode 100755 lib/SwipeableInkTabBar.js create mode 100755 lib/SwipeableTabBarMixin.js create mode 100755 lib/SwipeableTabContent.js create mode 100755 lib/TabBar.js create mode 100755 lib/TabBarMixin.js create mode 100755 lib/TabContent.js create mode 100755 lib/TabPane.js create mode 100755 lib/Tabs.js create mode 100755 lib/index.js create mode 100755 lib/utils.js diff --git a/.gitignore b/.gitignore index 7ff37080..c745351e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,10 +21,9 @@ Thumbs.db .build node_modules .cache -dist + assets/**/*.css build -lib -es + coverage yarn.lock diff --git a/dist/rc-tabs.css b/dist/rc-tabs.css new file mode 100644 index 00000000..50d56df1 --- /dev/null +++ b/dist/rc-tabs.css @@ -0,0 +1,497 @@ +.rc-tabs { + box-sizing: border-box; + position: relative; + overflow: hidden; +} +.rc-tabs-bar, +.rc-tabs-nav-container { + font-size: 14px; + line-height: 1.5; + box-sizing: border-box; + overflow: hidden; + position: relative; + white-space: nowrap; + outline: none; + zoom: 1; + transition: padding .45s; +} +.rc-tabs-ink-bar { + z-index: 1; + position: absolute; + box-sizing: border-box; + margin-top: -3px; + background-color: #108ee9; + transform-origin: 0 0; +} +.rc-tabs-ink-bar-animated { + transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1); +} +.rc-tabs-tab-prev, +.rc-tabs-tab-next { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + z-index: 1; + line-height: 36px; + cursor: pointer; + border: none; + background-color: transparent; + position: absolute; +} +.rc-tabs-tab-prev-icon, +.rc-tabs-tab-next-icon { + position: relative; + display: inline-block; + font-style: normal; + font-weight: normal; + font-variant: normal; + line-height: inherit; + vertical-align: baseline; + text-align: center; + text-transform: none; + font-smoothing: antialiased; + text-stroke-width: 0; + font-family: sans-serif; +} +.rc-tabs-tab-prev-icon:before, +.rc-tabs-tab-next-icon:before { + display: block; +} +.rc-tabs-tab-btn-disabled { + cursor: default; + color: #ccc; +} +.rc-tabs-nav-wrap { + overflow: hidden; +} +.rc-tabs-nav { + box-sizing: border-box; + padding-left: 0; + position: relative; + margin: 0; + float: left; + list-style: none; + display: inline-block; + transform-origin: 0 0; +} +.rc-tabs-nav-animated { + transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1); +} +.rc-tabs-nav:before, +.rc-tabs-nav:after { + display: table; + content: " "; +} +.rc-tabs-nav:after { + clear: both; +} +.rc-tabs-tab { + box-sizing: border-box; + position: relative; + display: block; + transition: color 0.3s cubic-bezier(0.35, 0, 0.25, 1); + padding: 8px 20px; + font-weight: 500; + cursor: pointer; +} +.rc-tabs-tab:hover { + color: #23c0fa; +} +.rc-tabs-tab-active, +.rc-tabs-tab-active:hover { + color: #108ee9; + cursor: default; + transform: translateZ(0); +} +.rc-tabs-tab-disabled { + cursor: default; + color: #ccc; +} +.rc-tabs-tab-disabled:hover { + color: #ccc; +} +.rc-tabs-content { + zoom: 1; +} +.rc-tabs-content .rc-tabs-tabpane { + overflow: auto; +} +.rc-tabs-content-animated { + transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-left 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-top 0.3s cubic-bezier(0.35, 0, 0.25, 1); + display: -ms-flexbox; + display: flex; + will-change: transform; +} +.rc-tabs-content-animated .rc-tabs-tabpane { + -ms-flex-negative: 0; + flex-shrink: 0; +} +.no-flexbox .rc-tabs-content { + transform: none !important; + overflow: auto; +} +.no-csstransitions .rc-tabs-tabpane-inactive, +.no-flexbox .rc-tabs-tabpane-inactive, +.rc-tabs-content-no-animated .rc-tabs-tabpane-inactive { + display: none; +} +.rc-tabs-left { + border-right: 2px solid #f3f3f3; +} +.rc-tabs-left .rc-tabs-bar { + float: left; + height: 100%; + margin-right: 10px; + border-right: 1px solid #f3f3f3; +} +.rc-tabs-left .rc-tabs-nav-container { + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-container-scrolling { + padding-top: 32px; + padding-bottom: 32px; +} +.rc-tabs-left .rc-tabs-nav-wrap { + height: 100%; +} +.rc-tabs-left .rc-tabs-content-animated { + -ms-flex-direction: column; + flex-direction: column; +} +.rc-tabs-left .rc-tabs-content-animated .rc-tabs-tabpane { + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-scroll { + height: 99999px; +} +.rc-tabs-left .rc-tabs-nav-swipe { + position: relative; + top: 0; +} +.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + -ms-flex-direction: column; + flex-direction: column; + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-left .rc-tabs-tab-prev, +.rc-tabs-left .rc-tabs-tab-next { + margin-top: -2px; + height: 0; + line-height: 32px; + width: 0; + display: block; + text-align: center; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show, +.rc-tabs-left .rc-tabs-tab-arrow-show, +.rc-tabs-bottom .rc-tabs-tab-arrow-show, +.rc-tabs-right .rc-tabs-tab-arrow-show { + opacity: 1; + width: 100%; + height: 32px; +} +.rc-tabs-left .rc-tabs-tab-next { + bottom: 0; +} +.rc-tabs-left .rc-tabs-tab-next-icon { + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.rc-tabs-left .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-left .rc-tabs-tab-prev { + top: 2px; +} +.rc-tabs-left .rc-tabs-tab-prev-icon { + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.rc-tabs-left .rc-tabs-tab-prev-icon:before { + content: ">"; +} +.rc-tabs-left .rc-tabs-ink-bar { + width: 2px; + right: 0; +} +.rc-tabs-left .rc-tabs-tab { + padding: 16px 24px; +} +.rc-tabs-right { + border-left: 2px solid #f3f3f3; +} +.rc-tabs-right .rc-tabs-bar { + float: right; + height: 100%; + margin-left: 10px; + border-left: 1px solid #f3f3f3; +} +.rc-tabs-right .rc-tabs-nav-container { + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-container-scrolling { + padding-top: 32px; + padding-bottom: 32px; +} +.rc-tabs-right .rc-tabs-nav-wrap { + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-scroll { + height: 99999px; +} +.rc-tabs-right .rc-tabs-nav-swipe { + position: relative; +} +.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + -ms-flex-direction: column; + flex-direction: column; + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-right .rc-tabs-tab-prev, +.rc-tabs-right .rc-tabs-tab-next { + margin-top: -2px; + height: 0; + width: 0; + display: block; + text-align: center; + line-height: 32px; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show { + opacity: 1; + width: 100%; + height: 32px; +} +.rc-tabs-right .rc-tabs-tab-next { + bottom: 0; +} +.rc-tabs-right .rc-tabs-tab-next-icon { + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.rc-tabs-right .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-right .rc-tabs-tab-prev { + top: 2px; +} +.rc-tabs-right .rc-tabs-tab-prev-icon { + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.rc-tabs-right .rc-tabs-tab-prev-icon:before { + content: ">"; +} +.rc-tabs-right .rc-tabs-content-animated { + -ms-flex-direction: column; + flex-direction: column; +} +.rc-tabs-right .rc-tabs-content-animated .rc-tabs-tabpane { + height: 100%; +} +.rc-tabs-right .rc-tabs-ink-bar { + width: 2px; + left: 0; +} +.rc-tabs-right .rc-tabs-tab { + padding: 16px 24px; +} +.rc-tabs-bottom { + border-top: 2px solid #f3f3f3; +} +.rc-tabs-bottom .rc-tabs-content { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-bar { + border-top: 1px solid #f3f3f3; +} +.rc-tabs-bottom .rc-tabs-nav-container-scrolling { + padding-left: 32px; + padding-right: 32px; +} +.rc-tabs-bottom .rc-tabs-nav-scroll { + width: 99999px; +} +.rc-tabs-bottom .rc-tabs-nav-swipe { + position: relative; + left: 0; +} +.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + width: 100%; +} +.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + margin-right: 0; + padding: 8px 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-bottom .rc-tabs-nav-wrap { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-content-animated { + -ms-flex-direction: row; + flex-direction: row; +} +.rc-tabs-bottom .rc-tabs-content-animated .rc-tabs-tabpane { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-tab-next { + right: 2px; +} +.rc-tabs-bottom .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-bottom .rc-tabs-tab-prev { + left: 0; +} +.rc-tabs-bottom .rc-tabs-tab-prev-icon:before { + content: "<"; +} +.rc-tabs-bottom .rc-tabs-tab-prev, +.rc-tabs-bottom .rc-tabs-tab-next { + margin-right: -2px; + width: 32px; + height: 100%; + top: 0; + text-align: center; +} +.rc-tabs-bottom .rc-tabs-ink-bar { + height: 2px; + top: 3px; + left: 0; +} +.rc-tabs-bottom .rc-tabs-tab { + float: left; + height: 100%; + margin-right: 30px; +} +.rc-tabs-bottom .rc-tabs-tabpane-inactive { + height: 0; + overflow: visible; +} +.rc-tabs-top { + border-bottom: 2px solid #f3f3f3; +} +.rc-tabs-top .rc-tabs-content { + width: 100%; +} +.rc-tabs-top .rc-tabs-bar { + border-bottom: 1px solid #f3f3f3; +} +.rc-tabs-top .rc-tabs-nav-container-scrolling { + padding-left: 32px; + padding-right: 32px; +} +.rc-tabs-top .rc-tabs-nav-scroll { + width: 99999px; +} +.rc-tabs-top .rc-tabs-nav-swipe { + position: relative; + left: 0; +} +.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + width: 100%; +} +.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + margin-right: 0; + padding: 8px 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-top .rc-tabs-nav-wrap { + width: 100%; +} +.rc-tabs-top .rc-tabs-content-animated { + -ms-flex-direction: row; + flex-direction: row; +} +.rc-tabs-top .rc-tabs-content-animated .rc-tabs-tabpane { + width: 100%; +} +.rc-tabs-top .rc-tabs-tab-next { + right: 2px; +} +.rc-tabs-top .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-top .rc-tabs-tab-prev { + left: 0; +} +.rc-tabs-top .rc-tabs-tab-prev-icon:before { + content: "<"; +} +.rc-tabs-top .rc-tabs-tab-prev, +.rc-tabs-top .rc-tabs-tab-next { + margin-right: -2px; + width: 0; + height: 0; + top: 0; + text-align: center; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show { + opacity: 1; + width: 32px; + height: 100%; +} +.rc-tabs-top .rc-tabs-ink-bar { + height: 2px; + bottom: 0; + left: 0; +} +.rc-tabs-top .rc-tabs-tab { + float: left; + height: 100%; + margin-right: 30px; +} +.rc-tabs-top .rc-tabs-tabpane-inactive { + height: 0; + overflow: visible; +} + +/*# sourceMappingURL=rc-tabs.css.map*/ \ No newline at end of file diff --git a/dist/rc-tabs.css.map b/dist/rc-tabs.css.map new file mode 100644 index 00000000..63350bb2 --- /dev/null +++ b/dist/rc-tabs.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./assets/index/common.less","webpack:///./assets/index.less","webpack:///./assets/index/left.less","webpack:///./assets/index/right.less","webpack:///./assets/index/bottom.less","webpack:///./assets/index/top.less"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;CCCD;ADCC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCEH;ADCC;EACE;EACA;EACA;EACA;EACA;EACA;CCCH;ADAG;EACE;CCEL;ADEC;;EACE;KAAA;MAAA;UAAA;EACA;EACA;EACA;EACA;EACA;EACA;CCCH;ADCG;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCEL;ADAK;;EACE;CCGP;ADEC;EACE;EACA;CCAH;ADGC;EACE;CCDH;ADIC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCFH;ADIG;EACE;CCFL;ADKG;;EACE;EACA;CCFL;ADKG;EACE;CCHL;ADOC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CCLH;ADOG;EACE;CCLL;ADUG;;EACE;EACA;EAEA;CCRL;ADYC;EACE;EACA;CCVH;ADWG;EACE;CCTL;ADaC;EACE;CCXH;ADUC;EAII;CCXL;ADcG;EACE;EAGA;EAAA;EACA;CCdL;ADSG;EAQI;MAAA;CCdP;ADmBC;EACE;EACA;CCjBH;ADoBC;;;EAGE;CClBH;ACnIC;EACE;CDqIH;AClIC;EACE;EACA;EACA;EACA;CDoIH;AClIC;EACE;CDoIH;AClIC;EACE;EACA;CDoIH;ACjIC;EACE;CDmIH;AChIC;EACE;MAAA;CDkIH;ACnIC;EAII;CDkIL;AC9HC;EACE;CDgIH;AC7HC;EACE;EACA;CD+HH;ACjIC;EAII;EAAA;EACA;MAAA;EACA;MAAA;EACA;CDgIL;ACvIC;EASM;EAAA;EACA;MAAA;EACA;MAAA;CDiIP;AC5HC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CD+HH;AC5HC;;;;EAIE;EACA;EACA;CD8HH;AC3HC;EACE;CD6HH;AC5HG;EACE;EACA;CD8HL;AC5HG;EACE;CD8HL;AC1HC;EACE;CD4HH;AC3HG;EACE;EACA;CD6HL;AC3HG;EACE;CD6HL;ACzHC;EACE;EACA;CD2HH;ACxHC;EACE;CD0HH;AE5NC;EACE;CF8NH;AE3NC;EACE;EACA;EACA;EACA;CF6NH;AE3NC;EACE;CF6NH;AE3NC;EACE;EACA;CF6NH;AE1NC;EACE;CF4NH;AEzNC;EACE;CF2NH;AExNC;EACE;CF0NH;AE3NC;EAGI;EAAA;EACA;MAAA;EACA;MAAA;EACA;CF2NL;AEjOC;EAQM;EAAA;EACA;MAAA;EACA;MAAA;CF4NP;AEvNC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CF0NH;AEtNC;EACE;EACA;EACA;CFwNH;AErNC;EACE;CFuNH;AEtNG;EACE;EACA;CFwNL;AEtNG;EACE;CFwNL;AEpNC;EACE;CFsNH;AErNG;EACE;EACA;CFuNL;AErNG;EACE;CFuNL;AEnNC;EACE;MAAA;CFqNH;AEtNC;EAII;CFqNL;AEjNC;EACE;EACA;CFmNH;AEhNC;EACE;CFkNH;AGjTC;EACE;CHmTH;AGhTC;EACE;CHkTH;AG/SC;EACE;CHiTH;AG9SC;EACE;EACA;CHgTH;AG7SC;EACE;CH+SH;AG5SC;EACE;EACA;CH8SH;AGhTC;EAII;EAAA;EACA;MAAA;EACA;CH+SL;AGrTC;EAQM;EAAA;EACA;MAAA;EACA;EACA;EACA;MAAA;CHgTP;AG5SC;EACE;CH8SH;AG3SC;EACE;MAAA;CH6SH;AG9SC;EAII;CH6SL;AGzSC;EACE;CH2SH;AGzSG;EACE;CH2SL;AGvSC;EACE;CHySH;AGxSG;EACE;CH0SL;AGtSC;;EACE;EACA;EACA;EACA;EACA;CHySH;AGtSC;EACE;EACA;EACA;CHwSH;AGrSC;EACE;EACA;EACA;CHuSH;AGpSC;EACE;EACA;CHsSH;AI5XC;EACE;CJ8XH;AI3XC;EACE;CJ6XH;AI1XC;EACE;CJ4XH;AIzXC;EACE;EACA;CJ2XH;AIxXC;EACE;CJ0XH;AIvXC;EACE;EACA;CJyXH;AI3XC;EAII;EAAA;EACA;MAAA;EACA;CJ0XL;AIhYC;EAQM;EAAA;EACA;MAAA;EACA;EACA;EACA;MAAA;CJ2XP;AItXC;EACE;CJwXH;AIrXC;EACE;MAAA;CJuXH;AIxXC;EAGI;CJwXL;AIpXC;EACE;CJsXH;AIpXG;EACE;CJsXL;AIlXC;EACE;CJoXH;AInXG;EACE;CJqXL;AIjXC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CJoXH;AIjXC;EACE;EACA;EACA;CJmXH;AIhXC;EACE;EACA;EACA;CJkXH;AI/WC;EACE;EACA;EACA;CJiXH;AI9WC;EACE;EACA;CJgXH","file":"rc-tabs.css","sourcesContent":[".@{tabs-prefix-cls} {\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n\n &-bar, &-nav-container {\n font-size: 14px;\n line-height: 1.5;\n box-sizing: border-box;\n overflow: hidden;\n position: relative;\n white-space: nowrap;\n outline: none;\n zoom: 1;\n transition: padding .45s;\n }\n\n &-ink-bar {\n z-index: 1;\n position: absolute;\n box-sizing: border-box;\n margin-top: -3px;\n background-color: #108ee9;\n transform-origin: 0 0;\n &-animated {\n transition: transform @effect-duration @easing-in-out;\n }\n }\n\n &-tab-prev, &-tab-next {\n user-select: none;\n z-index: 1;\n line-height: 36px;\n cursor: pointer;\n border: none;\n background-color: transparent;\n position: absolute;\n\n &-icon {\n position: relative;\n display: inline-block;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n line-height: inherit;\n vertical-align: baseline;\n text-align: center;\n text-transform: none;\n font-smoothing: antialiased;\n text-stroke-width: 0;\n font-family: sans-serif;\n\n &:before {\n display: block;\n }\n }\n }\n\n &-tab-btn-disabled {\n cursor: default;\n color: #ccc;\n }\n\n &-nav-wrap {\n overflow: hidden;\n }\n\n &-nav {\n box-sizing: border-box;\n padding-left: 0;\n position: relative;\n margin: 0;\n float: left;\n list-style: none;\n display: inline-block;\n transform-origin: 0 0;\n\n &-animated {\n transition: transform 0.5s @easing-in-out;\n }\n\n &:before, &:after {\n display: table;\n content: \" \";\n }\n\n &:after {\n clear: both;\n }\n }\n\n &-tab {\n box-sizing: border-box;\n position: relative;\n display: block;\n transition: color @effect-duration @easing-in-out;\n padding: 8px 20px;\n font-weight: 500;\n cursor: pointer;\n\n &:hover {\n color: #23c0fa;\n }\n }\n\n &-tab-active {\n &, &:hover {\n color: #108ee9;\n cursor: default;\n // fix chrome render\n transform: translateZ(0);\n }\n }\n\n &-tab-disabled {\n cursor: default;\n color: #ccc;\n &:hover {\n color: #ccc;\n }\n }\n\n &-content {\n zoom: 1;\n\n .@{tabs-prefix-cls}-tabpane {\n overflow: auto;\n }\n\n &-animated {\n transition: transform @effect-duration @easing-in-out,\n margin-left @effect-duration @easing-in-out,\n margin-top @effect-duration @easing-in-out;\n display: flex;\n will-change: transform;\n\n .@{tabs-prefix-cls}-tabpane {\n flex-shrink: 0;\n }\n }\n }\n\n .no-flexbox &-content {\n transform: none !important;\n overflow: auto;\n }\n\n .no-csstransitions &-tabpane-inactive,\n .no-flexbox &-tabpane-inactive,\n &-content-no-animated &-tabpane-inactive {\n display: none;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/common.less",".rc-tabs {\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n}\n.rc-tabs-bar,\n.rc-tabs-nav-container {\n font-size: 14px;\n line-height: 1.5;\n box-sizing: border-box;\n overflow: hidden;\n position: relative;\n white-space: nowrap;\n outline: none;\n zoom: 1;\n transition: padding .45s;\n}\n.rc-tabs-ink-bar {\n z-index: 1;\n position: absolute;\n box-sizing: border-box;\n margin-top: -3px;\n background-color: #108ee9;\n transform-origin: 0 0;\n}\n.rc-tabs-ink-bar-animated {\n transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n}\n.rc-tabs-tab-prev,\n.rc-tabs-tab-next {\n user-select: none;\n z-index: 1;\n line-height: 36px;\n cursor: pointer;\n border: none;\n background-color: transparent;\n position: absolute;\n}\n.rc-tabs-tab-prev-icon,\n.rc-tabs-tab-next-icon {\n position: relative;\n display: inline-block;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n line-height: inherit;\n vertical-align: baseline;\n text-align: center;\n text-transform: none;\n font-smoothing: antialiased;\n text-stroke-width: 0;\n font-family: sans-serif;\n}\n.rc-tabs-tab-prev-icon:before,\n.rc-tabs-tab-next-icon:before {\n display: block;\n}\n.rc-tabs-tab-btn-disabled {\n cursor: default;\n color: #ccc;\n}\n.rc-tabs-nav-wrap {\n overflow: hidden;\n}\n.rc-tabs-nav {\n box-sizing: border-box;\n padding-left: 0;\n position: relative;\n margin: 0;\n float: left;\n list-style: none;\n display: inline-block;\n transform-origin: 0 0;\n}\n.rc-tabs-nav-animated {\n transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);\n}\n.rc-tabs-nav:before,\n.rc-tabs-nav:after {\n display: table;\n content: \" \";\n}\n.rc-tabs-nav:after {\n clear: both;\n}\n.rc-tabs-tab {\n box-sizing: border-box;\n position: relative;\n display: block;\n transition: color 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n padding: 8px 20px;\n font-weight: 500;\n cursor: pointer;\n}\n.rc-tabs-tab:hover {\n color: #23c0fa;\n}\n.rc-tabs-tab-active,\n.rc-tabs-tab-active:hover {\n color: #108ee9;\n cursor: default;\n transform: translateZ(0);\n}\n.rc-tabs-tab-disabled {\n cursor: default;\n color: #ccc;\n}\n.rc-tabs-tab-disabled:hover {\n color: #ccc;\n}\n.rc-tabs-content {\n zoom: 1;\n}\n.rc-tabs-content .rc-tabs-tabpane {\n overflow: auto;\n}\n.rc-tabs-content-animated {\n transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-left 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-top 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n display: flex;\n will-change: transform;\n}\n.rc-tabs-content-animated .rc-tabs-tabpane {\n flex-shrink: 0;\n}\n.no-flexbox .rc-tabs-content {\n transform: none !important;\n overflow: auto;\n}\n.no-csstransitions .rc-tabs-tabpane-inactive,\n.no-flexbox .rc-tabs-tabpane-inactive,\n.rc-tabs-content-no-animated .rc-tabs-tabpane-inactive {\n display: none;\n}\n.rc-tabs-left {\n border-right: 2px solid #f3f3f3;\n}\n.rc-tabs-left .rc-tabs-bar {\n float: left;\n height: 100%;\n margin-right: 10px;\n border-right: 1px solid #f3f3f3;\n}\n.rc-tabs-left .rc-tabs-nav-container {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n}\n.rc-tabs-left .rc-tabs-nav-wrap {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-content-animated {\n flex-direction: column;\n}\n.rc-tabs-left .rc-tabs-content-animated .rc-tabs-tabpane {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-scroll {\n height: 99999px;\n}\n.rc-tabs-left .rc-tabs-nav-swipe {\n position: relative;\n top: 0;\n}\n.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n}\n.rc-tabs-left .rc-tabs-tab-prev,\n.rc-tabs-left .rc-tabs-tab-next {\n margin-top: -2px;\n height: 0;\n line-height: 32px;\n width: 0;\n display: block;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show,\n.rc-tabs-left .rc-tabs-tab-arrow-show,\n.rc-tabs-bottom .rc-tabs-tab-arrow-show,\n.rc-tabs-right .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n}\n.rc-tabs-left .rc-tabs-tab-next {\n bottom: 0;\n}\n.rc-tabs-left .rc-tabs-tab-next-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n}\n.rc-tabs-left .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-left .rc-tabs-tab-prev {\n top: 2px;\n}\n.rc-tabs-left .rc-tabs-tab-prev-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n}\n.rc-tabs-left .rc-tabs-tab-prev-icon:before {\n content: \">\";\n}\n.rc-tabs-left .rc-tabs-ink-bar {\n width: 2px;\n right: 0;\n}\n.rc-tabs-left .rc-tabs-tab {\n padding: 16px 24px;\n}\n.rc-tabs-right {\n border-left: 2px solid #f3f3f3;\n}\n.rc-tabs-right .rc-tabs-bar {\n float: right;\n height: 100%;\n margin-left: 10px;\n border-left: 1px solid #f3f3f3;\n}\n.rc-tabs-right .rc-tabs-nav-container {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n}\n.rc-tabs-right .rc-tabs-nav-wrap {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-scroll {\n height: 99999px;\n}\n.rc-tabs-right .rc-tabs-nav-swipe {\n position: relative;\n}\n.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n}\n.rc-tabs-right .rc-tabs-tab-prev,\n.rc-tabs-right .rc-tabs-tab-next {\n margin-top: -2px;\n height: 0;\n width: 0;\n display: block;\n text-align: center;\n line-height: 32px;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n}\n.rc-tabs-right .rc-tabs-tab-next {\n bottom: 0;\n}\n.rc-tabs-right .rc-tabs-tab-next-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n}\n.rc-tabs-right .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-right .rc-tabs-tab-prev {\n top: 2px;\n}\n.rc-tabs-right .rc-tabs-tab-prev-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n}\n.rc-tabs-right .rc-tabs-tab-prev-icon:before {\n content: \">\";\n}\n.rc-tabs-right .rc-tabs-content-animated {\n flex-direction: column;\n}\n.rc-tabs-right .rc-tabs-content-animated .rc-tabs-tabpane {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-ink-bar {\n width: 2px;\n left: 0;\n}\n.rc-tabs-right .rc-tabs-tab {\n padding: 16px 24px;\n}\n.rc-tabs-bottom {\n border-top: 2px solid #f3f3f3;\n}\n.rc-tabs-bottom .rc-tabs-content {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-bar {\n border-top: 1px solid #f3f3f3;\n}\n.rc-tabs-bottom .rc-tabs-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n}\n.rc-tabs-bottom .rc-tabs-nav-scroll {\n width: 99999px;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe {\n position: relative;\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n}\n.rc-tabs-bottom .rc-tabs-nav-wrap {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-content-animated {\n flex-direction: row;\n}\n.rc-tabs-bottom .rc-tabs-content-animated .rc-tabs-tabpane {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-tab-next {\n right: 2px;\n}\n.rc-tabs-bottom .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-bottom .rc-tabs-tab-prev {\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-tab-prev-icon:before {\n content: \"<\";\n}\n.rc-tabs-bottom .rc-tabs-tab-prev,\n.rc-tabs-bottom .rc-tabs-tab-next {\n margin-right: -2px;\n width: 32px;\n height: 100%;\n top: 0;\n text-align: center;\n}\n.rc-tabs-bottom .rc-tabs-ink-bar {\n height: 2px;\n top: 3px;\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n}\n.rc-tabs-bottom .rc-tabs-tabpane-inactive {\n height: 0;\n overflow: visible;\n}\n.rc-tabs-top {\n border-bottom: 2px solid #f3f3f3;\n}\n.rc-tabs-top .rc-tabs-content {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-bar {\n border-bottom: 1px solid #f3f3f3;\n}\n.rc-tabs-top .rc-tabs-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n}\n.rc-tabs-top .rc-tabs-nav-scroll {\n width: 99999px;\n}\n.rc-tabs-top .rc-tabs-nav-swipe {\n position: relative;\n left: 0;\n}\n.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n}\n.rc-tabs-top .rc-tabs-nav-wrap {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-content-animated {\n flex-direction: row;\n}\n.rc-tabs-top .rc-tabs-content-animated .rc-tabs-tabpane {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-tab-next {\n right: 2px;\n}\n.rc-tabs-top .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-top .rc-tabs-tab-prev {\n left: 0;\n}\n.rc-tabs-top .rc-tabs-tab-prev-icon:before {\n content: \"<\";\n}\n.rc-tabs-top .rc-tabs-tab-prev,\n.rc-tabs-top .rc-tabs-tab-next {\n margin-right: -2px;\n width: 0;\n height: 0;\n top: 0;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 32px;\n height: 100%;\n}\n.rc-tabs-top .rc-tabs-ink-bar {\n height: 2px;\n bottom: 0;\n left: 0;\n}\n.rc-tabs-top .rc-tabs-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n}\n.rc-tabs-top .rc-tabs-tabpane-inactive {\n height: 0;\n overflow: visible;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index.less",".@{tabs-prefix-cls} {\n &-left {\n border-right: 2px solid #f3f3f3;\n }\n\n &-left &-bar {\n float: left;\n height:100%;\n margin-right: 10px;\n border-right: 1px solid #f3f3f3;\n }\n &-left &-nav-container {\n height:100%;\n }\n &-left &-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n &-left &-nav-wrap {\n height: 100%;\n }\n\n &-left &-content-animated {\n flex-direction: column;\n\n .@{tabs-prefix-cls}-tabpane {\n height: 100%;\n }\n }\n\n &-left &-nav-scroll {\n height: 99999px;\n }\n\n &-left &-nav-swipe {\n position: relative;\n top: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n }\n }\n }\n\n &-left &-tab-prev, &-left &-tab-next {\n margin-top: -2px;\n height: 0;\n line-height: 32px;\n width: 0;\n display: block;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n &-top &-tab-arrow-show,\n &-left &-tab-arrow-show,\n &-bottom &-tab-arrow-show,\n &-right &-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n }\n\n &-left &-tab-next {\n bottom: 0;\n &-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-left &-tab-prev {\n top: 2px;\n &-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-left &-ink-bar {\n width: 2px;\n right: 0;\n }\n\n &-left &-tab {\n padding: 16px 24px;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/left.less",".@{tabs-prefix-cls} {\n &-right {\n border-left: 2px solid #f3f3f3;\n }\n\n &-right &-bar {\n float: right;\n height: 100%;\n margin-left: 10px;\n border-left: 1px solid #f3f3f3;\n }\n &-right &-nav-container {\n height:100%;\n }\n &-right &-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n &-right &-nav-wrap {\n height: 100%;\n }\n\n &-right &-nav-scroll {\n height: 99999px;\n }\n\n &-right &-nav-swipe {\n position: relative;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n }\n }\n }\n\n &-right &-tab-prev, &-right &-tab-next {\n margin-top: -2px;\n height: 0;\n width: 0;\n display: block;\n text-align: center;\n line-height: 32px;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n\n &-top &-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n }\n\n &-right &-tab-next {\n bottom: 0;\n &-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-right &-tab-prev {\n top: 2px;\n &-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-right &-content-animated {\n flex-direction: column;\n\n .@{tabs-prefix-cls}-tabpane {\n height: 100%;\n }\n }\n\n &-right &-ink-bar {\n width: 2px;\n left: 0;\n }\n\n &-right &-tab {\n padding: 16px 24px;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/right.less",".@{tabs-prefix-cls} {\n &-bottom {\n border-top: 2px solid #f3f3f3;\n }\n\n &-bottom &-content {\n width: 100%;\n }\n\n &-bottom &-bar {\n border-top: 1px solid #f3f3f3;\n }\n\n &-bottom &-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n }\n\n &-bottom &-nav-scroll {\n width: 99999px;\n }\n\n &-bottom &-nav-swipe {\n position: relative;\n left: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n width: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n }\n }\n }\n &-bottom &-nav-wrap {\n width: 100%;\n }\n\n &-bottom &-content-animated {\n flex-direction: row;\n\n .@{tabs-prefix-cls}-tabpane {\n width: 100%;\n }\n }\n\n &-bottom &-tab-next {\n right: 2px;\n\n &-icon:before {\n content: \">\";\n }\n }\n\n &-bottom &-tab-prev {\n left: 0;\n &-icon:before {\n content: \"<\";\n }\n }\n\n &-bottom &-tab-prev, &-bottom &-tab-next {\n margin-right: -2px;\n width: 32px;\n height: 100%;\n top: 0;\n text-align: center;\n }\n\n &-bottom &-ink-bar {\n height: 2px;\n top: 3px;\n left: 0;\n }\n\n &-bottom &-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n }\n\n &-bottom &-tabpane-inactive {\n height: 0;\n overflow: visible;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/bottom.less",".@{tabs-prefix-cls} {\n &-top {\n border-bottom: 2px solid #f3f3f3;\n }\n\n &-top &-content {\n width: 100%;\n }\n\n &-top &-bar {\n border-bottom: 1px solid #f3f3f3;\n }\n\n &-top &-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n }\n\n &-top &-nav-scroll {\n width: 99999px;\n }\n\n &-top &-nav-swipe {\n position: relative;\n left: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n width: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n }\n }\n }\n\n &-top &-nav-wrap {\n width: 100%;\n }\n\n &-top &-content-animated {\n flex-direction: row;\n .@{tabs-prefix-cls}-tabpane {\n width: 100%;\n }\n }\n\n &-top &-tab-next {\n right: 2px;\n\n &-icon:before {\n content: \">\";\n }\n }\n\n &-top &-tab-prev {\n left: 0;\n &-icon:before {\n content: \"<\";\n }\n }\n\n &-top &-tab-prev, &-top &-tab-next {\n margin-right: -2px;\n width: 0;\n height: 0;\n top: 0;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n &-top &-tab-arrow-show {\n opacity: 1;\n width: 32px;\n height: 100%;\n }\n\n &-top &-ink-bar {\n height: 2px;\n bottom: 0;\n left: 0;\n }\n\n &-top &-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n }\n\n &-top &-tabpane-inactive {\n height: 0;\n overflow: visible;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/top.less"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rc-tabs.js b/dist/rc-tabs.js new file mode 100644 index 00000000..7c6a7c2d --- /dev/null +++ b/dist/rc-tabs.js @@ -0,0 +1,2958 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("react")); + else if(typeof define === 'function' && define.amd) + define(["react"], factory); + else if(typeof exports === 'object') + exports["rc-tabs"] = factory(require("react")); + else + root["rc-tabs"] = factory(root["React"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 22); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_1__; + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export toArray */ +/* harmony export (immutable) */ __webpack_exports__["a"] = getActiveIndex; +/* unused harmony export getActiveKey */ +/* unused harmony export setTransform */ +/* unused harmony export isTransformSupported */ +/* unused harmony export setTransition */ +/* harmony export (immutable) */ __webpack_exports__["c"] = getTransformPropValue; +/* unused harmony export isVertical */ +/* harmony export (immutable) */ __webpack_exports__["d"] = getTransformByIndex; +/* harmony export (immutable) */ __webpack_exports__["b"] = getMarginStyle; +/* unused harmony export getStyle */ +/* unused harmony export setPxStyle */ +/* harmony export (immutable) */ __webpack_exports__["e"] = getDataAttr; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + +function toArray(children) { + // allow [c,[a,b]] + var c = []; + __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (child) { + if (child) { + c.push(child); + } + }); + return c; +} + +function getActiveIndex(children, activeKey) { + var c = toArray(children); + for (var i = 0; i < c.length; i++) { + if (c[i].key === activeKey) { + return i; + } + } + return -1; +} + +function getActiveKey(children, index) { + var c = toArray(children); + return c[index].key; +} + +function setTransform(style, v) { + style.transform = v; + style.webkitTransform = v; + style.mozTransform = v; +} + +function isTransformSupported(style) { + return 'transform' in style || 'webkitTransform' in style || 'MozTransform' in style; +} + +function setTransition(style, v) { + style.transition = v; + style.webkitTransition = v; + style.MozTransition = v; +} +function getTransformPropValue(v) { + return { + transform: v, + WebkitTransform: v, + MozTransform: v + }; +} + +function isVertical(tabBarPosition) { + return tabBarPosition === 'left' || tabBarPosition === 'right'; +} + +function getTransformByIndex(index, tabBarPosition) { + var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX'; + return translate + '(' + -index * 100 + '%) translateZ(0)'; +} + +function getMarginStyle(index, tabBarPosition) { + var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft'; + return _defineProperty({}, marginDirection, -index * 100 + '%'); +} + +function getStyle(el, property) { + return +getComputedStyle(el).getPropertyValue(property).replace('px', ''); +} + +function setPxStyle(el, value, vertical) { + value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px'; + setTransform(el.style, 'translate3d(' + value + ')'); +} + +function getDataAttr(props) { + return Object.keys(props).reduce(function (prev, key) { + if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { + prev[key] = props[key]; + } + return prev; + }, {}); +} + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! + Copyright (c) 2017 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg) && arg.length) { + var inner = classNames.apply(null, arg); + if (inner) { + classes.push(inner); + } + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if (typeof module !== 'undefined' && module.exports) { + classNames.default = classNames; + module.exports = classNames; + } else if (true) { + // register as 'classnames', consistent with npm package name + !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { + return classNames; + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else { + window.classNames = classNames; + } +}()); + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +if (process.env.NODE_ENV !== 'production') { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(21)(isValidElement, throwOnDirectAccess); +} else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = __webpack_require__(20)(); +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + +module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 6 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_create_react_class__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_create_react_class___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_create_react_class__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_classnames__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(2); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + + + + + + + +var TabPane = __WEBPACK_IMPORTED_MODULE_2_create_react_class___default()({ + displayName: 'TabPane', + propTypes: { + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + active: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + destroyInactiveTabPane: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + forceRender: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + placeholder: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.node + }, + getDefaultProps: function getDefaultProps() { + return { placeholder: null }; + }, + render: function render() { + var _classnames; + + var _props = this.props, + className = _props.className, + destroyInactiveTabPane = _props.destroyInactiveTabPane, + active = _props.active, + forceRender = _props.forceRender, + rootPrefixCls = _props.rootPrefixCls, + style = _props.style, + children = _props.children, + placeholder = _props.placeholder, + restProps = _objectWithoutProperties(_props, ['className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); + + this._isActived = this._isActived || active; + var prefixCls = rootPrefixCls + '-tabpane'; + var cls = __WEBPACK_IMPORTED_MODULE_3_classnames___default()((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-inactive', !active), _defineProperty(_classnames, prefixCls + '-active', active), _defineProperty(_classnames, className, className), _classnames)); + var isRender = destroyInactiveTabPane ? active : this._isActived; + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + _extends({ + style: style, + role: 'tabpanel', + 'aria-hidden': active ? 'false' : 'true', + className: cls + }, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["e" /* getDataAttr */])(restProps)), + isRender || forceRender ? children : placeholder + ); + } +}); + +/* harmony default export */ __webpack_exports__["a"] = (TabPane); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var React = __webpack_require__(1); +var factory = __webpack_require__(14); + +if (typeof React === 'undefined') { + throw Error( + 'create-react-class could not find the React object. If you are using script tags, ' + + 'make sure that React is being loaded before create-react-class.' + ); +} + +// Hack to grab NoopUpdateQueue from isomorphic React +var ReactNoopUpdateQueue = new React.Component().updater; + +module.exports = factory( + React.Component, + React.isValidElement, + ReactNoopUpdateQueue +); + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Tabs__ = __webpack_require__(13); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__TabPane__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__TabContent__ = __webpack_require__(12); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TabPane", function() { return __WEBPACK_IMPORTED_MODULE_1__TabPane__["a"]; }); +/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TabContent", function() { return __WEBPACK_IMPORTED_MODULE_2__TabContent__["a"]; }); + + + + +/* harmony default export */ __webpack_exports__["default"] = (__WEBPACK_IMPORTED_MODULE_0__Tabs__["a" /* default */]); + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), +/* 11 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony default export */ __webpack_exports__["a"] = ({ + /** + * LEFT + */ + LEFT: 37, // also NUM_WEST + /** + * UP + */ + UP: 38, // also NUM_NORTH + /** + * RIGHT + */ + RIGHT: 39, // also NUM_EAST + /** + * DOWN + */ + DOWN: 40 // also NUM_SOUTH +}); + +/***/ }), +/* 12 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_create_react_class__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_create_react_class___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_create_react_class__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_classnames__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils__ = __webpack_require__(2); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + + + + + + +var TabContent = __WEBPACK_IMPORTED_MODULE_1_create_react_class___default()({ + displayName: 'TabContent', + propTypes: { + animated: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + animatedWithMargin: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.bool, + prefixCls: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + children: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any, + activeKey: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string, + style: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.any, + tabBarPosition: __WEBPACK_IMPORTED_MODULE_2_prop_types___default.a.string + }, + getDefaultProps: function getDefaultProps() { + return { + animated: true + }; + }, + getTabPanes: function getTabPanes() { + var props = this.props; + var activeKey = props.activeKey; + var children = props.children; + var newChildren = []; + + __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(children, function (child) { + if (!child) { + return; + } + var key = child.key; + var active = activeKey === key; + newChildren.push(__WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(child, { + active: active, + destroyInactiveTabPane: props.destroyInactiveTabPane, + rootPrefixCls: props.prefixCls + })); + }); + + return newChildren; + }, + render: function render() { + var _classnames; + + var props = this.props; + var prefixCls = props.prefixCls, + children = props.children, + activeKey = props.activeKey, + tabBarPosition = props.tabBarPosition, + animated = props.animated, + animatedWithMargin = props.animatedWithMargin; + var style = props.style; + + var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()((_classnames = {}, _defineProperty(_classnames, prefixCls + '-content', true), _defineProperty(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames)); + if (animated) { + var activeIndex = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["a" /* getActiveIndex */])(children, activeKey); + if (activeIndex !== -1) { + var animatedStyle = animatedWithMargin ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["b" /* getMarginStyle */])(activeIndex, tabBarPosition) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["c" /* getTransformPropValue */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils__["d" /* getTransformByIndex */])(activeIndex, tabBarPosition)); + style = _extends({}, style, animatedStyle); + } else { + style = _extends({}, style, { + display: 'none' + }); + } + } + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + { + className: classes, + style: style + }, + this.getTabPanes() + ); + } +}); + +/* harmony default export */ __webpack_exports__["a"] = (TabContent); + +/***/ }), +/* 13 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__KeyCode__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__TabPane__ = __webpack_require__(6); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames__ = __webpack_require__(3); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_classnames__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils__ = __webpack_require__(2); +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + + + + + + + +function noop() {} + +function getDefaultActiveKey(props) { + var activeKey = void 0; + __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(props.children, function (child) { + if (child && !activeKey && !child.props.disabled) { + activeKey = child.key; + } + }); + return activeKey; +} + +function activeKeyIsValid(props, key) { + var keys = __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.map(props.children, function (child) { + return child && child.key; + }); + return keys.indexOf(key) >= 0; +} + +var Tabs = function (_React$Component) { + _inherits(Tabs, _React$Component); + + function Tabs(props) { + _classCallCheck(this, Tabs); + + var _this = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); + + _initialiseProps.call(_this); + + var activeKey = void 0; + if ('activeKey' in props) { + activeKey = props.activeKey; + } else if ('defaultActiveKey' in props) { + activeKey = props.defaultActiveKey; + } else { + activeKey = getDefaultActiveKey(props); + } + + _this.state = { + activeKey: activeKey + }; + return _this; + } + + _createClass(Tabs, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if ('activeKey' in nextProps) { + this.setState({ + activeKey: nextProps.activeKey + }); + } else if (!activeKeyIsValid(nextProps, this.state.activeKey)) { + // https://github.com/ant-design/ant-design/issues/7093 + this.setState({ + activeKey: getDefaultActiveKey(nextProps) + }); + } + } + }, { + key: 'render', + value: function render() { + var _classnames; + + var props = this.props; + + var prefixCls = props.prefixCls, + navWrapper = props.navWrapper, + tabBarPosition = props.tabBarPosition, + className = props.className, + renderTabContent = props.renderTabContent, + renderTabBar = props.renderTabBar, + destroyInactiveTabPane = props.destroyInactiveTabPane, + restProps = _objectWithoutProperties(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane']); + + var cls = __WEBPACK_IMPORTED_MODULE_4_classnames___default()((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-' + tabBarPosition, 1), _defineProperty(_classnames, className, !!className), _classnames)); + + this.tabBar = renderTabBar(); + var contents = [__WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(this.tabBar, { + prefixCls: prefixCls, + navWrapper: navWrapper, + key: 'tabBar', + onKeyDown: this.onNavKeyDown, + tabBarPosition: tabBarPosition, + onTabClick: this.onTabClick, + panels: props.children, + activeKey: this.state.activeKey + }), __WEBPACK_IMPORTED_MODULE_0_react___default.a.cloneElement(renderTabContent(), { + prefixCls: prefixCls, + tabBarPosition: tabBarPosition, + activeKey: this.state.activeKey, + destroyInactiveTabPane: destroyInactiveTabPane, + children: props.children, + onChange: this.setActiveKey, + key: 'tabContent' + })]; + if (tabBarPosition === 'bottom') { + contents.reverse(); + } + return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement( + 'div', + _extends({ + className: cls, + style: props.style + }, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils__["e" /* getDataAttr */])(restProps)), + contents + ); + } + }]); + + return Tabs; +}(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component); + +var _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onTabClick = function (activeKey, e) { + if (_this2.tabBar.props.onTabClick) { + _this2.tabBar.props.onTabClick(activeKey, e); + } + _this2.setActiveKey(activeKey); + }; + + this.onNavKeyDown = function (e) { + var canDownNavKey = _this2.props.canDownNavKey; + + + if (canDownNavKey && !canDownNavKey()) { + return; + } + + var eventKeyCode = e.keyCode; + if (eventKeyCode === __WEBPACK_IMPORTED_MODULE_2__KeyCode__["a" /* default */].RIGHT || eventKeyCode === __WEBPACK_IMPORTED_MODULE_2__KeyCode__["a" /* default */].DOWN) { + e.preventDefault(); + var nextKey = _this2.getNextActiveKey(true); + _this2.onTabClick(nextKey); + } else if (eventKeyCode === __WEBPACK_IMPORTED_MODULE_2__KeyCode__["a" /* default */].LEFT || eventKeyCode === __WEBPACK_IMPORTED_MODULE_2__KeyCode__["a" /* default */].UP) { + e.preventDefault(); + var previousKey = _this2.getNextActiveKey(false); + _this2.onTabClick(previousKey); + } + }; + + this.setActiveKey = function (activeKey) { + if (_this2.state.activeKey !== activeKey) { + if (!('activeKey' in _this2.props)) { + _this2.setState({ + activeKey: activeKey + }); + } + _this2.props.onChange(activeKey); + } + }; + + this.getNextActiveKey = function (next) { + var activeKey = _this2.state.activeKey; + var children = []; + __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.forEach(_this2.props.children, function (c) { + if (c && !c.props.disabled) { + if (next) { + children.push(c); + } else { + children.unshift(c); + } + } + }); + var length = children.length; + var ret = length && children[0].key; + children.forEach(function (child, i) { + if (child.key === activeKey) { + if (i === length - 1) { + ret = children[0].key; + } else { + ret = children[i + 1].key; + } + } + }); + return ret; + }; +}; + +/* harmony default export */ __webpack_exports__["a"] = (Tabs); + + +Tabs.propTypes = { + destroyInactiveTabPane: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool, + renderTabBar: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + renderTabContent: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired, + navWrapper: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + onChange: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func, + children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.any, + prefixCls: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + className: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + tabBarPosition: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + style: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object, + activeKey: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + defaultActiveKey: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, + canDownNavKey: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func +}; + +Tabs.defaultProps = { + prefixCls: 'rc-tabs', + destroyInactiveTabPane: false, + onChange: noop, + navWrapper: function navWrapper(arg) { + return arg; + }, + tabBarPosition: 'top', + style: {} +}; + +Tabs.TabPane = __WEBPACK_IMPORTED_MODULE_3__TabPane__["a" /* default */]; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var _assign = __webpack_require__(8); + +var emptyObject = __webpack_require__(16); +var _invariant = __webpack_require__(17); + +if (process.env.NODE_ENV !== 'production') { + var warning = __webpack_require__(18); +} + +var MIXINS_KEY = 'mixins'; + +// Helper function to allow the creation of anonymous functions which do not +// have .name set to the name of the variable being assigned to. +function identity(fn) { + return fn; +} + +var ReactPropTypeLocationNames; +if (process.env.NODE_ENV !== 'production') { + ReactPropTypeLocationNames = { + prop: 'prop', + context: 'context', + childContext: 'child context' + }; +} else { + ReactPropTypeLocationNames = {}; +} + +function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) { + /** + * Policies that describe methods in `ReactClassInterface`. + */ + + var injectedMixins = []; + + /** + * Composite components are higher-level components that compose other composite + * or host components. + * + * To create a new type of `ReactClass`, pass a specification of + * your new class to `React.createClass`. The only requirement of your class + * specification is that you implement a `render` method. + * + * var MyComponent = React.createClass({ + * render: function() { + * return
Hello World
; + * } + * }); + * + * The class specification supports a specific protocol of methods that have + * special meaning (e.g. `render`). See `ReactClassInterface` for + * more the comprehensive protocol. Any other properties and methods in the + * class specification will be available on the prototype. + * + * @interface ReactClassInterface + * @internal + */ + var ReactClassInterface = { + /** + * An array of Mixin objects to include when defining your component. + * + * @type {array} + * @optional + */ + mixins: 'DEFINE_MANY', + + /** + * An object containing properties and methods that should be defined on + * the component's constructor instead of its prototype (static methods). + * + * @type {object} + * @optional + */ + statics: 'DEFINE_MANY', + + /** + * Definition of prop types for this component. + * + * @type {object} + * @optional + */ + propTypes: 'DEFINE_MANY', + + /** + * Definition of context types for this component. + * + * @type {object} + * @optional + */ + contextTypes: 'DEFINE_MANY', + + /** + * Definition of context types this component sets for its children. + * + * @type {object} + * @optional + */ + childContextTypes: 'DEFINE_MANY', + + // ==== Definition methods ==== + + /** + * Invoked when the component is mounted. Values in the mapping will be set on + * `this.props` if that prop is not specified (i.e. using an `in` check). + * + * This method is invoked before `getInitialState` and therefore cannot rely + * on `this.state` or use `this.setState`. + * + * @return {object} + * @optional + */ + getDefaultProps: 'DEFINE_MANY_MERGED', + + /** + * Invoked once before the component is mounted. The return value will be used + * as the initial value of `this.state`. + * + * getInitialState: function() { + * return { + * isOn: false, + * fooBaz: new BazFoo() + * } + * } + * + * @return {object} + * @optional + */ + getInitialState: 'DEFINE_MANY_MERGED', + + /** + * @return {object} + * @optional + */ + getChildContext: 'DEFINE_MANY_MERGED', + + /** + * Uses props from `this.props` and state from `this.state` to render the + * structure of the component. + * + * No guarantees are made about when or how often this method is invoked, so + * it must not have side effects. + * + * render: function() { + * var name = this.props.name; + * return
Hello, {name}!
; + * } + * + * @return {ReactComponent} + * @required + */ + render: 'DEFINE_ONCE', + + // ==== Delegate methods ==== + + /** + * Invoked when the component is initially created and about to be mounted. + * This may have side effects, but any external subscriptions or data created + * by this method must be cleaned up in `componentWillUnmount`. + * + * @optional + */ + componentWillMount: 'DEFINE_MANY', + + /** + * Invoked when the component has been mounted and has a DOM representation. + * However, there is no guarantee that the DOM node is in the document. + * + * Use this as an opportunity to operate on the DOM when the component has + * been mounted (initialized and rendered) for the first time. + * + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidMount: 'DEFINE_MANY', + + /** + * Invoked before the component receives new props. + * + * Use this as an opportunity to react to a prop transition by updating the + * state using `this.setState`. Current props are accessed via `this.props`. + * + * componentWillReceiveProps: function(nextProps, nextContext) { + * this.setState({ + * likesIncreasing: nextProps.likeCount > this.props.likeCount + * }); + * } + * + * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop + * transition may cause a state change, but the opposite is not true. If you + * need it, you are probably looking for `componentWillUpdate`. + * + * @param {object} nextProps + * @optional + */ + componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Invoked while deciding if the component should be updated as a result of + * receiving new props, state and/or context. + * + * Use this as an opportunity to `return false` when you're certain that the + * transition to the new props/state/context will not require a component + * update. + * + * shouldComponentUpdate: function(nextProps, nextState, nextContext) { + * return !equal(nextProps, this.props) || + * !equal(nextState, this.state) || + * !equal(nextContext, this.context); + * } + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @return {boolean} True if the component should update. + * @optional + */ + shouldComponentUpdate: 'DEFINE_ONCE', + + /** + * Invoked when the component is about to update due to a transition from + * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` + * and `nextContext`. + * + * Use this as an opportunity to perform preparation before an update occurs. + * + * NOTE: You **cannot** use `this.setState()` in this method. + * + * @param {object} nextProps + * @param {?object} nextState + * @param {?object} nextContext + * @param {ReactReconcileTransaction} transaction + * @optional + */ + componentWillUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component's DOM representation has been updated. + * + * Use this as an opportunity to operate on the DOM when the component has + * been updated. + * + * @param {object} prevProps + * @param {?object} prevState + * @param {?object} prevContext + * @param {DOMElement} rootNode DOM element representing the component. + * @optional + */ + componentDidUpdate: 'DEFINE_MANY', + + /** + * Invoked when the component is about to be removed from its parent and have + * its DOM representation destroyed. + * + * Use this as an opportunity to deallocate any external resources. + * + * NOTE: There is no `componentDidUnmount` since your component will have been + * destroyed by that point. + * + * @optional + */ + componentWillUnmount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillMount`. + * + * @optional + */ + UNSAFE_componentWillMount: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillReceiveProps`. + * + * @optional + */ + UNSAFE_componentWillReceiveProps: 'DEFINE_MANY', + + /** + * Replacement for (deprecated) `componentWillUpdate`. + * + * @optional + */ + UNSAFE_componentWillUpdate: 'DEFINE_MANY', + + // ==== Advanced methods ==== + + /** + * Updates the component's currently mounted DOM representation. + * + * By default, this implements React's rendering and reconciliation algorithm. + * Sophisticated clients may wish to override this. + * + * @param {ReactReconcileTransaction} transaction + * @internal + * @overridable + */ + updateComponent: 'OVERRIDE_BASE' + }; + + /** + * Similar to ReactClassInterface but for static methods. + */ + var ReactClassStaticInterface = { + /** + * This method is invoked after a component is instantiated and when it + * receives new props. Return an object to update state in response to + * prop changes. Return null to indicate no change to state. + * + * If an object is returned, its keys will be merged into the existing state. + * + * @return {object || null} + * @optional + */ + getDerivedStateFromProps: 'DEFINE_MANY_MERGED' + }; + + /** + * Mapping from class specification keys to special processing functions. + * + * Although these are declared like instance properties in the specification + * when defining classes using `React.createClass`, they are actually static + * and are accessible on the constructor instead of the prototype. Despite + * being static, they must be defined outside of the "statics" key under + * which all other static methods are defined. + */ + var RESERVED_SPEC_KEYS = { + displayName: function(Constructor, displayName) { + Constructor.displayName = displayName; + }, + mixins: function(Constructor, mixins) { + if (mixins) { + for (var i = 0; i < mixins.length; i++) { + mixSpecIntoComponent(Constructor, mixins[i]); + } + } + }, + childContextTypes: function(Constructor, childContextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, childContextTypes, 'childContext'); + } + Constructor.childContextTypes = _assign( + {}, + Constructor.childContextTypes, + childContextTypes + ); + }, + contextTypes: function(Constructor, contextTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, contextTypes, 'context'); + } + Constructor.contextTypes = _assign( + {}, + Constructor.contextTypes, + contextTypes + ); + }, + /** + * Special case getDefaultProps which should move into statics but requires + * automatic merging. + */ + getDefaultProps: function(Constructor, getDefaultProps) { + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps = createMergedResultFunction( + Constructor.getDefaultProps, + getDefaultProps + ); + } else { + Constructor.getDefaultProps = getDefaultProps; + } + }, + propTypes: function(Constructor, propTypes) { + if (process.env.NODE_ENV !== 'production') { + validateTypeDef(Constructor, propTypes, 'prop'); + } + Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); + }, + statics: function(Constructor, statics) { + mixStaticSpecIntoComponent(Constructor, statics); + }, + autobind: function() {} + }; + + function validateTypeDef(Constructor, typeDef, location) { + for (var propName in typeDef) { + if (typeDef.hasOwnProperty(propName)) { + // use a warning instead of an _invariant so components + // don't show up in prod but only in __DEV__ + if (process.env.NODE_ENV !== 'production') { + warning( + typeof typeDef[propName] === 'function', + '%s: %s type `%s` is invalid; it must be a function, usually from ' + + 'React.PropTypes.', + Constructor.displayName || 'ReactClass', + ReactPropTypeLocationNames[location], + propName + ); + } + } + } + } + + function validateMethodOverride(isAlreadyDefined, name) { + var specPolicy = ReactClassInterface.hasOwnProperty(name) + ? ReactClassInterface[name] + : null; + + // Disallow overriding of base class methods unless explicitly allowed. + if (ReactClassMixin.hasOwnProperty(name)) { + _invariant( + specPolicy === 'OVERRIDE_BASE', + 'ReactClassInterface: You are attempting to override ' + + '`%s` from your class specification. Ensure that your method names ' + + 'do not overlap with React methods.', + name + ); + } + + // Disallow defining methods more than once unless explicitly allowed. + if (isAlreadyDefined) { + _invariant( + specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClassInterface: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be due ' + + 'to a mixin.', + name + ); + } + } + + /** + * Mixin helper which handles policy validation and reserved + * specification keys when building React classes. + */ + function mixSpecIntoComponent(Constructor, spec) { + if (!spec) { + if (process.env.NODE_ENV !== 'production') { + var typeofSpec = typeof spec; + var isMixinValid = typeofSpec === 'object' && spec !== null; + + if (process.env.NODE_ENV !== 'production') { + warning( + isMixinValid, + "%s: You're attempting to include a mixin that is either null " + + 'or not an object. Check the mixins included by the component, ' + + 'as well as any mixins they include themselves. ' + + 'Expected object but got %s.', + Constructor.displayName || 'ReactClass', + spec === null ? null : typeofSpec + ); + } + } + + return; + } + + _invariant( + typeof spec !== 'function', + "ReactClass: You're attempting to " + + 'use a component class or function as a mixin. Instead, just use a ' + + 'regular object.' + ); + _invariant( + !isValidElement(spec), + "ReactClass: You're attempting to " + + 'use a component as a mixin. Instead, just use a regular object.' + ); + + var proto = Constructor.prototype; + var autoBindPairs = proto.__reactAutoBindPairs; + + // By handling mixins before any other properties, we ensure the same + // chaining order is applied to methods with DEFINE_MANY policy, whether + // mixins are listed before or after these methods in the spec. + if (spec.hasOwnProperty(MIXINS_KEY)) { + RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); + } + + for (var name in spec) { + if (!spec.hasOwnProperty(name)) { + continue; + } + + if (name === MIXINS_KEY) { + // We have already handled mixins in a special case above. + continue; + } + + var property = spec[name]; + var isAlreadyDefined = proto.hasOwnProperty(name); + validateMethodOverride(isAlreadyDefined, name); + + if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { + RESERVED_SPEC_KEYS[name](Constructor, property); + } else { + // Setup methods on prototype: + // The following member methods should not be automatically bound: + // 1. Expected ReactClass methods (in the "interface"). + // 2. Overridden methods (that were mixed in). + var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); + var isFunction = typeof property === 'function'; + var shouldAutoBind = + isFunction && + !isReactClassMethod && + !isAlreadyDefined && + spec.autobind !== false; + + if (shouldAutoBind) { + autoBindPairs.push(name, property); + proto[name] = property; + } else { + if (isAlreadyDefined) { + var specPolicy = ReactClassInterface[name]; + + // These cases should already be caught by validateMethodOverride. + _invariant( + isReactClassMethod && + (specPolicy === 'DEFINE_MANY_MERGED' || + specPolicy === 'DEFINE_MANY'), + 'ReactClass: Unexpected spec policy %s for key %s ' + + 'when mixing in component specs.', + specPolicy, + name + ); + + // For methods which are defined more than once, call the existing + // methods before calling the new property, merging if appropriate. + if (specPolicy === 'DEFINE_MANY_MERGED') { + proto[name] = createMergedResultFunction(proto[name], property); + } else if (specPolicy === 'DEFINE_MANY') { + proto[name] = createChainedFunction(proto[name], property); + } + } else { + proto[name] = property; + if (process.env.NODE_ENV !== 'production') { + // Add verbose displayName to the function, which helps when looking + // at profiling tools. + if (typeof property === 'function' && spec.displayName) { + proto[name].displayName = spec.displayName + '_' + name; + } + } + } + } + } + } + } + + function mixStaticSpecIntoComponent(Constructor, statics) { + if (!statics) { + return; + } + + for (var name in statics) { + var property = statics[name]; + if (!statics.hasOwnProperty(name)) { + continue; + } + + var isReserved = name in RESERVED_SPEC_KEYS; + _invariant( + !isReserved, + 'ReactClass: You are attempting to define a reserved ' + + 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + + 'as an instance property instead; it will still be accessible on the ' + + 'constructor.', + name + ); + + var isAlreadyDefined = name in Constructor; + if (isAlreadyDefined) { + var specPolicy = ReactClassStaticInterface.hasOwnProperty(name) + ? ReactClassStaticInterface[name] + : null; + + _invariant( + specPolicy === 'DEFINE_MANY_MERGED', + 'ReactClass: You are attempting to define ' + + '`%s` on your component more than once. This conflict may be ' + + 'due to a mixin.', + name + ); + + Constructor[name] = createMergedResultFunction(Constructor[name], property); + + return; + } + + Constructor[name] = property; + } + } + + /** + * Merge two objects, but throw if both contain the same key. + * + * @param {object} one The first object, which is mutated. + * @param {object} two The second object + * @return {object} one after it has been mutated to contain everything in two. + */ + function mergeIntoWithNoDuplicateKeys(one, two) { + _invariant( + one && two && typeof one === 'object' && typeof two === 'object', + 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' + ); + + for (var key in two) { + if (two.hasOwnProperty(key)) { + _invariant( + one[key] === undefined, + 'mergeIntoWithNoDuplicateKeys(): ' + + 'Tried to merge two objects with the same key: `%s`. This conflict ' + + 'may be due to a mixin; in particular, this may be caused by two ' + + 'getInitialState() or getDefaultProps() methods returning objects ' + + 'with clashing keys.', + key + ); + one[key] = two[key]; + } + } + return one; + } + + /** + * Creates a function that invokes two functions and merges their return values. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createMergedResultFunction(one, two) { + return function mergedResult() { + var a = one.apply(this, arguments); + var b = two.apply(this, arguments); + if (a == null) { + return b; + } else if (b == null) { + return a; + } + var c = {}; + mergeIntoWithNoDuplicateKeys(c, a); + mergeIntoWithNoDuplicateKeys(c, b); + return c; + }; + } + + /** + * Creates a function that invokes two functions and ignores their return vales. + * + * @param {function} one Function to invoke first. + * @param {function} two Function to invoke second. + * @return {function} Function that invokes the two argument functions. + * @private + */ + function createChainedFunction(one, two) { + return function chainedFunction() { + one.apply(this, arguments); + two.apply(this, arguments); + }; + } + + /** + * Binds a method to the component. + * + * @param {object} component Component whose method is going to be bound. + * @param {function} method Method to be bound. + * @return {function} The bound method. + */ + function bindAutoBindMethod(component, method) { + var boundMethod = method.bind(component); + if (process.env.NODE_ENV !== 'production') { + boundMethod.__reactBoundContext = component; + boundMethod.__reactBoundMethod = method; + boundMethod.__reactBoundArguments = null; + var componentName = component.constructor.displayName; + var _bind = boundMethod.bind; + boundMethod.bind = function(newThis) { + for ( + var _len = arguments.length, + args = Array(_len > 1 ? _len - 1 : 0), + _key = 1; + _key < _len; + _key++ + ) { + args[_key - 1] = arguments[_key]; + } + + // User is trying to bind() an autobound method; we effectively will + // ignore the value of "this" that the user is trying to use, so + // let's warn. + if (newThis !== component && newThis !== null) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): React component methods may only be bound to the ' + + 'component instance. See %s', + componentName + ); + } + } else if (!args.length) { + if (process.env.NODE_ENV !== 'production') { + warning( + false, + 'bind(): You are binding a component method to the component. ' + + 'React does this for you automatically in a high-performance ' + + 'way, so you can safely remove this call. See %s', + componentName + ); + } + return boundMethod; + } + var reboundMethod = _bind.apply(boundMethod, arguments); + reboundMethod.__reactBoundContext = component; + reboundMethod.__reactBoundMethod = method; + reboundMethod.__reactBoundArguments = args; + return reboundMethod; + }; + } + return boundMethod; + } + + /** + * Binds all auto-bound methods in a component. + * + * @param {object} component Component whose method is going to be bound. + */ + function bindAutoBindMethods(component) { + var pairs = component.__reactAutoBindPairs; + for (var i = 0; i < pairs.length; i += 2) { + var autoBindKey = pairs[i]; + var method = pairs[i + 1]; + component[autoBindKey] = bindAutoBindMethod(component, method); + } + } + + var IsMountedPreMixin = { + componentDidMount: function() { + this.__isMounted = true; + } + }; + + var IsMountedPostMixin = { + componentWillUnmount: function() { + this.__isMounted = false; + } + }; + + /** + * Add more to the ReactClass base class. These are all legacy features and + * therefore not already part of the modern ReactComponent. + */ + var ReactClassMixin = { + /** + * TODO: This will be deprecated because state should always keep a consistent + * type signature and the only use case for this, is to avoid that. + */ + replaceState: function(newState, callback) { + this.updater.enqueueReplaceState(this, newState, callback); + }, + + /** + * Checks whether or not this composite component is mounted. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */ + isMounted: function() { + if (process.env.NODE_ENV !== 'production') { + warning( + this.__didWarnIsMounted, + '%s: isMounted is deprecated. Instead, make sure to clean up ' + + 'subscriptions and pending requests in componentWillUnmount to ' + + 'prevent memory leaks.', + (this.constructor && this.constructor.displayName) || + this.name || + 'Component' + ); + this.__didWarnIsMounted = true; + } + return !!this.__isMounted; + } + }; + + var ReactClassComponent = function() {}; + _assign( + ReactClassComponent.prototype, + ReactComponent.prototype, + ReactClassMixin + ); + + /** + * Creates a composite component class given a class specification. + * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass + * + * @param {object} spec Class specification (which must define `render`). + * @return {function} Component constructor function. + * @public + */ + function createClass(spec) { + // To keep our warnings more understandable, we'll use a little hack here to + // ensure that Constructor.name !== 'Constructor'. This makes sure we don't + // unnecessarily identify a class without displayName as 'Constructor'. + var Constructor = identity(function(props, context, updater) { + // This constructor gets overridden by mocks. The argument is used + // by mocks to assert on what gets mounted. + + if (process.env.NODE_ENV !== 'production') { + warning( + this instanceof Constructor, + 'Something is calling a React component directly. Use a factory or ' + + 'JSX instead. See: https://fb.me/react-legacyfactory' + ); + } + + // Wire up auto-binding + if (this.__reactAutoBindPairs.length) { + bindAutoBindMethods(this); + } + + this.props = props; + this.context = context; + this.refs = emptyObject; + this.updater = updater || ReactNoopUpdateQueue; + + this.state = null; + + // ReactClasses doesn't have constructors. Instead, they use the + // getInitialState and componentWillMount methods for initialization. + + var initialState = this.getInitialState ? this.getInitialState() : null; + if (process.env.NODE_ENV !== 'production') { + // We allow auto-mocks to proceed as if they're returning null. + if ( + initialState === undefined && + this.getInitialState._isMockFunction + ) { + // This is probably bad practice. Consider warning here and + // deprecating this convenience. + initialState = null; + } + } + _invariant( + typeof initialState === 'object' && !Array.isArray(initialState), + '%s.getInitialState(): must return an object or null', + Constructor.displayName || 'ReactCompositeComponent' + ); + + this.state = initialState; + }); + Constructor.prototype = new ReactClassComponent(); + Constructor.prototype.constructor = Constructor; + Constructor.prototype.__reactAutoBindPairs = []; + + injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); + + mixSpecIntoComponent(Constructor, IsMountedPreMixin); + mixSpecIntoComponent(Constructor, spec); + mixSpecIntoComponent(Constructor, IsMountedPostMixin); + + // Initialize the defaultProps property after all mixins have been merged. + if (Constructor.getDefaultProps) { + Constructor.defaultProps = Constructor.getDefaultProps(); + } + + if (process.env.NODE_ENV !== 'production') { + // This is a tag to indicate that the use of these method names is ok, + // since it's used with createClass. If it's not, then it's likely a + // mistake so we'll warn you to use the static property, property + // initializer or constructor respectively. + if (Constructor.getDefaultProps) { + Constructor.getDefaultProps.isReactClassApproved = {}; + } + if (Constructor.prototype.getInitialState) { + Constructor.prototype.getInitialState.isReactClassApproved = {}; + } + } + + _invariant( + Constructor.prototype.render, + 'createClass(...): Class specification must implement a `render` method.' + ); + + if (process.env.NODE_ENV !== 'production') { + warning( + !Constructor.prototype.componentShouldUpdate, + '%s has a method called ' + + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + + 'The name is phrased as a question because the function is ' + + 'expected to return a value.', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.componentWillRecieveProps, + '%s has a method called ' + + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + warning( + !Constructor.prototype.UNSAFE_componentWillRecieveProps, + '%s has a method called UNSAFE_componentWillRecieveProps(). ' + + 'Did you mean UNSAFE_componentWillReceiveProps()?', + spec.displayName || 'A component' + ); + } + + // Reduce time spent doing lookups by setting these on the prototype. + for (var methodName in ReactClassInterface) { + if (!Constructor.prototype[methodName]) { + Constructor.prototype[methodName] = null; + } + } + + return Constructor; + } + + return createClass; +} + +module.exports = factory; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + +function makeEmptyFunction(arg) { + return function () { + return arg; + }; +} + +/** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ +var emptyFunction = function emptyFunction() {}; + +emptyFunction.thatReturns = makeEmptyFunction; +emptyFunction.thatReturnsFalse = makeEmptyFunction(false); +emptyFunction.thatReturnsTrue = makeEmptyFunction(true); +emptyFunction.thatReturnsNull = makeEmptyFunction(null); +emptyFunction.thatReturnsThis = function () { + return this; +}; +emptyFunction.thatReturnsArgument = function (arg) { + return arg; +}; + +module.exports = emptyFunction; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var emptyObject = {}; + +if (process.env.NODE_ENV !== 'production') { + Object.freeze(emptyObject); +} + +module.exports = emptyObject; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var validateFormat = function validateFormat(format) {}; + +if (process.env.NODE_ENV !== 'production') { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; +} + +function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +} + +module.exports = invariant; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + + +var emptyFunction = __webpack_require__(15); + +/** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + +var warning = emptyFunction; + +if (process.env.NODE_ENV !== 'production') { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; +} + +module.exports = warning; +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + var ReactPropTypesSecret = __webpack_require__(5); + var loggedTypeFailures = {}; + + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +/** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (process.env.NODE_ENV !== 'production') { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + if (typeof typeSpecs[typeSpecName] !== 'function') { + var err = Error( + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + ); + err.name = 'Invariant Violation'; + throw err; + } + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + if (error && !(error instanceof Error)) { + printWarning( + (componentName || 'React class') + ': type specification of ' + + location + ' `' + typeSpecName + '` is invalid; the type checker ' + + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + + 'You may have forgotten to pass an argument to the type checker ' + + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + + 'shape all require an argument).' + ) + + } + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + printWarning( + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') + ); + } + } + } + } +} + +module.exports = checkPropTypes; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var ReactPropTypesSecret = __webpack_require__(5); + +function emptyFunction() {} + +module.exports = function() { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === ReactPropTypesSecret) { + // It is still safe when called from React. + return; + } + var err = 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' + ); + err.name = 'Invariant Violation'; + throw err; + }; + shim.isRequired = shim; + function getShim() { + return shim; + }; + // Important! + // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + + any: shim, + arrayOf: getShim, + element: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim + }; + + ReactPropTypes.checkPropTypes = emptyFunction; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) {/** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + + +var assign = __webpack_require__(8); + +var ReactPropTypesSecret = __webpack_require__(5); +var checkPropTypes = __webpack_require__(19); + +var printWarning = function() {}; + +if (process.env.NODE_ENV !== 'production') { + printWarning = function(text) { + var message = 'Warning: ' + text; + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; +} + +function emptyFunctionThatReturnsNull() { + return null; +} + +module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (process.env.NODE_ENV !== 'production') { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + var err = 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' + ); + err.name = 'Invariant Violation'; + throw err; + } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + printWarning( + 'You are manually calling a React.PropTypes validation ' + + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunctionThatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunctionThatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + printWarning( + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' + ); + return emptyFunctionThatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; +}; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(9); +module.exports = __webpack_require__(10); + + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=rc-tabs.js.map \ No newline at end of file diff --git a/dist/rc-tabs.js.map b/dist/rc-tabs.js.map new file mode 100644 index 00000000..2fc45868 --- /dev/null +++ b/dist/rc-tabs.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 0249b7501a866026ae24","webpack:///./~/process/browser.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///./src/utils.js","webpack:///./~/classnames/index.js","webpack:///./~/prop-types/index.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js","webpack:///./src/TabPane.js","webpack:///./~/create-react-class/index.js","webpack:///./~/object-assign/index.js","webpack:///./src/index.js","webpack:///./assets/index.less?796e","webpack:///./src/KeyCode.js","webpack:///./src/TabContent.js","webpack:///./src/Tabs.js","webpack:///./~/create-react-class/factory.js","webpack:///./~/fbjs/lib/emptyFunction.js","webpack:///./~/fbjs/lib/emptyObject.js","webpack:///./~/fbjs/lib/invariant.js","webpack:///./~/fbjs/lib/warning.js","webpack:///./~/prop-types/checkPropTypes.js","webpack:///./~/prop-types/factoryWithThrowingShims.js","webpack:///./~/prop-types/factoryWithTypeCheckers.js"],"names":["toArray","children","c","React","Children","forEach","child","push","getActiveIndex","activeKey","i","length","key","getActiveKey","index","setTransform","style","v","transform","webkitTransform","mozTransform","isTransformSupported","setTransition","transition","webkitTransition","MozTransition","getTransformPropValue","WebkitTransform","MozTransform","isVertical","tabBarPosition","getTransformByIndex","translate","getMarginStyle","marginDirection","getStyle","el","property","getComputedStyle","getPropertyValue","replace","setPxStyle","value","vertical","getDataAttr","props","Object","keys","reduce","prev","substr","TabPane","createReactClass","displayName","propTypes","className","PropTypes","string","active","bool","any","destroyInactiveTabPane","forceRender","placeholder","node","getDefaultProps","render","rootPrefixCls","restProps","_isActived","prefixCls","cls","classnames","isRender","LEFT","UP","RIGHT","DOWN","TabContent","animated","animatedWithMargin","getTabPanes","newChildren","cloneElement","classes","activeIndex","animatedStyle","display","noop","getDefaultActiveKey","disabled","activeKeyIsValid","map","indexOf","Tabs","defaultActiveKey","state","nextProps","setState","navWrapper","renderTabContent","renderTabBar","tabBar","contents","onKeyDown","onNavKeyDown","onTabClick","panels","onChange","setActiveKey","reverse","Component","e","canDownNavKey","eventKeyCode","keyCode","KeyCode","preventDefault","nextKey","getNextActiveKey","previousKey","next","unshift","ret","func","isRequired","object","defaultProps","arg"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;AChEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;ACvLtC,+C;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAEO,SAASA,OAAT,CAAiBC,QAAjB,EAA2B;AAChC;AACA,MAAMC,IAAI,EAAV;AACAC,EAAA,6CAAAA,CAAMC,QAAN,CAAeC,OAAf,CAAuBJ,QAAvB,EAAiC,iBAAS;AACxC,QAAIK,KAAJ,EAAW;AACTJ,QAAEK,IAAF,CAAOD,KAAP;AACD;AACF,GAJD;AAKA,SAAOJ,CAAP;AACD;;AAEM,SAASM,cAAT,CAAwBP,QAAxB,EAAkCQ,SAAlC,EAA6C;AAClD,MAAMP,IAAIF,QAAQC,QAAR,CAAV;AACA,OAAK,IAAIS,IAAI,CAAb,EAAgBA,IAAIR,EAAES,MAAtB,EAA8BD,GAA9B,EAAmC;AACjC,QAAIR,EAAEQ,CAAF,EAAKE,GAAL,KAAaH,SAAjB,EAA4B;AAC1B,aAAOC,CAAP;AACD;AACF;AACD,SAAO,CAAC,CAAR;AACD;;AAEM,SAASG,YAAT,CAAsBZ,QAAtB,EAAgCa,KAAhC,EAAuC;AAC5C,MAAMZ,IAAIF,QAAQC,QAAR,CAAV;AACA,SAAOC,EAAEY,KAAF,EAASF,GAAhB;AACD;;AAEM,SAASG,YAAT,CAAsBC,KAAtB,EAA6BC,CAA7B,EAAgC;AACrCD,QAAME,SAAN,GAAkBD,CAAlB;AACAD,QAAMG,eAAN,GAAwBF,CAAxB;AACAD,QAAMI,YAAN,GAAqBH,CAArB;AACD;;AAEM,SAASI,oBAAT,CAA8BL,KAA9B,EAAqC;AAC1C,SAAO,eAAeA,KAAf,IACL,qBAAqBA,KADhB,IAEL,kBAAkBA,KAFpB;AAGD;;AAEM,SAASM,aAAT,CAAuBN,KAAvB,EAA8BC,CAA9B,EAAiC;AACtCD,QAAMO,UAAN,GAAmBN,CAAnB;AACAD,QAAMQ,gBAAN,GAAyBP,CAAzB;AACAD,QAAMS,aAAN,GAAsBR,CAAtB;AACD;AACM,SAASS,qBAAT,CAA+BT,CAA/B,EAAkC;AACvC,SAAO;AACLC,eAAWD,CADN;AAELU,qBAAiBV,CAFZ;AAGLW,kBAAcX;AAHT,GAAP;AAKD;;AAEM,SAASY,UAAT,CAAoBC,cAApB,EAAoC;AACzC,SAAOA,mBAAmB,MAAnB,IAA6BA,mBAAmB,OAAvD;AACD;;AAEM,SAASC,mBAAT,CAA6BjB,KAA7B,EAAoCgB,cAApC,EAAoD;AACzD,MAAME,YAAYH,WAAWC,cAAX,IAA6B,YAA7B,GAA4C,YAA9D;AACA,SAAUE,SAAV,SAAuB,CAAClB,KAAD,GAAS,GAAhC;AACD;;AAEM,SAASmB,cAAT,CAAwBnB,KAAxB,EAA+BgB,cAA/B,EAA+C;AACpD,MAAMI,kBAAkBL,WAAWC,cAAX,IAA6B,WAA7B,GAA2C,YAAnE;AACA,6BACGI,eADH,EACwB,CAACpB,KAAD,GAAS,GADjC;AAGD;;AAEM,SAASqB,QAAT,CAAkBC,EAAlB,EAAsBC,QAAtB,EAAgC;AACrC,SAAO,CAACC,iBAAiBF,EAAjB,EAAqBG,gBAArB,CAAsCF,QAAtC,EAAgDG,OAAhD,CAAwD,IAAxD,EAA8D,EAA9D,CAAR;AACD;;AAEM,SAASC,UAAT,CAAoBL,EAApB,EAAwBM,KAAxB,EAA+BC,QAA/B,EAAyC;AAC9CD,UAAQC,qBAAmBD,KAAnB,eAAuCA,KAAvC,iBAAR;AACA3B,eAAaqB,GAAGpB,KAAhB,mBAAsC0B,KAAtC;AACD;;AAEM,SAASE,WAAT,CAAqBC,KAArB,EAA4B;AACjC,SAAOC,OAAOC,IAAP,CAAYF,KAAZ,EAAmBG,MAAnB,CAA0B,UAACC,IAAD,EAAOrC,GAAP,EAAe;AAC9C,QAAIA,IAAIsC,MAAJ,CAAW,CAAX,EAAc,CAAd,MAAqB,OAArB,IAAgCtC,IAAIsC,MAAJ,CAAW,CAAX,EAAc,CAAd,MAAqB,OAArD,IAAgEtC,QAAQ,MAA5E,EAAoF;AAClFqC,WAAKrC,GAAL,IAAYiC,MAAMjC,GAAN,CAAZ;AACD;AACD,WAAOqC,IAAP;AACD,GALM,EAKJ,EALI,CAAP;AAMD,C;;;;;;ACrFD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gBAAgB;;AAEhB;AACA;;AAEA,iBAAiB,sBAAsB;AACvC;AACA;;AAEA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA,GAAG;AAAA;AACH,EAAE;AACF;AACA;AACA,CAAC;;;;;;;ACnDD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;AAEA,IAAME,UAAU,0DAAAC,CAAiB;AAC/BC,eAAa,SADkB;AAE/BC,aAAW;AACTC,eAAW,kDAAAC,CAAUC,MADZ;AAETC,YAAQ,kDAAAF,CAAUG,IAFT;AAGT3C,WAAO,kDAAAwC,CAAUI,GAHR;AAITC,4BAAwB,kDAAAL,CAAUG,IAJzB;AAKTG,iBAAa,kDAAAN,CAAUG,IALd;AAMTI,iBAAa,kDAAAP,CAAUQ;AANd,GAFoB;AAU/BC,iBAV+B,6BAUb;AAChB,WAAO,EAAEF,aAAa,IAAf,EAAP;AACD,GAZ8B;AAa/BG,QAb+B,oBAatB;AAAA;;AAAA,iBAIH,KAAKrB,KAJF;AAAA,QAELU,SAFK,UAELA,SAFK;AAAA,QAEMM,sBAFN,UAEMA,sBAFN;AAAA,QAE8BH,MAF9B,UAE8BA,MAF9B;AAAA,QAEsCI,WAFtC,UAEsCA,WAFtC;AAAA,QAGLK,aAHK,UAGLA,aAHK;AAAA,QAGUnD,KAHV,UAGUA,KAHV;AAAA,QAGiBf,QAHjB,UAGiBA,QAHjB;AAAA,QAG2B8D,WAH3B,UAG2BA,WAH3B;AAAA,QAG2CK,SAH3C;;AAKP,SAAKC,UAAL,GAAkB,KAAKA,UAAL,IAAmBX,MAArC;AACA,QAAMY,YAAeH,aAAf,aAAN;AACA,QAAMI,MAAM,kDAAAC,iDACTF,SADS,EACG,CADH,gCAENA,SAFM,gBAEiB,CAACZ,MAFlB,gCAGNY,SAHM,cAGeZ,MAHf,gCAITH,SAJS,EAIGA,SAJH,gBAAZ;AAMA,QAAMkB,WAAWZ,yBAAyBH,MAAzB,GAAkC,KAAKW,UAAxD;AACA,WACE;AAAA;AAAA;AACE,eAAOrD,KADT;AAEE,cAAK,UAFP;AAGE,uBAAa0C,SAAS,OAAT,GAAmB,MAHlC;AAIE,mBAAWa;AAJb,SAKM,kFAAA3B,CAAYwB,SAAZ,CALN;AAOGK,kBAAYX,WAAZ,GAA0B7D,QAA1B,GAAqC8D;AAPxC,KADF;AAWD;AAtC8B,CAAjB,CAAhB;;AAyCA,yDAAeZ,OAAf,E;;;;;;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,gCAAgC;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH,kCAAkC;AAClC;AACA;AACA;;AAEA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,gBAAgB,sBAAsB;AACtC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;ACzFA;AACA;AACA;;AAEA,+DAAe,sDAAf;;;;;;;ACJA,yC;;;;;;;ACAA,yDAAe;AACb;;;AAGAuB,QAAM,EAJO,EAIH;AACV;;;AAGAC,MAAI,EARS,EAQL;AACR;;;AAGAC,SAAO,EAZM,EAYF;AACX;;;AAGAC,QAAM,EAhBO,CAgBH;AAhBG,CAAf,E;;;;;;;;;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;;AAOA,IAAMC,aAAa,0DAAA1B,CAAiB;AAClCC,eAAa,YADqB;AAElCC,aAAW;AACTyB,cAAU,kDAAAvB,CAAUG,IADX;AAETqB,wBAAoB,kDAAAxB,CAAUG,IAFrB;AAGTW,eAAW,kDAAAd,CAAUC,MAHZ;AAITxD,cAAU,kDAAAuD,CAAUI,GAJX;AAKTnD,eAAW,kDAAA+C,CAAUC,MALZ;AAMTzC,WAAO,kDAAAwC,CAAUI,GANR;AAOT9B,oBAAgB,kDAAA0B,CAAUC;AAPjB,GAFuB;AAWlCQ,iBAXkC,6BAWhB;AAChB,WAAO;AACLc,gBAAU;AADL,KAAP;AAGD,GAfiC;AAgBlCE,aAhBkC,yBAgBpB;AACZ,QAAMpC,QAAQ,KAAKA,KAAnB;AACA,QAAMpC,YAAYoC,MAAMpC,SAAxB;AACA,QAAMR,WAAW4C,MAAM5C,QAAvB;AACA,QAAMiF,cAAc,EAApB;;AAEA/E,IAAA,6CAAAA,CAAMC,QAAN,CAAeC,OAAf,CAAuBJ,QAAvB,EAAiC,UAACK,KAAD,EAAW;AAC1C,UAAI,CAACA,KAAL,EAAY;AACV;AACD;AACD,UAAMM,MAAMN,MAAMM,GAAlB;AACA,UAAM8C,SAASjD,cAAcG,GAA7B;AACAsE,kBAAY3E,IAAZ,CAAiB,6CAAAJ,CAAMgF,YAAN,CAAmB7E,KAAnB,EAA0B;AACzCoD,sBADyC;AAEzCG,gCAAwBhB,MAAMgB,sBAFW;AAGzCM,uBAAetB,MAAMyB;AAHoB,OAA1B,CAAjB;AAKD,KAXD;;AAaA,WAAOY,WAAP;AACD,GApCiC;AAqClChB,QArCkC,oBAqCzB;AAAA;;AAAA,QACCrB,KADD,GACW,IADX,CACCA,KADD;AAAA,QAGLyB,SAHK,GAKHzB,KALG,CAGLyB,SAHK;AAAA,QAGMrE,QAHN,GAKH4C,KALG,CAGM5C,QAHN;AAAA,QAGgBQ,SAHhB,GAKHoC,KALG,CAGgBpC,SAHhB;AAAA,QAILqB,cAJK,GAKHe,KALG,CAILf,cAJK;AAAA,QAIWiD,QAJX,GAKHlC,KALG,CAIWkC,QAJX;AAAA,QAIqBC,kBAJrB,GAKHnC,KALG,CAIqBmC,kBAJrB;AAAA,QAMDhE,KANC,GAMS6B,KANT,CAMD7B,KANC;;AAOP,QAAMoE,UAAU,kDAAAZ,iDACVF,SADU,eACY,IADZ,gCAEbS,WACIT,SADJ,yBAEIA,SAFJ,yBAFa,EAIyB,IAJzB,gBAAhB;AAMA,QAAIS,QAAJ,EAAc;AACZ,UAAMM,cAAc,qFAAA7E,CAAeP,QAAf,EAAyBQ,SAAzB,CAApB;AACA,UAAI4E,gBAAgB,CAAC,CAArB,EAAwB;AACtB,YAAMC,gBAAgBN,qBACd,qFAAA/C,CAAeoD,WAAf,EAA4BvD,cAA5B,CADc,GAEd,4FAAAJ,CAAsB,0FAAAK,CAAoBsD,WAApB,EAAiCvD,cAAjC,CAAtB,CAFR;AAGAd,6BACKA,KADL,EAEKsE,aAFL;AAID,OARD,MAQO;AACLtE,6BACKA,KADL;AAEEuE,mBAAS;AAFX;AAID;AACF;AACD,WACE;AAAA;AAAA;AACE,mBAAWH,OADb;AAEE,eAAOpE;AAFT;AAIG,WAAKiE,WAAL;AAJH,KADF;AAQD;AA3EiC,CAAjB,CAAnB;;AA8EA,yDAAeH,UAAf,E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASU,IAAT,GAAgB,CACf;;AAED,SAASC,mBAAT,CAA6B5C,KAA7B,EAAoC;AAClC,MAAIpC,kBAAJ;AACAN,EAAA,6CAAAA,CAAMC,QAAN,CAAeC,OAAf,CAAuBwC,MAAM5C,QAA7B,EAAuC,UAACK,KAAD,EAAW;AAChD,QAAIA,SAAS,CAACG,SAAV,IAAuB,CAACH,MAAMuC,KAAN,CAAY6C,QAAxC,EAAkD;AAChDjF,kBAAYH,MAAMM,GAAlB;AACD;AACF,GAJD;AAKA,SAAOH,SAAP;AACD;;AAED,SAASkF,gBAAT,CAA0B9C,KAA1B,EAAiCjC,GAAjC,EAAsC;AACpC,MAAMmC,OAAO,6CAAA5C,CAAMC,QAAN,CAAewF,GAAf,CAAmB/C,MAAM5C,QAAzB,EAAmC;AAAA,WAASK,SAASA,MAAMM,GAAxB;AAAA,GAAnC,CAAb;AACA,SAAOmC,KAAK8C,OAAL,CAAajF,GAAb,KAAqB,CAA5B;AACD;;IAEoBkF,I;;;AACnB,gBAAYjD,KAAZ,EAAmB;AAAA;;AAAA,4GACXA,KADW;;AAAA;;AAGjB,QAAIpC,kBAAJ;AACA,QAAI,eAAeoC,KAAnB,EAA0B;AACxBpC,kBAAYoC,MAAMpC,SAAlB;AACD,KAFD,MAEO,IAAI,sBAAsBoC,KAA1B,EAAiC;AACtCpC,kBAAYoC,MAAMkD,gBAAlB;AACD,KAFM,MAEA;AACLtF,kBAAYgF,oBAAoB5C,KAApB,CAAZ;AACD;;AAED,UAAKmD,KAAL,GAAa;AACXvF;AADW,KAAb;AAZiB;AAelB;;;;8CAEyBwF,S,EAAW;AACnC,UAAI,eAAeA,SAAnB,EAA8B;AAC5B,aAAKC,QAAL,CAAc;AACZzF,qBAAWwF,UAAUxF;AADT,SAAd;AAGD,OAJD,MAIO,IAAI,CAACkF,iBAAiBM,SAAjB,EAA4B,KAAKD,KAAL,CAAWvF,SAAvC,CAAL,EAAwD;AAC7D;AACA,aAAKyF,QAAL,CAAc;AACZzF,qBAAWgF,oBAAoBQ,SAApB;AADC,SAAd;AAGD;AACF;;;6BAiEQ;AAAA;;AACP,UAAMpD,QAAQ,KAAKA,KAAnB;;AADO,UAGLyB,SAHK,GAUHzB,KAVG,CAGLyB,SAHK;AAAA,UAIL6B,UAJK,GAUHtD,KAVG,CAILsD,UAJK;AAAA,UAKLrE,cALK,GAUHe,KAVG,CAKLf,cALK;AAAA,UAKWyB,SALX,GAUHV,KAVG,CAKWU,SALX;AAAA,UAML6C,gBANK,GAUHvD,KAVG,CAMLuD,gBANK;AAAA,UAOLC,YAPK,GAUHxD,KAVG,CAOLwD,YAPK;AAAA,UAQLxC,sBARK,GAUHhB,KAVG,CAQLgB,sBARK;AAAA,UASFO,SATE,4BAUHvB,KAVG;;AAWP,UAAM0B,MAAM,kDAAAC,iDACTF,SADS,EACG,CADH,gCAENA,SAFM,SAEOxC,cAFP,EAE0B,CAF1B,gCAGTyB,SAHS,EAGG,CAAC,CAACA,SAHL,gBAAZ;;AAMA,WAAK+C,MAAL,GAAcD,cAAd;AACA,UAAME,WAAW,CACf,6CAAApG,CAAMgF,YAAN,CAAmB,KAAKmB,MAAxB,EAAgC;AAC9BhC,4BAD8B;AAE9B6B,8BAF8B;AAG9BvF,aAAK,QAHyB;AAI9B4F,mBAAW,KAAKC,YAJc;AAK9B3E,sCAL8B;AAM9B4E,oBAAY,KAAKA,UANa;AAO9BC,gBAAQ9D,MAAM5C,QAPgB;AAQ9BQ,mBAAW,KAAKuF,KAAL,CAAWvF;AARQ,OAAhC,CADe,EAWf,6CAAAN,CAAMgF,YAAN,CAAmBiB,kBAAnB,EAAuC;AACrC9B,4BADqC;AAErCxC,sCAFqC;AAGrCrB,mBAAW,KAAKuF,KAAL,CAAWvF,SAHe;AAIrCoD,sDAJqC;AAKrC5D,kBAAU4C,MAAM5C,QALqB;AAMrC2G,kBAAU,KAAKC,YANsB;AAOrCjG,aAAK;AAPgC,OAAvC,CAXe,CAAjB;AAqBA,UAAIkB,mBAAmB,QAAvB,EAAiC;AAC/ByE,iBAASO,OAAT;AACD;AACD,aACE;AAAA;AAAA;AACE,qBAAWvC,GADb;AAEE,iBAAO1B,MAAM7B;AAFf,WAGM,kFAAA4B,CAAYwB,SAAZ,CAHN;AAKGmC;AALH,OADF;AASD;;;;EAjJ+B,6CAAApG,CAAM4G,S;;;;;OA+BtCL,U,GAAa,UAACjG,SAAD,EAAYuG,CAAZ,EAAkB;AAC7B,QAAI,OAAKV,MAAL,CAAYzD,KAAZ,CAAkB6D,UAAtB,EAAkC;AAChC,aAAKJ,MAAL,CAAYzD,KAAZ,CAAkB6D,UAAlB,CAA6BjG,SAA7B,EAAwCuG,CAAxC;AACD;AACD,WAAKH,YAAL,CAAkBpG,SAAlB;AACD,G;;OAEDgG,Y,GAAe,UAACO,CAAD,EAAO;AAAA,QACZC,aADY,GACM,OAAKpE,KADX,CACZoE,aADY;;;AAGpB,QAAIA,iBAAiB,CAACA,eAAtB,EAAuC;AACrC;AACD;;AAED,QAAMC,eAAeF,EAAEG,OAAvB;AACA,QAAID,iBAAiB,yDAAAE,CAAQxC,KAAzB,IAAkCsC,iBAAiB,yDAAAE,CAAQvC,IAA/D,EAAqE;AACnEmC,QAAEK,cAAF;AACA,UAAMC,UAAU,OAAKC,gBAAL,CAAsB,IAAtB,CAAhB;AACA,aAAKb,UAAL,CAAgBY,OAAhB;AACD,KAJD,MAIO,IAAIJ,iBAAiB,yDAAAE,CAAQ1C,IAAzB,IAAiCwC,iBAAiB,yDAAAE,CAAQzC,EAA9D,EAAkE;AACvEqC,QAAEK,cAAF;AACA,UAAMG,cAAc,OAAKD,gBAAL,CAAsB,KAAtB,CAApB;AACA,aAAKb,UAAL,CAAgBc,WAAhB;AACD;AACF,G;;OAEDX,Y,GAAe,UAACpG,SAAD,EAAe;AAC5B,QAAI,OAAKuF,KAAL,CAAWvF,SAAX,KAAyBA,SAA7B,EAAwC;AACtC,UAAI,EAAE,eAAe,OAAKoC,KAAtB,CAAJ,EAAkC;AAChC,eAAKqD,QAAL,CAAc;AACZzF;AADY,SAAd;AAGD;AACD,aAAKoC,KAAL,CAAW+D,QAAX,CAAoBnG,SAApB;AACD;AACF,G;;OAED8G,gB,GAAmB,UAACE,IAAD,EAAU;AAC3B,QAAMhH,YAAY,OAAKuF,KAAL,CAAWvF,SAA7B;AACA,QAAMR,WAAW,EAAjB;AACAE,IAAA,6CAAAA,CAAMC,QAAN,CAAeC,OAAf,CAAuB,OAAKwC,KAAL,CAAW5C,QAAlC,EAA4C,UAACC,CAAD,EAAO;AACjD,UAAIA,KAAK,CAACA,EAAE2C,KAAF,CAAQ6C,QAAlB,EAA4B;AAC1B,YAAI+B,IAAJ,EAAU;AACRxH,mBAASM,IAAT,CAAcL,CAAd;AACD,SAFD,MAEO;AACLD,mBAASyH,OAAT,CAAiBxH,CAAjB;AACD;AACF;AACF,KARD;AASA,QAAMS,SAASV,SAASU,MAAxB;AACA,QAAIgH,MAAMhH,UAAUV,SAAS,CAAT,EAAYW,GAAhC;AACAX,aAASI,OAAT,CAAiB,UAACC,KAAD,EAAQI,CAAR,EAAc;AAC7B,UAAIJ,MAAMM,GAAN,KAAcH,SAAlB,EAA6B;AAC3B,YAAIC,MAAMC,SAAS,CAAnB,EAAsB;AACpBgH,gBAAM1H,SAAS,CAAT,EAAYW,GAAlB;AACD,SAFD,MAEO;AACL+G,gBAAM1H,SAASS,IAAI,CAAb,EAAgBE,GAAtB;AACD;AACF;AACF,KARD;AASA,WAAO+G,GAAP;AACD,G;;;yDA5FkB7B,I;;;AAoJrBA,KAAKxC,SAAL,GAAiB;AACfO,0BAAwB,kDAAAL,CAAUG,IADnB;AAEf0C,gBAAc,kDAAA7C,CAAUoE,IAAV,CAAeC,UAFd;AAGfzB,oBAAkB,kDAAA5C,CAAUoE,IAAV,CAAeC,UAHlB;AAIf1B,cAAY,kDAAA3C,CAAUoE,IAJP;AAKfhB,YAAU,kDAAApD,CAAUoE,IALL;AAMf3H,YAAU,kDAAAuD,CAAUI,GANL;AAOfU,aAAW,kDAAAd,CAAUC,MAPN;AAQfF,aAAW,kDAAAC,CAAUC,MARN;AASf3B,kBAAgB,kDAAA0B,CAAUC,MATX;AAUfzC,SAAO,kDAAAwC,CAAUsE,MAVF;AAWfrH,aAAW,kDAAA+C,CAAUC,MAXN;AAYfsC,oBAAkB,kDAAAvC,CAAUC,MAZb;AAafwD,iBAAe,kDAAAzD,CAAUoE;AAbV,CAAjB;;AAgBA9B,KAAKiC,YAAL,GAAoB;AAClBzD,aAAW,SADO;AAElBT,0BAAwB,KAFN;AAGlB+C,YAAUpB,IAHQ;AAIlBW,cAAY;AAAA,WAAO6B,GAAP;AAAA,GAJM;AAKlBlG,kBAAgB,KALE;AAMlBd,SAAO;AANW,CAApB;;AASA8E,KAAK3C,OAAL,GAAe,yDAAf,C;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC;AACA;AACA,gBAAgB;AAChB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,0BAA0B;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,wCAAwC;AACxC,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,SAAS;AACtB,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,SAAS;AACtB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;AACpB;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;AC75BA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+B;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA,6B;;;;;;;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,0BAA0B;AAC1B;AACA;AACA;;AAEA,2B;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,sFAAsF,aAAa;AACnG;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA,4FAA4F,eAAe;AAC3G;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yB;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4GAA4G;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;AC1FA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B;AAC7B,QAAQ;AACR;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,4BAA4B;AAC5B,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA","file":"rc-tabs.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rc-tabs\"] = factory(require(\"react\"));\n\telse\n\t\troot[\"rc-tabs\"] = factory(root[\"React\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 22);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0249b7501a866026ae24","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 0\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n// module id = 1\n// module chunks = 0","import React from 'react';\n\nexport function toArray(children) {\n // allow [c,[a,b]]\n const c = [];\n React.Children.forEach(children, child => {\n if (child) {\n c.push(child);\n }\n });\n return c;\n}\n\nexport function getActiveIndex(children, activeKey) {\n const c = toArray(children);\n for (let i = 0; i < c.length; i++) {\n if (c[i].key === activeKey) {\n return i;\n }\n }\n return -1;\n}\n\nexport function getActiveKey(children, index) {\n const c = toArray(children);\n return c[index].key;\n}\n\nexport function setTransform(style, v) {\n style.transform = v;\n style.webkitTransform = v;\n style.mozTransform = v;\n}\n\nexport function isTransformSupported(style) {\n return 'transform' in style ||\n 'webkitTransform' in style ||\n 'MozTransform' in style;\n}\n\nexport function setTransition(style, v) {\n style.transition = v;\n style.webkitTransition = v;\n style.MozTransition = v;\n}\nexport function getTransformPropValue(v) {\n return {\n transform: v,\n WebkitTransform: v,\n MozTransform: v,\n };\n}\n\nexport function isVertical(tabBarPosition) {\n return tabBarPosition === 'left' || tabBarPosition === 'right';\n}\n\nexport function getTransformByIndex(index, tabBarPosition) {\n const translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX';\n return `${translate}(${-index * 100}%) translateZ(0)`;\n}\n\nexport function getMarginStyle(index, tabBarPosition) {\n const marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft';\n return {\n [marginDirection]: `${-index * 100}%`,\n };\n}\n\nexport function getStyle(el, property) {\n return +getComputedStyle(el).getPropertyValue(property).replace('px', '');\n}\n\nexport function setPxStyle(el, value, vertical) {\n value = vertical ? `0px, ${value}px, 0px` : `${value}px, 0px, 0px`;\n setTransform(el.style, `translate3d(${value})`);\n}\n\nexport function getDataAttr(props) {\n return Object.keys(props).reduce((prev, key) => {\n if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') {\n prev[key] = props[key];\n }\n return prev;\n }, {});\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/classnames/index.js\n// module id = 3\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 4\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 5\n// module chunks = 0","import React from 'react';\nimport PropTypes from 'prop-types';\nimport createReactClass from 'create-react-class';\nimport classnames from 'classnames';\nimport { getDataAttr } from './utils';\n\nconst TabPane = createReactClass({\n displayName: 'TabPane',\n propTypes: {\n className: PropTypes.string,\n active: PropTypes.bool,\n style: PropTypes.any,\n destroyInactiveTabPane: PropTypes.bool,\n forceRender: PropTypes.bool,\n placeholder: PropTypes.node,\n },\n getDefaultProps() {\n return { placeholder: null };\n },\n render() {\n const {\n className, destroyInactiveTabPane, active, forceRender,\n rootPrefixCls, style, children, placeholder, ...restProps,\n } = this.props;\n this._isActived = this._isActived || active;\n const prefixCls = `${rootPrefixCls}-tabpane`;\n const cls = classnames({\n [prefixCls]: 1,\n [`${prefixCls}-inactive`]: !active,\n [`${prefixCls}-active`]: active,\n [className]: className,\n });\n const isRender = destroyInactiveTabPane ? active : this._isActived;\n return (\n \n {isRender || forceRender ? children : placeholder}\n \n );\n },\n});\n\nexport default TabPane;\n\n\n\n// WEBPACK FOOTER //\n// ./src/TabPane.js","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar React = require('react');\nvar factory = require('./factory');\n\nif (typeof React === 'undefined') {\n throw Error(\n 'create-react-class could not find the React object. If you are using script tags, ' +\n 'make sure that React is being loaded before create-react-class.'\n );\n}\n\n// Hack to grab NoopUpdateQueue from isomorphic React\nvar ReactNoopUpdateQueue = new React.Component().updater;\n\nmodule.exports = factory(\n React.Component,\n React.isValidElement,\n ReactNoopUpdateQueue\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-react-class/index.js\n// module id = 7\n// module chunks = 0","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/object-assign/index.js\n// module id = 8\n// module chunks = 0","import Tabs from './Tabs';\nimport TabPane from './TabPane';\nimport TabContent from './TabContent';\n\nexport default Tabs;\nexport { TabPane, TabContent };\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","// removed by extract-text-webpack-plugin\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/index.less\n// module id = 10\n// module chunks = 0","export default {\n /**\n * LEFT\n */\n LEFT: 37, // also NUM_WEST\n /**\n * UP\n */\n UP: 38, // also NUM_NORTH\n /**\n * RIGHT\n */\n RIGHT: 39, // also NUM_EAST\n /**\n * DOWN\n */\n DOWN: 40, // also NUM_SOUTH\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/KeyCode.js","import React from 'react';\nimport createReactClass from 'create-react-class';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {\n getTransformByIndex,\n getActiveIndex,\n getTransformPropValue,\n getMarginStyle,\n} from './utils';\n\nconst TabContent = createReactClass({\n displayName: 'TabContent',\n propTypes: {\n animated: PropTypes.bool,\n animatedWithMargin: PropTypes.bool,\n prefixCls: PropTypes.string,\n children: PropTypes.any,\n activeKey: PropTypes.string,\n style: PropTypes.any,\n tabBarPosition: PropTypes.string,\n },\n getDefaultProps() {\n return {\n animated: true,\n };\n },\n getTabPanes() {\n const props = this.props;\n const activeKey = props.activeKey;\n const children = props.children;\n const newChildren = [];\n\n React.Children.forEach(children, (child) => {\n if (!child) {\n return;\n }\n const key = child.key;\n const active = activeKey === key;\n newChildren.push(React.cloneElement(child, {\n active,\n destroyInactiveTabPane: props.destroyInactiveTabPane,\n rootPrefixCls: props.prefixCls,\n }));\n });\n\n return newChildren;\n },\n render() {\n const { props } = this;\n const {\n prefixCls, children, activeKey,\n tabBarPosition, animated, animatedWithMargin,\n } = props;\n let { style } = props;\n const classes = classnames({\n [`${prefixCls}-content`]: true,\n [animated ?\n `${prefixCls}-content-animated` :\n `${prefixCls}-content-no-animated`]: true,\n });\n if (animated) {\n const activeIndex = getActiveIndex(children, activeKey);\n if (activeIndex !== -1) {\n const animatedStyle = animatedWithMargin ?\n getMarginStyle(activeIndex, tabBarPosition) :\n getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition));\n style = {\n ...style,\n ...animatedStyle,\n };\n } else {\n style = {\n ...style,\n display: 'none',\n };\n }\n }\n return (\n \n {this.getTabPanes()}\n \n );\n },\n});\n\nexport default TabContent;\n\n\n\n// WEBPACK FOOTER //\n// ./src/TabContent.js","import React from 'react';\nimport PropTypes from 'prop-types';\nimport KeyCode from './KeyCode';\nimport TabPane from './TabPane';\nimport classnames from 'classnames';\nimport { getDataAttr } from './utils';\n\nfunction noop() {\n}\n\nfunction getDefaultActiveKey(props) {\n let activeKey;\n React.Children.forEach(props.children, (child) => {\n if (child && !activeKey && !child.props.disabled) {\n activeKey = child.key;\n }\n });\n return activeKey;\n}\n\nfunction activeKeyIsValid(props, key) {\n const keys = React.Children.map(props.children, child => child && child.key);\n return keys.indexOf(key) >= 0;\n}\n\nexport default class Tabs extends React.Component {\n constructor(props) {\n super(props);\n\n let activeKey;\n if ('activeKey' in props) {\n activeKey = props.activeKey;\n } else if ('defaultActiveKey' in props) {\n activeKey = props.defaultActiveKey;\n } else {\n activeKey = getDefaultActiveKey(props);\n }\n\n this.state = {\n activeKey,\n };\n }\n\n componentWillReceiveProps(nextProps) {\n if ('activeKey' in nextProps) {\n this.setState({\n activeKey: nextProps.activeKey,\n });\n } else if (!activeKeyIsValid(nextProps, this.state.activeKey)) {\n // https://github.com/ant-design/ant-design/issues/7093\n this.setState({\n activeKey: getDefaultActiveKey(nextProps),\n });\n }\n }\n\n onTabClick = (activeKey, e) => {\n if (this.tabBar.props.onTabClick) {\n this.tabBar.props.onTabClick(activeKey, e);\n }\n this.setActiveKey(activeKey);\n }\n\n onNavKeyDown = (e) => {\n const { canDownNavKey } = this.props;\n\n if (canDownNavKey && !canDownNavKey()) {\n return\n }\n\n const eventKeyCode = e.keyCode;\n if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) {\n e.preventDefault();\n const nextKey = this.getNextActiveKey(true);\n this.onTabClick(nextKey);\n } else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) {\n e.preventDefault();\n const previousKey = this.getNextActiveKey(false);\n this.onTabClick(previousKey);\n }\n }\n\n setActiveKey = (activeKey) => {\n if (this.state.activeKey !== activeKey) {\n if (!('activeKey' in this.props)) {\n this.setState({\n activeKey,\n });\n }\n this.props.onChange(activeKey);\n }\n }\n\n getNextActiveKey = (next) => {\n const activeKey = this.state.activeKey;\n const children = [];\n React.Children.forEach(this.props.children, (c) => {\n if (c && !c.props.disabled) {\n if (next) {\n children.push(c);\n } else {\n children.unshift(c);\n }\n }\n });\n const length = children.length;\n let ret = length && children[0].key;\n children.forEach((child, i) => {\n if (child.key === activeKey) {\n if (i === length - 1) {\n ret = children[0].key;\n } else {\n ret = children[i + 1].key;\n }\n }\n });\n return ret;\n }\n\n render() {\n const props = this.props;\n const {\n prefixCls,\n navWrapper,\n tabBarPosition, className,\n renderTabContent,\n renderTabBar,\n destroyInactiveTabPane,\n ...restProps,\n } = props;\n const cls = classnames({\n [prefixCls]: 1,\n [`${prefixCls}-${tabBarPosition}`]: 1,\n [className]: !!className,\n });\n\n this.tabBar = renderTabBar();\n const contents = [\n React.cloneElement(this.tabBar, {\n prefixCls,\n navWrapper,\n key: 'tabBar',\n onKeyDown: this.onNavKeyDown,\n tabBarPosition,\n onTabClick: this.onTabClick,\n panels: props.children,\n activeKey: this.state.activeKey,\n }),\n React.cloneElement(renderTabContent(), {\n prefixCls,\n tabBarPosition,\n activeKey: this.state.activeKey,\n destroyInactiveTabPane,\n children: props.children,\n onChange: this.setActiveKey,\n key: 'tabContent',\n }),\n ];\n if (tabBarPosition === 'bottom') {\n contents.reverse();\n }\n return (\n \n {contents}\n \n );\n }\n}\n\nTabs.propTypes = {\n destroyInactiveTabPane: PropTypes.bool,\n renderTabBar: PropTypes.func.isRequired,\n renderTabContent: PropTypes.func.isRequired,\n navWrapper: PropTypes.func,\n onChange: PropTypes.func,\n children: PropTypes.any,\n prefixCls: PropTypes.string,\n className: PropTypes.string,\n tabBarPosition: PropTypes.string,\n style: PropTypes.object,\n activeKey: PropTypes.string,\n defaultActiveKey: PropTypes.string,\n canDownNavKey: PropTypes.func,\n};\n\nTabs.defaultProps = {\n prefixCls: 'rc-tabs',\n destroyInactiveTabPane: false,\n onChange: noop,\n navWrapper: arg => arg,\n tabBarPosition: 'top',\n style: {},\n};\n\nTabs.TabPane = TabPane;\n\n\n\n// WEBPACK FOOTER //\n// ./src/Tabs.js","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar emptyObject = require('fbjs/lib/emptyObject');\nvar _invariant = require('fbjs/lib/invariant');\n\nif (process.env.NODE_ENV !== 'production') {\n var warning = require('fbjs/lib/warning');\n}\n\nvar MIXINS_KEY = 'mixins';\n\n// Helper function to allow the creation of anonymous functions which do not\n// have .name set to the name of the variable being assigned to.\nfunction identity(fn) {\n return fn;\n}\n\nvar ReactPropTypeLocationNames;\nif (process.env.NODE_ENV !== 'production') {\n ReactPropTypeLocationNames = {\n prop: 'prop',\n context: 'context',\n childContext: 'child context'\n };\n} else {\n ReactPropTypeLocationNames = {};\n}\n\nfunction factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {\n /**\n * Policies that describe methods in `ReactClassInterface`.\n */\n\n var injectedMixins = [];\n\n /**\n * Composite components are higher-level components that compose other composite\n * or host components.\n *\n * To create a new type of `ReactClass`, pass a specification of\n * your new class to `React.createClass`. The only requirement of your class\n * specification is that you implement a `render` method.\n *\n * var MyComponent = React.createClass({\n * render: function() {\n * return
Hello World
;\n * }\n * });\n *\n * The class specification supports a specific protocol of methods that have\n * special meaning (e.g. `render`). See `ReactClassInterface` for\n * more the comprehensive protocol. Any other properties and methods in the\n * class specification will be available on the prototype.\n *\n * @interface ReactClassInterface\n * @internal\n */\n var ReactClassInterface = {\n /**\n * An array of Mixin objects to include when defining your component.\n *\n * @type {array}\n * @optional\n */\n mixins: 'DEFINE_MANY',\n\n /**\n * An object containing properties and methods that should be defined on\n * the component's constructor instead of its prototype (static methods).\n *\n * @type {object}\n * @optional\n */\n statics: 'DEFINE_MANY',\n\n /**\n * Definition of prop types for this component.\n *\n * @type {object}\n * @optional\n */\n propTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types for this component.\n *\n * @type {object}\n * @optional\n */\n contextTypes: 'DEFINE_MANY',\n\n /**\n * Definition of context types this component sets for its children.\n *\n * @type {object}\n * @optional\n */\n childContextTypes: 'DEFINE_MANY',\n\n // ==== Definition methods ====\n\n /**\n * Invoked when the component is mounted. Values in the mapping will be set on\n * `this.props` if that prop is not specified (i.e. using an `in` check).\n *\n * This method is invoked before `getInitialState` and therefore cannot rely\n * on `this.state` or use `this.setState`.\n *\n * @return {object}\n * @optional\n */\n getDefaultProps: 'DEFINE_MANY_MERGED',\n\n /**\n * Invoked once before the component is mounted. The return value will be used\n * as the initial value of `this.state`.\n *\n * getInitialState: function() {\n * return {\n * isOn: false,\n * fooBaz: new BazFoo()\n * }\n * }\n *\n * @return {object}\n * @optional\n */\n getInitialState: 'DEFINE_MANY_MERGED',\n\n /**\n * @return {object}\n * @optional\n */\n getChildContext: 'DEFINE_MANY_MERGED',\n\n /**\n * Uses props from `this.props` and state from `this.state` to render the\n * structure of the component.\n *\n * No guarantees are made about when or how often this method is invoked, so\n * it must not have side effects.\n *\n * render: function() {\n * var name = this.props.name;\n * return
Hello, {name}!
;\n * }\n *\n * @return {ReactComponent}\n * @required\n */\n render: 'DEFINE_ONCE',\n\n // ==== Delegate methods ====\n\n /**\n * Invoked when the component is initially created and about to be mounted.\n * This may have side effects, but any external subscriptions or data created\n * by this method must be cleaned up in `componentWillUnmount`.\n *\n * @optional\n */\n componentWillMount: 'DEFINE_MANY',\n\n /**\n * Invoked when the component has been mounted and has a DOM representation.\n * However, there is no guarantee that the DOM node is in the document.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been mounted (initialized and rendered) for the first time.\n *\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidMount: 'DEFINE_MANY',\n\n /**\n * Invoked before the component receives new props.\n *\n * Use this as an opportunity to react to a prop transition by updating the\n * state using `this.setState`. Current props are accessed via `this.props`.\n *\n * componentWillReceiveProps: function(nextProps, nextContext) {\n * this.setState({\n * likesIncreasing: nextProps.likeCount > this.props.likeCount\n * });\n * }\n *\n * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop\n * transition may cause a state change, but the opposite is not true. If you\n * need it, you are probably looking for `componentWillUpdate`.\n *\n * @param {object} nextProps\n * @optional\n */\n componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Invoked while deciding if the component should be updated as a result of\n * receiving new props, state and/or context.\n *\n * Use this as an opportunity to `return false` when you're certain that the\n * transition to the new props/state/context will not require a component\n * update.\n *\n * shouldComponentUpdate: function(nextProps, nextState, nextContext) {\n * return !equal(nextProps, this.props) ||\n * !equal(nextState, this.state) ||\n * !equal(nextContext, this.context);\n * }\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @return {boolean} True if the component should update.\n * @optional\n */\n shouldComponentUpdate: 'DEFINE_ONCE',\n\n /**\n * Invoked when the component is about to update due to a transition from\n * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`\n * and `nextContext`.\n *\n * Use this as an opportunity to perform preparation before an update occurs.\n *\n * NOTE: You **cannot** use `this.setState()` in this method.\n *\n * @param {object} nextProps\n * @param {?object} nextState\n * @param {?object} nextContext\n * @param {ReactReconcileTransaction} transaction\n * @optional\n */\n componentWillUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component's DOM representation has been updated.\n *\n * Use this as an opportunity to operate on the DOM when the component has\n * been updated.\n *\n * @param {object} prevProps\n * @param {?object} prevState\n * @param {?object} prevContext\n * @param {DOMElement} rootNode DOM element representing the component.\n * @optional\n */\n componentDidUpdate: 'DEFINE_MANY',\n\n /**\n * Invoked when the component is about to be removed from its parent and have\n * its DOM representation destroyed.\n *\n * Use this as an opportunity to deallocate any external resources.\n *\n * NOTE: There is no `componentDidUnmount` since your component will have been\n * destroyed by that point.\n *\n * @optional\n */\n componentWillUnmount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillMount`.\n *\n * @optional\n */\n UNSAFE_componentWillMount: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillReceiveProps`.\n *\n * @optional\n */\n UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',\n\n /**\n * Replacement for (deprecated) `componentWillUpdate`.\n *\n * @optional\n */\n UNSAFE_componentWillUpdate: 'DEFINE_MANY',\n\n // ==== Advanced methods ====\n\n /**\n * Updates the component's currently mounted DOM representation.\n *\n * By default, this implements React's rendering and reconciliation algorithm.\n * Sophisticated clients may wish to override this.\n *\n * @param {ReactReconcileTransaction} transaction\n * @internal\n * @overridable\n */\n updateComponent: 'OVERRIDE_BASE'\n };\n\n /**\n * Similar to ReactClassInterface but for static methods.\n */\n var ReactClassStaticInterface = {\n /**\n * This method is invoked after a component is instantiated and when it\n * receives new props. Return an object to update state in response to\n * prop changes. Return null to indicate no change to state.\n *\n * If an object is returned, its keys will be merged into the existing state.\n *\n * @return {object || null}\n * @optional\n */\n getDerivedStateFromProps: 'DEFINE_MANY_MERGED'\n };\n\n /**\n * Mapping from class specification keys to special processing functions.\n *\n * Although these are declared like instance properties in the specification\n * when defining classes using `React.createClass`, they are actually static\n * and are accessible on the constructor instead of the prototype. Despite\n * being static, they must be defined outside of the \"statics\" key under\n * which all other static methods are defined.\n */\n var RESERVED_SPEC_KEYS = {\n displayName: function(Constructor, displayName) {\n Constructor.displayName = displayName;\n },\n mixins: function(Constructor, mixins) {\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n mixSpecIntoComponent(Constructor, mixins[i]);\n }\n }\n },\n childContextTypes: function(Constructor, childContextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, childContextTypes, 'childContext');\n }\n Constructor.childContextTypes = _assign(\n {},\n Constructor.childContextTypes,\n childContextTypes\n );\n },\n contextTypes: function(Constructor, contextTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, contextTypes, 'context');\n }\n Constructor.contextTypes = _assign(\n {},\n Constructor.contextTypes,\n contextTypes\n );\n },\n /**\n * Special case getDefaultProps which should move into statics but requires\n * automatic merging.\n */\n getDefaultProps: function(Constructor, getDefaultProps) {\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps = createMergedResultFunction(\n Constructor.getDefaultProps,\n getDefaultProps\n );\n } else {\n Constructor.getDefaultProps = getDefaultProps;\n }\n },\n propTypes: function(Constructor, propTypes) {\n if (process.env.NODE_ENV !== 'production') {\n validateTypeDef(Constructor, propTypes, 'prop');\n }\n Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);\n },\n statics: function(Constructor, statics) {\n mixStaticSpecIntoComponent(Constructor, statics);\n },\n autobind: function() {}\n };\n\n function validateTypeDef(Constructor, typeDef, location) {\n for (var propName in typeDef) {\n if (typeDef.hasOwnProperty(propName)) {\n // use a warning instead of an _invariant so components\n // don't show up in prod but only in __DEV__\n if (process.env.NODE_ENV !== 'production') {\n warning(\n typeof typeDef[propName] === 'function',\n '%s: %s type `%s` is invalid; it must be a function, usually from ' +\n 'React.PropTypes.',\n Constructor.displayName || 'ReactClass',\n ReactPropTypeLocationNames[location],\n propName\n );\n }\n }\n }\n }\n\n function validateMethodOverride(isAlreadyDefined, name) {\n var specPolicy = ReactClassInterface.hasOwnProperty(name)\n ? ReactClassInterface[name]\n : null;\n\n // Disallow overriding of base class methods unless explicitly allowed.\n if (ReactClassMixin.hasOwnProperty(name)) {\n _invariant(\n specPolicy === 'OVERRIDE_BASE',\n 'ReactClassInterface: You are attempting to override ' +\n '`%s` from your class specification. Ensure that your method names ' +\n 'do not overlap with React methods.',\n name\n );\n }\n\n // Disallow defining methods more than once unless explicitly allowed.\n if (isAlreadyDefined) {\n _invariant(\n specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClassInterface: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be due ' +\n 'to a mixin.',\n name\n );\n }\n }\n\n /**\n * Mixin helper which handles policy validation and reserved\n * specification keys when building React classes.\n */\n function mixSpecIntoComponent(Constructor, spec) {\n if (!spec) {\n if (process.env.NODE_ENV !== 'production') {\n var typeofSpec = typeof spec;\n var isMixinValid = typeofSpec === 'object' && spec !== null;\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n isMixinValid,\n \"%s: You're attempting to include a mixin that is either null \" +\n 'or not an object. Check the mixins included by the component, ' +\n 'as well as any mixins they include themselves. ' +\n 'Expected object but got %s.',\n Constructor.displayName || 'ReactClass',\n spec === null ? null : typeofSpec\n );\n }\n }\n\n return;\n }\n\n _invariant(\n typeof spec !== 'function',\n \"ReactClass: You're attempting to \" +\n 'use a component class or function as a mixin. Instead, just use a ' +\n 'regular object.'\n );\n _invariant(\n !isValidElement(spec),\n \"ReactClass: You're attempting to \" +\n 'use a component as a mixin. Instead, just use a regular object.'\n );\n\n var proto = Constructor.prototype;\n var autoBindPairs = proto.__reactAutoBindPairs;\n\n // By handling mixins before any other properties, we ensure the same\n // chaining order is applied to methods with DEFINE_MANY policy, whether\n // mixins are listed before or after these methods in the spec.\n if (spec.hasOwnProperty(MIXINS_KEY)) {\n RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);\n }\n\n for (var name in spec) {\n if (!spec.hasOwnProperty(name)) {\n continue;\n }\n\n if (name === MIXINS_KEY) {\n // We have already handled mixins in a special case above.\n continue;\n }\n\n var property = spec[name];\n var isAlreadyDefined = proto.hasOwnProperty(name);\n validateMethodOverride(isAlreadyDefined, name);\n\n if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {\n RESERVED_SPEC_KEYS[name](Constructor, property);\n } else {\n // Setup methods on prototype:\n // The following member methods should not be automatically bound:\n // 1. Expected ReactClass methods (in the \"interface\").\n // 2. Overridden methods (that were mixed in).\n var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);\n var isFunction = typeof property === 'function';\n var shouldAutoBind =\n isFunction &&\n !isReactClassMethod &&\n !isAlreadyDefined &&\n spec.autobind !== false;\n\n if (shouldAutoBind) {\n autoBindPairs.push(name, property);\n proto[name] = property;\n } else {\n if (isAlreadyDefined) {\n var specPolicy = ReactClassInterface[name];\n\n // These cases should already be caught by validateMethodOverride.\n _invariant(\n isReactClassMethod &&\n (specPolicy === 'DEFINE_MANY_MERGED' ||\n specPolicy === 'DEFINE_MANY'),\n 'ReactClass: Unexpected spec policy %s for key %s ' +\n 'when mixing in component specs.',\n specPolicy,\n name\n );\n\n // For methods which are defined more than once, call the existing\n // methods before calling the new property, merging if appropriate.\n if (specPolicy === 'DEFINE_MANY_MERGED') {\n proto[name] = createMergedResultFunction(proto[name], property);\n } else if (specPolicy === 'DEFINE_MANY') {\n proto[name] = createChainedFunction(proto[name], property);\n }\n } else {\n proto[name] = property;\n if (process.env.NODE_ENV !== 'production') {\n // Add verbose displayName to the function, which helps when looking\n // at profiling tools.\n if (typeof property === 'function' && spec.displayName) {\n proto[name].displayName = spec.displayName + '_' + name;\n }\n }\n }\n }\n }\n }\n }\n\n function mixStaticSpecIntoComponent(Constructor, statics) {\n if (!statics) {\n return;\n }\n\n for (var name in statics) {\n var property = statics[name];\n if (!statics.hasOwnProperty(name)) {\n continue;\n }\n\n var isReserved = name in RESERVED_SPEC_KEYS;\n _invariant(\n !isReserved,\n 'ReactClass: You are attempting to define a reserved ' +\n 'property, `%s`, that shouldn\\'t be on the \"statics\" key. Define it ' +\n 'as an instance property instead; it will still be accessible on the ' +\n 'constructor.',\n name\n );\n\n var isAlreadyDefined = name in Constructor;\n if (isAlreadyDefined) {\n var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)\n ? ReactClassStaticInterface[name]\n : null;\n\n _invariant(\n specPolicy === 'DEFINE_MANY_MERGED',\n 'ReactClass: You are attempting to define ' +\n '`%s` on your component more than once. This conflict may be ' +\n 'due to a mixin.',\n name\n );\n\n Constructor[name] = createMergedResultFunction(Constructor[name], property);\n\n return;\n }\n\n Constructor[name] = property;\n }\n }\n\n /**\n * Merge two objects, but throw if both contain the same key.\n *\n * @param {object} one The first object, which is mutated.\n * @param {object} two The second object\n * @return {object} one after it has been mutated to contain everything in two.\n */\n function mergeIntoWithNoDuplicateKeys(one, two) {\n _invariant(\n one && two && typeof one === 'object' && typeof two === 'object',\n 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'\n );\n\n for (var key in two) {\n if (two.hasOwnProperty(key)) {\n _invariant(\n one[key] === undefined,\n 'mergeIntoWithNoDuplicateKeys(): ' +\n 'Tried to merge two objects with the same key: `%s`. This conflict ' +\n 'may be due to a mixin; in particular, this may be caused by two ' +\n 'getInitialState() or getDefaultProps() methods returning objects ' +\n 'with clashing keys.',\n key\n );\n one[key] = two[key];\n }\n }\n return one;\n }\n\n /**\n * Creates a function that invokes two functions and merges their return values.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createMergedResultFunction(one, two) {\n return function mergedResult() {\n var a = one.apply(this, arguments);\n var b = two.apply(this, arguments);\n if (a == null) {\n return b;\n } else if (b == null) {\n return a;\n }\n var c = {};\n mergeIntoWithNoDuplicateKeys(c, a);\n mergeIntoWithNoDuplicateKeys(c, b);\n return c;\n };\n }\n\n /**\n * Creates a function that invokes two functions and ignores their return vales.\n *\n * @param {function} one Function to invoke first.\n * @param {function} two Function to invoke second.\n * @return {function} Function that invokes the two argument functions.\n * @private\n */\n function createChainedFunction(one, two) {\n return function chainedFunction() {\n one.apply(this, arguments);\n two.apply(this, arguments);\n };\n }\n\n /**\n * Binds a method to the component.\n *\n * @param {object} component Component whose method is going to be bound.\n * @param {function} method Method to be bound.\n * @return {function} The bound method.\n */\n function bindAutoBindMethod(component, method) {\n var boundMethod = method.bind(component);\n if (process.env.NODE_ENV !== 'production') {\n boundMethod.__reactBoundContext = component;\n boundMethod.__reactBoundMethod = method;\n boundMethod.__reactBoundArguments = null;\n var componentName = component.constructor.displayName;\n var _bind = boundMethod.bind;\n boundMethod.bind = function(newThis) {\n for (\n var _len = arguments.length,\n args = Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n\n // User is trying to bind() an autobound method; we effectively will\n // ignore the value of \"this\" that the user is trying to use, so\n // let's warn.\n if (newThis !== component && newThis !== null) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): React component methods may only be bound to the ' +\n 'component instance. See %s',\n componentName\n );\n }\n } else if (!args.length) {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n false,\n 'bind(): You are binding a component method to the component. ' +\n 'React does this for you automatically in a high-performance ' +\n 'way, so you can safely remove this call. See %s',\n componentName\n );\n }\n return boundMethod;\n }\n var reboundMethod = _bind.apply(boundMethod, arguments);\n reboundMethod.__reactBoundContext = component;\n reboundMethod.__reactBoundMethod = method;\n reboundMethod.__reactBoundArguments = args;\n return reboundMethod;\n };\n }\n return boundMethod;\n }\n\n /**\n * Binds all auto-bound methods in a component.\n *\n * @param {object} component Component whose method is going to be bound.\n */\n function bindAutoBindMethods(component) {\n var pairs = component.__reactAutoBindPairs;\n for (var i = 0; i < pairs.length; i += 2) {\n var autoBindKey = pairs[i];\n var method = pairs[i + 1];\n component[autoBindKey] = bindAutoBindMethod(component, method);\n }\n }\n\n var IsMountedPreMixin = {\n componentDidMount: function() {\n this.__isMounted = true;\n }\n };\n\n var IsMountedPostMixin = {\n componentWillUnmount: function() {\n this.__isMounted = false;\n }\n };\n\n /**\n * Add more to the ReactClass base class. These are all legacy features and\n * therefore not already part of the modern ReactComponent.\n */\n var ReactClassMixin = {\n /**\n * TODO: This will be deprecated because state should always keep a consistent\n * type signature and the only use case for this, is to avoid that.\n */\n replaceState: function(newState, callback) {\n this.updater.enqueueReplaceState(this, newState, callback);\n },\n\n /**\n * Checks whether or not this composite component is mounted.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function() {\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this.__didWarnIsMounted,\n '%s: isMounted is deprecated. Instead, make sure to clean up ' +\n 'subscriptions and pending requests in componentWillUnmount to ' +\n 'prevent memory leaks.',\n (this.constructor && this.constructor.displayName) ||\n this.name ||\n 'Component'\n );\n this.__didWarnIsMounted = true;\n }\n return !!this.__isMounted;\n }\n };\n\n var ReactClassComponent = function() {};\n _assign(\n ReactClassComponent.prototype,\n ReactComponent.prototype,\n ReactClassMixin\n );\n\n /**\n * Creates a composite component class given a class specification.\n * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass\n *\n * @param {object} spec Class specification (which must define `render`).\n * @return {function} Component constructor function.\n * @public\n */\n function createClass(spec) {\n // To keep our warnings more understandable, we'll use a little hack here to\n // ensure that Constructor.name !== 'Constructor'. This makes sure we don't\n // unnecessarily identify a class without displayName as 'Constructor'.\n var Constructor = identity(function(props, context, updater) {\n // This constructor gets overridden by mocks. The argument is used\n // by mocks to assert on what gets mounted.\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n this instanceof Constructor,\n 'Something is calling a React component directly. Use a factory or ' +\n 'JSX instead. See: https://fb.me/react-legacyfactory'\n );\n }\n\n // Wire up auto-binding\n if (this.__reactAutoBindPairs.length) {\n bindAutoBindMethods(this);\n }\n\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n\n this.state = null;\n\n // ReactClasses doesn't have constructors. Instead, they use the\n // getInitialState and componentWillMount methods for initialization.\n\n var initialState = this.getInitialState ? this.getInitialState() : null;\n if (process.env.NODE_ENV !== 'production') {\n // We allow auto-mocks to proceed as if they're returning null.\n if (\n initialState === undefined &&\n this.getInitialState._isMockFunction\n ) {\n // This is probably bad practice. Consider warning here and\n // deprecating this convenience.\n initialState = null;\n }\n }\n _invariant(\n typeof initialState === 'object' && !Array.isArray(initialState),\n '%s.getInitialState(): must return an object or null',\n Constructor.displayName || 'ReactCompositeComponent'\n );\n\n this.state = initialState;\n });\n Constructor.prototype = new ReactClassComponent();\n Constructor.prototype.constructor = Constructor;\n Constructor.prototype.__reactAutoBindPairs = [];\n\n injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));\n\n mixSpecIntoComponent(Constructor, IsMountedPreMixin);\n mixSpecIntoComponent(Constructor, spec);\n mixSpecIntoComponent(Constructor, IsMountedPostMixin);\n\n // Initialize the defaultProps property after all mixins have been merged.\n if (Constructor.getDefaultProps) {\n Constructor.defaultProps = Constructor.getDefaultProps();\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // This is a tag to indicate that the use of these method names is ok,\n // since it's used with createClass. If it's not, then it's likely a\n // mistake so we'll warn you to use the static property, property\n // initializer or constructor respectively.\n if (Constructor.getDefaultProps) {\n Constructor.getDefaultProps.isReactClassApproved = {};\n }\n if (Constructor.prototype.getInitialState) {\n Constructor.prototype.getInitialState.isReactClassApproved = {};\n }\n }\n\n _invariant(\n Constructor.prototype.render,\n 'createClass(...): Class specification must implement a `render` method.'\n );\n\n if (process.env.NODE_ENV !== 'production') {\n warning(\n !Constructor.prototype.componentShouldUpdate,\n '%s has a method called ' +\n 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +\n 'The name is phrased as a question because the function is ' +\n 'expected to return a value.',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.componentWillRecieveProps,\n '%s has a method called ' +\n 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n warning(\n !Constructor.prototype.UNSAFE_componentWillRecieveProps,\n '%s has a method called UNSAFE_componentWillRecieveProps(). ' +\n 'Did you mean UNSAFE_componentWillReceiveProps()?',\n spec.displayName || 'A component'\n );\n }\n\n // Reduce time spent doing lookups by setting these on the prototype.\n for (var methodName in ReactClassInterface) {\n if (!Constructor.prototype[methodName]) {\n Constructor.prototype[methodName] = null;\n }\n }\n\n return Constructor;\n }\n\n return createClass;\n}\n\nmodule.exports = factory;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-react-class/factory.js\n// module id = 14\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 15\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyObject = {};\n\nif (process.env.NODE_ENV !== 'production') {\n Object.freeze(emptyObject);\n}\n\nmodule.exports = emptyObject;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyObject.js\n// module id = 16\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 17\n// module chunks = 0","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 18\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n )\n\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 19\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 20\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nvar printWarning = function() {};\n\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n printWarning(\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning(\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'\n );\n return emptyFunctionThatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 21\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rc-tabs.min.css b/dist/rc-tabs.min.css new file mode 100644 index 00000000..f39e05d3 --- /dev/null +++ b/dist/rc-tabs.min.css @@ -0,0 +1,497 @@ +.rc-tabs { + box-sizing: border-box; + position: relative; + overflow: hidden; +} +.rc-tabs-bar, +.rc-tabs-nav-container { + font-size: 14px; + line-height: 1.5; + box-sizing: border-box; + overflow: hidden; + position: relative; + white-space: nowrap; + outline: none; + zoom: 1; + transition: padding .45s; +} +.rc-tabs-ink-bar { + z-index: 1; + position: absolute; + box-sizing: border-box; + margin-top: -3px; + background-color: #108ee9; + transform-origin: 0 0; +} +.rc-tabs-ink-bar-animated { + transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1); +} +.rc-tabs-tab-prev, +.rc-tabs-tab-next { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + z-index: 1; + line-height: 36px; + cursor: pointer; + border: none; + background-color: transparent; + position: absolute; +} +.rc-tabs-tab-prev-icon, +.rc-tabs-tab-next-icon { + position: relative; + display: inline-block; + font-style: normal; + font-weight: normal; + font-variant: normal; + line-height: inherit; + vertical-align: baseline; + text-align: center; + text-transform: none; + font-smoothing: antialiased; + text-stroke-width: 0; + font-family: sans-serif; +} +.rc-tabs-tab-prev-icon:before, +.rc-tabs-tab-next-icon:before { + display: block; +} +.rc-tabs-tab-btn-disabled { + cursor: default; + color: #ccc; +} +.rc-tabs-nav-wrap { + overflow: hidden; +} +.rc-tabs-nav { + box-sizing: border-box; + padding-left: 0; + position: relative; + margin: 0; + float: left; + list-style: none; + display: inline-block; + transform-origin: 0 0; +} +.rc-tabs-nav-animated { + transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1); +} +.rc-tabs-nav:before, +.rc-tabs-nav:after { + display: table; + content: " "; +} +.rc-tabs-nav:after { + clear: both; +} +.rc-tabs-tab { + box-sizing: border-box; + position: relative; + display: block; + transition: color 0.3s cubic-bezier(0.35, 0, 0.25, 1); + padding: 8px 20px; + font-weight: 500; + cursor: pointer; +} +.rc-tabs-tab:hover { + color: #23c0fa; +} +.rc-tabs-tab-active, +.rc-tabs-tab-active:hover { + color: #108ee9; + cursor: default; + transform: translateZ(0); +} +.rc-tabs-tab-disabled { + cursor: default; + color: #ccc; +} +.rc-tabs-tab-disabled:hover { + color: #ccc; +} +.rc-tabs-content { + zoom: 1; +} +.rc-tabs-content .rc-tabs-tabpane { + overflow: auto; +} +.rc-tabs-content-animated { + transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-left 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-top 0.3s cubic-bezier(0.35, 0, 0.25, 1); + display: -ms-flexbox; + display: flex; + will-change: transform; +} +.rc-tabs-content-animated .rc-tabs-tabpane { + -ms-flex-negative: 0; + flex-shrink: 0; +} +.no-flexbox .rc-tabs-content { + transform: none !important; + overflow: auto; +} +.no-csstransitions .rc-tabs-tabpane-inactive, +.no-flexbox .rc-tabs-tabpane-inactive, +.rc-tabs-content-no-animated .rc-tabs-tabpane-inactive { + display: none; +} +.rc-tabs-left { + border-right: 2px solid #f3f3f3; +} +.rc-tabs-left .rc-tabs-bar { + float: left; + height: 100%; + margin-right: 10px; + border-right: 1px solid #f3f3f3; +} +.rc-tabs-left .rc-tabs-nav-container { + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-container-scrolling { + padding-top: 32px; + padding-bottom: 32px; +} +.rc-tabs-left .rc-tabs-nav-wrap { + height: 100%; +} +.rc-tabs-left .rc-tabs-content-animated { + -ms-flex-direction: column; + flex-direction: column; +} +.rc-tabs-left .rc-tabs-content-animated .rc-tabs-tabpane { + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-scroll { + height: 99999px; +} +.rc-tabs-left .rc-tabs-nav-swipe { + position: relative; + top: 0; +} +.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + -ms-flex-direction: column; + flex-direction: column; + height: 100%; +} +.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-left .rc-tabs-tab-prev, +.rc-tabs-left .rc-tabs-tab-next { + margin-top: -2px; + height: 0; + line-height: 32px; + width: 0; + display: block; + text-align: center; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show, +.rc-tabs-left .rc-tabs-tab-arrow-show, +.rc-tabs-bottom .rc-tabs-tab-arrow-show, +.rc-tabs-right .rc-tabs-tab-arrow-show { + opacity: 1; + width: 100%; + height: 32px; +} +.rc-tabs-left .rc-tabs-tab-next { + bottom: 0; +} +.rc-tabs-left .rc-tabs-tab-next-icon { + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.rc-tabs-left .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-left .rc-tabs-tab-prev { + top: 2px; +} +.rc-tabs-left .rc-tabs-tab-prev-icon { + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.rc-tabs-left .rc-tabs-tab-prev-icon:before { + content: ">"; +} +.rc-tabs-left .rc-tabs-ink-bar { + width: 2px; + right: 0; +} +.rc-tabs-left .rc-tabs-tab { + padding: 16px 24px; +} +.rc-tabs-right { + border-left: 2px solid #f3f3f3; +} +.rc-tabs-right .rc-tabs-bar { + float: right; + height: 100%; + margin-left: 10px; + border-left: 1px solid #f3f3f3; +} +.rc-tabs-right .rc-tabs-nav-container { + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-container-scrolling { + padding-top: 32px; + padding-bottom: 32px; +} +.rc-tabs-right .rc-tabs-nav-wrap { + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-scroll { + height: 99999px; +} +.rc-tabs-right .rc-tabs-nav-swipe { + position: relative; +} +.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + -ms-flex-direction: column; + flex-direction: column; + height: 100%; +} +.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-right .rc-tabs-tab-prev, +.rc-tabs-right .rc-tabs-tab-next { + margin-top: -2px; + height: 0; + width: 0; + display: block; + text-align: center; + line-height: 32px; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show { + opacity: 1; + width: 100%; + height: 32px; +} +.rc-tabs-right .rc-tabs-tab-next { + bottom: 0; +} +.rc-tabs-right .rc-tabs-tab-next-icon { + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.rc-tabs-right .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-right .rc-tabs-tab-prev { + top: 2px; +} +.rc-tabs-right .rc-tabs-tab-prev-icon { + transform: rotate(270deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.rc-tabs-right .rc-tabs-tab-prev-icon:before { + content: ">"; +} +.rc-tabs-right .rc-tabs-content-animated { + -ms-flex-direction: column; + flex-direction: column; +} +.rc-tabs-right .rc-tabs-content-animated .rc-tabs-tabpane { + height: 100%; +} +.rc-tabs-right .rc-tabs-ink-bar { + width: 2px; + left: 0; +} +.rc-tabs-right .rc-tabs-tab { + padding: 16px 24px; +} +.rc-tabs-bottom { + border-top: 2px solid #f3f3f3; +} +.rc-tabs-bottom .rc-tabs-content { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-bar { + border-top: 1px solid #f3f3f3; +} +.rc-tabs-bottom .rc-tabs-nav-container-scrolling { + padding-left: 32px; + padding-right: 32px; +} +.rc-tabs-bottom .rc-tabs-nav-scroll { + width: 99999px; +} +.rc-tabs-bottom .rc-tabs-nav-swipe { + position: relative; + left: 0; +} +.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + width: 100%; +} +.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + margin-right: 0; + padding: 8px 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-bottom .rc-tabs-nav-wrap { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-content-animated { + -ms-flex-direction: row; + flex-direction: row; +} +.rc-tabs-bottom .rc-tabs-content-animated .rc-tabs-tabpane { + width: 100%; +} +.rc-tabs-bottom .rc-tabs-tab-next { + right: 2px; +} +.rc-tabs-bottom .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-bottom .rc-tabs-tab-prev { + left: 0; +} +.rc-tabs-bottom .rc-tabs-tab-prev-icon:before { + content: "<"; +} +.rc-tabs-bottom .rc-tabs-tab-prev, +.rc-tabs-bottom .rc-tabs-tab-next { + margin-right: -2px; + width: 32px; + height: 100%; + top: 0; + text-align: center; +} +.rc-tabs-bottom .rc-tabs-ink-bar { + height: 2px; + top: 3px; + left: 0; +} +.rc-tabs-bottom .rc-tabs-tab { + float: left; + height: 100%; + margin-right: 30px; +} +.rc-tabs-bottom .rc-tabs-tabpane-inactive { + height: 0; + overflow: visible; +} +.rc-tabs-top { + border-bottom: 2px solid #f3f3f3; +} +.rc-tabs-top .rc-tabs-content { + width: 100%; +} +.rc-tabs-top .rc-tabs-bar { + border-bottom: 1px solid #f3f3f3; +} +.rc-tabs-top .rc-tabs-nav-container-scrolling { + padding-left: 32px; + padding-right: 32px; +} +.rc-tabs-top .rc-tabs-nav-scroll { + width: 99999px; +} +.rc-tabs-top .rc-tabs-nav-swipe { + position: relative; + left: 0; +} +.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav { + display: -ms-flexbox; + display: flex; + -ms-flex: 1; + flex: 1; + width: 100%; +} +.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab { + display: -ms-flexbox; + display: flex; + -ms-flex-negative: 0; + flex-shrink: 0; + margin-right: 0; + padding: 8px 0; + -ms-flex-pack: center; + justify-content: center; +} +.rc-tabs-top .rc-tabs-nav-wrap { + width: 100%; +} +.rc-tabs-top .rc-tabs-content-animated { + -ms-flex-direction: row; + flex-direction: row; +} +.rc-tabs-top .rc-tabs-content-animated .rc-tabs-tabpane { + width: 100%; +} +.rc-tabs-top .rc-tabs-tab-next { + right: 2px; +} +.rc-tabs-top .rc-tabs-tab-next-icon:before { + content: ">"; +} +.rc-tabs-top .rc-tabs-tab-prev { + left: 0; +} +.rc-tabs-top .rc-tabs-tab-prev-icon:before { + content: "<"; +} +.rc-tabs-top .rc-tabs-tab-prev, +.rc-tabs-top .rc-tabs-tab-next { + margin-right: -2px; + width: 0; + height: 0; + top: 0; + text-align: center; + opacity: 0; + transition: width .3s, height .3s, opacity .3s; +} +.rc-tabs-top .rc-tabs-tab-arrow-show { + opacity: 1; + width: 32px; + height: 100%; +} +.rc-tabs-top .rc-tabs-ink-bar { + height: 2px; + bottom: 0; + left: 0; +} +.rc-tabs-top .rc-tabs-tab { + float: left; + height: 100%; + margin-right: 30px; +} +.rc-tabs-top .rc-tabs-tabpane-inactive { + height: 0; + overflow: visible; +} + +/*# sourceMappingURL=rc-tabs.min.css.map*/ \ No newline at end of file diff --git a/dist/rc-tabs.min.css.map b/dist/rc-tabs.min.css.map new file mode 100644 index 00000000..88cff415 --- /dev/null +++ b/dist/rc-tabs.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./assets/index/common.less","webpack:///./assets/index.less","webpack:///./assets/index/left.less","webpack:///./assets/index/right.less","webpack:///./assets/index/bottom.less","webpack:///./assets/index/top.less"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;CCCD;ADCC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCEH;ADCC;EACE;EACA;EACA;EACA;EACA;EACA;CCCH;ADAG;EACE;CCEL;ADEC;;EACE;KAAA;MAAA;UAAA;EACA;EACA;EACA;EACA;EACA;EACA;CCCH;ADCG;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCEL;ADAK;;EACE;CCGP;ADEC;EACE;EACA;CCAH;ADGC;EACE;CCDH;ADIC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CCFH;ADIG;EACE;CCFL;ADKG;;EACE;EACA;CCFL;ADKG;EACE;CCHL;ADOC;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CCLH;ADOG;EACE;CCLL;ADUG;;EACE;EACA;EAEA;CCRL;ADYC;EACE;EACA;CCVH;ADWG;EACE;CCTL;ADaC;EACE;CCXH;ADUC;EAII;CCXL;ADcG;EACE;EAGA;EAAA;EACA;CCdL;ADSG;EAQI;MAAA;CCdP;ADmBC;EACE;EACA;CCjBH;ADoBC;;;EAGE;CClBH;ACnIC;EACE;CDqIH;AClIC;EACE;EACA;EACA;EACA;CDoIH;AClIC;EACE;CDoIH;AClIC;EACE;EACA;CDoIH;ACjIC;EACE;CDmIH;AChIC;EACE;MAAA;CDkIH;ACnIC;EAII;CDkIL;AC9HC;EACE;CDgIH;AC7HC;EACE;EACA;CD+HH;ACjIC;EAII;EAAA;EACA;MAAA;EACA;MAAA;EACA;CDgIL;ACvIC;EASM;EAAA;EACA;MAAA;EACA;MAAA;CDiIP;AC5HC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CD+HH;AC5HC;;;;EAIE;EACA;EACA;CD8HH;AC3HC;EACE;CD6HH;AC5HG;EACE;EACA;CD8HL;AC5HG;EACE;CD8HL;AC1HC;EACE;CD4HH;AC3HG;EACE;EACA;CD6HL;AC3HG;EACE;CD6HL;ACzHC;EACE;EACA;CD2HH;ACxHC;EACE;CD0HH;AE5NC;EACE;CF8NH;AE3NC;EACE;EACA;EACA;EACA;CF6NH;AE3NC;EACE;CF6NH;AE3NC;EACE;EACA;CF6NH;AE1NC;EACE;CF4NH;AEzNC;EACE;CF2NH;AExNC;EACE;CF0NH;AE3NC;EAGI;EAAA;EACA;MAAA;EACA;MAAA;EACA;CF2NL;AEjOC;EAQM;EAAA;EACA;MAAA;EACA;MAAA;CF4NP;AEvNC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CF0NH;AEtNC;EACE;EACA;EACA;CFwNH;AErNC;EACE;CFuNH;AEtNG;EACE;EACA;CFwNL;AEtNG;EACE;CFwNL;AEpNC;EACE;CFsNH;AErNG;EACE;EACA;CFuNL;AErNG;EACE;CFuNL;AEnNC;EACE;MAAA;CFqNH;AEtNC;EAII;CFqNL;AEjNC;EACE;EACA;CFmNH;AEhNC;EACE;CFkNH;AGjTC;EACE;CHmTH;AGhTC;EACE;CHkTH;AG/SC;EACE;CHiTH;AG9SC;EACE;EACA;CHgTH;AG7SC;EACE;CH+SH;AG5SC;EACE;EACA;CH8SH;AGhTC;EAII;EAAA;EACA;MAAA;EACA;CH+SL;AGrTC;EAQM;EAAA;EACA;MAAA;EACA;EACA;EACA;MAAA;CHgTP;AG5SC;EACE;CH8SH;AG3SC;EACE;MAAA;CH6SH;AG9SC;EAII;CH6SL;AGzSC;EACE;CH2SH;AGzSG;EACE;CH2SL;AGvSC;EACE;CHySH;AGxSG;EACE;CH0SL;AGtSC;;EACE;EACA;EACA;EACA;EACA;CHySH;AGtSC;EACE;EACA;EACA;CHwSH;AGrSC;EACE;EACA;EACA;CHuSH;AGpSC;EACE;EACA;CHsSH;AI5XC;EACE;CJ8XH;AI3XC;EACE;CJ6XH;AI1XC;EACE;CJ4XH;AIzXC;EACE;EACA;CJ2XH;AIxXC;EACE;CJ0XH;AIvXC;EACE;EACA;CJyXH;AI3XC;EAII;EAAA;EACA;MAAA;EACA;CJ0XL;AIhYC;EAQM;EAAA;EACA;MAAA;EACA;EACA;EACA;MAAA;CJ2XP;AItXC;EACE;CJwXH;AIrXC;EACE;MAAA;CJuXH;AIxXC;EAGI;CJwXL;AIpXC;EACE;CJsXH;AIpXG;EACE;CJsXL;AIlXC;EACE;CJoXH;AInXG;EACE;CJqXL;AIjXC;;EACE;EACA;EACA;EACA;EACA;EACA;EACA;CJoXH;AIjXC;EACE;EACA;EACA;CJmXH;AIhXC;EACE;EACA;EACA;CJkXH;AI/WC;EACE;EACA;EACA;CJiXH;AI9WC;EACE;EACA;CJgXH","file":"rc-tabs.min.css","sourcesContent":[".@{tabs-prefix-cls} {\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n\n &-bar, &-nav-container {\n font-size: 14px;\n line-height: 1.5;\n box-sizing: border-box;\n overflow: hidden;\n position: relative;\n white-space: nowrap;\n outline: none;\n zoom: 1;\n transition: padding .45s;\n }\n\n &-ink-bar {\n z-index: 1;\n position: absolute;\n box-sizing: border-box;\n margin-top: -3px;\n background-color: #108ee9;\n transform-origin: 0 0;\n &-animated {\n transition: transform @effect-duration @easing-in-out;\n }\n }\n\n &-tab-prev, &-tab-next {\n user-select: none;\n z-index: 1;\n line-height: 36px;\n cursor: pointer;\n border: none;\n background-color: transparent;\n position: absolute;\n\n &-icon {\n position: relative;\n display: inline-block;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n line-height: inherit;\n vertical-align: baseline;\n text-align: center;\n text-transform: none;\n font-smoothing: antialiased;\n text-stroke-width: 0;\n font-family: sans-serif;\n\n &:before {\n display: block;\n }\n }\n }\n\n &-tab-btn-disabled {\n cursor: default;\n color: #ccc;\n }\n\n &-nav-wrap {\n overflow: hidden;\n }\n\n &-nav {\n box-sizing: border-box;\n padding-left: 0;\n position: relative;\n margin: 0;\n float: left;\n list-style: none;\n display: inline-block;\n transform-origin: 0 0;\n\n &-animated {\n transition: transform 0.5s @easing-in-out;\n }\n\n &:before, &:after {\n display: table;\n content: \" \";\n }\n\n &:after {\n clear: both;\n }\n }\n\n &-tab {\n box-sizing: border-box;\n position: relative;\n display: block;\n transition: color @effect-duration @easing-in-out;\n padding: 8px 20px;\n font-weight: 500;\n cursor: pointer;\n\n &:hover {\n color: #23c0fa;\n }\n }\n\n &-tab-active {\n &, &:hover {\n color: #108ee9;\n cursor: default;\n // fix chrome render\n transform: translateZ(0);\n }\n }\n\n &-tab-disabled {\n cursor: default;\n color: #ccc;\n &:hover {\n color: #ccc;\n }\n }\n\n &-content {\n zoom: 1;\n\n .@{tabs-prefix-cls}-tabpane {\n overflow: auto;\n }\n\n &-animated {\n transition: transform @effect-duration @easing-in-out,\n margin-left @effect-duration @easing-in-out,\n margin-top @effect-duration @easing-in-out;\n display: flex;\n will-change: transform;\n\n .@{tabs-prefix-cls}-tabpane {\n flex-shrink: 0;\n }\n }\n }\n\n .no-flexbox &-content {\n transform: none !important;\n overflow: auto;\n }\n\n .no-csstransitions &-tabpane-inactive,\n .no-flexbox &-tabpane-inactive,\n &-content-no-animated &-tabpane-inactive {\n display: none;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/common.less",".rc-tabs {\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n}\n.rc-tabs-bar,\n.rc-tabs-nav-container {\n font-size: 14px;\n line-height: 1.5;\n box-sizing: border-box;\n overflow: hidden;\n position: relative;\n white-space: nowrap;\n outline: none;\n zoom: 1;\n transition: padding .45s;\n}\n.rc-tabs-ink-bar {\n z-index: 1;\n position: absolute;\n box-sizing: border-box;\n margin-top: -3px;\n background-color: #108ee9;\n transform-origin: 0 0;\n}\n.rc-tabs-ink-bar-animated {\n transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n}\n.rc-tabs-tab-prev,\n.rc-tabs-tab-next {\n user-select: none;\n z-index: 1;\n line-height: 36px;\n cursor: pointer;\n border: none;\n background-color: transparent;\n position: absolute;\n}\n.rc-tabs-tab-prev-icon,\n.rc-tabs-tab-next-icon {\n position: relative;\n display: inline-block;\n font-style: normal;\n font-weight: normal;\n font-variant: normal;\n line-height: inherit;\n vertical-align: baseline;\n text-align: center;\n text-transform: none;\n font-smoothing: antialiased;\n text-stroke-width: 0;\n font-family: sans-serif;\n}\n.rc-tabs-tab-prev-icon:before,\n.rc-tabs-tab-next-icon:before {\n display: block;\n}\n.rc-tabs-tab-btn-disabled {\n cursor: default;\n color: #ccc;\n}\n.rc-tabs-nav-wrap {\n overflow: hidden;\n}\n.rc-tabs-nav {\n box-sizing: border-box;\n padding-left: 0;\n position: relative;\n margin: 0;\n float: left;\n list-style: none;\n display: inline-block;\n transform-origin: 0 0;\n}\n.rc-tabs-nav-animated {\n transition: transform 0.5s cubic-bezier(0.35, 0, 0.25, 1);\n}\n.rc-tabs-nav:before,\n.rc-tabs-nav:after {\n display: table;\n content: \" \";\n}\n.rc-tabs-nav:after {\n clear: both;\n}\n.rc-tabs-tab {\n box-sizing: border-box;\n position: relative;\n display: block;\n transition: color 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n padding: 8px 20px;\n font-weight: 500;\n cursor: pointer;\n}\n.rc-tabs-tab:hover {\n color: #23c0fa;\n}\n.rc-tabs-tab-active,\n.rc-tabs-tab-active:hover {\n color: #108ee9;\n cursor: default;\n transform: translateZ(0);\n}\n.rc-tabs-tab-disabled {\n cursor: default;\n color: #ccc;\n}\n.rc-tabs-tab-disabled:hover {\n color: #ccc;\n}\n.rc-tabs-content {\n zoom: 1;\n}\n.rc-tabs-content .rc-tabs-tabpane {\n overflow: auto;\n}\n.rc-tabs-content-animated {\n transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-left 0.3s cubic-bezier(0.35, 0, 0.25, 1), margin-top 0.3s cubic-bezier(0.35, 0, 0.25, 1);\n display: flex;\n will-change: transform;\n}\n.rc-tabs-content-animated .rc-tabs-tabpane {\n flex-shrink: 0;\n}\n.no-flexbox .rc-tabs-content {\n transform: none !important;\n overflow: auto;\n}\n.no-csstransitions .rc-tabs-tabpane-inactive,\n.no-flexbox .rc-tabs-tabpane-inactive,\n.rc-tabs-content-no-animated .rc-tabs-tabpane-inactive {\n display: none;\n}\n.rc-tabs-left {\n border-right: 2px solid #f3f3f3;\n}\n.rc-tabs-left .rc-tabs-bar {\n float: left;\n height: 100%;\n margin-right: 10px;\n border-right: 1px solid #f3f3f3;\n}\n.rc-tabs-left .rc-tabs-nav-container {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n}\n.rc-tabs-left .rc-tabs-nav-wrap {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-content-animated {\n flex-direction: column;\n}\n.rc-tabs-left .rc-tabs-content-animated .rc-tabs-tabpane {\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-scroll {\n height: 99999px;\n}\n.rc-tabs-left .rc-tabs-nav-swipe {\n position: relative;\n top: 0;\n}\n.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n}\n.rc-tabs-left .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n}\n.rc-tabs-left .rc-tabs-tab-prev,\n.rc-tabs-left .rc-tabs-tab-next {\n margin-top: -2px;\n height: 0;\n line-height: 32px;\n width: 0;\n display: block;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show,\n.rc-tabs-left .rc-tabs-tab-arrow-show,\n.rc-tabs-bottom .rc-tabs-tab-arrow-show,\n.rc-tabs-right .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n}\n.rc-tabs-left .rc-tabs-tab-next {\n bottom: 0;\n}\n.rc-tabs-left .rc-tabs-tab-next-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n}\n.rc-tabs-left .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-left .rc-tabs-tab-prev {\n top: 2px;\n}\n.rc-tabs-left .rc-tabs-tab-prev-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n}\n.rc-tabs-left .rc-tabs-tab-prev-icon:before {\n content: \">\";\n}\n.rc-tabs-left .rc-tabs-ink-bar {\n width: 2px;\n right: 0;\n}\n.rc-tabs-left .rc-tabs-tab {\n padding: 16px 24px;\n}\n.rc-tabs-right {\n border-left: 2px solid #f3f3f3;\n}\n.rc-tabs-right .rc-tabs-bar {\n float: right;\n height: 100%;\n margin-left: 10px;\n border-left: 1px solid #f3f3f3;\n}\n.rc-tabs-right .rc-tabs-nav-container {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n}\n.rc-tabs-right .rc-tabs-nav-wrap {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-scroll {\n height: 99999px;\n}\n.rc-tabs-right .rc-tabs-nav-swipe {\n position: relative;\n}\n.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n}\n.rc-tabs-right .rc-tabs-tab-prev,\n.rc-tabs-right .rc-tabs-tab-next {\n margin-top: -2px;\n height: 0;\n width: 0;\n display: block;\n text-align: center;\n line-height: 32px;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n}\n.rc-tabs-right .rc-tabs-tab-next {\n bottom: 0;\n}\n.rc-tabs-right .rc-tabs-tab-next-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n}\n.rc-tabs-right .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-right .rc-tabs-tab-prev {\n top: 2px;\n}\n.rc-tabs-right .rc-tabs-tab-prev-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n}\n.rc-tabs-right .rc-tabs-tab-prev-icon:before {\n content: \">\";\n}\n.rc-tabs-right .rc-tabs-content-animated {\n flex-direction: column;\n}\n.rc-tabs-right .rc-tabs-content-animated .rc-tabs-tabpane {\n height: 100%;\n}\n.rc-tabs-right .rc-tabs-ink-bar {\n width: 2px;\n left: 0;\n}\n.rc-tabs-right .rc-tabs-tab {\n padding: 16px 24px;\n}\n.rc-tabs-bottom {\n border-top: 2px solid #f3f3f3;\n}\n.rc-tabs-bottom .rc-tabs-content {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-bar {\n border-top: 1px solid #f3f3f3;\n}\n.rc-tabs-bottom .rc-tabs-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n}\n.rc-tabs-bottom .rc-tabs-nav-scroll {\n width: 99999px;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe {\n position: relative;\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n}\n.rc-tabs-bottom .rc-tabs-nav-wrap {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-content-animated {\n flex-direction: row;\n}\n.rc-tabs-bottom .rc-tabs-content-animated .rc-tabs-tabpane {\n width: 100%;\n}\n.rc-tabs-bottom .rc-tabs-tab-next {\n right: 2px;\n}\n.rc-tabs-bottom .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-bottom .rc-tabs-tab-prev {\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-tab-prev-icon:before {\n content: \"<\";\n}\n.rc-tabs-bottom .rc-tabs-tab-prev,\n.rc-tabs-bottom .rc-tabs-tab-next {\n margin-right: -2px;\n width: 32px;\n height: 100%;\n top: 0;\n text-align: center;\n}\n.rc-tabs-bottom .rc-tabs-ink-bar {\n height: 2px;\n top: 3px;\n left: 0;\n}\n.rc-tabs-bottom .rc-tabs-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n}\n.rc-tabs-bottom .rc-tabs-tabpane-inactive {\n height: 0;\n overflow: visible;\n}\n.rc-tabs-top {\n border-bottom: 2px solid #f3f3f3;\n}\n.rc-tabs-top .rc-tabs-content {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-bar {\n border-bottom: 1px solid #f3f3f3;\n}\n.rc-tabs-top .rc-tabs-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n}\n.rc-tabs-top .rc-tabs-nav-scroll {\n width: 99999px;\n}\n.rc-tabs-top .rc-tabs-nav-swipe {\n position: relative;\n left: 0;\n}\n.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav {\n display: flex;\n flex: 1;\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-nav-swipe .rc-tabs-nav .rc-tabs-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n}\n.rc-tabs-top .rc-tabs-nav-wrap {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-content-animated {\n flex-direction: row;\n}\n.rc-tabs-top .rc-tabs-content-animated .rc-tabs-tabpane {\n width: 100%;\n}\n.rc-tabs-top .rc-tabs-tab-next {\n right: 2px;\n}\n.rc-tabs-top .rc-tabs-tab-next-icon:before {\n content: \">\";\n}\n.rc-tabs-top .rc-tabs-tab-prev {\n left: 0;\n}\n.rc-tabs-top .rc-tabs-tab-prev-icon:before {\n content: \"<\";\n}\n.rc-tabs-top .rc-tabs-tab-prev,\n.rc-tabs-top .rc-tabs-tab-next {\n margin-right: -2px;\n width: 0;\n height: 0;\n top: 0;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n}\n.rc-tabs-top .rc-tabs-tab-arrow-show {\n opacity: 1;\n width: 32px;\n height: 100%;\n}\n.rc-tabs-top .rc-tabs-ink-bar {\n height: 2px;\n bottom: 0;\n left: 0;\n}\n.rc-tabs-top .rc-tabs-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n}\n.rc-tabs-top .rc-tabs-tabpane-inactive {\n height: 0;\n overflow: visible;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index.less",".@{tabs-prefix-cls} {\n &-left {\n border-right: 2px solid #f3f3f3;\n }\n\n &-left &-bar {\n float: left;\n height:100%;\n margin-right: 10px;\n border-right: 1px solid #f3f3f3;\n }\n &-left &-nav-container {\n height:100%;\n }\n &-left &-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n &-left &-nav-wrap {\n height: 100%;\n }\n\n &-left &-content-animated {\n flex-direction: column;\n\n .@{tabs-prefix-cls}-tabpane {\n height: 100%;\n }\n }\n\n &-left &-nav-scroll {\n height: 99999px;\n }\n\n &-left &-nav-swipe {\n position: relative;\n top: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n }\n }\n }\n\n &-left &-tab-prev, &-left &-tab-next {\n margin-top: -2px;\n height: 0;\n line-height: 32px;\n width: 0;\n display: block;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n &-top &-tab-arrow-show,\n &-left &-tab-arrow-show,\n &-bottom &-tab-arrow-show,\n &-right &-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n }\n\n &-left &-tab-next {\n bottom: 0;\n &-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-left &-tab-prev {\n top: 2px;\n &-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-left &-ink-bar {\n width: 2px;\n right: 0;\n }\n\n &-left &-tab {\n padding: 16px 24px;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/left.less",".@{tabs-prefix-cls} {\n &-right {\n border-left: 2px solid #f3f3f3;\n }\n\n &-right &-bar {\n float: right;\n height: 100%;\n margin-left: 10px;\n border-left: 1px solid #f3f3f3;\n }\n &-right &-nav-container {\n height:100%;\n }\n &-right &-nav-container-scrolling {\n padding-top: 32px;\n padding-bottom: 32px;\n }\n\n &-right &-nav-wrap {\n height: 100%;\n }\n\n &-right &-nav-scroll {\n height: 99999px;\n }\n\n &-right &-nav-swipe {\n position: relative;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n height: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n justify-content: center;\n }\n }\n }\n\n &-right &-tab-prev, &-right &-tab-next {\n margin-top: -2px;\n height: 0;\n width: 0;\n display: block;\n text-align: center;\n line-height: 32px;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n\n &-top &-tab-arrow-show {\n opacity: 1;\n width: 100%;\n height: 32px;\n }\n\n &-right &-tab-next {\n bottom: 0;\n &-icon {\n transform: rotate(90deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-right &-tab-prev {\n top: 2px;\n &-icon {\n transform: rotate(270deg);\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n }\n &-icon:before {\n content: \">\";\n }\n }\n\n &-right &-content-animated {\n flex-direction: column;\n\n .@{tabs-prefix-cls}-tabpane {\n height: 100%;\n }\n }\n\n &-right &-ink-bar {\n width: 2px;\n left: 0;\n }\n\n &-right &-tab {\n padding: 16px 24px;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/right.less",".@{tabs-prefix-cls} {\n &-bottom {\n border-top: 2px solid #f3f3f3;\n }\n\n &-bottom &-content {\n width: 100%;\n }\n\n &-bottom &-bar {\n border-top: 1px solid #f3f3f3;\n }\n\n &-bottom &-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n }\n\n &-bottom &-nav-scroll {\n width: 99999px;\n }\n\n &-bottom &-nav-swipe {\n position: relative;\n left: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n width: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n }\n }\n }\n &-bottom &-nav-wrap {\n width: 100%;\n }\n\n &-bottom &-content-animated {\n flex-direction: row;\n\n .@{tabs-prefix-cls}-tabpane {\n width: 100%;\n }\n }\n\n &-bottom &-tab-next {\n right: 2px;\n\n &-icon:before {\n content: \">\";\n }\n }\n\n &-bottom &-tab-prev {\n left: 0;\n &-icon:before {\n content: \"<\";\n }\n }\n\n &-bottom &-tab-prev, &-bottom &-tab-next {\n margin-right: -2px;\n width: 32px;\n height: 100%;\n top: 0;\n text-align: center;\n }\n\n &-bottom &-ink-bar {\n height: 2px;\n top: 3px;\n left: 0;\n }\n\n &-bottom &-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n }\n\n &-bottom &-tabpane-inactive {\n height: 0;\n overflow: visible;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/bottom.less",".@{tabs-prefix-cls} {\n &-top {\n border-bottom: 2px solid #f3f3f3;\n }\n\n &-top &-content {\n width: 100%;\n }\n\n &-top &-bar {\n border-bottom: 1px solid #f3f3f3;\n }\n\n &-top &-nav-container-scrolling {\n padding-left: 32px;\n padding-right: 32px;\n }\n\n &-top &-nav-scroll {\n width: 99999px;\n }\n\n &-top &-nav-swipe {\n position: relative;\n left: 0;\n .@{tabs-prefix-cls}-nav {\n display: flex;\n flex: 1;\n width: 100%;\n .@{tabs-prefix-cls}-tab {\n display: flex;\n flex-shrink: 0;\n margin-right: 0;\n padding: 8px 0;\n justify-content: center;\n }\n }\n }\n\n &-top &-nav-wrap {\n width: 100%;\n }\n\n &-top &-content-animated {\n flex-direction: row;\n .@{tabs-prefix-cls}-tabpane {\n width: 100%;\n }\n }\n\n &-top &-tab-next {\n right: 2px;\n\n &-icon:before {\n content: \">\";\n }\n }\n\n &-top &-tab-prev {\n left: 0;\n &-icon:before {\n content: \"<\";\n }\n }\n\n &-top &-tab-prev, &-top &-tab-next {\n margin-right: -2px;\n width: 0;\n height: 0;\n top: 0;\n text-align: center;\n opacity: 0;\n transition: width .3s, height .3s, opacity .3s;\n }\n\n &-top &-tab-arrow-show {\n opacity: 1;\n width: 32px;\n height: 100%;\n }\n\n &-top &-ink-bar {\n height: 2px;\n bottom: 0;\n left: 0;\n }\n\n &-top &-tab {\n float: left;\n height: 100%;\n margin-right: 30px;\n }\n\n &-top &-tabpane-inactive {\n height: 0;\n overflow: visible;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/index/top.less"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rc-tabs.min.js b/dist/rc-tabs.min.js new file mode 100644 index 00000000..d7d738fb --- /dev/null +++ b/dist/rc-tabs.min.js @@ -0,0 +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["rc-tabs"]=t(require("react")):e["rc-tabs"]=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=[];return f.a.Children.forEach(e,function(e){e&&t.push(e)}),t}function o(e,t){for(var n=a(e),r=0;r=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var o=n(0),i=n.n(o),s=n(3),c=n.n(s),u=n(5),p=n.n(u),l=n(2),f=n.n(l),y=n(1),d=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function c(){}function u(e){var t=void 0;return f.a.Children.forEach(e.children,function(e){!e||t||e.props.disabled||(t=e.key)}),t}function p(e,t){return f.a.Children.map(e.children,function(e){return e&&e.key}).indexOf(t)>=0}var l=n(0),f=n.n(l),y=n(3),d=n.n(y),v=n(8),h=n(4),b=n(2),m=n.n(b),E=n(1),g=Object.assign||function(e){for(var t=1;t= 0) { + next = false; + this.setOffset(0, false); + offset = 0; + } else if (minOffset < offset) { + next = true; + } else { + next = false; + var realOffset = navWrapNodeWH - navNodeWH; + this.setOffset(realOffset, false); + offset = realOffset; + } + + if (offset < 0) { + prev = true; + } else { + prev = false; + } + + this.setNext(next); + this.setPrev(prev); + return { + next: next, + prev: prev + }; + }, + getOffsetWH: function getOffsetWH(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'offsetWidth'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'offsetHeight'; + } + return node[prop]; + }, + getScrollWH: function getScrollWH(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'scrollWidth'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'scrollHeight'; + } + return node[prop]; + }, + getOffsetLT: function getOffsetLT(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'left'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'top'; + } + return node.getBoundingClientRect()[prop]; + }, + setOffset: function setOffset(offset) { + var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var target = Math.min(0, offset); + if (this.offset !== target) { + this.offset = target; + var navOffset = {}; + var tabBarPosition = this.props.tabBarPosition; + var navStyle = this.nav.style; + var transformSupported = isTransformSupported(navStyle); + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + if (transformSupported) { + navOffset = { + value: 'translate3d(0,' + target + 'px,0)' + }; + } else { + navOffset = { + name: 'top', + value: target + 'px' + }; + } + } else { + if (transformSupported) { + navOffset = { + value: 'translate3d(' + target + 'px,0,0)' + }; + } else { + navOffset = { + name: 'left', + value: target + 'px' + }; + } + } + if (transformSupported) { + setTransform(navStyle, navOffset.value); + } else { + navStyle[navOffset.name] = navOffset.value; + } + if (checkNextPrev) { + this.setNextPrev(); + } + } + }, + setPrev: function setPrev(v) { + if (this.state.prev !== v) { + this.setState({ + prev: v + }); + } + }, + setNext: function setNext(v) { + if (this.state.next !== v) { + this.setState({ + next: v + }); + } + }, + isNextPrevShown: function isNextPrevShown(state) { + if (state) { + return state.next || state.prev; + } + return this.state.next || this.state.prev; + }, + prevTransitionEnd: function prevTransitionEnd(e) { + if (e.propertyName !== 'opacity') { + return; + } + var container = this.container; + + this.scrollToActiveTab({ + target: container, + currentTarget: container + }); + }, + scrollToActiveTab: function scrollToActiveTab(e) { + var activeTab = this.activeTab, + navWrap = this.navWrap; + + if (e && e.target !== e.currentTarget || !activeTab) { + return; + } + + var needToSroll = this.isNextPrevShown() && this.lastNextPrevShown; + this.lastNextPrevShown = this.isNextPrevShown(); + if (!needToSroll) { + return; + } + + var activeTabWH = this.getScrollWH(activeTab); + var navWrapNodeWH = this.getOffsetWH(navWrap); + var offset = this.offset; + + var wrapOffset = this.getOffsetLT(navWrap); + var activeTabOffset = this.getOffsetLT(activeTab); + if (wrapOffset > activeTabOffset) { + offset += wrapOffset - activeTabOffset; + this.setOffset(offset); + } else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) { + offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH); + this.setOffset(offset); + } + }, + prev: function prev(e) { + this.props.onPrevClick(e); + var navWrapNode = this.navWrap; + var navWrapNodeWH = this.getOffsetWH(navWrapNode); + var offset = this.offset; + + this.setOffset(offset + navWrapNodeWH); + }, + next: function next(e) { + this.props.onNextClick(e); + var navWrapNode = this.navWrap; + var navWrapNodeWH = this.getOffsetWH(navWrapNode); + var offset = this.offset; + + this.setOffset(offset - navWrapNodeWH); + }, + getScrollBarNode: function getScrollBarNode(content) { + var _classnames, _classnames2, _classnames3, _classnames4; + + var _state2 = this.state, + next = _state2.next, + prev = _state2.prev; + var _props = this.props, + prefixCls = _props.prefixCls, + scrollAnimated = _props.scrollAnimated, + navWrapper = _props.navWrapper; + + var showNextPrev = prev || next; + + var prevButton = React.createElement( + 'span', + { + onClick: prev ? this.prev : null, + unselectable: 'unselectable', + className: classnames((_classnames = {}, _defineProperty(_classnames, prefixCls + '-tab-prev', 1), _defineProperty(_classnames, prefixCls + '-tab-btn-disabled', !prev), _defineProperty(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)), + onTransitionEnd: this.prevTransitionEnd + }, + React.createElement('span', { className: prefixCls + '-tab-prev-icon' }) + ); + + var nextButton = React.createElement( + 'span', + { + onClick: next ? this.next : null, + unselectable: 'unselectable', + className: classnames((_classnames2 = {}, _defineProperty(_classnames2, prefixCls + '-tab-next', 1), _defineProperty(_classnames2, prefixCls + '-tab-btn-disabled', !next), _defineProperty(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2)) + }, + React.createElement('span', { className: prefixCls + '-tab-next-icon' }) + ); + + var navClassName = prefixCls + '-nav'; + var navClasses = classnames((_classnames3 = {}, _defineProperty(_classnames3, navClassName, true), _defineProperty(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3)); + + return React.createElement( + 'div', + { + className: classnames((_classnames4 = {}, _defineProperty(_classnames4, prefixCls + '-nav-container', 1), _defineProperty(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)), + key: 'container', + ref: this.saveRef('container') + }, + prevButton, + nextButton, + React.createElement( + 'div', + { className: prefixCls + '-nav-wrap', ref: this.saveRef('navWrap') }, + React.createElement( + 'div', + { className: prefixCls + '-nav-scroll' }, + React.createElement( + 'div', + { className: navClasses, ref: this.saveRef('nav') }, + navWrapper(content) + ) + ) + ) + ); + } +}; \ No newline at end of file diff --git a/es/SwipeableInkTabBar.js b/es/SwipeableInkTabBar.js new file mode 100755 index 00000000..1d2a8882 --- /dev/null +++ b/es/SwipeableInkTabBar.js @@ -0,0 +1,74 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import React from 'react'; +import createReactClass from 'create-react-class'; +import classnames from 'classnames'; +import InkTabBarMixin from './InkTabBarMixin'; +import SwipeableTabBarMixin from './SwipeableTabBarMixin'; +import TabBarMixin from './TabBarMixin'; +import RefMixin from './RefMixin'; + +var SwipeableInkTabBar = createReactClass({ + displayName: 'SwipeableInkTabBar', + + mixins: [RefMixin, TabBarMixin, InkTabBarMixin, SwipeableTabBarMixin], + + getSwipeableTabs: function getSwipeableTabs() { + var _this = this; + + var props = this.props; + var children = props.panels; + var activeKey = props.activeKey; + var rst = []; + var prefixCls = props.prefixCls; + + var _flexWidth = 1 / props.pageSize * 100 + '%'; + var tabStyle = { + WebkitFlexBasis: _flexWidth, + flexBasis: _flexWidth + }; + + React.Children.forEach(children, function (child) { + var _classnames; + + if (!child) { + return; + } + var key = child.key; + var cls = classnames(prefixCls + '-tab', (_classnames = {}, _defineProperty(_classnames, prefixCls + '-tab-active', activeKey === key), _defineProperty(_classnames, prefixCls + '-tab-disabled', child.props.disabled), _classnames)); + var events = {}; + if (!child.props.disabled) { + events = { + onClick: _this.onTabClick.bind(_this, key) + }; + } + var refProps = {}; + if (activeKey === key) { + refProps.ref = _this.saveRef('activeTab'); + } + rst.push(React.createElement( + 'div', + _extends({ + role: 'tab', + style: tabStyle, + 'aria-disabled': child.props.disabled ? 'true' : 'false', + 'aria-selected': activeKey === key ? 'true' : 'false' + }, events, { + className: cls, + key: key + }, refProps), + child.props.tab + )); + }); + + return rst; + }, + render: function render() { + var inkBarNode = this.getInkBarNode(); + var tabs = this.getSwipeableTabs(); + var scrollbarNode = this.getSwipeBarNode([inkBarNode, tabs]); + return this.getRootNode(scrollbarNode); + } +}); + +export default SwipeableInkTabBar; \ No newline at end of file diff --git a/es/SwipeableTabBarMixin.js b/es/SwipeableTabBarMixin.js new file mode 100755 index 00000000..348186fb --- /dev/null +++ b/es/SwipeableTabBarMixin.js @@ -0,0 +1,211 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import React from 'react'; +import classnames from 'classnames'; +import Hammer from 'rc-hammerjs'; +import ReactDOM from 'react-dom'; +import { isVertical, getStyle, setPxStyle } from './utils'; + +export default { + getInitialState: function getInitialState() { + var _checkPaginationByKey = this.checkPaginationByKey(this.props.activeKey), + hasPrevPage = _checkPaginationByKey.hasPrevPage, + hasNextPage = _checkPaginationByKey.hasNextPage; + + return { + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }; + }, + getDefaultProps: function getDefaultProps() { + return { + hammerOptions: {}, + pageSize: 5, // per page show how many tabs + speed: 7 // swipe speed, 1 to 10, more bigger more faster + }; + }, + checkPaginationByKey: function checkPaginationByKey(activeKey) { + var _props = this.props, + panels = _props.panels, + pageSize = _props.pageSize; + + var index = this.getIndexByKey(activeKey); + var centerTabCount = Math.floor(pageSize / 2); + // the basic rule is to make activeTab be shown in the center of TabBar viewport + return { + hasPrevPage: index - centerTabCount > 0, + hasNextPage: index + centerTabCount < panels.length + }; + }, + + /** + * used for props.activeKey setting, not for swipe callback + */ + getDeltaByKey: function getDeltaByKey(activeKey) { + var pageSize = this.props.pageSize; + + var index = this.getIndexByKey(activeKey); + var centerTabCount = Math.floor(pageSize / 2); + var tabWidth = this.cache.tabWidth; + + var delta = (index - centerTabCount) * tabWidth * -1; + return delta; + }, + getIndexByKey: function getIndexByKey(activeKey) { + var panels = this.props.panels; + + var length = panels.length; + for (var i = 0; i < length; i++) { + if (panels[i].key === activeKey) { + return i; + } + } + return -1; + }, + checkPaginationByDelta: function checkPaginationByDelta(delta) { + var totalAvaliableDelta = this.cache.totalAvaliableDelta; + + return { + hasPrevPage: delta < 0, + hasNextPage: -delta < totalAvaliableDelta + }; + }, + setSwipePositionByKey: function setSwipePositionByKey(activeKey) { + var _checkPaginationByKey2 = this.checkPaginationByKey(activeKey), + hasPrevPage = _checkPaginationByKey2.hasPrevPage, + hasNextPage = _checkPaginationByKey2.hasNextPage; + + var totalAvaliableDelta = this.cache.totalAvaliableDelta; + + this.setState({ + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }); + var delta = void 0; + if (!hasPrevPage) { + // the first page + delta = 0; + } else if (!hasNextPage) { + // the last page + delta = -totalAvaliableDelta; + } else if (hasNextPage) { + // the middle page + delta = this.getDeltaByKey(activeKey); + } + this.cache.totalDelta = delta; + this.setSwipePosition(); + }, + setSwipePosition: function setSwipePosition() { + var _cache = this.cache, + totalDelta = _cache.totalDelta, + vertical = _cache.vertical; + + setPxStyle(this.swipeNode, totalDelta, vertical); + }, + componentDidMount: function componentDidMount() { + var swipe = this.swipe, + nav = this.nav; + var _props2 = this.props, + tabBarPosition = _props2.tabBarPosition, + pageSize = _props2.pageSize, + panels = _props2.panels, + activeKey = _props2.activeKey; + + this.swipeNode = ReactDOM.findDOMNode(swipe); // dom which scroll (9999px) + this.realNode = ReactDOM.findDOMNode(nav); // dom which visiable in screen (viewport) + var _isVertical = isVertical(tabBarPosition); + var _viewSize = getStyle(this.realNode, _isVertical ? 'height' : 'width'); + var _tabWidth = _viewSize / pageSize; + this.cache = { + vertical: _isVertical, + totalAvaliableDelta: _tabWidth * panels.length - _viewSize, + tabWidth: _tabWidth + }; + this.setSwipePositionByKey(activeKey); + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + if (nextProps.activeKey && nextProps.activeKey !== this.props.activeKey) { + this.setSwipePositionByKey(nextProps.activeKey); + } + }, + onPan: function onPan(e) { + var _cache2 = this.cache, + vertical = _cache2.vertical, + totalAvaliableDelta = _cache2.totalAvaliableDelta, + totalDelta = _cache2.totalDelta; + var speed = this.props.speed; + // calculate touch distance + + var nowDelta = vertical ? e.deltaY : e.deltaX; + nowDelta = nowDelta * (speed / 10); + + // calculate distance dom need transform + var _nextDelta = nowDelta + totalDelta; + if (_nextDelta >= 0) { + _nextDelta = 0; + } else if (_nextDelta <= -totalAvaliableDelta) { + _nextDelta = -totalAvaliableDelta; + } + + this.cache.totalDelta = _nextDelta; + this.setSwipePosition(); + + // calculate pagination display + + var _checkPaginationByDel = this.checkPaginationByDelta(this.cache.totalDelta), + hasPrevPage = _checkPaginationByDel.hasPrevPage, + hasNextPage = _checkPaginationByDel.hasNextPage; + + if (hasPrevPage !== this.state.hasPrevPage || hasNextPage !== this.state.hasNextPage) { + this.setState({ + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }); + } + }, + getSwipeBarNode: function getSwipeBarNode(tabs) { + var _classnames2; + + var _props3 = this.props, + prefixCls = _props3.prefixCls, + hammerOptions = _props3.hammerOptions, + tabBarPosition = _props3.tabBarPosition; + var _state = this.state, + hasPrevPage = _state.hasPrevPage, + hasNextPage = _state.hasNextPage; + + var navClassName = prefixCls + '-nav'; + var navClasses = classnames(_defineProperty({}, navClassName, true)); + var events = { + onPan: this.onPan + }; + return React.createElement( + 'div', + { + className: classnames((_classnames2 = {}, _defineProperty(_classnames2, prefixCls + '-nav-container', 1), _defineProperty(_classnames2, prefixCls + '-nav-swipe-container', 1), _defineProperty(_classnames2, prefixCls + '-prevpage', hasPrevPage), _defineProperty(_classnames2, prefixCls + '-nextpage', hasNextPage), _classnames2)), + key: 'container', + ref: this.saveRef('container') + }, + React.createElement( + 'div', + { className: prefixCls + '-nav-wrap', ref: this.saveRef('navWrap') }, + React.createElement( + Hammer, + _extends({}, events, { + direction: isVertical(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL', + options: hammerOptions + }), + React.createElement( + 'div', + { className: prefixCls + '-nav-swipe', ref: this.saveRef('swipe') }, + React.createElement( + 'div', + { className: navClasses, ref: this.saveRef('nav') }, + tabs + ) + ) + ) + ) + ); + } +}; \ No newline at end of file diff --git a/es/SwipeableTabContent.js b/es/SwipeableTabContent.js new file mode 100755 index 00000000..7eca7cb9 --- /dev/null +++ b/es/SwipeableTabContent.js @@ -0,0 +1,176 @@ +import _extends from 'babel-runtime/helpers/extends'; +import TabContent from './TabContent'; +import React from 'react'; +import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; +import Hammer from 'rc-hammerjs'; +import ReactDOM from 'react-dom'; +import { isVertical, getActiveIndex, getTransformByIndex, setTransform, getActiveKey, toArray, setTransition } from './utils'; + +var RESISTANCE_COEF = 0.6; + +function computeIndex(_ref) { + var maxIndex = _ref.maxIndex, + startIndex = _ref.startIndex, + delta = _ref.delta, + viewSize = _ref.viewSize; + + var index = startIndex + -delta / viewSize; + if (index < 0) { + index = Math.exp(index * RESISTANCE_COEF) - 1; + } else if (index > maxIndex) { + index = maxIndex + 1 - Math.exp((maxIndex - index) * RESISTANCE_COEF); + } + return index; +} + +function getIndexByDelta(e) { + var delta = isVertical(this.props.tabBarPosition) ? e.deltaY : e.deltaX; + var otherDelta = isVertical(this.props.tabBarPosition) ? e.deltaX : e.deltaY; + if (Math.abs(delta) < Math.abs(otherDelta)) { + return undefined; + } + var currentIndex = computeIndex({ + maxIndex: this.maxIndex, + viewSize: this.viewSize, + startIndex: this.startIndex, + delta: delta + }); + var showIndex = delta < 0 ? Math.floor(currentIndex + 1) : Math.floor(currentIndex); + if (showIndex < 0) { + showIndex = 0; + } else if (showIndex > this.maxIndex) { + showIndex = this.maxIndex; + } + if (this.children[showIndex].props.disabled) { + return undefined; + } + return currentIndex; +} + +var SwipeableTabContent = createReactClass({ + displayName: 'SwipeableTabContent', + + propTypes: { + tabBarPosition: PropTypes.string, + onChange: PropTypes.func, + children: PropTypes.any, + hammerOptions: PropTypes.any, + animated: PropTypes.bool, + activeKey: PropTypes.string + }, + + getDefaultProps: function getDefaultProps() { + return { + animated: true + }; + }, + componentDidMount: function componentDidMount() { + this.rootNode = ReactDOM.findDOMNode(this); + }, + onPanStart: function onPanStart() { + var _props = this.props, + tabBarPosition = _props.tabBarPosition, + children = _props.children, + activeKey = _props.activeKey, + animated = _props.animated; + + var startIndex = this.startIndex = getActiveIndex(children, activeKey); + if (startIndex === -1) { + return; + } + if (animated) { + setTransition(this.rootNode.style, 'none'); + } + this.startDrag = true; + this.children = toArray(children); + this.maxIndex = this.children.length - 1; + this.viewSize = isVertical(tabBarPosition) ? this.rootNode.offsetHeight : this.rootNode.offsetWidth; + }, + onPan: function onPan(e) { + if (!this.startDrag) { + return; + } + var tabBarPosition = this.props.tabBarPosition; + + var currentIndex = getIndexByDelta.call(this, e); + if (currentIndex !== undefined) { + setTransform(this.rootNode.style, getTransformByIndex(currentIndex, tabBarPosition)); + } + }, + onPanEnd: function onPanEnd(e) { + if (!this.startDrag) { + return; + } + this.end(e); + }, + onSwipe: function onSwipe(e) { + this.end(e, true); + }, + end: function end(e, swipe) { + var _props2 = this.props, + tabBarPosition = _props2.tabBarPosition, + animated = _props2.animated; + + this.startDrag = false; + if (animated) { + setTransition(this.rootNode.style, ''); + } + var currentIndex = getIndexByDelta.call(this, e); + var finalIndex = this.startIndex; + if (currentIndex !== undefined) { + if (currentIndex < 0) { + finalIndex = 0; + } else if (currentIndex > this.maxIndex) { + finalIndex = this.maxIndex; + } else if (swipe) { + var delta = isVertical(tabBarPosition) ? e.deltaY : e.deltaX; + finalIndex = delta < 0 ? Math.ceil(currentIndex) : Math.floor(currentIndex); + } else { + var floorIndex = Math.floor(currentIndex); + if (currentIndex - floorIndex > 0.6) { + finalIndex = floorIndex + 1; + } else { + finalIndex = floorIndex; + } + } + } + if (this.children[finalIndex].props.disabled) { + return; + } + if (this.startIndex === finalIndex) { + if (animated) { + setTransform(this.rootNode.style, getTransformByIndex(finalIndex, this.props.tabBarPosition)); + } + } else { + this.props.onChange(getActiveKey(this.props.children, finalIndex)); + } + }, + render: function render() { + var _props3 = this.props, + tabBarPosition = _props3.tabBarPosition, + hammerOptions = _props3.hammerOptions, + animated = _props3.animated; + + var events = { + onSwipe: this.onSwipe, + onPanStart: this.onPanStart + }; + if (animated !== false) { + events = _extends({}, events, { + onPan: this.onPan, + onPanEnd: this.onPanEnd + }); + } + return React.createElement( + Hammer, + _extends({}, events, { + direction: isVertical(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL', + options: hammerOptions + }), + React.createElement(TabContent, this.props) + ); + } +}); + +export default SwipeableTabContent; \ No newline at end of file diff --git a/es/TabBar.js b/es/TabBar.js new file mode 100755 index 00000000..de9c9159 --- /dev/null +++ b/es/TabBar.js @@ -0,0 +1,14 @@ +import createReactClass from 'create-react-class'; +import TabBarMixin from './TabBarMixin'; +import RefMixin from './RefMixin'; + +var TabBar = createReactClass({ + displayName: 'TabBar', + mixins: [RefMixin, TabBarMixin], + render: function render() { + var tabs = this.getTabs(); + return this.getRootNode(tabs); + } +}); + +export default TabBar; \ No newline at end of file diff --git a/es/TabBarMixin.js b/es/TabBarMixin.js new file mode 100755 index 00000000..959f08c1 --- /dev/null +++ b/es/TabBarMixin.js @@ -0,0 +1,103 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; +import _extends from 'babel-runtime/helpers/extends'; +import React, { cloneElement } from 'react'; +import classnames from 'classnames'; +import warning from 'warning'; +import { getDataAttr } from './utils'; + +export default { + getDefaultProps: function getDefaultProps() { + return { + styles: {} + }; + }, + onTabClick: function onTabClick(key, e) { + this.props.onTabClick(key, e); + }, + getTabs: function getTabs() { + var _this = this; + + var _props = this.props, + children = _props.panels, + activeKey = _props.activeKey, + prefixCls = _props.prefixCls, + tabBarGutter = _props.tabBarGutter; + + var rst = []; + + React.Children.forEach(children, function (child, index) { + if (!child) { + return; + } + var key = child.key; + var cls = activeKey === key ? prefixCls + '-tab-active' : ''; + cls += ' ' + prefixCls + '-tab'; + var events = {}; + if (child.props.disabled) { + cls += ' ' + prefixCls + '-tab-disabled'; + } else { + events = { + onClick: function onClick(e) { + return _this.onTabClick.call(_this, key, e); + } + }; + } + var ref = {}; + if (activeKey === key) { + ref.ref = _this.saveRef('activeTab'); + } + warning('tab' in child.props, 'There must be `tab` property on children of Tabs.'); + rst.push(React.createElement( + 'div', + _extends({ + role: 'tab', + 'aria-disabled': child.props.disabled ? 'true' : 'false', + 'aria-selected': activeKey === key ? 'true' : 'false' + }, events, { + className: cls, + key: key, + style: { marginRight: tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter } + }, ref), + child.props.tab + )); + }); + + return rst; + }, + getRootNode: function getRootNode(contents) { + var _props2 = this.props, + prefixCls = _props2.prefixCls, + onKeyDown = _props2.onKeyDown, + className = _props2.className, + extraContent = _props2.extraContent, + style = _props2.style, + tabBarPosition = _props2.tabBarPosition, + restProps = _objectWithoutProperties(_props2, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition']); + + var cls = classnames(prefixCls + '-bar', _defineProperty({}, className, !!className)); + var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; + var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; + var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {}; + var children = contents; + if (extraContent) { + children = [cloneElement(extraContent, { + key: 'extra', + style: _extends({}, tabBarExtraContentStyle, extraContentStyle) + }), cloneElement(contents, { key: 'content' })]; + children = topOrBottom ? children : children.reverse(); + } + return React.createElement( + 'div', + _extends({ + role: 'tablist', + className: cls, + tabIndex: '0', + ref: this.saveRef('root'), + onKeyDown: onKeyDown, + style: style + }, getDataAttr(restProps)), + children + ); + } +}; \ No newline at end of file diff --git a/es/TabContent.js b/es/TabContent.js new file mode 100755 index 00000000..a779c6f7 --- /dev/null +++ b/es/TabContent.js @@ -0,0 +1,81 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import React from 'react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import classnames from 'classnames'; +import { getTransformByIndex, getActiveIndex, getTransformPropValue, getMarginStyle } from './utils'; + +var TabContent = createReactClass({ + displayName: 'TabContent', + propTypes: { + animated: PropTypes.bool, + animatedWithMargin: PropTypes.bool, + prefixCls: PropTypes.string, + children: PropTypes.any, + activeKey: PropTypes.string, + style: PropTypes.any, + tabBarPosition: PropTypes.string + }, + getDefaultProps: function getDefaultProps() { + return { + animated: true + }; + }, + getTabPanes: function getTabPanes() { + var props = this.props; + var activeKey = props.activeKey; + var children = props.children; + var newChildren = []; + + React.Children.forEach(children, function (child) { + if (!child) { + return; + } + var key = child.key; + var active = activeKey === key; + newChildren.push(React.cloneElement(child, { + active: active, + destroyInactiveTabPane: props.destroyInactiveTabPane, + rootPrefixCls: props.prefixCls + })); + }); + + return newChildren; + }, + render: function render() { + var _classnames; + + var props = this.props; + var prefixCls = props.prefixCls, + children = props.children, + activeKey = props.activeKey, + tabBarPosition = props.tabBarPosition, + animated = props.animated, + animatedWithMargin = props.animatedWithMargin; + var style = props.style; + + var classes = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls + '-content', true), _defineProperty(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames)); + if (animated) { + var activeIndex = getActiveIndex(children, activeKey); + if (activeIndex !== -1) { + var animatedStyle = animatedWithMargin ? getMarginStyle(activeIndex, tabBarPosition) : getTransformPropValue(getTransformByIndex(activeIndex, tabBarPosition)); + style = _extends({}, style, animatedStyle); + } else { + style = _extends({}, style, { + display: 'none' + }); + } + } + return React.createElement( + 'div', + { + className: classes, + style: style + }, + this.getTabPanes() + ); + } +}); + +export default TabContent; \ No newline at end of file diff --git a/es/TabPane.js b/es/TabPane.js new file mode 100755 index 00000000..6a508357 --- /dev/null +++ b/es/TabPane.js @@ -0,0 +1,54 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; +import React from 'react'; +import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; +import classnames from 'classnames'; +import { getDataAttr } from './utils'; + +var TabPane = createReactClass({ + displayName: 'TabPane', + propTypes: { + className: PropTypes.string, + active: PropTypes.bool, + style: PropTypes.any, + destroyInactiveTabPane: PropTypes.bool, + forceRender: PropTypes.bool, + placeholder: PropTypes.node + }, + getDefaultProps: function getDefaultProps() { + return { placeholder: null }; + }, + render: function render() { + var _classnames; + + var _props = this.props, + className = _props.className, + destroyInactiveTabPane = _props.destroyInactiveTabPane, + active = _props.active, + forceRender = _props.forceRender, + rootPrefixCls = _props.rootPrefixCls, + style = _props.style, + children = _props.children, + placeholder = _props.placeholder, + restProps = _objectWithoutProperties(_props, ['className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); + + this._isActived = this._isActived || active; + var prefixCls = rootPrefixCls + '-tabpane'; + var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-inactive', !active), _defineProperty(_classnames, prefixCls + '-active', active), _defineProperty(_classnames, className, className), _classnames)); + var isRender = destroyInactiveTabPane ? active : this._isActived; + return React.createElement( + 'div', + _extends({ + style: style, + role: 'tabpanel', + 'aria-hidden': active ? 'false' : 'true', + className: cls + }, getDataAttr(restProps)), + isRender || forceRender ? children : placeholder + ); + } +}); + +export default TabPane; \ No newline at end of file diff --git a/es/Tabs.js b/es/Tabs.js new file mode 100755 index 00000000..2a4340e7 --- /dev/null +++ b/es/Tabs.js @@ -0,0 +1,225 @@ +import _extends from 'babel-runtime/helpers/extends'; +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; +import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; +import _createClass from 'babel-runtime/helpers/createClass'; +import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; +import _inherits from 'babel-runtime/helpers/inherits'; +import React from 'react'; +import PropTypes from 'prop-types'; +import KeyCode from './KeyCode'; +import TabPane from './TabPane'; +import classnames from 'classnames'; +import { getDataAttr } from './utils'; + +function noop() {} + +function getDefaultActiveKey(props) { + var activeKey = void 0; + React.Children.forEach(props.children, function (child) { + if (child && !activeKey && !child.props.disabled) { + activeKey = child.key; + } + }); + return activeKey; +} + +function activeKeyIsValid(props, key) { + var keys = React.Children.map(props.children, function (child) { + return child && child.key; + }); + return keys.indexOf(key) >= 0; +} + +var Tabs = function (_React$Component) { + _inherits(Tabs, _React$Component); + + function Tabs(props) { + _classCallCheck(this, Tabs); + + var _this = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); + + _initialiseProps.call(_this); + + var activeKey = void 0; + if ('activeKey' in props) { + activeKey = props.activeKey; + } else if ('defaultActiveKey' in props) { + activeKey = props.defaultActiveKey; + } else { + activeKey = getDefaultActiveKey(props); + } + + _this.state = { + activeKey: activeKey + }; + return _this; + } + + _createClass(Tabs, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if ('activeKey' in nextProps) { + this.setState({ + activeKey: nextProps.activeKey + }); + } else if (!activeKeyIsValid(nextProps, this.state.activeKey)) { + // https://github.com/ant-design/ant-design/issues/7093 + this.setState({ + activeKey: getDefaultActiveKey(nextProps) + }); + } + } + }, { + key: 'render', + value: function render() { + var _classnames; + + var props = this.props; + + var prefixCls = props.prefixCls, + navWrapper = props.navWrapper, + tabBarPosition = props.tabBarPosition, + className = props.className, + renderTabContent = props.renderTabContent, + renderTabBar = props.renderTabBar, + destroyInactiveTabPane = props.destroyInactiveTabPane, + restProps = _objectWithoutProperties(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane']); + + var cls = classnames((_classnames = {}, _defineProperty(_classnames, prefixCls, 1), _defineProperty(_classnames, prefixCls + '-' + tabBarPosition, 1), _defineProperty(_classnames, className, !!className), _classnames)); + + this.tabBar = renderTabBar(); + var contents = [React.cloneElement(this.tabBar, { + prefixCls: prefixCls, + navWrapper: navWrapper, + key: 'tabBar', + onKeyDown: this.onNavKeyDown, + tabBarPosition: tabBarPosition, + onTabClick: this.onTabClick, + panels: props.children, + activeKey: this.state.activeKey + }), React.cloneElement(renderTabContent(), { + prefixCls: prefixCls, + tabBarPosition: tabBarPosition, + activeKey: this.state.activeKey, + destroyInactiveTabPane: destroyInactiveTabPane, + children: props.children, + onChange: this.setActiveKey, + key: 'tabContent' + })]; + if (tabBarPosition === 'bottom') { + contents.reverse(); + } + return React.createElement( + 'div', + _extends({ + className: cls, + style: props.style + }, getDataAttr(restProps)), + contents + ); + } + }]); + + return Tabs; +}(React.Component); + +var _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onTabClick = function (activeKey, e) { + if (_this2.tabBar.props.onTabClick) { + _this2.tabBar.props.onTabClick(activeKey, e); + } + _this2.setActiveKey(activeKey); + }; + + this.onNavKeyDown = function (e) { + var canDownNavKey = _this2.props.canDownNavKey; + + + if (canDownNavKey && !canDownNavKey()) { + return; + } + + var eventKeyCode = e.keyCode; + if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) { + e.preventDefault(); + var nextKey = _this2.getNextActiveKey(true); + _this2.onTabClick(nextKey); + } else if (eventKeyCode === KeyCode.LEFT || eventKeyCode === KeyCode.UP) { + e.preventDefault(); + var previousKey = _this2.getNextActiveKey(false); + _this2.onTabClick(previousKey); + } + }; + + this.setActiveKey = function (activeKey) { + if (_this2.state.activeKey !== activeKey) { + if (!('activeKey' in _this2.props)) { + _this2.setState({ + activeKey: activeKey + }); + } + _this2.props.onChange(activeKey); + } + }; + + this.getNextActiveKey = function (next) { + var activeKey = _this2.state.activeKey; + var children = []; + React.Children.forEach(_this2.props.children, function (c) { + if (c && !c.props.disabled) { + if (next) { + children.push(c); + } else { + children.unshift(c); + } + } + }); + var length = children.length; + var ret = length && children[0].key; + children.forEach(function (child, i) { + if (child.key === activeKey) { + if (i === length - 1) { + ret = children[0].key; + } else { + ret = children[i + 1].key; + } + } + }); + return ret; + }; +}; + +export default Tabs; + + +Tabs.propTypes = { + destroyInactiveTabPane: PropTypes.bool, + renderTabBar: PropTypes.func.isRequired, + renderTabContent: PropTypes.func.isRequired, + navWrapper: PropTypes.func, + onChange: PropTypes.func, + children: PropTypes.any, + prefixCls: PropTypes.string, + className: PropTypes.string, + tabBarPosition: PropTypes.string, + style: PropTypes.object, + activeKey: PropTypes.string, + defaultActiveKey: PropTypes.string, + canDownNavKey: PropTypes.func +}; + +Tabs.defaultProps = { + prefixCls: 'rc-tabs', + destroyInactiveTabPane: false, + onChange: noop, + navWrapper: function navWrapper(arg) { + return arg; + }, + tabBarPosition: 'top', + style: {} +}; + +Tabs.TabPane = TabPane; \ No newline at end of file diff --git a/es/index.js b/es/index.js new file mode 100755 index 00000000..d2ab5ff2 --- /dev/null +++ b/es/index.js @@ -0,0 +1,6 @@ +import Tabs from './Tabs'; +import TabPane from './TabPane'; +import TabContent from './TabContent'; + +export default Tabs; +export { TabPane, TabContent }; \ No newline at end of file diff --git a/es/utils.js b/es/utils.js new file mode 100755 index 00000000..2d211666 --- /dev/null +++ b/es/utils.js @@ -0,0 +1,83 @@ +import _defineProperty from 'babel-runtime/helpers/defineProperty'; +import React from 'react'; + +export function toArray(children) { + // allow [c,[a,b]] + var c = []; + React.Children.forEach(children, function (child) { + if (child) { + c.push(child); + } + }); + return c; +} + +export function getActiveIndex(children, activeKey) { + var c = toArray(children); + for (var i = 0; i < c.length; i++) { + if (c[i].key === activeKey) { + return i; + } + } + return -1; +} + +export function getActiveKey(children, index) { + var c = toArray(children); + return c[index].key; +} + +export function setTransform(style, v) { + style.transform = v; + style.webkitTransform = v; + style.mozTransform = v; +} + +export function isTransformSupported(style) { + return 'transform' in style || 'webkitTransform' in style || 'MozTransform' in style; +} + +export function setTransition(style, v) { + style.transition = v; + style.webkitTransition = v; + style.MozTransition = v; +} +export function getTransformPropValue(v) { + return { + transform: v, + WebkitTransform: v, + MozTransform: v + }; +} + +export function isVertical(tabBarPosition) { + return tabBarPosition === 'left' || tabBarPosition === 'right'; +} + +export function getTransformByIndex(index, tabBarPosition) { + var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX'; + return translate + '(' + -index * 100 + '%) translateZ(0)'; +} + +export function getMarginStyle(index, tabBarPosition) { + var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft'; + return _defineProperty({}, marginDirection, -index * 100 + '%'); +} + +export function getStyle(el, property) { + return +getComputedStyle(el).getPropertyValue(property).replace('px', ''); +} + +export function setPxStyle(el, value, vertical) { + value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px'; + setTransform(el.style, 'translate3d(' + value + ')'); +} + +export function getDataAttr(props) { + return Object.keys(props).reduce(function (prev, key) { + if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { + prev[key] = props[key]; + } + return prev; + }, {}); +} \ No newline at end of file diff --git a/lib/InkTabBar.js b/lib/InkTabBar.js new file mode 100755 index 00000000..ec7a7fa2 --- /dev/null +++ b/lib/InkTabBar.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _InkTabBarMixin = require('./InkTabBarMixin'); + +var _InkTabBarMixin2 = _interopRequireDefault(_InkTabBarMixin); + +var _TabBarMixin = require('./TabBarMixin'); + +var _TabBarMixin2 = _interopRequireDefault(_TabBarMixin); + +var _RefMixin = require('./RefMixin'); + +var _RefMixin2 = _interopRequireDefault(_RefMixin); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var InkTabBar = (0, _createReactClass2['default'])({ + displayName: 'InkTabBar', + mixins: [_RefMixin2['default'], _TabBarMixin2['default'], _InkTabBarMixin2['default']], + render: function render() { + var inkBarNode = this.getInkBarNode(); + var tabs = this.getTabs(); + return this.getRootNode([inkBarNode, tabs]); + } +}); + +exports['default'] = InkTabBar; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/InkTabBarMixin.js b/lib/InkTabBarMixin.js new file mode 100755 index 00000000..b7889736 --- /dev/null +++ b/lib/InkTabBarMixin.js @@ -0,0 +1,171 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +exports.getScroll = getScroll; + +var _utils = require('./utils'); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var isDev = process.env.NODE_ENV !== 'production'; + +function getScroll(w, top) { + var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; + var method = 'scroll' + (top ? 'Top' : 'Left'); + if (typeof ret !== 'number') { + var d = w.document; + // ie6,7,8 standard mode + ret = d.documentElement[method]; + if (typeof ret !== 'number') { + // quirks mode + ret = d.body[method]; + } + } + return ret; +} + +function offset(elem) { + var box = void 0; + var x = void 0; + var y = void 0; + var doc = elem.ownerDocument; + var body = doc.body; + var docElem = doc && doc.documentElement; + box = elem.getBoundingClientRect(); + x = box.left; + y = box.top; + x -= docElem.clientLeft || body.clientLeft || 0; + y -= docElem.clientTop || body.clientTop || 0; + var w = doc.defaultView || doc.parentWindow; + x += getScroll(w); + y += getScroll(w, true); + return { + left: x, top: y + }; +} + +function _componentDidUpdate(component, init) { + var styles = component.props.styles; + + var rootNode = component.root; + var wrapNode = component.nav || rootNode; + var containerOffset = offset(wrapNode); + var inkBarNode = component.inkBar; + var activeTab = component.activeTab; + var inkBarNodeStyle = inkBarNode.style; + var tabBarPosition = component.props.tabBarPosition; + if (init) { + // prevent mount animation + inkBarNodeStyle.display = 'none'; + } + if (activeTab) { + var tabNode = activeTab; + var tabOffset = offset(tabNode); + var transformSupported = (0, _utils.isTransformSupported)(inkBarNodeStyle); + if (tabBarPosition === 'top' || tabBarPosition === 'bottom') { + var left = tabOffset.left - containerOffset.left; + var width = tabNode.offsetWidth; + + // If tabNode'width width equal to wrapNode'width when tabBarPosition is top or bottom + // It means no css working, then ink bar should not have width until css is loaded + // Fix https://github.com/ant-design/ant-design/issues/7564 + if (width === rootNode.offsetWidth) { + width = 0; + } else if (styles.inkBar && styles.inkBar.width !== undefined) { + width = parseFloat(styles.inkBar.width, 10); + if (width) { + left = left + (tabNode.offsetWidth - width) / 2; + } + } + // use 3d gpu to optimize render + if (transformSupported) { + (0, _utils.setTransform)(inkBarNodeStyle, 'translate3d(' + left + 'px,0,0)'); + inkBarNodeStyle.width = width + 'px'; + inkBarNodeStyle.height = ''; + } else { + inkBarNodeStyle.left = left + 'px'; + inkBarNodeStyle.top = ''; + inkBarNodeStyle.bottom = ''; + inkBarNodeStyle.right = wrapNode.offsetWidth - left - width + 'px'; + } + } else { + var top = tabOffset.top - containerOffset.top; + var height = tabNode.offsetHeight; + if (styles.inkBar && styles.inkBar.height !== undefined) { + height = parseFloat(styles.inkBar.height, 10); + if (height) { + top = top + (tabNode.offsetHeight - height) / 2; + } + } + if (transformSupported) { + (0, _utils.setTransform)(inkBarNodeStyle, 'translate3d(0,' + top + 'px,0)'); + inkBarNodeStyle.height = height + 'px'; + inkBarNodeStyle.width = ''; + } else { + inkBarNodeStyle.left = ''; + inkBarNodeStyle.right = ''; + inkBarNodeStyle.top = top + 'px'; + inkBarNodeStyle.bottom = wrapNode.offsetHeight - top - height + 'px'; + } + } + } + inkBarNodeStyle.display = activeTab ? 'block' : 'none'; +} + +exports['default'] = { + getDefaultProps: function getDefaultProps() { + return { + inkBarAnimated: true + }; + }, + componentDidUpdate: function componentDidUpdate() { + _componentDidUpdate(this); + }, + componentDidMount: function componentDidMount() { + var _this = this; + + if (isDev) { + // https://github.com/ant-design/ant-design/issues/8678 + this.timeout = setTimeout(function () { + _componentDidUpdate(_this, true); + }, 0); + } else { + _componentDidUpdate(this, true); + } + }, + componentWillUnmount: function componentWillUnmount() { + clearTimeout(this.timeout); + }, + getInkBarNode: function getInkBarNode() { + var _classnames; + + var _props = this.props, + prefixCls = _props.prefixCls, + styles = _props.styles, + inkBarAnimated = _props.inkBarAnimated; + + var className = prefixCls + '-ink-bar'; + var classes = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, className, true), (0, _defineProperty3['default'])(_classnames, inkBarAnimated ? className + '-animated' : className + '-no-animated', true), _classnames)); + return _react2['default'].createElement('div', { + style: styles.inkBar, + className: classes, + key: 'inkBar', + ref: this.saveRef('inkBar') + }); + } +}; \ No newline at end of file diff --git a/lib/KeyCode.js b/lib/KeyCode.js new file mode 100755 index 00000000..9eccf620 --- /dev/null +++ b/lib/KeyCode.js @@ -0,0 +1,24 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = { + /** + * LEFT + */ + LEFT: 37, // also NUM_WEST + /** + * UP + */ + UP: 38, // also NUM_NORTH + /** + * RIGHT + */ + RIGHT: 39, // also NUM_EAST + /** + * DOWN + */ + DOWN: 40 // also NUM_SOUTH +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/RefMixin.js b/lib/RefMixin.js new file mode 100644 index 00000000..597e112d --- /dev/null +++ b/lib/RefMixin.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = { + saveRef: function saveRef(name) { + var _this = this; + + return function (node) { + _this[name] = node; + }; + } +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/ScrollableInkTabBar.js b/lib/ScrollableInkTabBar.js new file mode 100755 index 00000000..a15d0564 --- /dev/null +++ b/lib/ScrollableInkTabBar.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _InkTabBarMixin = require('./InkTabBarMixin'); + +var _InkTabBarMixin2 = _interopRequireDefault(_InkTabBarMixin); + +var _ScrollableTabBarMixin = require('./ScrollableTabBarMixin'); + +var _ScrollableTabBarMixin2 = _interopRequireDefault(_ScrollableTabBarMixin); + +var _TabBarMixin = require('./TabBarMixin'); + +var _TabBarMixin2 = _interopRequireDefault(_TabBarMixin); + +var _RefMixin = require('./RefMixin'); + +var _RefMixin2 = _interopRequireDefault(_RefMixin); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var ScrollableInkTabBar = (0, _createReactClass2['default'])({ + displayName: 'ScrollableInkTabBar', + mixins: [_RefMixin2['default'], _TabBarMixin2['default'], _InkTabBarMixin2['default'], _ScrollableTabBarMixin2['default']], + render: function render() { + var inkBarNode = this.getInkBarNode(); + var tabs = this.getTabs(); + var scrollbarNode = this.getScrollBarNode([inkBarNode, tabs]); + return this.getRootNode(scrollbarNode); + } +}); + +exports['default'] = ScrollableInkTabBar; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/ScrollableTabBar.js b/lib/ScrollableTabBar.js new file mode 100755 index 00000000..0bd9e58e --- /dev/null +++ b/lib/ScrollableTabBar.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _ScrollableTabBarMixin = require('./ScrollableTabBarMixin'); + +var _ScrollableTabBarMixin2 = _interopRequireDefault(_ScrollableTabBarMixin); + +var _TabBarMixin = require('./TabBarMixin'); + +var _TabBarMixin2 = _interopRequireDefault(_TabBarMixin); + +var _RefMixin = require('./RefMixin'); + +var _RefMixin2 = _interopRequireDefault(_RefMixin); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var ScrollableTabBar = (0, _createReactClass2['default'])({ + displayName: 'ScrollableTabBar', + mixins: [_RefMixin2['default'], _TabBarMixin2['default'], _ScrollableTabBarMixin2['default']], + render: function render() { + var inkBarNode = this.getInkBarNode(); + var tabs = this.getTabs(); + var scrollbarNode = this.getScrollBarNode([inkBarNode, tabs]); + return this.getRootNode(scrollbarNode); + } +}); + +exports['default'] = ScrollableTabBar; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/ScrollableTabBarMixin.js b/lib/ScrollableTabBarMixin.js new file mode 100755 index 00000000..75e9298f --- /dev/null +++ b/lib/ScrollableTabBarMixin.js @@ -0,0 +1,326 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _classnames5 = require('classnames'); + +var _classnames6 = _interopRequireDefault(_classnames5); + +var _utils = require('./utils'); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _addEventListener = require('rc-util/lib/Dom/addEventListener'); + +var _addEventListener2 = _interopRequireDefault(_addEventListener); + +var _debounce = require('lodash/debounce'); + +var _debounce2 = _interopRequireDefault(_debounce); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +exports['default'] = { + getDefaultProps: function getDefaultProps() { + return { + scrollAnimated: true, + onPrevClick: function onPrevClick() {}, + onNextClick: function onNextClick() {} + }; + }, + getInitialState: function getInitialState() { + this.offset = 0; + return { + next: false, + prev: false + }; + }, + componentDidMount: function componentDidMount() { + var _this = this; + + this.componentDidUpdate(); + this.debouncedResize = (0, _debounce2['default'])(function () { + _this.setNextPrev(); + _this.scrollToActiveTab(); + }, 200); + this.resizeEvent = (0, _addEventListener2['default'])(window, 'resize', this.debouncedResize); + }, + componentDidUpdate: function componentDidUpdate(prevProps) { + var props = this.props; + if (prevProps && prevProps.tabBarPosition !== props.tabBarPosition) { + this.setOffset(0); + return; + } + var nextPrev = this.setNextPrev(); + // wait next, prev show hide + /* eslint react/no-did-update-set-state:0 */ + if (this.isNextPrevShown(this.state) !== this.isNextPrevShown(nextPrev)) { + this.setState({}, this.scrollToActiveTab); + } else if (!prevProps || props.activeKey !== prevProps.activeKey) { + // can not use props.activeKey + this.scrollToActiveTab(); + } + }, + componentWillUnmount: function componentWillUnmount() { + if (this.resizeEvent) { + this.resizeEvent.remove(); + } + if (this.debouncedResize && this.debouncedResize.cancel) { + this.debouncedResize.cancel(); + } + }, + setNextPrev: function setNextPrev() { + var navNode = this.nav; + var navNodeWH = this.getScrollWH(navNode); + var containerWH = this.getOffsetWH(this.container); + var navWrapNodeWH = this.getOffsetWH(this.navWrap); + var offset = this.offset; + + var minOffset = containerWH - navNodeWH; + var _state = this.state, + next = _state.next, + prev = _state.prev; + + if (minOffset >= 0) { + next = false; + this.setOffset(0, false); + offset = 0; + } else if (minOffset < offset) { + next = true; + } else { + next = false; + // Fix https://github.com/ant-design/ant-design/issues/8861 + // Test with container offset which is stable + // and set the offset of the nav wrap node + var realOffset = navWrapNodeWH - navNodeWH; + this.setOffset(realOffset, false); + offset = realOffset; + } + + if (offset < 0) { + prev = true; + } else { + prev = false; + } + + this.setNext(next); + this.setPrev(prev); + return { + next: next, + prev: prev + }; + }, + getOffsetWH: function getOffsetWH(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'offsetWidth'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'offsetHeight'; + } + return node[prop]; + }, + getScrollWH: function getScrollWH(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'scrollWidth'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'scrollHeight'; + } + return node[prop]; + }, + getOffsetLT: function getOffsetLT(node) { + var tabBarPosition = this.props.tabBarPosition; + var prop = 'left'; + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + prop = 'top'; + } + return node.getBoundingClientRect()[prop]; + }, + setOffset: function setOffset(offset) { + var checkNextPrev = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + var target = Math.min(0, offset); + if (this.offset !== target) { + this.offset = target; + var navOffset = {}; + var tabBarPosition = this.props.tabBarPosition; + var navStyle = this.nav.style; + var transformSupported = (0, _utils.isTransformSupported)(navStyle); + if (tabBarPosition === 'left' || tabBarPosition === 'right') { + if (transformSupported) { + navOffset = { + value: 'translate3d(0,' + target + 'px,0)' + }; + } else { + navOffset = { + name: 'top', + value: target + 'px' + }; + } + } else { + if (transformSupported) { + navOffset = { + value: 'translate3d(' + target + 'px,0,0)' + }; + } else { + navOffset = { + name: 'left', + value: target + 'px' + }; + } + } + if (transformSupported) { + (0, _utils.setTransform)(navStyle, navOffset.value); + } else { + navStyle[navOffset.name] = navOffset.value; + } + if (checkNextPrev) { + this.setNextPrev(); + } + } + }, + setPrev: function setPrev(v) { + if (this.state.prev !== v) { + this.setState({ + prev: v + }); + } + }, + setNext: function setNext(v) { + if (this.state.next !== v) { + this.setState({ + next: v + }); + } + }, + isNextPrevShown: function isNextPrevShown(state) { + if (state) { + return state.next || state.prev; + } + return this.state.next || this.state.prev; + }, + prevTransitionEnd: function prevTransitionEnd(e) { + if (e.propertyName !== 'opacity') { + return; + } + var container = this.container; + + this.scrollToActiveTab({ + target: container, + currentTarget: container + }); + }, + scrollToActiveTab: function scrollToActiveTab(e) { + var activeTab = this.activeTab, + navWrap = this.navWrap; + + if (e && e.target !== e.currentTarget || !activeTab) { + return; + } + + // when not scrollable or enter scrollable first time, don't emit scrolling + var needToSroll = this.isNextPrevShown() && this.lastNextPrevShown; + this.lastNextPrevShown = this.isNextPrevShown(); + if (!needToSroll) { + return; + } + + var activeTabWH = this.getScrollWH(activeTab); + var navWrapNodeWH = this.getOffsetWH(navWrap); + var offset = this.offset; + + var wrapOffset = this.getOffsetLT(navWrap); + var activeTabOffset = this.getOffsetLT(activeTab); + if (wrapOffset > activeTabOffset) { + offset += wrapOffset - activeTabOffset; + this.setOffset(offset); + } else if (wrapOffset + navWrapNodeWH < activeTabOffset + activeTabWH) { + offset -= activeTabOffset + activeTabWH - (wrapOffset + navWrapNodeWH); + this.setOffset(offset); + } + }, + prev: function prev(e) { + this.props.onPrevClick(e); + var navWrapNode = this.navWrap; + var navWrapNodeWH = this.getOffsetWH(navWrapNode); + var offset = this.offset; + + this.setOffset(offset + navWrapNodeWH); + }, + next: function next(e) { + this.props.onNextClick(e); + var navWrapNode = this.navWrap; + var navWrapNodeWH = this.getOffsetWH(navWrapNode); + var offset = this.offset; + + this.setOffset(offset - navWrapNodeWH); + }, + getScrollBarNode: function getScrollBarNode(content) { + var _classnames, _classnames2, _classnames3, _classnames4; + + var _state2 = this.state, + next = _state2.next, + prev = _state2.prev; + var _props = this.props, + prefixCls = _props.prefixCls, + scrollAnimated = _props.scrollAnimated, + navWrapper = _props.navWrapper; + + var showNextPrev = prev || next; + + var prevButton = _react2['default'].createElement( + 'span', + { + onClick: prev ? this.prev : null, + unselectable: 'unselectable', + className: (0, _classnames6['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-prev', 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-btn-disabled', !prev), (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-arrow-show', showNextPrev), _classnames)), + onTransitionEnd: this.prevTransitionEnd + }, + _react2['default'].createElement('span', { className: prefixCls + '-tab-prev-icon' }) + ); + + var nextButton = _react2['default'].createElement( + 'span', + { + onClick: next ? this.next : null, + unselectable: 'unselectable', + className: (0, _classnames6['default'])((_classnames2 = {}, (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-next', 1), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-btn-disabled', !next), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-tab-arrow-show', showNextPrev), _classnames2)) + }, + _react2['default'].createElement('span', { className: prefixCls + '-tab-next-icon' }) + ); + + var navClassName = prefixCls + '-nav'; + var navClasses = (0, _classnames6['default'])((_classnames3 = {}, (0, _defineProperty3['default'])(_classnames3, navClassName, true), (0, _defineProperty3['default'])(_classnames3, scrollAnimated ? navClassName + '-animated' : navClassName + '-no-animated', true), _classnames3)); + + return _react2['default'].createElement( + 'div', + { + className: (0, _classnames6['default'])((_classnames4 = {}, (0, _defineProperty3['default'])(_classnames4, prefixCls + '-nav-container', 1), (0, _defineProperty3['default'])(_classnames4, prefixCls + '-nav-container-scrolling', showNextPrev), _classnames4)), + key: 'container', + ref: this.saveRef('container') + }, + prevButton, + nextButton, + _react2['default'].createElement( + 'div', + { className: prefixCls + '-nav-wrap', ref: this.saveRef('navWrap') }, + _react2['default'].createElement( + 'div', + { className: prefixCls + '-nav-scroll' }, + _react2['default'].createElement( + 'div', + { className: navClasses, ref: this.saveRef('nav') }, + navWrapper(content) + ) + ) + ) + ); + } +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/SwipeableInkTabBar.js b/lib/SwipeableInkTabBar.js new file mode 100755 index 00000000..dfc3d0fe --- /dev/null +++ b/lib/SwipeableInkTabBar.js @@ -0,0 +1,109 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +var _InkTabBarMixin = require('./InkTabBarMixin'); + +var _InkTabBarMixin2 = _interopRequireDefault(_InkTabBarMixin); + +var _SwipeableTabBarMixin = require('./SwipeableTabBarMixin'); + +var _SwipeableTabBarMixin2 = _interopRequireDefault(_SwipeableTabBarMixin); + +var _TabBarMixin = require('./TabBarMixin'); + +var _TabBarMixin2 = _interopRequireDefault(_TabBarMixin); + +var _RefMixin = require('./RefMixin'); + +var _RefMixin2 = _interopRequireDefault(_RefMixin); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var SwipeableInkTabBar = (0, _createReactClass2['default'])({ + displayName: 'SwipeableInkTabBar', + + mixins: [_RefMixin2['default'], _TabBarMixin2['default'], _InkTabBarMixin2['default'], _SwipeableTabBarMixin2['default']], + + getSwipeableTabs: function getSwipeableTabs() { + var _this = this; + + var props = this.props; + var children = props.panels; + var activeKey = props.activeKey; + var rst = []; + var prefixCls = props.prefixCls; + + var _flexWidth = 1 / props.pageSize * 100 + '%'; + var tabStyle = { + WebkitFlexBasis: _flexWidth, + flexBasis: _flexWidth + }; + + _react2['default'].Children.forEach(children, function (child) { + var _classnames; + + if (!child) { + return; + } + var key = child.key; + var cls = (0, _classnames3['default'])(prefixCls + '-tab', (_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-active', activeKey === key), (0, _defineProperty3['default'])(_classnames, prefixCls + '-tab-disabled', child.props.disabled), _classnames)); + var events = {}; + if (!child.props.disabled) { + events = { + onClick: _this.onTabClick.bind(_this, key) + }; + } + var refProps = {}; + if (activeKey === key) { + refProps.ref = _this.saveRef('activeTab'); + } + rst.push(_react2['default'].createElement( + 'div', + (0, _extends3['default'])({ + role: 'tab', + style: tabStyle, + 'aria-disabled': child.props.disabled ? 'true' : 'false', + 'aria-selected': activeKey === key ? 'true' : 'false' + }, events, { + className: cls, + key: key + }, refProps), + child.props.tab + )); + }); + + return rst; + }, + render: function render() { + var inkBarNode = this.getInkBarNode(); + var tabs = this.getSwipeableTabs(); + var scrollbarNode = this.getSwipeBarNode([inkBarNode, tabs]); + return this.getRootNode(scrollbarNode); + } +}); + +exports['default'] = SwipeableInkTabBar; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/SwipeableTabBarMixin.js b/lib/SwipeableTabBarMixin.js new file mode 100755 index 00000000..7edcbc1f --- /dev/null +++ b/lib/SwipeableTabBarMixin.js @@ -0,0 +1,238 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _classnames3 = require('classnames'); + +var _classnames4 = _interopRequireDefault(_classnames3); + +var _rcHammerjs = require('rc-hammerjs'); + +var _rcHammerjs2 = _interopRequireDefault(_rcHammerjs); + +var _reactDom = require('react-dom'); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +exports['default'] = { + getInitialState: function getInitialState() { + var _checkPaginationByKey = this.checkPaginationByKey(this.props.activeKey), + hasPrevPage = _checkPaginationByKey.hasPrevPage, + hasNextPage = _checkPaginationByKey.hasNextPage; + + return { + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }; + }, + getDefaultProps: function getDefaultProps() { + return { + hammerOptions: {}, + pageSize: 5, // per page show how many tabs + speed: 7 // swipe speed, 1 to 10, more bigger more faster + }; + }, + checkPaginationByKey: function checkPaginationByKey(activeKey) { + var _props = this.props, + panels = _props.panels, + pageSize = _props.pageSize; + + var index = this.getIndexByKey(activeKey); + var centerTabCount = Math.floor(pageSize / 2); + // the basic rule is to make activeTab be shown in the center of TabBar viewport + return { + hasPrevPage: index - centerTabCount > 0, + hasNextPage: index + centerTabCount < panels.length + }; + }, + + /** + * used for props.activeKey setting, not for swipe callback + */ + getDeltaByKey: function getDeltaByKey(activeKey) { + var pageSize = this.props.pageSize; + + var index = this.getIndexByKey(activeKey); + var centerTabCount = Math.floor(pageSize / 2); + var tabWidth = this.cache.tabWidth; + + var delta = (index - centerTabCount) * tabWidth * -1; + return delta; + }, + getIndexByKey: function getIndexByKey(activeKey) { + var panels = this.props.panels; + + var length = panels.length; + for (var i = 0; i < length; i++) { + if (panels[i].key === activeKey) { + return i; + } + } + return -1; + }, + checkPaginationByDelta: function checkPaginationByDelta(delta) { + var totalAvaliableDelta = this.cache.totalAvaliableDelta; + + return { + hasPrevPage: delta < 0, + hasNextPage: -delta < totalAvaliableDelta + }; + }, + setSwipePositionByKey: function setSwipePositionByKey(activeKey) { + var _checkPaginationByKey2 = this.checkPaginationByKey(activeKey), + hasPrevPage = _checkPaginationByKey2.hasPrevPage, + hasNextPage = _checkPaginationByKey2.hasNextPage; + + var totalAvaliableDelta = this.cache.totalAvaliableDelta; + + this.setState({ + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }); + var delta = void 0; + if (!hasPrevPage) { + // the first page + delta = 0; + } else if (!hasNextPage) { + // the last page + delta = -totalAvaliableDelta; + } else if (hasNextPage) { + // the middle page + delta = this.getDeltaByKey(activeKey); + } + this.cache.totalDelta = delta; + this.setSwipePosition(); + }, + setSwipePosition: function setSwipePosition() { + var _cache = this.cache, + totalDelta = _cache.totalDelta, + vertical = _cache.vertical; + + (0, _utils.setPxStyle)(this.swipeNode, totalDelta, vertical); + }, + componentDidMount: function componentDidMount() { + var swipe = this.swipe, + nav = this.nav; + var _props2 = this.props, + tabBarPosition = _props2.tabBarPosition, + pageSize = _props2.pageSize, + panels = _props2.panels, + activeKey = _props2.activeKey; + + this.swipeNode = _reactDom2['default'].findDOMNode(swipe); // dom which scroll (9999px) + this.realNode = _reactDom2['default'].findDOMNode(nav); // dom which visiable in screen (viewport) + var _isVertical = (0, _utils.isVertical)(tabBarPosition); + var _viewSize = (0, _utils.getStyle)(this.realNode, _isVertical ? 'height' : 'width'); + var _tabWidth = _viewSize / pageSize; + this.cache = { + vertical: _isVertical, + totalAvaliableDelta: _tabWidth * panels.length - _viewSize, + tabWidth: _tabWidth + }; + this.setSwipePositionByKey(activeKey); + }, + componentWillReceiveProps: function componentWillReceiveProps(nextProps) { + if (nextProps.activeKey && nextProps.activeKey !== this.props.activeKey) { + this.setSwipePositionByKey(nextProps.activeKey); + } + }, + onPan: function onPan(e) { + var _cache2 = this.cache, + vertical = _cache2.vertical, + totalAvaliableDelta = _cache2.totalAvaliableDelta, + totalDelta = _cache2.totalDelta; + var speed = this.props.speed; + // calculate touch distance + + var nowDelta = vertical ? e.deltaY : e.deltaX; + nowDelta = nowDelta * (speed / 10); + + // calculate distance dom need transform + var _nextDelta = nowDelta + totalDelta; + if (_nextDelta >= 0) { + _nextDelta = 0; + } else if (_nextDelta <= -totalAvaliableDelta) { + _nextDelta = -totalAvaliableDelta; + } + + this.cache.totalDelta = _nextDelta; + this.setSwipePosition(); + + // calculate pagination display + + var _checkPaginationByDel = this.checkPaginationByDelta(this.cache.totalDelta), + hasPrevPage = _checkPaginationByDel.hasPrevPage, + hasNextPage = _checkPaginationByDel.hasNextPage; + + if (hasPrevPage !== this.state.hasPrevPage || hasNextPage !== this.state.hasNextPage) { + this.setState({ + hasPrevPage: hasPrevPage, + hasNextPage: hasNextPage + }); + } + }, + getSwipeBarNode: function getSwipeBarNode(tabs) { + var _classnames2; + + var _props3 = this.props, + prefixCls = _props3.prefixCls, + hammerOptions = _props3.hammerOptions, + tabBarPosition = _props3.tabBarPosition; + var _state = this.state, + hasPrevPage = _state.hasPrevPage, + hasNextPage = _state.hasNextPage; + + var navClassName = prefixCls + '-nav'; + var navClasses = (0, _classnames4['default'])((0, _defineProperty3['default'])({}, navClassName, true)); + var events = { + onPan: this.onPan + }; + return _react2['default'].createElement( + 'div', + { + className: (0, _classnames4['default'])((_classnames2 = {}, (0, _defineProperty3['default'])(_classnames2, prefixCls + '-nav-container', 1), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-nav-swipe-container', 1), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-prevpage', hasPrevPage), (0, _defineProperty3['default'])(_classnames2, prefixCls + '-nextpage', hasNextPage), _classnames2)), + key: 'container', + ref: this.saveRef('container') + }, + _react2['default'].createElement( + 'div', + { className: prefixCls + '-nav-wrap', ref: this.saveRef('navWrap') }, + _react2['default'].createElement( + _rcHammerjs2['default'], + (0, _extends3['default'])({}, events, { + direction: (0, _utils.isVertical)(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL', + options: hammerOptions + }), + _react2['default'].createElement( + 'div', + { className: prefixCls + '-nav-swipe', ref: this.saveRef('swipe') }, + _react2['default'].createElement( + 'div', + { className: navClasses, ref: this.saveRef('nav') }, + tabs + ) + ) + ) + ) + ); + } +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/SwipeableTabContent.js b/lib/SwipeableTabContent.js new file mode 100755 index 00000000..e5bf8fb0 --- /dev/null +++ b/lib/SwipeableTabContent.js @@ -0,0 +1,206 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _TabContent = require('./TabContent'); + +var _TabContent2 = _interopRequireDefault(_TabContent); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _rcHammerjs = require('rc-hammerjs'); + +var _rcHammerjs2 = _interopRequireDefault(_rcHammerjs); + +var _reactDom = require('react-dom'); + +var _reactDom2 = _interopRequireDefault(_reactDom); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var RESISTANCE_COEF = 0.6; + +function computeIndex(_ref) { + var maxIndex = _ref.maxIndex, + startIndex = _ref.startIndex, + delta = _ref.delta, + viewSize = _ref.viewSize; + + var index = startIndex + -delta / viewSize; + if (index < 0) { + index = Math.exp(index * RESISTANCE_COEF) - 1; + } else if (index > maxIndex) { + index = maxIndex + 1 - Math.exp((maxIndex - index) * RESISTANCE_COEF); + } + return index; +} + +function getIndexByDelta(e) { + var delta = (0, _utils.isVertical)(this.props.tabBarPosition) ? e.deltaY : e.deltaX; + var otherDelta = (0, _utils.isVertical)(this.props.tabBarPosition) ? e.deltaX : e.deltaY; + if (Math.abs(delta) < Math.abs(otherDelta)) { + return undefined; + } + var currentIndex = computeIndex({ + maxIndex: this.maxIndex, + viewSize: this.viewSize, + startIndex: this.startIndex, + delta: delta + }); + var showIndex = delta < 0 ? Math.floor(currentIndex + 1) : Math.floor(currentIndex); + if (showIndex < 0) { + showIndex = 0; + } else if (showIndex > this.maxIndex) { + showIndex = this.maxIndex; + } + if (this.children[showIndex].props.disabled) { + return undefined; + } + return currentIndex; +} + +var SwipeableTabContent = (0, _createReactClass2['default'])({ + displayName: 'SwipeableTabContent', + + propTypes: { + tabBarPosition: _propTypes2['default'].string, + onChange: _propTypes2['default'].func, + children: _propTypes2['default'].any, + hammerOptions: _propTypes2['default'].any, + animated: _propTypes2['default'].bool, + activeKey: _propTypes2['default'].string + }, + + getDefaultProps: function getDefaultProps() { + return { + animated: true + }; + }, + componentDidMount: function componentDidMount() { + this.rootNode = _reactDom2['default'].findDOMNode(this); + }, + onPanStart: function onPanStart() { + var _props = this.props, + tabBarPosition = _props.tabBarPosition, + children = _props.children, + activeKey = _props.activeKey, + animated = _props.animated; + + var startIndex = this.startIndex = (0, _utils.getActiveIndex)(children, activeKey); + if (startIndex === -1) { + return; + } + if (animated) { + (0, _utils.setTransition)(this.rootNode.style, 'none'); + } + this.startDrag = true; + this.children = (0, _utils.toArray)(children); + this.maxIndex = this.children.length - 1; + this.viewSize = (0, _utils.isVertical)(tabBarPosition) ? this.rootNode.offsetHeight : this.rootNode.offsetWidth; + }, + onPan: function onPan(e) { + if (!this.startDrag) { + return; + } + var tabBarPosition = this.props.tabBarPosition; + + var currentIndex = getIndexByDelta.call(this, e); + if (currentIndex !== undefined) { + (0, _utils.setTransform)(this.rootNode.style, (0, _utils.getTransformByIndex)(currentIndex, tabBarPosition)); + } + }, + onPanEnd: function onPanEnd(e) { + if (!this.startDrag) { + return; + } + this.end(e); + }, + onSwipe: function onSwipe(e) { + this.end(e, true); + }, + end: function end(e, swipe) { + var _props2 = this.props, + tabBarPosition = _props2.tabBarPosition, + animated = _props2.animated; + + this.startDrag = false; + if (animated) { + (0, _utils.setTransition)(this.rootNode.style, ''); + } + var currentIndex = getIndexByDelta.call(this, e); + var finalIndex = this.startIndex; + if (currentIndex !== undefined) { + if (currentIndex < 0) { + finalIndex = 0; + } else if (currentIndex > this.maxIndex) { + finalIndex = this.maxIndex; + } else if (swipe) { + var delta = (0, _utils.isVertical)(tabBarPosition) ? e.deltaY : e.deltaX; + finalIndex = delta < 0 ? Math.ceil(currentIndex) : Math.floor(currentIndex); + } else { + var floorIndex = Math.floor(currentIndex); + if (currentIndex - floorIndex > 0.6) { + finalIndex = floorIndex + 1; + } else { + finalIndex = floorIndex; + } + } + } + if (this.children[finalIndex].props.disabled) { + return; + } + if (this.startIndex === finalIndex) { + if (animated) { + (0, _utils.setTransform)(this.rootNode.style, (0, _utils.getTransformByIndex)(finalIndex, this.props.tabBarPosition)); + } + } else { + this.props.onChange((0, _utils.getActiveKey)(this.props.children, finalIndex)); + } + }, + render: function render() { + var _props3 = this.props, + tabBarPosition = _props3.tabBarPosition, + hammerOptions = _props3.hammerOptions, + animated = _props3.animated; + + var events = { + onSwipe: this.onSwipe, + onPanStart: this.onPanStart + }; + if (animated !== false) { + events = (0, _extends3['default'])({}, events, { + onPan: this.onPan, + onPanEnd: this.onPanEnd + }); + } + return _react2['default'].createElement( + _rcHammerjs2['default'], + (0, _extends3['default'])({}, events, { + direction: (0, _utils.isVertical)(tabBarPosition) ? 'DIRECTION_ALL' : 'DIRECTION_HORIZONTAL', + options: hammerOptions + }), + _react2['default'].createElement(_TabContent2['default'], this.props) + ); + } +}); + +exports['default'] = SwipeableTabContent; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/TabBar.js b/lib/TabBar.js new file mode 100755 index 00000000..f59e7823 --- /dev/null +++ b/lib/TabBar.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _TabBarMixin = require('./TabBarMixin'); + +var _TabBarMixin2 = _interopRequireDefault(_TabBarMixin); + +var _RefMixin = require('./RefMixin'); + +var _RefMixin2 = _interopRequireDefault(_RefMixin); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var TabBar = (0, _createReactClass2['default'])({ + displayName: 'TabBar', + mixins: [_RefMixin2['default'], _TabBarMixin2['default']], + render: function render() { + var tabs = this.getTabs(); + return this.getRootNode(tabs); + } +}); + +exports['default'] = TabBar; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/TabBarMixin.js b/lib/TabBarMixin.js new file mode 100755 index 00000000..cc8f5afd --- /dev/null +++ b/lib/TabBarMixin.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); + +var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +var _warning = require('warning'); + +var _warning2 = _interopRequireDefault(_warning); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +exports['default'] = { + getDefaultProps: function getDefaultProps() { + return { + styles: {} + }; + }, + onTabClick: function onTabClick(key, e) { + this.props.onTabClick(key, e); + }, + getTabs: function getTabs() { + var _this = this; + + var _props = this.props, + children = _props.panels, + activeKey = _props.activeKey, + prefixCls = _props.prefixCls, + tabBarGutter = _props.tabBarGutter; + + var rst = []; + + _react2['default'].Children.forEach(children, function (child, index) { + if (!child) { + return; + } + var key = child.key; + var cls = activeKey === key ? prefixCls + '-tab-active' : ''; + cls += ' ' + prefixCls + '-tab'; + var events = {}; + if (child.props.disabled) { + cls += ' ' + prefixCls + '-tab-disabled'; + } else { + events = { + onClick: function onClick(e) { + return _this.onTabClick.call(_this, key, e); + } + }; + } + var ref = {}; + if (activeKey === key) { + ref.ref = _this.saveRef('activeTab'); + } + (0, _warning2['default'])('tab' in child.props, 'There must be `tab` property on children of Tabs.'); + rst.push(_react2['default'].createElement( + 'div', + (0, _extends3['default'])({ + role: 'tab', + 'aria-disabled': child.props.disabled ? 'true' : 'false', + 'aria-selected': activeKey === key ? 'true' : 'false' + }, events, { + className: cls, + key: key, + style: { marginRight: tabBarGutter && index === children.length - 1 ? 0 : tabBarGutter } + }, ref), + child.props.tab + )); + }); + + return rst; + }, + getRootNode: function getRootNode(contents) { + var _props2 = this.props, + prefixCls = _props2.prefixCls, + onKeyDown = _props2.onKeyDown, + className = _props2.className, + extraContent = _props2.extraContent, + style = _props2.style, + tabBarPosition = _props2.tabBarPosition, + restProps = (0, _objectWithoutProperties3['default'])(_props2, ['prefixCls', 'onKeyDown', 'className', 'extraContent', 'style', 'tabBarPosition']); + + var cls = (0, _classnames3['default'])(prefixCls + '-bar', (0, _defineProperty3['default'])({}, className, !!className)); + var topOrBottom = tabBarPosition === 'top' || tabBarPosition === 'bottom'; + var tabBarExtraContentStyle = topOrBottom ? { float: 'right' } : {}; + var extraContentStyle = extraContent && extraContent.props ? extraContent.props.style : {}; + var children = contents; + if (extraContent) { + children = [(0, _react.cloneElement)(extraContent, { + key: 'extra', + style: (0, _extends3['default'])({}, tabBarExtraContentStyle, extraContentStyle) + }), (0, _react.cloneElement)(contents, { key: 'content' })]; + children = topOrBottom ? children : children.reverse(); + } + return _react2['default'].createElement( + 'div', + (0, _extends3['default'])({ + role: 'tablist', + className: cls, + tabIndex: '0', + ref: this.saveRef('root'), + onKeyDown: onKeyDown, + style: style + }, (0, _utils.getDataAttr)(restProps)), + children + ); + } +}; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/TabContent.js b/lib/TabContent.js new file mode 100755 index 00000000..1e9230aa --- /dev/null +++ b/lib/TabContent.js @@ -0,0 +1,108 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var TabContent = (0, _createReactClass2['default'])({ + displayName: 'TabContent', + propTypes: { + animated: _propTypes2['default'].bool, + animatedWithMargin: _propTypes2['default'].bool, + prefixCls: _propTypes2['default'].string, + children: _propTypes2['default'].any, + activeKey: _propTypes2['default'].string, + style: _propTypes2['default'].any, + tabBarPosition: _propTypes2['default'].string + }, + getDefaultProps: function getDefaultProps() { + return { + animated: true + }; + }, + getTabPanes: function getTabPanes() { + var props = this.props; + var activeKey = props.activeKey; + var children = props.children; + var newChildren = []; + + _react2['default'].Children.forEach(children, function (child) { + if (!child) { + return; + } + var key = child.key; + var active = activeKey === key; + newChildren.push(_react2['default'].cloneElement(child, { + active: active, + destroyInactiveTabPane: props.destroyInactiveTabPane, + rootPrefixCls: props.prefixCls + })); + }); + + return newChildren; + }, + render: function render() { + var _classnames; + + var props = this.props; + var prefixCls = props.prefixCls, + children = props.children, + activeKey = props.activeKey, + tabBarPosition = props.tabBarPosition, + animated = props.animated, + animatedWithMargin = props.animatedWithMargin; + var style = props.style; + + var classes = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls + '-content', true), (0, _defineProperty3['default'])(_classnames, animated ? prefixCls + '-content-animated' : prefixCls + '-content-no-animated', true), _classnames)); + if (animated) { + var activeIndex = (0, _utils.getActiveIndex)(children, activeKey); + if (activeIndex !== -1) { + var animatedStyle = animatedWithMargin ? (0, _utils.getMarginStyle)(activeIndex, tabBarPosition) : (0, _utils.getTransformPropValue)((0, _utils.getTransformByIndex)(activeIndex, tabBarPosition)); + style = (0, _extends3['default'])({}, style, animatedStyle); + } else { + style = (0, _extends3['default'])({}, style, { + display: 'none' + }); + } + } + return _react2['default'].createElement( + 'div', + { + className: classes, + style: style + }, + this.getTabPanes() + ); + } +}); + +exports['default'] = TabContent; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/TabPane.js b/lib/TabPane.js new file mode 100755 index 00000000..50b30ae2 --- /dev/null +++ b/lib/TabPane.js @@ -0,0 +1,84 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); + +var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _createReactClass = require('create-react-class'); + +var _createReactClass2 = _interopRequireDefault(_createReactClass); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var TabPane = (0, _createReactClass2['default'])({ + displayName: 'TabPane', + propTypes: { + className: _propTypes2['default'].string, + active: _propTypes2['default'].bool, + style: _propTypes2['default'].any, + destroyInactiveTabPane: _propTypes2['default'].bool, + forceRender: _propTypes2['default'].bool, + placeholder: _propTypes2['default'].node + }, + getDefaultProps: function getDefaultProps() { + return { placeholder: null }; + }, + render: function render() { + var _classnames; + + var _props = this.props, + className = _props.className, + destroyInactiveTabPane = _props.destroyInactiveTabPane, + active = _props.active, + forceRender = _props.forceRender, + rootPrefixCls = _props.rootPrefixCls, + style = _props.style, + children = _props.children, + placeholder = _props.placeholder, + restProps = (0, _objectWithoutProperties3['default'])(_props, ['className', 'destroyInactiveTabPane', 'active', 'forceRender', 'rootPrefixCls', 'style', 'children', 'placeholder']); + + this._isActived = this._isActived || active; + var prefixCls = rootPrefixCls + '-tabpane'; + var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls, 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-inactive', !active), (0, _defineProperty3['default'])(_classnames, prefixCls + '-active', active), (0, _defineProperty3['default'])(_classnames, className, className), _classnames)); + var isRender = destroyInactiveTabPane ? active : this._isActived; + return _react2['default'].createElement( + 'div', + (0, _extends3['default'])({ + style: style, + role: 'tabpanel', + 'aria-hidden': active ? 'false' : 'true', + className: cls + }, (0, _utils.getDataAttr)(restProps)), + isRender || forceRender ? children : placeholder + ); + } +}); + +exports['default'] = TabPane; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/Tabs.js b/lib/Tabs.js new file mode 100755 index 00000000..3fd25df3 --- /dev/null +++ b/lib/Tabs.js @@ -0,0 +1,268 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties'); + +var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2); + +var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require('babel-runtime/helpers/createClass'); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); + +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); + +var _inherits2 = require('babel-runtime/helpers/inherits'); + +var _inherits3 = _interopRequireDefault(_inherits2); + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +var _propTypes = require('prop-types'); + +var _propTypes2 = _interopRequireDefault(_propTypes); + +var _KeyCode = require('./KeyCode'); + +var _KeyCode2 = _interopRequireDefault(_KeyCode); + +var _TabPane = require('./TabPane'); + +var _TabPane2 = _interopRequireDefault(_TabPane); + +var _classnames2 = require('classnames'); + +var _classnames3 = _interopRequireDefault(_classnames2); + +var _utils = require('./utils'); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function noop() {} + +function getDefaultActiveKey(props) { + var activeKey = void 0; + _react2['default'].Children.forEach(props.children, function (child) { + if (child && !activeKey && !child.props.disabled) { + activeKey = child.key; + } + }); + return activeKey; +} + +function activeKeyIsValid(props, key) { + var keys = _react2['default'].Children.map(props.children, function (child) { + return child && child.key; + }); + return keys.indexOf(key) >= 0; +} + +var Tabs = function (_React$Component) { + (0, _inherits3['default'])(Tabs, _React$Component); + + function Tabs(props) { + (0, _classCallCheck3['default'])(this, Tabs); + + var _this = (0, _possibleConstructorReturn3['default'])(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, props)); + + _initialiseProps.call(_this); + + var activeKey = void 0; + if ('activeKey' in props) { + activeKey = props.activeKey; + } else if ('defaultActiveKey' in props) { + activeKey = props.defaultActiveKey; + } else { + activeKey = getDefaultActiveKey(props); + } + + _this.state = { + activeKey: activeKey + }; + return _this; + } + + (0, _createClass3['default'])(Tabs, [{ + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(nextProps) { + if ('activeKey' in nextProps) { + this.setState({ + activeKey: nextProps.activeKey + }); + } else if (!activeKeyIsValid(nextProps, this.state.activeKey)) { + // https://github.com/ant-design/ant-design/issues/7093 + this.setState({ + activeKey: getDefaultActiveKey(nextProps) + }); + } + } + }, { + key: 'render', + value: function render() { + var _classnames; + + var props = this.props; + var prefixCls = props.prefixCls, + navWrapper = props.navWrapper, + tabBarPosition = props.tabBarPosition, + className = props.className, + renderTabContent = props.renderTabContent, + renderTabBar = props.renderTabBar, + destroyInactiveTabPane = props.destroyInactiveTabPane, + restProps = (0, _objectWithoutProperties3['default'])(props, ['prefixCls', 'navWrapper', 'tabBarPosition', 'className', 'renderTabContent', 'renderTabBar', 'destroyInactiveTabPane']); + + var cls = (0, _classnames3['default'])((_classnames = {}, (0, _defineProperty3['default'])(_classnames, prefixCls, 1), (0, _defineProperty3['default'])(_classnames, prefixCls + '-' + tabBarPosition, 1), (0, _defineProperty3['default'])(_classnames, className, !!className), _classnames)); + + this.tabBar = renderTabBar(); + var contents = [_react2['default'].cloneElement(this.tabBar, { + prefixCls: prefixCls, + navWrapper: navWrapper, + key: 'tabBar', + onKeyDown: this.onNavKeyDown, + tabBarPosition: tabBarPosition, + onTabClick: this.onTabClick, + panels: props.children, + activeKey: this.state.activeKey + }), _react2['default'].cloneElement(renderTabContent(), { + prefixCls: prefixCls, + tabBarPosition: tabBarPosition, + activeKey: this.state.activeKey, + destroyInactiveTabPane: destroyInactiveTabPane, + children: props.children, + onChange: this.setActiveKey, + key: 'tabContent' + })]; + if (tabBarPosition === 'bottom') { + contents.reverse(); + } + return _react2['default'].createElement( + 'div', + (0, _extends3['default'])({ + className: cls, + style: props.style + }, (0, _utils.getDataAttr)(restProps)), + contents + ); + } + }]); + return Tabs; +}(_react2['default'].Component); + +var _initialiseProps = function _initialiseProps() { + var _this2 = this; + + this.onTabClick = function (activeKey, e) { + if (_this2.tabBar.props.onTabClick) { + _this2.tabBar.props.onTabClick(activeKey, e); + } + _this2.setActiveKey(activeKey); + }; + + this.onNavKeyDown = function (e) { + var canDownNavKey = _this2.props.canDownNavKey; + + + if (canDownNavKey && !canDownNavKey()) { + return; + } + + var eventKeyCode = e.keyCode; + if (eventKeyCode === _KeyCode2['default'].RIGHT || eventKeyCode === _KeyCode2['default'].DOWN) { + e.preventDefault(); + var nextKey = _this2.getNextActiveKey(true); + _this2.onTabClick(nextKey); + } else if (eventKeyCode === _KeyCode2['default'].LEFT || eventKeyCode === _KeyCode2['default'].UP) { + e.preventDefault(); + var previousKey = _this2.getNextActiveKey(false); + _this2.onTabClick(previousKey); + } + }; + + this.setActiveKey = function (activeKey) { + if (_this2.state.activeKey !== activeKey) { + if (!('activeKey' in _this2.props)) { + _this2.setState({ + activeKey: activeKey + }); + } + _this2.props.onChange(activeKey); + } + }; + + this.getNextActiveKey = function (next) { + var activeKey = _this2.state.activeKey; + var children = []; + _react2['default'].Children.forEach(_this2.props.children, function (c) { + if (c && !c.props.disabled) { + if (next) { + children.push(c); + } else { + children.unshift(c); + } + } + }); + var length = children.length; + var ret = length && children[0].key; + children.forEach(function (child, i) { + if (child.key === activeKey) { + if (i === length - 1) { + ret = children[0].key; + } else { + ret = children[i + 1].key; + } + } + }); + return ret; + }; +}; + +exports['default'] = Tabs; + + +Tabs.propTypes = { + destroyInactiveTabPane: _propTypes2['default'].bool, + renderTabBar: _propTypes2['default'].func.isRequired, + renderTabContent: _propTypes2['default'].func.isRequired, + navWrapper: _propTypes2['default'].func, + onChange: _propTypes2['default'].func, + children: _propTypes2['default'].any, + prefixCls: _propTypes2['default'].string, + className: _propTypes2['default'].string, + tabBarPosition: _propTypes2['default'].string, + style: _propTypes2['default'].object, + activeKey: _propTypes2['default'].string, + defaultActiveKey: _propTypes2['default'].string, + canDownNavKey: _propTypes2['default'].func +}; + +Tabs.defaultProps = { + prefixCls: 'rc-tabs', + destroyInactiveTabPane: false, + onChange: noop, + navWrapper: function navWrapper(arg) { + return arg; + }, + tabBarPosition: 'top', + style: {} +}; + +Tabs.TabPane = _TabPane2['default']; +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100755 index 00000000..d1dae008 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.TabContent = exports.TabPane = undefined; + +var _Tabs = require('./Tabs'); + +var _Tabs2 = _interopRequireDefault(_Tabs); + +var _TabPane = require('./TabPane'); + +var _TabPane2 = _interopRequireDefault(_TabPane); + +var _TabContent = require('./TabContent'); + +var _TabContent2 = _interopRequireDefault(_TabContent); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +exports['default'] = _Tabs2['default']; +exports.TabPane = _TabPane2['default']; +exports.TabContent = _TabContent2['default']; \ No newline at end of file diff --git a/lib/utils.js b/lib/utils.js new file mode 100755 index 00000000..483fdbbd --- /dev/null +++ b/lib/utils.js @@ -0,0 +1,110 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _defineProperty2 = require('babel-runtime/helpers/defineProperty'); + +var _defineProperty3 = _interopRequireDefault(_defineProperty2); + +exports.toArray = toArray; +exports.getActiveIndex = getActiveIndex; +exports.getActiveKey = getActiveKey; +exports.setTransform = setTransform; +exports.isTransformSupported = isTransformSupported; +exports.setTransition = setTransition; +exports.getTransformPropValue = getTransformPropValue; +exports.isVertical = isVertical; +exports.getTransformByIndex = getTransformByIndex; +exports.getMarginStyle = getMarginStyle; +exports.getStyle = getStyle; +exports.setPxStyle = setPxStyle; +exports.getDataAttr = getDataAttr; + +var _react = require('react'); + +var _react2 = _interopRequireDefault(_react); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +function toArray(children) { + // allow [c,[a,b]] + var c = []; + _react2['default'].Children.forEach(children, function (child) { + if (child) { + c.push(child); + } + }); + return c; +} + +function getActiveIndex(children, activeKey) { + var c = toArray(children); + for (var i = 0; i < c.length; i++) { + if (c[i].key === activeKey) { + return i; + } + } + return -1; +} + +function getActiveKey(children, index) { + var c = toArray(children); + return c[index].key; +} + +function setTransform(style, v) { + style.transform = v; + style.webkitTransform = v; + style.mozTransform = v; +} + +function isTransformSupported(style) { + return 'transform' in style || 'webkitTransform' in style || 'MozTransform' in style; +} + +function setTransition(style, v) { + style.transition = v; + style.webkitTransition = v; + style.MozTransition = v; +} +function getTransformPropValue(v) { + return { + transform: v, + WebkitTransform: v, + MozTransform: v + }; +} + +function isVertical(tabBarPosition) { + return tabBarPosition === 'left' || tabBarPosition === 'right'; +} + +function getTransformByIndex(index, tabBarPosition) { + var translate = isVertical(tabBarPosition) ? 'translateY' : 'translateX'; + return translate + '(' + -index * 100 + '%) translateZ(0)'; +} + +function getMarginStyle(index, tabBarPosition) { + var marginDirection = isVertical(tabBarPosition) ? 'marginTop' : 'marginLeft'; + return (0, _defineProperty3['default'])({}, marginDirection, -index * 100 + '%'); +} + +function getStyle(el, property) { + return +getComputedStyle(el).getPropertyValue(property).replace('px', ''); +} + +function setPxStyle(el, value, vertical) { + value = vertical ? '0px, ' + value + 'px, 0px' : value + 'px, 0px, 0px'; + setTransform(el.style, 'translate3d(' + value + ')'); +} + +function getDataAttr(props) { + return Object.keys(props).reduce(function (prev, key) { + if (key.substr(0, 5) === 'aria-' || key.substr(0, 5) === 'data-' || key === 'role') { + prev[key] = props[key]; + } + return prev; + }, {}); +} \ No newline at end of file diff --git a/src/Tabs.js b/src/Tabs.js index 7b8f208e..b7a22a4a 100755 --- a/src/Tabs.js +++ b/src/Tabs.js @@ -62,6 +62,12 @@ export default class Tabs extends React.Component { } onNavKeyDown = (e) => { + const { canDownNavKey } = this.props; + + if (canDownNavKey && !canDownNavKey()) { + return; + } + const eventKeyCode = e.keyCode; if (eventKeyCode === KeyCode.RIGHT || eventKeyCode === KeyCode.DOWN) { e.preventDefault(); @@ -178,6 +184,7 @@ Tabs.propTypes = { style: PropTypes.object, activeKey: PropTypes.string, defaultActiveKey: PropTypes.string, + canDownNavKey: PropTypes.func, }; Tabs.defaultProps = {