Skip to content

Commit

Permalink
inlude feedback passthrough on rich text component
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie-n committed Jun 19, 2024
1 parent 15efd71 commit 80c71f3
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 19 deletions.
5 changes: 4 additions & 1 deletion dist/components/form/Form.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ declare const Form: {
({ type, className, ...rest }: import("./components/FormCheck").FormCheckProps): React.JSX.Element;
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;
};
RichText: ({ modules, value, onChange, theme, importCallback, debug, ...rest }: import("./components/FormRichText").QuillEditorProps) => React.JSX.Element;
RichText: {
({ modules, value, onChange, theme, importCallback, debug, ...rest }: import("./components/FormRichText").QuillEditorProps): React.JSX.Element;
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;
};
DateTime: {
({ className, ...rest }: import("./components/FormDateTime").FormDateTimeProps): React.JSX.Element;
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;
Expand Down
2 changes: 1 addition & 1 deletion dist/components/form/Form.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/components/form/components/FormRichText.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export interface QuillEditorProps {
onChange?(value: string): any;
importCallback?(): any;
}
declare const FormRichText: ({ modules, value, onChange, theme, importCallback, debug, ...rest }: QuillEditorProps) => React.JSX.Element;
declare const FormRichText: {
({ modules, value, onChange, theme, importCallback, debug, ...rest }: QuillEditorProps): React.JSX.Element;
Feedback: import("react-bootstrap/esm/helpers").BsPrefixRefForwardingComponent<"div", import("react-bootstrap/esm/Feedback").FeedbackProps>;
};
export default FormRichText;
//# sourceMappingURL=FormRichText.d.ts.map
2 changes: 1 addition & 1 deletion dist/components/form/components/FormRichText.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions dist/components/form/components/FormRichText.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/components/form/components/FormRichText.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions dist/index.es.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25535,7 +25535,7 @@ var FormRichText = function (_a) {
var modules = _a.modules, value = _a.value, onChange = _a.onChange, theme = _a.theme, importCallback = _a.importCallback, debug = _a.debug, rest = __rest(_a, ["modules", "value", "onChange", "theme", "importCallback", "debug"]);
var quillRef = React.useRef(null);
var containerRef = React.useRef(null);
//Set debug mode, false results in no output.
// Set debug mode, false results in no output.
Quill.debug(debug || false);
var quillOptions = __assign(__assign({}, modules), { theme: theme || 'snow' });
var setValue = function (quillRef) {
Expand All @@ -25553,7 +25553,7 @@ var FormRichText = function (_a) {
React.useEffect(function () {
if (containerRef.current) {
if (importCallback) {
//Callback to import new modules into quill, needs to be done within the same instance as the quill object.
// Callback to import new modules into quill, needs to be done within the same instance as the quill object.
importCallback();
}
var container_1 = containerRef.current;
Expand All @@ -25572,8 +25572,9 @@ var FormRichText = function (_a) {
// NOTE: Run effect once on component mount, please recheck dependencies if effect is updated.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className });
return (React.createElement("div", { ref: containerRef, style: rest.style, id: rest.id, className: rest.className }));
};
FormRichText.Feedback = Feedback$1;

var FormDateTime = function (_a) {
var className = _a.className, rest = __rest(_a, ["className"]);
Expand Down
8 changes: 4 additions & 4 deletions dist/index.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/components/form/components/FormRichText.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useRef, CSSProperties, useEffect } from 'react';
import Feedback from 'react-bootstrap/esm/Feedback';
import Quill from 'quill';
import 'quill/dist/quill.snow.css';

Expand Down Expand Up @@ -88,4 +89,6 @@ const FormRichText = ({
);
};

FormRichText.Feedback = Feedback;

export default FormRichText;

0 comments on commit 80c71f3

Please sign in to comment.