forstok-ui-lib 5.7.4 → 5.8.1
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/index.d.ts +1 -13
- package/dist/index.js +345 -359
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +320 -334
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rollup.config.js +3 -1
- package/src/assets/images/icons/humberbars.svg +1 -0
- package/src/assets/stylesheets/shares.styles.ts +2 -6
- package/src/components/date/index.tsx +0 -1
- package/src/components/date/react.datepicker.css +3 -31
- package/src/components/date/styles.tsx +1 -16
- package/src/components/icon/styles.ts +7 -0
- package/src/components/index.ts +0 -2
- package/dist/assets/index-CjIUtQZ4.css +0 -5
- package/dist/assets/index-aVDYiS61.css +0 -1132
- package/src/components/date/daterange.tsx +0 -45
- package/src/components/date/daterangepicker.css +0 -100
- package/src/components/date/styles.css +0 -3
- package/src/components/date/typed.ts +0 -3
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import DateRangePicker from '@wojtekmaj/react-daterange-picker';
|
|
4
|
-
import { configDateRange } from '../../maps';
|
|
5
|
-
import '@wojtekmaj/react-daterange-picker/dist/DateRangePicker.css';
|
|
6
|
-
import 'react-calendar/dist/Calendar.css';
|
|
7
|
-
import './daterangepicker.css';
|
|
8
|
-
import { DateRangeWrapper } from './styles';
|
|
9
|
-
import { TValueDateRange } from './typed';
|
|
10
|
-
|
|
11
|
-
type TDateRangeComponent = {
|
|
12
|
-
$mode?: string;
|
|
13
|
-
startDate?: Date | null;
|
|
14
|
-
endDate?: Date | null;
|
|
15
|
-
evChange: (value: TValueDateRange) => void;
|
|
16
|
-
portalId?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const DateRangeComponent = ({ $mode, startDate, endDate, evChange, portalId }: TDateRangeComponent) => {
|
|
20
|
-
const _startDate: Date | null = startDate || moment(configDateRange.startDate, 'YYYY-MM-DD').toDate();
|
|
21
|
-
const _endDate: Date | null = endDate || moment(configDateRange.endDate, 'YYYY-MM-DD').toDate();
|
|
22
|
-
const minDate = moment(configDateRange.minDate, 'YYYY-MM-DD').toDate();
|
|
23
|
-
const maxDate = moment().toDate();
|
|
24
|
-
|
|
25
|
-
const [value, setValue] = useState<TValueDateRange>([_startDate, _endDate]);
|
|
26
|
-
|
|
27
|
-
const onChange = (value: TValueDateRange) => {
|
|
28
|
-
setValue(value);
|
|
29
|
-
evChange && evChange(value);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<DateRangeWrapper $mode={$mode}>
|
|
34
|
-
<DateRangePicker
|
|
35
|
-
minDate={minDate}
|
|
36
|
-
maxDate={maxDate}
|
|
37
|
-
onChange={onChange}
|
|
38
|
-
value={value}
|
|
39
|
-
clearIcon={null}
|
|
40
|
-
{...portalId && { portalContainer: document.getElementById(portalId) }} />
|
|
41
|
-
</DateRangeWrapper>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export default DateRangeComponent;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
.react-daterange-picker {
|
|
2
|
-
font-family: var(--pri-ft-fm);
|
|
3
|
-
font-size: var(--pri-ft-sz);
|
|
4
|
-
color: var(--pri-clr);
|
|
5
|
-
background-color: var(--ter-clr-bg);
|
|
6
|
-
align-items: center;
|
|
7
|
-
border: 0;
|
|
8
|
-
border-radius: var(--sec-rd);
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
height: 30px;
|
|
11
|
-
padding: 0 26px 0 16px;
|
|
12
|
-
position: relative;
|
|
13
|
-
width: 100%;
|
|
14
|
-
}
|
|
15
|
-
.react-daterange-picker__wrapper {
|
|
16
|
-
border: 0;
|
|
17
|
-
width: 100%;
|
|
18
|
-
justify-content: left;
|
|
19
|
-
display: inline-grid;
|
|
20
|
-
grid-auto-flow: column;
|
|
21
|
-
}
|
|
22
|
-
.react-calendar {
|
|
23
|
-
background-color: var(--pri-clr-bg);
|
|
24
|
-
border: 1px solid var(--sec-clr-ln);
|
|
25
|
-
box-shadow: var(--sec-shd-bx);
|
|
26
|
-
border-radius: var(--sec-rd);
|
|
27
|
-
border: 1px solid #a0a096;
|
|
28
|
-
font-family: var(--pri-ft-fm);
|
|
29
|
-
font-size: var(--pri-ft-sz);
|
|
30
|
-
color: var(--pri-clr);
|
|
31
|
-
line-height: 1.125em;
|
|
32
|
-
padding: 10px 15px;
|
|
33
|
-
}
|
|
34
|
-
.react-calendar__navigation__label__labelText {
|
|
35
|
-
color: #000;
|
|
36
|
-
font-size: 1em;
|
|
37
|
-
font-weight: 700;
|
|
38
|
-
height: 35px;
|
|
39
|
-
line-height: 35px;
|
|
40
|
-
position: relative;
|
|
41
|
-
text-align: center;
|
|
42
|
-
}
|
|
43
|
-
.react-calendar__tile {
|
|
44
|
-
font-size: 1em;
|
|
45
|
-
line-height: 1;
|
|
46
|
-
border-radius: 0;
|
|
47
|
-
}
|
|
48
|
-
.react-calendar__tile--now {
|
|
49
|
-
border-radius: 10px !important;
|
|
50
|
-
}
|
|
51
|
-
.react-calendar__tile--now.react-calendar__tile--active {
|
|
52
|
-
border-radius: 0 !important;
|
|
53
|
-
}
|
|
54
|
-
.react-calendar__tile--now.react-calendar__tile--rangeEnd.react-calendar__tile--active {
|
|
55
|
-
border-radius: 0 10px 10px 0 !important;
|
|
56
|
-
}
|
|
57
|
-
.react-calendar__tile--hover {
|
|
58
|
-
border-radius: 0;
|
|
59
|
-
}
|
|
60
|
-
.react-calendar__tile--active {
|
|
61
|
-
background-color: #fc5c64;
|
|
62
|
-
border: 1px solid #ec5b62;
|
|
63
|
-
}
|
|
64
|
-
.react-calendar__tile--active:enabled:hover, .react-calendar__tile--active:enabled:focus {
|
|
65
|
-
background-color: #fc5c64;
|
|
66
|
-
border: 1px solid #ec5b62;
|
|
67
|
-
}
|
|
68
|
-
.react-calendar__tile--rangeStart.react-calendar__tile--rangeEnd {
|
|
69
|
-
border-radius: 10px !important;
|
|
70
|
-
}
|
|
71
|
-
.react-calendar__tile--now.react-calendar__tile--rangeStart.react-calendar__tile--rangeEnd.react-calendar__tile--active {
|
|
72
|
-
border-radius: 10px !important;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.react-calendar__tile--rangeStart, .react-calendar__tile--hoverStart {
|
|
77
|
-
border-radius: 10px 0px 0 10px !important;
|
|
78
|
-
}
|
|
79
|
-
.react-calendar__tile--rangeEnd, .react-calendar__tile--hoverEnd {
|
|
80
|
-
border-radius: 0 10px 10px 0 !important;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
.react-calendar__month-view__days {
|
|
85
|
-
gap: 1px 0;
|
|
86
|
-
}
|
|
87
|
-
.react-calendar__month-view__weekdays {
|
|
88
|
-
font-size: 1em;
|
|
89
|
-
}
|
|
90
|
-
.react-calendar__navigation__arrow {
|
|
91
|
-
font-size: 1.5em;
|
|
92
|
-
}
|
|
93
|
-
.react-daterange-picker__calendar {
|
|
94
|
-
z-index: 100;
|
|
95
|
-
}
|
|
96
|
-
.react-daterange-picker__button {
|
|
97
|
-
position: absolute;
|
|
98
|
-
right: 0;
|
|
99
|
-
}
|
|
100
|
-
|