@ntbjs/react-components 2.0.0-rc.26 → 2.0.0-rc.27
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/{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/warning-circle-24f3efcd.js +15 -0
- package/build/{AssetAction-d081e4b7.js → widgets/AssetGallery/AssetGallery.js} +601 -622
- 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/package.json +1 -1
- 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
- package/build/widgets/index.js +0 -65
package/build/{CompactAutocompleteSelect-797778cb.js → CompactAutocompleteSelect-52c49513.js}
RENAMED
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { _ as _extends } from './_rollupPluginBabelHelpers-c245b26a.js';
|
|
2
|
+
import { isEmpty } from 'lodash';
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
import { a as applyDefaultTheme, P as PropTypes } from './defaultTheme-1bcc2541.js';
|
|
5
|
+
import React__default, { useState, useMemo } from 'react';
|
|
6
|
+
import './Alert-e6847a22.js';
|
|
7
|
+
import './Badge-d93586a9.js';
|
|
8
|
+
import './Popover-20050b91.js';
|
|
9
|
+
import './Tab-04d435c3.js';
|
|
10
|
+
import './Tabs-74d1ea8a.js';
|
|
11
|
+
import { T as Tooltip } from './Tooltip-c1d1199e.js';
|
|
12
|
+
import './VerificationStatusIcon-49cb1c1b.js';
|
|
13
|
+
import styled, { keyframes, css } from 'styled-components';
|
|
14
|
+
import Select, { components } from 'react-select';
|
|
15
|
+
import { withAsyncPaginate, AsyncPaginate } from 'react-select-async-paginate';
|
|
16
|
+
import CreatableSelect from 'react-select/creatable';
|
|
17
|
+
import { S as SvgClose } from './close-a5d37608.js';
|
|
18
|
+
import { S as SvgExpandMore } from './expand-more-c5523c46.js';
|
|
2
19
|
|
|
3
|
-
|
|
4
|
-
var lodash = require('lodash');
|
|
5
|
-
var nanoid = require('nanoid');
|
|
6
|
-
var defaultTheme = require('./defaultTheme-d9a7342e.js');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
require('./Alert-8a511bdc.js');
|
|
9
|
-
require('./Badge-aa4cd9c1.js');
|
|
10
|
-
require('./Popover-c4be47ea.js');
|
|
11
|
-
require('./Tab-ccbca1f2.js');
|
|
12
|
-
require('./Tabs-b06c0e24.js');
|
|
13
|
-
var Tooltip = require('./Tooltip-d5882b82.js');
|
|
14
|
-
require('./VerificationStatusIcon-9876b68f.js');
|
|
15
|
-
var styled = require('styled-components');
|
|
16
|
-
var Select = require('react-select');
|
|
17
|
-
var reactSelectAsyncPaginate = require('react-select-async-paginate');
|
|
18
|
-
var CreatableSelect = require('react-select/creatable');
|
|
19
|
-
var close = require('./close-1751121a.js');
|
|
20
|
-
var expandMore = require('./expand-more-d74e2bd2.js');
|
|
21
|
-
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
26
|
-
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
27
|
-
var CreatableSelect__default = /*#__PURE__*/_interopDefaultLegacy(CreatableSelect);
|
|
28
|
-
|
|
29
|
-
const fadeIn = styled.keyframes`
|
|
20
|
+
const fadeIn = keyframes`
|
|
30
21
|
from {
|
|
31
22
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};
|
|
32
23
|
}
|
|
@@ -34,7 +25,7 @@ const fadeIn = styled.keyframes`
|
|
|
34
25
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};
|
|
35
26
|
}
|
|
36
27
|
`;
|
|
37
|
-
const fadeOut =
|
|
28
|
+
const fadeOut = keyframes`
|
|
38
29
|
from {
|
|
39
30
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 1)', 'rgba(191, 224, 213, 1)')};
|
|
40
31
|
}
|
|
@@ -42,7 +33,7 @@ const fadeOut = styled.keyframes`
|
|
|
42
33
|
background-color: ${props => props.theme.themeProp('rgba(48, 130, 106, 0)', 'rgba(191, 224, 213, 0)')};
|
|
43
34
|
}
|
|
44
35
|
`;
|
|
45
|
-
const fadeInCheck =
|
|
36
|
+
const fadeInCheck = keyframes`
|
|
46
37
|
from {
|
|
47
38
|
opacity: 0
|
|
48
39
|
}
|
|
@@ -50,7 +41,7 @@ const fadeInCheck = styled.keyframes`
|
|
|
50
41
|
opacity: 1
|
|
51
42
|
}
|
|
52
43
|
`;
|
|
53
|
-
const fadeOutCheck =
|
|
44
|
+
const fadeOutCheck = keyframes`
|
|
54
45
|
from {
|
|
55
46
|
opacity: 1
|
|
56
47
|
}
|
|
@@ -58,8 +49,8 @@ const fadeOutCheck = styled.keyframes`
|
|
|
58
49
|
opacity: 0
|
|
59
50
|
}
|
|
60
51
|
`;
|
|
61
|
-
const AsyncCreatableSelectPaginate =
|
|
62
|
-
const sharedStyle =
|
|
52
|
+
const AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);
|
|
53
|
+
const sharedStyle = css`
|
|
63
54
|
font-family: ${props => props.theme.primaryFontFamily};
|
|
64
55
|
font-size: 0.875rem;
|
|
65
56
|
line-height: 1rem;
|
|
@@ -68,17 +59,17 @@ const sharedStyle = styled.css`
|
|
|
68
59
|
box-shadow: 'none';
|
|
69
60
|
flex-basis: ${props => props.$hasLabel ? '66.66%' : '100%'};
|
|
70
61
|
`;
|
|
71
|
-
const CompactAutocompleteSelect$1 =
|
|
62
|
+
const CompactAutocompleteSelect$1 = styled.div.attrs(applyDefaultTheme)`
|
|
72
63
|
display: flex;
|
|
73
64
|
align-items: center;
|
|
74
65
|
height: 24px;
|
|
75
66
|
font-family: ${props => props.theme.primaryFontFamily};
|
|
76
|
-
${props => props.disabled &&
|
|
67
|
+
${props => props.disabled && css`
|
|
77
68
|
opacity: 0.5;
|
|
78
69
|
cursor: not-allowed;
|
|
79
70
|
`}
|
|
80
71
|
`;
|
|
81
|
-
const Label =
|
|
72
|
+
const Label = styled.label.attrs(applyDefaultTheme)`
|
|
82
73
|
${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
|
|
83
74
|
flex-basis: 33.33%;
|
|
84
75
|
font-size: 0.875rem;
|
|
@@ -88,16 +79,16 @@ const Label = styled__default["default"].label.attrs(defaultTheme.applyDefaultTh
|
|
|
88
79
|
justify-content: space-between;
|
|
89
80
|
align-items: center;
|
|
90
81
|
padding-top: 2px;
|
|
91
|
-
${props => props.disabled &&
|
|
82
|
+
${props => props.disabled && css`
|
|
92
83
|
cursor: not-allowed;
|
|
93
84
|
`}
|
|
94
85
|
`;
|
|
95
|
-
const InputContainer =
|
|
86
|
+
const InputContainer = styled.div.attrs(applyDefaultTheme)`
|
|
96
87
|
display: flex;
|
|
97
88
|
width: 100%;
|
|
98
89
|
height: 19px;
|
|
99
90
|
`;
|
|
100
|
-
const SuccessContainer =
|
|
91
|
+
const SuccessContainer = styled.div.attrs(applyDefaultTheme)`
|
|
101
92
|
opacity: 1;
|
|
102
93
|
pointer-events: none;
|
|
103
94
|
display: flex;
|
|
@@ -110,50 +101,50 @@ const SuccessContainer = styled__default["default"].div.attrs(defaultTheme.apply
|
|
|
110
101
|
width: 13px;
|
|
111
102
|
}
|
|
112
103
|
`;
|
|
113
|
-
const AsyncCreatableAutocompleteSelect =
|
|
104
|
+
const AsyncCreatableAutocompleteSelect = styled(AsyncCreatableSelectPaginate).attrs(applyDefaultTheme)`
|
|
114
105
|
${sharedStyle}
|
|
115
|
-
${props => props.disabled &&
|
|
106
|
+
${props => props.disabled && css`
|
|
116
107
|
opacity: 0.5;
|
|
117
108
|
cursor: not-allowed;
|
|
118
109
|
`}
|
|
119
110
|
&&:hover:not(:focus) {
|
|
120
|
-
${props => props.disabled &&
|
|
111
|
+
${props => props.disabled && css`
|
|
121
112
|
background: none !important;
|
|
122
113
|
cursor: not-allowed;
|
|
123
114
|
`}
|
|
124
115
|
}
|
|
125
116
|
`;
|
|
126
|
-
const AsyncAutocompleteSelect =
|
|
117
|
+
const AsyncAutocompleteSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)`
|
|
127
118
|
${sharedStyle}
|
|
128
|
-
${props => props.disabled &&
|
|
119
|
+
${props => props.disabled && css`
|
|
129
120
|
opacity: 0.5;
|
|
130
121
|
`}
|
|
131
122
|
&&:hover:not(:focus) {
|
|
132
|
-
${props => props.disabled &&
|
|
123
|
+
${props => props.disabled && css`
|
|
133
124
|
background: none !important;
|
|
134
125
|
cursor: not-allowed;
|
|
135
126
|
`}
|
|
136
127
|
}
|
|
137
128
|
`;
|
|
138
|
-
const AutocompletSelect =
|
|
129
|
+
const AutocompletSelect = styled(Select).attrs(applyDefaultTheme)`
|
|
139
130
|
${sharedStyle}
|
|
140
|
-
${props => props.disabled &&
|
|
131
|
+
${props => props.disabled && css`
|
|
141
132
|
opacity: 0.5;
|
|
142
133
|
`}
|
|
143
134
|
&&:hover:not(:focus) {
|
|
144
|
-
${props => props.disabled &&
|
|
135
|
+
${props => props.disabled && css`
|
|
145
136
|
background: none !important;
|
|
146
137
|
cursor: not-allowed;
|
|
147
138
|
`}
|
|
148
139
|
}
|
|
149
140
|
`;
|
|
150
|
-
const AutocompletCreatableSelect =
|
|
141
|
+
const AutocompletCreatableSelect = styled(CreatableSelect).attrs(applyDefaultTheme)`
|
|
151
142
|
${sharedStyle}
|
|
152
|
-
${props => props.disabled &&
|
|
143
|
+
${props => props.disabled && css`
|
|
153
144
|
opacity: 0.5;
|
|
154
145
|
`}
|
|
155
146
|
`;
|
|
156
|
-
const Control =
|
|
147
|
+
const Control = styled(components.Control).attrs(applyDefaultTheme)`
|
|
157
148
|
&& {
|
|
158
149
|
${props => props.edit && props.theme.themeProp('background', 'rgba(39,39,42, 0.7)', 'rgba(244,244,245, 0.3)')};
|
|
159
150
|
${props => props.edit && props.theme.themeProp('border-color', 'rgba(39,39,42, 0.7)', 'rgba(228,228,231, 0.3)')};
|
|
@@ -166,7 +157,7 @@ const Control = styled__default["default"](Select.components.Control).attrs(defa
|
|
|
166
157
|
cursor: pointer;
|
|
167
158
|
border: 1px solid transparent;
|
|
168
159
|
background-color: transparent;
|
|
169
|
-
${props => props.type &&
|
|
160
|
+
${props => props.type && css`
|
|
170
161
|
animation: ${props => props.type === 'success' ? fadeIn : fadeOut} 0.5s ease-in-out;
|
|
171
162
|
`}
|
|
172
163
|
|
|
@@ -202,7 +193,7 @@ const Control = styled__default["default"](Select.components.Control).attrs(defa
|
|
|
202
193
|
${props => props.type === 'error' && !props.isFocused && props.theme.themeProp('background', '#901d1d', '#f7d5d0')};
|
|
203
194
|
}
|
|
204
195
|
`;
|
|
205
|
-
const Option =
|
|
196
|
+
const Option = styled(components.Option).attrs(applyDefaultTheme)`
|
|
206
197
|
&& {
|
|
207
198
|
min-height: 22px;
|
|
208
199
|
height: 22px;
|
|
@@ -212,15 +203,15 @@ const Option = styled__default["default"](Select.components.Option).attrs(defaul
|
|
|
212
203
|
cursor: pointer;
|
|
213
204
|
padding: 1px 13px;
|
|
214
205
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))}
|
|
215
|
-
${props => props.isFocused &&
|
|
206
|
+
${props => props.isFocused && css`
|
|
216
207
|
${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
|
|
217
208
|
`}
|
|
218
|
-
${props => props.isSelected &&
|
|
209
|
+
${props => props.isSelected && css`
|
|
219
210
|
${props.theme.themeProp('background-color', 'transparent', 'transparent')}
|
|
220
211
|
|
|
221
212
|
${props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))}
|
|
222
213
|
`}
|
|
223
|
-
${props => props.isFocused && props.isSelected &&
|
|
214
|
+
${props => props.isFocused && props.isSelected && css`
|
|
224
215
|
${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
|
|
225
216
|
`}
|
|
226
217
|
}
|
|
@@ -234,20 +225,20 @@ const Option = styled__default["default"](Select.components.Option).attrs(defaul
|
|
|
234
225
|
color: inherit;
|
|
235
226
|
}
|
|
236
227
|
`;
|
|
237
|
-
const Placeholder =
|
|
228
|
+
const Placeholder = styled(components.Placeholder).attrs(applyDefaultTheme)`
|
|
238
229
|
&& {
|
|
239
|
-
${props => (props.type === 'error' || props.type === 'warning') &&
|
|
230
|
+
${props => (props.type === 'error' || props.type === 'warning') && css`
|
|
240
231
|
${props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))}
|
|
241
232
|
`}
|
|
242
233
|
${props => (props.type === 'error' || props.type === 'warning') && props.theme.themeProp('opacity', '0.6', '0.6')};
|
|
243
234
|
}
|
|
244
235
|
`;
|
|
245
|
-
const SingleValue =
|
|
236
|
+
const SingleValue = styled(components.SingleValue).attrs(applyDefaultTheme)`
|
|
246
237
|
&& {
|
|
247
238
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))};
|
|
248
239
|
}
|
|
249
240
|
`;
|
|
250
|
-
const Input =
|
|
241
|
+
const Input = styled(components.Input).attrs(applyDefaultTheme)`
|
|
251
242
|
&& {
|
|
252
243
|
margin: 0;
|
|
253
244
|
padding: 0;
|
|
@@ -255,17 +246,17 @@ const Input = styled__default["default"](Select.components.Input).attrs(defaultT
|
|
|
255
246
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-200'), props.theme.getColor('gray-700'))}
|
|
256
247
|
}
|
|
257
248
|
`;
|
|
258
|
-
const Menu =
|
|
249
|
+
const Menu = styled(components.Menu).attrs(applyDefaultTheme)`
|
|
259
250
|
&& {
|
|
260
251
|
${props => props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'))};
|
|
261
252
|
}
|
|
262
253
|
`;
|
|
263
|
-
const ValueContainer =
|
|
254
|
+
const ValueContainer = styled(components.ValueContainer).attrs(applyDefaultTheme)`
|
|
264
255
|
&& {
|
|
265
256
|
padding: 0;
|
|
266
257
|
}
|
|
267
258
|
`;
|
|
268
|
-
const ClearIndicator =
|
|
259
|
+
const ClearIndicator = styled(components.ClearIndicator).attrs(applyDefaultTheme)`
|
|
269
260
|
&& {
|
|
270
261
|
display: ${props => props.isFocused ? 'flex' : 'none'};
|
|
271
262
|
padding: 0;
|
|
@@ -273,7 +264,7 @@ const ClearIndicator = styled__default["default"](Select.components.ClearIndicat
|
|
|
273
264
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))};
|
|
274
265
|
}
|
|
275
266
|
`;
|
|
276
|
-
const DropdownIndicator =
|
|
267
|
+
const DropdownIndicator = styled(components.DropdownIndicator).attrs(applyDefaultTheme)`
|
|
277
268
|
&& {
|
|
278
269
|
display: ${props => props.isFocused ? 'flex' : 'none'};
|
|
279
270
|
padding: 0;
|
|
@@ -284,16 +275,16 @@ const DropdownIndicator = styled__default["default"](Select.components.DropdownI
|
|
|
284
275
|
${props => props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))};
|
|
285
276
|
}
|
|
286
277
|
`;
|
|
287
|
-
const DropdownIndicatorIcon =
|
|
278
|
+
const DropdownIndicatorIcon = styled(SvgExpandMore).attrs(applyDefaultTheme)`
|
|
288
279
|
width: 12px;
|
|
289
280
|
`;
|
|
290
|
-
const ClearIndicatorIcon =
|
|
281
|
+
const ClearIndicatorIcon = styled(SvgClose).attrs(applyDefaultTheme)`
|
|
291
282
|
width: 8px;
|
|
292
283
|
margin-right: 4px;
|
|
293
284
|
${props => props.theme.themeProp('stroke', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))};
|
|
294
285
|
stroke-width: 2px;
|
|
295
286
|
`;
|
|
296
|
-
const IndicatorSeparator =
|
|
287
|
+
const IndicatorSeparator = styled(components.IndicatorSeparator).attrs(applyDefaultTheme)`
|
|
297
288
|
&& {
|
|
298
289
|
display: ${props => props.isFocused ? 'flex' : 'none'};
|
|
299
290
|
margin: 4px;
|
|
@@ -301,7 +292,7 @@ const IndicatorSeparator = styled__default["default"](Select.components.Indicato
|
|
|
301
292
|
}
|
|
302
293
|
`;
|
|
303
294
|
|
|
304
|
-
const CompactAutocompleteSelect = React__default
|
|
295
|
+
const CompactAutocompleteSelect = React__default.forwardRef(function CompactAutocompleteSelect({
|
|
305
296
|
label,
|
|
306
297
|
availableOptions,
|
|
307
298
|
placeholder,
|
|
@@ -322,41 +313,41 @@ const CompactAutocompleteSelect = React__default["default"].forwardRef(function
|
|
|
322
313
|
successIcon,
|
|
323
314
|
...props
|
|
324
315
|
}, forwardedRef) {
|
|
325
|
-
const [uniqueId] =
|
|
326
|
-
const [selected, setSelected] =
|
|
327
|
-
const [focused, setFocused] =
|
|
328
|
-
const [cacheUnique, setCacheUnique] =
|
|
329
|
-
const memoizedDescriptionToolTip =
|
|
316
|
+
const [uniqueId] = useState(nanoid());
|
|
317
|
+
const [selected, setSelected] = useState(selectedOption);
|
|
318
|
+
const [focused, setFocused] = useState(false);
|
|
319
|
+
const [cacheUnique, setCacheUnique] = useState(0);
|
|
320
|
+
const memoizedDescriptionToolTip = useMemo(() => {
|
|
330
321
|
return descriptionToolTip;
|
|
331
322
|
}, [descriptionToolTip]);
|
|
332
323
|
const Control$1 = props => {
|
|
333
|
-
return React__default
|
|
324
|
+
return React__default.createElement(Control, _extends({
|
|
334
325
|
className: "select-control",
|
|
335
326
|
edit: edit,
|
|
336
327
|
type: type
|
|
337
328
|
}, props));
|
|
338
329
|
};
|
|
339
|
-
const ValueContainer$1 =
|
|
330
|
+
const ValueContainer$1 = useMemo(() => {
|
|
340
331
|
const valueContainer = props => {
|
|
341
|
-
return React__default
|
|
332
|
+
return React__default.createElement(React__default.Fragment, null, React__default.createElement(ValueContainer, _extends({
|
|
342
333
|
type: type
|
|
343
334
|
}, props)));
|
|
344
335
|
};
|
|
345
336
|
valueContainer.displayName = 'ValueContainerWrapper';
|
|
346
337
|
return valueContainer;
|
|
347
338
|
}, [type]);
|
|
348
|
-
const Input$1 =
|
|
339
|
+
const Input$1 = useMemo(() => {
|
|
349
340
|
const selectInput = props => {
|
|
350
|
-
return React__default
|
|
341
|
+
return React__default.createElement(Input, _extends({
|
|
351
342
|
className: "select-input"
|
|
352
343
|
}, props));
|
|
353
344
|
};
|
|
354
345
|
selectInput.displayName = 'InputWrapper';
|
|
355
346
|
return selectInput;
|
|
356
347
|
}, []);
|
|
357
|
-
const Menu$1 =
|
|
348
|
+
const Menu$1 = useMemo(() => {
|
|
358
349
|
const menu = props => {
|
|
359
|
-
return React__default
|
|
350
|
+
return React__default.createElement(Menu, _extends({
|
|
360
351
|
className: "select-menu"
|
|
361
352
|
}, props));
|
|
362
353
|
};
|
|
@@ -364,42 +355,42 @@ const CompactAutocompleteSelect = React__default["default"].forwardRef(function
|
|
|
364
355
|
return menu;
|
|
365
356
|
}, []);
|
|
366
357
|
const Placeholder$1 = props => {
|
|
367
|
-
return React__default
|
|
358
|
+
return React__default.createElement(Placeholder, _extends({
|
|
368
359
|
className: "select-placeholder",
|
|
369
360
|
type: type
|
|
370
361
|
}, props));
|
|
371
362
|
};
|
|
372
363
|
const Option$1 = props => {
|
|
373
|
-
return !props.data.link ? React__default
|
|
364
|
+
return !props.data.link ? React__default.createElement(Option, _extends({
|
|
374
365
|
className: "menu-item"
|
|
375
|
-
}, props)) : React__default
|
|
366
|
+
}, props)) : React__default.createElement(Option, props, React__default.createElement("a", {
|
|
376
367
|
href: props.data.link
|
|
377
368
|
}, props.data.icon, props.label));
|
|
378
369
|
};
|
|
379
370
|
const SingleValue$1 = props => {
|
|
380
|
-
return React__default
|
|
371
|
+
return React__default.createElement(SingleValue, _extends({
|
|
381
372
|
className: "menu-value"
|
|
382
373
|
}, props));
|
|
383
374
|
};
|
|
384
375
|
Option$1.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
385
|
-
data:
|
|
386
|
-
icon:
|
|
387
|
-
link:
|
|
376
|
+
data: PropTypes.shape({
|
|
377
|
+
icon: PropTypes.node,
|
|
378
|
+
link: PropTypes.string
|
|
388
379
|
}),
|
|
389
|
-
label:
|
|
380
|
+
label: PropTypes.string
|
|
390
381
|
} : {};
|
|
391
382
|
const DropdownIndicator$1 = props => {
|
|
392
|
-
return React__default
|
|
383
|
+
return React__default.createElement(DropdownIndicator, _extends({
|
|
393
384
|
className: "dropdown-indicator"
|
|
394
|
-
}, props), React__default
|
|
385
|
+
}, props), React__default.createElement(DropdownIndicatorIcon, null));
|
|
395
386
|
};
|
|
396
387
|
const ClearIndicator$1 = props => {
|
|
397
|
-
return React__default
|
|
388
|
+
return React__default.createElement(ClearIndicator, _extends({
|
|
398
389
|
className: "clear-indicator"
|
|
399
|
-
}, props), React__default
|
|
390
|
+
}, props), React__default.createElement(ClearIndicatorIcon, null));
|
|
400
391
|
};
|
|
401
392
|
const IndicatorSeparator$1 = props => {
|
|
402
|
-
return React__default
|
|
393
|
+
return React__default.createElement(IndicatorSeparator, _extends({
|
|
403
394
|
className: "indicator-separator"
|
|
404
395
|
}, props));
|
|
405
396
|
};
|
|
@@ -488,22 +479,22 @@ const CompactAutocompleteSelect = React__default["default"].forwardRef(function
|
|
|
488
479
|
};
|
|
489
480
|
if (hidden) return null;
|
|
490
481
|
const input = () => {
|
|
491
|
-
return React__default
|
|
482
|
+
return React__default.createElement(CompactAutocompleteSelect$1, {
|
|
492
483
|
disabled: disabled
|
|
493
|
-
}, React__default
|
|
484
|
+
}, React__default.createElement(InputContainer, null, label && React__default.createElement(Label, {
|
|
494
485
|
htmlFor: uniqueId,
|
|
495
486
|
disabled: disabled
|
|
496
|
-
}, label, React__default
|
|
497
|
-
$hasLabel: !
|
|
498
|
-
}, sharedSelectProps, props)) : React__default
|
|
499
|
-
$hasLabel: !
|
|
500
|
-
}, sharedSelectProps, props)) : creatable ? React__default
|
|
501
|
-
$hasLabel: !
|
|
502
|
-
}, sharedSelectProps, props)) : React__default
|
|
503
|
-
$hasLabel: !
|
|
487
|
+
}, label, React__default.createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon)), loadOptions ? creatable ? React__default.createElement(AsyncCreatableAutocompleteSelect, _extends({
|
|
488
|
+
$hasLabel: !isEmpty(label)
|
|
489
|
+
}, sharedSelectProps, props)) : React__default.createElement(AsyncAutocompleteSelect, _extends({
|
|
490
|
+
$hasLabel: !isEmpty(label)
|
|
491
|
+
}, sharedSelectProps, props)) : creatable ? React__default.createElement(AutocompletCreatableSelect, _extends({
|
|
492
|
+
$hasLabel: !isEmpty(label)
|
|
493
|
+
}, sharedSelectProps, props)) : React__default.createElement(AutocompletSelect, _extends({
|
|
494
|
+
$hasLabel: !isEmpty(label)
|
|
504
495
|
}, sharedSelectProps, props))));
|
|
505
496
|
};
|
|
506
|
-
return React__default
|
|
497
|
+
return React__default.createElement(React__default.Fragment, null, !memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && React__default.createElement("div", null, React__default.createElement(Tooltip, {
|
|
507
498
|
content: memoizedDescriptionToolTip,
|
|
508
499
|
key: "tooltipTextArea1",
|
|
509
500
|
placement: "bottom-end",
|
|
@@ -512,26 +503,26 @@ const CompactAutocompleteSelect = React__default["default"].forwardRef(function
|
|
|
512
503
|
}, input())));
|
|
513
504
|
});
|
|
514
505
|
CompactAutocompleteSelect.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
515
|
-
label:
|
|
516
|
-
placeholder:
|
|
517
|
-
availableOptions:
|
|
518
|
-
selectedOption:
|
|
519
|
-
loadOptions:
|
|
520
|
-
loadingMessageFunc:
|
|
521
|
-
createNewOptionMessageFunc:
|
|
522
|
-
noOptionsMessageFunc:
|
|
523
|
-
readOnly:
|
|
524
|
-
edit:
|
|
525
|
-
hidden:
|
|
526
|
-
error:
|
|
527
|
-
warning:
|
|
528
|
-
onUpdateCallback:
|
|
529
|
-
creatable:
|
|
530
|
-
disabled:
|
|
531
|
-
type:
|
|
532
|
-
descriptionToolTip:
|
|
533
|
-
loadingIcon:
|
|
534
|
-
successIcon:
|
|
506
|
+
label: PropTypes.string,
|
|
507
|
+
placeholder: PropTypes.string,
|
|
508
|
+
availableOptions: PropTypes.arrayOf(PropTypes.object),
|
|
509
|
+
selectedOption: PropTypes.object,
|
|
510
|
+
loadOptions: PropTypes.func,
|
|
511
|
+
loadingMessageFunc: PropTypes.func,
|
|
512
|
+
createNewOptionMessageFunc: PropTypes.func,
|
|
513
|
+
noOptionsMessageFunc: PropTypes.func,
|
|
514
|
+
readOnly: PropTypes.bool,
|
|
515
|
+
edit: PropTypes.bool,
|
|
516
|
+
hidden: PropTypes.bool,
|
|
517
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
518
|
+
warning: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
519
|
+
onUpdateCallback: PropTypes.func,
|
|
520
|
+
creatable: PropTypes.bool,
|
|
521
|
+
disabled: PropTypes.bool,
|
|
522
|
+
type: PropTypes.oneOf(['', 'error', 'warning', 'instructions-warning', 'loading', 'success']),
|
|
523
|
+
descriptionToolTip: PropTypes.string,
|
|
524
|
+
loadingIcon: PropTypes.element,
|
|
525
|
+
successIcon: PropTypes.element
|
|
535
526
|
} : {};
|
|
536
527
|
CompactAutocompleteSelect.defaultProps = {
|
|
537
528
|
noOptionsMessageFunc: inputValue => {
|
|
@@ -552,4 +543,4 @@ CompactAutocompleteSelect.defaultProps = {
|
|
|
552
543
|
descriptionToolTip: ''
|
|
553
544
|
};
|
|
554
545
|
|
|
555
|
-
|
|
546
|
+
export { CompactAutocompleteSelect as C };
|