forstok-ui-lib 5.7.0 → 5.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "5.7.0",
3
+ "version": "5.7.3",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
package/rollup.config.js CHANGED
@@ -68,7 +68,7 @@ export default [
68
68
  exclude: 'node_modules/**'
69
69
  })
70
70
  ],
71
- external: ['react', 'react-dom', 'styled-components'],
71
+ external: ['react', 'react-dom', 'styled-components', '@wojtekmaj/react-daterange-picker'],
72
72
  },
73
73
  {
74
74
  input: 'src/index.ts',
@@ -21,6 +21,7 @@ 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';
24
25
  export { default as DateTimeComponent } from './datetime';
25
26
  export { default as RadioComponent } from './radio';
26
27
  export { default as SwitchComponent } from './switch';
@@ -31,6 +32,7 @@ export * from './dropdown/typed';
31
32
  export * from './message/typed';
32
33
  export * from './popup/typed';
33
34
  export * from './select/typed';
35
+ export * from './date/typed';
34
36
 
35
37
  export * from './select/components';
36
38
  export * from './form/styles';
@@ -1,4 +1,5 @@
1
- import { TMouseEvent, TObject, TState } from './base.typed';
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>