@interopio/groups-ui-react 2.2.4 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Bounds, ButtonProps, OverflowedTabInfo, ToggleButtonProps } from "./internal";
2
+ import { Bounds, ButtonProps, Location, OverflowedTabInfo, ToggleButtonProps } from "./internal";
3
3
  import { CustomButtonProps } from "./defaultComponents";
4
4
  export interface ChannelProps {
5
5
  visible: boolean;
@@ -106,8 +106,10 @@ export interface TabElementProps {
106
106
  export interface AfterTabsProps {
107
107
  frameId: string;
108
108
  selectedWindow: string;
109
+ hiddenTabsToTheLeft?: OverflowedTabInfo[];
110
+ hiddenTabsToTheRight?: OverflowedTabInfo[];
109
111
  }
110
- export interface TabHeaderButtonsProps {
112
+ interface FrameButtonsProps {
111
113
  overflow?: ButtonProps;
112
114
  feedback?: ButtonProps;
113
115
  clone?: ButtonProps;
@@ -123,7 +125,11 @@ export interface TabHeaderButtonsProps {
123
125
  frameId: string;
124
126
  selectedWindow: string;
125
127
  }
126
- export interface HtmlButtonsProps extends TabHeaderButtonsProps {
128
+ export interface TabHeaderButtonsProps extends FrameButtonsProps {
129
+ hiddenTabsToTheLeft: OverflowedTabInfo[];
130
+ hiddenTabsToTheRight: OverflowedTabInfo[];
131
+ }
132
+ export interface HtmlButtonsProps extends FrameButtonsProps {
127
133
  }
128
134
  export interface GroupProps {
129
135
  components?: {
@@ -161,3 +167,8 @@ export interface MoveAreaProps {
161
167
  export interface GroupComponentVisibilityState {
162
168
  groupCaptionBarVisible?: boolean;
163
169
  }
170
+ export interface OpenTabOverflowPopupOptions {
171
+ frameId: string;
172
+ location: Location;
173
+ }
174
+ export {};
@@ -202,7 +202,10 @@ export interface CreateTabOverflowPopupRequestOptions extends CreateElementReque
202
202
  export interface CreateFrameLoadingAnimationRequestOptions extends CreateFrameElementRequestOptions {
203
203
  show: boolean;
204
204
  }
205
- export declare type UpdateFrameRequestOptions = CreateFrameElementRequestOptions;
205
+ export interface UpdateFrameRequestOptions extends CreateFrameElementRequestOptions {
206
+ hiddenTabsToTheLeft: OverflowedTabInfo[];
207
+ hiddenTabsToTheRight: OverflowedTabInfo[];
208
+ }
206
209
  export declare enum TargetType {
207
210
  Group = "group",
208
211
  Frame = "frame",
@@ -285,6 +288,7 @@ export interface ExternalLibraryFactory {
285
288
  onCaptionEditorBoundsChanged(targetType: TargetType, targetId: string, bounds: Bounds): void;
286
289
  commitCaptionEditing(targetType: TargetType, targetId: string, text: string): void;
287
290
  selectTab(windowId: string): void;
291
+ openTabOverflowPopup(frameId: string, location: Location): void;
288
292
  addTabContainerClass(windowId: string, className: string): void;
289
293
  removeTabContainerClass(windowId: string, className: string): void;
290
294
  }
@@ -302,7 +306,9 @@ export interface Size {
302
306
  width: number;
303
307
  height: number;
304
308
  }
305
- export interface Bounds extends Size {
309
+ export interface Location {
306
310
  left: number;
307
311
  top: number;
308
312
  }
313
+ export interface Bounds extends Size, Location {
314
+ }
@@ -1,4 +1,4 @@
1
- import { Bounds, TargetType } from "./types/internal";
1
+ import { Bounds, Location, TargetType } from "./types/internal";
2
2
  declare class WebGroupsManagerDecorator {
3
3
  private readonly registry;
4
4
  readonly skipFocusStyle = "t42-skip-focus";
@@ -38,6 +38,7 @@ declare class WebGroupsManagerDecorator {
38
38
  selectTab(windowId: string): void;
39
39
  addTabContainerClass(windowId: string, className: string): void;
40
40
  removeTabContainerClass(windowId: string, className: string): void;
41
+ openTabOverflowPopup(frameId: string, location: Location): void;
41
42
  }
42
43
  declare const _default: WebGroupsManagerDecorator;
43
44
  export default _default;
@@ -29,7 +29,7 @@ import CustomButton from "./defaultComponents/buttons/CustomButton";
29
29
  import { waitForWindow } from "./utils";
30
30
  import useGroupComponentVisibility from "./useGroupComponentVisibility";
31
31
  import { CloseButtonProps, ExtractButtonProps, StickyButtonProps, FeedbackButtonProps, FlatButtonsProps, FlatCaptionEditorProps, FlatCaptionProps, FlatChannelSelectorProps, FlatMoveAreaProps, GroupButtonsProps, GroupCaptionEditorProps, GroupMoveAreaProps, LockButtonProps, MaximizeButtonProps, MinimizeButtonProps, RestoreButtonProps, TabCaptionEditorProps, TabCaptionProps, TabChannelSelectorProps, TabCloseButtonProps, UnlockButtonProps, UseCaptionEditorOptions, UseEditableCaptionOptions, OverflowButtonProps } from "./types/defaultComponents";
32
- import { AboveTabsProps, AboveWindowProps, AfterTabsProps, BeforeTabsProps, BelowTabsProps, BelowWindowProps, FlatCaptionBarProps, FrameLoadingAnimationProps, FrameWindowOverlayProps, GroupCaptionBarProps, GroupComponentVisibilityState, GroupOverlayProps, GroupProps, HtmlButtonsProps, MoveAreaProps, TabElementProps, TabHeaderButtonsProps, TabOverflowPopupProps, WindowContentOverlayProps } from "./types/api";
32
+ import { AboveTabsProps, AboveWindowProps, AfterTabsProps, BeforeTabsProps, BelowTabsProps, BelowWindowProps, FlatCaptionBarProps, FrameLoadingAnimationProps, FrameWindowOverlayProps, GroupCaptionBarProps, GroupComponentVisibilityState, GroupOverlayProps, GroupProps, HtmlButtonsProps, MoveAreaProps, OpenTabOverflowPopupOptions, TabElementProps, TabHeaderButtonsProps, TabOverflowPopupProps, WindowContentOverlayProps } from "./types/api";
33
33
  import GroupCaptionEditor from "./defaultComponents/groupCaptionBar/GroupCaptionEditor";
34
34
  import FlatCaptionEditor from "./defaultComponents/flatCaptionBar/FlatCaptionEditor";
35
35
  import TabCaptionEditor from "./defaultComponents/tabs/TabCaptionEditor";
@@ -46,6 +46,7 @@ export declare const getGroupId: () => string;
46
46
  export declare const requestPageFocus: () => void;
47
47
  export declare const requestFrameFocus: (frameId: string) => void;
48
48
  export declare const requestGroupFocus: () => void;
49
+ export declare const openTabOverflowPopup: (options: OpenTabOverflowPopupOptions) => void;
49
50
  export declare const onCommitGroupCaptionEditingRequested: (targetId: string, cb: () => void) => () => void;
50
51
  export declare const onCommitFlatCaptionEditingRequested: (targetId: string, cb: () => void) => () => void;
51
52
  export declare const onCommitTabCaptionEditingRequested: (targetId: string, cb: () => void) => () => void;
package/dist/esm/index.js CHANGED
@@ -336,6 +336,13 @@ var WebGroupsManagerDecorator = /** @class */ (function () {
336
336
  }
337
337
  window.webGroupsManager.externalLibraryFactory.removeTabContainerClass(windowId, className);
338
338
  };
339
+ WebGroupsManagerDecorator.prototype.openTabOverflowPopup = function (frameId, location) {
340
+ if (typeof window.webGroupsManager.externalLibraryFactory.openTabOverflowPopup !== "function") {
341
+ console.warn("The method openTabOverflowPopup is not supported by the current version of the library");
342
+ return;
343
+ }
344
+ window.webGroupsManager.externalLibraryFactory.openTabOverflowPopup(frameId, location);
345
+ };
339
346
  return WebGroupsManagerDecorator;
340
347
  }());
341
348
  var webGroupsManager = new WebGroupsManagerDecorator();
@@ -2482,10 +2489,17 @@ var WebGroupsStore = /** @class */ (function () {
2482
2489
  if (stateProp === "groupOverlay" || stateProp === "groupCaptionBar" || stateProp === "tabElements") {
2483
2490
  return;
2484
2491
  }
2485
- if (s[stateProp][targetId] && ((_b = s[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.selectedWindow) !== selectedWindow) {
2486
- newState[stateProp] = __assign(__assign({}, s[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, s[stateProp][targetId]), { selectedWindow: selectedWindow }), _a));
2492
+ if (newState[stateProp][targetId] && ((_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.selectedWindow) !== selectedWindow) {
2493
+ newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { selectedWindow: selectedWindow }), _a));
2487
2494
  }
2488
2495
  };
2496
+ var updateHiddenTabs = function (stateProp, targetId, hiddenTabsToTheLeft, hiddenTabsToTheRight) {
2497
+ var _a;
2498
+ var _b, _c;
2499
+ var oldHiddenToTheLeft = (_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.hiddenTabsToTheLeft;
2500
+ var oldHiddenToTheRight = (_c = newState[stateProp][targetId]) === null || _c === void 0 ? void 0 : _c.hiddenTabsToTheRight;
2501
+ newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { hiddenTabsToTheLeft: hiddenTabsToTheLeft || oldHiddenToTheLeft, hiddenTabsToTheRight: hiddenTabsToTheRight || oldHiddenToTheRight }), _a));
2502
+ };
2489
2503
  updateSelectionWindow("frameCaptionBars", options.targetId, options.selectedWindow);
2490
2504
  updateSelectionWindow("frameWindowOverlays", options.targetId, options.selectedWindow);
2491
2505
  updateSelectionWindow("windowContentOverlays", options.targetId, options.selectedWindow);
@@ -2497,6 +2511,8 @@ var WebGroupsStore = /** @class */ (function () {
2497
2511
  updateSelectionWindow("tabHeaderButtons", options.targetId, options.selectedWindow);
2498
2512
  updateSelectionWindow("belowTabsZones", options.targetId, options.selectedWindow);
2499
2513
  updateSelectionWindow("frameLoadingAnimations", options.targetId, options.selectedWindow);
2514
+ updateHiddenTabs("afterTabsZones", options.targetId, options.hiddenTabsToTheLeft, options.hiddenTabsToTheRight);
2515
+ updateHiddenTabs("tabHeaderButtons", options.targetId, options.hiddenTabsToTheLeft, options.hiddenTabsToTheRight);
2500
2516
  return newState;
2501
2517
  });
2502
2518
  };
@@ -3381,7 +3397,10 @@ var TabOverflowPopup = function (_a) {
3381
3397
  React.createElement("li", { className: "title" }, title),
3382
3398
  tabs.map(function (tab) { return (React.createElement("li", { key: tab.windowId, onClick: function () { return handleTabClick(tab.windowId); } },
3383
3399
  React.createElement("span", null, tab.title),
3384
- React.createElement("div", { className: "t42-tab-close-button-content", onClick: function () { return handleTabClose(tab.windowId); } }))); })));
3400
+ React.createElement("div", { className: "t42-tab-close-button-content", onClick: function (e) {
3401
+ e.stopPropagation();
3402
+ handleTabClose(tab.windowId);
3403
+ } }))); })));
3385
3404
  };
3386
3405
  var handleTabClick = function (windowId) {
3387
3406
  select(windowId);
@@ -3399,9 +3418,13 @@ var getGroupId = function () { return webGroupsManager === null || webGroupsMana
3399
3418
  var requestPageFocus = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestPageFocus(); };
3400
3419
  var requestFrameFocus = function (frameId) { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestFrameFocus(frameId); };
3401
3420
  var requestGroupFocus = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestGroupFocus(); };
3421
+ var openTabOverflowPopup = function (_a) {
3422
+ var frameId = _a.frameId, location = _a.location;
3423
+ return webGroupsManager.openTabOverflowPopup(frameId, location);
3424
+ };
3402
3425
  var onCommitGroupCaptionEditingRequested = function (targetId, cb) { return webGroupsManager.onCommitCaptionEditingRequested(TargetType.Group, targetId, cb); };
3403
3426
  var onCommitFlatCaptionEditingRequested = function (targetId, cb) { return webGroupsManager.onCommitCaptionEditingRequested(TargetType.Frame, targetId, cb); };
3404
3427
  var onCommitTabCaptionEditingRequested = function (targetId, cb) { return webGroupsManager.onCommitCaptionEditingRequested(TargetType.Tab, targetId, cb); };
3405
3428
 
3406
- export { CloneButton, CloseButton, CustomButton, ExtractButton, FeedbackButton, FlatButtons, FlatCaption, FlatCaptionBar, FlatCaptionEditor, FlatChannelSelector, FlatMoveArea, FrameLoadingAnimation, GroupButtons, GroupCaption, GroupCaptionBar, GroupCaptionEditor, GroupMoveArea, HtmlButtons, LockButton, MaximizeButton, MinimizeButton, OverflowButton, RestoreButton, StickyButton, Tab, TabCaption, TabCaptionEditor, TabChannelSelector, TabCloseButton, TabHeaderButtons, TabOverflowPopup, UnlockButton, GroupElementCreationWrapper as default, getGroupId, onCommitFlatCaptionEditingRequested, onCommitGroupCaptionEditingRequested, onCommitTabCaptionEditingRequested, requestFrameFocus, requestGroupFocus, requestPageFocus, useCaptionEditor, useCommitFlatCaptionEditingRequested, useCommitGroupCaptionEditingRequested, useCommitTabCaptionEditingRequested, useEditableCaption, useGroupComponentVisibility, useIOConnectWindow, waitForWindow };
3429
+ export { CloneButton, CloseButton, CustomButton, ExtractButton, FeedbackButton, FlatButtons, FlatCaption, FlatCaptionBar, FlatCaptionEditor, FlatChannelSelector, FlatMoveArea, FrameLoadingAnimation, GroupButtons, GroupCaption, GroupCaptionBar, GroupCaptionEditor, GroupMoveArea, HtmlButtons, LockButton, MaximizeButton, MinimizeButton, OverflowButton, RestoreButton, StickyButton, Tab, TabCaption, TabCaptionEditor, TabChannelSelector, TabCloseButton, TabHeaderButtons, TabOverflowPopup, UnlockButton, GroupElementCreationWrapper as default, getGroupId, onCommitFlatCaptionEditingRequested, onCommitGroupCaptionEditingRequested, onCommitTabCaptionEditingRequested, openTabOverflowPopup, requestFrameFocus, requestGroupFocus, requestPageFocus, useCaptionEditor, useCommitFlatCaptionEditingRequested, useCommitGroupCaptionEditingRequested, useCommitTabCaptionEditingRequested, useEditableCaption, useGroupComponentVisibility, useIOConnectWindow, waitForWindow };
3407
3430
  //# sourceMappingURL=index.js.map