flexlayout-react 0.8.13 → 0.8.15

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.
Files changed (60) hide show
  1. package/README.md +12 -11
  2. package/{lib → dist}/index.js +105 -64
  3. package/package.json +12 -11
  4. package/style/_base.scss +8 -0
  5. package/style/combined.css +1059 -1053
  6. package/style/combined.css.map +1 -1
  7. package/style/dark.css +711 -705
  8. package/style/dark.css.map +1 -1
  9. package/style/gray.css +714 -708
  10. package/style/gray.css.map +1 -1
  11. package/style/light.css +688 -682
  12. package/style/light.css.map +1 -1
  13. package/style/rounded.css +727 -721
  14. package/style/rounded.css.map +1 -1
  15. package/style/underline.css +717 -711
  16. package/style/underline.css.map +1 -1
  17. package/{declarations → types}/Types.d.ts +2 -0
  18. package/{declarations → types}/view/Icons.d.ts +2 -0
  19. package/{declarations → types}/view/Layout.d.ts +3 -1
  20. package/types/view/SizeTracker.d.ts +13 -0
  21. package/declarations/view/SizeTracker.d.ts +0 -10
  22. /package/{declarations → types}/Attribute.d.ts +0 -0
  23. /package/{declarations → types}/AttributeDefinitions.d.ts +0 -0
  24. /package/{declarations → types}/DockLocation.d.ts +0 -0
  25. /package/{declarations → types}/DropInfo.d.ts +0 -0
  26. /package/{declarations → types}/I18nLabel.d.ts +0 -0
  27. /package/{declarations → types}/Orientation.d.ts +0 -0
  28. /package/{declarations → types}/Rect.d.ts +0 -0
  29. /package/{declarations → types}/index.d.ts +0 -0
  30. /package/{declarations → types}/model/Action.d.ts +0 -0
  31. /package/{declarations → types}/model/Actions.d.ts +0 -0
  32. /package/{declarations → types}/model/BorderNode.d.ts +0 -0
  33. /package/{declarations → types}/model/BorderSet.d.ts +0 -0
  34. /package/{declarations → types}/model/ICloseType.d.ts +0 -0
  35. /package/{declarations → types}/model/IDraggable.d.ts +0 -0
  36. /package/{declarations → types}/model/IDropTarget.d.ts +0 -0
  37. /package/{declarations → types}/model/IJsonModel.d.ts +0 -0
  38. /package/{declarations → types}/model/LayoutWindow.d.ts +0 -0
  39. /package/{declarations → types}/model/Model.d.ts +0 -0
  40. /package/{declarations → types}/model/Node.d.ts +0 -0
  41. /package/{declarations → types}/model/RowNode.d.ts +0 -0
  42. /package/{declarations → types}/model/TabNode.d.ts +0 -0
  43. /package/{declarations → types}/model/TabSetNode.d.ts +0 -0
  44. /package/{declarations → types}/model/Utils.d.ts +0 -0
  45. /package/{declarations → types}/view/BorderButton.d.ts +0 -0
  46. /package/{declarations → types}/view/BorderTab.d.ts +0 -0
  47. /package/{declarations → types}/view/BorderTabSet.d.ts +0 -0
  48. /package/{declarations → types}/view/DragContainer.d.ts +0 -0
  49. /package/{declarations → types}/view/ErrorBoundary.d.ts +0 -0
  50. /package/{declarations → types}/view/Overlay.d.ts +0 -0
  51. /package/{declarations → types}/view/PopoutWindow.d.ts +0 -0
  52. /package/{declarations → types}/view/PopupMenu.d.ts +0 -0
  53. /package/{declarations → types}/view/Row.d.ts +0 -0
  54. /package/{declarations → types}/view/Splitter.d.ts +0 -0
  55. /package/{declarations → types}/view/Tab.d.ts +0 -0
  56. /package/{declarations → types}/view/TabButton.d.ts +0 -0
  57. /package/{declarations → types}/view/TabButtonStamp.d.ts +0 -0
  58. /package/{declarations → types}/view/TabOverflowHook.d.ts +0 -0
  59. /package/{declarations → types}/view/TabSet.d.ts +0 -0
  60. /package/{declarations → types}/view/Utils.d.ts +0 -0
package/README.md CHANGED
@@ -55,16 +55,17 @@ import {Layout, Model} from 'flexlayout-react';
55
55
 
56
56
  Include the light, dark, underline, gray, rounded or combined theme by either:
57
57
 
58
- Adding an additional import:
58
+ Adding an import in your js code:
59
59
 
60
60
  ```
61
61
  import 'flexlayout-react/style/light.css';
62
62
  ```
63
63
 
64
- or by adding the css to your html:
64
+ or by copying the relevant css from the node_modules/flexlayout-react/style directory to your
65
+ public assets folder (e.g. public/style) and linking the css in your html:
65
66
 
66
67
  ```
67
- <link rel="stylesheet" href="node_modules/flexlayout-react/style/light.css" />
68
+ <link rel="stylesheet" href="/style/light.css" />
68
69
  ```
69
70
 
70
71
  [How to change the theme dynamically in code](#dynamically-changing-the-theme)
@@ -94,7 +95,7 @@ The model can be created using the Model.fromJson(jsonObject) static method, and
94
95
  ## Example Configuration:
95
96
 
96
97
  ```javascript
97
- var json = {
98
+ const json = {
98
99
  global: {},
99
100
  borders: [],
100
101
  layout: {
@@ -136,7 +137,7 @@ const model = Model.fromJson(json);
136
137
  function App() {
137
138
 
138
139
  const factory = (node) => {
139
- var component = node.getComponent();
140
+ const component = node.getComponent();
140
141
 
141
142
  if (component === "placeholder") {
142
143
  return <div>{node.getName()}</div>;
@@ -265,6 +266,8 @@ You can use the `<Layout>` prop onRenderTabSet to customize the tabset rendering
265
266
 
266
267
  Update the renderValues parameter as needed:
267
268
 
269
+ renderValues.leading : the blue block
270
+
268
271
  renderValues.stickyButtons : the red block
269
272
 
270
273
  renderValues.buttons : the green block
@@ -419,7 +422,7 @@ an additional icon is shown in the tab header bar allowing the tab to be popped
419
422
  into an external window.
420
423
 
421
424
  For popouts to work there needs to be an additional html page 'popout.html' hosted
422
- at the same location as the main page (copy the one from examples/demo). The popout.html is the host page for the
425
+ at the same location as the main page (copy the one from the demo app). The popout.html is the host page for the
423
426
  popped out tab, the styles from the main page will be copied into it at runtime.
424
427
 
425
428
  Because popouts are rendering into a different document to the main layout any code in the popped out
@@ -457,7 +460,7 @@ enableWindowReMount tab attribute to force the component to re-mount.
457
460
 
458
461
  See this article about using React portals in this way: https://dev.to/noriste/the-challenges-of-rendering-an-openlayers-map-in-a-popup-through-react-2elh
459
462
 
460
- ## Running the Examples and Building the Project
463
+ ## Running the Demo and Building the Project
461
464
 
462
465
  First install dependencies:
463
466
 
@@ -465,15 +468,13 @@ First install dependencies:
465
468
  pnpm install
466
469
  ```
467
470
 
468
- Compile the project and run the examples:
471
+ Run the Demo app:
469
472
 
470
473
  ```
471
474
  pnpm dev
472
475
  ```
473
476
 
474
- Open your browser at the address shown to see the Demo app.
475
-
476
- The 'pnpm dev' command will watch for changes to flexlayout and the Demo, so you can make changes to the code and then refresh the browser to see the result.
477
+ The 'pnpm dev' command will watch for changes to FlexLayout and the Demo, so you can make changes to the FlexLayout code and see the changes in your browser.
477
478
 
478
479
  Once the demo is running you can run the Playwright tests by running (in another terminal window)
479
480
 
@@ -1,3 +1,7 @@
1
+ /**
2
+ * flexlayout-react
3
+ * @version 0.8.15
4
+ */
1
5
  var __defProp = Object.defineProperty;
2
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
7
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -278,6 +282,7 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
278
282
  CLASSES2["FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER"] = "flexlayout__border_inner_tab_container";
279
283
  CLASSES2["FLEXLAYOUT__BORDER_INNER_TAB_CONTAINER_"] = "flexlayout__border_inner_tab_container_";
280
284
  CLASSES2["FLEXLAYOUT__BORDER_TAB_DIVIDER"] = "flexlayout__border_tab_divider";
285
+ CLASSES2["FLEXLAYOUT__BORDER_LEADING"] = "flexlayout__border_leading";
281
286
  CLASSES2["FLEXLAYOUT__BORDER_SIZER"] = "flexlayout__border_sizer";
282
287
  CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR"] = "flexlayout__border_toolbar";
283
288
  CLASSES2["FLEXLAYOUT__BORDER_TOOLBAR_"] = "flexlayout__border_toolbar_";
@@ -324,6 +329,7 @@ var CLASSES = /* @__PURE__ */ ((CLASSES2) => {
324
329
  CLASSES2["FLEXLAYOUT__TABSET_CONTENT"] = "flexlayout__tabset_content";
325
330
  CLASSES2["FLEXLAYOUT__TABSET_TABBAR_INNER"] = "flexlayout__tabset_tabbar_inner";
326
331
  CLASSES2["FLEXLAYOUT__TABSET_TABBAR_INNER_"] = "flexlayout__tabset_tabbar_inner_";
332
+ CLASSES2["FLEXLAYOUT__TABSET_LEADING"] = "flexlayout__tabset_leading";
327
333
  CLASSES2["FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER"] = "flexlayout__tabset_tabbar_inner_tab_container";
328
334
  CLASSES2["FLEXLAYOUT__TABSET_TABBAR_INNER_TAB_CONTAINER_"] = "flexlayout__tabset_tabbar_inner_tab_container_";
329
335
  CLASSES2["FLEXLAYOUT__TABSET_TABBAR_OUTER"] = "flexlayout__tabset_tabbar_outer";
@@ -887,11 +893,7 @@ class Node {
887
893
  for (const node of this.children) {
888
894
  let newPath = path;
889
895
  if (node.getType() === "row") {
890
- if (node.getOrientation() === Orientation.VERT) {
891
- newPath += "/c" + i;
892
- } else {
893
- newPath += "/r" + i;
894
- }
896
+ newPath += "/r" + i;
895
897
  } else if (node.getType() === "tabset") {
896
898
  newPath += "/ts" + i;
897
899
  } else if (node.getType() === "tab") {
@@ -2644,7 +2646,7 @@ const _Model = class _Model {
2644
2646
  case Actions.CLOSE_WINDOW: {
2645
2647
  const window2 = this.windows.get(action.data.windowId);
2646
2648
  if (window2) {
2647
- (_a = this.rootWindow.root) == null ? void 0 : _a.drop(window2 == null ? void 0 : window2.root, DockLocation.CENTER, -1);
2649
+ (_a = this.rootWindow.root) == null ? void 0 : _a.drop(window2.root, DockLocation.CENTER, -1);
2648
2650
  this.rootWindow.visitNodes((node, level) => {
2649
2651
  if (node instanceof RowNode) {
2650
2652
  node.setWindowId(_Model.MAIN_WINDOW_ID);
@@ -4346,10 +4348,13 @@ const BorderTabSet = (props) => {
4346
4348
  if (border.getClassName() !== void 0) {
4347
4349
  borderClasses += " " + border.getClassName();
4348
4350
  }
4351
+ let leading = void 0;
4349
4352
  let buttons = [];
4350
- const stickyButtons = [];
4351
- const renderState = { buttons, stickyButtons, overflowPosition: void 0 };
4353
+ let stickyButtons = [];
4354
+ const renderState = { leading, buttons, stickyButtons, overflowPosition: void 0 };
4352
4355
  layout.customizeTabSet(border, renderState);
4356
+ leading = renderState.leading;
4357
+ stickyButtons = renderState.stickyButtons;
4353
4358
  buttons = renderState.buttons;
4354
4359
  if (renderState.overflowPosition === void 0) {
4355
4360
  renderState.overflowPosition = stickyButtons.length;
@@ -4449,6 +4454,10 @@ const BorderTabSet = (props) => {
4449
4454
  }
4450
4455
  );
4451
4456
  }
4457
+ let leadingContainer = void 0;
4458
+ if (leading) {
4459
+ leadingContainer = /* @__PURE__ */ jsx("div", { className: cm(CLASSES.FLEXLAYOUT__BORDER_LEADING), children: leading });
4460
+ }
4452
4461
  return /* @__PURE__ */ jsxs(
4453
4462
  "div",
4454
4463
  {
@@ -4464,6 +4473,7 @@ const BorderTabSet = (props) => {
4464
4473
  onContextMenu,
4465
4474
  onWheel: onMouseWheel,
4466
4475
  children: [
4476
+ leadingContainer,
4467
4477
  /* @__PURE__ */ jsxs("div", { className: cm(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER), children: [
4468
4478
  /* @__PURE__ */ jsx(
4469
4479
  "div",
@@ -4506,31 +4516,6 @@ const DragContainer = (props) => {
4506
4516
  }
4507
4517
  );
4508
4518
  };
4509
- class ErrorBoundary extends React.Component {
4510
- constructor(props) {
4511
- super(props);
4512
- __publicField(this, "retry", () => {
4513
- this.setState({ hasError: false });
4514
- });
4515
- this.state = { hasError: false };
4516
- }
4517
- static getDerivedStateFromError(error) {
4518
- return { hasError: true };
4519
- }
4520
- componentDidCatch(error, errorInfo) {
4521
- console.debug(error);
4522
- console.debug(errorInfo);
4523
- }
4524
- render() {
4525
- if (this.state.hasError) {
4526
- return /* @__PURE__ */ jsx("div", { className: CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER, children: /* @__PURE__ */ jsx("div", { className: CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
4527
- this.props.message,
4528
- /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("button", { onClick: this.retry, children: this.props.retryText }) })
4529
- ] }) }) });
4530
- }
4531
- return this.props.children;
4532
- }
4533
- }
4534
4519
  const PopoutWindow = (props) => {
4535
4520
  const { title, layout, layoutWindow, url, onCloseWindow, onSetWindow, children } = props;
4536
4521
  const popoutWindow = React.useRef(null);
@@ -4696,6 +4681,15 @@ const AddIcon = () => {
4696
4681
  /* @__PURE__ */ jsx("path", { stroke: "var(--color-icon)", d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
4697
4682
  ] });
4698
4683
  };
4684
+ const MenuIcon = () => {
4685
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", style, height: "24px", width: "24px", viewBox: "0 -960 960 960", fill: "var(--color-icon)", children: /* @__PURE__ */ jsx("path", { d: "M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" }) });
4686
+ };
4687
+ const SettingsIcon = (props) => {
4688
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", ...props, style, viewBox: "0 0 24 24", fill: "var(--color-icon)", children: /* @__PURE__ */ jsxs("g", { children: [
4689
+ /* @__PURE__ */ jsx("path", { d: "M0,0h24v24H0V0z", fill: "none" }),
4690
+ /* @__PURE__ */ jsx("path", { d: "M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z" })
4691
+ ] }) });
4692
+ };
4699
4693
  const Overlay = (props) => {
4700
4694
  const { layout, show } = props;
4701
4695
  return /* @__PURE__ */ jsx(
@@ -5005,10 +4999,12 @@ const TabSet = (props) => {
5005
4999
  }
5006
5000
  }
5007
5001
  }
5002
+ let leading = void 0;
5008
5003
  let stickyButtons = [];
5009
5004
  let buttons = [];
5010
- const renderState = { stickyButtons, buttons, overflowPosition: void 0 };
5005
+ const renderState = { leading, stickyButtons, buttons, overflowPosition: void 0 };
5011
5006
  layout.customizeTabSet(node, renderState);
5007
+ leading = renderState.leading;
5012
5008
  stickyButtons = renderState.stickyButtons;
5013
5009
  buttons = renderState.buttons;
5014
5010
  const isTabStretch = node.isEnableSingleTabStretch() && node.getChildren().length === 1;
@@ -5167,6 +5163,10 @@ const TabSet = (props) => {
5167
5163
  tabStripClasses += " " + tabNode.getTabSetClassName();
5168
5164
  }
5169
5165
  }
5166
+ let leadingContainer = void 0;
5167
+ if (leading) {
5168
+ leadingContainer = /* @__PURE__ */ jsx("div", { className: cm(CLASSES.FLEXLAYOUT__TABSET_LEADING), children: leading });
5169
+ }
5170
5170
  if (node.isEnableTabWrap()) {
5171
5171
  if (node.isEnableTabStrip()) {
5172
5172
  tabStrip = /* @__PURE__ */ jsxs(
@@ -5184,6 +5184,7 @@ const TabSet = (props) => {
5184
5184
  draggable: true,
5185
5185
  onDragStart,
5186
5186
  children: [
5187
+ leadingContainer,
5187
5188
  tabs,
5188
5189
  /* @__PURE__ */ jsx("div", { style: { flexGrow: 1 } }),
5189
5190
  buttonbar
@@ -5219,6 +5220,7 @@ const TabSet = (props) => {
5219
5220
  onWheel: onMouseWheel,
5220
5221
  onDragStart,
5221
5222
  children: [
5223
+ leadingContainer,
5222
5224
  /* @__PURE__ */ jsxs("div", { className: cm(CLASSES.FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER), children: [
5223
5225
  /* @__PURE__ */ jsx(
5224
5226
  "div",
@@ -5443,11 +5445,45 @@ const Tab = (props) => {
5443
5445
  )
5444
5446
  ] });
5445
5447
  };
5446
- const SizeTracker = React.memo(({ children }) => {
5447
- return /* @__PURE__ */ jsx(Fragment, { children });
5448
- }, (prevProps, nextProps) => {
5449
- return prevProps.rect.equalSize(nextProps.rect) && prevProps.selected === nextProps.selected && prevProps.forceRevision === nextProps.forceRevision && prevProps.tabsRevision === nextProps.tabsRevision;
5450
- });
5448
+ class ErrorBoundary extends React.Component {
5449
+ constructor(props) {
5450
+ super(props);
5451
+ __publicField(this, "retry", () => {
5452
+ this.setState({ hasError: false });
5453
+ });
5454
+ this.state = { hasError: false };
5455
+ }
5456
+ static getDerivedStateFromError(error) {
5457
+ return { hasError: true };
5458
+ }
5459
+ componentDidCatch(error, errorInfo) {
5460
+ console.debug(error);
5461
+ console.debug(errorInfo);
5462
+ }
5463
+ render() {
5464
+ if (this.state.hasError) {
5465
+ return /* @__PURE__ */ jsx("div", { className: CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER, children: /* @__PURE__ */ jsx("div", { className: CLASSES.FLEXLAYOUT__ERROR_BOUNDARY_CONTENT, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center" }, children: [
5466
+ this.props.message,
5467
+ /* @__PURE__ */ jsx("p", { children: /* @__PURE__ */ jsx("button", { onClick: this.retry, children: this.props.retryText }) })
5468
+ ] }) }) });
5469
+ }
5470
+ return this.props.children;
5471
+ }
5472
+ }
5473
+ const SizeTracker = React.memo(({ layout, node }) => {
5474
+ return /* @__PURE__ */ jsx(
5475
+ ErrorBoundary,
5476
+ {
5477
+ message: layout.i18nName(I18nLabel.Error_rendering_component),
5478
+ retryText: layout.i18nName(I18nLabel.Error_rendering_component_retry),
5479
+ children: layout.props.factory(node)
5480
+ }
5481
+ );
5482
+ }, arePropsEqual);
5483
+ function arePropsEqual(prevProps, nextProps) {
5484
+ const reRender = nextProps.visible && (!prevProps.rect.equalSize(nextProps.rect) || prevProps.forceRevision !== nextProps.forceRevision || prevProps.tabsRevision !== nextProps.tabsRevision);
5485
+ return !reRender;
5486
+ }
5451
5487
  class Layout extends React.Component {
5452
5488
  // so LayoutInternal knows this is a parent render (used for optimization)
5453
5489
  /** @internal */
@@ -5658,7 +5694,6 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5658
5694
  }
5659
5695
  });
5660
5696
  __publicField(this, "onDragEnter", (event) => {
5661
- var _a;
5662
5697
  if (!_LayoutInternal.dragState && this.props.onExternalDrag) {
5663
5698
  const externalDrag = this.props.onExternalDrag(event);
5664
5699
  if (externalDrag) {
@@ -5687,7 +5722,7 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5687
5722
  if (!this.isDraggingOverWindow && this.props.model.getMaximizedTabset(this.windowId) === void 0) {
5688
5723
  this.setState({ showEdges: this.props.model.isEnableEdgeDock() });
5689
5724
  }
5690
- const clientRect = (_a = this.selfRef.current) == null ? void 0 : _a.getBoundingClientRect();
5725
+ const clientRect = this.selfRef.current.getBoundingClientRect();
5691
5726
  const r = new Rect(
5692
5727
  event.clientX - clientRect.left,
5693
5728
  event.clientY - clientRect.top,
@@ -5836,6 +5871,9 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
5836
5871
  if (this.selfRef.current) {
5837
5872
  (_a = this.resizeObserver) == null ? void 0 : _a.unobserve(this.selfRef.current);
5838
5873
  }
5874
+ if (this.isMainWindow) {
5875
+ this.props.model.removeChangeListener(this.onModelChange);
5876
+ }
5839
5877
  (_b = this.styleObserver) == null ? void 0 : _b.disconnect();
5840
5878
  }
5841
5879
  render() {
@@ -6007,18 +6045,23 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
6007
6045
  child.setMoveableElement(element);
6008
6046
  const selected = child.isSelected();
6009
6047
  const rect = child.getParent().getContentRect();
6010
- const renderTab = child.isRendered() || (selected || !child.isEnableRenderOnDemand()) && (rect.width > 0 && rect.height > 0);
6048
+ const visible = selected || !child.isEnableRenderOnDemand();
6049
+ const renderTab = child.isRendered() || visible && (rect.width > 0 && rect.height > 0);
6011
6050
  if (renderTab) {
6012
6051
  const key = child.getId() + (child.isEnableWindowReMount() ? child.getWindowId() : "");
6013
6052
  tabMoveables.set(node.getId(), createPortal(
6014
- /* @__PURE__ */ jsx(SizeTracker, { rect, selected: child.isSelected(), forceRevision: this.state.forceRevision, tabsRevision: this.props.renderRevision, children: /* @__PURE__ */ jsx(
6015
- ErrorBoundary,
6053
+ /* @__PURE__ */ jsx(
6054
+ SizeTracker,
6016
6055
  {
6017
- message: this.i18nName(I18nLabel.Error_rendering_component),
6018
- retryText: this.i18nName(I18nLabel.Error_rendering_component_retry),
6019
- children: this.props.factory(child)
6020
- }
6021
- ) }, key),
6056
+ layout: this,
6057
+ node: child,
6058
+ rect,
6059
+ visible,
6060
+ forceRevision: this.state.forceRevision,
6061
+ tabsRevision: this.props.renderRevision
6062
+ },
6063
+ key
6064
+ ),
6022
6065
  element,
6023
6066
  key
6024
6067
  ));
@@ -6047,20 +6090,16 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
6047
6090
  const path = child.getPath();
6048
6091
  const renderTab = child.isRendered() || selected || !child.isEnableRenderOnDemand();
6049
6092
  if (renderTab) {
6050
- tabs.set(
6051
- child.getId(),
6052
- // <SizeTracker rect={rect} forceRevision={this.state.forceRevision} key={key}>
6053
- /* @__PURE__ */ jsx(
6054
- Tab,
6055
- {
6056
- layout: this,
6057
- path,
6058
- node: child,
6059
- selected
6060
- },
6061
- child.getId()
6062
- )
6063
- );
6093
+ tabs.set(child.getId(), /* @__PURE__ */ jsx(
6094
+ Tab,
6095
+ {
6096
+ layout: this,
6097
+ path,
6098
+ node: child,
6099
+ selected
6100
+ },
6101
+ child.getId()
6102
+ ));
6064
6103
  }
6065
6104
  }
6066
6105
  });
@@ -6348,7 +6387,7 @@ const _LayoutInternal = class _LayoutInternal extends React.Component {
6348
6387
  };
6349
6388
  __publicField(_LayoutInternal, "dragState");
6350
6389
  let LayoutInternal = _LayoutInternal;
6351
- const FlexLayoutVersion = "0.8.13";
6390
+ const FlexLayoutVersion = "0.8.15";
6352
6391
  const defaultIcons = {
6353
6392
  close: /* @__PURE__ */ jsx(CloseIcon, {}),
6354
6393
  closeTabset: /* @__PURE__ */ jsx(CloseIcon, {}),
@@ -6397,6 +6436,7 @@ export {
6397
6436
  LayoutInternal,
6398
6437
  LayoutWindow,
6399
6438
  MaximizeIcon,
6439
+ MenuIcon,
6400
6440
  Model,
6401
6441
  Node,
6402
6442
  Orientation,
@@ -6405,6 +6445,7 @@ export {
6405
6445
  Rect,
6406
6446
  RestoreIcon,
6407
6447
  RowNode,
6448
+ SettingsIcon,
6408
6449
  TabNode,
6409
6450
  TabSetNode
6410
6451
  };
package/package.json CHANGED
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "name": "flexlayout-react",
3
- "version": "0.8.13",
3
+ "version": "0.8.15",
4
4
  "description": "A multi-tab docking layout manager",
5
5
  "author": "Caplin Systems Ltd",
6
6
  "repository": "https://github.com/caplin/FlexLayout",
7
7
  "license": "ISC",
8
8
  "type":"module",
9
- "main": "./lib/index.js",
10
- "module": "./lib/index.js",
11
- "types": "./declarations/index.d.ts",
9
+ "main": "./dist/index.js",
10
+ "module": "./dist/index.js",
11
+ "types": "./types/index.d.ts",
12
12
  "exports": {
13
13
  ".": {
14
- "import": "./lib/index.js"
14
+ "import": "./dist/index.js",
15
+ "types": "./types/index.d.ts"
15
16
  },
16
17
  "./style/*": "./style/*"
17
18
  },
18
19
  "files": [
19
- "declarations/",
20
- "lib/",
20
+ "dist/",
21
+ "types/",
21
22
  "style/"
22
23
  ],
23
24
  "keywords": [
@@ -42,16 +43,16 @@
42
43
  "scripts": {
43
44
  "dev": "vite",
44
45
  "preview": "vite preview",
45
- "build": "npm run build:clean && npm run css && npm run doc && npm run build:demo && npm run build:types && npm run build:libs",
46
- "build:clean": "rimraf lib/ declarations/ typedoc/",
46
+ "build": "npm run build:clean && npm run build:demo && npm run css && npm run build:lib && npm run build:types && npm run doc",
47
+ "build:clean": "rimraf demo/dist dist/ types/ typedoc/",
47
48
  "build:demo": "vite build",
48
49
  "build:types": "tsc -p tsconfig-types.json",
49
- "build:libs": "vite build --config vite.config.lib.ts",
50
+ "build:lib": "vite build --config vite.config.lib.ts",
50
51
  "test": "vitest",
51
52
  "playwright": "playwright test --ui",
52
53
  "lint": "eslint src/*",
53
54
  "doc": "typedoc --out typedoc --exclude \"**/demo/**/*.tsx\" --excludeInternal --disableSources --excludePrivate --excludeProtected --readme none ./src",
54
- "css": "sass style/rounded.scss style/rounded.css && sass style/underline.scss style/underline.css && sass style/gray.scss style/gray.css && sass style/light.scss style/light.css && sass style/dark.scss style/dark.css && sass style/combined.scss style/combined.css"
55
+ "css": "sass style:style"
55
56
  },
56
57
  "eslintConfig": {
57
58
  "extends": "react-app"
package/style/_base.scss CHANGED
@@ -195,6 +195,10 @@
195
195
  position: relative;
196
196
  }
197
197
 
198
+ &_leading {
199
+ display:flex;
200
+ }
201
+
198
202
  &_header {
199
203
  // tabset header bar
200
204
  display: flex;
@@ -478,6 +482,10 @@
478
482
  overflow: hidden;
479
483
  background-color: var(--color-border-tab-content);
480
484
  }
485
+
486
+ &_leading {
487
+ display:flex;
488
+ }
481
489
 
482
490
  &_top {
483
491
  border-bottom: 1px solid var(--color-border-divider-line);