@sb1/ffe-feedback-react 100.1.0 → 100.2.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/es/Feedback.js +4 -1
- package/lib/Feedback.js +4 -1
- package/package.json +8 -8
- package/types/Feedback.d.ts +2 -1
package/es/Feedback.js
CHANGED
|
@@ -8,7 +8,7 @@ import { HighFive } from './HighFive';
|
|
|
8
8
|
export var Feedback = function (_a) {
|
|
9
9
|
var _b;
|
|
10
10
|
var _c;
|
|
11
|
-
var _d = _a.headingLevel, headingLevel = _d === void 0 ? 4 : _d, _e = _a.locale, locale = _e === void 0 ? 'nb' : _e, onThumbClick = _a.onThumbClick, onFeedbackSend = _a.onFeedbackSend, bgColor = _a.bgColor, contactLink = _a.contactLink, texts = _a.texts, className = _a.className, _f = _a.includeConsent, includeConsent = _f === void 0 ? false : _f;
|
|
11
|
+
var _d = _a.headingLevel, headingLevel = _d === void 0 ? 4 : _d, _e = _a.locale, locale = _e === void 0 ? 'nb' : _e, onThumbClick = _a.onThumbClick, onFeedbackSend = _a.onFeedbackSend, onFinish = _a.onFinish, bgColor = _a.bgColor, contactLink = _a.contactLink, texts = _a.texts, className = _a.className, _f = _a.includeConsent, includeConsent = _f === void 0 ? false : _f;
|
|
12
12
|
var feedbackSentRef = useRef(null);
|
|
13
13
|
var expandedRef = useRef(null);
|
|
14
14
|
var _g = useState(false), expanded = _g[0], setExpanded = _g[1];
|
|
@@ -34,6 +34,9 @@ export var Feedback = function (_a) {
|
|
|
34
34
|
if (feedbackText && feedbackText.length > 0) {
|
|
35
35
|
onFeedbackSend(feedbackText, consentGiven);
|
|
36
36
|
}
|
|
37
|
+
else if (onFinish) {
|
|
38
|
+
onFinish();
|
|
39
|
+
}
|
|
37
40
|
};
|
|
38
41
|
var renderHeading = function (level, text, options) {
|
|
39
42
|
var _a;
|
package/lib/Feedback.js
CHANGED
|
@@ -47,7 +47,7 @@ var HighFive_1 = require("./HighFive");
|
|
|
47
47
|
var Feedback = function (_a) {
|
|
48
48
|
var _b;
|
|
49
49
|
var _c;
|
|
50
|
-
var _d = _a.headingLevel, headingLevel = _d === void 0 ? 4 : _d, _e = _a.locale, locale = _e === void 0 ? 'nb' : _e, onThumbClick = _a.onThumbClick, onFeedbackSend = _a.onFeedbackSend, bgColor = _a.bgColor, contactLink = _a.contactLink, texts = _a.texts, className = _a.className, _f = _a.includeConsent, includeConsent = _f === void 0 ? false : _f;
|
|
50
|
+
var _d = _a.headingLevel, headingLevel = _d === void 0 ? 4 : _d, _e = _a.locale, locale = _e === void 0 ? 'nb' : _e, onThumbClick = _a.onThumbClick, onFeedbackSend = _a.onFeedbackSend, onFinish = _a.onFinish, bgColor = _a.bgColor, contactLink = _a.contactLink, texts = _a.texts, className = _a.className, _f = _a.includeConsent, includeConsent = _f === void 0 ? false : _f;
|
|
51
51
|
var feedbackSentRef = (0, react_1.useRef)(null);
|
|
52
52
|
var expandedRef = (0, react_1.useRef)(null);
|
|
53
53
|
var _g = (0, react_1.useState)(false), expanded = _g[0], setExpanded = _g[1];
|
|
@@ -73,6 +73,9 @@ var Feedback = function (_a) {
|
|
|
73
73
|
if (feedbackText && feedbackText.length > 0) {
|
|
74
74
|
onFeedbackSend(feedbackText, consentGiven);
|
|
75
75
|
}
|
|
76
|
+
else if (onFinish) {
|
|
77
|
+
onFinish();
|
|
78
|
+
}
|
|
76
79
|
};
|
|
77
80
|
var renderHeading = function (level, text, options) {
|
|
78
81
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-feedback-react",
|
|
3
|
-
"version": "100.
|
|
3
|
+
"version": "100.2.0",
|
|
4
4
|
"description": "React component for ffe-feedback",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"test:watch": "ffe-buildtool jest --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sb1/ffe-buttons-react": "^100.
|
|
29
|
-
"@sb1/ffe-core-react": "^100.
|
|
30
|
-
"@sb1/ffe-feedback": "^100.
|
|
31
|
-
"@sb1/ffe-form-react": "^100.
|
|
32
|
-
"@sb1/ffe-icons-react": "^100.
|
|
28
|
+
"@sb1/ffe-buttons-react": "^100.2.0",
|
|
29
|
+
"@sb1/ffe-core-react": "^100.2.0",
|
|
30
|
+
"@sb1/ffe-feedback": "^100.2.0",
|
|
31
|
+
"@sb1/ffe-form-react": "^100.2.0",
|
|
32
|
+
"@sb1/ffe-icons-react": "^100.2.0",
|
|
33
33
|
"classnames": "^2.3.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@sb1/ffe-buildtool": "^100.
|
|
36
|
+
"@sb1/ffe-buildtool": "^100.2.0",
|
|
37
37
|
"eslint": "^9.22.0",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-dom": "^18.2.0"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "055b3751618e57967c8558f5c41469b32e6a79dc"
|
|
48
48
|
}
|
package/types/Feedback.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface FeedbackProps {
|
|
|
9
9
|
locale?: Locale;
|
|
10
10
|
onThumbClick: (thumb: Thumb) => void;
|
|
11
11
|
onFeedbackSend: (feedbackText: string, consent?: boolean) => void;
|
|
12
|
+
onFinish?: () => void;
|
|
12
13
|
bgColor?: BgColor;
|
|
13
14
|
contactLink?: FeedbackExpandedProps['contactLink'];
|
|
14
15
|
texts?: {
|
|
@@ -18,5 +19,5 @@ export interface FeedbackProps {
|
|
|
18
19
|
className?: string;
|
|
19
20
|
includeConsent?: boolean;
|
|
20
21
|
}
|
|
21
|
-
export declare const Feedback: ({ headingLevel, locale, onThumbClick, onFeedbackSend, bgColor, contactLink, texts, className, includeConsent, }: FeedbackProps) => React.JSX.Element;
|
|
22
|
+
export declare const Feedback: ({ headingLevel, locale, onThumbClick, onFeedbackSend, onFinish, bgColor, contactLink, texts, className, includeConsent, }: FeedbackProps) => React.JSX.Element;
|
|
22
23
|
export {};
|