@ntbjs/react-components 2.0.0-rc.26 → 2.0.0-rc.28
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/build/{ActionButton-03dc5f67.js → ActionButton-4db754c3.js} +17 -24
- package/build/{Alert-8a511bdc.js → Alert-e6847a22.js} +29 -36
- package/build/{AssetAction-d081e4b7.js → AssetGallery-f67393d4.js} +588 -622
- package/build/{Badge-aa4cd9c1.js → Badge-d93586a9.js} +35 -42
- package/build/{Button-2e26f5da.js → Button-179a2fe4.js} +83 -90
- package/build/{Checkbox-0b8faf49.js → Checkbox-4a5fd716.js} +45 -52
- package/build/{CompactAutocompleteSelect-797778cb.js → CompactAutocompleteSelect-52c49513.js} +116 -125
- package/build/{CompactStarRating-da21b53f.js → CompactStarRating-9af2f427.js} +76 -101
- package/build/{CompactTextInput-d56aec71.js → CompactTextInput-42ca5d42.js} +104 -129
- package/build/InputGroup-1294d190.js +23 -0
- package/build/{MultiLevelCheckboxSelect-d229cf98.js → MultiLevelCheckboxSelect-d8044c88.js} +139 -167
- package/build/{MultiSelect-d7920eb1.js → MultiSelect-9f497e62.js} +81 -90
- package/build/{Popover-c4be47ea.js → Popover-20050b91.js} +35 -44
- package/build/{Radio-150fb2c9.js → Radio-73ca3ae2.js} +28 -35
- package/build/SectionSeparator-f47760a2.js +31 -0
- package/build/{Switch-d2d6e9ec.js → Switch-ecf3122b.js} +35 -42
- package/build/Tab-04d435c3.js +32 -0
- package/build/{Tabs-b06c0e24.js → Tabs-74d1ea8a.js} +37 -44
- package/build/{TextArea-26d3c8a1.js → TextArea-1e5b9201.js} +105 -113
- package/build/{TextInput-3a567daa.js → TextInput-fab35842.js} +78 -86
- package/build/Tooltip-c1d1199e.js +65 -0
- package/build/{VerificationStatusIcon-9876b68f.js → VerificationStatusIcon-49cb1c1b.js} +19 -44
- package/build/{_rollupPluginBabelHelpers-4b342fad.js → _rollupPluginBabelHelpers-c245b26a.js} +1 -3
- package/build/arrow-forward-ad12c5f3.js +15 -0
- package/build/close-a5d37608.js +15 -0
- package/build/data/Alert/index.js +6 -12
- package/build/data/Badge/index.js +5 -11
- package/build/data/Popover/index.js +10 -16
- package/build/data/Tab/index.js +5 -11
- package/build/data/Tabs/index.js +7 -13
- package/build/data/Tooltip/index.js +7 -13
- package/build/data/index.js +16 -30
- package/build/{defaultTheme-d9a7342e.js → defaultTheme-1bcc2541.js} +3 -7
- package/build/edit-note-283a0e15.js +15 -0
- package/build/expand-more-c5523c46.js +15 -0
- package/build/inputs/ActionButton/index.js +6 -12
- package/build/inputs/Button/index.js +13 -19
- package/build/inputs/Checkbox/index.js +6 -12
- package/build/inputs/CompactAutocompleteSelect/index.js +23 -29
- package/build/inputs/CompactStarRating/index.js +17 -23
- package/build/inputs/CompactTextInput/index.js +19 -25
- package/build/inputs/MultiLevelCheckboxSelect/MultiLevelCheckboxSelect.js +26 -0
- package/build/inputs/MultiSelect/index.js +10 -16
- package/build/inputs/Radio/index.js +7 -13
- package/build/inputs/Switch/index.js +6 -12
- package/build/inputs/TextArea/index.js +20 -26
- package/build/inputs/TextInput/index.js +9 -15
- package/build/inputs/index.js +40 -60
- package/build/layout/InputGroup/index.js +5 -11
- package/build/layout/SectionSeparator/index.js +5 -11
- package/build/layout/index.js +6 -15
- package/build/{shift-away-subtle-158617af.js → shift-away-subtle-0dd94a03.js} +3 -5
- package/build/ssr/index.js +1 -12
- package/build/styles/utils/colors.scss +4 -4
- package/build/warning-circle-24f3efcd.js +15 -0
- package/build/widgets/AssetGallery/AssetGallery.js +45 -0
- package/build/widgets/AssetPreview/AssetPreviewTopBar/AssetPreviewTopBar.js +127 -0
- package/build/widgets/ContextMenu/ContextMenu.js +26 -0
- package/build/{ContextMenuItem-3967010d.js → widgets/ContextMenu/ContextMenuItem/ContextMenuItem.js} +23 -48
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/ContextMenuItemsGroup.js +37 -0
- package/build/{InfoCard-d0fdf377.js → widgets/InfoCard/InfoCard.js} +27 -34
- package/build/widgets/Instructions/Instructions.js +255 -0
- package/build/{ProgressBar-2d26c1fb.js → widgets/ProgressBar/ProgressBar.js} +39 -46
- package/build/widgets/index.js +50 -65
- package/package.json +3 -3
- package/styles/utils/colors.scss +4 -4
- package/build/AssetPreviewTopBar-623cfa18.js +0 -152
- package/build/ContextMenu-82f9d728.js +0 -33
- package/build/InputGroup-8d4a4644.js +0 -30
- package/build/Instructions-af191987.js +0 -274
- package/build/SectionSeparator-e06c7660.js +0 -38
- package/build/Tab-ccbca1f2.js +0 -39
- package/build/Tooltip-d5882b82.js +0 -73
- package/build/arrow-forward-d7c77ae3.js +0 -37
- package/build/close-1751121a.js +0 -37
- package/build/edit-note-cefe2215.js +0 -37
- package/build/expand-more-d74e2bd2.js +0 -37
- package/build/widgets/AssetGallery/index.js +0 -55
- package/build/widgets/AssetPreview/AssetPreviewTopBar/index.js +0 -12
- package/build/widgets/ContextMenu/ContextMenuItem/index.js +0 -11
- package/build/widgets/ContextMenu/ContextMenuItemsGroup/index.js +0 -44
- package/build/widgets/ContextMenu/index.js +0 -11
- package/build/widgets/InfoCard/index.js +0 -12
- package/build/widgets/Instructions/index.js +0 -33
- package/build/widgets/ProgressBar/index.js +0 -12
|
@@ -1,48 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var styled = require('styled-components');
|
|
14
|
-
|
|
15
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
-
|
|
17
|
-
function _interopNamespace(e) {
|
|
18
|
-
if (e && e.__esModule) return e;
|
|
19
|
-
var n = Object.create(null);
|
|
20
|
-
if (e) {
|
|
21
|
-
Object.keys(e).forEach(function (k) {
|
|
22
|
-
if (k !== 'default') {
|
|
23
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () { return e[k]; }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
n["default"] = e;
|
|
32
|
-
return Object.freeze(n);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
36
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
37
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
1
|
+
import { _ as _extends$2 } from './_rollupPluginBabelHelpers-c245b26a.js';
|
|
2
|
+
import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import React__default, { useState, useRef, useEffect, useMemo } from 'react';
|
|
5
|
+
import './Alert-e6847a22.js';
|
|
6
|
+
import './Badge-d93586a9.js';
|
|
7
|
+
import './Popover-20050b91.js';
|
|
8
|
+
import './Tab-04d435c3.js';
|
|
9
|
+
import './Tabs-74d1ea8a.js';
|
|
10
|
+
import { T as Tooltip } from './Tooltip-c1d1199e.js';
|
|
11
|
+
import './VerificationStatusIcon-49cb1c1b.js';
|
|
12
|
+
import styled, { keyframes, css } from 'styled-components';
|
|
38
13
|
|
|
39
14
|
var _path$1;
|
|
40
15
|
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
41
16
|
function SvgStarFilled(props) {
|
|
42
|
-
return /*#__PURE__*/
|
|
17
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
43
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
44
19
|
viewBox: "0 0 40 38"
|
|
45
|
-
}, props), _path$1 || (_path$1 = /*#__PURE__*/
|
|
20
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
46
21
|
fill: "currentColor",
|
|
47
22
|
d: "M7.65 38l3.25-14.05L0 14.5l14.4-1.25L20 0l5.6 13.25L40 14.5l-10.9 9.45L32.35 38 20 30.55 7.65 38z"
|
|
48
23
|
})));
|
|
@@ -51,16 +26,16 @@ function SvgStarFilled(props) {
|
|
|
51
26
|
var _path;
|
|
52
27
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
53
28
|
function SvgStar(props) {
|
|
54
|
-
return /*#__PURE__*/
|
|
29
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
55
30
|
xmlns: "http://www.w3.org/2000/svg",
|
|
56
31
|
viewBox: "0 0 40 38"
|
|
57
|
-
}, props), _path || (_path = /*#__PURE__*/
|
|
32
|
+
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
58
33
|
fill: "currentColor",
|
|
59
34
|
d: "M12.2 31.8l7.8-4.7 7.9 4.8-2.1-8.9 6.9-6-9.1-.8L20 7.7l-3.5 8.4-9.1.8 6.9 6-2.1 8.9zM7.7 38L11 24 0 14.5l14.4-1.2L20 0l5.6 13.2L40 14.5 29.1 24l3.3 14L20 30.6 7.7 38z"
|
|
60
35
|
})));
|
|
61
36
|
}
|
|
62
37
|
|
|
63
|
-
const fadeIn =
|
|
38
|
+
const fadeIn = keyframes`
|
|
64
39
|
from {
|
|
65
40
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};
|
|
66
41
|
}
|
|
@@ -68,7 +43,7 @@ const fadeIn = styled.keyframes`
|
|
|
68
43
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};
|
|
69
44
|
}
|
|
70
45
|
`;
|
|
71
|
-
const fadeOut =
|
|
46
|
+
const fadeOut = keyframes`
|
|
72
47
|
from {
|
|
73
48
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};
|
|
74
49
|
}
|
|
@@ -76,7 +51,7 @@ const fadeOut = styled.keyframes`
|
|
|
76
51
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};
|
|
77
52
|
}
|
|
78
53
|
`;
|
|
79
|
-
const fadeInCheck =
|
|
54
|
+
const fadeInCheck = keyframes`
|
|
80
55
|
from {
|
|
81
56
|
opacity: 0
|
|
82
57
|
}
|
|
@@ -84,7 +59,7 @@ const fadeInCheck = styled.keyframes`
|
|
|
84
59
|
opacity: 1
|
|
85
60
|
}
|
|
86
61
|
`;
|
|
87
|
-
const fadeOutCheck =
|
|
62
|
+
const fadeOutCheck = keyframes`
|
|
88
63
|
from {
|
|
89
64
|
opacity: 1
|
|
90
65
|
}
|
|
@@ -92,7 +67,7 @@ const fadeOutCheck = styled.keyframes`
|
|
|
92
67
|
opacity: 0
|
|
93
68
|
}
|
|
94
69
|
`;
|
|
95
|
-
const CompactStarRating$1 =
|
|
70
|
+
const CompactStarRating$1 = styled.div.attrs(applyDefaultTheme)`
|
|
96
71
|
font-family: ${props => props.theme.primaryFontFamily};
|
|
97
72
|
font-size: 1rem;
|
|
98
73
|
font-weight: 500;
|
|
@@ -108,16 +83,16 @@ const CompactStarRating$1 = styled__default["default"].div.attrs(defaultTheme.ap
|
|
|
108
83
|
margin: 0;
|
|
109
84
|
}
|
|
110
85
|
|
|
111
|
-
${props => props.readOnly &&
|
|
86
|
+
${props => props.readOnly && css`
|
|
112
87
|
pointer-events: none;
|
|
113
88
|
`}
|
|
114
89
|
|
|
115
|
-
${props => props.disabled &&
|
|
90
|
+
${props => props.disabled && css`
|
|
116
91
|
opacity: 0.5;
|
|
117
92
|
cursor: not-allowed;
|
|
118
93
|
`}
|
|
119
94
|
`;
|
|
120
|
-
const labelWidth =
|
|
95
|
+
const labelWidth = styled.div.attrs(applyDefaultTheme)`
|
|
121
96
|
width: 33.33%;
|
|
122
97
|
display: flex;
|
|
123
98
|
align-items: center;
|
|
@@ -129,11 +104,11 @@ const labelWidth = styled__default["default"].div.attrs(defaultTheme.applyDefaul
|
|
|
129
104
|
cursor: default;
|
|
130
105
|
justify-content: space-between;
|
|
131
106
|
${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
|
|
132
|
-
${props => props.disabled &&
|
|
107
|
+
${props => props.disabled && css`
|
|
133
108
|
cursor: not-allowed;
|
|
134
109
|
`}
|
|
135
110
|
`;
|
|
136
|
-
const SuccessContainer =
|
|
111
|
+
const SuccessContainer = styled.div.attrs(applyDefaultTheme)`
|
|
137
112
|
opacity: 1;
|
|
138
113
|
pointer-events: none;
|
|
139
114
|
display: flex;
|
|
@@ -146,7 +121,7 @@ const SuccessContainer = styled__default["default"].div.attrs(defaultTheme.apply
|
|
|
146
121
|
width: 13px;
|
|
147
122
|
}
|
|
148
123
|
`;
|
|
149
|
-
const starsWidth =
|
|
124
|
+
const starsWidth = styled.div.attrs(applyDefaultTheme)`
|
|
150
125
|
display: flex;
|
|
151
126
|
width: 66.66%;
|
|
152
127
|
border-radius: 3px;
|
|
@@ -156,22 +131,22 @@ const starsWidth = styled__default["default"].div.attrs(defaultTheme.applyDefaul
|
|
|
156
131
|
box-sizing: border-box;
|
|
157
132
|
border: 1px solid;
|
|
158
133
|
|
|
159
|
-
${props => props.readOnly &&
|
|
134
|
+
${props => props.readOnly && css`
|
|
160
135
|
border: none;
|
|
161
136
|
`}
|
|
162
137
|
|
|
163
138
|
${props => props.theme.themeProp('border-color', props.theme.getColor('gray-900'), props.theme.getColor('white'))}
|
|
164
139
|
|
|
165
|
-
${props => props.type === 'success' &&
|
|
140
|
+
${props => props.type === 'success' && css`
|
|
166
141
|
animation: ${props => props.success ? fadeIn : fadeOut} 0.5s ease-in-out;
|
|
167
142
|
`}
|
|
168
143
|
|
|
169
|
-
${props => props.type === 'error' &&
|
|
144
|
+
${props => props.type === 'error' && css`
|
|
170
145
|
${props.theme.themeProp('background', '#7F1B1B', '#FBEAE6')};
|
|
171
146
|
${props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6')}
|
|
172
147
|
`}
|
|
173
148
|
|
|
174
|
-
${props => props.type === 'warning' &&
|
|
149
|
+
${props => props.type === 'warning' && css`
|
|
175
150
|
${props.theme.themeProp('background', '#634E01', '#FFFDE8')};
|
|
176
151
|
${props.theme.themeProp('border-color', '#2F2402 ', '#FFFDE8')}
|
|
177
152
|
`}
|
|
@@ -189,7 +164,7 @@ const starsWidth = styled__default["default"].div.attrs(defaultTheme.applyDefaul
|
|
|
189
164
|
${props => props.type === 'error' && !props.readOnly && props.theme.themeProp('background', '#901d1d', '#f7d5d0')};
|
|
190
165
|
}
|
|
191
166
|
`;
|
|
192
|
-
const Star =
|
|
167
|
+
const Star = styled.button.attrs(applyDefaultTheme)`
|
|
193
168
|
display: flex;
|
|
194
169
|
align-items: center;
|
|
195
170
|
background: none;
|
|
@@ -211,11 +186,11 @@ const Star = styled__default["default"].button.attrs(defaultTheme.applyDefaultTh
|
|
|
211
186
|
|
|
212
187
|
${props => props.hover && props.theme.themeProp('color', props.theme.getColor('orange-500'), props.theme.getColor('orange-500'))};
|
|
213
188
|
|
|
214
|
-
${props => props.readOnly &&
|
|
189
|
+
${props => props.readOnly && css`
|
|
215
190
|
pointer-events: none;
|
|
216
191
|
`}
|
|
217
192
|
|
|
218
|
-
${props => props.disabled &&
|
|
193
|
+
${props => props.disabled && css`
|
|
219
194
|
button {
|
|
220
195
|
cursor: not-allowed;
|
|
221
196
|
}
|
|
@@ -224,7 +199,7 @@ const Star = styled__default["default"].button.attrs(defaultTheme.applyDefaultTh
|
|
|
224
199
|
}
|
|
225
200
|
`}
|
|
226
201
|
`;
|
|
227
|
-
const StarFill =
|
|
202
|
+
const StarFill = styled.button.attrs(applyDefaultTheme)`
|
|
228
203
|
display: flex;
|
|
229
204
|
align-items: center;
|
|
230
205
|
background: none;
|
|
@@ -246,11 +221,11 @@ const StarFill = styled__default["default"].button.attrs(defaultTheme.applyDefau
|
|
|
246
221
|
|
|
247
222
|
${props => props.hover && props.theme.themeProp('color', props.theme.getColor('orange-500'), props.theme.getColor('orange-500'))};
|
|
248
223
|
|
|
249
|
-
${props => props.readOnly &&
|
|
224
|
+
${props => props.readOnly && css`
|
|
250
225
|
pointer-events: none;
|
|
251
226
|
`}
|
|
252
227
|
|
|
253
|
-
${props => props.disabled &&
|
|
228
|
+
${props => props.disabled && css`
|
|
254
229
|
button {
|
|
255
230
|
cursor: not-allowed;
|
|
256
231
|
}
|
|
@@ -259,7 +234,7 @@ const StarFill = styled__default["default"].button.attrs(defaultTheme.applyDefau
|
|
|
259
234
|
}
|
|
260
235
|
`}
|
|
261
236
|
`;
|
|
262
|
-
|
|
237
|
+
styled.div.attrs(applyDefaultTheme)`
|
|
263
238
|
opacity: 1;
|
|
264
239
|
pointer-events: none;
|
|
265
240
|
margin-left: auto;
|
|
@@ -272,7 +247,7 @@ styled__default["default"].div.attrs(defaultTheme.applyDefaultTheme)`
|
|
|
272
247
|
}
|
|
273
248
|
`;
|
|
274
249
|
|
|
275
|
-
const CompactStarRating = React__default
|
|
250
|
+
const CompactStarRating = React__default.forwardRef(function CompactStarRating({
|
|
276
251
|
label,
|
|
277
252
|
icon,
|
|
278
253
|
iconFill,
|
|
@@ -294,16 +269,16 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
294
269
|
...props
|
|
295
270
|
}, forwardedRef) {
|
|
296
271
|
const stars = Array.from(Array(max).keys());
|
|
297
|
-
const [rating, setRating] =
|
|
298
|
-
const [hover, setHover] =
|
|
299
|
-
const [tempRating, setTempRating] =
|
|
300
|
-
const [initialRating, setInitialRating] =
|
|
301
|
-
const inputRef =
|
|
302
|
-
|
|
272
|
+
const [rating, setRating] = useState('');
|
|
273
|
+
const [hover, setHover] = useState(false);
|
|
274
|
+
const [tempRating, setTempRating] = useState('');
|
|
275
|
+
const [initialRating, setInitialRating] = useState('');
|
|
276
|
+
const inputRef = useRef();
|
|
277
|
+
useEffect(() => {
|
|
303
278
|
setRating(value || defaultValue);
|
|
304
279
|
setInitialRating(value || defaultValue);
|
|
305
280
|
}, [value, defaultValue]);
|
|
306
|
-
|
|
281
|
+
useEffect(() => {
|
|
307
282
|
inputRef.current.value = String(rating);
|
|
308
283
|
if (rating === initialRating) {
|
|
309
284
|
return undefined;
|
|
@@ -314,12 +289,12 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
314
289
|
});
|
|
315
290
|
}
|
|
316
291
|
}, [rating]);
|
|
317
|
-
const memoizedDescriptionToolTip =
|
|
292
|
+
const memoizedDescriptionToolTip = useMemo(() => {
|
|
318
293
|
return descriptionToolTip;
|
|
319
294
|
}, [descriptionToolTip]);
|
|
320
295
|
const starIconRender = key => {
|
|
321
296
|
if (rating > 0 && rating >= key + 1) {
|
|
322
|
-
return React__default
|
|
297
|
+
return React__default.createElement(StarFill, {
|
|
323
298
|
readOnly: readOnly,
|
|
324
299
|
disabled: disabled,
|
|
325
300
|
onClick: event => {
|
|
@@ -345,7 +320,7 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
345
320
|
key: key
|
|
346
321
|
}, iconFill);
|
|
347
322
|
} else if (viewEmpty) {
|
|
348
|
-
return React__default
|
|
323
|
+
return React__default.createElement(Star, {
|
|
349
324
|
readOnly: readOnly,
|
|
350
325
|
disabled: disabled,
|
|
351
326
|
onClick: event => {
|
|
@@ -367,22 +342,22 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
367
342
|
}
|
|
368
343
|
};
|
|
369
344
|
const input = () => {
|
|
370
|
-
return React__default
|
|
345
|
+
return React__default.createElement(CompactStarRating$1, _extends$2({
|
|
371
346
|
ref: forwardedRef,
|
|
372
347
|
readOnly: readOnly,
|
|
373
348
|
disabled: disabled,
|
|
374
349
|
onChange: onChange,
|
|
375
350
|
onBlur: onBlur
|
|
376
|
-
}, props), React__default
|
|
351
|
+
}, props), React__default.createElement(labelWidth, {
|
|
377
352
|
disabled: disabled
|
|
378
|
-
}, label, React__default
|
|
353
|
+
}, label, React__default.createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon)), React__default.createElement(starsWidth, {
|
|
379
354
|
edit: edit,
|
|
380
355
|
type: type,
|
|
381
356
|
readOnly: readOnly
|
|
382
357
|
}, stars.map(key => {
|
|
383
|
-
return React__default
|
|
358
|
+
return React__default.createElement("div", {
|
|
384
359
|
key: key
|
|
385
|
-
}, React__default
|
|
360
|
+
}, React__default.createElement("input", {
|
|
386
361
|
type: "number",
|
|
387
362
|
name: name,
|
|
388
363
|
ref: inputRef
|
|
@@ -390,7 +365,7 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
390
365
|
})));
|
|
391
366
|
};
|
|
392
367
|
if (hidden) return null;
|
|
393
|
-
return React__default
|
|
368
|
+
return React__default.createElement(React__default.Fragment, null, !memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && React__default.createElement("div", null, React__default.createElement(Tooltip, {
|
|
394
369
|
content: memoizedDescriptionToolTip,
|
|
395
370
|
key: "tooltipTextArea1",
|
|
396
371
|
placement: "bottom-end",
|
|
@@ -399,24 +374,24 @@ const CompactStarRating = React__default["default"].forwardRef(function CompactS
|
|
|
399
374
|
}, input())));
|
|
400
375
|
});
|
|
401
376
|
CompactStarRating.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
402
|
-
readOnly:
|
|
403
|
-
disabled:
|
|
404
|
-
edit:
|
|
405
|
-
value:
|
|
406
|
-
type:
|
|
407
|
-
defaultValue:
|
|
408
|
-
label:
|
|
409
|
-
name:
|
|
410
|
-
icon:
|
|
411
|
-
iconFill:
|
|
412
|
-
max:
|
|
413
|
-
viewEmpty:
|
|
414
|
-
onChange:
|
|
415
|
-
onBlur:
|
|
416
|
-
hidden:
|
|
417
|
-
loadingIcon:
|
|
418
|
-
successIcon:
|
|
419
|
-
descriptionToolTip:
|
|
377
|
+
readOnly: PropTypes.bool,
|
|
378
|
+
disabled: PropTypes.bool,
|
|
379
|
+
edit: PropTypes.bool,
|
|
380
|
+
value: PropTypes.number,
|
|
381
|
+
type: PropTypes.oneOf(['', 'error', 'warning', 'loading', 'success']),
|
|
382
|
+
defaultValue: PropTypes.number,
|
|
383
|
+
label: PropTypes.string,
|
|
384
|
+
name: PropTypes.string,
|
|
385
|
+
icon: PropTypes.element,
|
|
386
|
+
iconFill: PropTypes.element,
|
|
387
|
+
max: PropTypes.number,
|
|
388
|
+
viewEmpty: PropTypes.bool,
|
|
389
|
+
onChange: PropTypes.func,
|
|
390
|
+
onBlur: PropTypes.func,
|
|
391
|
+
hidden: PropTypes.bool,
|
|
392
|
+
loadingIcon: PropTypes.element,
|
|
393
|
+
successIcon: PropTypes.element,
|
|
394
|
+
descriptionToolTip: PropTypes.string
|
|
420
395
|
} : {};
|
|
421
396
|
CompactStarRating.defaultProps = {
|
|
422
397
|
label: 'Rating',
|
|
@@ -424,8 +399,8 @@ CompactStarRating.defaultProps = {
|
|
|
424
399
|
value: 0,
|
|
425
400
|
defaultValue: 0,
|
|
426
401
|
viewEmpty: true,
|
|
427
|
-
icon: React__default
|
|
428
|
-
iconFill: React__default
|
|
402
|
+
icon: React__default.createElement(SvgStar, null),
|
|
403
|
+
iconFill: React__default.createElement(SvgStarFilled, null),
|
|
429
404
|
hidden: false,
|
|
430
405
|
type: '',
|
|
431
406
|
descriptionToolTip: '',
|
|
@@ -433,4 +408,4 @@ CompactStarRating.defaultProps = {
|
|
|
433
408
|
onChange: () => {}
|
|
434
409
|
};
|
|
435
410
|
|
|
436
|
-
|
|
411
|
+
export { CompactStarRating as C };
|