@dropi/ui 0.1.50 → 0.1.51
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/dist/cjs/dropi-date-picker-range.cjs.entry.js +135 -28
- package/dist/cjs/dropi-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.css +169 -83
- package/dist/collection/components/dropi-date-picker-range/dropi-date-picker-range.js +172 -31
- package/dist/components/dropi-date-picker-range.js +1 -1
- package/dist/docs.json +54 -8
- package/dist/dropi-ui/dropi-ui.esm.js +1 -1
- package/dist/dropi-ui/p-4f498d26.entry.js +1 -0
- package/dist/esm/dropi-date-picker-range.entry.js +136 -29
- package/dist/esm/dropi-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/dropi-date-picker-range/dropi-date-picker-range.d.ts +18 -5
- package/dist/types/components.d.ts +21 -10
- package/hydrate/index.js +147 -35
- package/hydrate/index.mjs +147 -35
- package/package.json +1 -1
|
@@ -1,99 +1,105 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
width: 100%;
|
|
4
|
-
max-width: 380px;
|
|
5
|
-
}
|
|
6
|
-
|
|
1
|
+
:host { display: block; width: 100%; position: relative; }
|
|
7
2
|
*, *::before, *::after { box-sizing: border-box; }
|
|
8
3
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
font-size: 11px;
|
|
16
|
-
font-weight: var(--font-weight-medium);
|
|
17
|
-
color: #7b8190;
|
|
18
|
-
margin-bottom: 8px;
|
|
4
|
+
/* Label */
|
|
5
|
+
.dpr-label {
|
|
6
|
+
display: block;
|
|
7
|
+
font-size: var(--font-size-xxs, 10px);
|
|
8
|
+
color: var(--Gray-Gray-600, #475066);
|
|
9
|
+
margin-bottom: 4px;
|
|
19
10
|
}
|
|
20
11
|
|
|
21
|
-
|
|
12
|
+
/* Trigger */
|
|
13
|
+
.dpr-trigger {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 44px;
|
|
22
16
|
display: flex;
|
|
23
|
-
align-items:
|
|
24
|
-
gap: 8px;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: var(--Size-2, 8px);
|
|
19
|
+
padding: 0 var(--Size-3, 12px);
|
|
20
|
+
border: 1px solid var(--Gray-Gray-200, #c3c9d9);
|
|
21
|
+
border-radius: var(--Border-2, 8px);
|
|
22
|
+
background: var(--Neutral-White, #ffffff);
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
font-family: inherit;
|
|
25
|
+
transition: border-color 0.2s;
|
|
25
26
|
}
|
|
27
|
+
.dpr-trigger:hover:not(:disabled) { border-color: var(--Info-Info-500, #50a5f1); }
|
|
28
|
+
.dpr-trigger--disabled { background: var(--Gray-Gray-50, #f7f8fa); cursor: not-allowed; opacity: 0.6; }
|
|
26
29
|
|
|
27
|
-
.
|
|
30
|
+
.dpr-trigger__value {
|
|
28
31
|
flex: 1;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
font-size: var(--font-size-xs, 11px);
|
|
36
|
-
color: var(--Gray-Gray-500, #69738c);
|
|
37
|
-
font-weight: var(--font-weight-medium, 500);
|
|
32
|
+
text-align: left;
|
|
33
|
+
font-size: var(--font-size-xs, 12px);
|
|
34
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
38
|
}
|
|
39
|
+
.dpr-trigger__placeholder { color: var(--Gray-Gray-400, #858ea6); }
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
/* Popup */
|
|
42
|
+
.dpr-popup {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: calc(100% + 8px);
|
|
45
|
+
left: 0;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: row;
|
|
46
48
|
background: var(--Neutral-White, #ffffff);
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
transition: border-color 0.15s ease;
|
|
49
|
+
border: 1px solid var(--Gray-Gray-200, #c3c9d9);
|
|
50
|
+
border-radius: var(--Border-3, 12px);
|
|
51
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.08);
|
|
52
|
+
z-index: 300;
|
|
53
|
+
overflow: hidden;
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
/* Calendar section */
|
|
57
|
+
.dpr-calendar {
|
|
58
|
+
padding: var(--Size-4, 16px);
|
|
59
|
+
width: 300px;
|
|
60
|
+
flex-shrink: 0;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
/* Vertical divider */
|
|
64
|
+
.dpr-divider {
|
|
65
|
+
width: 1px;
|
|
66
|
+
background: var(--Gray-Gray-100, #e6eaf2);
|
|
67
|
+
flex-shrink: 0;
|
|
63
68
|
}
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
/* Shortcuts section */
|
|
71
|
+
.dpr-shortcuts {
|
|
72
|
+
padding: var(--Size-4, 16px) var(--Size-3, 12px);
|
|
66
73
|
display: flex;
|
|
67
74
|
flex-direction: column;
|
|
68
75
|
gap: 2px;
|
|
69
|
-
|
|
70
|
-
border-left: 1px solid var(--Gray-Gray-100, #e6eaf2);
|
|
71
|
-
padding-left: 10px;
|
|
76
|
+
min-width: 140px;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
79
|
.shortcut-btn {
|
|
75
80
|
background: transparent;
|
|
76
|
-
border:
|
|
77
|
-
padding:
|
|
81
|
+
border: 1px solid transparent;
|
|
82
|
+
padding: 6px 10px;
|
|
78
83
|
font-size: 13px;
|
|
79
84
|
font-family: inherit;
|
|
80
85
|
color: var(--Gray-Gray-700, #32394d);
|
|
81
86
|
cursor: pointer;
|
|
82
87
|
text-align: left;
|
|
83
|
-
border-radius:
|
|
88
|
+
border-radius: 6px;
|
|
84
89
|
transition: background 0.1s ease;
|
|
85
90
|
font-weight: var(--font-weight-regular);
|
|
91
|
+
white-space: nowrap;
|
|
86
92
|
}
|
|
87
|
-
|
|
88
93
|
.shortcut-btn:hover {
|
|
89
94
|
background: var(--Gray-Gray-50, #f5f6f8);
|
|
90
95
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
background: var(--Gray-Gray-50, #f5f6f8);
|
|
96
|
+
.shortcut-btn--active {
|
|
97
|
+
border-color: var(--Gray-Gray-200, #c3c9d9);
|
|
94
98
|
font-weight: var(--font-weight-semibold);
|
|
99
|
+
background: var(--Gray-Gray-50, #f5f6f8);
|
|
95
100
|
}
|
|
96
101
|
|
|
102
|
+
/* Warning */
|
|
97
103
|
.warning-box {
|
|
98
104
|
margin-top: 8px;
|
|
99
105
|
padding: 4px 8px;
|
|
@@ -101,43 +107,123 @@
|
|
|
101
107
|
border-radius: 4px;
|
|
102
108
|
background: var(--Warning-Warning-50);
|
|
103
109
|
}
|
|
104
|
-
|
|
105
110
|
.warning-message {
|
|
106
111
|
color: #495057;
|
|
107
112
|
font-size: var(--font-size-xxs);
|
|
108
113
|
line-height: 16px;
|
|
109
114
|
}
|
|
110
115
|
|
|
116
|
+
/* ── Calendar styles (copied from dropi-date-picker) ── */
|
|
117
|
+
.dp-nav {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: space-between;
|
|
121
|
+
margin-bottom: var(--Size-4, 16px);
|
|
122
|
+
padding-bottom: var(--Size-3, 12px);
|
|
123
|
+
border-bottom: 1px solid var(--Gray-Gray-100, #e6eaf2);
|
|
124
|
+
}
|
|
125
|
+
.dp-nav__btn {
|
|
126
|
+
background: none;
|
|
127
|
+
border: none;
|
|
128
|
+
padding: 0;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
border-radius: 50%;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
justify-content: center;
|
|
134
|
+
width: 32px;
|
|
135
|
+
height: 32px;
|
|
136
|
+
transition: background 0.15s;
|
|
137
|
+
}
|
|
138
|
+
.dp-nav__btn:hover { background: var(--Gray-Gray-50, #f7f8fa); }
|
|
139
|
+
.dp-nav__title {
|
|
140
|
+
font-size: var(--font-size-s, 14px);
|
|
141
|
+
font-weight: var(--font-weight-bold, 700);
|
|
142
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 8px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.dp-grid {
|
|
148
|
+
display: grid;
|
|
149
|
+
grid-template-columns: repeat(7, 1fr);
|
|
150
|
+
row-gap: 6px;
|
|
151
|
+
column-gap: 2px;
|
|
152
|
+
}
|
|
153
|
+
.dp-day-header {
|
|
154
|
+
font-size: var(--font-size-s, 14px);
|
|
155
|
+
color: var(--Gray-Gray-700, #32394d);
|
|
156
|
+
text-align: center;
|
|
157
|
+
padding: 6px 0;
|
|
158
|
+
font-weight: var(--font-weight-bold, 700);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.dp-cell {
|
|
162
|
+
aspect-ratio: 1;
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
justify-content: center;
|
|
166
|
+
font-size: var(--font-size-xs, 12px);
|
|
167
|
+
font-family: inherit;
|
|
168
|
+
border: none;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
background: transparent;
|
|
171
|
+
color: var(--Gray-Gray-600, #475066);
|
|
172
|
+
width: 100%;
|
|
173
|
+
position: relative;
|
|
174
|
+
z-index: 1;
|
|
175
|
+
padding: 0;
|
|
176
|
+
}
|
|
177
|
+
.dp-cell::after {
|
|
178
|
+
content: "";
|
|
179
|
+
position: absolute;
|
|
180
|
+
top: 0; left: 0; right: 0; bottom: 0;
|
|
181
|
+
border-radius: 50%;
|
|
182
|
+
transition: background 0.15s;
|
|
183
|
+
z-index: -1;
|
|
184
|
+
background: transparent;
|
|
185
|
+
}
|
|
186
|
+
.dp-cell::before {
|
|
187
|
+
content: "";
|
|
188
|
+
position: absolute;
|
|
189
|
+
top: 0; bottom: 0;
|
|
190
|
+
z-index: -2;
|
|
191
|
+
background: transparent;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dp-cell:hover:not(:disabled)::after { background: var(--Gray-Gray-100, #e6eaf2); }
|
|
195
|
+
.dp-cell--other-month { color: var(--Gray-Gray-300, #a0a9c0); }
|
|
196
|
+
.dp-cell--today { font-weight: var(--font-weight-bold, 700); }
|
|
197
|
+
.dp-cell--today::after { background: var(--Gray-Gray-100, #e6eaf2); }
|
|
198
|
+
|
|
199
|
+
.dp-cell--selected { color: var(--Neutral-White, #ffffff); font-weight: var(--font-weight-bold, 700); }
|
|
200
|
+
.dp-cell--selected::after { background: var(--Orange-orange-500, #f49a3d) !important; }
|
|
201
|
+
|
|
202
|
+
.dp-cell--range-start, .dp-cell--range-end {
|
|
203
|
+
color: var(--Neutral-White, #ffffff);
|
|
204
|
+
font-weight: var(--font-weight-bold, 700);
|
|
205
|
+
}
|
|
206
|
+
.dp-cell--range-start::after, .dp-cell--range-end::after {
|
|
207
|
+
background: var(--Orange-orange-500, #f49a3d) !important;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.dp-cell--in-range { color: var(--Orange-orange-500, #f49a3d); font-weight: var(--font-weight-bold, 700); }
|
|
211
|
+
.dp-cell--in-range::before { left: -1px; right: -1px; background: var(--Orange-orange-50, #fef5ec); }
|
|
212
|
+
.dp-cell--range-start::before { left: 50%; right: -1px; background: var(--Orange-orange-50, #fef5ec); }
|
|
213
|
+
.dp-cell--range-end::before { left: -1px; right: 50%; background: var(--Orange-orange-50, #fef5ec); }
|
|
214
|
+
.dp-cell--range-start.dp-cell--range-end::before { background: transparent; }
|
|
215
|
+
.dp-cell--disabled { opacity: 0.35; cursor: not-allowed; }
|
|
216
|
+
|
|
217
|
+
/* Skeleton */
|
|
111
218
|
@keyframes shimmer {
|
|
112
219
|
0% { background-position: -468px 0; }
|
|
113
|
-
100% { background-position:
|
|
220
|
+
100% { background-position: 468px 0; }
|
|
114
221
|
}
|
|
115
|
-
|
|
116
222
|
.skeleton {
|
|
117
|
-
height:
|
|
223
|
+
height: 44px;
|
|
118
224
|
width: 100%;
|
|
119
|
-
|
|
120
|
-
border-radius: 6px;
|
|
225
|
+
border-radius: 8px;
|
|
121
226
|
animation: shimmer 1s linear infinite;
|
|
122
227
|
background: linear-gradient(to right, #f5f6f8 8%, #e3e7ef 28%, #f5f6f8 77%);
|
|
123
228
|
background-size: 800px 104px;
|
|
124
229
|
}
|
|
125
|
-
|
|
126
|
-
@media screen and (max-width: 480px) {
|
|
127
|
-
.inputs-row {
|
|
128
|
-
flex-direction: column;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.separator {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.shortcuts {
|
|
136
|
-
flex-direction: row;
|
|
137
|
-
flex-wrap: wrap;
|
|
138
|
-
border-left: none;
|
|
139
|
-
padding-left: 0;
|
|
140
|
-
border-top: 1px solid var(--Gray-Gray-100, #e6eaf2);
|
|
141
|
-
padding-top: 8px;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
const MONTHS_ES = [
|
|
3
|
+
'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
|
|
4
|
+
'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre',
|
|
5
|
+
];
|
|
6
|
+
const DAYS_ES = ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'];
|
|
2
7
|
/**
|
|
3
8
|
* @component dropi-date-picker-range
|
|
4
|
-
* Date range picker with
|
|
9
|
+
* Date range picker with calendar popup and shortcut panel.
|
|
5
10
|
*
|
|
6
11
|
* @example
|
|
7
|
-
* <dropi-date-picker-range
|
|
12
|
+
* <dropi-date-picker-range></dropi-date-picker-range>
|
|
8
13
|
*/
|
|
9
14
|
export class DropiDatePickerRange {
|
|
10
15
|
/** Start date (YYYY-MM-DD) */
|
|
@@ -14,13 +19,15 @@ export class DropiDatePickerRange {
|
|
|
14
19
|
/** Show "Rango de fechas" label */
|
|
15
20
|
showLabel = true;
|
|
16
21
|
/** Input placeholder */
|
|
17
|
-
placeholder = '';
|
|
22
|
+
placeholder = 'DD/MM/YYYY – DD/MM/YYYY';
|
|
18
23
|
/** Show loading skeleton */
|
|
19
24
|
loading = false;
|
|
20
25
|
/** Max allowed range in days (0 = unlimited) */
|
|
21
26
|
maxDaysRange = 0;
|
|
22
27
|
/** Hide "Hoy" shortcut */
|
|
23
28
|
hideTodayRangeShortcut = false;
|
|
29
|
+
/** Disabled state */
|
|
30
|
+
disabled = false;
|
|
24
31
|
/** Emitted when start date changes */
|
|
25
32
|
startDateChange;
|
|
26
33
|
/** Emitted when end date changes */
|
|
@@ -31,8 +38,18 @@ export class DropiDatePickerRange {
|
|
|
31
38
|
end = '';
|
|
32
39
|
activeRange = -1;
|
|
33
40
|
showWarning = false;
|
|
41
|
+
open = false;
|
|
42
|
+
viewYear = new Date().getFullYear();
|
|
43
|
+
viewMonth = new Date().getMonth();
|
|
44
|
+
hoverDate = '';
|
|
45
|
+
el;
|
|
34
46
|
onStartPropChange(val) { this.start = val; }
|
|
35
47
|
onEndPropChange(val) { this.end = val; }
|
|
48
|
+
handleDocClick(e) {
|
|
49
|
+
if (this.open && !e.composedPath().includes(this.el)) {
|
|
50
|
+
this.open = false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
36
53
|
componentWillLoad() {
|
|
37
54
|
this.start = this.startDate;
|
|
38
55
|
this.end = this.endDate;
|
|
@@ -55,47 +72,137 @@ export class DropiDatePickerRange {
|
|
|
55
72
|
];
|
|
56
73
|
return this.hideTodayRangeShortcut ? all.slice(1) : all;
|
|
57
74
|
}
|
|
75
|
+
get displayValue() {
|
|
76
|
+
const fmt = (s) => s.split('-').reverse().join('/');
|
|
77
|
+
if (this.start && this.end)
|
|
78
|
+
return `${fmt(this.start)} – ${fmt(this.end)}`;
|
|
79
|
+
if (this.start)
|
|
80
|
+
return fmt(this.start);
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
toggleOpen() {
|
|
84
|
+
if (this.disabled)
|
|
85
|
+
return;
|
|
86
|
+
if (!this.open && this.start) {
|
|
87
|
+
const d = new Date(this.start);
|
|
88
|
+
this.viewYear = d.getFullYear();
|
|
89
|
+
this.viewMonth = d.getMonth();
|
|
90
|
+
}
|
|
91
|
+
this.open = !this.open;
|
|
92
|
+
}
|
|
93
|
+
prevMonth() {
|
|
94
|
+
if (this.viewMonth === 0) {
|
|
95
|
+
this.viewMonth = 11;
|
|
96
|
+
this.viewYear--;
|
|
97
|
+
}
|
|
98
|
+
else
|
|
99
|
+
this.viewMonth--;
|
|
100
|
+
}
|
|
101
|
+
nextMonth() {
|
|
102
|
+
if (this.viewMonth === 11) {
|
|
103
|
+
this.viewMonth = 0;
|
|
104
|
+
this.viewYear++;
|
|
105
|
+
}
|
|
106
|
+
else
|
|
107
|
+
this.viewMonth++;
|
|
108
|
+
}
|
|
109
|
+
toISO(year, month, day) {
|
|
110
|
+
return `${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
|
|
111
|
+
}
|
|
112
|
+
isInRange(iso) {
|
|
113
|
+
const end = this.end || this.hoverDate;
|
|
114
|
+
if (!this.start || !end)
|
|
115
|
+
return false;
|
|
116
|
+
const [s, e] = this.start <= end ? [this.start, end] : [end, this.start];
|
|
117
|
+
return iso > s && iso < e;
|
|
118
|
+
}
|
|
119
|
+
selectDate(iso) {
|
|
120
|
+
if (!this.start || (this.start && this.end)) {
|
|
121
|
+
this.start = iso;
|
|
122
|
+
this.end = '';
|
|
123
|
+
this.activeRange = -1;
|
|
124
|
+
this.showWarning = false;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
if (iso < this.start) {
|
|
128
|
+
this.end = this.start;
|
|
129
|
+
this.start = iso;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
this.end = iso;
|
|
133
|
+
}
|
|
134
|
+
this.activeRange = -1;
|
|
135
|
+
if (this.maxDaysRange > 0) {
|
|
136
|
+
const diff = (new Date(this.end).getTime() - new Date(this.start).getTime()) / 86400000;
|
|
137
|
+
this.showWarning = diff > this.maxDaysRange;
|
|
138
|
+
if (this.showWarning)
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.open = false;
|
|
142
|
+
this.emit();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
58
145
|
selectShortcut(idx) {
|
|
59
146
|
const s = this.shortcuts[idx];
|
|
60
147
|
this.start = s.start;
|
|
61
148
|
this.end = s.end;
|
|
62
149
|
this.activeRange = idx;
|
|
63
150
|
this.showWarning = false;
|
|
151
|
+
this.open = false;
|
|
64
152
|
this.emit();
|
|
65
153
|
}
|
|
66
|
-
onStartChange(e) {
|
|
67
|
-
this.start = e.target.value;
|
|
68
|
-
this.activeRange = -1;
|
|
69
|
-
this.checkRange();
|
|
70
|
-
if (this.start && this.end)
|
|
71
|
-
this.emit();
|
|
72
|
-
}
|
|
73
|
-
onEndChange(e) {
|
|
74
|
-
this.end = e.target.value;
|
|
75
|
-
this.activeRange = -1;
|
|
76
|
-
this.checkRange();
|
|
77
|
-
if (this.start && this.end)
|
|
78
|
-
this.emit();
|
|
79
|
-
}
|
|
80
|
-
checkRange() {
|
|
81
|
-
if (this.start && this.end && this.maxDaysRange > 0) {
|
|
82
|
-
const diff = (new Date(this.end).getTime() - new Date(this.start).getTime()) / 86400000;
|
|
83
|
-
this.showWarning = diff > this.maxDaysRange;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
this.showWarning = false;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
154
|
emit() {
|
|
90
155
|
this.startDateChange.emit(this.start);
|
|
91
156
|
this.endDateChange.emit(this.end);
|
|
92
157
|
this.dropiRangeChange.emit({ start: this.start, end: this.end });
|
|
93
158
|
}
|
|
159
|
+
buildDays() {
|
|
160
|
+
const year = this.viewYear;
|
|
161
|
+
const month = this.viewMonth;
|
|
162
|
+
const firstDay = new Date(year, month, 1).getDay();
|
|
163
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
164
|
+
const daysInPrevMonth = new Date(year, month, 0).getDate();
|
|
165
|
+
const cells = [];
|
|
166
|
+
for (let i = firstDay - 1; i >= 0; i--) {
|
|
167
|
+
const d = daysInPrevMonth - i;
|
|
168
|
+
const m = month === 0 ? 11 : month - 1;
|
|
169
|
+
const y = month === 0 ? year - 1 : year;
|
|
170
|
+
cells.push({ iso: this.toISO(y, m, d), day: d, currentMonth: false });
|
|
171
|
+
}
|
|
172
|
+
for (let d = 1; d <= daysInMonth; d++) {
|
|
173
|
+
cells.push({ iso: this.toISO(year, month, d), day: d, currentMonth: true });
|
|
174
|
+
}
|
|
175
|
+
const remaining = 42 - cells.length;
|
|
176
|
+
for (let d = 1; d <= remaining; d++) {
|
|
177
|
+
const m = month === 11 ? 0 : month + 1;
|
|
178
|
+
const y = month === 11 ? year + 1 : year;
|
|
179
|
+
cells.push({ iso: this.toISO(y, m, d), day: d, currentMonth: false });
|
|
180
|
+
}
|
|
181
|
+
return cells;
|
|
182
|
+
}
|
|
94
183
|
render() {
|
|
95
|
-
if (this.loading)
|
|
184
|
+
if (this.loading)
|
|
96
185
|
return h("div", { class: "skeleton" });
|
|
97
|
-
|
|
98
|
-
|
|
186
|
+
const days = this.buildDays();
|
|
187
|
+
const today = this.today;
|
|
188
|
+
return (h("div", { class: "dpr-wrap" }, this.showLabel && h("label", { class: "dpr-label" }, "Rango de fechas"), h("button", { class: { 'dpr-trigger': true, 'dpr-trigger--disabled': this.disabled }, onClick: () => this.toggleOpen(), disabled: this.disabled, type: "button" }, h("dropi-icon", { name: "Calendar", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-400" }), h("span", { class: { 'dpr-trigger__value': true, 'dpr-trigger__placeholder': !this.displayValue } }, this.displayValue || this.placeholder), h("dropi-icon", { name: "Arrow-Down-2", iconWidth: "12px", iconHeight: "12px", color: "Gray-Gray-400" })), this.open && (h("div", { class: "dpr-popup" }, h("div", { class: "dpr-calendar" }, h("div", { class: "dp-nav" }, h("button", { class: "dp-nav__btn", onClick: () => this.prevMonth(), type: "button" }, h("dropi-icon", { name: "Arrow-Left-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" })), h("span", { class: "dp-nav__title" }, h("span", null, MONTHS_ES[this.viewMonth]), h("span", null, this.viewYear)), h("button", { class: "dp-nav__btn", onClick: () => this.nextMonth(), type: "button" }, h("dropi-icon", { name: "Arrow-Right-2", iconWidth: "16px", iconHeight: "16px", color: "Gray-Gray-600" }))), h("div", { class: "dp-grid" }, DAYS_ES.map(d => h("div", { class: "dp-day-header" }, d)), days.map(({ iso, day, currentMonth }) => {
|
|
189
|
+
const isStart = iso === this.start;
|
|
190
|
+
const isEnd = iso === this.end;
|
|
191
|
+
const inRange = this.isInRange(iso);
|
|
192
|
+
const isToday = iso === today;
|
|
193
|
+
return (h("button", { class: {
|
|
194
|
+
'dp-cell': true,
|
|
195
|
+
'dp-cell--other-month': !currentMonth,
|
|
196
|
+
'dp-cell--today': isToday && !isStart && !isEnd,
|
|
197
|
+
'dp-cell--selected': isStart || isEnd,
|
|
198
|
+
'dp-cell--range-start': isStart,
|
|
199
|
+
'dp-cell--range-end': isEnd,
|
|
200
|
+
'dp-cell--in-range': inRange,
|
|
201
|
+
}, type: "button", onClick: () => this.selectDate(iso), onMouseEnter: () => {
|
|
202
|
+
if (this.start && !this.end)
|
|
203
|
+
this.hoverDate = iso;
|
|
204
|
+
}, onMouseLeave: () => this.hoverDate = '' }, day));
|
|
205
|
+
})), this.showWarning && (h("div", { class: "warning-box" }, h("span", { class: "warning-message" }, "Solo puedes filtrar en un rango m\u00E1ximo de ", this.maxDaysRange, " d\u00EDas.")))), h("div", { class: "dpr-divider" }), h("div", { class: "dpr-shortcuts" }, this.shortcuts.map((s, i) => (h("button", { key: i, class: { 'shortcut-btn': true, 'shortcut-btn--active': this.activeRange === i }, onClick: () => this.selectShortcut(i), type: "button" }, s.label))))))));
|
|
99
206
|
}
|
|
100
207
|
static get is() { return "dropi-date-picker-range"; }
|
|
101
208
|
static get encapsulation() { return "shadow"; }
|
|
@@ -189,7 +296,7 @@ export class DropiDatePickerRange {
|
|
|
189
296
|
"setter": false,
|
|
190
297
|
"reflect": false,
|
|
191
298
|
"attribute": "placeholder",
|
|
192
|
-
"defaultValue": "''"
|
|
299
|
+
"defaultValue": "'DD/MM/YYYY \u2013 DD/MM/YYYY'"
|
|
193
300
|
},
|
|
194
301
|
"loading": {
|
|
195
302
|
"type": "boolean",
|
|
@@ -250,6 +357,26 @@ export class DropiDatePickerRange {
|
|
|
250
357
|
"reflect": false,
|
|
251
358
|
"attribute": "hide-today-range-shortcut",
|
|
252
359
|
"defaultValue": "false"
|
|
360
|
+
},
|
|
361
|
+
"disabled": {
|
|
362
|
+
"type": "boolean",
|
|
363
|
+
"mutable": false,
|
|
364
|
+
"complexType": {
|
|
365
|
+
"original": "boolean",
|
|
366
|
+
"resolved": "boolean",
|
|
367
|
+
"references": {}
|
|
368
|
+
},
|
|
369
|
+
"required": false,
|
|
370
|
+
"optional": false,
|
|
371
|
+
"docs": {
|
|
372
|
+
"tags": [],
|
|
373
|
+
"text": "Disabled state"
|
|
374
|
+
},
|
|
375
|
+
"getter": false,
|
|
376
|
+
"setter": false,
|
|
377
|
+
"reflect": false,
|
|
378
|
+
"attribute": "disabled",
|
|
379
|
+
"defaultValue": "false"
|
|
253
380
|
}
|
|
254
381
|
};
|
|
255
382
|
}
|
|
@@ -258,7 +385,11 @@ export class DropiDatePickerRange {
|
|
|
258
385
|
"start": {},
|
|
259
386
|
"end": {},
|
|
260
387
|
"activeRange": {},
|
|
261
|
-
"showWarning": {}
|
|
388
|
+
"showWarning": {},
|
|
389
|
+
"open": {},
|
|
390
|
+
"viewYear": {},
|
|
391
|
+
"viewMonth": {},
|
|
392
|
+
"hoverDate": {}
|
|
262
393
|
};
|
|
263
394
|
}
|
|
264
395
|
static get events() {
|
|
@@ -315,6 +446,7 @@ export class DropiDatePickerRange {
|
|
|
315
446
|
}
|
|
316
447
|
}];
|
|
317
448
|
}
|
|
449
|
+
static get elementRef() { return "el"; }
|
|
318
450
|
static get watchers() {
|
|
319
451
|
return [{
|
|
320
452
|
"propName": "startDate",
|
|
@@ -324,4 +456,13 @@ export class DropiDatePickerRange {
|
|
|
324
456
|
"methodName": "onEndPropChange"
|
|
325
457
|
}];
|
|
326
458
|
}
|
|
459
|
+
static get listeners() {
|
|
460
|
+
return [{
|
|
461
|
+
"name": "click",
|
|
462
|
+
"method": "handleDocClick",
|
|
463
|
+
"target": "document",
|
|
464
|
+
"capture": false,
|
|
465
|
+
"passive": false
|
|
466
|
+
}];
|
|
467
|
+
}
|
|
327
468
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as a,H as e,c as i,h as s}from"./index.js";const r=a(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.startDateChange=i(this,"startDateChange"),this.endDateChange=i(this,"endDateChange"),this.dropiRangeChange=i(this,"dropiRangeChange")}startDate="";endDate="";showLabel=!0;placeholder="";loading=!1;maxDaysRange=0;hideTodayRangeShortcut=!1;startDateChange;endDateChange;dropiRangeChange;start="";end="";activeRange=-1;showWarning=!1;onStartPropChange(t){this.start=t}onEndPropChange(t){this.end=t}componentWillLoad(){this.start=this.startDate,this.end=this.endDate}get today(){return(new Date).toISOString().split("T")[0]}daysAgo(t){const a=new Date;return a.setDate(a.getDate()-t),a.toISOString().split("T")[0]}get shortcuts(){const t=[{label:"Hoy",start:this.today,end:this.today},{label:"Últimos 7 días",start:this.daysAgo(6),end:this.today},{label:"Últimos 15 días",start:this.daysAgo(14),end:this.today},{label:"Últimos 30 días",start:this.daysAgo(29),end:this.today},{label:"Últimos 90 días",start:this.daysAgo(89),end:this.today}];return this.hideTodayRangeShortcut?t.slice(1):t}selectShortcut(t){const a=this.shortcuts[t];this.start=a.start,this.end=a.end,this.activeRange=t,this.showWarning=!1,this.emit()}onStartChange(t){this.start=t.target.value,this.activeRange=-1,this.checkRange(),this.start&&this.end&&this.emit()}onEndChange(t){this.end=t.target.value,this.activeRange=-1,this.checkRange(),this.start&&this.end&&this.emit()}checkRange(){if(this.start&&this.end&&this.maxDaysRange>0){const t=(new Date(this.end).getTime()-new Date(this.start).getTime())/864e5;this.showWarning=t>this.maxDaysRange}else this.showWarning=!1}emit(){this.startDateChange.emit(this.start),this.endDateChange.emit(this.end),this.dropiRangeChange.emit({start:this.start,end:this.end})}render(){return this.loading?s("div",{class:"skeleton"}):s("div",{class:"date-picker-range"},this.showLabel&&s("div",{class:"label"},"Rango de fechas"),s("div",{class:"inputs-row"},s("div",{class:"input-group"},s("label",{class:"input-label"},"Desde"),s("input",{type:"date",class:"date-input",value:this.start,max:this.end||this.today,onChange:t=>this.onStartChange(t)})),s("span",{class:"separator"},"—"),s("div",{class:"input-group"},s("label",{class:"input-label"},"Hasta"),s("input",{type:"date",class:"date-input",value:this.end,min:this.start,max:this.today,onChange:t=>this.onEndChange(t)}))),s("div",{class:"shortcuts"},this.shortcuts.map(((t,a)=>s("button",{key:a,class:"shortcut-btn"+(this.activeRange===a?" active":""),onClick:()=>this.selectShortcut(a)},t.label)))),this.showWarning&&s("div",{class:"warning-box"},s("span",{class:"warning-message"},"Solo puedes filtrar en un rango máximo de ",this.maxDaysRange," días.")))}static get watchers(){return{startDate:[{onStartPropChange:0}],endDate:[{onEndPropChange:0}]}}static get style(){return":host{display:block;width:100%;max-width:380px}*,*::before,*::after{box-sizing:border-box}.date-picker-range{width:100%;font-family:inherit}.label{font-size:11px;font-weight:var(--font-weight-medium);color:#7b8190;margin-bottom:8px}.inputs-row{display:flex;align-items:flex-end;gap:8px}.input-group{flex:1;display:flex;flex-direction:column;gap:4px}.input-label{font-size:var(--font-size-xs, 11px);color:var(--Gray-Gray-500, #69738c);font-weight:var(--font-weight-medium, 500)}.date-input{width:100%;height:40px;padding:0 10px;border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);color:var(--Gray-Gray-600, #475066);font-size:13px;font-family:inherit;outline:none;cursor:pointer;transition:border-color 0.15s ease}.date-input:focus{border-color:var(--Primary-Primary-500, #f49a3d)}.separator{padding-bottom:8px;color:var(--Gray-Gray-400, #858ea6);font-size:var(--font-size-m)}.shortcuts{display:flex;flex-direction:column;gap:2px;margin-top:10px;border-left:1px solid var(--Gray-Gray-100, #e6eaf2);padding-left:10px}.shortcut-btn{background:transparent;border:none;padding:4px 6px;font-size:13px;font-family:inherit;color:var(--Gray-Gray-700, #32394d);cursor:pointer;text-align:left;border-radius:5px;transition:background 0.1s ease;font-weight:var(--font-weight-regular)}.shortcut-btn:hover{background:var(--Gray-Gray-50, #f5f6f8)}.shortcut-btn.active{background:var(--Gray-Gray-50, #f5f6f8);font-weight:var(--font-weight-semibold)}.warning-box{margin-top:8px;padding:4px 8px;border:1px solid var(--Warning-Warning-400);border-radius:4px;background:var(--Warning-Warning-50)}.warning-message{color:#495057;font-size:var(--font-size-xxs);line-height:16px}@keyframes shimmer{0%{background-position:-468px 0}100%{background-position:468px 0}}.skeleton{height:40px;width:100%;min-width:180px;border-radius:6px;animation:shimmer 1s linear infinite;background:linear-gradient(to right, #f5f6f8 8%, #e3e7ef 28%, #f5f6f8 77%);background-size:800px 104px}@media screen and (max-width: 480px){.inputs-row{flex-direction:column}.separator{display:none}.shortcuts{flex-direction:row;flex-wrap:wrap;border-left:none;padding-left:0;border-top:1px solid var(--Gray-Gray-100, #e6eaf2);padding-top:8px}}"}},[513,"dropi-date-picker-range",{startDate:[1025,"start-date"],endDate:[1025,"end-date"],showLabel:[4,"show-label"],placeholder:[1],loading:[4],maxDaysRange:[2,"max-days-range"],hideTodayRangeShortcut:[4,"hide-today-range-shortcut"],start:[32],end:[32],activeRange:[32],showWarning:[32]},void 0,{startDate:[{onStartPropChange:0}],endDate:[{onEndPropChange:0}]}]);function n(){"undefined"!=typeof customElements&&["dropi-date-picker-range"].forEach((a=>{"dropi-date-picker-range"===a&&(customElements.get(t(a))||customElements.define(t(a),r))}))}n();const o=r,d=n;export{o as DropiDatePickerRange,d as defineCustomElement}
|
|
1
|
+
import{t,p as e,H as r,c as a,h as i}from"./index.js";import{d as n}from"./p-DqAyyLAT.js";const o=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],s=["Do","Lu","Ma","Mi","Ju","Vi","Sa"],d=e(class extends r{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.startDateChange=a(this,"startDateChange"),this.endDateChange=a(this,"endDateChange"),this.dropiRangeChange=a(this,"dropiRangeChange")}startDate="";endDate="";showLabel=!0;placeholder="DD/MM/YYYY – DD/MM/YYYY";loading=!1;maxDaysRange=0;hideTodayRangeShortcut=!1;disabled=!1;startDateChange;endDateChange;dropiRangeChange;start="";end="";activeRange=-1;showWarning=!1;open=!1;viewYear=(new Date).getFullYear();viewMonth=(new Date).getMonth();hoverDate="";get el(){return this}onStartPropChange(t){this.start=t}onEndPropChange(t){this.end=t}handleDocClick(t){this.open&&!t.composedPath().includes(this.el)&&(this.open=!1)}componentWillLoad(){this.start=this.startDate,this.end=this.endDate}get today(){return(new Date).toISOString().split("T")[0]}daysAgo(t){const e=new Date;return e.setDate(e.getDate()-t),e.toISOString().split("T")[0]}get shortcuts(){const t=[{label:"Hoy",start:this.today,end:this.today},{label:"Últimos 7 días",start:this.daysAgo(6),end:this.today},{label:"Últimos 15 días",start:this.daysAgo(14),end:this.today},{label:"Últimos 30 días",start:this.daysAgo(29),end:this.today},{label:"Últimos 90 días",start:this.daysAgo(89),end:this.today}];return this.hideTodayRangeShortcut?t.slice(1):t}get displayValue(){const t=t=>t.split("-").reverse().join("/");return this.start&&this.end?`${t(this.start)} – ${t(this.end)}`:this.start?t(this.start):""}toggleOpen(){if(!this.disabled){if(!this.open&&this.start){const t=new Date(this.start);this.viewYear=t.getFullYear(),this.viewMonth=t.getMonth()}this.open=!this.open}}prevMonth(){0===this.viewMonth?(this.viewMonth=11,this.viewYear--):this.viewMonth--}nextMonth(){11===this.viewMonth?(this.viewMonth=0,this.viewYear++):this.viewMonth++}toISO(t,e,r){return`${t}-${(e+1+"").padStart(2,"0")}-${(r+"").padStart(2,"0")}`}isInRange(t){const e=this.end||this.hoverDate;if(!this.start||!e)return!1;const[r,a]=this.start<=e?[this.start,e]:[e,this.start];return t>r&&t<a}selectDate(t){if(!this.start||this.start&&this.end)this.start=t,this.end="",this.activeRange=-1,this.showWarning=!1;else{if(t<this.start?(this.end=this.start,this.start=t):this.end=t,this.activeRange=-1,this.maxDaysRange>0){const t=(new Date(this.end).getTime()-new Date(this.start).getTime())/864e5;if(this.showWarning=t>this.maxDaysRange,this.showWarning)return}this.open=!1,this.emit()}}selectShortcut(t){const e=this.shortcuts[t];this.start=e.start,this.end=e.end,this.activeRange=t,this.showWarning=!1,this.open=!1,this.emit()}emit(){this.startDateChange.emit(this.start),this.endDateChange.emit(this.end),this.dropiRangeChange.emit({start:this.start,end:this.end})}buildDays(){const t=this.viewYear,e=this.viewMonth,r=new Date(t,e,1).getDay(),a=new Date(t,e+1,0).getDate(),i=new Date(t,e,0).getDate(),n=[];for(let a=r-1;a>=0;a--){const r=i-a;n.push({iso:this.toISO(0===e?t-1:t,0===e?11:e-1,r),day:r,currentMonth:!1})}for(let r=1;r<=a;r++)n.push({iso:this.toISO(t,e,r),day:r,currentMonth:!0});const o=42-n.length;for(let r=1;r<=o;r++)n.push({iso:this.toISO(11===e?t+1:t,11===e?0:e+1,r),day:r,currentMonth:!1});return n}render(){if(this.loading)return i("div",{class:"skeleton"});const t=this.buildDays(),e=this.today;return i("div",{class:"dpr-wrap"},this.showLabel&&i("label",{class:"dpr-label"},"Rango de fechas"),i("button",{class:{"dpr-trigger":!0,"dpr-trigger--disabled":this.disabled},onClick:()=>this.toggleOpen(),disabled:this.disabled,type:"button"},i("dropi-icon",{name:"Calendar",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-400"}),i("span",{class:{"dpr-trigger__value":!0,"dpr-trigger__placeholder":!this.displayValue}},this.displayValue||this.placeholder),i("dropi-icon",{name:"Arrow-Down-2",iconWidth:"12px",iconHeight:"12px",color:"Gray-Gray-400"})),this.open&&i("div",{class:"dpr-popup"},i("div",{class:"dpr-calendar"},i("div",{class:"dp-nav"},i("button",{class:"dp-nav__btn",onClick:()=>this.prevMonth(),type:"button"},i("dropi-icon",{name:"Arrow-Left-2",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"})),i("span",{class:"dp-nav__title"},i("span",null,o[this.viewMonth]),i("span",null,this.viewYear)),i("button",{class:"dp-nav__btn",onClick:()=>this.nextMonth(),type:"button"},i("dropi-icon",{name:"Arrow-Right-2",iconWidth:"16px",iconHeight:"16px",color:"Gray-Gray-600"}))),i("div",{class:"dp-grid"},s.map((t=>i("div",{class:"dp-day-header"},t))),t.map((({iso:t,day:r,currentMonth:a})=>{const n=t===this.start,o=t===this.end,s=this.isInRange(t);return i("button",{class:{"dp-cell":!0,"dp-cell--other-month":!a,"dp-cell--today":t===e&&!n&&!o,"dp-cell--selected":n||o,"dp-cell--range-start":n,"dp-cell--range-end":o,"dp-cell--in-range":s},type:"button",onClick:()=>this.selectDate(t),onMouseEnter:()=>{this.start&&!this.end&&(this.hoverDate=t)},onMouseLeave:()=>this.hoverDate=""},r)}))),this.showWarning&&i("div",{class:"warning-box"},i("span",{class:"warning-message"},"Solo puedes filtrar en un rango máximo de ",this.maxDaysRange," días."))),i("div",{class:"dpr-divider"}),i("div",{class:"dpr-shortcuts"},this.shortcuts.map(((t,e)=>i("button",{key:e,class:{"shortcut-btn":!0,"shortcut-btn--active":this.activeRange===e},onClick:()=>this.selectShortcut(e),type:"button"},t.label))))))}static get watchers(){return{startDate:[{onStartPropChange:0}],endDate:[{onEndPropChange:0}]}}static get style(){return':host{display:block;width:100%;position:relative}*,*::before,*::after{box-sizing:border-box}.dpr-label{display:block;font-size:var(--font-size-xxs, 10px);color:var(--Gray-Gray-600, #475066);margin-bottom:4px}.dpr-trigger{width:100%;height:44px;display:flex;align-items:center;gap:var(--Size-2, 8px);padding:0 var(--Size-3, 12px);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-2, 8px);background:var(--Neutral-White, #ffffff);cursor:pointer;font-family:inherit;transition:border-color 0.2s}.dpr-trigger:hover:not(:disabled){border-color:var(--Info-Info-500, #50a5f1)}.dpr-trigger--disabled{background:var(--Gray-Gray-50, #f7f8fa);cursor:not-allowed;opacity:0.6}.dpr-trigger__value{flex:1;text-align:left;font-size:var(--font-size-xs, 12px);color:var(--Gray-Gray-700, #32394d);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dpr-trigger__placeholder{color:var(--Gray-Gray-400, #858ea6)}.dpr-popup{position:absolute;top:calc(100% + 8px);left:0;display:flex;flex-direction:row;background:var(--Neutral-White, #ffffff);border:1px solid var(--Gray-Gray-200, #c3c9d9);border-radius:var(--Border-3, 12px);box-shadow:0 4px 16px rgba(0,0,0,0.08);z-index:300;overflow:hidden}.dpr-calendar{padding:var(--Size-4, 16px);width:300px;flex-shrink:0}.dpr-divider{width:1px;background:var(--Gray-Gray-100, #e6eaf2);flex-shrink:0}.dpr-shortcuts{padding:var(--Size-4, 16px) var(--Size-3, 12px);display:flex;flex-direction:column;gap:2px;min-width:140px}.shortcut-btn{background:transparent;border:1px solid transparent;padding:6px 10px;font-size:13px;font-family:inherit;color:var(--Gray-Gray-700, #32394d);cursor:pointer;text-align:left;border-radius:6px;transition:background 0.1s ease;font-weight:var(--font-weight-regular);white-space:nowrap}.shortcut-btn:hover{background:var(--Gray-Gray-50, #f5f6f8)}.shortcut-btn--active{border-color:var(--Gray-Gray-200, #c3c9d9);font-weight:var(--font-weight-semibold);background:var(--Gray-Gray-50, #f5f6f8)}.warning-box{margin-top:8px;padding:4px 8px;border:1px solid var(--Warning-Warning-400);border-radius:4px;background:var(--Warning-Warning-50)}.warning-message{color:#495057;font-size:var(--font-size-xxs);line-height:16px}.dp-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--Size-4, 16px);padding-bottom:var(--Size-3, 12px);border-bottom:1px solid var(--Gray-Gray-100, #e6eaf2)}.dp-nav__btn{background:none;border:none;padding:0;cursor:pointer;border-radius:50%;display:flex;align-items:center;justify-content:center;width:32px;height:32px;transition:background 0.15s}.dp-nav__btn:hover{background:var(--Gray-Gray-50, #f7f8fa)}.dp-nav__title{font-size:var(--font-size-s, 14px);font-weight:var(--font-weight-bold, 700);color:var(--Gray-Gray-700, #32394d);display:flex;gap:8px}.dp-grid{display:grid;grid-template-columns:repeat(7, 1fr);row-gap:6px;column-gap:2px}.dp-day-header{font-size:var(--font-size-s, 14px);color:var(--Gray-Gray-700, #32394d);text-align:center;padding:6px 0;font-weight:var(--font-weight-bold, 700)}.dp-cell{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:var(--font-size-xs, 12px);font-family:inherit;border:none;cursor:pointer;background:transparent;color:var(--Gray-Gray-600, #475066);width:100%;position:relative;z-index:1;padding:0}.dp-cell::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:50%;transition:background 0.15s;z-index:-1;background:transparent}.dp-cell::before{content:"";position:absolute;top:0;bottom:0;z-index:-2;background:transparent}.dp-cell:hover:not(:disabled)::after{background:var(--Gray-Gray-100, #e6eaf2)}.dp-cell--other-month{color:var(--Gray-Gray-300, #a0a9c0)}.dp-cell--today{font-weight:var(--font-weight-bold, 700)}.dp-cell--today::after{background:var(--Gray-Gray-100, #e6eaf2)}.dp-cell--selected{color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.dp-cell--selected::after{background:var(--Orange-orange-500, #f49a3d) !important}.dp-cell--range-start,.dp-cell--range-end{color:var(--Neutral-White, #ffffff);font-weight:var(--font-weight-bold, 700)}.dp-cell--range-start::after,.dp-cell--range-end::after{background:var(--Orange-orange-500, #f49a3d) !important}.dp-cell--in-range{color:var(--Orange-orange-500, #f49a3d);font-weight:var(--font-weight-bold, 700)}.dp-cell--in-range::before{left:-1px;right:-1px;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-start::before{left:50%;right:-1px;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-end::before{left:-1px;right:50%;background:var(--Orange-orange-50, #fef5ec)}.dp-cell--range-start.dp-cell--range-end::before{background:transparent}.dp-cell--disabled{opacity:0.35;cursor:not-allowed}@keyframes shimmer{0%{background-position:-468px 0}100%{background-position:468px 0}}.skeleton{height:44px;width:100%;border-radius:8px;animation:shimmer 1s linear infinite;background:linear-gradient(to right, #f5f6f8 8%, #e3e7ef 28%, #f5f6f8 77%);background-size:800px 104px}'}},[513,"dropi-date-picker-range",{startDate:[1025,"start-date"],endDate:[1025,"end-date"],showLabel:[4,"show-label"],placeholder:[1],loading:[4],maxDaysRange:[2,"max-days-range"],hideTodayRangeShortcut:[4,"hide-today-range-shortcut"],disabled:[4],start:[32],end:[32],activeRange:[32],showWarning:[32],open:[32],viewYear:[32],viewMonth:[32],hoverDate:[32]},[[4,"click","handleDocClick"]],{startDate:[{onStartPropChange:0}],endDate:[{onEndPropChange:0}]}]);function l(){"undefined"!=typeof customElements&&["dropi-date-picker-range","dropi-icon"].forEach((e=>{switch(e){case"dropi-date-picker-range":customElements.get(t(e))||customElements.define(t(e),d);break;case"dropi-icon":customElements.get(t(e))||n()}}))}l();const h=d,p=l;export{h as DropiDatePickerRange,p as defineCustomElement}
|