dash-core-components 4.0.0-rc2 → 4.0.0-rc3
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 -2
- package/dash_core_components/async-dropdown.js.map +1 -1
- package/dash_core_components/async-graph.js +1 -1
- package/dash_core_components/async-graph.js.map +1 -1
- package/dash_core_components/async-highlight.js +1 -1
- package/dash_core_components/async-highlight.js.map +1 -1
- package/dash_core_components/async-markdown.js +1 -1
- package/dash_core_components/async-markdown.js.map +1 -1
- package/dash_core_components/async-mathjax.js +1 -1
- package/dash_core_components/async-slider.js +1 -1
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/async-upload.js +1 -1
- package/dash_core_components/async-upload.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 +116 -12
- package/lib/components/Clipboard.react.js +1 -1
- package/lib/components/DatePickerRange.tsx +70 -0
- package/lib/components/DatePickerSingle.tsx +72 -0
- package/lib/components/Input.tsx +1 -1
- package/lib/components/Tab.tsx +19 -0
- package/lib/components/Tabs.tsx +311 -0
- package/lib/components/css/calendar.css +66 -0
- package/lib/components/css/datepickers.css +233 -0
- package/lib/components/css/dcc.css +1 -0
- package/lib/components/css/dropdown.css +6 -3
- package/lib/components/css/input.css +8 -2
- package/lib/components/css/sliders.css +22 -0
- package/lib/components/css/tabs.css +113 -0
- package/lib/fragments/DatePickerRange.tsx +444 -0
- package/lib/fragments/DatePickerSingle.tsx +249 -0
- package/lib/fragments/Dropdown.tsx +8 -4
- package/lib/fragments/Graph.react.js +18 -45
- package/lib/fragments/RangeSlider.tsx +2 -0
- package/lib/index.ts +4 -6
- package/lib/types.ts +353 -27
- package/lib/utils/DatePickerPersistence.ts +14 -0
- package/lib/utils/LazyLoader/datePickerRange.ts +4 -0
- package/lib/utils/LazyLoader/datePickerSingle.ts +4 -0
- package/lib/utils/calendar/Calendar.tsx +382 -0
- package/lib/utils/calendar/CalendarDay.tsx +75 -0
- package/lib/utils/calendar/CalendarDayPadding.tsx +15 -0
- package/lib/utils/calendar/CalendarMonth.tsx +247 -0
- package/lib/utils/calendar/CalendarMonthHeader.tsx +23 -0
- package/lib/utils/calendar/createMonthGrid.ts +28 -0
- package/lib/utils/calendar/helpers.ts +272 -0
- package/lib/utils/computeSliderMarkers.ts +71 -116
- package/lib/utils/optionRendering.tsx +22 -15
- package/lib/utils/sliderRendering.tsx +40 -2
- package/package.json +16 -13
- package/lib/components/DatePickerRange.react.js +0 -244
- package/lib/components/DatePickerSingle.react.js +0 -209
- package/lib/components/Dropdown.react.js.old +0 -228
- package/lib/components/Tab.react.js +0 -80
- package/lib/components/Tab.react.js.old +0 -79
- package/lib/components/Tabs.react.js +0 -295
- package/lib/components/Textarea.react.js.old +0 -287
- package/lib/fragments/DatePickerRange.react.js +0 -188
- package/lib/fragments/DatePickerSingle.react.js +0 -132
- package/lib/utils/DatePickerPersistence.js +0 -18
- package/lib/utils/LazyLoader/datePickerRange.js +0 -8
- package/lib/utils/LazyLoader/datePickerSingle.js +0 -8
- package/lib/utils/convertToMoment.js +0 -30
- package/lib/utils/optionTypes.js +0 -39
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
|
2
|
+
import {has, isNil} from 'ramda';
|
|
3
|
+
|
|
4
|
+
import LoadingElement from '../utils/_LoadingElement';
|
|
5
|
+
import {PersistedProps, PersistenceTypes, TabProps, TabsProps} from '../types';
|
|
6
|
+
import './css/tabs.css';
|
|
7
|
+
import {DashComponent} from '@dash-renderer/types';
|
|
8
|
+
|
|
9
|
+
interface EnhancedTabProps extends TabProps {
|
|
10
|
+
selected: boolean;
|
|
11
|
+
componentPath?: (string | number)[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// EnhancedTab is defined here instead of in Tab.tsx because if exported there,
|
|
15
|
+
// it will mess up the Python imports and metadata.json
|
|
16
|
+
const EnhancedTab = ({
|
|
17
|
+
id,
|
|
18
|
+
label,
|
|
19
|
+
selected,
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
selected_className,
|
|
23
|
+
selected_style,
|
|
24
|
+
setProps: selectHandler,
|
|
25
|
+
value,
|
|
26
|
+
disabled = false,
|
|
27
|
+
disabled_style = {color: 'var(--Dash-Text-Disabled)'},
|
|
28
|
+
disabled_className,
|
|
29
|
+
componentPath,
|
|
30
|
+
}: EnhancedTabProps) => {
|
|
31
|
+
const ExternalWrapper = window.dash_component_api.ExternalWrapper;
|
|
32
|
+
const ctx = window.dash_component_api.useDashContext();
|
|
33
|
+
componentPath = componentPath ?? ctx.componentPath;
|
|
34
|
+
// We use the raw path here since it's up one level from
|
|
35
|
+
// the tabs child.
|
|
36
|
+
const isLoading = ctx.useLoading({rawPath: componentPath});
|
|
37
|
+
const tabStyle = useMemo(() => {
|
|
38
|
+
return {
|
|
39
|
+
...style,
|
|
40
|
+
...(disabled ? disabled_style : {}),
|
|
41
|
+
...(selected ? selected_style : {}),
|
|
42
|
+
};
|
|
43
|
+
}, [style, disabled, disabled_style, selected, selected_style]);
|
|
44
|
+
|
|
45
|
+
const tabClassNames = useMemo(() => {
|
|
46
|
+
let names = 'tab';
|
|
47
|
+
if (disabled) {
|
|
48
|
+
names += ' tab--disabled';
|
|
49
|
+
if (disabled_className) {
|
|
50
|
+
names += ` ${disabled_className}`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (selected) {
|
|
54
|
+
names += ' tab--selected';
|
|
55
|
+
if (selected_className) {
|
|
56
|
+
names += ` ${selected_className}`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (className) {
|
|
60
|
+
names += ` ${className}`;
|
|
61
|
+
}
|
|
62
|
+
return names;
|
|
63
|
+
}, [className, disabled, disabled_className, selected, selected_className]);
|
|
64
|
+
|
|
65
|
+
let labelDisplay;
|
|
66
|
+
if (typeof label === 'object') {
|
|
67
|
+
labelDisplay = (
|
|
68
|
+
<ExternalWrapper
|
|
69
|
+
component={label}
|
|
70
|
+
componentPath={[...componentPath, 'props', 'label']}
|
|
71
|
+
/>
|
|
72
|
+
);
|
|
73
|
+
} else {
|
|
74
|
+
labelDisplay = <span>{label}</span>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div
|
|
79
|
+
data-dash-is-loading={isLoading}
|
|
80
|
+
className={tabClassNames}
|
|
81
|
+
id={id}
|
|
82
|
+
style={tabStyle}
|
|
83
|
+
onClick={() => {
|
|
84
|
+
if (!disabled) {
|
|
85
|
+
selectHandler({value});
|
|
86
|
+
}
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
{labelDisplay}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* A Dash component that lets you render pages with tabs - the Tabs component's children
|
|
96
|
+
* can be dcc.Tab components, which can hold a label that will be displayed as a tab, and can in turn hold
|
|
97
|
+
* children components that will be that tab's content.
|
|
98
|
+
*/
|
|
99
|
+
function Tabs({
|
|
100
|
+
// eslint-disable-next-line no-magic-numbers
|
|
101
|
+
mobile_breakpoint = 800,
|
|
102
|
+
colors = {
|
|
103
|
+
border: 'var(--Dash-Stroke-Weak)',
|
|
104
|
+
primary: 'var(--Dash-Fill-Interactive-Strong)',
|
|
105
|
+
background: 'var(--Dash-Fill-Weak)',
|
|
106
|
+
},
|
|
107
|
+
vertical = false,
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
109
|
+
persisted_props = [PersistedProps.value],
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
111
|
+
persistence_type = PersistenceTypes.local,
|
|
112
|
+
children,
|
|
113
|
+
...props
|
|
114
|
+
}: TabsProps) {
|
|
115
|
+
const initializedRef = useRef(false);
|
|
116
|
+
const [isAboveBreakpoint, setIsAboveBreakpoint] = useState(false);
|
|
117
|
+
|
|
118
|
+
const parseChildrenToArray = useCallback((): DashComponent[] => {
|
|
119
|
+
if (!children) {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
if (children instanceof Array) {
|
|
123
|
+
return children;
|
|
124
|
+
}
|
|
125
|
+
return [children];
|
|
126
|
+
}, [children]);
|
|
127
|
+
|
|
128
|
+
const valueOrDefault = (): string | undefined => {
|
|
129
|
+
if (has('value', props)) {
|
|
130
|
+
return props.value;
|
|
131
|
+
}
|
|
132
|
+
const children = parseChildrenToArray();
|
|
133
|
+
if (children && children.length && children[0].props.componentPath) {
|
|
134
|
+
const firstChildren: TabProps = window.dash_component_api.getLayout(
|
|
135
|
+
[...children[0].props.componentPath, 'props']
|
|
136
|
+
);
|
|
137
|
+
return firstChildren.value ?? 'tab-1';
|
|
138
|
+
}
|
|
139
|
+
return 'tab-1';
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// Initialize value on mount if not set
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (!initializedRef.current && !has('value', props)) {
|
|
145
|
+
props.setProps({
|
|
146
|
+
value: `${valueOrDefault()}`,
|
|
147
|
+
});
|
|
148
|
+
initializedRef.current = true;
|
|
149
|
+
}
|
|
150
|
+
}, []);
|
|
151
|
+
|
|
152
|
+
// Setup matchMedia for responsive breakpoint
|
|
153
|
+
useEffect(() => {
|
|
154
|
+
const mediaQuery = window.matchMedia(
|
|
155
|
+
`(min-width: ${mobile_breakpoint}px)`
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Set initial value
|
|
159
|
+
setIsAboveBreakpoint(mediaQuery.matches);
|
|
160
|
+
|
|
161
|
+
// Listen for changes
|
|
162
|
+
const handler = (e: MediaQueryListEvent) =>
|
|
163
|
+
setIsAboveBreakpoint(e.matches);
|
|
164
|
+
mediaQuery.addEventListener('change', handler);
|
|
165
|
+
|
|
166
|
+
return () => mediaQuery.removeEventListener('change', handler);
|
|
167
|
+
}, [mobile_breakpoint]);
|
|
168
|
+
|
|
169
|
+
let EnhancedTabs: JSX.Element[];
|
|
170
|
+
let selectedTab;
|
|
171
|
+
|
|
172
|
+
const value = valueOrDefault();
|
|
173
|
+
|
|
174
|
+
if (children) {
|
|
175
|
+
const children = parseChildrenToArray();
|
|
176
|
+
|
|
177
|
+
EnhancedTabs = children.map((child, index) => {
|
|
178
|
+
// TODO: handle components that are not dcc.Tab components (throw error)
|
|
179
|
+
// enhance Tab components coming from Dash (as dcc.Tab) with methods needed for handling logic
|
|
180
|
+
let childProps: Omit<TabProps, 'setProps'>;
|
|
181
|
+
|
|
182
|
+
if (React.isValidElement(child) && child.props.componentPath) {
|
|
183
|
+
childProps = window.dash_component_api.getLayout([
|
|
184
|
+
...child.props.componentPath,
|
|
185
|
+
'props',
|
|
186
|
+
]);
|
|
187
|
+
} else {
|
|
188
|
+
// In case the selected tab is a string.
|
|
189
|
+
childProps = {};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (!childProps.value) {
|
|
193
|
+
childProps = {...childProps, value: `tab-${index + 1}`};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// check if this child/Tab is currently selected
|
|
197
|
+
if (childProps.value === value) {
|
|
198
|
+
selectedTab = child;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const style = childProps.style ?? {};
|
|
202
|
+
if (typeof childProps.width === 'number') {
|
|
203
|
+
style.width = `${childProps.width}px`;
|
|
204
|
+
style.flex = '0 0 auto';
|
|
205
|
+
} else if (typeof childProps.width === 'string') {
|
|
206
|
+
style.width = childProps.width;
|
|
207
|
+
style.flex = '0 0 auto';
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<EnhancedTab
|
|
212
|
+
key={index}
|
|
213
|
+
id={childProps.id}
|
|
214
|
+
label={childProps.label}
|
|
215
|
+
selected={value === childProps.value}
|
|
216
|
+
setProps={props.setProps}
|
|
217
|
+
className={childProps.className}
|
|
218
|
+
style={style}
|
|
219
|
+
selected_className={childProps.selected_className}
|
|
220
|
+
selected_style={childProps.selected_style}
|
|
221
|
+
value={childProps.value}
|
|
222
|
+
disabled={childProps.disabled}
|
|
223
|
+
disabled_style={childProps.disabled_style}
|
|
224
|
+
disabled_className={childProps.disabled_className}
|
|
225
|
+
componentPath={child.props.componentPath}
|
|
226
|
+
/>
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const selectedTabContent = !isNil(selectedTab) ? selectedTab : '';
|
|
232
|
+
|
|
233
|
+
const tabContainerClassNames = useMemo(() => {
|
|
234
|
+
let names = 'tab-container';
|
|
235
|
+
if (vertical) {
|
|
236
|
+
names += ` tab-container--vert`;
|
|
237
|
+
}
|
|
238
|
+
if (props.className) {
|
|
239
|
+
names += ` ${props.className}`;
|
|
240
|
+
}
|
|
241
|
+
return names;
|
|
242
|
+
}, [vertical, props.className]);
|
|
243
|
+
|
|
244
|
+
const tabContentClassNames = useMemo(() => {
|
|
245
|
+
let names = 'tab-content';
|
|
246
|
+
if (vertical) {
|
|
247
|
+
names += ` tab-content--vert`;
|
|
248
|
+
}
|
|
249
|
+
if (props.content_className) {
|
|
250
|
+
names += ` ${props.content_className}`;
|
|
251
|
+
}
|
|
252
|
+
return names;
|
|
253
|
+
}, [vertical, props.content_className]);
|
|
254
|
+
|
|
255
|
+
const tabParentClassNames = useMemo(() => {
|
|
256
|
+
let names = 'tab-parent';
|
|
257
|
+
if (vertical) {
|
|
258
|
+
names += ` tab-parent--vert`;
|
|
259
|
+
}
|
|
260
|
+
if (isAboveBreakpoint) {
|
|
261
|
+
names += ' tab-parent--above-breakpoint';
|
|
262
|
+
}
|
|
263
|
+
if (props.parent_className) {
|
|
264
|
+
names += ` ${props.parent_className}`;
|
|
265
|
+
}
|
|
266
|
+
return names;
|
|
267
|
+
}, [vertical, isAboveBreakpoint, props.parent_className]);
|
|
268
|
+
|
|
269
|
+
// Set CSS variables for dynamic styling
|
|
270
|
+
const cssVars = {
|
|
271
|
+
'--tabs-border': colors.border,
|
|
272
|
+
'--tabs-primary': colors.primary,
|
|
273
|
+
'--tabs-background': colors.background,
|
|
274
|
+
} as const;
|
|
275
|
+
|
|
276
|
+
return (
|
|
277
|
+
<LoadingElement>
|
|
278
|
+
{loadingProps => (
|
|
279
|
+
<div
|
|
280
|
+
className={tabParentClassNames}
|
|
281
|
+
style={{...cssVars, ...props.parent_style}}
|
|
282
|
+
id={props.id ? `${props.id}-parent` : undefined}
|
|
283
|
+
{...loadingProps}
|
|
284
|
+
>
|
|
285
|
+
<div
|
|
286
|
+
className={tabContainerClassNames}
|
|
287
|
+
style={props.style}
|
|
288
|
+
id={props.id}
|
|
289
|
+
>
|
|
290
|
+
{EnhancedTabs}
|
|
291
|
+
</div>
|
|
292
|
+
<div
|
|
293
|
+
className={tabContentClassNames}
|
|
294
|
+
style={props.content_style}
|
|
295
|
+
>
|
|
296
|
+
{selectedTabContent || ''}
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
)}
|
|
300
|
+
</LoadingElement>
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
Tabs.dashPersistence = {
|
|
305
|
+
persisted_props: [PersistedProps.value],
|
|
306
|
+
persistence_type: PersistenceTypes.local,
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
Tabs.dashChildrenUpdate = true;
|
|
310
|
+
|
|
311
|
+
export default Tabs;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
.dash-datepicker-calendar {
|
|
2
|
+
padding: 0;
|
|
3
|
+
border-collapse: collapse;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.dash-datepicker-calendar th > *,
|
|
7
|
+
.dash-datepicker-calendar td > * {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dash-datepicker-calendar th,
|
|
14
|
+
.dash-datepicker-calendar td {
|
|
15
|
+
padding: 0;
|
|
16
|
+
font-weight: normal;
|
|
17
|
+
color: var(--Dash-Text-Weak);
|
|
18
|
+
text-align: center;
|
|
19
|
+
border-radius: 4px;
|
|
20
|
+
cursor: default;
|
|
21
|
+
user-select: none;
|
|
22
|
+
-webkit-user-select: none;
|
|
23
|
+
-moz-user-select: none;
|
|
24
|
+
width: var(--day-size, 36px);
|
|
25
|
+
height: var(--day-size, 36px);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dash-datepicker-calendar td.dash-datepicker-calendar-date-inside {
|
|
29
|
+
color: var(--Dash-Text-Strong);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.dash-datepicker-calendar td:hover {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
background-color: var(--Dash-Fill-Weak);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.dash-datepicker-calendar td:focus {
|
|
38
|
+
outline: 2px solid var(--Dash-Fill-Interactive-Strong);
|
|
39
|
+
outline-offset: -2px;
|
|
40
|
+
z-index: 1;
|
|
41
|
+
position: relative;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dash-datepicker-calendar td.dash-datepicker-calendar-date-highlighted {
|
|
45
|
+
background-color: color-mix(
|
|
46
|
+
in srgb,
|
|
47
|
+
var(--Dash-Fill-Interactive-Strong) 5%,
|
|
48
|
+
transparent 95%
|
|
49
|
+
);
|
|
50
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.dash-datepicker-calendar td.dash-datepicker-calendar-date-selected {
|
|
54
|
+
background-color: var(--Dash-Fill-Interactive-Strong);
|
|
55
|
+
color: var(--Dash-Fill-Inverse-Strong);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.dash-datepicker-calendar td.dash-datepicker-calendar-date-disabled {
|
|
59
|
+
opacity: 0.6;
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.dash-datepicker-calendar td input {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
.dash-datepicker {
|
|
2
|
+
display: block;
|
|
3
|
+
flex: 1;
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
background: var(--Dash-Fill-Inverse-Strong);
|
|
6
|
+
padding: 0;
|
|
7
|
+
border: none;
|
|
8
|
+
outline: none;
|
|
9
|
+
width: 100%;
|
|
10
|
+
font-size: inherit;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
accent-color: var(--Dash-Fill-Interactive-Strong);
|
|
13
|
+
outline-color: var(--Dash-Fill-Interactive-Strong);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.dash-datepicker-input-wrapper {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: auto 1fr;
|
|
19
|
+
justify-items: start;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: calc(var(--Dash-Spacing) * 2);
|
|
22
|
+
box-sizing: border-box;
|
|
23
|
+
padding: 0 calc(var(--Dash-Spacing) * 2);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dash-datepicker-input-wrapper:has(:nth-child(3)) {
|
|
27
|
+
grid-template-columns: auto 1fr auto;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.dash-datepicker-input-wrapper:has(:nth-child(4)) {
|
|
31
|
+
grid-template-columns: auto 1fr auto auto;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dash-datepicker-input-wrapper:has(:nth-child(5)) {
|
|
35
|
+
grid-template-columns: auto auto auto 1fr auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dash-datepicker-input-wrapper:has(:nth-child(6)) {
|
|
39
|
+
grid-template-columns: auto auto auto 1fr auto auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.dash-datepicker-input-wrapper,
|
|
43
|
+
.dash-datepicker-content {
|
|
44
|
+
border-radius: var(--Dash-Spacing);
|
|
45
|
+
border: 1px solid var(--Dash-Stroke-Strong);
|
|
46
|
+
color: inherit;
|
|
47
|
+
text-align: left;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.dash-datepicker-input {
|
|
51
|
+
height: 32px;
|
|
52
|
+
width: fit-content;
|
|
53
|
+
border: none;
|
|
54
|
+
outline: none;
|
|
55
|
+
border-radius: 4px;
|
|
56
|
+
padding: 0;
|
|
57
|
+
background-color: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.dash-datepicker-input::selection,
|
|
61
|
+
.dash-datepicker-input::-webkit-selection {
|
|
62
|
+
color: var(--Dash-Fill-Inverse-Strong);
|
|
63
|
+
background: var(--Dash-Fill-Interactive-Strong);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.dash-datepicker-input-wrapper:focus-within {
|
|
67
|
+
border: 1px solid var(--Dash-Fill-Interactive-Strong);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dash-datepicker-input-wrapper-disabled {
|
|
71
|
+
opacity: 0.6;
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dash-datepicker-input-wrapper-disabled .dash-datepicker-input {
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.dash-datepicker-input:focus {
|
|
80
|
+
outline: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.dash-datepicker-input::placeholder {
|
|
84
|
+
color: var(--Dash-Text-Disabled);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.dash-datepicker-trigger-button {
|
|
88
|
+
padding: var(--Dash-Spacing);
|
|
89
|
+
background: transparent;
|
|
90
|
+
border: none;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
color: var(--Dash-Text-Strong);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.dash-datepicker-trigger-button:hover {
|
|
97
|
+
background: var(--Dash-Fill-Weak);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.dash-datepicker-trigger-button:focus-visible {
|
|
101
|
+
outline: 2px solid var(--Dash-Fill-Interactive-Strong);
|
|
102
|
+
outline-offset: 2px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.dash-datepicker-trigger-button[aria-expanded='true'] {
|
|
106
|
+
background: var(--Dash-Fill-Weak);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.dash-datepicker-trigger-icon {
|
|
110
|
+
width: 16px;
|
|
111
|
+
height: 16px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dash-datepicker-caret-icon {
|
|
115
|
+
color: var(--Dash-Text-Strong);
|
|
116
|
+
fill: var(--Dash-Text-Strong);
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
justify-self: end;
|
|
119
|
+
transition: transform 0.15s;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.dash-datepicker-input-wrapper[aria-expanded='true']
|
|
123
|
+
.dash-datepicker-caret-icon {
|
|
124
|
+
transform: rotate(180deg);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.dash-datepicker-clear {
|
|
128
|
+
background: none;
|
|
129
|
+
border: none;
|
|
130
|
+
cursor: pointer;
|
|
131
|
+
padding: 0;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
justify-self: end;
|
|
136
|
+
color: var(--Dash-Text-Strong);
|
|
137
|
+
width: calc(var(--Dash-Spacing) * 3);
|
|
138
|
+
height: calc(var(--Dash-Spacing) * 3);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.dash-datepicker-clear:hover {
|
|
142
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.dash-datepicker-clear:focus {
|
|
146
|
+
outline: 2px solid var(--Dash-Fill-Interactive-Strong);
|
|
147
|
+
outline-offset: 1px;
|
|
148
|
+
border-radius: 2px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.dash-datepicker-content {
|
|
152
|
+
padding: 8px;
|
|
153
|
+
background: var(--Dash-Fill-Inverse-Strong);
|
|
154
|
+
width: fit-content;
|
|
155
|
+
max-width: 98vw;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
z-index: 500;
|
|
158
|
+
box-shadow: 0px 10px 38px -10px var(--Dash-Shading-Strong),
|
|
159
|
+
0px 10px 20px -15px var(--Dash-Shading-Weak);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.dash-datepicker-calendar-wrapper {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
align-items: center;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.dash-datepicker-calendar-container {
|
|
169
|
+
display: flex;
|
|
170
|
+
align-items: flex-start;
|
|
171
|
+
gap: calc(var(--Dash-Spacing) * 4);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.dash-datepicker-controls {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
gap: var(--Dash-Spacing);
|
|
179
|
+
margin-bottom: calc(var(--Dash-Spacing) * 2);
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.dash-datepicker-controls .dash-dropdown {
|
|
184
|
+
flex: 0 0 auto;
|
|
185
|
+
min-width: 122px;
|
|
186
|
+
width: auto;
|
|
187
|
+
margin: 0;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.dash-datepicker-controls .dash-input {
|
|
191
|
+
flex-shrink: 0;
|
|
192
|
+
flex-grow: 0;
|
|
193
|
+
width: 102px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.dash-datepicker-controls .dash-input-stepper {
|
|
197
|
+
width: 20px;
|
|
198
|
+
height: 100%;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.dash-datepicker-month-nav {
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
width: 20px;
|
|
206
|
+
height: 32px;
|
|
207
|
+
padding: 0;
|
|
208
|
+
background: transparent;
|
|
209
|
+
border: none;
|
|
210
|
+
border-radius: 4px;
|
|
211
|
+
color: var(--Dash-Fill-Interactive-Strong);
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
flex-shrink: 0;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.dash-datepicker-month-nav:hover:not(:disabled) {
|
|
217
|
+
background: var(--Dash-Fill-Weak);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.dash-datepicker-month-nav:focus-visible {
|
|
221
|
+
outline: 2px solid var(--Dash-Fill-Interactive-Strong);
|
|
222
|
+
outline-offset: 2px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.dash-datepicker-month-nav:disabled {
|
|
226
|
+
color: var(--Dash-Text-Disabled);
|
|
227
|
+
cursor: not-allowed;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.dash-datepicker-month-nav svg {
|
|
231
|
+
width: 20px;
|
|
232
|
+
height: 20px;
|
|
233
|
+
}
|
|
@@ -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-Weak: rgba(0, 12, 51, 0.65);
|
|
10
11
|
--Dash-Text-Disabled: rgba(0, 21, 89, 0.3);
|
|
11
12
|
--Dash-Fill-Primary-Hover: rgba(0, 18, 77, 0.04);
|
|
12
13
|
--Dash-Fill-Primary-Active: rgba(0, 18, 77, 0.08);
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
display: block;
|
|
3
3
|
flex: 1;
|
|
4
4
|
box-sizing: border-box;
|
|
5
|
-
margin: calc(var(--Dash-Spacing) * 2) 0;
|
|
6
5
|
padding: 0;
|
|
7
|
-
background:
|
|
6
|
+
background: var(--Dash-Fill-Inverse-Strong);
|
|
8
7
|
border: none;
|
|
9
8
|
outline: none;
|
|
10
9
|
width: 100%;
|
|
@@ -46,7 +45,7 @@
|
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
.dash-dropdown:focus {
|
|
49
|
-
|
|
48
|
+
border: 1px solid var(--Dash-Fill-Interactive-Strong);
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
.dash-dropdown:disabled {
|
|
@@ -70,6 +69,10 @@
|
|
|
70
69
|
display: inline;
|
|
71
70
|
}
|
|
72
71
|
|
|
72
|
+
.dash-dropdown-value-item:not(:first-child)::before {
|
|
73
|
+
content: ', ';
|
|
74
|
+
}
|
|
75
|
+
|
|
73
76
|
.dash-dropdown-content {
|
|
74
77
|
background: var(--Dash-Fill-Inverse-Strong);
|
|
75
78
|
width: fit-content;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
display: inline-flex;
|
|
5
5
|
align-items: center;
|
|
6
6
|
width: 170px; /* default input width */
|
|
7
|
-
height:
|
|
7
|
+
height: 34px;
|
|
8
8
|
background: var(--Dash-Fill-Inverse-Strong);
|
|
9
9
|
border-radius: var(--Dash-Spacing);
|
|
10
10
|
border: 1px solid var(--Dash-Stroke-Strong);
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.dash-input-container:focus-within {
|
|
19
|
-
|
|
19
|
+
border: 1px solid var(--Dash-Fill-Interactive-Strong);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.dash-input-container:has(.dash-input-element:disabled) {
|
|
@@ -48,6 +48,12 @@
|
|
|
48
48
|
accent-color: var(--Dash-Fill-Interactive-Strong);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
.dash-input-element::selection,
|
|
52
|
+
.dash-input-element::-webkit-selection {
|
|
53
|
+
color: var(--Dash-Fill-Inverse-Strong);
|
|
54
|
+
background: var(--Dash-Fill-Interactive-Strong);
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
.dash-input-element:disabled {
|
|
52
58
|
cursor: not-allowed;
|
|
53
59
|
}
|