superdesk-ui-framework 3.0.66 → 3.0.68

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.
Files changed (78) hide show
  1. package/app/styles/components/_list-item.scss +22 -11
  2. package/app-typescript/components/Autocomplete.tsx +9 -3
  3. package/app-typescript/components/Badge.tsx +16 -2
  4. package/app-typescript/components/Dropdown.tsx +3 -1
  5. package/app-typescript/components/DropdownFirst.tsx +14 -2
  6. package/app-typescript/components/DurationInput.tsx +19 -4
  7. package/app-typescript/components/EmptyState.tsx +11 -2
  8. package/app-typescript/components/Layouts/Panel.tsx +12 -1
  9. package/app-typescript/components/Lists/ContentList.tsx +5 -1
  10. package/app-typescript/components/Modal.tsx +10 -1
  11. package/app-typescript/components/Navigation/BottomNav.tsx +9 -2
  12. package/app-typescript/components/Navigation/QuickNavBar.tsx +10 -2
  13. package/app-typescript/components/Navigation/SideBarMenu.tsx +9 -4
  14. package/app-typescript/components/SidebarMenu.tsx +8 -1
  15. package/app-typescript/components/TabList.tsx +5 -1
  16. package/app-typescript/components/TagInput.tsx +4 -1
  17. package/app-typescript/components/ThemeSelector.tsx +13 -2
  18. package/app-typescript/components/TreeMenu.tsx +127 -122
  19. package/app-typescript/components/TreeSelect/TreeSelect.tsx +157 -141
  20. package/app-typescript/components/WithPortal.tsx +49 -0
  21. package/app-typescript/components/avatar/avatar-image.tsx +2 -0
  22. package/app-typescript/components/avatar/avatar.tsx +2 -1
  23. package/dist/examples.bundle.js +1446 -1318
  24. package/dist/playgrounds/planning.html +121 -43
  25. package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +398 -385
  26. package/dist/playgrounds/react-playgrounds/EditorTest.tsx +359 -365
  27. package/dist/playgrounds/react-playgrounds/FirstPlayground.tsx +33 -33
  28. package/dist/playgrounds/react-playgrounds/Multiedit.tsx +227 -231
  29. package/dist/playgrounds/react-playgrounds/PageLayoutTest.tsx +41 -38
  30. package/dist/playgrounds/react-playgrounds/PersonalProfile.tsx +76 -96
  31. package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +73 -101
  32. package/dist/playgrounds/react-playgrounds/Rundowns.tsx +788 -729
  33. package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +35 -26
  34. package/dist/playgrounds/react-playgrounds/TestGround.tsx +99 -128
  35. package/dist/playgrounds/react-playgrounds/UiPlayground.tsx +40 -25
  36. package/dist/playgrounds/react-playgrounds/components/GraphicButton.tsx +6 -5
  37. package/dist/playgrounds/react-playgrounds/components/Layout.tsx +0 -2
  38. package/dist/playgrounds/react-playgrounds/components/SearchBar.tsx +16 -9
  39. package/dist/playgrounds/react-playgrounds/tsconfig.json +4 -0
  40. package/dist/superdesk-ui.bundle.css +24 -14
  41. package/dist/superdesk-ui.bundle.js +830 -727
  42. package/dist/vendor.bundle.js +14 -14
  43. package/examples/pages/playgrounds/planning.html +121 -43
  44. package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +398 -385
  45. package/examples/pages/playgrounds/react-playgrounds/EditorTest.tsx +359 -365
  46. package/examples/pages/playgrounds/react-playgrounds/FirstPlayground.tsx +33 -33
  47. package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +227 -231
  48. package/examples/pages/playgrounds/react-playgrounds/PageLayoutTest.tsx +41 -38
  49. package/examples/pages/playgrounds/react-playgrounds/PersonalProfile.tsx +76 -96
  50. package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +73 -101
  51. package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +788 -729
  52. package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +35 -26
  53. package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +99 -128
  54. package/examples/pages/playgrounds/react-playgrounds/UiPlayground.tsx +40 -25
  55. package/examples/pages/playgrounds/react-playgrounds/components/GraphicButton.tsx +6 -5
  56. package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +0 -2
  57. package/examples/pages/playgrounds/react-playgrounds/components/SearchBar.tsx +16 -9
  58. package/examples/pages/playgrounds/react-playgrounds/tsconfig.json +4 -0
  59. package/package.json +3 -2
  60. package/react/components/Autocomplete.js +2 -2
  61. package/react/components/Badge.js +1 -1
  62. package/react/components/Dropdown.js +3 -1
  63. package/react/components/DropdownFirst.js +6 -2
  64. package/react/components/DurationInput.js +5 -1
  65. package/react/components/EmptyState.js +2 -1
  66. package/react/components/Lists/ContentList.js +1 -1
  67. package/react/components/Navigation/BottomNav.js +4 -1
  68. package/react/components/Navigation/QuickNavBar.js +2 -1
  69. package/react/components/Navigation/SideBarMenu.js +3 -1
  70. package/react/components/TabList.js +2 -1
  71. package/react/components/TagInput.js +1 -1
  72. package/react/components/TreeSelect/TreeSelect.d.ts +3 -2
  73. package/react/components/TreeSelect/TreeSelect.js +81 -73
  74. package/react/components/WithPortal.d.ts +14 -0
  75. package/react/components/WithPortal.js +69 -0
  76. package/react/components/avatar/avatar.js +2 -1
  77. /package/dist/playgrounds/dummy-data/{items.js → items.ts} +0 -0
  78. /package/examples/pages/playgrounds/dummy-data/{items.js → items.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as Components from './components/Index';
3
- import { ButtonGroup, Button, NavButton, SubNav, Dropdown, CheckButtonGroup, RadioGroup, RadioButtonGroup, Input, Select, Option, Label, Icon, IconButton, Checkbox, GridList, Badge } from '../../../../app-typescript/index';
3
+ import { ButtonGroup, Button, NavButton, SubNav, Dropdown, RadioButtonGroup, Input, Select, Option, Label, Icon, IconButton, Checkbox, GridList, Badge } from '../../../../app-typescript/index';
4
4
  import * as GridElements from '../../../../app-typescript/components/GridItem';
5
5
 
6
6
  import dummy_items from '../dummy-data/items';
@@ -77,7 +77,9 @@ export class UiPlayground extends React.Component<IProps, IState> {
77
77
  { icon: 'spike', size: 'big' },
78
78
  { icon: 'personal', size: 'big' },
79
79
  { icon: 'global-search', size: 'big' },
80
- { icon: 'picture', size: 'big', active: true }]} />
80
+ { icon: 'picture', size: 'big', active: true }
81
+ ]}
82
+ />
81
83
 
82
84
  <Components.LayoutContainer>
83
85
  <Components.HeaderPanel>
@@ -93,7 +95,9 @@ export class UiPlayground extends React.Component<IProps, IState> {
93
95
  { label: 'File archive', onSelect: () => this.setState({ dropDownState: 'File archive' }) },
94
96
  { label: 'AP images', onSelect: () => this.setState({ dropDownState: 'AP archive' }) },
95
97
  ]
96
- }]}>
98
+ }
99
+ ]}
100
+ >
97
101
  <NavButton text={this.state.dropDownState ? this.state.dropDownState : 'All Archives'} onClick={() => false} />
98
102
  </Dropdown>
99
103
  </ButtonGroup>
@@ -107,11 +111,16 @@ export class UiPlayground extends React.Component<IProps, IState> {
107
111
  <ButtonGroup align='inline'>
108
112
  <NavButton icon='filter-large' onClick={this.handleFilter} />
109
113
  </ButtonGroup>
110
- <RadioButtonGroup options={[
111
- {value:'test10', label:'Radio button with icon'},
112
- {value:'test11', label:'I have an icon!'},
113
- {value:'test12', label:'Yeah, me too!'},
114
- ]} group={{padded:true}} value={this.state.itemType} onChange={(value) => this.setState({ itemType: value })} />
114
+ <RadioButtonGroup
115
+ options={[
116
+ {value:'test10', label:'Radio button with icon'},
117
+ {value:'test11', label:'I have an icon!'},
118
+ {value:'test12', label:'Yeah, me too!'},
119
+ ]}
120
+ group={{padded:true}}
121
+ value={this.state.itemType}
122
+ onChange={(value) => this.setState({ itemType: value })}
123
+ />
115
124
  <ButtonGroup align='end' spaces='no-space'>
116
125
  <Dropdown
117
126
  items={[
@@ -123,7 +132,8 @@ export class UiPlayground extends React.Component<IProps, IState> {
123
132
  { label: 'Accessible Light', icon: 'adjust', onSelect: () => this.handleTheme('accessible-light-ui')},
124
133
  ]
125
134
  },
126
- ]}>
135
+ ]}
136
+ >
127
137
  <NavButton type='default' icon='adjust' onClick={()=> false} />
128
138
  </Dropdown>
129
139
  <NavButton icon='th-list' onClick={() => false} />
@@ -145,8 +155,8 @@ export class UiPlayground extends React.Component<IProps, IState> {
145
155
  value='Title'
146
156
  inlineLabel={false}
147
157
  disabled={false}
148
- invalid={false}
149
- onChange={(value) => { }} />
158
+ onChange={() => false}
159
+ />
150
160
  </div>
151
161
  </div>
152
162
  <div className="form__group">
@@ -156,8 +166,8 @@ export class UiPlayground extends React.Component<IProps, IState> {
156
166
  error='This is error message'
157
167
  inlineLabel={false}
158
168
  disabled={false}
159
- invalid={false}
160
- onChange={(value) => { }}>
169
+ onChange={() => false}
170
+ >
161
171
  <Option value="option-1">Select ingest source...</Option>
162
172
  <Option value="option-2">Associated Press</Option>
163
173
  <Option value="option-3">Reuters</Option>
@@ -173,8 +183,8 @@ export class UiPlayground extends React.Component<IProps, IState> {
173
183
  value='Keyword'
174
184
  inlineLabel={false}
175
185
  disabled={false}
176
- invalid={false}
177
- onChange={(value) => { }} />
186
+ onChange={() => false}
187
+ />
178
188
  </div>
179
189
  </div>
180
190
 
@@ -186,8 +196,8 @@ export class UiPlayground extends React.Component<IProps, IState> {
186
196
  info='Dolor in hendrerit.'
187
197
  inlineLabel={false}
188
198
  disabled={false}
189
- invalid={false}
190
- onChange={(value) => { }}>
199
+ onChange={() => false}
200
+ >
191
201
  <Option value="">--- Not selected ---</Option>
192
202
  <Option value="single">Single usage</Option>
193
203
  <Option value="time">Time restricted</Option>
@@ -206,16 +216,19 @@ export class UiPlayground extends React.Component<IProps, IState> {
206
216
  </Components.LeftPanel>
207
217
  {/* FILTER PANEL*/}
208
218
 
209
- <Components.MainPanel >
210
-
219
+ <Components.MainPanel>
211
220
  <GridList size="small" gap="medium" margin="3">
212
- {dummy_items.map((item, index) =>
221
+ {dummy_items.map((item: any, index: any) =>
213
222
  <GridElements.GridItem locked={item.locked} status={item.status} onClick={this.handlePreview} itemtype={item.type} key={index}>
214
223
  <GridElements.GridItemCheckWrapper>
215
- <Checkbox checked={item.selected} label={{text:''}} onChange={(value) => {
216
- item.selected = value;
217
- this.changeStatus(item, 'selected');
218
- }} />
224
+ <Checkbox
225
+ checked={item.selected}
226
+ label={{text:''}}
227
+ onChange={(value) => {
228
+ item.selected = value;
229
+ this.changeStatus(item, 'selected');
230
+ }}
231
+ />
219
232
  </GridElements.GridItemCheckWrapper>
220
233
  <GridElements.GridItemTopActions>
221
234
  <IconButton icon='fullscreen' ariaValue='More actions' onClick={()=> false} />
@@ -265,7 +278,9 @@ export class UiPlayground extends React.Component<IProps, IState> {
265
278
  { label: 'Download', icon: 'download', onSelect: () => this.setState({ dropDownState: 'Download' }) },
266
279
  { label: 'Delete', icon: 'trash', onSelect: () => this.setState({ dropDownState: 'Delete' }) },
267
280
  ]
268
- }]}>
281
+ }
282
+ ]}
283
+ >
269
284
  <IconButton ariaValue='dropdown-more-options' icon='dots-vertical' onClick={() => false} />
270
285
  </Dropdown>
271
286
  </div>
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import {Redirect} from 'react-router-dom';
3
2
 
4
3
  interface IGraphicButton {
5
4
  children?: never;
@@ -10,12 +9,14 @@ interface IGraphicButton {
10
9
  }
11
10
 
12
11
  export class GraphicButton extends React.PureComponent<IGraphicButton> {
13
- constructor(props){
12
+ constructor(props: IGraphicButton){
14
13
  super(props);
15
14
  this.onSubmit=this.onSubmit.bind(this);
16
15
  }
17
- onSubmit=() =>{
18
- window.location.href = this.props.link;
16
+ onSubmit=() => {
17
+ if (this.props.link != null) {
18
+ window.location.href = this.props.link;
19
+ }
19
20
  }
20
21
  render() {
21
22
  return (
@@ -30,4 +31,4 @@ export class GraphicButton extends React.PureComponent<IGraphicButton> {
30
31
  </a>
31
32
  );
32
33
  }
33
- }
34
+ }
@@ -1,6 +1,4 @@
1
1
  import * as React from 'react';
2
- import { SidebarMenu } from './SidebarMenu';
3
- import { AuthoringContent } from './AuthoringContent';
4
2
 
5
3
  interface IProps {
6
4
  header: string;
@@ -20,7 +20,7 @@ interface IState {
20
20
 
21
21
  export class SearchBar extends React.PureComponent<IProps, IState> {
22
22
  private inputRef: any;
23
- constructor(props) {
23
+ constructor(props: IProps) {
24
24
  super(props);
25
25
  this.state = {
26
26
  inputValue: this.props.value ? this.props.value : '',
@@ -46,27 +46,34 @@ export class SearchBar extends React.PureComponent<IProps, IState> {
46
46
  }
47
47
 
48
48
  render() {
49
- let classes = classNames('sd-searchbar', {
49
+ const classes = classNames('sd-searchbar', {
50
50
  [`sd-searchbar--${this.state.type}`] : this.props.type,
51
51
  'sd-searchbar--expanded': this.state.type === 'expanded' || this.props.type === undefined,
52
52
  'sd-searchbar--focused' : this.state.focused,
53
53
  'sd-searchbar--boxed': this.state.boxed,
54
54
  });
55
+
55
56
  return (
56
57
  <div className={classes} ref={this.inputRef}>
57
58
  <label className="sd-searchbar__icon"></label>
58
- <input id="search-input"
59
- ref={(input: any) => (input && this.props.focused) && input.focus()}
59
+
60
+ <input
61
+ id="search-input"
62
+ ref={(input: any) => (input && this.props.focused) && input.focus()}
60
63
  className="sd-searchbar__input"
61
64
  type="text"
62
65
  placeholder={this.props.placeholder}
63
66
  value={this.state.inputValue}
64
67
  onChange={(e) => this.setState({inputValue: e.target.value})}
65
- onFocus={() => this.setState({focused: true})} />
66
- {this.state.inputValue &&
67
- <button className="sd-searchbar__cancel" onClick={() => this.setState({inputValue: ''})}>
68
- <Icon name='remove-sign' />
69
- </button>}
68
+ onFocus={() => this.setState({focused: true})}
69
+ />
70
+
71
+ {this.state.inputValue && (
72
+ <button className="sd-searchbar__cancel" onClick={() => this.setState({inputValue: ''})}>
73
+ <Icon name='remove-sign' />
74
+ </button>
75
+ )}
76
+
70
77
  <button id="sd-searchbar__search-btn" className="sd-searchbar__search-btn" onSubmit={() => this.props.onSubmit}>
71
78
  <Icon name='chevron-right-thin' />
72
79
  </button>
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../../tsconfig.json",
3
+ "files": ["Index.tsx", "../../../../globals.d.ts"]
4
+ }
@@ -42321,34 +42321,44 @@ a.text-link {
42321
42321
  color: var(--sd-colour-interactive); }
42322
42322
 
42323
42323
  .sd-list-item-nested {
42324
- display: flex;
42325
- flex-direction: column; }
42324
+ --parent-item-height: 58px;
42325
+ display: grid;
42326
+ grid-template-rows: var(--parent-item-height) 0fr;
42327
+ transition: grid-template-rows 0.3s ease-out; }
42328
+ .sd-list-item-nested > .sd-list-item {
42329
+ max-height: var(--parent-item-height);
42330
+ height: var(--parent-item-height); }
42326
42331
 
42327
42332
  .sd-list-item-nested__childs {
42328
42333
  position: relative;
42329
42334
  z-index: 0;
42330
- display: flex;
42331
- flex-direction: column;
42332
- margin-inline-start: 1rem; }
42335
+ overflow: hidden !important;
42336
+ display: grid;
42337
+ grid-template-rows: 1fr;
42338
+ margin-inline-start: 1rem;
42339
+ transition: all 0.3s ease-out; }
42333
42340
  .sd-list-item-nested__childs .sd-list-item {
42334
42341
  margin-block-start: 0;
42335
42342
  border-block-start: 1px solid var(--sd-colour-line--x-light); }
42343
+ .sd-list-item-nested__childs .sd-list-item-nested__childs-inner {
42344
+ overflow: hidden;
42345
+ opacity: 0;
42346
+ transition: opacity 0.2s ease-out; }
42336
42347
 
42337
42348
  .sd-list-item-nested__parent {
42338
42349
  position: relative;
42339
42350
  z-index: 1; }
42340
42351
 
42341
42352
  .sd-list-item-nested--collapsed .sd-list-item-nested__childs {
42342
- transition: all ease-in 0.2s;
42343
- max-height: 0;
42344
- opacity: 0;
42345
- margin-block-end: 0;
42346
- overflow: hidden; }
42353
+ opacity: 0; }
42347
42354
 
42348
- .sd-list-item-nested--expanded .sd-list-item-nested__childs {
42349
- transition: all ease-in 0.2s;
42350
- max-height: 114rem;
42351
- opacity: 1; }
42355
+ .sd-list-item-nested--expanded {
42356
+ grid-template-rows: var(--parent-item-height) 1fr; }
42357
+ .sd-list-item-nested--expanded .sd-list-item-nested__childs {
42358
+ grid-template-rows: 1fr;
42359
+ opacity: 1; }
42360
+ .sd-list-item-nested--expanded .sd-list-item-nested__childs .sd-list-item-nested__childs-inner {
42361
+ opacity: 1; }
42352
42362
 
42353
42363
  .sd-list-item-group {
42354
42364
  display: flex;