@genesislcap/foundation-layout 14.92.2-beta.revert-PA-913.1 → 14.92.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +20 -2
- package/dist/custom-elements.json +129 -121
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/main/layout-main.d.ts +9 -0
- package/dist/dts/main/layout-main.d.ts.map +1 -1
- package/dist/dts/utils/constants.d.ts +5 -0
- package/dist/dts/utils/constants.d.ts.map +1 -1
- package/dist/dts/utils/events.d.ts +4 -0
- package/dist/dts/utils/events.d.ts.map +1 -1
- package/dist/dts/utils/types.d.ts +74 -2
- package/dist/dts/utils/types.d.ts.map +1 -1
- package/dist/esm/main/layout-main.js +55 -7
- package/dist/esm/utils/constants.js +5 -0
- package/dist/esm/utils/events.js +2 -0
- package/dist/esm/utils/types.js +1 -1
- package/dist/foundation-layout.api.json +109 -5
- package/dist/foundation-layout.d.ts +77 -0
- package/docs/api/foundation-layout.foundationlayout.getlayout.md +4 -0
- package/docs/api/foundation-layout.layoutcomponentwithstate.applystate.md +24 -0
- package/docs/api/foundation-layout.layoutcomponentwithstate.getcurrentstate.md +17 -0
- package/docs/api/foundation-layout.layoutcomponentwithstate.md +75 -0
- package/docs/api/foundation-layout.layoutreceiveevents.md +2 -1
- package/docs/api/foundation-layout.layoutreceiveeventsdetail.md +2 -1
- package/docs/api/foundation-layout.md +3 -2
- package/docs/api-report.md +8 -0
- package/package.json +7 -7
package/README.md
CHANGED
@@ -189,11 +189,13 @@ To enable autosaving the layout see [here](#autosaving-layout).
|
|
189
189
|
|
190
190
|
#### [Get Layout](./docs/api/foundation-layout.foundationlayout.getlayout.md)
|
191
191
|
|
192
|
-
Get an object describing the current layout so that it can be restored at a later date. This does not save any data internally to the layout. It is up to the client to store this state where appropriate for later recall (browser local storage, persistence layer, etc.)
|
192
|
+
Get an object describing the current layout so that it can be restored at a later date. This does not save any data internally to the layout. It is up to the client to store this state where appropriate for later recall (browser local storage, persistence layer, etc.). Use the [autosaving layout](#autosaving-layout) feature to get the layout to do this for you with local storage.
|
193
|
+
|
194
|
+
You can store state for an instance of an item, and that will be saved inline. See [managing state](#managing-state).
|
193
195
|
|
194
196
|
#### [Load Layout](./docs/api/foundation-layout.foundationlayout.loadlayout.md)
|
195
197
|
|
196
|
-
Loads a serialised layout. All items that are described in the config to load must already be registered with the layout system - using either the declarative or JavaScript API. If there are items missing (could be due either to missing items or to a mismatch of registered names) then a `LayoutUsageError` will be thrown containing the names of the missing items.
|
198
|
+
Loads a serialised layout. All items that are described in the config to load must already be registered with the layout system - using either the declarative or JavaScript API. If there are items missing (could be due either to missing items or to a mismatch of registered names) then a `LayoutUsageError` will be thrown containing the names of the missing items. Alternatively, you can request placeholder items to be added.
|
197
199
|
|
198
200
|
## Events
|
199
201
|
|
@@ -300,6 +302,22 @@ Throughout Foundation UI, there is no need to de-register a component that is re
|
|
300
302
|
|
301
303
|
- Once the component is actually initialised in the layout on the DOM, then `shouldRunConnect` will be true, and you can then perform all the required initialisation.
|
302
304
|
|
305
|
+
### Managing state
|
306
|
+
|
307
|
+
Items inside of the layout can save and restore state using various methods, but it can become difficult to manage state if you're adding the same item to the layout multiple times (multiple instances of the same web component).
|
308
|
+
|
309
|
+
You can implement the [LayoutComponentWithState](./docs/api/foundation-layout.layoutcomponentwithstate.md) interface which will allow you to save and load state *per instance* of your components. See the linked interface and the associated functions API documentation for examples and explanations of usage.
|
310
|
+
|
311
|
+
Usage of this interface is optional, if you do not need to manage state for your components in this way then simply do not implement the interface.
|
312
|
+
|
313
|
+
:::warning
|
314
|
+
The layout system is only interacting with the immediately contained items - so if you have components that contain other components, the top level components will need to interact with the contained components to manage their state.
|
315
|
+
:::
|
316
|
+
|
317
|
+
:::danger
|
318
|
+
Each layout item can contain multiple components, and most of the time there are no extra considerations when doing this. However, the state of each component in an instance is saved in order of the components on the DOM, so if the serialised state is manually changed to have the items out of order with their state, then the incorrect states will be passed into each item. This should not occur during defined behaviour, but is possible if the end-user is able to change the state passed into `loadLayout()` manually.
|
319
|
+
:::
|
320
|
+
|
303
321
|
### Element cloning
|
304
322
|
|
305
323
|
To enable you to add multiple items from the same `registration`, the layout system clones elements to add to the layout.
|
@@ -45,6 +45,14 @@
|
|
45
45
|
"module": "./utils"
|
46
46
|
}
|
47
47
|
},
|
48
|
+
{
|
49
|
+
"kind": "js",
|
50
|
+
"name": "LayoutComponentWithState",
|
51
|
+
"declaration": {
|
52
|
+
"name": "LayoutComponentWithState",
|
53
|
+
"module": "./utils"
|
54
|
+
}
|
55
|
+
},
|
48
56
|
{
|
49
57
|
"kind": "js",
|
50
58
|
"name": "LayoutEmitEvents",
|
@@ -1029,124 +1037,6 @@
|
|
1029
1037
|
}
|
1030
1038
|
]
|
1031
1039
|
},
|
1032
|
-
{
|
1033
|
-
"kind": "javascript-module",
|
1034
|
-
"path": "src/styles/constants.ts",
|
1035
|
-
"declarations": [
|
1036
|
-
{
|
1037
|
-
"kind": "variable",
|
1038
|
-
"name": "glVisualConfig",
|
1039
|
-
"type": {
|
1040
|
-
"text": "Omit<LayoutConfig, 'root'>"
|
1041
|
-
},
|
1042
|
-
"default": "{\n dimensions: {\n headerHeight: 38,\n borderWidth: 12,\n },\n header: {\n maximise: 'maximise',\n minimise: 'minimise',\n popout: false,\n },\n}"
|
1043
|
-
},
|
1044
|
-
{
|
1045
|
-
"kind": "variable",
|
1046
|
-
"name": "LAYOUT_ICONS",
|
1047
|
-
"type": {
|
1048
|
-
"text": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n}"
|
1049
|
-
},
|
1050
|
-
"default": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n}",
|
1051
|
-
"description": "A collection of SVG icons in base64 format.",
|
1052
|
-
"privacy": "public"
|
1053
|
-
}
|
1054
|
-
],
|
1055
|
-
"exports": [
|
1056
|
-
{
|
1057
|
-
"kind": "js",
|
1058
|
-
"name": "glVisualConfig",
|
1059
|
-
"declaration": {
|
1060
|
-
"name": "glVisualConfig",
|
1061
|
-
"module": "src/styles/constants.ts"
|
1062
|
-
}
|
1063
|
-
},
|
1064
|
-
{
|
1065
|
-
"kind": "js",
|
1066
|
-
"name": "LAYOUT_ICONS",
|
1067
|
-
"declaration": {
|
1068
|
-
"name": "LAYOUT_ICONS",
|
1069
|
-
"module": "src/styles/constants.ts"
|
1070
|
-
}
|
1071
|
-
}
|
1072
|
-
]
|
1073
|
-
},
|
1074
|
-
{
|
1075
|
-
"kind": "javascript-module",
|
1076
|
-
"path": "src/styles/dragging.styles.ts",
|
1077
|
-
"declarations": [
|
1078
|
-
{
|
1079
|
-
"kind": "variable",
|
1080
|
-
"name": "globalDraggingStyles",
|
1081
|
-
"default": "`\n .lm_dragProxy .lm_content {\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);\n }\n .lm_dropTargetIndicator {\n box-shadow: inset 0 0 30px #000000;\n outline: 1px dashed #cccccc;\n transition: all 200ms ease;\n }\n .lm_dropTargetIndicator .lm_inner {\n background: var(${neutralFillStealthRest.cssCustomProperty});\n opacity: 0.2;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n`",
|
1082
|
-
"description": "This is defined as a string rather than a css template\nbecause it is applied to a CSSStyleSheet object rather than\nused as a FAST template"
|
1083
|
-
}
|
1084
|
-
],
|
1085
|
-
"exports": [
|
1086
|
-
{
|
1087
|
-
"kind": "js",
|
1088
|
-
"name": "globalDraggingStyles",
|
1089
|
-
"declaration": {
|
1090
|
-
"name": "globalDraggingStyles",
|
1091
|
-
"module": "src/styles/dragging.styles.ts"
|
1092
|
-
}
|
1093
|
-
}
|
1094
|
-
]
|
1095
|
-
},
|
1096
|
-
{
|
1097
|
-
"kind": "javascript-module",
|
1098
|
-
"path": "src/styles/index.ts",
|
1099
|
-
"declarations": [],
|
1100
|
-
"exports": [
|
1101
|
-
{
|
1102
|
-
"kind": "js",
|
1103
|
-
"name": "*",
|
1104
|
-
"declaration": {
|
1105
|
-
"name": "*",
|
1106
|
-
"package": "./constants"
|
1107
|
-
}
|
1108
|
-
},
|
1109
|
-
{
|
1110
|
-
"kind": "js",
|
1111
|
-
"name": "*",
|
1112
|
-
"declaration": {
|
1113
|
-
"name": "*",
|
1114
|
-
"package": "./dragging.styles"
|
1115
|
-
}
|
1116
|
-
},
|
1117
|
-
{
|
1118
|
-
"kind": "js",
|
1119
|
-
"name": "*",
|
1120
|
-
"declaration": {
|
1121
|
-
"name": "*",
|
1122
|
-
"package": "./layout.styles"
|
1123
|
-
}
|
1124
|
-
}
|
1125
|
-
]
|
1126
|
-
},
|
1127
|
-
{
|
1128
|
-
"kind": "javascript-module",
|
1129
|
-
"path": "src/styles/layout.styles.ts",
|
1130
|
-
"declarations": [
|
1131
|
-
{
|
1132
|
-
"kind": "variable",
|
1133
|
-
"name": "layoutStyles",
|
1134
|
-
"default": "css`\n ${containerStyles}\n ${loadingSpinnerStyles}\n\n .lm_goldenlayout {\n padding: 1px;\n background: ${neutralLayer1};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n }\n\n .lm_stack.lm_item {\n background-color: ${neutralLayer4};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n }\n .lm_maximised .lm_header {\n background-color: ${neutralLayer4};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n position: unset;\n }\n\n .lm_maximised .lm_header .lm_tabs {\n z-index: 3;\n }\n\n .lm_content {\n background-color: ${neutralLayer3};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n border: 1px solid;\n border-color: #2e3339;\n box-sizing: border-box;\n }\n\n .lm-header {\n z-index: 1;\n }\n .lm_header .lm_tabs {\n padding: 0 16px;\n }\n\n .lm_stack > .lm_items {\n z-index: 2;\n box-shadow: 0px -1px 15px rgba(0, 0, 0, 0.35);\n }\n\n .lm_header .lm_tab.lm_active.lm_focused {\n background-color: ${neutralLayer3};\n }\n .lm_header .lm_tab.lm_active {\n background-color: ${neutralLayer3};\n border: 1px solid;\n border-color: #2e3339;\n border-bottom: 0;\n color: ${accentFillRest};\n }\n\n .lm_header .lm_tab {\n align-items: center;\n background-color: ${neutralLayer4};\n border: 1px solid;\n border-bottom-color: #2e3339;\n border-bottom: 0px solid;\n border-color: rgba(0, 0, 0, 0.35);\n border-radius: calc(${controlCornerRadius} * 1.5px) calc(${controlCornerRadius} * 1.5px) 0 0;\n box-shadow: 1px -1px 2px rgba(0, 0, 0, 0.35);\n color: rgba(255, 255, 255, 0.3);\n display: flex;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n height: 30px;\n margin-right: 2px;\n margin-top: 3px;\n padding: 2px 16px;\n }\n\n .lm_header .lm_tab:not(.lm_active):hover {\n background-color: rgba(255, 255, 255, 0.1);\n color: #f1f1f1;\n }\n\n .lm_header .lm_controls {\n top: 4px;\n display: flex;\n }\n .lm_header .lm_controls > * {\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px;\n background-color: rgba(255, 255, 255, 0.03);\n border-radius: calc(${controlCornerRadius} * 1.5px);\n margin-right: 4px;\n top: 3px;\n opacity: 1;\n }\n .lm_header .lm_controls > *:hover {\n background-color: rgba(255, 255, 255, 0.1);\n cursor: pointer;\n }\n\n .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.maximiseSVG}');\n }\n .lm_maximised .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.minimiseSVG}');\n }\n .lm_controls .lm_close {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n }\n .lm_header .lm_tab .lm_close_tab {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n background-size: 10px;\n background-repeat: no-repeat;\n margin-left: 12px;\n position: relative;\n top: 0;\n right: 0;\n }\n\n .lm_header .lm_tab.lm_active {\n padding: 4px 25px 3px 10px;\n }\n\n .lm_header .lm_tab:not(.lm_active) .lm_title {\n color: ${accentFillRest};\n opacity: 0.7;\n }\n\n .lm_header .lm_controls .lm_tabdropdown::before {\n content: none;\n }\n .lm_header .lm_controls .lm_tabdropdown {\n background-image: url('${LAYOUT_ICONS.tabDropdownSVG}');\n }\n .lm_header .lm_tabdropdown_list {\n top: 38px;\n right: 108px;\n background-color: ${neutralLayer3};\n border: 1px solid;\n border-color: #2e3339;\n border-radius: calc(${controlCornerRadius} * 1.5px);\n box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.35);\n }\n .lm_header .lm_tabdropdown_list > .lm_tab {\n box-shadow: none;\n padding: 0 16px;\n white-space: nowrap;\n background-color: transparent;\n color: #c9c9c9;\n height: 36px;\n border-radius: 0;\n overflow: visible;\n text-overflow: normal;\n }\n .lm_header .lm_tabdropdown_list > .lm_tab:last-child {\n border-bottom: 0;\n }\n\n /* gl base styles start */\n .lm_root {\n position: relative;\n }\n .lm_row > .lm_item {\n float: left;\n }\n .lm_content {\n overflow: hidden;\n position: relative;\n }\n .lm_dragging,\n .lm_dragging * {\n cursor: move !important;\n user-select: none;\n }\n .lm_maximised {\n left: 0;\n padding: 1px;\n position: absolute;\n top: 0;\n z-index: 40;\n }\n .lm_maximise_placeholder {\n display: none;\n }\n .lm_splitter {\n position: relative;\n z-index: 20;\n }\n .lm_splitter:hover,\n .lm_splitter.lm_dragging {\n background: ${accentFillRest};\n border-radius: calc(${controlCornerRadius} * 4px);\n }\n .lm_splitter.lm_vertical .lm_drag_handle {\n width: 100%;\n height: 15px;\n position: absolute;\n top: -5px;\n cursor: ns-resize;\n }\n .lm_splitter.lm_horizontal {\n float: left;\n height: 100%;\n }\n .lm_splitter.lm_horizontal .lm_drag_handle {\n width: 15px;\n height: 100%;\n position: absolute;\n left: -5px;\n cursor: ew-resize;\n }\n .lm_header {\n overflow: visible;\n position: relative;\n z-index: 1;\n }\n .lm_header [class^='lm_'] {\n box-sizing: content-box !important;\n }\n .lm_header .lm_controls {\n position: absolute;\n right: 3px;\n }\n .lm_header .lm_controls > li {\n cursor: pointer;\n float: left;\n width: 18px;\n height: 18px;\n text-align: center;\n }\n .lm_header ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n .lm_header .lm_tabs {\n position: absolute;\n }\n .lm_header .lm_tab {\n cursor: pointer;\n float: left;\n margin-top: 1px;\n padding: 3px 25px 3px 10px;\n position: relative;\n }\n .lm_header .lm_tab i {\n width: 2px;\n height: 19px;\n position: absolute;\n }\n .lm_header .lm_tab i.lm_left {\n top: 0;\n left: -2px;\n }\n .lm_header .lm_tab i.lm_right {\n top: 0;\n right: -2px;\n }\n .lm_header .lm_tab .lm_title {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .lm_header .lm_tab .lm_title:only-child {\n padding-left: 10px;\n }\n .lm_header .lm_tab .lm_close_tab {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 11px;\n right: 0;\n text-align: center;\n }\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n height: 100%;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header,\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_left .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items,\n .lm_stack.lm_left .lm_items,\n .lm_stack.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab,\n .lm_stack.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab,\n .lm_stack.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_drop_tab_placeholder {\n float: left;\n width: 100px;\n height: 10px;\n visibility: hidden;\n }\n .lm_header .lm_tabdropdown_list {\n position: absolute;\n top: 20px;\n right: 0;\n z-index: 5;\n overflow: hidden;\n }\n .lm_header .lm_tabdropdown_list .lm_tab {\n clear: both;\n padding-right: 10px;\n margin: 0;\n }\n .lm_header .lm_tabdropdown_list .lm_tab .lm_title {\n width: 100px;\n }\n .lm_header .lm_tabdropdown_list .lm_close_tab {\n display: none !important;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n .lm_popin {\n width: 20px;\n height: 20px;\n position: absolute;\n bottom: 0;\n right: 0;\n z-index: 9999;\n }\n .lm_popin > * {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n .lm_popin > .lm_bg {\n z-index: 10;\n }\n .lm_popin > .lm_icon {\n z-index: 20;\n } /*# sourceMappingURL=goldenlayout-base.css.map */\n`",
|
1135
|
-
"description": "`ElementStyles` which defines the css for FoundationLayout.",
|
1136
|
-
"privacy": "public"
|
1137
|
-
}
|
1138
|
-
],
|
1139
|
-
"exports": [
|
1140
|
-
{
|
1141
|
-
"kind": "js",
|
1142
|
-
"name": "layoutStyles",
|
1143
|
-
"declaration": {
|
1144
|
-
"name": "layoutStyles",
|
1145
|
-
"module": "src/styles/layout.styles.ts"
|
1146
|
-
}
|
1147
|
-
}
|
1148
|
-
]
|
1149
|
-
},
|
1150
1040
|
{
|
1151
1041
|
"kind": "javascript-module",
|
1152
1042
|
"path": "src/utils/constants.ts",
|
@@ -1233,10 +1123,10 @@
|
|
1233
1123
|
"kind": "variable",
|
1234
1124
|
"name": "LayoutReceiveEvents",
|
1235
1125
|
"type": {
|
1236
|
-
"text": "{\n changeTitle: 'change-title',\n}"
|
1126
|
+
"text": "{\n changeTitle: 'change-title',\n autosave: 'autosave',\n}"
|
1237
1127
|
},
|
1238
|
-
"default": "{\n changeTitle: 'change-title',\n}",
|
1239
|
-
"description": "Defines events that the layout system listens for\n\n'changeTitle' - emit this from a contained item to update the title of the window that contains it.",
|
1128
|
+
"default": "{\n changeTitle: 'change-title',\n autosave: 'autosave',\n}",
|
1129
|
+
"description": "Defines events that the layout system listens for\n\n'changeTitle' - emit this from a contained item to update the title of the window that contains it.\n'autosave' - emit this from a contained item to hint to the layout system that it should autosave the layout. A contained item should do this if it has just changed some state it would like to persist. See LayoutComponentWithState.",
|
1240
1130
|
"privacy": "public"
|
1241
1131
|
}
|
1242
1132
|
],
|
@@ -1359,6 +1249,124 @@
|
|
1359
1249
|
"path": "src/utils/types.ts",
|
1360
1250
|
"declarations": [],
|
1361
1251
|
"exports": []
|
1252
|
+
},
|
1253
|
+
{
|
1254
|
+
"kind": "javascript-module",
|
1255
|
+
"path": "src/styles/constants.ts",
|
1256
|
+
"declarations": [
|
1257
|
+
{
|
1258
|
+
"kind": "variable",
|
1259
|
+
"name": "glVisualConfig",
|
1260
|
+
"type": {
|
1261
|
+
"text": "Omit<LayoutConfig, 'root'>"
|
1262
|
+
},
|
1263
|
+
"default": "{\n dimensions: {\n headerHeight: 38,\n borderWidth: 12,\n },\n header: {\n maximise: 'maximise',\n minimise: 'minimise',\n popout: false,\n },\n}"
|
1264
|
+
},
|
1265
|
+
{
|
1266
|
+
"kind": "variable",
|
1267
|
+
"name": "LAYOUT_ICONS",
|
1268
|
+
"type": {
|
1269
|
+
"text": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n}"
|
1270
|
+
},
|
1271
|
+
"default": "{\n renameSVG,\n maximiseSVG,\n minimiseSVG,\n closeSVG,\n tabDropdownSVG,\n}",
|
1272
|
+
"description": "A collection of SVG icons in base64 format.",
|
1273
|
+
"privacy": "public"
|
1274
|
+
}
|
1275
|
+
],
|
1276
|
+
"exports": [
|
1277
|
+
{
|
1278
|
+
"kind": "js",
|
1279
|
+
"name": "glVisualConfig",
|
1280
|
+
"declaration": {
|
1281
|
+
"name": "glVisualConfig",
|
1282
|
+
"module": "src/styles/constants.ts"
|
1283
|
+
}
|
1284
|
+
},
|
1285
|
+
{
|
1286
|
+
"kind": "js",
|
1287
|
+
"name": "LAYOUT_ICONS",
|
1288
|
+
"declaration": {
|
1289
|
+
"name": "LAYOUT_ICONS",
|
1290
|
+
"module": "src/styles/constants.ts"
|
1291
|
+
}
|
1292
|
+
}
|
1293
|
+
]
|
1294
|
+
},
|
1295
|
+
{
|
1296
|
+
"kind": "javascript-module",
|
1297
|
+
"path": "src/styles/dragging.styles.ts",
|
1298
|
+
"declarations": [
|
1299
|
+
{
|
1300
|
+
"kind": "variable",
|
1301
|
+
"name": "globalDraggingStyles",
|
1302
|
+
"default": "`\n .lm_dragProxy .lm_content {\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);\n }\n .lm_dropTargetIndicator {\n box-shadow: inset 0 0 30px #000000;\n outline: 1px dashed #cccccc;\n transition: all 200ms ease;\n }\n .lm_dropTargetIndicator .lm_inner {\n background: var(${neutralFillStealthRest.cssCustomProperty});\n opacity: 0.2;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n`",
|
1303
|
+
"description": "This is defined as a string rather than a css template\nbecause it is applied to a CSSStyleSheet object rather than\nused as a FAST template"
|
1304
|
+
}
|
1305
|
+
],
|
1306
|
+
"exports": [
|
1307
|
+
{
|
1308
|
+
"kind": "js",
|
1309
|
+
"name": "globalDraggingStyles",
|
1310
|
+
"declaration": {
|
1311
|
+
"name": "globalDraggingStyles",
|
1312
|
+
"module": "src/styles/dragging.styles.ts"
|
1313
|
+
}
|
1314
|
+
}
|
1315
|
+
]
|
1316
|
+
},
|
1317
|
+
{
|
1318
|
+
"kind": "javascript-module",
|
1319
|
+
"path": "src/styles/index.ts",
|
1320
|
+
"declarations": [],
|
1321
|
+
"exports": [
|
1322
|
+
{
|
1323
|
+
"kind": "js",
|
1324
|
+
"name": "*",
|
1325
|
+
"declaration": {
|
1326
|
+
"name": "*",
|
1327
|
+
"package": "./constants"
|
1328
|
+
}
|
1329
|
+
},
|
1330
|
+
{
|
1331
|
+
"kind": "js",
|
1332
|
+
"name": "*",
|
1333
|
+
"declaration": {
|
1334
|
+
"name": "*",
|
1335
|
+
"package": "./dragging.styles"
|
1336
|
+
}
|
1337
|
+
},
|
1338
|
+
{
|
1339
|
+
"kind": "js",
|
1340
|
+
"name": "*",
|
1341
|
+
"declaration": {
|
1342
|
+
"name": "*",
|
1343
|
+
"package": "./layout.styles"
|
1344
|
+
}
|
1345
|
+
}
|
1346
|
+
]
|
1347
|
+
},
|
1348
|
+
{
|
1349
|
+
"kind": "javascript-module",
|
1350
|
+
"path": "src/styles/layout.styles.ts",
|
1351
|
+
"declarations": [
|
1352
|
+
{
|
1353
|
+
"kind": "variable",
|
1354
|
+
"name": "layoutStyles",
|
1355
|
+
"default": "css`\n ${containerStyles}\n ${loadingSpinnerStyles}\n\n .lm_goldenlayout {\n padding: 1px;\n background: ${neutralLayer1};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n }\n\n .lm_stack.lm_item {\n background-color: ${neutralLayer4};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n }\n .lm_maximised .lm_header {\n background-color: ${neutralLayer4};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n position: unset;\n }\n\n .lm_maximised .lm_header .lm_tabs {\n z-index: 3;\n }\n\n .lm_content {\n background-color: ${neutralLayer3};\n border-radius: calc(${controlCornerRadius} * 1.5px);\n border: 1px solid;\n border-color: #2e3339;\n box-sizing: border-box;\n }\n\n .lm-header {\n z-index: 1;\n }\n .lm_header .lm_tabs {\n padding: 0 16px;\n }\n\n .lm_stack > .lm_items {\n z-index: 2;\n box-shadow: 0px -1px 15px rgba(0, 0, 0, 0.35);\n }\n\n .lm_header .lm_tab.lm_active.lm_focused {\n background-color: ${neutralLayer3};\n }\n .lm_header .lm_tab.lm_active {\n background-color: ${neutralLayer3};\n border: 1px solid;\n border-color: #2e3339;\n border-bottom: 0;\n color: ${accentFillRest};\n }\n\n .lm_header .lm_tab {\n align-items: center;\n background-color: ${neutralLayer4};\n border: 1px solid;\n border-bottom-color: #2e3339;\n border-bottom: 0px solid;\n border-color: rgba(0, 0, 0, 0.35);\n border-radius: calc(${controlCornerRadius} * 1.5px) calc(${controlCornerRadius} * 1.5px) 0 0;\n box-shadow: 1px -1px 2px rgba(0, 0, 0, 0.35);\n color: rgba(255, 255, 255, 0.3);\n display: flex;\n font-family: inherit;\n font-size: 13px;\n font-weight: 700;\n height: 30px;\n margin-right: 2px;\n margin-top: 3px;\n padding: 2px 16px;\n }\n\n .lm_header .lm_tab:not(.lm_active):hover {\n background-color: rgba(255, 255, 255, 0.1);\n color: #f1f1f1;\n }\n\n .lm_header .lm_controls {\n top: 4px;\n display: flex;\n }\n .lm_header .lm_controls > * {\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px;\n background-color: rgba(255, 255, 255, 0.03);\n border-radius: calc(${controlCornerRadius} * 1.5px);\n margin-right: 4px;\n top: 3px;\n opacity: 1;\n }\n .lm_header .lm_controls > *:hover {\n background-color: rgba(255, 255, 255, 0.1);\n cursor: pointer;\n }\n\n .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.maximiseSVG}');\n }\n .lm_maximised .lm_controls .lm_maximise {\n background-image: url('${LAYOUT_ICONS.minimiseSVG}');\n }\n .lm_controls .lm_close {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n }\n .lm_header .lm_tab .lm_close_tab {\n background-image: url('${LAYOUT_ICONS.closeSVG}');\n background-size: 10px;\n background-repeat: no-repeat;\n margin-left: 12px;\n position: relative;\n top: 0;\n right: 0;\n }\n\n .lm_header .lm_tab.lm_active {\n padding: 4px 25px 3px 10px;\n }\n\n .lm_header .lm_tab:not(.lm_active) .lm_title {\n color: ${accentFillRest};\n opacity: 0.7;\n }\n\n .lm_header .lm_controls .lm_tabdropdown::before {\n content: none;\n }\n .lm_header .lm_controls .lm_tabdropdown {\n background-image: url('${LAYOUT_ICONS.tabDropdownSVG}');\n }\n .lm_header .lm_tabdropdown_list {\n top: 38px;\n right: 108px;\n background-color: ${neutralLayer3};\n border: 1px solid;\n border-color: #2e3339;\n border-radius: calc(${controlCornerRadius} * 1.5px);\n box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.35);\n }\n .lm_header .lm_tabdropdown_list > .lm_tab {\n box-shadow: none;\n padding: 0 16px;\n white-space: nowrap;\n background-color: transparent;\n color: #c9c9c9;\n height: 36px;\n border-radius: 0;\n overflow: visible;\n text-overflow: normal;\n }\n .lm_header .lm_tabdropdown_list > .lm_tab:last-child {\n border-bottom: 0;\n }\n\n /* gl base styles start */\n .lm_root {\n position: relative;\n }\n .lm_row > .lm_item {\n float: left;\n }\n .lm_content {\n overflow: hidden;\n position: relative;\n }\n .lm_dragging,\n .lm_dragging * {\n cursor: move !important;\n user-select: none;\n }\n .lm_maximised {\n left: 0;\n padding: 1px;\n position: absolute;\n top: 0;\n z-index: 40;\n }\n .lm_maximise_placeholder {\n display: none;\n }\n .lm_splitter {\n position: relative;\n z-index: 20;\n }\n .lm_splitter:hover,\n .lm_splitter.lm_dragging {\n background: ${accentFillRest};\n border-radius: calc(${controlCornerRadius} * 4px);\n }\n .lm_splitter.lm_vertical .lm_drag_handle {\n width: 100%;\n height: 15px;\n position: absolute;\n top: -5px;\n cursor: ns-resize;\n }\n .lm_splitter.lm_horizontal {\n float: left;\n height: 100%;\n }\n .lm_splitter.lm_horizontal .lm_drag_handle {\n width: 15px;\n height: 100%;\n position: absolute;\n left: -5px;\n cursor: ew-resize;\n }\n .lm_header {\n overflow: visible;\n position: relative;\n z-index: 1;\n }\n .lm_header [class^='lm_'] {\n box-sizing: content-box !important;\n }\n .lm_header .lm_controls {\n position: absolute;\n right: 3px;\n }\n .lm_header .lm_controls > li {\n cursor: pointer;\n float: left;\n width: 18px;\n height: 18px;\n text-align: center;\n }\n .lm_header ul {\n margin: 0;\n padding: 0;\n list-style-type: none;\n }\n .lm_header .lm_tabs {\n position: absolute;\n }\n .lm_header .lm_tab {\n cursor: pointer;\n float: left;\n margin-top: 1px;\n padding: 3px 25px 3px 10px;\n position: relative;\n }\n .lm_header .lm_tab i {\n width: 2px;\n height: 19px;\n position: absolute;\n }\n .lm_header .lm_tab i.lm_left {\n top: 0;\n left: -2px;\n }\n .lm_header .lm_tab i.lm_right {\n top: 0;\n right: -2px;\n }\n .lm_header .lm_tab .lm_title {\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .lm_header .lm_tab .lm_title:only-child {\n padding-left: 10px;\n }\n .lm_header .lm_tab .lm_close_tab {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 11px;\n right: 0;\n text-align: center;\n }\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n height: 100%;\n }\n .lm_dragProxy.lm_left .lm_header,\n .lm_dragProxy.lm_right .lm_header,\n .lm_stack.lm_left .lm_header,\n .lm_stack.lm_right .lm_header {\n width: 20px;\n float: left;\n vertical-align: top;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform-origin: left top;\n top: 0;\n width: 1000px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_controls,\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_left .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n bottom: 0;\n }\n .lm_dragProxy.lm_left .lm_items,\n .lm_dragProxy.lm_right .lm_items,\n .lm_stack.lm_left .lm_items,\n .lm_stack.lm_right .lm_items {\n float: left;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs,\n .lm_stack.lm_left .lm_header .lm_tabs {\n transform: rotate(-90deg) scaleX(-1);\n left: 0;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabs .lm_tab,\n .lm_stack.lm_left .lm_header .lm_tabs .lm_tab {\n transform: scaleX(-1);\n margin-top: 1px;\n }\n .lm_dragProxy.lm_left .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_left .lm_header .lm_tabdropdown_list {\n top: initial;\n right: initial;\n left: 20px;\n }\n .lm_dragProxy.lm_right .lm_content {\n float: left;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabs,\n .lm_stack.lm_right .lm_header .lm_tabs {\n transform: rotate(90deg) scaleX(1);\n left: 100%;\n margin-left: 0;\n }\n .lm_dragProxy.lm_right .lm_header .lm_controls,\n .lm_stack.lm_right .lm_header .lm_controls {\n left: 3px;\n }\n .lm_dragProxy.lm_right .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_right .lm_header .lm_tabdropdown_list {\n top: initial;\n right: 20px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tab,\n .lm_stack.lm_bottom .lm_header .lm_tab {\n margin-top: 0;\n border-top: none;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_controls,\n .lm_stack.lm_bottom .lm_header .lm_controls {\n top: 3px;\n }\n .lm_dragProxy.lm_bottom .lm_header .lm_tabdropdown_list,\n .lm_stack.lm_bottom .lm_header .lm_tabdropdown_list {\n top: initial;\n bottom: 20px;\n }\n .lm_drop_tab_placeholder {\n float: left;\n width: 100px;\n height: 10px;\n visibility: hidden;\n }\n .lm_header .lm_tabdropdown_list {\n position: absolute;\n top: 20px;\n right: 0;\n z-index: 5;\n overflow: hidden;\n }\n .lm_header .lm_tabdropdown_list .lm_tab {\n clear: both;\n padding-right: 10px;\n margin: 0;\n }\n .lm_header .lm_tabdropdown_list .lm_tab .lm_title {\n width: 100px;\n }\n .lm_header .lm_tabdropdown_list .lm_close_tab {\n display: none !important;\n }\n .lm_dragProxy {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 30;\n }\n .lm_dragProxy .lm_header {\n background: transparent;\n }\n .lm_dragProxy .lm_content {\n border-top: none;\n overflow: hidden;\n }\n .lm_dropTargetIndicator {\n display: none;\n position: absolute;\n z-index: 20;\n }\n .lm_dropTargetIndicator .lm_inner {\n width: 100%;\n height: 100%;\n position: relative;\n top: 0;\n left: 0;\n }\n .lm_transition_indicator {\n display: none;\n width: 20px;\n height: 20px;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 20;\n }\n .lm_popin {\n width: 20px;\n height: 20px;\n position: absolute;\n bottom: 0;\n right: 0;\n z-index: 9999;\n }\n .lm_popin > * {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n }\n .lm_popin > .lm_bg {\n z-index: 10;\n }\n .lm_popin > .lm_icon {\n z-index: 20;\n } /*# sourceMappingURL=goldenlayout-base.css.map */\n`",
|
1356
|
+
"description": "`ElementStyles` which defines the css for FoundationLayout.",
|
1357
|
+
"privacy": "public"
|
1358
|
+
}
|
1359
|
+
],
|
1360
|
+
"exports": [
|
1361
|
+
{
|
1362
|
+
"kind": "js",
|
1363
|
+
"name": "layoutStyles",
|
1364
|
+
"declaration": {
|
1365
|
+
"name": "layoutStyles",
|
1366
|
+
"module": "src/styles/layout.styles.ts"
|
1367
|
+
}
|
1368
|
+
}
|
1369
|
+
]
|
1362
1370
|
}
|
1363
1371
|
]
|
1364
1372
|
}
|
package/dist/dts/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
export * from './main';
|
2
2
|
export { LAYOUT_ICONS } from './styles';
|
3
|
-
export { CustomButton, DEFAULT_RELOAD_BUFFER, LayoutEmitEvents, LayoutReceiveEvents, LayoutReceiveEventsDetail, LayoutRegionType, LayoutRegistrationError, LayoutUsageError, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout, } from './utils';
|
3
|
+
export { CustomButton, DEFAULT_RELOAD_BUFFER, LayoutComponentWithState, LayoutEmitEvents, LayoutReceiveEvents, LayoutReceiveEventsDetail, LayoutRegionType, LayoutRegistrationError, LayoutUsageError, Placement, RegisteredElementConfig, RegistrationConfig, SerialisedLayout, } from './utils';
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/dts/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EACzB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
@@ -107,6 +107,8 @@ export declare class FoundationLayout extends FoundationElement implements Layou
|
|
107
107
|
private onPostItemRemoved;
|
108
108
|
/** @internal */
|
109
109
|
private onPostItemResized;
|
110
|
+
/** @internal */
|
111
|
+
private onAutosaveRequest;
|
110
112
|
/**
|
111
113
|
* JS API, public
|
112
114
|
*/
|
@@ -135,6 +137,8 @@ export declare class FoundationLayout extends FoundationElement implements Layou
|
|
135
137
|
/**
|
136
138
|
* @public
|
137
139
|
* Gets a minified string containing the config describing the current layout of the layout object to later restore in {@link FoundationLayout.loadLayout | function}
|
140
|
+
* @remarks
|
141
|
+
* Includes any state for a contained component exposed by the {@link LayoutComponentWithState} interface.
|
138
142
|
* @returns - latest version of {@link SerialisedLayout} describing the layout
|
139
143
|
*/
|
140
144
|
getLayout(): SerialisedLayout;
|
@@ -278,6 +282,11 @@ export declare class FoundationLayout extends FoundationElement implements Layou
|
|
278
282
|
* @internal
|
279
283
|
*/
|
280
284
|
private setupCustomButtons;
|
285
|
+
/**
|
286
|
+
* Return an array of each contained items in the layout.
|
287
|
+
* @internal
|
288
|
+
*/
|
289
|
+
private getLayoutComponents;
|
281
290
|
}
|
282
291
|
/**
|
283
292
|
* `ViewTemplate` which defines the html for {@link FoundationLayout}.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"layout-main.d.ts","sourceRoot":"","sources":["../../../src/main/layout-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EAEZ,cAAc,EAGf,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAEL,eAAe,EAGf,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EAKb,YAAY,
|
1
|
+
{"version":3,"file":"layout-main.d.ts","sourceRoot":"","sources":["../../../src/main/layout-main.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,YAAY,EAEZ,cAAc,EAGf,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAEL,eAAe,EAGf,SAAS,EACT,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EAKb,YAAY,EAIb,MAAM,WAAW,CAAC;AAKnB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiBzC;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,iBAAkB,YAAW,eAAe;;IAChF,OAAO,CAAC,MAAM,CAAe;IAC7B,gBAAgB;IAChB,aAAa,EAAE,WAAW,CAAC;IAC3B,OAAO,CAAC,YAAY,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unique symbol;
|
6
|
+
/**
|
7
|
+
* Used to key a reference to the instance and golden layout container on a layout component.
|
8
|
+
* @internal
|
9
|
+
*/
|
10
|
+
export declare const instanceContainer: unique symbol;
|
6
11
|
/**
|
7
12
|
* Default time in milliseconds for the layout to buffer calls to reloading
|
8
13
|
* the layout while the declarative API is loading.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,eAA2B,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,YAAY,+BAA+B,CAAC"}
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,eAA2B,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,eAA+B,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,YAAY,+BAA+B,CAAC"}
|
@@ -21,15 +21,18 @@ export declare const LayoutEmitEvents: {
|
|
21
21
|
* Defines events that the layout system listens for
|
22
22
|
*
|
23
23
|
* 'changeTitle' - emit this from a contained item to update the title of the window that contains it.
|
24
|
+
* 'autosave' - emit this from a contained item to hint to the layout system that it should autosave the layout. A contained item should do this if it has just changed some state it would like to persist. See {@link LayoutComponentWithState}.
|
24
25
|
* @public
|
25
26
|
*/
|
26
27
|
export declare const LayoutReceiveEvents: {
|
27
28
|
readonly changeTitle: "change-title";
|
29
|
+
readonly autosave: "autosave";
|
28
30
|
};
|
29
31
|
/**
|
30
32
|
* Defines the shape of the detail that the layout listens works with for events it listens on
|
31
33
|
*
|
32
34
|
* 'changeTitle' - `title` is the string you want to set. For `mode`: `replace` will set the title to be `title`, `suffix` will append `title` to the end of the existing title.
|
35
|
+
* 'autosave' - no other parameters.
|
33
36
|
* @public
|
34
37
|
*/
|
35
38
|
export type LayoutReceiveEventsDetail = {
|
@@ -37,5 +40,6 @@ export type LayoutReceiveEventsDetail = {
|
|
37
40
|
title: string;
|
38
41
|
mode: 'replace' | 'suffix';
|
39
42
|
};
|
43
|
+
autosave: void;
|
40
44
|
};
|
41
45
|
//# sourceMappingURL=events.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAEX
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/utils/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAA;KAAE,CAAC;IAC3D,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ResolvedLayoutConfig } from '@genesis-community/golden-layout';
|
2
|
-
import { componentType } from './constants';
|
1
|
+
import { ComponentContainer, ResolvedLayoutConfig } from '@genesis-community/golden-layout';
|
2
|
+
import { componentType, instanceContainer } from './constants';
|
3
3
|
/**
|
4
4
|
* Definition of a custom button which will be added to all layout items.
|
5
5
|
* @remarks
|
@@ -26,6 +26,69 @@ export type SerialisedLayout = {
|
|
26
26
|
v: '1';
|
27
27
|
c: ResolvedLayoutConfig;
|
28
28
|
};
|
29
|
+
/**
|
30
|
+
* Interface to implement on an item which is a component of the layout and you wish to serialise state with. This is saved separately for each instance of the component, which allows you to restore multiple instances of the same component with different state.
|
31
|
+
* @typeParam T - the type of the state object you wish to serialise with the component.
|
32
|
+
* @remarks
|
33
|
+
* When the layout is saved either via the autosave functionality or manually calling {@link FoundationLayout.getLayout}, all contained components will be requested to provide state if they wish.
|
34
|
+
*
|
35
|
+
* Any state which is provided will be saved as part of the layout config and will be passed back to the component when the layout is reloaded. Before an item is appended onto the layout DOM, the state will be applied to the component via `applyState`. You will likely want to cache this and then use it later in the lifecycle of the component. The state is `null` when the instance is first created.
|
36
|
+
*
|
37
|
+
* See the written documentation for some error scenarios to consider about when implementing this interface.
|
38
|
+
*
|
39
|
+
* @example
|
40
|
+
* ```
|
41
|
+
* type ComponentState = {
|
42
|
+
* foo: string;
|
43
|
+
* }
|
44
|
+
* \@customElement({ name: 'my-component' })
|
45
|
+
* export class MyComponent extends FASTElement implements LayoutComponentWithState<ComponentState> {
|
46
|
+
* \@observable foo: string;
|
47
|
+
* private fooCache: ComponentState | null;
|
48
|
+
*
|
49
|
+
* getCurrentState(): ComponentState {
|
50
|
+
* if (!this.foo) return null;
|
51
|
+
* return {
|
52
|
+
* foo: this.foo;
|
53
|
+
* }
|
54
|
+
* }
|
55
|
+
*
|
56
|
+
* applyState(state: ComponentState | null) {
|
57
|
+
* this.fooCache = state;
|
58
|
+
* }
|
59
|
+
*
|
60
|
+
* connectedCallback() {
|
61
|
+
* // do other required setup
|
62
|
+
* if (this.fooCache) {
|
63
|
+
* this.foo = this.fooCache.foo;
|
64
|
+
* }
|
65
|
+
* }
|
66
|
+
* }
|
67
|
+
* ```
|
68
|
+
*
|
69
|
+
* @example
|
70
|
+
* If you are using the autosave functionality you should inform the layout system when you update the state of a component, otherwise the state will only be updated when the user performs an action such as resizing an item. Use the {@link LayoutReceiveEvents} `autosave` event.
|
71
|
+
* ```
|
72
|
+
* // Same component as above
|
73
|
+
* export class MyComponent extends FASTElement implements LayoutComponentWithState<ComponentState> {
|
74
|
+
* // can use xChanged pattern as `foo` was declared observable
|
75
|
+
* fooChanged() {
|
76
|
+
* this.$emit(LayoutReceiveEvents.autosave);
|
77
|
+
* }
|
78
|
+
* }
|
79
|
+
* ```
|
80
|
+
* @public
|
81
|
+
* */
|
82
|
+
export interface LayoutComponentWithState<T> {
|
83
|
+
/**
|
84
|
+
* Provide the state you wish to save. It is recommended if the component which implements this interface has not fully initialised at the point this is called that you return `null` as the state, following the pattern of `null` being set as the initial state.
|
85
|
+
*/
|
86
|
+
getCurrentState(): T;
|
87
|
+
/**
|
88
|
+
* Handle any state that has been saved previously for this instance of this component. This will be called before the component is appended to the DOM. Due to the lifecycle events not running by this point, it is recommended you cache the state and then apply it in `connectedCallback`.
|
89
|
+
*/
|
90
|
+
applyState(state: T | null): void;
|
91
|
+
}
|
29
92
|
/**
|
30
93
|
* @public
|
31
94
|
* The parameters that can be set on a new item when being added by the {@link FoundationLayout.addItem} API
|
@@ -61,6 +124,15 @@ export type Placement = {
|
|
61
124
|
};
|
62
125
|
};
|
63
126
|
/** @internal */
|
127
|
+
export type InstanceContainer = {
|
128
|
+
container: ComponentContainer;
|
129
|
+
instance: string;
|
130
|
+
};
|
131
|
+
/** @internal */
|
132
|
+
export type LayoutComponentItem<T> = Element & Partial<LayoutComponentWithState<T>> & {
|
133
|
+
[instanceContainer]?: InstanceContainer;
|
134
|
+
};
|
135
|
+
/** @internal */
|
64
136
|
export interface RegistrationConfig {
|
65
137
|
elements: Element[];
|
66
138
|
id?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC5F,OAA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