orc-shared 1.7.0-dev.8 → 5.2.0-dev.1
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/modules.js +15 -1
- package/dist/actions/navigation.js +1 -14
- package/dist/actions/scopes.js +2 -3
- package/dist/buildStore.js +1 -7
- package/dist/components/AppFrame/Sidebar.js +8 -4
- package/dist/components/MaterialUI/DataDisplay/Notification.js +0 -6
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +6 -18
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -2
- package/dist/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +2 -4
- package/dist/components/MaterialUI/DataDisplay/tableHelpers.js +7 -7
- package/dist/components/MaterialUI/Inputs/Autocomplete.js +0 -5
- package/dist/components/MaterialUI/Inputs/DatePicker.js +8 -15
- package/dist/components/MaterialUI/Inputs/InputBase.js +16 -102
- package/dist/components/MaterialUI/Inputs/InputBaseProps.js +1 -7
- package/dist/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +46 -43
- package/dist/components/MaterialUI/Inputs/TimePicker.js +2 -5
- package/dist/components/MaterialUI/Navigation/DropDownMenu.js +1 -6
- package/dist/components/MaterialUI/Surfaces/SectionExpansionPanel.js +0 -1
- package/dist/components/MaterialUI/hocs/withDeferredTooltip.js +1 -3
- package/dist/components/Routing/Page.js +1 -4
- package/dist/components/Routing/SegmentPage.js +1 -4
- package/dist/components/Routing/SubPage.js +8 -38
- package/dist/components/Scope/useScopeConfirmationModalState.js +3 -1
- package/dist/constants.js +2 -18
- package/dist/content/icons/hide.svg +1 -10
- package/dist/content/icons/open-in-new-tab.svg +1 -3
- package/dist/content/iconsSheet.svg +650 -117
- package/dist/content/orckestra-logo-white.png +0 -0
- package/dist/hooks/useEditState.js +2 -4
- package/dist/reducers/modules.js +3 -4
- package/dist/reducers/navigation.js +0 -16
- package/dist/reducers/request.js +1 -6
- package/dist/reducers/scopes.js +0 -3
- package/dist/reducers/view.js +1 -1
- package/dist/selectors/authentication.js +1 -15
- package/dist/selectors/metadata.js +1 -1
- package/dist/sharedMessages.js +1 -17
- package/dist/utils/propertyHelper.js +0 -33
- package/dist/utils/timezoneHelper.js +1 -23
- package/package.json +7 -10
- package/src/actions/modules.js +10 -0
- package/src/actions/modules.test.js +14 -0
- package/src/actions/navigation.js +0 -7
- package/src/actions/navigation.test.js +0 -12
- package/src/actions/scopes.js +1 -2
- package/src/actions/scopes.test.js +1 -2
- package/src/buildStore.js +0 -6
- package/src/components/AppFrame/About.test.js +3 -3
- package/src/components/AppFrame/Sidebar.js +3 -4
- package/src/components/Form/InputField.test.js +0 -18
- package/src/components/Form/Inputs/Date.test.js +0 -18
- package/src/components/MaterialUI/DataDisplay/Notification.js +0 -6
- package/src/components/MaterialUI/DataDisplay/Notification.test.js +0 -37
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.js +5 -23
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/InformationItem.test.js +0 -121
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +1 -2
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.test.js +0 -20
- package/src/components/MaterialUI/DataDisplay/TooltippedElements/MultipleLinesText.js +1 -2
- package/src/components/MaterialUI/DataDisplay/tableHelpers.js +8 -8
- package/src/components/MaterialUI/DataDisplay/tableHelpers.test.js +0 -93
- package/src/components/MaterialUI/Inputs/Autocomplete.js +0 -5
- package/src/components/MaterialUI/Inputs/Autocomplete.test.js +0 -15
- package/src/components/MaterialUI/Inputs/DatePicker.js +3 -17
- package/src/components/MaterialUI/Inputs/DatePicker.test.js +1 -143
- package/src/components/MaterialUI/Inputs/InputBase.js +15 -103
- package/src/components/MaterialUI/Inputs/InputBase.test.js +1 -376
- package/src/components/MaterialUI/Inputs/InputBaseProps.js +0 -6
- package/src/components/MaterialUI/Inputs/InputBaseProps.test.js +0 -6
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.js +27 -39
- package/src/components/MaterialUI/Inputs/PredefinedElements/SearchControl.test.js +34 -39
- package/src/components/MaterialUI/Inputs/TimePicker.js +1 -5
- package/src/components/MaterialUI/Navigation/DropDownMenu.js +1 -6
- package/src/components/MaterialUI/Surfaces/SectionExpansionPanel.js +0 -1
- package/src/components/MaterialUI/hocs/withDeferredTooltip.js +1 -2
- package/src/components/MaterialUI/hocs/withDeferredTooltip.test.js +0 -52
- package/src/components/Routing/Page.js +1 -12
- package/src/components/Routing/SegmentPage.js +1 -12
- package/src/components/Routing/SubPage.js +9 -41
- package/src/components/Routing/SubPage.test.js +1 -295
- package/src/components/Scope/useScopeConfirmationModalState.js +3 -1
- package/src/components/Scope/useScopeConfirmationModalState.test.js +35 -4
- package/src/components/Text.test.js +59 -44
- package/src/constants.js +0 -15
- package/src/content/icons/hide.svg +1 -10
- package/src/content/icons/open-in-new-tab.svg +1 -3
- package/src/content/iconsSheet.svg +650 -117
- package/src/content/orckestra-logo-white.png +0 -0
- package/src/hooks/useEditState.js +2 -12
- package/src/hooks/useEditState.test.js +1 -1
- package/src/hooks/useLabelMessage.test.js +10 -16
- package/src/reducers/modules.js +4 -4
- package/src/reducers/modules.test.js +5 -5
- package/src/reducers/navigation.js +0 -24
- package/src/reducers/navigation.test.js +0 -38
- package/src/reducers/request.js +1 -6
- package/src/reducers/request.test.js +0 -34
- package/src/reducers/scopes.js +0 -3
- package/src/reducers/scopes.test.js +0 -47
- package/src/reducers/view.js +1 -1
- package/src/reducers/view.test.js +8 -1
- package/src/selectors/authentication.js +0 -13
- package/src/selectors/authentication.test.js +0 -322
- package/src/selectors/metadata.js +1 -1
- package/src/selectors/metadata.test.js +0 -12
- package/src/sharedMessages.js +1 -17
- package/src/translations/en-US.json +12 -16
- package/src/translations/fr-CA.json +12 -16
- package/src/utils/propertyHelper.js +0 -38
- package/src/utils/propertyHelper.test.js +0 -160
- package/src/utils/timezoneHelper.js +0 -18
- package/src/utils/timezoneHelper.test.js +1 -23
- package/dist/actions/globalErrorMessages.js +0 -63
- package/dist/actions/tasks.js +0 -170
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +0 -160
- package/dist/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +0 -88
- package/dist/components/TaskDetailsModal.js +0 -191
- package/dist/content/icons/anonymize.svg +0 -3
- package/dist/content/icons/archives.svg +0 -3
- package/dist/content/icons/clean-index.svg +0 -3
- package/dist/content/icons/date-index.svg +0 -3
- package/dist/content/icons/inventory.svg +0 -4
- package/dist/content/icons/query-tester.svg +0 -10
- package/dist/content/icons/reciprocity.svg +0 -10
- package/dist/content/icons/schema.svg +0 -11
- package/dist/content/icons/synonyms.svg +0 -3
- package/dist/content/icons/tenant.svg +0 -3
- package/dist/content/icons/time-index.svg +0 -3
- package/dist/hooks/useDispatchWithErrorHandling.js +0 -103
- package/dist/hooks/useScopeGuardLoader.js +0 -77
- package/dist/reducers/globalErrorMessages.js +0 -78
- package/dist/reducers/scopeRouteState.js +0 -83
- package/dist/reducers/tasks.js +0 -98
- package/dist/selectors/globalErrorMessages.js +0 -57
- package/dist/selectors/scopeRouteState.js +0 -53
- package/dist/selectors/tasks.js +0 -64
- package/dist/utils/responseProcessingHelper.js +0 -86
- package/src/actions/globalErrorMessages.js +0 -12
- package/src/actions/globalErrorMessages.test.js +0 -21
- package/src/actions/tasks.js +0 -77
- package/src/actions/tasks.test.js +0 -169
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.js +0 -108
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/GlobalErrorMessages.test.js +0 -468
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.js +0 -29
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/LookupDisplayValue.test.js +0 -147
- package/src/components/TaskDetailsModal.js +0 -132
- package/src/components/TaskDetailsModal.test.js +0 -317
- package/src/content/icons/anonymize.svg +0 -3
- package/src/content/icons/archives.svg +0 -3
- package/src/content/icons/clean-index.svg +0 -3
- package/src/content/icons/date-index.svg +0 -3
- package/src/content/icons/inventory.svg +0 -4
- package/src/content/icons/query-tester.svg +0 -10
- package/src/content/icons/reciprocity.svg +0 -10
- package/src/content/icons/schema.svg +0 -11
- package/src/content/icons/synonyms.svg +0 -3
- package/src/content/icons/tenant.svg +0 -3
- package/src/content/icons/time-index.svg +0 -3
- package/src/hooks/useDispatchWithErrorHandling.js +0 -57
- package/src/hooks/useDispatchWithErrorHandling.test.js +0 -230
- package/src/hooks/useScopeGuardLoader.js +0 -25
- package/src/hooks/useScopeGuardLoader.test.js +0 -187
- package/src/reducers/globalErrorMessages.js +0 -25
- package/src/reducers/globalErrorMessages.test.js +0 -66
- package/src/reducers/scopeRouteState.js +0 -29
- package/src/reducers/scopeRouteState.test.js +0 -49
- package/src/reducers/tasks.js +0 -56
- package/src/reducers/tasks.test.js +0 -404
- package/src/selectors/globalErrorMessages.js +0 -11
- package/src/selectors/globalErrorMessages.test.js +0 -25
- package/src/selectors/scopeRouteState.js +0 -5
- package/src/selectors/scopeRouteState.test.js +0 -13
- package/src/selectors/tasks.js +0 -16
- package/src/selectors/tasks.test.js +0 -60
- package/src/utils/responseProcessingHelper.js +0 -42
- package/src/utils/responseProcessingHelper.test.js +0 -218
|
@@ -15,25 +15,8 @@ describe("DatePicker", () => {
|
|
|
15
15
|
locale: {
|
|
16
16
|
locale: "en-CA",
|
|
17
17
|
},
|
|
18
|
-
metadata: {
|
|
19
|
-
lookups: {
|
|
20
|
-
customer: {
|
|
21
|
-
index: {
|
|
22
|
-
TimeZone: {
|
|
23
|
-
values: {
|
|
24
|
-
UTC: {
|
|
25
|
-
value: "Eastern Standard Time",
|
|
26
|
-
displayName: {
|
|
27
|
-
"en-US": "Eastern Standard Time",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
18
|
});
|
|
19
|
+
|
|
37
20
|
store = {
|
|
38
21
|
subscribe: () => {},
|
|
39
22
|
dispatch: () => {},
|
|
@@ -328,131 +311,6 @@ describe("DatePicker", () => {
|
|
|
328
311
|
|
|
329
312
|
input.at(0).simulate("change", event);
|
|
330
313
|
});
|
|
331
|
-
|
|
332
|
-
it("should call onChange prop with timezone", () => {
|
|
333
|
-
const onChangeMock = jest.fn();
|
|
334
|
-
const date = new Date("2020-06-30T00:00:00");
|
|
335
|
-
const event = {
|
|
336
|
-
preventDefault() {},
|
|
337
|
-
target: { value: "" },
|
|
338
|
-
};
|
|
339
|
-
const requestTimeZone = "Eastern Standard Time";
|
|
340
|
-
|
|
341
|
-
const component = (
|
|
342
|
-
<TestWrapper provider={{ store }} intlProvider>
|
|
343
|
-
<DatePicker
|
|
344
|
-
onChange={onChangeMock}
|
|
345
|
-
value={date}
|
|
346
|
-
useTime={true}
|
|
347
|
-
useDate={false}
|
|
348
|
-
showTimeSelectOnly={true}
|
|
349
|
-
timePickerTimeZone={requestTimeZone}
|
|
350
|
-
/>
|
|
351
|
-
</TestWrapper>
|
|
352
|
-
);
|
|
353
|
-
const mountedComponent = mount(component);
|
|
354
|
-
|
|
355
|
-
const input = mountedComponent.find("input");
|
|
356
|
-
input.at(0).simulate("change", event);
|
|
357
|
-
expect(onChangeMock.mock.calls.length, "to equal", 1);
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
it("should call onChange prop with null timezone", () => {
|
|
361
|
-
const onChangeMock = jest.fn();
|
|
362
|
-
const date = new Date("2020-06-30T00:00:00");
|
|
363
|
-
const event = {
|
|
364
|
-
preventDefault() {},
|
|
365
|
-
target: { value: "" },
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
const component = (
|
|
369
|
-
<TestWrapper provider={{ store }} intlProvider>
|
|
370
|
-
<DatePicker
|
|
371
|
-
onChange={onChangeMock}
|
|
372
|
-
value={date}
|
|
373
|
-
useTime={true}
|
|
374
|
-
useDate={false}
|
|
375
|
-
showTimeSelectOnly={true}
|
|
376
|
-
timePickerTimeZone={null}
|
|
377
|
-
/>
|
|
378
|
-
</TestWrapper>
|
|
379
|
-
);
|
|
380
|
-
const mountedComponent = mount(component);
|
|
381
|
-
|
|
382
|
-
const input = mountedComponent.find("input");
|
|
383
|
-
input.at(0).simulate("change", event);
|
|
384
|
-
expect(onChangeMock.mock.calls.length, "to equal", 1);
|
|
385
|
-
});
|
|
386
|
-
|
|
387
|
-
it("should call onChange prop with timezone without date value", () => {
|
|
388
|
-
const onChangeMock = jest.fn();
|
|
389
|
-
const event = {
|
|
390
|
-
preventDefault() {},
|
|
391
|
-
target: { value: "" },
|
|
392
|
-
};
|
|
393
|
-
const requestTimeZone = "Eastern Standard Time";
|
|
394
|
-
const component = (
|
|
395
|
-
<TestWrapper provider={{ store }} intlProvider>
|
|
396
|
-
<DatePicker
|
|
397
|
-
onChange={onChangeMock}
|
|
398
|
-
useTime={true}
|
|
399
|
-
useDate={false}
|
|
400
|
-
showTimeSelectOnly={true}
|
|
401
|
-
timePickerTimeZone={requestTimeZone}
|
|
402
|
-
/>
|
|
403
|
-
</TestWrapper>
|
|
404
|
-
);
|
|
405
|
-
const mountedComponent = mount(component);
|
|
406
|
-
|
|
407
|
-
const input = mountedComponent.find("input");
|
|
408
|
-
input.at(0).simulate("change", event);
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
it("should call onChange prop with timezone and not use time", () => {
|
|
412
|
-
const date = new Date("2020-06-30T00:00:00");
|
|
413
|
-
const event = {
|
|
414
|
-
preventDefault() {},
|
|
415
|
-
target: { value: "" },
|
|
416
|
-
};
|
|
417
|
-
const requestTimeZone = "Eastern Standard Time";
|
|
418
|
-
const component = (
|
|
419
|
-
<TestWrapper provider={{ store }} intlProvider>
|
|
420
|
-
<DatePicker value={date} useDate={false} showTimeSelectOnly={true} timePickerTimeZone={requestTimeZone} />
|
|
421
|
-
</TestWrapper>
|
|
422
|
-
);
|
|
423
|
-
const mountedComponent = mount(component);
|
|
424
|
-
|
|
425
|
-
const input = mountedComponent.find("input");
|
|
426
|
-
input.at(0).simulate("change", event);
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
it("should call onChange prop with useTimeZone", () => {
|
|
430
|
-
const onChangeMock = jest.fn();
|
|
431
|
-
const date = new Date("2020-06-30T00:00:00");
|
|
432
|
-
const event = {
|
|
433
|
-
preventDefault() {},
|
|
434
|
-
target: { value: "" },
|
|
435
|
-
};
|
|
436
|
-
const requestTimeZone = "Eastern Standard Time";
|
|
437
|
-
const component = (
|
|
438
|
-
<TestWrapper provider={{ store }} intlProvider>
|
|
439
|
-
<DatePicker
|
|
440
|
-
onChange={onChangeMock}
|
|
441
|
-
value={date}
|
|
442
|
-
useTime={true}
|
|
443
|
-
useDate={false}
|
|
444
|
-
useTimeZone={true}
|
|
445
|
-
showTimeSelectOnly={true}
|
|
446
|
-
timePickerTimeZone={requestTimeZone}
|
|
447
|
-
/>
|
|
448
|
-
</TestWrapper>
|
|
449
|
-
);
|
|
450
|
-
const mountedComponent = mount(component);
|
|
451
|
-
|
|
452
|
-
const input = mountedComponent.find("input");
|
|
453
|
-
input.at(0).simulate("change", event);
|
|
454
|
-
expect(onChangeMock.mock.calls.length, "to equal", 1);
|
|
455
|
-
});
|
|
456
314
|
});
|
|
457
315
|
|
|
458
316
|
describe("createFormat", () => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { makeStyles } from "@material-ui/core/styles";
|
|
3
3
|
import InputBaseMUI from "@material-ui/core/InputBase";
|
|
4
4
|
import InputBaseProps, { isInputProps } from "./InputBaseProps";
|
|
5
5
|
import classNames from "classnames";
|
|
6
|
-
import { NumericFormat, numericFormatter } from "react-number-format";
|
|
7
6
|
|
|
8
7
|
export const useStyles = makeStyles(theme => ({
|
|
9
8
|
container: {
|
|
@@ -80,27 +79,6 @@ export const useStyles = makeStyles(theme => ({
|
|
|
80
79
|
},
|
|
81
80
|
}));
|
|
82
81
|
|
|
83
|
-
export const AdvancedNumericInput = props => {
|
|
84
|
-
const { inputRef, onChange, ...other } = props;
|
|
85
|
-
|
|
86
|
-
// https://github.com/s-yadav/react-number-format
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<NumericFormat
|
|
90
|
-
{...other}
|
|
91
|
-
getInputRef={inputRef}
|
|
92
|
-
onValueChange={values => {
|
|
93
|
-
onChange({
|
|
94
|
-
target: {
|
|
95
|
-
name: props.name,
|
|
96
|
-
value: values.value,
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
}}
|
|
100
|
-
/>
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
82
|
const InputBase = ({ inputProps }) => {
|
|
105
83
|
if (isInputProps(inputProps) === false) {
|
|
106
84
|
throw new TypeError("inputProps property is not of type InputBaseProps");
|
|
@@ -121,25 +99,6 @@ const InputBase = ({ inputProps }) => {
|
|
|
121
99
|
const endAdornment = inputProps?.get(InputBaseProps.propNames.endAdornment);
|
|
122
100
|
const metadata = inputProps?.get(InputBaseProps.propNames.metadata);
|
|
123
101
|
const autoComplete = inputProps?.get(InputBaseProps.propNames.autoComplete);
|
|
124
|
-
const timeoutDelay = inputProps?.get(InputBaseProps.propNames.timeoutDelay) || 100;
|
|
125
|
-
const rowsProps = inputProps?.get(InputBaseProps.propNames.rows);
|
|
126
|
-
const numericInputProps = inputProps?.get(InputBaseProps.propNames.numericInputProps) || null;
|
|
127
|
-
|
|
128
|
-
const isAdvancedNumericInput = type.toLowerCase() === "advancednumericinput";
|
|
129
|
-
const inputComponent = isAdvancedNumericInput ? AdvancedNumericInput : undefined;
|
|
130
|
-
const inputControlType = isAdvancedNumericInput ? "text" : type;
|
|
131
|
-
|
|
132
|
-
if (isAdvancedNumericInput && numericInputProps) {
|
|
133
|
-
Object.keys(numericInputProps).forEach(key => {
|
|
134
|
-
if (key !== "blurFormattingSkipFixedDecimalScale") {
|
|
135
|
-
inputAttributes[key] = numericInputProps[key];
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const defaultRows = 4;
|
|
141
|
-
let rows = rowsProps;
|
|
142
|
-
if (rows === null || rows === undefined) rows = defaultRows;
|
|
143
102
|
|
|
144
103
|
const tooltipText = type === "text" ? value : "";
|
|
145
104
|
|
|
@@ -151,80 +110,34 @@ const InputBase = ({ inputProps }) => {
|
|
|
151
110
|
const classes = useStyles({ label, errorPosition });
|
|
152
111
|
|
|
153
112
|
const onChangeHandler = event => {
|
|
154
|
-
|
|
155
|
-
event.persist();
|
|
156
|
-
}
|
|
113
|
+
event.persist();
|
|
157
114
|
|
|
158
115
|
if (!event.target.value || window.bypassDebounce === true) {
|
|
159
116
|
update(event.target.value, metadata);
|
|
160
117
|
}
|
|
161
|
-
setInputText(event.target.value);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const timerId = useRef(null);
|
|
165
|
-
|
|
166
|
-
React.useEffect(() => {
|
|
167
|
-
return () => {
|
|
168
|
-
clearTimeout(timerId.current);
|
|
169
|
-
timerId.current = null;
|
|
170
|
-
};
|
|
171
|
-
}, []);
|
|
172
118
|
|
|
173
|
-
|
|
174
|
-
let updateValue = (inputText ?? value).toString(); // value cannot be null as defined above
|
|
175
|
-
|
|
176
|
-
if (timerId.current) {
|
|
177
|
-
clearTimeout(timerId.current);
|
|
178
|
-
timerId.current = null;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
if (isAdvancedNumericInput) {
|
|
182
|
-
const formattingProps = { ...numericInputProps };
|
|
183
|
-
delete formattingProps.blurFormattingSkipFixedDecimalScale;
|
|
184
|
-
|
|
185
|
-
if (numericInputProps?.blurFormattingSkipFixedDecimalScale !== true) {
|
|
186
|
-
formattingProps.fixedDecimalScale = true;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
updateValue = numericFormatter(updateValue, formattingProps);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
update(updateValue, metadata);
|
|
193
|
-
setInputText(null);
|
|
194
|
-
|
|
195
|
-
if (onBlur) {
|
|
196
|
-
onBlur(e);
|
|
197
|
-
}
|
|
119
|
+
setInputText(event.target.value);
|
|
198
120
|
};
|
|
199
121
|
|
|
200
122
|
const inputBaseInputStyle = inputProps?.getStyle(InputBaseProps.ruleNames.input);
|
|
201
123
|
const errorTextStyle = inputProps?.getStyle(InputBaseProps.ruleNames.errorText);
|
|
124
|
+
|
|
202
125
|
const [inputText, setInputText] = React.useState(null);
|
|
126
|
+
|
|
203
127
|
const textToDisplay = inputText ?? value;
|
|
204
128
|
|
|
205
129
|
React.useEffect(() => {
|
|
206
|
-
if (inputText
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (inputText !== value) {
|
|
211
|
-
clearTimeout(timerId.current);
|
|
212
|
-
timerId.current = setTimeout(() => {
|
|
213
|
-
update(inputText, metadata);
|
|
130
|
+
if (inputText !== value && inputText != null && window.bypassDebounce !== true) {
|
|
131
|
+
const timeOutId = setTimeout(() => {
|
|
132
|
+
const updateValue = update(inputText, metadata);
|
|
214
133
|
setInputText(null);
|
|
215
|
-
}, timeoutDelay);
|
|
216
134
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
};
|
|
221
|
-
} else {
|
|
222
|
-
setInputText(null);
|
|
223
|
-
clearTimeout(timerId.current);
|
|
135
|
+
return updateValue;
|
|
136
|
+
}, 100);
|
|
137
|
+
return () => clearTimeout(timeOutId);
|
|
224
138
|
}
|
|
225
|
-
|
|
226
139
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
227
|
-
}, [inputText,
|
|
140
|
+
}, [inputText, value]);
|
|
228
141
|
|
|
229
142
|
return (
|
|
230
143
|
<div className={classes.container}>
|
|
@@ -238,21 +151,20 @@ const InputBase = ({ inputProps }) => {
|
|
|
238
151
|
multiline: classes.multiline,
|
|
239
152
|
inputMultiline: classes.inputMultiline,
|
|
240
153
|
}}
|
|
241
|
-
onBlur={
|
|
154
|
+
onBlur={onBlur}
|
|
242
155
|
onClick={onClick}
|
|
243
|
-
type={
|
|
156
|
+
type={type}
|
|
244
157
|
placeholder={placeholder}
|
|
245
158
|
value={textToDisplay}
|
|
246
159
|
fullWidth={true}
|
|
247
160
|
onChange={event => onChangeHandler(event)}
|
|
248
161
|
error={!!error}
|
|
249
162
|
inputProps={inputAttributes}
|
|
250
|
-
inputComponent={inputComponent}
|
|
251
163
|
disabled={disabled}
|
|
252
164
|
multiline={multiline}
|
|
253
165
|
startAdornment={startAdornment}
|
|
254
166
|
endAdornment={endAdornment}
|
|
255
|
-
|
|
167
|
+
rows={4}
|
|
256
168
|
title={tooltipText}
|
|
257
169
|
autoComplete={autoComplete}
|
|
258
170
|
/>
|