@semcore/feedback-form 16.1.1 → 16.1.2-prerelease.3
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 +6 -0
- package/README.md +1 -31
- package/lib/cjs/FeedbackForm.js +22 -23
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/component/checkbox-button/CheckboxButton.js +15 -15
- package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/cjs/component/feedback-item/FeedbackItem.js +8 -8
- package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.js +36 -37
- package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/lib/cjs/component/slider-rating/SliderRating.js +29 -30
- package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/cjs/component/submit-button/SubmitButton.js +1 -1
- package/lib/cjs/component/submit-button/SubmitButton.js.map +1 -1
- package/lib/cjs/index.d.js +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/FeedbackForm.js +21 -21
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/component/checkbox-button/CheckboxButton.js +13 -12
- package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/es6/component/feedback-item/FeedbackItem.js +7 -7
- package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.js +36 -36
- package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/lib/es6/component/slider-rating/SliderRating.js +27 -27
- package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/es6/component/submit-button/SubmitButton.js +1 -1
- package/lib/es6/component/submit-button/SubmitButton.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/FeedbackForm.mjs +23 -21
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +16 -13
- package/lib/esm/component/feedback-item/FeedbackItem.mjs +6 -6
- package/lib/esm/component/feedback-rating/FeedbackRating.mjs +34 -32
- package/lib/esm/component/slider-rating/SliderRating.mjs +29 -27
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/component/feedback-item/FeedbackItem.d.ts +3 -3
- package/lib/types/component/feedback-rating/FeedbackRating.d.ts +8 -8
- package/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +8 -7
- package/lib/types/component/slider-rating/SliderRating.d.ts +3 -3
- package/lib/types/component/submit-button/SubmitButton.d.ts +1 -1
- package/lib/types/index.d.ts +5 -6
- package/package.json +17 -17
|
@@ -2,36 +2,40 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
6
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
|
|
7
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
8
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
9
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { Box } from "@semcore/flex-box";
|
|
10
|
+
import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
|
|
11
11
|
import Checkbox from "@semcore/checkbox";
|
|
12
|
+
import { Box } from "@semcore/flex-box";
|
|
13
|
+
import React from "react";
|
|
12
14
|
var _excluded = ["styles", "id", "label", "type", "focused"];
|
|
15
|
+
function _callSuper(t, o, e) {
|
|
16
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
17
|
+
}
|
|
13
18
|
/*!__reshadow-styles__:"../../style/checkbox-button.shadow.css"*/
|
|
14
19
|
var style = (
|
|
15
20
|
/*__reshadow_css_start__*/
|
|
16
21
|
(sstyled.insert(
|
|
17
22
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
23
|
+
".___SCheckboxButton_1ka27_gg_{margin-top:var(--intergalactic-spacing-2x, 8px);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-rounded-medium, 6px)}.___SCheckboxButton_1ka27_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x, 12px);box-sizing:border-box}.___SCheckboxButton_1ka27_gg_.__checked_1ka27_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}@media (hover:hover){.___SCheckboxButton_1ka27_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}.___SCheckboxButton_1ka27_gg_.__checked_1ka27_gg_:hover{background-color:rgba(0,143,248,.2)}}",
|
|
19
24
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
25
|
+
"1ka27_gg_"
|
|
21
26
|
), /*__reshadow_css_end__*/
|
|
22
27
|
{
|
|
23
|
-
"__SCheckboxButton": "
|
|
24
|
-
"_checked": "
|
|
28
|
+
"__SCheckboxButton": "___SCheckboxButton_1ka27_gg_",
|
|
29
|
+
"_checked": "__checked_1ka27_gg_"
|
|
25
30
|
})
|
|
26
31
|
);
|
|
27
32
|
var CheckboxButtonRoot = /* @__PURE__ */ function(_Component) {
|
|
28
|
-
_inherits(CheckboxButtonRoot2, _Component);
|
|
29
|
-
var _super = _createSuper(CheckboxButtonRoot2);
|
|
30
33
|
function CheckboxButtonRoot2() {
|
|
31
34
|
_classCallCheck(this, CheckboxButtonRoot2);
|
|
32
|
-
return
|
|
35
|
+
return _callSuper(this, CheckboxButtonRoot2, arguments);
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
_inherits(CheckboxButtonRoot2, _Component);
|
|
38
|
+
return _createClass(CheckboxButtonRoot2, [{
|
|
35
39
|
key: "render",
|
|
36
40
|
value: function render() {
|
|
37
41
|
var _ref = this.asProps, _ref2;
|
|
@@ -50,7 +54,6 @@ var CheckboxButtonRoot = /* @__PURE__ */ function(_Component) {
|
|
|
50
54
|
}, label)));
|
|
51
55
|
}
|
|
52
56
|
}]);
|
|
53
|
-
return CheckboxButtonRoot2;
|
|
54
57
|
}(Component);
|
|
55
58
|
_defineProperty(CheckboxButtonRoot, "style", style);
|
|
56
59
|
var CheckboxButton = createComponent(CheckboxButtonRoot);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Field } from "react-final-form";
|
|
6
|
-
import Tooltip from "@semcore/tooltip";
|
|
7
|
-
import pick from "@semcore/core/lib/utils/pick";
|
|
8
|
-
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
9
4
|
import { assignProps } from "@semcore/core";
|
|
5
|
+
import pick from "@semcore/core/lib/utils/pick";
|
|
10
6
|
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
7
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
8
|
+
import Tooltip from "@semcore/tooltip";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Field } from "react-final-form";
|
|
11
11
|
var _excluded = ["Children", "tag", "uid", "tooltipProps"], _excluded2 = ["input", "meta"];
|
|
12
12
|
var deafultTooltipPropsList = ["title", "theme", "strategy", "modifiers", "placement", "interaction", "timeout", "visible", "defaultVisible", "onVisibleChange", "offset", "preventOverflow", "arrow", "flip", "computeStyles", "eventListeners", "onFirstUpdate"];
|
|
13
13
|
function FeedbackItem(_ref) {
|
|
@@ -23,7 +23,7 @@ function FeedbackItem(_ref) {
|
|
|
23
23
|
var popperId = "".concat(uid, "-error-description");
|
|
24
24
|
var ariaDescribedBy = props["aria-describedby"];
|
|
25
25
|
var inputProps = assignProps(_objectSpread(_objectSpread({}, propsForElement(other)), {}, {
|
|
26
|
-
state: errorState ? "invalid" : "normal",
|
|
26
|
+
"state": errorState ? "invalid" : "normal",
|
|
27
27
|
"aria-invalid": errorState ? true : false,
|
|
28
28
|
"aria-describedby": meta.active ? errorState ? popperId : ariaDescribedBy : void 0
|
|
29
29
|
}), input);
|
|
@@ -3,76 +3,78 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
-
import
|
|
6
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
7
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
|
|
8
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
9
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
9
10
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
-
import {
|
|
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";
|
|
11
|
+
import { createComponent, sstyled, assignProps, Component } from "@semcore/core";
|
|
15
12
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
13
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
17
|
-
import
|
|
14
|
+
import { Box, Flex } from "@semcore/flex-box";
|
|
18
15
|
import CheckM from "@semcore/icon/Check/m";
|
|
19
16
|
import WarnM from "@semcore/icon/Warning/m";
|
|
20
|
-
import { Text } from "@semcore/typography";
|
|
21
17
|
import FeedbackIllustration from "@semcore/illustration/Feedback";
|
|
18
|
+
import Input from "@semcore/input";
|
|
22
19
|
import Link from "@semcore/link";
|
|
23
|
-
import SliderRating from "../slider-rating/SliderRating.mjs";
|
|
24
20
|
import Modal from "@semcore/modal";
|
|
21
|
+
import Notice from "@semcore/notice";
|
|
22
|
+
import { NoticeBubbleContainer, NoticeBubbleManager } from "@semcore/notice-bubble";
|
|
23
|
+
import SpinContainer from "@semcore/spin-container";
|
|
25
24
|
import Textarea from "@semcore/textarea";
|
|
26
|
-
import {
|
|
25
|
+
import { Text } from "@semcore/typography";
|
|
26
|
+
import createFocusDecorator from "final-form-focus";
|
|
27
|
+
import React from "react";
|
|
28
|
+
import { Form, Field } from "react-final-form";
|
|
29
|
+
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
30
|
+
import CheckboxButton from "../checkbox-button/CheckboxButton.mjs";
|
|
27
31
|
import { FeedbackItem } from "../feedback-item/FeedbackItem.mjs";
|
|
32
|
+
import SliderRating from "../slider-rating/SliderRating.mjs";
|
|
28
33
|
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
34
|
var _excluded = ["header", "submitText", "formConfig", "notificationText", "notificationTitle", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail", "modalWidth"];
|
|
35
|
+
function _callSuper(t, o, e) {
|
|
36
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
37
|
+
}
|
|
34
38
|
/*!__reshadow-styles__:"../../style/feedback-rating.shadow.css"*/
|
|
35
39
|
var style = (
|
|
36
40
|
/*__reshadow_css_start__*/
|
|
37
41
|
(sstyled.insert(
|
|
38
42
|
/*__inner_css_start__*/
|
|
39
|
-
".
|
|
43
|
+
".___SFeedbackRating_ckgh6_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_ckgh6_gg_ li{list-style:none}",
|
|
40
44
|
/*__inner_css_end__*/
|
|
41
|
-
"
|
|
45
|
+
"ckgh6_gg_"
|
|
42
46
|
), /*__reshadow_css_end__*/
|
|
43
47
|
{
|
|
44
|
-
"__SFeedbackRating": "
|
|
48
|
+
"__SFeedbackRating": "___SFeedbackRating_ckgh6_gg_"
|
|
45
49
|
})
|
|
46
50
|
);
|
|
47
51
|
var FeedbackRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
48
|
-
_inherits(FeedbackRatingRoot2, _Component);
|
|
49
|
-
var _super = _createSuper(FeedbackRatingRoot2);
|
|
50
52
|
function FeedbackRatingRoot2() {
|
|
51
53
|
var _this;
|
|
52
54
|
_classCallCheck(this, FeedbackRatingRoot2);
|
|
53
55
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
54
56
|
args[_key] = arguments[_key];
|
|
55
57
|
}
|
|
56
|
-
_this =
|
|
57
|
-
_defineProperty(
|
|
58
|
+
_this = _callSuper(this, FeedbackRatingRoot2, [].concat(args));
|
|
59
|
+
_defineProperty(_this, "state", {
|
|
58
60
|
error: false
|
|
59
61
|
});
|
|
60
|
-
_defineProperty(
|
|
61
|
-
_defineProperty(
|
|
62
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "manager", new NoticeBubbleManager());
|
|
63
|
+
_defineProperty(_this, "focusDecorator", createFocusDecorator());
|
|
64
|
+
_defineProperty(_this, "handleChangeRating", function(rating) {
|
|
63
65
|
if (rating > 0) {
|
|
64
66
|
_this.asProps.onVisibleChange(true, rating);
|
|
65
67
|
}
|
|
66
68
|
});
|
|
67
|
-
_defineProperty(
|
|
69
|
+
_defineProperty(_this, "handelCloseModal", function() {
|
|
68
70
|
_this.asProps.onVisibleChange(false, _this.asProps.rating);
|
|
69
71
|
});
|
|
70
|
-
_defineProperty(
|
|
71
|
-
return function(
|
|
72
|
+
_defineProperty(_this, "handleChange", function(fn) {
|
|
73
|
+
return function(_value, e) {
|
|
72
74
|
fn(e);
|
|
73
75
|
};
|
|
74
76
|
});
|
|
75
|
-
_defineProperty(
|
|
77
|
+
_defineProperty(_this, "renderCheckbox", function(config, index) {
|
|
76
78
|
var initialValue = _this.props.initialValues[config.key];
|
|
77
79
|
return /* @__PURE__ */ React.createElement(Field, {
|
|
78
80
|
name: config.key,
|
|
@@ -91,7 +93,7 @@ var FeedbackRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
91
93
|
}));
|
|
92
94
|
});
|
|
93
95
|
});
|
|
94
|
-
_defineProperty(
|
|
96
|
+
_defineProperty(_this, "renderTextField", function(config) {
|
|
95
97
|
var _config$description;
|
|
96
98
|
var initialValue = _this.props.initialValues[config.key];
|
|
97
99
|
var label = typeof config.label === "string" ? /* @__PURE__ */ React.createElement(Text, {
|
|
@@ -147,7 +149,8 @@ var FeedbackRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
147
149
|
});
|
|
148
150
|
return _this;
|
|
149
151
|
}
|
|
150
|
-
|
|
152
|
+
_inherits(FeedbackRatingRoot2, _Component);
|
|
153
|
+
return _createClass(FeedbackRatingRoot2, [{
|
|
151
154
|
key: "headerId",
|
|
152
155
|
get: function get() {
|
|
153
156
|
var uid = this.asProps.uid;
|
|
@@ -309,7 +312,6 @@ var FeedbackRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
309
312
|
})));
|
|
310
313
|
}
|
|
311
314
|
}]);
|
|
312
|
-
return FeedbackRatingRoot2;
|
|
313
315
|
}(Component);
|
|
314
316
|
_defineProperty(FeedbackRatingRoot, "displayName", "FeedbackRatingForm");
|
|
315
317
|
_defineProperty(FeedbackRatingRoot, "style", style);
|
|
@@ -1,70 +1,72 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { Box, Flex } from "@semcore/flex-box";
|
|
11
|
-
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
9
|
+
import { createComponent, assignProps, sstyled, Component } from "@semcore/core";
|
|
12
10
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
12
|
+
import { Flex, Box } from "@semcore/flex-box";
|
|
13
|
+
import React from "react";
|
|
13
14
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
15
|
+
function _callSuper(t, o, e) {
|
|
16
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
17
|
+
}
|
|
14
18
|
/*!__reshadow-styles__:"../../style/slider-rating.shadow.css"*/
|
|
15
19
|
var style = (
|
|
16
20
|
/*__reshadow_css_start__*/
|
|
17
21
|
(sstyled.insert(
|
|
18
22
|
/*__inner_css_start__*/
|
|
19
|
-
".
|
|
23
|
+
".___SSliderRating_16k7i_gg_ .___SStar_16k7i_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_16k7i_gg_:focus-visible .___SStar_16k7i_gg_.__hovered_16k7i_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_16k7i_gg_ .___SStar_16k7i_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_16k7i_gg_.__readonly_16k7i_gg_ .___SStar_16k7i_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_16k7i_gg_.__filled_16k7i_gg_:active{animation:wobble .8s ease-in-out}.___SStar_16k7i_gg_ path{fill:var(--intergalactic-slider-rating-normal, #a9abb6)}.___SStar_16k7i_gg_.__filled_16k7i_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active, #fdc23c)}",
|
|
20
24
|
/*__inner_css_end__*/
|
|
21
|
-
"
|
|
25
|
+
"16k7i_gg_"
|
|
22
26
|
), /*__reshadow_css_end__*/
|
|
23
27
|
{
|
|
24
|
-
"__SSliderRating": "
|
|
25
|
-
"__SStar": "
|
|
26
|
-
"_hovered": "
|
|
27
|
-
"_readonly": "
|
|
28
|
-
"_filled": "
|
|
28
|
+
"__SSliderRating": "___SSliderRating_16k7i_gg_",
|
|
29
|
+
"__SStar": "___SStar_16k7i_gg_",
|
|
30
|
+
"_hovered": "__hovered_16k7i_gg_",
|
|
31
|
+
"_readonly": "__readonly_16k7i_gg_",
|
|
32
|
+
"_filled": "__filled_16k7i_gg_"
|
|
29
33
|
})
|
|
30
34
|
);
|
|
31
35
|
var MIN = 1;
|
|
32
36
|
var MAX = 5;
|
|
33
37
|
var SliderRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
34
|
-
_inherits(SliderRatingRoot2, _Component);
|
|
35
|
-
var _super = _createSuper(SliderRatingRoot2);
|
|
36
38
|
function SliderRatingRoot2() {
|
|
37
39
|
var _this;
|
|
38
40
|
_classCallCheck(this, SliderRatingRoot2);
|
|
39
41
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
42
|
args[_key] = arguments[_key];
|
|
41
43
|
}
|
|
42
|
-
_this =
|
|
43
|
-
_defineProperty(
|
|
44
|
+
_this = _callSuper(this, SliderRatingRoot2, [].concat(args));
|
|
45
|
+
_defineProperty(_this, "state", {
|
|
44
46
|
hoveredIndex: -1,
|
|
45
47
|
clickedIndex: -1
|
|
46
48
|
});
|
|
47
|
-
_defineProperty(
|
|
48
|
-
return function(
|
|
49
|
+
_defineProperty(_this, "handleClick", function(newValue) {
|
|
50
|
+
return function(_e) {
|
|
49
51
|
var readonly = _this.asProps.readonly;
|
|
50
52
|
if (!readonly) {
|
|
51
53
|
_this.setValue(newValue);
|
|
52
54
|
}
|
|
53
55
|
};
|
|
54
56
|
});
|
|
55
|
-
_defineProperty(
|
|
57
|
+
_defineProperty(_this, "handleMouseEnder", function(index) {
|
|
56
58
|
return function() {
|
|
57
59
|
_this.setState({
|
|
58
60
|
hoveredIndex: index
|
|
59
61
|
});
|
|
60
62
|
};
|
|
61
63
|
});
|
|
62
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "handleMouseLeave", function() {
|
|
63
65
|
_this.setState({
|
|
64
66
|
hoveredIndex: -1
|
|
65
67
|
});
|
|
66
68
|
});
|
|
67
|
-
_defineProperty(
|
|
69
|
+
_defineProperty(_this, "setValue", function(newValue) {
|
|
68
70
|
var _this$asProps = _this.asProps, onChange = _this$asProps.onChange, value = _this$asProps.value;
|
|
69
71
|
if (onChange) {
|
|
70
72
|
onChange(newValue);
|
|
@@ -81,17 +83,17 @@ var SliderRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
_defineProperty(
|
|
86
|
+
_defineProperty(_this, "handleKeyDown", function(event) {
|
|
85
87
|
if (!["ArrowLeft", "ArrowRight", "Enter"].includes(event.key)) return;
|
|
86
88
|
event.preventDefault();
|
|
87
89
|
if (event.key === "Enter") {
|
|
88
90
|
var hoveredIndex = _this.state.hoveredIndex;
|
|
89
91
|
_this.setValue(hoveredIndex + 1);
|
|
90
92
|
} else {
|
|
91
|
-
var
|
|
93
|
+
var value = _this.asProps.value;
|
|
92
94
|
var _hoveredIndex = _this.state.hoveredIndex;
|
|
93
95
|
var direction = event.key === "ArrowLeft" ? -1 : 1;
|
|
94
|
-
var newValue = _hoveredIndex === -1 ?
|
|
96
|
+
var newValue = _hoveredIndex === -1 ? value + direction : _hoveredIndex + 1 + direction;
|
|
95
97
|
if (newValue > MAX) newValue = MAX;
|
|
96
98
|
if (newValue < MIN) newValue = MIN;
|
|
97
99
|
_this.setState({
|
|
@@ -101,7 +103,8 @@ var SliderRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
101
103
|
});
|
|
102
104
|
return _this;
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
_inherits(SliderRatingRoot2, _Component);
|
|
107
|
+
return _createClass(SliderRatingRoot2, [{
|
|
105
108
|
key: "getStarProps",
|
|
106
109
|
value: function getStarProps(_, index) {
|
|
107
110
|
var _this$asProps2 = this.asProps, value = _this$asProps2.value, readonly = _this$asProps2.readonly;
|
|
@@ -177,7 +180,6 @@ var SliderRatingRoot = /* @__PURE__ */ function(_Component) {
|
|
|
177
180
|
}));
|
|
178
181
|
}
|
|
179
182
|
}]);
|
|
180
|
-
return SliderRatingRoot2;
|
|
181
183
|
}(Component);
|
|
182
184
|
_defineProperty(SliderRatingRoot, "displayName", "SliderRating");
|
|
183
185
|
_defineProperty(SliderRatingRoot, "style", style);
|
|
@@ -6,12 +6,12 @@ import it from "./it.json.mjs";
|
|
|
6
6
|
import ja from "./ja.json.mjs";
|
|
7
7
|
import ko from "./ko.json.mjs";
|
|
8
8
|
import nl from "./nl.json.mjs";
|
|
9
|
+
import pl from "./pl.json.mjs";
|
|
9
10
|
import pt from "./pt.json.mjs";
|
|
11
|
+
import sv from "./sv.json.mjs";
|
|
10
12
|
import tr from "./tr.json.mjs";
|
|
11
13
|
import vi from "./vi.json.mjs";
|
|
12
14
|
import zh from "./zh.json.mjs";
|
|
13
|
-
import pl from "./pl.json.mjs";
|
|
14
|
-
import sv from "./sv.json.mjs";
|
|
15
15
|
var localizedMessages = {
|
|
16
16
|
de,
|
|
17
17
|
en,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function FeedbackItem({ Children, tag, uid, tooltipProps: tooltipPropsList, ...props }: any): JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function FeedbackItem({ Children, tag, uid, tooltipProps: tooltipPropsList, ...props }: any): React.JSX.Element;
|
|
3
3
|
export declare namespace FeedbackItem {
|
|
4
4
|
var enhance: ((props: any) => {
|
|
5
|
-
uid:
|
|
5
|
+
uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
|
|
6
6
|
})[];
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Component } from '@semcore/core';
|
|
3
|
-
import { FeedbackRatingProps, FeedbackRatingType, FormConfigItem } from './FeedbackRating.type';
|
|
4
2
|
import { NoticeBubbleManager } from '@semcore/notice-bubble';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { FeedbackRatingProps, FeedbackRatingType, FormConfigItem } from './FeedbackRating.type';
|
|
5
5
|
type State = {
|
|
6
6
|
error: boolean;
|
|
7
7
|
};
|
|
@@ -11,11 +11,11 @@ declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, Stat
|
|
|
11
11
|
[key: string]: string;
|
|
12
12
|
};
|
|
13
13
|
static enhance: readonly [(props: any) => {
|
|
14
|
-
getI18nText: (messageId: string, variables?: {
|
|
14
|
+
getI18nText: ReturnType<(dictionary: import("@semcore/core/lib/utils/enhances/WithI18n").Dictionary, locale?: import("@semcore/core/lib/utils/enhances/WithI18n").LocaleKeys, fallbackDictionary?: import("@semcore/core/lib/utils/enhances/WithI18n").Dictionary) => (messageId: string, variables?: {
|
|
15
15
|
[key: string]: string | number | undefined;
|
|
16
|
-
}
|
|
16
|
+
}) => string>;
|
|
17
17
|
}, (props: any) => {
|
|
18
|
-
uid:
|
|
18
|
+
uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
|
|
19
19
|
}];
|
|
20
20
|
static defaultProps: {
|
|
21
21
|
onSubmit: () => void;
|
|
@@ -208,10 +208,10 @@ declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, Stat
|
|
|
208
208
|
getNoticeTextId(): string;
|
|
209
209
|
handleChangeRating: (rating: number) => void;
|
|
210
210
|
handelCloseModal: () => void;
|
|
211
|
-
handleChange: (fn: (e: React.SyntheticEvent) => void) => (
|
|
211
|
+
handleChange: (fn: (e: React.SyntheticEvent) => void) => (_value: any, e: React.SyntheticEvent) => void;
|
|
212
212
|
componentDidUpdate(prevProps: Readonly<FeedbackRatingProps>): void;
|
|
213
|
-
renderCheckbox: (config: FormConfigItem, index: number) => JSX.Element;
|
|
214
|
-
renderTextField: (config: FormConfigItem) => JSX.Element;
|
|
213
|
+
renderCheckbox: (config: FormConfigItem, index: number) => React.JSX.Element;
|
|
214
|
+
renderTextField: (config: FormConfigItem) => React.JSX.Element;
|
|
215
215
|
render(): React.ReactNode;
|
|
216
216
|
}
|
|
217
217
|
declare const FeedbackRating: typeof FeedbackRatingType & {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { Intergalactic } from '@semcore/core';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import type Button from '@semcore/button';
|
|
2
|
+
import type Checkbox from '@semcore/checkbox';
|
|
3
|
+
import type { CheckboxProps } from '@semcore/checkbox';
|
|
4
|
+
import type { Intergalactic } from '@semcore/core';
|
|
5
|
+
import type { Text } from '@semcore/typography';
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
import type { FieldProps } from 'react-final-form';
|
|
8
|
+
import type { FeedbackFormProps } from '../../index';
|
|
8
9
|
export type FormConfigItem = {
|
|
9
10
|
key: string;
|
|
10
11
|
label: React.ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Box, BoxProps } from '@semcore/flex-box';
|
|
1
|
+
import { type Intergalactic } from '@semcore/core';
|
|
2
|
+
import { Flex, Box, type BoxProps } from '@semcore/flex-box';
|
|
3
3
|
type SliderRatingProps = {
|
|
4
4
|
value: number;
|
|
5
5
|
onChange?: (value: number) => void;
|
|
@@ -8,7 +8,7 @@ type SliderRatingProps = {
|
|
|
8
8
|
type StarProps = BoxProps & {
|
|
9
9
|
filled?: boolean;
|
|
10
10
|
};
|
|
11
|
-
declare const SliderRating:
|
|
11
|
+
declare const SliderRating: Intergalactic.Component<typeof Flex, SliderRatingProps> & {
|
|
12
12
|
Star: Intergalactic.Component<typeof Box, StarProps>;
|
|
13
13
|
};
|
|
14
14
|
export default SliderRating;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { Box } from '@semcore/flex-box';
|
|
1
|
+
import type Button from '@semcore/button';
|
|
2
|
+
import type { Intergalactic } from '@semcore/core';
|
|
3
|
+
import type { Box } from '@semcore/flex-box';
|
|
4
|
+
import type { NoticeSmart } from '@semcore/notice';
|
|
5
|
+
import type { FormProps, FieldProps, FieldInputProps, FieldMetaState } from 'react-final-form';
|
|
7
6
|
|
|
8
7
|
import { default as FeedbackRating } from './component/feedback-rating/FeedbackRating';
|
|
9
8
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/feedback-form",
|
|
3
3
|
"description": "Semrush Feedback Form Component",
|
|
4
|
-
"version": "16.1.
|
|
4
|
+
"version": "16.1.2-prerelease.3",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,26 +14,26 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/flex-box": "16.0.
|
|
18
|
-
"@semcore/checkbox": "16.0.
|
|
19
|
-
"@semcore/notice-bubble": "16.1.
|
|
20
|
-
"@semcore/typography": "16.1.
|
|
21
|
-
"@semcore/link": "16.0.
|
|
22
|
-
"@semcore/modal": "16.1.
|
|
23
|
-
"@semcore/illustration": "16.0.
|
|
24
|
-
"@semcore/icon": "16.2.
|
|
25
|
-
"@semcore/textarea": "16.0.
|
|
26
|
-
"@semcore/input": "16.0.
|
|
17
|
+
"@semcore/flex-box": "16.0.2-prerelease.3",
|
|
18
|
+
"@semcore/checkbox": "16.0.2-prerelease.3",
|
|
19
|
+
"@semcore/notice-bubble": "16.1.2-prerelease.3",
|
|
20
|
+
"@semcore/typography": "16.1.2-prerelease.3",
|
|
21
|
+
"@semcore/link": "16.0.2-prerelease.3",
|
|
22
|
+
"@semcore/modal": "16.1.2-prerelease.3",
|
|
23
|
+
"@semcore/illustration": "16.0.3-prerelease.3",
|
|
24
|
+
"@semcore/icon": "16.2.1-prerelease.3",
|
|
25
|
+
"@semcore/textarea": "16.0.2-prerelease.3",
|
|
26
|
+
"@semcore/input": "16.0.2-prerelease.3",
|
|
27
27
|
"final-form": "4.20.7",
|
|
28
|
-
"@semcore/button": "16.0.
|
|
29
|
-
"@semcore/notice": "16.1.
|
|
30
|
-
"@semcore/spin-container": "16.0.
|
|
31
|
-
"@semcore/tooltip": "16.0.
|
|
28
|
+
"@semcore/button": "16.0.2-prerelease.3",
|
|
29
|
+
"@semcore/notice": "16.1.2-prerelease.3",
|
|
30
|
+
"@semcore/spin-container": "16.0.2-prerelease.3",
|
|
31
|
+
"@semcore/tooltip": "16.0.2-prerelease.3",
|
|
32
32
|
"final-form-focus": "1.1.2",
|
|
33
33
|
"react-final-form": "6.5.9"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@semcore/base-components": "^16.0.
|
|
36
|
+
"@semcore/base-components": "^16.0.2-prerelease.3"
|
|
37
37
|
},
|
|
38
38
|
"repository": {
|
|
39
39
|
"type": "git",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"directory": "semcore/feedback-form"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/react": "18.0.21",
|
|
45
44
|
"@types/final-form-focus": "1.1.7",
|
|
45
|
+
"@semcore/core": "16.0.0",
|
|
46
46
|
"@semcore/testing-utils": "1.0.0"
|
|
47
47
|
},
|
|
48
48
|
"overrides": {
|