@itwin/appui-react 5.24.2 → 5.26.0
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.md +37 -0
- package/lib/appui-react/layout/target/TitleBarTarget.d.ts +1 -1
- package/lib/appui-react/layout/target/TitleBarTarget.d.ts.map +1 -1
- package/lib/appui-react/layout/target/TitleBarTarget.js +3 -3
- package/lib/appui-react/layout/target/TitleBarTarget.js.map +1 -1
- package/lib/appui-react/layout/target/TitleBarTarget.scss +9 -7
- package/lib/appui-react/layout/widget/ContentContainer.d.ts +2 -0
- package/lib/appui-react/layout/widget/ContentContainer.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/ContentContainer.js +16 -16
- package/lib/appui-react/layout/widget/ContentContainer.js.map +1 -1
- package/lib/appui-react/layout/widget/FloatingWidget.d.ts +56 -4
- package/lib/appui-react/layout/widget/FloatingWidget.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/FloatingWidget.js +97 -51
- package/lib/appui-react/layout/widget/FloatingWidget.js.map +1 -1
- package/lib/appui-react/layout/widget/PanelWidget.d.ts +2 -2
- package/lib/appui-react/layout/widget/PanelWidget.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/PanelWidget.js +6 -4
- package/lib/appui-react/layout/widget/PanelWidget.js.map +1 -1
- package/lib/appui-react/layout/widget/TabBar.d.ts +2 -0
- package/lib/appui-react/layout/widget/TabBar.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/TabBar.js +13 -12
- package/lib/appui-react/layout/widget/TabBar.js.map +1 -1
- package/lib/appui-react/layout/widget/Widget.d.ts +6 -3
- package/lib/appui-react/layout/widget/Widget.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/Widget.js +29 -31
- package/lib/appui-react/layout/widget/Widget.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.d.ts +4 -0
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.js +2 -2
- package/lib/appui-react/layout/widget/widget-content-layout/WidgetContentLayout.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.d.ts +2 -2
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js +4 -4
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.scss +9 -2
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderLayout.d.ts +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderLayout.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderLayout.js +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderLayout.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.d.ts +2 -4
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.js +2 -2
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderSearch.js.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.d.ts +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.d.ts.map +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.js +1 -1
- package/lib/appui-react/layout/widget/widget-content-layout/header/HeaderTopBar.js.map +1 -1
- package/lib/appui-react/preview/PreviewFeatures.d.ts +11 -3
- package/lib/appui-react/preview/PreviewFeatures.d.ts.map +1 -1
- package/lib/appui-react/preview/PreviewFeatures.js +4 -2
- package/lib/appui-react/preview/PreviewFeatures.js.map +1 -1
- package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.d.ts +3 -0
- package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.d.ts.map +1 -1
- package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.js +11 -2
- package/lib/appui-react/preview/control-widget-visibility/CloseWidgetButton.js.map +1 -1
- package/lib/appui-react/preview/widget-tab-actions/Widget.d.ts +10 -0
- package/lib/appui-react/preview/widget-tab-actions/Widget.d.ts.map +1 -0
- package/lib/appui-react/preview/widget-tab-actions/Widget.js +242 -0
- package/lib/appui-react/preview/widget-tab-actions/Widget.js.map +1 -0
- package/lib/appui-react/preview/widget-tab-actions/Widget.scss +198 -0
- package/lib/appui-react/preview/widget-tab-actions/useWidgetTabActions.d.ts +6 -0
- package/lib/appui-react/preview/widget-tab-actions/useWidgetTabActions.d.ts.map +1 -0
- package/lib/appui-react/preview/widget-tab-actions/useWidgetTabActions.js +18 -0
- package/lib/appui-react/preview/widget-tab-actions/useWidgetTabActions.js.map +1 -0
- package/lib/cjs/appui-react/layout/target/TitleBarTarget.scss +9 -7
- package/lib/cjs/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.scss +9 -2
- package/lib/cjs/appui-react/preview/widget-tab-actions/Widget.scss +198 -0
- package/lib/esm/appui-react/layout/target/TitleBarTarget.scss +9 -7
- package/lib/esm/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.scss +9 -2
- package/lib/esm/appui-react/preview/widget-tab-actions/Widget.scss +198 -0
- package/package.json +8 -8
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Widget
|
|
7
|
+
*/
|
|
8
|
+
import "./Widget.scss";
|
|
9
|
+
import classnames from "classnames";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { assert } from "@itwin/core-bentley";
|
|
12
|
+
import { Icon } from "@itwin/core-react";
|
|
13
|
+
import { useRefs } from "@itwin/core-react/internal";
|
|
14
|
+
import { IconButton, Tabs, VisuallyHidden } from "@itwin/itwinui-react";
|
|
15
|
+
import { SvgCloseSmall } from "@itwin/itwinui-icons-react";
|
|
16
|
+
import { useActiveTabId, useDragPanelWidget, useWidgetContextValue, WidgetContext, WidgetIdContext, } from "../../layout/widget/Widget.js";
|
|
17
|
+
import { useSafeContext } from "../../hooks/useSafeContext.js";
|
|
18
|
+
import { useLayout } from "../../layout/base/LayoutStore.js";
|
|
19
|
+
import { getWidgetState } from "../../layout/state/internal/WidgetStateHelpers.js";
|
|
20
|
+
import { TabIdContext } from "../../layout/widget/ContentRenderer.js";
|
|
21
|
+
import { useWidgetContentContainer } from "../../layout/widget/ContentContainer.js";
|
|
22
|
+
import { useTabInteractions } from "../../layout/widget/Tab.js";
|
|
23
|
+
import { FloatingWidgetHandle, useFloatingWidget, } from "../../layout/widget/FloatingWidget.js";
|
|
24
|
+
import { useWidgetTabCloseAction } from "./useWidgetTabActions.js";
|
|
25
|
+
import { NineZoneDispatchContext } from "../../layout/base/NineZone.js";
|
|
26
|
+
import { ConfigurableUiContext } from "../../configurableui/ConfigurableUiContent.js";
|
|
27
|
+
import { WidgetActions } from "../../layout/widget/WidgetActions.js";
|
|
28
|
+
import { TabTarget } from "../../layout/target/TabTarget.js";
|
|
29
|
+
import { TitleBarTarget } from "../../layout/target/TitleBarTarget.js";
|
|
30
|
+
import { WidgetTarget } from "../../layout/target/WidgetTarget.js";
|
|
31
|
+
import { WidgetOutline } from "../../layout/outline/WidgetOutline.js";
|
|
32
|
+
import { PanelSideContext } from "../../layout/widget-panels/Panel.js";
|
|
33
|
+
import { useDragWidgetHandle } from "../../layout/widget/TabBar.js";
|
|
34
|
+
import { useBorders } from "../../layout/widget/PanelWidget.js";
|
|
35
|
+
import { useTranslation } from "../../hooks/useTranslation.js";
|
|
36
|
+
import { useWidgetDef } from "../../widget-panels/Content.js";
|
|
37
|
+
const TabsContext = React.createContext(undefined);
|
|
38
|
+
const Widget = React.forwardRef((props, forwardedRef) => {
|
|
39
|
+
const { handles, minimized, ...rest } = props;
|
|
40
|
+
const widgetId = useSafeContext(WidgetIdContext);
|
|
41
|
+
const dispatch = React.useContext(NineZoneDispatchContext);
|
|
42
|
+
const tabIds = useLayout((state) => getWidgetState(state, widgetId).tabs);
|
|
43
|
+
const activeTabId = useActiveTabId();
|
|
44
|
+
const [actionTabId, setActionTabId] = React.useState(undefined);
|
|
45
|
+
const [focusedTabId, setFocusedTabId] = React.useState(undefined);
|
|
46
|
+
const [anchored, setAnchored] = React.useState(false);
|
|
47
|
+
const [actionFocused, setActionFocused] = React.useState(false);
|
|
48
|
+
const tabElementsRef = React.useRef(new Map());
|
|
49
|
+
const hideTab = React.useCallback((id) => {
|
|
50
|
+
setActionTabId(undefined);
|
|
51
|
+
dispatch({
|
|
52
|
+
type: "WIDGET_TAB_HIDE",
|
|
53
|
+
id,
|
|
54
|
+
});
|
|
55
|
+
const tabIndex = tabIds.indexOf(id);
|
|
56
|
+
const nextTabIndex = tabIndex + 1 > tabIds.length - 1 ? tabIndex - 1 : tabIndex + 1;
|
|
57
|
+
if (nextTabIndex < 0)
|
|
58
|
+
return;
|
|
59
|
+
const nextTabId = tabIds[nextTabIndex];
|
|
60
|
+
const tabEl = tabElementsRef.current.get(nextTabId);
|
|
61
|
+
tabEl?.focus();
|
|
62
|
+
}, [dispatch, tabIds]);
|
|
63
|
+
const setTabElement = React.useCallback((id, element) => {
|
|
64
|
+
tabElementsRef.current.set(id, element);
|
|
65
|
+
}, []);
|
|
66
|
+
const [widgetRef, value] = useWidgetContextValue();
|
|
67
|
+
const ref = useRefs(forwardedRef, widgetRef);
|
|
68
|
+
return (React.createElement(WidgetContext.Provider, { value: value },
|
|
69
|
+
React.createElement(TabsContext.Provider, { value: {
|
|
70
|
+
actionTabId,
|
|
71
|
+
setActionTabId,
|
|
72
|
+
hideTab,
|
|
73
|
+
setTabElement,
|
|
74
|
+
anchored,
|
|
75
|
+
setAnchored,
|
|
76
|
+
actionFocused,
|
|
77
|
+
setActionFocused,
|
|
78
|
+
focusedTabId,
|
|
79
|
+
setFocusedTabId,
|
|
80
|
+
} },
|
|
81
|
+
React.createElement(Tabs.Wrapper, { ...rest, className: classnames("uifw-preview-widgetTabActions-widget_wrapper", props.className), value: minimized ? "" : activeTabId, focusActivationMode: "manual", ref: ref },
|
|
82
|
+
React.createElement(WidgetHandle, null),
|
|
83
|
+
React.createElement(Tabs.TabList, { className: "uifw-preview-widgetTabActions-widget_tabList" }, tabIds.map((tabId) => {
|
|
84
|
+
return (React.createElement(TabIdContext.Provider, { key: tabId, value: tabId },
|
|
85
|
+
React.createElement(Tab, null)));
|
|
86
|
+
})),
|
|
87
|
+
React.createElement(TabsActions, null),
|
|
88
|
+
React.createElement(Tabs.Panel, { value: activeTabId, className: "uifw-preview-widgetTabActions-widget_panel" },
|
|
89
|
+
React.createElement(PanelContent, null)),
|
|
90
|
+
handles))));
|
|
91
|
+
});
|
|
92
|
+
Widget.displayName = "Widget";
|
|
93
|
+
function Tab() {
|
|
94
|
+
const { actionTabId, actionFocused, setActionTabId, hideTab, setTabElement, focusedTabId, setFocusedTabId, } = useSafeContext(TabsContext);
|
|
95
|
+
const id = useSafeContext(TabIdContext);
|
|
96
|
+
const label = useLayout((state) => state.tabs[id].label);
|
|
97
|
+
const closeAction = useWidgetTabCloseAction(id);
|
|
98
|
+
const interactionsRef = useTabInteractions({});
|
|
99
|
+
const ref = React.useCallback((el) => {
|
|
100
|
+
setTabElement(id, el ?? undefined);
|
|
101
|
+
}, [id, setTabElement]);
|
|
102
|
+
return (React.createElement(Tabs.Tab, { className: "uifw-preview-widgetTabActions-widget_tab", value: id, ref: useRefs(ref, interactionsRef), onKeyDown: (e) => {
|
|
103
|
+
if (e.key === "Delete") {
|
|
104
|
+
e.preventDefault();
|
|
105
|
+
hideTab(id);
|
|
106
|
+
}
|
|
107
|
+
}, onFocus: () => {
|
|
108
|
+
setActionTabId(id);
|
|
109
|
+
setFocusedTabId(id);
|
|
110
|
+
}, onBlur: () => {
|
|
111
|
+
setFocusedTabId(undefined);
|
|
112
|
+
}, "data-_appui-mask": id === actionTabId && actionFocused ? "true" : undefined, "data-_appui-decoration": closeAction ? "true" : undefined, ...(!!focusedTabId
|
|
113
|
+
? {
|
|
114
|
+
tabIndex: -1,
|
|
115
|
+
}
|
|
116
|
+
: undefined) },
|
|
117
|
+
React.createElement(TabIcon, null),
|
|
118
|
+
React.createElement(Tabs.TabLabel, { className: "uifw-preview-widgetTabActions-widget_label" }, label),
|
|
119
|
+
closeAction && React.createElement(CloseTabDecoration, null),
|
|
120
|
+
React.createElement(TabTarget, null)));
|
|
121
|
+
}
|
|
122
|
+
function TabIcon() {
|
|
123
|
+
const widgetDef = useWidgetDef();
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
125
|
+
const iconSpec = widgetDef?.initialConfig?.icon;
|
|
126
|
+
const icon = widgetDef?.initialConfig?.iconNode ??
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
128
|
+
(iconSpec ? React.createElement(Icon, { iconSpec: iconSpec }) : undefined);
|
|
129
|
+
if (!icon)
|
|
130
|
+
return null;
|
|
131
|
+
return React.createElement(Tabs.TabIcon, null, icon);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Decorative button to close the tab.
|
|
135
|
+
*/
|
|
136
|
+
function CloseTabDecoration() {
|
|
137
|
+
const { actionTabId, hideTab, setAnchored } = useSafeContext(TabsContext);
|
|
138
|
+
const id = useSafeContext(TabIdContext);
|
|
139
|
+
const label = useLayout((state) => state.tabs[id].label);
|
|
140
|
+
const ref = React.useRef(null);
|
|
141
|
+
const isActionTab = actionTabId === id;
|
|
142
|
+
React.useEffect(() => {
|
|
143
|
+
if (!isActionTab || !ref.current)
|
|
144
|
+
return;
|
|
145
|
+
const observer = new IntersectionObserver((entries) => {
|
|
146
|
+
const entry = entries[0];
|
|
147
|
+
setAnchored(entry.isIntersecting);
|
|
148
|
+
}, { threshold: 1 });
|
|
149
|
+
observer.observe(ref.current);
|
|
150
|
+
return () => {
|
|
151
|
+
setAnchored(false);
|
|
152
|
+
observer.disconnect();
|
|
153
|
+
};
|
|
154
|
+
}, [isActionTab, setAnchored]);
|
|
155
|
+
const { translate } = useTranslation();
|
|
156
|
+
const closeLabel = translate("dialog.close");
|
|
157
|
+
return (React.createElement(IconButton, { as: Tabs.TabIcon, className: "uifw-preview-widgetTabActions-widget_decoration", styleType: "borderless", size: "small", label: `${closeLabel} ${label}`, "aria-hidden": "true", onClick: () => {
|
|
158
|
+
hideTab(id);
|
|
159
|
+
}, "data-_appui-action": isActionTab ? "true" : undefined, ref: ref },
|
|
160
|
+
React.createElement(SvgCloseSmall, null)));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Visually hidden button to expose decorative close action to screen readers.
|
|
164
|
+
* The action is anchored to the respective decoration when decoration is visible.
|
|
165
|
+
*/
|
|
166
|
+
function CloseTabAction() {
|
|
167
|
+
const { setActionTabId, hideTab, anchored, actionTabId, setActionFocused } = useSafeContext(TabsContext);
|
|
168
|
+
assert(!!actionTabId);
|
|
169
|
+
const label = useLayout((state) => state.tabs[actionTabId].label);
|
|
170
|
+
const closeAction = useWidgetTabCloseAction(actionTabId);
|
|
171
|
+
const { translate } = useTranslation();
|
|
172
|
+
const closeLabel = translate("dialog.close");
|
|
173
|
+
if (!closeAction)
|
|
174
|
+
return null;
|
|
175
|
+
return (React.createElement(VisuallyHidden, { as: "span", className: "uifw-preview-widgetTabActions-widget_action", "data-_appui-anchor": anchored ? "true" : undefined },
|
|
176
|
+
React.createElement(IconButton, { onFocus: () => setActionFocused(true), onBlur: () => {
|
|
177
|
+
setActionTabId(undefined);
|
|
178
|
+
setActionFocused(false);
|
|
179
|
+
}, label: `${closeLabel} ${label}`, styleType: "borderless", size: "small", onClick: () => {
|
|
180
|
+
hideTab(actionTabId);
|
|
181
|
+
} },
|
|
182
|
+
React.createElement(SvgCloseSmall, null))));
|
|
183
|
+
}
|
|
184
|
+
function TabsActions() {
|
|
185
|
+
const { actionTabId } = useSafeContext(TabsContext);
|
|
186
|
+
const widgetId = useSafeContext(WidgetIdContext);
|
|
187
|
+
const { widgetActions } = React.useContext(ConfigurableUiContext);
|
|
188
|
+
const tabIds = useLayout((state) => getWidgetState(state, widgetId).tabs);
|
|
189
|
+
const actionTab = tabIds.find((id) => id === actionTabId);
|
|
190
|
+
return (React.createElement(Tabs.Actions, { className: "uifw-preview-widgetTabActions-widget_actions", wrapperProps: {
|
|
191
|
+
className: "uifw-preview-widgetTabActions-widget_actionsWrapper",
|
|
192
|
+
} },
|
|
193
|
+
React.createElement(TitleBarTarget, { className: "uifw-preview-widgetTabActions-widget_titleBarTarget" }),
|
|
194
|
+
actionTab && React.createElement(CloseTabAction, null),
|
|
195
|
+
widgetActions ?? React.createElement(WidgetActions, null)));
|
|
196
|
+
}
|
|
197
|
+
function PanelContent() {
|
|
198
|
+
const side = React.useContext(PanelSideContext);
|
|
199
|
+
const ref = useWidgetContentContainer();
|
|
200
|
+
const showTarget = useLayout((state) => {
|
|
201
|
+
if (side) {
|
|
202
|
+
const panel = state.panels[side];
|
|
203
|
+
return panel.widgets.length > 1;
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
});
|
|
207
|
+
return (React.createElement(React.Fragment, null,
|
|
208
|
+
React.createElement("div", { className: "uifw-preview-widgetTabActions-widget_content", ref: ref }),
|
|
209
|
+
showTarget && React.createElement(WidgetTarget, null),
|
|
210
|
+
React.createElement(WidgetOutline, null)));
|
|
211
|
+
}
|
|
212
|
+
function WidgetHandle() {
|
|
213
|
+
const ref = useDragWidgetHandle();
|
|
214
|
+
return (React.createElement("div", { className: "uifw-preview-widgetTabActions-widget_handle", ref: ref }));
|
|
215
|
+
}
|
|
216
|
+
/** @internal */
|
|
217
|
+
export function PanelWidget() {
|
|
218
|
+
const widgetId = useSafeContext(WidgetIdContext);
|
|
219
|
+
const widgetRef = useDragPanelWidget();
|
|
220
|
+
const borders = useBorders(widgetId);
|
|
221
|
+
return (React.createElement(Widget, { className: classnames("uifw-preview-widgetTabActions-widget_panelWidget", borders), ref: widgetRef }));
|
|
222
|
+
}
|
|
223
|
+
/** @internal */
|
|
224
|
+
export function FloatingWidget() {
|
|
225
|
+
const { ref, style, hidden, minimized, resizable, dragged, isToolSettingsTab, maximizedWidget, } = useFloatingWidget();
|
|
226
|
+
return (React.createElement(Widget, { className: classnames("uifw-preview-widgetTabActions-widget_floating", maximizedWidget.classNames), handles: resizable ? React.createElement(ResizeHandles, null) : undefined, minimized: minimized, "data-_appui-dragged": dragged ? "true" : undefined, "data-_appui-hidden": hidden ? "true" : undefined, "data-_appui-minimized": minimized ? "true" : undefined, "data-_appui-tool-settings": isToolSettingsTab ? "true" : undefined, style: style, ref: ref }));
|
|
227
|
+
}
|
|
228
|
+
function ResizeHandle(props) {
|
|
229
|
+
return (React.createElement(FloatingWidgetHandle, { ...props, className: "uifw-preview-widgetTabActions-widget_resizeHandle" }));
|
|
230
|
+
}
|
|
231
|
+
function ResizeHandles() {
|
|
232
|
+
return (React.createElement(React.Fragment, null,
|
|
233
|
+
React.createElement(ResizeHandle, { handle: "left" }),
|
|
234
|
+
React.createElement(ResizeHandle, { handle: "top" }),
|
|
235
|
+
React.createElement(ResizeHandle, { handle: "right" }),
|
|
236
|
+
React.createElement(ResizeHandle, { handle: "bottom" }),
|
|
237
|
+
React.createElement(ResizeHandle, { handle: "topLeft" }),
|
|
238
|
+
React.createElement(ResizeHandle, { handle: "topRight" }),
|
|
239
|
+
React.createElement(ResizeHandle, { handle: "bottomLeft" }),
|
|
240
|
+
React.createElement(ResizeHandle, { handle: "bottomRight" })));
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=Widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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GAAG;QAClC,oBAAC,YAAY,IAAC,MAAM,EAAC,YAAY,GAAG;QACpC,oBAAC,YAAY,IAAC,MAAM,EAAC,aAAa,GAAG,CACpC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Widget\n */\n\nimport \"./Widget.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { assert } from \"@itwin/core-bentley\";\nimport { Icon } from \"@itwin/core-react\";\nimport { useRefs } from \"@itwin/core-react/internal\";\nimport { IconButton, Tabs, VisuallyHidden } from \"@itwin/itwinui-react\";\nimport { SvgCloseSmall } from \"@itwin/itwinui-icons-react\";\n\nimport {\n useActiveTabId,\n useDragPanelWidget,\n useWidgetContextValue,\n WidgetContext,\n WidgetIdContext,\n} from \"../../layout/widget/Widget.js\";\nimport { useSafeContext } from \"../../hooks/useSafeContext.js\";\nimport { useLayout } from \"../../layout/base/LayoutStore.js\";\nimport { getWidgetState } from \"../../layout/state/internal/WidgetStateHelpers.js\";\nimport { TabIdContext } from \"../../layout/widget/ContentRenderer.js\";\nimport { useWidgetContentContainer } from \"../../layout/widget/ContentContainer.js\";\nimport { useTabInteractions } from \"../../layout/widget/Tab.js\";\nimport {\n FloatingWidgetHandle,\n useFloatingWidget,\n} from \"../../layout/widget/FloatingWidget.js\";\nimport { useWidgetTabCloseAction } from \"./useWidgetTabActions.js\";\nimport { NineZoneDispatchContext } from \"../../layout/base/NineZone.js\";\nimport { ConfigurableUiContext } from \"../../configurableui/ConfigurableUiContent.js\";\nimport { WidgetActions } from \"../../layout/widget/WidgetActions.js\";\nimport { TabTarget } from \"../../layout/target/TabTarget.js\";\nimport { TitleBarTarget } from \"../../layout/target/TitleBarTarget.js\";\nimport { WidgetTarget } from \"../../layout/target/WidgetTarget.js\";\nimport { WidgetOutline } from \"../../layout/outline/WidgetOutline.js\";\nimport { PanelSideContext } from \"../../layout/widget-panels/Panel.js\";\nimport { useDragWidgetHandle } from \"../../layout/widget/TabBar.js\";\nimport { useBorders } from \"../../layout/widget/PanelWidget.js\";\nimport { useTranslation } from \"../../hooks/useTranslation.js\";\nimport { useWidgetDef } from \"../../widget-panels/Content.js\";\n\nconst TabsContext = React.createContext<\n | {\n // Last focused tab, used to expose decorative actions to screen readers.\n actionTabId: string | undefined;\n setActionTabId: (id: string | undefined) => void;\n // Describes if the action should be anchored to the decorative tab action.\n anchored: boolean;\n setAnchored: (anchored: boolean) => void;\n hideTab: (id: string) => void;\n setTabElement: (id: string, element: HTMLElement | undefined) => void;\n // Describes if the tab action is focused.\n actionFocused: boolean;\n setActionFocused: (focused: boolean) => void;\n // Track focused tab to focus the action (skips focus of active tab)\n focusedTabId: string | undefined;\n setFocusedTabId: (id: string | undefined) => void;\n }\n | undefined\n>(undefined);\n\ntype WidgetProps = React.ComponentProps<typeof Tabs.Wrapper> & {\n minimized?: boolean;\n handles?: React.ReactNode;\n};\n\nconst Widget = React.forwardRef<HTMLElement, WidgetProps>(\n (props, forwardedRef) => {\n const { handles, minimized, ...rest } = props;\n const widgetId = useSafeContext(WidgetIdContext);\n const dispatch = React.useContext(NineZoneDispatchContext);\n const tabIds = useLayout((state) => getWidgetState(state, widgetId).tabs);\n const activeTabId = useActiveTabId();\n const [actionTabId, setActionTabId] = React.useState<string | undefined>(\n undefined\n );\n const [focusedTabId, setFocusedTabId] = React.useState<string | undefined>(\n undefined\n );\n const [anchored, setAnchored] = React.useState(false);\n const [actionFocused, setActionFocused] = React.useState(false);\n const tabElementsRef = React.useRef(\n new Map<string, HTMLElement | undefined>()\n );\n const hideTab = React.useCallback(\n (id: string) => {\n setActionTabId(undefined);\n dispatch({\n type: \"WIDGET_TAB_HIDE\",\n id,\n });\n\n const tabIndex = tabIds.indexOf(id);\n const nextTabIndex =\n tabIndex + 1 > tabIds.length - 1 ? tabIndex - 1 : tabIndex + 1;\n\n if (nextTabIndex < 0) return;\n const nextTabId = tabIds[nextTabIndex];\n const tabEl = tabElementsRef.current.get(nextTabId);\n tabEl?.focus();\n },\n [dispatch, tabIds]\n );\n const setTabElement = React.useCallback(\n (id: string, element: HTMLElement | undefined) => {\n tabElementsRef.current.set(id, element);\n },\n []\n );\n\n const [widgetRef, value] = useWidgetContextValue();\n const ref = useRefs(forwardedRef, widgetRef);\n return (\n <WidgetContext.Provider value={value}>\n <TabsContext.Provider\n value={{\n actionTabId,\n setActionTabId,\n hideTab,\n setTabElement,\n anchored,\n setAnchored,\n actionFocused,\n setActionFocused,\n focusedTabId,\n setFocusedTabId,\n }}\n >\n <Tabs.Wrapper\n {...rest}\n className={classnames(\n \"uifw-preview-widgetTabActions-widget_wrapper\",\n props.className\n )}\n value={minimized ? \"\" : activeTabId}\n focusActivationMode=\"manual\"\n ref={ref}\n >\n <WidgetHandle />\n <Tabs.TabList className=\"uifw-preview-widgetTabActions-widget_tabList\">\n {tabIds.map((tabId) => {\n return (\n <TabIdContext.Provider key={tabId} value={tabId}>\n <Tab />\n </TabIdContext.Provider>\n );\n })}\n </Tabs.TabList>\n\n <TabsActions />\n\n <Tabs.Panel\n value={activeTabId}\n className=\"uifw-preview-widgetTabActions-widget_panel\"\n >\n <PanelContent />\n </Tabs.Panel>\n\n {handles}\n </Tabs.Wrapper>\n </TabsContext.Provider>\n </WidgetContext.Provider>\n );\n }\n);\nWidget.displayName = \"Widget\";\n\nfunction Tab() {\n const {\n actionTabId,\n actionFocused,\n setActionTabId,\n hideTab,\n setTabElement,\n focusedTabId,\n setFocusedTabId,\n } = useSafeContext(TabsContext);\n const id = useSafeContext(TabIdContext);\n const label = useLayout((state) => state.tabs[id].label);\n const closeAction = useWidgetTabCloseAction(id);\n const interactionsRef = useTabInteractions({});\n const ref = React.useCallback(\n (el: HTMLElement | null) => {\n setTabElement(id, el ?? undefined);\n },\n [id, setTabElement]\n );\n return (\n <Tabs.Tab\n className=\"uifw-preview-widgetTabActions-widget_tab\"\n value={id}\n ref={useRefs(ref, interactionsRef)}\n onKeyDown={(e) => {\n if (e.key === \"Delete\") {\n e.preventDefault();\n hideTab(id);\n }\n }}\n onFocus={() => {\n setActionTabId(id);\n setFocusedTabId(id);\n }}\n onBlur={() => {\n setFocusedTabId(undefined);\n }}\n data-_appui-mask={\n id === actionTabId && actionFocused ? \"true\" : undefined\n }\n data-_appui-decoration={closeAction ? \"true\" : undefined}\n {...(!!focusedTabId\n ? {\n tabIndex: -1,\n }\n : undefined)}\n >\n <TabIcon />\n <Tabs.TabLabel className=\"uifw-preview-widgetTabActions-widget_label\">\n {label}\n </Tabs.TabLabel>\n {closeAction && <CloseTabDecoration />}\n <TabTarget />\n </Tabs.Tab>\n );\n}\n\nfunction TabIcon() {\n const widgetDef = useWidgetDef();\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n const iconSpec = widgetDef?.initialConfig?.icon;\n const icon =\n widgetDef?.initialConfig?.iconNode ??\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n (iconSpec ? <Icon iconSpec={iconSpec} /> : undefined);\n\n if (!icon) return null;\n return <Tabs.TabIcon>{icon}</Tabs.TabIcon>;\n}\n\n/**\n * Decorative button to close the tab.\n */\nfunction CloseTabDecoration() {\n const { actionTabId, hideTab, setAnchored } = useSafeContext(TabsContext);\n const id = useSafeContext(TabIdContext);\n const label = useLayout((state) => state.tabs[id].label);\n\n const ref = React.useRef<HTMLButtonElement | null>(null);\n const isActionTab = actionTabId === id;\n React.useEffect(() => {\n if (!isActionTab || !ref.current) return;\n\n const observer = new IntersectionObserver(\n (entries) => {\n const entry = entries[0];\n setAnchored(entry.isIntersecting);\n },\n { threshold: 1 }\n );\n observer.observe(ref.current);\n return () => {\n setAnchored(false);\n observer.disconnect();\n };\n }, [isActionTab, setAnchored]);\n\n const { translate } = useTranslation();\n const closeLabel = translate(\"dialog.close\");\n return (\n <IconButton\n as={Tabs.TabIcon}\n className=\"uifw-preview-widgetTabActions-widget_decoration\"\n styleType=\"borderless\"\n size=\"small\"\n label={`${closeLabel} ${label}`}\n aria-hidden=\"true\"\n onClick={() => {\n hideTab(id);\n }}\n data-_appui-action={isActionTab ? \"true\" : undefined}\n ref={ref}\n >\n <SvgCloseSmall />\n </IconButton>\n );\n}\n\n/**\n * Visually hidden button to expose decorative close action to screen readers.\n * The action is anchored to the respective decoration when decoration is visible.\n */\nfunction CloseTabAction() {\n const { setActionTabId, hideTab, anchored, actionTabId, setActionFocused } =\n useSafeContext(TabsContext);\n assert(!!actionTabId);\n const label = useLayout((state) => state.tabs[actionTabId].label);\n const closeAction = useWidgetTabCloseAction(actionTabId);\n\n const { translate } = useTranslation();\n const closeLabel = translate(\"dialog.close\");\n\n if (!closeAction) return null;\n return (\n <VisuallyHidden\n as=\"span\"\n className=\"uifw-preview-widgetTabActions-widget_action\"\n data-_appui-anchor={anchored ? \"true\" : undefined}\n >\n <IconButton\n onFocus={() => setActionFocused(true)}\n onBlur={() => {\n setActionTabId(undefined);\n setActionFocused(false);\n }}\n label={`${closeLabel} ${label}`}\n styleType=\"borderless\"\n size=\"small\"\n onClick={() => {\n hideTab(actionTabId);\n }}\n >\n <SvgCloseSmall />\n </IconButton>\n </VisuallyHidden>\n );\n}\n\nfunction TabsActions() {\n const { actionTabId } = useSafeContext(TabsContext);\n const widgetId = useSafeContext(WidgetIdContext);\n const { widgetActions } = React.useContext(ConfigurableUiContext);\n const tabIds = useLayout((state) => getWidgetState(state, widgetId).tabs);\n const actionTab = tabIds.find((id) => id === actionTabId);\n return (\n <Tabs.Actions\n className=\"uifw-preview-widgetTabActions-widget_actions\"\n wrapperProps={{\n className: \"uifw-preview-widgetTabActions-widget_actionsWrapper\",\n }}\n >\n <TitleBarTarget className=\"uifw-preview-widgetTabActions-widget_titleBarTarget\" />\n {actionTab && <CloseTabAction />}\n {widgetActions ?? <WidgetActions />}\n </Tabs.Actions>\n );\n}\n\nfunction PanelContent() {\n const side = React.useContext(PanelSideContext);\n const ref = useWidgetContentContainer();\n const showTarget = useLayout((state) => {\n if (side) {\n const panel = state.panels[side];\n return panel.widgets.length > 1;\n }\n return true;\n });\n return (\n <>\n <div className=\"uifw-preview-widgetTabActions-widget_content\" ref={ref} />\n {showTarget && <WidgetTarget />}\n <WidgetOutline />\n </>\n );\n}\n\nfunction WidgetHandle() {\n const ref = useDragWidgetHandle();\n return (\n <div className=\"uifw-preview-widgetTabActions-widget_handle\" ref={ref} />\n );\n}\n\n/** @internal */\nexport function PanelWidget() {\n const widgetId = useSafeContext(WidgetIdContext);\n const widgetRef = useDragPanelWidget();\n const borders = useBorders(widgetId);\n return (\n <Widget\n className={classnames(\n \"uifw-preview-widgetTabActions-widget_panelWidget\",\n borders\n )}\n ref={widgetRef}\n />\n );\n}\n\n/** @internal */\nexport function FloatingWidget() {\n const {\n ref,\n style,\n hidden,\n minimized,\n resizable,\n dragged,\n isToolSettingsTab,\n maximizedWidget,\n } = useFloatingWidget();\n return (\n <Widget\n className={classnames(\n \"uifw-preview-widgetTabActions-widget_floating\",\n maximizedWidget.classNames\n )}\n handles={resizable ? <ResizeHandles /> : undefined}\n minimized={minimized}\n data-_appui-dragged={dragged ? \"true\" : undefined}\n data-_appui-hidden={hidden ? \"true\" : undefined}\n data-_appui-minimized={minimized ? \"true\" : undefined}\n data-_appui-tool-settings={isToolSettingsTab ? \"true\" : undefined}\n style={style}\n ref={ref}\n />\n );\n}\n\nfunction ResizeHandle(\n props: Pick<React.ComponentProps<typeof FloatingWidgetHandle>, \"handle\">\n) {\n return (\n <FloatingWidgetHandle\n {...props}\n className=\"uifw-preview-widgetTabActions-widget_resizeHandle\"\n />\n );\n}\n\nfunction ResizeHandles() {\n return (\n <>\n <ResizeHandle handle=\"left\" />\n <ResizeHandle handle=\"top\" />\n <ResizeHandle handle=\"right\" />\n <ResizeHandle handle=\"bottom\" />\n <ResizeHandle handle=\"topLeft\" />\n <ResizeHandle handle=\"topRight\" />\n <ResizeHandle handle=\"bottomLeft\" />\n <ResizeHandle handle=\"bottomRight\" />\n </>\n );\n}\n"]}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
@use "~@itwin/core-react/lib/core-react/z-index" as *;
|
|
6
|
+
@use "../../layout/widgetopacity" as *;
|
|
7
|
+
@use "../../layout/widget/variables" as *;
|
|
8
|
+
|
|
9
|
+
$border-width: 1px;
|
|
10
|
+
|
|
11
|
+
@layer appui.preview {
|
|
12
|
+
.uifw-preview-widgetTabActions-widget_wrapper {
|
|
13
|
+
flex: 1;
|
|
14
|
+
grid-template-rows: min-content 1fr;
|
|
15
|
+
grid-template-columns: auto 1fr;
|
|
16
|
+
isolation: isolate;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.uifw-preview-widgetTabActions-widget_panelWidget {
|
|
20
|
+
border: 0px solid var(--iui-color-border);
|
|
21
|
+
|
|
22
|
+
&:where(.nz-border-top) {
|
|
23
|
+
border-block-start-width: $border-width;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:where(.nz-border-bottom) {
|
|
27
|
+
border-block-end-width: $border-width;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:where(.nz-border-left) {
|
|
31
|
+
border-inline-start-width: $border-width;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&:where(.nz-border-right) {
|
|
35
|
+
border-inline-end-width: $border-width;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.uifw-preview-widgetTabActions-widget_floating {
|
|
40
|
+
position: absolute;
|
|
41
|
+
min-inline-size: 200px;
|
|
42
|
+
min-block-size: 120px;
|
|
43
|
+
inline-size: auto;
|
|
44
|
+
transition: opacity var(--iui-duration-2) ease;
|
|
45
|
+
border: $border-width solid var(--iui-color-border);
|
|
46
|
+
contain: none;
|
|
47
|
+
|
|
48
|
+
@include uicore-z-index(dragged-widget);
|
|
49
|
+
@include nz-widget-opacity;
|
|
50
|
+
|
|
51
|
+
&:where([data-_appui-dragged="true"]) {
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
opacity: $nz-dragged-widget-opacity;
|
|
54
|
+
|
|
55
|
+
@include uicore-z-index(drag-preview);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:where([data-_appui-hidden="true"]) {
|
|
59
|
+
opacity: 0;
|
|
60
|
+
pointer-events: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:where([data-_appui-minimized="true"]) {
|
|
64
|
+
.uifw-preview-widgetTabActions-widget_panel {
|
|
65
|
+
block-size: 0;
|
|
66
|
+
border: 0;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:where([data-_appui-tool-settings="true"]) {
|
|
72
|
+
min-block-size: 60px;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.uifw-preview-widgetTabActions-widget_handle {
|
|
77
|
+
grid-column: tabs / tabs-actions;
|
|
78
|
+
grid-row: tabs;
|
|
79
|
+
position: relative;
|
|
80
|
+
cursor: grab;
|
|
81
|
+
user-select: none;
|
|
82
|
+
-webkit-user-select: none;
|
|
83
|
+
background-color: var(--iui-color-background-hover);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.uifw-preview-widgetTabActions-widget_tabList {
|
|
87
|
+
grid-area: tabs;
|
|
88
|
+
z-index: 1;
|
|
89
|
+
overscroll-behavior-x: none;
|
|
90
|
+
margin-inline: -1px; // Don't use $border-width as this is accounting for iTwinUI's tab border
|
|
91
|
+
margin-block-start: -1px; // Don't use $border-width as this is accounting for iTwinUI's tab border
|
|
92
|
+
container-type: normal;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.uifw-preview-widgetTabActions-widget_tab {
|
|
96
|
+
grid-template-areas:
|
|
97
|
+
"icon label decoration"
|
|
98
|
+
"icon description decoration";
|
|
99
|
+
grid-template-rows: auto minmax(0, auto);
|
|
100
|
+
grid-template-columns: auto minmax(min-content, 1fr) auto;
|
|
101
|
+
|
|
102
|
+
min-inline-size: min-content;
|
|
103
|
+
|
|
104
|
+
@media (any-hover: hover) {
|
|
105
|
+
&:where(:not(:hover, :focus-visible)) {
|
|
106
|
+
--_appui-decoration-opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:where([data-_appui-decoration]) {
|
|
111
|
+
&:where(:hover, :focus-visible, [data-_appui-mask="true"])
|
|
112
|
+
.uifw-preview-widgetTabActions-widget_label {
|
|
113
|
+
mask-image: linear-gradient(
|
|
114
|
+
270deg,
|
|
115
|
+
transparent 0%,
|
|
116
|
+
transparent 24px,
|
|
117
|
+
#000 32px,
|
|
118
|
+
#000 100%
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.uifw-preview-widgetTabActions-widget_panel {
|
|
125
|
+
padding: 0;
|
|
126
|
+
position: relative;
|
|
127
|
+
display: flex;
|
|
128
|
+
border-block-end: 0;
|
|
129
|
+
border-inline: 0;
|
|
130
|
+
min-block-size: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.uifw-preview-widgetTabActions-widget_content {
|
|
134
|
+
min-inline-size: 0;
|
|
135
|
+
display: flex;
|
|
136
|
+
inline-size: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.uifw-preview-widgetTabActions-widget_label {
|
|
140
|
+
grid-area: label / decoration;
|
|
141
|
+
-webkit-line-clamp: 1;
|
|
142
|
+
user-select: none;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.uifw-preview-widgetTabActions-widget_decoration {
|
|
146
|
+
grid-area: decoration;
|
|
147
|
+
justify-self: end;
|
|
148
|
+
opacity: var(--_appui-decoration-opacity);
|
|
149
|
+
block-size: var(--_iui-field-height);
|
|
150
|
+
|
|
151
|
+
&:where([data-_appui-action="true"]) {
|
|
152
|
+
anchor-name: --_appui-tab-action;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.uifw-preview-widgetTabActions-widget_actionsWrapper {
|
|
157
|
+
margin-inline-start: 0;
|
|
158
|
+
padding-inline-start: var(--iui-size-s);
|
|
159
|
+
|
|
160
|
+
&::before,
|
|
161
|
+
&::after {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&:has(
|
|
166
|
+
.uifw-preview-widgetTabActions-widget_titleBarTarget:not(.nz-hidden)
|
|
167
|
+
) {
|
|
168
|
+
position: relative;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.uifw-preview-widgetTabActions-widget_titleBarTarget {
|
|
173
|
+
position: absolute;
|
|
174
|
+
height: 100%;
|
|
175
|
+
width: 100%;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.uifw-preview-widgetTabActions-widget_actions {
|
|
179
|
+
flex: 1;
|
|
180
|
+
justify-content: flex-end;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.uifw-preview-widgetTabActions-widget_resizeHandle {
|
|
184
|
+
z-index: 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@supports (anchor-name: --_appui-tab-action) {
|
|
188
|
+
.uifw-preview-widgetTabActions-widget_action {
|
|
189
|
+
&:where([data-_appui-anchor="true"]) {
|
|
190
|
+
position: absolute;
|
|
191
|
+
position-anchor: --_appui-tab-action;
|
|
192
|
+
right: anchor(right);
|
|
193
|
+
align-self: anchor-center;
|
|
194
|
+
z-index: 1;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TabState } from "../../layout/state/TabState.js";
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare function useWidgetTabActions(): boolean;
|
|
4
|
+
/** @internal */
|
|
5
|
+
export declare function useWidgetTabCloseAction(tabId: TabState["id"]): boolean;
|
|
6
|
+
//# sourceMappingURL=useWidgetTabActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWidgetTabActions.d.ts","sourceRoot":"","sources":["../../../../src/appui-react/preview/widget-tab-actions/useWidgetTabActions.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAI/D,gBAAgB;AAChB,wBAAgB,mBAAmB,YAGlC;AAED,gBAAgB;AAChB,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,WAI5D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { useControlWidgetVisibility } from "../control-widget-visibility/CloseWidgetButton.js";
|
|
6
|
+
import { usePreviewFeatures } from "../PreviewFeatures.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export function useWidgetTabActions() {
|
|
9
|
+
const { widgetTabActions } = usePreviewFeatures();
|
|
10
|
+
return !!widgetTabActions;
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
export function useWidgetTabCloseAction(tabId) {
|
|
14
|
+
const { widgetTabActions } = usePreviewFeatures();
|
|
15
|
+
const controlWidgetVisibility = useControlWidgetVisibility(tabId);
|
|
16
|
+
return !!widgetTabActions && !!controlWidgetVisibility;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=useWidgetTabActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWidgetTabActions.js","sourceRoot":"","sources":["../../../../src/appui-react/preview/widget-tab-actions/useWidgetTabActions.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAGhG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,gBAAgB;AAChB,MAAM,UAAU,mBAAmB;IACjC,MAAM,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAClD,OAAO,CAAC,CAAC,gBAAgB,CAAC;AAC5B,CAAC;AAED,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAAC,KAAqB;IAC3D,MAAM,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAClD,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClE,OAAO,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,uBAAuB,CAAC;AACzD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport type { TabState } from \"../../layout/state/TabState.js\";\nimport { useControlWidgetVisibility } from \"../control-widget-visibility/CloseWidgetButton.js\";\nimport { usePreviewFeatures } from \"../PreviewFeatures.js\";\n\n/** @internal */\nexport function useWidgetTabActions() {\n const { widgetTabActions } = usePreviewFeatures();\n return !!widgetTabActions;\n}\n\n/** @internal */\nexport function useWidgetTabCloseAction(tabId: TabState[\"id\"]) {\n const { widgetTabActions } = usePreviewFeatures();\n const controlWidgetVisibility = useControlWidgetVisibility(tabId);\n return !!widgetTabActions && !!controlWidgetVisibility;\n}\n"]}
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
@use "~@itwin/core-react/lib/core-react/z-index" as *;
|
|
6
6
|
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
@layer appui.component {
|
|
8
|
+
.nz-target-titleBarTarget {
|
|
9
|
+
flex: 1 1 0;
|
|
10
|
+
position: relative;
|
|
11
|
+
overflow: hidden;
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
@include uicore-z-index(drop-target);
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
&.nz-hidden {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
19
|
}
|
package/lib/cjs/appui-react/layout/widget/widget-content-layout/header/HeaderIconToolbar.scss
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
@layer appui.component {
|
|
2
2
|
.nz-widget-widgetContentLayout-header-headerIconToolbar {
|
|
3
|
+
display: flex;
|
|
3
4
|
--_appui-icon-size: var(--iui-component-height);
|
|
4
5
|
--_appui-max-search-width: 200px;
|
|
5
6
|
min-width: var(--_appui-icon-size);
|
|
6
7
|
min-height: var(--_appui-icon-size);
|
|
7
8
|
|
|
8
9
|
&[data-_appui-icon-size="small"] {
|
|
9
|
-
--icon-size: var(--iui-component-height-small);
|
|
10
|
+
--_appui-icon-size: var(--iui-component-height-small);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
&[data-_appui-icon-size="large"] {
|
|
13
|
-
--icon-size: var(--iui-component-height-large);
|
|
14
|
+
--_appui-icon-size: var(--iui-component-height-large);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
&[data-_appui-search-expanded="true"] {
|
|
@@ -40,5 +41,11 @@
|
|
|
40
41
|
inset-block: unset;
|
|
41
42
|
}
|
|
42
43
|
}
|
|
44
|
+
|
|
45
|
+
// when icon-size is small, the button width is 2px wider than the icon size due to a transparent border,
|
|
46
|
+
// so we need to remove the border to make it the same width as the icon
|
|
47
|
+
.nz-header-overflow-button {
|
|
48
|
+
border: 0px;
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
}
|