superdesk-ui-framework 3.1.28 → 4.0.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/app-typescript/components/Dropdown.tsx +120 -165
- package/app-typescript/components/Layouts/Panel.tsx +3 -2
- package/app-typescript/components/Menu.tsx +3 -4
- package/app-typescript/components/Modal.tsx +4 -2
- package/app-typescript/components/MultiSelect.tsx +3 -2
- package/app-typescript/components/Popover.tsx +0 -2
- package/app-typescript/components/SelectWithTemplate.tsx +3 -1
- package/app-typescript/components/ShowPopup.tsx +9 -5
- package/app-typescript/components/SubNav.tsx +5 -6
- package/app-typescript/components/TreeMenu.tsx +3 -2
- package/app-typescript/components/TreeSelect/TreeSelect.tsx +3 -2
- package/app-typescript/components/WithPopover.tsx +0 -2
- package/app-typescript/components/_Positioner.tsx +3 -4
- package/app-typescript/components/avatar/avatar-group.tsx +0 -3
- package/app-typescript/index.ts +1 -0
- package/app-typescript/zIndex.tsx +5 -0
- package/dist/components/CreateButton.tsx +2 -2
- package/dist/components/Dropdowns.tsx +4 -483
- package/dist/components/Modal.tsx +0 -12
- package/dist/components/MultiSelect.tsx +0 -2
- package/dist/components/NavButtons.tsx +4 -4
- package/dist/components/Panel.tsx +0 -1
- package/dist/components/Popover.tsx +0 -3
- package/dist/components/SubNav.tsx +9 -10
- package/dist/components/TableList.tsx +1 -1
- package/dist/design-patterns/ThreePaneLayoutPattern.tsx +3 -3
- package/dist/examples.bundle.js +3110 -3478
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +2 -3
- package/dist/playgrounds/react-playgrounds/EditorTest.tsx +1 -1
- package/dist/playgrounds/react-playgrounds/Multiedit.tsx +1 -2
- package/dist/playgrounds/react-playgrounds/PageLayoutTest.tsx +1 -1
- package/dist/playgrounds/react-playgrounds/PersonalProfile.tsx +2 -2
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +3 -10
- package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +2 -3
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +0 -4
- package/dist/playgrounds/react-playgrounds/UiPlayground.tsx +2 -3
- package/dist/superdesk-ui.bundle.js +2406 -2399
- package/dist/vendor.bundle.js +21 -21
- package/examples/pages/components/CreateButton.tsx +2 -2
- package/examples/pages/components/Dropdowns.tsx +4 -483
- package/examples/pages/components/Modal.tsx +0 -12
- package/examples/pages/components/MultiSelect.tsx +0 -2
- package/examples/pages/components/NavButtons.tsx +4 -4
- package/examples/pages/components/Panel.tsx +0 -1
- package/examples/pages/components/Popover.tsx +0 -3
- package/examples/pages/components/SubNav.tsx +9 -10
- package/examples/pages/components/TableList.tsx +1 -1
- package/examples/pages/design-patterns/ThreePaneLayoutPattern.tsx +3 -3
- package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +2 -3
- package/examples/pages/playgrounds/react-playgrounds/EditorTest.tsx +1 -1
- package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +1 -2
- package/examples/pages/playgrounds/react-playgrounds/PageLayoutTest.tsx +1 -1
- package/examples/pages/playgrounds/react-playgrounds/PersonalProfile.tsx +2 -2
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +3 -10
- package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +2 -3
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +0 -4
- package/examples/pages/playgrounds/react-playgrounds/UiPlayground.tsx +2 -3
- package/package.json +1 -1
- package/react/components/Dropdown.d.ts +1 -3
- package/react/components/Dropdown.js +31 -60
- package/react/components/Layouts/Panel.d.ts +1 -1
- package/react/components/Layouts/Panel.js +5 -2
- package/react/components/Menu.d.ts +1 -1
- package/react/components/Menu.js +3 -3
- package/react/components/Modal.d.ts +1 -1
- package/react/components/Modal.js +5 -2
- package/react/components/MultiSelect.d.ts +1 -1
- package/react/components/MultiSelect.js +3 -1
- package/react/components/Popover.d.ts +0 -1
- package/react/components/Popover.js +1 -1
- package/react/components/SelectWithTemplate.d.ts +3 -0
- package/react/components/SelectWithTemplate.js +3 -0
- package/react/components/ShowPopup.d.ts +20 -1
- package/react/components/ShowPopup.js +12 -5
- package/react/components/SubNav.d.ts +0 -1
- package/react/components/SubNav.js +1 -4
- package/react/components/TreeMenu.d.ts +1 -1
- package/react/components/TreeMenu.js +3 -1
- package/react/components/TreeSelect/TreeSelect.d.ts +1 -1
- package/react/components/TreeSelect/TreeSelect.js +3 -1
- package/react/components/WithPopover.d.ts +0 -1
- package/react/components/WithPopover.js +1 -1
- package/react/components/_Positioner.d.ts +0 -1
- package/react/components/_Positioner.js +3 -3
- package/react/components/avatar/avatar-group.d.ts +0 -1
- package/react/components/avatar/avatar-group.js +2 -3
- package/react/index.d.ts +1 -0
- package/react/index.js +4 -1
- package/react/zIndex.d.ts +2 -0
- package/react/zIndex.js +8 -0
@@ -5,6 +5,7 @@ import {getPrefixedItemId, TreeSelectItem} from './TreeSelect/TreeSelectItem';
|
|
5
5
|
import {keyboardNavigation} from './TreeSelect/KeyboardNavigation';
|
6
6
|
import {WithPortal} from './WithPortal';
|
7
7
|
import {nameof} from '../helpers';
|
8
|
+
import {getNextZIndex} from '../zIndex';
|
8
9
|
|
9
10
|
interface IState<T> {
|
10
11
|
options: Array<ITreeMenuNode<T>>;
|
@@ -21,7 +22,6 @@ interface IState<T> {
|
|
21
22
|
}
|
22
23
|
|
23
24
|
interface IProps<T> {
|
24
|
-
zIndex?: number;
|
25
25
|
searchPlaceholder?: string;
|
26
26
|
singleLevelSearch?: boolean;
|
27
27
|
'data-test-id'?: string;
|
@@ -78,6 +78,7 @@ export class TreeMenu<T> extends React.Component<IProps<T>, IState<T>> {
|
|
78
78
|
private treeMenuRef: React.RefObject<HTMLDivElement>;
|
79
79
|
private inputRef: React.RefObject<HTMLInputElement>;
|
80
80
|
private popperInstance: Instance | null;
|
81
|
+
private zIndex: number = getNextZIndex();
|
81
82
|
|
82
83
|
constructor(props: IProps<T>) {
|
83
84
|
super(props);
|
@@ -357,7 +358,7 @@ export class TreeMenu<T> extends React.Component<IProps<T>, IState<T>> {
|
|
357
358
|
ref={this.dropdownRef}
|
358
359
|
className="autocomplete autocomplete--multi-select autocomplete--fixed-width"
|
359
360
|
style={{
|
360
|
-
zIndex: this.
|
361
|
+
zIndex: this.zIndex,
|
361
362
|
}}
|
362
363
|
>
|
363
364
|
<div className='autocomplete__header'>
|
@@ -14,6 +14,7 @@ import {getPrefixedItemId, TreeSelectItem} from './TreeSelectItem';
|
|
14
14
|
import {keyboardNavigation} from './KeyboardNavigation';
|
15
15
|
import {WithPortal} from '../WithPortal';
|
16
16
|
import { DragDropContext, Droppable, Draggable, DropResult } from "react-beautiful-dnd";
|
17
|
+
import {getNextZIndex} from '../../zIndex';
|
17
18
|
|
18
19
|
const reorder = (list: Array<any>, startIndex: number, endIndex: number) => {
|
19
20
|
const result = Array.from(list);
|
@@ -53,7 +54,6 @@ interface IPropsBase<T> extends IInputWrapper {
|
|
53
54
|
searchPlaceholder?: string;
|
54
55
|
noResultsFoundMessage?: string;
|
55
56
|
dropdownInitiallyOpen?: boolean;
|
56
|
-
zIndex?: number;
|
57
57
|
sortable?: boolean;
|
58
58
|
'data-test-id'?: string;
|
59
59
|
getLabel(item: T): string;
|
@@ -94,6 +94,7 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
|
|
94
94
|
private treeSelectRef: React.RefObject<HTMLDivElement>;
|
95
95
|
private htmlId: string = nextId();
|
96
96
|
private popperInstance: Instance | null;
|
97
|
+
private zIndex: number = getNextZIndex();
|
97
98
|
|
98
99
|
constructor(props: IProps<T>) {
|
99
100
|
super(props);
|
@@ -887,7 +888,7 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
|
|
887
888
|
+ (this.props.width === 'medium' ? ' autocomplete--fixed-width' : '')
|
888
889
|
}
|
889
890
|
style={{
|
890
|
-
zIndex: this.
|
891
|
+
zIndex: this.zIndex,
|
891
892
|
width: this.treeSelectRef.current?.offsetWidth,
|
892
893
|
}}
|
893
894
|
ref={this.dropdownRef}
|
@@ -7,7 +7,6 @@ export interface IPropsWithPopover {
|
|
7
7
|
children(toggle: (referenceElement: HTMLElement) => void): React.ReactNode;
|
8
8
|
placement: Placement;
|
9
9
|
component: React.ComponentType<{closePopup(): void}>;
|
10
|
-
zIndex?: number;
|
11
10
|
closeOnHoverEnd?: boolean;
|
12
11
|
onClose?: () => void;
|
13
12
|
}
|
@@ -30,7 +29,6 @@ export class WithPopover extends React.PureComponent<IPropsWithPopover> {
|
|
30
29
|
referenceElement,
|
31
30
|
this.props.placement,
|
32
31
|
this.props.component,
|
33
|
-
this.props.zIndex,
|
34
32
|
this.props.closeOnHoverEnd,
|
35
33
|
() => {
|
36
34
|
this.closePopup = undefined;
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
3
3
|
import * as _popper from 'popper.js';
|
4
4
|
import {PopperOptions} from 'popper.js';
|
5
|
+
import {getNextZIndex} from '../zIndex';
|
5
6
|
|
6
7
|
const Popper = _popper.default;
|
7
8
|
|
@@ -22,6 +23,7 @@ class PopperWrapper extends React.Component<IPropsPopperWrapper> {
|
|
22
23
|
wrapper: HTMLDivElement;
|
23
24
|
popperInstance: any;
|
24
25
|
previouslyFocusedElement: HTMLElement | undefined;
|
26
|
+
public zIndex: number = getNextZIndex();
|
25
27
|
|
26
28
|
constructor(props: IPropsPopperWrapper) {
|
27
29
|
super(props);
|
@@ -42,9 +44,7 @@ class PopperWrapper extends React.Component<IPropsPopperWrapper> {
|
|
42
44
|
|
43
45
|
const dropdownElement = this.wrapper;
|
44
46
|
|
45
|
-
|
46
|
-
dropdownElement.style.zIndex = this.props.zIndex.toString();
|
47
|
-
}
|
47
|
+
dropdownElement.style.zIndex = this.zIndex.toString();
|
48
48
|
|
49
49
|
const rect = this.props.triggerElement.getBoundingClientRect();
|
50
50
|
|
@@ -110,7 +110,6 @@ class PopperWrapper extends React.Component<IPropsPopperWrapper> {
|
|
110
110
|
interface IPropsPositioner {
|
111
111
|
triggerSelector: string;
|
112
112
|
placement: PopperOptions['placement'];
|
113
|
-
zIndex?: number;
|
114
113
|
className?: string;
|
115
114
|
}
|
116
115
|
|
@@ -24,8 +24,6 @@ export interface IPropsAvatarGroup {
|
|
24
24
|
*/
|
25
25
|
max?: number | 'show-all';
|
26
26
|
|
27
|
-
zIndex?: number;
|
28
|
-
|
29
27
|
// unless a custom onClick handler is passed
|
30
28
|
// a popover would get shown when maximum number
|
31
29
|
// of avatars is exceeded.
|
@@ -78,7 +76,6 @@ export class AvatarGroup extends React.PureComponent<IPropsAvatarGroup> {
|
|
78
76
|
|
79
77
|
return (
|
80
78
|
<WithPopover
|
81
|
-
zIndex={this.props.zIndex ?? 101}
|
82
79
|
placement='bottom-end'
|
83
80
|
component={() => (
|
84
81
|
<div className="avatar-popup">
|
package/app-typescript/index.ts
CHANGED
@@ -100,6 +100,7 @@ export { ContentListItem } from './components/Lists/ContentList';
|
|
100
100
|
export { MultiSelect } from './components/MultiSelect';
|
101
101
|
export { ResizablePanels } from './components/ResizablePanels';
|
102
102
|
export { WithPopover } from './components/WithPopover';
|
103
|
+
export { PopupPositioner, showPopup } from './components/ShowPopup';
|
103
104
|
export { Spacer, SpacerBlock } from '@superdesk/common';
|
104
105
|
export { ResizeObserverComponent } from './components/ResizeObserverComponent';
|
105
106
|
export { DragHandleDots } from './components/DragHandleDots';
|
@@ -17,7 +17,7 @@ export default class CreateButtonDoc extends React.Component {
|
|
17
17
|
|
18
18
|
<Markup.ReactMarkup>
|
19
19
|
<Markup.ReactMarkupPreview>
|
20
|
-
<SubNav
|
20
|
+
<SubNav>
|
21
21
|
<ButtonGroup align='start' spaces='no-space'>
|
22
22
|
<Tooltip text='Filters' flow='right'>
|
23
23
|
<NavButton icon='filter-large' type='darker' state="active" text="Filter" onClick={() => false} />
|
@@ -34,7 +34,7 @@ export default class CreateButtonDoc extends React.Component {
|
|
34
34
|
</SubNav>
|
35
35
|
</Markup.ReactMarkupPreview>
|
36
36
|
<Markup.ReactMarkupCode>{`
|
37
|
-
<SubNav
|
37
|
+
<SubNav>
|
38
38
|
<ButtonGroup align='start' spaces='no-space'>
|
39
39
|
<Tooltip text='Filters' flow='right'>
|
40
40
|
<NavButton icon='filter-large' type='darker' state="active" text="Filter" onClick={() => false} />
|