@patternfly/react-core 4.217.4 → 4.218.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.217.4",
3
+ "version": "4.218.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",
@@ -34,9 +34,9 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.68.4",
38
- "@patternfly/react-styles": "^4.67.4",
39
- "@patternfly/react-tokens": "^4.69.4",
37
+ "@patternfly/react-icons": "^4.69.0",
38
+ "@patternfly/react-styles": "^4.68.0",
39
+ "@patternfly/react-tokens": "^4.70.0",
40
40
  "focus-trap": "6.2.2",
41
41
  "react-dropzone": "9.0.0",
42
42
  "tippy.js": "5.1.2",
@@ -60,5 +60,5 @@
60
60
  "react": "^16.8.0 || ^17.0.0",
61
61
  "react-dom": "^16.8.0 || ^17.0.0"
62
62
  },
63
- "gitHead": "ba782c2941a816480fc345e27ce9f15782a81298"
63
+ "gitHead": "5a409a664a4c75aea67d0c8d3d25de641e320f9e"
64
64
  }
@@ -78,6 +78,10 @@ export interface FileUploadFieldProps extends Omit<React.HTMLProps<HTMLDivElemen
78
78
  containerRef?: React.Ref<HTMLDivElement>;
79
79
  /** Text area text changed */
80
80
  onTextChange?: (text: string) => void;
81
+ /** Callback for when focus is lost on the text area field */
82
+ onTextAreaBlur?: (event?: any) => void;
83
+ /** Placeholder string to display in the empty text area field */
84
+ textAreaPlaceholder?: string;
81
85
  }
82
86
 
83
87
  export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({
@@ -90,6 +94,8 @@ export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({
90
94
  onClearButtonClick = () => {},
91
95
  onTextAreaClick,
92
96
  onTextChange,
97
+ onTextAreaBlur,
98
+ textAreaPlaceholder = '',
93
99
  className = '',
94
100
  isDisabled = false,
95
101
  isReadOnly = false,
@@ -169,6 +175,8 @@ export const FileUploadField: React.FunctionComponent<FileUploadFieldProps> = ({
169
175
  value={value as string}
170
176
  onChange={onTextAreaChange}
171
177
  onClick={onTextAreaClick}
178
+ onBlur={onTextAreaBlur}
179
+ placeholder={textAreaPlaceholder}
172
180
  />
173
181
  )}
174
182
  {isLoading && (
@@ -59,6 +59,7 @@ exports[`simple fileupload 1`] = `
59
59
  class="pf-c-form-control pf-m-resize-vertical"
60
60
  id="simple-text-file"
61
61
  name="simple-text-file"
62
+ placeholder=""
62
63
  />
63
64
  </div>
64
65
  <input
@@ -58,6 +58,7 @@ exports[`simple fileuploadfield 1`] = `
58
58
  class="pf-c-form-control pf-m-resize-vertical"
59
59
  id="custom-file-upload"
60
60
  name="custom-file-upload"
61
+ placeholder=""
61
62
  />
62
63
  </div>
63
64
  <p>
@@ -268,7 +268,8 @@ class CustomFileUpload extends React.Component {
268
268
  isLoading: false,
269
269
  isDragActive: false,
270
270
  hideDefaultPreview: false,
271
- children: false
271
+ children: false,
272
+ hasPlaceholderText: false
272
273
  };
273
274
  this.handleTextAreaChange = value => {
274
275
  this.setState({ value });
@@ -283,11 +284,12 @@ class CustomFileUpload extends React.Component {
283
284
  isLoading,
284
285
  isDragActive,
285
286
  hideDefaultPreview,
286
- children
287
+ children,
288
+ hasPlaceholderText
287
289
  } = this.state;
288
290
  return (
289
291
  <div>
290
- {['filename', 'isClearButtonDisabled', 'isDragActive', 'isLoading', 'hideDefaultPreview', 'children'].map(
292
+ {['filename', 'isClearButtonDisabled', 'isDragActive', 'isLoading', 'hideDefaultPreview', 'children', 'hasPlaceholderText'].map(
291
293
  stateKey => (
292
294
  <Checkbox
293
295
  key={stateKey}
@@ -321,6 +323,7 @@ class CustomFileUpload extends React.Component {
321
323
  isDragActive={isDragActive}
322
324
  hideDefaultPreview={hideDefaultPreview}
323
325
  browseButtonText="Upload"
326
+ textAreaPlaceholder={hasPlaceholderText ? "File preview" : ''}
324
327
  >
325
328
  {children && (
326
329
  <div className="pf-u-m-md">(A custom preview of the uploaded file can be passed as children)</div>