superdesk-ui-framework 3.0.1 → 3.0.4

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 (43) hide show
  1. package/app/styles/app.scss +2 -1
  2. package/app/styles/editor/_editor-themes.scss +6 -1
  3. package/app/styles/form-elements/_inputs.scss +8 -8
  4. package/app/styles/layout/_editor.scss +5 -2
  5. package/app/styles/primereact/_pr-tag-input.scss +61 -0
  6. package/app-typescript/components/Layouts/AuthoringInnerBody.tsx +8 -1
  7. package/app-typescript/components/Layouts/AuthoringMain.tsx +2 -1
  8. package/app-typescript/components/MultiSelect.tsx +4 -2
  9. package/app-typescript/components/Navigation/SideBarTabs.tsx +34 -36
  10. package/app-typescript/components/TagInput.tsx +49 -233
  11. package/app-typescript/index.ts +0 -2
  12. package/dist/examples.bundle.js +2524 -2235
  13. package/dist/playgrounds/react-playgrounds/EditorTest.tsx +21 -18
  14. package/dist/playgrounds/react-playgrounds/Multiedit.tsx +29 -21
  15. package/dist/react/Index.tsx +3 -3
  16. package/dist/react/MultiSelect.tsx +4 -3
  17. package/dist/react/TagInputDocs.tsx +82 -0
  18. package/dist/superdesk-ui.bundle.css +73 -2
  19. package/dist/superdesk-ui.bundle.js +1506 -1704
  20. package/dist/vendor.bundle.js +19 -19
  21. package/examples/pages/playgrounds/react-playgrounds/EditorTest.tsx +21 -18
  22. package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +29 -21
  23. package/examples/pages/react/Index.tsx +3 -3
  24. package/examples/pages/react/MultiSelect.tsx +4 -3
  25. package/examples/pages/react/TagInputDocs.tsx +82 -0
  26. package/package.json +2 -2
  27. package/react/components/Layouts/AuthoringInnerBody.d.ts +1 -0
  28. package/react/components/Layouts/AuthoringInnerBody.js +5 -1
  29. package/react/components/Layouts/AuthoringMain.d.ts +1 -0
  30. package/react/components/Layouts/AuthoringMain.js +1 -1
  31. package/react/components/MultiSelect.d.ts +2 -1
  32. package/react/components/MultiSelect.js +4 -1
  33. package/react/components/Navigation/SideBarTabs.d.ts +7 -8
  34. package/react/components/Navigation/SideBarTabs.js +21 -22
  35. package/react/index.d.ts +0 -2
  36. package/react/index.js +1 -6
  37. package/app-typescript/components/TagInputTest.tsx +0 -76
  38. package/dist/react/TagInputs.tsx +0 -92
  39. package/examples/pages/react/TagInputs.tsx +0 -92
  40. package/react/components/TagInput.d.ts +0 -7
  41. package/react/components/TagInput.js +0 -200
  42. package/react/components/TagInputTest.d.ts +0 -18
  43. package/react/components/TagInputTest.js +0 -91
@@ -7,7 +7,7 @@
7
7
  var a = typeof exports === 'object' ? factory(require("react"), require("react-dom")) : factory(root["react"], root["react-dom"]);
8
8
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
9
  }
10
- })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_7__) {
10
+ })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_8__) {
11
11
  return /******/ (function(modules) { // webpackBootstrap
12
12
  /******/ // The module cache
13
13
  /******/ var installedModules = {};
@@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap
70
70
  /******/ __webpack_require__.p = "";
71
71
  /******/
72
72
  /******/ // Load entry module and return exports
73
- /******/ return __webpack_require__(__webpack_require__.s = 536);
73
+ /******/ return __webpack_require__(__webpack_require__.s = 534);
74
74
  /******/ })
75
75
  /************************************************************************/
76
76
  /******/ ({
@@ -82,7 +82,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
82
82
 
83
83
  /***/ }),
84
84
 
85
- /***/ 33:
85
+ /***/ 34:
86
86
  /***/ (function(module, exports, __webpack_require__) {
87
87
 
88
88
  /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
@@ -28246,29 +28246,29 @@ module.exports = function(module) {
28246
28246
 
28247
28247
  /***/ }),
28248
28248
 
28249
- /***/ 536:
28249
+ /***/ 534:
28250
28250
  /***/ (function(module, exports, __webpack_require__) {
28251
28251
 
28252
28252
  "use strict";
28253
28253
 
28254
28254
 
28255
- __webpack_require__(33);
28255
+ __webpack_require__(34);
28256
28256
 
28257
28257
  __webpack_require__(42);
28258
28258
 
28259
+ __webpack_require__(535);
28260
+
28259
28261
  __webpack_require__(537);
28260
28262
 
28261
28263
  __webpack_require__(539);
28262
28264
 
28263
- __webpack_require__(541);
28264
-
28265
28265
  __webpack_require__(0);
28266
28266
 
28267
- __webpack_require__(7);
28267
+ __webpack_require__(8);
28268
28268
 
28269
28269
  /***/ }),
28270
28270
 
28271
- /***/ 537:
28271
+ /***/ 535:
28272
28272
  /***/ (function(module, exports, __webpack_require__) {
28273
28273
 
28274
28274
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -28292,7 +28292,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
28292
28292
  if ( true ) {
28293
28293
 
28294
28294
  // AMD. Register as an anonymous module.
28295
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(42), __webpack_require__(538) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
28295
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(42), __webpack_require__(536) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
28296
28296
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
28297
28297
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
28298
28298
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -29030,7 +29030,7 @@ return $.widget;
29030
29030
 
29031
29031
  /***/ }),
29032
29032
 
29033
- /***/ 538:
29033
+ /***/ 536:
29034
29034
  /***/ (function(module, exports, __webpack_require__) {
29035
29035
 
29036
29036
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
@@ -29060,16 +29060,16 @@ return $.ui.version = "1.13.0";
29060
29060
 
29061
29061
  /***/ }),
29062
29062
 
29063
- /***/ 539:
29063
+ /***/ 537:
29064
29064
  /***/ (function(module, exports, __webpack_require__) {
29065
29065
 
29066
- __webpack_require__(540);
29066
+ __webpack_require__(538);
29067
29067
  module.exports = angular;
29068
29068
 
29069
29069
 
29070
29070
  /***/ }),
29071
29071
 
29072
- /***/ 540:
29072
+ /***/ 538:
29073
29073
  /***/ (function(module, exports, __webpack_require__) {
29074
29074
 
29075
29075
  /* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {/**
@@ -65676,16 +65676,16 @@ $provide.value("$locale", {
65676
65676
 
65677
65677
  /***/ }),
65678
65678
 
65679
- /***/ 541:
65679
+ /***/ 539:
65680
65680
  /***/ (function(module, exports, __webpack_require__) {
65681
65681
 
65682
- __webpack_require__(542);
65682
+ __webpack_require__(540);
65683
65683
  module.exports = 'ngAnimate';
65684
65684
 
65685
65685
 
65686
65686
  /***/ }),
65687
65687
 
65688
- /***/ 542:
65688
+ /***/ 540:
65689
65689
  /***/ (function(module, exports) {
65690
65690
 
65691
65691
  /**
@@ -69964,10 +69964,10 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
69964
69964
 
69965
69965
  /***/ }),
69966
69966
 
69967
- /***/ 7:
69967
+ /***/ 8:
69968
69968
  /***/ (function(module, exports) {
69969
69969
 
69970
- module.exports = __WEBPACK_EXTERNAL_MODULE_7__;
69970
+ module.exports = __WEBPACK_EXTERNAL_MODULE_8__;
69971
69971
 
69972
69972
  /***/ })
69973
69973
 
@@ -44,7 +44,7 @@ export class EditorTest extends React.Component<IProps, IState> {
44
44
  rightPanelOpen: false,
45
45
  rightPanelPinned: false,
46
46
  sideOverlayOpen: false,
47
-
47
+
48
48
  }
49
49
  this.handleTheme = this.handleTheme.bind(this);
50
50
  }
@@ -161,7 +161,7 @@ export class EditorTest extends React.Component<IProps, IState> {
161
161
  required={false}
162
162
  disabled={false}
163
163
  invalid={false}
164
- onChange={(value) => {}} />
164
+ onChange={(value) => {}} />
165
165
  </Form.FormItem>
166
166
  </Form.FormGroup>
167
167
  <Form.FormGroup inlineLabel={true}>
@@ -176,7 +176,7 @@ export class EditorTest extends React.Component<IProps, IState> {
176
176
  required={false}
177
177
  disabled={false}
178
178
  invalid={false}
179
- onChange={(value) => {}} />
179
+ onChange={(value) => {}} />
180
180
  </Form.FormItem>
181
181
  </Form.FormGroup>
182
182
  <Form.FormGroup marginBottom='0' inlineLabel={true}>
@@ -191,7 +191,7 @@ export class EditorTest extends React.Component<IProps, IState> {
191
191
  required={true}
192
192
  disabled={false}
193
193
  invalid={false}
194
- onChange={(value) => {}} />
194
+ onChange={(value) => {}} />
195
195
  </Form.FormItem>
196
196
  <Form.FormItem autoWidth={true}>
197
197
  <Form.FormText>Just testing:</Form.FormText>
@@ -304,7 +304,7 @@ export class EditorTest extends React.Component<IProps, IState> {
304
304
  </ButtonGroup>
305
305
  </Layout.Container>
306
306
  </div>
307
-
307
+
308
308
  <div id='section4'>
309
309
  <Heading type='h1' className='sd-padding--5'>Section 4</Heading>
310
310
  <p className='sd-margin-b--3'>Maecenas sed diam eget risus varius blandit sit amet non magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas faucibus mollis interdum.
@@ -328,9 +328,9 @@ export class EditorTest extends React.Component<IProps, IState> {
328
328
  <Button text="Submit" onClick={()=> false} type="primary" />
329
329
  </ButtonGroup>
330
330
  </Layout.Container>
331
- </div>
331
+ </div>
332
332
  </div>
333
-
333
+
334
334
  </Layout.AuthoringMain>
335
335
  )}
336
336
  sidePanelPinned={this.state.rightPanelOpen}
@@ -341,7 +341,7 @@ export class EditorTest extends React.Component<IProps, IState> {
341
341
  <Layout.PanelContent>
342
342
  <Layout.PanelContentBlock>
343
343
  <BoxedList density='comfortable'>
344
- <BoxedListItem
344
+ <BoxedListItem
345
345
  type="success"
346
346
  clickable={true}
347
347
  media={(
@@ -355,10 +355,10 @@ export class EditorTest extends React.Component<IProps, IState> {
355
355
  Maecenas sed diam eget risus varius blandit sit amet non magna. Vestibulum id ligula porta felis euismod semper.
356
356
  </BoxedListContentRow>
357
357
  <BoxedListContentRow>
358
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
358
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
359
359
  </BoxedListContentRow>
360
360
  </BoxedListItem>
361
- <BoxedListItem
361
+ <BoxedListItem
362
362
  type="warning"
363
363
  media={(
364
364
  <AvatarWrapper
@@ -381,7 +381,7 @@ export class EditorTest extends React.Component<IProps, IState> {
381
381
  Maecenas sed diam eget risus varius blandit sit amet magna.
382
382
  </BoxedListContentRow>
383
383
  </BoxedListItem>
384
- <BoxedListItem
384
+ <BoxedListItem
385
385
  selected={true}
386
386
  actions={(
387
387
  <IconButton icon="dots-vertical" ariaValue="More actions" onClick={()=> false} />
@@ -442,13 +442,16 @@ export class EditorTest extends React.Component<IProps, IState> {
442
442
  sideBar={(
443
443
  <Nav.SideBarTabs
444
444
  items={[
445
- { icon: 'info', size: 'big', tooltip: 'Info', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
446
- { icon: 'chat', size: 'big', tooltip: 'Comments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
447
- { icon: 'history', size: 'big', tooltip: 'History', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
448
- { icon: 'package', size: 'big', tooltip: 'Packages', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
449
- { icon: 'attachment', size: 'big', tooltip: 'Attachments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
450
- { icon: 'comments', size: 'big', tooltip: 'Inline Comments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) },
451
- { icon: 'suggestion', size: 'big', tooltip: 'Suggestions', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}) }]} />
445
+ { icon: 'info', size: 'big', tooltip: 'Info', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '1' },
446
+ { icon: 'chat', size: 'big', tooltip: 'Comments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '2' },
447
+ { icon: 'history', size: 'big', tooltip: 'History', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '3' },
448
+ { icon: 'package', size: 'big', tooltip: 'Packages', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '4' },
449
+ { icon: 'attachment', size: 'big', tooltip: 'Attachments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '5' },
450
+ { icon: 'comments', size: 'big', tooltip: 'Inline Comments', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '6' },
451
+ { icon: 'suggestion', size: 'big', tooltip: 'Suggestions', onClick: () => this.setState({'sideOverlayOpen': !this.state.sideOverlayOpen}), id: '7' }
452
+ ]}
453
+ active={'3'}
454
+ />
452
455
  )}
453
456
  overlayPanel={(
454
457
  <div></div>
@@ -47,8 +47,8 @@ export class Multiedit extends React.Component<IProps, IState> {
47
47
  rightPanelPinned: false,
48
48
  sideOverlayOpen: false,
49
49
  sideBarOpen: false,
50
- arr: [<Editor />, <Editor />]
51
-
50
+ arr: [<Editor />, <Editor />],
51
+
52
52
  }
53
53
  this.handleTheme = this.handleTheme.bind(this);
54
54
  }
@@ -68,7 +68,7 @@ export class Multiedit extends React.Component<IProps, IState> {
68
68
  }
69
69
 
70
70
  render() {
71
- return (
71
+ return (
72
72
  <Modal
73
73
  className='p-dialog-flex'
74
74
  onHide={() => false}
@@ -89,21 +89,23 @@ export class Multiedit extends React.Component<IProps, IState> {
89
89
  <Button type="primary" icon="plus-large" text="Add article" style="filled" size="large" shape="round" iconOnly={true} onClick={()=> false} />
90
90
  </Dropdown>
91
91
  </div>
92
- </Modal>
92
+ </Modal>
93
93
  );
94
94
  }
95
95
  }
96
96
 
97
97
  interface IEditor {
98
98
  sideBarOpen?: boolean;
99
+ activeTab: string | null;
99
100
  }
100
101
 
101
- export class Editor extends React.Component<IEditor, IEditor> {
102
+ export class Editor extends React.Component<{}, IEditor> {
102
103
  constructor(props: IEditor) {
103
104
  super(props);
104
105
  this.state = {
105
106
  sideBarOpen: false,
106
-
107
+ activeTab: '1',
108
+
107
109
  }
108
110
  }
109
111
 
@@ -178,7 +180,7 @@ export class Editor extends React.Component<IEditor, IEditor> {
178
180
  required={false}
179
181
  disabled={false}
180
182
  invalid={false}
181
- onChange={(value) => {}} />
183
+ onChange={(value) => {}} />
182
184
  </Form.FormItem>
183
185
  </Form.FormGroup>
184
186
  <Form.FormGroup inlineLabel={true}>
@@ -193,7 +195,7 @@ export class Editor extends React.Component<IEditor, IEditor> {
193
195
  required={false}
194
196
  disabled={false}
195
197
  invalid={false}
196
- onChange={(value) => {}} />
198
+ onChange={(value) => {}} />
197
199
  </Form.FormItem>
198
200
  </Form.FormGroup>
199
201
  <Form.FormGroup marginBottom='0' inlineLabel={true}>
@@ -208,7 +210,7 @@ export class Editor extends React.Component<IEditor, IEditor> {
208
210
  required={true}
209
211
  disabled={false}
210
212
  invalid={false}
211
- onChange={(value) => {}} />
213
+ onChange={(value) => {}} />
212
214
  </Form.FormItem>
213
215
  <Form.FormItem autoWidth={true}>
214
216
  <Form.FormText>Just testing:</Form.FormText>
@@ -247,7 +249,7 @@ export class Editor extends React.Component<IEditor, IEditor> {
247
249
  <Layout.PanelContent>
248
250
  <Layout.PanelContentBlock>
249
251
  <BoxedList density='comfortable'>
250
- <BoxedListItem
252
+ <BoxedListItem
251
253
  type="success"
252
254
  clickable={true}
253
255
  media={(
@@ -261,10 +263,10 @@ export class Editor extends React.Component<IEditor, IEditor> {
261
263
  Maecenas sed diam eget risus varius blandit sit amet non magna. Vestibulum id ligula porta felis euismod semper.
262
264
  </BoxedListContentRow>
263
265
  <BoxedListContentRow>
264
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
266
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
265
267
  </BoxedListContentRow>
266
268
  </BoxedListItem>
267
- <BoxedListItem
269
+ <BoxedListItem
268
270
  type="warning"
269
271
  media={(
270
272
  <AvatarWrapper
@@ -287,7 +289,7 @@ export class Editor extends React.Component<IEditor, IEditor> {
287
289
  Maecenas sed diam eget risus varius blandit sit amet magna.
288
290
  </BoxedListContentRow>
289
291
  </BoxedListItem>
290
- <BoxedListItem
292
+ <BoxedListItem
291
293
  selected={true}
292
294
  actions={(
293
295
  <IconButton icon="dots-vertical" ariaValue="More actions" onClick={()=> false} />
@@ -302,18 +304,24 @@ export class Editor extends React.Component<IEditor, IEditor> {
302
304
  </Layout.PanelContent>
303
305
  </Layout.Panel>
304
306
  )}
305
-
307
+
306
308
  sideBarClosed={this.state.sideBarOpen}
307
309
  sideBar={(
308
310
  <Nav.SideBarTabs
309
311
  items={[
310
- { icon: 'info', size: 'big', tooltip: 'Info', onClick: () => false },
311
- { icon: 'chat', size: 'big', tooltip: 'Comments', onClick: () => false },
312
- { icon: 'history', size: 'big', tooltip: 'History', onClick: () => false },
313
- { icon: 'package', size: 'big', tooltip: 'Packages', onClick: () => false },
314
- { icon: 'attachment', size: 'big', tooltip: 'Attachments', onClick: () => false },
315
- { icon: 'comments', size: 'big', tooltip: 'Inline Comments', onClick: () => false },
316
- { icon: 'suggestion', size: 'big', tooltip: 'Suggestions', onClick: () => false }]} />
312
+ { icon: 'info', size: 'big', tooltip: 'Info', onClick: () => false, id: '1' },
313
+ { icon: 'chat', size: 'big', tooltip: 'Comments', onClick: () => false, id: '2' },
314
+ { icon: 'history', size: 'big', tooltip: 'History', onClick: () => false, id: '3' },
315
+ { icon: 'package', size: 'big', tooltip: 'Packages', onClick: () => false, id: '4' },
316
+ { icon: 'attachment', size: 'big', tooltip: 'Attachments', onClick: () => false, id: '5'},
317
+ { icon: 'comments', size: 'big', tooltip: 'Inline Comments', onClick: () => false, id: '6' },
318
+ { icon: 'suggestion', size: 'big', tooltip: 'Suggestions', onClick: () => false, id: '7' }
319
+ ]}
320
+ activeTab={this.state.activeTab}
321
+ onActiveTabChange={(e) => this.setState({
322
+ activeTab: e,
323
+ })}
324
+ />
317
325
  )}
318
326
  />
319
327
  </div>
@@ -33,7 +33,6 @@ import IconFontDoc from './IconFont';
33
33
  import BigIconFontDoc from './BigIconFont';
34
34
  import SubNavDoc from './SubNav';
35
35
  import DropdownDoc from './Dropdowns';
36
- import TagInputDoc from './TagInputs';
37
36
  import ToastsDoc from './Toasts';
38
37
  import TagDoc from './Tags';
39
38
  import EmptyStateDoc from './EmptyStates';
@@ -56,6 +55,7 @@ import TextDoc from "./Text";
56
55
  import ContainerDoc from './Container';
57
56
  import DropZoneDoc from './DropZone';
58
57
  import CreateButtonDoc from './CreateButton';
58
+ import TagInputDocs from './TagInputDocs'
59
59
 
60
60
  import * as Playgrounds from '../playgrounds/react-playgrounds/Index';
61
61
  import { SelectWithTemplateDocs } from './SelectWithTemplate';
@@ -212,7 +212,7 @@ const pages = {
212
212
  name: 'Autocomplete',
213
213
  },
214
214
  'tag-input': {
215
- name: 'Tag Inputs',
215
+ name: 'Tag Input',
216
216
  },
217
217
  'select': {
218
218
  name: 'Select',
@@ -357,7 +357,7 @@ class ReactDoc extends React.Component<IProps, IState> {
357
357
  <Route path="/react/sub-navigation" component={SubNavDoc} />
358
358
  <Route path="/react/dropdowns" component={DropdownDoc} />
359
359
  <Route path="/react/toast" component={ToastsDoc} />
360
- <Route path="/react/tag-input" component={TagInputDoc} />
360
+ <Route path="/react/tag-input" component={TagInputDocs} />
361
361
  <Route path="/react/empty-states" component={EmptyStateDoc} />
362
362
  <Route path="/react/grid-list" component={GridListDoc} />
363
363
  <Route path="/react/grid-item" component={GridItemDoc} />
@@ -64,9 +64,10 @@ export class MultiselectDocs extends React.Component<{}, IState> {
64
64
  <MultiSelect
65
65
  value={this.state.value}
66
66
  options={ItemArr}
67
- onChange={(e: any) => this.setState({value: e.value})}
67
+ onChange={(e: any) => this.setState({value: e})}
68
68
  filter
69
69
  showSelectAll
70
+ zIndex={2000}
70
71
  placeholder='Select a color'
71
72
  optionLabel='name'
72
73
  required
@@ -105,7 +106,7 @@ export class MultiselectDocs extends React.Component<{}, IState> {
105
106
  <MultiSelect
106
107
  value={this.state.value2}
107
108
  options={ItemArr}
108
- onChange={(e: any) => this.setState({value2: e.value})}
109
+ onChange={(e: any) => this.setState({value2: e})}
109
110
  filter
110
111
  showSelectAll
111
112
  optionLabel='name'
@@ -198,4 +199,4 @@ export class MultiselectDocs extends React.Component<{}, IState> {
198
199
  </section>
199
200
  )
200
201
  }
201
- }
202
+ }
@@ -0,0 +1,82 @@
1
+ import * as React from 'react';
2
+ import {Prop, PropsList} from '../../../app-typescript';
3
+ import {TagInput} from '../../../app-typescript/components/TagInput';
4
+ import * as Markup from '../../js/react';
5
+
6
+ export default class TagInputDocs extends React.Component<{}, {value: Array<string>}> {
7
+ constructor(props) {
8
+ super(props);
9
+
10
+ this.state = {
11
+ value: ['Item'],
12
+ }
13
+ }
14
+
15
+ render() {
16
+ return (
17
+ <section className="docs-page__container">
18
+ <h2 className="docs-page__h2">Tag Input</h2>
19
+ <Markup.ReactMarkupCodePreview>{`
20
+ <TagInput
21
+ onChange={(value) => {
22
+ this.setState({
23
+ value: value,
24
+ });
25
+ }}
26
+ value={this.state.value}
27
+ placeholder="Type Here"
28
+ />
29
+ `}
30
+ </Markup.ReactMarkupCodePreview>
31
+ <Markup.ReactMarkup>
32
+ <Markup.ReactMarkupPreview>
33
+ <div className='docs-page__content-row'>
34
+ <TagInput
35
+ required
36
+ info={'Info Message'}
37
+ error={'Error Message'}
38
+ label={'Tag-input Label'}
39
+ onChange={(value) => {
40
+ this.setState({
41
+ value: value,
42
+ });
43
+ }}
44
+ value={this.state.value}
45
+ placeholder="Type Here"
46
+ />
47
+ </div>
48
+ </Markup.ReactMarkupPreview>
49
+ <Markup.ReactMarkupCode>{`
50
+ <TagInput
51
+ required
52
+ info={'Info Message'}
53
+ error={'Error Message'}
54
+ label={'TreeSelect Label'}
55
+ onChange={(value) => {
56
+ this.setState({
57
+ value: value,
58
+ });
59
+ }}
60
+ value={this.state.value}
61
+ placeholder="Type Here"
62
+ />
63
+ `}
64
+ </Markup.ReactMarkupCode>
65
+ </Markup.ReactMarkup>
66
+ <h3 className="docs-page__h3">Props</h3>
67
+ <PropsList>
68
+ <Prop name='value' isRequired={false} type='Array<T>' default='/' description='Value of the component.'/>
69
+ <Prop name='placeholder' isRequired={false} type='string' default='/' description='Input placeholder.'/>
70
+ <Prop name='onChange' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
71
+ <Prop name='label' isRequired={false} type='string' default='/' description='Input label.'/>
72
+ <Prop name='info' isRequired={false} type='string' default='/' description='Hint text.'/>
73
+ <Prop name='error' isRequired={false} type='string' default='/' description='Error text.'/>
74
+ <Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline.'/>
75
+ <Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required.'/>
76
+ <Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled.'/>
77
+ <Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid.'/>
78
+ </PropsList>
79
+ </section>
80
+ )
81
+ }
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "3.0.1",
3
+ "version": "3.0.4",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,7 +84,7 @@
84
84
  "dependencies": {
85
85
  "@material-ui/lab": "^4.0.0-alpha.56",
86
86
  "@popperjs/core": "^2.4.0",
87
- "@superdesk/primereact": "^5.0.2-6",
87
+ "@superdesk/primereact": "^5.0.2-8",
88
88
  "@types/node": "^14.10.2",
89
89
  "chart.js": "^2.9.3",
90
90
  "date-fns": "2.7.0",
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface IProps {
3
3
  children?: React.ReactNode;
4
+ noPadding?: boolean;
4
5
  }
5
6
  export declare class AuthoringInnerBody extends React.PureComponent<IProps> {
6
7
  render(): JSX.Element;
@@ -33,16 +33,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
33
33
  __setModuleDefault(result, mod);
34
34
  return result;
35
35
  };
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
36
39
  Object.defineProperty(exports, "__esModule", { value: true });
37
40
  exports.AuthoringInnerBody = void 0;
38
41
  var React = __importStar(require("react"));
42
+ var classnames_1 = __importDefault(require("classnames"));
39
43
  var AuthoringInnerBody = /** @class */ (function (_super) {
40
44
  __extends(AuthoringInnerBody, _super);
41
45
  function AuthoringInnerBody() {
42
46
  return _super !== null && _super.apply(this, arguments) || this;
43
47
  }
44
48
  AuthoringInnerBody.prototype.render = function () {
45
- return (React.createElement("article", { className: "sd-editor-content__authoring-body" }, this.props.children));
49
+ return (React.createElement("article", { className: (0, classnames_1.default)('sd-editor-content__authoring-body', { 'sd-editor-content__authoring-body-padding': this.props.noPadding === false }) }, this.props.children));
46
50
  };
47
51
  return AuthoringInnerBody;
48
52
  }(React.PureComponent));
@@ -7,6 +7,7 @@ interface IProps {
7
7
  headerCollapsed?: boolean;
8
8
  headerPadding?: 'small' | 'medium' | 'large';
9
9
  toolbarCustom?: boolean;
10
+ noPaddingForContent?: boolean;
10
11
  }
11
12
  export declare class AuthoringMain extends React.PureComponent<IProps> {
12
13
  render(): JSX.Element;
@@ -48,7 +48,7 @@ var AuthoringMain = /** @class */ (function (_super) {
48
48
  React.createElement(_1.AuthoringMainContent, null,
49
49
  this.props.authoringHeader && (React.createElement(_1.AuthoringInnerHeader, { headerPadding: this.props.headerPadding, collapsed: this.props.headerCollapsed }, this.props.authoringHeader)),
50
50
  this.props.authoringBookmarks && (React.createElement(_1.AuthorinInnerSideBar, null, this.props.authoringBookmarks)),
51
- React.createElement(_1.AuthoringInnerBody, null, this.props.children))));
51
+ React.createElement(_1.AuthoringInnerBody, { noPadding: this.props.noPaddingForContent }, this.props.children))));
52
52
  };
53
53
  return AuthoringMain;
54
54
  }(React.PureComponent));
@@ -13,9 +13,10 @@ interface IProps<T> {
13
13
  filter?: boolean;
14
14
  showClear?: boolean;
15
15
  showSelectAll?: boolean;
16
+ zIndex?: number;
16
17
  itemTemplate?(item: any): JSX.Element | undefined;
17
18
  selectedItemTemplate?(value: any): JSX.Element | undefined;
18
- onChange(newValue: T): void;
19
+ onChange(newValue: Array<T>): void;
19
20
  invalid?: boolean;
20
21
  inlineLabel?: boolean;
21
22
  labelHidden?: boolean;
@@ -63,7 +63,10 @@ var MultiSelect = /** @class */ (function (_super) {
63
63
  'showFilter': this.props.filter,
64
64
  });
65
65
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
66
- React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (e) { return _this.props.onChange(e); }, display: "chip", filter: this.props.filter, filterBy: this.props.optionLabel, appendTo: document.body, placeholder: this.props.placeholder, optionLabel: this.props.optionLabel, emptyFilterMessage: this.props.emptyFilterMessage, filterPlaceholder: this.props.filterPlaceholder, itemTemplate: this.props.itemTemplate, selectedItemTemplate: this.props.selectedItemTemplate, maxSelectedLabels: (_a = this.props.maxSelectedLabels) !== null && _a !== void 0 ? _a : 4, selectedItemsLabel: this.props.selectedItemsLabel, ariaLabelledBy: this.htmlId + 'label', tabIndex: this.props.tabIndex ? this.props.tabIndex : '0', showClear: this.props.showClear, disabled: this.props.disabled, inputId: this.htmlId })));
66
+ React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
67
+ var value = _a.value;
68
+ return _this.props.onChange(value);
69
+ }, display: "chip", zIndex: this.props.zIndex, filter: this.props.filter, filterBy: this.props.optionLabel, appendTo: document.body, placeholder: this.props.placeholder, optionLabel: this.props.optionLabel, emptyFilterMessage: this.props.emptyFilterMessage, filterPlaceholder: this.props.filterPlaceholder, itemTemplate: this.props.itemTemplate, selectedItemTemplate: this.props.selectedItemTemplate, maxSelectedLabels: (_a = this.props.maxSelectedLabels) !== null && _a !== void 0 ? _a : 4, selectedItemsLabel: this.props.selectedItemsLabel, ariaLabelledBy: this.htmlId + 'label', tabIndex: this.props.tabIndex ? this.props.tabIndex : '0', showClear: this.props.showClear, disabled: this.props.disabled, inputId: this.htmlId })));
67
70
  };
68
71
  return MultiSelect;
69
72
  }(React.Component));