forstok-ui-lib 5.7.6 → 5.8.2
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 +342 -356
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +138 -152
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/assets/images/icons/close copy.svg +9 -0
- package/src/assets/images/icons/humberbars.svg +1 -0
- package/src/components/date/styles.tsx +1 -16
- package/src/components/icon/styles.ts +14 -0
- package/src/components/index.ts +0 -2
- package/src/components/date/daterange.tsx +0 -45
- package/src/components/date/daterangepicker.css +0 -96
- package/src/components/date/typed.ts +0 -3
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
4
|
+
viewBox="0 0 212.982 212.982" style="enable-background:new 0 0 212.982 212.982; fill: rgb(72,72,72)" xml:space="preserve">
|
|
5
|
+
<path style="fill-rule:evenodd;clip-rule:evenodd;" d="M131.804,106.491l75.936-75.936c6.99-6.99,6.99-18.323,0-25.312
|
|
6
|
+
c-6.99-6.99-18.322-6.99-25.312,0l-75.937,75.937L30.554,5.242c-6.99-6.99-18.322-6.99-25.312,0c-6.989,6.99-6.989,18.323,0,25.312
|
|
7
|
+
l75.937,75.936L5.242,182.427c-6.989,6.99-6.989,18.323,0,25.312c6.99,6.99,18.322,6.99,25.312,0l75.937-75.937l75.937,75.937
|
|
8
|
+
c6.989,6.99,18.322,6.99,25.312,0c6.99-6.99,6.99-18.322,0-25.312L131.804,106.491z"/>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg height="auto" viewBox="0 -53 384 384" width="auto" xmlns="http://www.w3.org/2000/svg"><path d="m368 154.667969h-352c-8.832031 0-16-7.167969-16-16s7.167969-16 16-16h352c8.832031 0 16 7.167969 16 16s-7.167969 16-16 16zm0 0"/><path d="m368 32h-352c-8.832031 0-16-7.167969-16-16s7.167969-16 16-16h352c8.832031 0 16 7.167969 16 16s-7.167969 16-16 16zm0 0"/><path d="m368 277.332031h-352c-8.832031 0-16-7.167969-16-16s7.167969-16 16-16h352c8.832031 0 16 7.167969 16 16s-7.167969 16-16 16zm0 0"/></svg>
|
|
@@ -398,19 +398,4 @@ export const DateRangePortalContainer = styled.div`
|
|
|
398
398
|
export const DateRangeIconContainer = styled.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
padding: 0 0 0 12px;
|
|
401
|
-
`
|
|
402
|
-
export const DateRangeWrapper = styled.div<{ $mode?: string }>`
|
|
403
|
-
position: relative;
|
|
404
|
-
${({ $mode }: { $mode?: string }) => $mode === 'input' && css`
|
|
405
|
-
border: 1px solid var(--ck-clr-ln);
|
|
406
|
-
cursor: pointer;
|
|
407
|
-
height: 30px;
|
|
408
|
-
border-radius: var(--ter-rd);
|
|
409
|
-
background-color: rgb(255, 255, 255);
|
|
410
|
-
padding: 0px 2px 0px 8px;
|
|
411
|
-
.react-daterange-picker {
|
|
412
|
-
background-color: transparent;
|
|
413
|
-
padding: 0px;
|
|
414
|
-
}
|
|
415
|
-
`}
|
|
416
|
-
`;
|
|
401
|
+
`
|
|
@@ -31,6 +31,8 @@ import IconQuestion from '../../assets/images/icons/question.svg';
|
|
|
31
31
|
import IconSortby from '../../assets/images/icons/sortby.svg';
|
|
32
32
|
import IconNotificationDownload from '../../assets/images/icons/notif-download-white.svg';
|
|
33
33
|
import IconNotificationUpload from '../../assets/images/icons/notif-upload-white.svg';
|
|
34
|
+
import IconBar from '../../assets/images/icons/humberbars.svg';
|
|
35
|
+
import IconClose from '../../assets/images/icons/close.svg';
|
|
34
36
|
|
|
35
37
|
const NotificationStyled = css`
|
|
36
38
|
width: 44px;
|
|
@@ -265,6 +267,18 @@ const getIconContainerStyled = ({ $mode, $name, $width, onClick }:{ $mode?: stri
|
|
|
265
267
|
content: url(${IconNotificationUpload});
|
|
266
268
|
}`
|
|
267
269
|
break;
|
|
270
|
+
case 'bar':
|
|
271
|
+
style += `
|
|
272
|
+
&:before {
|
|
273
|
+
content: url(${IconBar});
|
|
274
|
+
}`
|
|
275
|
+
break;
|
|
276
|
+
case 'close':
|
|
277
|
+
style += `
|
|
278
|
+
&:before {
|
|
279
|
+
content: url(${IconClose});
|
|
280
|
+
}`
|
|
281
|
+
break;
|
|
268
282
|
default:
|
|
269
283
|
break;
|
|
270
284
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -21,7 +21,6 @@ export { default as UploadDragDropComponent } from './upload/drag.drop';
|
|
|
21
21
|
export { default as TextAreaComponent } from './textarea';
|
|
22
22
|
export { default as TextAreaRefComponent } from './textarea/ref';
|
|
23
23
|
export { default as DateComponent } from './date';
|
|
24
|
-
export { default as DateRangeComponent } from './date/daterange';
|
|
25
24
|
export { default as DateTimeComponent } from './datetime';
|
|
26
25
|
export { default as RadioComponent } from './radio';
|
|
27
26
|
export { default as SwitchComponent } from './switch';
|
|
@@ -32,7 +31,6 @@ export * from './dropdown/typed';
|
|
|
32
31
|
export * from './message/typed';
|
|
33
32
|
export * from './popup/typed';
|
|
34
33
|
export * from './select/typed';
|
|
35
|
-
export * from './date/typed';
|
|
36
34
|
|
|
37
35
|
export * from './select/components';
|
|
38
36
|
export * from './form/styles';
|
|
@@ -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,96 +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
|
-
.react-calendar__tile--rangeStart, .react-calendar__tile--hoverStart {
|
|
75
|
-
border-radius: 10px 0px 0 10px !important;
|
|
76
|
-
}
|
|
77
|
-
.react-calendar__tile--rangeEnd, .react-calendar__tile--hoverEnd {
|
|
78
|
-
border-radius: 0 10px 10px 0 !important;
|
|
79
|
-
}
|
|
80
|
-
.react-calendar__month-view__days {
|
|
81
|
-
gap: 1px 0;
|
|
82
|
-
}
|
|
83
|
-
.react-calendar__month-view__weekdays {
|
|
84
|
-
font-size: 1em;
|
|
85
|
-
}
|
|
86
|
-
.react-calendar__navigation__arrow {
|
|
87
|
-
font-size: 1.5em;
|
|
88
|
-
}
|
|
89
|
-
.react-daterange-picker__calendar {
|
|
90
|
-
z-index: 100;
|
|
91
|
-
}
|
|
92
|
-
.react-daterange-picker__button {
|
|
93
|
-
position: absolute;
|
|
94
|
-
right: 0;
|
|
95
|
-
}
|
|
96
|
-
|