@imposium-hub/components 2.5.10 → 2.5.11-1
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/dist/cjs/components/app-wrapper/AppWrapper.js +2 -5
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableAssetIdCell.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdCell.js +54 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdCell.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter.d.ts +2 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter.js +94 -0
- package/dist/cjs/components/assets/AssetsTableAssetIdFilter.js.map +1 -0
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js +2 -1
- package/dist/cjs/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/cjs/components/assets/AssetsTableNameCell.js +2 -1
- package/dist/cjs/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/cjs/components/card/Card.d.ts +1 -0
- package/dist/cjs/components/card/Card.js +17 -4
- package/dist/cjs/components/card/Card.js.map +1 -1
- package/dist/cjs/components/confirm-modal/ConfirmModal.d.ts +0 -8
- package/dist/cjs/components/confirm-modal/ConfirmModal.js +8 -21
- package/dist/cjs/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/cjs/components/data-table/Paginator.js +51 -7
- package/dist/cjs/components/data-table/Paginator.js.map +1 -1
- package/dist/cjs/components/smpte-field/SMPTEField.d.ts +2 -1
- package/dist/cjs/components/smpte-field/SMPTEField.js +9 -3
- package/dist/cjs/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/cjs/components/story-previewer/StoryPreviewer.js +1 -11
- package/dist/cjs/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/cjs/constants/variables.d.ts +0 -3
- package/dist/cjs/constants/variables.js +2 -27
- package/dist/cjs/constants/variables.js.map +1 -1
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +6 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/redux/actions/asset-list.js +42 -33
- package/dist/cjs/redux/actions/asset-list.js.map +1 -1
- package/dist/cjs/redux/actions/asset-uploads.js +0 -10
- package/dist/cjs/redux/actions/asset-uploads.js.map +1 -1
- package/dist/cjs/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +2 -5
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableAssetIdCell.d.ts +2 -0
- package/dist/esm/components/assets/AssetsTableAssetIdCell.js +29 -0
- package/dist/esm/components/assets/AssetsTableAssetIdCell.js.map +1 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter.d.ts +2 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter.js +20 -0
- package/dist/esm/components/assets/AssetsTableAssetIdFilter.js.map +1 -0
- package/dist/esm/components/assets/AssetsTableGlobalCell.js +2 -1
- package/dist/esm/components/assets/AssetsTableGlobalCell.js.map +1 -1
- package/dist/esm/components/assets/AssetsTableNameCell.js +2 -1
- package/dist/esm/components/assets/AssetsTableNameCell.js.map +1 -1
- package/dist/esm/components/card/Card.d.ts +1 -0
- package/dist/esm/components/card/Card.js +16 -4
- package/dist/esm/components/card/Card.js.map +1 -1
- package/dist/esm/components/confirm-modal/ConfirmModal.d.ts +0 -8
- package/dist/esm/components/confirm-modal/ConfirmModal.js +8 -21
- package/dist/esm/components/confirm-modal/ConfirmModal.js.map +1 -1
- package/dist/esm/components/data-table/Paginator.js +74 -44
- package/dist/esm/components/data-table/Paginator.js.map +1 -1
- package/dist/esm/components/smpte-field/SMPTEField.d.ts +2 -1
- package/dist/esm/components/smpte-field/SMPTEField.js +9 -3
- package/dist/esm/components/smpte-field/SMPTEField.js.map +1 -1
- package/dist/esm/components/story-previewer/StoryPreviewer.js +2 -12
- package/dist/esm/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/esm/constants/variables.d.ts +0 -3
- package/dist/esm/constants/variables.js +1 -25
- package/dist/esm/constants/variables.js.map +1 -1
- package/dist/esm/index.d.ts +3 -2
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/redux/actions/asset-list.js +42 -33
- package/dist/esm/redux/actions/asset-list.js.map +1 -1
- package/dist/esm/redux/actions/asset-uploads.js +0 -10
- package/dist/esm/redux/actions/asset-uploads.js.map +1 -1
- package/dist/esm/redux/reducers/asset-uploads.js.map +1 -1
- package/dist/styles.css +13 -2
- package/dist/styles.less +16 -3
- package/less/components/data-table.less +4 -0
- package/less/components/form-field.less +7 -3
- package/less/components/tag.less +5 -0
- package/package.json +1 -1
- package/src/components/app-wrapper/AppWrapper.tsx +4 -3
- package/src/components/assets/AssetsTableAssetIdCell.tsx +64 -0
- package/src/components/assets/AssetsTableAssetIdFilter.tsx +41 -0
- package/src/components/assets/AssetsTableGlobalCell.tsx +11 -1
- package/src/components/assets/AssetsTableNameCell.tsx +10 -1
- package/src/components/card/Card.tsx +27 -13
- package/src/components/data-table/Paginator.tsx +140 -93
- package/src/components/smpte-field/SMPTEField.tsx +8 -3
- package/src/components/story-previewer/StoryPreviewer.tsx +4 -28
- package/src/constants/variables.ts +1 -27
- package/src/index.ts +5 -4
- package/src/redux/actions/asset-list.ts +44 -36
- package/src/redux/actions/asset-uploads.ts +0 -9
- package/src/redux/reducers/asset-uploads.ts +2 -0
- package/dist/cjs/components/app-wrapper/AppWrapper_BACKUP_73190.d.ts +0 -27
- package/dist/cjs/components/app-wrapper/AppWrapper_BACKUP_73190.js +0 -243
- package/dist/cjs/components/app-wrapper/AppWrapper_BACKUP_73190.js.map +0 -1
- package/dist/cjs/components/app-wrapper/AppWrapper_BASE_73190.d.ts +0 -28
- package/dist/cjs/components/app-wrapper/AppWrapper_BASE_73190.js +0 -255
- package/dist/cjs/components/app-wrapper/AppWrapper_BASE_73190.js.map +0 -1
- package/dist/cjs/components/app-wrapper/AppWrapper_LOCAL_73190.d.ts +0 -27
- package/dist/cjs/components/app-wrapper/AppWrapper_LOCAL_73190.js +0 -243
- package/dist/cjs/components/app-wrapper/AppWrapper_LOCAL_73190.js.map +0 -1
- package/dist/cjs/components/app-wrapper/AppWrapper_REMOTE_73190.d.ts +0 -28
- package/dist/cjs/components/app-wrapper/AppWrapper_REMOTE_73190.js +0 -251
- package/dist/cjs/components/app-wrapper/AppWrapper_REMOTE_73190.js.map +0 -1
- package/dist/cjs/components/error-message-preview/ErrorMessagePreview.d.ts +0 -15
- package/dist/cjs/components/error-message-preview/ErrorMessagePreview.js +0 -91
- package/dist/cjs/components/error-message-preview/ErrorMessagePreview.js.map +0 -1
- package/dist/cjs/components/header/Header_BACKUP_73021.d.ts +0 -33
- package/dist/cjs/components/header/Header_BACKUP_73021.js +0 -393
- package/dist/cjs/components/header/Header_BACKUP_73021.js.map +0 -1
- package/dist/cjs/components/header/Header_BASE_73021.d.ts +0 -29
- package/dist/cjs/components/header/Header_BASE_73021.js +0 -376
- package/dist/cjs/components/header/Header_BASE_73021.js.map +0 -1
- package/dist/cjs/components/header/Header_LOCAL_73021.d.ts +0 -33
- package/dist/cjs/components/header/Header_LOCAL_73021.js +0 -382
- package/dist/cjs/components/header/Header_LOCAL_73021.js.map +0 -1
- package/dist/cjs/components/header/Header_REMOTE_73021.d.ts +0 -30
- package/dist/cjs/components/header/Header_REMOTE_73021.js +0 -386
- package/dist/cjs/components/header/Header_REMOTE_73021.js.map +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper_BACKUP_73190.d.ts +0 -27
- package/dist/esm/components/app-wrapper/AppWrapper_BACKUP_73190.js +0 -194
- package/dist/esm/components/app-wrapper/AppWrapper_BACKUP_73190.js.map +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper_BASE_73190.d.ts +0 -28
- package/dist/esm/components/app-wrapper/AppWrapper_BASE_73190.js +0 -208
- package/dist/esm/components/app-wrapper/AppWrapper_BASE_73190.js.map +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper_LOCAL_73190.d.ts +0 -27
- package/dist/esm/components/app-wrapper/AppWrapper_LOCAL_73190.js +0 -194
- package/dist/esm/components/app-wrapper/AppWrapper_LOCAL_73190.js.map +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper_REMOTE_73190.d.ts +0 -28
- package/dist/esm/components/app-wrapper/AppWrapper_REMOTE_73190.js +0 -204
- package/dist/esm/components/app-wrapper/AppWrapper_REMOTE_73190.js.map +0 -1
- package/dist/esm/components/error-message-preview/ErrorMessagePreview.d.ts +0 -15
- package/dist/esm/components/error-message-preview/ErrorMessagePreview.js +0 -35
- package/dist/esm/components/error-message-preview/ErrorMessagePreview.js.map +0 -1
- package/dist/esm/components/header/Header_BACKUP_73021.d.ts +0 -33
- package/dist/esm/components/header/Header_BACKUP_73021.js +0 -336
- package/dist/esm/components/header/Header_BACKUP_73021.js.map +0 -1
- package/dist/esm/components/header/Header_BASE_73021.d.ts +0 -29
- package/dist/esm/components/header/Header_BASE_73021.js +0 -322
- package/dist/esm/components/header/Header_BASE_73021.js.map +0 -1
- package/dist/esm/components/header/Header_LOCAL_73021.d.ts +0 -33
- package/dist/esm/components/header/Header_LOCAL_73021.js +0 -328
- package/dist/esm/components/header/Header_LOCAL_73021.js.map +0 -1
- package/dist/esm/components/header/Header_REMOTE_73021.d.ts +0 -30
- package/dist/esm/components/header/Header_REMOTE_73021.js +0 -329
- package/dist/esm/components/header/Header_REMOTE_73021.js.map +0 -1
- package/src/components/confirm-modal/ConfirmModal.tsx +0 -131
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
padding:4px;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
input[type=number] {
|
|
59
|
+
-moz-appearance: textfield;
|
|
60
|
+
}
|
|
61
|
+
|
|
58
62
|
textarea{
|
|
59
63
|
height:@inputHeight * 3;
|
|
60
64
|
resize:none;
|
|
@@ -156,15 +160,15 @@
|
|
|
156
160
|
padding-top: 1px;
|
|
157
161
|
box-sizing: border-box;
|
|
158
162
|
color:darken(@textDefault, 30%);
|
|
159
|
-
|
|
163
|
+
background: #373737;
|
|
160
164
|
&:hover{
|
|
161
165
|
background:darken(@inputBackground, 5%);
|
|
162
166
|
}
|
|
163
167
|
|
|
164
168
|
&.active{
|
|
165
169
|
cursor:auto;
|
|
166
|
-
background:
|
|
167
|
-
color
|
|
170
|
+
background:unset;
|
|
171
|
+
color:unset;
|
|
168
172
|
}
|
|
169
173
|
|
|
170
174
|
&.disabled svg {
|
package/less/components/tag.less
CHANGED
package/package.json
CHANGED
|
@@ -8,7 +8,6 @@ import { bindActionCreators } from 'redux';
|
|
|
8
8
|
import { login, clearCachedAuth } from '../../redux/actions/auth';
|
|
9
9
|
import { validateAccessLevel } from '../../Util';
|
|
10
10
|
import { setAccessData } from '../../redux/actions/access';
|
|
11
|
-
import { ConfirmModal } from '../confirm-modal/ConfirmModal';
|
|
12
11
|
|
|
13
12
|
export interface IAppWrapperProps {
|
|
14
13
|
children: React.ReactChildren;
|
|
@@ -85,7 +84,10 @@ class AppWrapper extends React.Component<IAppWrapperProps, IAppWrapperState> {
|
|
|
85
84
|
/*
|
|
86
85
|
Check the auth0 session expiry
|
|
87
86
|
*/
|
|
88
|
-
public componentDidUpdate = (
|
|
87
|
+
public componentDidUpdate = (
|
|
88
|
+
prevProps: Readonly<IAppWrapperProps>,
|
|
89
|
+
prevState: Readonly<IAppWrapperState>
|
|
90
|
+
): void => {
|
|
89
91
|
const { auth } = this.props;
|
|
90
92
|
let validAccessLevel: boolean;
|
|
91
93
|
|
|
@@ -284,7 +286,6 @@ class AppWrapper extends React.Component<IAppWrapperProps, IAppWrapperState> {
|
|
|
284
286
|
id='app'
|
|
285
287
|
className='app'>
|
|
286
288
|
{innerContent}
|
|
287
|
-
<ConfirmModal />
|
|
288
289
|
</div>
|
|
289
290
|
);
|
|
290
291
|
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { copying } from '../../constants/copy';
|
|
3
|
+
import { updateFilters } from '../../redux/actions/asset-filters';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import { bindActionCreators } from 'redux';
|
|
6
|
+
|
|
7
|
+
interface IAssetsTableAssetIdCellProps {
|
|
8
|
+
cell: any;
|
|
9
|
+
onNotification?: (e) => void;
|
|
10
|
+
onError?: (e) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const AssetsTableAssetIdCell: React.FC<IAssetsTableAssetIdCellProps> = (
|
|
14
|
+
props: IAssetsTableAssetIdCellProps
|
|
15
|
+
) => {
|
|
16
|
+
const {
|
|
17
|
+
onNotification,
|
|
18
|
+
onError,
|
|
19
|
+
cell: {
|
|
20
|
+
row: {
|
|
21
|
+
original: { id }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} = props;
|
|
25
|
+
|
|
26
|
+
const copyToClipboard = (e) => {
|
|
27
|
+
navigator.clipboard.writeText(e.target.textContent).then(
|
|
28
|
+
() => {
|
|
29
|
+
if (onNotification) {
|
|
30
|
+
onNotification(`${copying.copied}`);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
() => {
|
|
34
|
+
if (onError) {
|
|
35
|
+
onError(`${copying.error}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
key={id}
|
|
44
|
+
className='imposium-asset-id'
|
|
45
|
+
onClick={(e) => copyToClipboard(e)}>
|
|
46
|
+
{id}
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const mapDispatchToProps = (dispatch): any => {
|
|
52
|
+
return bindActionCreators({ updateFilters }, dispatch);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const mapStateToProps = (state): any => {
|
|
56
|
+
return { assetFilters: state.assetFilters };
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const AssetsTableAssetIdCellMemoized = connect(
|
|
60
|
+
mapStateToProps,
|
|
61
|
+
mapDispatchToProps
|
|
62
|
+
)(React.memo(AssetsTableAssetIdCell));
|
|
63
|
+
|
|
64
|
+
export default AssetsTableAssetIdCellMemoized;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import TextField from '../text-field/TextField';
|
|
3
|
+
import { updateFilters } from '../../redux/actions/asset-filters';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
import { bindActionCreators } from 'redux';
|
|
6
|
+
|
|
7
|
+
interface IAssetsTableAssetIdFilterProps {
|
|
8
|
+
assetFilters: any;
|
|
9
|
+
updateFilters: (filters: any) => any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class AssetsTableAssetIdFilter extends React.PureComponent<IAssetsTableAssetIdFilterProps> {
|
|
13
|
+
public render = (): JSX.Element => {
|
|
14
|
+
const { assetFilters } = this.props;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<TextField
|
|
18
|
+
className='asset-id'
|
|
19
|
+
submittable
|
|
20
|
+
submittableType='search'
|
|
21
|
+
value={assetFilters.id}
|
|
22
|
+
doSubmit={(n) => this.props.updateFilters({ id: n })}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const mapDispatchToProps = (dispatch): any => {
|
|
29
|
+
return bindActionCreators({ updateFilters }, dispatch);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const mapStateToProps = (state): any => {
|
|
33
|
+
return { assetFilters: state.assetFilters };
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const AssetsTableAssetIdFilterMemoized = connect(
|
|
37
|
+
mapStateToProps,
|
|
38
|
+
mapDispatchToProps
|
|
39
|
+
)(React.memo(AssetsTableAssetIdFilter));
|
|
40
|
+
|
|
41
|
+
export default AssetsTableAssetIdFilterMemoized;
|
|
@@ -6,8 +6,18 @@ interface IAssetsTableGlobalCell {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
const AssetsTableGlobalCell: React.FC<IAssetsTableGlobalCell> = (p: IAssetsTableGlobalCell) => {
|
|
9
|
+
const {
|
|
10
|
+
cell: {
|
|
11
|
+
row: {
|
|
12
|
+
original: { story_id }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
} = p;
|
|
16
|
+
|
|
9
17
|
return (
|
|
10
|
-
<div className='asset-global-cell'>
|
|
18
|
+
<div className='asset-global-cell'>
|
|
19
|
+
{story_id || story_id === undefined ? null : ICON_GLOBE}
|
|
20
|
+
</div>
|
|
11
21
|
);
|
|
12
22
|
};
|
|
13
23
|
|
|
@@ -45,6 +45,15 @@ const AssetsTableNameCell: React.FC<IAssetsTableNameCell> = (props: IAssetsTable
|
|
|
45
45
|
};
|
|
46
46
|
}, [name]);
|
|
47
47
|
|
|
48
|
+
const errorField = error ? (
|
|
49
|
+
<TextField
|
|
50
|
+
value={error}
|
|
51
|
+
width={'100%'}
|
|
52
|
+
/>
|
|
53
|
+
) : (
|
|
54
|
+
<span>{copy.uploads.preparePhase}</span>
|
|
55
|
+
);
|
|
56
|
+
|
|
48
57
|
if (uploadProgress) {
|
|
49
58
|
const loader: JSX.Element =
|
|
50
59
|
uploadProgress < 100 ? (
|
|
@@ -53,7 +62,7 @@ const AssetsTableNameCell: React.FC<IAssetsTableNameCell> = (props: IAssetsTable
|
|
|
53
62
|
text={name}
|
|
54
63
|
/>
|
|
55
64
|
) : (
|
|
56
|
-
|
|
65
|
+
errorField
|
|
57
66
|
);
|
|
58
67
|
return loader;
|
|
59
68
|
} else {
|
|
@@ -11,6 +11,7 @@ interface ICardProps {
|
|
|
11
11
|
onOpen?: (e: any) => any;
|
|
12
12
|
onClose?: (e: any) => any;
|
|
13
13
|
onToggle?: (toggle: boolean) => any;
|
|
14
|
+
buttons?: any[];
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
interface ICardState {
|
|
@@ -97,9 +98,7 @@ class Card extends React.PureComponent<ICardProps, ICardState> {
|
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
100
|
<div className={`card ${openClass} ${collapsableClass} ${styleClass}`}>
|
|
100
|
-
<div
|
|
101
|
-
className='card-header'
|
|
102
|
-
onClick={this.evtHandlers.toggleOpen}>
|
|
101
|
+
<div className='card-header'>
|
|
103
102
|
{this.renderTitle(styleClass)}
|
|
104
103
|
{this.renderButtons()}
|
|
105
104
|
</div>
|
|
@@ -109,21 +108,36 @@ class Card extends React.PureComponent<ICardProps, ICardState> {
|
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
public renderButtons() {
|
|
112
|
-
const { collapsable } = this.props;
|
|
111
|
+
const { collapsable, buttons } = this.props;
|
|
113
112
|
const { open } = this.state;
|
|
114
113
|
const buttonIcon = open ? ICON_CARET_UP : ICON_CARET_DOWN;
|
|
115
114
|
|
|
115
|
+
let buttonArray: JSX.Element[];
|
|
116
|
+
|
|
117
|
+
const toggleBtn = (
|
|
118
|
+
<Button
|
|
119
|
+
key='toggleOpen'
|
|
120
|
+
style='subtle'
|
|
121
|
+
onClick={(e) => this.toggleOpen(e)}>
|
|
122
|
+
{buttonIcon}
|
|
123
|
+
</Button>
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
if (buttons && buttons.length > 0) {
|
|
127
|
+
buttonArray = buttons.map((button) => {
|
|
128
|
+
return button;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
116
132
|
if (collapsable) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{buttonIcon}
|
|
123
|
-
</Button>
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
133
|
+
if (buttonArray && buttonArray.length > 0) {
|
|
134
|
+
buttonArray.push(toggleBtn);
|
|
135
|
+
} else {
|
|
136
|
+
buttonArray = [toggleBtn];
|
|
137
|
+
}
|
|
126
138
|
}
|
|
139
|
+
|
|
140
|
+
return <div className='header-buttons'>{buttonArray}</div>;
|
|
127
141
|
}
|
|
128
142
|
}
|
|
129
143
|
|
|
@@ -26,102 +26,149 @@ const Paginator: React.FC<any> = ({
|
|
|
26
26
|
setPageSize,
|
|
27
27
|
itemsPerPage,
|
|
28
28
|
onItemsPerPage
|
|
29
|
-
}) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
29
|
+
}) => {
|
|
30
|
+
const [getPageIndex, setPageIndex] = React.useState<number>(pageIndex);
|
|
31
|
+
const [getItemsPerPage, setItemsPerPage] = React.useState<number>(itemsPerPage);
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (pageIndex !== getPageIndex) {
|
|
35
|
+
setPageIndex(pageIndex);
|
|
36
|
+
}
|
|
37
|
+
}, [pageIndex]);
|
|
38
|
+
|
|
39
|
+
const onItemsPerPageBlur = () => {
|
|
40
|
+
clearTimeout(textInputTimeout);
|
|
41
|
+
onItemsPerPage(getItemsPerPage);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const onGoToPageBlur = () => {
|
|
45
|
+
clearTimeout(textInputTimeout);
|
|
46
|
+
gotoPage(getPageIndex, pageSize);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const onItemsPerPageKeyDown = (e) => {
|
|
50
|
+
if (e.key === 'Enter') {
|
|
51
|
+
clearTimeout(textInputTimeout);
|
|
52
|
+
onItemsPerPage(getItemsPerPage);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const onGoToPageKeyDown = (e) => {
|
|
57
|
+
if (e.key === 'Enter') {
|
|
58
|
+
clearTimeout(textInputTimeout);
|
|
59
|
+
gotoPage(getPageIndex, pageSize);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<section className='ip-table-pagination'>
|
|
65
65
|
<span>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
<Button
|
|
67
|
+
style='subtle'
|
|
68
|
+
size='small'
|
|
69
|
+
tooltip='Go to first page'
|
|
70
|
+
disabled={!canPreviousPage}
|
|
71
|
+
onClick={() => gotoPage(1, pageSize)}>
|
|
72
|
+
{ICON_ANGLE_DOUBLE_LEFT}
|
|
73
|
+
</Button>
|
|
74
|
+
<Button
|
|
75
|
+
style='subtle'
|
|
76
|
+
size='small'
|
|
77
|
+
tooltip='Go to previous page'
|
|
78
|
+
disabled={!canPreviousPage}
|
|
79
|
+
onClick={() => previousPage()}>
|
|
80
|
+
{ICON_ANGLE_LEFT}
|
|
81
|
+
</Button>
|
|
82
|
+
<Button
|
|
83
|
+
style='subtle'
|
|
84
|
+
size='small'
|
|
85
|
+
tooltip='Go to next page'
|
|
86
|
+
disabled={!canNextPage}
|
|
87
|
+
onClick={() => nextPage()}>
|
|
88
|
+
{ICON_ANGLE_RIGHT}
|
|
89
|
+
</Button>
|
|
90
|
+
<Button
|
|
91
|
+
style='subtle'
|
|
92
|
+
size='small'
|
|
93
|
+
tooltip='Go to last page'
|
|
94
|
+
disabled={!canNextPage}
|
|
95
|
+
onClick={() => gotoPage(pageCount, pageSize)}>
|
|
96
|
+
{ICON_ANGLE_DOUBLE_RIGHT}
|
|
97
|
+
</Button>
|
|
70
98
|
|
|
99
|
+
<span>
|
|
100
|
+
{copy.table.page}
|
|
101
|
+
<strong>
|
|
102
|
+
{getPageIndex} of {pageCount}
|
|
103
|
+
</strong>
|
|
104
|
+
|
|
105
|
+
</span>
|
|
106
|
+
<span>
|
|
107
|
+
{copy.table.goToPage}
|
|
108
|
+
<input
|
|
109
|
+
className='paginator-input'
|
|
110
|
+
type='number'
|
|
111
|
+
placeholder={getPageIndex.toString()}
|
|
112
|
+
onChange={(e) => {
|
|
113
|
+
const input = e.target.value;
|
|
114
|
+
const inputNum = Number(input);
|
|
115
|
+
let next: number;
|
|
116
|
+
|
|
117
|
+
clearTimeout(textInputTimeout);
|
|
118
|
+
|
|
119
|
+
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
124
|
+
next = inputNum;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
textInputTimeout = window.setTimeout(
|
|
128
|
+
() => gotoPage(next, pageSize),
|
|
129
|
+
1000
|
|
130
|
+
);
|
|
131
|
+
}}
|
|
132
|
+
onBlur={() => onGoToPageBlur()}
|
|
133
|
+
onKeyDown={(e) => onGoToPageKeyDown(e)}
|
|
134
|
+
/>
|
|
135
|
+
</span>
|
|
136
|
+
|
|
137
|
+
<span>
|
|
138
|
+
{copy.table.itemsPerPage}
|
|
139
|
+
<input
|
|
140
|
+
className='paginator-input'
|
|
141
|
+
type='number'
|
|
142
|
+
placeholder={getItemsPerPage.toString()}
|
|
143
|
+
min={1}
|
|
144
|
+
onChange={(e) => {
|
|
145
|
+
const input = e.target.value;
|
|
146
|
+
const inputNum = Number(input);
|
|
147
|
+
|
|
148
|
+
clearTimeout(textInputTimeout);
|
|
149
|
+
|
|
150
|
+
if (!input || inputNum < 1) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
setItemsPerPage(inputNum);
|
|
155
|
+
|
|
156
|
+
textInputTimeout = window.setTimeout(
|
|
157
|
+
() => onItemsPerPage(inputNum),
|
|
158
|
+
1000
|
|
159
|
+
);
|
|
160
|
+
}}
|
|
161
|
+
onBlur={() => onItemsPerPageBlur()}
|
|
162
|
+
onKeyDown={(e) => onItemsPerPageKeyDown(e)}
|
|
163
|
+
/>
|
|
164
|
+
</span>
|
|
71
165
|
</span>
|
|
72
|
-
<span>
|
|
73
|
-
{copy.table.goToPage}
|
|
74
|
-
<input
|
|
75
|
-
className='paginator-input'
|
|
76
|
-
type='number'
|
|
77
|
-
placeholder={pageIndex}
|
|
78
|
-
onChange={(e) => {
|
|
79
|
-
const input = e.target.value;
|
|
80
|
-
const inputNum = Number(input);
|
|
81
|
-
let next: number;
|
|
82
|
-
|
|
83
|
-
clearTimeout(textInputTimeout);
|
|
84
|
-
|
|
85
|
-
if (!input || inputNum < 1 || inputNum > pageCount) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (inputNum >= 1 && inputNum <= pageCount) {
|
|
90
|
-
next = inputNum;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
textInputTimeout = window.setTimeout(() => gotoPage(next, pageSize), 300);
|
|
94
|
-
}}
|
|
95
|
-
/>
|
|
96
|
-
</span>
|
|
97
|
-
|
|
98
|
-
<span>
|
|
99
|
-
{copy.table.itemsPerPage}
|
|
100
|
-
<input
|
|
101
|
-
className='paginator-input'
|
|
102
|
-
type='number'
|
|
103
|
-
placeholder={itemsPerPage}
|
|
104
|
-
min={1}
|
|
105
|
-
onChange={(e) => {
|
|
106
|
-
const input = e.target.value;
|
|
107
|
-
const inputNum = Number(input);
|
|
108
|
-
|
|
109
|
-
clearTimeout(textInputTimeout);
|
|
110
|
-
|
|
111
|
-
if (!input || inputNum < 1) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
textInputTimeout = window.setTimeout(() => onItemsPerPage(inputNum), 300);
|
|
116
|
-
}}
|
|
117
|
-
/>
|
|
118
|
-
</span>
|
|
119
|
-
</span>
|
|
120
166
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
);
|
|
167
|
+
<span className='total-assets'>
|
|
168
|
+
{copy.table.total} <strong>{totalItems || 0}</strong>
|
|
169
|
+
</span>
|
|
170
|
+
</section>
|
|
171
|
+
);
|
|
172
|
+
};
|
|
126
173
|
|
|
127
174
|
export default Paginator;
|
|
@@ -12,6 +12,7 @@ interface ISMPTEFieldProps {
|
|
|
12
12
|
width?: string | number;
|
|
13
13
|
onChange?(e): void;
|
|
14
14
|
onBlur?(e): void;
|
|
15
|
+
onError?(e): void;
|
|
15
16
|
info?: string;
|
|
16
17
|
labelPosition?: string;
|
|
17
18
|
labelWidth?: string | number;
|
|
@@ -75,7 +76,7 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
75
76
|
|
|
76
77
|
private onBlur(e?) {
|
|
77
78
|
const val = e ? e.target.value : this.inputRef.current.value;
|
|
78
|
-
const isValid = this.
|
|
79
|
+
const isValid = this.SMTPEValidator(val);
|
|
79
80
|
|
|
80
81
|
if (e && e.key === 'Enter') {
|
|
81
82
|
this.setDuration(isValid, val);
|
|
@@ -88,10 +89,12 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
88
89
|
|
|
89
90
|
private onChange() {
|
|
90
91
|
const val = this.inputRef.current.value;
|
|
91
|
-
const isValid = this.
|
|
92
|
+
const isValid = this.SMTPEValidator(val);
|
|
92
93
|
|
|
93
94
|
if (isValid) {
|
|
94
95
|
this.props.onChange(val);
|
|
96
|
+
} else {
|
|
97
|
+
this.props.onError(isValid);
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
|
|
@@ -101,11 +104,13 @@ class SMPTEField extends React.PureComponent<ISMPTEFieldProps, ISMPTEFieldState>
|
|
|
101
104
|
const smpte = getSMPTE(frameRate, val);
|
|
102
105
|
if (smpte && this.props.onBlur) {
|
|
103
106
|
this.props.onBlur(smpte);
|
|
107
|
+
} else {
|
|
108
|
+
this.props.onError(isValid);
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
private
|
|
113
|
+
private SMTPEValidator(val) {
|
|
109
114
|
const isValidSMPTETimeCode = new RegExp(this.regex);
|
|
110
115
|
const isValid = isValidSMPTETimeCode.test(val);
|
|
111
116
|
const errorMsg = isValid ? null : TIMECODE.ERROR;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IImposiumAPI } from '../../services/API';
|
|
3
|
-
import {
|
|
4
|
-
VARIABLE_TYPES,
|
|
5
|
-
BOOLEAN_DEFAULT_OPTIONS,
|
|
6
|
-
colorPresets,
|
|
7
|
-
formatColor
|
|
8
|
-
} from '../../constants/variables';
|
|
3
|
+
import { VARIABLE_TYPES, BOOLEAN_DEFAULT_OPTIONS } from '../../constants/variables';
|
|
9
4
|
import { OUTPUT_TYPES } from '../../constants/previewer';
|
|
10
5
|
import TextField from '../text-field/TextField';
|
|
11
6
|
import Button from '../button/Button';
|
|
@@ -28,7 +23,6 @@ import LogViewer from '../log-viewer/LogViewer';
|
|
|
28
23
|
import { connect } from 'react-redux';
|
|
29
24
|
import { ICON_DOWNLOAD, ICON_CLIPBOARD } from '../../constants/icons';
|
|
30
25
|
import AudioPlayer from '../players/AudioPlayer';
|
|
31
|
-
import ColorField from '../color-field/ColorField';
|
|
32
26
|
|
|
33
27
|
interface IStoryPreviewerProps {
|
|
34
28
|
api: IImposiumAPI;
|
|
@@ -143,14 +137,15 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
143
137
|
const { variables } = this.props;
|
|
144
138
|
const inventoryOverrides = this.props.editor?.inventoryOverrides;
|
|
145
139
|
const newInv = {};
|
|
140
|
+
|
|
146
141
|
for (const i in variables) {
|
|
147
142
|
if (variables.hasOwnProperty(i)) {
|
|
148
143
|
const override = inventoryOverrides ? inventoryOverrides[i] : null;
|
|
149
144
|
const inv = variables[i];
|
|
150
|
-
newInv[inv.id] =
|
|
151
|
-
override !== null ? override : this.getVariableValue(inv.previewItem);
|
|
145
|
+
newInv[inv.id] = override ? override : this.getVariableValue(inv.previewItem);
|
|
152
146
|
}
|
|
153
147
|
}
|
|
148
|
+
|
|
154
149
|
return newInv;
|
|
155
150
|
}
|
|
156
151
|
|
|
@@ -235,11 +230,6 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
235
230
|
}
|
|
236
231
|
}
|
|
237
232
|
|
|
238
|
-
private colorInputChanged(key, value) {
|
|
239
|
-
const color = formatColor(value);
|
|
240
|
-
this.variableInputChanged(key, color);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
233
|
private variableInputChanged(key, value) {
|
|
244
234
|
const inventory = { ...this.state.inventory };
|
|
245
235
|
inventory[key] = value;
|
|
@@ -407,20 +397,6 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
407
397
|
</FieldWrapper>
|
|
408
398
|
);
|
|
409
399
|
break;
|
|
410
|
-
case VARIABLE_TYPES.COLOR:
|
|
411
|
-
const value = inventory[inv.id] ? inventory[inv.id] : 'rgba(0,0,0,1)';
|
|
412
|
-
fields.push(
|
|
413
|
-
<ColorField
|
|
414
|
-
label={inv.name}
|
|
415
|
-
labelPosition='top'
|
|
416
|
-
enableAlpha={true}
|
|
417
|
-
presetColors={colorPresets}
|
|
418
|
-
value={value}
|
|
419
|
-
pickerPosition='bottom'
|
|
420
|
-
onChange={(v) => this.colorInputChanged(inv.id, v)}
|
|
421
|
-
/>
|
|
422
|
-
);
|
|
423
|
-
break;
|
|
424
400
|
}
|
|
425
401
|
}
|
|
426
402
|
}
|