orc-shared 5.7.0-dev.14 → 5.7.0-dev.16
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/dist/actions/makeApiAction.js +2 -2
- package/dist/actions/makeOrcApiAction.js +2 -2
- package/dist/actions/metadata.js +2 -2
- package/dist/actions/navigation.js +2 -2
- package/dist/buildStore.js +2 -2
- package/dist/components/AppFrame/About.js +2 -2
- package/dist/components/AppFrame/Preferences.js +2 -3
- package/dist/components/Form/FieldList.js +5 -6
- package/dist/components/Form/Inputs/Text.js +0 -1
- package/dist/components/Form/Inputs/Translation.js +2 -2
- package/dist/components/List/enhanceColumnDefs.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Modal.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/Notification.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/NotificationProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/Translations.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/TableProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/TransferList.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/chipProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/collapsableListProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/dividerProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/modalProps.js +2 -2
- package/dist/components/MaterialUI/DataDisplay/useTableSelection.js +2 -2
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +2 -2
- package/dist/components/MaterialUI/Inputs/AutocompleteProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/Checkbox.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxGroup.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxGroupProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/CheckboxProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/DatePicker.js +2 -2
- package/dist/components/MaterialUI/Inputs/InputBase.js +8 -3
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/RadioProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/Select.js +2 -2
- package/dist/components/MaterialUI/Inputs/SelectProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/StandaloneRadio.js +2 -2
- package/dist/components/MaterialUI/Inputs/Switch.js +2 -2
- package/dist/components/MaterialUI/Inputs/SwitchProps.js +2 -2
- package/dist/components/MaterialUI/Inputs/createInput.js +2 -2
- package/dist/components/MaterialUI/Inputs/standaloneRadioProps.js +2 -2
- package/dist/components/MaterialUI/Navigation/DropDownMenuProps.js +2 -2
- package/dist/components/MaterialUI/ScopeSelector/TreeItem.js +2 -3
- package/dist/components/MaterialUI/Surfaces/expansionPanelProps.js +2 -2
- package/dist/components/MaterialUI/Surfaces/paperProps.js +2 -2
- package/dist/components/MaterialUI/componentProps.js +2 -2
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +1 -0
- package/dist/components/MaterialUI/muiThemes.js +2 -2
- package/dist/components/MaterialUI/textProps.js +2 -2
- package/dist/components/Navigation/Bar.js +2 -2
- package/dist/components/Navigation/index.js +1 -0
- package/dist/components/Navigation/useNavigationState.js +2 -2
- package/dist/components/Routing/SegmentPage.js +1 -1
- package/dist/components/Routing/withWaypointing.js +2 -2
- package/dist/components/Scope/index.js +2 -2
- package/dist/components/Treeview/Node.js +2 -2
- package/dist/components/Treeview/index.js +2 -2
- package/dist/getThemeOverrides.js +2 -2
- package/dist/hocs/withToggle.js +2 -2
- package/dist/hocs/withUpdateHandler.js +2 -2
- package/dist/hooks/useEditState.js +2 -2
- package/dist/hooks/useEntityLoader.js +2 -2
- package/dist/hooks/useFullEntityEditState.js +2 -2
- package/dist/hooks/useLabelMessage.js +2 -2
- package/dist/hooks/useMultipleFieldEditState.js +2 -2
- package/dist/hooks/useNotificationRequestState.js +2 -2
- package/dist/selectors/metadata.js +2 -2
- package/dist/selectors/modules.js +2 -2
- package/dist/utils/flatten.js +2 -2
- package/dist/utils/modelValidationHelper.js +2 -2
- package/dist/utils/stripKey.js +2 -2
- package/package.json +1 -1
- package/src/components/MaterialUI/Inputs/InputBase.js +8 -5
- package/src/components/MaterialUI/Inputs/InputBase.test.js +160 -110
- package/src/components/Routing/SegmentPage.js +1 -0
package/dist/utils/flatten.js
CHANGED
|
@@ -13,8 +13,8 @@ exports.flattenObj = exports.flatten = void 0;
|
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
18
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
19
19
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
20
20
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -14,8 +14,8 @@ var _lodash = require("lodash");
|
|
|
14
14
|
enterModule && enterModule(module);
|
|
15
15
|
})();
|
|
16
16
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(
|
|
18
|
-
function _toPrimitive(
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
19
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
20
20
|
return a;
|
|
21
21
|
};
|
package/dist/utils/stripKey.js
CHANGED
|
@@ -12,8 +12,8 @@ exports.default = void 0;
|
|
|
12
12
|
})();
|
|
13
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
-
function _toPropertyKey(
|
|
16
|
-
function _toPrimitive(
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
18
18
|
return a;
|
|
19
19
|
};
|
package/package.json
CHANGED
|
@@ -146,12 +146,15 @@ const InputBase = ({ inputProps }) => {
|
|
|
146
146
|
inputAttributes.min = -2147483648;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
const decimalScale = numericInputProps?.decimalScale ?? 0;
|
|
150
|
+
|
|
151
|
+
const lengthForMin = Math.trunc(inputAttributes.min).toString().length;
|
|
152
|
+
const lengthForMax = Math.trunc(inputAttributes.max).toString().length;
|
|
153
|
+
|
|
154
|
+
inputAttributes.maxLength = Math.max(lengthForMin, lengthForMax) + (decimalScale > 0 ? decimalScale + 1 : 0);
|
|
155
|
+
|
|
149
156
|
inputAttributes.isAllowed = val => {
|
|
150
|
-
return
|
|
151
|
-
val.value === "" ||
|
|
152
|
-
val.value === "-" ||
|
|
153
|
-
(val.floatValue >= inputAttributes.min && val.floatValue <= inputAttributes.max)
|
|
154
|
-
);
|
|
157
|
+
return val.value === "" || val.value === "-" || val.value !== null;
|
|
155
158
|
};
|
|
156
159
|
}
|
|
157
160
|
|
|
@@ -436,6 +436,166 @@ describe("AdvancedNumericInput", () => {
|
|
|
436
436
|
expect(advInput.props().decimalScale, "to be", 2);
|
|
437
437
|
});
|
|
438
438
|
|
|
439
|
+
it("Renders InputBase component as advanced numeric input without min max", () => {
|
|
440
|
+
const inputProps = new InputBaseProps();
|
|
441
|
+
const aLabel = "aLabel";
|
|
442
|
+
const aValue = "value";
|
|
443
|
+
|
|
444
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
445
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
446
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
447
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
448
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
449
|
+
|
|
450
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
451
|
+
|
|
452
|
+
const mountedComponent = mount(component);
|
|
453
|
+
|
|
454
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
455
|
+
expect(advInput.props().decimalScale, "to be", 2);
|
|
456
|
+
expect(advInput.props().min, "to be", -2147483648);
|
|
457
|
+
expect(advInput.props().max, "to be", 2147483647);
|
|
458
|
+
expect(advInput.props().maxLength, "to be", 14);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
it("Renders InputBase component as advanced numeric input without min", () => {
|
|
462
|
+
const inputProps = new InputBaseProps();
|
|
463
|
+
const aLabel = "aLabel";
|
|
464
|
+
const aValue = "value";
|
|
465
|
+
|
|
466
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
467
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
468
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
469
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
470
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 0 });
|
|
471
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { max: 122 });
|
|
472
|
+
|
|
473
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
474
|
+
|
|
475
|
+
const mountedComponent = mount(component);
|
|
476
|
+
|
|
477
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
478
|
+
expect(advInput.props().decimalScale, "to be", 0);
|
|
479
|
+
expect(advInput.props().min, "to be", -2147483648);
|
|
480
|
+
expect(advInput.props().max, "to be", 122);
|
|
481
|
+
expect(advInput.props().maxLength, "to be", 11);
|
|
482
|
+
});
|
|
483
|
+
|
|
484
|
+
it("Renders InputBase component as advanced numeric input without max", () => {
|
|
485
|
+
const inputProps = new InputBaseProps();
|
|
486
|
+
const aLabel = "aLabel";
|
|
487
|
+
const aValue = "value";
|
|
488
|
+
|
|
489
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
490
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
491
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
492
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
493
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
494
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -9.9 });
|
|
495
|
+
|
|
496
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
497
|
+
|
|
498
|
+
const mountedComponent = mount(component);
|
|
499
|
+
|
|
500
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
501
|
+
expect(advInput.props().decimalScale, "to be", 2);
|
|
502
|
+
expect(advInput.props().min, "to be", -9.9);
|
|
503
|
+
expect(advInput.props().max, "to be", 2147483647);
|
|
504
|
+
expect(advInput.props().maxLength, "to be", 13);
|
|
505
|
+
});
|
|
506
|
+
|
|
507
|
+
it("Renders InputBase component as advanced numeric input with negative min positive max", () => {
|
|
508
|
+
const inputProps = new InputBaseProps();
|
|
509
|
+
const aLabel = "aLabel";
|
|
510
|
+
const aValue = "value";
|
|
511
|
+
|
|
512
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
513
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
514
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
515
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
516
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 1 });
|
|
517
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -999.9, max: 9.8 });
|
|
518
|
+
|
|
519
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
520
|
+
|
|
521
|
+
const mountedComponent = mount(component);
|
|
522
|
+
|
|
523
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
524
|
+
expect(advInput.props().decimalScale, "to be", 1);
|
|
525
|
+
expect(advInput.props().min, "to be", -999.9);
|
|
526
|
+
expect(advInput.props().max, "to be", 9.8);
|
|
527
|
+
expect(advInput.props().maxLength, "to be", 6);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
it("Renders InputBase component as advanced numeric input with negative min large positive max", () => {
|
|
531
|
+
const inputProps = new InputBaseProps();
|
|
532
|
+
const aLabel = "aLabel";
|
|
533
|
+
const aValue = "value";
|
|
534
|
+
|
|
535
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
536
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
537
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
538
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
539
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 1 });
|
|
540
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -9.9, max: 99999.8 });
|
|
541
|
+
|
|
542
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
543
|
+
|
|
544
|
+
const mountedComponent = mount(component);
|
|
545
|
+
|
|
546
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
547
|
+
expect(advInput.props().decimalScale, "to be", 1);
|
|
548
|
+
expect(advInput.props().min, "to be", -9.9);
|
|
549
|
+
expect(advInput.props().max, "to be", 99999.8);
|
|
550
|
+
expect(advInput.props().maxLength, "to be", 7);
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
it("Renders InputBase component as advanced numeric input with negative min negative max", () => {
|
|
554
|
+
const inputProps = new InputBaseProps();
|
|
555
|
+
const aLabel = "aLabel";
|
|
556
|
+
const aValue = "value";
|
|
557
|
+
|
|
558
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
559
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
560
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
561
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
562
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 3 });
|
|
563
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: -99.9, max: -9.8 });
|
|
564
|
+
|
|
565
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
566
|
+
|
|
567
|
+
const mountedComponent = mount(component);
|
|
568
|
+
|
|
569
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
570
|
+
expect(advInput.props().decimalScale, "to be", 3);
|
|
571
|
+
expect(advInput.props().min, "to be", -99.9);
|
|
572
|
+
expect(advInput.props().max, "to be", -9.8);
|
|
573
|
+
expect(advInput.props().maxLength, "to be", 7);
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
it("Renders InputBase component as advanced numeric input with positive min positive max", () => {
|
|
577
|
+
const inputProps = new InputBaseProps();
|
|
578
|
+
const aLabel = "aLabel";
|
|
579
|
+
const aValue = "value";
|
|
580
|
+
|
|
581
|
+
inputProps.set(InputBaseProps.propNames.update, update);
|
|
582
|
+
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
583
|
+
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
584
|
+
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
585
|
+
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 5 });
|
|
586
|
+
inputProps.set(InputBaseProps.propNames.inputAttributes, { min: 9.9, max: 99.8 });
|
|
587
|
+
|
|
588
|
+
const component = <InputBase inputProps={inputProps} />;
|
|
589
|
+
|
|
590
|
+
const mountedComponent = mount(component);
|
|
591
|
+
|
|
592
|
+
const advInput = mountedComponent.find("AdvancedNumericInput");
|
|
593
|
+
expect(advInput.props().decimalScale, "to be", 5);
|
|
594
|
+
expect(advInput.props().min, "to be", 9.9);
|
|
595
|
+
expect(advInput.props().max, "to be", 99.8);
|
|
596
|
+
expect(advInput.props().maxLength, "to be", 8);
|
|
597
|
+
});
|
|
598
|
+
|
|
439
599
|
it("Change advanced numeric input value", () => {
|
|
440
600
|
const inputProps = new InputBaseProps();
|
|
441
601
|
const aLabel = "aLabel";
|
|
@@ -686,116 +846,6 @@ describe("AdvancedNumericInput", () => {
|
|
|
686
846
|
// no idea what to assert here, this test is mostly for code coverage
|
|
687
847
|
});
|
|
688
848
|
|
|
689
|
-
it("Change advanced numeric input value with min value out of default bounds", () => {
|
|
690
|
-
const inputProps = new InputBaseProps();
|
|
691
|
-
const aLabel = "aLabel";
|
|
692
|
-
const aValue = "12.2";
|
|
693
|
-
const metadata = {
|
|
694
|
-
test: "value",
|
|
695
|
-
};
|
|
696
|
-
|
|
697
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
698
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
699
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
700
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
701
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
702
|
-
inputProps.set(InputBaseProps.propNames.metadata, metadata);
|
|
703
|
-
|
|
704
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
705
|
-
const mountedComponent = mount(component);
|
|
706
|
-
const input = mountedComponent.find("input");
|
|
707
|
-
input.simulate("change", { target: { value: "-3147483648", focus: noop } });
|
|
708
|
-
|
|
709
|
-
expect(update, "not to have calls satisfying", [{ args: ["-3147483648", metadata] }]);
|
|
710
|
-
|
|
711
|
-
input.simulate("change", { target: { value: "-111", focus: noop } });
|
|
712
|
-
expect(update, "to have calls satisfying", [{ args: ["-111", metadata] }]);
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
it("Change advanced numeric input value with min value out of specified bounds", () => {
|
|
716
|
-
const inputProps = new InputBaseProps();
|
|
717
|
-
const aLabel = "aLabel";
|
|
718
|
-
const aValue = "12.2";
|
|
719
|
-
const metadata = {
|
|
720
|
-
test: "value",
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
724
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
725
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
726
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
727
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
728
|
-
inputProps.set(InputBaseProps.propNames.metadata, metadata);
|
|
729
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, {
|
|
730
|
-
min: -100,
|
|
731
|
-
});
|
|
732
|
-
|
|
733
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
734
|
-
const mountedComponent = mount(component);
|
|
735
|
-
const input = mountedComponent.find("input");
|
|
736
|
-
input.simulate("change", { target: { value: "-2000", focus: noop } });
|
|
737
|
-
|
|
738
|
-
expect(update, "not to have calls satisfying", [{ args: ["-2000", metadata] }]);
|
|
739
|
-
|
|
740
|
-
input.simulate("change", { target: { value: "-11", focus: noop } });
|
|
741
|
-
expect(update, "to have calls satisfying", [{ args: ["-11", metadata] }]);
|
|
742
|
-
});
|
|
743
|
-
|
|
744
|
-
it("Change advanced numeric input value with max value out of default bounds", () => {
|
|
745
|
-
const inputProps = new InputBaseProps();
|
|
746
|
-
const aLabel = "aLabel";
|
|
747
|
-
const aValue = "12.2";
|
|
748
|
-
const metadata = {
|
|
749
|
-
test: "value",
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
753
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
754
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
755
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
756
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
757
|
-
inputProps.set(InputBaseProps.propNames.metadata, metadata);
|
|
758
|
-
|
|
759
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
760
|
-
const mountedComponent = mount(component);
|
|
761
|
-
const input = mountedComponent.find("input");
|
|
762
|
-
input.simulate("change", { target: { value: "3147483648", focus: noop } });
|
|
763
|
-
|
|
764
|
-
expect(update, "not to have calls satisfying", [{ args: ["3147483648", metadata] }]);
|
|
765
|
-
|
|
766
|
-
input.simulate("change", { target: { value: "111", focus: noop } });
|
|
767
|
-
expect(update, "to have calls satisfying", [{ args: ["111", metadata] }]);
|
|
768
|
-
});
|
|
769
|
-
|
|
770
|
-
it("Change advanced numeric input value with max value out of specified bounds", () => {
|
|
771
|
-
const inputProps = new InputBaseProps();
|
|
772
|
-
const aLabel = "aLabel";
|
|
773
|
-
const aValue = "12.2";
|
|
774
|
-
const metadata = {
|
|
775
|
-
test: "value",
|
|
776
|
-
};
|
|
777
|
-
|
|
778
|
-
inputProps.set(InputBaseProps.propNames.update, update);
|
|
779
|
-
inputProps.set(InputBaseProps.propNames.value, aValue);
|
|
780
|
-
inputProps.set(InputBaseProps.propNames.label, aLabel);
|
|
781
|
-
inputProps.set(InputBaseProps.propNames.type, "AdvancedNumericInput");
|
|
782
|
-
inputProps.set(InputBaseProps.propNames.numericInputProps, { decimalScale: 2 });
|
|
783
|
-
inputProps.set(InputBaseProps.propNames.metadata, metadata);
|
|
784
|
-
inputProps.set(InputBaseProps.propNames.inputAttributes, {
|
|
785
|
-
max: 100,
|
|
786
|
-
});
|
|
787
|
-
|
|
788
|
-
const component = <InputBase inputProps={inputProps} />;
|
|
789
|
-
const mountedComponent = mount(component);
|
|
790
|
-
const input = mountedComponent.find("input");
|
|
791
|
-
input.simulate("change", { target: { value: "2000", focus: noop } });
|
|
792
|
-
|
|
793
|
-
expect(update, "not to have calls satisfying", [{ args: ["2000", metadata] }]);
|
|
794
|
-
|
|
795
|
-
input.simulate("change", { target: { value: "11", focus: noop } });
|
|
796
|
-
expect(update, "to have calls satisfying", [{ args: ["11", metadata] }]);
|
|
797
|
-
});
|
|
798
|
-
|
|
799
849
|
it("Change advanced numeric input value: dash is allowed", () => {
|
|
800
850
|
const inputProps = new InputBaseProps();
|
|
801
851
|
const aLabel = "aLabel";
|
|
@@ -64,6 +64,7 @@ export const List = styled.div`
|
|
|
64
64
|
border-right: 1px solid ${getThemeProp(["colors", "borderLight"], "#cccccc")};
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
67
|
+
overflow-y: auto;
|
|
67
68
|
`;
|
|
68
69
|
|
|
69
70
|
const FilteredLink = ({ active, ...props }) => (props.to ? <Link {...props} /> : <div {...props} />);
|