superdesk-ui-framework 3.0.1-beta.4 → 3.0.1-beta.5
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/app-typescript/components/DurationInput.tsx +83 -61
- package/app-typescript/components/Form/InputNew.tsx +3 -1
- package/dist/examples.bundle.js +129 -109
- package/dist/superdesk-ui.bundle.js +117 -97
- package/package.json +1 -1
- package/patches/@superdesk+primereact+5.0.2-4.patch +10 -1
- package/react/components/DurationInput.d.ts +5 -2
- package/react/components/DurationInput.js +74 -56
- package/react/components/Form/InputNew.js +3 -1
@@ -6014,8 +6014,8 @@ var SearchBar_1 = __webpack_require__(418);
|
|
6014
6014
|
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return SearchBar_1.SearchBar; } });
|
6015
6015
|
var WithSizeObserver_1 = __webpack_require__(250);
|
6016
6016
|
Object.defineProperty(exports, "WithSizeObserver", { enumerable: true, get: function () { return WithSizeObserver_1.WithSizeObserver; } });
|
6017
|
-
__exportStar(__webpack_require__(15), exports);
|
6018
6017
|
__exportStar(__webpack_require__(16), exports);
|
6018
|
+
__exportStar(__webpack_require__(15), exports);
|
6019
6019
|
__exportStar(__webpack_require__(72), exports);
|
6020
6020
|
__exportStar(__webpack_require__(239), exports);
|
6021
6021
|
var Skeleton_1 = __webpack_require__(240);
|
@@ -7407,6 +7407,32 @@ function toDate(argument) {
|
|
7407
7407
|
|
7408
7408
|
"use strict";
|
7409
7409
|
|
7410
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7411
|
+
exports.InputNew = exports.InputBase = exports.InputWrapper = exports.FormLabel = exports.FormText = exports.FormItem = exports.FormGroup = exports.FormRow = void 0;
|
7412
|
+
var FormRow_1 = __webpack_require__(263);
|
7413
|
+
Object.defineProperty(exports, "FormRow", { enumerable: true, get: function () { return FormRow_1.FormRow; } });
|
7414
|
+
var FormGroup_1 = __webpack_require__(264);
|
7415
|
+
Object.defineProperty(exports, "FormGroup", { enumerable: true, get: function () { return FormGroup_1.FormGroup; } });
|
7416
|
+
var FormItem_1 = __webpack_require__(265);
|
7417
|
+
Object.defineProperty(exports, "FormItem", { enumerable: true, get: function () { return FormItem_1.FormItem; } });
|
7418
|
+
var FormText_1 = __webpack_require__(266);
|
7419
|
+
Object.defineProperty(exports, "FormText", { enumerable: true, get: function () { return FormText_1.FormText; } });
|
7420
|
+
var FormLabel_1 = __webpack_require__(51);
|
7421
|
+
Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return FormLabel_1.FormLabel; } });
|
7422
|
+
var InputWrapper_1 = __webpack_require__(267);
|
7423
|
+
Object.defineProperty(exports, "InputWrapper", { enumerable: true, get: function () { return InputWrapper_1.InputWrapper; } });
|
7424
|
+
var InputBase_1 = __webpack_require__(268);
|
7425
|
+
Object.defineProperty(exports, "InputBase", { enumerable: true, get: function () { return InputBase_1.InputBase; } });
|
7426
|
+
var InputNew_1 = __webpack_require__(269);
|
7427
|
+
Object.defineProperty(exports, "InputNew", { enumerable: true, get: function () { return InputNew_1.InputNew; } });
|
7428
|
+
|
7429
|
+
|
7430
|
+
/***/ }),
|
7431
|
+
/* 16 */
|
7432
|
+
/***/ (function(module, exports, __webpack_require__) {
|
7433
|
+
|
7434
|
+
"use strict";
|
7435
|
+
|
7410
7436
|
Object.defineProperty(exports, "__esModule", { value: true });
|
7411
7437
|
exports.NotificationPanel = exports.MainMenu = exports.BottomBarAction = exports.HamburgerButton = exports.CoreLayoutOverlay = exports.CoreLayoutFooter = exports.CoreLayoutSlideInMenu = exports.CoreLayoutMain = exports.CoreLayoutTopMenu = exports.CoreLayoutContainer = exports.CoreLayout = exports.AuthorinInnerSideBar = exports.AuthoringInnerBody = exports.AuthoringInnerHeader = exports.AuthoringMainContent = exports.AuthoringMainToolBar = exports.AuthoringMainContainer = exports.AuthoringMain = exports.AuthoringFrame = exports.AuthoringFrameOverlay = exports.AuthoringFrameSidePanelOverlay = exports.AuthoringFrameSidePanel = exports.AuthoringFrameRightBar = exports.AuthoringFrameLeftBar = exports.AuthoringFrameNavBar = exports.AuthoringFrameMain = exports.AuthoringFrameContainer = exports.Container = exports.PageLayout = exports.ContentSplitter = exports.AuthoringContainer = exports.OverlayPanel = exports.RightPanel = exports.LeftPanel = exports.IMainPanelProps = exports.MainPanel = exports.HeaderPanel = exports.LayoutContainer = exports.Layout = exports.PanelHeaderSlidingToolbar = exports.PanelFooter = exports.PanelContentBlock = exports.PanelContent = exports.PanelHeader = exports.Panel = void 0;
|
7412
7438
|
var Panel_1 = __webpack_require__(238);
|
@@ -7495,32 +7521,6 @@ var NotificationPanel_1 = __webpack_require__(456);
|
|
7495
7521
|
Object.defineProperty(exports, "NotificationPanel", { enumerable: true, get: function () { return NotificationPanel_1.NotificationPanel; } });
|
7496
7522
|
|
7497
7523
|
|
7498
|
-
/***/ }),
|
7499
|
-
/* 16 */
|
7500
|
-
/***/ (function(module, exports, __webpack_require__) {
|
7501
|
-
|
7502
|
-
"use strict";
|
7503
|
-
|
7504
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
7505
|
-
exports.InputNew = exports.InputBase = exports.InputWrapper = exports.FormLabel = exports.FormText = exports.FormItem = exports.FormGroup = exports.FormRow = void 0;
|
7506
|
-
var FormRow_1 = __webpack_require__(263);
|
7507
|
-
Object.defineProperty(exports, "FormRow", { enumerable: true, get: function () { return FormRow_1.FormRow; } });
|
7508
|
-
var FormGroup_1 = __webpack_require__(264);
|
7509
|
-
Object.defineProperty(exports, "FormGroup", { enumerable: true, get: function () { return FormGroup_1.FormGroup; } });
|
7510
|
-
var FormItem_1 = __webpack_require__(265);
|
7511
|
-
Object.defineProperty(exports, "FormItem", { enumerable: true, get: function () { return FormItem_1.FormItem; } });
|
7512
|
-
var FormText_1 = __webpack_require__(266);
|
7513
|
-
Object.defineProperty(exports, "FormText", { enumerable: true, get: function () { return FormText_1.FormText; } });
|
7514
|
-
var FormLabel_1 = __webpack_require__(51);
|
7515
|
-
Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return FormLabel_1.FormLabel; } });
|
7516
|
-
var InputWrapper_1 = __webpack_require__(267);
|
7517
|
-
Object.defineProperty(exports, "InputWrapper", { enumerable: true, get: function () { return InputWrapper_1.InputWrapper; } });
|
7518
|
-
var InputBase_1 = __webpack_require__(268);
|
7519
|
-
Object.defineProperty(exports, "InputBase", { enumerable: true, get: function () { return InputBase_1.InputBase; } });
|
7520
|
-
var InputNew_1 = __webpack_require__(269);
|
7521
|
-
Object.defineProperty(exports, "InputNew", { enumerable: true, get: function () { return InputNew_1.InputNew; } });
|
7522
|
-
|
7523
|
-
|
7524
7524
|
/***/ }),
|
7525
7525
|
/* 17 */
|
7526
7526
|
/***/ (function(module, exports, __webpack_require__) {
|
@@ -38537,7 +38537,7 @@ var calendar_1 = __webpack_require__(316);
|
|
38537
38537
|
var lodash_1 = __webpack_require__(33);
|
38538
38538
|
// import classNames from 'classnames';
|
38539
38539
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
38540
|
-
var Form_1 = __webpack_require__(
|
38540
|
+
var Form_1 = __webpack_require__(15);
|
38541
38541
|
var internalPrimereactClassnames = {
|
38542
38542
|
overlayVisible: 'p-input-overlay-visible',
|
38543
38543
|
};
|
@@ -40338,59 +40338,74 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40338
40338
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
40339
40339
|
};
|
40340
40340
|
Object.defineProperty(exports, "__esModule", { value: true });
|
40341
|
-
exports.DurationInput = void 0;
|
40341
|
+
exports.getDurationString = exports.DurationInput = void 0;
|
40342
40342
|
var React = __importStar(__webpack_require__(0));
|
40343
40343
|
var classnames_1 = __importDefault(__webpack_require__(2));
|
40344
40344
|
var moment_1 = __importDefault(__webpack_require__(1));
|
40345
40345
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
40346
|
+
var Form_1 = __webpack_require__(15);
|
40346
40347
|
var DurationInput = /** @class */ (function (_super) {
|
40347
40348
|
__extends(DurationInput, _super);
|
40348
40349
|
function DurationInput(props) {
|
40349
|
-
var _a;
|
40350
40350
|
var _this = _super.call(this, props) || this;
|
40351
|
+
_this.htmlId = (0, react_id_generator_1.default)();
|
40351
40352
|
_this.state = {
|
40352
|
-
hours: _this.props.hours
|
40353
|
-
minutes: _this.
|
40354
|
-
seconds: _this.
|
40355
|
-
invalid: (_a = _this.props.invalid) !== null && _a !== void 0 ? _a : false,
|
40353
|
+
hours: _this.stateUpdate('hours', _this.props.hours, _this.props.minutes, _this.props.seconds),
|
40354
|
+
minutes: _this.stateUpdate('minutes', _this.props.minutes, _this.props.seconds),
|
40355
|
+
seconds: _this.stateUpdate('seconds', _this.props.seconds),
|
40356
40356
|
};
|
40357
40357
|
_this.hourRef = React.createRef();
|
40358
40358
|
_this.minuteRef = React.createRef();
|
40359
40359
|
_this.secondRef = React.createRef();
|
40360
40360
|
_this.handleKeyDown = _this.handleKeyDown.bind(_this);
|
40361
|
-
_this.
|
40361
|
+
_this.zeroPad = _this.zeroPad.bind(_this);
|
40362
40362
|
_this.handleChange = _this.handleChange.bind(_this);
|
40363
40363
|
_this.handleFocusOnKeyUp = _this.handleFocusOnKeyUp.bind(_this);
|
40364
40364
|
_this.handleKeyValue = _this.handleKeyValue.bind(_this);
|
40365
|
+
_this.valueUpdate = _this.valueUpdate.bind(_this);
|
40366
|
+
_this.stateUpdate = _this.stateUpdate.bind(_this);
|
40365
40367
|
return _this;
|
40366
40368
|
}
|
40367
|
-
DurationInput.prototype.
|
40368
|
-
|
40369
|
-
|
40370
|
-
|
40369
|
+
DurationInput.prototype.stateUpdate = function (state, parametar1, parametar2, parametar3) {
|
40370
|
+
var value;
|
40371
|
+
if (state === 'hours') {
|
40372
|
+
value = parametar1
|
40373
|
+
? parametar1 + Math.floor((parametar2 || 0) / 60) + Math.floor((parametar3 || 0) / 3600)
|
40374
|
+
: Math.floor((parametar2 || 0) / 60) + Math.floor((parametar3 || 0) / 3600);
|
40375
|
+
}
|
40376
|
+
else if (state === 'minutes') {
|
40377
|
+
value = parametar1
|
40378
|
+
? (parametar1 % 60) + Math.floor((parametar2 || 0) % 3600 / 60)
|
40379
|
+
: Math.floor((parametar2 || 0) % 3600 / 60);
|
40380
|
+
}
|
40381
|
+
else {
|
40382
|
+
value = parametar1 ? parametar1 % 60 : 0;
|
40371
40383
|
}
|
40384
|
+
return this.zeroPad(value);
|
40385
|
+
};
|
40386
|
+
DurationInput.prototype.componentDidUpdate = function (_, prevState) {
|
40372
40387
|
if (!this.hourRef.current || !this.minuteRef.current || !this.secondRef.current) {
|
40373
40388
|
return;
|
40374
40389
|
}
|
40375
40390
|
if (this.state.hours !== prevState.hours) {
|
40376
40391
|
if (Number(this.hourRef.current.value) > 99) {
|
40377
40392
|
this.setState({
|
40378
|
-
hours: this.
|
40393
|
+
hours: this.zeroPad(99),
|
40379
40394
|
});
|
40380
40395
|
}
|
40381
40396
|
}
|
40382
40397
|
if (this.state.minutes !== prevState.minutes) {
|
40383
40398
|
if (Number(this.minuteRef.current.value) > 59) {
|
40384
40399
|
this.setState({
|
40385
|
-
hours: this.
|
40386
|
-
minutes: this.
|
40400
|
+
hours: this.zeroPad(Number(this.state.hours) + 1),
|
40401
|
+
minutes: this.zeroPad(this.state.minutes % 60),
|
40387
40402
|
});
|
40388
40403
|
}
|
40389
40404
|
if (Number(this.minuteRef.current.value) < 0) {
|
40390
40405
|
this.setState({
|
40391
|
-
hours: this.
|
40392
|
-
? this.
|
40393
|
-
: this.
|
40406
|
+
hours: this.zeroPad(Number(this.state.hours)) > 0
|
40407
|
+
? this.zeroPad(Number(this.state.hours) - 1)
|
40408
|
+
: this.zeroPad(Number(this.state.hours)),
|
40394
40409
|
minutes: 59,
|
40395
40410
|
});
|
40396
40411
|
}
|
@@ -40398,18 +40413,24 @@ var DurationInput = /** @class */ (function (_super) {
|
|
40398
40413
|
if (this.state.seconds !== prevState.seconds) {
|
40399
40414
|
if (Number(this.secondRef.current.value) > 59) {
|
40400
40415
|
this.setState({
|
40401
|
-
minutes: this.
|
40402
|
-
seconds: this.
|
40416
|
+
minutes: this.zeroPad(Number(this.state.minutes) + 1),
|
40417
|
+
seconds: this.zeroPad(this.state.seconds % 60),
|
40403
40418
|
});
|
40404
40419
|
}
|
40405
40420
|
if (Number(this.secondRef.current.value) < 0) {
|
40406
40421
|
this.setState({
|
40407
|
-
minutes: this.
|
40422
|
+
minutes: this.zeroPad(Number(this.state.minutes) - 1),
|
40408
40423
|
seconds: 59,
|
40409
40424
|
});
|
40410
40425
|
}
|
40411
40426
|
}
|
40412
40427
|
};
|
40428
|
+
DurationInput.prototype.valueUpdate = function () {
|
40429
|
+
if (this.props.onChange) {
|
40430
|
+
this.props.onChange(moment_1.default.duration("".concat(this.state.hours, ":").concat(this.state.minutes, ":").concat(this.state.seconds))
|
40431
|
+
.asSeconds());
|
40432
|
+
}
|
40433
|
+
};
|
40413
40434
|
DurationInput.prototype.handleKeyDown = function (event) {
|
40414
40435
|
if (!(event.target instanceof HTMLInputElement)) {
|
40415
40436
|
return;
|
@@ -40452,6 +40473,12 @@ var DurationInput = /** @class */ (function (_super) {
|
|
40452
40473
|
}
|
40453
40474
|
if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
|
40454
40475
|
this.handleKeyValue(event, event.target.id);
|
40476
|
+
setTimeout(this.valueUpdate);
|
40477
|
+
}
|
40478
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
|
40479
|
+
if (!this.state.hours || !this.state.minutes || !this.state.seconds) {
|
40480
|
+
setTimeout(this.valueUpdate);
|
40481
|
+
}
|
40455
40482
|
}
|
40456
40483
|
};
|
40457
40484
|
DurationInput.prototype.handleKeyValue = function (event, state) {
|
@@ -40467,24 +40494,26 @@ var DurationInput = /** @class */ (function (_super) {
|
|
40467
40494
|
if (event.key === 'ArrowUp') {
|
40468
40495
|
if (event.target.id === 'hours') {
|
40469
40496
|
stateClone[state] = this.state[state] < 99
|
40470
|
-
? this.
|
40471
|
-
: this.
|
40497
|
+
? this.zeroPad(Number(this.state[state]) + 1)
|
40498
|
+
: this.zeroPad(99);
|
40472
40499
|
}
|
40473
40500
|
else {
|
40474
|
-
stateClone[state] = this.
|
40501
|
+
stateClone[state] = this.zeroPad(Number(this.state[state]) + 1);
|
40475
40502
|
}
|
40476
40503
|
}
|
40477
40504
|
else if (event.key === 'ArrowDown') {
|
40478
40505
|
if (event.target.id === 'hours') {
|
40479
|
-
stateClone[state] = this.state[state] > 0
|
40506
|
+
stateClone[state] = this.state[state] > 0
|
40507
|
+
? this.zeroPad(Number(this.state[state]) - 1)
|
40508
|
+
: this.zeroPad(0);
|
40480
40509
|
}
|
40481
40510
|
else {
|
40482
|
-
stateClone[state] = this.
|
40511
|
+
stateClone[state] = this.zeroPad(Number(this.state[state]) - 1);
|
40483
40512
|
}
|
40484
40513
|
}
|
40485
40514
|
this.setState(stateClone);
|
40486
40515
|
};
|
40487
|
-
DurationInput.prototype.
|
40516
|
+
DurationInput.prototype.zeroPad = function (value) {
|
40488
40517
|
if (value.toString().length === 1 || value === 0) {
|
40489
40518
|
return "0".concat(value);
|
40490
40519
|
}
|
@@ -40504,6 +40533,7 @@ var DurationInput = /** @class */ (function (_super) {
|
|
40504
40533
|
stateClone[state] = event.target.value;
|
40505
40534
|
}
|
40506
40535
|
this.setState(stateClone);
|
40536
|
+
setTimeout(this.valueUpdate);
|
40507
40537
|
};
|
40508
40538
|
DurationInput.prototype.handleFocus = function (ref, state) {
|
40509
40539
|
ref === null || ref === void 0 ? void 0 : ref.focus();
|
@@ -40511,65 +40541,53 @@ var DurationInput = /** @class */ (function (_super) {
|
|
40511
40541
|
ref === null || ref === void 0 ? void 0 : ref.setSelectionRange(0, 2);
|
40512
40542
|
});
|
40513
40543
|
var stateClone = {};
|
40514
|
-
stateClone[state] = this.
|
40544
|
+
stateClone[state] = this.zeroPad(this.state[state]);
|
40515
40545
|
this.setState(stateClone);
|
40516
40546
|
};
|
40517
40547
|
DurationInput.prototype.handleFocusOnKeyUp = function (event, ref) {
|
40518
40548
|
if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft' && event.key !== 'ArrowUp' && event.key !== 'ArrowDown' && event.key !== 'Backspace') {
|
40519
|
-
|
40520
|
-
|
40521
|
-
|
40522
|
-
|
40523
|
-
|
40524
|
-
|
40549
|
+
if ((event.keyCode > 46 && event.keyCode < 58) || (event.keyCode > 95 && event.keyCode < 106)) {
|
40550
|
+
var target = event.target;
|
40551
|
+
if (target.value.length >= 2) {
|
40552
|
+
ref === null || ref === void 0 ? void 0 : ref.focus();
|
40553
|
+
setTimeout(function () {
|
40554
|
+
ref === null || ref === void 0 ? void 0 : ref.setSelectionRange(0, 2);
|
40555
|
+
});
|
40556
|
+
}
|
40525
40557
|
}
|
40526
40558
|
}
|
40527
40559
|
};
|
40528
40560
|
DurationInput.prototype.render = function () {
|
40529
40561
|
var _this = this;
|
40530
40562
|
var InputClasses = (0, classnames_1.default)('sd-input__duration-input');
|
40531
|
-
|
40532
|
-
'sd-input--inline-label': this.props.inlineLabel,
|
40533
|
-
'sd-input--required': this.props.required,
|
40534
|
-
'sd-input--disabled': this.props.disabled,
|
40535
|
-
'sd-input--full-width': this.props.fullWidth,
|
40536
|
-
'sd-input--invalid': this.props.invalid || this.state.invalid,
|
40537
|
-
});
|
40538
|
-
var labelClasses = (0, classnames_1.default)('sd-input__label', {
|
40539
|
-
'a11y-only': this.props.labelHidden,
|
40540
|
-
});
|
40541
|
-
var htmlId = (0, react_id_generator_1.default)();
|
40542
|
-
return (React.createElement("div", { className: classes },
|
40543
|
-
React.createElement("label", { className: labelClasses, htmlFor: htmlId, id: htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
|
40563
|
+
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 },
|
40544
40564
|
React.createElement("div", { className: InputClasses },
|
40545
|
-
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.
|
40565
|
+
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) {
|
40546
40566
|
if (!/[0-9]/.test(event.key)) {
|
40547
40567
|
event.preventDefault();
|
40548
40568
|
}
|
40549
40569
|
} }),
|
40550
40570
|
React.createElement("span", { className: 'sd-input__suffix' }, "h"),
|
40551
|
-
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.
|
40571
|
+
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) {
|
40552
40572
|
if (!/[0-9]/.test(event.key)) {
|
40553
40573
|
event.preventDefault();
|
40554
40574
|
}
|
40555
40575
|
} }),
|
40556
40576
|
React.createElement("span", { className: 'sd-input__suffix' }, "m"),
|
40557
|
-
React.createElement("input", { className: 'duration-input', type: 'text', id: 'seconds', ref: this.secondRef, value: this.state.seconds, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.hourRef.current); }, onChange: function (event) { _this.handleChange(event, 'seconds'); }, onBlur: function (event) { return _this.setState({ seconds: _this.
|
40577
|
+
React.createElement("input", { className: 'duration-input', type: 'text', id: 'seconds', ref: this.secondRef, value: this.state.seconds, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.hourRef.current); }, onChange: function (event) { _this.handleChange(event, 'seconds'); }, onBlur: function (event) { return _this.setState({ seconds: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
|
40558
40578
|
if (!/[0-9]/.test(event.key)) {
|
40559
40579
|
event.preventDefault();
|
40560
40580
|
}
|
40561
40581
|
} }),
|
40562
|
-
React.createElement("span", { className: 'sd-input__suffix' }, "s"))
|
40563
|
-
React.createElement("div", { className: 'sd-input__message-box' },
|
40564
|
-
this.props.info && !this.props.invalid && !this.state.invalid ?
|
40565
|
-
React.createElement("div", { className: 'sd-input__hint' }, this.props.info) : null,
|
40566
|
-
this.props.invalid || this.state.invalid ?
|
40567
|
-
React.createElement("div", { className: 'sd-input__message' }, this.props.error)
|
40568
|
-
: null)));
|
40582
|
+
React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
|
40569
40583
|
};
|
40570
40584
|
return DurationInput;
|
40571
40585
|
}(React.PureComponent));
|
40572
40586
|
exports.DurationInput = DurationInput;
|
40587
|
+
function getDurationString(seconds) {
|
40588
|
+
return moment_1.default.utc(seconds * 1000).format("HH:mm:ss");
|
40589
|
+
}
|
40590
|
+
exports.getDurationString = getDurationString;
|
40573
40591
|
|
40574
40592
|
|
40575
40593
|
/***/ }),
|
@@ -60954,7 +60972,7 @@ exports.TimePicker = void 0;
|
|
60954
60972
|
var React = __importStar(__webpack_require__(0));
|
60955
60973
|
// import classNames from 'classnames';
|
60956
60974
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
60957
|
-
var Form_1 = __webpack_require__(
|
60975
|
+
var Form_1 = __webpack_require__(15);
|
60958
60976
|
var TimePicker = /** @class */ (function (_super) {
|
60959
60977
|
__extends(TimePicker, _super);
|
60960
60978
|
function TimePicker(props) {
|
@@ -63104,7 +63122,7 @@ exports.Input = void 0;
|
|
63104
63122
|
var React = __importStar(__webpack_require__(0));
|
63105
63123
|
// import classNames from 'classnames';
|
63106
63124
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
63107
|
-
var Form_1 = __webpack_require__(
|
63125
|
+
var Form_1 = __webpack_require__(15);
|
63108
63126
|
var Input = /** @class */ (function (_super) {
|
63109
63127
|
__extends(Input, _super);
|
63110
63128
|
function Input(props) {
|
@@ -63629,7 +63647,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
63629
63647
|
exports.InputNew = void 0;
|
63630
63648
|
var React = __importStar(__webpack_require__(0));
|
63631
63649
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
63632
|
-
var _1 = __webpack_require__(
|
63650
|
+
var _1 = __webpack_require__(15);
|
63633
63651
|
var InputNew = /** @class */ (function (_super) {
|
63634
63652
|
__extends(InputNew, _super);
|
63635
63653
|
function InputNew(props) {
|
@@ -63653,7 +63671,9 @@ var InputNew = /** @class */ (function (_super) {
|
|
63653
63671
|
return (React.createElement(_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, value: this.state.value, invalid: this.state.invalid, info: this.props.info, maxLength: this.props.maxLength, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, size: (_a = this.props.size) !== null && _a !== void 0 ? _a : 'medium', fullWidth: this.props.fullWidth, htmlId: this.htmlId, boxedStyle: this.props.boxedStyle, boxedLable: this.props.boxedLable, tabindex: this.props.tabindex },
|
63654
63672
|
React.createElement(_1.InputBase, { type: "text", onChange: function (value) {
|
63655
63673
|
_this.setState({ value: value });
|
63656
|
-
_this.setState({ invalid: _this.props.maxLength
|
63674
|
+
_this.setState({ invalid: _this.props.maxLength
|
63675
|
+
? value.length > _this.props.maxLength
|
63676
|
+
: false });
|
63657
63677
|
_this.props.onChange(value);
|
63658
63678
|
}, disabled: this.props.disabled, htmlId: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, placeholder: this.props.placeholder })));
|
63659
63679
|
};
|
@@ -63710,7 +63730,7 @@ exports.Option = exports.Select = void 0;
|
|
63710
63730
|
var React = __importStar(__webpack_require__(0));
|
63711
63731
|
// import classNames from 'classnames';
|
63712
63732
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
63713
|
-
var Form_1 = __webpack_require__(
|
63733
|
+
var Form_1 = __webpack_require__(15);
|
63714
63734
|
var Select = /** @class */ (function (_super) {
|
63715
63735
|
__extends(Select, _super);
|
63716
63736
|
function Select(props) {
|
@@ -63797,7 +63817,7 @@ var React = __importStar(__webpack_require__(0));
|
|
63797
63817
|
var dropdown_1 = __webpack_require__(272);
|
63798
63818
|
// import classNames from 'classnames';
|
63799
63819
|
var react_id_generator_1 = __importDefault(__webpack_require__(8));
|
63800
|
-
var Form_1 = __webpack_require__(
|
63820
|
+
var Form_1 = __webpack_require__(15);
|
63801
63821
|
var labelKey = 'label';
|
63802
63822
|
var SelectWithTemplate = /** @class */ (function (_super) {
|
63803
63823
|
__extends(SelectWithTemplate, _super);
|
@@ -94844,7 +94864,7 @@ var Dialog = /*#__PURE__*/function (_Component) {
|
|
94844
94864
|
this.setState({
|
94845
94865
|
maskVisible: true
|
94846
94866
|
}, function () {
|
94847
|
-
_this5.mask.style.zIndex = String(
|
94867
|
+
_this5.mask.style.zIndex = String(this.zIndex);
|
94848
94868
|
});
|
94849
94869
|
}
|
94850
94870
|
|
@@ -98491,7 +98511,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
98491
98511
|
exports.PageLayout = void 0;
|
98492
98512
|
// External Modules
|
98493
98513
|
var React = __importStar(__webpack_require__(0));
|
98494
|
-
var Layouts_1 = __webpack_require__(
|
98514
|
+
var Layouts_1 = __webpack_require__(16);
|
98495
98515
|
var PageLayout = /** @class */ (function (_super) {
|
98496
98516
|
__extends(PageLayout, _super);
|
98497
98517
|
function PageLayout() {
|
@@ -99088,7 +99108,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
99088
99108
|
exports.AuthoringFrame = void 0;
|
99089
99109
|
// External Modules
|
99090
99110
|
var React = __importStar(__webpack_require__(0));
|
99091
|
-
var _1 = __webpack_require__(
|
99111
|
+
var _1 = __webpack_require__(16);
|
99092
99112
|
var AuthoringFrame = /** @class */ (function (_super) {
|
99093
99113
|
__extends(AuthoringFrame, _super);
|
99094
99114
|
function AuthoringFrame() {
|
@@ -99152,7 +99172,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
99152
99172
|
Object.defineProperty(exports, "__esModule", { value: true });
|
99153
99173
|
exports.AuthoringMain = void 0;
|
99154
99174
|
var React = __importStar(__webpack_require__(0));
|
99155
|
-
var _1 = __webpack_require__(
|
99175
|
+
var _1 = __webpack_require__(16);
|
99156
99176
|
var AuthoringMain = /** @class */ (function (_super) {
|
99157
99177
|
__extends(AuthoringMain, _super);
|
99158
99178
|
function AuthoringMain() {
|
@@ -99576,7 +99596,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
99576
99596
|
Object.defineProperty(exports, "__esModule", { value: true });
|
99577
99597
|
exports.CoreLayout = void 0;
|
99578
99598
|
var React = __importStar(__webpack_require__(0));
|
99579
|
-
var _1 = __webpack_require__(
|
99599
|
+
var _1 = __webpack_require__(16);
|
99580
99600
|
var CoreLayout = /** @class */ (function (_super) {
|
99581
99601
|
__extends(CoreLayout, _super);
|
99582
99602
|
function CoreLayout() {
|
@@ -99694,8 +99714,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
99694
99714
|
Object.defineProperty(exports, "__esModule", { value: true });
|
99695
99715
|
exports.CoreLayoutTopMenu = void 0;
|
99696
99716
|
var React = __importStar(__webpack_require__(0));
|
99697
|
-
var _1 = __webpack_require__(
|
99698
|
-
var _2 = __webpack_require__(
|
99717
|
+
var _1 = __webpack_require__(16);
|
99718
|
+
var _2 = __webpack_require__(16);
|
99699
99719
|
var CoreLayoutTopMenu = /** @class */ (function (_super) {
|
99700
99720
|
__extends(CoreLayoutTopMenu, _super);
|
99701
99721
|
function CoreLayoutTopMenu() {
|
package/package.json
CHANGED
@@ -12,7 +12,7 @@ index 80b0f8e..5343abf 100644
|
|
12
12
|
blockScroll?: boolean;
|
13
13
|
ariaCloseIconLabel?: string;
|
14
14
|
diff --git a/node_modules/@superdesk/primereact/components/dialog/Dialog.js b/node_modules/@superdesk/primereact/components/dialog/Dialog.js
|
15
|
-
index 2e243f2..
|
15
|
+
index 2e243f2..e7ce643 100644
|
16
16
|
--- a/node_modules/@superdesk/primereact/components/dialog/Dialog.js
|
17
17
|
+++ b/node_modules/@superdesk/primereact/components/dialog/Dialog.js
|
18
18
|
@@ -148,7 +148,7 @@ var Dialog = /*#__PURE__*/function (_Component) {
|
@@ -24,6 +24,15 @@ index 2e243f2..c40162e 100644
|
|
24
24
|
}
|
25
25
|
}, {
|
26
26
|
key: "maximized",
|
27
|
+
@@ -301,7 +301,7 @@ var Dialog = /*#__PURE__*/function (_Component) {
|
28
|
+
this.setState({
|
29
|
+
maskVisible: true
|
30
|
+
}, function () {
|
31
|
+
- _this5.mask.style.zIndex = String(_this5.zIndex);
|
32
|
+
+ _this5.mask.style.zIndex = String(this.zIndex);
|
33
|
+
});
|
34
|
+
}
|
35
|
+
|
27
36
|
@@ -501,7 +501,7 @@ _defineProperty(Dialog, "defaultProps", {
|
28
37
|
maskClassName: null,
|
29
38
|
showHeader: true,
|
@@ -19,20 +19,23 @@ interface IState {
|
|
19
19
|
hours?: any;
|
20
20
|
minutes?: any;
|
21
21
|
seconds?: any;
|
22
|
-
invalid?: any;
|
23
22
|
}
|
24
23
|
export declare class DurationInput extends React.PureComponent<IProps, IState> {
|
25
24
|
hourRef: React.RefObject<HTMLInputElement>;
|
26
25
|
minuteRef: React.RefObject<HTMLInputElement>;
|
27
26
|
secondRef: React.RefObject<HTMLInputElement>;
|
27
|
+
private htmlId;
|
28
28
|
constructor(props: IProps);
|
29
|
+
stateUpdate(state: string, parametar1?: number, parametar2?: number, parametar3?: number): string | number;
|
29
30
|
componentDidUpdate(_: any, prevState: IState): void;
|
31
|
+
valueUpdate(): void;
|
30
32
|
handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;
|
31
33
|
handleKeyValue(event: React.KeyboardEvent<HTMLInputElement>, state: 'hours' | 'minutes' | 'seconds'): void;
|
32
|
-
|
34
|
+
zeroPad(value: number | string): string | number;
|
33
35
|
handleChange(event: React.ChangeEvent<HTMLInputElement>, state: 'hours' | 'minutes' | 'seconds'): void;
|
34
36
|
handleFocus(ref: HTMLInputElement | null, state: 'hours' | 'minutes' | 'seconds'): void;
|
35
37
|
handleFocusOnKeyUp(event: React.KeyboardEvent<HTMLInputElement>, ref: HTMLInputElement | null): void;
|
36
38
|
render(): JSX.Element;
|
37
39
|
}
|
40
|
+
export declare function getDurationString(seconds: number): string;
|
38
41
|
export {};
|