intelicoreact 0.0.53 → 0.0.64
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/Atomic/FormElements/DateTime/DateTime.stories.js +1 -1
- package/dist/Atomic/FormElements/Input/Input.js +5 -5
- package/dist/Atomic/FormElements/InputCalendar/InputCalendar.js +4 -4
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +265 -0
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.scss +569 -0
- package/dist/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +243 -0
- package/dist/Atomic/FormElements/InputDateRange/components/Datepicker.js +486 -0
- package/dist/Atomic/FormElements/InputDateRange/components/OpenedPart.js +154 -0
- package/dist/Atomic/FormElements/InputDateRange/components/SelectItem.js +46 -0
- package/dist/Atomic/FormElements/InputDateRange/dependencies.js +249 -0
- package/dist/Atomic/FormElements/Modal/Modal.stories.js +64 -18
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.js +162 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +101 -0
- package/dist/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +81 -0
- package/dist/Atomic/UI/Arrow/Arrow.js +80 -0
- package/dist/Atomic/UI/Arrow/Arrow.scss +19 -0
- package/dist/Atomic/UI/Arrow/Arrow.stories.js +46 -0
- package/dist/Atomic/UI/Button/Button.js +4 -2
- package/dist/Atomic/UI/Button/Button.scss +26 -0
- package/dist/Atomic/UI/Button/Button.stories.js +2 -2
- package/dist/Atomic/{FormElements → UI}/Calendar/Calendar.js +0 -0
- package/dist/Atomic/UI/Calendar/Calendar.scss +544 -0
- package/dist/Atomic/{FormElements → UI}/Calendar/Calendar.stories.js +5 -1
- package/dist/Functions/utils.js +10 -2
- package/package.json +7 -5
- package/src/Atomic/FormElements/DateTime/DateTime.stories.js +1 -1
- package/src/Atomic/FormElements/Input/Input.js +5 -5
- package/src/Atomic/FormElements/InputCalendar/InputCalendar.js +6 -6
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.js +247 -0
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.scss +569 -0
- package/src/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +148 -0
- package/src/Atomic/FormElements/InputDateRange/components/Datepicker.js +406 -0
- package/src/Atomic/FormElements/InputDateRange/components/OpenedPart.js +112 -0
- package/src/Atomic/FormElements/InputDateRange/components/SelectItem.js +24 -0
- package/src/Atomic/FormElements/InputDateRange/dependencies.js +161 -0
- package/src/Atomic/FormElements/Modal/Modal.stories.js +60 -15
- package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.js +143 -0
- package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +101 -0
- package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +54 -0
- package/src/Atomic/UI/Arrow/Arrow.js +41 -0
- package/src/Atomic/UI/Arrow/Arrow.scss +19 -0
- package/src/Atomic/UI/Arrow/Arrow.stories.js +32 -0
- package/src/Atomic/UI/Button/Button.js +3 -3
- package/src/Atomic/UI/Button/Button.scss +26 -0
- package/src/Atomic/UI/Button/Button.stories.js +4 -3
- package/src/Atomic/{FormElements → UI}/Calendar/Calendar.js +0 -0
- package/src/Atomic/UI/Calendar/Calendar.scss +544 -0
- package/src/Atomic/{FormElements → UI}/Calendar/Calendar.stories.js +5 -1
- package/src/Functions/utils.js +6 -0
- package/dist/Atomic/FormElements/Calendar/Calendar.scss +0 -543
- package/src/Atomic/FormElements/Calendar/Calendar.scss +0 -543
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--input-height: 26px;
|
|
3
|
+
--label-line-height: 16px;
|
|
4
|
+
// --border-color: rgba(0, 0, 0, 0.3);
|
|
5
|
+
--border-color: #e2e5ec;
|
|
6
|
+
--calendar-range-point-color: #6b81dd;
|
|
7
|
+
--font-size: 12px;
|
|
8
|
+
--line-height: 20px;
|
|
9
|
+
--border-radius: 4px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.date-range-input {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 430px;
|
|
15
|
+
height: calc(var(--input-height) + var(--label-line-height));
|
|
16
|
+
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-flow: column nowrap;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
|
|
22
|
+
input::-webkit-outer-spin-button,
|
|
23
|
+
input::-webkit-inner-spin-button {
|
|
24
|
+
-webkit-appearance: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__label {
|
|
28
|
+
margin-bottom: 2px;
|
|
29
|
+
font-size: var(--font-size);
|
|
30
|
+
line-height: var(--label-line-height);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__wraper {
|
|
34
|
+
position: relative;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__absolut-wraper {
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: fit-content;
|
|
43
|
+
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 0;
|
|
46
|
+
left: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-flow: column nowrap;
|
|
49
|
+
justify-content: flex-start;
|
|
50
|
+
align-items: flex-start;
|
|
51
|
+
|
|
52
|
+
background: transparent;
|
|
53
|
+
z-index: 1;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
&_right-position {
|
|
57
|
+
left: auto;
|
|
58
|
+
right: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__static-part{
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: var(--input-height);
|
|
67
|
+
border-radius: var(--border-radius);
|
|
68
|
+
|
|
69
|
+
display: flex;
|
|
70
|
+
flex-flow: row nowrap;
|
|
71
|
+
justify-content: flex-end;
|
|
72
|
+
align-items: flex-start;
|
|
73
|
+
|
|
74
|
+
background: #FFFFFF;
|
|
75
|
+
border: 1px solid var(--border-color);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&_focused {
|
|
79
|
+
.date-range-input__static-part {
|
|
80
|
+
border: 1px solid blue;
|
|
81
|
+
filter: drop-shadow(0px 0px 4px rgba(93, 120, 255, 0.5));
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__toggle-button {
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
padding: 0 10px;
|
|
89
|
+
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
flex-flow: row nowrap;
|
|
93
|
+
justify-content: flex-start;
|
|
94
|
+
align-items: center;
|
|
95
|
+
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&__interval-key {
|
|
100
|
+
display: inline-block;
|
|
101
|
+
margin-right: 10px;
|
|
102
|
+
text-transform: capitalize;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
text-align: left;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__range{
|
|
109
|
+
display: inline-block;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
word-wrap: break-word;
|
|
112
|
+
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-flow: row wrap;
|
|
115
|
+
justify-content: flex-start;
|
|
116
|
+
align-items: center;
|
|
117
|
+
|
|
118
|
+
&-text {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
|
|
121
|
+
&:first-of-type {
|
|
122
|
+
margin-right: 5px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&_little {
|
|
126
|
+
font-size: calc(var(--font-size) - 2px);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&__arrows-block{
|
|
132
|
+
box-sizing: border-box;
|
|
133
|
+
width: fit-content;
|
|
134
|
+
height: 100%;
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-flow: row nowrap;
|
|
137
|
+
justify-content: flex-start;
|
|
138
|
+
align-items: center;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&__arrow {
|
|
142
|
+
box-sizing: border-box;
|
|
143
|
+
width: auto;
|
|
144
|
+
height: 100%;
|
|
145
|
+
cursor: pointer;
|
|
146
|
+
|
|
147
|
+
&:active {
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
&__compact {
|
|
152
|
+
.date-range-input__toggle-button {
|
|
153
|
+
padding-right: 18px;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&_hide-arrows {
|
|
158
|
+
.date-range-input__toggle-button {
|
|
159
|
+
padding: 9px 18px 9px 18px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&_error {
|
|
164
|
+
.date-range-input__wraper {
|
|
165
|
+
border-color: #FA564C;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&_disabled {
|
|
170
|
+
.date-range-input__wraper {
|
|
171
|
+
opacity: 0.7;
|
|
172
|
+
pointer-events: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.date-range-input__toggle-button {
|
|
176
|
+
cursor: auto;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
&__error-block {
|
|
181
|
+
position: absolute;
|
|
182
|
+
left: 8px;
|
|
183
|
+
bottom: -20px;
|
|
184
|
+
font-size: var(--font-size);
|
|
185
|
+
line-height: var(--line-height);
|
|
186
|
+
color: #FA564C;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&__opened-part {
|
|
190
|
+
width: fit-content;
|
|
191
|
+
height: fit-content;
|
|
192
|
+
padding-top: 6px;
|
|
193
|
+
background-color: transparent;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.opened-part {
|
|
198
|
+
&__wrapper {
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-flow: row nowrap;
|
|
201
|
+
justify-content: flex-start;
|
|
202
|
+
align-items: stretch;
|
|
203
|
+
border: 1px solid var(--border-color);
|
|
204
|
+
border-radius: var(--border-radius);
|
|
205
|
+
background: #FFFFFF;
|
|
206
|
+
|
|
207
|
+
&_right-position-once-element {
|
|
208
|
+
justify-content: flex-end;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&__intervals-list {
|
|
213
|
+
width: fit-content;
|
|
214
|
+
padding: 6px 0;
|
|
215
|
+
border-right: 1px solid var(--border-color);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&__intervals-item {
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
position: relative;
|
|
221
|
+
|
|
222
|
+
width: 100%;
|
|
223
|
+
padding: 4px 8px 4px 32px;
|
|
224
|
+
|
|
225
|
+
text-transform: capitalize;
|
|
226
|
+
white-space: nowrap;
|
|
227
|
+
font-size: var(--font-size);
|
|
228
|
+
line-height: var(--line-height);
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-flow: row nowrap;
|
|
233
|
+
justify-content: flex-start;
|
|
234
|
+
align-items: center;
|
|
235
|
+
|
|
236
|
+
&:hover {
|
|
237
|
+
background-color: rgba(128, 128, 128, 0.1);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&-icon-active {
|
|
241
|
+
position: absolute;
|
|
242
|
+
left: 10px;
|
|
243
|
+
top: 5px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
&_disabled {
|
|
247
|
+
pointer-events: none;
|
|
248
|
+
color: rgba($color: #000000, $alpha: 0.3);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&__date-picker {
|
|
253
|
+
width: fit-content;
|
|
254
|
+
border: none;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.date-picker {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex-flow: column nowrap;
|
|
261
|
+
justify-content: space-between;
|
|
262
|
+
align-items: flex-start;
|
|
263
|
+
|
|
264
|
+
&__header {
|
|
265
|
+
box-sizing: border-box;
|
|
266
|
+
width: 100%;
|
|
267
|
+
height: fit-content;
|
|
268
|
+
padding: 5px;
|
|
269
|
+
border: none;
|
|
270
|
+
|
|
271
|
+
display: flex;
|
|
272
|
+
flex-flow: column nowrap;
|
|
273
|
+
justify-content: flex-start;
|
|
274
|
+
align-items: flex-start;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
&__inputs-block {
|
|
278
|
+
width: 100%;
|
|
279
|
+
height: fit-content;
|
|
280
|
+
display: flex;
|
|
281
|
+
flex-flow: row nowrap;
|
|
282
|
+
justify-content: flex-start;
|
|
283
|
+
align-items: center;
|
|
284
|
+
font-size: var(--font-size);
|
|
285
|
+
line-height: var(--line-height);
|
|
286
|
+
|
|
287
|
+
&>div:not(.date-picker__inputs-separator) {
|
|
288
|
+
height: 100%;
|
|
289
|
+
margin-right: 9px;
|
|
290
|
+
|
|
291
|
+
border: 1px solid var(--border-color);
|
|
292
|
+
box-sizing: border-box;
|
|
293
|
+
|
|
294
|
+
&:last-child {
|
|
295
|
+
margin-right: 0;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&.input__wrap {
|
|
299
|
+
box-sizing: border-box;
|
|
300
|
+
box-shadow: none;
|
|
301
|
+
border-radius: var(--border-radius);
|
|
302
|
+
|
|
303
|
+
&_focus {
|
|
304
|
+
border: 1px solid blue;
|
|
305
|
+
box-shadow: none;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.date-picker__inputs-separator {
|
|
311
|
+
margin-right: 9px;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&__date-input {
|
|
316
|
+
box-sizing: border-box;
|
|
317
|
+
width: fit-content;
|
|
318
|
+
height: fit-content;
|
|
319
|
+
padding: 3px 10px;
|
|
320
|
+
|
|
321
|
+
font-family: inherit;
|
|
322
|
+
font-style: inherit;
|
|
323
|
+
font-weight: inherit;
|
|
324
|
+
font-size: inherit;
|
|
325
|
+
line-height: inherit;
|
|
326
|
+
letter-spacing: inherit;
|
|
327
|
+
color: inherit;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
&__hour-select-input {
|
|
331
|
+
width: 70px;
|
|
332
|
+
height: fit-content;
|
|
333
|
+
border-radius: var(--border-radius);
|
|
334
|
+
|
|
335
|
+
&>.dropdown__trigger {
|
|
336
|
+
width: 100%;
|
|
337
|
+
height: 100%;
|
|
338
|
+
padding-left: 10px;
|
|
339
|
+
padding-right: 15px;
|
|
340
|
+
|
|
341
|
+
font-family: inherit;
|
|
342
|
+
font-style: inherit;
|
|
343
|
+
font-weight: inherit;
|
|
344
|
+
font-size: inherit;
|
|
345
|
+
line-height: inherit;
|
|
346
|
+
letter-spacing: inherit;
|
|
347
|
+
color: inherit;
|
|
348
|
+
|
|
349
|
+
box-sizing: border-box;
|
|
350
|
+
box-shadow: none;
|
|
351
|
+
border: none;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
& .dropdown__list-item{
|
|
355
|
+
font-family: inherit;
|
|
356
|
+
font-style: inherit;
|
|
357
|
+
font-weight: inherit;
|
|
358
|
+
font-size: inherit;
|
|
359
|
+
line-height: inherit;
|
|
360
|
+
letter-spacing: inherit;
|
|
361
|
+
color: inherit;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// &__previous-period {
|
|
366
|
+
|
|
367
|
+
// }
|
|
368
|
+
|
|
369
|
+
&__calendars {
|
|
370
|
+
box-sizing: border-box;
|
|
371
|
+
width: 100%;
|
|
372
|
+
height: 100%;
|
|
373
|
+
padding: 10px 16px;
|
|
374
|
+
border-top: 1px solid var(--border-color);
|
|
375
|
+
border-bottom: 1px solid var(--border-color);
|
|
376
|
+
background-color: #FFFFFF;
|
|
377
|
+
|
|
378
|
+
display: flex;
|
|
379
|
+
flex-flow: row nowrap;
|
|
380
|
+
justify-content: center;
|
|
381
|
+
align-items: flex-start;
|
|
382
|
+
|
|
383
|
+
&-wrapper {
|
|
384
|
+
width: 100%;
|
|
385
|
+
// width: fit-content;
|
|
386
|
+
display: flex;
|
|
387
|
+
flex-flow: row nowrap;
|
|
388
|
+
justify-content: space-between;
|
|
389
|
+
align-items: flex-start;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.date-picker__calendar {
|
|
393
|
+
&:first-child{
|
|
394
|
+
margin-right: 10px;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.range-calendar {
|
|
399
|
+
box-sizing: border-box;
|
|
400
|
+
width: fit-content;
|
|
401
|
+
height: fit-content;
|
|
402
|
+
|
|
403
|
+
&-header {
|
|
404
|
+
height: fit-content;
|
|
405
|
+
margin-bottom: 12px;
|
|
406
|
+
|
|
407
|
+
font-size: calc(var(--font-size) + 2px);
|
|
408
|
+
line-height: calc(var(--line-height) + 4px);
|
|
409
|
+
|
|
410
|
+
display: flex;
|
|
411
|
+
justify-content: space-between;
|
|
412
|
+
align-items: center;
|
|
413
|
+
|
|
414
|
+
&__title {
|
|
415
|
+
text-align: center;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
&__next, &__prev {
|
|
419
|
+
cursor: pointer;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&__week {
|
|
424
|
+
display: flex;
|
|
425
|
+
|
|
426
|
+
&-title {
|
|
427
|
+
margin-bottom: 5px;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&__day {
|
|
432
|
+
position: relative;
|
|
433
|
+
box-sizing: border-box;
|
|
434
|
+
width: 36px;
|
|
435
|
+
height: 24px;
|
|
436
|
+
margin: 1px 0;
|
|
437
|
+
flex-grow: 1;
|
|
438
|
+
flex-basis: 0;
|
|
439
|
+
user-select: none;
|
|
440
|
+
|
|
441
|
+
display: flex;
|
|
442
|
+
justify-content: center;
|
|
443
|
+
align-items: center;
|
|
444
|
+
|
|
445
|
+
font-size: var(--font-size);
|
|
446
|
+
line-height: var(--line-height);
|
|
447
|
+
text-align: center;
|
|
448
|
+
|
|
449
|
+
&--clickable {
|
|
450
|
+
cursor: pointer;
|
|
451
|
+
|
|
452
|
+
&:hover {
|
|
453
|
+
background: #E2E6F8;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
&--disabled {
|
|
458
|
+
cursor: default;
|
|
459
|
+
opacity: 0.2;
|
|
460
|
+
pointer-events: none;
|
|
461
|
+
|
|
462
|
+
&:hover {
|
|
463
|
+
background: inherit;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
&--range-end {
|
|
468
|
+
background: #EAF2FF;
|
|
469
|
+
border: 1px solid #EAF2FF;
|
|
470
|
+
border-radius: 0 24px 24px 0;
|
|
471
|
+
color: var(--calendar-range-point-color);
|
|
472
|
+
|
|
473
|
+
&::before {
|
|
474
|
+
content: '';
|
|
475
|
+
display: block;
|
|
476
|
+
width: 100%;
|
|
477
|
+
height: 100%;
|
|
478
|
+
box-sizing: border-box;
|
|
479
|
+
position: absolute;
|
|
480
|
+
border: 1px solid var(--calendar-range-point-color);
|
|
481
|
+
border-radius: 24px;
|
|
482
|
+
pointer-events: none;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
&:hover {
|
|
486
|
+
color: #F8FBFF;
|
|
487
|
+
background-color: var(--calendar-range-point-color);
|
|
488
|
+
border-radius: 24px;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
&--range-start {
|
|
493
|
+
background: var(--calendar-range-point-color);
|
|
494
|
+
border: 1px solid var(--calendar-range-point-color);
|
|
495
|
+
box-sizing: border-box;
|
|
496
|
+
border-radius: 24px;
|
|
497
|
+
color: #F8FBFF;
|
|
498
|
+
|
|
499
|
+
&:hover {
|
|
500
|
+
background: var(--calendar-range-point-color);
|
|
501
|
+
color: #F8FBFF;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
&--range-inside {
|
|
506
|
+
background: #EAF2FF;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
&--prev-range-end {
|
|
510
|
+
background: #E2E5EC;
|
|
511
|
+
border-radius: var(--border-radius);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
&--prev-range-inside {
|
|
515
|
+
background: #F7F8FA;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
&--title {
|
|
519
|
+
font-size: calc(var(--font-size) + 2px);
|
|
520
|
+
line-height: calc(var(--line-height) + 4px);
|
|
521
|
+
|
|
522
|
+
&:hover {
|
|
523
|
+
background: inherit;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
&__footer {
|
|
531
|
+
box-sizing: border-box;
|
|
532
|
+
width: 100%;
|
|
533
|
+
padding: 8px 16px;
|
|
534
|
+
border-radius: 0 0 var(--border-radius) 0;
|
|
535
|
+
border: none;
|
|
536
|
+
|
|
537
|
+
display: flex;
|
|
538
|
+
flex-flow: row nowrap;
|
|
539
|
+
justify-content: space-between;
|
|
540
|
+
align-items: center;
|
|
541
|
+
|
|
542
|
+
&_once-element{
|
|
543
|
+
justify-content: flex-end;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
&__buttons-block {
|
|
548
|
+
box-sizing: border-box;
|
|
549
|
+
width: fit-content;
|
|
550
|
+
height: 100%;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
&__button {
|
|
554
|
+
text-transform: capitalize;
|
|
555
|
+
|
|
556
|
+
&:first-child {
|
|
557
|
+
margin-right: 16px;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
&:last-child {
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
&__compare-block {
|
|
565
|
+
box-sizing: border-box;
|
|
566
|
+
width: fit-content;
|
|
567
|
+
height: 100%;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import React, { /*useEffect,*/ useState } from 'react';
|
|
2
|
+
import InputDateRange from './InputDateRange';
|
|
3
|
+
import Table from '../Table/Table';
|
|
4
|
+
|
|
5
|
+
global.lng = 'en';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Form Elements/InputDateRange',
|
|
9
|
+
component: InputDateRange,
|
|
10
|
+
argTypes: {
|
|
11
|
+
// status: {
|
|
12
|
+
// control: {
|
|
13
|
+
// type: 'select',
|
|
14
|
+
// options: ['admin', 'user']
|
|
15
|
+
// }
|
|
16
|
+
// }
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const tableData = {
|
|
21
|
+
header: [
|
|
22
|
+
{ id: 1, label: 'state' },
|
|
23
|
+
{ id: 2, label: 'Tags' },
|
|
24
|
+
{ id: 3, label: 'status' },
|
|
25
|
+
{ id: 4, label: 'loanAmountApproved' },
|
|
26
|
+
{ id: 5, label: 'loanAmountRejected' },
|
|
27
|
+
{ id: 6, label: 'approveRate' },
|
|
28
|
+
{ id: 7, label: 'actions', type: 'actions' }
|
|
29
|
+
],
|
|
30
|
+
rows: [
|
|
31
|
+
{
|
|
32
|
+
id: 1,
|
|
33
|
+
link: { label: 'CA', link: '#s' },
|
|
34
|
+
tags: [{ label: 'Label 1' }],
|
|
35
|
+
status: { value: '90', status: 'active' },
|
|
36
|
+
loanAmountApproved: { value: '$70,000' },
|
|
37
|
+
loanAmountRejected: { value: '$30,000' },
|
|
38
|
+
approveRate: { value: '70%' }
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 2,
|
|
42
|
+
link: { label: 'NY', link: '#s' },
|
|
43
|
+
advancedTags: [
|
|
44
|
+
{
|
|
45
|
+
labelLeft: 'home',
|
|
46
|
+
labelRight: 'hoods',
|
|
47
|
+
active: 3,
|
|
48
|
+
pause: 1,
|
|
49
|
+
merchants: 5
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
labelRight: 'jewelry',
|
|
53
|
+
active: 3,
|
|
54
|
+
pause: 1,
|
|
55
|
+
merchants: 5
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
labelLeft: 'home',
|
|
59
|
+
labelRight: 'improvement',
|
|
60
|
+
active: 0,
|
|
61
|
+
pause: 0,
|
|
62
|
+
warnLeft: true,
|
|
63
|
+
warnLeftMsg: 'landerNotIncluded',
|
|
64
|
+
warnRightMsg: 'noMerchants'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
labelLeft: 'home',
|
|
68
|
+
labelRight: 'hoods',
|
|
69
|
+
active: 3,
|
|
70
|
+
pause: 1,
|
|
71
|
+
merchants: 5
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
labelRight: 'jewelry',
|
|
75
|
+
active: 3,
|
|
76
|
+
pause: 1,
|
|
77
|
+
merchants: 5
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
status: { label: 'Active', className: 'color--green-haze' },
|
|
81
|
+
loanAmountApproved: { value: '$3,000' },
|
|
82
|
+
loanAmountRejected: { value: '$7,000' },
|
|
83
|
+
approveRate: { value: '30%' }
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 3,
|
|
87
|
+
link: { label: 'NH', link: '#s' },
|
|
88
|
+
tags: [{ label: 'Label 1' }, { label: 'Label 2' }, { label: 'Label 3' }],
|
|
89
|
+
status: { status: 'error' },
|
|
90
|
+
loanAmountApproved: { value: '$70,000' },
|
|
91
|
+
loanAmountRejected: { value: '$30,000' },
|
|
92
|
+
approveRate: { value: '70%' }
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const Template = args => {
|
|
98
|
+
const { dateRange, ...restOfProps } = args;
|
|
99
|
+
const [value, setValue] = useState(dateRange);
|
|
100
|
+
|
|
101
|
+
const [state, setState] = useState(tableData);
|
|
102
|
+
|
|
103
|
+
const rowsWithActions = state?.rows?.map(row => ({
|
|
104
|
+
...row,
|
|
105
|
+
actions: row.isDeleted ? [{ type: 'undo' }] : [{ type: 'download' }, { type: 'edit' }, { type: 'delete' }]
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
// useEffect(() => console.log(value), [value]);
|
|
109
|
+
|
|
110
|
+
// return <InputDateRange {...restOfProps} value={value} onChange={setValue} />;
|
|
111
|
+
return (
|
|
112
|
+
<div>
|
|
113
|
+
<div className="mb20">
|
|
114
|
+
<InputDateRange {...restOfProps} value={value} onChange={setValue} />
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
<Table header={state.header} rows={rowsWithActions} onChange={setState} />
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export const InputDateRangeTemplate = Template.bind({});
|
|
124
|
+
|
|
125
|
+
InputDateRangeTemplate.args = {
|
|
126
|
+
txt: {},
|
|
127
|
+
buttonsTypes: {
|
|
128
|
+
// apply: 'ellipse-apply',
|
|
129
|
+
cancel: 'bark-outline'
|
|
130
|
+
},
|
|
131
|
+
label: 'Date Range',
|
|
132
|
+
dateRange: { intervalKey: 'today'},
|
|
133
|
+
id: 'anyToggleButtonId',
|
|
134
|
+
className: 'anyExternalContainerClassName',
|
|
135
|
+
error: false,
|
|
136
|
+
disabled: false,
|
|
137
|
+
isHoverable: false,
|
|
138
|
+
// short: true,
|
|
139
|
+
isCompact: false,
|
|
140
|
+
// isFocused: true,
|
|
141
|
+
isIntervalsHidden: false,
|
|
142
|
+
isCompareHidden: true,
|
|
143
|
+
hideArrows: false,
|
|
144
|
+
isOptionsRight: false,
|
|
145
|
+
// limitRange,
|
|
146
|
+
// isUseAbs,
|
|
147
|
+
// absTooltip
|
|
148
|
+
};
|