pixelize-design-library 1.1.53 → 1.1.54

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.
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
2
  import { NoteTextAreaProps } from "./NoteTextAreaProps";
3
- export default function NoteTextArea({ width, handleSubmit, handleCancel, value, title, file, isEditable, saveButtonLoading, maxFileSize, maxFilesSizeError, maxNoteWordCount, }: NoteTextAreaProps): React.JSX.Element;
3
+ export default function NoteTextArea({ width, handleSubmit, handleCancel, value, title, file, isEditable, saveButtonLoading, maxFileSize, maxFilesSizeError, maxNoteWordCount, onChange, ref, }: NoteTextAreaProps): React.JSX.Element;
@@ -98,7 +98,7 @@ var countWords = function (text) {
98
98
  return text.trim().split(/\s+/).length;
99
99
  };
100
100
  function NoteTextArea(_a) {
101
- var _b = _a.width, width = _b === void 0 ? "100%" : _b, handleSubmit = _a.handleSubmit, handleCancel = _a.handleCancel, value = _a.value, title = _a.title, file = _a.file, _c = _a.isEditable, isEditable = _c === void 0 ? false : _c, saveButtonLoading = _a.saveButtonLoading, _d = _a.maxFileSize, maxFileSize = _d === void 0 ? 1 * 1024 * 1024 : _d, _e = _a.maxFilesSizeError, maxFilesSizeError = _e === void 0 ? "Some files are too large. Maximum allowed size is" : _e, _f = _a.maxNoteWordCount, maxNoteWordCount = _f === void 0 ? 15 : _f;
101
+ var _b = _a.width, width = _b === void 0 ? "100%" : _b, handleSubmit = _a.handleSubmit, handleCancel = _a.handleCancel, value = _a.value, title = _a.title, file = _a.file, _c = _a.isEditable, isEditable = _c === void 0 ? false : _c, saveButtonLoading = _a.saveButtonLoading, _d = _a.maxFileSize, maxFileSize = _d === void 0 ? 1 * 1024 * 1024 : _d, _e = _a.maxFilesSizeError, maxFilesSizeError = _e === void 0 ? "Some files are too large. Maximum allowed size is" : _e, _f = _a.maxNoteWordCount, maxNoteWordCount = _f === void 0 ? 15 : _f, onChange = _a.onChange, ref = _a.ref;
102
102
  var theme = (0, useCustomTheme_1.useCustomTheme)();
103
103
  var noteAreaRef = (0, react_1.useRef)(null);
104
104
  var _g = (0, react_1.useState)(false), isActive = _g[0], setIsActive = _g[1];
@@ -169,6 +169,7 @@ function NoteTextArea(_a) {
169
169
  };
170
170
  var handleNoteChange = function (event) {
171
171
  setNoteValue(event.target.value);
172
+ onChange === null || onChange === void 0 ? void 0 : onChange(event.target.value);
172
173
  adjustHeight();
173
174
  };
174
175
  (0, react_1.useEffect)(function () {
@@ -209,7 +210,7 @@ function NoteTextArea(_a) {
209
210
  var start = nameWithoutExtension.substring(0, maxLength - extension.length - 3);
210
211
  return "".concat(start, "...").concat(extension, " ");
211
212
  };
212
- return (react_1.default.createElement(Container, { style: { width: width }, isActive: isActive },
213
+ return (react_1.default.createElement(Container, { style: { width: width }, isActive: isActive, ref: ref },
213
214
  react_1.default.createElement(PlaceholderText, { isActive: !isActive, onClick: handleTextArea },
214
215
  react_1.default.createElement("span", null, "Add a note...")),
215
216
  react_1.default.createElement(TextAreaContainer, { isActive: isActive },
@@ -1,3 +1,4 @@
1
+ import { LegacyRef } from "react";
1
2
  export type NoteTextAreaProps = {
2
3
  width: number | string;
3
4
  handleSubmit: (noteValue: string, titleValue: string, file: File[], resetState: void) => void;
@@ -10,4 +11,6 @@ export type NoteTextAreaProps = {
10
11
  maxFileSize?: number;
11
12
  maxFilesSizeError?: string;
12
13
  maxNoteWordCount?: number;
14
+ onChange?: (value: string) => void;
15
+ ref?: LegacyRef<HTMLDivElement>;
13
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "1.1.53",
3
+ "version": "1.1.54",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",