forstok-ui-lib 3.0.0 → 4.0.0
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 +156 -2
- package/dist/index.js +406 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +406 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
- package/src/assets/stylesheets/shares.styles.ts +1 -1
- package/src/components/dropdown/dropdown.styles.ts +325 -0
- package/src/components/dropdown/dropdown.tsx +254 -0
- package/src/components/dropdown/dropdown.typed.ts +24 -0
- package/src/components/index.ts +9 -0
- package/src/components/message/message.styles.ts +211 -0
- package/src/components/message/message.tsx +62 -0
- package/src/components/message/message.typed.ts +18 -0
- package/src/components/message/message_question.tsx +72 -0
- package/src/components/popup/popup.styles.ts +315 -0
- package/src/components/popup/popup.tsx +92 -0
- package/src/components/popup/popup.typed.ts +33 -0
- package/src/components/portal/react_portal.tsx +37 -0
- package/src/typeds/shares.typed.ts +18 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent,
|
|
3
|
+
import { HTMLAttributes, ReactNode, AnchorHTMLAttributes, MouseEvent, Dispatch, SetStateAction, KeyboardEvent, FocusEvent, ChangeEvent, DragEvent, InputHTMLAttributes, PropsWithChildren, ButtonHTMLAttributes, RefObject } from 'react';
|
|
4
4
|
import * as styled_components from 'styled-components';
|
|
5
5
|
import * as styled_components_dist_types from 'styled-components/dist/types';
|
|
6
6
|
|
|
@@ -27,8 +27,52 @@ type TLinkBase = {
|
|
|
27
27
|
}));
|
|
28
28
|
declare const LinkComponent: ({ children, mode, $activated, href, $elipsis, $shadow, disabled, ...props }: TLinkBase) => react_jsx_runtime.JSX.Element;
|
|
29
29
|
|
|
30
|
+
type RemoveUnderscoreFirstLetter<S extends string> = S extends `${infer FirstLetter}${infer U}` ? `${FirstLetter extends "_" ? U : `${FirstLetter}${U}`}` : S;
|
|
31
|
+
type CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? "_" : ""}${RemoveUnderscoreFirstLetter<Lowercase<T>>}${CamelToSnakeCase<U>}` : S;
|
|
32
|
+
type WithRequired<T, K extends keyof T> = T & {
|
|
33
|
+
[P in K]-?: T[P];
|
|
34
|
+
};
|
|
35
|
+
type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
36
|
+
type KeysToSnakeCase<T extends object> = {
|
|
37
|
+
[K in keyof T as CamelToSnakeCase<K & string>]: T[K];
|
|
38
|
+
};
|
|
39
|
+
type TIdNum = {
|
|
40
|
+
id: number;
|
|
41
|
+
};
|
|
42
|
+
type TIdStr = {
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
45
|
+
type TObject = {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
};
|
|
48
|
+
type TMouseEvent = (e: MouseEvent) => void;
|
|
49
|
+
type TChangeEvent = (e: ChangeEvent) => void;
|
|
50
|
+
type TDragEvent = (e: DragEvent) => void;
|
|
30
51
|
type TEnterEvent = (e: KeyboardEvent<HTMLInputElement | HTMLElement> | FocusEvent<HTMLInputElement | HTMLElement | Element> | MouseEvent<HTMLElement>) => void;
|
|
31
52
|
type TKeyboadEvent = (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
53
|
+
type TPage = {
|
|
54
|
+
totalCount: number;
|
|
55
|
+
totalPageCount: number;
|
|
56
|
+
pageInfo: {
|
|
57
|
+
endCursor?: string | null;
|
|
58
|
+
hasNextPage: boolean;
|
|
59
|
+
hasPreviousPage: boolean;
|
|
60
|
+
startCursor?: string | null;
|
|
61
|
+
};
|
|
62
|
+
pageCursors?: {
|
|
63
|
+
page: number;
|
|
64
|
+
startCursor: string;
|
|
65
|
+
endCursor: string;
|
|
66
|
+
}[] | null;
|
|
67
|
+
};
|
|
68
|
+
type TFile = {
|
|
69
|
+
name: string;
|
|
70
|
+
file: File;
|
|
71
|
+
};
|
|
72
|
+
type TFileImage = TFile & {
|
|
73
|
+
src: string;
|
|
74
|
+
url?: string;
|
|
75
|
+
};
|
|
32
76
|
type TState<T> = Dispatch<SetStateAction<T>>;
|
|
33
77
|
|
|
34
78
|
type TInput$1 = InputHTMLAttributes<HTMLInputElement> & {
|
|
@@ -103,6 +147,84 @@ type TLoading = HTMLAttributes<HTMLDivElement> & {
|
|
|
103
147
|
};
|
|
104
148
|
declare const LoadingComponent: ({ $mode, $position, $shape, $color, $extendClass, ...props }: TLoading) => react_jsx_runtime.JSX.Element;
|
|
105
149
|
|
|
150
|
+
type TDropdown = {
|
|
151
|
+
children: ReactNode[];
|
|
152
|
+
title?: string;
|
|
153
|
+
subTitle?: string;
|
|
154
|
+
$externalWidth?: string;
|
|
155
|
+
$externalMinWidth?: string;
|
|
156
|
+
$internalWidth?: string;
|
|
157
|
+
$area?: string;
|
|
158
|
+
$openPosition?: string;
|
|
159
|
+
$placement?: string;
|
|
160
|
+
$top?: string;
|
|
161
|
+
$bottom?: string;
|
|
162
|
+
$alias?: string;
|
|
163
|
+
type?: string;
|
|
164
|
+
portalId?: string;
|
|
165
|
+
onClick?: TMouseEvent;
|
|
166
|
+
detail?: string;
|
|
167
|
+
};
|
|
168
|
+
type TCloseDropdownFunction = (currentTarget: EventTarget & HTMLElement) => void;
|
|
169
|
+
|
|
170
|
+
declare const DropDownComponent: ({ children, title, subTitle, $externalWidth, $externalMinWidth, $internalWidth, $area, $openPosition, $placement, $top, onClick, $alias, type, portalId, $bottom, ...props }: TDropdown) => react_jsx_runtime.JSX.Element;
|
|
171
|
+
|
|
172
|
+
type TMessage = {
|
|
173
|
+
timer?: number;
|
|
174
|
+
$type: string;
|
|
175
|
+
message: string | ReactNode;
|
|
176
|
+
callback?: () => void;
|
|
177
|
+
};
|
|
178
|
+
type TMessageQuestion = {
|
|
179
|
+
$type: string;
|
|
180
|
+
title: string;
|
|
181
|
+
subtitle: string;
|
|
182
|
+
callback?: () => void;
|
|
183
|
+
buttonSubmit?: string;
|
|
184
|
+
cancelCallback?: () => void;
|
|
185
|
+
};
|
|
186
|
+
type TMessageFunction = ({ timer, $type, message, callback }: TMessage) => void;
|
|
187
|
+
type TMessageQuestionFunction = ({ $type, title, subtitle, callback, buttonSubmit }: TMessageQuestion) => void;
|
|
188
|
+
|
|
189
|
+
declare const MessageComponent: ({ timer, $type, message, callback }: TMessage) => react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
declare const MessageQuestionComponent: ({ $type, title, subtitle, callback, buttonSubmit, cancelCallback }: TMessageQuestion) => react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
type TPopupOpenFunction = (e: MouseEvent, el?: string) => void;
|
|
194
|
+
type TPopupFunctionParam = {
|
|
195
|
+
mode?: string | null;
|
|
196
|
+
path?: string | null;
|
|
197
|
+
action?: string | null;
|
|
198
|
+
detail?: any;
|
|
199
|
+
};
|
|
200
|
+
type TPopupFunction = (props?: TPopupFunctionParam) => void;
|
|
201
|
+
type TPopupFunctionGroup = {
|
|
202
|
+
evTooglePopup?: TPopupFunction;
|
|
203
|
+
evCreateMessage?: TMessageFunction;
|
|
204
|
+
evForcePopUp?: TPopupFunction;
|
|
205
|
+
};
|
|
206
|
+
type TPopupContainer = {
|
|
207
|
+
isOpen: boolean;
|
|
208
|
+
} & Required<TPopupFunctionParam> & Required<TPopupFunctionGroup>;
|
|
209
|
+
type TPopup = {
|
|
210
|
+
isOpen: boolean;
|
|
211
|
+
body?: string;
|
|
212
|
+
height?: string | number;
|
|
213
|
+
width?: string | number;
|
|
214
|
+
type?: string;
|
|
215
|
+
} & TPopupFunctionParam & TPopupFunctionGroup;
|
|
216
|
+
|
|
217
|
+
type TPopupOtherProp = {
|
|
218
|
+
children: ReactNode[];
|
|
219
|
+
'data-qa-id'?: string;
|
|
220
|
+
};
|
|
221
|
+
declare const PopupComponent: ({ children, body, mode, height, width, isOpen, evTooglePopup, ...props }: TPopup & TPopupOtherProp) => react_jsx_runtime.JSX.Element;
|
|
222
|
+
|
|
223
|
+
declare function ReactPortalComponent({ children, wrapperId }: {
|
|
224
|
+
children: ReactNode;
|
|
225
|
+
wrapperId?: string;
|
|
226
|
+
}): react_jsx_runtime.JSX.Element;
|
|
227
|
+
|
|
106
228
|
declare const clearList: styled_components.RuleSet<object>;
|
|
107
229
|
declare const responseWidth: styled_components.RuleSet<object>;
|
|
108
230
|
declare const elipsis: styled_components.RuleSet<object>;
|
|
@@ -129,4 +251,36 @@ declare const TabsContent: styled_components_dist_types.IStyledComponentBase<"we
|
|
|
129
251
|
declare const FoContainer: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
130
252
|
declare const InfoGroup: styled_components_dist_types.IStyledComponentBase<"web", styled_components.FastOmit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
131
253
|
|
|
132
|
-
|
|
254
|
+
type TUser = {
|
|
255
|
+
profile_id: number;
|
|
256
|
+
profile_name: string;
|
|
257
|
+
id: number;
|
|
258
|
+
username: string;
|
|
259
|
+
email: string;
|
|
260
|
+
freshchat_restore_id: string | number | null;
|
|
261
|
+
credentials: {
|
|
262
|
+
aws_access_key: string;
|
|
263
|
+
aws_secret_access_key: string;
|
|
264
|
+
aws_bucket_name: string;
|
|
265
|
+
aws_region: string;
|
|
266
|
+
chat_token: string;
|
|
267
|
+
shopee_partner_id: string;
|
|
268
|
+
shopee_partner_key: string;
|
|
269
|
+
};
|
|
270
|
+
has_access_orderV1: boolean;
|
|
271
|
+
};
|
|
272
|
+
type THierarchy = {
|
|
273
|
+
evTooglePopup?: TPopupFunction;
|
|
274
|
+
evCreateMessage?: TMessageFunction;
|
|
275
|
+
evForcePopUp?: TPopupFunction;
|
|
276
|
+
isOpenPopup: boolean;
|
|
277
|
+
modePopup: string;
|
|
278
|
+
pathPopup: string;
|
|
279
|
+
actionPopup: string;
|
|
280
|
+
detailPopup?: TObject;
|
|
281
|
+
evOpenPopup?: TPopupOpenFunction;
|
|
282
|
+
evCloseDropdown?: TCloseDropdownFunction;
|
|
283
|
+
evCreateMessageQuestion?: TMessageQuestionFunction;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
export { ButtonComponent, CheckboxComponent, DropDownComponent as DropdownComponent, FoContainer, HeaderContainer, IconComponent, InfoGroup, InputComponent, type KeysToSnakeCase, LabelComponent, LinkComponent, ListContainer, LoadingComponent, MessageComponent, MessageQuestionComponent, PanelContainer, PanelWrapper, type PartialBy, PopupComponent, ReactPortalComponent, type TChangeEvent, type TCloseDropdownFunction, type TDragEvent, type TDropdown, type TEnterEvent, type TFile, type TFileImage, type THierarchy, type TIdNum, type TIdStr, type TKeyboadEvent, type TMessage, type TMessageFunction, type TMessageQuestion, type TMessageQuestionFunction, type TMouseEvent, type TObject, type TPage, type TPopup, type TPopupContainer, type TPopupFunction, type TPopupFunctionGroup, type TPopupFunctionParam, type TPopupOpenFunction, type TState, type TUser, TabsContainer, TabsContent, TextComponent, Title, type WithRequired, boxBase, clearList, dropBase, elipsis, formLabel, headTable, multiElipsis, responseWidth, thirdElipsis };
|