@keenmate/pure-admin-core 1.0.0-rc01
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/LICENSE +21 -0
- package/README.md +172 -0
- package/dist/css/main.css +11542 -0
- package/dist/fonts/Delivery/Delivery_W_Bd.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_BdIt.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_CdBlk.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_CdLt.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_It.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_Lt.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_LtIt.woff2 +0 -0
- package/dist/fonts/Delivery/Delivery_W_Rg.woff2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8UH-qVHQ.woff2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8UH-qVHQ.woff2.1 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8UH-qVHQ.woff2.2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8VH-qVHQ.woff2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8VH-qVHQ.woff2.1 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8VH-qVHQ.woff2.2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8bH-o.woff2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8bH-o.woff2.1 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8fH-qVHQ.woff2 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8fH-qVHQ.woff2.1 +0 -0
- package/dist/fonts/google/3y976aknfjLm_3lMKjiMgmUUYBs04Y8fH-qVHQ.woff2.2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvtE2H68T.woff2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvtU2Hw.woff2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvtY2H68T.woff2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvtg2H68T.woff2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvto2H68T.woff2 +0 -0
- package/dist/fonts/google/6aez4K2oVqwIvts2H68T.woff2 +0 -0
- package/dist/fonts/google/7Auup_AqnyWWAxW2Wk3swUz56MS91Eww8SX21nejog.woff2 +0 -0
- package/dist/fonts/google/7Auup_AqnyWWAxW2Wk3swUz56MS91Eww8SX21nijogp5.woff2 +0 -0
- package/dist/fonts/google/7Auup_AqnyWWAxW2Wk3swUz56MS91Eww8SX21nmjogp5.woff2 +0 -0
- package/dist/fonts/google/PN_xRfK9oXHga0XdZ8g_vT0.woff2 +0 -0
- package/dist/fonts/google/PN_xRfK9oXHga0XdZsg_.woff2 +0 -0
- package/dist/fonts/google/PN_xRfK9oXHga0XdaMg_vT0.woff2 +0 -0
- package/dist/fonts/google/TK3tWkYFABsmjsphPho.woff2 +0 -0
- package/dist/fonts/google/TK3tWkYFABsmjspuPho7vA.woff2 +0 -0
- package/dist/fonts/google/TK3tWkYFABsmjspvPho7vA.woff2 +0 -0
- package/dist/fonts/google/dg45_pLmvrkcOkBnKsOzXyGWTBcmg-X6VjTYJwQj.woff2 +0 -0
- package/dist/fonts/google/dg45_pLmvrkcOkBnKsOzXyGWTBcmg-X6VjXYJwQj.woff2 +0 -0
- package/dist/fonts/google/dg45_pLmvrkcOkBnKsOzXyGWTBcmg-X6Vj_YJwQj.woff2 +0 -0
- package/dist/fonts/google/dg45_pLmvrkcOkBnKsOzXyGWTBcmg-X6VjbYJwQj.woff2 +0 -0
- package/dist/fonts/google/dg45_pLmvrkcOkBnKsOzXyGWTBcmg-X6VjvYJw.woff2 +0 -0
- package/dist/fonts/google/fonts-tracklist.txt +48 -0
- package/dist/fonts/google/vEFO2_JTCgwQ5ejvMV0O96D01E8J0tJXHKbBjM4.woff2 +0 -0
- package/dist/fonts/google/vEFO2_JTCgwQ5ejvMV0O96D01E8J0tJXHKbOjM7sfA.woff2 +0 -0
- package/dist/fonts/google/vEFO2_JTCgwQ5ejvMV0O96D01E8J0tJXHKbPjM7sfA.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfLtrftV.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfXtrftV.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfbtrQ.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfjtrftV.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfntrftV.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfrtrftV.woff2 +0 -0
- package/dist/fonts/google/wEOhEADFm8hSaQTFG18FErVhsC9x-tarUfvtrftV.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_B-bnBeA.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_C-bk.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_G-bnBeA.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_M-bnBeA.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_N-bnBeA.woff2 +0 -0
- package/dist/fonts/google/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_P-bnBeA.woff2 +0 -0
- package/package.json +60 -0
- package/snippets/alerts.html +281 -0
- package/snippets/badges.html +212 -0
- package/snippets/buttons.html +287 -0
- package/snippets/cards.html +393 -0
- package/snippets/checkbox-lists.html +490 -0
- package/snippets/code.html +225 -0
- package/snippets/command-palette.html +210 -0
- package/snippets/comparison.html +428 -0
- package/snippets/customization.html +142 -0
- package/snippets/forms.html +477 -0
- package/snippets/grid.html +338 -0
- package/snippets/layout.html +598 -0
- package/snippets/lists.html +232 -0
- package/snippets/loaders.html +183 -0
- package/snippets/manifest.json +388 -0
- package/snippets/modal-dialogs.html +411 -0
- package/snippets/modals.html +310 -0
- package/snippets/popconfirm.html +253 -0
- package/snippets/profile.html +264 -0
- package/snippets/tables.html +317 -0
- package/snippets/tabs.html +930 -0
- package/snippets/timeline.html +364 -0
- package/snippets/toasts.html +154 -0
- package/snippets/tooltips.html +411 -0
- package/snippets/typography.html +101 -0
- package/snippets/utilities.html +595 -0
- package/snippets/virtual-scroll.html +322 -0
- package/snippets/web-daterangepicker.html +634 -0
- package/snippets/web-multiselect.html +362 -0
- package/src/scss/.claude/settings.local.json +11 -0
- package/src/scss/_base-css-variables.scss +348 -0
- package/src/scss/_core.scss +99 -0
- package/src/scss/_fonts.scss +67 -0
- package/src/scss/_purecss-grid-responsive.scss +138 -0
- package/src/scss/_purecss-grid.scss +58 -0
- package/src/scss/_variables.scss +14 -0
- package/src/scss/core-components/_alerts.scss +212 -0
- package/src/scss/core-components/_badges.scss +16 -0
- package/src/scss/core-components/_base.scss +124 -0
- package/src/scss/core-components/_buttons.scss +473 -0
- package/src/scss/core-components/_cards.scss +285 -0
- package/src/scss/core-components/_checkbox-lists.scss +289 -0
- package/src/scss/core-components/_code.scss +141 -0
- package/src/scss/core-components/_command-palette.scss +518 -0
- package/src/scss/core-components/_comparison.scss +172 -0
- package/src/scss/core-components/_file-selector.scss +780 -0
- package/src/scss/core-components/_forms.scss +16 -0
- package/src/scss/core-components/_grid.scss +264 -0
- package/src/scss/core-components/_layout.scss +15 -0
- package/src/scss/core-components/_lists.scss +211 -0
- package/src/scss/core-components/_loaders.scss +277 -0
- package/src/scss/core-components/_logic-tree.scss +280 -0
- package/src/scss/core-components/_modals.scss +209 -0
- package/src/scss/core-components/_notifications.scss +253 -0
- package/src/scss/core-components/_pagers.scss +141 -0
- package/src/scss/core-components/_popconfirm.scss +170 -0
- package/src/scss/core-components/_profile.scss +281 -0
- package/src/scss/core-components/_settings-panel.scss +128 -0
- package/src/scss/core-components/_statistics.scss +200 -0
- package/src/scss/core-components/_tables.scss +555 -0
- package/src/scss/core-components/_tabs.scss +438 -0
- package/src/scss/core-components/_timeline.scss +589 -0
- package/src/scss/core-components/_toasts.scss +281 -0
- package/src/scss/core-components/_tooltips.scss +503 -0
- package/src/scss/core-components/_utilities.scss +241 -0
- package/src/scss/core-components/_web-components-theme.scss +294 -0
- package/src/scss/core-components/badges/_badge-base.scss +131 -0
- package/src/scss/core-components/badges/_badge-group.scss +25 -0
- package/src/scss/core-components/badges/_composite-badge-variants.scss +396 -0
- package/src/scss/core-components/badges/_composite-badge.scss +70 -0
- package/src/scss/core-components/badges/_index.scss +10 -0
- package/src/scss/core-components/badges/_labels.scss +155 -0
- package/src/scss/core-components/forms/_checkboxes-radios.scss +205 -0
- package/src/scss/core-components/forms/_form-inputs.scss +100 -0
- package/src/scss/core-components/forms/_form-layout.scss +66 -0
- package/src/scss/core-components/forms/_form-states.scss +89 -0
- package/src/scss/core-components/forms/_index.scss +12 -0
- package/src/scss/core-components/forms/_input-groups.scss +149 -0
- package/src/scss/core-components/forms/_input-wrapper.scss +89 -0
- package/src/scss/core-components/forms/_query-editor.scss +313 -0
- package/src/scss/core-components/layout/_index.scss +11 -0
- package/src/scss/core-components/layout/_layout-container.scss +105 -0
- package/src/scss/core-components/layout/_layout-responsive.scss +100 -0
- package/src/scss/core-components/layout/_navbar-elements.scss +238 -0
- package/src/scss/core-components/layout/_navbar.scss +71 -0
- package/src/scss/core-components/layout/_sidebar-states.scss +228 -0
- package/src/scss/core-components/layout/_sidebar.scss +177 -0
- package/src/scss/main.scss +7 -0
- package/src/scss/themes/_dark-base.scss +207 -0
- package/src/scss/themes/audi-light.scss +311 -0
- package/src/scss/themes/audi.scss +288 -0
- package/src/scss/themes/corporate.scss +203 -0
- package/src/scss/themes/dark-blue.scss +152 -0
- package/src/scss/themes/dark-green.scss +156 -0
- package/src/scss/themes/dark-red.scss +160 -0
- package/src/scss/themes/dark.scss +145 -0
- package/src/scss/themes/express.scss +281 -0
- package/src/scss/themes/minimal.scss +121 -0
- package/src/scss/utilities.scss +481 -0
- package/src/scss/variables/_base.scss +81 -0
- package/src/scss/variables/_colors.scss +148 -0
- package/src/scss/variables/_components.scss +509 -0
- package/src/scss/variables/_index.scss +13 -0
- package/src/scss/variables/_layout.scss +65 -0
- package/src/scss/variables/_spacing.scss +66 -0
- package/src/scss/variables/_system.scss +80 -0
- package/src/scss/variables/_typography.scss +37 -0
|
@@ -0,0 +1,634 @@
|
|
|
1
|
+
<!-- Web Date Range Picker Component
|
|
2
|
+
Advanced date picker web component from @keenmate/web-daterangepicker
|
|
3
|
+
Framework-agnostic, TypeScript-based web component with excellent features
|
|
4
|
+
Repository: https://github.com/keenmate/web-daterangepicker
|
|
5
|
+
Package: npm install @keenmate/web-daterangepicker
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
<!-- ========================================
|
|
9
|
+
BASIC USAGE
|
|
10
|
+
======================================== -->
|
|
11
|
+
|
|
12
|
+
<!-- Single Date Selection -->
|
|
13
|
+
<web-daterangepicker
|
|
14
|
+
selection-mode="single"
|
|
15
|
+
placeholder="Select a date"
|
|
16
|
+
date-format-mask="YYYY-MM-DD">
|
|
17
|
+
</web-daterangepicker>
|
|
18
|
+
|
|
19
|
+
<!-- Date Range Selection -->
|
|
20
|
+
<web-daterangepicker
|
|
21
|
+
selection-mode="range"
|
|
22
|
+
visible-months-count="2"
|
|
23
|
+
placeholder="Select date range"
|
|
24
|
+
date-format-mask="YYYY-MM-DD">
|
|
25
|
+
</web-daterangepicker>
|
|
26
|
+
|
|
27
|
+
<!-- Multiple Dates/Ranges Selection -->
|
|
28
|
+
<web-daterangepicker
|
|
29
|
+
selection-mode="multiple"
|
|
30
|
+
placeholder="Select multiple dates"
|
|
31
|
+
date-format-mask="YYYY-MM-DD">
|
|
32
|
+
</web-daterangepicker>
|
|
33
|
+
|
|
34
|
+
<!-- ========================================
|
|
35
|
+
DATE FORMAT OPTIONS
|
|
36
|
+
======================================== -->
|
|
37
|
+
|
|
38
|
+
<!-- ISO Format (YYYY-MM-DD) -->
|
|
39
|
+
<web-daterangepicker
|
|
40
|
+
selection-mode="single"
|
|
41
|
+
date-format-mask="YYYY-MM-DD"
|
|
42
|
+
placeholder="2025-01-15">
|
|
43
|
+
</web-daterangepicker>
|
|
44
|
+
|
|
45
|
+
<!-- European Format (DD.MM.YYYY) -->
|
|
46
|
+
<web-daterangepicker
|
|
47
|
+
selection-mode="single"
|
|
48
|
+
date-format-mask="DD.MM.YYYY"
|
|
49
|
+
placeholder="15.01.2025">
|
|
50
|
+
</web-daterangepicker>
|
|
51
|
+
|
|
52
|
+
<!-- US Format (MM/DD/YYYY) -->
|
|
53
|
+
<web-daterangepicker
|
|
54
|
+
selection-mode="single"
|
|
55
|
+
date-format-mask="MM/DD/YYYY"
|
|
56
|
+
placeholder="01/15/2025">
|
|
57
|
+
</web-daterangepicker>
|
|
58
|
+
|
|
59
|
+
<!-- UK Format (DD/MM/YYYY) -->
|
|
60
|
+
<web-daterangepicker
|
|
61
|
+
selection-mode="single"
|
|
62
|
+
date-format-mask="DD/MM/YYYY"
|
|
63
|
+
placeholder="15/01/2025">
|
|
64
|
+
</web-daterangepicker>
|
|
65
|
+
|
|
66
|
+
<!-- ========================================
|
|
67
|
+
DATE RESTRICTIONS
|
|
68
|
+
======================================== -->
|
|
69
|
+
|
|
70
|
+
<!-- Min/Max Dates -->
|
|
71
|
+
<web-daterangepicker
|
|
72
|
+
selection-mode="single"
|
|
73
|
+
min-date="2025-01-01"
|
|
74
|
+
max-date="2025-12-31"
|
|
75
|
+
placeholder="Only 2025 dates"
|
|
76
|
+
date-format-mask="YYYY-MM-DD">
|
|
77
|
+
</web-daterangepicker>
|
|
78
|
+
|
|
79
|
+
<!-- Disable Weekends -->
|
|
80
|
+
<web-daterangepicker
|
|
81
|
+
selection-mode="single"
|
|
82
|
+
disabled-weekdays="0,6"
|
|
83
|
+
placeholder="Weekdays only"
|
|
84
|
+
date-format-mask="YYYY-MM-DD">
|
|
85
|
+
</web-daterangepicker>
|
|
86
|
+
|
|
87
|
+
<!-- Future Dates Only (via JavaScript) -->
|
|
88
|
+
<web-daterangepicker
|
|
89
|
+
id="future-only"
|
|
90
|
+
selection-mode="single"
|
|
91
|
+
placeholder="Future dates only"
|
|
92
|
+
date-format-mask="YYYY-MM-DD">
|
|
93
|
+
</web-daterangepicker>
|
|
94
|
+
|
|
95
|
+
<script>
|
|
96
|
+
const futureOnly = document.getElementById('future-only');
|
|
97
|
+
const today = new Date().toISOString().split('T')[0];
|
|
98
|
+
futureOnly.setAttribute('min-date', today);
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<!-- Past Dates Only (via JavaScript) -->
|
|
102
|
+
<web-daterangepicker
|
|
103
|
+
id="past-only"
|
|
104
|
+
selection-mode="single"
|
|
105
|
+
placeholder="Past dates only"
|
|
106
|
+
date-format-mask="YYYY-MM-DD">
|
|
107
|
+
</web-daterangepicker>
|
|
108
|
+
|
|
109
|
+
<script>
|
|
110
|
+
const pastOnly = document.getElementById('past-only');
|
|
111
|
+
const yesterday = new Date();
|
|
112
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
113
|
+
pastOnly.setAttribute('max-date', yesterday.toISOString().split('T')[0]);
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<!-- ========================================
|
|
117
|
+
ACTION BUTTONS
|
|
118
|
+
======================================== -->
|
|
119
|
+
|
|
120
|
+
<!-- Today Button -->
|
|
121
|
+
<web-daterangepicker
|
|
122
|
+
selection-mode="single"
|
|
123
|
+
show-today-button="true"
|
|
124
|
+
placeholder="Select date"
|
|
125
|
+
date-format-mask="YYYY-MM-DD">
|
|
126
|
+
</web-daterangepicker>
|
|
127
|
+
|
|
128
|
+
<!-- Clear Button -->
|
|
129
|
+
<web-daterangepicker
|
|
130
|
+
selection-mode="single"
|
|
131
|
+
show-clear-button="true"
|
|
132
|
+
placeholder="Select date"
|
|
133
|
+
date-format-mask="YYYY-MM-DD">
|
|
134
|
+
</web-daterangepicker>
|
|
135
|
+
|
|
136
|
+
<!-- Apply Button (for ranges) -->
|
|
137
|
+
<web-daterangepicker
|
|
138
|
+
selection-mode="range"
|
|
139
|
+
visible-months-count="2"
|
|
140
|
+
show-apply-button="true"
|
|
141
|
+
placeholder="Select range"
|
|
142
|
+
date-format-mask="YYYY-MM-DD">
|
|
143
|
+
</web-daterangepicker>
|
|
144
|
+
|
|
145
|
+
<!-- All Buttons -->
|
|
146
|
+
<web-daterangepicker
|
|
147
|
+
selection-mode="range"
|
|
148
|
+
visible-months-count="2"
|
|
149
|
+
show-today-button="true"
|
|
150
|
+
show-clear-button="true"
|
|
151
|
+
show-apply-button="true"
|
|
152
|
+
placeholder="Select range"
|
|
153
|
+
date-format-mask="YYYY-MM-DD">
|
|
154
|
+
</web-daterangepicker>
|
|
155
|
+
|
|
156
|
+
<!-- ========================================
|
|
157
|
+
INLINE MODE (Always Visible)
|
|
158
|
+
======================================== -->
|
|
159
|
+
|
|
160
|
+
<web-daterangepicker
|
|
161
|
+
selection-mode="range"
|
|
162
|
+
visible-months-count="2"
|
|
163
|
+
positioning-mode="inline"
|
|
164
|
+
show-today-button="true"
|
|
165
|
+
show-clear-button="true"
|
|
166
|
+
date-format-mask="YYYY-MM-DD">
|
|
167
|
+
</web-daterangepicker>
|
|
168
|
+
|
|
169
|
+
<!-- ========================================
|
|
170
|
+
CUSTOM RENDERING (Badges & Tooltips)
|
|
171
|
+
======================================== -->
|
|
172
|
+
|
|
173
|
+
<web-daterangepicker
|
|
174
|
+
id="custom-badges"
|
|
175
|
+
selection-mode="single"
|
|
176
|
+
visible-months-count="2"
|
|
177
|
+
placeholder="Dates with events"
|
|
178
|
+
date-format-mask="YYYY-MM-DD">
|
|
179
|
+
</web-daterangepicker>
|
|
180
|
+
|
|
181
|
+
<script>
|
|
182
|
+
const customBadges = document.getElementById('custom-badges');
|
|
183
|
+
|
|
184
|
+
// Add metadata to dates (holidays, events, etc.)
|
|
185
|
+
customBadges.getDateMetadataCallback = (date) => {
|
|
186
|
+
const day = date.getDate();
|
|
187
|
+
const month = date.getMonth();
|
|
188
|
+
|
|
189
|
+
// New Year's Day
|
|
190
|
+
if (month === 0 && day === 1) {
|
|
191
|
+
return {
|
|
192
|
+
badge: 'primary',
|
|
193
|
+
tooltip: 'New Year\'s Day',
|
|
194
|
+
label: 'Holiday'
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Valentine's Day
|
|
199
|
+
if (month === 1 && day === 14) {
|
|
200
|
+
return {
|
|
201
|
+
badge: 'danger',
|
|
202
|
+
tooltip: 'Valentine\'s Day',
|
|
203
|
+
label: 'Holiday'
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Team meetings on Mondays
|
|
208
|
+
if (date.getDay() === 1) {
|
|
209
|
+
return {
|
|
210
|
+
badge: 'warning',
|
|
211
|
+
tooltip: 'Team Meeting at 10 AM',
|
|
212
|
+
label: 'Meeting'
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return null;
|
|
217
|
+
};
|
|
218
|
+
</script>
|
|
219
|
+
|
|
220
|
+
<!-- ========================================
|
|
221
|
+
DISABLED DATES (Advanced)
|
|
222
|
+
======================================== -->
|
|
223
|
+
|
|
224
|
+
<web-daterangepicker
|
|
225
|
+
id="disabled-dates"
|
|
226
|
+
selection-mode="single"
|
|
227
|
+
placeholder="Some dates disabled"
|
|
228
|
+
date-format-mask="YYYY-MM-DD">
|
|
229
|
+
</web-daterangepicker>
|
|
230
|
+
|
|
231
|
+
<script>
|
|
232
|
+
const disabledDates = document.getElementById('disabled-dates');
|
|
233
|
+
|
|
234
|
+
// Disable specific dates via callback
|
|
235
|
+
disabledDates.getDateMetadataCallback = (date) => {
|
|
236
|
+
const day = date.getDate();
|
|
237
|
+
|
|
238
|
+
// Disable all 13th days (superstition example)
|
|
239
|
+
if (day === 13) {
|
|
240
|
+
return { isDisabled: true };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// Disable first week of each month
|
|
244
|
+
if (day >= 1 && day <= 7) {
|
|
245
|
+
return { isDisabled: true };
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return null;
|
|
249
|
+
};
|
|
250
|
+
</script>
|
|
251
|
+
|
|
252
|
+
<!-- ========================================
|
|
253
|
+
RANGE HANDLING MODES
|
|
254
|
+
======================================== -->
|
|
255
|
+
|
|
256
|
+
<!-- Allow Mode (default): Range can include disabled dates -->
|
|
257
|
+
<web-daterangepicker
|
|
258
|
+
selection-mode="range"
|
|
259
|
+
visible-months-count="2"
|
|
260
|
+
disabled-weekdays="0,6"
|
|
261
|
+
placeholder="Range includes weekends"
|
|
262
|
+
date-format-mask="YYYY-MM-DD">
|
|
263
|
+
</web-daterangepicker>
|
|
264
|
+
|
|
265
|
+
<!-- Block Mode: Range stops at disabled dates -->
|
|
266
|
+
<web-daterangepicker
|
|
267
|
+
id="block-mode"
|
|
268
|
+
selection-mode="range"
|
|
269
|
+
visible-months-count="2"
|
|
270
|
+
disabled-weekdays="0,6"
|
|
271
|
+
placeholder="Range stops at weekends"
|
|
272
|
+
date-format-mask="YYYY-MM-DD">
|
|
273
|
+
</web-daterangepicker>
|
|
274
|
+
|
|
275
|
+
<!-- Note: Range handling mode is set via JavaScript property, not attribute -->
|
|
276
|
+
<script>
|
|
277
|
+
const blockMode = document.getElementById('block-mode');
|
|
278
|
+
// blockMode.disabledDatesHandling = 'block'; // Requires access to component API
|
|
279
|
+
</script>
|
|
280
|
+
|
|
281
|
+
<!-- ========================================
|
|
282
|
+
EVENTS & VALIDATION
|
|
283
|
+
======================================== -->
|
|
284
|
+
|
|
285
|
+
<web-daterangepicker
|
|
286
|
+
id="with-events"
|
|
287
|
+
selection-mode="range"
|
|
288
|
+
placeholder="Select range"
|
|
289
|
+
date-format-mask="YYYY-MM-DD">
|
|
290
|
+
</web-daterangepicker>
|
|
291
|
+
|
|
292
|
+
<script>
|
|
293
|
+
const withEvents = document.getElementById('with-events');
|
|
294
|
+
|
|
295
|
+
// Listen for date selection
|
|
296
|
+
withEvents.addEventListener('date-select', (e) => {
|
|
297
|
+
console.log('Date selected:', e.detail);
|
|
298
|
+
|
|
299
|
+
if (e.detail.date) {
|
|
300
|
+
console.log('Single date:', e.detail.date);
|
|
301
|
+
} else if (e.detail.dateRange) {
|
|
302
|
+
console.log('Range:', e.detail.dateRange.start, 'to', e.detail.dateRange.end);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// Change event (alias for date-select)
|
|
307
|
+
withEvents.addEventListener('change', (e) => {
|
|
308
|
+
console.log('Value changed:', withEvents.value);
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// Validation callback (async supported)
|
|
312
|
+
withEvents.beforeDateSelectCallback = async (selection) => {
|
|
313
|
+
// Validate selection before accepting it
|
|
314
|
+
// Return true to accept, false to reject, or modify selection object
|
|
315
|
+
|
|
316
|
+
if (selection.dateRange) {
|
|
317
|
+
const start = new Date(selection.dateRange.start);
|
|
318
|
+
const end = new Date(selection.dateRange.end);
|
|
319
|
+
const days = (end - start) / (1000 * 60 * 60 * 24);
|
|
320
|
+
|
|
321
|
+
// Limit range to 30 days
|
|
322
|
+
if (days > 30) {
|
|
323
|
+
alert('Range cannot exceed 30 days');
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return true;
|
|
329
|
+
};
|
|
330
|
+
</script>
|
|
331
|
+
|
|
332
|
+
<!-- ========================================
|
|
333
|
+
PROGRAMMATIC CONTROL
|
|
334
|
+
======================================== -->
|
|
335
|
+
|
|
336
|
+
<web-daterangepicker
|
|
337
|
+
id="programmatic"
|
|
338
|
+
selection-mode="range"
|
|
339
|
+
visible-months-count="2"
|
|
340
|
+
placeholder="Controlled via JavaScript"
|
|
341
|
+
date-format-mask="YYYY-MM-DD">
|
|
342
|
+
</web-daterangepicker>
|
|
343
|
+
|
|
344
|
+
<script>
|
|
345
|
+
const programmatic = document.getElementById('programmatic');
|
|
346
|
+
|
|
347
|
+
// Set value programmatically
|
|
348
|
+
programmatic.value = '2025-01-01 - 2025-01-31';
|
|
349
|
+
|
|
350
|
+
// Get current value
|
|
351
|
+
console.log('Current value:', programmatic.value);
|
|
352
|
+
|
|
353
|
+
// Clear selection
|
|
354
|
+
programmatic.value = '';
|
|
355
|
+
|
|
356
|
+
// Listen for changes
|
|
357
|
+
programmatic.addEventListener('change', (e) => {
|
|
358
|
+
console.log('New value:', programmatic.value);
|
|
359
|
+
});
|
|
360
|
+
</script>
|
|
361
|
+
|
|
362
|
+
<!-- ========================================
|
|
363
|
+
MULTIPLE MONTHS
|
|
364
|
+
======================================== -->
|
|
365
|
+
|
|
366
|
+
<!-- Show 1 month (default for single mode) -->
|
|
367
|
+
<web-daterangepicker
|
|
368
|
+
selection-mode="single"
|
|
369
|
+
visible-months-count="1"
|
|
370
|
+
placeholder="1 month view"
|
|
371
|
+
date-format-mask="YYYY-MM-DD">
|
|
372
|
+
</web-daterangepicker>
|
|
373
|
+
|
|
374
|
+
<!-- Show 2 months (default for range mode) -->
|
|
375
|
+
<web-daterangepicker
|
|
376
|
+
selection-mode="range"
|
|
377
|
+
visible-months-count="2"
|
|
378
|
+
placeholder="2 months view"
|
|
379
|
+
date-format-mask="YYYY-MM-DD">
|
|
380
|
+
</web-daterangepicker>
|
|
381
|
+
|
|
382
|
+
<!-- Show 3 months -->
|
|
383
|
+
<web-daterangepicker
|
|
384
|
+
selection-mode="range"
|
|
385
|
+
visible-months-count="3"
|
|
386
|
+
placeholder="3 months view"
|
|
387
|
+
date-format-mask="YYYY-MM-DD">
|
|
388
|
+
</web-daterangepicker>
|
|
389
|
+
|
|
390
|
+
<!-- ========================================
|
|
391
|
+
LOCALIZATION
|
|
392
|
+
======================================== -->
|
|
393
|
+
|
|
394
|
+
<!-- English (default) -->
|
|
395
|
+
<web-daterangepicker
|
|
396
|
+
selection-mode="single"
|
|
397
|
+
locale="en"
|
|
398
|
+
placeholder="Select date"
|
|
399
|
+
date-format-mask="YYYY-MM-DD">
|
|
400
|
+
</web-daterangepicker>
|
|
401
|
+
|
|
402
|
+
<!-- German -->
|
|
403
|
+
<web-daterangepicker
|
|
404
|
+
selection-mode="single"
|
|
405
|
+
locale="de"
|
|
406
|
+
placeholder="Datum auswählen"
|
|
407
|
+
date-format-mask="DD.MM.YYYY">
|
|
408
|
+
</web-daterangepicker>
|
|
409
|
+
|
|
410
|
+
<!-- French -->
|
|
411
|
+
<web-daterangepicker
|
|
412
|
+
selection-mode="single"
|
|
413
|
+
locale="fr"
|
|
414
|
+
placeholder="Sélectionner une date"
|
|
415
|
+
date-format-mask="DD/MM/YYYY">
|
|
416
|
+
</web-daterangepicker>
|
|
417
|
+
|
|
418
|
+
<!-- ========================================
|
|
419
|
+
AUTO-CLOSE BEHAVIOR
|
|
420
|
+
======================================== -->
|
|
421
|
+
|
|
422
|
+
<!-- Auto-close on single date selection -->
|
|
423
|
+
<web-daterangepicker
|
|
424
|
+
selection-mode="single"
|
|
425
|
+
auto-close="on-select"
|
|
426
|
+
placeholder="Closes after selection"
|
|
427
|
+
date-format-mask="YYYY-MM-DD">
|
|
428
|
+
</web-daterangepicker>
|
|
429
|
+
|
|
430
|
+
<!-- Auto-close on range completion -->
|
|
431
|
+
<web-daterangepicker
|
|
432
|
+
selection-mode="range"
|
|
433
|
+
auto-close="on-select"
|
|
434
|
+
placeholder="Closes after range selected"
|
|
435
|
+
date-format-mask="YYYY-MM-DD">
|
|
436
|
+
</web-daterangepicker>
|
|
437
|
+
|
|
438
|
+
<!-- Manual close only (use Apply button) -->
|
|
439
|
+
<web-daterangepicker
|
|
440
|
+
selection-mode="range"
|
|
441
|
+
show-apply-button="true"
|
|
442
|
+
placeholder="Requires Apply button"
|
|
443
|
+
date-format-mask="YYYY-MM-DD">
|
|
444
|
+
</web-daterangepicker>
|
|
445
|
+
|
|
446
|
+
<!-- ========================================
|
|
447
|
+
AVAILABLE ATTRIBUTES
|
|
448
|
+
======================================== -->
|
|
449
|
+
|
|
450
|
+
<!--
|
|
451
|
+
Core Attributes:
|
|
452
|
+
- selection-mode: "single" | "range" | "multiple"
|
|
453
|
+
- visible-months-count: Number of months to display (1-3)
|
|
454
|
+
- placeholder: Input placeholder text
|
|
455
|
+
- date-format-mask: Date format (YYYY-MM-DD, DD.MM.YYYY, MM/DD/YYYY, DD/MM/YYYY)
|
|
456
|
+
- positioning-mode: "floating" (default) | "inline"
|
|
457
|
+
- calendar-placement: Floating UI placement (bottom-start, bottom-end, etc.)
|
|
458
|
+
- locale: Locale code (en, de, fr, es, etc.)
|
|
459
|
+
- disabled: Disable the component
|
|
460
|
+
|
|
461
|
+
Date Restrictions:
|
|
462
|
+
- min-date: Minimum selectable date (YYYY-MM-DD)
|
|
463
|
+
- max-date: Maximum selectable date (YYYY-MM-DD)
|
|
464
|
+
- disabled-weekdays: Comma-separated day numbers (0=Sunday, 6=Saturday)
|
|
465
|
+
|
|
466
|
+
Action Buttons:
|
|
467
|
+
- show-today-button: "true" | "false" (default)
|
|
468
|
+
- show-clear-button: "true" | "false" (default)
|
|
469
|
+
- show-apply-button: "true" | "false" (default)
|
|
470
|
+
|
|
471
|
+
Behavior:
|
|
472
|
+
- auto-close: "on-select" | "manual" (default)
|
|
473
|
+
-->
|
|
474
|
+
|
|
475
|
+
<!-- ========================================
|
|
476
|
+
CSS THEMING (40+ Variables)
|
|
477
|
+
======================================== -->
|
|
478
|
+
|
|
479
|
+
<style>
|
|
480
|
+
/* Override CSS custom properties to match your theme */
|
|
481
|
+
:root {
|
|
482
|
+
/* Colors */
|
|
483
|
+
--drp-accent-color: #007bff;
|
|
484
|
+
--drp-primary-bg: #007bff;
|
|
485
|
+
--drp-text-primary: #2c3e50;
|
|
486
|
+
--drp-text-secondary: #6c757d;
|
|
487
|
+
--drp-border-color: #e1e5e9;
|
|
488
|
+
--drp-card-bg: #ffffff;
|
|
489
|
+
--drp-hover-bg: #f8f9fa;
|
|
490
|
+
|
|
491
|
+
/* Calendar */
|
|
492
|
+
--drp-calendar-bg: #ffffff;
|
|
493
|
+
--drp-calendar-shadow: 0 0 60px rgba(0, 0, 0, 0.12);
|
|
494
|
+
--drp-calendar-border-radius: 4px;
|
|
495
|
+
--drp-calendar-padding: 1rem;
|
|
496
|
+
|
|
497
|
+
/* Days */
|
|
498
|
+
--drp-day-size: 2.25rem;
|
|
499
|
+
--drp-day-font-size: 0.875rem;
|
|
500
|
+
--drp-day-border-radius: 2px;
|
|
501
|
+
--drp-day-hover-bg: rgba(0, 123, 255, 0.1);
|
|
502
|
+
--drp-day-selected-bg: #007bff;
|
|
503
|
+
--drp-day-selected-text: #ffffff;
|
|
504
|
+
--drp-day-range-bg: rgba(0, 123, 255, 0.05);
|
|
505
|
+
--drp-day-today-border: #007bff;
|
|
506
|
+
--drp-day-disabled-opacity: 0.65;
|
|
507
|
+
|
|
508
|
+
/* Weekday Header */
|
|
509
|
+
--drp-weekday-font-size: 0.75rem;
|
|
510
|
+
--drp-weekday-font-weight: 600;
|
|
511
|
+
--drp-weekday-text: #6c757d;
|
|
512
|
+
|
|
513
|
+
/* Badges */
|
|
514
|
+
--drp-badge-primary: #007bff;
|
|
515
|
+
--drp-badge-success: #28a745;
|
|
516
|
+
--drp-badge-warning: #ffc107;
|
|
517
|
+
--drp-badge-danger: #dc3545;
|
|
518
|
+
--drp-badge-info: #17a2b8;
|
|
519
|
+
|
|
520
|
+
/* Input */
|
|
521
|
+
--drp-input-bg: #ffffff;
|
|
522
|
+
--drp-input-border: #ced4da;
|
|
523
|
+
--drp-input-padding-v: 0.5rem;
|
|
524
|
+
--drp-input-padding-h: 0.75rem;
|
|
525
|
+
--drp-input-font-size: 0.875rem;
|
|
526
|
+
--drp-input-border-radius: 4px;
|
|
527
|
+
--drp-input-focus-border: #007bff;
|
|
528
|
+
|
|
529
|
+
/* Action Buttons */
|
|
530
|
+
--drp-action-btn-primary-bg: #007bff;
|
|
531
|
+
--drp-action-btn-primary-text: #ffffff;
|
|
532
|
+
|
|
533
|
+
/* Spacing */
|
|
534
|
+
--drp-spacing-sm: 0.5rem;
|
|
535
|
+
--drp-spacing-md: 0.75rem;
|
|
536
|
+
--drp-spacing-base: 1rem;
|
|
537
|
+
|
|
538
|
+
/* Animations */
|
|
539
|
+
--drp-transition-normal: 0.15s;
|
|
540
|
+
--drp-easing-smooth: ease;
|
|
541
|
+
}
|
|
542
|
+
</style>
|
|
543
|
+
|
|
544
|
+
<!-- ========================================
|
|
545
|
+
TYPESCRIPT TYPES
|
|
546
|
+
======================================== -->
|
|
547
|
+
|
|
548
|
+
<!--
|
|
549
|
+
TypeScript usage:
|
|
550
|
+
|
|
551
|
+
import '@keenmate/web-daterangepicker';
|
|
552
|
+
import type { DateRangePickerElement } from '@keenmate/web-daterangepicker';
|
|
553
|
+
|
|
554
|
+
const picker = document.querySelector<DateRangePickerElement>('web-daterangepicker');
|
|
555
|
+
|
|
556
|
+
if (picker) {
|
|
557
|
+
// Type-safe API
|
|
558
|
+
picker.addEventListener('date-select', (e: CustomEvent<{
|
|
559
|
+
date?: string;
|
|
560
|
+
dateRange?: { start: string; end: string };
|
|
561
|
+
}>) => {
|
|
562
|
+
console.log(e.detail);
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// Validation callback
|
|
566
|
+
picker.beforeDateSelectCallback = async (selection) => {
|
|
567
|
+
return true; // or false to reject
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// Custom rendering
|
|
571
|
+
picker.getDateMetadataCallback = (date: Date) => {
|
|
572
|
+
return {
|
|
573
|
+
badge: 'primary',
|
|
574
|
+
tooltip: 'Event',
|
|
575
|
+
isDisabled: false
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
-->
|
|
580
|
+
|
|
581
|
+
<!-- ========================================
|
|
582
|
+
KEY FEATURES
|
|
583
|
+
======================================== -->
|
|
584
|
+
|
|
585
|
+
<!--
|
|
586
|
+
✅ Selection Modes: Single, range, and multiple date/range selection
|
|
587
|
+
✅ Keyboard Navigation: Full arrow key support with shortcuts (Ctrl+arrows, PageUp/Down, Home/End, Tab, T for today)
|
|
588
|
+
✅ Date Restrictions: Min/max dates, disabled weekdays, custom disabled dates
|
|
589
|
+
✅ Rolling Selector: Innovative month/year picker for quick navigation
|
|
590
|
+
✅ Custom Rendering: Badges, tooltips, and custom content for dates
|
|
591
|
+
✅ Validation: Async beforeDateSelectCallback for validation
|
|
592
|
+
✅ Action Buttons: Today, Clear, Apply buttons with customization
|
|
593
|
+
✅ Range Handling: 5 modes (allow, block, split, individual, prevent) for disabled dates
|
|
594
|
+
✅ Input Masking: Auto-format dates as user types
|
|
595
|
+
✅ Localization: Support for multiple languages and date formats
|
|
596
|
+
✅ Inline Mode: Display calendar directly on page instead of dropdown
|
|
597
|
+
✅ Framework Agnostic: Works with any framework or vanilla JS
|
|
598
|
+
✅ TypeScript: Full type definitions included
|
|
599
|
+
✅ Accessible: Keyboard-friendly with proper focus management
|
|
600
|
+
✅ Customizable: 40+ CSS variables for theming
|
|
601
|
+
✅ Dependencies: Only @floating-ui/dom for smart positioning
|
|
602
|
+
-->
|
|
603
|
+
|
|
604
|
+
<!-- ========================================
|
|
605
|
+
KEYBOARD SHORTCUTS
|
|
606
|
+
======================================== -->
|
|
607
|
+
|
|
608
|
+
<!--
|
|
609
|
+
Navigation:
|
|
610
|
+
- ↑↓: Navigate by day (up/down)
|
|
611
|
+
- ←→: Navigate by week (left/right)
|
|
612
|
+
- Ctrl+←→: Previous/next month
|
|
613
|
+
- PageUp/PageDown: Previous/next month
|
|
614
|
+
- Home/End: First/last day of month
|
|
615
|
+
- Ctrl+Home/End: First/last day of year
|
|
616
|
+
- Tab: Switch between month columns (multi-month view)
|
|
617
|
+
- T: Jump to today
|
|
618
|
+
|
|
619
|
+
Actions:
|
|
620
|
+
- Enter: Select focused day
|
|
621
|
+
- Esc: Close calendar
|
|
622
|
+
- Space: Toggle selection (in multiple mode)
|
|
623
|
+
-->
|
|
624
|
+
|
|
625
|
+
<!-- ========================================
|
|
626
|
+
RESOURCES
|
|
627
|
+
======================================== -->
|
|
628
|
+
|
|
629
|
+
<!--
|
|
630
|
+
npm Package: @keenmate/web-daterangepicker
|
|
631
|
+
Repository: https://github.com/keenmate/web-daterangepicker
|
|
632
|
+
Documentation: See package README and ../../web-daterangepicker/ai/ for AI instructions
|
|
633
|
+
Pure Admin Integration: src/scss/core-components/_web-components-theme.scss
|
|
634
|
+
-->
|