dash-core-components 4.0.0-rc0 → 4.0.0-rc1
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/dash_core_components/async-datepicker.js +1 -1
- package/dash_core_components/async-datepicker.js.map +1 -1
- package/dash_core_components/async-dropdown.js +1 -1
- package/dash_core_components/async-dropdown.js.map +1 -1
- package/dash_core_components/async-graph.js +1 -1
- package/dash_core_components/async-slider.js +1 -2
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/dash_core_components-shared.js +1 -1
- package/dash_core_components/dash_core_components-shared.js.map +1 -1
- package/dash_core_components/dash_core_components.js +1 -1
- package/dash_core_components/dash_core_components.js.map +1 -1
- package/dash_core_components/proptypes.js +18 -0
- package/lib/components/Dropdown.tsx +52 -0
- package/lib/components/RangeSlider.tsx +8 -1
- package/lib/components/Textarea.react.js.old +287 -0
- package/lib/components/css/dcc.css +1 -0
- package/lib/components/css/dropdown.css +230 -0
- package/lib/components/css/sliders.css +8 -0
- package/lib/fragments/Dropdown.tsx +577 -0
- package/lib/fragments/RangeSlider.tsx +71 -71
- package/lib/index.ts +1 -1
- package/lib/types.ts +168 -0
- package/lib/utils/LazyLoader/dropdown.ts +2 -0
- package/lib/utils/_LoadingElement.tsx +8 -18
- package/lib/utils/dropdownSearch.ts +92 -0
- package/lib/utils/optionTypes.ts +27 -0
- package/package.json +7 -3
- package/lib/components/Dropdown.react.js +0 -182
- package/lib/fragments/Dropdown.react.js +0 -158
- package/lib/fragments/Slider.tsx.old +0 -364
- package/lib/utils/LazyLoader/dropdown.js +0 -8
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
var pt = window.PropTypes;
|
|
4
4
|
var pk = window['dash_core_components'];
|
|
5
5
|
|
|
6
|
+
pk.Dropdown.propTypes = {options:pt.any,
|
|
7
|
+
value:pt.oneOfType([pt.string,pt.number,pt.bool,pt.arrayOf(pt.oneOfType([pt.string,pt.number,pt.bool]))]),
|
|
8
|
+
multi:pt.oneOfType([pt.bool]),
|
|
9
|
+
clearable:pt.oneOfType([pt.bool]),
|
|
10
|
+
searchable:pt.oneOfType([pt.bool]),
|
|
11
|
+
search_value:pt.oneOfType([pt.string]),
|
|
12
|
+
placeholder:pt.oneOfType([pt.string]),
|
|
13
|
+
disabled:pt.oneOfType([pt.bool]),
|
|
14
|
+
closeOnSelect:pt.oneOfType([pt.bool]),
|
|
15
|
+
optionHeight:pt.oneOfType([pt.number]),
|
|
16
|
+
maxHeight:pt.oneOfType([pt.number]),
|
|
17
|
+
style:pt.any,
|
|
18
|
+
className:pt.oneOfType([pt.string]),
|
|
19
|
+
id:pt.oneOfType([pt.string]),
|
|
20
|
+
setProps:pt.any,
|
|
21
|
+
persistence:pt.oneOfType([pt.string,pt.number,pt.bool]),
|
|
22
|
+
persisted_props:pt.any,
|
|
23
|
+
persistence_type:pt.oneOf(['local','session','memory'])};
|
|
6
24
|
pk.Input.propTypes = {value:pt.oneOfType([pt.string,pt.number]),
|
|
7
25
|
debounce:pt.oneOfType([pt.number,pt.bool]),
|
|
8
26
|
placeholder:pt.oneOfType([pt.string,pt.number]),
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, {Component, lazy, Suspense} from 'react';
|
|
2
|
+
import {DropdownProps, PersistedProps, PersistenceTypes} from '../types';
|
|
3
|
+
import dropdown from '../utils/LazyLoader/dropdown';
|
|
4
|
+
|
|
5
|
+
const RealDropdown = lazy(dropdown);
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Dropdown is an interactive dropdown element for selecting one or more
|
|
9
|
+
* items.
|
|
10
|
+
* The values and labels of the dropdown items are specified in the `options`
|
|
11
|
+
* property and the selected item(s) are specified with the `value` property.
|
|
12
|
+
*
|
|
13
|
+
* Use a dropdown when you have many options (more than 5) or when you are
|
|
14
|
+
* constrained for space. Otherwise, you can use RadioItems or a Checklist,
|
|
15
|
+
* which have the benefit of showing the users all of the items at once.
|
|
16
|
+
*/
|
|
17
|
+
export default function Dropdown({
|
|
18
|
+
clearable = true,
|
|
19
|
+
disabled = false,
|
|
20
|
+
multi = false,
|
|
21
|
+
searchable = true,
|
|
22
|
+
// eslint-disable-next-line no-magic-numbers
|
|
23
|
+
optionHeight = 36,
|
|
24
|
+
// eslint-disable-next-line no-magic-numbers
|
|
25
|
+
maxHeight = 200,
|
|
26
|
+
closeOnSelect = !multi,
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
28
|
+
persisted_props = [PersistedProps.value],
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
30
|
+
persistence_type = PersistenceTypes.local,
|
|
31
|
+
...props
|
|
32
|
+
}: DropdownProps) {
|
|
33
|
+
return (
|
|
34
|
+
<Suspense fallback={null}>
|
|
35
|
+
<RealDropdown
|
|
36
|
+
clearable={clearable}
|
|
37
|
+
disabled={disabled}
|
|
38
|
+
multi={multi}
|
|
39
|
+
searchable={searchable}
|
|
40
|
+
optionHeight={optionHeight}
|
|
41
|
+
maxHeight={maxHeight}
|
|
42
|
+
closeOnSelect={closeOnSelect}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
</Suspense>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
Dropdown.dashPersistence = {
|
|
50
|
+
persisted_props: [PersistedProps.value],
|
|
51
|
+
persistence_type: PersistenceTypes.local,
|
|
52
|
+
};
|
|
@@ -18,9 +18,16 @@ export default function RangeSlider({
|
|
|
18
18
|
persistence_type = PersistenceTypes.local,
|
|
19
19
|
// eslint-disable-next-line no-magic-numbers
|
|
20
20
|
verticalHeight = 400,
|
|
21
|
-
step =
|
|
21
|
+
step = undefined,
|
|
22
22
|
...props
|
|
23
23
|
}: RangeSliderProps) {
|
|
24
|
+
// Some considerations for the default value of `step`:
|
|
25
|
+
// If the range consists of integers, default to a value of `1`
|
|
26
|
+
// Otherwise, leave it undefined
|
|
27
|
+
if (Number.isInteger(props.min) && Number.isInteger(props.max)) {
|
|
28
|
+
step = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
return (
|
|
25
32
|
<Suspense fallback={null}>
|
|
26
33
|
<RealRangeSlider
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import {pick} from 'ramda';
|
|
5
|
+
|
|
6
|
+
const textAreaProps = [
|
|
7
|
+
'id',
|
|
8
|
+
'autoFocus',
|
|
9
|
+
'cols',
|
|
10
|
+
'disabled',
|
|
11
|
+
'form',
|
|
12
|
+
'maxLength',
|
|
13
|
+
'minLength',
|
|
14
|
+
'name',
|
|
15
|
+
'placeholder',
|
|
16
|
+
'readOnly',
|
|
17
|
+
'required',
|
|
18
|
+
'rows',
|
|
19
|
+
'wrap',
|
|
20
|
+
'accessKey',
|
|
21
|
+
'className',
|
|
22
|
+
'contentEditable',
|
|
23
|
+
'contextMenu',
|
|
24
|
+
'dir',
|
|
25
|
+
'draggable',
|
|
26
|
+
'hidden',
|
|
27
|
+
'lang',
|
|
28
|
+
'spellCheck',
|
|
29
|
+
'style',
|
|
30
|
+
'tabIndex',
|
|
31
|
+
'title',
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A basic HTML textarea for entering multiline text.
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
const Textarea = ({
|
|
39
|
+
setProps,
|
|
40
|
+
value,
|
|
41
|
+
n_blur = 0,
|
|
42
|
+
n_blur_timestamp = -1,
|
|
43
|
+
n_clicks,
|
|
44
|
+
n_clicks_timestamp = -1,
|
|
45
|
+
persisted_props,
|
|
46
|
+
persistence_type,
|
|
47
|
+
...props
|
|
48
|
+
}) => {
|
|
49
|
+
const ctx = window.dash_component_api.useDashContext();
|
|
50
|
+
const isLoading = ctx.useLoading();
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<textarea
|
|
54
|
+
data-dash-is-loading={isLoading || undefined}
|
|
55
|
+
value={value}
|
|
56
|
+
onChange={e => {
|
|
57
|
+
setProps({value: e.target.value});
|
|
58
|
+
}}
|
|
59
|
+
onBlur={() => {
|
|
60
|
+
setProps({
|
|
61
|
+
n_blur: n_blur + 1,
|
|
62
|
+
n_blur_timestamp: Date.now(),
|
|
63
|
+
});
|
|
64
|
+
}}
|
|
65
|
+
onClick={() => {
|
|
66
|
+
setProps({
|
|
67
|
+
n_clicks: n_clicks + 1,
|
|
68
|
+
n_clicks_timestamp: Date.now(),
|
|
69
|
+
});
|
|
70
|
+
}}
|
|
71
|
+
{...pick(textAreaProps, props)}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
Textarea.dashPersistence = {
|
|
77
|
+
persisted_props: ['value'],
|
|
78
|
+
persistence_type: 'local',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Textarea.propTypes = {
|
|
82
|
+
/**
|
|
83
|
+
* The ID of this component, used to identify dash components
|
|
84
|
+
* in callbacks. The ID needs to be unique across all of the
|
|
85
|
+
* components in an app.
|
|
86
|
+
*/
|
|
87
|
+
id: PropTypes.string,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The value of the textarea
|
|
91
|
+
*/
|
|
92
|
+
value: PropTypes.string,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The element should be automatically focused after the page loaded.
|
|
96
|
+
*/
|
|
97
|
+
autoFocus: PropTypes.string,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Defines the number of columns in a textarea.
|
|
101
|
+
*/
|
|
102
|
+
cols: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Indicates whether the user can interact with the element.
|
|
106
|
+
*/
|
|
107
|
+
disabled: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Indicates the form that is the owner of the element.
|
|
111
|
+
*/
|
|
112
|
+
form: PropTypes.string,
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Defines the maximum number of characters allowed in the element.
|
|
116
|
+
*/
|
|
117
|
+
maxLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Defines the minimum number of characters allowed in the element.
|
|
121
|
+
*/
|
|
122
|
+
minLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Name of the element. For example used by the server to identify the fields in form submits.
|
|
126
|
+
*/
|
|
127
|
+
name: PropTypes.string,
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Provides a hint to the user of what can be entered in the field.
|
|
131
|
+
*/
|
|
132
|
+
placeholder: PropTypes.string,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Indicates whether the element can be edited.
|
|
136
|
+
* readOnly is an HTML boolean attribute - it is enabled by a boolean or
|
|
137
|
+
* 'readOnly'. Alternative capitalizations `readonly` & `READONLY`
|
|
138
|
+
* are also acccepted.
|
|
139
|
+
*/
|
|
140
|
+
readOnly: PropTypes.oneOfType([
|
|
141
|
+
PropTypes.bool,
|
|
142
|
+
PropTypes.oneOf(['readOnly', 'readonly', 'READONLY']),
|
|
143
|
+
]),
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Indicates whether this element is required to fill out or not.
|
|
147
|
+
* required is an HTML boolean attribute - it is enabled by a boolean or
|
|
148
|
+
* 'required'. Alternative capitalizations `REQUIRED`
|
|
149
|
+
* are also acccepted.
|
|
150
|
+
*/
|
|
151
|
+
required: PropTypes.oneOfType([
|
|
152
|
+
PropTypes.oneOf(['required', 'REQUIRED']),
|
|
153
|
+
PropTypes.bool,
|
|
154
|
+
]),
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Defines the number of rows in a text area.
|
|
158
|
+
*/
|
|
159
|
+
rows: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Indicates whether the text should be wrapped.
|
|
163
|
+
*/
|
|
164
|
+
wrap: PropTypes.string,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Defines a keyboard shortcut to activate or add focus to the element.
|
|
168
|
+
*/
|
|
169
|
+
accessKey: PropTypes.string,
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Often used with CSS to style elements with common properties.
|
|
173
|
+
*/
|
|
174
|
+
className: PropTypes.string,
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Indicates whether the element's content is editable.
|
|
178
|
+
*/
|
|
179
|
+
contentEditable: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Defines the ID of a <menu> element which will serve as the element's context menu.
|
|
183
|
+
*/
|
|
184
|
+
contextMenu: PropTypes.string,
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
|
|
188
|
+
*/
|
|
189
|
+
dir: PropTypes.string,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Defines whether the element can be dragged.
|
|
193
|
+
*/
|
|
194
|
+
draggable: PropTypes.oneOfType([
|
|
195
|
+
// enumerated property, not a boolean property: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
|
|
196
|
+
PropTypes.oneOf(['true', 'false']),
|
|
197
|
+
PropTypes.bool,
|
|
198
|
+
]),
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
|
|
202
|
+
*/
|
|
203
|
+
hidden: PropTypes.string,
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Defines the language used in the element.
|
|
207
|
+
*/
|
|
208
|
+
lang: PropTypes.string,
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Indicates whether spell checking is allowed for the element.
|
|
212
|
+
*/
|
|
213
|
+
spellCheck: PropTypes.oneOfType([
|
|
214
|
+
// enumerated property, not a boolean property: https://www.w3.org/TR/html51/editing.html#spelling-and-grammar-checking
|
|
215
|
+
PropTypes.oneOf(['true', 'false']),
|
|
216
|
+
PropTypes.bool,
|
|
217
|
+
]),
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Defines CSS styles which will override styles previously set.
|
|
221
|
+
*/
|
|
222
|
+
style: PropTypes.object,
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Overrides the browser's default tab order and follows the one specified instead.
|
|
226
|
+
*/
|
|
227
|
+
tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Text to be displayed in a tooltip when hovering over the element.
|
|
231
|
+
*/
|
|
232
|
+
title: PropTypes.string,
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Number of times the textarea lost focus.
|
|
236
|
+
*/
|
|
237
|
+
n_blur: PropTypes.number,
|
|
238
|
+
/**
|
|
239
|
+
* Last time the textarea lost focus.
|
|
240
|
+
*/
|
|
241
|
+
n_blur_timestamp: PropTypes.number,
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Number of times the textarea has been clicked.
|
|
245
|
+
*/
|
|
246
|
+
n_clicks: PropTypes.number,
|
|
247
|
+
/**
|
|
248
|
+
* Last time the textarea was clicked.
|
|
249
|
+
*/
|
|
250
|
+
n_clicks_timestamp: PropTypes.number,
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Dash-assigned callback that gets fired when the value changes.
|
|
254
|
+
*/
|
|
255
|
+
setProps: PropTypes.func,
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Used to allow user interactions in this component to be persisted when
|
|
259
|
+
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
260
|
+
* hasn't changed from its previous value, a `value` that the user has
|
|
261
|
+
* changed while using the app will keep that change, as long as
|
|
262
|
+
* the new `value` also matches what was given originally.
|
|
263
|
+
* Used in conjunction with `persistence_type`.
|
|
264
|
+
*/
|
|
265
|
+
persistence: PropTypes.oneOfType([
|
|
266
|
+
PropTypes.bool,
|
|
267
|
+
PropTypes.string,
|
|
268
|
+
PropTypes.number,
|
|
269
|
+
]),
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Properties whose user interactions will persist after refreshing the
|
|
273
|
+
* component or the page. Since only `value` is allowed this prop can
|
|
274
|
+
* normally be ignored.
|
|
275
|
+
*/
|
|
276
|
+
persisted_props: PropTypes.arrayOf(PropTypes.oneOf(['value'])),
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Where persisted user changes will be stored:
|
|
280
|
+
* memory: only kept in memory, reset on page refresh.
|
|
281
|
+
* local: window.localStorage, data is kept after the browser quit.
|
|
282
|
+
* session: window.sessionStorage, data is cleared once the browser quit.
|
|
283
|
+
*/
|
|
284
|
+
persistence_type: PropTypes.oneOf(['local', 'session', 'memory']),
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export default Textarea;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
--Dash-Fill-Inverse-Strong: #fff;
|
|
8
8
|
--Dash-Text-Primary: rgba(0, 18, 77, 0.87);
|
|
9
9
|
--Dash-Text-Strong: rgba(0, 9, 38, 0.9);
|
|
10
|
+
--Dash-Text-Disabled: rgba(0, 21, 89, 0.3);
|
|
10
11
|
--Dash-Fill-Primary-Hover: rgba(0, 18, 77, 0.04);
|
|
11
12
|
--Dash-Fill-Primary-Active: rgba(0, 18, 77, 0.08);
|
|
12
13
|
--Dash-Fill-Disabled: rgba(0, 24, 102, 0.1);
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
.dash-dropdown {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
margin: calc(var(--Dash-Spacing) * 2) 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dash-dropdown-grid-container {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: auto 1fr;
|
|
9
|
+
justify-items: start;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.dash-dropdown-grid-container:has(:nth-child(3)) {
|
|
15
|
+
grid-template-columns: auto 1fr auto;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.dash-dropdown-grid-container:has(:nth-child(4)) {
|
|
19
|
+
grid-template-columns: auto 1fr auto auto;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.dash-dropdown-trigger,
|
|
23
|
+
.dash-dropdown-content {
|
|
24
|
+
border-radius: var(--Dash-Spacing);
|
|
25
|
+
border: 1px solid var(--Dash-Stroke-Strong);
|
|
26
|
+
color: inherit;
|
|
27
|
+
text-align: left;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dash-dropdown-trigger {
|
|
31
|
+
background: inherit;
|
|
32
|
+
padding: 6px 12px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
min-height: 32px;
|
|
35
|
+
height: 100%;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
font-size: inherit;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dash-dropdown-trigger:disabled {
|
|
42
|
+
opacity: 0.6;
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.dash-dropdown-value {
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
text-align: left;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
text-overflow: ellipsis;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.dash-dropdown-placeholder {
|
|
55
|
+
color: var(--Dash-Text-Disabled);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dash-dropdown-value > * {
|
|
59
|
+
display: inline;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.dash-dropdown-content {
|
|
63
|
+
background: var(--Dash-Fill-Inverse-Strong);
|
|
64
|
+
min-width: fit-content;
|
|
65
|
+
width: var(--radix-popover-trigger-width);
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
z-index: 50;
|
|
68
|
+
box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35),
|
|
69
|
+
0px 10px 20px -15px rgba(22, 23, 24, 0.2);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.dash-dropdown-value-count,
|
|
73
|
+
.dash-dropdown-trigger-icon {
|
|
74
|
+
color: var(--Dash-Text-Strong);
|
|
75
|
+
fill: var(--Dash-Text-Strong);
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
justify-self: end;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dash-dropdown-trigger-icon {
|
|
81
|
+
transition: transform 0.15s;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[data-state='open'] .dash-dropdown-trigger-icon {
|
|
85
|
+
transform: rotate(180deg);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dash-dropdown-value-count {
|
|
89
|
+
line-height: 18px;
|
|
90
|
+
padding: 0 2px;
|
|
91
|
+
background: var(--Dash-Fill-Weak);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.dash-dropdown-search-container {
|
|
95
|
+
margin: calc(var(--Dash-Spacing) * 2);
|
|
96
|
+
padding: var(--Dash-Spacing);
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
border: 1px solid var(--Dash-Stroke-Strong);
|
|
99
|
+
background: var(--Dash-Fill-Inverse-Strong);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.dash-dropdown-search-container:focus-within {
|
|
103
|
+
border-color: var(--Dash-Fill-Interactive-Strong);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.dash-dropdown-search-icon,
|
|
107
|
+
.dash-dropdown-clear {
|
|
108
|
+
width: calc(var(--Dash-Spacing) * 3);
|
|
109
|
+
height: calc(var(--Dash-Spacing) * 3);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.dash-dropdown-search-container:focus-within .dash-dropdown-search-icon {
|
|
113
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.dash-dropdown-clear {
|
|
117
|
+
background: none;
|
|
118
|
+
border: none;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
padding: 0;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
justify-content: center;
|
|
124
|
+
justify-self: end;
|
|
125
|
+
color: var(--Dash-Text-Strong);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.dash-dropdown-clear:hover {
|
|
129
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.dash-dropdown-clear:focus {
|
|
133
|
+
outline: 2px solid var(--Dash-Fill-Interactive-Strong);
|
|
134
|
+
outline-offset: 1px;
|
|
135
|
+
border-radius: 2px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.dash-dropdown-search {
|
|
139
|
+
line-height: calc(var(--Dash-Spacing) * 6);
|
|
140
|
+
width: 100%;
|
|
141
|
+
border: none;
|
|
142
|
+
background: transparent;
|
|
143
|
+
color: var(--Dash-Text-Strong);
|
|
144
|
+
outline: none;
|
|
145
|
+
padding: 0;
|
|
146
|
+
|
|
147
|
+
/* Hide the "x" clear button in search inputs */
|
|
148
|
+
&::-webkit-search-cancel-button {
|
|
149
|
+
-webkit-appearance: none;
|
|
150
|
+
appearance: none;
|
|
151
|
+
display: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&::-ms-clear {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.dash-dropdown-actions {
|
|
160
|
+
display: flex;
|
|
161
|
+
gap: calc(var(--Dash-Spacing) * 6);
|
|
162
|
+
line-height: 18px;
|
|
163
|
+
padding: var(--Dash-Spacing) calc(var(--Dash-Spacing) * 3);
|
|
164
|
+
border-top: 1px solid var(--Dash-Fill-Disabled);
|
|
165
|
+
border-bottom: 1px solid var(--Dash-Fill-Disabled);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.dash-dropdown-action-button {
|
|
169
|
+
background: none;
|
|
170
|
+
border: none;
|
|
171
|
+
cursor: pointer;
|
|
172
|
+
font-size: 14px;
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
padding: 0;
|
|
175
|
+
text-decoration: none;
|
|
176
|
+
color: var(--Dash-Text-Disabled);
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.dash-dropdown-action-button:hover {
|
|
181
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.dash-dropdown-action-button:focus {
|
|
185
|
+
text-decoration: underline;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.dash-dropdown-options {
|
|
189
|
+
overflow-y: auto;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.dash-dropdown-option {
|
|
193
|
+
padding: var(--Dash-Spacing) calc(var(--Dash-Spacing) * 3);
|
|
194
|
+
background: var(--Dash-Fill-Inverse-strong);
|
|
195
|
+
box-shadow: 0 -1px 0 0 var(--Dash-Fill-Disabled) inset;
|
|
196
|
+
color: var(--Dash-Text-Strong);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
user-select: none;
|
|
201
|
+
overflow: hidden;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.dash-dropdown-option:not(:has(input[disabled])):hover,
|
|
205
|
+
.dash-dropdown-option:not(:has(input[disabled])):focus-within {
|
|
206
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
207
|
+
background: var(--Dash-Fill-Interactive-Weak);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.dash-dropdown-option:has(input[disabled]) {
|
|
211
|
+
color: var(--Dash-Text-Disabled);
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.dash-dropdown-option-text {
|
|
216
|
+
white-space: pre;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.dash-dropdown-option-checkbox {
|
|
220
|
+
display: inline-block;
|
|
221
|
+
margin: 0 calc(var(--Dash-Spacing) * 2) 0 0;
|
|
222
|
+
box-sizing: border-box;
|
|
223
|
+
border: 1px solid var(--Dash-Stroke-Strong);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.dash-dropdown-option-checkbox:hover,
|
|
227
|
+
.dash-dropdown-option-checkbox:focus,
|
|
228
|
+
.dash-dropdown-option-checkbox:checked {
|
|
229
|
+
accent-color: var(--Dash-Fill-Interactive-Strong);
|
|
230
|
+
}
|
|
@@ -50,6 +50,8 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.dash-slider-thumb {
|
|
53
|
+
position: relative;
|
|
54
|
+
z-index: 1;
|
|
53
55
|
display: block;
|
|
54
56
|
width: 16px;
|
|
55
57
|
height: 16px;
|
|
@@ -185,10 +187,16 @@
|
|
|
185
187
|
min-width: 64px;
|
|
186
188
|
}
|
|
187
189
|
|
|
190
|
+
.dash-range-slider-max-input {
|
|
191
|
+
order: 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
188
194
|
.dash-range-slider-input {
|
|
189
195
|
width: 64px;
|
|
190
196
|
margin-top: 8px;
|
|
197
|
+
-webkit-appearance: textfield;
|
|
191
198
|
-moz-appearance: textfield;
|
|
199
|
+
appearance: textfield;
|
|
192
200
|
}
|
|
193
201
|
|
|
194
202
|
/* Hide the number input spinners */
|