@patternfly/react-core 4.269.0 → 4.271.0

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/components/DatePicker/DatePicker.d.ts +2 -2
  3. package/components/DatePicker/DatePicker.d.ts.map +1 -1
  4. package/components/DatePicker/DatePicker.js +7 -7
  5. package/components/DatePicker/DatePicker.js.map +1 -1
  6. package/components/SearchInput/SearchInput.js +1 -1
  7. package/components/SearchInput/SearchInput.js.map +1 -1
  8. package/components/TextInputGroup/TextInputGroupMain.d.ts +1 -1
  9. package/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  10. package/components/TextInputGroup/TextInputGroupMain.js +1 -1
  11. package/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  12. package/dist/esm/components/DatePicker/DatePicker.d.ts +2 -2
  13. package/dist/esm/components/DatePicker/DatePicker.d.ts.map +1 -1
  14. package/dist/esm/components/DatePicker/DatePicker.js +7 -7
  15. package/dist/esm/components/DatePicker/DatePicker.js.map +1 -1
  16. package/dist/esm/components/SearchInput/SearchInput.js +1 -1
  17. package/dist/esm/components/SearchInput/SearchInput.js.map +1 -1
  18. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts +1 -1
  19. package/dist/esm/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  20. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js +1 -1
  21. package/dist/esm/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  22. package/dist/js/components/DatePicker/DatePicker.d.ts +2 -2
  23. package/dist/js/components/DatePicker/DatePicker.d.ts.map +1 -1
  24. package/dist/js/components/DatePicker/DatePicker.js +7 -7
  25. package/dist/js/components/DatePicker/DatePicker.js.map +1 -1
  26. package/dist/js/components/SearchInput/SearchInput.js +1 -1
  27. package/dist/js/components/SearchInput/SearchInput.js.map +1 -1
  28. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts +1 -1
  29. package/dist/js/components/TextInputGroup/TextInputGroupMain.d.ts.map +1 -1
  30. package/dist/js/components/TextInputGroup/TextInputGroupMain.js +1 -1
  31. package/dist/js/components/TextInputGroup/TextInputGroupMain.js.map +1 -1
  32. package/dist/umd/react-core.min.js +1 -1
  33. package/package.json +2 -2
  34. package/src/components/DatePicker/DatePicker.tsx +9 -9
  35. package/src/components/DatePicker/examples/DatePickerBasic.tsx +2 -2
  36. package/src/components/DatePicker/examples/DatePickerControlled.tsx +1 -1
  37. package/src/components/SearchInput/SearchInput.tsx +1 -1
  38. package/src/components/TextInputGroup/TextInputGroupMain.tsx +2 -2
  39. package/src/components/TextInputGroup/examples/TextInputGroupFilters.tsx +1 -1
  40. package/src/components/TextInputGroup/examples/TextInputGroupUtilitiesAndIcon.tsx +1 -1
  41. package/src/demos/ComposableMenu/examples/ComposableMultipleTypeaheadSelect.tsx +1 -1
  42. package/src/demos/ComposableMenu/examples/ComposableTypeaheadSelect.tsx +1 -1
  43. package/src/demos/examples/TextInputGroup/AttributeValueFiltering.tsx +1 -1
  44. package/src/demos/examples/TextInputGroup/AutoCompleteSearch.tsx +1 -1
  45. package/src/next/components/Select/examples/SelectMultiTypeahead.tsx +1 -1
  46. package/src/next/components/Select/examples/SelectTypeahead.tsx +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.269.0",
3
+ "version": "4.271.0",
4
4
  "description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
5
5
  "main": "dist/js/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -71,5 +71,5 @@
71
71
  "react": "^16.8 || ^17 || ^18",
72
72
  "react-dom": "^16.8 || ^17 || ^18"
73
73
  },
74
- "gitHead": "bf9cf833bd7117fcfdb71fc68cab3d2453374336"
74
+ "gitHead": "25c2750b4d7f220fe08d5cfa5ffacd06102d63fe"
75
75
  }
@@ -42,9 +42,9 @@ export interface DatePickerProps
42
42
  /** Error message to display when the text input cannot be parsed. */
43
43
  invalidFormatText?: string;
44
44
  /** Callback called every time the text input loses focus. */
45
- onBlur?: (value: string, date?: Date) => void;
45
+ onBlur?: (event: any, value: string, date?: Date) => void;
46
46
  /** Callback called every time the text input value changes. */
47
- onChange?: (value: string, date?: Date) => void;
47
+ onChange?: (event: React.FormEvent<HTMLInputElement>, value: string, date?: Date) => void;
48
48
  /** String to display in the empty text input as a hint for the expected date format. */
49
49
  placeholder?: string;
50
50
  /** Props to pass to the popover that contains the calendar month component. */
@@ -138,28 +138,28 @@ const DatePickerBase = (
138
138
  setErrorText(validators.map(validator => validator(date)).join('\n') || '');
139
139
  };
140
140
 
141
- const onTextInput = (value: string) => {
141
+ const onTextInput = (value: string, event: React.FormEvent<HTMLInputElement>) => {
142
142
  setValue(value);
143
143
  setErrorText('');
144
144
  const newValueDate = dateParse(value);
145
145
  setValueDate(newValueDate);
146
146
  if (isValidDate(newValueDate)) {
147
- onChange(value, new Date(newValueDate));
147
+ onChange(event, value, new Date(newValueDate));
148
148
  } else {
149
- onChange(value);
149
+ onChange(event, value);
150
150
  }
151
151
  };
152
152
 
153
- const onInputBlur = () => {
153
+ const onInputBlur = (event: any) => {
154
154
  if (pristine) {
155
155
  return;
156
156
  }
157
157
  const newValueDate = dateParse(value);
158
158
  if (isValidDate(newValueDate)) {
159
- onBlur(value, new Date(newValueDate));
159
+ onBlur(event, value, new Date(newValueDate));
160
160
  setError(newValueDate);
161
161
  } else {
162
- onBlur(value);
162
+ onBlur(event, value);
163
163
  setErrorText(invalidFormatText);
164
164
  }
165
165
  };
@@ -170,7 +170,7 @@ const DatePickerBase = (
170
170
  setValueDate(newValueDate);
171
171
  setError(newValueDate);
172
172
  setPopoverOpen(false);
173
- onChange(newValue, new Date(newValueDate));
173
+ onChange(null, newValue, new Date(newValueDate));
174
174
  };
175
175
 
176
176
  const onKeyPress = (ev: React.KeyboardEvent<HTMLInputElement>) => {
@@ -4,8 +4,8 @@ import { DatePicker } from '@patternfly/react-core';
4
4
  export const DatePickerBasic: React.FunctionComponent = () => (
5
5
  <DatePicker
6
6
  // eslint-disable-next-line no-console
7
- onBlur={(str, date) => console.log('onBlur', str, date)}
7
+ onBlur={(_event, str, date) => console.log('onBlur', str, date)}
8
8
  // eslint-disable-next-line no-console
9
- onChange={(str, date) => console.log('onChange', str, date)}
9
+ onChange={(_event, str, date) => console.log('onChange', str, date)}
10
10
  />
11
11
  );
@@ -7,7 +7,7 @@ export const DatePickerControlled: React.FunctionComponent = () => {
7
7
  return (
8
8
  <React.Fragment>
9
9
  <Button onClick={() => setValue(initialValue)}>Reset date</Button>
10
- <DatePicker value={value} onChange={value => setValue(value)} />
10
+ <DatePicker value={value} onChange={(_event, value) => setValue(value)} />
11
11
  </React.Fragment>
12
12
  );
13
13
  };
@@ -206,7 +206,7 @@ const SearchInputBase: React.FunctionComponent<SearchInputProps> = ({
206
206
  setIsSearchMenuOpen(isAdvancedSearchOpen);
207
207
  }, [isAdvancedSearchOpen]);
208
208
 
209
- const onChangeHandler = (value: string, event: React.FormEvent<HTMLInputElement>) => {
209
+ const onChangeHandler = (event: React.FormEvent<HTMLInputElement>, value: string) => {
210
210
  if (onChange) {
211
211
  onChange(value, event);
212
212
  }
@@ -26,7 +26,7 @@ export interface TextInputGroupMainProps extends Omit<React.HTMLProps<HTMLDivEle
26
26
  /** Suggestion that will show up like a placeholder even with text in the input */
27
27
  hint?: string;
28
28
  /** Callback for when there is a change in the input field*/
29
- onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;
29
+ onChange?: (event: React.FormEvent<HTMLInputElement>, value: string) => void;
30
30
  /** Callback for when the input field is focused*/
31
31
  onFocus?: (event?: any) => void;
32
32
  /** Callback for when focus is lost on the input field*/
@@ -61,7 +61,7 @@ export const TextInputGroupMain: React.FunctionComponent<TextInputGroupMainProps
61
61
  const textInputGroupInputInputRef = innerRef || ref;
62
62
 
63
63
  const handleChange = (event: React.FormEvent<HTMLInputElement>) => {
64
- onChange(event.currentTarget.value, event);
64
+ onChange(event, event.currentTarget.value);
65
65
  };
66
66
 
67
67
  return (
@@ -27,7 +27,7 @@ export const TextInputGroupFilters: React.FunctionComponent = () => {
27
27
  const showSearchIcon = !currentChips.length;
28
28
 
29
29
  /** callback for updating the inputValue state in this component so that the input can be controlled */
30
- const handleInputChange = (value: string, _event: React.FormEvent<HTMLInputElement>) => {
30
+ const handleInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
31
31
  setInputValue(value);
32
32
  };
33
33
 
@@ -7,7 +7,7 @@ export const TextInputGroupUtilitiesAndIcon: React.FunctionComponent = () => {
7
7
  const [inputValue, setInputValue] = React.useState('');
8
8
 
9
9
  /** callback for updating the inputValue state in this component so that the input can be controlled */
10
- const handleInputChange = (value: string, _event: React.FormEvent<HTMLInputElement>) => {
10
+ const handleInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
11
11
  setInputValue(value);
12
12
  };
13
13
 
@@ -123,7 +123,7 @@ export const ComposableMultipleTypeaheadSelect: React.FunctionComponent = () =>
123
123
  textInputRef.current?.focus();
124
124
  };
125
125
 
126
- const onTextInputChange = (value: string) => {
126
+ const onTextInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
127
127
  setInputValue(value);
128
128
  };
129
129
 
@@ -135,7 +135,7 @@ export const ComposableTypeaheadSelect: React.FunctionComponent = () => {
135
135
  textInputRef.current?.focus();
136
136
  };
137
137
 
138
- const onTextInputChange = (value: string) => {
138
+ const onTextInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
139
139
  setInputValue(value);
140
140
  setIsSelected(false);
141
141
  };
@@ -44,7 +44,7 @@ export const AttributeValueFiltering: React.FunctionComponent = () => {
44
44
  const textInputGroupRef = React.useRef<HTMLDivElement>();
45
45
 
46
46
  /** callback for updating the inputValue state in this component so that the input can be controlled */
47
- const handleInputChange = (value: string, _event: React.FormEvent<HTMLInputElement>) => {
47
+ const handleInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
48
48
  setInputValue(value);
49
49
  };
50
50
 
@@ -31,7 +31,7 @@ export const AutoCompleteSearch: React.FunctionComponent = () => {
31
31
  const textInputGroupRef = React.useRef<HTMLDivElement>();
32
32
 
33
33
  /** callback for updating the inputValue state in this component so that the input can be controlled */
34
- const handleInputChange = (value: string, _event: React.FormEvent<HTMLInputElement>) => {
34
+ const handleInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
35
35
  setInputValue(value);
36
36
  };
37
37
 
@@ -109,7 +109,7 @@ export const SelectMultiTypeahead: React.FunctionComponent = () => {
109
109
  setIsOpen(!isOpen);
110
110
  };
111
111
 
112
- const onTextInputChange = (value: string) => {
112
+ const onTextInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
113
113
  setInputValue(value);
114
114
  };
115
115
 
@@ -67,7 +67,7 @@ export const SelectBasic: React.FunctionComponent = () => {
67
67
  setFocusedItemIndex(null);
68
68
  };
69
69
 
70
- const onTextInputChange = (value: string) => {
70
+ const onTextInputChange = (_event: React.FormEvent<HTMLInputElement>, value: string) => {
71
71
  setInputValue(value);
72
72
  setFilterValue(value);
73
73
  };