forstok-ui-lib 8.3.11 → 8.3.13

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.
@@ -1,168 +1,187 @@
1
- import { Dispatch, JSX } from 'react';
2
- import { TChangeEvent, TMouseEvent, TObject, TPage, TState, TUPage } from './base.typed';
3
- import { TMessageFunction, TMessageQuestionFunction } from '../components/message/typed';
4
- import { TPopupFunction, TPopupOpenFunction } from '../components/popup/typed';
5
- import { TOption } from '../components/select/typed';
1
+ import { Dispatch, JSX } from "react";
2
+ import {
3
+ TChangeEvent,
4
+ TMouseEvent,
5
+ TObject,
6
+ TPage,
7
+ TState,
8
+ TUPage,
9
+ } from "./base.typed";
10
+ import {
11
+ TMessageFunction,
12
+ TMessageQuestionFunction,
13
+ } from "../components/message/typed";
14
+ import { TPopupFunction, TPopupOpenFunction } from "../components/popup/typed";
15
+ import { TOption } from "../components/select/typed";
6
16
 
7
- export type TCloseDropdownFunction = (currentTarget: EventTarget & HTMLElement) => void;
17
+ export type TCloseDropdownFunction = (
18
+ currentTarget: EventTarget & HTMLElement,
19
+ ) => void;
8
20
  export type TUser = {
9
- profile_id: number,
10
- profile_name: string,
11
- id: number,
12
- username: string,
13
- email: string,
14
- freshchat_restore_id: string|number | null,
21
+ profile_id: number;
22
+ profile_name: string;
23
+ id: number;
24
+ username: string;
25
+ email: string;
26
+ freshchat_restore_id: string | number | null;
15
27
  credentials: {
16
- aws_access_key: string,
17
- aws_secret_access_key: string,
18
- aws_bucket_name: string,
19
- aws_region: string,
20
- chat_token: string,
21
- shopee_partner_id: string,
22
- shopee_partner_key: string
23
- },
24
- has_access_orderV1: boolean
25
- isAI?: boolean
26
- }
28
+ aws_access_key: string;
29
+ aws_secret_access_key: string;
30
+ aws_bucket_name: string;
31
+ aws_region: string;
32
+ chat_token: string;
33
+ shopee_partner_id: string;
34
+ shopee_partner_key: string;
35
+ };
36
+ has_access_orderV1: boolean;
37
+ isAI?: boolean;
38
+ };
27
39
  export type THierarchy = {
28
- evTooglePopup?: TPopupFunction
29
- evCreateMessage?: TMessageFunction
30
- evForcePopUp?: TPopupFunction
31
- isOpenPopup: boolean
32
- modePopup: string
33
- pathPopup: string
34
- actionPopup: string
35
- detailPopup?: TObject
36
- evOpenPopup?: TPopupOpenFunction
37
- evCloseDropdown?: TCloseDropdownFunction
38
- evCreateMessageQuestion?: TMessageQuestionFunction
39
- }
40
+ evTooglePopup?: TPopupFunction;
41
+ evCreateMessage?: TMessageFunction;
42
+ evForcePopUp?: TPopupFunction;
43
+ isOpenPopup: boolean;
44
+ modePopup: string;
45
+ pathPopup: string;
46
+ actionPopup: string;
47
+ detailPopup?: TObject;
48
+ evOpenPopup?: TPopupOpenFunction;
49
+ evCloseDropdown?: TCloseDropdownFunction;
50
+ evCreateMessageQuestion?: TMessageQuestionFunction;
51
+ };
40
52
  export type TChannel = {
41
- channelName?: string
42
- channelInitials?: string
43
- channelColor?: string
44
- channelImage?: string
45
- channelId?: number
46
- name?: string | null
47
- initials?: string | null
48
- color?: string | null
49
- icon?: string | null
50
- id?: number | null
51
- totalStores?: number
53
+ channelName?: string;
54
+ channelInitials?: string;
55
+ channelColor?: string;
56
+ channelImage?: string;
57
+ channelId?: number;
58
+ name?: string | null;
59
+ initials?: string | null;
60
+ color?: string | null;
61
+ icon?: string | null;
62
+ id?: number | null;
63
+ totalStores?: number;
64
+ phone?: string;
52
65
  Stores?: {
53
- id?: number
54
- storeName?: string
55
- storeImage?: string
56
- storeImageName?: string
57
- }[]
58
- availableAPI?: boolean | null
59
- }
66
+ id?: number;
67
+ storeName?: string;
68
+ storeImage?: string;
69
+ storeImageName?: string;
70
+ }[];
71
+ availableAPI?: boolean | null;
72
+ };
60
73
  export type THeadProps = {
61
- key: string
62
- name: string
63
- fieldType: string
64
- validations?: TObject
65
- width: number
66
- typeData: string
67
- condition?: string
68
- type?: string
69
- bare?: boolean,
70
- multiline?: boolean
71
- options?: TOption[],
72
- isMassEditable?: boolean
73
- isMassClearable?: boolean
74
- value?: number
75
- schema?: string
76
- align?: any
77
- format?: string
78
- allowEmpty?: boolean
79
- customOptionKey?: string
80
- icon?: string
81
- initial?: string
82
- color?: string
83
- tip?: string
84
- placeholder?: string
85
- isHidden?: boolean
86
- showFormat?: string
87
- containOfType?: string[] | null
88
- }
74
+ key: string;
75
+ name: string;
76
+ fieldType: string;
77
+ validations?: TObject;
78
+ width: number;
79
+ typeData: string;
80
+ condition?: string;
81
+ type?: string;
82
+ bare?: boolean;
83
+ multiline?: boolean;
84
+ options?: TOption[];
85
+ isMassEditable?: boolean;
86
+ isMassClearable?: boolean;
87
+ value?: number;
88
+ schema?: string;
89
+ align?: any;
90
+ format?: string;
91
+ allowEmpty?: boolean;
92
+ customOptionKey?: string;
93
+ icon?: string;
94
+ initial?: string;
95
+ color?: string;
96
+ tip?: string;
97
+ placeholder?: string;
98
+ isHidden?: boolean;
99
+ showFormat?: string;
100
+ containOfType?: string[] | null;
101
+ };
89
102
 
90
103
  export type TInData<TData = never> = {
91
- loading: boolean
92
- data?: TData | null
93
- }
104
+ loading: boolean;
105
+ data?: TData | null;
106
+ };
94
107
 
95
108
  export type TInListProps = {
96
- loadName: string
97
- searchByDef: string
98
- hasCheckAll?: boolean
99
- hasSubscription?: boolean
100
- hasTab?: boolean
101
- hasSort?: boolean
102
- tabStorage?: string
103
- sortStorage?: string
104
- pageStorage?: string
105
- }
109
+ loadName: string;
110
+ searchByDef: string;
111
+ hasCheckAll?: boolean;
112
+ hasSubscription?: boolean;
113
+ hasTab?: boolean;
114
+ hasSort?: boolean;
115
+ tabStorage?: string;
116
+ sortStorage?: string;
117
+ pageStorage?: string;
118
+ };
106
119
 
107
120
  export type TInPart = {
108
- evOpenPopup?: TPopupOpenFunction
109
- evForcePopUp?: TPopupFunction
110
- evCloseDropdown?: TCloseDropdownFunction
111
- evCreateMessage?: TMessageFunction
112
- evCreateMessageQuestion?: TMessageQuestionFunction
113
- saveSubscription?: (statuses: (string | null)[], id: string | number) => void
114
- clearSubscription?: ()=> void
115
- data?: any
116
- id?: string | number
117
- evPrintReceipt?: (dataOrder: any) => void
118
- }
121
+ evOpenPopup?: TPopupOpenFunction;
122
+ evForcePopUp?: TPopupFunction;
123
+ evCloseDropdown?: TCloseDropdownFunction;
124
+ evCreateMessage?: TMessageFunction;
125
+ evCreateMessageQuestion?: TMessageQuestionFunction;
126
+ saveSubscription?: (statuses: (string | null)[], id: string | number) => void;
127
+ clearSubscription?: () => void;
128
+ data?: any;
129
+ id?: string | number;
130
+ evPrintReceipt?: (dataOrder: any) => void;
131
+ };
119
132
 
120
133
  export type TInList = TInPart & {
121
- firstDispatch: Dispatch<any>
122
- resetByOption: (opt?: string | string[], callback?: () => void, noScroll?: boolean) => void
123
- activeStatusTab?: string
124
- evClickTab?: TMouseEvent
125
- loadName?: string,
126
- activePageOption: number
127
- evSetPageOption: TMouseEvent
128
- activePage: number
129
- evSetPage: TMouseEvent
130
- activeCursor: string
131
- searchInput: string
132
- evSearchInput: TChangeEvent
133
- activeSearchBy: string
134
- evClickSearchBy: TMouseEvent
135
- abortRef: AbortController
136
- abortSecRef: AbortController
137
- isForceUpdate: boolean
138
- checkboxData?: TObject[]
139
- isCheckAll?: boolean
140
- isForceUpdateCheckAll?: boolean
141
- isResetSubscription?: boolean
142
- activeSort?: string
143
- evChangeSort?: TChangeEvent
144
- isForceUpdateSort?: boolean
145
- evClickCollapse?: TMouseEvent
146
- isReadyQuery: boolean
147
- }
134
+ firstDispatch: Dispatch<any>;
135
+ resetByOption: (
136
+ opt?: string | string[],
137
+ callback?: () => void,
138
+ noScroll?: boolean,
139
+ ) => void;
140
+ activeStatusTab?: string;
141
+ evClickTab?: TMouseEvent;
142
+ loadName?: string;
143
+ activePageOption: number;
144
+ evSetPageOption: TMouseEvent;
145
+ activePage: number;
146
+ evSetPage: TMouseEvent;
147
+ activeCursor: string;
148
+ searchInput: string;
149
+ evSearchInput: TChangeEvent;
150
+ activeSearchBy: string;
151
+ evClickSearchBy: TMouseEvent;
152
+ abortRef: AbortController;
153
+ abortSecRef: AbortController;
154
+ isForceUpdate: boolean;
155
+ checkboxData?: TObject[];
156
+ isCheckAll?: boolean;
157
+ isForceUpdateCheckAll?: boolean;
158
+ isResetSubscription?: boolean;
159
+ activeSort?: string;
160
+ evChangeSort?: TChangeEvent;
161
+ isForceUpdateSort?: boolean;
162
+ evClickCollapse?: TMouseEvent;
163
+ isReadyQuery: boolean;
164
+ };
148
165
 
149
- export type TInlistPart = Omit<TInList,
150
- 'evClickTab' |
151
- 'activePageOption' |
152
- 'evSetPageOption' |
153
- 'activePage' |
154
- 'evSetPage' |
155
- 'activeCursor' |
156
- 'searchInput' |
157
- 'abortRef' |
158
- 'abortSecRef' |
159
- 'isResetSubscription' |
160
- 'isReadyQuery'> & {
161
- pageEl: JSX.Element | null
162
- readyFilter?: string[]
163
- parseSetForceUpdate?: (value: boolean) => void
164
- evReload?: () => void
165
- }
166
+ export type TInlistPart = Omit<
167
+ TInList,
168
+ | "evClickTab"
169
+ | "activePageOption"
170
+ | "evSetPageOption"
171
+ | "activePage"
172
+ | "evSetPage"
173
+ | "activeCursor"
174
+ | "searchInput"
175
+ | "abortRef"
176
+ | "abortSecRef"
177
+ | "isResetSubscription"
178
+ | "isReadyQuery"
179
+ > & {
180
+ pageEl: JSX.Element | null;
181
+ readyFilter?: string[];
182
+ parseSetForceUpdate?: (value: boolean) => void;
183
+ evReload?: () => void;
184
+ };
166
185
 
167
186
  export interface TPagination {
168
187
  data?: TPage | TUPage | null;
@@ -171,153 +190,165 @@ export interface TPagination {
171
190
  evSetPage: TMouseEvent;
172
191
  activePageOption?: number;
173
192
  evSetPageOption: TMouseEvent;
174
- mode?: 'noPageOption' | 'min10PageOption';
193
+ mode?: "noPageOption" | "min10PageOption";
175
194
  }
176
195
 
177
196
  export type TObjPage = {
178
- cursor?: string
179
- page: number
180
- isCurrent: boolean
181
- }
197
+ cursor?: string;
198
+ page: number;
199
+ isCurrent: boolean;
200
+ };
182
201
 
183
- export type TPageObj = {
184
- first: TObjPage
185
- last: TObjPage
186
- next: TObjPage
187
- prev: TObjPage
188
- around: TObjPage
189
- dot: {
190
- start: boolean
191
- end: boolean
192
- }
193
- } | TObject | null
202
+ export type TPageObj =
203
+ | {
204
+ first: TObjPage;
205
+ last: TObjPage;
206
+ next: TObjPage;
207
+ prev: TObjPage;
208
+ around: TObjPage;
209
+ dot: {
210
+ start: boolean;
211
+ end: boolean;
212
+ };
213
+ }
214
+ | TObject
215
+ | null;
194
216
 
195
217
  export type TNewFilterPartial = {
196
- firstDispatch?: Dispatch<any>
197
- activeStatusTab?: string
198
- evCloseDropdown?: TCloseDropdownFunction
199
- readyFilter?: string[]
200
- isForceUpdate: boolean
201
- setForceUpdate?: TState<boolean>
202
- localStorageName?: string
203
- loadName?: string
204
- resetByOption?: (opt?: string | string[], callback?: () => void, noScroll?: boolean) => void
205
- }
218
+ firstDispatch?: Dispatch<any>;
219
+ activeStatusTab?: string;
220
+ evCloseDropdown?: TCloseDropdownFunction;
221
+ readyFilter?: string[];
222
+ isForceUpdate: boolean;
223
+ setForceUpdate?: TState<boolean>;
224
+ localStorageName?: string;
225
+ loadName?: string;
226
+ resetByOption?: (
227
+ opt?: string | string[],
228
+ callback?: () => void,
229
+ noScroll?: boolean,
230
+ ) => void;
231
+ };
206
232
 
207
233
  export type TNewFunction = {
208
- checkboxData?: TObject[]
209
- evReload?: () => void
210
- evForcePopUp?: TPopupFunction
211
- evCreateMessage?: TMessageFunction
212
- evCreateMessageQuestion?: TMessageQuestionFunction
213
- type?: string
214
- data?: TObject[]
215
- evOpenPopup?: TPopupOpenFunction
216
- inboundId?: number
217
- outboundId?: number
218
- adjustmentId?: number
219
- evMarkIncomplete?: TMouseEvent
220
- source?: string
221
- portalKey?: number
222
- }
234
+ checkboxData?: TObject[];
235
+ evReload?: () => void;
236
+ evForcePopUp?: TPopupFunction;
237
+ evCreateMessage?: TMessageFunction;
238
+ evCreateMessageQuestion?: TMessageQuestionFunction;
239
+ type?: string;
240
+ data?: TObject[];
241
+ evOpenPopup?: TPopupOpenFunction;
242
+ inboundId?: number;
243
+ outboundId?: number;
244
+ adjustmentId?: number;
245
+ evMarkIncomplete?: TMouseEvent;
246
+ source?: string;
247
+ portalKey?: number;
248
+ };
223
249
 
224
250
  export type TDetailNew<TData = never> = {
225
- activeTab?: string
226
- evOpenPopup?: TPopupOpenFunction
227
- data: TData
228
- evClickTabDetail?: TMouseEvent
229
- evCreateMessage?: TMessageFunction
230
- evCreateMessageQuestion?: TMessageQuestionFunction
231
- evCloseDropdown?: TCloseDropdownFunction
232
- evReload?: () => void
233
- }
251
+ activeTab?: string;
252
+ evOpenPopup?: TPopupOpenFunction;
253
+ data: TData;
254
+ evClickTabDetail?: TMouseEvent;
255
+ evCreateMessage?: TMessageFunction;
256
+ evCreateMessageQuestion?: TMessageQuestionFunction;
257
+ evCloseDropdown?: TCloseDropdownFunction;
258
+ evReload?: () => void;
259
+ };
234
260
 
235
261
  type Callback<S> = (state: S) => void | (() => void | undefined);
236
262
 
237
- type DispatchWithCallback<A, S> = (
238
- value: A,
239
- callback: Callback<S>,
240
- ) => void;
263
+ type DispatchWithCallback<A, S> = (value: A, callback: Callback<S>) => void;
241
264
 
242
- export type TStateCallback<TData> = DispatchWithCallback<React.SetStateAction<TData>, TData>
265
+ export type TStateCallback<TData> = DispatchWithCallback<
266
+ React.SetStateAction<TData>,
267
+ TData
268
+ >;
243
269
 
244
270
  export type ModeListTableColumn =
245
- | 'item'
246
- | 'item-nocheck'
247
- | 'quantity'
248
- | 'listing'
249
- | 'listing-nocheck'
250
- | 'picklist'
251
- | 'package'
252
- | 'shipment'
253
- | 'invoice'
254
- | 'payment-receive'
255
- | 'sales-return'
256
- | 'activity'
257
- | 'putaway'
258
- | 'inbound'
259
- | 'lowstock'
260
- | 'price'
261
- | 'stock-adjustment'
262
- | 'stock-outbound'
263
- | 'stock-transfer'
264
- | 'promotion'
265
- | 'stock-history'
266
- | 'price-history'
267
- | 'turnover'
268
- | 'days-outofstock'
269
- | 'warehouses'
270
- | 'archived'
271
- | 'pos-order'
272
- | 'order'
273
- | 'order-nocheck'
274
- | 'table-customheader';
271
+ | "item"
272
+ | "item-nocheck"
273
+ | "quantity"
274
+ | "listing"
275
+ | "listing-nocheck"
276
+ | "picklist"
277
+ | "package"
278
+ | "shipment"
279
+ | "invoice"
280
+ | "payment-receive"
281
+ | "sales-return"
282
+ | "activity"
283
+ | "putaway"
284
+ | "inbound"
285
+ | "lowstock"
286
+ | "price"
287
+ | "stock-adjustment"
288
+ | "stock-outbound"
289
+ | "stock-transfer"
290
+ | "promotion"
291
+ | "stock-history"
292
+ | "price-history"
293
+ | "turnover"
294
+ | "days-outofstock"
295
+ | "warehouses"
296
+ | "archived"
297
+ | "pos-order"
298
+ | "order"
299
+ | "order-nocheck"
300
+ | "table-customheader";
275
301
 
276
302
  export type TInDetail = TInPart & {
277
- firstDispatch?: Dispatch<any>
278
- resetByOption: (opt?: string | string[], callback?: () => void, noScroll?: boolean) => void
279
- activeStatusTab?: string
280
- evClickTab?: TMouseEvent
281
- abortRef: AbortController
282
- isForceUpdate: boolean
283
- isResetSubscription?: boolean
284
- isReadyQuery: boolean
285
- }
303
+ firstDispatch?: Dispatch<any>;
304
+ resetByOption: (
305
+ opt?: string | string[],
306
+ callback?: () => void,
307
+ noScroll?: boolean,
308
+ ) => void;
309
+ activeStatusTab?: string;
310
+ evClickTab?: TMouseEvent;
311
+ abortRef: AbortController;
312
+ isForceUpdate: boolean;
313
+ isResetSubscription?: boolean;
314
+ isReadyQuery: boolean;
315
+ };
286
316
 
287
317
  export type TInDetailProps = {
288
- hasTab?: boolean
289
- tabDef?: string
290
- hasSubscription?: boolean
291
- }
318
+ hasTab?: boolean;
319
+ tabDef?: string;
320
+ hasSubscription?: boolean;
321
+ };
292
322
 
293
323
  export type modeTable =
294
- | 'picklist'
295
- | 'listing'
296
- | 'price'
297
- | 'price'
298
- | 'price-full'
299
- | 'price-mid'
324
+ | "picklist"
325
+ | "listing"
326
+ | "price"
327
+ | "price"
328
+ | "price-full"
329
+ | "price-mid";
300
330
 
301
- export type BodyContentStyle =
302
- | 'create-return'
303
- | 'create-price'
304
- | 'create-adjustment'
305
- | 'create-outbound'
306
- | 'confirm-inbound'
307
- | 'confirm-outbound'
308
- | 'confirm-adjustment'
331
+ export type BodyContentStyle =
332
+ | "create-return"
333
+ | "create-price"
334
+ | "create-adjustment"
335
+ | "create-outbound"
336
+ | "confirm-inbound"
337
+ | "confirm-outbound"
338
+ | "confirm-adjustment";
309
339
 
310
- export type BodyContentMode = BodyContentStyle
311
- | 'create-promotion'
312
- | 'create-inbound'
313
- | 'create-transfer'
314
- | 'create-picklist'
315
- | 'edit-picklist'
316
- | 'create-package'
317
- | 'edit-master'
318
- | 'putaway-inbound'
319
- | 'create-paymentreceive'
320
- | 'create-master'
321
- | 'create-listing'
322
- | 'create-adjustment'
323
- | 'edit-listing'
340
+ export type BodyContentMode =
341
+ | BodyContentStyle
342
+ | "create-promotion"
343
+ | "create-inbound"
344
+ | "create-transfer"
345
+ | "create-picklist"
346
+ | "edit-picklist"
347
+ | "create-package"
348
+ | "edit-master"
349
+ | "putaway-inbound"
350
+ | "create-paymentreceive"
351
+ | "create-master"
352
+ | "create-listing"
353
+ | "create-adjustment"
354
+ | "edit-listing";