superdesk-ui-framework 3.1.15 → 3.1.17
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/styles/components/_sd-loader.scss +18 -5
- package/app-typescript/components/Layouts/Panel.tsx +7 -5
- package/app-typescript/components/Loader.tsx +23 -5
- package/app-typescript/components/Navigation/SideBarTabs.tsx +7 -3
- package/dist/components/Index.tsx +6 -1
- package/dist/components/Loader.tsx +24 -0
- package/dist/examples.bundle.js +166 -90
- package/dist/superdesk-ui.bundle.css +13 -6
- package/dist/superdesk-ui.bundle.js +83 -77
- package/examples/pages/components/Index.tsx +6 -1
- package/examples/pages/components/Loader.tsx +24 -0
- package/package.json +1 -1
- package/react/components/Layouts/Panel.js +1 -1
- package/react/components/Loader.d.ts +11 -3
- package/react/components/Loader.js +6 -2
- package/react/components/Navigation/SideBarTabs.d.ts +1 -0
- package/react/components/Navigation/SideBarTabs.js +2 -1
@@ -1,6 +1,24 @@
|
|
1
1
|
// Animated loader
|
2
2
|
|
3
|
+
.sd-loader--inline {
|
4
|
+
display: inline-flex;
|
5
|
+
width: 100%;
|
6
|
+
min-width: 90px;
|
7
|
+
height: 100%;
|
8
|
+
min-height: 30px;
|
9
|
+
|
10
|
+
// inlining img/three-dots.svg as base64 encoded URL to have loader ready on application start
|
11
|
+
// otherwise, loader image would only start downloading when it already needs to be shown
|
12
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMTIwIDMwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9IiM3YjdiN2IiPjxjaXJjbGUgY3g9IjE1IiBjeT0iMTUiIHI9IjE1Ij48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBmcm9tPSIxNSIgdG89IjE1IiBiZWdpbj0iMHMiIGR1cj0iMC44cyIgdmFsdWVzPSIxNTs5OzE1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YXIiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiAvPjwvY2lyY2xlPjwvc3ZnPg==");
|
13
|
+
|
14
|
+
background-repeat: no-repeat;
|
15
|
+
background-position: center center;
|
16
|
+
background-size: 60px;
|
17
|
+
background-color: var(--sd-colour-overlay-actioning);
|
18
|
+
}
|
19
|
+
|
3
20
|
.sd-loader {
|
21
|
+
@extend .sd-loader--inline;
|
4
22
|
content: '';
|
5
23
|
display: block;
|
6
24
|
position: absolute;
|
@@ -9,9 +27,4 @@
|
|
9
27
|
inset-block-end: 0;
|
10
28
|
inset-inline-start: 0;
|
11
29
|
z-index: 99999;
|
12
|
-
background-image: url(../img/three-dots.svg);
|
13
|
-
background-repeat: no-repeat;
|
14
|
-
background-position: center center;
|
15
|
-
background-size: 60px;
|
16
|
-
background-color: var(--sd-colour-overlay-actioning);
|
17
30
|
}
|
@@ -111,11 +111,13 @@ class PanelHeader extends React.PureComponent<IPropsPanelHeader> {
|
|
111
111
|
&& this.props.iconButtons
|
112
112
|
}
|
113
113
|
{this.props.onClose != null
|
114
|
-
&&
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
114
|
+
&& (
|
115
|
+
<IconButton
|
116
|
+
icon='close-small'
|
117
|
+
ariaValue='Close'
|
118
|
+
onClick={this.props.onClose}
|
119
|
+
/>
|
120
|
+
)
|
119
121
|
}
|
120
122
|
</ButtonGroup>
|
121
123
|
)
|
@@ -1,18 +1,36 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
|
3
|
-
interface
|
4
|
-
overlay
|
3
|
+
interface IPropsOverlay {
|
4
|
+
overlay: true;
|
5
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
5
6
|
}
|
6
7
|
|
8
|
+
interface IPropsInline {
|
9
|
+
overlay?: false;
|
10
|
+
width?: React.CSSProperties['width'];
|
11
|
+
height?: React.CSSProperties['height'];
|
12
|
+
backgroundColor?: React.CSSProperties['backgroundColor'];
|
13
|
+
}
|
14
|
+
|
15
|
+
type IProps = IPropsOverlay | IPropsInline;
|
16
|
+
|
7
17
|
export class Loader extends React.Component<IProps> {
|
8
18
|
render() {
|
9
|
-
|
10
19
|
if (this.props.overlay) {
|
11
20
|
return (
|
12
|
-
<div className=
|
21
|
+
<div className="sd-loader" style={{backgroundColor: this.props.backgroundColor}} />
|
13
22
|
);
|
14
23
|
} else {
|
15
|
-
return
|
24
|
+
return (
|
25
|
+
<div
|
26
|
+
className="sd-loader--inline"
|
27
|
+
style={{
|
28
|
+
width: this.props.width,
|
29
|
+
height: this.props.height,
|
30
|
+
backgroundColor: this.props.backgroundColor,
|
31
|
+
}}
|
32
|
+
/>
|
33
|
+
);
|
16
34
|
}
|
17
35
|
}
|
18
36
|
}
|
@@ -8,6 +8,7 @@ interface IProps {
|
|
8
8
|
onActiveTabChange(val: string | null): void;
|
9
9
|
items: Array<ISideBarTab | 'divider'>;
|
10
10
|
side?: 'none' | 'left' | 'right';
|
11
|
+
disabled?: boolean;
|
11
12
|
}
|
12
13
|
|
13
14
|
export interface ISideBarTab {
|
@@ -53,12 +54,15 @@ export class SideBarTabs extends React.PureComponent<IProps> {
|
|
53
54
|
} else {
|
54
55
|
return (
|
55
56
|
<li key={index} data-sd-tooltip={item.tooltip} data-flow='left'>
|
56
|
-
<
|
57
|
+
<button
|
58
|
+
disabled={this.props.disabled}
|
57
59
|
role='button'
|
58
60
|
aria-label={item.tooltip}
|
59
61
|
className={classNames(
|
60
62
|
'sd-sidetab-menu__btn',
|
61
|
-
{'sd-sidetab-menu__btn--active':
|
63
|
+
{'sd-sidetab-menu__btn--active':
|
64
|
+
item.id === this.props.activeTab && this.props.disabled !== true,
|
65
|
+
},
|
62
66
|
)}
|
63
67
|
onClick={() => this.handleClick(item)}
|
64
68
|
>
|
@@ -71,7 +75,7 @@ export class SideBarTabs extends React.PureComponent<IProps> {
|
|
71
75
|
</span>
|
72
76
|
|
73
77
|
<i className='sd-sidetab-menu__helper-icon icon-close-small'></i>
|
74
|
-
</
|
78
|
+
</button>
|
75
79
|
</li>
|
76
80
|
);
|
77
81
|
}
|
@@ -84,6 +84,7 @@ import { BorderUtilitiesDoc } from './utilities/BorderUtilities';
|
|
84
84
|
import { OpacityUtilitiesDoc } from './utilities/OpacityUtilities';
|
85
85
|
import { ObjectFitUtilitiesDoc } from './utilities/ObjectFitUtilities';
|
86
86
|
import { ObjectPositionUtilitiesDoc } from './utilities/ObjectPositionUtilities';
|
87
|
+
import LoaderDoc from './Loader';
|
87
88
|
|
88
89
|
|
89
90
|
interface IPages {
|
@@ -181,7 +182,11 @@ const pages: IPages = {
|
|
181
182
|
"illustration-button": {
|
182
183
|
name: 'Illustration Button',
|
183
184
|
component: IllustrationButtonDoc,
|
184
|
-
}
|
185
|
+
},
|
186
|
+
"loader": {
|
187
|
+
name: 'Loader',
|
188
|
+
component: LoaderDoc,
|
189
|
+
},
|
185
190
|
}
|
186
191
|
},
|
187
192
|
navigationComponents: {
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import * as Markup from '../../js/react';
|
3
|
+
import {Loader} from '../../../app-typescript';
|
4
|
+
|
5
|
+
export default class LoaderDoc extends React.Component {
|
6
|
+
render() {
|
7
|
+
return (
|
8
|
+
<section className='docs-page__container'>
|
9
|
+
<h2 className='docs-page__h2'>Loader</h2>
|
10
|
+
|
11
|
+
<Markup.ReactMarkup>
|
12
|
+
<Markup.ReactMarkupPreview>
|
13
|
+
<Loader />
|
14
|
+
</Markup.ReactMarkupPreview>
|
15
|
+
|
16
|
+
<Markup.ReactMarkupCode>{`
|
17
|
+
<Loader />
|
18
|
+
`}
|
19
|
+
</Markup.ReactMarkupCode>
|
20
|
+
</Markup.ReactMarkup>
|
21
|
+
</section>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
}
|