superdesk-ui-framework 3.0.1-beta.17 → 3.0.1-beta.19
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/.vscode/settings.json +5 -0
- package/app/styles/_content-divider.scss +58 -3
- package/app-typescript/components/ContentDivider.tsx +3 -0
- package/app-typescript/components/Dropdown.tsx +6 -2
- package/app-typescript/components/DurationInput.tsx +32 -17
- package/app-typescript/components/Spacer.tsx +87 -0
- package/app-typescript/dist/components/Alert.d.ts +16 -0
- package/app-typescript/dist/components/Autocomplete.d.ts +48 -0
- package/app-typescript/dist/components/Avatar.d.ts +33 -0
- package/app-typescript/dist/components/Badge.d.ts +13 -0
- package/app-typescript/dist/components/Button.d.ts +23 -0
- package/app-typescript/dist/components/ButtonGroup.d.ts +12 -0
- package/app-typescript/dist/components/CheckButtonGroup.d.ts +11 -0
- package/app-typescript/dist/components/CheckGroup.d.ts +9 -0
- package/app-typescript/dist/components/Checkbox.d.ts +19 -0
- package/app-typescript/dist/components/CheckboxButton.d.ts +19 -0
- package/app-typescript/dist/components/DatePicker.d.ts +37 -0
- package/app-typescript/dist/components/Divider.d.ts +9 -0
- package/app-typescript/dist/components/DonutChart.d.ts +12 -0
- package/app-typescript/dist/components/Dropdown.d.ts +28 -0
- package/app-typescript/dist/components/DropdownFirst.d.ts +42 -0
- package/app-typescript/dist/components/EmptyState.d.ts +11 -0
- package/app-typescript/dist/components/FormLabel.d.ts +9 -0
- package/app-typescript/dist/components/Genie.d.ts +13 -0
- package/app-typescript/dist/components/GridItem.d.ts +69 -0
- package/app-typescript/dist/components/GridList.d.ts +14 -0
- package/app-typescript/dist/components/HeadingText.d.ts +10 -0
- package/app-typescript/dist/components/HelloWorld.d.ts +8 -0
- package/app-typescript/dist/components/Icon.d.ts +12 -0
- package/app-typescript/dist/components/IconButton.d.ts +12 -0
- package/app-typescript/dist/components/IconLabel.d.ts +11 -0
- package/app-typescript/dist/components/Input.d.ts +24 -0
- package/app-typescript/dist/components/Label.d.ts +15 -0
- package/app-typescript/dist/components/LeftMenu.d.ts +26 -0
- package/app-typescript/dist/components/Loader.d.ts +8 -0
- package/app-typescript/dist/components/NavButton.d.ts +15 -0
- package/app-typescript/dist/components/Popover.d.ts +13 -0
- package/app-typescript/dist/components/PropsList.d.ts +15 -0
- package/app-typescript/dist/components/Radio.d.ts +19 -0
- package/app-typescript/dist/components/RadioButton.d.ts +20 -0
- package/app-typescript/dist/components/Select.d.ts +29 -0
- package/app-typescript/dist/components/SelectWithTemplate.d.ts +32 -0
- package/app-typescript/dist/components/SlidingToolbar.d.ts +8 -0
- package/app-typescript/dist/components/StrechBar.d.ts +4 -0
- package/app-typescript/dist/components/SubNav.d.ts +10 -0
- package/app-typescript/dist/components/Switch.d.ts +12 -0
- package/app-typescript/dist/components/TabCustom.d.ts +25 -0
- package/app-typescript/dist/components/TabList.d.ts +22 -0
- package/app-typescript/dist/components/Tag.d.ts +9 -0
- package/app-typescript/dist/components/TagInput.d.ts +7 -0
- package/app-typescript/dist/components/TagInputTest.d.ts +18 -0
- package/app-typescript/dist/components/TimePicker.d.ts +11 -0
- package/app-typescript/dist/components/Tooltip.d.ts +11 -0
- package/app-typescript/dist/components/_Positioner.d.ts +27 -0
- package/app-typescript/dist/index.d.ts +56 -0
- package/dist/examples.bundle.js +184 -42
- package/dist/react/ContentDivider.tsx +18 -14
- package/dist/react/ContentList.tsx +187 -3
- package/dist/react/DurationInput.tsx +7 -3
- package/dist/react/TableList.tsx +21 -4
- package/dist/superdesk-ui.bundle.css +41 -3
- package/dist/superdesk-ui.bundle.js +43 -22
- package/examples/pages/react/ContentDivider.tsx +18 -14
- package/examples/pages/react/ContentList.tsx +187 -3
- package/examples/pages/react/DurationInput.tsx +7 -3
- package/examples/pages/react/TableList.tsx +21 -4
- package/package.json +1 -1
- package/react/components/ContentDivider.d.ts +1 -0
- package/react/components/ContentDivider.js +2 -0
- package/react/components/Dropdown.js +6 -2
- package/react/components/DurationInput.d.ts +1 -1
- package/react/components/DurationInput.js +35 -20
- package/yarn-error.log +111 -0
@@ -4,6 +4,9 @@
|
|
4
4
|
padding: 0;
|
5
5
|
color: $sd-text;
|
6
6
|
list-style: none;
|
7
|
+
border-bottom: 0;
|
8
|
+
border-left: 0;
|
9
|
+
border-right: 0;
|
7
10
|
border-top: 1px var(--sd-colour-line--medium);
|
8
11
|
border-style: solid;
|
9
12
|
|
@@ -15,6 +18,9 @@
|
|
15
18
|
white-space: nowrap;
|
16
19
|
text-align: center;
|
17
20
|
border-top: 0;
|
21
|
+
border-bottom: 0;
|
22
|
+
border-left: 0;
|
23
|
+
border-right: 0;
|
18
24
|
border-top-color: var(--sd-colour-line--medium);
|
19
25
|
border-style: solid;
|
20
26
|
}
|
@@ -24,7 +30,23 @@
|
|
24
30
|
clear: both;
|
25
31
|
width: 100%;
|
26
32
|
min-width: 100%;
|
27
|
-
|
33
|
+
&.sd-content-divider--margin-x-small {
|
34
|
+
margin: $sd-base-increment * 1 0;
|
35
|
+
}
|
36
|
+
&.sd-content-divider--margin-small {
|
37
|
+
margin: $sd-base-increment * 2 0;
|
38
|
+
}
|
39
|
+
&.sd-content-divider--margin-medium {
|
40
|
+
margin: $sd-base-increment * 3 0;
|
41
|
+
}
|
42
|
+
&.sd-content-divider--margin-large {
|
43
|
+
margin: $sd-base-increment * 4 0;
|
44
|
+
}
|
45
|
+
&.sd-content-divider--margin-none {
|
46
|
+
margin: 0 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
|
28
50
|
}
|
29
51
|
&.sd-content-divider--horizontal.sd-content-divider--with-text {
|
30
52
|
margin: 1.6rem 0;
|
@@ -37,6 +59,8 @@
|
|
37
59
|
border-top-color: transparent;
|
38
60
|
border-top-color: inherit;
|
39
61
|
border-bottom: 0;
|
62
|
+
border-left: 0;
|
63
|
+
border-right: 0;
|
40
64
|
transform: translateY(50%);
|
41
65
|
border-style: inherit;
|
42
66
|
}
|
@@ -56,13 +80,27 @@
|
|
56
80
|
width: 5%;
|
57
81
|
}
|
58
82
|
}
|
83
|
+
&.sd-content-divider--margin-x-small {
|
84
|
+
margin: $sd-base-increment * 1 0;
|
85
|
+
}
|
86
|
+
&.sd-content-divider--margin-small {
|
87
|
+
margin: $sd-base-increment * 2 0;
|
88
|
+
}
|
89
|
+
&.sd-content-divider--margin-medium {
|
90
|
+
margin: $sd-base-increment * 3 0;
|
91
|
+
}
|
92
|
+
&.sd-content-divider--margin-large {
|
93
|
+
margin: $sd-base-increment * 4 0;
|
94
|
+
}
|
95
|
+
&.sd-content-divider--margin-none {
|
96
|
+
margin: $sd-base-increment / 2 0;
|
97
|
+
}
|
59
98
|
}
|
60
99
|
|
61
|
-
|
62
100
|
&.sd-content-divider--vertical {
|
63
101
|
position: relative;
|
64
102
|
display: inline-block;
|
65
|
-
margin: $sd-base-increment * 0.5 $sd-base-increment * 1.5;
|
103
|
+
//margin: $sd-base-increment * 0.5 $sd-base-increment * 1.5;
|
66
104
|
vertical-align: middle;
|
67
105
|
border-top: 0;
|
68
106
|
border-left: 1px var(--sd-colour-line--medium);
|
@@ -86,7 +124,9 @@
|
|
86
124
|
position: relative;
|
87
125
|
height: 50%;
|
88
126
|
border-left: 1px var(--sd-colour-line--medium);
|
127
|
+
border-right: 0;
|
89
128
|
border-bottom: 0;
|
129
|
+
border-top: 0;
|
90
130
|
width: 1px;
|
91
131
|
border-style: solid;
|
92
132
|
}
|
@@ -103,6 +143,21 @@
|
|
103
143
|
}
|
104
144
|
}
|
105
145
|
}
|
146
|
+
&.sd-content-divider--margin-x-small {
|
147
|
+
margin: 0 $sd-base-increment * 1;
|
148
|
+
}
|
149
|
+
&.sd-content-divider--margin-small {
|
150
|
+
margin: 0 $sd-base-increment * 2;
|
151
|
+
}
|
152
|
+
&.sd-content-divider--margin-medium {
|
153
|
+
margin: 0 $sd-base-increment * 3;
|
154
|
+
}
|
155
|
+
&.sd-content-divider--margin-large {
|
156
|
+
margin: 0 $sd-base-increment * 4;
|
157
|
+
}
|
158
|
+
&.sd-content-divider--margin-none {
|
159
|
+
margin: 0 0;
|
160
|
+
}
|
106
161
|
}
|
107
162
|
&.sd-content-divider--dashed {
|
108
163
|
border-style: dashed;
|
@@ -6,6 +6,7 @@ interface IProps {
|
|
6
6
|
orientation?: 'horizontal' |'vertical'; // defaults to 'horizontal'
|
7
7
|
align?: 'center' | 'left' | 'right'; // defaults to 'center'
|
8
8
|
border?: boolean;
|
9
|
+
margin?: 'x-small' | 'small' |'medium' | 'large' | 'none';
|
9
10
|
children?: React.ReactNode;
|
10
11
|
}
|
11
12
|
|
@@ -19,6 +20,8 @@ export class ContentDivider extends React.PureComponent<IProps> {
|
|
19
20
|
[`sd-content-divider--text-${this.props.align}`]: this.props.align || this.props.align !== undefined,
|
20
21
|
[`sd-content-divider--${this.props.orientation}`]:
|
21
22
|
this.props.orientation || this.props.orientation !== undefined,
|
23
|
+
'sd-content-divider--margin-medium': this.props.margin === undefined,
|
24
|
+
[`sd-content-divider--margin-${this.props.margin}`]: this.props.margin || this.props.margin !== undefined,
|
22
25
|
});
|
23
26
|
|
24
27
|
if (this.props.children) {
|
@@ -322,7 +322,9 @@ onChange,
|
|
322
322
|
<button tabIndex={0}
|
323
323
|
role='menuitem'
|
324
324
|
onClick={() => {
|
325
|
-
|
325
|
+
setTimeout(() => {
|
326
|
+
onSelect();
|
327
|
+
});
|
326
328
|
if (onChange) {
|
327
329
|
onChange();
|
328
330
|
}
|
@@ -376,7 +378,9 @@ const DropdownItemWithSubmenu = ({
|
|
376
378
|
tabIndex={0}
|
377
379
|
onClick={() => {
|
378
380
|
if (item.onSelect) {
|
379
|
-
|
381
|
+
setTimeout(() => {
|
382
|
+
item.onSelect();
|
383
|
+
});
|
380
384
|
}
|
381
385
|
if (onChange) {
|
382
386
|
onChange();
|
@@ -129,14 +129,18 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
129
129
|
}
|
130
130
|
}
|
131
131
|
|
132
|
-
if (
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
132
|
+
if (this.hourRef.current.value.length === 2
|
133
|
+
&& this.minuteRef.current.value.length === 2
|
134
|
+
&& this.secondRef.current.value.length === 2) {
|
135
|
+
if ((this.props.hours !== prevProps.hours)
|
136
|
+
|| (this.props.minutes !== prevProps.minutes)
|
137
|
+
|| (this.props.seconds !== prevProps.seconds)) {
|
138
|
+
this.setState({
|
139
|
+
hours: this.stateUpdate('hours', this.props.hours, this.props.minutes, this.props.seconds),
|
140
|
+
minutes: this.stateUpdate('minutes', this.props.minutes, this.props.seconds),
|
141
|
+
seconds: this.stateUpdate('seconds', this.props.seconds),
|
142
|
+
});
|
143
|
+
}
|
140
144
|
}
|
141
145
|
}
|
142
146
|
|
@@ -241,11 +245,13 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
241
245
|
|
242
246
|
handleChange(event: React.ChangeEvent<HTMLInputElement>, state: 'hours' | 'minutes' | 'seconds') {
|
243
247
|
let stateClone: IState = {};
|
244
|
-
if (event.target.value.length
|
245
|
-
if (event.target.selectionStart === 1
|
246
|
-
stateClone[state] = event.target.value.slice(0, 1)
|
248
|
+
if (event.target.value.length > 2) {
|
249
|
+
if (event.target.selectionStart === 1) {
|
250
|
+
stateClone[state] = event.target.value.slice(0, 1);
|
251
|
+
} else if (event.target.selectionStart === 2) {
|
252
|
+
stateClone[state] = event.target.value.slice(1, 2);
|
247
253
|
} else {
|
248
|
-
stateClone[state] = event.target.value.slice(
|
254
|
+
stateClone[state] = event.target.value.slice(2, 3);
|
249
255
|
}
|
250
256
|
} else {
|
251
257
|
stateClone[state] = event.target.value;
|
@@ -299,6 +305,7 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
299
305
|
className={`duration-input ${this.state.blink === 'hour' ? 'blink_me' : ''}`}
|
300
306
|
type='text'
|
301
307
|
id='hours'
|
308
|
+
autoComplete="off"
|
302
309
|
max={99}
|
303
310
|
min={0}
|
304
311
|
ref={this.hourRef}
|
@@ -319,6 +326,7 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
319
326
|
className={`duration-input ${this.state.blink === 'minute' ? 'blink_me' : ''}`}
|
320
327
|
type='text'
|
321
328
|
id='minutes'
|
329
|
+
autoComplete="off"
|
322
330
|
ref={this.minuteRef}
|
323
331
|
value={this.state.minutes}
|
324
332
|
disabled={this.props.disabled}
|
@@ -337,6 +345,7 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
337
345
|
className='duration-input'
|
338
346
|
type='text'
|
339
347
|
id='seconds'
|
348
|
+
autoComplete="off"
|
340
349
|
ref={this.secondRef}
|
341
350
|
value={this.state.seconds}
|
342
351
|
disabled={this.props.disabled}
|
@@ -356,7 +365,7 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
|
|
356
365
|
}
|
357
366
|
}
|
358
367
|
|
359
|
-
export function getDurationString(seconds: number,
|
368
|
+
export function getDurationString(seconds: number, minSections: 1 | 2 | 3) {
|
360
369
|
function zeroPad(value: number | string) {
|
361
370
|
if (value.toString().length === 1 || value === 0) {
|
362
371
|
return `0${value}`;
|
@@ -371,13 +380,19 @@ export function getDurationString(seconds: number, zero?: boolean) {
|
|
371
380
|
let minute = zeroPad(Math.floor((seconds % 3600) / 60));
|
372
381
|
let second = zeroPad(Math.floor(seconds % 60));
|
373
382
|
|
374
|
-
if (
|
383
|
+
if (minSections === 3) {
|
375
384
|
return `${hour}h ${minute}m ${second}s`;
|
376
|
-
} else {
|
377
|
-
if (Number(hour)
|
385
|
+
} else if (minSections === 2) {
|
386
|
+
if (Number(hour) > 0) {
|
387
|
+
return `${hour}h ${minute}m ${second}s`;
|
388
|
+
} else {
|
378
389
|
return `${minute}m ${second}s`;
|
379
|
-
}
|
390
|
+
}
|
391
|
+
} else {
|
392
|
+
if (Number(hour) === 0 && Number(minute) === 0) {
|
380
393
|
return `${second}s`;
|
394
|
+
} else if (Number(hour) === 0 && Number(minute) > 0) {
|
395
|
+
return `${minute}m ${second}s`;
|
381
396
|
} else {
|
382
397
|
return `${hour}h ${minute}m ${second}s`;
|
383
398
|
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import classNames from 'classnames';
|
3
|
+
|
4
|
+
export interface IPropsSpacer {
|
5
|
+
h?: boolean; // horizontal
|
6
|
+
v?: boolean; // vertical
|
7
|
+
gap: '4' | '8' | '16' | '32' | '64';
|
8
|
+
justifyContent?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'stretch';
|
9
|
+
alignItems?: 'start' | 'end' | 'center' | 'stretch';
|
10
|
+
noGrow?: boolean;
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Will not wrap children in div elements.
|
14
|
+
* `noGrow` prop would then not be relevant.
|
15
|
+
*/
|
16
|
+
noWrap?: boolean;
|
17
|
+
|
18
|
+
style?: React.CSSProperties;
|
19
|
+
|
20
|
+
children: Array<React.ReactNode>;
|
21
|
+
}
|
22
|
+
|
23
|
+
export class Spacer extends React.PureComponent<IPropsSpacer> {
|
24
|
+
constructor(props: IPropsSpacer) {
|
25
|
+
super(props);
|
26
|
+
this.state = {
|
27
|
+
items: [],
|
28
|
+
};
|
29
|
+
|
30
|
+
}
|
31
|
+
render() {
|
32
|
+
const {h, v, gap, justifyContent, alignItems, noGrow, noWrap} = this.props;
|
33
|
+
|
34
|
+
const justifyContentDefault: IPropsSpacer['justifyContent'] = h ? 'space-between' : 'start';
|
35
|
+
const alignItemsDefault: IPropsSpacer['alignItems'] = h ? 'center' : 'start';
|
36
|
+
|
37
|
+
return (
|
38
|
+
<div
|
39
|
+
style={{
|
40
|
+
display: 'flex',
|
41
|
+
flexDirection: v ? 'column' : 'row',
|
42
|
+
gap: `${gap}px`,
|
43
|
+
justifyContent: justifyContent ?? justifyContentDefault,
|
44
|
+
alignItems: alignItems ?? alignItemsDefault,
|
45
|
+
width: noGrow === true ? undefined : '100%',
|
46
|
+
...(this.props.style ?? {}),
|
47
|
+
}}
|
48
|
+
>
|
49
|
+
{this.props.children.map((el, i) => noWrap ? el : (
|
50
|
+
<div
|
51
|
+
key={i}
|
52
|
+
style={{
|
53
|
+
width: noGrow === true ? undefined : '100%',
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
{el}
|
57
|
+
</div>
|
58
|
+
))}
|
59
|
+
</div>
|
60
|
+
);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
/**
|
65
|
+
* Renders a standalone spacing block - similar to <br />
|
66
|
+
*/
|
67
|
+
export interface ISpacerBlock {
|
68
|
+
h?: boolean; // horizontal
|
69
|
+
v?: boolean; // vertical
|
70
|
+
gap: '4' | '8' | '16' | '32' | '64';
|
71
|
+
}
|
72
|
+
|
73
|
+
export class SpacerBlock extends React.PureComponent<ISpacerBlock> {
|
74
|
+
render() {
|
75
|
+
const {gap, h, v} = this.props;
|
76
|
+
|
77
|
+
return (
|
78
|
+
<span
|
79
|
+
style={{
|
80
|
+
display: h === true ? 'inline-block' : 'block',
|
81
|
+
width: h === true ? `${gap}px` : undefined,
|
82
|
+
height: v === true ? `${gap}px` : undefined,
|
83
|
+
}}
|
84
|
+
/>
|
85
|
+
);
|
86
|
+
}
|
87
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
type?: 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'sd-green';
|
4
|
+
style?: 'filled' | 'hollow';
|
5
|
+
size?: 'normal' | 'small';
|
6
|
+
restoreIcon?: 'info' | 'help';
|
7
|
+
}
|
8
|
+
interface IState {
|
9
|
+
open: boolean;
|
10
|
+
}
|
11
|
+
export declare class Alert extends React.PureComponent<IProps, IState> {
|
12
|
+
constructor(props: IProps);
|
13
|
+
onToggle(): void;
|
14
|
+
render(): JSX.Element;
|
15
|
+
}
|
16
|
+
export {};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
items: Array<any>;
|
4
|
+
keyValue?: string;
|
5
|
+
minLength?: number;
|
6
|
+
value?: string | object;
|
7
|
+
label?: string;
|
8
|
+
placeholder?: string;
|
9
|
+
info?: string;
|
10
|
+
error?: string;
|
11
|
+
required?: boolean;
|
12
|
+
disabled?: boolean;
|
13
|
+
invalid?: boolean;
|
14
|
+
inlineLabel?: boolean;
|
15
|
+
isSearchField?: boolean;
|
16
|
+
listItemTemplate?(value: any): any;
|
17
|
+
search?(searhString: string, callback: (result: Array<any>) => void): {
|
18
|
+
cancel: () => void;
|
19
|
+
};
|
20
|
+
onChange(newValue: string): void;
|
21
|
+
onSelect?(suggestion: string): void;
|
22
|
+
}
|
23
|
+
interface IState {
|
24
|
+
selectedItem: any;
|
25
|
+
filteredItems: any;
|
26
|
+
invalid: boolean;
|
27
|
+
focused: boolean;
|
28
|
+
}
|
29
|
+
export declare class Autocomplete extends React.Component<IProps, IState> {
|
30
|
+
latestCall?: {
|
31
|
+
cancel: () => void;
|
32
|
+
};
|
33
|
+
constructor(props: IProps);
|
34
|
+
htmlId: string;
|
35
|
+
search(term: string): void;
|
36
|
+
searchItem(event: any): void;
|
37
|
+
handleChange(event: {
|
38
|
+
originalEvent: Event;
|
39
|
+
value: any;
|
40
|
+
}): void;
|
41
|
+
handleSelect(event: {
|
42
|
+
originalEvent: Event;
|
43
|
+
value: any;
|
44
|
+
}): void;
|
45
|
+
handleInputClear(): void;
|
46
|
+
render(): JSX.Element;
|
47
|
+
}
|
48
|
+
export {};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IBase {
|
3
|
+
tooltipText?: string;
|
4
|
+
}
|
5
|
+
interface IImageAvatar extends IBase {
|
6
|
+
imageUrl?: string;
|
7
|
+
}
|
8
|
+
interface ITextAvatar extends IBase {
|
9
|
+
text: string;
|
10
|
+
}
|
11
|
+
export declare class AvatarContentText extends React.PureComponent<ITextAvatar> {
|
12
|
+
render(): JSX.Element;
|
13
|
+
}
|
14
|
+
export declare class AvatarContentImage extends React.PureComponent<IImageAvatar> {
|
15
|
+
render(): JSX.Element;
|
16
|
+
}
|
17
|
+
interface IPropsAvatarWrapper {
|
18
|
+
size?: 'small' | 'medium' | 'large' | 'x-large' | 'xx-large';
|
19
|
+
statusIndicator?: {
|
20
|
+
status: 'online' | 'offline';
|
21
|
+
tooltipText?: string;
|
22
|
+
};
|
23
|
+
administratorIndicator?: {
|
24
|
+
enabled: boolean;
|
25
|
+
tooltipText?: string;
|
26
|
+
};
|
27
|
+
children: React.ReactNode;
|
28
|
+
'data-test-id'?: string;
|
29
|
+
}
|
30
|
+
export declare class AvatarWrapper extends React.PureComponent<IPropsAvatarWrapper> {
|
31
|
+
render(): JSX.Element;
|
32
|
+
}
|
33
|
+
export {};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
text?: string;
|
4
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'light';
|
5
|
+
color?: string;
|
6
|
+
shape?: 'round' | 'square';
|
7
|
+
children?: React.ReactNode;
|
8
|
+
'data-test-id'?: string;
|
9
|
+
}
|
10
|
+
export declare class Badge extends React.PureComponent<IProps> {
|
11
|
+
render(): JSX.Element;
|
12
|
+
}
|
13
|
+
export {};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IButtonBase {
|
3
|
+
id?: string;
|
4
|
+
theme?: 'light' | 'dark';
|
5
|
+
type?: 'default' | 'primary' | 'success' | 'warning' | 'alert' | 'highlight' | 'sd-green';
|
6
|
+
size?: 'small' | 'normal' | 'large';
|
7
|
+
children?: never;
|
8
|
+
icon?: string;
|
9
|
+
disabled?: boolean;
|
10
|
+
iconOnly?: boolean;
|
11
|
+
onClick(): void;
|
12
|
+
'data-test-id'?: string;
|
13
|
+
}
|
14
|
+
interface IPropsButton extends IButtonBase {
|
15
|
+
text: string;
|
16
|
+
expand?: boolean;
|
17
|
+
style?: 'filled' | 'hollow' | 'text-only';
|
18
|
+
shape?: 'square' | 'round';
|
19
|
+
}
|
20
|
+
export declare class Button extends React.PureComponent<IPropsButton> {
|
21
|
+
render(): JSX.Element;
|
22
|
+
}
|
23
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
4
|
+
spaces?: 'comfort' | 'compact';
|
5
|
+
align?: 'left' | 'right' | 'center' | 'inline';
|
6
|
+
padded?: boolean;
|
7
|
+
children: React.ReactNode;
|
8
|
+
}
|
9
|
+
export declare class ButtonGroup extends React.PureComponent<IProps> {
|
10
|
+
render(): JSX.Element;
|
11
|
+
}
|
12
|
+
export {};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
4
|
+
grid?: boolean;
|
5
|
+
align?: 'left' | 'right' | 'center' | 'inline';
|
6
|
+
padded?: boolean;
|
7
|
+
}
|
8
|
+
export declare class CheckButtonGroup extends React.PureComponent<IProps> {
|
9
|
+
render(): JSX.Element;
|
10
|
+
}
|
11
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
label: {
|
4
|
+
text: string;
|
5
|
+
side?: 'left' | 'right';
|
6
|
+
hidden?: boolean;
|
7
|
+
};
|
8
|
+
checked?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
required?: boolean;
|
11
|
+
onChange(nextValue: boolean): void;
|
12
|
+
}
|
13
|
+
export declare class Checkbox extends React.Component<IProps> {
|
14
|
+
htmlId: string;
|
15
|
+
constructor(props: IProps);
|
16
|
+
handleChange(event: React.ChangeEvent<HTMLInputElement>): void;
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IProps {
|
3
|
+
label: {
|
4
|
+
text: string;
|
5
|
+
icon?: string;
|
6
|
+
hidden?: boolean;
|
7
|
+
};
|
8
|
+
checked?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
required?: boolean;
|
11
|
+
onChange(nextValue: boolean): void;
|
12
|
+
}
|
13
|
+
export declare class CheckboxButton extends React.Component<IProps> {
|
14
|
+
htmlId: string;
|
15
|
+
constructor(props: IProps);
|
16
|
+
handleChange(event: React.ChangeEvent<HTMLInputElement>): void;
|
17
|
+
render(): JSX.Element;
|
18
|
+
}
|
19
|
+
export {};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { LocaleSettings, CalendarProps } from '@superdesk/primereact/calendar';
|
3
|
+
export declare type DatePickerLocaleSettings = Omit<LocaleSettings, 'today' | 'clear'>;
|
4
|
+
interface IDatePickerBase {
|
5
|
+
disabled?: boolean;
|
6
|
+
dateFormat: string;
|
7
|
+
shortcuts?: Array<{
|
8
|
+
days: number;
|
9
|
+
label: string;
|
10
|
+
}>;
|
11
|
+
locale?: DatePickerLocaleSettings;
|
12
|
+
}
|
13
|
+
interface IDatePicker extends IDatePickerBase {
|
14
|
+
value: Date | null;
|
15
|
+
onChange(valueNext: Date | null): void;
|
16
|
+
}
|
17
|
+
interface IState {
|
18
|
+
value: CalendarProps['value'];
|
19
|
+
valid: boolean;
|
20
|
+
}
|
21
|
+
export declare class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
22
|
+
private instance;
|
23
|
+
hidePopupOnScroll: () => void;
|
24
|
+
constructor(props: IDatePicker);
|
25
|
+
componentDidMount(): void;
|
26
|
+
componentWillUnmount(): void;
|
27
|
+
componentDidUpdate(prevProps: IDatePicker): void;
|
28
|
+
render(): JSX.Element;
|
29
|
+
}
|
30
|
+
interface IDatePickerISO extends IDatePickerBase {
|
31
|
+
value: string;
|
32
|
+
onChange(value: string): void;
|
33
|
+
}
|
34
|
+
export declare class DatePickerISO extends React.PureComponent<IDatePickerISO> {
|
35
|
+
render(): JSX.Element;
|
36
|
+
}
|
37
|
+
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ChartData, ChartOptions } from 'chart.js';
|
3
|
+
interface IProps {
|
4
|
+
data: ChartData;
|
5
|
+
options: ChartOptions;
|
6
|
+
width: string;
|
7
|
+
height: string;
|
8
|
+
}
|
9
|
+
export declare class DonutChart extends React.Component<IProps, {}> {
|
10
|
+
render(): JSX.Element;
|
11
|
+
}
|
12
|
+
export {};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export interface IMenuItem {
|
3
|
+
label: string;
|
4
|
+
icon?: string;
|
5
|
+
onSelect(): void;
|
6
|
+
}
|
7
|
+
export interface ISubmenu {
|
8
|
+
type: 'submenu';
|
9
|
+
label: string;
|
10
|
+
icon?: string;
|
11
|
+
items: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
12
|
+
}
|
13
|
+
export interface IMenuGroup {
|
14
|
+
type: 'group';
|
15
|
+
label?: string;
|
16
|
+
items: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
17
|
+
}
|
18
|
+
interface IMenu {
|
19
|
+
label?: string;
|
20
|
+
align?: 'left' | 'right';
|
21
|
+
items: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
22
|
+
header?: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
23
|
+
footer?: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
24
|
+
append?: boolean;
|
25
|
+
children: React.ReactNode;
|
26
|
+
}
|
27
|
+
export declare const Dropdown: ({ items, header, footer, children, append, align, }: IMenu) => JSX.Element;
|
28
|
+
export {};
|