@sb1/ffe-datepicker 13.0.15 → 13.1.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 +8 -0
- package/css/datepicker.css +289 -0
- package/less/calendar.less +2 -0
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -24,6 +24,14 @@ You need styles for both the dateinput field and the calendar.
|
|
|
24
24
|
@import 'node_modules/@sb1/ffe-form/less/form.less';
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
### Importing compiled CSS
|
|
28
|
+
|
|
29
|
+
If your project does not use Less, you can import the compiled styling:
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import '~@sb1/ffe-datepicker/css/datepicker.css';
|
|
33
|
+
```
|
|
34
|
+
|
|
27
35
|
Example HTML stucture with classes. (Aria-tags and other attributes have been removed for clarity)
|
|
28
36
|
|
|
29
37
|
```html
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
:host {
|
|
3
|
+
--ffe-v-datepicker-bg-color: var(--ffe-farge-hvit);
|
|
4
|
+
--ffe-v-datepicker-border-hover-color: var(--ffe-g-primary-color);
|
|
5
|
+
--ffe-v-datepicker-icon-color: var(--ffe-g-primary-color);
|
|
6
|
+
--ffe-v-datepicker-icon-color-hover: var(--ffe-g-secondary-color);
|
|
7
|
+
--ffe-v-datepicker-title-color: var(--ffe-farge-svart);
|
|
8
|
+
--ffe-v-datepicker-weekday-color: var(--ffe-farge-moerkgraa);
|
|
9
|
+
--ffe-v-datepicker-weekday-border-color: var(--ffe-farge-lysgraa);
|
|
10
|
+
--ffe-v-datepicker-date-color: var(--ffe-g-text-color);
|
|
11
|
+
--ffe-v-datepicker-date-color-today: var(--ffe-farge-varmgraa);
|
|
12
|
+
--ffe-v-datepicker-date-color-hover: var(--ffe-farge-vann);
|
|
13
|
+
--ffe-v-datepicker-date-color-focus: var(--ffe-farge-vann);
|
|
14
|
+
--ffe-v-datepicker-date-color-disabled: var(--ffe-farge-varmgraa);
|
|
15
|
+
}
|
|
16
|
+
@media (prefers-color-scheme: dark) {
|
|
17
|
+
:root .regard-color-scheme-preference,
|
|
18
|
+
:host .regard-color-scheme-preference {
|
|
19
|
+
--ffe-v-datepicker-bg-color: var(--ffe-farge-svart);
|
|
20
|
+
--ffe-v-datepicker-border-hover-color: var(--ffe-g-primary-color);
|
|
21
|
+
--ffe-v-datepicker-icon-color: var(--ffe-g-primary-color);
|
|
22
|
+
--ffe-v-datepicker-icon-color-hover: var(--ffe-farge-vann-30);
|
|
23
|
+
--ffe-v-datepicker-title-color: var(--ffe-farge-vann-70);
|
|
24
|
+
--ffe-v-datepicker-weekday-color: var(--ffe-farge-graa);
|
|
25
|
+
--ffe-v-datepicker-weekday-border-color: var(--ffe-farge-varmgraa);
|
|
26
|
+
--ffe-v-datepicker-date-color: var(--ffe-farge-hvit);
|
|
27
|
+
--ffe-v-datepicker-date-color-today: var(--ffe-farge-graa);
|
|
28
|
+
--ffe-v-datepicker-date-color-hover: var(--ffe-farge-vann-70);
|
|
29
|
+
--ffe-v-datepicker-date-color-focus: var(--ffe-farge-vann-70);
|
|
30
|
+
--ffe-v-datepicker-date-color-disabled: var(--ffe-farge-graa);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
.ffe-dateinput {
|
|
34
|
+
position: relative;
|
|
35
|
+
display: inline-block;
|
|
36
|
+
}
|
|
37
|
+
.ffe-dateinput--full-width {
|
|
38
|
+
display: block;
|
|
39
|
+
}
|
|
40
|
+
@media (hover: hover) and (pointer: fine) {
|
|
41
|
+
.ffe-dateinput:hover {
|
|
42
|
+
color: var(--ffe-g-primary-color);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.ffe-dateinput__field {
|
|
46
|
+
min-width: 160px;
|
|
47
|
+
grid-column: 1 / 3;
|
|
48
|
+
grid-row: 1 / -1;
|
|
49
|
+
}
|
|
50
|
+
.ffe-dateinput__field::-ms-clear {
|
|
51
|
+
display: none;
|
|
52
|
+
}
|
|
53
|
+
.ffe-dateinput__field[aria-invalid='true'] {
|
|
54
|
+
border-color: var(--ffe-g-error-color);
|
|
55
|
+
border-style: solid;
|
|
56
|
+
}
|
|
57
|
+
@media (hover: hover) and (pointer: fine) {
|
|
58
|
+
.ffe-dateinput__field {
|
|
59
|
+
/* stylelint-disable selector-max-specificity */
|
|
60
|
+
/* stylelint-enable selector-max-specificity */
|
|
61
|
+
}
|
|
62
|
+
.ffe-dateinput__field:focus + .ffe-datepicker__button:hover {
|
|
63
|
+
border-color: transparent;
|
|
64
|
+
-webkit-box-shadow: 0 0 0 2px var(--ffe-v-datepicker-border-hover-color);
|
|
65
|
+
box-shadow: 0 0 0 2px var(--ffe-v-datepicker-border-hover-color);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
.ffe-datepicker {
|
|
69
|
+
display: inline-block;
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
.ffe-datepicker--full-width {
|
|
73
|
+
display: block;
|
|
74
|
+
}
|
|
75
|
+
.ffe-datepicker--wrapper {
|
|
76
|
+
display: grid;
|
|
77
|
+
grid-template-columns: 1fr auto;
|
|
78
|
+
}
|
|
79
|
+
.ffe-datepicker__button {
|
|
80
|
+
background-color: transparent;
|
|
81
|
+
border: 2px solid transparent;
|
|
82
|
+
grid-column: 2 / 3;
|
|
83
|
+
grid-row: 1 / -1;
|
|
84
|
+
outline: none;
|
|
85
|
+
border-top-right-radius: 4px;
|
|
86
|
+
border-bottom-right-radius: 4px;
|
|
87
|
+
-webkit-transition: all var(--ffe-transition-duration) var(--ffe-ease);
|
|
88
|
+
-o-transition: all var(--ffe-transition-duration) var(--ffe-ease);
|
|
89
|
+
transition: all var(--ffe-transition-duration) var(--ffe-ease);
|
|
90
|
+
width: 56px;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
.ffe-datepicker__button:focus,
|
|
94
|
+
.ffe-datepicker__button:active {
|
|
95
|
+
border-color: var(--ffe-v-datepicker-border-hover-color);
|
|
96
|
+
}
|
|
97
|
+
@media (hover: hover) and (pointer: fine) {
|
|
98
|
+
.ffe-datepicker__button:hover {
|
|
99
|
+
border-color: var(--ffe-v-datepicker-border-hover-color);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
.ffe-datepicker__icon.ffe-icons {
|
|
103
|
+
vertical-align: middle;
|
|
104
|
+
color: var(--ffe-v-datepicker-icon-color);
|
|
105
|
+
-webkit-transition: color var(--ffe-transition-duration) var(--ffe-ease);
|
|
106
|
+
-o-transition: color var(--ffe-transition-duration) var(--ffe-ease);
|
|
107
|
+
transition: color var(--ffe-transition-duration) var(--ffe-ease);
|
|
108
|
+
}
|
|
109
|
+
@media (hover: hover) and (pointer: fine) {
|
|
110
|
+
.ffe-datepicker__icon.ffe-icons:hover {
|
|
111
|
+
color: var(--ffe-v-datepicker-icon-color-hover);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.ffe-calendar {
|
|
115
|
+
border: solid 2px var(--ffe-g-border-color);
|
|
116
|
+
border-radius: var(--ffe-g-border-radius);
|
|
117
|
+
padding: var(--ffe-spacing-2xs);
|
|
118
|
+
background: var(--ffe-v-datepicker-bg-color);
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
}
|
|
121
|
+
.ffe-calendar--datepicker {
|
|
122
|
+
position: absolute;
|
|
123
|
+
-webkit-transform: translateY(var(--ffe-spacing-xs));
|
|
124
|
+
transform: translateY(var(--ffe-spacing-xs));
|
|
125
|
+
left: 0;
|
|
126
|
+
z-index: 9999;
|
|
127
|
+
width: -webkit-fit-content;
|
|
128
|
+
width: -moz-fit-content;
|
|
129
|
+
width: fit-content;
|
|
130
|
+
}
|
|
131
|
+
.ffe-calendar--datepicker--above {
|
|
132
|
+
top: inherit;
|
|
133
|
+
bottom: 55px;
|
|
134
|
+
min-height: 339px;
|
|
135
|
+
}
|
|
136
|
+
.ffe-calendar__header {
|
|
137
|
+
text-align: center;
|
|
138
|
+
padding: var(--ffe-spacing-sm) var(--ffe-spacing-2xs) var(--ffe-spacing-2xs);
|
|
139
|
+
width: 100%;
|
|
140
|
+
}
|
|
141
|
+
.ffe-calendar__header-inner-wrapper {
|
|
142
|
+
display: -webkit-box;
|
|
143
|
+
display: -ms-flexbox;
|
|
144
|
+
display: flex;
|
|
145
|
+
-webkit-box-pack: center;
|
|
146
|
+
-ms-flex-pack: center;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
-webkit-box-align: center;
|
|
149
|
+
-ms-flex-align: center;
|
|
150
|
+
align-items: center;
|
|
151
|
+
}
|
|
152
|
+
.ffe-calendar__month {
|
|
153
|
+
padding-right: var(--ffe-spacing-xs);
|
|
154
|
+
}
|
|
155
|
+
.ffe-calendar__month-nav {
|
|
156
|
+
border: none;
|
|
157
|
+
background: transparent;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
outline: none;
|
|
160
|
+
border-radius: 4px;
|
|
161
|
+
display: grid;
|
|
162
|
+
place-items: center;
|
|
163
|
+
}
|
|
164
|
+
.ffe-calendar__month-nav:focus,
|
|
165
|
+
.ffe-calendar__month-nav:active {
|
|
166
|
+
-webkit-box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
167
|
+
box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
168
|
+
}
|
|
169
|
+
@media (hover: hover) and (pointer: fine) {
|
|
170
|
+
.ffe-calendar__month-nav:hover {
|
|
171
|
+
-webkit-box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
172
|
+
box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
.ffe-calendar__icon-prev.ffe-icons,
|
|
176
|
+
.ffe-calendar__icon-next.ffe-icons {
|
|
177
|
+
color: var(--ffe-v-datepicker-icon-color);
|
|
178
|
+
}
|
|
179
|
+
.ffe-calendar__icon-next {
|
|
180
|
+
-webkit-transform: rotate(180deg);
|
|
181
|
+
transform: rotate(180deg);
|
|
182
|
+
}
|
|
183
|
+
.ffe-calendar__title {
|
|
184
|
+
font-family: var(--ffe-g-font-heading-small);
|
|
185
|
+
font-size: var(--ffe-fontsize-h5);
|
|
186
|
+
color: var(--ffe-v-datepicker-title-color);
|
|
187
|
+
display: inline-block;
|
|
188
|
+
vertical-align: middle;
|
|
189
|
+
min-width: 50%;
|
|
190
|
+
margin-bottom: 0;
|
|
191
|
+
}
|
|
192
|
+
.ffe-calendar__accessible-text {
|
|
193
|
+
position: absolute !important;
|
|
194
|
+
clip: rect(1px, 1px, 1px, 1px);
|
|
195
|
+
}
|
|
196
|
+
.ffe-calendar__grid {
|
|
197
|
+
width: 100%;
|
|
198
|
+
border-spacing: 0.5em 0;
|
|
199
|
+
}
|
|
200
|
+
.ffe-calendar__grid:focus {
|
|
201
|
+
outline: none;
|
|
202
|
+
-webkit-box-shadow: 0 0 0 2px var(--ffe-v-datepicker-date-color-focus);
|
|
203
|
+
box-shadow: 0 0 0 2px var(--ffe-v-datepicker-date-color-focus);
|
|
204
|
+
border-radius: 4px;
|
|
205
|
+
}
|
|
206
|
+
.ffe-calendar__weekday {
|
|
207
|
+
color: var(--ffe-g-text-color);
|
|
208
|
+
font-family: var(--ffe-g-font);
|
|
209
|
+
font-weight: normal;
|
|
210
|
+
font-variant-numeric: tabular-nums;
|
|
211
|
+
line-height: 1.25rem;
|
|
212
|
+
margin: 0;
|
|
213
|
+
font-size: var(--ffe-fontsize-small-text);
|
|
214
|
+
overflow-wrap: anywhere;
|
|
215
|
+
border-bottom: 1px solid var(--ffe-v-datepicker-weekday-border-color);
|
|
216
|
+
color: var(--ffe-v-datepicker-weekday-color);
|
|
217
|
+
}
|
|
218
|
+
.ffe-calendar__day {
|
|
219
|
+
padding: var(--ffe-spacing-2xs) 0;
|
|
220
|
+
text-align: center;
|
|
221
|
+
outline: none;
|
|
222
|
+
}
|
|
223
|
+
.ffe-calendar__date {
|
|
224
|
+
color: var(--ffe-g-text-color);
|
|
225
|
+
font-family: var(--ffe-g-font);
|
|
226
|
+
font-weight: normal;
|
|
227
|
+
font-variant-numeric: tabular-nums;
|
|
228
|
+
line-height: 1.25rem;
|
|
229
|
+
margin: 0;
|
|
230
|
+
font-size: var(--ffe-fontsize-small-text);
|
|
231
|
+
overflow-wrap: anywhere;
|
|
232
|
+
font-size: 1rem;
|
|
233
|
+
background-color: var(--ffe-v-datepicker-bg-color);
|
|
234
|
+
width: 2.1875rem;
|
|
235
|
+
aspect-ratio: 1;
|
|
236
|
+
color: var(--ffe-v-datepicker-date-color);
|
|
237
|
+
border-radius: 4px;
|
|
238
|
+
display: inline-block;
|
|
239
|
+
line-height: 2.1875;
|
|
240
|
+
border: 2px solid transparent;
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
}
|
|
243
|
+
.ffe-calendar__date--today {
|
|
244
|
+
border: 1px solid var(--ffe-v-datepicker-date-color-today);
|
|
245
|
+
}
|
|
246
|
+
.ffe-calendar__date:focus {
|
|
247
|
+
border: 2px solid var(--ffe-v-datepicker-border-hover-color);
|
|
248
|
+
color: var(--ffe-v-datepicker-date-color-hover);
|
|
249
|
+
outline: none;
|
|
250
|
+
}
|
|
251
|
+
@media (hover: hover) and (pointer: fine) {
|
|
252
|
+
.ffe-calendar__date:hover {
|
|
253
|
+
border: 2px solid var(--ffe-v-datepicker-border-hover-color);
|
|
254
|
+
color: var(--ffe-v-datepicker-date-color-hover);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
.ffe-calendar__date--focus {
|
|
258
|
+
border: 2px solid var(--ffe-v-datepicker-border-hover-color);
|
|
259
|
+
background: var(--ffe-v-datepicker-bg-color);
|
|
260
|
+
}
|
|
261
|
+
.ffe-calendar__date--selected {
|
|
262
|
+
background: var(--ffe-v-datepicker-border-hover-color);
|
|
263
|
+
color: var(--ffe-v-datepicker-bg-color);
|
|
264
|
+
}
|
|
265
|
+
@media (hover: hover) and (pointer: fine) {
|
|
266
|
+
.ffe-calendar__date--selected:hover {
|
|
267
|
+
color: var(--ffe-v-datepicker-bg-color);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
.ffe-calendar__date--focus.ffe-calendar__date--selected {
|
|
271
|
+
-webkit-box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
272
|
+
box-shadow: 0 0 0 2px var(--ffe-v-datepicker-bg-color), 0 0 0 4px var(--ffe-v-datepicker-border-hover-color);
|
|
273
|
+
}
|
|
274
|
+
.ffe-calendar__date--disabled {
|
|
275
|
+
color: var(--ffe-v-datepicker-date-color-disabled);
|
|
276
|
+
}
|
|
277
|
+
.ffe-calendar__date--disabled:focus {
|
|
278
|
+
border: 2px solid var(--ffe-v-datepicker-date-color-disabled);
|
|
279
|
+
color: var(--ffe-v-datepicker-date-color-disabled);
|
|
280
|
+
}
|
|
281
|
+
@media (hover: hover) and (pointer: fine) {
|
|
282
|
+
.ffe-calendar__date--disabled:hover {
|
|
283
|
+
border: 2px solid var(--ffe-v-datepicker-date-color-disabled);
|
|
284
|
+
color: var(--ffe-v-datepicker-date-color-disabled);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
.ffe-calendar__date--disabled-focus {
|
|
288
|
+
border: 2px solid var(--ffe-v-datepicker-date-color-disabled);
|
|
289
|
+
}
|
package/less/calendar.less
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-datepicker",
|
|
3
|
-
"version": "13.0
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "FFE Datepicker",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SpareBank 1",
|
|
7
7
|
"files": [
|
|
8
|
-
"less"
|
|
8
|
+
"less",
|
|
9
|
+
"css"
|
|
9
10
|
],
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
@@ -13,11 +14,12 @@
|
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
16
|
"lint": "ffe-buildtool stylelint less/*.less",
|
|
16
|
-
"test": "npm run lint"
|
|
17
|
+
"test": "npm run lint",
|
|
18
|
+
"build": "lessc less/datepicker.less css/datepicker.css --autoprefix"
|
|
17
19
|
},
|
|
18
20
|
"dependencies": {
|
|
19
|
-
"@sb1/ffe-core": "^29.
|
|
20
|
-
"@sb1/ffe-form": "^30.0
|
|
21
|
+
"@sb1/ffe-core": "^29.2.0",
|
|
22
|
+
"@sb1/ffe-form": "^30.1.0"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
25
|
"@sb1/ffe-buildtool": "^0.9.0"
|
|
@@ -25,5 +27,5 @@
|
|
|
25
27
|
"publishConfig": {
|
|
26
28
|
"access": "public"
|
|
27
29
|
},
|
|
28
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "55ee3d40abaef9433c55aa993889e67c3f5c5abd"
|
|
29
31
|
}
|