flexlayout-react 0.7.9 → 0.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ChangeLog.txt +6 -0
- package/README.md +10 -1
- package/dist/flexlayout.js +2 -2
- package/dist/flexlayout_min.js +1 -1
- package/lib/view/BorderTabSet.js +13 -5
- package/lib/view/BorderTabSet.js.map +1 -1
- package/lib/view/TabSet.js +10 -11
- package/lib/view/TabSet.js.map +1 -1
- package/package.json +1 -1
- package/src/view/BorderTabSet.tsx +23 -7
- package/src/view/TabSet.tsx +19 -20
package/ChangeLog.txt
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
0.7.10
|
|
2
|
+
Fix for #399 - the overflow button in a tabset is now placed after
|
|
3
|
+
any sticky buttons (additional buttons that stick to the last tab of a tabset)
|
|
4
|
+
but before any other buttons.
|
|
5
|
+
Enabled sticky buttons in border tabsets
|
|
6
|
+
|
|
1
7
|
0.7.9
|
|
2
8
|
Fix drag issue found when used in devtool extension
|
|
3
9
|
Fix double render in popout when in strict mode
|
package/README.md
CHANGED
|
@@ -58,7 +58,15 @@ import { createRoot } from "react-dom/client";
|
|
|
58
58
|
import * as FlexLayout from "flexlayout-react";
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Include the light, underline, gray or dark
|
|
61
|
+
Include the light, underline, gray or dark theme by either:
|
|
62
|
+
|
|
63
|
+
Adding an additional import:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
import 'flexlayout-react/style/light.css';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
or by adding the css to your html:
|
|
62
70
|
|
|
63
71
|
```
|
|
64
72
|
<link rel="stylesheet" href="node_modules/flexlayout-react/style/light.css" />
|
|
@@ -614,6 +622,7 @@ To build the npm distribution run 'yarn build', this will create the artifacts i
|
|
|
614
622
|
| Name | Repository |
|
|
615
623
|
| ------------- |:-------------|
|
|
616
624
|
| rc-dock | https://github.com/ticlo/rc-dock |
|
|
625
|
+
| Dockview | https://dockview.dev/ |
|
|
617
626
|
| lumino | https://github.com/jupyterlab/lumino |
|
|
618
627
|
| golden-layout | https://github.com/golden-layout/golden-layout |
|
|
619
628
|
| react-mosaic | https://github.com/nomcopter/react-mosaic |
|
package/dist/flexlayout.js
CHANGED
|
@@ -296,7 +296,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
296
296
|
\***********************************/
|
|
297
297
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
298
298
|
|
|
299
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BorderTabSet\": () => (/* binding */ BorderTabSet)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _DockLocation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DockLocation */ \"./src/DockLocation.ts\");\n/* harmony import */ var _BorderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BorderButton */ \"./src/view/BorderButton.tsx\");\n/* harmony import */ var _PopupMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../PopupMenu */ \"./src/PopupMenu.tsx\");\n/* harmony import */ var _model_Actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/Actions */ \"./src/model/Actions.ts\");\n/* harmony import */ var _I18nLabel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../I18nLabel */ \"./src/I18nLabel.ts\");\n/* harmony import */ var _TabOverflowHook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TabOverflowHook */ \"./src/view/TabOverflowHook.tsx\");\n/* harmony import */ var _Orientation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Orientation */ \"./src/Orientation.ts\");\n/* harmony import */ var _Types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Types */ \"./src/Types.ts\");\n/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Utils */ \"./src/view/Utils.tsx\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/** @internal */\r\nconst BorderTabSet = (props) => {\r\n const { border, layout, iconFactory, titleFactory, icons, path } = props;\r\n const toolbarRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const overflowbuttonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const stickyButtonsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel } = (0,_TabOverflowHook__WEBPACK_IMPORTED_MODULE_6__.useTabOverflow)(border, _Orientation__WEBPACK_IMPORTED_MODULE_7__.Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);\r\n const onAuxMouseClick = (event) => {\r\n if ((0,_Utils__WEBPACK_IMPORTED_MODULE_9__.isAuxMouseEvent)(event)) {\r\n layout.auxMouseClick(border, event);\r\n }\r\n };\r\n const onContextMenu = (event) => {\r\n layout.showContextMenu(border, event);\r\n };\r\n const onInterceptMouseDown = (event) => {\r\n event.stopPropagation();\r\n };\r\n const onOverflowClick = (event) => {\r\n const callback = layout.getShowOverflowMenu();\r\n if (callback !== undefined) {\r\n callback(border, event, hiddenTabs, onOverflowItemSelect);\r\n }\r\n else {\r\n const element = overflowbuttonRef.current;\r\n (0,_PopupMenu__WEBPACK_IMPORTED_MODULE_3__.showPopup)(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onOverflowItemSelect = (item) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_4__.Actions.selectTab(item.node.getId()));\r\n userControlledLeft.current = false;\r\n };\r\n const onFloatTab = (event) => {\r\n const selectedTabNode = border.getChildren()[border.getSelected()];\r\n if (selectedTabNode !== undefined) {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_4__.Actions.floatTab(selectedTabNode.getId()));\r\n }\r\n event.stopPropagation();\r\n };\r\n const cm = layout.getClassName;\r\n let style = border.getTabHeaderRect().styleWithPosition({});\r\n const tabs = [];\r\n const layoutTab = (i) => {\r\n let isSelected = border.getSelected() === i;\r\n let child = border.getChildren()[i];\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(_BorderButton__WEBPACK_IMPORTED_MODULE_2__.BorderButton, { layout: layout, border: border.getLocation().getName(), node: child, path: path + \"/tb\" + i, key: child.getId(), selected: isSelected, iconFactory: iconFactory, titleFactory: titleFactory, icons: icons }));\r\n if (i < border.getChildren().length - 1) {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"divider\" + i, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER) }));\r\n }\r\n };\r\n for (let i = 0; i < border.getChildren().length; i++) {\r\n layoutTab(i);\r\n }\r\n let borderClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_ + border.getLocation().getName());\r\n if (border.getClassName() !== undefined) {\r\n borderClasses += \" \" + border.getClassName();\r\n }\r\n // allow customization of tabset right/bottom buttons\r\n let buttons = [];\r\n const renderState = { headerContent: undefined, buttons, stickyButtons: [], headerButtons: [] };\r\n layout.customizeTabSet(border, renderState);\r\n buttons = renderState.buttons;\r\n let toolbar;\r\n if (hiddenTabs.length > 0) {\r\n const overflowTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_5__.I18nLabel.Overflow_Menu_Tooltip);\r\n let overflowContent;\r\n if (typeof icons.more === \"function\") {\r\n overflowContent = icons.more(border, hiddenTabs);\r\n }\r\n else {\r\n overflowContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n icons.more,\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));\r\n }\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"overflowbutton\", ref: overflowbuttonRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ + border.getLocation().getName()), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));\r\n }\r\n const selectedIndex = border.getSelected();\r\n if (selectedIndex !== -1) {\r\n const selectedTabNode = border.getChildren()[selectedIndex];\r\n if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {\r\n const floatTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_5__.I18nLabel.Float_Tab);\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"float\", title: floatTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT), onClick: onFloatTab, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.popout === \"function\") ? icons.popout(selectedTabNode) : icons.popout));\r\n }\r\n }\r\n toolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_ + border.getLocation().getName()) }, buttons));\r\n style = layout.styleFont(style);\r\n let innerStyle = {};\r\n const borderHeight = border.getBorderBarSize() - 1;\r\n if (border.getLocation() === _DockLocation__WEBPACK_IMPORTED_MODULE_1__.DockLocation.LEFT) {\r\n innerStyle = { right: borderHeight, height: borderHeight, top: position };\r\n }\r\n else if (border.getLocation() === _DockLocation__WEBPACK_IMPORTED_MODULE_1__.DockLocation.RIGHT) {\r\n innerStyle = { left: borderHeight, height: borderHeight, top: position };\r\n }\r\n else {\r\n innerStyle = { height: borderHeight, left: position };\r\n }\r\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: selfRef, dir: \"ltr\", style: style, className: borderClasses, \"data-layout-path\": path, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onContextMenu: onContextMenu, onWheel: onMouseWheel },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: { height: borderHeight }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_ + border.getLocation().getName()) },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: innerStyle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ + border.getLocation().getName()) }, tabs)),\r\n toolbar));\r\n};\r\n\n\n//# sourceURL=webpack://FlexLayout/./src/view/BorderTabSet.tsx?");
|
|
299
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"BorderTabSet\": () => (/* binding */ BorderTabSet)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _DockLocation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../DockLocation */ \"./src/DockLocation.ts\");\n/* harmony import */ var _BorderButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BorderButton */ \"./src/view/BorderButton.tsx\");\n/* harmony import */ var _PopupMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../PopupMenu */ \"./src/PopupMenu.tsx\");\n/* harmony import */ var _model_Actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../model/Actions */ \"./src/model/Actions.ts\");\n/* harmony import */ var _I18nLabel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../I18nLabel */ \"./src/I18nLabel.ts\");\n/* harmony import */ var _TabOverflowHook__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TabOverflowHook */ \"./src/view/TabOverflowHook.tsx\");\n/* harmony import */ var _Orientation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Orientation */ \"./src/Orientation.ts\");\n/* harmony import */ var _Types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Types */ \"./src/Types.ts\");\n/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Utils */ \"./src/view/Utils.tsx\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/** @internal */\r\nconst BorderTabSet = (props) => {\r\n const { border, layout, iconFactory, titleFactory, icons, path } = props;\r\n const toolbarRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const overflowbuttonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const stickyButtonsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = (0,_TabOverflowHook__WEBPACK_IMPORTED_MODULE_6__.useTabOverflow)(border, _Orientation__WEBPACK_IMPORTED_MODULE_7__.Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);\r\n const onAuxMouseClick = (event) => {\r\n if ((0,_Utils__WEBPACK_IMPORTED_MODULE_9__.isAuxMouseEvent)(event)) {\r\n layout.auxMouseClick(border, event);\r\n }\r\n };\r\n const onContextMenu = (event) => {\r\n layout.showContextMenu(border, event);\r\n };\r\n const onInterceptMouseDown = (event) => {\r\n event.stopPropagation();\r\n };\r\n const onOverflowClick = (event) => {\r\n const callback = layout.getShowOverflowMenu();\r\n if (callback !== undefined) {\r\n callback(border, event, hiddenTabs, onOverflowItemSelect);\r\n }\r\n else {\r\n const element = overflowbuttonRef.current;\r\n (0,_PopupMenu__WEBPACK_IMPORTED_MODULE_3__.showPopup)(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onOverflowItemSelect = (item) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_4__.Actions.selectTab(item.node.getId()));\r\n userControlledLeft.current = false;\r\n };\r\n const onFloatTab = (event) => {\r\n const selectedTabNode = border.getChildren()[border.getSelected()];\r\n if (selectedTabNode !== undefined) {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_4__.Actions.floatTab(selectedTabNode.getId()));\r\n }\r\n event.stopPropagation();\r\n };\r\n const cm = layout.getClassName;\r\n let style = border.getTabHeaderRect().styleWithPosition({});\r\n const tabs = [];\r\n const layoutTab = (i) => {\r\n let isSelected = border.getSelected() === i;\r\n let child = border.getChildren()[i];\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(_BorderButton__WEBPACK_IMPORTED_MODULE_2__.BorderButton, { layout: layout, border: border.getLocation().getName(), node: child, path: path + \"/tb\" + i, key: child.getId(), selected: isSelected, iconFactory: iconFactory, titleFactory: titleFactory, icons: icons }));\r\n if (i < border.getChildren().length - 1) {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"divider\" + i, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TAB_DIVIDER) }));\r\n }\r\n };\r\n for (let i = 0; i < border.getChildren().length; i++) {\r\n layoutTab(i);\r\n }\r\n let borderClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_ + border.getLocation().getName());\r\n if (border.getClassName() !== undefined) {\r\n borderClasses += \" \" + border.getClassName();\r\n }\r\n // allow customization of tabset right/bottom buttons\r\n let buttons = [];\r\n let stickyButtons = [];\r\n const renderState = { headerContent: undefined, buttons, stickyButtons: stickyButtons, headerButtons: [] };\r\n layout.customizeTabSet(border, renderState);\r\n buttons = renderState.buttons;\r\n if (hiddenTabs.length > 0) {\r\n const overflowTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_5__.I18nLabel.Overflow_Menu_Tooltip);\r\n let overflowContent;\r\n if (typeof icons.more === \"function\") {\r\n overflowContent = icons.more(border, hiddenTabs);\r\n }\r\n else {\r\n overflowContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n icons.more,\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));\r\n }\r\n buttons.unshift(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"overflowbutton\", ref: overflowbuttonRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ + border.getLocation().getName()), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));\r\n }\r\n if (stickyButtons.length > 0) {\r\n if (tabsTruncated) {\r\n buttons = [...stickyButtons, ...buttons];\r\n }\r\n else {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: stickyButtonsRef, key: \"sticky_buttons_container\", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));\r\n }\r\n }\r\n const selectedIndex = border.getSelected();\r\n if (selectedIndex !== -1) {\r\n const selectedTabNode = border.getChildren()[selectedIndex];\r\n if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {\r\n const floatTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_5__.I18nLabel.Float_Tab);\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"float\", title: floatTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT), onClick: onFloatTab, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.popout === \"function\") ? icons.popout(selectedTabNode) : icons.popout));\r\n }\r\n }\r\n const toolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_ + border.getLocation().getName()) }, buttons));\r\n style = layout.styleFont(style);\r\n let innerStyle = {};\r\n const borderHeight = border.getBorderBarSize() - 1;\r\n if (border.getLocation() === _DockLocation__WEBPACK_IMPORTED_MODULE_1__.DockLocation.LEFT) {\r\n innerStyle = { right: borderHeight, height: borderHeight, top: position };\r\n }\r\n else if (border.getLocation() === _DockLocation__WEBPACK_IMPORTED_MODULE_1__.DockLocation.RIGHT) {\r\n innerStyle = { left: borderHeight, height: borderHeight, top: position };\r\n }\r\n else {\r\n innerStyle = { height: borderHeight, left: position };\r\n }\r\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: selfRef, dir: \"ltr\", style: style, className: borderClasses, \"data-layout-path\": path, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onContextMenu: onContextMenu, onWheel: onMouseWheel },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: { height: borderHeight }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_ + border.getLocation().getName()) },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: innerStyle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_8__.CLASSES.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_ + border.getLocation().getName()) }, tabs)),\r\n toolbar));\r\n};\r\n\n\n//# sourceURL=webpack://FlexLayout/./src/view/BorderTabSet.tsx?");
|
|
300
300
|
|
|
301
301
|
/***/ }),
|
|
302
302
|
|
|
@@ -416,7 +416,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
416
416
|
\*****************************/
|
|
417
417
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
418
418
|
|
|
419
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TabSet\": () => (/* binding */ TabSet)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _I18nLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../I18nLabel */ \"./src/I18nLabel.ts\");\n/* harmony import */ var _model_Actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/Actions */ \"./src/model/Actions.ts\");\n/* harmony import */ var _PopupMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../PopupMenu */ \"./src/PopupMenu.tsx\");\n/* harmony import */ var _TabButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TabButton */ \"./src/view/TabButton.tsx\");\n/* harmony import */ var _TabOverflowHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TabOverflowHook */ \"./src/view/TabOverflowHook.tsx\");\n/* harmony import */ var _Orientation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Orientation */ \"./src/Orientation.ts\");\n/* harmony import */ var _Types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Types */ \"./src/Types.ts\");\n/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Utils */ \"./src/view/Utils.tsx\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/** @internal */\r\nconst TabSet = (props) => {\r\n const { node, layout, iconFactory, titleFactory, icons, path } = props;\r\n const toolbarRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const overflowbuttonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const tabbarInnerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const stickyButtonsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = (0,_TabOverflowHook__WEBPACK_IMPORTED_MODULE_5__.useTabOverflow)(node, _Orientation__WEBPACK_IMPORTED_MODULE_6__.Orientation.HORZ, toolbarRef, stickyButtonsRef);\r\n const onOverflowClick = (event) => {\r\n const callback = layout.getShowOverflowMenu();\r\n if (callback !== undefined) {\r\n callback(node, event, hiddenTabs, onOverflowItemSelect);\r\n }\r\n else {\r\n const element = overflowbuttonRef.current;\r\n (0,_PopupMenu__WEBPACK_IMPORTED_MODULE_3__.showPopup)(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onOverflowItemSelect = (item) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.selectTab(item.node.getId()));\r\n userControlledLeft.current = false;\r\n };\r\n const onMouseDown = (event) => {\r\n if (!(0,_Utils__WEBPACK_IMPORTED_MODULE_8__.isAuxMouseEvent)(event)) {\r\n let name = node.getName();\r\n if (name === undefined) {\r\n name = \"\";\r\n }\r\n else {\r\n name = \": \" + name;\r\n }\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.setActiveTabset(node.getId()));\r\n if (!layout.getEditingTab()) {\r\n const message = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Move_Tabset, name);\r\n if (node.getModel().getMaximizedTabset() !== undefined) {\r\n layout.dragStart(event, message, node, false, (event2) => undefined, onDoubleClick);\r\n }\r\n else {\r\n layout.dragStart(event, message, node, node.isEnableDrag(), (event2) => undefined, onDoubleClick);\r\n }\r\n }\r\n }\r\n };\r\n const onAuxMouseClick = (event) => {\r\n if ((0,_Utils__WEBPACK_IMPORTED_MODULE_8__.isAuxMouseEvent)(event)) {\r\n layout.auxMouseClick(node, event);\r\n }\r\n };\r\n const onContextMenu = (event) => {\r\n layout.showContextMenu(node, event);\r\n };\r\n const onInterceptMouseDown = (event) => {\r\n event.stopPropagation();\r\n };\r\n const onMaximizeToggle = (event) => {\r\n if (node.canMaximize()) {\r\n layout.maximize(node);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onClose = (event) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.deleteTabset(node.getId()));\r\n event.stopPropagation();\r\n };\r\n const onFloatTab = (event) => {\r\n if (selectedTabNode !== undefined) {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.floatTab(selectedTabNode.getId()));\r\n }\r\n event.stopPropagation();\r\n };\r\n const onDoubleClick = (event) => {\r\n if (node.canMaximize()) {\r\n layout.maximize(node);\r\n }\r\n };\r\n // Start Render\r\n const cm = layout.getClassName;\r\n // tabbar inner can get shifted left via tab rename, this resets scrollleft to 0\r\n if (tabbarInnerRef.current !== null && tabbarInnerRef.current.scrollLeft !== 0) {\r\n tabbarInnerRef.current.scrollLeft = 0;\r\n }\r\n const selectedTabNode = node.getSelectedNode();\r\n let style = node._styleWithPosition();\r\n if (node.getModel().getMaximizedTabset() !== undefined && !node.isMaximized()) {\r\n (0,_Utils__WEBPACK_IMPORTED_MODULE_8__.hideElement)(style, node.getModel().isUseVisibility());\r\n }\r\n const tabs = [];\r\n if (node.isEnableTabStrip()) {\r\n for (let i = 0; i < node.getChildren().length; i++) {\r\n const child = node.getChildren()[i];\r\n let isSelected = node.getSelected() === i;\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(_TabButton__WEBPACK_IMPORTED_MODULE_4__.TabButton, { layout: layout, node: child, path: path + \"/tb\" + i, key: child.getId(), selected: isSelected, iconFactory: iconFactory, titleFactory: titleFactory, icons: icons }));\r\n if (i < node.getChildren().length - 1) {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"divider\" + i, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER) }));\r\n }\r\n }\r\n }\r\n const showHeader = node.getName() !== undefined;\r\n let stickyButtons = [];\r\n let buttons = [];\r\n let headerButtons = [];\r\n // allow customization of header contents and buttons\r\n const renderState = { headerContent: node.getName(), stickyButtons, buttons, headerButtons };\r\n layout.customizeTabSet(node, renderState);\r\n const headerContent = renderState.headerContent;\r\n stickyButtons = renderState.stickyButtons;\r\n buttons = renderState.buttons;\r\n headerButtons = renderState.headerButtons;\r\n if (stickyButtons.length > 0) {\r\n if (tabsTruncated) {\r\n buttons = [...stickyButtons, ...buttons];\r\n }\r\n else {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: stickyButtonsRef, key: \"sticky_buttons_container\", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));\r\n }\r\n }\r\n let toolbar;\r\n if (hiddenTabs.length > 0) {\r\n const overflowTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Overflow_Menu_Tooltip);\r\n let overflowContent;\r\n if (typeof icons.more === \"function\") {\r\n overflowContent = icons.more(node, hiddenTabs);\r\n }\r\n else {\r\n overflowContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n icons.more,\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));\r\n }\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"overflowbutton\", \"data-layout-path\": path + \"/button/overflow\", ref: overflowbuttonRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));\r\n }\r\n if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {\r\n const floatTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Float_Tab);\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"float\", \"data-layout-path\": path + \"/button/float\", title: floatTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT), onClick: onFloatTab, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.popout === \"function\") ? icons.popout(selectedTabNode) : icons.popout));\r\n }\r\n if (node.canMaximize()) {\r\n const minTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Restore);\r\n const maxTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Maximize);\r\n const btns = showHeader ? headerButtons : buttons;\r\n btns.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"max\", \"data-layout-path\": path + \"/button/max\", title: node.isMaximized() ? minTitle : maxTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ + (node.isMaximized() ? \"max\" : \"min\")), onClick: onMaximizeToggle, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, node.isMaximized() ?\r\n (typeof icons.restore === \"function\") ? icons.restore(node) : icons.restore :\r\n (typeof icons.maximize === \"function\") ? icons.maximize(node) : icons.maximize));\r\n }\r\n if (!node.isMaximized() && node.isEnableClose()) {\r\n const title = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Close_Tabset);\r\n const btns = showHeader ? headerButtons : buttons;\r\n btns.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"close\", \"data-layout-path\": path + \"/button/close\", title: title, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE), onClick: onClose, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.closeTabset === \"function\") ? icons.closeTabset(node) : icons.closeTabset));\r\n }\r\n toolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, buttons));\r\n let header;\r\n let tabStrip;\r\n let tabStripClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);\r\n if (node.getClassNameTabStrip() !== undefined) {\r\n tabStripClasses += \" \" + node.getClassNameTabStrip();\r\n }\r\n tabStripClasses += \" \" + _Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_ + node.getTabLocation();\r\n if (node.isActive() && !showHeader) {\r\n tabStripClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_SELECTED);\r\n }\r\n if (node.isMaximized() && !showHeader) {\r\n tabStripClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED);\r\n }\r\n if (showHeader) {\r\n const headerToolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, headerButtons));\r\n let tabHeaderClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_HEADER);\r\n if (node.isActive()) {\r\n tabHeaderClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_SELECTED);\r\n }\r\n if (node.isMaximized()) {\r\n tabHeaderClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED);\r\n }\r\n if (node.getClassNameHeader() !== undefined) {\r\n tabHeaderClasses += \" \" + node.getClassNameHeader();\r\n }\r\n header = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: tabHeaderClasses, style: { height: node.getHeaderHeight() + \"px\" }, \"data-layout-path\": path + \"/header\", onMouseDown: onMouseDown, onContextMenu: onContextMenu, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onTouchStart: onMouseDown },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT) }, headerContent),\r\n headerToolbar));\r\n }\r\n const tabStripStyle = { height: node.getTabStripHeight() + \"px\" };\r\n tabStrip = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: tabStripClasses, style: tabStripStyle, \"data-layout-path\": path + \"/tabstrip\", onMouseDown: onMouseDown, onContextMenu: onContextMenu, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onTouchStart: onMouseDown },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: tabbarInnerRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_ + node.getTabLocation()) },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: { left: position }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ + node.getTabLocation()) }, tabs)),\r\n toolbar));\r\n style = layout.styleFont(style);\r\n var placeHolder = undefined;\r\n if (node.getChildren().length === 0) {\r\n const placeHolderCallback = layout.getTabSetPlaceHolderCallback();\r\n if (placeHolderCallback) {\r\n placeHolder = placeHolderCallback(node);\r\n }\r\n }\r\n const center = react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_CONTENT) }, placeHolder);\r\n var content;\r\n if (node.getTabLocation() === \"top\") {\r\n content = react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n header,\r\n tabStrip,\r\n center);\r\n }\r\n else {\r\n content = react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n header,\r\n center,\r\n tabStrip);\r\n }\r\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: selfRef, dir: \"ltr\", \"data-layout-path\": path, style: style, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET), onWheel: onMouseWheel }, content));\r\n};\r\n\n\n//# sourceURL=webpack://FlexLayout/./src/view/TabSet.tsx?");
|
|
419
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TabSet\": () => (/* binding */ TabSet)\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _I18nLabel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../I18nLabel */ \"./src/I18nLabel.ts\");\n/* harmony import */ var _model_Actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model/Actions */ \"./src/model/Actions.ts\");\n/* harmony import */ var _PopupMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../PopupMenu */ \"./src/PopupMenu.tsx\");\n/* harmony import */ var _TabButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TabButton */ \"./src/view/TabButton.tsx\");\n/* harmony import */ var _TabOverflowHook__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TabOverflowHook */ \"./src/view/TabOverflowHook.tsx\");\n/* harmony import */ var _Orientation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Orientation */ \"./src/Orientation.ts\");\n/* harmony import */ var _Types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Types */ \"./src/Types.ts\");\n/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Utils */ \"./src/view/Utils.tsx\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/** @internal */\r\nconst TabSet = (props) => {\r\n const { node, layout, iconFactory, titleFactory, icons, path } = props;\r\n const toolbarRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const overflowbuttonRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const tabbarInnerRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const stickyButtonsRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null);\r\n const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = (0,_TabOverflowHook__WEBPACK_IMPORTED_MODULE_5__.useTabOverflow)(node, _Orientation__WEBPACK_IMPORTED_MODULE_6__.Orientation.HORZ, toolbarRef, stickyButtonsRef);\r\n const onOverflowClick = (event) => {\r\n const callback = layout.getShowOverflowMenu();\r\n if (callback !== undefined) {\r\n callback(node, event, hiddenTabs, onOverflowItemSelect);\r\n }\r\n else {\r\n const element = overflowbuttonRef.current;\r\n (0,_PopupMenu__WEBPACK_IMPORTED_MODULE_3__.showPopup)(element, hiddenTabs, onOverflowItemSelect, layout, iconFactory, titleFactory);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onOverflowItemSelect = (item) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.selectTab(item.node.getId()));\r\n userControlledLeft.current = false;\r\n };\r\n const onMouseDown = (event) => {\r\n if (!(0,_Utils__WEBPACK_IMPORTED_MODULE_8__.isAuxMouseEvent)(event)) {\r\n let name = node.getName();\r\n if (name === undefined) {\r\n name = \"\";\r\n }\r\n else {\r\n name = \": \" + name;\r\n }\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.setActiveTabset(node.getId()));\r\n if (!layout.getEditingTab()) {\r\n const message = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Move_Tabset, name);\r\n if (node.getModel().getMaximizedTabset() !== undefined) {\r\n layout.dragStart(event, message, node, false, (event2) => undefined, onDoubleClick);\r\n }\r\n else {\r\n layout.dragStart(event, message, node, node.isEnableDrag(), (event2) => undefined, onDoubleClick);\r\n }\r\n }\r\n }\r\n };\r\n const onAuxMouseClick = (event) => {\r\n if ((0,_Utils__WEBPACK_IMPORTED_MODULE_8__.isAuxMouseEvent)(event)) {\r\n layout.auxMouseClick(node, event);\r\n }\r\n };\r\n const onContextMenu = (event) => {\r\n layout.showContextMenu(node, event);\r\n };\r\n const onInterceptMouseDown = (event) => {\r\n event.stopPropagation();\r\n };\r\n const onMaximizeToggle = (event) => {\r\n if (node.canMaximize()) {\r\n layout.maximize(node);\r\n }\r\n event.stopPropagation();\r\n };\r\n const onClose = (event) => {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.deleteTabset(node.getId()));\r\n event.stopPropagation();\r\n };\r\n const onFloatTab = (event) => {\r\n if (selectedTabNode !== undefined) {\r\n layout.doAction(_model_Actions__WEBPACK_IMPORTED_MODULE_2__.Actions.floatTab(selectedTabNode.getId()));\r\n }\r\n event.stopPropagation();\r\n };\r\n const onDoubleClick = (event) => {\r\n if (node.canMaximize()) {\r\n layout.maximize(node);\r\n }\r\n };\r\n // Start Render\r\n const cm = layout.getClassName;\r\n // tabbar inner can get shifted left via tab rename, this resets scrollleft to 0\r\n if (tabbarInnerRef.current !== null && tabbarInnerRef.current.scrollLeft !== 0) {\r\n tabbarInnerRef.current.scrollLeft = 0;\r\n }\r\n const selectedTabNode = node.getSelectedNode();\r\n let style = node._styleWithPosition();\r\n if (node.getModel().getMaximizedTabset() !== undefined && !node.isMaximized()) {\r\n (0,_Utils__WEBPACK_IMPORTED_MODULE_8__.hideElement)(style, node.getModel().isUseVisibility());\r\n }\r\n const tabs = [];\r\n if (node.isEnableTabStrip()) {\r\n for (let i = 0; i < node.getChildren().length; i++) {\r\n const child = node.getChildren()[i];\r\n let isSelected = node.getSelected() === i;\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(_TabButton__WEBPACK_IMPORTED_MODULE_4__.TabButton, { layout: layout, node: child, path: path + \"/tb\" + i, key: child.getId(), selected: isSelected, iconFactory: iconFactory, titleFactory: titleFactory, icons: icons }));\r\n if (i < node.getChildren().length - 1) {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"divider\" + i, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TAB_DIVIDER) }));\r\n }\r\n }\r\n }\r\n const showHeader = node.getName() !== undefined;\r\n let stickyButtons = [];\r\n let buttons = [];\r\n let headerButtons = [];\r\n // allow customization of header contents and buttons\r\n const renderState = { headerContent: node.getName(), stickyButtons, buttons, headerButtons };\r\n layout.customizeTabSet(node, renderState);\r\n const headerContent = renderState.headerContent;\r\n stickyButtons = renderState.stickyButtons;\r\n buttons = renderState.buttons;\r\n headerButtons = renderState.headerButtons;\r\n if (hiddenTabs.length > 0) {\r\n const overflowTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Overflow_Menu_Tooltip);\r\n let overflowContent;\r\n if (typeof icons.more === \"function\") {\r\n overflowContent = icons.more(node, hiddenTabs);\r\n }\r\n else {\r\n overflowContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n icons.more,\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));\r\n }\r\n buttons.unshift(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"overflowbutton\", \"data-layout-path\": path + \"/button/overflow\", ref: overflowbuttonRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));\r\n }\r\n if (stickyButtons.length > 0) {\r\n if (tabsTruncated) {\r\n buttons = [...stickyButtons, ...buttons];\r\n }\r\n else {\r\n tabs.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: stickyButtonsRef, key: \"sticky_buttons_container\", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));\r\n }\r\n }\r\n if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {\r\n const floatTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Float_Tab);\r\n buttons.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"float\", \"data-layout-path\": path + \"/button/float\", title: floatTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT), onClick: onFloatTab, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.popout === \"function\") ? icons.popout(selectedTabNode) : icons.popout));\r\n }\r\n if (node.canMaximize()) {\r\n const minTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Restore);\r\n const maxTitle = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Maximize);\r\n const btns = showHeader ? headerButtons : buttons;\r\n btns.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"max\", \"data-layout-path\": path + \"/button/max\", title: node.isMaximized() ? minTitle : maxTitle, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_ + (node.isMaximized() ? \"max\" : \"min\")), onClick: onMaximizeToggle, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, node.isMaximized() ?\r\n (typeof icons.restore === \"function\") ? icons.restore(node) : icons.restore :\r\n (typeof icons.maximize === \"function\") ? icons.maximize(node) : icons.maximize));\r\n }\r\n if (!node.isMaximized() && node.isEnableClose()) {\r\n const title = layout.i18nName(_I18nLabel__WEBPACK_IMPORTED_MODULE_1__.I18nLabel.Close_Tabset);\r\n const btns = showHeader ? headerButtons : buttons;\r\n btns.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"button\", { key: \"close\", \"data-layout-path\": path + \"/button/close\", title: title, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE), onClick: onClose, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.closeTabset === \"function\") ? icons.closeTabset(node) : icons.closeTabset));\r\n }\r\n const toolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, buttons));\r\n let header;\r\n let tabStrip;\r\n let tabStripClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);\r\n if (node.getClassNameTabStrip() !== undefined) {\r\n tabStripClasses += \" \" + node.getClassNameTabStrip();\r\n }\r\n tabStripClasses += \" \" + _Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER_ + node.getTabLocation();\r\n if (node.isActive() && !showHeader) {\r\n tabStripClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_SELECTED);\r\n }\r\n if (node.isMaximized() && !showHeader) {\r\n tabStripClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED);\r\n }\r\n if (showHeader) {\r\n const headerToolbar = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { key: \"toolbar\", ref: toolbarRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, headerButtons));\r\n let tabHeaderClasses = cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_HEADER);\r\n if (node.isActive()) {\r\n tabHeaderClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_SELECTED);\r\n }\r\n if (node.isMaximized()) {\r\n tabHeaderClasses += \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_MAXIMIZED);\r\n }\r\n if (node.getClassNameHeader() !== undefined) {\r\n tabHeaderClasses += \" \" + node.getClassNameHeader();\r\n }\r\n header = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: tabHeaderClasses, style: { height: node.getHeaderHeight() + \"px\" }, \"data-layout-path\": path + \"/header\", onMouseDown: onMouseDown, onContextMenu: onContextMenu, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onTouchStart: onMouseDown },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_HEADER_CONTENT) }, headerContent),\r\n headerToolbar));\r\n }\r\n const tabStripStyle = { height: node.getTabStripHeight() + \"px\" };\r\n tabStrip = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: tabStripClasses, style: tabStripStyle, \"data-layout-path\": path + \"/tabstrip\", onMouseDown: onMouseDown, onContextMenu: onContextMenu, onClick: onAuxMouseClick, onAuxClick: onAuxMouseClick, onTouchStart: onMouseDown },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: tabbarInnerRef, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_ + node.getTabLocation()) },\r\n react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { style: { left: position }, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER) + \" \" + cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_ + node.getTabLocation()) }, tabs)),\r\n toolbar));\r\n style = layout.styleFont(style);\r\n var placeHolder = undefined;\r\n if (node.getChildren().length === 0) {\r\n const placeHolderCallback = layout.getTabSetPlaceHolderCallback();\r\n if (placeHolderCallback) {\r\n placeHolder = placeHolderCallback(node);\r\n }\r\n }\r\n const center = react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET_CONTENT) }, placeHolder);\r\n var content;\r\n if (node.getTabLocation() === \"top\") {\r\n content = react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n header,\r\n tabStrip,\r\n center);\r\n }\r\n else {\r\n content = react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,\r\n header,\r\n center,\r\n tabStrip);\r\n }\r\n return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", { ref: selfRef, dir: \"ltr\", \"data-layout-path\": path, style: style, className: cm(_Types__WEBPACK_IMPORTED_MODULE_7__.CLASSES.FLEXLAYOUT__TABSET), onWheel: onMouseWheel }, content));\r\n};\r\n\n\n//# sourceURL=webpack://FlexLayout/./src/view/TabSet.tsx?");
|
|
420
420
|
|
|
421
421
|
/***/ }),
|
|
422
422
|
|
package/dist/flexlayout_min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.FlexLayout=e(require("react"),require("react-dom")):t.FlexLayout=e(t.React,t.ReactDOM)}(self,((t,e)=>(()=>{"use strict";var i={899:e=>{e.exports=t},994:t=>{t.exports=e}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var o=s[t]={exports:{}};return i[t](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Action:()=>l,Actions:()=>h,BorderNode:()=>R,BorderSet:()=>Z,CLASSES:()=>g,DockLocation:()=>r,DragDrop:()=>d,DropInfo:()=>u,I18nLabel:()=>T,ICloseType:()=>p,Layout:()=>V,Model:()=>j,Node:()=>E,Orientation:()=>i,Rect:()=>s,RowNode:()=>f,SplitterNode:()=>m,TabNode:()=>b,TabSetNode:()=>v});var t=n(899),e=n(994);class i{static flip(t){return t===i.HORZ?i.VERT:i.HORZ}constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}}i.HORZ=new i("horz"),i.VERT=new i("vert");class s{static empty(){return new s(0,0,0,0)}constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}static fromElement(t){let{x:e,y:i,width:n,height:o}=t.getBoundingClientRect();return new s(e,i,n,o)}clone(){return new s(this.x,this.y,this.width,this.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,e){this.styleWithPosition(t.style,e)}styleWithPosition(t,e="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t}contains(t,e){return this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom()}removeInsets(t){return new s(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let e=this.width;return t===i.VERT&&(e=this.height),e}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}class r{static getByName(t){return r.values[t]}static getLocation(t,e,i){if(e=(e-t.x)/t.width,i=(i-t.y)/t.height,e>=.25&&e<.75&&i>=.25&&i<.75)return r.CENTER;const s=i>=1-e;return i>=e?s?r.BOTTOM:r.LEFT:s?r.RIGHT:r.TOP}constructor(t,e,i){this._name=t,this._orientation=e,this._indexPlus=i,r.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(t){return this===r.TOP?new s(t.x,t.y,t.width,t.height/2):this===r.BOTTOM?new s(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===r.LEFT?new s(t.x,t.y,t.width/2,t.height):this===r.RIGHT?new s(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,e){return this===r.TOP?{start:new s(t.x,t.y,t.width,e),end:new s(t.x,t.y+e,t.width,t.height-e)}:this===r.LEFT?{start:new s(t.x,t.y,e,t.height),end:new s(t.x+e,t.y,t.width-e,t.height)}:this===r.RIGHT?{start:new s(t.getRight()-e,t.y,e,t.height),end:new s(t.x,t.y,t.width-e,t.height)}:{start:new s(t.x,t.getBottom()-e,t.width,e),end:new s(t.x,t.y,t.width,t.height-e)}}reflect(){return this===r.TOP?r.BOTTOM:this===r.LEFT?r.RIGHT:this===r.RIGHT?r.LEFT:r.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}r.values={},r.TOP=new r("top",i.VERT,0),r.BOTTOM=new r("bottom",i.VERT,1),r.LEFT=new r("left",i.HORZ,0),r.RIGHT=new r("right",i.HORZ,1),r.CENTER=new r("center",i.VERT,0);const a=!("undefined"==typeof window||!window.document||!window.document.createElement);class d{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,a&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(t){var e;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),null===(e=this._document.defaultView)||void 0===e||e.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)}resizeGlass(){s.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),null===(t=this._document.defaultView)||void 0===t||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var t;this._glass.style.cursor=null!==(t=this._glassCursorOverride)&&void 0!==t?t:this._defaultGlassCursor}_setDefaultGlassCursor(t){this._defaultGlassCursor=t,this._updateGlassCursor()}setGlassCursorOverride(t){this._glassCursorOverride=t,this._updateGlassCursor()}startDrag(t,e,i,s,n,o,r,a,d){if(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500)return;if(this._dragging)return;this._lastEvent=t,this._document=a||window.document,this._rootElement=d||this._document.body;const l=this._getLocationEvent(t);this.addGlass(n),t?(this._startX=l.clientX,this._startY=l.clientY,window.matchMedia&&!window.matchMedia("(pointer: fine)").matches||this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=e,this._fDragMove=i,this._fDragEnd=s,this._fDragCancel=n,this._fClick=o,this._fDblClick=r,this._active=!0,"dragenter"===(null==t?void 0:t.type)?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(t){27===t.keyCode&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),void 0!==this._fDragCancel&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(t){let e=t;return t&&t.touches&&(e=t.touches[0]),e}_getLocationEventEnd(t){let e=t;return t.changedTouches&&(e=t.changedTouches[0]),e}_stopPropagation(t){t.stopPropagation&&t.stopPropagation()}_preventDefault(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t}_onMouseMove(t){this._lastEvent=t;const e=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-e.clientX)>5||Math.abs(this._startY-e.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(e),!1}_onMouseUp(t){this._lastEvent=t;const e=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-e.clientX)<=5&&Math.abs(this._startY-e.clientY)<=5){let i=!1;const s=(new Date).getTime();Math.abs(this._clickX-e.clientX)<=5&&Math.abs(this._clickY-e.clientY)<=5&&s-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),i=!0),!i&&this._fClick&&this._fClick(t),this._lastClick=s,this._clickX=e.clientX,this._clickY=e.clientY}return!1}_onDragEnter(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1}_onDragLeave(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}d.instance=new d;class l{constructor(t,e){this.type=t,this.data=e}}class h{static addNode(t,e,i,s,n){return new l(h.ADD_NODE,{json:t,toNode:e,location:i.getName(),index:s,select:n})}static moveNode(t,e,i,s,n){return new l(h.MOVE_NODE,{fromNode:t,toNode:e,location:i.getName(),index:s,select:n})}static deleteTab(t){return new l(h.DELETE_TAB,{node:t})}static deleteTabset(t){return new l(h.DELETE_TABSET,{node:t})}static renameTab(t,e){return new l(h.RENAME_TAB,{node:t,text:e})}static selectTab(t){return new l(h.SELECT_TAB,{tabNode:t})}static setActiveTabset(t){return new l(h.SET_ACTIVE_TABSET,{tabsetNode:t})}static adjustSplit(t){const e=t.node1Id,i=t.node2Id;return new l(h.ADJUST_SPLIT,{node1:e,weight1:t.weight1,pixelWidth1:t.pixelWidth1,node2:i,weight2:t.weight2,pixelWidth2:t.pixelWidth2})}static adjustBorderSplit(t,e){return new l(h.ADJUST_BORDER_SPLIT,{node:t,pos:e})}static maximizeToggle(t){return new l(h.MAXIMIZE_TOGGLE,{node:t})}static updateModelAttributes(t){return new l(h.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,e){return new l(h.UPDATE_NODE_ATTRIBUTES,{node:t,json:e})}static floatTab(t){return new l(h.FLOAT_TAB,{node:t})}static unFloatTab(t){return new l(h.UNFLOAT_TAB,{node:t})}}h.ADD_NODE="FlexLayout_AddNode",h.MOVE_NODE="FlexLayout_MoveNode",h.DELETE_TAB="FlexLayout_DeleteTab",h.DELETE_TABSET="FlexLayout_DeleteTabset",h.RENAME_TAB="FlexLayout_RenameTab",h.SELECT_TAB="FlexLayout_SelectTab",h.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",h.ADJUST_SPLIT="FlexLayout_AdjustSplit",h.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",h.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",h.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",h.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",h.FLOAT_TAB="FlexLayout_FloatTab",h.UNFLOAT_TAB="FlexLayout_UnFloatTab";class _{constructor(t,e,i,s){this.name=t,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=s,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}_.NUMBER="number",_.STRING="string",_.BOOLEAN="boolean";class c{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(t,e,i,s){const n=new _(t,e,i,s);return this.attributes.push(n),this.nameToAttribute[t]=n,n}addInherited(t,e){return this.addWithAll(t,e,void 0,!1)}add(t,e,i){return this.addWithAll(t,void 0,e,i)}getAttributes(){return this.attributes}getModelName(t){const e=this.nameToAttribute[t];if(void 0!==e)return e.modelName}toJson(t,e){for(const i of this.attributes){const s=e[i.name];(i.alwaysWriteJson||s!==i.defaultValue)&&(t[i.name]=s)}}fromJson(t,e){for(const i of this.attributes){const s=t[i.name];e[i.name]=void 0===s?i.defaultValue:s}}update(t,e){for(const i of this.attributes)if(t.hasOwnProperty(i.name)){const s=t[i.name];void 0===s?delete e[i.name]:e[i.name]=s}}setDefaults(t){for(const e of this.attributes)t[e.name]=e.defaultValue}toTypescriptInterface(t,e){const i=[],s=this.attributes.sort(((t,e)=>t.name.localeCompare(e.name)));i.push("export interface I"+t+"Attributes {");for(let t=0;t<s.length;t++){const n=s[t];let o,r,a=n.type,d=n;void 0!==d.defaultValue?o=d.defaultValue:void 0!==d.modelName&&void 0!==e&&void 0!==e.nameToAttribute[d.modelName]&&(r=d.modelName,d=e.nameToAttribute[d.modelName],o=d.defaultValue,a=d.type);let l=JSON.stringify(o);const h=d.required||d.fixed?"":"?";if(n.fixed)i.push("\t"+n.name+": "+l+";");else{const t=(void 0!==o?"default: "+l:"")+(void 0!==r?" - inherited from global "+r:"");i.push("\t"+n.name+h+": "+a+";"+(t.length>0?" // "+t:""))}}return i.push("}"),i.join("\n")}}class u{constructor(t,e,i,s,n){this.node=t,this.rect=e,this.location=i,this.index=s,this.className=n}}var g,T,p;!function(t){t.FLEXLAYOUT__BORDER="flexlayout__border",t.FLEXLAYOUT__BORDER_="flexlayout__border_",t.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",t.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",t.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",t.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",t.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",t.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",t.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",t.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",t.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",t.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",t.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",t.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",t.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",t.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",t.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",t.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",t.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",t.FLEXLAYOUT__LAYOUT="flexlayout__layout",t.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",t.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",t.FLEXLAYOUT__SPLITTER="flexlayout__splitter",t.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",t.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",t.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",t.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",t.FLEXLAYOUT__TAB="flexlayout__tab",t.FLEXLAYOUT__TABSET="flexlayout__tabset",t.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",t.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",t.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",t.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",t.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",t.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",t.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",t.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",t.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",t.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",t.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",t.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",t.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",t.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",t.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",t.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",t.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",t.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",t.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",t.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",t.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",t.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",t.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",t.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",t.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",t.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",t.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(g||(g={}));class E{constructor(t){this._dirty=!1,this._tempSize=0,this._model=t,this._attributes={},this._children=[],this._fixed=!1,this._rect=s.empty(),this._visible=!1,this._listeners={}}getId(){let t=this._attributes.id;return void 0!==t||(t=this._model._nextUniqueId(),this._setId(t)),t}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return void 0===this._parent?this._model.isRootOrientationVertical()?i.VERT:i.HORZ:i.flip(this._parent.getOrientation())}setEventListener(t,e){this._listeners[t]=e}removeEventListener(t){delete this._listeners[t]}_setId(t){this._attributes.id=t}_fireEvent(t,e){void 0!==this._listeners[t]&&this._listeners[t](e)}_getAttr(t){let e=this._attributes[t];if(void 0===e){const i=this._getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this._model._getAttribute(i))}return e}_forEachNode(t,e){t(this,e),e++;for(const i of this._children)i._forEachNode(t,e)}_setVisible(t){t!==this._visible&&(this._fireEvent("visibility",{visible:t}),this._visible=t)}_getDrawChildren(){return this._children}_setParent(t){this._parent=t}_setRect(t){this._rect=t}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}_isFixed(){return this._fixed}_layout(t,e){this._rect=t}_findDropTargetNode(t,e,i){let s;if(this._rect.contains(e,i))if(void 0!==this._model.getMaximizedTabset())s=this._model.getMaximizedTabset().canDrop(t,e,i);else if(s=this.canDrop(t,e,i),void 0===s&&0!==this._children.length)for(const n of this._children)if(s=n._findDropTargetNode(t,e,i),void 0!==s)break;return s}canDrop(t,e,i){}_canDockInto(t,e){if(null!=e){if(e.location===r.CENTER&&!1===e.node.isEnableDrop())return!1;if(e.location===r.CENTER&&"tabset"===t.getType()&&void 0!==t.getName())return!1;if(e.location!==r.CENTER&&!1===e.node.isEnableDivide())return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(t,e)}return!0}_removeChild(t){const e=this._children.indexOf(t);return-1!==e&&this._children.splice(e,1),this._dirty=!0,e}_addChild(t,e){return null!=e?this._children.splice(e,0,t):(this._children.push(t),e=this._children.length-1),t._parent=this,this._dirty=!0,e}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(t){return null==t&&(t={}),this._rect.styleWithPosition(t)}_getTempSize(){return this._tempSize}_setTempSize(t){this._tempSize=t}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0,"\t")}}class m extends E{constructor(t){super(t),this._fixed=!0,this._attributes.type=m.TYPE,t._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===i.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===i.HORZ?this._model.getSplitterSize():0}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(t){}_getPrefSize(t){return this._model.getSplitterSize()}_updateAttrs(t){}_getAttributeDefinitions(){return new c}toJson(){}}m.TYPE="splitter";class b extends E{static _fromJson(t,e,i=!0){return new b(e,t,i)}static _createAttributeDefinitions(){const t=new c;return t.add("type",b.TYPE,!0).setType(_.STRING),t.add("id",void 0).setType(_.STRING),t.add("name","[Unnamed Tab]").setType(_.STRING),t.add("altName",void 0).setType(_.STRING),t.add("helpText",void 0).setType(_.STRING),t.add("component",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.add("floating",!1).setType(_.BOOLEAN),t.addInherited("enableClose","tabEnableClose").setType(_.BOOLEAN),t.addInherited("closeType","tabCloseType").setType("ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(_.BOOLEAN),t.addInherited("enableRename","tabEnableRename").setType(_.BOOLEAN),t.addInherited("className","tabClassName").setType(_.STRING),t.addInherited("icon","tabIcon").setType(_.STRING),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(_.BOOLEAN),t.addInherited("enableFloat","tabEnableFloat").setType(_.BOOLEAN),t.addInherited("borderWidth","tabBorderWidth").setType(_.NUMBER),t.addInherited("borderHeight","tabBorderHeight").setType(_.NUMBER),t}constructor(t,e,i=!0){super(t),this._extra={},b._attributeDefinitions.fromJson(e,this._attributes),!0===i&&t._addNode(this)}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(t){this._tabRect=t}_setRenderedName(t){this._renderedName=t}_getNameForOverflowMenu(){const t=this._getAttr("altName");return void 0!==t?t:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(t){this._attributes.name=t,this._window&&this._window.document&&(this._window.document.title=t)}_setFloating(t){this._attributes.floating=t}_layout(t,e){t.equals(this._rect)||this._fireEvent("resize",{rect:t}),this._rect=t}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const t={};return b._attributeDefinitions.toJson(t,this._attributes),t}_updateAttrs(t){b._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return b._attributeDefinitions}_setWindow(t){this._window=t}_setBorderWidth(t){this._attributes.borderWidth=t}_setBorderHeight(t){this._attributes.borderHeight=t}static getAttributeDefinitions(){return b._attributeDefinitions}}b.TYPE="tab",b._attributeDefinitions=b._createAttributeDefinitions();class f extends E{static _fromJson(t,e){const i=new f(e,t);if(null!=t.children)for(const s of t.children)if(s.type===v.TYPE){const t=v._fromJson(s,e);i._addChild(t)}else{const t=f._fromJson(s,e);i._addChild(t)}return i}static _createAttributeDefinitions(){const t=new c;return t.add("type",f.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t}constructor(t,e){super(t),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,f._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this)}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(t){this._attributes.weight=t}_layout(t,e){super._layout(t,e);const n=this._rect._getSize(this.getOrientation());let o=0,r=0,a=0,d=0;const l=this._getDrawChildren();for(const t of l){const e=t._getPrefSize(this.getOrientation());t._isFixed()?void 0!==e&&(r+=e):void 0===e?o+=t.getWeight():(a+=e,d+=t.getWeight())}let h=!1,_=n-r-a;_<0&&(_=n-r,h=!0,o+=d);let c=0,u=0;for(const t of l){const e=t._getPrefSize(this.getOrientation());if(t._isFixed())void 0!==e&&t._setTempSize(e);else if(null==e||h){if(0===o)t._setTempSize(0);else{const e=t.getMinSize(this.getOrientation()),i=Math.floor(_*(t.getWeight()/o));t._setTempSize(Math.max(e,i))}u+=t._getTempSize()}else t._setTempSize(e);c+=t._getTempSize()}if(u>0){for(;c<n;)for(const t of l)if(!(t instanceof m)){const e=t._getPrefSize(this.getOrientation());!t._isFixed()&&(void 0===e||h)&&c<n&&(t._setTempSize(t._getTempSize()+1),c++)}for(;c>n;){let t=!1;for(const e of l)if(!(e instanceof m)){const i=e.getMinSize(this.getOrientation());e._getTempSize()>i&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0)}if(!t)break}for(;c>n;){let t=!1;for(const e of l)e instanceof m||e._getTempSize()>0&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0);if(!t)break}}let g=0;for(const t of l)this.getOrientation()===i.HORZ?t._layout(new s(this._rect.x+g,this._rect.y,t._getTempSize(),this._rect.height),e):t._layout(new s(this._rect.x,this._rect.y+g,this._rect.width,t._getTempSize()),e),g+=t._getTempSize();return!0}_getSplitterBounds(t,e=!1){const s=[0,0],n=this._getDrawChildren(),o=n.indexOf(t),r=n[o-1],a=n[o+1];if(this.getOrientation()===i.HORZ){const i=e?r.getMinWidth():0,n=e?a.getMinWidth():0;s[0]=r.getRect().x+i,s[1]=a.getRect().getRight()-t.getWidth()-n}else{const i=e?r.getMinHeight():0,n=e?a.getMinHeight():0;s[0]=r.getRect().y+i,s[1]=a.getRect().getBottom()-t.getHeight()-n}return s}_calculateSplit(t,e){let i;const s=this._getDrawChildren(),n=s.indexOf(t),o=this._getSplitterBounds(t),r=s[n-1].getWeight()+s[n+1].getWeight(),a=Math.max(0,e-o[0]),d=Math.max(0,o[1]-e);if(a+d>0){const t=a*r/(a+d),e=d*r/(a+d);i={node1Id:s[n-1].getId(),weight1:t,pixelWidth1:a,node2Id:s[n+1].getId(),weight2:e,pixelWidth2:d}}return i}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let t=0;t<this._children.length;t++){const e=this._children[t];if(0!==t){const t=new m(this._model);t._setParent(this),this._drawChildren.push(t)}this._drawChildren.push(e)}this._dirty=!1}return this._drawChildren}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}calcMinSize(){this._minHeight=0,this._minWidth=0;let t=!0;for(const e of this._children){const s=e;s instanceof f&&s.calcMinSize(),this.getOrientation()===i.VERT?(this._minHeight+=s.getMinHeight(),t||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,s.getMinWidth())):(this._minWidth+=s.getMinWidth(),t||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,s.getMinHeight())),t=!1}}_tidy(){let t=0;for(;t<this._children.length;){const e=this._children[t];if(e instanceof f){e._tidy();const i=e.getChildren();if(0===i.length)this._removeChild(e);else if(1===i.length){const s=i[0];if(this._removeChild(e),s instanceof f){let i=0;const n=s.getChildren();for(const t of n)i+=t.getWeight();for(let s=0;s<n.length;s++){const o=n[s];o._setWeight(e.getWeight()*o.getWeight()/i),this._addChild(o,t+s)}}else s._setWeight(e.getWeight()),this._addChild(s,t)}else t++}else e instanceof v&&0===e.getChildren().length&&e.isEnableDeleteWhenEmpty()?(this._removeChild(e),e===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):t++}if(this===this._model.getRoot()&&0===this._children.length){const t=this._model._getOnCreateTabSet();let e=t?t():{};e=Object.assign(Object.assign({},e),{selected:-1});const i=new v(this._model,e);this._model._setActiveTabset(i),this._addChild(i)}}canDrop(t,e,i){const s=i-this._rect.y,n=e-this._rect.x,o=this._rect.width,a=this._rect.height,d=50;let l;if(this._model.isEnableEdgeDock()&&void 0===this._parent){if(e<this._rect.x+10&&s>a/2-d&&s<a/2+d){const t=r.LEFT,e=t.getDockRect(this._rect);e.width=e.width/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(e>this._rect.getRight()-10&&s>a/2-d&&s<a/2+d){const t=r.RIGHT,e=t.getDockRect(this._rect);e.width=e.width/2,e.x+=e.width,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i<this._rect.y+10&&n>o/2-d&&n<o/2+d){const t=r.TOP,e=t.getDockRect(this._rect);e.height=e.height/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i>this._rect.getBottom()-10&&n>o/2-d&&n<o/2+d){const t=r.BOTTOM,e=t.getDockRect(this._rect);e.height=e.height/2,e.y+=e.height,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==l&&!t._canDockInto(t,l))return}return l}drop(t,e,i){const s=e,n=t.getParent();let o;if(n&&n._removeChild(t),void 0!==n&&n.getType()===v.TYPE&&n._setSelected(0),void 0!==n&&n.getType()===R.TYPE&&n._setSelected(-1),t instanceof v)o=t;else{const e=this._model._getOnCreateTabSet();o=new v(this._model,e?e(t):{}),o._addChild(t)}let a=this._children.reduce(((t,e)=>t+e.getWeight()),0);0===a&&(a=100),o._setWeight(a/3);const d=!this._model.isRootOrientationVertical();if(d&&s===r.LEFT||!d&&s===r.TOP)this._addChild(o,0);else if(d&&s===r.RIGHT||!d&&s===r.BOTTOM)this._addChild(o);else if(d&&s===r.TOP||!d&&s===r.LEFT){const t=new f(this._model,{}),e=new f(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(o),t._addChild(e),this._addChild(t)}else if(d&&s===r.BOTTOM||!d&&s===r.RIGHT){const t=new f(this._model,{}),e=new f(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(e),t._addChild(o),this._addChild(t)}this._model._setActiveTabset(o),this._model._tidy()}toJson(){const t={};f._attributeDefinitions.toJson(t,this._attributes),t.children=[];for(const e of this._children)t.children.push(e.toJson());return t}isEnableDrop(){return!0}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}_getAttributeDefinitions(){return f._attributeDefinitions}_updateAttrs(t){f._attributeDefinitions.update(t,this._attributes)}static getAttributeDefinitions(){return f._attributeDefinitions}}f.TYPE="row",f._attributeDefinitions=f._createAttributeDefinitions();class v extends E{static _fromJson(t,e){const i=new v(e,t);if(null!=t.children)for(const s of t.children){const t=b._fromJson(s,e);i._addChild(t)}return 0===i._children.length&&i._setSelected(-1),t.maximized&&!0===t.maximized&&e._setMaximizedTabset(i),t.active&&!0===t.active&&e._setActiveTabset(i),i}static _createAttributeDefinitions(){const t=new c;return t.add("type",v.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t.add("selected",0).setType(_.NUMBER),t.add("name",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),t.addInherited("enableDrop","tabSetEnableDrop"),t.addInherited("enableDrag","tabSetEnableDrag"),t.addInherited("enableDivide","tabSetEnableDivide"),t.addInherited("enableMaximize","tabSetEnableMaximize"),t.addInherited("enableClose","tabSetEnableClose"),t.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),t.addInherited("classNameHeader","tabSetClassNameHeader"),t.addInherited("enableTabStrip","tabSetEnableTabStrip"),t.addInherited("borderInsets","tabSetBorderInsets"),t.addInherited("marginInsets","tabSetMarginInsets"),t.addInherited("minWidth","tabSetMinWidth"),t.addInherited("minHeight","tabSetMinHeight"),t.addInherited("headerHeight","tabSetHeaderHeight"),t.addInherited("tabStripHeight","tabSetTabStripHeight"),t.addInherited("tabLocation","tabSetTabLocation"),t.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(_.BOOLEAN),t}constructor(t,e){super(t),v._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}getName(){return this._getAttr("name")}getSelected(){const t=this._attributes.selected;return void 0!==t?t:-1}getSelectedNode(){const t=this.getSelected();if(-1!==t)return this._children[t]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset()===this||this.getParent()!==this.getModel().getRoot()||1!==this.getModel().getRoot().getChildren().length)}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(t){const e=this._getAttr("headerHeight");this._calculatedHeaderBarHeight=0!==e?e:t.headerBarSize}calculateTabBarHeight(t){const e=this._getAttr("tabStripHeight");this._calculatedTabBarHeight=0!==e?e:t.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}canDrop(t,e,i){let n;if(t===this){const t=r.CENTER,e=this._tabHeaderRect;n=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(e,i)){let t=r.CENTER;void 0===this._model.getMaximizedTabset()&&(t=r.getLocation(this._contentRect,e,i));const s=t.getDockRect(this._rect);n=new u(this,s,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this._tabHeaderRect&&this._tabHeaderRect.contains(e,i)){let t,i,o;if(0===this._children.length)t=this._tabHeaderRect.clone(),i=t.y+3,o=t.height-4,t.width=2;else{let a=this._children[0];t=a.getTabRect(),i=t.y,o=t.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(a=this._children[h],t=a.getTabRect(),l=t.x+t.width/2,e>=d&&e<l){const e=r.CENTER,a=new s(t.x-2,i,3,o);n=new u(this,a,e,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}}if(null==n){const e=r.CENTER,a=new s(t.getRight()-2,i,3,o);n=new u(this,a,e,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}if(t._canDockInto(t,n))return n}_layout(t,e){this.calculateHeaderBarHeight(e),this.calculateTabBarHeight(e),this.isMaximized()&&(t=this._model.getRoot().getRect()),t=t.removeInsets(this._getAttr("marginInsets")),this._rect=t,t=t.removeInsets(this._getAttr("borderInsets"));let i=0,n=0;void 0!==this.getName()&&(i+=this._calculatedHeaderBarHeight,n+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&("top"===this.getTabLocation()?this._tabHeaderRect=new s(t.x,t.y+i,t.width,this._calculatedTabBarHeight):this._tabHeaderRect=new s(t.x,t.y+t.height-this._calculatedTabBarHeight,t.width,this._calculatedTabBarHeight),n+=this._calculatedTabBarHeight,"top"===this.getTabLocation()&&(i+=this._calculatedTabBarHeight)),this._contentRect=new s(t.x,t.y+i,t.width,t.height-n);for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected())}}_delete(){this._parent._removeChild(this)}_remove(t){const e=this._removeChild(t);this._model._tidy(),O(this,e)}drop(t,e,i,s){const n=e;if(this===t)return;let o=t.getParent(),a=0;if(void 0!==o&&(a=o._removeChild(t),o instanceof R&&o.getSelected()===a?o._setSelected(-1):O(o,a)),t.getType()===b.TYPE&&o===this&&a<i&&i>0&&i--,n===r.CENTER){let e=i;if(-1===e&&(e=this._children.length),t.getType()===b.TYPE)this._addChild(t,e),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(e);else{for(let i=0;i<t.getChildren().length;i++){const s=t.getChildren()[i];this._addChild(s,e),e++}-1===this.getSelected()&&this._children.length>0&&this._setSelected(0)}this._model._setActiveTabset(this)}else{let e;if(t instanceof b){const i=this._model._getOnCreateTabSet();e=new v(this._model,i?i(t):{}),e._addChild(t),o=e}else e=t;const i=this._parent,s=i.getChildren().indexOf(this);if(i.getOrientation()===n._orientation)e._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),i._addChild(e,s+n._indexPlus);else{const t=new f(this._model,{});t._setWeight(this.getWeight()),t._addChild(this),this._setWeight(50),e._setWeight(50),t._addChild(e,n._indexPlus),i._removeChild(this),i._addChild(t,s)}this._model._setActiveTabset(e)}this._model._tidy()}toJson(){const t={};return v._attributeDefinitions.toJson(t,this._attributes),t.children=this._children.map((t=>t.toJson())),this.isActive()&&(t.active=!0),this.isMaximized()&&(t.maximized=!0),t}_updateAttrs(t){v._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return v._attributeDefinitions}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}static getAttributeDefinitions(){return v._attributeDefinitions}}function O(t,e){if(void 0!==t&&(t.getType()===v.TYPE||t.getType()===R.TYPE)){const i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t._setSelected(t.getChildren().length-1):e<i?t._setSelected(i-1):e>i||t._setSelected(-1))}}v.TYPE="tabset",v._attributeDefinitions=v._createAttributeDefinitions();class R extends E{static _fromJson(t,e){const i=r.getByName(t.location),s=new R(i,t,e);return t.children&&(s._children=t.children.map((t=>{const i=b._fromJson(t,e);return i._setParent(s),i}))),s}static _createAttributeDefinitions(){const t=new c;return t.add("type",R.TYPE,!0).setType(_.STRING).setFixed(),t.add("selected",-1).setType(_.NUMBER),t.add("show",!0).setType(_.BOOLEAN),t.add("config",void 0).setType("any"),t.addInherited("barSize","borderBarSize").setType(_.NUMBER),t.addInherited("enableDrop","borderEnableDrop").setType(_.BOOLEAN),t.addInherited("className","borderClassName").setType(_.STRING),t.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(_.BOOLEAN),t.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(_.BOOLEAN),t.addInherited("size","borderSize").setType(_.NUMBER),t.addInherited("minSize","borderMinSize").setType(_.NUMBER),t.addInherited("enableAutoHide","borderEnableAutoHide").setType(_.BOOLEAN),t}constructor(t,e,i){super(i),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=t,this._drawChildren=[],this._attributes.id=`border_${t.getName()}`,R._attributeDefinitions.fromJson(e,this._attributes),i._addNode(this)}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(t){return null==t&&(t=-1!==this.getSelected()),t?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(t){const e=this._getAttr("barSize");this._calculatedBorderBarSize=0!==e?e:t.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const t=this._getAttr("size"),e=this.getSelected();if(-1===e)return t;{const s=this._children[e],n=this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight");return-1===n?t:n}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(-1!==this.getSelected())return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return!(!this._attributes.show||this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&0===this._children.length)}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(t){this._attributes.selected=t}_setSize(t){const e=this.getSelected();if(-1===e)this._attributes.size=t;else{const s=this._children[e];-1===(this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight"))?this._attributes.size=t:this._location._orientation===i.HORZ?s._setBorderWidth(t):s._setBorderHeight(t)}}_updateAttrs(t){R._attributeDefinitions.update(t,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(t){this._adjustedSize=t}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(t,e){this.calcBorderBarSize(e);const i=this._location.split(t,this.getBorderBarSize());return this._tabHeaderRect=i.start,i.end}_layoutBorderInner(t,e){this._drawChildren=[];const i=this._location,s=i.split(t,this._adjustedSize+this._model.getSplitterSize()),n=i.reflect().split(s.start,this._model.getSplitterSize());this._contentRect=n.end;for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected()),this._drawChildren.push(i)}if(-1===this.getSelected())return t;{const t=new m(this._model);return t._setParent(this),t._setRect(n.start),this._drawChildren.push(t),s.end}}_remove(t){const e=this._removeChild(t);-1!==this.getSelected()&&O(this,e)}canDrop(t,e,n){if(t.getType()!==b.TYPE)return;let o;const a=r.CENTER;if(this._tabHeaderRect.contains(e,n)){if(this._location._orientation===i.VERT)if(this._children.length>0){let t=this._children[0],i=t.getTabRect();const n=i.y,r=i.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],i=t.getTabRect(),l=i.x+i.width/2,e>=d&&e<l){const t=new s(i.x-2,n,3,r);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i.getRight()-2,n,3,r);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._children.length>0){let t=this._children[0],e=t.getTabRect();const i=e.x,r=e.width;let d=this._tabHeaderRect.y,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],e=t.getTabRect(),l=e.y+e.height/2,n>=d&&n<l){const t=new s(i,e.y-2,r,3);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i,e.getBottom()-2,r,3);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}if(!t._canDockInto(t,o))return}else if(-1!==this.getSelected()&&this._contentRect.contains(e,n)){const e=this._contentRect;if(o=new u(this,e,a,-1,g.FLEXLAYOUT__OUTLINE_RECT),!t._canDockInto(t,o))return}return o}drop(t,e,i,s){let n=0;const o=t.getParent();void 0!==o&&(n=o._removeChild(t),o!==this&&o instanceof R&&o.getSelected()===n?o._setSelected(-1):O(o,n)),t.getType()===b.TYPE&&o===this&&n<i&&i>0&&i--;let r=i;-1===r&&(r=this._children.length),t.getType()===b.TYPE&&this._addChild(t,r),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(r),this._model._tidy()}toJson(){const t={};return R._attributeDefinitions.toJson(t,this._attributes),t.location=this._location.getName(),t.children=this._children.map((t=>t.toJson())),t}_getSplitterBounds(t,e=!1){const i=[0,0],s=e?this.getMinSize():0,n=this._model._getOuterInnerRects().outer,o=this._model._getOuterInnerRects().inner,a=this._model.getRoot();return this._location===r.TOP?(i[0]=n.y+s,i[1]=Math.max(i[0],o.getBottom()-t.getHeight()-a.getMinHeight())):this._location===r.LEFT?(i[0]=n.x+s,i[1]=Math.max(i[0],o.getRight()-t.getWidth()-a.getMinWidth())):this._location===r.BOTTOM?(i[1]=n.getBottom()-t.getHeight()-s,i[0]=Math.min(i[1],o.y+a.getMinHeight())):this._location===r.RIGHT&&(i[1]=n.getRight()-t.getWidth()-s,i[0]=Math.min(i[1],o.x+a.getMinWidth())),i}_calculateSplit(t,e){const i=this._getSplitterBounds(t);return this._location===r.BOTTOM||this._location===r.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])}_getAttributeDefinitions(){return R._attributeDefinitions}static getAttributeDefinitions(){return R._attributeDefinitions}}function A(e,i,s,n){let o=s?s(i):void 0,r=i.getName(),a=i.getName();if(void 0!==n){const t=n(i);void 0!==t&&("string"==typeof t?(r=t,a=t):void 0!==t.titleContent?(r=t.titleContent,a=t.name):r=t)}void 0===o&&void 0!==i.getIcon()&&(o=t.createElement("img",{style:{width:"1em",height:"1em"},src:i.getIcon(),alt:"leadingContent"}));const d={leading:o,content:r,name:a,buttons:[]};return e.customizeTab(i,d),i._setRenderedName(d.name),d}function y(t,e){e?t.visibility="hidden":t.display="none"}function L(t){let e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}R.TYPE="border",R._attributeDefinitions=R._createAttributeDefinitions(),function(t){t.Close_Tab="Close",t.Close_Tabset="Close tabset",t.Move_Tab="Move: ",t.Move_Tabset="Move tabset",t.Maximize="Maximize tabset",t.Restore="Restore tabset",t.Float_Tab="Show selected tab in floating window",t.Overflow_Menu_Tooltip="Hidden tabs",t.Floating_Window_Message="This panel is shown in a floating window",t.Floating_Window_Show_Window="Show window",t.Floating_Window_Dock_Window="Dock window",t.Error_rendering_component="Error rendering component"}(T||(T={})),function(t){t[t.Visible=1]="Visible",t[t.Always=2]="Always",t[t.Selected=3]="Selected"}(p||(p={}));const N=e=>{const{layout:i,node:n,selected:o,border:r,iconFactory:a,titleFactory:d,icons:l,path:_}=e,c=t.useRef(null),u=t.useRef(null),E=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),b,f)},m=t=>{L(t)&&i.auxMouseClick(n,t)},b=()=>{i.doAction(h.selectTab(n.getId()))},f=t=>{},v=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):b()},O=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{R(),i.getEditingTab()===n&&u.current.select()}));const R=()=>{const t=i.getDomRect(),e=c.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},y=t=>{t.stopPropagation()},N=i.getClassName;let S=N(g.FLEXLAYOUT__BORDER_BUTTON)+" "+N(g.FLEXLAYOUT__BORDER_BUTTON_+r);S+=o?" "+N(g.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+N(g.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==n.getClassName()&&(S+=" "+n.getClassName());const D=A(i,n,a,d);let B=D.content?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},D.content):null;const w=D.leading?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_LEADING)},D.leading):null;if(i.getEditingTab()===n&&(B=t.createElement("input",{ref:u,className:N(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":_+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:y,onTouchStart:y})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);D.buttons.push(t.createElement("div",{key:"close","data-layout-path":_+"/button/close",title:e,className:N(g.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:O,onClick:v,onTouchStart:O},"function"==typeof l.close?l.close(n):l.close))}return t.createElement("div",{ref:c,"data-layout-path":_,className:S,onMouseDown:E,onClick:m,onAuxClick:m,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:E,title:n.getHelpText()},w,B,D.buttons)},S=e=>{const{layout:i,node:s,iconFactory:n,titleFactory:o}=e,r=t.useRef(null),a=i.getClassName;let d=a(g.FLEXLAYOUT__TAB_BUTTON_STAMP);const l=A(i,s,n,o);let h=l.content?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},l.content):s._getNameForOverflowMenu();const _=l.leading?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},l.leading):null;return t.createElement("div",{ref:r,className:d,title:s.getHelpText()},_,h)};function D(e,i,s,n,o,r){const a=n.getRootDiv(),l=n.getClassName,h=e.ownerDocument,_=e.getBoundingClientRect(),c=a.getBoundingClientRect(),u=h.createElement("div");u.className=l(g.FLEXLAYOUT__POPUP_MENU_CONTAINER),_.left<c.left+c.width/2?u.style.left=_.left-c.left+"px":u.style.right=c.right-_.right+"px",_.top<c.top+c.height/2?u.style.top=_.top-c.top+"px":u.style.bottom=c.bottom-_.bottom+"px",d.instance.addGlass((()=>T())),d.instance.setGlassCursorOverride("default"),a.appendChild(u);const T=()=>{n.hidePortal(),d.instance.hideGlass(),a.removeChild(u),u.removeEventListener("mousedown",p),h.removeEventListener("mousedown",E)},p=t=>{t.stopPropagation()},E=t=>{T()};u.addEventListener("mousedown",p),h.addEventListener("mousedown",E),n.showPortal(t.createElement(B,{currentDocument:h,onSelect:s,onHide:T,items:i,classNameMapper:l,layout:n,iconFactory:o,titleFactory:r}),u)}const B=e=>{const{items:i,onHide:s,onSelect:n,classNameMapper:o,layout:r,iconFactory:a,titleFactory:d}=e,l=i.map(((e,i)=>t.createElement("div",{key:e.index,className:o(g.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+i,onClick:t=>((t,e)=>{n(t),s(),e.stopPropagation()})(e,t),title:e.node.getHelpText()},e.node.getModel().isLegacyOverflowMenu()?e.node._getNameForOverflowMenu():t.createElement(S,{node:e.node,layout:r,iconFactory:a,titleFactory:d}))));return t.createElement("div",{className:o(g.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},l)},w=(e,n,o,r)=>{const a=t.useRef(!0),d=t.useRef(!1),l=t.useRef(new s(0,0,0,0)),h=t.useRef(null),[_,c]=t.useState(0),u=t.useRef(!1),[g,T]=t.useState([]),p=t.useRef(0);t.useLayoutEffect((()=>{u.current=!1}),[e.getSelectedNode(),e.getRect().width,e.getRect().height]),t.useLayoutEffect((()=>{O()})),t.useEffect((()=>{const t=h.current;return t.addEventListener("wheel",E,{passive:!1}),()=>{t.removeEventListener("wheel",E)}}),[]);const E=t=>{t.preventDefault()},m=t=>n===i.HORZ?t.x:t.y,b=t=>n===i.HORZ?t.getRight():t.getBottom(),f=t=>n===i.HORZ?t.width:t.height,O=()=>{!0===a.current&&(d.current=!1);const t=e instanceof v?e.getRect():e.getTabHeaderRect();let i=e.getChildren()[e.getChildren().length-1];const s=null===r.current?0:f(r.current.getBoundingClientRect());if(!0===a.current||0===p.current&&0!==g.length||t.width!==l.current.width||t.height!==l.current.height){p.current=g.length,l.current=t;const n=!(e instanceof v)||!0===e.isEnableTabStrip();let r=b(t)-s;if(null!==o.current&&(r-=f(o.current.getBoundingClientRect())),n&&e.getChildren().length>0){if(0===g.length&&0===_&&b(i.getTabRect())+2<r)return;let s=0;const n=e.getSelectedNode();if(n&&!u.current){const e=n.getTabRect(),i=m(e)-2,o=b(e)+2;f(e)+4>=r-m(t)?s=m(t)-i:(o>r||i<m(t))&&(i<m(t)&&(s=m(t)-i),o+s>r&&(s=r-o))}const o=Math.max(0,r-(b(i.getTabRect())+2+s)),l=Math.min(0,_+s+o),h=l-_,p=[];for(let i=0;i<e.getChildren().length;i++){const s=e.getChildren()[i];(m(s.getTabRect())+h<m(t)||b(s.getTabRect())+h>r)&&p.push({node:s,index:i})}p.length>0&&(d.current=!0),a.current=!1,T(p),c(l)}}else a.current=!0};return{selfRef:h,position:_,userControlledLeft:u,hiddenTabs:g,onMouseWheel:t=>{let e=0;e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY,1===t.deltaMode&&(e*=40),c(_+e),u.current=!0,t.stopPropagation()},tabsTruncated:d.current}},C=e=>{const{border:s,layout:n,iconFactory:o,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:b,onMouseWheel:f}=w(s,i.flip(s.getOrientation()),_,u),v=t=>{L(t)&&n.auxMouseClick(s,t)},O=t=>{t.stopPropagation()},R=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,b,A):D(c.current,b,A,n,o,a),t.stopPropagation()},A=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},y=t=>{const e=s.getChildren()[s.getSelected()];void 0!==e&&n.doAction(h.floatTab(e.getId())),t.stopPropagation()},S=n.getClassName;let B=s.getTabHeaderRect().styleWithPosition({});const C=[],M=e=>{let i=s.getSelected()===e,r=s.getChildren()[e];C.push(t.createElement(N,{layout:n,border:s.getLocation().getName(),node:r,path:l+"/tb"+e,key:r.getId(),selected:i,iconFactory:o,titleFactory:a,icons:d})),e<s.getChildren().length-1&&C.push(t.createElement("div",{key:"divider"+e,className:S(g.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let t=0;t<s.getChildren().length;t++)M(t);let x=S(g.FLEXLAYOUT__BORDER)+" "+S(g.FLEXLAYOUT__BORDER_+s.getLocation().getName());void 0!==s.getClassName()&&(x+=" "+s.getClassName());let U=[];const I={headerContent:void 0,buttons:U,stickyButtons:[],headerButtons:[]};let F;if(n.customizeTabSet(s,I),U=I.buttons,b.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof d.more?d.more(s,b):t.createElement(t.Fragment,null,d.more,t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},b.length)),U.push(t.createElement("button",{key:"overflowbutton",ref:c,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+s.getLocation().getName()),title:e,onClick:R,onMouseDown:O,onTouchStart:O},i))}const z=s.getSelected();if(-1!==z){const e=s.getChildren()[z];if(void 0!==e&&n.isSupportsPopout()&&e.isEnableFloat()&&!e.isFloating()){const i=n.i18nName(T.Float_Tab);U.push(t.createElement("button",{key:"float",title:i,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:y,onMouseDown:O,onTouchStart:O},"function"==typeof d.popout?d.popout(e):d.popout))}}F=t.createElement("div",{key:"toolbar",ref:_,className:S(g.FLEXLAYOUT__BORDER_TOOLBAR)+" "+S(g.FLEXLAYOUT__BORDER_TOOLBAR_+s.getLocation().getName())},U),B=n.styleFont(B);let Y={};const H=s.getBorderBarSize()-1;return Y=s.getLocation()===r.LEFT?{right:H,height:H,top:E}:s.getLocation()===r.RIGHT?{left:H,height:H,top:E}:{height:H,left:E},t.createElement("div",{ref:p,dir:"ltr",style:B,className:x,"data-layout-path":l,onClick:v,onAuxClick:v,onContextMenu:t=>{n.showContextMenu(s,t)},onWheel:f},t.createElement("div",{style:{height:H},className:S(g.FLEXLAYOUT__BORDER_INNER)+" "+S(g.FLEXLAYOUT__BORDER_INNER_+s.getLocation().getName())},t.createElement("div",{style:Y,className:S(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+S(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+s.getLocation().getName())},C)),F)},M=e=>{const{layout:s,node:n,path:o}=e,r=t.useRef([]),a=t.useRef(void 0),l=n.getParent(),_=t=>{d.instance.setGlassCursorOverride(n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"),d.instance.startDrag(t,u,T,E,c,void 0,void 0,s.getCurrentDocument(),s.getRootDiv()),r.current=l._getSplitterBounds(n,!0);const e=s.getRootDiv();a.current=s.getCurrentDocument().createElement("div"),a.current.style.position="absolute",a.current.className=s.getClassName(g.FLEXLAYOUT__SPLITTER_DRAG),a.current.style.cursor=n.getOrientation()===i.HORZ?"ns-resize":"ew-resize";const o=n.getRect();n.getOrientation()===i.VERT&&o.width<2?o.width=2:n.getOrientation()===i.HORZ&&o.height<2&&(o.height=2),o.positionElement(a.current),e.appendChild(a.current)},c=t=>{s.getRootDiv().removeChild(a.current)},u=()=>!0,T=t=>{const e=s.getDomRect(),o=t.clientX-e.left,r=t.clientY-e.top;a&&(n.getOrientation()===i.HORZ?a.current.style.top=m(r-4)+"px":a.current.style.left=m(o-4)+"px"),s.isRealtimeResize()&&p()},p=()=>{let t=0;if(a&&(t=n.getOrientation()===i.HORZ?a.current.offsetTop:a.current.offsetLeft),l instanceof R){const e=l._calculateSplit(n,t);s.doAction(h.adjustBorderSplit(n.getParent().getId(),e))}else{const e=l._calculateSplit(n,t);void 0!==e&&s.doAction(h.adjustSplit(e))}},E=()=>{p(),s.getRootDiv().removeChild(a.current)},m=t=>{const e=r.current;let i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},b=s.getClassName;let f=n.getRect();const v=f.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"});let O=b(g.FLEXLAYOUT__SPLITTER)+" "+b(g.FLEXLAYOUT__SPLITTER_+n.getOrientation().getName());l instanceof R?O+=" "+b(g.FLEXLAYOUT__SPLITTER_BORDER):void 0!==n.getModel().getMaximizedTabset()&&(v.display="none");const A=n.getModel().getSplitterExtra();if(0===A)return t.createElement("div",{style:v,"data-layout-path":o,className:O,onTouchStart:_,onMouseDown:_});{let e=f.clone();e.x=0,e.y=0,n.getOrientation()===i.VERT?e.width+=A:e.height+=A;const s=e.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"}),r=b(g.FLEXLAYOUT__SPLITTER_EXTRA);return t.createElement("div",{style:v,"data-layout-path":o,className:O},t.createElement("div",{style:s,className:r,onTouchStart:_,onMouseDown:_}))}};class x extends t.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){console.debug(t),console.debug(e)}render(){return this.state.hasError?t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}const U=e=>{const{layout:i,selected:s,node:n,factory:o,path:r}=e,[a,d]=t.useState(!e.node.isEnableRenderOnDemand()||e.selected);t.useLayoutEffect((()=>{!a&&s&&d(!0)}));const l=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},_=i.getClassName,c=n.getModel().isUseVisibility(),u=n.getParent(),p=n._styleWithPosition();let E;s||y(p,c),u instanceof v&&(void 0===n.getModel().getMaximizedTabset()||u.isMaximized()||y(p,c)),a&&(E=o(n));let m=_(g.FLEXLAYOUT__TAB);return u instanceof R&&(m+=" "+_(g.FLEXLAYOUT__TAB_BORDER),m+=" "+_(g.FLEXLAYOUT__TAB_BORDER_+u.getLocation().getName())),t.createElement("div",{className:m,"data-layout-path":r,onMouseDown:l,onTouchStart:l,style:p},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,E)))},I=e=>{const{layout:i,node:n,selected:o,iconFactory:r,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),m,b)},E=t=>{L(t)&&i.auxMouseClick(n,t)},m=()=>{i.doAction(h.selectTab(n.getId()))},b=t=>{n.isEnableRename()&&f()},f=()=>{i.setEditingTab(n),i.getCurrentDocument().body.addEventListener("mousedown",v),i.getCurrentDocument().body.addEventListener("touchstart",v)},v=t=>{t.target!==c.current&&(i.getCurrentDocument().body.removeEventListener("mousedown",v),i.getCurrentDocument().body.removeEventListener("touchstart",v),i.setEditingTab(void 0))},O=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):m()},R=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{y(),i.getEditingTab()===n&&c.current.select()}));const y=()=>{const t=i.getDomRect(),e=_.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},N=t=>{t.stopPropagation()},S=i.getClassName,D=n.getParent();let B=g.FLEXLAYOUT__TAB_BUTTON,w=S(B);w+=" "+S(B+"_"+D.getTabLocation()),w+=o?" "+S(B+"--selected"):" "+S(B+"--unselected"),void 0!==n.getClassName()&&(w+=" "+n.getClassName());const C=A(i,n,r,a);let M=C.content?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},C.content):null;const x=C.leading?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},C.leading):null;if(i.getEditingTab()===n&&(M=t.createElement("input",{ref:c,className:S(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":l+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:N,onTouchStart:N})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);C.buttons.push(t.createElement("div",{key:"close","data-layout-path":l+"/button/close",title:e,className:S(g.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:R,onClick:O,onTouchStart:R},"function"==typeof d.close?d.close(n):d.close))}return t.createElement("div",{ref:_,"data-layout-path":l,className:w,onMouseDown:u,onClick:E,onAuxClick:E,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:u,title:n.getHelpText()},x,M,C.buttons)},F=e=>{const{node:s,layout:n,iconFactory:o,titleFactory:r,icons:a,path:d}=e,l=t.useRef(null),_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:b,onMouseWheel:f,tabsTruncated:v}=w(s,i.HORZ,l,u),O=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,b,R):D(_.current,b,R,n,o,r),t.stopPropagation()},R=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},A=t=>{if(!L(t)){let e=s.getName();if(e=void 0===e?"":": "+e,n.doAction(h.setActiveTabset(s.getId())),!n.getEditingTab()){const i=n.i18nName(T.Move_Tabset,e);void 0!==s.getModel().getMaximizedTabset()?n.dragStart(t,i,s,!1,(t=>{}),U):n.dragStart(t,i,s,s.isEnableDrag(),(t=>{}),U)}}},N=t=>{L(t)&&n.auxMouseClick(s,t)},S=t=>{n.showContextMenu(s,t)},B=t=>{t.stopPropagation()},C=t=>{s.canMaximize()&&n.maximize(s),t.stopPropagation()},M=t=>{n.doAction(h.deleteTabset(s.getId())),t.stopPropagation()},x=t=>{void 0!==z&&n.doAction(h.floatTab(z.getId())),t.stopPropagation()},U=t=>{s.canMaximize()&&n.maximize(s)},F=n.getClassName;null!==c.current&&0!==c.current.scrollLeft&&(c.current.scrollLeft=0);const z=s.getSelectedNode();let Y=s._styleWithPosition();void 0===s.getModel().getMaximizedTabset()||s.isMaximized()||y(Y,s.getModel().isUseVisibility());const H=[];if(s.isEnableTabStrip())for(let e=0;e<s.getChildren().length;e++){const i=s.getChildren()[e];let l=s.getSelected()===e;H.push(t.createElement(I,{layout:n,node:i,path:d+"/tb"+e,key:i.getId(),selected:l,iconFactory:o,titleFactory:r,icons:a})),e<s.getChildren().length-1&&H.push(t.createElement("div",{key:"divider"+e,className:F(g.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}const X=void 0!==s.getName();let W=[],P=[],k=[];const G={headerContent:s.getName(),stickyButtons:W,buttons:P,headerButtons:k};n.customizeTabSet(s,G);const V=G.headerContent;let J,Z,j;if(W=G.stickyButtons,P=G.buttons,k=G.headerButtons,W.length>0&&(v?P=[...W,...P]:H.push(t.createElement("div",{ref:u,key:"sticky_buttons_container",onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()},className:F(g.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},W))),b.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof a.more?a.more(s,b):t.createElement(t.Fragment,null,a.more,t.createElement("div",{className:F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},b.length)),P.push(t.createElement("button",{key:"overflowbutton","data-layout-path":d+"/button/overflow",ref:_,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:e,onClick:O,onMouseDown:B,onTouchStart:B},i))}if(void 0!==z&&n.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const e=n.i18nName(T.Float_Tab);P.push(t.createElement("button",{key:"float","data-layout-path":d+"/button/float",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:x,onMouseDown:B,onTouchStart:B},"function"==typeof a.popout?a.popout(z):a.popout))}if(s.canMaximize()){const e=n.i18nName(T.Restore),i=n.i18nName(T.Maximize);(X?k:P).push(t.createElement("button",{key:"max","data-layout-path":d+"/button/max",title:s.isMaximized()?e:i,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(s.isMaximized()?"max":"min")),onClick:C,onMouseDown:B,onTouchStart:B},s.isMaximized()?"function"==typeof a.restore?a.restore(s):a.restore:"function"==typeof a.maximize?a.maximize(s):a.maximize))}if(!s.isMaximized()&&s.isEnableClose()){const e=n.i18nName(T.Close_Tabset);(X?k:P).push(t.createElement("button",{key:"close","data-layout-path":d+"/button/close",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:M,onMouseDown:B,onTouchStart:B},"function"==typeof a.closeTabset?a.closeTabset(s):a.closeTabset))}J=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},P);let q=F(g.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==s.getClassNameTabStrip()&&(q+=" "+s.getClassNameTabStrip()),q+=" "+g.FLEXLAYOUT__TABSET_TABBAR_OUTER_+s.getTabLocation(),s.isActive()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),X){const e=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},k);let i=F(g.FLEXLAYOUT__TABSET_HEADER);s.isActive()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),void 0!==s.getClassNameHeader()&&(i+=" "+s.getClassNameHeader()),Z=t.createElement("div",{className:i,style:{height:s.getHeaderHeight()+"px"},"data-layout-path":d+"/header",onMouseDown:A,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:A},t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_HEADER_CONTENT)},V),e)}const $={height:s.getTabStripHeight()+"px"};j=t.createElement("div",{className:q,style:$,"data-layout-path":d+"/tabstrip",onMouseDown:A,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:A},t.createElement("div",{ref:c,className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_+s.getTabLocation())},t.createElement("div",{style:{left:E},className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+s.getTabLocation())},H)),J),Y=n.styleFont(Y);var K=void 0;if(0===s.getChildren().length){const t=n.getTabSetPlaceHolderCallback();t&&(K=t(s))}const Q=t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_CONTENT)},K);var tt;return tt="top"===s.getTabLocation()?t.createElement(t.Fragment,null,Z,j,Q):t.createElement(t.Fragment,null,Z,Q,j),t.createElement("div",{ref:p,dir:"ltr","data-layout-path":d,style:Y,className:F(g.FLEXLAYOUT__TABSET),onWheel:f},tt)},z=i=>{const{title:s,id:n,url:o,rect:r,onCloseWindow:a,onSetWindow:d,children:l}=i,h=t.useRef(null),_=t.useRef(null),[c,u]=t.useState(void 0);return t.useLayoutEffect((()=>{_.current&&clearTimeout(_.current);let t=!0;const e=r,i=Array.from(window.document.styleSheets).reduce(((t,e)=>{let i;try{i=e.cssRules}catch(t){}try{return[...t,{href:e.href,type:e.type,rules:i?Array.from(i).map((t=>t.cssText)):null}]}catch(e){return t}}),[]);return h.current=window.open(o,n,`left=${e.x},top=${e.y},width=${e.width},height=${e.height}`),null!==h.current?(d(n,h.current),window.addEventListener("beforeunload",(()=>{h.current&&(h.current.close(),h.current=null)})),h.current.addEventListener("load",(()=>{if(t){const t=h.current.document;t.title=s;const e=t.createElement("div");e.className=g.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(e),function(t,e){const i=t.head,s=[];for(const n of e)if(n.href){const e=t.createElement("link");e.type=n.type,e.rel="stylesheet",e.href=n.href,i.appendChild(e),s.push(new Promise(((t,i)=>{e.onload=()=>t(!0)})))}else if(n.rules){const e=t.createElement("style");for(const i of n.rules)e.appendChild(t.createTextNode(i));i.appendChild(e)}return Promise.all(s)}(t,i).then((()=>{u(e)})),h.current.addEventListener("beforeunload",(()=>{a(n)}))}}))):(console.warn(`Unable to open window ${o}`),a(n)),()=>{t=!1,_.current=setTimeout((()=>{h.current&&(h.current.close(),h.current=null)}),0)}}),[]),void 0!==c?(0,e.createPortal)(l,c):null},Y=e=>{const{layout:i,node:s,factory:n}=e,o=i.getClassName,r=n(s);return t.createElement("div",{className:o(g.FLEXLAYOUT__FLOATING_WINDOW_TAB)},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,r)))},H=e=>{const{layout:i,selected:s,node:n,path:o}=e,r=()=>{n.getWindow()&&n.getWindow().focus()},a=()=>{i.doAction(h.unFloatTab(n.getId()))},d=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},l=i.getClassName,_=n.getParent(),c=n._styleWithPosition();s||y(c,n.getModel().isUseVisibility()),_ instanceof v&&(void 0===n.getModel().getMaximizedTabset()||_.isMaximized()||y(c,n.getModel().isUseVisibility()));const u=i.i18nName(T.Floating_Window_Message),p=i.i18nName(T.Floating_Window_Show_Window),E=i.i18nName(T.Floating_Window_Dock_Window),m=i.getOnRenderFloatingTabPlaceholder();return m?t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),onMouseDown:d,onTouchStart:d,style:c},m(a,r)):t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":o,onMouseDown:d,onTouchStart:d,style:c},t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING_INNER)},t.createElement("div",null,u),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),r()}},p)),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a()}},E))))},X={width:"1em",height:"1em",display:"flex",alignItems:"center"},W=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),t.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),P={close:t.createElement(W,null),closeTabset:t.createElement(W,null),popout:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 20 20",fill:"var(--color-icon)"},t.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),t.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))),null),maximize:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))),null),restore:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))),null),more:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))),null)},k="undefined"!=typeof window&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),G="undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!k;class V extends t.Component{constructor(i){super(i),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=t=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model,t)},this.updateRect=(t=this.getDomRect())=>{const e=new s(0,0,t.width,t.height);e.equals(this.state.rect)||0===e.width||0===e.height||this.setState({rect:e})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const t=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:t})}if(this.findTabBarSizeRef.current){const t=this.findTabBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:t})}if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.getClassName=t=>void 0===this.props.classNameMapper?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(h.unFloatTab(t));try{this.props.model.getNodeById(t)._setWindow(void 0)}catch(t){}},this.onSetWindow=(t,e)=>{this.props.model.getNodeById(t)._setWindow(e)},this.onCancelAdd=()=>{var t,e;this.selfRef.current.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(e=null===(t=this.customDrop)||void 0===t?void 0:t.invalidated)||void 0===e||e.call(t)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=t=>{var e,i;if(t){const t=this.selfRef.current;try{t.removeChild(this.outlineDiv)}catch(t){}try{t.removeChild(this.dragDiv)}catch(t){}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(i=null===(e=this.customDrop)||void 0===e?void 0:e.invalidated)||void 0===i||i.call(e)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:r.CENTER})},this.onDragDivMouseDown=t=>{t.preventDefault(),this.dragStart(t,this.dragDivText,b._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(t,e,i,s,n,o)=>{s?(this.dragNode=i,this.dragDivText=e,d.instance.startDrag(t,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,n,o,this.currentDocument,this.selfRef.current)):d.instance.startDrag(t,void 0,void 0,void 0,void 0,n,o,this.currentDocument,this.selfRef.current)},this.dragRectRender=(e,i,s,n)=>{let o;if(void 0!==e?o=t.createElement("div",{style:{whiteSpace:"pre"}},e.replace("<br>","\n")):i&&i instanceof b&&(o=t.createElement(S,{node:i,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),void 0!==this.props.onRenderDragRect){const t=this.props.onRenderDragRect(o,i,s);void 0!==t&&(o=t)}this.dragDiv.style.visibility="hidden",this.dragRectRendered=!1,this.showPortal(t.createElement(J,{onRendered:()=>{this.dragRectRendered=!0,null==n||n()}},o),this.dragDiv)},this.showPortal=(t,i)=>{const s=(0,e.createPortal)(t,i);this.setState({portal:s})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{this.dropInfo=void 0,this.customDrop=void 0;const t=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(g.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",t.appendChild(this.outlineDiv),null==this.dragDiv&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),t.appendChild(this.dragDiv)),void 0===this.props.model.getMaximizedTabset()&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),void 0!==this.dragNode&&this.dragNode instanceof b&&void 0!==this.dragNode.getTabRect()&&this.dragNode.getTabRect().positionElement(this.outlineDiv),this.firstMove=!0,!0},this.onDragMove=t=>{if(!1===this.firstMove){const t=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${t}s, left ${t}s, width ${t}s, height ${t}s`}this.firstMove=!1;const e=this.selfRef.current.getBoundingClientRect(),i={x:t.clientX-e.left,y:t.clientY-e.top};this.checkForBorderToShow(i.x,i.y);const s=this.dragDiv.getBoundingClientRect();let n=i.x-s.width/2;n+s.width>e.width&&(n=e.width-s.width),n=Math.max(0,n),this.dragDiv.style.left=n+"px",this.dragDiv.style.top=i.y+5+"px",this.dragRectRendered&&"hidden"===this.dragDiv.style.visibility&&(this.dragDiv.style.visibility="visible");let o=this.props.model._findDropTargetNode(this.dragNode,i.x,i.y);o&&(this.props.onTabDrag?this.handleCustomTabDrag(o,i,t):(this.dropInfo=o,this.outlineDiv.className=this.getClassName(o.className),o.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))},this.onDragEnd=t=>{const e=this.selfRef.current;if(e.removeChild(this.outlineDiv),e.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),d.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:t,dragging:e,over:i,x:s,y:n,location:o}=this.customDrop;t(e,i,s,n,o),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(t){console.error(t)}}else if(void 0!==this.newTabJson){const e=this.doAction(h.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(e,t),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else void 0!==this.dragNode&&this.doAction(h.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:r.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=t.createRef(),this.findHeaderBarSizeRef=t.createRef(),this.findTabBarSizeRef=t.createRef(),this.findBorderBarSizeRef=t.createRef(),this.supportsPopout=void 0!==i.supportsPopout?i.supportsPopout:G,this.popoutURL=i.popoutURL?i.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},P),i.icons),this.state={rect:new s(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:r.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(t){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(t.fontStyle=this.props.font.style),this.props.font.weight&&(t.fontWeight=this.props.font.weight)),t}doAction(t){if(void 0!==this.props.onAction){const e=this.props.onAction(t);return void 0!==e?this.props.model.doAction(e):void 0}return this.props.model.doAction(t)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver((t=>{this.updateRect(t[0].contentRect)})),this.resizeObserver.observe(this.selfRef.current)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var t;return null!==(t=this.props.realtimeResize)&&void 0!==t&&t}onTabDrag(...t){var e,i;return null===(i=(e=this.props).onTabDrag)||void 0===i?void 0:i.call(e,...t)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var t;null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.selfRef.current)}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const e=[],i=[],s=[],n={},o=[],r={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,r),this.renderBorder(this.props.model.getBorderSet(),e,n,s,o),this.renderChildren("",this.props.model.getRoot(),i,n,s,o);const a=[],d={};for(const t of this.tabIds)n[t]&&(a.push(t),d[t]=t);this.tabIds=a;for(const t of Object.keys(n))d[t]||this.tabIds.push(t);const l=[];if(this.state.showEdges){const e=this.centerRect,i=this.edgeRectLength,s=this.edgeRectWidth,n=this.edgeRectLength/2,o=this.getClassName(g.FLEXLAYOUT__EDGE_RECT),r=50;l.push(t.createElement("div",{key:"North",style:{top:e.y,left:e.x+e.width/2-n,width:i,height:s,borderBottomLeftRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"West",style:{top:e.y+e.height/2-n,left:e.x,width:s,height:i,borderTopRightRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"South",style:{top:e.y+e.height-s,left:e.x+e.width/2-n,width:i,height:s,borderTopLeftRadius:r,borderTopRightRadius:r},className:o})),l.push(t.createElement("div",{key:"East",style:{top:e.y+e.height/2-n,left:e.x+e.width-s,width:s,height:i,borderTopLeftRadius:r,borderBottomLeftRadius:r},className:o}))}return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},i,this.tabIds.map((t=>n[t])),e,o,l,s,this.metricsElements(),this.state.portal)}metricsElements(){const e=this.styleFont({visibility:"hidden"});return t.createElement(t.Fragment,null,t.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),t.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),t.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(e,s,n,o,r){for(const a of e.getBorders()){const e=`/border/${a.getLocation().getName()}`;if(a.isShowing()){s.push(t.createElement(C,{key:`border_${a.getLocation().getName()}`,path:e,border:a,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const d=a._getDrawChildren();let l=0,h=0;for(const s of d){if(s instanceof m){let i=e+"/s";r.push(t.createElement(M,{key:s.getId(),layout:this,node:s,path:i}))}else if(s instanceof b){let r=e+"/t"+h++;if(this.supportsPopout&&s.isFloating()){const e=this._getScreenRect(s),d=s._getAttr("borderWidth"),h=s._getAttr("borderHeight");-1!==d&&a.getLocation().getOrientation()===i.HORZ?e.width=d:-1!==h&&a.getLocation().getOrientation()===i.VERT&&(e.height=h),o.push(t.createElement(z,{key:s.getId(),url:this.popoutURL,rect:e,title:s.getName(),id:s.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:s,factory:this.props.factory}))),n[s.getId()]=t.createElement(H,{key:s.getId(),layout:this,path:r,node:s,selected:l===a.getSelected()})}else n[s.getId()]=t.createElement(U,{key:s.getId(),layout:this,path:r,node:s,selected:l===a.getSelected(),factory:this.props.factory})}l++}}}}renderChildren(e,s,n,o,r,a){const d=s._getDrawChildren();let l=0,h=0,_=0;for(const s of d)if(s instanceof m){const i=e+"/s"+l++;a.push(t.createElement(M,{key:s.getId(),layout:this,path:i,node:s}))}else if(s instanceof v){const i=e+"/ts"+_++;n.push(t.createElement(F,{key:s.getId(),layout:this,path:i,node:s,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(i,s,n,o,r,a)}else if(s instanceof b){const i=e+"/t"+h++,n=s.getParent().getChildren()[s.getParent().getSelected()];if(void 0===n&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&s.isFloating()){const e=this._getScreenRect(s);r.push(t.createElement(z,{key:s.getId(),url:this.popoutURL,rect:e,title:s.getName(),id:s.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:s,factory:this.props.factory}))),o[s.getId()]=t.createElement(H,{key:s.getId(),layout:this,path:i,node:s,selected:s===n})}else o[s.getId()]=t.createElement(U,{key:s.getId(),layout:this,path:i,node:s,selected:s===n,factory:this.props.factory})}else{const t=e+(s.getOrientation()===i.HORZ?"/r":"/c")+_++;this.renderChildren(t,s,n,o,r,a)}}_getScreenRect(t){const e=t.getRect().clone(),i=this.selfRef.current.getBoundingClientRect(),s=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),n=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return e.x=e.x+i.x+this.currentWindow.screenX+n,e.y=e.y+i.y+this.currentWindow.screenY+s,e}addTabToTabSet(t,e){void 0!==this.props.model.getNodeById(t)&&this.doAction(h.addNode(e,t,r.CENTER,-1))}addTabToActiveTabSet(t){const e=this.props.model.getActiveTabset();void 0!==e&&this.doAction(h.addNode(t,e.getId(),r.CENTER,-1))}addTabWithDragAndDrop(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,this.dragStart(void 0,t,b._fromJson(e,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(t,e){this.dragStart(void 0,e,t,!0,void 0,void 0)}addTabWithDragAndDropIndirect(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,d.instance.addGlass(this.onCancelAdd),this.dragDivText=t,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,(()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const t=this.dragDiv.getBoundingClientRect(),e=new s(0,0,null==t?void 0:t.width,null==t?void 0:t.height);e.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=e.x+"px",this.dragDiv.style.top=e.y+"px"}})),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(t,e,i){var n,o,r;let a=null===(n=this.customDrop)||void 0===n?void 0:n.invalidated;const l=null===(o=this.customDrop)||void 0===o?void 0:o.callback;this.customDrop=void 0;const h=this.newTabJson||(this.dragNode instanceof b?this.dragNode:void 0);if(h&&(t.node instanceof v||t.node instanceof R)&&-1===t.index){const n=t.node.getSelectedNode(),o=null==n?void 0:n.getRect();if(n&&(null==o?void 0:o.contains(e.x,e.y))){let r;try{const a=this.onTabDrag(h,n,e.x-o.x,e.y-o.y,t.location,(()=>this.onDragMove(i)));a&&(r={rect:new s(a.x+o.x,a.y+o.y,a.width,a.height),callback:a.callback,invalidated:a.invalidated,dragging:h,over:n,x:e.x-o.x,y:e.y-o.y,location:t.location,cursor:a.cursor})}catch(t){console.error(t)}(null==r?void 0:r.callback)===l&&(a=void 0),this.customDrop=r}}this.dropInfo=t,this.outlineDiv.className=this.getClassName(this.customDrop?g.FLEXLAYOUT__OUTLINE_RECT:t.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):t.rect.positionElement(this.outlineDiv),d.instance.setGlassCursorOverride(null===(r=this.customDrop)||void 0===r?void 0:r.cursor),this.outlineDiv.style.visibility="visible";try{null==a||a()}catch(t){console.error(t)}}onDragEnter(t){if(d.instance.isDragging())return;const e=this.props.onExternalDrag(t);e&&(this.fnNewNodeDropped=e.onDrop,this.newTabJson=e.json,this.dragStart(t,e.dragText,b._fromJson(e.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(t,e){const i=this.props.model._getOuterInnerRects().outer,s=i.getCenter(),n=this.edgeRectWidth,o=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===r.CENTER&&(e>s.y-o&&e<s.y+o||t>s.x-o&&t<s.x+o)&&(a=!0);let d=r.CENTER;a||(t<=i.x+n?d=r.LEFT:t>=i.getRight()-n?d=r.RIGHT:e<=i.y+n?d=r.TOP:e>=i.getBottom()-n&&(d=r.BOTTOM)),d!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:d})}maximize(t){this.doAction(h.maximizeToggle(t.getId()))}customizeTab(t,e){this.props.onRenderTab&&this.props.onRenderTab(t,e)}customizeTabSet(t,e){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,e)}i18nName(t,e){let i;return this.props.i18nMapper&&(i=this.props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(t,e){this.props.onContextMenu&&this.props.onContextMenu(t,e)}auxMouseClick(t,e){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,e)}}const J=e=>(t.useEffect((()=>{var t;null===(t=e.onRendered)||void 0===t||t.call(e)}),[e]),t.createElement(t.Fragment,null,e.children));class Z{static _fromJson(t,e){const i=new Z(e);return i._borders=t.map((t=>R._fromJson(t,e))),i}constructor(t){this._model=t,this._borders=[]}getBorders(){return this._borders}_forEachNode(t){for(const e of this._borders){t(e,0);for(const i of e.getChildren())i._forEachNode(t,1)}}_toJson(){return this._borders.map((t=>t.toJson()))}_layoutBorder(t,e){const s=t.outer,n=this._model.getRoot();let o=Math.max(0,s.height-n.getMinHeight()),r=Math.max(0,s.width-n.getMinWidth()),a=0,d=0,l=0,h=0;const _=this._borders.filter((t=>t.isShowing()));for(const t of _){t._setAdjustedSize(t.getSize());const e=-1!==t.getSelected();t.getLocation().getOrientation()===i.HORZ?(d+=t.getBorderBarSize(),e&&(r-=this._model.getSplitterSize(),d+=t.getSize(),h+=t.getSize())):(a+=t.getBorderBarSize(),e&&(o-=this._model.getSplitterSize(),a+=t.getSize(),l+=t.getSize()))}let c=0,u=!1;for(;d>r&&h>0||a>o&&l>0;){const t=_[c];if(-1!==t.getSelected()){const e=t._getAdjustedSize();d>r&&h>0&&t.getLocation().getOrientation()===i.HORZ&&e>0&&e>t.getMinSize()?(t._setAdjustedSize(e-1),d--,h--,u=!0):a>o&&l>0&&t.getLocation().getOrientation()===i.VERT&&e>0&&e>t.getMinSize()&&(t._setAdjustedSize(e-1),a--,l--,u=!0)}if(c=(c+1)%_.length,0===c){if(!u)break;u=!1}}for(const i of _)t.outer=i._layoutBorderOuter(t.outer,e);t.inner=t.outer;for(const i of _)t.inner=i._layoutBorderInner(t.inner,e);return t}_findDropTargetNode(t,e,i){for(const s of this._borders)if(s.isShowing()){const n=s.canDrop(t,e,i);if(void 0!==n)return n}}}class j{static fromJson(t){const e=new j;return j._attributeDefinitions.fromJson(t.global,e._attributes),t.borders&&(e._borders=Z._fromJson(t.borders,e)),e._root=f._fromJson(t.layout,e),e._tidy(),e}static _createAttributeDefinitions(){const t=new c;return t.add("legacyOverflowMenu",!1).setType(_.BOOLEAN),t.add("splitterSize",-1).setType(_.NUMBER),t.add("splitterExtra",0).setType(_.NUMBER),t.add("enableEdgeDock",!0).setType(_.BOOLEAN),t.add("rootOrientationVertical",!1).setType(_.BOOLEAN),t.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("enableUseVisibility",!1).setType(_.BOOLEAN),t.add("tabEnableClose",!0).setType(_.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnableFloat",!1).setType(_.BOOLEAN),t.add("tabEnableDrag",!0).setType(_.BOOLEAN),t.add("tabEnableRename",!0).setType(_.BOOLEAN),t.add("tabClassName",void 0).setType(_.STRING),t.add("tabIcon",void 0).setType(_.STRING),t.add("tabEnableRenderOnDemand",!0).setType(_.BOOLEAN),t.add("tabDragSpeed",.3).setType(_.NUMBER),t.add("tabBorderWidth",-1).setType(_.NUMBER),t.add("tabBorderHeight",-1).setType(_.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(_.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(_.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(_.BOOLEAN),t.add("tabSetEnableClose",!1).setType(_.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(_.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(_.STRING),t.add("tabSetClassNameHeader",void 0).setType(_.STRING),t.add("tabSetEnableTabStrip",!0).setType(_.BOOLEAN),t.add("tabSetHeaderHeight",0).setType(_.NUMBER),t.add("tabSetTabStripHeight",0).setType(_.NUMBER),t.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabSetMinWidth",0).setType(_.NUMBER),t.add("tabSetMinHeight",0).setType(_.NUMBER),t.add("borderSize",200).setType(_.NUMBER),t.add("borderMinSize",0).setType(_.NUMBER),t.add("borderBarSize",0).setType(_.NUMBER),t.add("borderEnableDrop",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(_.BOOLEAN),t.add("borderClassName",void 0).setType(_.STRING),t.add("borderEnableAutoHide",!1).setType(_.BOOLEAN),t}constructor(){this._borderRects={inner:s.empty(),outer:s.empty()},this._attributes={},this._idMap={},this._borders=new Z(this),this._pointerFine=!0,this._showHiddenBorder=r.CENTER}_setChangeListener(t){this._changeListener=t}getActiveTabset(){return this._activeTabSet&&this.getNodeById(this._activeTabSet.getId())?this._activeTabSet:void 0}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(t){this._showHiddenBorder=t}_setActiveTabset(t){this._activeTabSet=t}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(t){this._maximizedTabSet=t}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(t){this._pointerFine=t}visitNodes(t){this._borders._forEachNode(t),this._root._forEachNode(t,0)}getNodeById(t){return this._idMap[t]}doAction(t){let e;switch(t.type){case h.ADD_NODE:{const i=new b(this,t.data.json,!0),s=this._idMap[t.data.toNode];(s instanceof v||s instanceof R||s instanceof f)&&(s.drop(i,r.getByName(t.data.location),t.data.index,t.data.select),e=i);break}case h.MOVE_NODE:{const e=this._idMap[t.data.fromNode];if(e instanceof b||e instanceof v){const i=this._idMap[t.data.toNode];(i instanceof v||i instanceof R||i instanceof f)&&i.drop(e,r.getByName(t.data.location),t.data.index,t.data.select)}break}case h.DELETE_TAB:{const e=this._idMap[t.data.node];e instanceof b&&e._delete();break}case h.DELETE_TABSET:{const e=this._idMap[t.data.node];if(e instanceof v){const t=[...e.getChildren()];for(let e=0;e<t.length;e++){const i=t[e];i.isEnableClose()&&i._delete()}0===e.getChildren().length&&e._delete(),this._tidy()}break}case h.FLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof b&&(e._setFloating(!0),function(t){const e=t.getParent();if(null!==e)if(e instanceof v){let i=!1,s=0;const n=e.getChildren();for(let e=0;e<n.length;e++){const o=n[e];if(o===t)i=!0;else if(!o.isFloating()&&(s=e,i))break}e._setSelected(s)}else e instanceof R&&e._setSelected(-1)}(e));break}case h.UNFLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof b&&(e._setFloating(!1),function(t){const e=t.getParent();if(null!==e&&(e instanceof v||e instanceof R)){const i=e.getChildren();for(let s=0;s<i.length;s++)if(i[s]===t)return void e._setSelected(s)}}(e));break}case h.RENAME_TAB:{const e=this._idMap[t.data.node];e instanceof b&&e._setName(t.data.text);break}case h.SELECT_TAB:{const e=this._idMap[t.data.tabNode];if(e instanceof b){const t=e.getParent(),i=t.getChildren().indexOf(e);t instanceof R?t.getSelected()===i?t._setSelected(-1):t._setSelected(i):t instanceof v&&(t.getSelected()!==i&&t._setSelected(i),this._activeTabSet=t)}break}case h.SET_ACTIVE_TABSET:{const e=this._idMap[t.data.tabsetNode];e instanceof v&&(this._activeTabSet=e);break}case h.ADJUST_SPLIT:{const e=this._idMap[t.data.node1],i=this._idMap[t.data.node2];(e instanceof v||e instanceof f)&&(i instanceof v||i instanceof f)&&(this._adjustSplitSide(e,t.data.weight1,t.data.pixelWidth1),this._adjustSplitSide(i,t.data.weight2,t.data.pixelWidth2));break}case h.ADJUST_BORDER_SPLIT:{const e=this._idMap[t.data.node];e instanceof R&&e._setSize(t.data.pos);break}case h.MAXIMIZE_TOGGLE:{const e=this._idMap[t.data.node];e instanceof v&&(e===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=e,this._activeTabSet=e));break}case h.UPDATE_MODEL_ATTRIBUTES:this._updateAttrs(t.data.json);break;case h.UPDATE_NODE_ATTRIBUTES:this._idMap[t.data.node]._updateAttrs(t.data.json)}return this._updateIdMap(),void 0!==this._changeListener&&this._changeListener(t),e}_updateIdMap(){this._idMap={},this.visitNodes((t=>this._idMap[t.getId()]=t))}_adjustSplitSide(t,e,s){t._setWeight(e),null!=t.getWidth()&&t.getOrientation()===i.VERT?t._updateAttrs({width:s}):null!=t.getHeight()&&t.getOrientation()===i.HORZ&&t._updateAttrs({height:s})}toJson(){const t={};return j._attributeDefinitions.toJson(t,this._attributes),this.visitNodes((t=>{t._fireEvent("save",void 0)})),{global:t,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let t=this._attributes.splitterSize;return-1===t&&(t=this._pointerFine?8:12),t}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(t){const e=t.getId();if(void 0!==this._idMap[e])throw new Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);"splitter"!==t.getType()&&(this._idMap[e]=t)}_layout(t,e){var i;return this._borderRects=this._borders._layoutBorder({outer:t,inner:t},e),t=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),null===(i=this._root)||void 0===i||i.calcMinSize(),this._root._layout(t,e),t}_findDropTargetNode(t,e,i){let s=this._root._findDropTargetNode(t,e,i);return void 0===s&&(s=this._borders._findDropTargetNode(t,e,i)),s}_tidy(){this._root._tidy()}_updateAttrs(t){j._attributeDefinitions.update(t,this._attributes)}_nextUniqueId(){return"#"+([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}_getAttribute(t){return this._attributes[t]}setOnAllowDrop(t){this._onAllowDrop=t}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(t){this._onCreateTabSet=t}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(j._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(f.getAttributeDefinitions().toTypescriptInterface("Row",j._attributeDefinitions)),console.log(v.getAttributeDefinitions().toTypescriptInterface("TabSet",j._attributeDefinitions)),console.log(b.getAttributeDefinitions().toTypescriptInterface("Tab",j._attributeDefinitions)),console.log(R.getAttributeDefinitions().toTypescriptInterface("Border",j._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}j._attributeDefinitions=j._createAttributeDefinitions()})(),o})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.FlexLayout=e(require("react"),require("react-dom")):t.FlexLayout=e(t.React,t.ReactDOM)}(self,((t,e)=>(()=>{"use strict";var i={899:e=>{e.exports=t},994:t=>{t.exports=e}},s={};function n(t){var e=s[t];if(void 0!==e)return e.exports;var o=s[t]={exports:{}};return i[t](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{n.r(o),n.d(o,{Action:()=>l,Actions:()=>h,BorderNode:()=>R,BorderSet:()=>Z,CLASSES:()=>g,DockLocation:()=>r,DragDrop:()=>d,DropInfo:()=>u,I18nLabel:()=>T,ICloseType:()=>p,Layout:()=>V,Model:()=>j,Node:()=>E,Orientation:()=>i,Rect:()=>s,RowNode:()=>f,SplitterNode:()=>m,TabNode:()=>b,TabSetNode:()=>v});var t=n(899),e=n(994);class i{static flip(t){return t===i.HORZ?i.VERT:i.HORZ}constructor(t){this._name=t}getName(){return this._name}toString(){return this._name}}i.HORZ=new i("horz"),i.VERT=new i("vert");class s{static empty(){return new s(0,0,0,0)}constructor(t,e,i,s){this.x=t,this.y=e,this.width=i,this.height=s}static fromElement(t){let{x:e,y:i,width:n,height:o}=t.getBoundingClientRect();return new s(e,i,n,o)}clone(){return new s(this.x,this.y,this.width,this.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}getBottom(){return this.y+this.height}getRight(){return this.x+this.width}getCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}positionElement(t,e){this.styleWithPosition(t.style,e)}styleWithPosition(t,e="absolute"){return t.left=this.x+"px",t.top=this.y+"px",t.width=Math.max(0,this.width)+"px",t.height=Math.max(0,this.height)+"px",t.position=e,t}contains(t,e){return this.x<=t&&t<=this.getRight()&&this.y<=e&&e<=this.getBottom()}removeInsets(t){return new s(this.x+t.left,this.y+t.top,Math.max(0,this.width-t.left-t.right),Math.max(0,this.height-t.top-t.bottom))}centerInRect(t){this.x=(t.width-this.width)/2,this.y=(t.height-this.height)/2}_getSize(t){let e=this.width;return t===i.VERT&&(e=this.height),e}toString(){return"(Rect: x="+this.x+", y="+this.y+", width="+this.width+", height="+this.height+")"}}class r{static getByName(t){return r.values[t]}static getLocation(t,e,i){if(e=(e-t.x)/t.width,i=(i-t.y)/t.height,e>=.25&&e<.75&&i>=.25&&i<.75)return r.CENTER;const s=i>=1-e;return i>=e?s?r.BOTTOM:r.LEFT:s?r.RIGHT:r.TOP}constructor(t,e,i){this._name=t,this._orientation=e,this._indexPlus=i,r.values[this._name]=this}getName(){return this._name}getOrientation(){return this._orientation}getDockRect(t){return this===r.TOP?new s(t.x,t.y,t.width,t.height/2):this===r.BOTTOM?new s(t.x,t.getBottom()-t.height/2,t.width,t.height/2):this===r.LEFT?new s(t.x,t.y,t.width/2,t.height):this===r.RIGHT?new s(t.getRight()-t.width/2,t.y,t.width/2,t.height):t.clone()}split(t,e){return this===r.TOP?{start:new s(t.x,t.y,t.width,e),end:new s(t.x,t.y+e,t.width,t.height-e)}:this===r.LEFT?{start:new s(t.x,t.y,e,t.height),end:new s(t.x+e,t.y,t.width-e,t.height)}:this===r.RIGHT?{start:new s(t.getRight()-e,t.y,e,t.height),end:new s(t.x,t.y,t.width-e,t.height)}:{start:new s(t.x,t.getBottom()-e,t.width,e),end:new s(t.x,t.y,t.width,t.height-e)}}reflect(){return this===r.TOP?r.BOTTOM:this===r.LEFT?r.RIGHT:this===r.RIGHT?r.LEFT:r.TOP}toString(){return"(DockLocation: name="+this._name+", orientation="+this._orientation+")"}}r.values={},r.TOP=new r("top",i.VERT,0),r.BOTTOM=new r("bottom",i.VERT,1),r.LEFT=new r("left",i.HORZ,0),r.RIGHT=new r("right",i.HORZ,1),r.CENTER=new r("center",i.VERT,0);const a=!("undefined"==typeof window||!window.document||!window.document.createElement);class d{constructor(){this._manualGlassManagement=!1,this._startX=0,this._startY=0,this._dragDepth=0,this._glassShowing=!1,this._dragging=!1,this._active=!1,a&&(this._glass=document.createElement("div"),this._glass.style.zIndex="998",this._glass.style.backgroundColor="transparent",this._glass.style.outline="none"),this._defaultGlassCursor="default",this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onKeyPress=this._onKeyPress.bind(this),this._onDragCancel=this._onDragCancel.bind(this),this._onDragEnter=this._onDragEnter.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.resizeGlass=this.resizeGlass.bind(this),this._lastClick=0,this._clickX=0,this._clickY=0}addGlass(t){var e;this._glassShowing?this._manualGlassManagement=!0:(this._document||(this._document=window.document),this._rootElement||(this._rootElement=this._document.body),this.resizeGlass(),null===(e=this._document.defaultView)||void 0===e||e.addEventListener("resize",this.resizeGlass),this._document.body.appendChild(this._glass),this._glass.tabIndex=-1,this._glass.focus(),this._glass.addEventListener("keydown",this._onKeyPress),this._glass.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._glass.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._glass.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._glassShowing=!0,this._fDragCancel=t,this._manualGlassManagement=!1)}resizeGlass(){s.fromElement(this._rootElement).positionElement(this._glass,"fixed")}hideGlass(){var t;this._glassShowing&&(this._document.body.removeChild(this._glass),null===(t=this._document.defaultView)||void 0===t||t.removeEventListener("resize",this.resizeGlass),this._glassShowing=!1,this._document=void 0,this._rootElement=void 0,this.setGlassCursorOverride(void 0))}_updateGlassCursor(){var t;this._glass.style.cursor=null!==(t=this._glassCursorOverride)&&void 0!==t?t:this._defaultGlassCursor}_setDefaultGlassCursor(t){this._defaultGlassCursor=t,this._updateGlassCursor()}setGlassCursorOverride(t){this._glassCursorOverride=t,this._updateGlassCursor()}startDrag(t,e,i,s,n,o,r,a,d){if(t&&this._lastEvent&&this._lastEvent.type.startsWith("touch")&&t.type.startsWith("mouse")&&t.timeStamp-this._lastEvent.timeStamp<500)return;if(this._dragging)return;this._lastEvent=t,this._document=a||window.document,this._rootElement=d||this._document.body;const l=this._getLocationEvent(t);this.addGlass(n),t?(this._startX=l.clientX,this._startY=l.clientY,window.matchMedia&&!window.matchMedia("(pointer: fine)").matches||this._setDefaultGlassCursor(getComputedStyle(t.target).cursor),this._stopPropagation(t),this._preventDefault(t)):(this._startX=0,this._startY=0,this._setDefaultGlassCursor("default")),this._dragging=!1,this._fDragStart=e,this._fDragMove=i,this._fDragEnd=s,this._fDragCancel=n,this._fClick=o,this._fDblClick=r,this._active=!0,"dragenter"===(null==t?void 0:t.type)?(this._dragDepth=1,this._rootElement.addEventListener("dragenter",this._onDragEnter,{passive:!1}),this._rootElement.addEventListener("dragover",this._onMouseMove,{passive:!1}),this._rootElement.addEventListener("dragleave",this._onDragLeave,{passive:!1}),this._document.addEventListener("dragend",this._onDragCancel,{passive:!1}),this._document.addEventListener("drop",this._onMouseUp,{passive:!1})):(this._document.addEventListener("mouseup",this._onMouseUp,{passive:!1}),this._document.addEventListener("mousemove",this._onMouseMove,{passive:!1}),this._document.addEventListener("touchend",this._onMouseUp,{passive:!1}),this._document.addEventListener("touchmove",this._onMouseMove,{passive:!1}))}isDragging(){return this._dragging}isActive(){return this._active}toString(){return"(DragDrop: startX="+this._startX+", startY="+this._startY+", dragging="+this._dragging+")"}_onKeyPress(t){27===t.keyCode&&this._onDragCancel()}_onDragCancel(){this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this.hideGlass(),void 0!==this._fDragCancel&&this._fDragCancel(this._dragging),this._dragging=!1,this._active=!1}_getLocationEvent(t){let e=t;return t&&t.touches&&(e=t.touches[0]),e}_getLocationEventEnd(t){let e=t;return t.changedTouches&&(e=t.changedTouches[0]),e}_stopPropagation(t){t.stopPropagation&&t.stopPropagation()}_preventDefault(t){return t.preventDefault&&t.cancelable&&t.preventDefault(),t}_onMouseMove(t){this._lastEvent=t;const e=this._getLocationEvent(t);return this._stopPropagation(t),this._preventDefault(t),!this._dragging&&(Math.abs(this._startX-e.clientX)>5||Math.abs(this._startY-e.clientY)>5)&&(this._dragging=!0,this._fDragStart&&(this._setDefaultGlassCursor("move"),this._dragging=this._fDragStart({clientX:this._startX,clientY:this._startY}))),this._dragging&&this._fDragMove&&this._fDragMove(e),!1}_onMouseUp(t){this._lastEvent=t;const e=this._getLocationEventEnd(t);if(this._stopPropagation(t),this._preventDefault(t),this._active=!1,this._rootElement.removeEventListener("dragenter",this._onDragEnter),this._rootElement.removeEventListener("dragover",this._onMouseMove),this._rootElement.removeEventListener("dragleave",this._onDragLeave),this._document.removeEventListener("dragend",this._onDragCancel),this._document.removeEventListener("drop",this._onMouseUp),this._document.removeEventListener("mousemove",this._onMouseMove),this._document.removeEventListener("mouseup",this._onMouseUp),this._document.removeEventListener("touchend",this._onMouseUp),this._document.removeEventListener("touchmove",this._onMouseMove),this._manualGlassManagement||this.hideGlass(),this._dragging)this._dragging=!1,this._fDragEnd&&this._fDragEnd(t);else if(this._fDragCancel&&this._fDragCancel(this._dragging),Math.abs(this._startX-e.clientX)<=5&&Math.abs(this._startY-e.clientY)<=5){let i=!1;const s=(new Date).getTime();Math.abs(this._clickX-e.clientX)<=5&&Math.abs(this._clickY-e.clientY)<=5&&s-this._lastClick<500&&this._fDblClick&&(this._fDblClick(t),i=!0),!i&&this._fClick&&this._fClick(t),this._lastClick=s,this._clickX=e.clientX,this._clickY=e.clientY}return!1}_onDragEnter(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth++,!1}_onDragLeave(t){return this._preventDefault(t),this._stopPropagation(t),this._dragDepth--,this._dragDepth<=0&&this._onDragCancel(),!1}}d.instance=new d;class l{constructor(t,e){this.type=t,this.data=e}}class h{static addNode(t,e,i,s,n){return new l(h.ADD_NODE,{json:t,toNode:e,location:i.getName(),index:s,select:n})}static moveNode(t,e,i,s,n){return new l(h.MOVE_NODE,{fromNode:t,toNode:e,location:i.getName(),index:s,select:n})}static deleteTab(t){return new l(h.DELETE_TAB,{node:t})}static deleteTabset(t){return new l(h.DELETE_TABSET,{node:t})}static renameTab(t,e){return new l(h.RENAME_TAB,{node:t,text:e})}static selectTab(t){return new l(h.SELECT_TAB,{tabNode:t})}static setActiveTabset(t){return new l(h.SET_ACTIVE_TABSET,{tabsetNode:t})}static adjustSplit(t){const e=t.node1Id,i=t.node2Id;return new l(h.ADJUST_SPLIT,{node1:e,weight1:t.weight1,pixelWidth1:t.pixelWidth1,node2:i,weight2:t.weight2,pixelWidth2:t.pixelWidth2})}static adjustBorderSplit(t,e){return new l(h.ADJUST_BORDER_SPLIT,{node:t,pos:e})}static maximizeToggle(t){return new l(h.MAXIMIZE_TOGGLE,{node:t})}static updateModelAttributes(t){return new l(h.UPDATE_MODEL_ATTRIBUTES,{json:t})}static updateNodeAttributes(t,e){return new l(h.UPDATE_NODE_ATTRIBUTES,{node:t,json:e})}static floatTab(t){return new l(h.FLOAT_TAB,{node:t})}static unFloatTab(t){return new l(h.UNFLOAT_TAB,{node:t})}}h.ADD_NODE="FlexLayout_AddNode",h.MOVE_NODE="FlexLayout_MoveNode",h.DELETE_TAB="FlexLayout_DeleteTab",h.DELETE_TABSET="FlexLayout_DeleteTabset",h.RENAME_TAB="FlexLayout_RenameTab",h.SELECT_TAB="FlexLayout_SelectTab",h.SET_ACTIVE_TABSET="FlexLayout_SetActiveTabset",h.ADJUST_SPLIT="FlexLayout_AdjustSplit",h.ADJUST_BORDER_SPLIT="FlexLayout_AdjustBorderSplit",h.MAXIMIZE_TOGGLE="FlexLayout_MaximizeToggle",h.UPDATE_MODEL_ATTRIBUTES="FlexLayout_UpdateModelAttributes",h.UPDATE_NODE_ATTRIBUTES="FlexLayout_UpdateNodeAttributes",h.FLOAT_TAB="FlexLayout_FloatTab",h.UNFLOAT_TAB="FlexLayout_UnFloatTab";class _{constructor(t,e,i,s){this.name=t,this.modelName=e,this.defaultValue=i,this.alwaysWriteJson=s,this.required=!1,this.fixed=!1,this.type="any"}setType(t){return this.type=t,this}setRequired(){return this.required=!0,this}setFixed(){return this.fixed=!0,this}}_.NUMBER="number",_.STRING="string",_.BOOLEAN="boolean";class c{constructor(){this.attributes=[],this.nameToAttribute={}}addWithAll(t,e,i,s){const n=new _(t,e,i,s);return this.attributes.push(n),this.nameToAttribute[t]=n,n}addInherited(t,e){return this.addWithAll(t,e,void 0,!1)}add(t,e,i){return this.addWithAll(t,void 0,e,i)}getAttributes(){return this.attributes}getModelName(t){const e=this.nameToAttribute[t];if(void 0!==e)return e.modelName}toJson(t,e){for(const i of this.attributes){const s=e[i.name];(i.alwaysWriteJson||s!==i.defaultValue)&&(t[i.name]=s)}}fromJson(t,e){for(const i of this.attributes){const s=t[i.name];e[i.name]=void 0===s?i.defaultValue:s}}update(t,e){for(const i of this.attributes)if(t.hasOwnProperty(i.name)){const s=t[i.name];void 0===s?delete e[i.name]:e[i.name]=s}}setDefaults(t){for(const e of this.attributes)t[e.name]=e.defaultValue}toTypescriptInterface(t,e){const i=[],s=this.attributes.sort(((t,e)=>t.name.localeCompare(e.name)));i.push("export interface I"+t+"Attributes {");for(let t=0;t<s.length;t++){const n=s[t];let o,r,a=n.type,d=n;void 0!==d.defaultValue?o=d.defaultValue:void 0!==d.modelName&&void 0!==e&&void 0!==e.nameToAttribute[d.modelName]&&(r=d.modelName,d=e.nameToAttribute[d.modelName],o=d.defaultValue,a=d.type);let l=JSON.stringify(o);const h=d.required||d.fixed?"":"?";if(n.fixed)i.push("\t"+n.name+": "+l+";");else{const t=(void 0!==o?"default: "+l:"")+(void 0!==r?" - inherited from global "+r:"");i.push("\t"+n.name+h+": "+a+";"+(t.length>0?" // "+t:""))}}return i.push("}"),i.join("\n")}}class u{constructor(t,e,i,s,n){this.node=t,this.rect=e,this.location=i,this.index=s,this.className=n}}var g,T,p;!function(t){t.FLEXLAYOUT__BORDER="flexlayout__border",t.FLEXLAYOUT__BORDER_="flexlayout__border_",t.FLEXLAYOUT__BORDER_BUTTON="flexlayout__border_button",t.FLEXLAYOUT__BORDER_BUTTON_="flexlayout__border_button_",t.FLEXLAYOUT__BORDER_BUTTON_CONTENT="flexlayout__border_button_content",t.FLEXLAYOUT__BORDER_BUTTON_LEADING="flexlayout__border_button_leading",t.FLEXLAYOUT__BORDER_BUTTON_TRAILING="flexlayout__border_button_trailing",t.FLEXLAYOUT__BORDER_BUTTON__SELECTED="flexlayout__border_button--selected",t.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED="flexlayout__border_button--unselected",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW="flexlayout__border_toolbar_button_overflow",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_="flexlayout__border_toolbar_button_overflow_",t.FLEXLAYOUT__BORDER_INNER="flexlayout__border_inner",t.FLEXLAYOUT__BORDER_INNER_="flexlayout__border_inner_",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER="flexlayout__border_inner_tab_container",t.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_="flexlayout__border_inner_tab_container_",t.FLEXLAYOUT__BORDER_TAB_DIVIDER="flexlayout__border_tab_divider",t.FLEXLAYOUT__BORDER_SIZER="flexlayout__border_sizer",t.FLEXLAYOUT__BORDER_TOOLBAR="flexlayout__border_toolbar",t.FLEXLAYOUT__BORDER_TOOLBAR_="flexlayout__border_toolbar_",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON="flexlayout__border_toolbar_button",t.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT="flexlayout__border_toolbar_button-float",t.FLEXLAYOUT__DRAG_RECT="flexlayout__drag_rect",t.FLEXLAYOUT__EDGE_RECT="flexlayout__edge_rect",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER="flexlayout__error_boundary_container",t.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT="flexlayout__error_boundary_content",t.FLEXLAYOUT__FLOATING_WINDOW_CONTENT="flexlayout__floating_window_content",t.FLEXLAYOUT__FLOATING_WINDOW_TAB="flexlayout__floating_window_tab",t.FLEXLAYOUT__LAYOUT="flexlayout__layout",t.FLEXLAYOUT__OUTLINE_RECT="flexlayout__outline_rect",t.FLEXLAYOUT__OUTLINE_RECT_EDGE="flexlayout__outline_rect_edge",t.FLEXLAYOUT__SPLITTER="flexlayout__splitter",t.FLEXLAYOUT__SPLITTER_EXTRA="flexlayout__splitter_extra",t.FLEXLAYOUT__SPLITTER_="flexlayout__splitter_",t.FLEXLAYOUT__SPLITTER_BORDER="flexlayout__splitter_border",t.FLEXLAYOUT__SPLITTER_DRAG="flexlayout__splitter_drag",t.FLEXLAYOUT__TAB="flexlayout__tab",t.FLEXLAYOUT__TABSET="flexlayout__tabset",t.FLEXLAYOUT__TABSET_HEADER="flexlayout__tabset_header",t.FLEXLAYOUT__TABSET_HEADER_SIZER="flexlayout__tabset_header_sizer",t.FLEXLAYOUT__TABSET_HEADER_CONTENT="flexlayout__tabset_header_content",t.FLEXLAYOUT__TABSET_MAXIMIZED="flexlayout__tabset-maximized",t.FLEXLAYOUT__TABSET_SELECTED="flexlayout__tabset-selected",t.FLEXLAYOUT__TABSET_SIZER="flexlayout__tabset_sizer",t.FLEXLAYOUT__TABSET_TAB_DIVIDER="flexlayout__tabset_tab_divider",t.FLEXLAYOUT__TABSET_CONTENT="flexlayout__tabset_content",t.FLEXLAYOUT__TABSET_TABBAR_INNER="flexlayout__tabset_tabbar_inner",t.FLEXLAYOUT__TABSET_TABBAR_INNER_="flexlayout__tabset_tabbar_inner_",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER="flexlayout__tabset_tabbar_inner_tab_container",t.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_="flexlayout__tabset_tabbar_inner_tab_container_",t.FLEXLAYOUT__TABSET_TABBAR_OUTER="flexlayout__tabset_tabbar_outer",t.FLEXLAYOUT__TABSET_TABBAR_OUTER_="flexlayout__tabset_tabbar_outer_",t.FLEXLAYOUT__TAB_BORDER="flexlayout__tab_border",t.FLEXLAYOUT__TAB_BORDER_="flexlayout__tab_border_",t.FLEXLAYOUT__TAB_BUTTON="flexlayout__tab_button",t.FLEXLAYOUT__TAB_BUTTON_CONTENT="flexlayout__tab_button_content",t.FLEXLAYOUT__TAB_BUTTON_LEADING="flexlayout__tab_button_leading",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW="flexlayout__tab_button_overflow",t.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT="flexlayout__tab_button_overflow_count",t.FLEXLAYOUT__TAB_BUTTON_TEXTBOX="flexlayout__tab_button_textbox",t.FLEXLAYOUT__TAB_BUTTON_TRAILING="flexlayout__tab_button_trailing",t.FLEXLAYOUT__TAB_BUTTON_STAMP="flexlayout__tab_button_stamp",t.FLEXLAYOUT__TAB_FLOATING="flexlayout__tab_floating",t.FLEXLAYOUT__TAB_FLOATING_INNER="flexlayout__tab_floating_inner",t.FLEXLAYOUT__TAB_TOOLBAR="flexlayout__tab_toolbar",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON="flexlayout__tab_toolbar_button",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_="flexlayout__tab_toolbar_button-",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT="flexlayout__tab_toolbar_button-float",t.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER="flexlayout__tab_toolbar_sticky_buttons_container",t.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE="flexlayout__tab_toolbar_button-close",t.FLEXLAYOUT__POPUP_MENU_CONTAINER="flexlayout__popup_menu_container",t.FLEXLAYOUT__POPUP_MENU_ITEM="flexlayout__popup_menu_item",t.FLEXLAYOUT__POPUP_MENU="flexlayout__popup_menu"}(g||(g={}));class E{constructor(t){this._dirty=!1,this._tempSize=0,this._model=t,this._attributes={},this._children=[],this._fixed=!1,this._rect=s.empty(),this._visible=!1,this._listeners={}}getId(){let t=this._attributes.id;return void 0!==t||(t=this._model._nextUniqueId(),this._setId(t)),t}getModel(){return this._model}getType(){return this._attributes.type}getParent(){return this._parent}getChildren(){return this._children}getRect(){return this._rect}isVisible(){return this._visible}getOrientation(){return void 0===this._parent?this._model.isRootOrientationVertical()?i.VERT:i.HORZ:i.flip(this._parent.getOrientation())}setEventListener(t,e){this._listeners[t]=e}removeEventListener(t){delete this._listeners[t]}_setId(t){this._attributes.id=t}_fireEvent(t,e){void 0!==this._listeners[t]&&this._listeners[t](e)}_getAttr(t){let e=this._attributes[t];if(void 0===e){const i=this._getAttributeDefinitions().getModelName(t);void 0!==i&&(e=this._model._getAttribute(i))}return e}_forEachNode(t,e){t(this,e),e++;for(const i of this._children)i._forEachNode(t,e)}_setVisible(t){t!==this._visible&&(this._fireEvent("visibility",{visible:t}),this._visible=t)}_getDrawChildren(){return this._children}_setParent(t){this._parent=t}_setRect(t){this._rect=t}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}_isFixed(){return this._fixed}_layout(t,e){this._rect=t}_findDropTargetNode(t,e,i){let s;if(this._rect.contains(e,i))if(void 0!==this._model.getMaximizedTabset())s=this._model.getMaximizedTabset().canDrop(t,e,i);else if(s=this.canDrop(t,e,i),void 0===s&&0!==this._children.length)for(const n of this._children)if(s=n._findDropTargetNode(t,e,i),void 0!==s)break;return s}canDrop(t,e,i){}_canDockInto(t,e){if(null!=e){if(e.location===r.CENTER&&!1===e.node.isEnableDrop())return!1;if(e.location===r.CENTER&&"tabset"===t.getType()&&void 0!==t.getName())return!1;if(e.location!==r.CENTER&&!1===e.node.isEnableDivide())return!1;if(this._model._getOnAllowDrop())return this._model._getOnAllowDrop()(t,e)}return!0}_removeChild(t){const e=this._children.indexOf(t);return-1!==e&&this._children.splice(e,1),this._dirty=!0,e}_addChild(t,e){return null!=e?this._children.splice(e,0,t):(this._children.push(t),e=this._children.length-1),t._parent=this,this._dirty=!0,e}_removeAll(){this._children=[],this._dirty=!0}_styleWithPosition(t){return null==t&&(t={}),this._rect.styleWithPosition(t)}_getTempSize(){return this._tempSize}_setTempSize(t){this._tempSize=t}isEnableDivide(){return!0}_toAttributeString(){return JSON.stringify(this._attributes,void 0,"\t")}}class m extends E{constructor(t){super(t),this._fixed=!0,this._attributes.type=m.TYPE,t._addNode(this)}getWidth(){return this._model.getSplitterSize()}getMinWidth(){return this.getOrientation()===i.VERT?this._model.getSplitterSize():0}getHeight(){return this._model.getSplitterSize()}getMinHeight(){return this.getOrientation()===i.HORZ?this._model.getSplitterSize():0}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getWeight(){return 0}_setWeight(t){}_getPrefSize(t){return this._model.getSplitterSize()}_updateAttrs(t){}_getAttributeDefinitions(){return new c}toJson(){}}m.TYPE="splitter";class b extends E{static _fromJson(t,e,i=!0){return new b(e,t,i)}static _createAttributeDefinitions(){const t=new c;return t.add("type",b.TYPE,!0).setType(_.STRING),t.add("id",void 0).setType(_.STRING),t.add("name","[Unnamed Tab]").setType(_.STRING),t.add("altName",void 0).setType(_.STRING),t.add("helpText",void 0).setType(_.STRING),t.add("component",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.add("floating",!1).setType(_.BOOLEAN),t.addInherited("enableClose","tabEnableClose").setType(_.BOOLEAN),t.addInherited("closeType","tabCloseType").setType("ICloseType"),t.addInherited("enableDrag","tabEnableDrag").setType(_.BOOLEAN),t.addInherited("enableRename","tabEnableRename").setType(_.BOOLEAN),t.addInherited("className","tabClassName").setType(_.STRING),t.addInherited("icon","tabIcon").setType(_.STRING),t.addInherited("enableRenderOnDemand","tabEnableRenderOnDemand").setType(_.BOOLEAN),t.addInherited("enableFloat","tabEnableFloat").setType(_.BOOLEAN),t.addInherited("borderWidth","tabBorderWidth").setType(_.NUMBER),t.addInherited("borderHeight","tabBorderHeight").setType(_.NUMBER),t}constructor(t,e,i=!0){super(t),this._extra={},b._attributeDefinitions.fromJson(e,this._attributes),!0===i&&t._addNode(this)}getWindow(){return this._window}getTabRect(){return this._tabRect}_setTabRect(t){this._tabRect=t}_setRenderedName(t){this._renderedName=t}_getNameForOverflowMenu(){const t=this._getAttr("altName");return void 0!==t?t:this._renderedName}getName(){return this._getAttr("name")}getHelpText(){return this._getAttr("helpText")}getComponent(){return this._getAttr("component")}getConfig(){return this._attributes.config}getExtraData(){return this._extra}isFloating(){return this._getAttr("floating")}getIcon(){return this._getAttr("icon")}isEnableClose(){return this._getAttr("enableClose")}getCloseType(){return this._getAttr("closeType")}isEnableFloat(){return this._getAttr("enableFloat")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableRename(){return this._getAttr("enableRename")}getClassName(){return this._getAttr("className")}isEnableRenderOnDemand(){return this._getAttr("enableRenderOnDemand")}_setName(t){this._attributes.name=t,this._window&&this._window.document&&(this._window.document.title=t)}_setFloating(t){this._attributes.floating=t}_layout(t,e){t.equals(this._rect)||this._fireEvent("resize",{rect:t}),this._rect=t}_delete(){this._parent._remove(this),this._fireEvent("close",{})}toJson(){const t={};return b._attributeDefinitions.toJson(t,this._attributes),t}_updateAttrs(t){b._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return b._attributeDefinitions}_setWindow(t){this._window=t}_setBorderWidth(t){this._attributes.borderWidth=t}_setBorderHeight(t){this._attributes.borderHeight=t}static getAttributeDefinitions(){return b._attributeDefinitions}}b.TYPE="tab",b._attributeDefinitions=b._createAttributeDefinitions();class f extends E{static _fromJson(t,e){const i=new f(e,t);if(null!=t.children)for(const s of t.children)if(s.type===v.TYPE){const t=v._fromJson(s,e);i._addChild(t)}else{const t=f._fromJson(s,e);i._addChild(t)}return i}static _createAttributeDefinitions(){const t=new c;return t.add("type",f.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t}constructor(t,e){super(t),this._dirty=!0,this._drawChildren=[],this._minHeight=0,this._minWidth=0,f._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this)}getWeight(){return this._attributes.weight}getWidth(){return this._getAttr("width")}getHeight(){return this._getAttr("height")}_setWeight(t){this._attributes.weight=t}_layout(t,e){super._layout(t,e);const n=this._rect._getSize(this.getOrientation());let o=0,r=0,a=0,d=0;const l=this._getDrawChildren();for(const t of l){const e=t._getPrefSize(this.getOrientation());t._isFixed()?void 0!==e&&(r+=e):void 0===e?o+=t.getWeight():(a+=e,d+=t.getWeight())}let h=!1,_=n-r-a;_<0&&(_=n-r,h=!0,o+=d);let c=0,u=0;for(const t of l){const e=t._getPrefSize(this.getOrientation());if(t._isFixed())void 0!==e&&t._setTempSize(e);else if(null==e||h){if(0===o)t._setTempSize(0);else{const e=t.getMinSize(this.getOrientation()),i=Math.floor(_*(t.getWeight()/o));t._setTempSize(Math.max(e,i))}u+=t._getTempSize()}else t._setTempSize(e);c+=t._getTempSize()}if(u>0){for(;c<n;)for(const t of l)if(!(t instanceof m)){const e=t._getPrefSize(this.getOrientation());!t._isFixed()&&(void 0===e||h)&&c<n&&(t._setTempSize(t._getTempSize()+1),c++)}for(;c>n;){let t=!1;for(const e of l)if(!(e instanceof m)){const i=e.getMinSize(this.getOrientation());e._getTempSize()>i&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0)}if(!t)break}for(;c>n;){let t=!1;for(const e of l)e instanceof m||e._getTempSize()>0&&c>n&&(e._setTempSize(e._getTempSize()-1),c--,t=!0);if(!t)break}}let g=0;for(const t of l)this.getOrientation()===i.HORZ?t._layout(new s(this._rect.x+g,this._rect.y,t._getTempSize(),this._rect.height),e):t._layout(new s(this._rect.x,this._rect.y+g,this._rect.width,t._getTempSize()),e),g+=t._getTempSize();return!0}_getSplitterBounds(t,e=!1){const s=[0,0],n=this._getDrawChildren(),o=n.indexOf(t),r=n[o-1],a=n[o+1];if(this.getOrientation()===i.HORZ){const i=e?r.getMinWidth():0,n=e?a.getMinWidth():0;s[0]=r.getRect().x+i,s[1]=a.getRect().getRight()-t.getWidth()-n}else{const i=e?r.getMinHeight():0,n=e?a.getMinHeight():0;s[0]=r.getRect().y+i,s[1]=a.getRect().getBottom()-t.getHeight()-n}return s}_calculateSplit(t,e){let i;const s=this._getDrawChildren(),n=s.indexOf(t),o=this._getSplitterBounds(t),r=s[n-1].getWeight()+s[n+1].getWeight(),a=Math.max(0,e-o[0]),d=Math.max(0,o[1]-e);if(a+d>0){const t=a*r/(a+d),e=d*r/(a+d);i={node1Id:s[n-1].getId(),weight1:t,pixelWidth1:a,node2Id:s[n+1].getId(),weight2:e,pixelWidth2:d}}return i}_getDrawChildren(){if(this._dirty){this._drawChildren=[];for(let t=0;t<this._children.length;t++){const e=this._children[t];if(0!==t){const t=new m(this._model);t._setParent(this),this._drawChildren.push(t)}this._drawChildren.push(e)}this._dirty=!1}return this._drawChildren}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getMinWidth(){return this._minWidth}getMinHeight(){return this._minHeight}calcMinSize(){this._minHeight=0,this._minWidth=0;let t=!0;for(const e of this._children){const s=e;s instanceof f&&s.calcMinSize(),this.getOrientation()===i.VERT?(this._minHeight+=s.getMinHeight(),t||(this._minHeight+=this._model.getSplitterSize()),this._minWidth=Math.max(this._minWidth,s.getMinWidth())):(this._minWidth+=s.getMinWidth(),t||(this._minWidth+=this._model.getSplitterSize()),this._minHeight=Math.max(this._minHeight,s.getMinHeight())),t=!1}}_tidy(){let t=0;for(;t<this._children.length;){const e=this._children[t];if(e instanceof f){e._tidy();const i=e.getChildren();if(0===i.length)this._removeChild(e);else if(1===i.length){const s=i[0];if(this._removeChild(e),s instanceof f){let i=0;const n=s.getChildren();for(const t of n)i+=t.getWeight();for(let s=0;s<n.length;s++){const o=n[s];o._setWeight(e.getWeight()*o.getWeight()/i),this._addChild(o,t+s)}}else s._setWeight(e.getWeight()),this._addChild(s,t)}else t++}else e instanceof v&&0===e.getChildren().length&&e.isEnableDeleteWhenEmpty()?(this._removeChild(e),e===this._model.getMaximizedTabset()&&this._model._setMaximizedTabset(void 0)):t++}if(this===this._model.getRoot()&&0===this._children.length){const t=this._model._getOnCreateTabSet();let e=t?t():{};e=Object.assign(Object.assign({},e),{selected:-1});const i=new v(this._model,e);this._model._setActiveTabset(i),this._addChild(i)}}canDrop(t,e,i){const s=i-this._rect.y,n=e-this._rect.x,o=this._rect.width,a=this._rect.height,d=50;let l;if(this._model.isEnableEdgeDock()&&void 0===this._parent){if(e<this._rect.x+10&&s>a/2-d&&s<a/2+d){const t=r.LEFT,e=t.getDockRect(this._rect);e.width=e.width/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(e>this._rect.getRight()-10&&s>a/2-d&&s<a/2+d){const t=r.RIGHT,e=t.getDockRect(this._rect);e.width=e.width/2,e.x+=e.width,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i<this._rect.y+10&&n>o/2-d&&n<o/2+d){const t=r.TOP,e=t.getDockRect(this._rect);e.height=e.height/2,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}else if(i>this._rect.getBottom()-10&&n>o/2-d&&n<o/2+d){const t=r.BOTTOM,e=t.getDockRect(this._rect);e.height=e.height/2,e.y+=e.height,l=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT_EDGE)}if(void 0!==l&&!t._canDockInto(t,l))return}return l}drop(t,e,i){const s=e,n=t.getParent();let o;if(n&&n._removeChild(t),void 0!==n&&n.getType()===v.TYPE&&n._setSelected(0),void 0!==n&&n.getType()===R.TYPE&&n._setSelected(-1),t instanceof v)o=t;else{const e=this._model._getOnCreateTabSet();o=new v(this._model,e?e(t):{}),o._addChild(t)}let a=this._children.reduce(((t,e)=>t+e.getWeight()),0);0===a&&(a=100),o._setWeight(a/3);const d=!this._model.isRootOrientationVertical();if(d&&s===r.LEFT||!d&&s===r.TOP)this._addChild(o,0);else if(d&&s===r.RIGHT||!d&&s===r.BOTTOM)this._addChild(o);else if(d&&s===r.TOP||!d&&s===r.LEFT){const t=new f(this._model,{}),e=new f(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(o),t._addChild(e),this._addChild(t)}else if(d&&s===r.BOTTOM||!d&&s===r.RIGHT){const t=new f(this._model,{}),e=new f(this._model,{});e._setWeight(75),o._setWeight(25);for(const t of this._children)e._addChild(t);this._removeAll(),t._addChild(e),t._addChild(o),this._addChild(t)}this._model._setActiveTabset(o),this._model._tidy()}toJson(){const t={};f._attributeDefinitions.toJson(t,this._attributes),t.children=[];for(const e of this._children)t.children.push(e.toJson());return t}isEnableDrop(){return!0}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}_getAttributeDefinitions(){return f._attributeDefinitions}_updateAttrs(t){f._attributeDefinitions.update(t,this._attributes)}static getAttributeDefinitions(){return f._attributeDefinitions}}f.TYPE="row",f._attributeDefinitions=f._createAttributeDefinitions();class v extends E{static _fromJson(t,e){const i=new v(e,t);if(null!=t.children)for(const s of t.children){const t=b._fromJson(s,e);i._addChild(t)}return 0===i._children.length&&i._setSelected(-1),t.maximized&&!0===t.maximized&&e._setMaximizedTabset(i),t.active&&!0===t.active&&e._setActiveTabset(i),i}static _createAttributeDefinitions(){const t=new c;return t.add("type",v.TYPE,!0).setType(_.STRING).setFixed(),t.add("id",void 0).setType(_.STRING),t.add("weight",100).setType(_.NUMBER),t.add("width",void 0).setType(_.NUMBER),t.add("height",void 0).setType(_.NUMBER),t.add("selected",0).setType(_.NUMBER),t.add("name",void 0).setType(_.STRING),t.add("config",void 0).setType("any"),t.addInherited("enableDeleteWhenEmpty","tabSetEnableDeleteWhenEmpty"),t.addInherited("enableDrop","tabSetEnableDrop"),t.addInherited("enableDrag","tabSetEnableDrag"),t.addInherited("enableDivide","tabSetEnableDivide"),t.addInherited("enableMaximize","tabSetEnableMaximize"),t.addInherited("enableClose","tabSetEnableClose"),t.addInherited("classNameTabStrip","tabSetClassNameTabStrip"),t.addInherited("classNameHeader","tabSetClassNameHeader"),t.addInherited("enableTabStrip","tabSetEnableTabStrip"),t.addInherited("borderInsets","tabSetBorderInsets"),t.addInherited("marginInsets","tabSetMarginInsets"),t.addInherited("minWidth","tabSetMinWidth"),t.addInherited("minHeight","tabSetMinHeight"),t.addInherited("headerHeight","tabSetHeaderHeight"),t.addInherited("tabStripHeight","tabSetTabStripHeight"),t.addInherited("tabLocation","tabSetTabLocation"),t.addInherited("autoSelectTab","tabSetAutoSelectTab").setType(_.BOOLEAN),t}constructor(t,e){super(t),v._attributeDefinitions.fromJson(e,this._attributes),t._addNode(this),this._calculatedTabBarHeight=0,this._calculatedHeaderBarHeight=0}getName(){return this._getAttr("name")}getSelected(){const t=this._attributes.selected;return void 0!==t?t:-1}getSelectedNode(){const t=this.getSelected();if(-1!==t)return this._children[t]}getWeight(){return this._getAttr("weight")}getWidth(){return this._getAttr("width")}getMinWidth(){return this._getAttr("minWidth")}getHeight(){return this._getAttr("height")}getMinHeight(){return this._getAttr("minHeight")}getMinSize(t){return t===i.HORZ?this.getMinWidth():this.getMinHeight()}getConfig(){return this._attributes.config}isMaximized(){return this._model.getMaximizedTabset()===this}isActive(){return this._model.getActiveTabset()===this}isEnableDeleteWhenEmpty(){return this._getAttr("enableDeleteWhenEmpty")}isEnableDrop(){return this._getAttr("enableDrop")}isEnableDrag(){return this._getAttr("enableDrag")}isEnableDivide(){return this._getAttr("enableDivide")}isEnableMaximize(){return this._getAttr("enableMaximize")}isEnableClose(){return this._getAttr("enableClose")}canMaximize(){return!!this.isEnableMaximize()&&(this.getModel().getMaximizedTabset()===this||this.getParent()!==this.getModel().getRoot()||1!==this.getModel().getRoot().getChildren().length)}isEnableTabStrip(){return this._getAttr("enableTabStrip")}isAutoSelectTab(){return this._getAttr("autoSelectTab")}getClassNameTabStrip(){return this._getAttr("classNameTabStrip")}getClassNameHeader(){return this._getAttr("classNameHeader")}calculateHeaderBarHeight(t){const e=this._getAttr("headerHeight");this._calculatedHeaderBarHeight=0!==e?e:t.headerBarSize}calculateTabBarHeight(t){const e=this._getAttr("tabStripHeight");this._calculatedTabBarHeight=0!==e?e:t.tabBarSize}getHeaderHeight(){return this._calculatedHeaderBarHeight}getTabStripHeight(){return this._calculatedTabBarHeight}getTabLocation(){return this._getAttr("tabLocation")}_setWeight(t){this._attributes.weight=t}_setSelected(t){this._attributes.selected=t}canDrop(t,e,i){let n;if(t===this){const t=r.CENTER,e=this._tabHeaderRect;n=new u(this,e,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._contentRect.contains(e,i)){let t=r.CENTER;void 0===this._model.getMaximizedTabset()&&(t=r.getLocation(this._contentRect,e,i));const s=t.getDockRect(this._rect);n=new u(this,s,t,-1,g.FLEXLAYOUT__OUTLINE_RECT)}else if(null!=this._tabHeaderRect&&this._tabHeaderRect.contains(e,i)){let t,i,o;if(0===this._children.length)t=this._tabHeaderRect.clone(),i=t.y+3,o=t.height-4,t.width=2;else{let a=this._children[0];t=a.getTabRect(),i=t.y,o=t.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(a=this._children[h],t=a.getTabRect(),l=t.x+t.width/2,e>=d&&e<l){const e=r.CENTER,a=new s(t.x-2,i,3,o);n=new u(this,a,e,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}}if(null==n){const e=r.CENTER,a=new s(t.getRight()-2,i,3,o);n=new u(this,a,e,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}if(t._canDockInto(t,n))return n}_layout(t,e){this.calculateHeaderBarHeight(e),this.calculateTabBarHeight(e),this.isMaximized()&&(t=this._model.getRoot().getRect()),t=t.removeInsets(this._getAttr("marginInsets")),this._rect=t,t=t.removeInsets(this._getAttr("borderInsets"));let i=0,n=0;void 0!==this.getName()&&(i+=this._calculatedHeaderBarHeight,n+=this._calculatedHeaderBarHeight),this.isEnableTabStrip()&&("top"===this.getTabLocation()?this._tabHeaderRect=new s(t.x,t.y+i,t.width,this._calculatedTabBarHeight):this._tabHeaderRect=new s(t.x,t.y+t.height-this._calculatedTabBarHeight,t.width,this._calculatedTabBarHeight),n+=this._calculatedTabBarHeight,"top"===this.getTabLocation()&&(i+=this._calculatedTabBarHeight)),this._contentRect=new s(t.x,t.y+i,t.width,t.height-n);for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected())}}_delete(){this._parent._removeChild(this)}_remove(t){const e=this._removeChild(t);this._model._tidy(),O(this,e)}drop(t,e,i,s){const n=e;if(this===t)return;let o=t.getParent(),a=0;if(void 0!==o&&(a=o._removeChild(t),o instanceof R&&o.getSelected()===a?o._setSelected(-1):O(o,a)),t.getType()===b.TYPE&&o===this&&a<i&&i>0&&i--,n===r.CENTER){let e=i;if(-1===e&&(e=this._children.length),t.getType()===b.TYPE)this._addChild(t,e),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(e);else{for(let i=0;i<t.getChildren().length;i++){const s=t.getChildren()[i];this._addChild(s,e),e++}-1===this.getSelected()&&this._children.length>0&&this._setSelected(0)}this._model._setActiveTabset(this)}else{let e;if(t instanceof b){const i=this._model._getOnCreateTabSet();e=new v(this._model,i?i(t):{}),e._addChild(t),o=e}else e=t;const i=this._parent,s=i.getChildren().indexOf(this);if(i.getOrientation()===n._orientation)e._setWeight(this.getWeight()/2),this._setWeight(this.getWeight()/2),i._addChild(e,s+n._indexPlus);else{const t=new f(this._model,{});t._setWeight(this.getWeight()),t._addChild(this),this._setWeight(50),e._setWeight(50),t._addChild(e,n._indexPlus),i._removeChild(this),i._addChild(t,s)}this._model._setActiveTabset(e)}this._model._tidy()}toJson(){const t={};return v._attributeDefinitions.toJson(t,this._attributes),t.children=this._children.map((t=>t.toJson())),this.isActive()&&(t.active=!0),this.isMaximized()&&(t.maximized=!0),t}_updateAttrs(t){v._attributeDefinitions.update(t,this._attributes)}_getAttributeDefinitions(){return v._attributeDefinitions}_getPrefSize(t){let e=this.getWidth();return t===i.VERT&&(e=this.getHeight()),e}static getAttributeDefinitions(){return v._attributeDefinitions}}function O(t,e){if(void 0!==t&&(t.getType()===v.TYPE||t.getType()===R.TYPE)){const i=t.getSelected();-1!==i&&(e===i&&t.getChildren().length>0?e>=t.getChildren().length&&t._setSelected(t.getChildren().length-1):e<i?t._setSelected(i-1):e>i||t._setSelected(-1))}}v.TYPE="tabset",v._attributeDefinitions=v._createAttributeDefinitions();class R extends E{static _fromJson(t,e){const i=r.getByName(t.location),s=new R(i,t,e);return t.children&&(s._children=t.children.map((t=>{const i=b._fromJson(t,e);return i._setParent(s),i}))),s}static _createAttributeDefinitions(){const t=new c;return t.add("type",R.TYPE,!0).setType(_.STRING).setFixed(),t.add("selected",-1).setType(_.NUMBER),t.add("show",!0).setType(_.BOOLEAN),t.add("config",void 0).setType("any"),t.addInherited("barSize","borderBarSize").setType(_.NUMBER),t.addInherited("enableDrop","borderEnableDrop").setType(_.BOOLEAN),t.addInherited("className","borderClassName").setType(_.STRING),t.addInherited("autoSelectTabWhenOpen","borderAutoSelectTabWhenOpen").setType(_.BOOLEAN),t.addInherited("autoSelectTabWhenClosed","borderAutoSelectTabWhenClosed").setType(_.BOOLEAN),t.addInherited("size","borderSize").setType(_.NUMBER),t.addInherited("minSize","borderMinSize").setType(_.NUMBER),t.addInherited("enableAutoHide","borderEnableAutoHide").setType(_.BOOLEAN),t}constructor(t,e,i){super(i),this._adjustedSize=0,this._calculatedBorderBarSize=0,this._location=t,this._drawChildren=[],this._attributes.id=`border_${t.getName()}`,R._attributeDefinitions.fromJson(e,this._attributes),i._addNode(this)}getLocation(){return this._location}getTabHeaderRect(){return this._tabHeaderRect}getRect(){return this._tabHeaderRect}getContentRect(){return this._contentRect}isEnableDrop(){return this._getAttr("enableDrop")}isAutoSelectTab(t){return null==t&&(t=-1!==this.getSelected()),t?this._getAttr("autoSelectTabWhenOpen"):this._getAttr("autoSelectTabWhenClosed")}getClassName(){return this._getAttr("className")}calcBorderBarSize(t){const e=this._getAttr("barSize");this._calculatedBorderBarSize=0!==e?e:t.borderBarSize}getBorderBarSize(){return this._calculatedBorderBarSize}getSize(){const t=this._getAttr("size"),e=this.getSelected();if(-1===e)return t;{const s=this._children[e],n=this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight");return-1===n?t:n}}getMinSize(){return this._getAttr("minSize")}getSelected(){return this._attributes.selected}getSelectedNode(){if(-1!==this.getSelected())return this._children[this.getSelected()]}getOrientation(){return this._location.getOrientation()}getConfig(){return this._attributes.config}isMaximized(){return!1}isShowing(){return!(!this._attributes.show||this._model._getShowHiddenBorder()!==this._location&&this.isAutoHide()&&0===this._children.length)}isAutoHide(){return this._getAttr("enableAutoHide")}_setSelected(t){this._attributes.selected=t}_setSize(t){const e=this.getSelected();if(-1===e)this._attributes.size=t;else{const s=this._children[e];-1===(this._location._orientation===i.HORZ?s._getAttr("borderWidth"):s._getAttr("borderHeight"))?this._attributes.size=t:this._location._orientation===i.HORZ?s._setBorderWidth(t):s._setBorderHeight(t)}}_updateAttrs(t){R._attributeDefinitions.update(t,this._attributes)}_getDrawChildren(){return this._drawChildren}_setAdjustedSize(t){this._adjustedSize=t}_getAdjustedSize(){return this._adjustedSize}_layoutBorderOuter(t,e){this.calcBorderBarSize(e);const i=this._location.split(t,this.getBorderBarSize());return this._tabHeaderRect=i.start,i.end}_layoutBorderInner(t,e){this._drawChildren=[];const i=this._location,s=i.split(t,this._adjustedSize+this._model.getSplitterSize()),n=i.reflect().split(s.start,this._model.getSplitterSize());this._contentRect=n.end;for(let t=0;t<this._children.length;t++){const i=this._children[t];i._layout(this._contentRect,e),i._setVisible(t===this.getSelected()),this._drawChildren.push(i)}if(-1===this.getSelected())return t;{const t=new m(this._model);return t._setParent(this),t._setRect(n.start),this._drawChildren.push(t),s.end}}_remove(t){const e=this._removeChild(t);-1!==this.getSelected()&&O(this,e)}canDrop(t,e,n){if(t.getType()!==b.TYPE)return;let o;const a=r.CENTER;if(this._tabHeaderRect.contains(e,n)){if(this._location._orientation===i.VERT)if(this._children.length>0){let t=this._children[0],i=t.getTabRect();const n=i.y,r=i.height;let d=this._tabHeaderRect.x,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],i=t.getTabRect(),l=i.x+i.width/2,e>=d&&e<l){const t=new s(i.x-2,n,3,r);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i.getRight()-2,n,3,r);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+1,this._tabHeaderRect.y+2,3,18);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}else if(this._children.length>0){let t=this._children[0],e=t.getTabRect();const i=e.x,r=e.width;let d=this._tabHeaderRect.y,l=0;for(let h=0;h<this._children.length;h++){if(t=this._children[h],e=t.getTabRect(),l=e.y+e.height/2,n>=d&&n<l){const t=new s(i,e.y-2,r,3);o=new u(this,t,a,h,g.FLEXLAYOUT__OUTLINE_RECT);break}d=l}if(null==o){const t=new s(i,e.getBottom()-2,r,3);o=new u(this,t,a,this._children.length,g.FLEXLAYOUT__OUTLINE_RECT)}}else{const t=new s(this._tabHeaderRect.x+2,this._tabHeaderRect.y+1,18,3);o=new u(this,t,a,0,g.FLEXLAYOUT__OUTLINE_RECT)}if(!t._canDockInto(t,o))return}else if(-1!==this.getSelected()&&this._contentRect.contains(e,n)){const e=this._contentRect;if(o=new u(this,e,a,-1,g.FLEXLAYOUT__OUTLINE_RECT),!t._canDockInto(t,o))return}return o}drop(t,e,i,s){let n=0;const o=t.getParent();void 0!==o&&(n=o._removeChild(t),o!==this&&o instanceof R&&o.getSelected()===n?o._setSelected(-1):O(o,n)),t.getType()===b.TYPE&&o===this&&n<i&&i>0&&i--;let r=i;-1===r&&(r=this._children.length),t.getType()===b.TYPE&&this._addChild(t,r),(s||!1!==s&&this.isAutoSelectTab())&&this._setSelected(r),this._model._tidy()}toJson(){const t={};return R._attributeDefinitions.toJson(t,this._attributes),t.location=this._location.getName(),t.children=this._children.map((t=>t.toJson())),t}_getSplitterBounds(t,e=!1){const i=[0,0],s=e?this.getMinSize():0,n=this._model._getOuterInnerRects().outer,o=this._model._getOuterInnerRects().inner,a=this._model.getRoot();return this._location===r.TOP?(i[0]=n.y+s,i[1]=Math.max(i[0],o.getBottom()-t.getHeight()-a.getMinHeight())):this._location===r.LEFT?(i[0]=n.x+s,i[1]=Math.max(i[0],o.getRight()-t.getWidth()-a.getMinWidth())):this._location===r.BOTTOM?(i[1]=n.getBottom()-t.getHeight()-s,i[0]=Math.min(i[1],o.y+a.getMinHeight())):this._location===r.RIGHT&&(i[1]=n.getRight()-t.getWidth()-s,i[0]=Math.min(i[1],o.x+a.getMinWidth())),i}_calculateSplit(t,e){const i=this._getSplitterBounds(t);return this._location===r.BOTTOM||this._location===r.RIGHT?Math.max(0,i[1]-e):Math.max(0,e-i[0])}_getAttributeDefinitions(){return R._attributeDefinitions}static getAttributeDefinitions(){return R._attributeDefinitions}}function A(e,i,s,n){let o=s?s(i):void 0,r=i.getName(),a=i.getName();if(void 0!==n){const t=n(i);void 0!==t&&("string"==typeof t?(r=t,a=t):void 0!==t.titleContent?(r=t.titleContent,a=t.name):r=t)}void 0===o&&void 0!==i.getIcon()&&(o=t.createElement("img",{style:{width:"1em",height:"1em"},src:i.getIcon(),alt:"leadingContent"}));const d={leading:o,content:r,name:a,buttons:[]};return e.customizeTab(i,d),i._setRenderedName(d.name),d}function y(t,e){e?t.visibility="hidden":t.display="none"}function L(t){let e=!1;return t.nativeEvent instanceof MouseEvent&&(0!==t.nativeEvent.button||t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&(e=!0),e}R.TYPE="border",R._attributeDefinitions=R._createAttributeDefinitions(),function(t){t.Close_Tab="Close",t.Close_Tabset="Close tabset",t.Move_Tab="Move: ",t.Move_Tabset="Move tabset",t.Maximize="Maximize tabset",t.Restore="Restore tabset",t.Float_Tab="Show selected tab in floating window",t.Overflow_Menu_Tooltip="Hidden tabs",t.Floating_Window_Message="This panel is shown in a floating window",t.Floating_Window_Show_Window="Show window",t.Floating_Window_Dock_Window="Dock window",t.Error_rendering_component="Error rendering component"}(T||(T={})),function(t){t[t.Visible=1]="Visible",t[t.Always=2]="Always",t[t.Selected=3]="Selected"}(p||(p={}));const N=e=>{const{layout:i,node:n,selected:o,border:r,iconFactory:a,titleFactory:d,icons:l,path:_}=e,c=t.useRef(null),u=t.useRef(null),E=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),b,f)},m=t=>{L(t)&&i.auxMouseClick(n,t)},b=()=>{i.doAction(h.selectTab(n.getId()))},f=t=>{},v=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):b()},O=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{R(),i.getEditingTab()===n&&u.current.select()}));const R=()=>{const t=i.getDomRect(),e=c.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},y=t=>{t.stopPropagation()},N=i.getClassName;let S=N(g.FLEXLAYOUT__BORDER_BUTTON)+" "+N(g.FLEXLAYOUT__BORDER_BUTTON_+r);S+=o?" "+N(g.FLEXLAYOUT__BORDER_BUTTON__SELECTED):" "+N(g.FLEXLAYOUT__BORDER_BUTTON__UNSELECTED),void 0!==n.getClassName()&&(S+=" "+n.getClassName());const D=A(i,n,a,d);let B=D.content?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_CONTENT)},D.content):null;const w=D.leading?t.createElement("div",{className:N(g.FLEXLAYOUT__BORDER_BUTTON_LEADING)},D.leading):null;if(i.getEditingTab()===n&&(B=t.createElement("input",{ref:u,className:N(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":_+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:y,onTouchStart:y})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);D.buttons.push(t.createElement("div",{key:"close","data-layout-path":_+"/button/close",title:e,className:N(g.FLEXLAYOUT__BORDER_BUTTON_TRAILING),onMouseDown:O,onClick:v,onTouchStart:O},"function"==typeof l.close?l.close(n):l.close))}return t.createElement("div",{ref:c,"data-layout-path":_,className:S,onMouseDown:E,onClick:m,onAuxClick:m,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:E,title:n.getHelpText()},w,B,D.buttons)},S=e=>{const{layout:i,node:s,iconFactory:n,titleFactory:o}=e,r=t.useRef(null),a=i.getClassName;let d=a(g.FLEXLAYOUT__TAB_BUTTON_STAMP);const l=A(i,s,n,o);let h=l.content?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},l.content):s._getNameForOverflowMenu();const _=l.leading?t.createElement("div",{className:a(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},l.leading):null;return t.createElement("div",{ref:r,className:d,title:s.getHelpText()},_,h)};function D(e,i,s,n,o,r){const a=n.getRootDiv(),l=n.getClassName,h=e.ownerDocument,_=e.getBoundingClientRect(),c=a.getBoundingClientRect(),u=h.createElement("div");u.className=l(g.FLEXLAYOUT__POPUP_MENU_CONTAINER),_.left<c.left+c.width/2?u.style.left=_.left-c.left+"px":u.style.right=c.right-_.right+"px",_.top<c.top+c.height/2?u.style.top=_.top-c.top+"px":u.style.bottom=c.bottom-_.bottom+"px",d.instance.addGlass((()=>T())),d.instance.setGlassCursorOverride("default"),a.appendChild(u);const T=()=>{n.hidePortal(),d.instance.hideGlass(),a.removeChild(u),u.removeEventListener("mousedown",p),h.removeEventListener("mousedown",E)},p=t=>{t.stopPropagation()},E=t=>{T()};u.addEventListener("mousedown",p),h.addEventListener("mousedown",E),n.showPortal(t.createElement(B,{currentDocument:h,onSelect:s,onHide:T,items:i,classNameMapper:l,layout:n,iconFactory:o,titleFactory:r}),u)}const B=e=>{const{items:i,onHide:s,onSelect:n,classNameMapper:o,layout:r,iconFactory:a,titleFactory:d}=e,l=i.map(((e,i)=>t.createElement("div",{key:e.index,className:o(g.FLEXLAYOUT__POPUP_MENU_ITEM),"data-layout-path":"/popup-menu/tb"+i,onClick:t=>((t,e)=>{n(t),s(),e.stopPropagation()})(e,t),title:e.node.getHelpText()},e.node.getModel().isLegacyOverflowMenu()?e.node._getNameForOverflowMenu():t.createElement(S,{node:e.node,layout:r,iconFactory:a,titleFactory:d}))));return t.createElement("div",{className:o(g.FLEXLAYOUT__POPUP_MENU),"data-layout-path":"/popup-menu"},l)},w=(e,n,o,r)=>{const a=t.useRef(!0),d=t.useRef(!1),l=t.useRef(new s(0,0,0,0)),h=t.useRef(null),[_,c]=t.useState(0),u=t.useRef(!1),[g,T]=t.useState([]),p=t.useRef(0);t.useLayoutEffect((()=>{u.current=!1}),[e.getSelectedNode(),e.getRect().width,e.getRect().height]),t.useLayoutEffect((()=>{O()})),t.useEffect((()=>{const t=h.current;return t.addEventListener("wheel",E,{passive:!1}),()=>{t.removeEventListener("wheel",E)}}),[]);const E=t=>{t.preventDefault()},m=t=>n===i.HORZ?t.x:t.y,b=t=>n===i.HORZ?t.getRight():t.getBottom(),f=t=>n===i.HORZ?t.width:t.height,O=()=>{!0===a.current&&(d.current=!1);const t=e instanceof v?e.getRect():e.getTabHeaderRect();let i=e.getChildren()[e.getChildren().length-1];const s=null===r.current?0:f(r.current.getBoundingClientRect());if(!0===a.current||0===p.current&&0!==g.length||t.width!==l.current.width||t.height!==l.current.height){p.current=g.length,l.current=t;const n=!(e instanceof v)||!0===e.isEnableTabStrip();let r=b(t)-s;if(null!==o.current&&(r-=f(o.current.getBoundingClientRect())),n&&e.getChildren().length>0){if(0===g.length&&0===_&&b(i.getTabRect())+2<r)return;let s=0;const n=e.getSelectedNode();if(n&&!u.current){const e=n.getTabRect(),i=m(e)-2,o=b(e)+2;f(e)+4>=r-m(t)?s=m(t)-i:(o>r||i<m(t))&&(i<m(t)&&(s=m(t)-i),o+s>r&&(s=r-o))}const o=Math.max(0,r-(b(i.getTabRect())+2+s)),l=Math.min(0,_+s+o),h=l-_,p=[];for(let i=0;i<e.getChildren().length;i++){const s=e.getChildren()[i];(m(s.getTabRect())+h<m(t)||b(s.getTabRect())+h>r)&&p.push({node:s,index:i})}p.length>0&&(d.current=!0),a.current=!1,T(p),c(l)}}else a.current=!0};return{selfRef:h,position:_,userControlledLeft:u,hiddenTabs:g,onMouseWheel:t=>{let e=0;e=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY,1===t.deltaMode&&(e*=40),c(_+e),u.current=!0,t.stopPropagation()},tabsTruncated:d.current}},C=e=>{const{border:s,layout:n,iconFactory:o,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:b,onMouseWheel:f,tabsTruncated:v}=w(s,i.flip(s.getOrientation()),_,u),O=t=>{L(t)&&n.auxMouseClick(s,t)},R=t=>{t.stopPropagation()},A=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,b,y):D(c.current,b,y,n,o,a),t.stopPropagation()},y=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},S=t=>{const e=s.getChildren()[s.getSelected()];void 0!==e&&n.doAction(h.floatTab(e.getId())),t.stopPropagation()},B=n.getClassName;let C=s.getTabHeaderRect().styleWithPosition({});const M=[],x=e=>{let i=s.getSelected()===e,r=s.getChildren()[e];M.push(t.createElement(N,{layout:n,border:s.getLocation().getName(),node:r,path:l+"/tb"+e,key:r.getId(),selected:i,iconFactory:o,titleFactory:a,icons:d})),e<s.getChildren().length-1&&M.push(t.createElement("div",{key:"divider"+e,className:B(g.FLEXLAYOUT__BORDER_TAB_DIVIDER)}))};for(let t=0;t<s.getChildren().length;t++)x(t);let U=B(g.FLEXLAYOUT__BORDER)+" "+B(g.FLEXLAYOUT__BORDER_+s.getLocation().getName());void 0!==s.getClassName()&&(U+=" "+s.getClassName());let I=[],F=[];const z={headerContent:void 0,buttons:I,stickyButtons:F,headerButtons:[]};if(n.customizeTabSet(s,z),I=z.buttons,b.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof d.more?d.more(s,b):t.createElement(t.Fragment,null,d.more,t.createElement("div",{className:B(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},b.length)),I.unshift(t.createElement("button",{key:"overflowbutton",ref:c,className:B(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+B(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW)+" "+B(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_+s.getLocation().getName()),title:e,onClick:A,onMouseDown:R,onTouchStart:R},i))}F.length>0&&(v?I=[...F,...I]:M.push(t.createElement("div",{ref:u,key:"sticky_buttons_container",onMouseDown:R,onTouchStart:R,onDragStart:t=>{t.preventDefault()},className:B(g.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},F)));const Y=s.getSelected();if(-1!==Y){const e=s.getChildren()[Y];if(void 0!==e&&n.isSupportsPopout()&&e.isEnableFloat()&&!e.isFloating()){const i=n.i18nName(T.Float_Tab);I.push(t.createElement("button",{key:"float",title:i,className:B(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON)+" "+B(g.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT),onClick:S,onMouseDown:R,onTouchStart:R},"function"==typeof d.popout?d.popout(e):d.popout))}}const H=t.createElement("div",{key:"toolbar",ref:_,className:B(g.FLEXLAYOUT__BORDER_TOOLBAR)+" "+B(g.FLEXLAYOUT__BORDER_TOOLBAR_+s.getLocation().getName())},I);C=n.styleFont(C);let X={};const W=s.getBorderBarSize()-1;return X=s.getLocation()===r.LEFT?{right:W,height:W,top:E}:s.getLocation()===r.RIGHT?{left:W,height:W,top:E}:{height:W,left:E},t.createElement("div",{ref:p,dir:"ltr",style:C,className:U,"data-layout-path":l,onClick:O,onAuxClick:O,onContextMenu:t=>{n.showContextMenu(s,t)},onWheel:f},t.createElement("div",{style:{height:W},className:B(g.FLEXLAYOUT__BORDER_INNER)+" "+B(g.FLEXLAYOUT__BORDER_INNER_+s.getLocation().getName())},t.createElement("div",{style:X,className:B(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER)+" "+B(g.FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_+s.getLocation().getName())},M)),H)},M=e=>{const{layout:s,node:n,path:o}=e,r=t.useRef([]),a=t.useRef(void 0),l=n.getParent(),_=t=>{d.instance.setGlassCursorOverride(n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"),d.instance.startDrag(t,u,T,E,c,void 0,void 0,s.getCurrentDocument(),s.getRootDiv()),r.current=l._getSplitterBounds(n,!0);const e=s.getRootDiv();a.current=s.getCurrentDocument().createElement("div"),a.current.style.position="absolute",a.current.className=s.getClassName(g.FLEXLAYOUT__SPLITTER_DRAG),a.current.style.cursor=n.getOrientation()===i.HORZ?"ns-resize":"ew-resize";const o=n.getRect();n.getOrientation()===i.VERT&&o.width<2?o.width=2:n.getOrientation()===i.HORZ&&o.height<2&&(o.height=2),o.positionElement(a.current),e.appendChild(a.current)},c=t=>{s.getRootDiv().removeChild(a.current)},u=()=>!0,T=t=>{const e=s.getDomRect(),o=t.clientX-e.left,r=t.clientY-e.top;a&&(n.getOrientation()===i.HORZ?a.current.style.top=m(r-4)+"px":a.current.style.left=m(o-4)+"px"),s.isRealtimeResize()&&p()},p=()=>{let t=0;if(a&&(t=n.getOrientation()===i.HORZ?a.current.offsetTop:a.current.offsetLeft),l instanceof R){const e=l._calculateSplit(n,t);s.doAction(h.adjustBorderSplit(n.getParent().getId(),e))}else{const e=l._calculateSplit(n,t);void 0!==e&&s.doAction(h.adjustSplit(e))}},E=()=>{p(),s.getRootDiv().removeChild(a.current)},m=t=>{const e=r.current;let i=t;return t<e[0]&&(i=e[0]),t>e[1]&&(i=e[1]),i},b=s.getClassName;let f=n.getRect();const v=f.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"});let O=b(g.FLEXLAYOUT__SPLITTER)+" "+b(g.FLEXLAYOUT__SPLITTER_+n.getOrientation().getName());l instanceof R?O+=" "+b(g.FLEXLAYOUT__SPLITTER_BORDER):void 0!==n.getModel().getMaximizedTabset()&&(v.display="none");const A=n.getModel().getSplitterExtra();if(0===A)return t.createElement("div",{style:v,"data-layout-path":o,className:O,onTouchStart:_,onMouseDown:_});{let e=f.clone();e.x=0,e.y=0,n.getOrientation()===i.VERT?e.width+=A:e.height+=A;const s=e.styleWithPosition({cursor:n.getOrientation()===i.HORZ?"ns-resize":"ew-resize"}),r=b(g.FLEXLAYOUT__SPLITTER_EXTRA);return t.createElement("div",{style:v,"data-layout-path":o,className:O},t.createElement("div",{style:s,className:r,onTouchStart:_,onMouseDown:_}))}};class x extends t.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,e){console.debug(t),console.debug(e)}render(){return this.state.hasError?t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER},t.createElement("div",{className:g.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT},this.props.message)):this.props.children}}const U=e=>{const{layout:i,selected:s,node:n,factory:o,path:r}=e,[a,d]=t.useState(!e.node.isEnableRenderOnDemand()||e.selected);t.useLayoutEffect((()=>{!a&&s&&d(!0)}));const l=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},_=i.getClassName,c=n.getModel().isUseVisibility(),u=n.getParent(),p=n._styleWithPosition();let E;s||y(p,c),u instanceof v&&(void 0===n.getModel().getMaximizedTabset()||u.isMaximized()||y(p,c)),a&&(E=o(n));let m=_(g.FLEXLAYOUT__TAB);return u instanceof R&&(m+=" "+_(g.FLEXLAYOUT__TAB_BORDER),m+=" "+_(g.FLEXLAYOUT__TAB_BORDER_+u.getLocation().getName())),t.createElement("div",{className:m,"data-layout-path":r,onMouseDown:l,onTouchStart:l,style:p},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,E)))},I=e=>{const{layout:i,node:n,selected:o,iconFactory:r,titleFactory:a,icons:d,path:l}=e,_=t.useRef(null),c=t.useRef(null),u=t=>{L(t)||i.getEditingTab()||i.dragStart(t,void 0,n,n.isEnableDrag(),m,b)},E=t=>{L(t)&&i.auxMouseClick(n,t)},m=()=>{i.doAction(h.selectTab(n.getId()))},b=t=>{n.isEnableRename()&&f()},f=()=>{i.setEditingTab(n),i.getCurrentDocument().body.addEventListener("mousedown",v),i.getCurrentDocument().body.addEventListener("touchstart",v)},v=t=>{t.target!==c.current&&(i.getCurrentDocument().body.removeEventListener("mousedown",v),i.getCurrentDocument().body.removeEventListener("touchstart",v),i.setEditingTab(void 0))},O=t=>{(()=>{const t=n.getCloseType();return!!(o||t===p.Always||t===p.Visible&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches)})()?i.doAction(h.deleteTab(n.getId())):m()},R=t=>{t.stopPropagation()};t.useLayoutEffect((()=>{y(),i.getEditingTab()===n&&c.current.select()}));const y=()=>{const t=i.getDomRect(),e=_.current.getBoundingClientRect();n._setTabRect(new s(e.left-t.left,e.top-t.top,e.width,e.height))},N=t=>{t.stopPropagation()},S=i.getClassName,D=n.getParent();let B=g.FLEXLAYOUT__TAB_BUTTON,w=S(B);w+=" "+S(B+"_"+D.getTabLocation()),w+=o?" "+S(B+"--selected"):" "+S(B+"--unselected"),void 0!==n.getClassName()&&(w+=" "+n.getClassName());const C=A(i,n,r,a);let M=C.content?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_CONTENT)},C.content):null;const x=C.leading?t.createElement("div",{className:S(g.FLEXLAYOUT__TAB_BUTTON_LEADING)},C.leading):null;if(i.getEditingTab()===n&&(M=t.createElement("input",{ref:c,className:S(g.FLEXLAYOUT__TAB_BUTTON_TEXTBOX),"data-layout-path":l+"/textbox",type:"text",autoFocus:!0,defaultValue:n.getName(),onKeyDown:t=>{27===t.keyCode?i.setEditingTab(void 0):13===t.keyCode&&(i.setEditingTab(void 0),i.doAction(h.renameTab(n.getId(),t.target.value)))},onMouseDown:N,onTouchStart:N})),n.isEnableClose()){const e=i.i18nName(T.Close_Tab);C.buttons.push(t.createElement("div",{key:"close","data-layout-path":l+"/button/close",title:e,className:S(g.FLEXLAYOUT__TAB_BUTTON_TRAILING),onMouseDown:R,onClick:O,onTouchStart:R},"function"==typeof d.close?d.close(n):d.close))}return t.createElement("div",{ref:_,"data-layout-path":l,className:w,onMouseDown:u,onClick:E,onAuxClick:E,onContextMenu:t=>{i.showContextMenu(n,t)},onTouchStart:u,title:n.getHelpText()},x,M,C.buttons)},F=e=>{const{node:s,layout:n,iconFactory:o,titleFactory:r,icons:a,path:d}=e,l=t.useRef(null),_=t.useRef(null),c=t.useRef(null),u=t.useRef(null),{selfRef:p,position:E,userControlledLeft:m,hiddenTabs:b,onMouseWheel:f,tabsTruncated:v}=w(s,i.HORZ,l,u),O=t=>{const e=n.getShowOverflowMenu();void 0!==e?e(s,t,b,R):D(_.current,b,R,n,o,r),t.stopPropagation()},R=t=>{n.doAction(h.selectTab(t.node.getId())),m.current=!1},A=t=>{if(!L(t)){let e=s.getName();if(e=void 0===e?"":": "+e,n.doAction(h.setActiveTabset(s.getId())),!n.getEditingTab()){const i=n.i18nName(T.Move_Tabset,e);void 0!==s.getModel().getMaximizedTabset()?n.dragStart(t,i,s,!1,(t=>{}),U):n.dragStart(t,i,s,s.isEnableDrag(),(t=>{}),U)}}},N=t=>{L(t)&&n.auxMouseClick(s,t)},S=t=>{n.showContextMenu(s,t)},B=t=>{t.stopPropagation()},C=t=>{s.canMaximize()&&n.maximize(s),t.stopPropagation()},M=t=>{n.doAction(h.deleteTabset(s.getId())),t.stopPropagation()},x=t=>{void 0!==z&&n.doAction(h.floatTab(z.getId())),t.stopPropagation()},U=t=>{s.canMaximize()&&n.maximize(s)},F=n.getClassName;null!==c.current&&0!==c.current.scrollLeft&&(c.current.scrollLeft=0);const z=s.getSelectedNode();let Y=s._styleWithPosition();void 0===s.getModel().getMaximizedTabset()||s.isMaximized()||y(Y,s.getModel().isUseVisibility());const H=[];if(s.isEnableTabStrip())for(let e=0;e<s.getChildren().length;e++){const i=s.getChildren()[e];let l=s.getSelected()===e;H.push(t.createElement(I,{layout:n,node:i,path:d+"/tb"+e,key:i.getId(),selected:l,iconFactory:o,titleFactory:r,icons:a})),e<s.getChildren().length-1&&H.push(t.createElement("div",{key:"divider"+e,className:F(g.FLEXLAYOUT__TABSET_TAB_DIVIDER)}))}const X=void 0!==s.getName();let W=[],P=[],k=[];const G={headerContent:s.getName(),stickyButtons:W,buttons:P,headerButtons:k};n.customizeTabSet(s,G);const V=G.headerContent;if(W=G.stickyButtons,P=G.buttons,k=G.headerButtons,b.length>0){const e=n.i18nName(T.Overflow_Menu_Tooltip);let i;i="function"==typeof a.more?a.more(s,b):t.createElement(t.Fragment,null,a.more,t.createElement("div",{className:F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)},b.length)),P.unshift(t.createElement("button",{key:"overflowbutton","data-layout-path":d+"/button/overflow",ref:_,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_BUTTON_OVERFLOW),title:e,onClick:O,onMouseDown:B,onTouchStart:B},i))}if(W.length>0&&(v?P=[...W,...P]:H.push(t.createElement("div",{ref:u,key:"sticky_buttons_container",onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()},className:F(g.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)},W))),void 0!==z&&n.isSupportsPopout()&&z.isEnableFloat()&&!z.isFloating()){const e=n.i18nName(T.Float_Tab);P.push(t.createElement("button",{key:"float","data-layout-path":d+"/button/float",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_FLOAT),onClick:x,onMouseDown:B,onTouchStart:B},"function"==typeof a.popout?a.popout(z):a.popout))}if(s.canMaximize()){const e=n.i18nName(T.Restore),i=n.i18nName(T.Maximize);(X?k:P).push(t.createElement("button",{key:"max","data-layout-path":d+"/button/max",title:s.isMaximized()?e:i,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_+(s.isMaximized()?"max":"min")),onClick:C,onMouseDown:B,onTouchStart:B},s.isMaximized()?"function"==typeof a.restore?a.restore(s):a.restore:"function"==typeof a.maximize?a.maximize(s):a.maximize))}if(!s.isMaximized()&&s.isEnableClose()){const e=n.i18nName(T.Close_Tabset);(X?k:P).push(t.createElement("button",{key:"close","data-layout-path":d+"/button/close",title:e,className:F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON)+" "+F(g.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE),onClick:M,onMouseDown:B,onTouchStart:B},"function"==typeof a.closeTabset?a.closeTabset(s):a.closeTabset))}const J=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},P);let Z,j,q=F(g.FLEXLAYOUT__TABSET_TABBAR_OUTER);if(void 0!==s.getClassNameTabStrip()&&(q+=" "+s.getClassNameTabStrip()),q+=" "+g.FLEXLAYOUT__TABSET_TABBAR_OUTER_+s.getTabLocation(),s.isActive()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&!X&&(q+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),X){const e=t.createElement("div",{key:"toolbar",ref:l,className:F(g.FLEXLAYOUT__TAB_TOOLBAR),onMouseDown:B,onTouchStart:B,onDragStart:t=>{t.preventDefault()}},k);let i=F(g.FLEXLAYOUT__TABSET_HEADER);s.isActive()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_SELECTED)),s.isMaximized()&&(i+=" "+F(g.FLEXLAYOUT__TABSET_MAXIMIZED)),void 0!==s.getClassNameHeader()&&(i+=" "+s.getClassNameHeader()),Z=t.createElement("div",{className:i,style:{height:s.getHeaderHeight()+"px"},"data-layout-path":d+"/header",onMouseDown:A,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:A},t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_HEADER_CONTENT)},V),e)}const K={height:s.getTabStripHeight()+"px"};j=t.createElement("div",{className:q,style:K,"data-layout-path":d+"/tabstrip",onMouseDown:A,onContextMenu:S,onClick:N,onAuxClick:N,onTouchStart:A},t.createElement("div",{ref:c,className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_+s.getTabLocation())},t.createElement("div",{style:{left:E},className:F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER)+" "+F(g.FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_+s.getTabLocation())},H)),J),Y=n.styleFont(Y);var $=void 0;if(0===s.getChildren().length){const t=n.getTabSetPlaceHolderCallback();t&&($=t(s))}const Q=t.createElement("div",{className:F(g.FLEXLAYOUT__TABSET_CONTENT)},$);var tt;return tt="top"===s.getTabLocation()?t.createElement(t.Fragment,null,Z,j,Q):t.createElement(t.Fragment,null,Z,Q,j),t.createElement("div",{ref:p,dir:"ltr","data-layout-path":d,style:Y,className:F(g.FLEXLAYOUT__TABSET),onWheel:f},tt)},z=i=>{const{title:s,id:n,url:o,rect:r,onCloseWindow:a,onSetWindow:d,children:l}=i,h=t.useRef(null),_=t.useRef(null),[c,u]=t.useState(void 0);return t.useLayoutEffect((()=>{_.current&&clearTimeout(_.current);let t=!0;const e=r,i=Array.from(window.document.styleSheets).reduce(((t,e)=>{let i;try{i=e.cssRules}catch(t){}try{return[...t,{href:e.href,type:e.type,rules:i?Array.from(i).map((t=>t.cssText)):null}]}catch(e){return t}}),[]);return h.current=window.open(o,n,`left=${e.x},top=${e.y},width=${e.width},height=${e.height}`),null!==h.current?(d(n,h.current),window.addEventListener("beforeunload",(()=>{h.current&&(h.current.close(),h.current=null)})),h.current.addEventListener("load",(()=>{if(t){const t=h.current.document;t.title=s;const e=t.createElement("div");e.className=g.FLEXLAYOUT__FLOATING_WINDOW_CONTENT,t.body.appendChild(e),function(t,e){const i=t.head,s=[];for(const n of e)if(n.href){const e=t.createElement("link");e.type=n.type,e.rel="stylesheet",e.href=n.href,i.appendChild(e),s.push(new Promise(((t,i)=>{e.onload=()=>t(!0)})))}else if(n.rules){const e=t.createElement("style");for(const i of n.rules)e.appendChild(t.createTextNode(i));i.appendChild(e)}return Promise.all(s)}(t,i).then((()=>{u(e)})),h.current.addEventListener("beforeunload",(()=>{a(n)}))}}))):(console.warn(`Unable to open window ${o}`),a(n)),()=>{t=!1,_.current=setTimeout((()=>{h.current&&(h.current.close(),h.current=null)}),0)}}),[]),void 0!==c?(0,e.createPortal)(l,c):null},Y=e=>{const{layout:i,node:s,factory:n}=e,o=i.getClassName,r=n(s);return t.createElement("div",{className:o(g.FLEXLAYOUT__FLOATING_WINDOW_TAB)},t.createElement(x,{message:e.layout.i18nName(T.Error_rendering_component)},t.createElement(t.Fragment,null,r)))},H=e=>{const{layout:i,selected:s,node:n,path:o}=e,r=()=>{n.getWindow()&&n.getWindow().focus()},a=()=>{i.doAction(h.unFloatTab(n.getId()))},d=()=>{const t=n.getParent();t.getType()===v.TYPE&&(t.isActive()||i.doAction(h.setActiveTabset(t.getId())))},l=i.getClassName,_=n.getParent(),c=n._styleWithPosition();s||y(c,n.getModel().isUseVisibility()),_ instanceof v&&(void 0===n.getModel().getMaximizedTabset()||_.isMaximized()||y(c,n.getModel().isUseVisibility()));const u=i.i18nName(T.Floating_Window_Message),p=i.i18nName(T.Floating_Window_Show_Window),E=i.i18nName(T.Floating_Window_Dock_Window),m=i.getOnRenderFloatingTabPlaceholder();return m?t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),onMouseDown:d,onTouchStart:d,style:c},m(a,r)):t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING),"data-layout-path":o,onMouseDown:d,onTouchStart:d,style:c},t.createElement("div",{className:l(g.FLEXLAYOUT__TAB_FLOATING_INNER)},t.createElement("div",null,u),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),r()}},p)),t.createElement("div",null,t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a()}},E))))},X={width:"1em",height:"1em",display:"flex",alignItems:"center"},W=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24"},t.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),t.createElement("path",{stroke:"var(--color-icon)",fill:"var(--color-icon)",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),P={close:t.createElement(W,null),closeTabset:t.createElement(W,null),popout:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 20 20",fill:"var(--color-icon)"},t.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),t.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))),null),maximize:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))),null),restore:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))),null),more:t.createElement((()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",style:X,viewBox:"0 0 24 24",fill:"var(--color-icon)"},t.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t.createElement("path",{stroke:"var(--color-icon)",d:"M7 10l5 5 5-5z"}))),null)},k="undefined"!=typeof window&&(window.document.documentMode||/Edge\//.test(window.navigator.userAgent)),G="undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(hover: hover) and (pointer: fine)").matches&&!k;class V extends t.Component{constructor(i){super(i),this.firstMove=!1,this.dragRectRendered=!0,this.dragDivText=void 0,this.edgeRectLength=100,this.edgeRectWidth=10,this.onModelChange=t=>{this.forceUpdate(),this.props.onModelChange&&this.props.onModelChange(this.props.model,t)},this.updateRect=(t=this.getDomRect())=>{const e=new s(0,0,t.width,t.height);e.equals(this.state.rect)||0===e.width||0===e.height||this.setState({rect:e})},this.updateLayoutMetrics=()=>{if(this.findHeaderBarSizeRef.current){const t=this.findHeaderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedHeaderBarSize&&this.setState({calculatedHeaderBarSize:t})}if(this.findTabBarSizeRef.current){const t=this.findTabBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedTabBarSize&&this.setState({calculatedTabBarSize:t})}if(this.findBorderBarSizeRef.current){const t=this.findBorderBarSizeRef.current.getBoundingClientRect().height;t!==this.state.calculatedBorderBarSize&&this.setState({calculatedBorderBarSize:t})}},this.getClassName=t=>void 0===this.props.classNameMapper?t:this.props.classNameMapper(t),this.onCloseWindow=t=>{this.doAction(h.unFloatTab(t));try{this.props.model.getNodeById(t)._setWindow(void 0)}catch(t){}},this.onSetWindow=(t,e)=>{this.props.model.getNodeById(t)._setWindow(e)},this.onCancelAdd=()=>{var t,e;this.selfRef.current.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(e=null===(t=this.customDrop)||void 0===t?void 0:t.invalidated)||void 0===e||e.call(t)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0},this.onCancelDrag=t=>{var e,i;if(t){const t=this.selfRef.current;try{t.removeChild(this.outlineDiv)}catch(t){}try{t.removeChild(this.dragDiv)}catch(t){}this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0);try{null===(i=null===(e=this.customDrop)||void 0===e?void 0:e.invalidated)||void 0===i||i.call(e)}catch(t){console.error(t)}d.instance.hideGlass(),this.newTabJson=void 0,this.customDrop=void 0}this.setState({showHiddenBorder:r.CENTER})},this.onDragDivMouseDown=t=>{t.preventDefault(),this.dragStart(t,this.dragDivText,b._fromJson(this.newTabJson,this.props.model,!1),!0,void 0,void 0)},this.dragStart=(t,e,i,s,n,o)=>{s?(this.dragNode=i,this.dragDivText=e,d.instance.startDrag(t,this.onDragStart,this.onDragMove,this.onDragEnd,this.onCancelDrag,n,o,this.currentDocument,this.selfRef.current)):d.instance.startDrag(t,void 0,void 0,void 0,void 0,n,o,this.currentDocument,this.selfRef.current)},this.dragRectRender=(e,i,s,n)=>{let o;if(void 0!==e?o=t.createElement("div",{style:{whiteSpace:"pre"}},e.replace("<br>","\n")):i&&i instanceof b&&(o=t.createElement(S,{node:i,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory})),void 0!==this.props.onRenderDragRect){const t=this.props.onRenderDragRect(o,i,s);void 0!==t&&(o=t)}this.dragDiv.style.visibility="hidden",this.dragRectRendered=!1,this.showPortal(t.createElement(J,{onRendered:()=>{this.dragRectRendered=!0,null==n||n()}},o),this.dragDiv)},this.showPortal=(t,i)=>{const s=(0,e.createPortal)(t,i);this.setState({portal:s})},this.hidePortal=()=>{this.setState({portal:void 0})},this.onDragStart=()=>{this.dropInfo=void 0,this.customDrop=void 0;const t=this.selfRef.current;return this.outlineDiv=this.currentDocument.createElement("div"),this.outlineDiv.className=this.getClassName(g.FLEXLAYOUT__OUTLINE_RECT),this.outlineDiv.style.visibility="hidden",t.appendChild(this.outlineDiv),null==this.dragDiv&&(this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragRectRender(this.dragDivText,this.dragNode,this.newTabJson),t.appendChild(this.dragDiv)),void 0===this.props.model.getMaximizedTabset()&&this.setState({showEdges:this.props.model.isEnableEdgeDock()}),void 0!==this.dragNode&&this.dragNode instanceof b&&void 0!==this.dragNode.getTabRect()&&this.dragNode.getTabRect().positionElement(this.outlineDiv),this.firstMove=!0,!0},this.onDragMove=t=>{if(!1===this.firstMove){const t=this.props.model._getAttribute("tabDragSpeed");this.outlineDiv.style.transition=`top ${t}s, left ${t}s, width ${t}s, height ${t}s`}this.firstMove=!1;const e=this.selfRef.current.getBoundingClientRect(),i={x:t.clientX-e.left,y:t.clientY-e.top};this.checkForBorderToShow(i.x,i.y);const s=this.dragDiv.getBoundingClientRect();let n=i.x-s.width/2;n+s.width>e.width&&(n=e.width-s.width),n=Math.max(0,n),this.dragDiv.style.left=n+"px",this.dragDiv.style.top=i.y+5+"px",this.dragRectRendered&&"hidden"===this.dragDiv.style.visibility&&(this.dragDiv.style.visibility="visible");let o=this.props.model._findDropTargetNode(this.dragNode,i.x,i.y);o&&(this.props.onTabDrag?this.handleCustomTabDrag(o,i,t):(this.dropInfo=o,this.outlineDiv.className=this.getClassName(o.className),o.rect.positionElement(this.outlineDiv),this.outlineDiv.style.visibility="visible"))},this.onDragEnd=t=>{const e=this.selfRef.current;if(e.removeChild(this.outlineDiv),e.removeChild(this.dragDiv),this.dragDiv=void 0,this.hidePortal(),this.setState({showEdges:!1}),d.instance.hideGlass(),this.dropInfo)if(this.customDrop){this.newTabJson=void 0;try{const{callback:t,dragging:e,over:i,x:s,y:n,location:o}=this.customDrop;t(e,i,s,n,o),null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(),this.fnNewNodeDropped=void 0)}catch(t){console.error(t)}}else if(void 0!==this.newTabJson){const e=this.doAction(h.addNode(this.newTabJson,this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));null!=this.fnNewNodeDropped&&(this.fnNewNodeDropped(e,t),this.fnNewNodeDropped=void 0),this.newTabJson=void 0}else void 0!==this.dragNode&&this.doAction(h.moveNode(this.dragNode.getId(),this.dropInfo.node.getId(),this.dropInfo.location,this.dropInfo.index));this.setState({showHiddenBorder:r.CENTER})},this.props.model._setChangeListener(this.onModelChange),this.tabIds=[],this.selfRef=t.createRef(),this.findHeaderBarSizeRef=t.createRef(),this.findTabBarSizeRef=t.createRef(),this.findBorderBarSizeRef=t.createRef(),this.supportsPopout=void 0!==i.supportsPopout?i.supportsPopout:G,this.popoutURL=i.popoutURL?i.popoutURL:"popout.html",this.icons=Object.assign(Object.assign({},P),i.icons),this.state={rect:new s(0,0,0,0),calculatedHeaderBarSize:25,calculatedTabBarSize:26,calculatedBorderBarSize:30,editingTab:void 0,showHiddenBorder:r.CENTER,showEdges:!1},this.onDragEnter=this.onDragEnter.bind(this)}styleFont(t){return this.props.font&&(this.selfRef.current&&(this.props.font.size&&this.selfRef.current.style.setProperty("--font-size",this.props.font.size),this.props.font.family&&this.selfRef.current.style.setProperty("--font-family",this.props.font.family)),this.props.font.style&&(t.fontStyle=this.props.font.style),this.props.font.weight&&(t.fontWeight=this.props.font.weight)),t}doAction(t){if(void 0!==this.props.onAction){const e=this.props.onAction(t);return void 0!==e?this.props.model.doAction(e):void 0}return this.props.model.doAction(t)}componentDidMount(){this.updateRect(),this.updateLayoutMetrics(),this.currentDocument=this.selfRef.current.ownerDocument,this.currentWindow=this.currentDocument.defaultView,this.resizeObserver=new ResizeObserver((t=>{this.updateRect(t[0].contentRect)})),this.resizeObserver.observe(this.selfRef.current)}componentDidUpdate(){this.updateLayoutMetrics(),this.props.model!==this.previousModel&&(void 0!==this.previousModel&&this.previousModel._setChangeListener(void 0),this.props.model._setChangeListener(this.onModelChange),this.previousModel=this.props.model)}getCurrentDocument(){return this.currentDocument}getDomRect(){return this.selfRef.current.getBoundingClientRect()}getRootDiv(){return this.selfRef.current}isSupportsPopout(){return this.supportsPopout}isRealtimeResize(){var t;return null!==(t=this.props.realtimeResize)&&void 0!==t&&t}onTabDrag(...t){var e,i;return null===(i=(e=this.props).onTabDrag)||void 0===i?void 0:i.call(e,...t)}getPopoutURL(){return this.popoutURL}componentWillUnmount(){var t;null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.selfRef.current)}setEditingTab(t){this.setState({editingTab:t})}getEditingTab(){return this.state.editingTab}render(){if(!this.selfRef.current)return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT)},this.metricsElements());this.props.model._setPointerFine(window&&window.matchMedia&&window.matchMedia("(pointer: fine)").matches);const e=[],i=[],s=[],n={},o=[],r={headerBarSize:this.state.calculatedHeaderBarSize,tabBarSize:this.state.calculatedTabBarSize,borderBarSize:this.state.calculatedBorderBarSize};this.props.model._setShowHiddenBorder(this.state.showHiddenBorder),this.centerRect=this.props.model._layout(this.state.rect,r),this.renderBorder(this.props.model.getBorderSet(),e,n,s,o),this.renderChildren("",this.props.model.getRoot(),i,n,s,o);const a=[],d={};for(const t of this.tabIds)n[t]&&(a.push(t),d[t]=t);this.tabIds=a;for(const t of Object.keys(n))d[t]||this.tabIds.push(t);const l=[];if(this.state.showEdges){const e=this.centerRect,i=this.edgeRectLength,s=this.edgeRectWidth,n=this.edgeRectLength/2,o=this.getClassName(g.FLEXLAYOUT__EDGE_RECT),r=50;l.push(t.createElement("div",{key:"North",style:{top:e.y,left:e.x+e.width/2-n,width:i,height:s,borderBottomLeftRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"West",style:{top:e.y+e.height/2-n,left:e.x,width:s,height:i,borderTopRightRadius:r,borderBottomRightRadius:r},className:o})),l.push(t.createElement("div",{key:"South",style:{top:e.y+e.height-s,left:e.x+e.width/2-n,width:i,height:s,borderTopLeftRadius:r,borderTopRightRadius:r},className:o})),l.push(t.createElement("div",{key:"East",style:{top:e.y+e.height/2-n,left:e.x+e.width-s,width:s,height:i,borderTopLeftRadius:r,borderBottomLeftRadius:r},className:o}))}return t.createElement("div",{ref:this.selfRef,className:this.getClassName(g.FLEXLAYOUT__LAYOUT),onDragEnter:this.props.onExternalDrag?this.onDragEnter:void 0},i,this.tabIds.map((t=>n[t])),e,o,l,s,this.metricsElements(),this.state.portal)}metricsElements(){const e=this.styleFont({visibility:"hidden"});return t.createElement(t.Fragment,null,t.createElement("div",{key:"findHeaderBarSize",ref:this.findHeaderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_HEADER_SIZER)},"FindHeaderBarSize"),t.createElement("div",{key:"findTabBarSize",ref:this.findTabBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__TABSET_SIZER)},"FindTabBarSize"),t.createElement("div",{key:"findBorderBarSize",ref:this.findBorderBarSizeRef,style:e,className:this.getClassName(g.FLEXLAYOUT__BORDER_SIZER)},"FindBorderBarSize"))}renderBorder(e,s,n,o,r){for(const a of e.getBorders()){const e=`/border/${a.getLocation().getName()}`;if(a.isShowing()){s.push(t.createElement(C,{key:`border_${a.getLocation().getName()}`,path:e,border:a,layout:this,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons}));const d=a._getDrawChildren();let l=0,h=0;for(const s of d){if(s instanceof m){let i=e+"/s";r.push(t.createElement(M,{key:s.getId(),layout:this,node:s,path:i}))}else if(s instanceof b){let r=e+"/t"+h++;if(this.supportsPopout&&s.isFloating()){const e=this._getScreenRect(s),d=s._getAttr("borderWidth"),h=s._getAttr("borderHeight");-1!==d&&a.getLocation().getOrientation()===i.HORZ?e.width=d:-1!==h&&a.getLocation().getOrientation()===i.VERT&&(e.height=h),o.push(t.createElement(z,{key:s.getId(),url:this.popoutURL,rect:e,title:s.getName(),id:s.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:s,factory:this.props.factory}))),n[s.getId()]=t.createElement(H,{key:s.getId(),layout:this,path:r,node:s,selected:l===a.getSelected()})}else n[s.getId()]=t.createElement(U,{key:s.getId(),layout:this,path:r,node:s,selected:l===a.getSelected(),factory:this.props.factory})}l++}}}}renderChildren(e,s,n,o,r,a){const d=s._getDrawChildren();let l=0,h=0,_=0;for(const s of d)if(s instanceof m){const i=e+"/s"+l++;a.push(t.createElement(M,{key:s.getId(),layout:this,path:i,node:s}))}else if(s instanceof v){const i=e+"/ts"+_++;n.push(t.createElement(F,{key:s.getId(),layout:this,path:i,node:s,iconFactory:this.props.iconFactory,titleFactory:this.props.titleFactory,icons:this.icons})),this.renderChildren(i,s,n,o,r,a)}else if(s instanceof b){const i=e+"/t"+h++,n=s.getParent().getChildren()[s.getParent().getSelected()];if(void 0===n&&console.warn("undefined selectedTab should not happen"),this.supportsPopout&&s.isFloating()){const e=this._getScreenRect(s);r.push(t.createElement(z,{key:s.getId(),url:this.popoutURL,rect:e,title:s.getName(),id:s.getId(),onSetWindow:this.onSetWindow,onCloseWindow:this.onCloseWindow},t.createElement(Y,{layout:this,node:s,factory:this.props.factory}))),o[s.getId()]=t.createElement(H,{key:s.getId(),layout:this,path:i,node:s,selected:s===n})}else o[s.getId()]=t.createElement(U,{key:s.getId(),layout:this,path:i,node:s,selected:s===n,factory:this.props.factory})}else{const t=e+(s.getOrientation()===i.HORZ?"/r":"/c")+_++;this.renderChildren(t,s,n,o,r,a)}}_getScreenRect(t){const e=t.getRect().clone(),i=this.selfRef.current.getBoundingClientRect(),s=Math.min(80,this.currentWindow.outerHeight-this.currentWindow.innerHeight),n=Math.min(80,this.currentWindow.outerWidth-this.currentWindow.innerWidth);return e.x=e.x+i.x+this.currentWindow.screenX+n,e.y=e.y+i.y+this.currentWindow.screenY+s,e}addTabToTabSet(t,e){void 0!==this.props.model.getNodeById(t)&&this.doAction(h.addNode(e,t,r.CENTER,-1))}addTabToActiveTabSet(t){const e=this.props.model.getActiveTabset();void 0!==e&&this.doAction(h.addNode(t,e.getId(),r.CENTER,-1))}addTabWithDragAndDrop(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,this.dragStart(void 0,t,b._fromJson(e,this.props.model,!1),!0,void 0,void 0)}moveTabWithDragAndDrop(t,e){this.dragStart(void 0,e,t,!0,void 0,void 0)}addTabWithDragAndDropIndirect(t,e,i){this.fnNewNodeDropped=i,this.newTabJson=e,d.instance.addGlass(this.onCancelAdd),this.dragDivText=t,this.dragDiv=this.currentDocument.createElement("div"),this.dragDiv.className=this.getClassName(g.FLEXLAYOUT__DRAG_RECT),this.dragDiv.addEventListener("mousedown",this.onDragDivMouseDown),this.dragDiv.addEventListener("touchstart",this.onDragDivMouseDown,{passive:!1}),this.dragRectRender(this.dragDivText,void 0,this.newTabJson,(()=>{if(this.dragDiv){this.dragDiv.style.visibility="visible";const t=this.dragDiv.getBoundingClientRect(),e=new s(0,0,null==t?void 0:t.width,null==t?void 0:t.height);e.centerInRect(this.state.rect),this.dragDiv.setAttribute("data-layout-path","/drag-rectangle"),this.dragDiv.style.left=e.x+"px",this.dragDiv.style.top=e.y+"px"}})),this.selfRef.current.appendChild(this.dragDiv)}handleCustomTabDrag(t,e,i){var n,o,r;let a=null===(n=this.customDrop)||void 0===n?void 0:n.invalidated;const l=null===(o=this.customDrop)||void 0===o?void 0:o.callback;this.customDrop=void 0;const h=this.newTabJson||(this.dragNode instanceof b?this.dragNode:void 0);if(h&&(t.node instanceof v||t.node instanceof R)&&-1===t.index){const n=t.node.getSelectedNode(),o=null==n?void 0:n.getRect();if(n&&(null==o?void 0:o.contains(e.x,e.y))){let r;try{const a=this.onTabDrag(h,n,e.x-o.x,e.y-o.y,t.location,(()=>this.onDragMove(i)));a&&(r={rect:new s(a.x+o.x,a.y+o.y,a.width,a.height),callback:a.callback,invalidated:a.invalidated,dragging:h,over:n,x:e.x-o.x,y:e.y-o.y,location:t.location,cursor:a.cursor})}catch(t){console.error(t)}(null==r?void 0:r.callback)===l&&(a=void 0),this.customDrop=r}}this.dropInfo=t,this.outlineDiv.className=this.getClassName(this.customDrop?g.FLEXLAYOUT__OUTLINE_RECT:t.className),this.customDrop?this.customDrop.rect.positionElement(this.outlineDiv):t.rect.positionElement(this.outlineDiv),d.instance.setGlassCursorOverride(null===(r=this.customDrop)||void 0===r?void 0:r.cursor),this.outlineDiv.style.visibility="visible";try{null==a||a()}catch(t){console.error(t)}}onDragEnter(t){if(d.instance.isDragging())return;const e=this.props.onExternalDrag(t);e&&(this.fnNewNodeDropped=e.onDrop,this.newTabJson=e.json,this.dragStart(t,e.dragText,b._fromJson(e.json,this.props.model,!1),!0,void 0,void 0))}checkForBorderToShow(t,e){const i=this.props.model._getOuterInnerRects().outer,s=i.getCenter(),n=this.edgeRectWidth,o=this.edgeRectLength/2;let a=!1;this.props.model.isEnableEdgeDock()&&this.state.showHiddenBorder===r.CENTER&&(e>s.y-o&&e<s.y+o||t>s.x-o&&t<s.x+o)&&(a=!0);let d=r.CENTER;a||(t<=i.x+n?d=r.LEFT:t>=i.getRight()-n?d=r.RIGHT:e<=i.y+n?d=r.TOP:e>=i.getBottom()-n&&(d=r.BOTTOM)),d!==this.state.showHiddenBorder&&this.setState({showHiddenBorder:d})}maximize(t){this.doAction(h.maximizeToggle(t.getId()))}customizeTab(t,e){this.props.onRenderTab&&this.props.onRenderTab(t,e)}customizeTabSet(t,e){this.props.onRenderTabSet&&this.props.onRenderTabSet(t,e)}i18nName(t,e){let i;return this.props.i18nMapper&&(i=this.props.i18nMapper(t,e)),void 0===i&&(i=t+(void 0===e?"":e)),i}getOnRenderFloatingTabPlaceholder(){return this.props.onRenderFloatingTabPlaceholder}getShowOverflowMenu(){return this.props.onShowOverflowMenu}getTabSetPlaceHolderCallback(){return this.props.onTabSetPlaceHolder}showContextMenu(t,e){this.props.onContextMenu&&this.props.onContextMenu(t,e)}auxMouseClick(t,e){this.props.onAuxMouseClick&&this.props.onAuxMouseClick(t,e)}}const J=e=>(t.useEffect((()=>{var t;null===(t=e.onRendered)||void 0===t||t.call(e)}),[e]),t.createElement(t.Fragment,null,e.children));class Z{static _fromJson(t,e){const i=new Z(e);return i._borders=t.map((t=>R._fromJson(t,e))),i}constructor(t){this._model=t,this._borders=[]}getBorders(){return this._borders}_forEachNode(t){for(const e of this._borders){t(e,0);for(const i of e.getChildren())i._forEachNode(t,1)}}_toJson(){return this._borders.map((t=>t.toJson()))}_layoutBorder(t,e){const s=t.outer,n=this._model.getRoot();let o=Math.max(0,s.height-n.getMinHeight()),r=Math.max(0,s.width-n.getMinWidth()),a=0,d=0,l=0,h=0;const _=this._borders.filter((t=>t.isShowing()));for(const t of _){t._setAdjustedSize(t.getSize());const e=-1!==t.getSelected();t.getLocation().getOrientation()===i.HORZ?(d+=t.getBorderBarSize(),e&&(r-=this._model.getSplitterSize(),d+=t.getSize(),h+=t.getSize())):(a+=t.getBorderBarSize(),e&&(o-=this._model.getSplitterSize(),a+=t.getSize(),l+=t.getSize()))}let c=0,u=!1;for(;d>r&&h>0||a>o&&l>0;){const t=_[c];if(-1!==t.getSelected()){const e=t._getAdjustedSize();d>r&&h>0&&t.getLocation().getOrientation()===i.HORZ&&e>0&&e>t.getMinSize()?(t._setAdjustedSize(e-1),d--,h--,u=!0):a>o&&l>0&&t.getLocation().getOrientation()===i.VERT&&e>0&&e>t.getMinSize()&&(t._setAdjustedSize(e-1),a--,l--,u=!0)}if(c=(c+1)%_.length,0===c){if(!u)break;u=!1}}for(const i of _)t.outer=i._layoutBorderOuter(t.outer,e);t.inner=t.outer;for(const i of _)t.inner=i._layoutBorderInner(t.inner,e);return t}_findDropTargetNode(t,e,i){for(const s of this._borders)if(s.isShowing()){const n=s.canDrop(t,e,i);if(void 0!==n)return n}}}class j{static fromJson(t){const e=new j;return j._attributeDefinitions.fromJson(t.global,e._attributes),t.borders&&(e._borders=Z._fromJson(t.borders,e)),e._root=f._fromJson(t.layout,e),e._tidy(),e}static _createAttributeDefinitions(){const t=new c;return t.add("legacyOverflowMenu",!1).setType(_.BOOLEAN),t.add("splitterSize",-1).setType(_.NUMBER),t.add("splitterExtra",0).setType(_.NUMBER),t.add("enableEdgeDock",!0).setType(_.BOOLEAN),t.add("rootOrientationVertical",!1).setType(_.BOOLEAN),t.add("marginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("enableUseVisibility",!1).setType(_.BOOLEAN),t.add("tabEnableClose",!0).setType(_.BOOLEAN),t.add("tabCloseType",1).setType("ICloseType"),t.add("tabEnableFloat",!1).setType(_.BOOLEAN),t.add("tabEnableDrag",!0).setType(_.BOOLEAN),t.add("tabEnableRename",!0).setType(_.BOOLEAN),t.add("tabClassName",void 0).setType(_.STRING),t.add("tabIcon",void 0).setType(_.STRING),t.add("tabEnableRenderOnDemand",!0).setType(_.BOOLEAN),t.add("tabDragSpeed",.3).setType(_.NUMBER),t.add("tabBorderWidth",-1).setType(_.NUMBER),t.add("tabBorderHeight",-1).setType(_.NUMBER),t.add("tabSetEnableDeleteWhenEmpty",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrop",!0).setType(_.BOOLEAN),t.add("tabSetEnableDrag",!0).setType(_.BOOLEAN),t.add("tabSetEnableDivide",!0).setType(_.BOOLEAN),t.add("tabSetEnableMaximize",!0).setType(_.BOOLEAN),t.add("tabSetEnableClose",!1).setType(_.BOOLEAN),t.add("tabSetAutoSelectTab",!0).setType(_.BOOLEAN),t.add("tabSetClassNameTabStrip",void 0).setType(_.STRING),t.add("tabSetClassNameHeader",void 0).setType(_.STRING),t.add("tabSetEnableTabStrip",!0).setType(_.BOOLEAN),t.add("tabSetHeaderHeight",0).setType(_.NUMBER),t.add("tabSetTabStripHeight",0).setType(_.NUMBER),t.add("tabSetMarginInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetBorderInsets",{top:0,right:0,bottom:0,left:0}).setType("IInsets"),t.add("tabSetTabLocation","top").setType("ITabLocation"),t.add("tabSetMinWidth",0).setType(_.NUMBER),t.add("tabSetMinHeight",0).setType(_.NUMBER),t.add("borderSize",200).setType(_.NUMBER),t.add("borderMinSize",0).setType(_.NUMBER),t.add("borderBarSize",0).setType(_.NUMBER),t.add("borderEnableDrop",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenOpen",!0).setType(_.BOOLEAN),t.add("borderAutoSelectTabWhenClosed",!1).setType(_.BOOLEAN),t.add("borderClassName",void 0).setType(_.STRING),t.add("borderEnableAutoHide",!1).setType(_.BOOLEAN),t}constructor(){this._borderRects={inner:s.empty(),outer:s.empty()},this._attributes={},this._idMap={},this._borders=new Z(this),this._pointerFine=!0,this._showHiddenBorder=r.CENTER}_setChangeListener(t){this._changeListener=t}getActiveTabset(){return this._activeTabSet&&this.getNodeById(this._activeTabSet.getId())?this._activeTabSet:void 0}_getShowHiddenBorder(){return this._showHiddenBorder}_setShowHiddenBorder(t){this._showHiddenBorder=t}_setActiveTabset(t){this._activeTabSet=t}getMaximizedTabset(){return this._maximizedTabSet}_setMaximizedTabset(t){this._maximizedTabSet=t}getRoot(){return this._root}isRootOrientationVertical(){return this._attributes.rootOrientationVertical}isUseVisibility(){return this._attributes.enableUseVisibility}getBorderSet(){return this._borders}_getOuterInnerRects(){return this._borderRects}_getPointerFine(){return this._pointerFine}_setPointerFine(t){this._pointerFine=t}visitNodes(t){this._borders._forEachNode(t),this._root._forEachNode(t,0)}getNodeById(t){return this._idMap[t]}doAction(t){let e;switch(t.type){case h.ADD_NODE:{const i=new b(this,t.data.json,!0),s=this._idMap[t.data.toNode];(s instanceof v||s instanceof R||s instanceof f)&&(s.drop(i,r.getByName(t.data.location),t.data.index,t.data.select),e=i);break}case h.MOVE_NODE:{const e=this._idMap[t.data.fromNode];if(e instanceof b||e instanceof v){const i=this._idMap[t.data.toNode];(i instanceof v||i instanceof R||i instanceof f)&&i.drop(e,r.getByName(t.data.location),t.data.index,t.data.select)}break}case h.DELETE_TAB:{const e=this._idMap[t.data.node];e instanceof b&&e._delete();break}case h.DELETE_TABSET:{const e=this._idMap[t.data.node];if(e instanceof v){const t=[...e.getChildren()];for(let e=0;e<t.length;e++){const i=t[e];i.isEnableClose()&&i._delete()}0===e.getChildren().length&&e._delete(),this._tidy()}break}case h.FLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof b&&(e._setFloating(!0),function(t){const e=t.getParent();if(null!==e)if(e instanceof v){let i=!1,s=0;const n=e.getChildren();for(let e=0;e<n.length;e++){const o=n[e];if(o===t)i=!0;else if(!o.isFloating()&&(s=e,i))break}e._setSelected(s)}else e instanceof R&&e._setSelected(-1)}(e));break}case h.UNFLOAT_TAB:{const e=this._idMap[t.data.node];e instanceof b&&(e._setFloating(!1),function(t){const e=t.getParent();if(null!==e&&(e instanceof v||e instanceof R)){const i=e.getChildren();for(let s=0;s<i.length;s++)if(i[s]===t)return void e._setSelected(s)}}(e));break}case h.RENAME_TAB:{const e=this._idMap[t.data.node];e instanceof b&&e._setName(t.data.text);break}case h.SELECT_TAB:{const e=this._idMap[t.data.tabNode];if(e instanceof b){const t=e.getParent(),i=t.getChildren().indexOf(e);t instanceof R?t.getSelected()===i?t._setSelected(-1):t._setSelected(i):t instanceof v&&(t.getSelected()!==i&&t._setSelected(i),this._activeTabSet=t)}break}case h.SET_ACTIVE_TABSET:{const e=this._idMap[t.data.tabsetNode];e instanceof v&&(this._activeTabSet=e);break}case h.ADJUST_SPLIT:{const e=this._idMap[t.data.node1],i=this._idMap[t.data.node2];(e instanceof v||e instanceof f)&&(i instanceof v||i instanceof f)&&(this._adjustSplitSide(e,t.data.weight1,t.data.pixelWidth1),this._adjustSplitSide(i,t.data.weight2,t.data.pixelWidth2));break}case h.ADJUST_BORDER_SPLIT:{const e=this._idMap[t.data.node];e instanceof R&&e._setSize(t.data.pos);break}case h.MAXIMIZE_TOGGLE:{const e=this._idMap[t.data.node];e instanceof v&&(e===this._maximizedTabSet?this._maximizedTabSet=void 0:(this._maximizedTabSet=e,this._activeTabSet=e));break}case h.UPDATE_MODEL_ATTRIBUTES:this._updateAttrs(t.data.json);break;case h.UPDATE_NODE_ATTRIBUTES:this._idMap[t.data.node]._updateAttrs(t.data.json)}return this._updateIdMap(),void 0!==this._changeListener&&this._changeListener(t),e}_updateIdMap(){this._idMap={},this.visitNodes((t=>this._idMap[t.getId()]=t))}_adjustSplitSide(t,e,s){t._setWeight(e),null!=t.getWidth()&&t.getOrientation()===i.VERT?t._updateAttrs({width:s}):null!=t.getHeight()&&t.getOrientation()===i.HORZ&&t._updateAttrs({height:s})}toJson(){const t={};return j._attributeDefinitions.toJson(t,this._attributes),this.visitNodes((t=>{t._fireEvent("save",void 0)})),{global:t,borders:this._borders._toJson(),layout:this._root.toJson()}}getSplitterSize(){let t=this._attributes.splitterSize;return-1===t&&(t=this._pointerFine?8:12),t}isLegacyOverflowMenu(){return this._attributes.legacyOverflowMenu}getSplitterExtra(){return this._attributes.splitterExtra}isEnableEdgeDock(){return this._attributes.enableEdgeDock}_addNode(t){const e=t.getId();if(void 0!==this._idMap[e])throw new Error(`Error: each node must have a unique id, duplicate id:${t.getId()}`);"splitter"!==t.getType()&&(this._idMap[e]=t)}_layout(t,e){var i;return this._borderRects=this._borders._layoutBorder({outer:t,inner:t},e),t=this._borderRects.inner.removeInsets(this._getAttribute("marginInsets")),null===(i=this._root)||void 0===i||i.calcMinSize(),this._root._layout(t,e),t}_findDropTargetNode(t,e,i){let s=this._root._findDropTargetNode(t,e,i);return void 0===s&&(s=this._borders._findDropTargetNode(t,e,i)),s}_tidy(){this._root._tidy()}_updateAttrs(t){j._attributeDefinitions.update(t,this._attributes)}_nextUniqueId(){return"#"+([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)))}_getAttribute(t){return this._attributes[t]}setOnAllowDrop(t){this._onAllowDrop=t}_getOnAllowDrop(){return this._onAllowDrop}setOnCreateTabSet(t){this._onCreateTabSet=t}_getOnCreateTabSet(){return this._onCreateTabSet}static toTypescriptInterfaces(){console.log(j._attributeDefinitions.toTypescriptInterface("Global",void 0)),console.log(f.getAttributeDefinitions().toTypescriptInterface("Row",j._attributeDefinitions)),console.log(v.getAttributeDefinitions().toTypescriptInterface("TabSet",j._attributeDefinitions)),console.log(b.getAttributeDefinitions().toTypescriptInterface("Tab",j._attributeDefinitions)),console.log(R.getAttributeDefinitions().toTypescriptInterface("Border",j._attributeDefinitions))}toString(){return JSON.stringify(this.toJson())}}j._attributeDefinitions=j._createAttributeDefinitions()})(),o})()));
|
package/lib/view/BorderTabSet.js
CHANGED
|
@@ -17,7 +17,7 @@ const BorderTabSet = (props) => {
|
|
|
17
17
|
const toolbarRef = React.useRef(null);
|
|
18
18
|
const overflowbuttonRef = React.useRef(null);
|
|
19
19
|
const stickyButtonsRef = React.useRef(null);
|
|
20
|
-
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel } = (0, TabOverflowHook_1.useTabOverflow)(border, Orientation_1.Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
|
|
20
|
+
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = (0, TabOverflowHook_1.useTabOverflow)(border, Orientation_1.Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
|
|
21
21
|
const onAuxMouseClick = (event) => {
|
|
22
22
|
if ((0, Utils_1.isAuxMouseEvent)(event)) {
|
|
23
23
|
layout.auxMouseClick(border, event);
|
|
@@ -71,10 +71,10 @@ const BorderTabSet = (props) => {
|
|
|
71
71
|
}
|
|
72
72
|
// allow customization of tabset right/bottom buttons
|
|
73
73
|
let buttons = [];
|
|
74
|
-
|
|
74
|
+
let stickyButtons = [];
|
|
75
|
+
const renderState = { headerContent: undefined, buttons, stickyButtons: stickyButtons, headerButtons: [] };
|
|
75
76
|
layout.customizeTabSet(border, renderState);
|
|
76
77
|
buttons = renderState.buttons;
|
|
77
|
-
let toolbar;
|
|
78
78
|
if (hiddenTabs.length > 0) {
|
|
79
79
|
const overflowTitle = layout.i18nName(I18nLabel_1.I18nLabel.Overflow_Menu_Tooltip);
|
|
80
80
|
let overflowContent;
|
|
@@ -86,7 +86,15 @@ const BorderTabSet = (props) => {
|
|
|
86
86
|
icons.more,
|
|
87
87
|
React.createElement("div", { className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));
|
|
88
88
|
}
|
|
89
|
-
buttons.
|
|
89
|
+
buttons.unshift(React.createElement("button", { key: "overflowbutton", ref: overflowbuttonRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_OVERFLOW_ + border.getLocation().getName()), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));
|
|
90
|
+
}
|
|
91
|
+
if (stickyButtons.length > 0) {
|
|
92
|
+
if (tabsTruncated) {
|
|
93
|
+
buttons = [...stickyButtons, ...buttons];
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
tabs.push(React.createElement("div", { ref: stickyButtonsRef, key: "sticky_buttons_container", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));
|
|
97
|
+
}
|
|
90
98
|
}
|
|
91
99
|
const selectedIndex = border.getSelected();
|
|
92
100
|
if (selectedIndex !== -1) {
|
|
@@ -96,7 +104,7 @@ const BorderTabSet = (props) => {
|
|
|
96
104
|
buttons.push(React.createElement("button", { key: "float", title: floatTitle, className: cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_BUTTON_FLOAT), onClick: onFloatTab, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.popout === "function") ? icons.popout(selectedTabNode) : icons.popout));
|
|
97
105
|
}
|
|
98
106
|
}
|
|
99
|
-
toolbar = (React.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_ + border.getLocation().getName()) }, buttons));
|
|
107
|
+
const toolbar = (React.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_ + border.getLocation().getName()) }, buttons));
|
|
100
108
|
style = layout.styleFont(style);
|
|
101
109
|
let innerStyle = {};
|
|
102
110
|
const borderHeight = border.getBorderBarSize() - 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BorderTabSet.js","sourceRoot":"","sources":["../../src/view/BorderTabSet.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,kDAA+C;AAG/C,iDAA8C;AAE9C,4CAAyC;AACzC,8CAA2C;AAC3C,4CAAyC;AACzC,uDAAmD;AACnD,gDAA6C;AAC7C,oCAAmC;AACnC,mCAA0C;AAY1C,gBAAgB;AACT,MAAM,YAAY,GAAG,CAAC,KAAyB,EAAE,EAAE;IACtD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEzE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IAC7D,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAA2B,IAAI,CAAC,CAAC;IACvE,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IAEnE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,IAAA,gCAAc,EAAC,MAAM,EAAE,yBAAW,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"BorderTabSet.js","sourceRoot":"","sources":["../../src/view/BorderTabSet.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,kDAA+C;AAG/C,iDAA8C;AAE9C,4CAAyC;AACzC,8CAA2C;AAC3C,4CAAyC;AACzC,uDAAmD;AACnD,gDAA6C;AAC7C,oCAAmC;AACnC,mCAA0C;AAY1C,gBAAgB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CAAC,uCAAuC,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,CAAC,IAC7K,IAAI,CACH,CACJ;QACL,OAAO,CACN,CACT,CAAC;AACN,CAAC,CAAC;AAjMW,QAAA,YAAY,gBAiMvB"}
|
package/lib/view/TabSet.js
CHANGED
|
@@ -119,15 +119,6 @@ const TabSet = (props) => {
|
|
|
119
119
|
stickyButtons = renderState.stickyButtons;
|
|
120
120
|
buttons = renderState.buttons;
|
|
121
121
|
headerButtons = renderState.headerButtons;
|
|
122
|
-
if (stickyButtons.length > 0) {
|
|
123
|
-
if (tabsTruncated) {
|
|
124
|
-
buttons = [...stickyButtons, ...buttons];
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
tabs.push(React.createElement("div", { ref: stickyButtonsRef, key: "sticky_buttons_container", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
let toolbar;
|
|
131
122
|
if (hiddenTabs.length > 0) {
|
|
132
123
|
const overflowTitle = layout.i18nName(I18nLabel_1.I18nLabel.Overflow_Menu_Tooltip);
|
|
133
124
|
let overflowContent;
|
|
@@ -139,7 +130,15 @@ const TabSet = (props) => {
|
|
|
139
130
|
icons.more,
|
|
140
131
|
React.createElement("div", { className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT) }, hiddenTabs.length)));
|
|
141
132
|
}
|
|
142
|
-
buttons.
|
|
133
|
+
buttons.unshift(React.createElement("button", { key: "overflowbutton", "data-layout-path": path + "/button/overflow", ref: overflowbuttonRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW), title: overflowTitle, onClick: onOverflowClick, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, overflowContent));
|
|
134
|
+
}
|
|
135
|
+
if (stickyButtons.length > 0) {
|
|
136
|
+
if (tabsTruncated) {
|
|
137
|
+
buttons = [...stickyButtons, ...buttons];
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
tabs.push(React.createElement("div", { ref: stickyButtonsRef, key: "sticky_buttons_container", onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); }, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER) }, stickyButtons));
|
|
141
|
+
}
|
|
143
142
|
}
|
|
144
143
|
if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {
|
|
145
144
|
const floatTitle = layout.i18nName(I18nLabel_1.I18nLabel.Float_Tab);
|
|
@@ -158,7 +157,7 @@ const TabSet = (props) => {
|
|
|
158
157
|
const btns = showHeader ? headerButtons : buttons;
|
|
159
158
|
btns.push(React.createElement("button", { key: "close", "data-layout-path": path + "/button/close", title: title, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON) + " " + cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE), onClick: onClose, onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown }, (typeof icons.closeTabset === "function") ? icons.closeTabset(node) : icons.closeTabset));
|
|
160
159
|
}
|
|
161
|
-
toolbar = (React.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, buttons));
|
|
160
|
+
const toolbar = (React.createElement("div", { key: "toolbar", ref: toolbarRef, className: cm(Types_1.CLASSES.FLEXLAYOUT__TAB_TOOLBAR), onMouseDown: onInterceptMouseDown, onTouchStart: onInterceptMouseDown, onDragStart: (e) => { e.preventDefault(); } }, buttons));
|
|
162
161
|
let header;
|
|
163
162
|
let tabStrip;
|
|
164
163
|
let tabStripClasses = cm(Types_1.CLASSES.FLEXLAYOUT__TABSET_TABBAR_OUTER);
|
package/lib/view/TabSet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSet.js","sourceRoot":"","sources":["../../src/view/TabSet.tsx"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,4CAAyC;AACzC,8CAA2C;AAG3C,4CAAyC;AAEzC,2CAAwC;AACxC,uDAAmD;AACnD,gDAA6C;AAC7C,oCAAmC;AACnC,mCAAuD;AAavD,gBAAgB;AACT,MAAM,MAAM,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC1C,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAEvE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IAC7D,MAAM,iBAAiB,GAAG,KAAK,CAAC,MAAM,CAA2B,IAAI,CAAC,CAAC;IACvE,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IACjE,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAwB,IAAI,CAAC,CAAC;IAEnE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,IAAA,gCAAc,EAAC,IAAI,EAAE,yBAAW,CAAC,IAAI,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAEhK,MAAM,eAAe,GAAG,CAAC,KAAgD,EAAE,EAAE;QACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC;QAC9C,IAAI,QAAQ,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IAAI,WAAW,GAAoB,SAAS,CAAC;IAC7C,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,4BAA4B,EAAE,CAAC;QAClE,IAAI,mBAAmB,EAAE;YACrB,WAAW,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;SAC3C;KACJ;IAED,MAAM,MAAM,GAAG,6BAAK,SAAS,EAAE,EAAE,CAAC,eAAO,CAAC,0BAA0B,CAAC,IAChE,WAAW,CACV,CAAA;IAEN,IAAI,OAAO,CAAC;IACZ,IAAI,IAAI,CAAC,cAAc,EAAE,KAAK,KAAK,EAAE;QACjC,OAAO,GAAG;YAAG,MAAM;YAAE,QAAQ;YAAE,MAAM,CAAI,CAAC;KAC7C;SAAM;QACH,OAAO,GAAG;YAAG,MAAM;YAAE,MAAM;YAAE,QAAQ,CAAI,CAAC;KAC7C;IAED,OAAO,CACH,6BAAK,GAAG,EAAE,OAAO,EACb,GAAG,EAAC,KAAK,sBACS,IAAI,EACtB,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,eAAO,CAAC,kBAAkB,CAAC,EACzC,OAAO,EAAE,YAAY,IACpB,OAAO,CACN,CACT,CAAC;AACN,CAAC,CAAC;AA1WW,QAAA,MAAM,UA0WjB"}
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
30
30
|
const overflowbuttonRef = React.useRef<HTMLButtonElement | null>(null);
|
|
31
31
|
const stickyButtonsRef = React.useRef<HTMLDivElement | null>(null);
|
|
32
32
|
|
|
33
|
-
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel } = useTabOverflow(border, Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
|
|
33
|
+
const { selfRef, position, userControlledLeft, hiddenTabs, onMouseWheel, tabsTruncated } = useTabOverflow(border, Orientation.flip(border.getOrientation()), toolbarRef, stickyButtonsRef);
|
|
34
34
|
|
|
35
35
|
const onAuxMouseClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
|
36
36
|
if (isAuxMouseEvent(event)) {
|
|
@@ -42,7 +42,7 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
42
42
|
layout.showContextMenu(border, event);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const onInterceptMouseDown = (event: React.MouseEvent
|
|
45
|
+
const onInterceptMouseDown = (event: React.MouseEvent | React.TouchEvent) => {
|
|
46
46
|
event.stopPropagation();
|
|
47
47
|
};
|
|
48
48
|
|
|
@@ -116,12 +116,11 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
116
116
|
|
|
117
117
|
// allow customization of tabset right/bottom buttons
|
|
118
118
|
let buttons: any[] = [];
|
|
119
|
-
|
|
119
|
+
let stickyButtons: any[] = [];
|
|
120
|
+
const renderState = { headerContent: undefined, buttons, stickyButtons: stickyButtons, headerButtons: [] };
|
|
120
121
|
layout.customizeTabSet(border, renderState);
|
|
121
122
|
buttons = renderState.buttons;
|
|
122
123
|
|
|
123
|
-
let toolbar;
|
|
124
|
-
|
|
125
124
|
if (hiddenTabs.length > 0) {
|
|
126
125
|
const overflowTitle = layout.i18nName(I18nLabel.Overflow_Menu_Tooltip);
|
|
127
126
|
let overflowContent;
|
|
@@ -133,7 +132,7 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
133
132
|
<div className={cm(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)}>{hiddenTabs.length}</div>
|
|
134
133
|
</>);
|
|
135
134
|
}
|
|
136
|
-
buttons.
|
|
135
|
+
buttons.unshift(
|
|
137
136
|
<button
|
|
138
137
|
key="overflowbutton"
|
|
139
138
|
ref={overflowbuttonRef}
|
|
@@ -147,6 +146,23 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
147
146
|
</button>
|
|
148
147
|
);
|
|
149
148
|
}
|
|
149
|
+
|
|
150
|
+
if (stickyButtons.length > 0) {
|
|
151
|
+
if (tabsTruncated) {
|
|
152
|
+
buttons = [...stickyButtons, ...buttons];
|
|
153
|
+
} else {
|
|
154
|
+
tabs.push(<div
|
|
155
|
+
ref={stickyButtonsRef}
|
|
156
|
+
key="sticky_buttons_container"
|
|
157
|
+
onMouseDown={onInterceptMouseDown}
|
|
158
|
+
onTouchStart={onInterceptMouseDown}
|
|
159
|
+
onDragStart={(e) => { e.preventDefault() }}
|
|
160
|
+
className={cm(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)}
|
|
161
|
+
>
|
|
162
|
+
{stickyButtons}
|
|
163
|
+
</div>);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
150
166
|
|
|
151
167
|
const selectedIndex = border.getSelected();
|
|
152
168
|
if (selectedIndex !== -1) {
|
|
@@ -167,7 +183,7 @@ export const BorderTabSet = (props: IBorderTabSetProps) => {
|
|
|
167
183
|
);
|
|
168
184
|
}
|
|
169
185
|
}
|
|
170
|
-
toolbar = (
|
|
186
|
+
const toolbar = (
|
|
171
187
|
<div key="toolbar" ref={toolbarRef} className={cm(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR) + " " + cm(CLASSES.FLEXLAYOUT__BORDER_TOOLBAR_ + border.getLocation().getName())}>
|
|
172
188
|
{buttons}
|
|
173
189
|
</div>
|
package/src/view/TabSet.tsx
CHANGED
|
@@ -167,24 +167,6 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
167
167
|
buttons = renderState.buttons;
|
|
168
168
|
headerButtons = renderState.headerButtons;
|
|
169
169
|
|
|
170
|
-
if (stickyButtons.length > 0) {
|
|
171
|
-
if (tabsTruncated) {
|
|
172
|
-
buttons = [...stickyButtons, ...buttons];
|
|
173
|
-
} else {
|
|
174
|
-
tabs.push(<div
|
|
175
|
-
ref={stickyButtonsRef}
|
|
176
|
-
key="sticky_buttons_container"
|
|
177
|
-
onMouseDown={onInterceptMouseDown}
|
|
178
|
-
onTouchStart={onInterceptMouseDown}
|
|
179
|
-
onDragStart={(e) => { e.preventDefault() }}
|
|
180
|
-
className={cm(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)}
|
|
181
|
-
>
|
|
182
|
-
{stickyButtons}
|
|
183
|
-
</div>);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
let toolbar;
|
|
188
170
|
if (hiddenTabs.length > 0) {
|
|
189
171
|
const overflowTitle = layout.i18nName(I18nLabel.Overflow_Menu_Tooltip);
|
|
190
172
|
let overflowContent;
|
|
@@ -196,7 +178,7 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
196
178
|
<div className={cm(CLASSES.FLEXLAYOUT__TAB_BUTTON_OVERFLOW_COUNT)}>{hiddenTabs.length}</div>
|
|
197
179
|
</>);
|
|
198
180
|
}
|
|
199
|
-
buttons.
|
|
181
|
+
buttons.unshift(
|
|
200
182
|
<button
|
|
201
183
|
key="overflowbutton"
|
|
202
184
|
data-layout-path={path + "/button/overflow"}
|
|
@@ -213,6 +195,23 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
213
195
|
);
|
|
214
196
|
}
|
|
215
197
|
|
|
198
|
+
if (stickyButtons.length > 0) {
|
|
199
|
+
if (tabsTruncated) {
|
|
200
|
+
buttons = [...stickyButtons, ...buttons];
|
|
201
|
+
} else {
|
|
202
|
+
tabs.push(<div
|
|
203
|
+
ref={stickyButtonsRef}
|
|
204
|
+
key="sticky_buttons_container"
|
|
205
|
+
onMouseDown={onInterceptMouseDown}
|
|
206
|
+
onTouchStart={onInterceptMouseDown}
|
|
207
|
+
onDragStart={(e) => { e.preventDefault() }}
|
|
208
|
+
className={cm(CLASSES.FLEXLAYOUT__TAB_TOOLBAR_STICKY_BUTTONS_CONTAINER)}
|
|
209
|
+
>
|
|
210
|
+
{stickyButtons}
|
|
211
|
+
</div>);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
216
215
|
if (selectedTabNode !== undefined && layout.isSupportsPopout() && selectedTabNode.isEnableFloat() && !selectedTabNode.isFloating()) {
|
|
217
216
|
const floatTitle = layout.i18nName(I18nLabel.Float_Tab);
|
|
218
217
|
buttons.push(
|
|
@@ -268,7 +267,7 @@ export const TabSet = (props: ITabSetProps) => {
|
|
|
268
267
|
);
|
|
269
268
|
}
|
|
270
269
|
|
|
271
|
-
toolbar = (
|
|
270
|
+
const toolbar = (
|
|
272
271
|
<div key="toolbar" ref={toolbarRef}
|
|
273
272
|
className={cm(CLASSES.FLEXLAYOUT__TAB_TOOLBAR)}
|
|
274
273
|
onMouseDown={onInterceptMouseDown}
|