├── .gitignore
├── .npmignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docs
├── asset-manifest.json
├── favicon.ico
├── index.html
├── precache-manifest.e012afa12f2c99b2d230df197b606f82.js
└── static
│ ├── css
│ ├── main.6ba08d2b.chunk.css
│ └── main.6ba08d2b.chunk.css.map
│ └── js
│ ├── 1.6582865d.chunk.js
│ ├── 1.6582865d.chunk.js.map
│ ├── main.20a12729.chunk.js
│ ├── main.20a12729.chunk.js.map
│ ├── runtime~main.e8bd0c2b.js
│ └── runtime~main.e8bd0c2b.js.map
├── index.js
├── lib
├── HandleBar.js
├── Helpers.js
├── Pane.js
├── Splitter.js
├── index.js
├── splitters.css
└── typings
│ └── index.d.ts
├── package.json
├── public
├── favicon.ico
└── index.html
├── src
├── App.css
├── App.scss
├── App.tsx
├── components
│ └── Splitters
│ │ ├── HandleBar.tsx
│ │ ├── Helpers.ts
│ │ ├── Pane.tsx
│ │ ├── Splitter.tsx
│ │ ├── index.tsx
│ │ ├── splitters.css
│ │ ├── splitters.scss
│ │ └── typings
│ │ └── index.d.ts
└── index.tsx
├── tsconfig.json
├── tsconfig.prod.json
├── tslint.json
└── yarn.lock
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env
15 | .idea
16 | npm-debug.log*
17 | yarn-debug.log*
18 | yarn-error.log*
19 |
20 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 | /docs
12 | /public
13 | /src
14 | /tsconfig.json
15 | /tslint.json
16 |
17 | # misc
18 | .DS_Store
19 | .env
20 | .idea
21 | yarn.lock
22 | npm-debug.log*
23 | yarn-debug.log*
24 | yarn-error.log*
25 |
26 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at martinnovak@outlook.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | If you have some idea how to improve React-Splitters feel free to open pull request.
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Martin Novák
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Splitters for React
2 |
3 | v. 1.2.0
4 |
5 | **New version changes**
6 |
7 | * fixed [issue](https://github.com/martinnov92/React-Splitters/issues/15)
8 |
9 | v. 1.1.0
10 |
11 | **New version changes**
12 |
13 | * fixed issue with `getBoundingClientRect` in React 16
14 |
15 | [NPM](https://www.npmjs.com/package/m-react-splitters)
16 |
17 | [Demo](https://martinnov92.github.io/React-Splitters/)
18 |
19 | Install: `npm install --save m-react-splitters`
20 |
21 | ---------
22 |
23 | Splitters for React has been written in TypeScript.
24 |
25 | This splitter supports touch screens.
26 |
27 | There are two options how the splitter can work.
28 | You can either select to resize splitters as you are holding and dragging the handlebar, or you can
29 | postponed the resize.
30 |
31 | Splitters can be nested, but you have to specify what positions (vertical / horizontal) are they going to be and their sizes.
32 |
33 | Left pane's (primary) width is calculated by `JavaScript`, the other panel's width is set by `CSS`.
34 |
35 | Usage in your projects:
36 | Please import splitters like this:
37 |
38 | ```
39 | import Splitter from 'm-react-splitters';
40 | import 'm-react-splitters/lib/splitters.css';
41 | ```
42 |
43 | Vertical splitter
44 | ```js
45 | primaryPaneMinWidth={number}
46 | primaryPaneMaxWidth="string" (% or px)
47 | primaryPaneWidth="string" (% or px)
48 | ```
49 |
50 | Vertical splitter
51 | ```js
52 | primaryPaneMinWidth={number}
53 | primaryPaneMaxWidth="string" (% or px)
54 | primaryPaneWidth="string" (% or px)
55 | ```
56 |
57 | Horizontal splitter
58 | ```js
59 | primaryPaneMinHeight={number}
60 | primaryPaneMaxHeight="string" (% or px)
61 | primaryPaneHeight="string" (% or px)
62 | ```
63 |
64 | Another options for splitter are:
65 |
66 | * `postPoned`: Boolean
67 |
68 | * this specifies how the resize will work
69 | * default is false
70 |
71 | * `className`: string
72 | * `primaryPaneClassName`: string
73 | * `secondaryPaneClassName`: string
74 | * `dispatchResize`: Boolean
75 |
76 | * This dispatch resize event, it is meant for other components which resize on window resize
77 | * it's something like temporary callback function
78 | * Default is false
79 |
80 | * or you can use:
81 |
82 | `onDragFinished`: function
83 |
84 | * `maximizedPrimaryPane`: Boolean
85 | * `minimalizedPrimaryPane`: Boolean
86 |
87 | ```tsx
88 |
96 |
103 |
104 |
105 |
106 |
107 |
108 | ```
--------------------------------------------------------------------------------
/docs/asset-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "main.css": "/React-Splitters/static/css/main.6ba08d2b.chunk.css",
3 | "main.js": "/React-Splitters/static/js/main.20a12729.chunk.js",
4 | "main.js.map": "/React-Splitters/static/js/main.20a12729.chunk.js.map",
5 | "static/js/1.6582865d.chunk.js": "/React-Splitters/static/js/1.6582865d.chunk.js",
6 | "static/js/1.6582865d.chunk.js.map": "/React-Splitters/static/js/1.6582865d.chunk.js.map",
7 | "runtime~main.js": "/React-Splitters/static/js/runtime~main.e8bd0c2b.js",
8 | "runtime~main.js.map": "/React-Splitters/static/js/runtime~main.e8bd0c2b.js.map",
9 | "static/css/main.6ba08d2b.chunk.css.map": "/React-Splitters/static/css/main.6ba08d2b.chunk.css.map",
10 | "index.html": "/React-Splitters/index.html",
11 | "precache-manifest.e012afa12f2c99b2d230df197b606f82.js": "/React-Splitters/precache-manifest.e012afa12f2c99b2d230df197b606f82.js",
12 | "service-worker.js": "/React-Splitters/service-worker.js"
13 | }
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/martinnov92/React-Splitters/c9ca351426e55c41c2016c9cc1c647dd17974783/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
React App
--------------------------------------------------------------------------------
/docs/precache-manifest.e012afa12f2c99b2d230df197b606f82.js:
--------------------------------------------------------------------------------
1 | self.__precacheManifest = [
2 | {
3 | "revision": "e8bd0c2b273fc34ffdca",
4 | "url": "/React-Splitters/static/js/runtime~main.e8bd0c2b.js"
5 | },
6 | {
7 | "revision": "20a12729a29cfec227ab",
8 | "url": "/React-Splitters/static/js/main.20a12729.chunk.js"
9 | },
10 | {
11 | "revision": "6582865d9c9b8076c0ee",
12 | "url": "/React-Splitters/static/js/1.6582865d.chunk.js"
13 | },
14 | {
15 | "revision": "20a12729a29cfec227ab",
16 | "url": "/React-Splitters/static/css/main.6ba08d2b.chunk.css"
17 | },
18 | {
19 | "revision": "95be091a1382400dfe4393622c88296b",
20 | "url": "/React-Splitters/index.html"
21 | }
22 | ];
--------------------------------------------------------------------------------
/docs/static/css/main.6ba08d2b.chunk.css:
--------------------------------------------------------------------------------
1 | .splitter{height:100%;position:relative;display:flex;flex:0 0 100%;align-content:flex-start;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.pane{flex-grow:1;height:100%}.splitter.horizontal{flex-wrap:nowrap;flex-direction:column}.splitter .pane:first-child{width:100%;height:100%;flex-grow:0;flex-shrink:0;flex-basis:auto}.splitter .pane:last-child{flex:1 1;flex-grow:1;flex-shrink:1;flex-basis:0;overflow:hidden}.bottom-detail-pane{padding:10px;background-color:#e7f5ce;z-index:10}.splitter .pane.bottom-detail-pane{overflow:auto}.handle-bar{width:10px;height:100%;min-width:10px;display:flex;justify-content:center;align-items:center;position:relative;z-index:20;background-color:#eeeff0;cursor:col-resize;font-size:14px}.handle-bar .handle-bar_drag{width:4px;height:20px;border-left:1px solid rgba(0,0,0,.0980392);border-right:1px solid rgba(0,0,0,.0980392)}.handle-bar.horizontal{width:100%;height:10px;min-height:10px;cursor:row-resize}.handle-bar.horizontal .handle-bar_drag{width:20px;height:4px;border-top:1px solid rgba(0,0,0,.0980392);border-bottom:1px solid rgba(0,0,0,.0980392);border-right:0;border-left:0}.handle-bar.handle-bar_clone,.handle-bar:active,.handle-bar:hover{background-color:#ccc}.handle-bar.handle-bar_clone{position:absolute;opacity:.9;z-index:12000}.handle-bar.resize-not-allowed{cursor:auto}.handle-bar.resize-not-allowed:hover{background-color:#eeeff0}.handle-bar.resize-not-allowed .handle-bar_drag{display:none}.rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}*{padding:0;margin:0;box-sizing:border-box}#root{width:100vw;height:100vh;overflow:hidden}.app,.splitter-wrapper{width:100%;height:100%;position:relative}.pane,.splitter-wrapper{overflow:hidden}.placeholder{height:100%;display:flex;flex-wrap:wrap;align-content:center;align-items:center;background-color:#f9f9f9;color:#394053;font-size:6em;font-family:Arial}.placeholder,.placeholder p,.placeholder span{width:100%;text-align:center}.placeholder p{display:block;font-size:18px}.placeholder._1{background-color:#bcd4de}.placeholder._2{background-color:#a5ccd1}.placeholder._3{background-color:#a0b9bf}.placeholder._4{background-color:#9dacb2}
2 | /*# sourceMappingURL=main.6ba08d2b.chunk.css.map */
--------------------------------------------------------------------------------
/docs/static/css/main.6ba08d2b.chunk.css.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["/Users/martinnovak/Documents/WORK/web_pages/GitHub/TypeScript Splitters_v1/src/components/Splitters/splitters.css","/Users/martinnovak/Documents/WORK/web_pages/GitHub/TypeScript Splitters_v1/src/App.css"],"names":[],"mappings":"AAAA,UACE,YAAa,AACb,kBAAmB,AACnB,aAAc,AACd,cAAe,AACf,yBAA0B,AAC1B,yBAAkB,AAAlB,sBAAkB,AAAlB,qBAAkB,AAAlB,gBAAkB,CAAE,AAEtB,MACE,YAAa,AACb,WAAa,CAAE,AAEjB,qBACE,iBAAkB,AAClB,qBAAuB,CAAE,AAE3B,4BACE,WAAY,AACZ,YAAa,AACb,YAAa,AACb,cAAe,AACf,eAAiB,CAAE,AAErB,2BACE,SAAY,AACZ,YAAa,AACb,cAAe,AACf,aAAc,AACd,eAAiB,CAAE,AAErB,oBACE,aAAc,AACd,yBAA0B,AAC1B,UAAY,CAAE,AAEhB,mCACE,aAAe,CAAE,AAGnB,YACE,WAAY,AACZ,YAAa,AACb,eAAgB,AAChB,aAAc,AACd,uBAAwB,AACxB,mBAAoB,AACpB,kBAAmB,AACnB,WAAY,AACZ,yBAA0B,AAC1B,kBAAmB,AACnB,cAAgB,CAAE,AAClB,6BACE,UAAW,AACX,YAAa,AACb,2CAAgD,AAChD,2CAAiD,CAAE,AACrD,uBACE,WAAY,AACZ,YAAa,AACb,gBAAiB,AACjB,iBAAmB,CAAE,AACrB,wCACE,WAAY,AACZ,WAAY,AACZ,0CAA+C,AAC/C,6CAAkD,AAClD,eAAgB,AAChB,aAAe,CAAE,AACrB,kEACE,qBAAuB,CAAE,AAC3B,6BACE,kBAAmB,AACnB,WAAY,AACZ,aAAe,CAAE,AACnB,+BACE,WAAa,CAAE,AACf,qCACE,wBAA0B,CAAE,AAC9B,gDACE,YAAc,CAAE,AAEtB,WACE,gCAAyB,AAAzB,uBAAyB,CAAE,AClF7B,EACE,UAAW,AACX,SAAU,AACV,qBAAuB,CAAE,AAE3B,MACE,YAAa,AACb,aAAc,AACd,eAAiB,CAAE,AAOrB,uBAJE,WAAY,AACZ,YAAa,AACb,iBAAmB,CAMA,AAErB,wBACE,eAAiB,CAAE,AAErB,aAEE,YAAa,AACb,aAAc,AACd,eAAgB,AAChB,qBAAsB,AACtB,mBAAoB,AAEpB,yBAA0B,AAC1B,cAAe,AACf,cAAe,AACf,iBAAmB,CAAE,AAIrB,8CAdA,WAAY,AAMZ,iBAAmB,CAYI,AAJvB,eAEE,cAAe,AACf,cAAgB,CACK,AACvB,gBACE,wBAA0B,CAAE,AAC9B,gBACE,wBAA0B,CAAE,AAC9B,gBACE,wBAA0B,CAAE,AAC9B,gBACE,wBAA0B,CAAE","file":"main.6ba08d2b.chunk.css","sourcesContent":[".splitter {\n height: 100%;\n position: relative;\n display: flex;\n flex: 0 0 100%;\n align-content: flex-start;\n user-select: text; }\n\n.pane {\n flex-grow: 1;\n height: 100%; }\n\n.splitter.horizontal {\n flex-wrap: nowrap;\n flex-direction: column; }\n\n.splitter .pane:first-child {\n width: 100%;\n height: 100%;\n flex-grow: 0;\n flex-shrink: 0;\n flex-basis: auto; }\n\n.splitter .pane:last-child {\n flex: 1 1 0;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n overflow: hidden; }\n\n.bottom-detail-pane {\n padding: 10px;\n background-color: #e7f5ce;\n z-index: 10; }\n\n.splitter .pane.bottom-detail-pane {\n overflow: auto; }\n\n/*handle bar*/\n.handle-bar {\n width: 10px;\n height: 100%;\n min-width: 10px;\n display: flex;\n justify-content: center;\n align-items: center;\n position: relative;\n z-index: 20;\n background-color: #eeeff0;\n cursor: col-resize;\n font-size: 14px; }\n .handle-bar .handle-bar_drag {\n width: 4px;\n height: 20px;\n border-left: 1px solid rgba(0, 0, 0, 0.0980392);\n border-right: 1px solid rgba(0, 0, 0, 0.0980392); }\n .handle-bar.horizontal {\n width: 100%;\n height: 10px;\n min-height: 10px;\n cursor: row-resize; }\n .handle-bar.horizontal .handle-bar_drag {\n width: 20px;\n height: 4px;\n border-top: 1px solid rgba(0, 0, 0, 0.0980392);\n border-bottom: 1px solid rgba(0, 0, 0, 0.0980392);\n border-right: 0;\n border-left: 0; }\n .handle-bar:active, .handle-bar:hover, .handle-bar.handle-bar_clone {\n background-color: #ccc; }\n .handle-bar.handle-bar_clone {\n position: absolute;\n opacity: .9;\n z-index: 12000; }\n .handle-bar.resize-not-allowed {\n cursor: auto; }\n .handle-bar.resize-not-allowed:hover {\n background-color: #eeeff0; }\n .handle-bar.resize-not-allowed .handle-bar_drag {\n display: none; }\n\n.rotate-90 {\n transform: rotate(90deg); }\n","* {\n padding: 0;\n margin: 0;\n box-sizing: border-box; }\n\n#root {\n width: 100vw;\n height: 100vh;\n overflow: hidden; }\n\n.app {\n width: 100%;\n height: 100%;\n position: relative; }\n\n.splitter-wrapper {\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden; }\n\n.pane {\n overflow: hidden; }\n\n.placeholder {\n width: 100%;\n height: 100%;\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n align-items: center;\n text-align: center;\n background-color: #f9f9f9;\n color: #394053;\n font-size: 6em;\n font-family: Arial; }\n .placeholder span {\n width: 100%;\n text-align: center; }\n .placeholder p {\n width: 100%;\n display: block;\n font-size: 18px;\n text-align: center; }\n .placeholder._1 {\n background-color: #BCD4DE; }\n .placeholder._2 {\n background-color: #A5CCD1; }\n .placeholder._3 {\n background-color: #A0B9BF; }\n .placeholder._4 {\n background-color: #9DACB2; }\n"]}
--------------------------------------------------------------------------------
/docs/static/js/1.6582865d.chunk.js:
--------------------------------------------------------------------------------
1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(e,t,n){"use strict";e.exports=n(7)},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,i,a=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;uU.length&&U.push(e)}function F(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case u:case s:l=!0}}if(l)return n(r,e,""===t?"."+M(e,0):t),1;if(l=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;ithis.eventPool.length&&this.eventPool.push(e)}function Se(e){e.eventPool=[],e.getPooled=xe,e.release=Te}i(_e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t=Pe),Re=String.fromCharCode(32),Ie={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Fe=!1;function Me(e,t){switch(e){case"keyup":return-1!==Ne.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function De(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var ze=!1;var Le={eventTypes:Ie,extractEvents:function(e,t,n,r){var o=void 0,l=void 0;if(ge)e:{switch(e){case"compositionstart":o=Ie.compositionStart;break e;case"compositionend":o=Ie.compositionEnd;break e;case"compositionupdate":o=Ie.compositionUpdate;break e}o=void 0}else ze?Me(e,n)&&(o=Ie.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Ie.compositionStart);return o?(Ue&&(ze||o!==Ie.compositionStart?o===Ie.compositionEnd&&ze&&(l=ye()):(ve._root=r,ve._startText=he(),ze=!0)),o=ke.getPooled(o,t,n,r),l?o.data=l:null!==(l=De(n))&&(o.data=l),ee(o),l=o):l=null,(e=Oe?function(e,t){switch(e){case"compositionend":return De(t);case"keypress":return 32!==t.which?null:(Fe=!0,Re);case"textInput":return(e=t.data)===Re&&Fe?null:e;default:return null}}(e,n):function(e,t){if(ze)return"compositionend"===e||!ge&&Me(e,t)?(e=ye(),ve._root=null,ve._startText=null,ve._fallbackText=null,ze=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!Tt.call(kt,e)||!Tt.call(St,e)&&(xt.test(e)?kt[e]=!0:(St[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function Ut(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Rt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=zt(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function It(e,t){null!=(t=t.checked)&&Ot(e,"checked",t,!1)}function Ft(e,t){It(e,t);var n=zt(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?Dt(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dt(e,t.type,zt(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Mt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){t=""+e._wrapperState.initialValue;var r=e.value;n||t===r||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==n&&(e.name=n)}function Dt(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function zt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gt,Pt);Nt[t]=new Et(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gt,Pt);Nt[t]=new Et(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gt,Pt);Nt[t]=new Et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),Nt.tabIndex=new Et("tabIndex",1,!1,"tabindex",null);var Lt={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function At(e,t,n){return(e=_e.getPooled(Lt.change,e,t,n)).type="change",$e(n),ee(e),e}var jt=null,Bt=null;function Ht(e){L(e,!1)}function Wt(e){if(ot(V(e)))return e}function $t(e,t){if("change"===e)return t}var Vt=!1;function bt(){jt&&(jt.detachEvent("onpropertychange",Qt),Bt=jt=null)}function Qt(e){"value"===e.propertyName&&Wt(Bt)&&Ze(Ht,e=At(Bt,e,et(e)))}function Gt(e,t,n){"focus"===e?(bt(),Bt=n,(jt=t).attachEvent("onpropertychange",Qt)):"blur"===e&&bt()}function Kt(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Wt(Bt)}function Xt(e,t){if("click"===e)return Wt(t)}function Yt(e,t){if("input"===e||"change"===e)return Wt(t)}l.canUseDOM&&(Vt=tt("input")&&(!document.documentMode||9Pn.length&&Pn.push(e)}}}var zn={get _enabled(){return Un},setEnabled:Rn,isEnabled:function(){return Un},trapBubbledEvent:In,trapCapturedEvent:Fn,dispatchEvent:Dn},Ln={},An=0,jn="_reactListenersID"+(""+Math.random()).slice(2);function Bn(e){return Object.prototype.hasOwnProperty.call(e,jn)||(e[jn]=An++,Ln[e[jn]]={}),Ln[e[jn]]}function Hn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wn(e,t){var n,r=Hn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hn(r)}}function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Vn=l.canUseDOM&&"documentMode"in document&&11>=document.documentMode,bn={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Qn=null,Gn=null,Kn=null,Xn=!1;function Yn(e,t){if(Xn||null==Qn||Qn!==u())return null;var n=Qn;return"selectionStart"in n&&$n(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?n={anchorNode:(n=window.getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}:n=void 0,Kn&&s(Kn,n)?null:(Kn=n,(e=_e.getPooled(bn.select,Gn,e,t)).type="select",e.target=Qn,ee(e),e)}var Zn={eventTypes:bn,extractEvents:function(e,t,n,r){var o,l=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!l)){e:{l=Bn(l),o=x.onSelect;for(var i=0;it)){e=-1;for(var n=[],r=ar;null!==r;){var o=r.timeoutTime;-1!==o&&o<=t?n.push(r):-1!==o&&(-1===e||ot&&(t=8),mr=t=t.length||p("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function Er(e,t){var n=t.value;null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Nr(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}var gr={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Pr(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Or(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Pr(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Ur,Rr=void 0,Ir=(Ur=function(e,t){if(e.namespaceURI!==gr.svg||"innerHTML"in e)e.innerHTML=t;else{for((Rr=Rr||document.createElement("div")).innerHTML=""+t+" ",t=Rr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Ur(e,t)})}:Ur);function Fr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Mr={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dr=["Webkit","ms","Moz","O"];function zr(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,l=t[n];o=null==l||"boolean"===typeof l||""===l?"":r||"number"!==typeof l||0===l||Mr.hasOwnProperty(o)&&Mr[o]?(""+l).trim():l+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(Mr).forEach(function(e){Dr.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mr[t]=Mr[e]})});var Lr=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ar(e,t,n){t&&(Lr[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&p("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&p("60"),"object"===typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||p("61")),null!=t.style&&"object"!==typeof t.style&&p("62",n()))}function jr(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Br=a.thatReturns("");function Hr(e,t){var n=Bn(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=x[t];for(var r=0;r<\/script>",e=e.removeChild(e.firstChild)):e="string"===typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function $r(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function Vr(e,t,n,r){var o=jr(t,n);switch(t){case"iframe":case"object":In("load",e);var l=n;break;case"video":case"audio":for(l=0;lio||(e.current=lo[io],lo[io]=null,io--)}function so(e,t){lo[++io]=e.current,e.current=t}var co=ao(f),fo=ao(!1),po=f;function mo(e){return yo(e)?po:co.current}function vo(e,t){var n=e.type.contextTypes;if(!n)return f;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,l={};for(o in n)l[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function yo(e){return 2===e.tag&&null!=e.type.childContextTypes}function ho(e){yo(e)&&(uo(fo),uo(co))}function wo(e){uo(fo),uo(co)}function Co(e,t,n){co.current!==f&&p("168"),so(co,t),so(fo,n)}function _o(e,t){var n=e.stateNode,r=e.type.childContextTypes;if("function"!==typeof n.getChildContext)return t;for(var o in n=n.getChildContext())o in r||p("108",Ct(e)||"Unknown",o);return i({},t,n)}function xo(e){if(!yo(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||f,po=co.current,so(co,t),so(fo,fo.current),!0}function To(e,t){var n=e.stateNode;if(n||p("169"),t){var r=_o(e,po);n.__reactInternalMemoizedMergedChildContext=r,uo(fo),uo(co),so(co,r)}else uo(fo);so(fo,t)}function So(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=null,this.index=0,this.ref=null,this.pendingProps=t,this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.expirationTime=0,this.alternate=null}function ko(e,t,n){var r=e.alternate;return null===r?((r=new So(e.tag,t,e.key,e.mode)).type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.effectTag=0,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null),r.expirationTime=n,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Eo(e,t,n){var r=e.type,o=e.key;if(e=e.props,"function"===typeof r)var l=r.prototype&&r.prototype.isReactComponent?2:0;else if("string"===typeof r)l=5;else switch(r){case st:return No(e.children,t,n,o);case mt:l=11,t|=3;break;case ct:l=11,t|=2;break;case ft:return(r=new So(15,e,o,4|t)).type=ft,r.expirationTime=n,r;case yt:l=16,t|=2;break;default:e:{switch("object"===typeof r&&null!==r?r.$$typeof:null){case pt:l=13;break e;case dt:l=12;break e;case vt:l=14;break e;default:p("130",null==r?r:typeof r,"")}l=void 0}}return(t=new So(l,e,o,t)).type=r,t.expirationTime=n,t}function No(e,t,n,r){return(e=new So(10,e,r,t)).expirationTime=n,e}function go(e,t,n){return(e=new So(6,e,null,t)).expirationTime=n,e}function Po(e,t,n){return(t=new So(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Oo(e,t,n){return e={current:t=new So(3,null,null,t?3:0),containerInfo:e,pendingChildren:null,earliestPendingTime:0,latestPendingTime:0,earliestSuspendedTime:0,latestSuspendedTime:0,latestPingedTime:0,pendingCommitExpirationTime:0,finishedWork:null,context:null,pendingContext:null,hydrate:n,remainingExpirationTime:0,firstBatch:null,nextScheduledRoot:null},t.stateNode=e}var Uo=null,Ro=null;function Io(e){return function(t){try{return e(t)}catch(n){}}}function Fo(e){"function"===typeof Uo&&Uo(e)}function Mo(e){"function"===typeof Ro&&Ro(e)}var Do=!1;function zo(e){return{expirationTime:0,baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Lo(e){return{expirationTime:e.expirationTime,baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ao(e){return{expirationTime:e,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function jo(e,t,n){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t),(0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n)}function Bo(e,t,n){var r=e.alternate;if(null===r){var o=e.updateQueue,l=null;null===o&&(o=e.updateQueue=zo(e.memoizedState))}else o=e.updateQueue,l=r.updateQueue,null===o?null===l?(o=e.updateQueue=zo(e.memoizedState),l=r.updateQueue=zo(r.memoizedState)):o=e.updateQueue=Lo(l):null===l&&(l=r.updateQueue=Lo(o));null===l||o===l?jo(o,t,n):null===o.lastUpdate||null===l.lastUpdate?(jo(o,t,n),jo(l,t,n)):(jo(o,t,n),l.lastUpdate=t)}function Ho(e,t,n){var r=e.updateQueue;null===(r=null===r?e.updateQueue=zo(e.memoizedState):Wo(e,r)).lastCapturedUpdate?r.firstCapturedUpdate=r.lastCapturedUpdate=t:(r.lastCapturedUpdate.next=t,r.lastCapturedUpdate=t),(0===r.expirationTime||r.expirationTime>n)&&(r.expirationTime=n)}function Wo(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=Lo(t)),t}function $o(e,t,n,r,o,l){switch(n.tag){case 1:return"function"===typeof(e=n.payload)?e.call(l,r,o):e;case 3:e.effectTag=-1025&e.effectTag|64;case 0:if(null===(o="function"===typeof(e=n.payload)?e.call(l,r,o):e)||void 0===o)break;return i({},r,o);case 2:Do=!0}return r}function Vo(e,t,n,r,o){if(Do=!1,!(0===t.expirationTime||t.expirationTime>o)){for(var l=(t=Wo(e,t)).baseState,i=null,a=0,u=t.firstUpdate,s=l;null!==u;){var c=u.expirationTime;c>o?(null===i&&(i=u,l=s),(0===a||a>c)&&(a=c)):(s=$o(e,0,u,s,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastEffect?t.firstEffect=t.lastEffect=u:(t.lastEffect.nextEffect=u,t.lastEffect=u))),u=u.next}for(c=null,u=t.firstCapturedUpdate;null!==u;){var f=u.expirationTime;f>o?(null===c&&(c=u,null===i&&(l=s)),(0===a||a>f)&&(a=f)):(s=$o(e,0,u,s,n,r),null!==u.callback&&(e.effectTag|=32,u.nextEffect=null,null===t.lastCapturedEffect?t.firstCapturedEffect=t.lastCapturedEffect=u:(t.lastCapturedEffect.nextEffect=u,t.lastCapturedEffect=u))),u=u.next}null===i&&(t.lastUpdate=null),null===c?t.lastCapturedUpdate=null:e.effectTag|=32,null===i&&null===c&&(l=s),t.baseState=l,t.firstUpdate=i,t.firstCapturedUpdate=c,t.expirationTime=a,e.memoizedState=s}}function bo(e,t){"function"!==typeof e&&p("191",e),e.call(t)}function Qo(e,t,n){for(null!==t.firstCapturedUpdate&&(null!==t.lastUpdate&&(t.lastUpdate.next=t.firstCapturedUpdate,t.lastUpdate=t.lastCapturedUpdate),t.firstCapturedUpdate=t.lastCapturedUpdate=null),e=t.firstEffect,t.firstEffect=t.lastEffect=null;null!==e;){var r=e.callback;null!==r&&(e.callback=null,bo(r,n)),e=e.nextEffect}for(e=t.firstCapturedEffect,t.firstCapturedEffect=t.lastCapturedEffect=null;null!==e;)null!==(t=e.callback)&&(e.callback=null,bo(t,n)),e=e.nextEffect}function Go(e,t){return{value:e,source:t,stack:_t(t)}}var Ko=ao(null),Xo=ao(null),Yo=ao(0);function Zo(e){var t=e.type._context;so(Yo,t._changedBits),so(Xo,t._currentValue),so(Ko,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode}function qo(e){var t=Yo.current,n=Xo.current;uo(Ko),uo(Xo),uo(Yo),(e=e.type._context)._currentValue=n,e._changedBits=t}var Jo={},el=ao(Jo),tl=ao(Jo),nl=ao(Jo);function rl(e){return e===Jo&&p("174"),e}function ol(e,t){so(nl,t),so(tl,e),so(el,Jo);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Or(null,"");break;default:t=Or(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}uo(el),so(el,t)}function ll(e){uo(el),uo(tl),uo(nl)}function il(e){tl.current===e&&(uo(el),uo(tl))}function al(e,t,n){var r=e.memoizedState;r=null===(t=t(n,r))||void 0===t?r:i({},r,t),e.memoizedState=r,null!==(e=e.updateQueue)&&0===e.expirationTime&&(e.baseState=r)}var ul={isMounted:function(e){return!!(e=e._reactInternalFiber)&&2===an(e)},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=_i(),o=Ao(r=wi(r,e));o.payload=t,void 0!==n&&null!==n&&(o.callback=n),Bo(e,o,r),Ci(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=_i(),o=Ao(r=wi(r,e));o.tag=1,o.payload=t,void 0!==n&&null!==n&&(o.callback=n),Bo(e,o,r),Ci(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=_i(),r=Ao(n=wi(n,e));r.tag=2,void 0!==t&&null!==t&&(r.callback=t),Bo(e,r,n),Ci(e,n)}};function sl(e,t,n,r,o,l){var i=e.stateNode;return e=e.type,"function"===typeof i.shouldComponentUpdate?i.shouldComponentUpdate(n,o,l):!e.prototype||!e.prototype.isPureReactComponent||(!s(t,n)||!s(r,o))}function cl(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ul.enqueueReplaceState(t,t.state,null)}function fl(e,t){var n=e.type,r=e.stateNode,o=e.pendingProps,l=mo(e);r.props=o,r.state=e.memoizedState,r.refs=f,r.context=vo(e,l),null!==(l=e.updateQueue)&&(Vo(e,l,o,r,t),r.state=e.memoizedState),"function"===typeof(l=e.type.getDerivedStateFromProps)&&(al(e,l,o),r.state=e.memoizedState),"function"===typeof n.getDerivedStateFromProps||"function"===typeof r.getSnapshotBeforeUpdate||"function"!==typeof r.UNSAFE_componentWillMount&&"function"!==typeof r.componentWillMount||(n=r.state,"function"===typeof r.componentWillMount&&r.componentWillMount(),"function"===typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),n!==r.state&&ul.enqueueReplaceState(r,r.state,null),null!==(l=e.updateQueue)&&(Vo(e,l,o,r,t),r.state=e.memoizedState)),"function"===typeof r.componentDidMount&&(e.effectTag|=4)}var pl=Array.isArray;function dl(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){n=n._owner;var r=void 0;n&&(2!==n.tag&&p("110"),r=n.stateNode),r||p("147",e);var o=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===o?t.ref:((t=function(e){var t=r.refs===f?r.refs={}:r.refs;null===e?delete t[o]:t[o]=e})._stringRef=o,t)}"string"!==typeof e&&p("148"),n._owner||p("254",e)}return e}function ml(e,t){"textarea"!==e.type&&p("31","[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,"")}function vl(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t,n){return(e=ko(e,t,n)).index=0,e.sibling=null,e}function l(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)v?(y=p,p=null):y=p.sibling;var h=d(o,p,a[v],u);if(null===h){null===p&&(p=y);break}e&&p&&null===h.alternate&&t(o,p),i=l(h,i,v),null===c?s=h:c.sibling=h,c=h,p=y}if(v===a.length)return n(o,p),s;if(null===p){for(;vy?(h=v,v=null):h=v.sibling;var C=d(o,v,w.value,u);if(null===C){v||(v=h);break}e&&v&&null===C.alternate&&t(o,v),i=l(C,i,y),null===c?s=C:c.sibling=C,c=C,v=h}if(w.done)return n(o,v),s;if(null===v){for(;!w.done;y++,w=a.next())null!==(w=f(o,w.value,u))&&(i=l(w,i,y),null===c?s=w:c.sibling=w,c=w);return s}for(v=r(o,v);!w.done;y++,w=a.next())null!==(w=m(v,o,y,w.value,u))&&(e&&null!==w.alternate&&v.delete(null===w.key?y:w.key),i=l(w,i,y),null===c?s=w:c.sibling=w,c=w);return e&&v.forEach(function(e){return t(o,e)}),s}return function(e,r,l,a){var u="object"===typeof l&&null!==l&&l.type===st&&null===l.key;u&&(l=l.props.children);var s="object"===typeof l&&null!==l;if(s)switch(l.$$typeof){case at:e:{for(s=l.key,u=r;null!==u;){if(u.key===s){if(10===u.tag?l.type===st:u.type===l.type){n(e,u.sibling),(r=o(u,l.type===st?l.props.children:l.props,a)).ref=dl(e,u,l),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}l.type===st?((r=No(l.props.children,e.mode,a,l.key)).return=e,e=r):((a=Eo(l,e.mode,a)).ref=dl(e,r,l),a.return=e,e=a)}return i(e);case ut:e:{for(u=l.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===l.containerInfo&&r.stateNode.implementation===l.implementation){n(e,r.sibling),(r=o(r,l.children||[],a)).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Po(l,e.mode,a)).return=e,e=r}return i(e)}if("string"===typeof l||"number"===typeof l)return l=""+l,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,l,a)).return=e,e=r):(n(e,r),(r=go(l,e.mode,a)).return=e,e=r),i(e);if(pl(l))return v(e,r,l,a);if(wt(l))return y(e,r,l,a);if(s&&ml(e,l),"undefined"===typeof l&&!u)switch(e.tag){case 2:case 1:p("152",(a=e.type).displayName||a.name||"Component")}return n(e,r)}}var yl=vl(!0),hl=vl(!1),wl=null,Cl=null,_l=!1;function xl(e,t){var n=new So(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Tl(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function Sl(e){if(_l){var t=Cl;if(t){var n=t;if(!Tl(e,t)){if(!(t=ro(n))||!Tl(e,t))return e.effectTag|=2,_l=!1,void(wl=e);xl(wl,n)}wl=e,Cl=oo(t)}else e.effectTag|=2,_l=!1,wl=e}}function kl(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;wl=e}function El(e){if(e!==wl)return!1;if(!_l)return kl(e),_l=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Jr(t,e.memoizedProps))for(t=Cl;t;)xl(e,t),t=ro(t);return kl(e),Cl=wl?ro(e.stateNode):null,!0}function Nl(){Cl=wl=null,_l=!1}function gl(e,t,n){Pl(e,t,n,t.expirationTime)}function Pl(e,t,n,r){t.child=null===e?hl(t,null,n,r):yl(t,e.child,n,r)}function Ol(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Ul(e,t,n,r,o){Ol(e,t);var l=0!==(64&t.effectTag);if(!n&&!l)return r&&To(t,!1),Fl(e,t);n=t.stateNode,lt.current=t;var i=l?null:n.render();return t.effectTag|=1,l&&(Pl(e,t,null,o),t.child=null),Pl(e,t,i,o),t.memoizedState=n.state,t.memoizedProps=n.props,r&&To(t,!0),t.child}function Rl(e){var t=e.stateNode;t.pendingContext?Co(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Co(0,t.context,!1),ol(e,t.containerInfo)}function Il(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var l=0|o.stateNode;if(o.type===t&&0!==(l&n)){for(l=o;null!==l;){var i=l.alternate;if(0===l.expirationTime||l.expirationTime>r)l.expirationTime=r,null!==i&&(0===i.expirationTime||i.expirationTime>r)&&(i.expirationTime=r);else{if(null===i||!(0===i.expirationTime||i.expirationTime>r))break;i.expirationTime=r}l=l.return}l=null}else l=o.child;break;case 13:l=o.type===e.type?null:o.child;break;default:l=o.child}if(null!==l)l.return=o;else for(l=o;null!==l;){if(l===e){l=null;break}if(null!==(o=l.sibling)){o.return=l.return,l=o;break}l=l.return}o=l}}function Fl(e,t){if(null!==e&&t.child!==e.child&&p("153"),null!==t.child){var n=ko(e=t.child,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=ko(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}function Ml(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:Rl(t);break;case 2:xo(t);break;case 4:ol(t,t.stateNode.containerInfo);break;case 13:Zo(t)}return null}switch(t.tag){case 0:null!==e&&p("155");var r=t.type,o=t.pendingProps,l=mo(t);return r=r(o,l=vo(t,l)),t.effectTag|=1,"object"===typeof r&&null!==r&&"function"===typeof r.render&&void 0===r.$$typeof?(l=t.type,t.tag=2,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,"function"===typeof(l=l.getDerivedStateFromProps)&&al(t,l,o),o=xo(t),r.updater=ul,t.stateNode=r,r._reactInternalFiber=t,fl(t,n),e=Ul(e,t,!0,o,n)):(t.tag=1,gl(e,t,r),t.memoizedProps=o,e=t.child),e;case 1:return o=t.type,n=t.pendingProps,fo.current||t.memoizedProps!==n?(o=o(n,r=vo(t,r=mo(t))),t.effectTag|=1,gl(e,t,o),t.memoizedProps=n,e=t.child):e=Fl(e,t),e;case 2:if(o=xo(t),null===e)if(null===t.stateNode){var i=t.pendingProps,a=t.type;r=mo(t);var u=2===t.tag&&null!=t.type.contextTypes;i=new a(i,l=u?vo(t,r):f),t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,i.updater=ul,t.stateNode=i,i._reactInternalFiber=t,u&&((u=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,u.__reactInternalMemoizedMaskedChildContext=l),fl(t,n),r=!0}else{a=t.type,r=t.stateNode,u=t.memoizedProps,l=t.pendingProps,r.props=u;var s=r.context;i=vo(t,i=mo(t));var c=a.getDerivedStateFromProps;(a="function"===typeof c||"function"===typeof r.getSnapshotBeforeUpdate)||"function"!==typeof r.UNSAFE_componentWillReceiveProps&&"function"!==typeof r.componentWillReceiveProps||(u!==l||s!==i)&&cl(t,r,l,i),Do=!1;var d=t.memoizedState;s=r.state=d;var m=t.updateQueue;null!==m&&(Vo(t,m,l,r,n),s=t.memoizedState),u!==l||d!==s||fo.current||Do?("function"===typeof c&&(al(t,c,l),s=t.memoizedState),(u=Do||sl(t,u,l,d,s,i))?(a||"function"!==typeof r.UNSAFE_componentWillMount&&"function"!==typeof r.componentWillMount||("function"===typeof r.componentWillMount&&r.componentWillMount(),"function"===typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount()),"function"===typeof r.componentDidMount&&(t.effectTag|=4)):("function"===typeof r.componentDidMount&&(t.effectTag|=4),t.memoizedProps=l,t.memoizedState=s),r.props=l,r.state=s,r.context=i,r=u):("function"===typeof r.componentDidMount&&(t.effectTag|=4),r=!1)}else a=t.type,r=t.stateNode,l=t.memoizedProps,u=t.pendingProps,r.props=l,s=r.context,i=vo(t,i=mo(t)),(a="function"===typeof(c=a.getDerivedStateFromProps)||"function"===typeof r.getSnapshotBeforeUpdate)||"function"!==typeof r.UNSAFE_componentWillReceiveProps&&"function"!==typeof r.componentWillReceiveProps||(l!==u||s!==i)&&cl(t,r,u,i),Do=!1,s=t.memoizedState,d=r.state=s,null!==(m=t.updateQueue)&&(Vo(t,m,u,r,n),d=t.memoizedState),l!==u||s!==d||fo.current||Do?("function"===typeof c&&(al(t,c,u),d=t.memoizedState),(c=Do||sl(t,l,u,s,d,i))?(a||"function"!==typeof r.UNSAFE_componentWillUpdate&&"function"!==typeof r.componentWillUpdate||("function"===typeof r.componentWillUpdate&&r.componentWillUpdate(u,d,i),"function"===typeof r.UNSAFE_componentWillUpdate&&r.UNSAFE_componentWillUpdate(u,d,i)),"function"===typeof r.componentDidUpdate&&(t.effectTag|=4),"function"===typeof r.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof r.componentDidUpdate||l===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=4),"function"!==typeof r.getSnapshotBeforeUpdate||l===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=256),t.memoizedProps=u,t.memoizedState=d),r.props=u,r.state=d,r.context=i,r=c):("function"!==typeof r.componentDidUpdate||l===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=4),"function"!==typeof r.getSnapshotBeforeUpdate||l===e.memoizedProps&&s===e.memoizedState||(t.effectTag|=256),r=!1);return Ul(e,t,r,o,n);case 3:return Rl(t),null!==(o=t.updateQueue)?(r=null!==(r=t.memoizedState)?r.element:null,Vo(t,o,t.pendingProps,null,n),(o=t.memoizedState.element)===r?(Nl(),e=Fl(e,t)):(r=t.stateNode,(r=(null===e||null===e.child)&&r.hydrate)&&(Cl=oo(t.stateNode.containerInfo),wl=t,r=_l=!0),r?(t.effectTag|=2,t.child=hl(t,null,o,n)):(Nl(),gl(e,t,o)),e=t.child)):(Nl(),e=Fl(e,t)),e;case 5:return rl(nl.current),(o=rl(el.current))!==(r=Or(o,t.type))&&(so(tl,t),so(el,r)),null===e&&Sl(t),o=t.type,u=t.memoizedProps,r=t.pendingProps,l=null!==e?e.memoizedProps:null,fo.current||u!==r||((u=1&t.mode&&!!r.hidden)&&(t.expirationTime=1073741823),u&&1073741823===n)?(u=r.children,Jr(o,r)?u=null:l&&Jr(o,l)&&(t.effectTag|=16),Ol(e,t),1073741823!==n&&1&t.mode&&r.hidden?(t.expirationTime=1073741823,t.memoizedProps=r,e=null):(gl(e,t,u),t.memoizedProps=r,e=t.child)):e=Fl(e,t),e;case 6:return null===e&&Sl(t),t.memoizedProps=t.pendingProps,null;case 16:return null;case 4:return ol(t,t.stateNode.containerInfo),o=t.pendingProps,fo.current||t.memoizedProps!==o?(null===e?t.child=yl(t,null,o,n):gl(e,t,o),t.memoizedProps=o,e=t.child):e=Fl(e,t),e;case 14:return o=t.type.render,n=t.pendingProps,r=t.ref,fo.current||t.memoizedProps!==n||r!==(null!==e?e.ref:null)?(gl(e,t,o=o(n,r)),t.memoizedProps=n,e=t.child):e=Fl(e,t),e;case 10:return n=t.pendingProps,fo.current||t.memoizedProps!==n?(gl(e,t,n),t.memoizedProps=n,e=t.child):e=Fl(e,t),e;case 11:return n=t.pendingProps.children,fo.current||null!==n&&t.memoizedProps!==n?(gl(e,t,n),t.memoizedProps=n,e=t.child):e=Fl(e,t),e;case 15:return n=t.pendingProps,t.memoizedProps===n?e=Fl(e,t):(gl(e,t,n.children),t.memoizedProps=n,e=t.child),e;case 13:return function(e,t,n){var r=t.type._context,o=t.pendingProps,l=t.memoizedProps,i=!0;if(fo.current)i=!1;else if(l===o)return t.stateNode=0,Zo(t),Fl(e,t);var a=o.value;if(t.memoizedProps=o,null===l)a=1073741823;else if(l.value===o.value){if(l.children===o.children&&i)return t.stateNode=0,Zo(t),Fl(e,t);a=0}else{var u=l.value;if(u===a&&(0!==u||1/u===1/a)||u!==u&&a!==a){if(l.children===o.children&&i)return t.stateNode=0,Zo(t),Fl(e,t);a=0}else if(a="function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,a):1073741823,0===(a|=0)){if(l.children===o.children&&i)return t.stateNode=0,Zo(t),Fl(e,t)}else Il(t,r,a,n)}return t.stateNode=a,Zo(t),gl(e,t,o.children),t.child}(e,t,n);case 12:e:if(r=t.type,l=t.pendingProps,u=t.memoizedProps,o=r._currentValue,i=r._changedBits,fo.current||0!==i||u!==l){if(t.memoizedProps=l,void 0!==(a=l.unstable_observedBits)&&null!==a||(a=1073741823),t.stateNode=a,0!==(i&a))Il(t,r,i,n);else if(u===l){e=Fl(e,t);break e}n=(n=l.children)(o),t.effectTag|=1,gl(e,t,n),e=t.child}else e=Fl(e,t);return e;default:p("156")}}function Dl(e){e.effectTag|=4}var zl=void 0,Ll=void 0,Al=void 0;function jl(e,t){var n=t.pendingProps;switch(t.tag){case 1:return null;case 2:return ho(t),null;case 3:ll(),wo();var r=t.stateNode;return r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(El(t),t.effectTag&=-3),zl(t),null;case 5:il(t),r=rl(nl.current);var o=t.type;if(null!==e&&null!=t.stateNode){var l=e.memoizedProps,i=t.stateNode,a=rl(el.current);i=br(i,o,l,n,r),Ll(e,t,i,o,l,n,r,a),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!n)return null===t.stateNode&&p("166"),null;if(e=rl(el.current),El(t))n=t.stateNode,o=t.type,l=t.memoizedProps,n[H]=t,n[W]=l,r=Gr(n,o,l,e,r),t.updateQueue=r,null!==r&&Dl(t);else{(e=Wr(o,n,r,e))[H]=t,e[W]=n;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}Vr(e,o,n,r),qr(o,n)&&Dl(t),t.stateNode=e}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Al(e,t,e.memoizedProps,n);else{if("string"!==typeof n)return null===t.stateNode&&p("166"),null;r=rl(nl.current),rl(el.current),El(t)?(r=t.stateNode,n=t.memoizedProps,r[H]=t,Kr(r,n)&&Dl(t)):((r=$r(n,r))[H]=t,t.stateNode=r)}return null;case 14:case 16:case 10:case 11:case 15:return null;case 4:return ll(),zl(t),null;case 13:return qo(t),null;case 12:return null;case 0:p("167");default:p("156")}}function Bl(e,t){var n=t.source;null===t.stack&&null!==n&&_t(n),null!==n&&Ct(n),t=t.value,null!==e&&2===e.tag&&Ct(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(r){r&&r.suppressReactErrorLogging||console.error(r)}}function Hl(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){yi(e,n)}else t.current=null}function Wl(e){switch(Mo(e),e.tag){case 2:Hl(e);var t=e.stateNode;if("function"===typeof t.componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){yi(e,n)}break;case 5:Hl(e);break;case 4:bl(e)}}function $l(e){return 5===e.tag||3===e.tag||4===e.tag}function Vl(e){e:{for(var t=e.return;null!==t;){if($l(t)){var n=t;break e}t=t.return}p("160"),n=void 0}var r=t=void 0;switch(n.tag){case 5:t=n.stateNode,r=!1;break;case 3:case 4:t=n.stateNode.containerInfo,r=!0;break;default:p("161")}16&n.effectTag&&(Fr(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||$l(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var o=e;;){if(5===o.tag||6===o.tag)if(n)if(r){var l=t,i=o.stateNode,a=n;8===l.nodeType?l.parentNode.insertBefore(i,a):l.insertBefore(i,a)}else t.insertBefore(o.stateNode,n);else r?(l=t,i=o.stateNode,8===l.nodeType?l.parentNode.insertBefore(i,l):l.appendChild(i)):t.appendChild(o.stateNode);else if(4!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}}function bl(e){for(var t=e,n=!1,r=void 0,o=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&p("160"),n.tag){case 5:r=n.stateNode,o=!1;break e;case 3:case 4:r=n.stateNode.containerInfo,o=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag){e:for(var l=t,i=l;;)if(Wl(i),null!==i.child&&4!==i.tag)i.child.return=i,i=i.child;else{if(i===l)break;for(;null===i.sibling;){if(null===i.return||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}o?(l=r,i=t.stateNode,8===l.nodeType?l.parentNode.removeChild(i):l.removeChild(i)):r.removeChild(t.stateNode)}else if(4===t.tag?r=t.stateNode.containerInfo:Wl(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}function Ql(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var o=t.type,l=t.updateQueue;t.updateQueue=null,null!==l&&(n[W]=r,Qr(n,l,o,e,r))}break;case 6:null===t.stateNode&&p("162"),t.stateNode.nodeValue=t.memoizedProps;break;case 3:case 15:case 16:break;default:p("163")}}function Gl(e,t,n){(n=Ao(n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ji(r),Bl(e,t)},n}function Kl(e,t,n){(n=Ao(n)).tag=3;var r=e.stateNode;return null!==r&&"function"===typeof r.componentDidCatch&&(n.callback=function(){null===fi?fi=new Set([this]):fi.add(this);var n=t.value,r=t.stack;Bl(e,t),this.componentDidCatch(n,{componentStack:null!==r?r:""})}),n}function Xl(e,t,n,r,o,l){n.effectTag|=512,n.firstEffect=n.lastEffect=null,r=Go(r,n),e=t;do{switch(e.tag){case 3:return e.effectTag|=1024,void Ho(e,r=Gl(e,r,l),l);case 2:if(t=r,n=e.stateNode,0===(64&e.effectTag)&&null!==n&&"function"===typeof n.componentDidCatch&&(null===fi||!fi.has(n)))return e.effectTag|=1024,void Ho(e,r=Kl(e,t,l),l)}e=e.return}while(null!==e)}function Yl(e){switch(e.tag){case 2:ho(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return ll(),wo(),1024&(t=e.effectTag)?(e.effectTag=-1025&t|64,e):null;case 5:return il(e),null;case 16:return 1024&(t=e.effectTag)?(e.effectTag=-1025&t|64,e):null;case 4:return ll(),null;case 13:return qo(e),null;default:return null}}zl=function(){},Ll=function(e,t,n){(t.updateQueue=n)&&Dl(t)},Al=function(e,t,n,r){n!==r&&Dl(t)};var Zl=eo(),ql=2,Jl=Zl,ei=0,ti=0,ni=!1,ri=null,oi=null,li=0,ii=-1,ai=!1,ui=null,si=!1,ci=!1,fi=null;function pi(){if(null!==ri)for(var e=ri.return;null!==e;){var t=e;switch(t.tag){case 2:ho(t);break;case 3:ll(),wo();break;case 5:il(t);break;case 4:ll();break;case 13:qo(t)}e=e.return}oi=null,li=0,ii=-1,ai=!1,ri=null,ci=!1}function di(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0===(512&e.effectTag)){t=jl(t,e);var o=e;if(1073741823===li||1073741823!==o.expirationTime){var l=0;switch(o.tag){case 3:case 2:var i=o.updateQueue;null!==i&&(l=i.expirationTime)}for(i=o.child;null!==i;)0!==i.expirationTime&&(0===l||l>i.expirationTime)&&(l=i.expirationTime),i=i.sibling;o.expirationTime=l}if(null!==t)return t;if(null!==n&&0===(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1Ui)&&(Ui=e),e}function Ci(e,t){for(;null!==e;){if((0===e.expirationTime||e.expirationTime>t)&&(e.expirationTime=t),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>t)&&(e.alternate.expirationTime=t),null===e.return){if(3!==e.tag)break;var n=e.stateNode;!ni&&0!==li&&tji&&p("185")}e=e.return}}function _i(){return Jl=eo()-Zl,ql=2+(Jl/10|0)}function xi(e){var t=ti;ti=2+25*(1+((_i()-2+500)/25|0));try{return e()}finally{ti=t}}function Ti(e,t,n,r,o){var l=ti;ti=1;try{return e(t,n,r,o)}finally{ti=l}}var Si=null,ki=null,Ei=0,Ni=void 0,gi=!1,Pi=null,Oi=0,Ui=0,Ri=!1,Ii=!1,Fi=null,Mi=null,Di=!1,zi=!1,Li=!1,Ai=null,ji=1e3,Bi=0,Hi=1;function Wi(e){if(0!==Ei){if(e>Ei)return;null!==Ni&&no(Ni)}var t=eo()-Zl;Ei=e,Ni=to(bi,{timeout:10*(e-2)-t})}function $i(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===ki?(Si=ki=e,e.nextScheduledRoot=e):(ki=ki.nextScheduledRoot=e).nextScheduledRoot=Si;else{var n=e.remainingExpirationTime;(0===n||t=Oi)&&(!Ri||_i()>=Oi);)_i(),Yi(Pi,Oi,!Ri),Vi();else for(;null!==Pi&&0!==Oi&&(0===e||e>=Oi);)Yi(Pi,Oi,!1),Vi();null!==Mi&&(Ei=0,Ni=null),0!==Oi&&Wi(Oi),Mi=null,Ri=!1,Xi()}function Ki(e,t){gi&&p("253"),Pi=e,Oi=t,Yi(e,t,!1),Qi(),Xi()}function Xi(){if(Bi=0,null!==Ai){var e=Ai;Ai=null;for(var t=0;tx&&(T=x,x=P,P=T),T=Wn(N,P),S=Wn(N,x),T&&S&&(1!==g.rangeCount||g.anchorNode!==T.node||g.anchorOffset!==T.offset||g.focusNode!==S.node||g.focusOffset!==S.offset)&&((k=document.createRange()).setStart(T.node,T.offset),g.removeAllRanges(),P>x?(g.addRange(k),g.extend(S.node,S.offset)):(k.setEnd(S.node,S.offset),g.addRange(k))))),g=[];for(P=N;P=P.parentNode;)1===P.nodeType&&g.push({element:P,left:P.scrollLeft,top:P.scrollTop});for("function"===typeof N.focus&&N.focus(),N=0;NHi)&&(Ri=!0)}function Ji(e){null===Pi&&p("246"),Pi.remainingExpirationTime=0,Ii||(Ii=!0,Fi=e)}function ea(e,t){var n=Di;Di=!0;try{return e(t)}finally{(Di=n)||gi||Qi()}}function ta(e,t){if(Di&&!zi){zi=!0;try{return e(t)}finally{zi=!1}}return e(t)}function na(e,t){gi&&p("187");var n=Di;Di=!0;try{return Ti(e,t)}finally{Di=n,Qi()}}function ra(e,t,n){if(Li)return e(t,n);Di||gi||0===Ui||(Gi(Ui,!1,null),Ui=0);var r=Li,o=Di;Di=Li=!0;try{return e(t,n)}finally{Li=r,(Di=o)||gi||Qi()}}function oa(e){var t=Di;Di=!0;try{Ti(e)}finally{(Di=t)||gi||Gi(1,!1,null)}}function la(e,t,n,r,o){var l=t.current;if(n){var i;e:{for(2===an(n=n._reactInternalFiber)&&2===n.tag||p("170"),i=n;3!==i.tag;){if(yo(i)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}(i=i.return)||p("171")}i=i.stateNode.context}n=yo(n)?_o(n,i):i}else n=f;return null===t.context?t.context=n:t.pendingContext=n,t=o,(o=Ao(r)).payload={element:e},null!==(t=void 0===t?null:t)&&(o.callback=t),Bo(l,o,r),Ci(l,r),r}function ia(e){var t=e._reactInternalFiber;return void 0===t&&("function"===typeof e.render?p("188"):p("268",Object.keys(e))),null===(e=cn(t))?null:e.stateNode}function aa(e,t,n,r){var o=t.current;return la(e,t,n,o=wi(_i(),o),r)}function ua(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function sa(e){var t=e.findFiberByHostInstance;return function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Uo=Io(function(e){return t.onCommitFiberRoot(n,e)}),Ro=Io(function(e){return t.onCommitFiberUnmount(n,e)})}catch(r){}return!0}(i({},e,{findHostInstanceByFiber:function(e){return null===(e=cn(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null}}))}var ca=ea,fa=ra,pa=function(){gi||0===Ui||(Gi(Ui,!1,null),Ui=0)};function da(e){this._expirationTime=hi(),this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function ma(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function va(e,t,n){this._internalRoot=Oo(e,t,n)}function ya(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ha(e,t,n,r,o){ya(n)||p("200");var l=n._reactRootContainer;if(l){if("function"===typeof o){var i=o;o=function(){var e=ua(l._internalRoot);i.call(e)}}null!=e?l.legacy_renderSubtreeIntoContainer(e,t,o):l.render(t,o)}else{if(l=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new va(e,!1,t)}(n,r),"function"===typeof o){var a=o;o=function(){var e=ua(l._internalRoot);a.call(e)}}ta(function(){null!=e?l.legacy_renderSubtreeIntoContainer(e,t,o):l.render(t,o)})}return ua(l._internalRoot)}function wa(e,t){var n=21&&n.getSize(i,r),"horizontal"===n.props.position?t=r-o.offsetTop:"vertical"===n.props.position&&(t=i-o.offsetLeft),n.setState({isDragging:!0,handleBarOffsetFromParent:t}),document.addEventListener("mousemove",n.handleMouseMove),document.addEventListener("touchmove",n.handleMouseMove)}},n.handleMouseMove=function(e){if(n.state.isDragging){l.unselectAll();var t,i,r=n.state,a=r.handleBarOffsetFromParent,o=r.maxMousePosition,s=n.props,c=s.position,p=s.primaryPaneMinWidth,u=s.primaryPaneMinHeight,h=s.postPoned;"mousemove"===e.type?(t=e.clientX,i=e.clientY):"touchmove"===e.type&&(t=e.touches[0].clientX,i=e.touches[0].clientY);var d=l.getPrimaryPaneWidth(c,t,i,o,a,u,p);h?n.setState({handleBarClonePosition:d,lastX:t,lastY:i,isVisible:!0}):n.setState({primaryPane:d,lastX:t,lastY:i})}},n.handleMouseUp=function(e){if(n.state.isDragging){var t=n.state,i=t.handleBarOffsetFromParent,r=t.lastX,o=t.lastY,s=t.maxMousePosition,c=n.props,p=c.position,u=c.primaryPaneMinWidth,h=c.primaryPaneMinHeight,d=c.postPoned,m=l.getPrimaryPaneWidth(p,r,o,s,i,h,u);d?n.setState({isDragging:!1,isVisible:!1,primaryPane:m}):n.setState({isDragging:!1,primaryPane:m}),document.removeEventListener("mousemove",n.handleMouseMove),document.removeEventListener("touchmove",n.handleMouseMove),"boolean"===typeof n.props.dispatchResize&&window.dispatchEvent(new Event("resize")),"function"===typeof n.props.onDragFinished&&n.props.onDragFinished(),a.Children.count(n.props.children)>1&&n.getSize(r,o)}},n.getSize=function(e,t){var i,r,a,o=n.paneWrapper.getBoundingClientRect(),s=n.panePrimary.getDivInstance().getBoundingClientRect(),l=n.handlebar.getDivInstance().getBoundingClientRect(),c="vertical"===n.props.position?l.left-e:l.top-t,p=new RegExp(/\D+/gi);if("vertical"===n.props.position){var u=n.props.primaryPaneMaxWidth.match(p)[0].toLowerCase(),h=parseFloat(n.props.primaryPaneMaxWidth.split(p)[0]);r=o.width,a=s.left,"%"===u?i=Math.floor(r*(h/100)+a-(l.width+c)):"px"===u&&(i=Math.floor(h+a-l.width))}else{var d=n.props.primaryPaneMaxHeight.match(p)[0].toLowerCase(),m=parseFloat(n.props.primaryPaneMaxHeight.split(p)[0]);r=o.height,a=s.top,"%"===d?i=Math.floor(r*(m/100)+a-(l.height+c)):"px"===d&&(i=Math.floor(m+a-l.height))}n.setState({maxMousePosition:i})},n.state={isDragging:!1},n}return r(t,e),t.prototype.componentDidMount=function(){document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleMouseUp),a.Children.count(this.props.children)>1&&window.addEventListener("resize",this.getSize)},t.prototype.render=function(){var e,t,n,i=this,r=this.props,l=r.children,c=r.position,p=r.primaryPaneMinWidth,u=r.primaryPaneWidth,h=r.primaryPaneMaxWidth,d=r.primaryPaneMinHeight,m=r.primaryPaneHeight,f=r.primaryPaneMaxHeight,v=r.className,y=r.primaryPaneClassName,P=r.secondaryPaneClassName,g=r.maximizedPrimaryPane,_=r.minimalizedPrimaryPane,M=r.postPoned,w=r.allowResize,b=this.state,E=b.handleBarClonePosition,D=b.primaryPane,x=b.isVisible;switch(c){case"vertical":t=g?{width:"100%",minWidth:p,maxWidth:"100%"}:_?{width:"0px",minWidth:0,maxWidth:h}:{width:D?D+"px":u,minWidth:p,maxWidth:h};break;case"horizontal":t=g?{height:"100%",minHeight:0,maxHeight:"100%"}:_?{height:"0px",minHeight:0,maxHeight:f}:{height:D?D+"px":m,minHeight:d,maxHeight:f};break;default:return null}if(!l[1])var C={width:"100%",maxWidth:"100%",height:"100%"};a.Children.count(l)>1&&M&&((e={})["vertical"===c?"left":"top"]=E+"px",n=e);var z=["handle-bar handle-bar_clone","vertical"===c?"vertical":"horizontal"].join(" ");return a.createElement("div",{className:"splitter "+("vertical"===c?"vertical":"horizontal")+" "+(v||""),style:"undefined"!==C?C:null,ref:function(e){return i.paneWrapper=e}},a.createElement(o.default,{className:"primary "+(y||""),position:c,style:t,ref:function(e){return i.panePrimary=e}},l[1]?l[0]:l),l[1]?a.createElement(s.default,{position:c,handleMouseDown:this.handleMouseDown,ref:function(e){return i.handlebar=e},allowResize:w}):null,M&&x?a.createElement("div",{style:n,className:z}):null,l[1]?a.createElement(o.default,{className:P||"",position:c,hasDetailPane:this.props.hasDetailPane,ref:function(e){return i.paneNotPrimary=e}},l[1]):null)},t.defaultProps={position:"vertical",postPoned:!1,dispatchResize:!1,primaryPaneMaxWidth:"80%",primaryPaneMinWidth:300,primaryPaneWidth:"50%",primaryPaneMaxHeight:"80%",primaryPaneMinHeight:300,primaryPaneHeight:"50%"},t}(a.Component);t.Splitter=c},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getDivInstance=function(){return t.div},t}return r(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.hasDetailPane,i=t.id,r=t.style,o=["pane",n&&"bottom-detail-pane",t.position,t.className].filter(function(e){return e}).join(" ");return a.createElement("div",{id:i,ref:function(t){return e.div=t},className:o,style:r},this.props.children)},t}(a.Component);t.default=o},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.getDivInstance=function(){return t.div},t}return r(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.position,i=t.handleMouseDown,r=["handle-bar",n,!t.allowResize&&"resize-not-allowed"].filter(function(e){return e}).join(" ");return a.createElement("div",{className:r,ref:function(t){return e.div=t},onMouseDown:function(e){return i(e)},onTouchStart:function(e){return i(e)}},a.createElement("span",{className:"handle-bar_drag"}))},t.defaultProps={allowResize:!0},t}(a.Component);t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unselectAll=function(){try{window.getSelection().removeAllRanges()}catch(e){console.warn(e)}},t.getPrimaryPaneWidth=function(e,t,n,i,r,a,o){var s;switch(e){case"horizontal":s=n>i?i-r:n-r<=a?a+.001:n-r;break;case"vertical":default:s=t>=i?i-r:t-r<=o?o+.001:t-r}return s}},function(e,t,n){},,function(e,t,n){}],[[5,2,1]]]);
2 | //# sourceMappingURL=main.20a12729.chunk.js.map
--------------------------------------------------------------------------------
/docs/static/js/main.20a12729.chunk.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"sources":["index.tsx","App.tsx","components/Splitters/index.tsx","components/Splitters/Splitter.tsx","components/Splitters/Pane.tsx","components/Splitters/HandleBar.tsx","components/Splitters/Helpers.ts"],"names":["React","__webpack_require__","ReactDOM","App_1","render","createElement","default","document","getElementById","Splitters_1","App","_super","_this","apply","this","arguments","state","maxPrimaryPane","split","setState","onDragFinishedCallback","console","log","paneWrapper","panePrimary","div","clientWidth","paneNotPrimary","clientHeight","__extends","prototype","className","position","maximizedPrimaryPane","minimalizedPrimaryPane","onDragFinished","ref","node","primaryPaneMaxWidth","primaryPaneMinWidth","primaryPaneWidth","dispatchResize","postPoned","allowResize","Component","exports","Splitter_1","Splitter","Pane_1","HandleBar_1","Helpers_1","props","call","handleMouseDown","e","button","handleBarOffsetFromParent","clientX","clientY","target","currentTarget","type","touches","Children","count","children","getSize","offsetTop","offsetLeft","isDragging","addEventListener","handleMouseMove","unselectAll","_a","maxMousePosition","_b","primaryPaneMinHeight","primaryPanePosition","getPrimaryPaneWidth","handleBarClonePosition","lastX","lastY","isVisible","primaryPane","handleMouseUp","removeEventListener","window","dispatchEvent","Event","cX","cY","nodeWrapperSize","primaryPaneOffset","wrapper","getBoundingClientRect","getDivInstance","handleBarSize","handlebar","posInHandleBar","left","top","regEx","RegExp","maxWidthStr","match","toLowerCase","maxWidthNum","parseFloat","width","Math","floor","maxHeightStr","primaryPaneMaxHeight","maxHeightNum","height","componentDidMount","paneStyle","handlebarClone","primaryPaneHeight","primaryPaneClassName","secondaryPaneClassName","_c","minWidth","maxWidth","minHeight","maxHeight","onePaneStyle","handleBarCloneClassName","join","style","hasDetailPane","defaultProps","Pane","id","classNames","filter","cls","HandleBar","onMouseDown","onTouchStart","getSelection","removeAllRanges","warn"],"mappings":"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","file":"static/js/main.20a12729.chunk.js","sourcesContent":["import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport App from './App';\nimport './App.css';\n\nReactDOM.render(\n ,\n document.getElementById('root') as HTMLElement\n);","import * as React from 'react';\n\nimport Splitter from './components/Splitters';\n\ninterface AppState {\n maxPrimaryPane?: Boolean;\n}\n\nclass App extends React.Component<{}, AppState> {\n state = {\n maxPrimaryPane: false\n };\n\n split: Splitter | null = null;\n\n maxPrimaryPane = () => {\n this.setState({\n maxPrimaryPane: !this.state.maxPrimaryPane\n });\n }\n\n onDragFinishedCallback = () => {\n console.log('callback');\n console.log(this.split && this.split.paneWrapper); // actual div\n console.log(this.split && this.split.panePrimary.div.clientWidth);\n console.log(this.split && this.split.paneNotPrimary.div.clientHeight);\n }\n\n render() {\n return (\n \n
\n
this.split = node}\n >\n \n \n
1 \n
postponed
\n
primary
\n
\n \n \n
2 \n
normal resize
\n
primary
\n
\n 3
\n \n \n \n \n
\n
\n );\n }\n}\n\nexport default App;\n","import { Splitter } from './Splitter';\nexport default Splitter;","import * as React from 'react';\n\n/********************************\n* import files needed for splitter to work\n********************************/\nimport Pane from './Pane';\nimport HandleBar from './HandleBar';\nimport { unselectAll, getPrimaryPaneWidth } from './Helpers';\nimport { SplitterProps, SplitterState } from './typings/index';\nimport './splitters.css';\n\nexport class Splitter extends React.Component {\n public static defaultProps: Partial = {\n position: 'vertical',\n postPoned: false,\n dispatchResize: false,\n primaryPaneMaxWidth: '80%',\n primaryPaneMinWidth: 300,\n primaryPaneWidth: '50%',\n primaryPaneMaxHeight: '80%',\n primaryPaneMinHeight: 300,\n primaryPaneHeight: '50%'\n };\n\n panePrimary: Pane;\n paneNotPrimary: Pane;\n handlebar: HandleBar;\n paneWrapper: HTMLDivElement;\n\n constructor(props: SplitterProps) {\n super(props);\n\n this.state = {\n isDragging: false\n };\n }\n\n componentDidMount() {\n /********************************\n * Sets event listeners after component is mounted.\n * If there is only one pane, the resize event listener won't be added\n ********************************/\n document.addEventListener('mouseup', this.handleMouseUp);\n document.addEventListener('touchend', this.handleMouseUp);\n\n if (React.Children.count(this.props.children) > 1) {\n window.addEventListener('resize', this.getSize);\n }\n }\n\n handleMouseDown = (e: any) => {\n /********************************\n * If the right button was clicked - stop the function\n * If there is more then one pane, we get the sizes of panes + max pos of mouse in splitter\n * add event listener for touch move and mouse move\n ********************************/\n if (e.button === 2 || this.props.allowResize === false) {\n return;\n }\n\n const target = e.currentTarget;\n let handleBarOffsetFromParent;\n let clientX;\n let clientY;\n\n if (e.type === 'mousedown') {\n clientX = e.clientX;\n clientY = e.clientY;\n } else if (e.type === 'touchstart') {\n clientX = e.touches[0].clientX;\n clientY = e.touches[0].clientY;\n }\n\n if (React.Children.count(this.props.children) > 1) {\n this.getSize(clientX, clientY);\n }\n\n if (this.props.position === 'horizontal') {\n handleBarOffsetFromParent = clientY - target.offsetTop;\n } else if (this.props.position === 'vertical') {\n handleBarOffsetFromParent = clientX - target.offsetLeft;\n }\n\n this.setState({\n isDragging: true,\n handleBarOffsetFromParent\n });\n\n document.addEventListener('mousemove', this.handleMouseMove);\n document.addEventListener('touchmove', this.handleMouseMove);\n }\n\n handleMouseMove = (e: any) => {\n /********************************\n * check if the state is still isDragging, if not, stop the function\n * unselectAll - unselect all selected text\n * check position of mouse in the splitter and and set the width or height of primary pane\n * save last positions of X and Y coords (that is necessary for touch screen)\n ********************************/\n if (!this.state.isDragging) {\n return;\n }\n \n unselectAll();\n\n const {\n handleBarOffsetFromParent,\n maxMousePosition\n } = this.state;\n\n const {\n position,\n primaryPaneMinWidth,\n primaryPaneMinHeight,\n postPoned\n } = this.props;\n\n let clientX;\n let clientY;\n\n if (e.type === 'mousemove') {\n clientX = e.clientX;\n clientY = e.clientY;\n } else if (e.type === 'touchmove') {\n clientX = e.touches[0].clientX;\n clientY = e.touches[0].clientY;\n }\n\n const primaryPanePosition =\n getPrimaryPaneWidth(\n position,\n clientX,\n clientY,\n maxMousePosition,\n handleBarOffsetFromParent,\n primaryPaneMinHeight,\n primaryPaneMinWidth\n );\n\n if (postPoned) {\n this.setState({\n handleBarClonePosition: primaryPanePosition,\n lastX: clientX,\n lastY: clientY,\n isVisible: true\n });\n } else {\n this.setState({\n primaryPane: primaryPanePosition,\n lastX: clientX,\n lastY: clientY\n });\n }\n }\n\n handleMouseUp = (e: any) => {\n /********************************\n * Dispatch event is for components which resizes on window resize\n ********************************/\n if (!this.state.isDragging) {\n return;\n }\n\n const {\n handleBarOffsetFromParent,\n lastX, lastY, maxMousePosition\n } = this.state;\n\n const {\n position,\n primaryPaneMinWidth,\n primaryPaneMinHeight,\n postPoned\n } = this.props;\n\n const primaryPanePosition =\n getPrimaryPaneWidth(\n position,\n lastX,\n lastY,\n maxMousePosition,\n handleBarOffsetFromParent,\n primaryPaneMinHeight,\n primaryPaneMinWidth\n );\n\n if (postPoned) {\n this.setState({\n isDragging: false,\n isVisible: false,\n primaryPane: primaryPanePosition\n });\n } else {\n this.setState({\n isDragging: false,\n primaryPane: primaryPanePosition\n });\n }\n\n document.removeEventListener('mousemove', this.handleMouseMove);\n document.removeEventListener('touchmove', this.handleMouseMove);\n\n // call resize event to trigger method for updating of DataGrid width\n // TODO: add this event for IE11\n if (typeof this.props.dispatchResize === 'boolean') {\n window.dispatchEvent(new Event('resize'));\n }\n\n // callback function from parent component\n if (typeof this.props.onDragFinished === 'function') {\n this.props.onDragFinished();\n }\n\n if (React.Children.count(this.props.children) > 1) {\n this.getSize(lastX, lastY);\n }\n }\n\n render() {\n /********************************\n * set width of primary pane according to props, or state\n ********************************/\n const {\n children, position,\n primaryPaneMinWidth, primaryPaneWidth, primaryPaneMaxWidth,\n primaryPaneMinHeight, primaryPaneHeight, primaryPaneMaxHeight,\n className, primaryPaneClassName, secondaryPaneClassName,\n maximizedPrimaryPane, minimalizedPrimaryPane, postPoned, allowResize\n } = this.props;\n\n const {\n handleBarClonePosition,\n primaryPane,\n isVisible\n } = this.state;\n\n let paneStyle;\n switch (position) {\n case 'vertical': {\n if (maximizedPrimaryPane) {\n paneStyle = {\n width: '100%',\n minWidth: primaryPaneMinWidth,\n maxWidth: '100%'\n };\n } else if (minimalizedPrimaryPane) {\n paneStyle = {\n width: '0px',\n minWidth: 0,\n maxWidth: primaryPaneMaxWidth\n };\n } else {\n paneStyle = {\n width: primaryPane ? `${primaryPane}px` : primaryPaneWidth,\n minWidth: primaryPaneMinWidth,\n maxWidth: primaryPaneMaxWidth\n };\n }\n break;\n }\n case 'horizontal': {\n if (maximizedPrimaryPane) {\n paneStyle = {\n height: '100%',\n minHeight: 0,\n maxHeight: '100%'\n };\n } else if (minimalizedPrimaryPane) {\n paneStyle = {\n height: '0px',\n minHeight: 0,\n maxHeight: primaryPaneMaxHeight\n };\n } else {\n paneStyle = {\n height: primaryPane ? `${primaryPane}px` : primaryPaneHeight,\n minHeight: primaryPaneMinHeight,\n maxHeight: primaryPaneMaxHeight\n };\n }\n break;\n }\n default:\n return null;\n }\n\n if (!children[1]) {\n var onePaneStyle: any = {\n width: '100%',\n maxWidth: '100%',\n height: '100%'\n };\n }\n\n let handlebarClone;\n if (React.Children.count(children) > 1 && postPoned) {\n handlebarClone = {\n [position === 'vertical' ? 'left' : 'top']: handleBarClonePosition + 'px'\n };\n }\n\n const handleBarCloneClassName = [\n 'handle-bar handle-bar_clone',\n position === 'vertical' ? 'vertical' : 'horizontal',\n ].join(' ');\n\n return (\n this.paneWrapper = node}\n >\n
this.panePrimary = node}\n >\n {!children[1] ? children : children[0]}\n \n\n {\n children[1]\n ?
this.handlebar = node}\n allowResize={allowResize}\n />\n : null\n }\n\n {\n postPoned && isVisible\n ?
\n : null\n }\n\n {\n children[1]\n ? this.paneNotPrimary = node}\n >\n {children[1]}\n \n : null\n }\n \n );\n }\n\n getSize = (cX?: Number | any, cY?: Number | any) => {\n /********************************\n * This function calculates the max position of a mouse in the current splitter from given percentage.\n /********************************/\n let maxMousePosition;\n let nodeWrapperSize;\n let primaryPaneOffset;\n let wrapper = this.paneWrapper.getBoundingClientRect();\n let primaryPane = this.panePrimary.getDivInstance().getBoundingClientRect();\n let handleBarSize = this.handlebar.getDivInstance().getBoundingClientRect();\n\n const posInHandleBar = this.props.position === 'vertical' \n ? handleBarSize.left - cX\n : handleBarSize.top - cY;\n\n // find only letters from string\n const regEx = new RegExp(/\\D+/gi);\n \n if (this.props.position === 'vertical') {\n // split the maxWidth/maxHeight string to string and numbers\n let maxWidthStr = this.props.primaryPaneMaxWidth.match(regEx)[0].toLowerCase();\n let maxWidthNum = parseFloat(this.props.primaryPaneMaxWidth.split(regEx)[0]);\n nodeWrapperSize = wrapper.width;\n primaryPaneOffset = primaryPane.left;\n\n if (maxWidthStr === '%') {\n maxMousePosition =\n Math.floor(\n (nodeWrapperSize * (maxWidthNum / 100)) +\n primaryPaneOffset - (handleBarSize.width + posInHandleBar)\n );\n } else if (maxWidthStr === 'px') {\n maxMousePosition =\n Math.floor((maxWidthNum + primaryPaneOffset) - handleBarSize.width);\n }\n } else {\n let maxHeightStr = this.props.primaryPaneMaxHeight.match(regEx)[0].toLowerCase();\n let maxHeightNum = parseFloat(this.props.primaryPaneMaxHeight.split(regEx)[0]);\n nodeWrapperSize = wrapper.height;\n primaryPaneOffset = primaryPane.top;\n\n if (maxHeightStr === '%') {\n maxMousePosition =\n Math.floor(\n (nodeWrapperSize * (maxHeightNum / 100)) +\n primaryPaneOffset - (handleBarSize.height + posInHandleBar)\n );\n } else if (maxHeightStr === 'px') {\n maxMousePosition =\n Math.floor((maxHeightNum + primaryPaneOffset) - handleBarSize.height);\n }\n }\n\n this.setState({\n maxMousePosition\n });\n }\n}","import * as React from 'react';\nimport { PaneProps } from './typings/index';\n\nclass Pane extends React.Component {\n div: HTMLDivElement;\n\n render() {\n const { hasDetailPane, id, style, position, className } = this.props;\n\n const classNames = [\n 'pane',\n hasDetailPane && 'bottom-detail-pane',\n position,\n className\n ].filter((cls) => cls).join(' ');\n\n return (\n this.div = node}\n className={classNames}\n style={style}\n >\n {this.props.children}\n
\n );\n }\n\n getDivInstance = () => {\n return this.div;\n }\n}\n\nexport default Pane;","import * as React from 'react';\nimport { HandleBarProps } from './typings/index';\n\nclass HandleBar extends React.Component {\n static defaultProps: Partial = {\n allowResize: true\n };\n\n div: HTMLDivElement;\n\n render() {\n const { position, handleMouseDown, allowResize } = this.props;\n\n const classNames = [\n 'handle-bar',\n position,\n !allowResize && 'resize-not-allowed',\n ].filter((cls) => cls).join(' ');\n\n return (\n this.div = node}\n onMouseDown={(e) => handleMouseDown(e)} \n onTouchStart={(e) => handleMouseDown(e)}\n >\n \n
\n );\n }\n\n getDivInstance = () => {\n return this.div;\n }\n}\n\nexport default HandleBar;","export function unselectAll() {\n try {\n window.getSelection().removeAllRanges();\n } catch (e) {\n console.warn(e);\n }\n}\n\nexport function getPrimaryPaneWidth\n (\n position: string, lastX: number, lastY: number,\n maxMousePosition: number, handleBarOffsetFromParent: number,\n primaryPaneMinHeight: number, primaryPaneMinWidth: number\n ): number {\n\n let primaryPanePosition;\n\n switch (position) {\n case 'horizontal': {\n if (lastY > maxMousePosition) {\n primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;\n } else if ((lastY - handleBarOffsetFromParent) <= primaryPaneMinHeight) {\n primaryPanePosition = primaryPaneMinHeight + 0.001;\n } else {\n primaryPanePosition = lastY - handleBarOffsetFromParent;\n }\n break;\n }\n case 'vertical':\n default: {\n if (lastX >= maxMousePosition) {\n primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;\n } else if ((lastX - handleBarOffsetFromParent) <= primaryPaneMinWidth) {\n primaryPanePosition = primaryPaneMinWidth + 0.001;\n } else {\n primaryPanePosition = lastX - handleBarOffsetFromParent;\n }\n break;\n }\n }\n\n return primaryPanePosition;\n}"],"sourceRoot":""}
--------------------------------------------------------------------------------
/docs/static/js/runtime~main.e8bd0c2b.js:
--------------------------------------------------------------------------------
1 | !function(e){function r(r){for(var n,i,l=r[0],f=r[1],a=r[2],c=0,s=[];c maxMousePosition) {
17 | primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;
18 | }
19 | else if ((lastY - handleBarOffsetFromParent) <= primaryPaneMinHeight) {
20 | primaryPanePosition = primaryPaneMinHeight + 0.001;
21 | }
22 | else {
23 | primaryPanePosition = lastY - handleBarOffsetFromParent;
24 | }
25 | break;
26 | }
27 | case 'vertical':
28 | default: {
29 | if (lastX >= maxMousePosition) {
30 | primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;
31 | }
32 | else if ((lastX - handleBarOffsetFromParent) <= primaryPaneMinWidth) {
33 | primaryPanePosition = primaryPaneMinWidth + 0.001;
34 | }
35 | else {
36 | primaryPanePosition = lastX - handleBarOffsetFromParent;
37 | }
38 | break;
39 | }
40 | }
41 | return primaryPanePosition;
42 | }
43 | exports.getPrimaryPaneWidth = getPrimaryPaneWidth;
44 |
--------------------------------------------------------------------------------
/lib/Pane.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | }
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | Object.defineProperty(exports, "__esModule", { value: true });
16 | var React = require("react");
17 | var Pane = /** @class */ (function (_super) {
18 | __extends(Pane, _super);
19 | function Pane() {
20 | var _this = _super !== null && _super.apply(this, arguments) || this;
21 | _this.getDivInstance = function () {
22 | return _this.div;
23 | };
24 | return _this;
25 | }
26 | Pane.prototype.render = function () {
27 | var _this = this;
28 | var _a = this.props, hasDetailPane = _a.hasDetailPane, id = _a.id, style = _a.style, position = _a.position, className = _a.className;
29 | var classNames = [
30 | 'pane',
31 | hasDetailPane && 'bottom-detail-pane',
32 | position,
33 | className
34 | ].filter(function (cls) { return cls; }).join(' ');
35 | return (React.createElement("div", { id: id, ref: function (node) { return _this.div = node; }, className: classNames, style: style }, this.props.children));
36 | };
37 | return Pane;
38 | }(React.Component));
39 | exports.default = Pane;
40 |
--------------------------------------------------------------------------------
/lib/Splitter.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | }
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | Object.defineProperty(exports, "__esModule", { value: true });
16 | var React = require("react");
17 | /********************************
18 | * import files needed for splitter to work
19 | ********************************/
20 | var Pane_1 = require("./Pane");
21 | var HandleBar_1 = require("./HandleBar");
22 | var Helpers_1 = require("./Helpers");
23 | require("./splitters.css");
24 | var Splitter = /** @class */ (function (_super) {
25 | __extends(Splitter, _super);
26 | function Splitter(props) {
27 | var _this = _super.call(this, props) || this;
28 | _this.handleMouseDown = function (e) {
29 | /********************************
30 | * If the right button was clicked - stop the function
31 | * If there is more then one pane, we get the sizes of panes + max pos of mouse in splitter
32 | * add event listener for touch move and mouse move
33 | ********************************/
34 | if (e.button === 2 || _this.props.allowResize === false) {
35 | return;
36 | }
37 | var target = e.currentTarget;
38 | var handleBarOffsetFromParent;
39 | var clientX;
40 | var clientY;
41 | if (e.type === 'mousedown') {
42 | clientX = e.clientX;
43 | clientY = e.clientY;
44 | }
45 | else if (e.type === 'touchstart') {
46 | clientX = e.touches[0].clientX;
47 | clientY = e.touches[0].clientY;
48 | }
49 | if (React.Children.count(_this.props.children) > 1) {
50 | _this.getSize(clientX, clientY);
51 | }
52 | if (_this.props.position === 'horizontal') {
53 | handleBarOffsetFromParent = clientY - target.offsetTop;
54 | }
55 | else if (_this.props.position === 'vertical') {
56 | handleBarOffsetFromParent = clientX - target.offsetLeft;
57 | }
58 | _this.setState({
59 | isDragging: true,
60 | handleBarOffsetFromParent: handleBarOffsetFromParent
61 | });
62 | document.addEventListener('mousemove', _this.handleMouseMove);
63 | document.addEventListener('touchmove', _this.handleMouseMove);
64 | };
65 | _this.handleMouseMove = function (e) {
66 | /********************************
67 | * check if the state is still isDragging, if not, stop the function
68 | * unselectAll - unselect all selected text
69 | * check position of mouse in the splitter and and set the width or height of primary pane
70 | * save last positions of X and Y coords (that is necessary for touch screen)
71 | ********************************/
72 | if (!_this.state.isDragging) {
73 | return;
74 | }
75 | Helpers_1.unselectAll();
76 | var _a = _this.state, handleBarOffsetFromParent = _a.handleBarOffsetFromParent, maxMousePosition = _a.maxMousePosition;
77 | var _b = _this.props, position = _b.position, primaryPaneMinWidth = _b.primaryPaneMinWidth, primaryPaneMinHeight = _b.primaryPaneMinHeight, postPoned = _b.postPoned;
78 | var clientX;
79 | var clientY;
80 | if (e.type === 'mousemove') {
81 | clientX = e.clientX;
82 | clientY = e.clientY;
83 | }
84 | else if (e.type === 'touchmove') {
85 | clientX = e.touches[0].clientX;
86 | clientY = e.touches[0].clientY;
87 | }
88 | var primaryPanePosition = Helpers_1.getPrimaryPaneWidth(position, clientX, clientY, maxMousePosition, handleBarOffsetFromParent, primaryPaneMinHeight, primaryPaneMinWidth);
89 | if (postPoned) {
90 | _this.setState({
91 | handleBarClonePosition: primaryPanePosition,
92 | lastX: clientX,
93 | lastY: clientY,
94 | isVisible: true
95 | });
96 | }
97 | else {
98 | _this.setState({
99 | primaryPane: primaryPanePosition,
100 | lastX: clientX,
101 | lastY: clientY
102 | });
103 | }
104 | };
105 | _this.handleMouseUp = function (e) {
106 | /********************************
107 | * Dispatch event is for components which resizes on window resize
108 | ********************************/
109 | if (!_this.state.isDragging) {
110 | return;
111 | }
112 | var _a = _this.state, handleBarOffsetFromParent = _a.handleBarOffsetFromParent, lastX = _a.lastX, lastY = _a.lastY, maxMousePosition = _a.maxMousePosition;
113 | var _b = _this.props, position = _b.position, primaryPaneMinWidth = _b.primaryPaneMinWidth, primaryPaneMinHeight = _b.primaryPaneMinHeight, postPoned = _b.postPoned;
114 | var primaryPanePosition = Helpers_1.getPrimaryPaneWidth(position, lastX, lastY, maxMousePosition, handleBarOffsetFromParent, primaryPaneMinHeight, primaryPaneMinWidth);
115 | if (postPoned) {
116 | _this.setState({
117 | isDragging: false,
118 | isVisible: false,
119 | primaryPane: primaryPanePosition
120 | });
121 | }
122 | else {
123 | _this.setState({
124 | isDragging: false,
125 | primaryPane: primaryPanePosition
126 | });
127 | }
128 | document.removeEventListener('mousemove', _this.handleMouseMove);
129 | document.removeEventListener('touchmove', _this.handleMouseMove);
130 | // call resize event to trigger method for updating of DataGrid width
131 | // TODO: add this event for IE11
132 | if (typeof _this.props.dispatchResize === 'boolean') {
133 | window.dispatchEvent(new Event('resize'));
134 | }
135 | // callback function from parent component
136 | if (typeof _this.props.onDragFinished === 'function') {
137 | _this.props.onDragFinished();
138 | }
139 | if (React.Children.count(_this.props.children) > 1) {
140 | _this.getSize(lastX, lastY);
141 | }
142 | };
143 | _this.getSize = function (cX, cY) {
144 | /********************************
145 | * This function calculates the max position of a mouse in the current splitter from given percentage.
146 | /********************************/
147 | var maxMousePosition;
148 | var nodeWrapperSize;
149 | var primaryPaneOffset;
150 | var wrapper = _this.paneWrapper.getBoundingClientRect();
151 | var primaryPane = _this.panePrimary.getDivInstance().getBoundingClientRect();
152 | var handleBarSize = _this.handlebar.getDivInstance().getBoundingClientRect();
153 | var posInHandleBar = _this.props.position === 'vertical'
154 | ? handleBarSize.left - cX
155 | : handleBarSize.top - cY;
156 | // find only letters from string
157 | var regEx = new RegExp(/\D+/gi);
158 | if (_this.props.position === 'vertical') {
159 | // split the maxWidth/maxHeight string to string and numbers
160 | var maxWidthStr = _this.props.primaryPaneMaxWidth.match(regEx)[0].toLowerCase();
161 | var maxWidthNum = parseFloat(_this.props.primaryPaneMaxWidth.split(regEx)[0]);
162 | nodeWrapperSize = wrapper.width;
163 | primaryPaneOffset = primaryPane.left;
164 | if (maxWidthStr === '%') {
165 | maxMousePosition =
166 | Math.floor((nodeWrapperSize * (maxWidthNum / 100)) +
167 | primaryPaneOffset - (handleBarSize.width + posInHandleBar));
168 | }
169 | else if (maxWidthStr === 'px') {
170 | maxMousePosition =
171 | Math.floor((maxWidthNum + primaryPaneOffset) - handleBarSize.width);
172 | }
173 | }
174 | else {
175 | var maxHeightStr = _this.props.primaryPaneMaxHeight.match(regEx)[0].toLowerCase();
176 | var maxHeightNum = parseFloat(_this.props.primaryPaneMaxHeight.split(regEx)[0]);
177 | nodeWrapperSize = wrapper.height;
178 | primaryPaneOffset = primaryPane.top;
179 | if (maxHeightStr === '%') {
180 | maxMousePosition =
181 | Math.floor((nodeWrapperSize * (maxHeightNum / 100)) +
182 | primaryPaneOffset - (handleBarSize.height + posInHandleBar));
183 | }
184 | else if (maxHeightStr === 'px') {
185 | maxMousePosition =
186 | Math.floor((maxHeightNum + primaryPaneOffset) - handleBarSize.height);
187 | }
188 | }
189 | _this.setState({
190 | maxMousePosition: maxMousePosition
191 | });
192 | };
193 | _this.state = {
194 | isDragging: false
195 | };
196 | return _this;
197 | }
198 | Splitter.prototype.componentDidMount = function () {
199 | /********************************
200 | * Sets event listeners after component is mounted.
201 | * If there is only one pane, the resize event listener won't be added
202 | ********************************/
203 | document.addEventListener('mouseup', this.handleMouseUp);
204 | document.addEventListener('touchend', this.handleMouseUp);
205 | if (React.Children.count(this.props.children) > 1) {
206 | window.addEventListener('resize', this.getSize);
207 | }
208 | };
209 | Splitter.prototype.render = function () {
210 | var _this = this;
211 | var _a;
212 | /********************************
213 | * set width of primary pane according to props, or state
214 | ********************************/
215 | var _b = this.props, children = _b.children, position = _b.position, primaryPaneMinWidth = _b.primaryPaneMinWidth, primaryPaneWidth = _b.primaryPaneWidth, primaryPaneMaxWidth = _b.primaryPaneMaxWidth, primaryPaneMinHeight = _b.primaryPaneMinHeight, primaryPaneHeight = _b.primaryPaneHeight, primaryPaneMaxHeight = _b.primaryPaneMaxHeight, className = _b.className, primaryPaneClassName = _b.primaryPaneClassName, secondaryPaneClassName = _b.secondaryPaneClassName, maximizedPrimaryPane = _b.maximizedPrimaryPane, minimalizedPrimaryPane = _b.minimalizedPrimaryPane, postPoned = _b.postPoned, allowResize = _b.allowResize;
216 | var _c = this.state, handleBarClonePosition = _c.handleBarClonePosition, primaryPane = _c.primaryPane, isVisible = _c.isVisible;
217 | var paneStyle;
218 | switch (position) {
219 | case 'vertical': {
220 | if (maximizedPrimaryPane) {
221 | paneStyle = {
222 | width: '100%',
223 | minWidth: primaryPaneMinWidth,
224 | maxWidth: '100%'
225 | };
226 | }
227 | else if (minimalizedPrimaryPane) {
228 | paneStyle = {
229 | width: '0px',
230 | minWidth: 0,
231 | maxWidth: primaryPaneMaxWidth
232 | };
233 | }
234 | else {
235 | paneStyle = {
236 | width: primaryPane ? primaryPane + "px" : primaryPaneWidth,
237 | minWidth: primaryPaneMinWidth,
238 | maxWidth: primaryPaneMaxWidth
239 | };
240 | }
241 | break;
242 | }
243 | case 'horizontal': {
244 | if (maximizedPrimaryPane) {
245 | paneStyle = {
246 | height: '100%',
247 | minHeight: 0,
248 | maxHeight: '100%'
249 | };
250 | }
251 | else if (minimalizedPrimaryPane) {
252 | paneStyle = {
253 | height: '0px',
254 | minHeight: 0,
255 | maxHeight: primaryPaneMaxHeight
256 | };
257 | }
258 | else {
259 | paneStyle = {
260 | height: primaryPane ? primaryPane + "px" : primaryPaneHeight,
261 | minHeight: primaryPaneMinHeight,
262 | maxHeight: primaryPaneMaxHeight
263 | };
264 | }
265 | break;
266 | }
267 | default:
268 | return null;
269 | }
270 | if (!children[1]) {
271 | var onePaneStyle = {
272 | width: '100%',
273 | maxWidth: '100%',
274 | height: '100%'
275 | };
276 | }
277 | var handlebarClone;
278 | if (React.Children.count(children) > 1 && postPoned) {
279 | handlebarClone = (_a = {},
280 | _a[position === 'vertical' ? 'left' : 'top'] = handleBarClonePosition + 'px',
281 | _a);
282 | }
283 | var handleBarCloneClassName = [
284 | 'handle-bar handle-bar_clone',
285 | position === 'vertical' ? 'vertical' : 'horizontal',
286 | ].join(' ');
287 | return (React.createElement("div", { className: "splitter " + (position === 'vertical' ? 'vertical' : 'horizontal') + " " + (className || ''), style: onePaneStyle !== 'undefined' ? onePaneStyle : null, ref: function (node) { return _this.paneWrapper = node; } },
288 | React.createElement(Pane_1.default, { className: "primary " + (primaryPaneClassName || ''), position: position, style: paneStyle, ref: function (node) { return _this.panePrimary = node; } }, !children[1] ? children : children[0]),
289 | children[1]
290 | ? React.createElement(HandleBar_1.default, { position: position, handleMouseDown: this.handleMouseDown, ref: function (node) { return _this.handlebar = node; }, allowResize: allowResize })
291 | : null,
292 | postPoned && isVisible
293 | ? React.createElement("div", { style: handlebarClone, className: handleBarCloneClassName })
294 | : null,
295 | children[1]
296 | ? React.createElement(Pane_1.default, { className: secondaryPaneClassName || '', position: position, hasDetailPane: this.props.hasDetailPane, ref: function (node) { return _this.paneNotPrimary = node; } }, children[1])
297 | : null));
298 | };
299 | Splitter.defaultProps = {
300 | position: 'vertical',
301 | postPoned: false,
302 | dispatchResize: false,
303 | primaryPaneMaxWidth: '80%',
304 | primaryPaneMinWidth: 300,
305 | primaryPaneWidth: '50%',
306 | primaryPaneMaxHeight: '80%',
307 | primaryPaneMinHeight: 300,
308 | primaryPaneHeight: '50%'
309 | };
310 | return Splitter;
311 | }(React.Component));
312 | exports.Splitter = Splitter;
313 |
--------------------------------------------------------------------------------
/lib/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var Splitter_1 = require("./Splitter");
4 | exports.default = Splitter_1.Splitter;
5 |
--------------------------------------------------------------------------------
/lib/splitters.css:
--------------------------------------------------------------------------------
1 | .splitter {
2 | height: 100%;
3 | position: relative;
4 | display: flex;
5 | flex: 0 0 100%;
6 | align-content: flex-start;
7 | user-select: text; }
8 |
9 | .pane {
10 | flex-grow: 1;
11 | height: 100%; }
12 |
13 | .splitter.horizontal {
14 | flex-wrap: nowrap;
15 | flex-direction: column; }
16 |
17 | .splitter .pane:first-child {
18 | width: 100%;
19 | height: 100%;
20 | flex-grow: 0;
21 | flex-shrink: 0;
22 | flex-basis: auto; }
23 |
24 | .splitter .pane:last-child {
25 | flex: 1 1 0;
26 | flex-grow: 1;
27 | flex-shrink: 1;
28 | flex-basis: 0;
29 | overflow: hidden; }
30 |
31 | .bottom-detail-pane {
32 | padding: 10px;
33 | background-color: #e7f5ce;
34 | z-index: 10; }
35 |
36 | .splitter .pane.bottom-detail-pane {
37 | overflow: auto; }
38 |
39 | /*handle bar*/
40 | .handle-bar {
41 | width: 10px;
42 | height: 100%;
43 | min-width: 10px;
44 | display: flex;
45 | justify-content: center;
46 | align-items: center;
47 | position: relative;
48 | z-index: 20;
49 | background-color: #eeeff0;
50 | cursor: col-resize;
51 | font-size: 14px; }
52 | .handle-bar .handle-bar_drag {
53 | width: 4px;
54 | height: 20px;
55 | border-left: 1px solid rgba(0, 0, 0, 0.0980392);
56 | border-right: 1px solid rgba(0, 0, 0, 0.0980392); }
57 | .handle-bar.horizontal {
58 | width: 100%;
59 | height: 10px;
60 | min-height: 10px;
61 | cursor: row-resize; }
62 | .handle-bar.horizontal .handle-bar_drag {
63 | width: 20px;
64 | height: 4px;
65 | border-top: 1px solid rgba(0, 0, 0, 0.0980392);
66 | border-bottom: 1px solid rgba(0, 0, 0, 0.0980392);
67 | border-right: 0;
68 | border-left: 0; }
69 | .handle-bar:active, .handle-bar:hover, .handle-bar.handle-bar_clone {
70 | background-color: #ccc; }
71 | .handle-bar.handle-bar_clone {
72 | position: absolute;
73 | opacity: .9;
74 | z-index: 12000; }
75 | .handle-bar.resize-not-allowed {
76 | cursor: auto; }
77 | .handle-bar.resize-not-allowed:hover {
78 | background-color: #eeeff0; }
79 | .handle-bar.resize-not-allowed .handle-bar_drag {
80 | display: none; }
81 |
82 | .rotate-90 {
83 | transform: rotate(90deg); }
84 |
--------------------------------------------------------------------------------
/lib/typings/index.d.ts:
--------------------------------------------------------------------------------
1 | import { ComponentClass } from "react";
2 |
3 | // ------ Splitter interfaces
4 | export type handlePositionType = 'vertical' | 'horizontal';
5 |
6 | export interface SplitterProps {
7 | children?: {} | any;
8 | position: handlePositionType;
9 | hasDetailPane?: boolean;
10 | primaryPaneMinWidth?: number | any;
11 | primaryPaneWidth?: string | any;
12 | primaryPaneMaxWidth?: string | any;
13 | primaryPaneMinHeight?: number | any;
14 | primaryPaneHeight?: string | any;
15 | primaryPaneMaxHeight?: string | any;
16 | className?: string;
17 | primaryPaneClassName?: string;
18 | secondaryPaneClassName?: string;
19 | dispatchResize?: Boolean;
20 | maximizedPrimaryPane?: Boolean;
21 | minimalizedPrimaryPane?: Boolean;
22 | postPoned?: Boolean;
23 | onDragFinished?: Function;
24 | allowResize?: Boolean;
25 | }
26 |
27 | export interface SplitterState {
28 | isDragging?: boolean;
29 | maxMousePosition?: number | any;
30 | handleBarOffsetFromParent?: number | any;
31 | primaryPane?: number | any;
32 | lastX?: number | any;
33 | lastY?: number | any;
34 | handleBarClonePos?: number | any;
35 | isVisible?: Boolean;
36 | handleBarClonePosition?: number;
37 | }
38 |
39 | // ------ Pane interfaces
40 | export interface PaneProps {
41 | position: handlePositionType;
42 | hasDetailPane?: boolean;
43 | id?: string;
44 | style?: CSSStyleRule | any;
45 | className?: string;
46 | }
47 |
48 | // ------ Handlebar interfaces
49 | export interface HandleBarProps {
50 | position: handlePositionType;
51 | handleMouseDown?: Function | any;
52 | allowResize?: Boolean;
53 | }
54 |
55 | declare const Splitter: ComponentClass;
56 |
57 | export as namespace Splitter;
58 |
59 | export default Splitter;
60 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "m-react-splitters",
3 | "version": "1.2.0",
4 | "private": false,
5 | "main": "./lib/index",
6 | "homepage": "https://martinnov92.github.io/React-Splitters/",
7 | "license": "MIT",
8 | "author": "Martin Novák ",
9 | "description": "Splitter component for React, written in TypeScript",
10 | "typings": "./lib/typings/index.d.ts",
11 | "repository": {
12 | "type": "git",
13 | "url": "https://github.com/martinnov92/React-Splitters"
14 | },
15 | "keywords": [
16 | "react",
17 | "react-splitter",
18 | "component",
19 | "splitter",
20 | "splitters",
21 | "typescript",
22 | "ts",
23 | "es6"
24 | ],
25 | "devDependencies": {
26 | "@types/node": "^10.9.0",
27 | "@types/react": "^16.4.11",
28 | "@types/react-dom": "^16.0.7",
29 | "node-sass": "^4.13.0",
30 | "npm-run-all": "^4.1.3",
31 | "react-scripts-ts": "^4.0.8",
32 | "typescript": "^3.0.1"
33 | },
34 | "dependencies": {
35 | "react": "^16.4.2",
36 | "react-dom": "^16.4.2"
37 | },
38 | "peerDependencies": {
39 | "react": "^15.0.0 || ^16.0.0"
40 | },
41 | "scripts": {
42 | "tsc-compile": "tsc ./src/components/Splitters/*.tsx --outDir ./lib --jsx react --target ES5",
43 | "build-css": "node-sass src/ -o src/",
44 | "watch-css": "npm run build-css && node-sass src/ -o src/ --watch",
45 | "start-js": "react-scripts-ts start",
46 | "start": "npm-run-all -p watch-css start-js",
47 | "build": "npm run build-css && react-scripts-ts build",
48 | "test": "react-scripts-ts test --env=jsdom",
49 | "eject": "react-scripts-ts eject"
50 | },
51 | "browserslist": [
52 | ">0.2%",
53 | "not dead",
54 | "not ie <= 11",
55 | "not op_mini all"
56 | ]
57 | }
58 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/martinnov92/React-Splitters/c9ca351426e55c41c2016c9cc1c647dd17974783/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | React App
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/App.css:
--------------------------------------------------------------------------------
1 | * {
2 | padding: 0;
3 | margin: 0;
4 | box-sizing: border-box; }
5 |
6 | #root {
7 | width: 100vw;
8 | height: 100vh;
9 | overflow: hidden; }
10 |
11 | .app {
12 | width: 100%;
13 | height: 100%;
14 | position: relative; }
15 |
16 | .splitter-wrapper {
17 | width: 100%;
18 | height: 100%;
19 | position: relative;
20 | overflow: hidden; }
21 |
22 | .pane {
23 | overflow: hidden; }
24 |
25 | .placeholder {
26 | width: 100%;
27 | height: 100%;
28 | display: flex;
29 | flex-wrap: wrap;
30 | align-content: center;
31 | align-items: center;
32 | text-align: center;
33 | background-color: #f9f9f9;
34 | color: #394053;
35 | font-size: 6em;
36 | font-family: Arial; }
37 | .placeholder span {
38 | width: 100%;
39 | text-align: center; }
40 | .placeholder p {
41 | width: 100%;
42 | display: block;
43 | font-size: 18px;
44 | text-align: center; }
45 | .placeholder._1 {
46 | background-color: #BCD4DE; }
47 | .placeholder._2 {
48 | background-color: #A5CCD1; }
49 | .placeholder._3 {
50 | background-color: #A0B9BF; }
51 | .placeholder._4 {
52 | background-color: #9DACB2; }
53 |
--------------------------------------------------------------------------------
/src/App.scss:
--------------------------------------------------------------------------------
1 | * {
2 | padding: 0;
3 | margin: 0;
4 | box-sizing: border-box;
5 | }
6 |
7 | #root {
8 | width: 100vw;
9 | height: 100vh;
10 | overflow: hidden;
11 | }
12 |
13 | .app {
14 | width: 100%;
15 | height: 100%;
16 | position: relative;
17 | }
18 |
19 | .splitter-wrapper {
20 | width: 100%;
21 | height: 100%;
22 | position: relative;
23 | overflow: hidden;
24 | }
25 |
26 | .pane {
27 | overflow: hidden;
28 | }
29 |
30 | .placeholder {
31 | width: 100%;
32 | height: 100%;
33 | display: flex;
34 | flex-wrap: wrap;
35 | align-content: center;
36 | align-items: center;
37 | text-align: center;
38 | background-color: #f9f9f9;
39 | color: #394053;
40 | font-size: 6em;
41 | font-family: Arial;
42 |
43 | span {
44 | width: 100%;
45 | text-align: center;
46 | }
47 |
48 | p {
49 | width: 100%;
50 | display: block;
51 | font-size: 18px;
52 | text-align: center;
53 | }
54 |
55 | &._1 {
56 | background-color: #BCD4DE;
57 | }
58 | &._2 {
59 | background-color: #A5CCD1;
60 | }
61 | &._3 {
62 | background-color: #A0B9BF;
63 | }
64 | &._4 {
65 | background-color: #9DACB2;
66 | }
67 | }
--------------------------------------------------------------------------------
/src/App.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | import Splitter from './components/Splitters';
4 |
5 | interface AppState {
6 | maxPrimaryPane?: Boolean;
7 | }
8 |
9 | class App extends React.Component<{}, AppState> {
10 | state = {
11 | maxPrimaryPane: false
12 | };
13 |
14 | split: Splitter | null = null;
15 |
16 | maxPrimaryPane = () => {
17 | this.setState({
18 | maxPrimaryPane: !this.state.maxPrimaryPane
19 | });
20 | }
21 |
22 | onDragFinishedCallback = () => {
23 | console.log('callback');
24 | console.log(this.split && this.split.paneWrapper); // actual div
25 | console.log(this.split && this.split.panePrimary.div.clientWidth);
26 | console.log(this.split && this.split.paneNotPrimary.div.clientHeight);
27 | }
28 |
29 | render() {
30 | return (
31 |
32 |
33 |
this.split = node}
40 | >
41 |
51 |
52 |
1
53 |
postponed
54 |
primary
55 |
56 |
64 |
65 |
2
66 |
normal resize
67 |
primary
68 |
69 | 3
70 |
71 |
72 |
73 |
4
74 |
normal resize
75 |
76 |
77 |
78 |
79 | );
80 | }
81 | }
82 |
83 | export default App;
84 |
--------------------------------------------------------------------------------
/src/components/Splitters/HandleBar.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { HandleBarProps } from './typings/index';
3 |
4 | class HandleBar extends React.Component {
5 | static defaultProps: Partial = {
6 | allowResize: true
7 | };
8 |
9 | div: HTMLDivElement;
10 |
11 | render() {
12 | const { position, handleMouseDown, allowResize } = this.props;
13 |
14 | const classNames = [
15 | 'handle-bar',
16 | position,
17 | !allowResize && 'resize-not-allowed',
18 | ].filter((cls) => cls).join(' ');
19 |
20 | return (
21 | this.div = node}
24 | onMouseDown={(e) => handleMouseDown(e)}
25 | onTouchStart={(e) => handleMouseDown(e)}
26 | >
27 |
28 |
29 | );
30 | }
31 |
32 | getDivInstance = () => {
33 | return this.div;
34 | }
35 | }
36 |
37 | export default HandleBar;
--------------------------------------------------------------------------------
/src/components/Splitters/Helpers.ts:
--------------------------------------------------------------------------------
1 | export function unselectAll() {
2 | try {
3 | window.getSelection().removeAllRanges();
4 | } catch (e) {
5 | console.warn(e);
6 | }
7 | }
8 |
9 | export function getPrimaryPaneWidth
10 | (
11 | position: string, lastX: number, lastY: number,
12 | maxMousePosition: number, handleBarOffsetFromParent: number,
13 | primaryPaneMinHeight: number, primaryPaneMinWidth: number
14 | ): number {
15 |
16 | let primaryPanePosition;
17 |
18 | switch (position) {
19 | case 'horizontal': {
20 | if (lastY > maxMousePosition) {
21 | primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;
22 | } else if ((lastY - handleBarOffsetFromParent) <= primaryPaneMinHeight) {
23 | primaryPanePosition = primaryPaneMinHeight + 0.001;
24 | } else {
25 | primaryPanePosition = lastY - handleBarOffsetFromParent;
26 | }
27 | break;
28 | }
29 | case 'vertical':
30 | default: {
31 | if (lastX >= maxMousePosition) {
32 | primaryPanePosition = maxMousePosition - handleBarOffsetFromParent;
33 | } else if ((lastX - handleBarOffsetFromParent) <= primaryPaneMinWidth) {
34 | primaryPanePosition = primaryPaneMinWidth + 0.001;
35 | } else {
36 | primaryPanePosition = lastX - handleBarOffsetFromParent;
37 | }
38 | break;
39 | }
40 | }
41 |
42 | return primaryPanePosition;
43 | }
--------------------------------------------------------------------------------
/src/components/Splitters/Pane.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { PaneProps } from './typings/index';
3 |
4 | class Pane extends React.Component {
5 | div: HTMLDivElement;
6 |
7 | render() {
8 | const { hasDetailPane, id, style, position, className } = this.props;
9 |
10 | const classNames = [
11 | 'pane',
12 | hasDetailPane && 'bottom-detail-pane',
13 | position,
14 | className
15 | ].filter((cls) => cls).join(' ');
16 |
17 | return (
18 | this.div = node}
21 | className={classNames}
22 | style={style}
23 | >
24 | {this.props.children}
25 |
26 | );
27 | }
28 |
29 | getDivInstance = () => {
30 | return this.div;
31 | }
32 | }
33 |
34 | export default Pane;
--------------------------------------------------------------------------------
/src/components/Splitters/Splitter.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | /********************************
4 | * import files needed for splitter to work
5 | ********************************/
6 | import Pane from './Pane';
7 | import HandleBar from './HandleBar';
8 | import { unselectAll, getPrimaryPaneWidth } from './Helpers';
9 | import { SplitterProps, SplitterState } from './typings/index';
10 | import './splitters.css';
11 |
12 | export class Splitter extends React.Component {
13 | public static defaultProps: Partial = {
14 | position: 'vertical',
15 | postPoned: false,
16 | dispatchResize: false,
17 | primaryPaneMaxWidth: '80%',
18 | primaryPaneMinWidth: 300,
19 | primaryPaneWidth: '50%',
20 | primaryPaneMaxHeight: '80%',
21 | primaryPaneMinHeight: 300,
22 | primaryPaneHeight: '50%'
23 | };
24 |
25 | panePrimary: Pane;
26 | paneNotPrimary: Pane;
27 | handlebar: HandleBar;
28 | paneWrapper: HTMLDivElement;
29 |
30 | constructor(props: SplitterProps) {
31 | super(props);
32 |
33 | this.state = {
34 | isDragging: false
35 | };
36 | }
37 |
38 | componentDidMount() {
39 | /********************************
40 | * Sets event listeners after component is mounted.
41 | * If there is only one pane, the resize event listener won't be added
42 | ********************************/
43 | document.addEventListener('mouseup', this.handleMouseUp);
44 | document.addEventListener('touchend', this.handleMouseUp);
45 |
46 | if (React.Children.count(this.props.children) > 1) {
47 | window.addEventListener('resize', this.getSize);
48 | }
49 | }
50 |
51 | handleMouseDown = (e: any) => {
52 | /********************************
53 | * If the right button was clicked - stop the function
54 | * If there is more then one pane, we get the sizes of panes + max pos of mouse in splitter
55 | * add event listener for touch move and mouse move
56 | ********************************/
57 | if (e.button === 2 || this.props.allowResize === false) {
58 | return;
59 | }
60 |
61 | const target = e.currentTarget;
62 | let handleBarOffsetFromParent;
63 | let clientX;
64 | let clientY;
65 |
66 | if (e.type === 'mousedown') {
67 | clientX = e.clientX;
68 | clientY = e.clientY;
69 | } else if (e.type === 'touchstart') {
70 | clientX = e.touches[0].clientX;
71 | clientY = e.touches[0].clientY;
72 | }
73 |
74 | if (React.Children.count(this.props.children) > 1) {
75 | this.getSize(clientX, clientY);
76 | }
77 |
78 | if (this.props.position === 'horizontal') {
79 | handleBarOffsetFromParent = clientY - target.offsetTop;
80 | } else if (this.props.position === 'vertical') {
81 | handleBarOffsetFromParent = clientX - target.offsetLeft;
82 | }
83 |
84 | this.setState({
85 | isDragging: true,
86 | handleBarOffsetFromParent
87 | });
88 |
89 | document.addEventListener('mousemove', this.handleMouseMove);
90 | document.addEventListener('touchmove', this.handleMouseMove);
91 | }
92 |
93 | handleMouseMove = (e: any) => {
94 | /********************************
95 | * check if the state is still isDragging, if not, stop the function
96 | * unselectAll - unselect all selected text
97 | * check position of mouse in the splitter and and set the width or height of primary pane
98 | * save last positions of X and Y coords (that is necessary for touch screen)
99 | ********************************/
100 | if (!this.state.isDragging) {
101 | return;
102 | }
103 |
104 | unselectAll();
105 |
106 | const {
107 | handleBarOffsetFromParent,
108 | maxMousePosition
109 | } = this.state;
110 |
111 | const {
112 | position,
113 | primaryPaneMinWidth,
114 | primaryPaneMinHeight,
115 | postPoned
116 | } = this.props;
117 |
118 | let clientX;
119 | let clientY;
120 |
121 | if (e.type === 'mousemove') {
122 | clientX = e.clientX;
123 | clientY = e.clientY;
124 | } else if (e.type === 'touchmove') {
125 | clientX = e.touches[0].clientX;
126 | clientY = e.touches[0].clientY;
127 | }
128 |
129 | const primaryPanePosition =
130 | getPrimaryPaneWidth(
131 | position,
132 | clientX,
133 | clientY,
134 | maxMousePosition,
135 | handleBarOffsetFromParent,
136 | primaryPaneMinHeight,
137 | primaryPaneMinWidth
138 | );
139 |
140 | if (postPoned) {
141 | this.setState({
142 | handleBarClonePosition: primaryPanePosition,
143 | lastX: clientX,
144 | lastY: clientY,
145 | isVisible: true
146 | });
147 | } else {
148 | this.setState({
149 | primaryPane: primaryPanePosition,
150 | lastX: clientX,
151 | lastY: clientY
152 | });
153 | }
154 | }
155 |
156 | handleMouseUp = (e: any) => {
157 | /********************************
158 | * Dispatch event is for components which resizes on window resize
159 | ********************************/
160 | if (!this.state.isDragging) {
161 | return;
162 | }
163 |
164 | const {
165 | handleBarOffsetFromParent,
166 | lastX, lastY, maxMousePosition
167 | } = this.state;
168 |
169 | const {
170 | position,
171 | primaryPaneMinWidth,
172 | primaryPaneMinHeight,
173 | postPoned
174 | } = this.props;
175 |
176 | const primaryPanePosition =
177 | getPrimaryPaneWidth(
178 | position,
179 | lastX,
180 | lastY,
181 | maxMousePosition,
182 | handleBarOffsetFromParent,
183 | primaryPaneMinHeight,
184 | primaryPaneMinWidth
185 | );
186 |
187 | if (postPoned) {
188 | this.setState({
189 | isDragging: false,
190 | isVisible: false,
191 | primaryPane: primaryPanePosition
192 | });
193 | } else {
194 | this.setState({
195 | isDragging: false,
196 | primaryPane: primaryPanePosition
197 | });
198 | }
199 |
200 | document.removeEventListener('mousemove', this.handleMouseMove);
201 | document.removeEventListener('touchmove', this.handleMouseMove);
202 |
203 | // call resize event to trigger method for updating of DataGrid width
204 | // TODO: add this event for IE11
205 | if (typeof this.props.dispatchResize === 'boolean') {
206 | window.dispatchEvent(new Event('resize'));
207 | }
208 |
209 | // callback function from parent component
210 | if (typeof this.props.onDragFinished === 'function') {
211 | this.props.onDragFinished();
212 | }
213 |
214 | if (React.Children.count(this.props.children) > 1) {
215 | this.getSize(lastX, lastY);
216 | }
217 | }
218 |
219 | render() {
220 | /********************************
221 | * set width of primary pane according to props, or state
222 | ********************************/
223 | const {
224 | children, position,
225 | primaryPaneMinWidth, primaryPaneWidth, primaryPaneMaxWidth,
226 | primaryPaneMinHeight, primaryPaneHeight, primaryPaneMaxHeight,
227 | className, primaryPaneClassName, secondaryPaneClassName,
228 | maximizedPrimaryPane, minimalizedPrimaryPane, postPoned, allowResize
229 | } = this.props;
230 |
231 | const {
232 | handleBarClonePosition,
233 | primaryPane,
234 | isVisible
235 | } = this.state;
236 |
237 | let paneStyle;
238 | switch (position) {
239 | case 'vertical': {
240 | if (maximizedPrimaryPane) {
241 | paneStyle = {
242 | width: '100%',
243 | minWidth: primaryPaneMinWidth,
244 | maxWidth: '100%'
245 | };
246 | } else if (minimalizedPrimaryPane) {
247 | paneStyle = {
248 | width: '0px',
249 | minWidth: 0,
250 | maxWidth: primaryPaneMaxWidth
251 | };
252 | } else {
253 | paneStyle = {
254 | width: primaryPane ? `${primaryPane}px` : primaryPaneWidth,
255 | minWidth: primaryPaneMinWidth,
256 | maxWidth: primaryPaneMaxWidth
257 | };
258 | }
259 | break;
260 | }
261 | case 'horizontal': {
262 | if (maximizedPrimaryPane) {
263 | paneStyle = {
264 | height: '100%',
265 | minHeight: 0,
266 | maxHeight: '100%'
267 | };
268 | } else if (minimalizedPrimaryPane) {
269 | paneStyle = {
270 | height: '0px',
271 | minHeight: 0,
272 | maxHeight: primaryPaneMaxHeight
273 | };
274 | } else {
275 | paneStyle = {
276 | height: primaryPane ? `${primaryPane}px` : primaryPaneHeight,
277 | minHeight: primaryPaneMinHeight,
278 | maxHeight: primaryPaneMaxHeight
279 | };
280 | }
281 | break;
282 | }
283 | default:
284 | return null;
285 | }
286 |
287 | if (!children[1]) {
288 | var onePaneStyle: any = {
289 | width: '100%',
290 | maxWidth: '100%',
291 | height: '100%'
292 | };
293 | }
294 |
295 | let handlebarClone;
296 | if (React.Children.count(children) > 1 && postPoned) {
297 | handlebarClone = {
298 | [position === 'vertical' ? 'left' : 'top']: handleBarClonePosition + 'px'
299 | };
300 | }
301 |
302 | const handleBarCloneClassName = [
303 | 'handle-bar handle-bar_clone',
304 | position === 'vertical' ? 'vertical' : 'horizontal',
305 | ].join(' ');
306 |
307 | return (
308 | this.paneWrapper = node}
312 | >
313 |
this.panePrimary = node}
318 | >
319 | {!children[1] ? children : children[0]}
320 |
321 |
322 | {
323 | children[1]
324 | ?
this.handlebar = node}
328 | allowResize={allowResize}
329 | />
330 | : null
331 | }
332 |
333 | {
334 | postPoned && isVisible
335 | ?
339 | : null
340 | }
341 |
342 | {
343 | children[1]
344 | ? this.paneNotPrimary = node}
349 | >
350 | {children[1]}
351 |
352 | : null
353 | }
354 |
355 | );
356 | }
357 |
358 | getSize = (cX?: Number | any, cY?: Number | any) => {
359 | /********************************
360 | * This function calculates the max position of a mouse in the current splitter from given percentage.
361 | /********************************/
362 | let maxMousePosition;
363 | let nodeWrapperSize;
364 | let primaryPaneOffset;
365 | let wrapper = this.paneWrapper.getBoundingClientRect();
366 | let primaryPane = this.panePrimary.getDivInstance().getBoundingClientRect();
367 | let handleBarSize = this.handlebar.getDivInstance().getBoundingClientRect();
368 |
369 | const posInHandleBar = this.props.position === 'vertical'
370 | ? handleBarSize.left - cX
371 | : handleBarSize.top - cY;
372 |
373 | // find only letters from string
374 | const regEx = new RegExp(/\D+/gi);
375 |
376 | if (this.props.position === 'vertical') {
377 | // split the maxWidth/maxHeight string to string and numbers
378 | let maxWidthStr = this.props.primaryPaneMaxWidth.match(regEx)[0].toLowerCase();
379 | let maxWidthNum = parseFloat(this.props.primaryPaneMaxWidth.split(regEx)[0]);
380 | nodeWrapperSize = wrapper.width;
381 | primaryPaneOffset = primaryPane.left;
382 |
383 | if (maxWidthStr === '%') {
384 | maxMousePosition =
385 | Math.floor(
386 | (nodeWrapperSize * (maxWidthNum / 100)) +
387 | primaryPaneOffset - (handleBarSize.width + posInHandleBar)
388 | );
389 | } else if (maxWidthStr === 'px') {
390 | maxMousePosition =
391 | Math.floor((maxWidthNum + primaryPaneOffset) - handleBarSize.width);
392 | }
393 | } else {
394 | let maxHeightStr = this.props.primaryPaneMaxHeight.match(regEx)[0].toLowerCase();
395 | let maxHeightNum = parseFloat(this.props.primaryPaneMaxHeight.split(regEx)[0]);
396 | nodeWrapperSize = wrapper.height;
397 | primaryPaneOffset = primaryPane.top;
398 |
399 | if (maxHeightStr === '%') {
400 | maxMousePosition =
401 | Math.floor(
402 | (nodeWrapperSize * (maxHeightNum / 100)) +
403 | primaryPaneOffset - (handleBarSize.height + posInHandleBar)
404 | );
405 | } else if (maxHeightStr === 'px') {
406 | maxMousePosition =
407 | Math.floor((maxHeightNum + primaryPaneOffset) - handleBarSize.height);
408 | }
409 | }
410 |
411 | this.setState({
412 | maxMousePosition
413 | });
414 | }
415 | }
--------------------------------------------------------------------------------
/src/components/Splitters/index.tsx:
--------------------------------------------------------------------------------
1 | import { Splitter } from './Splitter';
2 | export default Splitter;
--------------------------------------------------------------------------------
/src/components/Splitters/splitters.css:
--------------------------------------------------------------------------------
1 | .splitter {
2 | height: 100%;
3 | position: relative;
4 | display: flex;
5 | flex: 0 0 100%;
6 | align-content: flex-start;
7 | user-select: text; }
8 |
9 | .pane {
10 | flex-grow: 1;
11 | height: 100%; }
12 |
13 | .splitter.horizontal {
14 | flex-wrap: nowrap;
15 | flex-direction: column; }
16 |
17 | .splitter .pane:first-child {
18 | width: 100%;
19 | height: 100%;
20 | flex-grow: 0;
21 | flex-shrink: 0;
22 | flex-basis: auto; }
23 |
24 | .splitter .pane:last-child {
25 | flex: 1 1 0;
26 | flex-grow: 1;
27 | flex-shrink: 1;
28 | flex-basis: 0;
29 | overflow: hidden; }
30 |
31 | .bottom-detail-pane {
32 | padding: 10px;
33 | background-color: #e7f5ce;
34 | z-index: 10; }
35 |
36 | .splitter .pane.bottom-detail-pane {
37 | overflow: auto; }
38 |
39 | /*handle bar*/
40 | .handle-bar {
41 | width: 10px;
42 | height: 100%;
43 | min-width: 10px;
44 | display: flex;
45 | justify-content: center;
46 | align-items: center;
47 | position: relative;
48 | z-index: 20;
49 | background-color: #eeeff0;
50 | cursor: col-resize;
51 | font-size: 14px; }
52 | .handle-bar .handle-bar_drag {
53 | width: 4px;
54 | height: 20px;
55 | border-left: 1px solid rgba(0, 0, 0, 0.0980392);
56 | border-right: 1px solid rgba(0, 0, 0, 0.0980392); }
57 | .handle-bar.horizontal {
58 | width: 100%;
59 | height: 10px;
60 | min-height: 10px;
61 | cursor: row-resize; }
62 | .handle-bar.horizontal .handle-bar_drag {
63 | width: 20px;
64 | height: 4px;
65 | border-top: 1px solid rgba(0, 0, 0, 0.0980392);
66 | border-bottom: 1px solid rgba(0, 0, 0, 0.0980392);
67 | border-right: 0;
68 | border-left: 0; }
69 | .handle-bar:active, .handle-bar:hover, .handle-bar.handle-bar_clone {
70 | background-color: #ccc; }
71 | .handle-bar.handle-bar_clone {
72 | position: absolute;
73 | opacity: .9;
74 | z-index: 12000; }
75 | .handle-bar.resize-not-allowed {
76 | cursor: auto; }
77 | .handle-bar.resize-not-allowed:hover {
78 | background-color: #eeeff0; }
79 | .handle-bar.resize-not-allowed .handle-bar_drag {
80 | display: none; }
81 |
82 | .rotate-90 {
83 | transform: rotate(90deg); }
84 |
--------------------------------------------------------------------------------
/src/components/Splitters/splitters.scss:
--------------------------------------------------------------------------------
1 | .splitter {
2 | height: 100%;
3 | position: relative;
4 | display: flex;
5 | flex: 0 0 100%;
6 | align-content: flex-start;
7 | user-select: text;
8 | }
9 |
10 | .pane {
11 | flex-grow: 1;
12 | height: 100%;
13 | }
14 |
15 | .splitter.horizontal {
16 | flex-wrap: nowrap;
17 | flex-direction: column;
18 | }
19 |
20 | .splitter .pane:first-child {
21 | width: 100%;
22 | height: 100%;
23 | flex-grow: 0;
24 | flex-shrink: 0;
25 | flex-basis: auto;
26 | }
27 |
28 | .splitter .pane:last-child {
29 | flex: 1 1 0;
30 | flex-grow: 1;
31 | flex-shrink: 1;
32 | flex-basis: 0;
33 | overflow: hidden;
34 | }
35 |
36 | .bottom-detail-pane {
37 | padding: 10px;
38 | background-color: #e7f5ce;
39 | z-index: 10;
40 | }
41 |
42 | .splitter .pane.bottom-detail-pane {
43 | overflow: auto;
44 | }
45 |
46 | /*handle bar*/
47 | .handle-bar {
48 | width: 10px;
49 | height: 100%;
50 | min-width: 10px;
51 | display: flex;
52 | justify-content: center;
53 | align-items: center;
54 | position: relative;
55 | z-index: 20;
56 | background-color: #eeeff0;
57 | cursor: col-resize;
58 | font-size: 14px;
59 |
60 | .handle-bar_drag {
61 | width: 4px;
62 | height: 20px;
63 | border-left: 1px solid rgba(0, 0, 0, 0.0980392);
64 | border-right: 1px solid rgba(0, 0, 0, 0.0980392);
65 | }
66 |
67 | &.horizontal {
68 | width: 100%;
69 | height: 10px;
70 | min-height: 10px;
71 | cursor: row-resize;
72 |
73 | .handle-bar_drag {
74 | width: 20px;
75 | height: 4px;
76 | border-top: 1px solid rgba(0, 0, 0, 0.0980392);
77 | border-bottom: 1px solid rgba(0, 0, 0, 0.0980392);
78 | border-right: 0;
79 | border-left: 0;
80 | }
81 | }
82 |
83 | &:active,
84 | &:hover,
85 | &.handle-bar_clone {
86 | background-color: #ccc;
87 | }
88 |
89 | &.handle-bar_clone {
90 | position: absolute;
91 | opacity: .9;
92 | z-index: 12000;
93 | }
94 |
95 | &.resize-not-allowed {
96 | cursor: auto;
97 |
98 | &:hover {
99 | background-color: #eeeff0;;
100 | }
101 |
102 | .handle-bar_drag {
103 | display: none;
104 | }
105 | }
106 | }
107 |
108 | .rotate-90 {
109 | transform: rotate(90deg);
110 | }
--------------------------------------------------------------------------------
/src/components/Splitters/typings/index.d.ts:
--------------------------------------------------------------------------------
1 | import { ComponentClass } from "react";
2 |
3 | // ------ Splitter interfaces
4 | export type handlePositionType = 'vertical' | 'horizontal';
5 |
6 | export interface SplitterProps {
7 | children?: {} | any;
8 | position: handlePositionType;
9 | hasDetailPane?: boolean;
10 | primaryPaneMinWidth?: number | any;
11 | primaryPaneWidth?: string | any;
12 | primaryPaneMaxWidth?: string | any;
13 | primaryPaneMinHeight?: number | any;
14 | primaryPaneHeight?: string | any;
15 | primaryPaneMaxHeight?: string | any;
16 | className?: string;
17 | primaryPaneClassName?: string;
18 | secondaryPaneClassName?: string;
19 | dispatchResize?: Boolean;
20 | maximizedPrimaryPane?: Boolean;
21 | minimalizedPrimaryPane?: Boolean;
22 | postPoned?: Boolean;
23 | onDragFinished?: Function;
24 | allowResize?: Boolean;
25 | }
26 |
27 | export interface SplitterState {
28 | isDragging?: boolean;
29 | maxMousePosition?: number | any;
30 | handleBarOffsetFromParent?: number | any;
31 | primaryPane?: number | any;
32 | lastX?: number | any;
33 | lastY?: number | any;
34 | handleBarClonePos?: number | any;
35 | isVisible?: Boolean;
36 | handleBarClonePosition?: number;
37 | }
38 |
39 | // ------ Pane interfaces
40 | export interface PaneProps {
41 | position: handlePositionType;
42 | hasDetailPane?: boolean;
43 | id?: string;
44 | style?: CSSStyleRule | any;
45 | className?: string;
46 | }
47 |
48 | // ------ Handlebar interfaces
49 | export interface HandleBarProps {
50 | position: handlePositionType;
51 | handleMouseDown?: Function | any;
52 | allowResize?: Boolean;
53 | }
54 |
55 | declare const Splitter: ComponentClass;
56 |
57 | export as namespace Splitter;
58 |
59 | export default Splitter;
60 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import * as ReactDOM from 'react-dom';
3 | import App from './App';
4 | import './App.css';
5 |
6 | ReactDOM.render(
7 | ,
8 | document.getElementById('root') as HTMLElement
9 | );
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "build/dist",
4 | "module": "commonjs",
5 | "target": "es5",
6 | "lib": ["es6", "dom"],
7 | "sourceMap": true,
8 | "allowJs": true,
9 | "jsx": "react",
10 | "moduleResolution": "node",
11 | "rootDir": "src",
12 | "forceConsistentCasingInFileNames": true,
13 | "noImplicitReturns": true,
14 | "noImplicitThis": true,
15 | "noImplicitAny": true,
16 | "strictNullChecks": true,
17 | "suppressImplicitAnyIndexErrors": true,
18 | "noUnusedLocals": true,
19 | "removeComments": true
20 | },
21 | "exclude": [
22 | "node_modules",
23 | "build",
24 | "scripts",
25 | "acceptance-tests",
26 | "webpack",
27 | "jest",
28 | "src/setupTests.ts"
29 | ],
30 | "types": [
31 | "typePatches"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/tsconfig.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json"
3 | }
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint-react"],
3 | "rules": {
4 | "align": [
5 | true,
6 | "parameters",
7 | "arguments",
8 | "statements"
9 | ],
10 | "ban": false,
11 | "class-name": true,
12 | "comment-format": [
13 | true,
14 | "check-space"
15 | ],
16 | "curly": true,
17 | "eofline": false,
18 | "forin": true,
19 | "indent": [ true, "spaces" ],
20 | "interface-name": [true, "never-prefix"],
21 | "jsdoc-format": true,
22 | "jsx-no-lambda": false,
23 | "jsx-no-multiline-js": false,
24 | "label-position": true,
25 | "max-line-length": [ true, 120 ],
26 | "member-ordering": [
27 | true,
28 | "public-before-private",
29 | "static-before-instance",
30 | "variables-before-functions"
31 | ],
32 | "no-any": false,
33 | "no-arg": true,
34 | "no-bitwise": true,
35 | "no-console": [
36 | false,
37 | "log",
38 | "error",
39 | "debug",
40 | "info",
41 | "time",
42 | "timeEnd",
43 | "trace"
44 | ],
45 | "no-consecutive-blank-lines": true,
46 | "no-construct": true,
47 | "no-debugger": true,
48 | "no-duplicate-variable": true,
49 | "no-empty": true,
50 | "no-eval": true,
51 | "no-shadowed-variable": true,
52 | "no-string-literal": true,
53 | "no-switch-case-fall-through": true,
54 | "no-trailing-whitespace": false,
55 | "no-unused-expression": true,
56 | "no-use-before-declare": true,
57 | "one-line": [
58 | true,
59 | "check-catch",
60 | "check-else",
61 | "check-open-brace",
62 | "check-whitespace"
63 | ],
64 | "quotemark": [true, "single", "jsx-double"],
65 | "radix": true,
66 | "semicolon": [true, "always"],
67 | "switch-default": true,
68 |
69 | "trailing-comma": false,
70 |
71 | "triple-equals": [ true, "allow-null-check" ],
72 | "typedef": [
73 | true,
74 | "parameter",
75 | "property-declaration"
76 | ],
77 | "typedef-whitespace": [
78 | true,
79 | {
80 | "call-signature": "nospace",
81 | "index-signature": "nospace",
82 | "parameter": "nospace",
83 | "property-declaration": "nospace",
84 | "variable-declaration": "nospace"
85 | }
86 | ],
87 | "variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"],
88 | "whitespace": [
89 | true,
90 | "check-branch",
91 | "check-decl",
92 | "check-module",
93 | "check-operator",
94 | "check-separator",
95 | "check-type",
96 | "check-typecast"
97 | ]
98 | }
99 | }
100 |
--------------------------------------------------------------------------------