flexlayout-react 0.8.4 → 0.8.6

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 (56) hide show
  1. package/ChangeLog.txt +9 -0
  2. package/README.md +29 -2
  3. package/declarations/Types.d.ts +2 -6
  4. package/declarations/view/Layout.d.ts +3 -1
  5. package/dist/flexlayout.js +7 -7
  6. package/dist/flexlayout_min.js +1 -1
  7. package/lib/Types.js +2 -6
  8. package/lib/Types.js.map +1 -1
  9. package/lib/model/TabSetNode.js +9 -4
  10. package/lib/model/TabSetNode.js.map +1 -1
  11. package/lib/view/BorderTabSet.js +11 -5
  12. package/lib/view/BorderTabSet.js.map +1 -1
  13. package/lib/view/Layout.js +3 -2
  14. package/lib/view/Layout.js.map +1 -1
  15. package/lib/view/PopupMenu.js +11 -5
  16. package/lib/view/PopupMenu.js.map +1 -1
  17. package/lib/view/TabOverflowHook.js +104 -21
  18. package/lib/view/TabOverflowHook.js.map +1 -1
  19. package/lib/view/TabSet.js +11 -5
  20. package/lib/view/TabSet.js.map +1 -1
  21. package/package.json +2 -2
  22. package/src/Types.ts +3 -8
  23. package/src/model/TabSetNode.ts +8 -4
  24. package/src/view/BorderTabSet.tsx +38 -24
  25. package/src/view/Layout.tsx +9 -5
  26. package/src/view/PopupMenu.tsx +31 -19
  27. package/src/view/TabOverflowHook.tsx +112 -21
  28. package/src/view/TabSet.tsx +36 -22
  29. package/style/_base.scss +569 -595
  30. package/style/_themes.scss +649 -0
  31. package/style/combined.css +1055 -0
  32. package/style/combined.css.map +1 -0
  33. package/style/combined.scss +46 -0
  34. package/style/dark.css +704 -701
  35. package/style/dark.css.map +1 -1
  36. package/style/dark.scss +5 -181
  37. package/style/gray.css +707 -684
  38. package/style/gray.css.map +1 -1
  39. package/style/gray.scss +5 -180
  40. package/style/light.css +681 -685
  41. package/style/light.css.map +1 -1
  42. package/style/light.scss +5 -163
  43. package/style/rounded.css +723 -730
  44. package/style/rounded.css.map +1 -1
  45. package/style/rounded.scss +5 -210
  46. package/style/underline.css +710 -705
  47. package/style/underline.css.map +1 -1
  48. package/style/underline.scss +5 -186
  49. package/.editorconfig +0 -8
  50. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -104
  51. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  52. package/.prettierrc.json +0 -3
  53. package/Screenshot_light.png +0 -0
  54. package/Screenshot_rounded.png +0 -0
  55. package/dist/bundles/demo.js +0 -232052
  56. package/dist/bundles/demo.js.map +0 -1
package/ChangeLog.txt CHANGED
@@ -1,3 +1,12 @@
1
+ 0.8.6
2
+ Restructured scss files to remove use of deprecated @import rule
3
+ Added combined.css containing all themes.
4
+ Updated demo to use combined.css for simple theme switching using class names
5
+ Added option in demo to show the layout structure
6
+
7
+ 0.8.5
8
+ Changed the mini scrollbar to only show when tabs are hovered over
9
+
1
10
  0.8.4
2
11
  Added attribute 'enableTabScrollbar' to TabSet and Border nodes
3
12
  Enabling this attribute will show a mini 'scrollbar' for the tabs to indicate the scroll position
package/README.md CHANGED
@@ -30,7 +30,7 @@ Features:
30
30
  * popout tabs into new browser windows
31
31
  * submodels, allow layouts inside layouts
32
32
  * tab renaming (double click tab text to rename)
33
- * theming - light, underline, gray, round and dark
33
+ * theming - light, dark, underline, gray, rounded and combined
34
34
  * works on mobile devices (iPad, Android)
35
35
  * add tabs using drag, add to active tab set, add to tab set by id
36
36
  * tab and tab set attributes: enableTabStrip, enableDock, enableDrop...
@@ -52,7 +52,7 @@ Import FlexLayout in your modules:
52
52
  import {Layout, Model} from 'flexlayout-react';
53
53
  ```
54
54
 
55
- Include the light, underline, gray or dark theme by either:
55
+ Include the light, dark, underline, gray, rounded or combined theme by either:
56
56
 
57
57
  Adding an additional import:
58
58
 
@@ -66,6 +66,9 @@ or by adding the css to your html:
66
66
  <link rel="stylesheet" href="node_modules/flexlayout-react/style/light.css" />
67
67
  ```
68
68
 
69
+ [How to change the theme dynamically in code](#dynamically-changing-the-theme)
70
+
71
+
69
72
  ## Usage
70
73
 
71
74
  The `<Layout>` component renders the tab sets and splitters, it takes the following props:
@@ -173,6 +176,10 @@ The layout element is built up using 3 types of 'node':
173
176
 
174
177
  The layout structure is defined with rows within rows that contain tabsets that themselves contain tabs.
175
178
 
179
+ Within the demo app you can show the layout structure by ticking the 'Show layout' checkbox, rows are shown in blue, tabsets in orange.
180
+
181
+ ![FlexLayout Demo Showing Layout](Screenshot_layout.png?raw=true "Demo showing layout")
182
+
176
183
  The optional borders element is made up of border nodes
177
184
 
178
185
  * border - borders contain a list of tabs and the index of the selected tab, they can only be used in the borders
@@ -196,6 +203,26 @@ tabs or drag and drop).
196
203
  global: {tabSetEnableTabStrip:false},
197
204
  ```
198
205
 
206
+ ## Dynamically Changing the Theme
207
+
208
+ The 'combined.css' theme contains all the other themes and can be used for theme switching.
209
+
210
+ When using combined.css, add a className (of the form "flexlayout__theme_[theme name]") to the div containing the `<Layout>` to select the applied theme.
211
+
212
+ For example:
213
+ ```
214
+ <div ref={containerRef} className="flexlayout__theme_light">
215
+ <Layout model={model} factory={factory} />
216
+ </div>
217
+ ```
218
+
219
+ Change the theme in code by changing the className on the containing div.
220
+
221
+ For example:
222
+ ```
223
+ containerRef.current!.className = "flexlayout__theme_dark"
224
+ ```
225
+
199
226
  ## Model Actions
200
227
 
201
228
  Once the model json has been loaded all changes to the model are applied through actions.
@@ -30,7 +30,6 @@ export declare enum CLASSES {
30
30
  FLEXLAYOUT__ERROR_BOUNDARY_CONTAINER = "flexlayout__error_boundary_container",
31
31
  FLEXLAYOUT__ERROR_BOUNDARY_CONTENT = "flexlayout__error_boundary_content",
32
32
  FLEXLAYOUT__FLOATING_WINDOW_CONTENT = "flexlayout__floating_window_content",
33
- FLEXLAYOUT__FLOATING_WINDOW_TAB = "flexlayout__floating_window_tab",
34
33
  FLEXLAYOUT__LAYOUT = "flexlayout__layout",
35
34
  FLEXLAYOUT__LAYOUT_MOVEABLES = "flexlayout__layout_moveables",
36
35
  FLEXLAYOUT__LAYOUT_OVERLAY = "flexlayout__layout_overlay",
@@ -56,11 +55,9 @@ export declare enum CLASSES {
56
55
  FLEXLAYOUT__TABSET = "flexlayout__tabset",
57
56
  FLEXLAYOUT__TABSET_CONTAINER = "flexlayout__tabset_container",
58
57
  FLEXLAYOUT__TABSET_HEADER = "flexlayout__tabset_header",
59
- FLEXLAYOUT__TABSET_HEADER_SIZER = "flexlayout__tabset_header_sizer",
60
58
  FLEXLAYOUT__TABSET_HEADER_CONTENT = "flexlayout__tabset_header_content",
61
59
  FLEXLAYOUT__TABSET_MAXIMIZED = "flexlayout__tabset-maximized",
62
60
  FLEXLAYOUT__TABSET_SELECTED = "flexlayout__tabset-selected",
63
- FLEXLAYOUT__TABSET_SIZER = "flexlayout__tabset_sizer",
64
61
  FLEXLAYOUT__TABSET_TAB_DIVIDER = "flexlayout__tabset_tab_divider",
65
62
  FLEXLAYOUT__TABSET_CONTENT = "flexlayout__tabset_content",
66
63
  FLEXLAYOUT__TABSET_TABBAR_INNER = "flexlayout__tabset_tabbar_inner",
@@ -80,8 +77,6 @@ export declare enum CLASSES {
80
77
  FLEXLAYOUT__TAB_BUTTON_TEXTBOX = "flexlayout__tab_button_textbox",
81
78
  FLEXLAYOUT__TAB_BUTTON_TRAILING = "flexlayout__tab_button_trailing",
82
79
  FLEXLAYOUT__TAB_BUTTON_STAMP = "flexlayout__tab_button_stamp",
83
- FLEXLAYOUT__TAB_FLOATING = "flexlayout__tab_floating",
84
- FLEXLAYOUT__TAB_FLOATING_INNER = "flexlayout__tab_floating_inner",
85
80
  FLEXLAYOUT__TAB_TOOLBAR = "flexlayout__tab_toolbar",
86
81
  FLEXLAYOUT__TAB_TOOLBAR_BUTTON = "flexlayout__tab_toolbar_button",
87
82
  FLEXLAYOUT__TAB_TOOLBAR_ICON = "flexlayout__tab_toolbar_icon",
@@ -91,7 +86,8 @@ export declare enum CLASSES {
91
86
  FLEXLAYOUT__TAB_TOOLBAR_BUTTON_CLOSE = "flexlayout__tab_toolbar_button-close",
92
87
  FLEXLAYOUT__POPUP_MENU_CONTAINER = "flexlayout__popup_menu_container",
93
88
  FLEXLAYOUT__POPUP_MENU_ITEM = "flexlayout__popup_menu_item",
89
+ FLEXLAYOUT__POPUP_MENU_ITEM__SELECTED = "flexlayout__popup_menu_item--selected",
94
90
  FLEXLAYOUT__POPUP_MENU = "flexlayout__popup_menu",
95
91
  FLEXLAYOUT__MINI_SCROLLBAR = "flexlayout__mini_scrollbar",
96
- FLEXLAYOUT__MINI_SCROLLBAR_HIDDEN = "flexlayout__mini_scrollbar_hidden"
92
+ FLEXLAYOUT__MINI_SCROLLBAR_CONTAINER = "flexlayout__mini_scrollbar_container"
97
93
  }
@@ -12,6 +12,8 @@ export interface ILayoutProps {
12
12
  model: Model;
13
13
  /** factory function for creating the tab components */
14
14
  factory: (node: TabNode) => React.ReactNode;
15
+ /** sets a top level class name on popout windows */
16
+ popoutClassName?: string;
15
17
  /** object mapping keys among close, maximize, restore, more, popout to React nodes to use in place of the default icons, can alternatively return functions for creating the React nodes */
16
18
  icons?: IIcons;
17
19
  /** function called whenever the layout generates an action to update the model (allows for intercepting actions before they are dispatched to the model, for example, asking the user to confirm a tab close.) Returning undefined from the function will halt the action, otherwise return the action to continue */
@@ -96,7 +98,7 @@ export declare class Layout extends React.Component<ILayoutProps> {
96
98
  /** Get the root div element of the layout */
97
99
  getRootDiv(): HTMLDivElement | null;
98
100
  }
99
- export declare const FlexLayoutVersion = "0.8.4";
101
+ export declare const FlexLayoutVersion = "0.8.6";
100
102
  export type DragRectRenderCallback = (content: React.ReactNode | undefined, node?: Node, json?: IJsonTabNode) => React.ReactNode | undefined;
101
103
  export type NodeMouseEvent = (node: TabNode | TabSetNode | BorderNode, event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
102
104
  export type ShowOverflowMenuCallback = (node: TabSetNode | BorderNode, mouseEvent: React.MouseEvent<HTMLElement, MouseEvent>, items: {