forstok-ui-lib 5.6.11 → 5.7.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 +275 -1
- package/dist/index.js +1422 -320
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1453 -351
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/rollup.config.js +4 -1
- package/src/assets/javascripts/function.ts +158 -1
- package/src/assets/javascripts/helper.ts +126 -0
- package/src/assets/stylesheets/shares.styles.ts +3112 -341
- package/src/components/date/daterange.tsx +45 -0
- package/src/components/date/daterangepicker.css +100 -0
- package/src/components/date/{styles.ts → styles.tsx} +16 -1
- package/src/components/date/typed.ts +3 -0
- package/src/typeds/shares.typed.ts +162 -1
- package/src/assets/images/icons/filter copy.svg +0 -16
|
@@ -0,0 +1,45 @@
|
|
|
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;
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
|
|
@@ -398,4 +398,19 @@ export const DateRangePortalContainer = styled.div`
|
|
|
398
398
|
export const DateRangeIconContainer = styled.div`
|
|
399
399
|
display: flex;
|
|
400
400
|
padding: 0 0 0 12px;
|
|
401
|
-
`
|
|
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
|
+
`;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dispatch, JSX } from 'react';
|
|
2
|
+
import { TChangeEvent, TMouseEvent, TObject, TPage, TState } from './base.typed';
|
|
2
3
|
import { TCloseDropdownFunction } from '../components/dropdown/typed';
|
|
3
4
|
import { TCustomField, TAutoCopy } from '../components/masterTable/typed';
|
|
4
5
|
import { TMessageFunction, TMessageQuestionFunction } from '../components/message/typed';
|
|
@@ -108,3 +109,163 @@ export type TMasterProps = {
|
|
|
108
109
|
setForceUpdate?: TState<boolean>
|
|
109
110
|
evPickAll?: TMouseEvent
|
|
110
111
|
}
|
|
112
|
+
|
|
113
|
+
export type TInData<TData = never> = {
|
|
114
|
+
loading: boolean
|
|
115
|
+
data?: TData | null
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type TInListProps = {
|
|
119
|
+
loadName: string
|
|
120
|
+
searchByDef: string
|
|
121
|
+
hasCheckAll?: boolean
|
|
122
|
+
hasSubscription?: boolean
|
|
123
|
+
hasTab?: boolean
|
|
124
|
+
hasSort?: boolean
|
|
125
|
+
tabStorage?: string
|
|
126
|
+
sortStorage?: string
|
|
127
|
+
pageStorage?: string
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type TInPart = {
|
|
131
|
+
evOpenPopup?: TPopupOpenFunction
|
|
132
|
+
evForcePopUp?: TPopupFunction
|
|
133
|
+
evCloseDropdown?: TCloseDropdownFunction
|
|
134
|
+
evCreateMessage?: TMessageFunction
|
|
135
|
+
evCreateMessageQuestion?: TMessageQuestionFunction
|
|
136
|
+
saveSubscription?: (statuses: (string | null)[], id: number) => void
|
|
137
|
+
clearSubscription?: ()=> void
|
|
138
|
+
data?: any
|
|
139
|
+
id?: string
|
|
140
|
+
evPrintReceipt?: (dataOrder: any) => void
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type TInList = TInPart & {
|
|
144
|
+
firstDispatch: Dispatch<any>
|
|
145
|
+
resetByOption: (opt?: string | string[], callback?: () => void, noScroll?: boolean) => void
|
|
146
|
+
activeStatusTab?: string
|
|
147
|
+
evClickTab?: TMouseEvent
|
|
148
|
+
loadName?: string,
|
|
149
|
+
activePageOption: number
|
|
150
|
+
evSetPageOption: TMouseEvent
|
|
151
|
+
activePage: number
|
|
152
|
+
evSetPage: TMouseEvent
|
|
153
|
+
activeCursor: string
|
|
154
|
+
searchInput: string
|
|
155
|
+
evSearchInput: TChangeEvent
|
|
156
|
+
activeSearchBy: string
|
|
157
|
+
evClickSearchBy: TMouseEvent
|
|
158
|
+
abortRef: AbortController
|
|
159
|
+
abortSecRef: AbortController
|
|
160
|
+
isForceUpdate: boolean
|
|
161
|
+
checkboxData?: TObject[]
|
|
162
|
+
isCheckAll?: boolean
|
|
163
|
+
isForceUpdateCheckAll?: boolean
|
|
164
|
+
isResetSubscription?: boolean
|
|
165
|
+
activeSort?: string
|
|
166
|
+
evChangeSort?: TChangeEvent
|
|
167
|
+
isForceUpdateSort?: boolean
|
|
168
|
+
evClickCollapse?: TMouseEvent
|
|
169
|
+
isReadyQuery: boolean
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export type TInlistPart = Omit<TInList,
|
|
173
|
+
'evClickTab' |
|
|
174
|
+
'activePageOption' |
|
|
175
|
+
'evSetPageOption' |
|
|
176
|
+
'activePage' |
|
|
177
|
+
'evSetPage' |
|
|
178
|
+
'activeCursor' |
|
|
179
|
+
'searchInput' |
|
|
180
|
+
'abortRef' |
|
|
181
|
+
'abortSecRef' |
|
|
182
|
+
'isResetSubscription' |
|
|
183
|
+
'isReadyQuery'> & {
|
|
184
|
+
pageEl: JSX.Element | null
|
|
185
|
+
readyFilter?: string[]
|
|
186
|
+
parseSetForceUpdate?: (value: boolean) => void
|
|
187
|
+
evReload?: () => void
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export type TPagination = {
|
|
191
|
+
data?: TPage | null
|
|
192
|
+
type: string
|
|
193
|
+
activePage: number
|
|
194
|
+
evSetPage: TMouseEvent
|
|
195
|
+
activePageOption?: number
|
|
196
|
+
evSetPageOption: TMouseEvent
|
|
197
|
+
$mode?: string
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export type TObjPage = {
|
|
201
|
+
cursor?: string
|
|
202
|
+
page: number
|
|
203
|
+
isCurrent: boolean
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export type TPageObj = {
|
|
207
|
+
first: TObjPage
|
|
208
|
+
last: TObjPage
|
|
209
|
+
next: TObjPage
|
|
210
|
+
prev: TObjPage
|
|
211
|
+
around: TObjPage
|
|
212
|
+
dot: {
|
|
213
|
+
start: boolean
|
|
214
|
+
end: boolean
|
|
215
|
+
}
|
|
216
|
+
} | TObject | null
|
|
217
|
+
|
|
218
|
+
export type TNewFilterPartial = {
|
|
219
|
+
firstDispatch?: Dispatch<any>
|
|
220
|
+
activeStatusTab?: string
|
|
221
|
+
evCloseDropdown?: TCloseDropdownFunction
|
|
222
|
+
readyFilter?: string[]
|
|
223
|
+
isForceUpdate: boolean
|
|
224
|
+
setForceUpdate?: TState<boolean>
|
|
225
|
+
localStorageName?: string
|
|
226
|
+
loadName?: string
|
|
227
|
+
resetByOption?: (opt?: string | string[], callback?: () => void, noScroll?: boolean) => void
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export type TTimeFilter = {
|
|
231
|
+
startDate: Date | null
|
|
232
|
+
endDate: Date | null
|
|
233
|
+
rangeDate : string
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type TNewFunction = {
|
|
237
|
+
checkboxData?: TObject[]
|
|
238
|
+
evReload?: () => void
|
|
239
|
+
evForcePopUp?: TPopupFunction
|
|
240
|
+
evCreateMessage?: TMessageFunction
|
|
241
|
+
evCreateMessageQuestion?: TMessageQuestionFunction
|
|
242
|
+
type?: string
|
|
243
|
+
data?: TObject[]
|
|
244
|
+
evOpenPopup?: TPopupOpenFunction
|
|
245
|
+
inboundId?: number
|
|
246
|
+
outboundId?: number
|
|
247
|
+
adjustmentId?: number
|
|
248
|
+
evMarkIncomplete?: TMouseEvent
|
|
249
|
+
source?: string
|
|
250
|
+
portalKey?: number
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export type TDetailNew<TData = never> = {
|
|
254
|
+
activeTab?: string
|
|
255
|
+
evOpenPopup?: TPopupOpenFunction
|
|
256
|
+
data: TData
|
|
257
|
+
evClickTabDetail?: TMouseEvent
|
|
258
|
+
evCreateMessage?: TMessageFunction
|
|
259
|
+
evCreateMessageQuestion?: TMessageQuestionFunction
|
|
260
|
+
evCloseDropdown?: TCloseDropdownFunction
|
|
261
|
+
evReload?: () => void
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
type Callback<S> = (state: S) => void | (() => void | undefined);
|
|
265
|
+
|
|
266
|
+
type DispatchWithCallback<A, S> = (
|
|
267
|
+
value: A,
|
|
268
|
+
callback: Callback<S>,
|
|
269
|
+
) => void;
|
|
270
|
+
|
|
271
|
+
export type TStateCallback<TData> = DispatchWithCallback<React.SetStateAction<TData>, TData>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
|
|
3
|
-
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
4
|
-
<svg width="auto" height="auto" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
-
<title>filter-horizontal-solid</title>
|
|
6
|
-
<g id="Layer_2" data-name="Layer 2">
|
|
7
|
-
<g id="invisible_box" data-name="invisible box">
|
|
8
|
-
<rect width="48" height="48" fill="none"/>
|
|
9
|
-
</g>
|
|
10
|
-
<g id="icons_Q2" data-name="icons Q2">
|
|
11
|
-
<path d="M41.8,8H21.7A6.2,6.2,0,0,0,16,4a6,6,0,0,0-5.6,4H6.2A2.1,2.1,0,0,0,4,10a2.1,2.1,0,0,0,2.2,2h4.2A6,6,0,0,0,16,16a6.2,6.2,0,0,0,5.7-4H41.8A2.1,2.1,0,0,0,44,10,2.1,2.1,0,0,0,41.8,8Z"/>
|
|
12
|
-
<path d="M41.8,22H37.7A6.2,6.2,0,0,0,32,18a6,6,0,0,0-5.6,4H6.2a2,2,0,1,0,0,4H26.4A6,6,0,0,0,32,30a6.2,6.2,0,0,0,5.7-4h4.1a2,2,0,1,0,0-4Z"/>
|
|
13
|
-
<path d="M41.8,36H24.7A6.2,6.2,0,0,0,19,32a6,6,0,0,0-5.6,4H6.2a2,2,0,1,0,0,4h7.2A6,6,0,0,0,19,44a6.2,6.2,0,0,0,5.7-4H41.8a2,2,0,1,0,0-4Z"/>
|
|
14
|
-
</g>
|
|
15
|
-
</g>
|
|
16
|
-
</svg>
|