superdesk-ui-framework 3.0.1-beta.6 → 3.0.1-beta.7

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.
@@ -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 = 488);
73
+ /******/ return __webpack_require__(__webpack_require__.s = 513);
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__;/**
@@ -17296,11 +17296,11 @@ module.exports = __WEBPACK_EXTERNAL_MODULE_0__;
17296
17296
  }
17297
17297
  }.call(this));
17298
17298
 
17299
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(39), __webpack_require__(47)(module)))
17299
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(40), __webpack_require__(49)(module)))
17300
17300
 
17301
17301
  /***/ }),
17302
17302
 
17303
- /***/ 39:
17303
+ /***/ 40:
17304
17304
  /***/ (function(module, exports) {
17305
17305
 
17306
17306
  var g;
@@ -17328,7 +17328,7 @@ module.exports = g;
17328
17328
 
17329
17329
  /***/ }),
17330
17330
 
17331
- /***/ 40:
17331
+ /***/ 41:
17332
17332
  /***/ (function(module, exports, __webpack_require__) {
17333
17333
 
17334
17334
  var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@@ -28217,7 +28217,7 @@ return jQuery;
28217
28217
 
28218
28218
  /***/ }),
28219
28219
 
28220
- /***/ 47:
28220
+ /***/ 49:
28221
28221
  /***/ (function(module, exports) {
28222
28222
 
28223
28223
  module.exports = function(module) {
@@ -28246,21 +28246,21 @@ module.exports = function(module) {
28246
28246
 
28247
28247
  /***/ }),
28248
28248
 
28249
- /***/ 488:
28249
+ /***/ 513:
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
- __webpack_require__(40);
28257
+ __webpack_require__(41);
28258
28258
 
28259
- __webpack_require__(489);
28259
+ __webpack_require__(514);
28260
28260
 
28261
- __webpack_require__(491);
28261
+ __webpack_require__(516);
28262
28262
 
28263
- __webpack_require__(493);
28263
+ __webpack_require__(518);
28264
28264
 
28265
28265
  __webpack_require__(0);
28266
28266
 
@@ -28268,7 +28268,7 @@ __webpack_require__(9);
28268
28268
 
28269
28269
  /***/ }),
28270
28270
 
28271
- /***/ 489:
28271
+ /***/ 514:
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__(40), __webpack_require__(490) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
28295
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(41), __webpack_require__(515) ], __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
- /***/ 490:
29033
+ /***/ 515:
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 ) {
@@ -29039,7 +29039,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
29039
29039
  if ( true ) {
29040
29040
 
29041
29041
  // AMD. Register as an anonymous module.
29042
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(40) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
29042
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(41) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
29043
29043
  __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
29044
29044
  (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
29045
29045
  __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
@@ -29060,16 +29060,16 @@ return $.ui.version = "1.13.0";
29060
29060
 
29061
29061
  /***/ }),
29062
29062
 
29063
- /***/ 491:
29063
+ /***/ 516:
29064
29064
  /***/ (function(module, exports, __webpack_require__) {
29065
29065
 
29066
- __webpack_require__(492);
29066
+ __webpack_require__(517);
29067
29067
  module.exports = angular;
29068
29068
 
29069
29069
 
29070
29070
  /***/ }),
29071
29071
 
29072
- /***/ 492:
29072
+ /***/ 517:
29073
29073
  /***/ (function(module, exports, __webpack_require__) {
29074
29074
 
29075
29075
  /* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {/**
@@ -65672,20 +65672,20 @@ $provide.value("$locale", {
65672
65672
  })(window);
65673
65673
 
65674
65674
  !window.angular.$$csp().noInlineStyle && window.angular.element(document.head).prepend(window.angular.element('<style>').text('@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}'));
65675
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(40)))
65675
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(41)))
65676
65676
 
65677
65677
  /***/ }),
65678
65678
 
65679
- /***/ 493:
65679
+ /***/ 518:
65680
65680
  /***/ (function(module, exports, __webpack_require__) {
65681
65681
 
65682
- __webpack_require__(494);
65682
+ __webpack_require__(519);
65683
65683
  module.exports = 'ngAnimate';
65684
65684
 
65685
65685
 
65686
65686
  /***/ }),
65687
65687
 
65688
- /***/ 494:
65688
+ /***/ 519:
65689
65689
  /***/ (function(module, exports) {
65690
65690
 
65691
65691
  /**
@@ -184,7 +184,7 @@ export class MultiselectDocs extends React.Component<{}, IState> {
184
184
  <Prop name='filter' isRequired={false} type='boolean' default='false' description='When specified, displays an input field to filter the items on keyup.'/>
185
185
  <Prop name='filterPlaceholder' isRequired={false} type='string' default='/' description='Placeholder text to show when filter input is empty.'/>
186
186
  <Prop name='emptyFilterMessage' isRequired={false} type='string' default='No results found' description='Template to display when filtering does not return any results.'/>
187
- <Prop name='maxSelectedLabels' isRequired={false} type='number' default='/' description='Decides how many selected item labels to show at most.'/>
187
+ <Prop name='maxSelectedLabels' isRequired={false} type='number' default='/' description='Decides how many selected item labels to show at most. Its necessary to use selectedItemTemplate.'/>
188
188
  <Prop name='selectedItemsLabel' isRequired={false} type='string' default='{0} items selected' description='Label to display after exceeding max selected labels.'/>
189
189
  <Prop name='ariaLabelledBy' isRequired={false} type='string' default='/' description='Establishes relationships between the component and label(s) where its value should be one or more element IDs.'/>
190
190
  <Prop name='tabIndex' isRequired={false} type='string' default="'0'" description='Index of the element in tabbing order.'/>
@@ -14,40 +14,40 @@ interface IProps {
14
14
  export default class TableListDoc extends React.Component<IProps, IState> {
15
15
  constructor(props: IState) {
16
16
  super(props);
17
- this.state={
17
+ this.state = {
18
18
  array: [
19
19
  {
20
20
  start: <>
21
- <Label style='translucent' text='aacc' />
22
- <Label style='translucent' type='primary' text='prlg' />
23
- </>,
21
+ <Label style='translucent' text='aacc' />
22
+ <Label style='translucent' type='primary' text='prlg' />
23
+ </>,
24
24
  center: <span>Item 1</span>,
25
25
  end: <IconLabel style='translucent' text='Label success' type='success' icon='time' />,
26
- action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={()=> false} />,
26
+ action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={() => false} />,
27
27
  onClick: () => {
28
28
  return false;
29
29
  }
30
30
  },
31
31
  {
32
32
  start: <>
33
- <Label style='translucent' text='aacc' />
34
- <Label style='translucent' type='primary' text='prlg' />
35
- </>,
33
+ <Label style='translucent' text='aacc' />
34
+ <Label style='translucent' type='primary' text='prlg' />
35
+ </>,
36
36
  center: <span>Item 2</span>,
37
37
  end: <IconLabel style='translucent' text='Label success' type='success' icon='time' />,
38
- action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={()=> false} />,
38
+ action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={() => false} />,
39
39
  onClick: () => {
40
40
  return false;
41
41
  }
42
42
  },
43
43
  {
44
44
  start: <>
45
- <Label style='translucent' text='aacc' />
46
- <Label style='translucent' type='primary' text='prlg' />
47
- </>,
45
+ <Label style='translucent' text='aacc' />
46
+ <Label style='translucent' type='primary' text='prlg' />
47
+ </>,
48
48
  center: <span>Item 3</span>,
49
49
  end: <IconLabel style='translucent' text='Label success' type='success' icon='time' />,
50
- action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={()=> false} />,
50
+ action: <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={() => false} />,
51
51
  onClick: () => {
52
52
  return false;
53
53
  }
@@ -61,7 +61,7 @@ export default class TableListDoc extends React.Component<IProps, IState> {
61
61
  return (
62
62
  <section className='docs-page__container'>
63
63
  <h2 className='docs-page__h2'>TableList</h2>
64
-
64
+
65
65
  <Markup.ReactMarkupCodePreview>{`
66
66
  <TableList
67
67
  dragAndDrop
@@ -82,50 +82,50 @@ export default class TableListDoc extends React.Component<IProps, IState> {
82
82
 
83
83
  <TableList>
84
84
  <TableListItem
85
- start={
86
- <>
87
- <Label style='translucent' text='aacc' />
88
- <Label style='translucent' type='primary' text='prlg' />
89
- </>
90
- }
91
- center={
92
- <span>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</span>
93
- }
94
- end={
95
- <IconLabel style='translucent' text='Label success' type='success' icon='time' />
96
- }
97
- action={
98
- <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={()=> false} />
99
- } />
85
+ start={
86
+ <>
87
+ <Label style='translucent' text='aacc' />
88
+ <Label style='translucent' type='primary' text='prlg' />
89
+ </>
90
+ }
91
+ center={
92
+ <span>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</span>
93
+ }
94
+ end={
95
+ <IconLabel style='translucent' text='Label success' type='success' icon='time' />
96
+ }
97
+ action={
98
+ <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={() => false} />
99
+ } />
100
100
  <TableListItem
101
- start={
102
- <>
103
- <Label style='hollow' text='aacc' />
104
- <Label style='filled' type='primary' text='prlg' />
105
- </>
106
- }
107
- center={
108
- <span>Nullam id dolor id nibh ultricies vehicula ut id elit.</span>
109
- }
110
- end={
111
- <IconLabel style='translucent' text='Label success' type='success' icon='time' />
112
- } />
101
+ start={
102
+ <>
103
+ <Label style='hollow' text='aacc' />
104
+ <Label style='filled' type='primary' text='prlg' />
105
+ </>
106
+ }
107
+ center={
108
+ <span>Nullam id dolor id nibh ultricies vehicula ut id elit.</span>
109
+ }
110
+ end={
111
+ <IconLabel style='translucent' text='Label success' type='success' icon='time' />
112
+ } />
113
113
  <TableListItem
114
- start={
115
- <>
116
- <Label style='translucent' text='aacc' />
117
- <Label style='translucent' type='primary' text='prlg' />
118
- </>
119
- }
120
- center={
121
- <span>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</span>
122
- }
123
- end={
124
- <IconLabel style='translucent' text='Label success' type='success' icon='time' />
125
- }
126
- action={
127
- <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={()=> false} />
128
- } />
114
+ start={
115
+ <>
116
+ <Label style='translucent' text='aacc' />
117
+ <Label style='translucent' type='primary' text='prlg' />
118
+ </>
119
+ }
120
+ center={
121
+ <span>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</span>
122
+ }
123
+ end={
124
+ <IconLabel style='translucent' text='Label success' type='success' icon='time' />
125
+ }
126
+ action={
127
+ <IconButton icon='dots-vertical' size='small' ariaValue='More actions' onClick={() => false} />
128
+ } />
129
129
  </TableList>
130
130
 
131
131
  </Markup.ReactMarkupPreview>
@@ -183,17 +183,18 @@ export default class TableListDoc extends React.Component<IProps, IState> {
183
183
  <p className="docs-page__paragraph">With drag and drop functionality:</p>
184
184
  <Markup.ReactMarkup>
185
185
  <Markup.ReactMarkupPreview>
186
-
186
+
187
187
  <TableList
188
- dragAndDrop
189
- addItem
190
- array={this.state.array}
191
- itemsDropdown={[
192
- { label: <Label style='translucent' type='primary' text='aacc' />, onSelect: () => 1 },
193
- { label: <Label style='translucent' text='prlg' />, onSelect: () => 1 },
194
- { label: <Label style='translucent' type='primary' text='prlg' />, onSelect: () => 1 },
195
- ]}
196
- onClick={() => false}
188
+ dragAndDrop
189
+ addItem
190
+ array={this.state.array}
191
+ itemsDropdown={[
192
+ { label: <Label style='translucent' type='primary' text='aacc' />, onSelect: () => 1 },
193
+ { label: <Label style='translucent' text='prlg' />, onSelect: () => 1 },
194
+ { label: <Label style='translucent' type='primary' text='prlg' />, onSelect: () => 1 },
195
+ ]}
196
+ onClick={() => false}
197
+ onDrag={(start, end) => console.log(start, end)}
197
198
  />
198
199
 
199
200
  </Markup.ReactMarkupPreview>
@@ -216,28 +217,29 @@ export default class TableListDoc extends React.Component<IProps, IState> {
216
217
  <h3 className="docs-page__h3">Props</h3>
217
218
  <p className="docs-page__paragraph">TableList</p>
218
219
  <PropsList>
219
- <Prop name='array' isRequired={false} type='Array' default='false' description='Array of object.'/>
220
- <Prop name='children' isRequired={false} type='React.ReactNode' default='false' description='Children of component.'/>
221
- <Prop name='addItem' isRequired={false} type='boolean' default='false' description='Functionality to add items to the list.'/>
222
- <Prop name='dragAndDrop' isRequired={false} type='boolean' default='false' description='Drag&Drop functionality.'/>
223
- <Prop name='itemsDropdown' isRequired={false} type='React.ReactNode | any' default='false' description='Dropdown for functionality to add items to the list.'/>
224
- <Prop name='className' isRequired={false} type='string' default='false' description='Add class on TableList container.'/>
225
- <Prop name='onClick' isRequired={false} type='function' default='false' description='onClick functionality.'/>
220
+ <Prop name='array' isRequired={false} type='Array' default='false' description='Array of object.' />
221
+ <Prop name='children' isRequired={false} type='React.ReactNode' default='false' description='Children of component.' />
222
+ <Prop name='addItem' isRequired={false} type='boolean' default='false' description='Functionality to add items to the list.' />
223
+ <Prop name='dragAndDrop' isRequired={false} type='boolean' default='false' description='Drag&Drop functionality.' />
224
+ <Prop name='itemsDropdown' isRequired={false} type='React.ReactNode | any' default='false' description='Dropdown for functionality to add items to the list.' />
225
+ <Prop name='className' isRequired={false} type='string' default='false' description='Add class on TableList container.' />
226
+ <Prop name='onClick' isRequired={false} type='function' default='false' description='onClick functionality.' />
227
+ <Prop name='onDrag' isRequired={false} type='function' default='false' description='Returns start and end position of draggable item' />
226
228
  </PropsList>
227
229
  <p className="docs-page__paragraph">array:</p>
228
230
  <PropsList>
229
- <Prop name='start' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
230
- <Prop name='center' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
231
- <Prop name='end' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
232
- <Prop name='action' isRequired={false} type='React.ReactNode' default='false' description='Column of individual list items that is displayed on hover.'/>
231
+ <Prop name='start' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
232
+ <Prop name='center' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
233
+ <Prop name='end' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
234
+ <Prop name='action' isRequired={false} type='React.ReactNode' default='false' description='Column of individual list items that is displayed on hover.' />
233
235
  </PropsList>
234
236
  <p className="docs-page__paragraph">TableListItem</p>
235
237
  <PropsList>
236
- <Prop name='start' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
237
- <Prop name='center' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
238
- <Prop name='end' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.'/>
239
- <Prop name='action' isRequired={false} type='React.ReactNode' default='false' description='Column of individual list items that is displayed on hover.'/>
240
- <Prop name='onClick' isRequired={false} type='function' default='false' description='onClick functionality.'/>
238
+ <Prop name='start' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
239
+ <Prop name='center' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
240
+ <Prop name='end' isRequired={false} type='React.ReactNode' default='false' description='Column of individual items of list.' />
241
+ <Prop name='action' isRequired={false} type='React.ReactNode' default='false' description='Column of individual list items that is displayed on hover.' />
242
+ <Prop name='onClick' isRequired={false} type='function' default='false' description='onClick functionality.' />
241
243
  </PropsList>
242
244
 
243
245
  </section>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "3.0.1-beta.6",
3
+ "version": "3.0.1-beta.7",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,6 +31,7 @@
31
31
  "@types/classnames": "^2.2.9",
32
32
  "@types/lodash": "^4.14.161",
33
33
  "@types/react": "16.8.23",
34
+ "@types/react-beautiful-dnd": "^13.1.2",
34
35
  "@types/react-dom": "16.8.0",
35
36
  "@types/react-router-dom": "^5.1.2",
36
37
  "@types/react-scrollspy": "^3.3.5",
@@ -19,6 +19,7 @@ interface IState {
19
19
  hours?: any;
20
20
  minutes?: any;
21
21
  seconds?: any;
22
+ blink?: string;
22
23
  }
23
24
  export declare class DurationInput extends React.PureComponent<IProps, IState> {
24
25
  hourRef: React.RefObject<HTMLInputElement>;
@@ -27,7 +28,7 @@ export declare class DurationInput extends React.PureComponent<IProps, IState> {
27
28
  private htmlId;
28
29
  constructor(props: IProps);
29
30
  stateUpdate(state: string, parametar1?: number, parametar2?: number, parametar3?: number): string | number;
30
- componentDidUpdate(_: any, prevState: IState): void;
31
+ componentDidUpdate(prevProps: any, prevState: IState): void;
31
32
  valueUpdate(): void;
32
33
  handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;
33
34
  handleKeyValue(event: React.KeyboardEvent<HTMLInputElement>, state: 'hours' | 'minutes' | 'seconds'): void;
@@ -52,6 +52,7 @@ var DurationInput = /** @class */ (function (_super) {
52
52
  hours: _this.stateUpdate('hours', _this.props.hours, _this.props.minutes, _this.props.seconds),
53
53
  minutes: _this.stateUpdate('minutes', _this.props.minutes, _this.props.seconds),
54
54
  seconds: _this.stateUpdate('seconds', _this.props.seconds),
55
+ blink: '',
55
56
  };
56
57
  _this.hourRef = React.createRef();
57
58
  _this.minuteRef = React.createRef();
@@ -82,7 +83,8 @@ var DurationInput = /** @class */ (function (_super) {
82
83
  }
83
84
  return this.zeroPad(value);
84
85
  };
85
- DurationInput.prototype.componentDidUpdate = function (_, prevState) {
86
+ DurationInput.prototype.componentDidUpdate = function (prevProps, prevState) {
87
+ var _this = this;
86
88
  if (!this.hourRef.current || !this.minuteRef.current || !this.secondRef.current) {
87
89
  return;
88
90
  }
@@ -99,6 +101,10 @@ var DurationInput = /** @class */ (function (_super) {
99
101
  hours: this.zeroPad(Number(this.state.hours) + 1),
100
102
  minutes: this.zeroPad(this.state.minutes % 60),
101
103
  });
104
+ this.setState({ blink: 'hour' });
105
+ setTimeout(function () {
106
+ _this.setState({ blink: '' });
107
+ }, 500);
102
108
  }
103
109
  if (Number(this.minuteRef.current.value) < 0) {
104
110
  this.setState({
@@ -107,6 +113,10 @@ var DurationInput = /** @class */ (function (_super) {
107
113
  : this.zeroPad(Number(this.state.hours)),
108
114
  minutes: 59,
109
115
  });
116
+ this.setState({ blink: 'hour' });
117
+ setTimeout(function () {
118
+ _this.setState({ blink: '' });
119
+ }, 500);
110
120
  }
111
121
  }
112
122
  if (this.state.seconds !== prevState.seconds) {
@@ -115,14 +125,31 @@ var DurationInput = /** @class */ (function (_super) {
115
125
  minutes: this.zeroPad(Number(this.state.minutes) + 1),
116
126
  seconds: this.zeroPad(this.state.seconds % 60),
117
127
  });
128
+ this.setState({ blink: 'minute' });
129
+ setTimeout(function () {
130
+ _this.setState({ blink: '' });
131
+ }, 500);
118
132
  }
119
133
  if (Number(this.secondRef.current.value) < 0) {
120
134
  this.setState({
121
135
  minutes: this.zeroPad(Number(this.state.minutes) - 1),
122
136
  seconds: 59,
123
137
  });
138
+ this.setState({ blink: 'minute' });
139
+ setTimeout(function () {
140
+ _this.setState({ blink: '' });
141
+ }, 500);
124
142
  }
125
143
  }
144
+ if ((this.props.hours !== prevProps.hours)
145
+ || (this.props.minutes !== prevProps.minutes)
146
+ || (this.props.seconds !== prevProps.seconds)) {
147
+ this.setState({
148
+ hours: this.stateUpdate('hours', this.props.hours, this.props.minutes, this.props.seconds),
149
+ minutes: this.stateUpdate('minutes', this.props.minutes, this.props.seconds),
150
+ seconds: this.stateUpdate('seconds', this.props.seconds),
151
+ });
152
+ }
126
153
  };
127
154
  DurationInput.prototype.valueUpdate = function () {
128
155
  if (this.props.onChange) {
@@ -226,7 +253,12 @@ var DurationInput = /** @class */ (function (_super) {
226
253
  DurationInput.prototype.handleChange = function (event, state) {
227
254
  var stateClone = {};
228
255
  if (event.target.value.length >= 2) {
229
- stateClone[state] = event.target.value.slice(0, 2);
256
+ if (event.target.selectionStart === 1 && event.target.selectionEnd === 1) {
257
+ stateClone[state] = event.target.value.slice(0, 1) + event.target.value.slice(2, 3);
258
+ }
259
+ else {
260
+ stateClone[state] = event.target.value.slice(0, 2);
261
+ }
230
262
  }
231
263
  else {
232
264
  stateClone[state] = event.target.value;
@@ -261,13 +293,13 @@ var DurationInput = /** @class */ (function (_super) {
261
293
  var InputClasses = (0, classnames_1.default)('sd-input__duration-input');
262
294
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.props.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
263
295
  React.createElement("div", { className: InputClasses },
264
- React.createElement("input", { className: 'duration-input', type: 'text', id: 'hours', max: 99, min: 0, ref: this.hourRef, value: this.state.hours, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.minuteRef.current); }, onChange: function (event) { _this.handleChange(event, 'hours'); }, onBlur: function (event) { return _this.setState({ hours: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
296
+ React.createElement("input", { className: "duration-input ".concat(this.state.blink === 'hour' ? 'blink_me' : ''), type: 'text', id: 'hours', max: 99, min: 0, ref: this.hourRef, value: this.state.hours, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.minuteRef.current); }, onChange: function (event) { _this.handleChange(event, 'hours'); }, onBlur: function (event) { return _this.setState({ hours: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
265
297
  if (!/[0-9]/.test(event.key)) {
266
298
  event.preventDefault();
267
299
  }
268
300
  } }),
269
301
  React.createElement("span", { className: 'sd-input__suffix' }, "h"),
270
- React.createElement("input", { className: 'duration-input', type: 'text', id: 'minutes', ref: this.minuteRef, value: this.state.minutes, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.secondRef.current); }, onChange: function (event) { _this.handleChange(event, 'minutes'); }, onBlur: function (event) { return _this.setState({ minutes: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
302
+ React.createElement("input", { className: "duration-input ".concat(this.state.blink === 'minute' ? 'blink_me' : ''), type: 'text', id: 'minutes', ref: this.minuteRef, value: this.state.minutes, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.secondRef.current); }, onChange: function (event) { _this.handleChange(event, 'minutes'); }, onBlur: function (event) { return _this.setState({ minutes: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
271
303
  if (!/[0-9]/.test(event.key)) {
272
304
  event.preventDefault();
273
305
  }
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ import { DropResult } from "react-beautiful-dnd";
3
+ import { IMenuItem, ISubmenu, IMenuGroup } from '../Dropdown';
4
+ export interface IProps {
5
+ children?: React.ReactNode;
6
+ array: Array<IPropsArrayItem>;
7
+ addItem?: boolean;
8
+ dragAndDrop?: boolean;
9
+ itemsDropdown?: Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
10
+ className?: string;
11
+ onDrag?(start: number, end: number): void;
12
+ }
13
+ export interface IPropsArrayItem {
14
+ start?: React.ReactNode;
15
+ center?: React.ReactNode;
16
+ end?: React.ReactNode;
17
+ action?: React.ReactNode;
18
+ onClick?(): void;
19
+ }
20
+ declare class TableList extends React.PureComponent<IProps, {
21
+ items: Array<IPropsArrayItem>;
22
+ }> {
23
+ constructor(props: Readonly<IProps>);
24
+ componentDidMount(): void;
25
+ componentDidUpdate(prevProps: Readonly<IProps>): void;
26
+ onDragEnd(result: DropResult): void | null;
27
+ render(): false | "" | 0 | JSX.Element | null | undefined;
28
+ }
29
+ export interface IPropsItem {
30
+ start?: React.ReactNode;
31
+ center?: React.ReactNode;
32
+ end?: React.ReactNode;
33
+ action?: React.ReactNode;
34
+ addItem?: boolean;
35
+ itemsDropdown?: any;
36
+ dragAndDrop?: boolean;
37
+ onClick?(): void;
38
+ }
39
+ declare class TableListItem extends React.PureComponent<IPropsItem> {
40
+ render(): JSX.Element;
41
+ }
42
+ export { TableList, TableListItem };