@keenmate/web-daterangepicker 1.1.0 → 1.2.0
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/README.md +51 -0
- package/dist/style.css +1 -1
- package/dist/web-daterangepicker.js +1965 -1592
- package/dist/web-daterangepicker.umd.js +17 -8
- package/package.json +1 -1
- package/src/scss/_base.scss +3 -2
- package/src/scss/_header-navigation.scss +186 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keenmate/web-daterangepicker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Lightweight date picker web component with excellent keyboard navigation and range selection",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/web-daterangepicker.umd.js",
|
package/src/scss/_base.scss
CHANGED
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
// CSS CUSTOM PROPERTIES (CSS VARIABLES)
|
|
10
10
|
// ==============================================================================
|
|
11
11
|
// Define CSS custom properties with SCSS fallbacks for runtime customization
|
|
12
|
-
// Using :host
|
|
12
|
+
// Using :host for Shadow DOM (web component) and :root for Light DOM (direct class usage)
|
|
13
13
|
|
|
14
|
-
:host
|
|
14
|
+
:host,
|
|
15
|
+
:root {
|
|
15
16
|
// ===========================================================================
|
|
16
17
|
// SIZING SCALE SYSTEM (THREE INDEPENDENT MULTIPLIERS)
|
|
17
18
|
// ===========================================================================
|
|
@@ -15,6 +15,19 @@
|
|
|
15
15
|
justify-content: space-between;
|
|
16
16
|
margin-bottom: var(--drp-spacing-md);
|
|
17
17
|
gap: var(--drp-spacing-sm);
|
|
18
|
+
|
|
19
|
+
// Static header (used in unified navigation mode)
|
|
20
|
+
&--static {
|
|
21
|
+
justify-content: center;
|
|
22
|
+
|
|
23
|
+
.drp-date-picker__month-year {
|
|
24
|
+
cursor: default;
|
|
25
|
+
|
|
26
|
+
&:hover {
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
// ==============================================================================
|
|
@@ -185,3 +198,176 @@
|
|
|
185
198
|
width: 100%;
|
|
186
199
|
min-width: 0; // Allow flex child to shrink below content size
|
|
187
200
|
}
|
|
201
|
+
|
|
202
|
+
// ==============================================================================
|
|
203
|
+
// UNIFIED NAVIGATION (MULTI-MONTH CALENDARS)
|
|
204
|
+
// ==============================================================================
|
|
205
|
+
|
|
206
|
+
// Unified header - appears above all months
|
|
207
|
+
.drp-date-picker__unified-header {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
justify-content: space-between;
|
|
211
|
+
margin-bottom: var(--drp-spacing-lg);
|
|
212
|
+
gap: var(--drp-spacing-sm);
|
|
213
|
+
padding: 0 var(--drp-spacing-sm);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Date range display in unified header (e.g., "Jan 2025 - Jun 2025")
|
|
217
|
+
.drp-date-picker__unified-range {
|
|
218
|
+
flex: 1;
|
|
219
|
+
text-align: center;
|
|
220
|
+
font-weight: var(--drp-font-weight-semibold);
|
|
221
|
+
font-size: var(--drp-font-size-lg);
|
|
222
|
+
color: var(--drp-text-primary);
|
|
223
|
+
padding: var(--drp-spacing-sm) var(--drp-spacing-md);
|
|
224
|
+
border-radius: var(--drp-border-radius);
|
|
225
|
+
cursor: pointer;
|
|
226
|
+
|
|
227
|
+
&:hover {
|
|
228
|
+
background-color: var(--drp-primary-bg);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:active {
|
|
232
|
+
background-color: var(--drp-primary-bg-hover);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Non-interactive state (when unifiedHeaderInteractive is false)
|
|
236
|
+
&--static {
|
|
237
|
+
cursor: default !important;
|
|
238
|
+
|
|
239
|
+
&:hover {
|
|
240
|
+
background-color: transparent;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
&:active {
|
|
244
|
+
background-color: transparent;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Unified rolling selector - overlay for all months
|
|
250
|
+
.drp-date-picker__unified-rolling-selector {
|
|
251
|
+
position: absolute;
|
|
252
|
+
// Position below unified header
|
|
253
|
+
top: calc(var(--drp-spacing-lg) + var(--drp-spacing-lg) * 2);
|
|
254
|
+
// Center horizontally
|
|
255
|
+
left: 50%;
|
|
256
|
+
transform: translateX(-50%);
|
|
257
|
+
|
|
258
|
+
// Size constraints (responsive but limited)
|
|
259
|
+
width: min(90%, 450px); // 90% of calendar width or 450px, whichever is smaller
|
|
260
|
+
height: 350px;
|
|
261
|
+
max-height: 350px;
|
|
262
|
+
|
|
263
|
+
display: none;
|
|
264
|
+
z-index: 100; // Above everything
|
|
265
|
+
background: var(--drp-card-bg); // White background to cover calendar below
|
|
266
|
+
gap: var(--drp-spacing-xs); // Match normal rolling selector gap
|
|
267
|
+
|
|
268
|
+
&--visible {
|
|
269
|
+
display: flex;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Apply rolling list styles to child lists
|
|
273
|
+
.drp-date-picker__rolling-list {
|
|
274
|
+
flex: 1;
|
|
275
|
+
min-width: 0;
|
|
276
|
+
height: 100%;
|
|
277
|
+
overflow-y: auto;
|
|
278
|
+
border: var(--drp-border-width-base) solid var(--drp-border-color);
|
|
279
|
+
border-radius: var(--drp-border-radius);
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-direction: column;
|
|
282
|
+
scroll-behavior: smooth;
|
|
283
|
+
|
|
284
|
+
// Custom scrollbar
|
|
285
|
+
&::-webkit-scrollbar {
|
|
286
|
+
width: $drp-rolling-scrollbar-width;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&::-webkit-scrollbar-track {
|
|
290
|
+
background: var(--drp-primary-bg);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
&::-webkit-scrollbar-thumb {
|
|
294
|
+
background: var(--drp-border-color);
|
|
295
|
+
border-radius: 3px;
|
|
296
|
+
|
|
297
|
+
&:hover {
|
|
298
|
+
background: var(--drp-accent-color);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Apply rolling item styles to child items
|
|
304
|
+
.drp-date-picker__rolling-item {
|
|
305
|
+
padding: #{$drp-rolling-item-padding-v} #{$drp-rolling-item-padding-h};
|
|
306
|
+
cursor: pointer;
|
|
307
|
+
font-size: #{$drp-rolling-item-font-size};
|
|
308
|
+
min-height: calc(#{$drp-rolling-item-min-height} * var(--drp-cell-scale));
|
|
309
|
+
flex-shrink: 0;
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
justify-content: var(--drp-rolling-item-justify-content, #{$drp-rolling-item-justify-content});
|
|
313
|
+
|
|
314
|
+
&:hover {
|
|
315
|
+
background-color: $drp-rolling-item-bg-hover;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
&--selected {
|
|
319
|
+
background-color: $drp-rolling-item-bg-selected;
|
|
320
|
+
color: $drp-rolling-item-color-selected;
|
|
321
|
+
font-weight: $drp-rolling-item-font-weight-selected;
|
|
322
|
+
|
|
323
|
+
&:hover {
|
|
324
|
+
background-color: var(--drp-accent-color-hover);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
&--disabled {
|
|
329
|
+
color: var(--drp-text-secondary);
|
|
330
|
+
opacity: 0.4;
|
|
331
|
+
cursor: not-allowed;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Text wrapper for ellipsis support
|
|
336
|
+
.drp-date-picker__rolling-item-text {
|
|
337
|
+
overflow: hidden;
|
|
338
|
+
text-overflow: ellipsis;
|
|
339
|
+
white-space: nowrap;
|
|
340
|
+
width: 100%;
|
|
341
|
+
min-width: 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// When unified navigation is enabled, hide individual month headers nav buttons
|
|
346
|
+
// but keep the month/year text visible (it becomes static display, not clickable)
|
|
347
|
+
.drp-date-picker--unified-nav {
|
|
348
|
+
.drp-date-picker__month {
|
|
349
|
+
.drp-date-picker__header {
|
|
350
|
+
// Hide nav buttons in individual month headers
|
|
351
|
+
.drp-date-picker__nav {
|
|
352
|
+
display: none;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Make month/year display static (not clickable)
|
|
356
|
+
.drp-date-picker__month-year {
|
|
357
|
+
cursor: default;
|
|
358
|
+
font-size: var(--drp-font-size-base);
|
|
359
|
+
font-weight: var(--drp-font-weight-normal);
|
|
360
|
+
color: var(--drp-text-secondary);
|
|
361
|
+
|
|
362
|
+
&:hover {
|
|
363
|
+
background-color: transparent;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// Hide individual month rolling selectors
|
|
369
|
+
.drp-date-picker__rolling-selector {
|
|
370
|
+
display: none !important;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|