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

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.
@@ -928,6 +928,8 @@
928
928
  text-align: end;
929
929
  width: 2.5ch;
930
930
  font-size: 1.4rem;
931
+ padding: 0 !important;
932
+ line-height: 3.2rem;
931
933
  &::-webkit-outer-spin-button,
932
934
  &::-webkit-inner-spin-button {
933
935
  -webkit-appearance: none;
@@ -324,5 +324,19 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
324
324
  }
325
325
 
326
326
  export function getDurationString(seconds: number) {
327
- return moment.utc(seconds * 1000).format("HH:mm:ss");
327
+ function zeroPad(value: number | string) {
328
+ if (value.toString().length === 1 || value === 0) {
329
+ return `0${value}`;
330
+ } else if (!value) {
331
+ return '00';
332
+ } else {
333
+ return value;
334
+ }
335
+ }
336
+
337
+ let hour = zeroPad(Math.floor(seconds / 3600));
338
+ let minute = zeroPad(Math.floor((seconds % 3600) / 60));
339
+ let second = zeroPad(Math.floor(seconds % 60));
340
+
341
+ return `${hour}h ${minute}m ${second}s`;
328
342
  }
@@ -88,7 +88,7 @@ export class Input extends React.Component<IProps, IState> {
88
88
  required={this.props.required}
89
89
  disabled={this.props.disabled}
90
90
  value={this.state.value}
91
- invalid={this.state.invalid}
91
+ invalid={this.props.invalid}
92
92
  info={this.props.info}
93
93
  maxLength={this.props.maxLength}
94
94
  inlineLabel={this.props.inlineLabel}
@@ -18,6 +18,7 @@ export { IconButton } from './components/IconButton';
18
18
  export { IconLabel } from './components/IconLabel';
19
19
  export { Tooltip } from './components/Tooltip';
20
20
  export { DurationInput } from './components/DurationInput';
21
+ export { getDurationString } from './components/DurationInput';
21
22
  export { DatePicker } from './components/DatePicker';
22
23
  export { DatePickerISO } from './components/DatePicker';
23
24
  export { DatePickerLocaleSettings } from './components/DatePicker';