@semcore/feedback-form 6.40.0 → 16.0.0-prerelease.11
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/CHANGELOG.md +2 -2
- package/lib/cjs/FeedbackForm.js +9 -11
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/component/checkbox-button/CheckboxButton.js +5 -7
- package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/cjs/component/feedback-item/FeedbackItem.js +4 -4
- package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.js +6 -8
- package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/cjs/component/slider-rating/SliderRating.js +13 -17
- package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/cjs/style/slider-rating.shadow.css +1 -6
- package/lib/es6/FeedbackForm.js +9 -9
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/component/checkbox-button/CheckboxButton.js +5 -5
- package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/es6/component/feedback-item/FeedbackItem.js +4 -4
- package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.js +6 -6
- package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/es6/component/slider-rating/SliderRating.js +13 -15
- package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/es6/style/slider-rating.shadow.css +1 -6
- package/lib/esm/FeedbackForm.mjs +124 -107
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +47 -41
- package/lib/esm/component/feedback-item/FeedbackItem.mjs +44 -33
- package/lib/esm/component/feedback-rating/FeedbackRating.mjs +288 -244
- package/lib/esm/component/slider-rating/SliderRating.mjs +168 -134
- package/lib/esm/component/submit-button/SubmitButton.mjs +14 -12
- package/lib/esm/index.mjs +4 -4
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +20 -14
- package/lib/esm/translations/en.json.mjs +20 -14
- package/lib/esm/translations/es.json.mjs +20 -14
- package/lib/esm/translations/fr.json.mjs +20 -14
- package/lib/esm/translations/it.json.mjs +20 -14
- package/lib/esm/translations/ja.json.mjs +20 -14
- package/lib/esm/translations/ko.json.mjs +20 -14
- package/lib/esm/translations/nl.json.mjs +20 -14
- package/lib/esm/translations/pl.json.mjs +20 -14
- package/lib/esm/translations/pt.json.mjs +20 -14
- package/lib/esm/translations/sv.json.mjs +20 -14
- package/lib/esm/translations/tr.json.mjs +20 -14
- package/lib/esm/translations/vi.json.mjs +20 -14
- package/lib/esm/translations/zh.json.mjs +20 -14
- package/lib/types/component/checkbox-button/CheckboxButton.d.ts +1 -1
- package/package.json +16 -19
|
@@ -1,310 +1,354 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { sstyled
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
var
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { Field, Form } from "react-final-form";
|
|
13
|
+
import createFocusDecorator from "final-form-focus";
|
|
14
|
+
import SpinContainer from "@semcore/spin-container";
|
|
15
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
17
|
+
import Notice from "@semcore/notice";
|
|
18
|
+
import CheckM from "@semcore/icon/Check/m";
|
|
19
|
+
import WarnM from "@semcore/icon/Warning/m";
|
|
20
|
+
import { Text } from "@semcore/typography";
|
|
21
|
+
import FeedbackIllustration from "@semcore/illustration/Feedback";
|
|
22
|
+
import Link from "@semcore/link";
|
|
23
|
+
import SliderRating from "../slider-rating/SliderRating.mjs";
|
|
24
|
+
import Modal from "@semcore/modal";
|
|
25
|
+
import Textarea from "@semcore/textarea";
|
|
26
|
+
import { Flex, Box } from "@semcore/flex-box";
|
|
27
|
+
import { FeedbackItem } from "../feedback-item/FeedbackItem.mjs";
|
|
28
|
+
import { SubmitButton } from "../submit-button/SubmitButton.mjs";
|
|
29
|
+
import CheckboxButton from "../checkbox-button/CheckboxButton.mjs";
|
|
30
|
+
import Input from "@semcore/input";
|
|
31
|
+
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
32
|
+
import { NoticeBubbleManager, NoticeBubbleContainer } from "@semcore/notice-bubble";
|
|
33
|
+
var _excluded = ["header", "submitText", "formConfig", "notificationText", "notificationTitle", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail", "modalWidth"];
|
|
34
|
+
var style = (
|
|
35
35
|
/*__reshadow_css_start__*/
|
|
36
|
-
(
|
|
36
|
+
(sstyled.insert(
|
|
37
37
|
/*__inner_css_start__*/
|
|
38
|
-
".
|
|
39
|
-
"
|
|
38
|
+
".___SFeedbackRating_kmztw_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_kmztw_gg_ li{list-style:none}",
|
|
39
|
+
"kmztw_gg_"
|
|
40
40
|
), {
|
|
41
|
-
__SFeedbackRating: "
|
|
41
|
+
"__SFeedbackRating": "___SFeedbackRating_kmztw_gg_"
|
|
42
42
|
})
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
43
|
+
);
|
|
44
|
+
var FeedbackRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
45
|
+
_inherits(FeedbackRatingRoot2, _Component);
|
|
46
|
+
var _super = _createSuper(FeedbackRatingRoot2);
|
|
47
|
+
function FeedbackRatingRoot2() {
|
|
48
|
+
var _this;
|
|
49
|
+
_classCallCheck(this, FeedbackRatingRoot2);
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
55
|
+
error: false
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "manager", new NoticeBubbleManager());
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "focusDecorator", createFocusDecorator());
|
|
59
|
+
_defineProperty(_assertThisInitialized(_this), "handleChangeRating", function(rating) {
|
|
60
|
+
_this.asProps.onVisibleChange(true, rating);
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(_assertThisInitialized(_this), "handelCloseModal", function() {
|
|
63
|
+
_this.asProps.onVisibleChange(false, _this.asProps.rating);
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "handleChange", function(fn) {
|
|
66
|
+
return function(value, e) {
|
|
67
|
+
fn(e);
|
|
60
68
|
};
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
});
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "renderCheckbox", function(config, index) {
|
|
71
|
+
var initialValue = _this.props.initialValues[config.key];
|
|
72
|
+
return /* @__PURE__ */ React.createElement(Field, {
|
|
73
|
+
name: config.key,
|
|
74
|
+
initialValue,
|
|
66
75
|
type: "checkbox",
|
|
67
|
-
key:
|
|
68
|
-
}, function(
|
|
69
|
-
var
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
id:
|
|
72
|
-
label:
|
|
73
|
-
onChange: function(
|
|
74
|
-
return
|
|
76
|
+
key: config.key
|
|
77
|
+
}, function(_ref7) {
|
|
78
|
+
var input = _ref7.input;
|
|
79
|
+
return /* @__PURE__ */ React.createElement(FeedbackRating.Checkbox, _extends({}, input, {
|
|
80
|
+
id: config.key,
|
|
81
|
+
label: config.label,
|
|
82
|
+
onChange: function onChange(_checked, e) {
|
|
83
|
+
return input.onChange(e);
|
|
75
84
|
},
|
|
76
|
-
focused:
|
|
85
|
+
focused: index === 0
|
|
77
86
|
}));
|
|
78
87
|
});
|
|
79
|
-
})
|
|
80
|
-
|
|
88
|
+
});
|
|
89
|
+
_defineProperty(_assertThisInitialized(_this), "renderTextField", function(config) {
|
|
90
|
+
var _config$description;
|
|
91
|
+
var initialValue = _this.props.initialValues[config.key];
|
|
92
|
+
var label = typeof config.label === "string" ? /* @__PURE__ */ React.createElement(Text, {
|
|
81
93
|
mb: 2,
|
|
82
94
|
size: 200
|
|
83
|
-
},
|
|
84
|
-
|
|
95
|
+
}, config.label) : config.label;
|
|
96
|
+
var isDescriptionReactFragment = ((_config$description = config.description) === null || _config$description === void 0 ? void 0 : _config$description.type) === React.Fragment;
|
|
97
|
+
return /* @__PURE__ */ React.createElement(Flex, {
|
|
85
98
|
direction: "column"
|
|
86
|
-
}, /* @__PURE__ */
|
|
99
|
+
}, /* @__PURE__ */ React.createElement(Flex, {
|
|
87
100
|
tag: "label",
|
|
88
101
|
mt: 4,
|
|
89
|
-
htmlFor:
|
|
90
|
-
key:
|
|
91
|
-
},
|
|
92
|
-
name:
|
|
93
|
-
validate:
|
|
94
|
-
initialValue
|
|
102
|
+
htmlFor: config.key,
|
|
103
|
+
key: config.key
|
|
104
|
+
}, label), /* @__PURE__ */ React.createElement(FeedbackRating.Item, {
|
|
105
|
+
name: config.key,
|
|
106
|
+
validate: config.validate,
|
|
107
|
+
initialValue,
|
|
95
108
|
placement: "left-start",
|
|
96
109
|
flip: {
|
|
97
110
|
fallbackPlacements: ["right-start", "bottom"]
|
|
98
111
|
},
|
|
99
|
-
"aria-describedby":
|
|
100
|
-
}, function(
|
|
101
|
-
var
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
"aria-describedby": config.description ? config.key + "-description" : void 0
|
|
113
|
+
}, function(_ref8) {
|
|
114
|
+
var input = _ref8.input;
|
|
115
|
+
if (config.type === "textarea") {
|
|
116
|
+
return /* @__PURE__ */ React.createElement(Textarea, _extends({}, input, {
|
|
117
|
+
h: 80,
|
|
118
|
+
onChange: _this.handleChange(input.onChange),
|
|
119
|
+
id: config.key
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
if (config.type === "input" || config.type === "email") {
|
|
123
|
+
if (config.type === "email") {
|
|
124
|
+
input.autoComplete = "email";
|
|
125
|
+
input.type = "email";
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ React.createElement(Input, {
|
|
128
|
+
state: input.state
|
|
129
|
+
}, /* @__PURE__ */ React.createElement(Input.Value, _extends({}, input, {
|
|
130
|
+
onChange: _this.handleChange(input.onChange),
|
|
131
|
+
id: config.key
|
|
132
|
+
})));
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}), config.description && /* @__PURE__ */ React.createElement(Box, {
|
|
113
136
|
mt: 2
|
|
114
|
-
}, typeof
|
|
137
|
+
}, typeof config.description === "string" || isDescriptionReactFragment ? /* @__PURE__ */ React.createElement(Text, {
|
|
115
138
|
size: 200,
|
|
116
139
|
color: "text-secondary",
|
|
117
|
-
id:
|
|
118
|
-
},
|
|
119
|
-
})
|
|
140
|
+
id: config.key + "-description"
|
|
141
|
+
}, config.description) : config.description));
|
|
142
|
+
});
|
|
143
|
+
return _this;
|
|
120
144
|
}
|
|
121
|
-
|
|
145
|
+
_createClass(FeedbackRatingRoot2, [{
|
|
122
146
|
key: "headerId",
|
|
123
|
-
get: function() {
|
|
124
|
-
var
|
|
125
|
-
return "".concat(
|
|
147
|
+
get: function get() {
|
|
148
|
+
var uid = this.asProps.uid;
|
|
149
|
+
return "".concat(uid, "-feedback-rating-header");
|
|
126
150
|
}
|
|
127
151
|
}, {
|
|
128
152
|
key: "getHeaderProps",
|
|
129
|
-
value: function() {
|
|
153
|
+
value: function getHeaderProps() {
|
|
130
154
|
return {
|
|
131
155
|
id: this.headerId
|
|
132
156
|
};
|
|
133
157
|
}
|
|
134
158
|
}, {
|
|
135
159
|
key: "getItemProps",
|
|
136
|
-
value: function() {
|
|
137
|
-
var
|
|
160
|
+
value: function getItemProps() {
|
|
161
|
+
var validateOnBlur = this.asProps.validateOnBlur;
|
|
138
162
|
return {
|
|
139
|
-
validateOnBlur
|
|
163
|
+
validateOnBlur
|
|
140
164
|
};
|
|
141
165
|
}
|
|
142
166
|
}, {
|
|
143
167
|
key: "getNoticeTextId",
|
|
144
|
-
value: function() {
|
|
145
|
-
var
|
|
146
|
-
return "".concat(
|
|
168
|
+
value: function getNoticeTextId() {
|
|
169
|
+
var uid = this.asProps.uid;
|
|
170
|
+
return "".concat(uid, "-feedback-rating-notice");
|
|
147
171
|
}
|
|
148
172
|
}, {
|
|
149
173
|
key: "componentDidUpdate",
|
|
150
|
-
value: function(
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
icon: /* @__PURE__ */ e.createElement(de, {
|
|
157
|
-
color: "green-400"
|
|
158
|
-
}),
|
|
159
|
-
children: r("successMessage"),
|
|
160
|
-
initialAnimation: !0,
|
|
161
|
-
duration: 5e3
|
|
174
|
+
value: function componentDidUpdate(prevProps) {
|
|
175
|
+
var _this2 = this;
|
|
176
|
+
var _this$asProps = this.asProps, status = _this$asProps.status, getI18nText = _this$asProps.getI18nText;
|
|
177
|
+
if (prevProps.status !== status) {
|
|
178
|
+
this.setState({
|
|
179
|
+
error: false
|
|
162
180
|
});
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
181
|
+
if (status === "success") {
|
|
182
|
+
setTimeout(function() {
|
|
183
|
+
_this2.manager.add({
|
|
184
|
+
icon: /* @__PURE__ */ React.createElement(CheckM, {
|
|
185
|
+
color: "green-400"
|
|
186
|
+
}),
|
|
187
|
+
children: getI18nText("successMessage"),
|
|
188
|
+
initialAnimation: true,
|
|
189
|
+
duration: 5e3
|
|
190
|
+
});
|
|
191
|
+
}, 300);
|
|
192
|
+
} else if (status === "error") {
|
|
193
|
+
this.setState({
|
|
194
|
+
error: true
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
166
198
|
}
|
|
167
199
|
}, {
|
|
168
200
|
key: "render",
|
|
169
|
-
value: function() {
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}), /* @__PURE__ */
|
|
185
|
-
|
|
186
|
-
"aria-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}, /* @__PURE__ */ e.createElement(P, a.cn("Text", {
|
|
201
|
+
value: function render() {
|
|
202
|
+
var _ref = this.asProps, _ref2 = this.asProps, _ref4, _this3 = this;
|
|
203
|
+
var _this$asProps2 = this.asProps, header = _this$asProps2.header, submitText = _this$asProps2.submitText, formConfig = _this$asProps2.formConfig, notificationText = _this$asProps2.notificationText, notificationTitle = _this$asProps2.notificationTitle, learnMoreLink = _this$asProps2.learnMoreLink;
|
|
204
|
+
_this$asProps2.Children;
|
|
205
|
+
var styles = _this$asProps2.styles, forwardRef = _this$asProps2.forwardRef, status = _this$asProps2.status, theme = _this$asProps2.theme, background = _this$asProps2.background, rating = _this$asProps2.rating, visible = _this$asProps2.visible;
|
|
206
|
+
_this$asProps2.onVisibleChange;
|
|
207
|
+
var notificationVisible = _this$asProps2.notificationVisible, onNotificationClose = _this$asProps2.onNotificationClose, getI18nText = _this$asProps2.getI18nText, errorFeedbackEmail = _this$asProps2.errorFeedbackEmail, modalWidth = _this$asProps2.modalWidth, other = _objectWithoutProperties(_this$asProps2, _excluded);
|
|
208
|
+
var SFeedbackRating = Modal;
|
|
209
|
+
var checkboxFields = formConfig.filter(function(item) {
|
|
210
|
+
return item.type === "checkbox";
|
|
211
|
+
});
|
|
212
|
+
var textFields = formConfig.filter(function(item) {
|
|
213
|
+
return item.type === "textarea" || item.type === "input" || item.type === "email";
|
|
214
|
+
});
|
|
215
|
+
var notificationId = this.getNoticeTextId();
|
|
216
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Box, assignProps({}, _ref2), /* @__PURE__ */ React.createElement(Notice, _ref4.cn("Notice", {
|
|
217
|
+
"visible": notificationVisible,
|
|
218
|
+
"aria-label": getI18nText("leaveFeedback"),
|
|
219
|
+
"tag": Flex,
|
|
220
|
+
"alignItems": notificationTitle ? "flex-start" : "center"
|
|
221
|
+
}), /* @__PURE__ */ React.createElement(Notice.Label, {
|
|
191
222
|
mr: 3,
|
|
192
|
-
|
|
193
|
-
}),
|
|
223
|
+
"aria-hidden": true
|
|
224
|
+
}, /* @__PURE__ */ React.createElement(FeedbackIllustration, _ref4.cn("FeedbackIllustration", {}))), /* @__PURE__ */ React.createElement(Notice.Content, null, notificationTitle ? /* @__PURE__ */ React.createElement(Notice.Title, null, notificationTitle) : null, /* @__PURE__ */ React.createElement(Notice.Text, {
|
|
225
|
+
tag: Flex,
|
|
226
|
+
alignItems: notificationTitle ? "flex-start" : "center"
|
|
227
|
+
}, /* @__PURE__ */ React.createElement(Text, _ref4.cn("Text", {
|
|
228
|
+
"mr": 3,
|
|
229
|
+
"id": notificationId
|
|
230
|
+
}), notificationText), /* @__PURE__ */ React.createElement(Notice.Actions, {
|
|
194
231
|
mt: 0
|
|
195
|
-
}, /* @__PURE__ */
|
|
196
|
-
value:
|
|
197
|
-
onChange: this.handleChangeRating,
|
|
198
|
-
"aria-labelledby":
|
|
199
|
-
}))),
|
|
200
|
-
ml: 3,
|
|
201
|
-
href:
|
|
202
|
-
}),
|
|
203
|
-
onClick:
|
|
204
|
-
})), /* @__PURE__ */
|
|
205
|
-
visible:
|
|
206
|
-
onClose: this.handelCloseModal,
|
|
207
|
-
p: 0,
|
|
208
|
-
"use:w":
|
|
232
|
+
}, /* @__PURE__ */ React.createElement(SliderRating, _ref4.cn("SliderRating", {
|
|
233
|
+
"value": rating,
|
|
234
|
+
"onChange": this.handleChangeRating,
|
|
235
|
+
"aria-labelledby": notificationId
|
|
236
|
+
}))), learnMoreLink && /* @__PURE__ */ React.createElement(Link, _ref4.cn("Link", {
|
|
237
|
+
"ml": 3,
|
|
238
|
+
"href": learnMoreLink
|
|
239
|
+
}), getI18nText("learnMore")))), /* @__PURE__ */ React.createElement(Notice.Close, {
|
|
240
|
+
onClick: onNotificationClose
|
|
241
|
+
})), /* @__PURE__ */ React.createElement(SFeedbackRating, _ref4.cn("SFeedbackRating", _objectSpread({}, assignProps({
|
|
242
|
+
"visible": visible,
|
|
243
|
+
"onClose": this.handelCloseModal,
|
|
244
|
+
"p": 0,
|
|
245
|
+
"use:w": modalWidth !== null && modalWidth !== void 0 ? modalWidth : 440,
|
|
209
246
|
"aria-labelledby": this.headerId
|
|
210
|
-
},
|
|
211
|
-
decorators: [this.focusDecorator]
|
|
212
|
-
},
|
|
213
|
-
var
|
|
214
|
-
return
|
|
215
|
-
background:
|
|
216
|
-
theme:
|
|
217
|
-
size: "xl",
|
|
218
|
-
loading:
|
|
219
|
-
p: 1,
|
|
220
|
-
m: 9
|
|
221
|
-
}), /* @__PURE__ */
|
|
222
|
-
justifyContent: "center"
|
|
223
|
-
}), /* @__PURE__ */
|
|
224
|
-
value:
|
|
225
|
-
readonly:
|
|
226
|
-
}))), (
|
|
227
|
-
tag: "form",
|
|
228
|
-
noValidate:
|
|
229
|
-
method: "POST",
|
|
230
|
-
ref:
|
|
231
|
-
},
|
|
232
|
-
onSubmit:
|
|
233
|
-
})), /* @__PURE__ */
|
|
234
|
-
name: "rating",
|
|
235
|
-
initialValue:
|
|
236
|
-
}), function(
|
|
237
|
-
var
|
|
238
|
-
return /* @__PURE__ */
|
|
247
|
+
}, _ref))), /* @__PURE__ */ React.createElement(Form, _ref4.cn("Form", _objectSpread({
|
|
248
|
+
"decorators": [this.focusDecorator]
|
|
249
|
+
}, other)), function(api) {
|
|
250
|
+
var _ref5;
|
|
251
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SpinContainer, _ref5.cn("SpinContainer", {
|
|
252
|
+
"background": background,
|
|
253
|
+
"theme": theme,
|
|
254
|
+
"size": "xl",
|
|
255
|
+
"loading": status !== "loading" ? api.submitting : status === "loading",
|
|
256
|
+
"p": 1,
|
|
257
|
+
"m": 9
|
|
258
|
+
}), /* @__PURE__ */ React.createElement(Flex, _ref5.cn("Flex", {
|
|
259
|
+
"justifyContent": "center"
|
|
260
|
+
}), /* @__PURE__ */ React.createElement(SliderRating, _ref5.cn("SliderRating", {
|
|
261
|
+
"value": rating,
|
|
262
|
+
"readonly": true
|
|
263
|
+
}))), (header === null || header === void 0 ? void 0 : header.type) === FeedbackRating.Header ? header : /* @__PURE__ */ React.createElement(FeedbackRating.Header, null, header), /* @__PURE__ */ React.createElement(Box, _ref5.cn("Box", _objectSpread(_objectSpread({
|
|
264
|
+
"tag": "form",
|
|
265
|
+
"noValidate": true,
|
|
266
|
+
"method": "POST",
|
|
267
|
+
"ref": forwardRef
|
|
268
|
+
}, other), {}, {
|
|
269
|
+
"onSubmit": api.handleSubmit
|
|
270
|
+
})), /* @__PURE__ */ React.createElement(Field, _ref5.cn("Field", {
|
|
271
|
+
"name": "rating",
|
|
272
|
+
"initialValue": rating
|
|
273
|
+
}), function(_ref9) {
|
|
274
|
+
var input = _ref9.input;
|
|
275
|
+
return /* @__PURE__ */ React.createElement("input", _extends({}, input, {
|
|
239
276
|
type: "hidden"
|
|
240
277
|
}));
|
|
241
|
-
}), /* @__PURE__ */
|
|
242
|
-
role: "group",
|
|
243
|
-
"aria-labelledby":
|
|
244
|
-
}),
|
|
245
|
-
return
|
|
246
|
-
})),
|
|
247
|
-
return
|
|
248
|
-
}),
|
|
249
|
-
theme: "warning",
|
|
250
|
-
mt: 4,
|
|
251
|
-
mb: 4
|
|
252
|
-
}), /* @__PURE__ */
|
|
253
|
-
email:
|
|
254
|
-
}))), /* @__PURE__ */
|
|
255
|
-
mt: 4,
|
|
256
|
-
justifyContent: "center"
|
|
257
|
-
}), /* @__PURE__ */
|
|
258
|
-
loading:
|
|
278
|
+
}), /* @__PURE__ */ React.createElement("div", _ref5.cn("div", {
|
|
279
|
+
"role": "group",
|
|
280
|
+
"aria-labelledby": _this3.headerId
|
|
281
|
+
}), checkboxFields.map(function(formConfigItem, index) {
|
|
282
|
+
return _this3.renderCheckbox(formConfigItem, index);
|
|
283
|
+
})), textFields.map(function(formConfigItem) {
|
|
284
|
+
return _this3.renderTextField(formConfigItem);
|
|
285
|
+
}), _this3.state.error && /* @__PURE__ */ React.createElement(Notice, _ref5.cn("Notice", {
|
|
286
|
+
"theme": "warning",
|
|
287
|
+
"mt": 4,
|
|
288
|
+
"mb": 4
|
|
289
|
+
}), /* @__PURE__ */ React.createElement(Notice.Label, null, /* @__PURE__ */ React.createElement(WarnM, _ref5.cn("WarnM", {}))), /* @__PURE__ */ React.createElement(Notice.Content, null, getI18nText("errorMessage", {
|
|
290
|
+
email: errorFeedbackEmail
|
|
291
|
+
}))), /* @__PURE__ */ React.createElement(Flex, _ref5.cn("Flex", {
|
|
292
|
+
"mt": 4,
|
|
293
|
+
"justifyContent": "center"
|
|
294
|
+
}), /* @__PURE__ */ React.createElement(FeedbackRating.Submit, {
|
|
295
|
+
loading: status !== "loading" ? api.submitting : status === "loading",
|
|
259
296
|
size: "l"
|
|
260
|
-
},
|
|
261
|
-
})), /* @__PURE__ */
|
|
262
|
-
manager: this.manager
|
|
297
|
+
}, submitText !== null && submitText !== void 0 ? submitText : getI18nText("submitButton")))));
|
|
298
|
+
})), /* @__PURE__ */ React.createElement(NoticeBubbleContainer, _ref4.cn("NoticeBubbleContainer", {
|
|
299
|
+
"manager": this.manager
|
|
263
300
|
})));
|
|
264
301
|
}
|
|
265
|
-
}])
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
302
|
+
}]);
|
|
303
|
+
return FeedbackRatingRoot2;
|
|
304
|
+
}(Component);
|
|
305
|
+
_defineProperty(FeedbackRatingRoot, "displayName", "FeedbackRatingForm");
|
|
306
|
+
_defineProperty(FeedbackRatingRoot, "style", style);
|
|
307
|
+
_defineProperty(FeedbackRatingRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
|
|
308
|
+
_defineProperty(FeedbackRatingRoot, "defaultProps", {
|
|
309
|
+
onSubmit: function onSubmit() {
|
|
272
310
|
},
|
|
273
|
-
i18n:
|
|
311
|
+
i18n: localizedMessages,
|
|
274
312
|
locale: "en"
|
|
275
313
|
});
|
|
276
|
-
|
|
277
|
-
description: function(
|
|
314
|
+
_defineProperty(FeedbackRatingRoot, "validate", {
|
|
315
|
+
description: function description(error) {
|
|
278
316
|
return function() {
|
|
279
|
-
var
|
|
280
|
-
|
|
281
|
-
|
|
317
|
+
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
318
|
+
var words = value.split(/\s+/);
|
|
319
|
+
var symbols = words.join(" ");
|
|
320
|
+
if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {
|
|
321
|
+
return error;
|
|
322
|
+
}
|
|
282
323
|
};
|
|
283
324
|
},
|
|
284
|
-
email: function(
|
|
325
|
+
email: function email(error) {
|
|
285
326
|
return function() {
|
|
286
|
-
var
|
|
287
|
-
if (
|
|
288
|
-
return
|
|
327
|
+
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
328
|
+
if (Boolean(value) && !/.+@.+\..+/i.test(String(value).toLowerCase())) {
|
|
329
|
+
return error;
|
|
330
|
+
}
|
|
289
331
|
};
|
|
290
332
|
}
|
|
291
333
|
});
|
|
292
|
-
function
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
334
|
+
function Header(props) {
|
|
335
|
+
var _ref3 = arguments[0], _ref6;
|
|
336
|
+
var styles = props.styles;
|
|
337
|
+
var SHeader = Text;
|
|
338
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SHeader, _ref6.cn("SHeader", _objectSpread({}, assignProps({
|
|
339
|
+
"size": 300,
|
|
340
|
+
"tag": "h2",
|
|
341
|
+
"mb": 4,
|
|
342
|
+
"mt": 4,
|
|
343
|
+
"textAlign": "center"
|
|
344
|
+
}, _ref3))));
|
|
301
345
|
}
|
|
302
|
-
var
|
|
303
|
-
Header
|
|
304
|
-
Item:
|
|
305
|
-
Checkbox:
|
|
306
|
-
Submit:
|
|
346
|
+
var FeedbackRating = createComponent(FeedbackRatingRoot, {
|
|
347
|
+
Header,
|
|
348
|
+
Item: FeedbackItem,
|
|
349
|
+
Checkbox: CheckboxButton,
|
|
350
|
+
Submit: SubmitButton
|
|
307
351
|
});
|
|
308
352
|
export {
|
|
309
|
-
|
|
353
|
+
FeedbackRating as default
|
|
310
354
|
};
|