@prom-ui/core 1.3.1 → 1.4.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/Avatar/cjs/index.development.js +99 -67
- package/Avatar/cjs/index.development.v2.js +99 -67
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -1
- package/Avatar/index.d.ts +14 -14
- package/Avatar/package.json +1 -1
- package/Avatar/utils.d.ts +2 -2
- package/Backdrop/cjs/index.development.js +131 -77
- package/Backdrop/cjs/index.development.v2.js +131 -77
- package/Backdrop/cjs/index.production.js +1 -1
- package/Backdrop/cjs/index.production.v2.js +1 -1
- package/Backdrop/index.d.ts +25 -25
- package/Backdrop/package.json +1 -1
- package/Body/cjs/index.development.js +2 -0
- package/Body/cjs/index.development.v2.js +2 -0
- package/Body/index.d.ts +36 -36
- package/Body/package.json +1 -1
- package/BodyContext/cjs/index.development.js +6 -7
- package/BodyContext/cjs/index.development.v2.js +6 -7
- package/BodyContext/cjs/index.production.js +1 -1
- package/BodyContext/cjs/index.production.v2.js +1 -1
- package/BodyContext/index.d.ts +12 -12
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +7 -6
- package/BodyProvider/cjs/index.development.v2.js +7 -6
- package/BodyProvider/index.d.ts +10 -10
- package/BodyProvider/package.json +1 -1
- package/Box/cjs/index.development.js +4 -4
- package/Box/cjs/index.development.v2.js +4 -4
- package/Box/index.d.ts +106 -106
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +67 -62
- package/Button/cjs/index.development.v2.js +67 -62
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -1
- package/Button/index.d.ts +45 -45
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +195 -85
- package/ButtonPageUp/cjs/index.development.v2.js +195 -85
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/index.d.ts +18 -18
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +99 -67
- package/Checkbox/cjs/index.development.v2.js +99 -67
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/index.d.ts +8 -8
- package/Checkbox/package.json +1 -1
- package/Flex/index.d.ts +34 -34
- package/Flex/package.json +1 -1
- package/Grid/index.d.ts +46 -46
- package/Grid/package.json +1 -1
- package/Icon/index.d.ts +9 -9
- package/Icon/package.json +1 -1
- package/Image/index.d.ts +42 -42
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +70 -63
- package/ImageEmoji/cjs/index.development.v2.js +70 -63
- package/ImageEmoji/cjs/index.production.js +1 -1
- package/ImageEmoji/cjs/index.production.v2.js +1 -1
- package/ImageEmoji/index.d.ts +9 -9
- package/ImageEmoji/package.json +1 -1
- package/Input/index.d.ts +18 -18
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +3 -3
- package/InputField/addons/AfterCorrectValue.d.ts +2 -2
- package/InputField/addons/AfterLoading.d.ts +2 -2
- package/InputField/addons/AfterTogglePassword.d.ts +6 -6
- package/InputField/addons/ErrorText.d.ts +6 -6
- package/InputField/cjs/index.development.js +237 -173
- package/InputField/cjs/index.development.v2.js +237 -173
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/index.d.ts +18 -18
- package/InputField/package.json +1 -1
- package/InputField/utils.d.ts +10 -10
- package/KeyPress/cjs/index.development.js +13 -13
- package/KeyPress/cjs/index.development.v2.js +13 -13
- package/KeyPress/index.d.ts +14 -14
- package/KeyPress/package.json +1 -1
- package/Line/index.d.ts +13 -13
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +5 -5
- package/Link/cjs/index.development.v2.js +5 -5
- package/Link/index.d.ts +28 -28
- package/Link/package.json +1 -1
- package/List/index.d.ts +23 -23
- package/List/package.json +1 -1
- package/Media/MediaProvider.d.ts +8 -8
- package/Media/cjs/index.development.js +70 -19
- package/Media/cjs/index.development.v2.js +70 -19
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/index.d.ts +20 -20
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +117 -61
- package/OutsideClick/cjs/index.development.v2.js +117 -61
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +12 -12
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +197 -183
- package/Overlay/cjs/index.development.v2.js +197 -183
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/components/OverlayHeader.d.ts +11 -11
- package/Overlay/components/SwipeClose.d.ts +11 -11
- package/Overlay/components/TouchScrollable.d.ts +8 -8
- package/Overlay/index.d.ts +76 -76
- package/Overlay/package.json +1 -1
- package/Overlay/utils.d.ts +10 -10
- package/Picture/index.d.ts +70 -70
- package/Picture/package.json +1 -1
- package/Portal/cjs/index.development.js +11 -11
- package/Portal/cjs/index.development.v2.js +11 -11
- package/Portal/index.d.ts +10 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +11 -11
- package/QRCode/cjs/index.development.v2.js +11 -11
- package/QRCode/index.d.ts +17 -17
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +75 -69
- package/Rating/cjs/index.development.v2.js +75 -69
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -1
- package/Rating/index.d.ts +17 -17
- package/Rating/package.json +1 -1
- package/RatingSelect/cjs/index.development.js +148 -68
- package/RatingSelect/cjs/index.development.v2.js +148 -68
- package/RatingSelect/cjs/index.production.js +1 -1
- package/RatingSelect/cjs/index.production.v2.js +1 -1
- package/RatingSelect/index.d.ts +22 -18
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +158 -110
- package/SafeQuery/cjs/index.development.v2.js +158 -110
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/components/Error.d.ts +7 -7
- package/SafeQuery/index.d.ts +10 -10
- package/SafeQuery/package.json +1 -1
- package/Scroll/index.d.ts +25 -25
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +11 -11
- package/ScrollControls/cjs/index.development.js +201 -113
- package/ScrollControls/cjs/index.development.v2.js +201 -113
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +16 -16
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +270 -158
- package/SimpleSlider/cjs/index.development.v2.js +270 -158
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/index.d.ts +41 -41
- package/SimpleSlider/package.json +1 -1
- package/SimpleSlider/useAutoPlay.d.ts +3 -3
- package/SimpleSlider/utils.d.ts +19 -19
- package/Skeleton/cjs/index.development.js +118 -64
- package/Skeleton/cjs/index.development.v2.js +118 -64
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -1
- package/Skeleton/index.d.ts +37 -37
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +66 -61
- package/Spinner/cjs/index.development.v2.js +66 -61
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -1
- package/Spinner/index.d.ts +29 -29
- package/Spinner/package.json +1 -1
- package/Text/index.d.ts +25 -25
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +65 -60
- package/TextEmoji/cjs/index.development.v2.js +65 -60
- package/TextEmoji/cjs/index.production.js +1 -1
- package/TextEmoji/cjs/index.production.v2.js +1 -1
- package/TextEmoji/index.d.ts +9 -9
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +80 -91
- package/Tooltip/cjs/index.development.v2.js +80 -91
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/index.d.ts +87 -87
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +98 -66
- package/Tumbler/cjs/index.development.v2.js +98 -66
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -1
- package/Tumbler/index.d.ts +8 -8
- package/Tumbler/package.json +1 -1
- package/package.json +7 -5
- package/useBodyTTag/cjs/index.development.js +1 -1
- package/useBodyTTag/cjs/index.development.v2.js +1 -1
- package/useBodyTTag/index.d.ts +2 -2
- package/useBodyTTag/package.json +1 -1
- package/useDebounce/cjs/index.development.js +58 -6
- package/useDebounce/cjs/index.development.v2.js +58 -6
- package/useDebounce/cjs/index.production.js +1 -1
- package/useDebounce/cjs/index.production.v2.js +1 -1
- package/useDebounce/index.d.ts +4 -4
- package/useDebounce/package.json +1 -1
- package/useId/cjs/index.development.js +6 -7
- package/useId/cjs/index.development.v2.js +6 -7
- package/useId/cjs/index.production.js +1 -1
- package/useId/cjs/index.production.v2.js +1 -1
- package/useId/index.d.ts +4 -4
- package/useId/package.json +1 -1
- package/useIsMounted/cjs/index.development.js +3 -3
- package/useIsMounted/cjs/index.development.v2.js +3 -3
- package/useIsMounted/index.d.ts +4 -4
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/cjs/index.development.js +76 -22
- package/useKeyPress/cjs/index.development.v2.js +76 -22
- package/useKeyPress/cjs/index.production.js +1 -1
- package/useKeyPress/cjs/index.production.v2.js +1 -1
- package/useKeyPress/index.d.ts +6 -6
- package/useKeyPress/package.json +1 -1
- package/useMedia/cjs/index.development.js +5 -5
- package/useMedia/cjs/index.development.v2.js +5 -5
- package/useMedia/index.d.ts +21 -21
- package/useMedia/package.json +1 -1
- package/useOutsideClick/cjs/index.development.js +2 -2
- package/useOutsideClick/cjs/index.development.v2.js +2 -2
- package/useOutsideClick/index.d.ts +5 -5
- package/useOutsideClick/package.json +1 -1
- package/usePortal/cjs/index.development.js +32 -27
- package/usePortal/cjs/index.development.v2.js +32 -27
- package/usePortal/index.d.ts +12 -12
- package/usePortal/package.json +1 -1
- package/useScrollPosition/cjs/index.development.js +2 -2
- package/useScrollPosition/cjs/index.development.v2.js +2 -2
- package/useScrollPosition/index.d.ts +5 -5
- package/useScrollPosition/package.json +1 -1
|
@@ -11,74 +11,154 @@ var StarFill = require('@prom-ui/icons/StarFill');
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
12
|
|
|
13
13
|
function _interopNamespaceCompat(e) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
}
|
|
14
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
25
23
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
32
32
|
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
34
|
+
function _iterableToArrayLimit(arr, i) {
|
|
35
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
36
|
+
if (null != _i) {
|
|
37
|
+
var _s,
|
|
38
|
+
_e,
|
|
39
|
+
_x,
|
|
40
|
+
_r,
|
|
41
|
+
_arr = [],
|
|
42
|
+
_n = !0,
|
|
43
|
+
_d = !1;
|
|
44
|
+
try {
|
|
45
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
46
|
+
if (Object(_i) !== _i) return;
|
|
47
|
+
_n = !1;
|
|
48
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
_d = !0, _e = err;
|
|
51
|
+
} finally {
|
|
52
|
+
try {
|
|
53
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
54
|
+
} finally {
|
|
55
|
+
if (_d) throw _e;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return _arr;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function _defineProperty(obj, key, value) {
|
|
62
|
+
key = _toPropertyKey(key);
|
|
63
|
+
if (key in obj) {
|
|
64
|
+
Object.defineProperty(obj, key, {
|
|
65
|
+
value: value,
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
obj[key] = value;
|
|
72
|
+
}
|
|
73
|
+
return obj;
|
|
74
|
+
}
|
|
75
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
76
|
+
if (source == null) return {};
|
|
77
|
+
var target = {};
|
|
78
|
+
var sourceKeys = Object.keys(source);
|
|
79
|
+
var key, i;
|
|
80
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
81
|
+
key = sourceKeys[i];
|
|
82
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
function _objectWithoutProperties(source, excluded) {
|
|
88
|
+
if (source == null) return {};
|
|
89
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
90
|
+
var key, i;
|
|
91
|
+
if (Object.getOwnPropertySymbols) {
|
|
92
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
93
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
94
|
+
key = sourceSymbolKeys[i];
|
|
95
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
96
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
97
|
+
target[key] = source[key];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return target;
|
|
101
|
+
}
|
|
102
|
+
function _slicedToArray(arr, i) {
|
|
103
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
104
|
+
}
|
|
105
|
+
function _arrayWithHoles(arr) {
|
|
106
|
+
if (Array.isArray(arr)) return arr;
|
|
107
|
+
}
|
|
108
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
109
|
+
if (!o) return;
|
|
110
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
111
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
112
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
113
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
114
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
115
|
+
}
|
|
116
|
+
function _arrayLikeToArray(arr, len) {
|
|
117
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
118
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
119
|
+
return arr2;
|
|
120
|
+
}
|
|
121
|
+
function _nonIterableRest() {
|
|
122
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
123
|
+
}
|
|
124
|
+
function _toPrimitive(input, hint) {
|
|
125
|
+
if (typeof input !== "object" || input === null) return input;
|
|
126
|
+
var prim = input[Symbol.toPrimitive];
|
|
127
|
+
if (prim !== undefined) {
|
|
128
|
+
var res = prim.call(input, hint || "default");
|
|
129
|
+
if (typeof res !== "object") return res;
|
|
130
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
131
|
+
}
|
|
132
|
+
return (hint === "string" ? String : Number)(input);
|
|
133
|
+
}
|
|
134
|
+
function _toPropertyKey(arg) {
|
|
135
|
+
var key = _toPrimitive(arg, "string");
|
|
136
|
+
return typeof key === "symbol" ? key : String(key);
|
|
59
137
|
}
|
|
60
138
|
|
|
61
139
|
var css = {"root":"RatingSelect__root___8RSGF","label":"RatingSelect__label___FF3m3","icon":"RatingSelect__icon___1Zpyt","input":"RatingSelect__input___25gdX","hovered":"RatingSelect__hovered___DscdS"};
|
|
62
140
|
|
|
141
|
+
var _excluded = ["value", "name", "onChange", "onHover", "size", "disabled"];
|
|
63
142
|
var ITEMS_LIST = [1, 2, 3, 4, 5];
|
|
64
|
-
var RatingSelect = function (
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
props = __rest(_a, ["value", "name", "onChange", "onHover", "size", "disabled"]);
|
|
143
|
+
var RatingSelect = function RatingSelect(_ref) {
|
|
144
|
+
var value = _ref.value,
|
|
145
|
+
name = _ref.name,
|
|
146
|
+
onChange = _ref.onChange,
|
|
147
|
+
onHover = _ref.onHover,
|
|
148
|
+
_ref$size = _ref.size,
|
|
149
|
+
size = _ref$size === void 0 ? 18 : _ref$size,
|
|
150
|
+
disabled = _ref.disabled,
|
|
151
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
74
152
|
var isMounted = useIsMounted.useIsMounted();
|
|
75
153
|
var componentId = useId.useId();
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
154
|
+
var _React$useState = React__namespace.useState(value),
|
|
155
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
156
|
+
selectedValue = _React$useState2[0],
|
|
157
|
+
setSelectedValue = _React$useState2[1];
|
|
158
|
+
var _React$useState3 = React__namespace.useState(true),
|
|
159
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
160
|
+
isHovered = _React$useState4[0],
|
|
161
|
+
setIsHovered = _React$useState4[1];
|
|
82
162
|
var inputName = name || componentId;
|
|
83
163
|
React__namespace.useEffect(function () {
|
|
84
164
|
if (isMounted && typeof onChange === 'function') {
|
|
@@ -90,18 +170,18 @@ var RatingSelect = function (_a) {
|
|
|
90
170
|
setSelectedValue(value);
|
|
91
171
|
}
|
|
92
172
|
}, [value]);
|
|
93
|
-
var onInputChange = function (inputValue) {
|
|
173
|
+
var onInputChange = function onInputChange(inputValue) {
|
|
94
174
|
setIsHovered(false);
|
|
95
175
|
setSelectedValue(inputValue);
|
|
96
176
|
};
|
|
97
|
-
var onLabelClick = function (inputValue, e) {
|
|
177
|
+
var onLabelClick = function onLabelClick(inputValue, e) {
|
|
98
178
|
setIsHovered(false);
|
|
99
179
|
if (!disabled && selectedValue === inputValue) {
|
|
100
180
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
101
181
|
setSelectedValue(undefined);
|
|
102
182
|
}
|
|
103
183
|
};
|
|
104
|
-
var onLabelMouseEnter = function (inputValue) {
|
|
184
|
+
var onLabelMouseEnter = function onLabelMouseEnter(inputValue) {
|
|
105
185
|
if (!isHovered) {
|
|
106
186
|
setIsHovered(true);
|
|
107
187
|
}
|
|
@@ -109,13 +189,13 @@ var RatingSelect = function (_a) {
|
|
|
109
189
|
onHover(inputValue);
|
|
110
190
|
}
|
|
111
191
|
};
|
|
112
|
-
var onRootMouseEnter = function () {
|
|
192
|
+
var onRootMouseEnter = function onRootMouseEnter() {
|
|
113
193
|
if (typeof onHover === 'function') {
|
|
114
194
|
onHover(undefined);
|
|
115
195
|
}
|
|
116
196
|
};
|
|
117
|
-
return React__namespace.createElement("div", {
|
|
118
|
-
className: classNames__default.default(css.root, (
|
|
197
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
198
|
+
className: classNames__default.default(css.root, _defineProperty({}, css.hovered, isHovered)),
|
|
119
199
|
style: {
|
|
120
200
|
fontSize: size
|
|
121
201
|
},
|
|
@@ -124,15 +204,15 @@ var RatingSelect = function (_a) {
|
|
|
124
204
|
"data-testid": props['data-testid'] || 'rating_select'
|
|
125
205
|
}, ITEMS_LIST.map(function (inputValue) {
|
|
126
206
|
var inputId = "".concat(inputName, "-").concat(inputValue);
|
|
127
|
-
return React__namespace.createElement("input", {
|
|
207
|
+
return /*#__PURE__*/React__namespace.createElement("input", {
|
|
128
208
|
key: inputValue,
|
|
129
209
|
id: inputId,
|
|
130
210
|
className: css.input,
|
|
131
|
-
type:
|
|
211
|
+
type: "radio",
|
|
132
212
|
name: inputName,
|
|
133
213
|
value: inputValue,
|
|
134
214
|
checked: selectedValue === inputValue,
|
|
135
|
-
onChange: function () {
|
|
215
|
+
onChange: function onChange() {
|
|
136
216
|
return onInputChange(inputValue);
|
|
137
217
|
},
|
|
138
218
|
disabled: disabled,
|
|
@@ -141,19 +221,19 @@ var RatingSelect = function (_a) {
|
|
|
141
221
|
});
|
|
142
222
|
}), ITEMS_LIST.map(function (inputValue) {
|
|
143
223
|
var inputId = "".concat(inputName, "-").concat(inputValue);
|
|
144
|
-
return React__namespace.createElement("label", {
|
|
224
|
+
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
145
225
|
key: inputValue,
|
|
146
226
|
className: css.label,
|
|
147
227
|
htmlFor: inputId,
|
|
148
|
-
onClick: function (e) {
|
|
228
|
+
onClick: function onClick(e) {
|
|
149
229
|
return onLabelClick(inputValue, e);
|
|
150
230
|
},
|
|
151
|
-
onMouseEnter: function () {
|
|
231
|
+
onMouseEnter: function onMouseEnter() {
|
|
152
232
|
return onLabelMouseEnter(inputValue);
|
|
153
233
|
},
|
|
154
234
|
"data-qaid": "rating_select_label_".concat(inputValue),
|
|
155
235
|
"data-testid": "rating_select_label_".concat(inputValue)
|
|
156
|
-
}, React__namespace.createElement(StarFill.SvgStarFill, {
|
|
236
|
+
}, /*#__PURE__*/React__namespace.createElement(StarFill.SvgStarFill, {
|
|
157
237
|
className: css.icon,
|
|
158
238
|
focusable: false,
|
|
159
239
|
"aria-hidden": true
|
|
@@ -11,74 +11,154 @@ var StarFill = require('@prom-ui/icons/StarFill');
|
|
|
11
11
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
12
|
|
|
13
13
|
function _interopNamespaceCompat(e) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
}
|
|
14
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
15
|
+
var n = Object.create(null);
|
|
16
|
+
if (e) {
|
|
17
|
+
Object.keys(e).forEach(function (k) {
|
|
18
|
+
if (k !== 'default') {
|
|
19
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
20
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return e[k]; }
|
|
25
23
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
n.default = e;
|
|
28
|
+
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
32
32
|
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
34
|
+
function _iterableToArrayLimit(arr, i) {
|
|
35
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
36
|
+
if (null != _i) {
|
|
37
|
+
var _s,
|
|
38
|
+
_e,
|
|
39
|
+
_x,
|
|
40
|
+
_r,
|
|
41
|
+
_arr = [],
|
|
42
|
+
_n = !0,
|
|
43
|
+
_d = !1;
|
|
44
|
+
try {
|
|
45
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
46
|
+
if (Object(_i) !== _i) return;
|
|
47
|
+
_n = !1;
|
|
48
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
_d = !0, _e = err;
|
|
51
|
+
} finally {
|
|
52
|
+
try {
|
|
53
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
54
|
+
} finally {
|
|
55
|
+
if (_d) throw _e;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return _arr;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function _defineProperty(obj, key, value) {
|
|
62
|
+
key = _toPropertyKey(key);
|
|
63
|
+
if (key in obj) {
|
|
64
|
+
Object.defineProperty(obj, key, {
|
|
65
|
+
value: value,
|
|
66
|
+
enumerable: true,
|
|
67
|
+
configurable: true,
|
|
68
|
+
writable: true
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
obj[key] = value;
|
|
72
|
+
}
|
|
73
|
+
return obj;
|
|
74
|
+
}
|
|
75
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
76
|
+
if (source == null) return {};
|
|
77
|
+
var target = {};
|
|
78
|
+
var sourceKeys = Object.keys(source);
|
|
79
|
+
var key, i;
|
|
80
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
81
|
+
key = sourceKeys[i];
|
|
82
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
function _objectWithoutProperties(source, excluded) {
|
|
88
|
+
if (source == null) return {};
|
|
89
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
90
|
+
var key, i;
|
|
91
|
+
if (Object.getOwnPropertySymbols) {
|
|
92
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
93
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
94
|
+
key = sourceSymbolKeys[i];
|
|
95
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
96
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
97
|
+
target[key] = source[key];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return target;
|
|
101
|
+
}
|
|
102
|
+
function _slicedToArray(arr, i) {
|
|
103
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
104
|
+
}
|
|
105
|
+
function _arrayWithHoles(arr) {
|
|
106
|
+
if (Array.isArray(arr)) return arr;
|
|
107
|
+
}
|
|
108
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
109
|
+
if (!o) return;
|
|
110
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
111
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
112
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
113
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
114
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
115
|
+
}
|
|
116
|
+
function _arrayLikeToArray(arr, len) {
|
|
117
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
118
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
119
|
+
return arr2;
|
|
120
|
+
}
|
|
121
|
+
function _nonIterableRest() {
|
|
122
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
123
|
+
}
|
|
124
|
+
function _toPrimitive(input, hint) {
|
|
125
|
+
if (typeof input !== "object" || input === null) return input;
|
|
126
|
+
var prim = input[Symbol.toPrimitive];
|
|
127
|
+
if (prim !== undefined) {
|
|
128
|
+
var res = prim.call(input, hint || "default");
|
|
129
|
+
if (typeof res !== "object") return res;
|
|
130
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
131
|
+
}
|
|
132
|
+
return (hint === "string" ? String : Number)(input);
|
|
133
|
+
}
|
|
134
|
+
function _toPropertyKey(arg) {
|
|
135
|
+
var key = _toPrimitive(arg, "string");
|
|
136
|
+
return typeof key === "symbol" ? key : String(key);
|
|
59
137
|
}
|
|
60
138
|
|
|
61
139
|
var css = {"root":"RatingSelect__root___V-LdE","label":"RatingSelect__label___sgjOY","icon":"RatingSelect__icon___FTT2B","input":"RatingSelect__input___DxUIq","hovered":"RatingSelect__hovered___LD2kV"};
|
|
62
140
|
|
|
141
|
+
var _excluded = ["value", "name", "onChange", "onHover", "size", "disabled"];
|
|
63
142
|
var ITEMS_LIST = [1, 2, 3, 4, 5];
|
|
64
|
-
var RatingSelect = function (
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
props = __rest(_a, ["value", "name", "onChange", "onHover", "size", "disabled"]);
|
|
143
|
+
var RatingSelect = function RatingSelect(_ref) {
|
|
144
|
+
var value = _ref.value,
|
|
145
|
+
name = _ref.name,
|
|
146
|
+
onChange = _ref.onChange,
|
|
147
|
+
onHover = _ref.onHover,
|
|
148
|
+
_ref$size = _ref.size,
|
|
149
|
+
size = _ref$size === void 0 ? 18 : _ref$size,
|
|
150
|
+
disabled = _ref.disabled,
|
|
151
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
74
152
|
var isMounted = useIsMounted.useIsMounted();
|
|
75
153
|
var componentId = useId.useId();
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
154
|
+
var _React$useState = React__namespace.useState(value),
|
|
155
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
156
|
+
selectedValue = _React$useState2[0],
|
|
157
|
+
setSelectedValue = _React$useState2[1];
|
|
158
|
+
var _React$useState3 = React__namespace.useState(true),
|
|
159
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
160
|
+
isHovered = _React$useState4[0],
|
|
161
|
+
setIsHovered = _React$useState4[1];
|
|
82
162
|
var inputName = name || componentId;
|
|
83
163
|
React__namespace.useEffect(function () {
|
|
84
164
|
if (isMounted && typeof onChange === 'function') {
|
|
@@ -90,18 +170,18 @@ var RatingSelect = function (_a) {
|
|
|
90
170
|
setSelectedValue(value);
|
|
91
171
|
}
|
|
92
172
|
}, [value]);
|
|
93
|
-
var onInputChange = function (inputValue) {
|
|
173
|
+
var onInputChange = function onInputChange(inputValue) {
|
|
94
174
|
setIsHovered(false);
|
|
95
175
|
setSelectedValue(inputValue);
|
|
96
176
|
};
|
|
97
|
-
var onLabelClick = function (inputValue, e) {
|
|
177
|
+
var onLabelClick = function onLabelClick(inputValue, e) {
|
|
98
178
|
setIsHovered(false);
|
|
99
179
|
if (!disabled && selectedValue === inputValue) {
|
|
100
180
|
e === null || e === void 0 ? void 0 : e.preventDefault();
|
|
101
181
|
setSelectedValue(undefined);
|
|
102
182
|
}
|
|
103
183
|
};
|
|
104
|
-
var onLabelMouseEnter = function (inputValue) {
|
|
184
|
+
var onLabelMouseEnter = function onLabelMouseEnter(inputValue) {
|
|
105
185
|
if (!isHovered) {
|
|
106
186
|
setIsHovered(true);
|
|
107
187
|
}
|
|
@@ -109,13 +189,13 @@ var RatingSelect = function (_a) {
|
|
|
109
189
|
onHover(inputValue);
|
|
110
190
|
}
|
|
111
191
|
};
|
|
112
|
-
var onRootMouseEnter = function () {
|
|
192
|
+
var onRootMouseEnter = function onRootMouseEnter() {
|
|
113
193
|
if (typeof onHover === 'function') {
|
|
114
194
|
onHover(undefined);
|
|
115
195
|
}
|
|
116
196
|
};
|
|
117
|
-
return React__namespace.createElement("div", {
|
|
118
|
-
className: classNames__default.default(css.root, (
|
|
197
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
198
|
+
className: classNames__default.default(css.root, _defineProperty({}, css.hovered, isHovered)),
|
|
119
199
|
style: {
|
|
120
200
|
fontSize: size
|
|
121
201
|
},
|
|
@@ -124,15 +204,15 @@ var RatingSelect = function (_a) {
|
|
|
124
204
|
"data-testid": props['data-testid'] || 'rating_select'
|
|
125
205
|
}, ITEMS_LIST.map(function (inputValue) {
|
|
126
206
|
var inputId = "".concat(inputName, "-").concat(inputValue);
|
|
127
|
-
return React__namespace.createElement("input", {
|
|
207
|
+
return /*#__PURE__*/React__namespace.createElement("input", {
|
|
128
208
|
key: inputValue,
|
|
129
209
|
id: inputId,
|
|
130
210
|
className: css.input,
|
|
131
|
-
type:
|
|
211
|
+
type: "radio",
|
|
132
212
|
name: inputName,
|
|
133
213
|
value: inputValue,
|
|
134
214
|
checked: selectedValue === inputValue,
|
|
135
|
-
onChange: function () {
|
|
215
|
+
onChange: function onChange() {
|
|
136
216
|
return onInputChange(inputValue);
|
|
137
217
|
},
|
|
138
218
|
disabled: disabled,
|
|
@@ -141,19 +221,19 @@ var RatingSelect = function (_a) {
|
|
|
141
221
|
});
|
|
142
222
|
}), ITEMS_LIST.map(function (inputValue) {
|
|
143
223
|
var inputId = "".concat(inputName, "-").concat(inputValue);
|
|
144
|
-
return React__namespace.createElement("label", {
|
|
224
|
+
return /*#__PURE__*/React__namespace.createElement("label", {
|
|
145
225
|
key: inputValue,
|
|
146
226
|
className: css.label,
|
|
147
227
|
htmlFor: inputId,
|
|
148
|
-
onClick: function (e) {
|
|
228
|
+
onClick: function onClick(e) {
|
|
149
229
|
return onLabelClick(inputValue, e);
|
|
150
230
|
},
|
|
151
|
-
onMouseEnter: function () {
|
|
231
|
+
onMouseEnter: function onMouseEnter() {
|
|
152
232
|
return onLabelMouseEnter(inputValue);
|
|
153
233
|
},
|
|
154
234
|
"data-qaid": "rating_select_label_".concat(inputValue),
|
|
155
235
|
"data-testid": "rating_select_label_".concat(inputValue)
|
|
156
|
-
}, React__namespace.createElement(StarFill.SvgStarFill, {
|
|
236
|
+
}, /*#__PURE__*/React__namespace.createElement(StarFill.SvgStarFill, {
|
|
157
237
|
className: css.icon,
|
|
158
238
|
focusable: false,
|
|
159
239
|
"aria-hidden": true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/useId"),n=require("@prom-ui/core/useIsMounted"),a=require("@prom-ui/icons/StarFill");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(f){l=!0,a=f}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw a}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y="_8RSGF",p="FF3m3",b="_1Zpyt",m="_25gdX",v="DscdS",g=["value","name","onChange","onHover","size","disabled"],j=[1,2,3,4,5],O=function(e){var t=e.value,i=e.name,o=e.onChange,d=e.onHover,O=e.size,S=void 0===O?18:O,h=e.disabled,_=f(e,g),E=n.useIsMounted(),q=r.useId(),w=s(u.useState(t),2),I=w[0],P=w[1],k=s(u.useState(!0),2),A=k[0],F=k[1],M=i||q;u.useEffect((function(){E&&"function"==typeof o&&o(I)}),[I]),u.useEffect((function(){t!==I&&P(t)}),[t]);return u.createElement("div",{className:c.default(y,l({},v,A)),style:{fontSize:S},onMouseLeave:function(){"function"==typeof d&&d(void 0)},"data-qaid":_["data-qaid"]||"rating_select","data-testid":_["data-testid"]||"rating_select"},j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("input",{key:e,id:t,className:m,type:"radio",name:M,value:e,checked:I===e,onChange:function(){return function(e){F(!1),P(e)}(e)},disabled:h,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("label",{key:e,className:p,htmlFor:t,onClick:function(t){return function(e,t){F(!1),h||I!==e||(null==t||t.preventDefault(),P(void 0))}(e,t)},onMouseEnter:function(){return function(e){A||F(!0),"function"==typeof d&&d(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},u.createElement(a.SvgStarFill,{className:b,focusable:!1,"aria-hidden":!0}))})))};O.displayName="RatingSelect",exports.RatingSelect=O,require("./style.production.css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/useId"),n=require("@prom-ui/core/useIsMounted"),a=require("@prom-ui/icons/StarFill");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i,o,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(f){l=!0,a=f}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw a}}return u}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return d(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var y="V-LdE",p="sgjOY",b="FTT2B",m="DxUIq",v="LD2kV",g=["value","name","onChange","onHover","size","disabled"],j=[1,2,3,4,5],O=function(e){var t=e.value,i=e.name,o=e.onChange,d=e.onHover,O=e.size,h=void 0===O?18:O,S=e.disabled,_=f(e,g),E=n.useIsMounted(),q=r.useId(),w=s(u.useState(t),2),I=w[0],P=w[1],k=s(u.useState(!0),2),x=k[0],A=k[1],M=i||q;u.useEffect((function(){E&&"function"==typeof o&&o(I)}),[I]),u.useEffect((function(){t!==I&&P(t)}),[t]);return u.createElement("div",{className:c.default(y,l({},v,x)),style:{fontSize:h},onMouseLeave:function(){"function"==typeof d&&d(void 0)},"data-qaid":_["data-qaid"]||"rating_select","data-testid":_["data-testid"]||"rating_select"},j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("input",{key:e,id:t,className:m,type:"radio",name:M,value:e,checked:I===e,onChange:function(){return function(e){A(!1),P(e)}(e)},disabled:S,"data-qaid":"rating_select_input_".concat(e),"data-testid":"rating_select_input_".concat(e)})})),j.map((function(e){var t="".concat(M,"-").concat(e);return u.createElement("label",{key:e,className:p,htmlFor:t,onClick:function(t){return function(e,t){A(!1),S||I!==e||(null==t||t.preventDefault(),P(void 0))}(e,t)},onMouseEnter:function(){return function(e){x||A(!0),"function"==typeof d&&d(e)}(e)},"data-qaid":"rating_select_label_".concat(e),"data-testid":"rating_select_label_".concat(e)},u.createElement(a.SvgStarFill,{className:b,focusable:!1,"aria-hidden":!0}))})))};O.displayName="RatingSelect",exports.RatingSelect=O,require("./style.production.v2.css");
|