@jsb188/react 1.1.8 → 1.1.11
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 +20 -20
- package/states/apiData.ts +18 -14
- package/states/appContext.ts +366 -314
- package/states/connected.ts +135 -11
- package/states/index.ts +1 -1
- package/states/keyDown.ts +32 -27
- package/states/modal.ts +314 -243
- package/states/popOver.ts +270 -223
- package/states/reactiveEvents.ts +56 -0
- package/states/uploads.ts +41 -27
- package/types/PopOver.d.ts +461 -205
- package/utils/hooks.ts +319 -249
- package/utils/schema.ts +146 -129
- package/states/toasts.ts +0 -30
package/types/PopOver.d.ts
CHANGED
|
@@ -1,248 +1,437 @@
|
|
|
1
|
-
import type { ColorEnum } from '@jsb188/app/types/app.d';
|
|
1
|
+
import type { ColorEnum } from '@jsb188/app/types/app.d.ts';
|
|
2
|
+
import type { CSSProperties, ElementType, MouseEvent, ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Utility types
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
export interface ClientRectValues {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
left: number;
|
|
12
|
+
right: number;
|
|
13
|
+
top: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type POPosition =
|
|
20
|
+
| 'top'
|
|
21
|
+
| 'left'
|
|
22
|
+
| 'right'
|
|
23
|
+
| 'bottom'
|
|
24
|
+
| 'bottom_left'
|
|
25
|
+
| 'bottom_right';
|
|
26
|
+
export type AbsolutePosition = Pick<
|
|
27
|
+
CSSProperties,
|
|
28
|
+
'left' | 'right' | 'top' | 'bottom'
|
|
29
|
+
>;
|
|
30
|
+
|
|
31
|
+
export type POItemValue = string | number | boolean | null;
|
|
32
|
+
export type POPrimitiveStateValue = POItemValue | undefined;
|
|
33
|
+
export interface POStateRecord {
|
|
34
|
+
[key: string]: POStateValue;
|
|
35
|
+
}
|
|
36
|
+
export type POStateValue = any;
|
|
37
|
+
export type POFormState = Record<string, POStateValue>;
|
|
38
|
+
export type POClassNameValue = string | false | null | undefined;
|
|
39
|
+
export type POListItemClickFn = {
|
|
40
|
+
bivarianceHack(
|
|
41
|
+
name: string | null,
|
|
42
|
+
value?: POStateValue,
|
|
43
|
+
notEventBased?: boolean,
|
|
44
|
+
dismissOnClick?: boolean,
|
|
45
|
+
): void;
|
|
46
|
+
}['bivarianceHack'];
|
|
47
|
+
|
|
48
|
+
export interface POLabelsAndValuesInputObj {
|
|
49
|
+
label: string;
|
|
50
|
+
value: string;
|
|
51
|
+
quantity?: number;
|
|
52
|
+
unit?: string;
|
|
16
53
|
}
|
|
17
54
|
|
|
18
55
|
/**
|
|
19
|
-
* Pop over
|
|
56
|
+
* Pop over list items
|
|
20
57
|
*/
|
|
21
58
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
text: string;
|
|
26
|
-
textClassName?: string;
|
|
27
|
-
colorIndicator?: ColorEnum;
|
|
59
|
+
export interface POItemBase {
|
|
60
|
+
__type: string;
|
|
61
|
+
hidden?: boolean;
|
|
28
62
|
}
|
|
29
63
|
|
|
30
|
-
export interface
|
|
31
|
-
|
|
32
|
-
|
|
64
|
+
export interface POListSubtitleObj extends POItemBase {
|
|
65
|
+
__type: 'LIST_SUBTITLE';
|
|
66
|
+
text: string;
|
|
67
|
+
textClassName?: string;
|
|
68
|
+
colorIndicator?: ColorEnum;
|
|
33
69
|
}
|
|
34
70
|
|
|
35
|
-
export
|
|
36
|
-
__type: 'LIST_ITEM' | 'CHECK_LIST_ITEM' | 'SINGLE_OPTION_LIST_ITEM' | 'LIST_ITEM_POPUP';
|
|
37
|
-
name?: string; // Name for form, for formValues object; if not set, index will be used
|
|
38
|
-
value?: string | boolean | null;
|
|
39
|
-
text: string;
|
|
40
|
-
className?: string;
|
|
41
|
-
textClassName?: string;
|
|
42
|
-
colorIndicator?: ColorEnum;
|
|
43
|
-
avatarDisplayName?: string;
|
|
44
|
-
photoUri?: string | null;
|
|
45
|
-
LinkComponent?: any;
|
|
46
|
-
allowDisabledOnClick?: boolean;
|
|
47
|
-
iconName?: string;
|
|
48
|
-
rightIconName?: string;
|
|
49
|
-
rightIconClassName?: string;
|
|
50
|
-
selected?: boolean;
|
|
51
|
-
hidden?: boolean;
|
|
52
|
-
disabled?: boolean;
|
|
53
|
-
onClick?: (name: string | null, value?: any) => void; // optional, if you want to bypass globalState handlers
|
|
71
|
+
export type PONListSubtitleObj = POListSubtitleObj;
|
|
54
72
|
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
export interface POListBreakObj extends POItemBase {
|
|
74
|
+
__type: 'BREAK';
|
|
75
|
+
}
|
|
57
76
|
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
export interface POActionListItemBase extends POItemBase {
|
|
78
|
+
name?: string;
|
|
79
|
+
value?: POStateValue;
|
|
80
|
+
text: string;
|
|
81
|
+
description?: string | null;
|
|
82
|
+
className?: POClassNameValue;
|
|
83
|
+
textClassName?: POClassNameValue;
|
|
84
|
+
colorIndicator?: ColorEnum;
|
|
85
|
+
avatarDisplayName?: string;
|
|
86
|
+
photoUri?: string | null;
|
|
87
|
+
LinkComponent?: ElementType;
|
|
88
|
+
allowDisabledOnClick?: boolean;
|
|
89
|
+
iconName?: string;
|
|
90
|
+
rightIconName?: string;
|
|
91
|
+
rightIconClassName?: POClassNameValue;
|
|
92
|
+
selected?: boolean;
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
onClick?: POListItemClickFn;
|
|
95
|
+
preset?: 'small' | 'default';
|
|
96
|
+
to?: string;
|
|
97
|
+
}
|
|
60
98
|
|
|
61
|
-
|
|
62
|
-
|
|
99
|
+
export interface POListItemObj extends POActionListItemBase {
|
|
100
|
+
__type: 'LIST_ITEM' | 'LIST_ITEM_COPY';
|
|
63
101
|
}
|
|
64
102
|
|
|
65
|
-
export interface
|
|
66
|
-
|
|
67
|
-
|
|
103
|
+
export interface POCheckListItemObj
|
|
104
|
+
extends Omit<POActionListItemBase, 'onClick' | 'value'> {
|
|
105
|
+
__type: 'CHECK_LIST_ITEM' | 'SINGLE_OPTION_LIST_ITEM';
|
|
106
|
+
value?: POItemValue;
|
|
68
107
|
}
|
|
69
108
|
|
|
70
|
-
export interface
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
109
|
+
export interface POModalVariables {
|
|
110
|
+
name: string;
|
|
111
|
+
preset?: string;
|
|
112
|
+
color?: ColorEnum | null;
|
|
113
|
+
props?: Record<string, POStateValue>;
|
|
74
114
|
}
|
|
75
115
|
|
|
76
|
-
export interface
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
label: string;
|
|
82
|
-
avatarDisplayName?: string;
|
|
83
|
-
photoUri?: string | null;
|
|
84
|
-
className?: string;
|
|
85
|
-
LinkComponent?: any;
|
|
86
|
-
allowDisabledOnClick?: boolean;
|
|
87
|
-
rightIconName?: string;
|
|
88
|
-
hidden?: boolean;
|
|
89
|
-
square?: boolean;
|
|
90
|
-
disabled?: boolean;
|
|
116
|
+
export interface POModalItemObj extends Omit<POActionListItemBase, 'onClick'> {
|
|
117
|
+
__type: 'LIST_ITEM_POPUP' | 'LIST_ITEM_MODAL';
|
|
118
|
+
variables: POModalVariables;
|
|
119
|
+
useMutationArgs?: POStateValue[];
|
|
120
|
+
}
|
|
91
121
|
|
|
92
|
-
|
|
93
|
-
|
|
122
|
+
export type POListColorValue = ColorEnum | (string & {}) | null;
|
|
123
|
+
export type POListBorderStyleValue =
|
|
124
|
+
| 'outlineAllCells'
|
|
125
|
+
| 'outlineInnerCells'
|
|
126
|
+
| 'outlineInnerVertical'
|
|
127
|
+
| 'outlineInnerHorizontal'
|
|
128
|
+
| 'outlineAllSides'
|
|
129
|
+
| 'outlineLeft'
|
|
130
|
+
| 'outlineTop'
|
|
131
|
+
| 'outlineRight'
|
|
132
|
+
| 'outlineBottom'
|
|
133
|
+
| 'outlineNone';
|
|
134
|
+
|
|
135
|
+
export interface POListItemPickerOptionObj {
|
|
136
|
+
iconName: string;
|
|
137
|
+
selectedIconName: string;
|
|
138
|
+
className?: string;
|
|
139
|
+
value: POStateValue;
|
|
140
|
+
}
|
|
94
141
|
|
|
95
|
-
|
|
96
|
-
|
|
142
|
+
export type POListMutationHandler = (params: {
|
|
143
|
+
variables?: Record<string, POStateValue>;
|
|
144
|
+
}) => void;
|
|
145
|
+
|
|
146
|
+
export interface POListMutationResult {
|
|
147
|
+
allowEdit?: boolean;
|
|
148
|
+
[mutationName: string]: POListMutationHandler | POStateValue;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface POListItemPickerObj
|
|
152
|
+
extends Omit<
|
|
153
|
+
POActionListItemBase,
|
|
154
|
+
'__type' | 'text' | 'value' | 'iconName' | 'onClick'
|
|
155
|
+
> {
|
|
156
|
+
__type: 'LIST_ITEM_PICKER';
|
|
157
|
+
label: string;
|
|
158
|
+
options: POListItemPickerOptionObj[];
|
|
159
|
+
selectedValue?: POStateValue;
|
|
160
|
+
mutationName: string;
|
|
161
|
+
useMutation?: (...args: POStateValue[]) => POListMutationResult;
|
|
162
|
+
useMutationArgs?: POStateValue[];
|
|
163
|
+
mutationVariables?:
|
|
164
|
+
| Record<string, POStateValue>
|
|
165
|
+
| ((value: POStateValue) => Record<string, POStateValue>);
|
|
97
166
|
}
|
|
98
167
|
|
|
99
|
-
export interface
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
168
|
+
export interface POListColorsObj extends POItemBase {
|
|
169
|
+
__type: 'LIST_COLORS';
|
|
170
|
+
name?: string;
|
|
171
|
+
iconName?: string;
|
|
172
|
+
label?: ReactNode;
|
|
173
|
+
onClickCustomize?: POListItemClickFn;
|
|
174
|
+
colors?: readonly POListColorValue[];
|
|
175
|
+
selectedValue?: POListColorValue | null;
|
|
176
|
+
className?: POClassNameValue;
|
|
177
|
+
disabled?: boolean;
|
|
105
178
|
}
|
|
106
179
|
|
|
107
|
-
export interface
|
|
108
|
-
|
|
180
|
+
export interface POListBorderStylesObj extends POItemBase {
|
|
181
|
+
__type: 'LIST_BORDER_STYLES';
|
|
182
|
+
name?: string;
|
|
183
|
+
label?: ReactNode;
|
|
184
|
+
onClickCustomize?: POListItemClickFn;
|
|
185
|
+
selectedValue?: POListBorderStyleValue | null;
|
|
186
|
+
className?: POClassNameValue;
|
|
187
|
+
disabled?: boolean;
|
|
109
188
|
}
|
|
110
189
|
|
|
111
|
-
export interface
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
190
|
+
export interface POListTextFormatControlsObj extends POItemBase {
|
|
191
|
+
__type: 'LIST_TEXT_FORMAT_CONTROLS';
|
|
192
|
+
name?: string;
|
|
193
|
+
markdownName?: string;
|
|
194
|
+
textStyleNames?: {
|
|
195
|
+
bold?: string;
|
|
196
|
+
italic?: string;
|
|
197
|
+
underline?: string;
|
|
198
|
+
strikethrough?: string;
|
|
199
|
+
};
|
|
200
|
+
selectedTextStyles?: {
|
|
201
|
+
bold?: boolean | null;
|
|
202
|
+
italic?: boolean | null;
|
|
203
|
+
underline?: boolean | null;
|
|
204
|
+
strikethrough?: boolean | null;
|
|
205
|
+
};
|
|
206
|
+
fontSizeLabel?: ReactNode;
|
|
207
|
+
textStyleLabel?: ReactNode;
|
|
208
|
+
textStyleButtonLabels?: {
|
|
209
|
+
bold: ReactNode;
|
|
210
|
+
italic: ReactNode;
|
|
211
|
+
markdown?: ReactNode;
|
|
212
|
+
underline: ReactNode;
|
|
213
|
+
strikethrough: ReactNode;
|
|
214
|
+
};
|
|
215
|
+
selectedFontSize?: number | null;
|
|
216
|
+
disableMarkdown?: boolean | null;
|
|
217
|
+
minFontSize?: number;
|
|
218
|
+
maxFontSize?: number;
|
|
219
|
+
className?: POClassNameValue;
|
|
220
|
+
disabled?: boolean;
|
|
117
221
|
}
|
|
118
222
|
|
|
119
|
-
export
|
|
120
|
-
|
|
223
|
+
export interface POListSubmenuObj
|
|
224
|
+
extends Pick<
|
|
225
|
+
POListVariables,
|
|
226
|
+
| 'notReady'
|
|
227
|
+
| 'designClassName'
|
|
228
|
+
| 'shadowClassName'
|
|
229
|
+
| 'className'
|
|
230
|
+
| 'savingValue'
|
|
231
|
+
> {
|
|
232
|
+
initialState?: POFormState | null;
|
|
233
|
+
options: POListIfaceItem[];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface POListSubmenuItemObj
|
|
237
|
+
extends Omit<POActionListItemBase, '__type' | 'onClick'> {
|
|
238
|
+
__type: 'LIST_SUBMENU_ITEM';
|
|
239
|
+
submenu: POListSubmenuObj;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface PONavAvatarItemObj extends POItemBase {
|
|
243
|
+
__type: 'AVATAR_ITEM';
|
|
244
|
+
name?: string;
|
|
245
|
+
value?: POStateValue;
|
|
246
|
+
text: string;
|
|
247
|
+
label: string;
|
|
248
|
+
avatarDisplayName?: string;
|
|
249
|
+
photoUri?: string | null;
|
|
250
|
+
className?: POClassNameValue;
|
|
251
|
+
LinkComponent?: ElementType;
|
|
252
|
+
allowDisabledOnClick?: boolean;
|
|
253
|
+
rightIconName?: string;
|
|
254
|
+
square?: boolean;
|
|
255
|
+
disabled?: boolean;
|
|
256
|
+
to?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface PODateItemBase extends POItemBase {
|
|
260
|
+
name?: string;
|
|
261
|
+
minDate?: Date;
|
|
262
|
+
maxDate?: Date;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export interface PODatePickerObj extends PODateItemBase {
|
|
266
|
+
__type: 'DATE_PICKER';
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface PODateRangeObj extends PODateItemBase {
|
|
270
|
+
__type: 'DATE_RANGE';
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface POTextObj extends POItemBase {
|
|
274
|
+
__type: 'TEXT';
|
|
275
|
+
text: string;
|
|
276
|
+
className?: POClassNameValue;
|
|
277
|
+
designClassName?: POClassNameValue;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export type POListIfaceItem =
|
|
281
|
+
| PONavAvatarItemObj
|
|
282
|
+
| POListSubtitleObj
|
|
283
|
+
| POListBreakObj
|
|
284
|
+
| POListItemObj
|
|
285
|
+
| POCheckListItemObj
|
|
286
|
+
| POListItemPickerObj
|
|
287
|
+
| POListColorsObj
|
|
288
|
+
| POListBorderStylesObj
|
|
289
|
+
| POListTextFormatControlsObj
|
|
290
|
+
| POListSubmenuItemObj
|
|
291
|
+
| POModalItemObj
|
|
292
|
+
| PODatePickerObj
|
|
293
|
+
| PODateRangeObj
|
|
294
|
+
| POTextObj;
|
|
295
|
+
|
|
296
|
+
export type POCheckListIfaceItem =
|
|
297
|
+
| POListSubtitleObj
|
|
298
|
+
| POListBreakObj
|
|
299
|
+
| POCheckListItemObj;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Pop over ifaces
|
|
303
|
+
*/
|
|
304
|
+
|
|
305
|
+
export interface POListVariables {
|
|
306
|
+
notReady?: boolean;
|
|
307
|
+
designClassName?: string;
|
|
308
|
+
shadowClassName?: string;
|
|
309
|
+
className?: string;
|
|
310
|
+
savingValue?: POStateValue;
|
|
311
|
+
iconName?: string;
|
|
312
|
+
title?: string;
|
|
313
|
+
description?: string;
|
|
314
|
+
displayName?: string;
|
|
315
|
+
photoUri?: string | null;
|
|
316
|
+
initialState?: POFormState | POStateValue[] | POStateValue;
|
|
317
|
+
options: POListIfaceItem[];
|
|
318
|
+
addFooterButton?: boolean;
|
|
319
|
+
footerButtonText?: string;
|
|
320
|
+
LinkComponent?: ElementType;
|
|
321
|
+
remainingHeight?: number;
|
|
322
|
+
}
|
|
121
323
|
|
|
122
324
|
export interface POListIface {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
description?: string;
|
|
132
|
-
displayName?: string;
|
|
133
|
-
photoUri?: string | null;
|
|
134
|
-
initialState?: Record<string, any>;
|
|
135
|
-
options: POListIfaceItem[];
|
|
136
|
-
addFooterButton?: boolean;
|
|
137
|
-
footerButtonText?: string;
|
|
138
|
-
LinkComponent?: any;
|
|
139
|
-
remainingHeight?: number; // Auto calc'd from <PopOverWrapper />
|
|
140
|
-
};
|
|
325
|
+
name: 'PO_LIST';
|
|
326
|
+
variables: POListVariables;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export interface POCheckListVariables
|
|
330
|
+
extends Omit<POListVariables, 'options' | 'initialState'> {
|
|
331
|
+
options: POCheckListIfaceItem[];
|
|
332
|
+
initialState?: POItemValue[];
|
|
141
333
|
}
|
|
142
334
|
|
|
143
335
|
export interface POCheckListIface {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
description?: string;
|
|
153
|
-
displayName?: string;
|
|
154
|
-
photoUri?: string | null;
|
|
155
|
-
options: POCheckListIfaceItem[];
|
|
156
|
-
initialState?: (string | null)[];
|
|
157
|
-
addFooterButton?: boolean;
|
|
158
|
-
footerButtonText?: string;
|
|
159
|
-
};
|
|
336
|
+
name: 'PO_CHECK_LIST';
|
|
337
|
+
variables: POCheckListVariables;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface POImageVariables {
|
|
341
|
+
imageUri: string;
|
|
342
|
+
alt?: string;
|
|
343
|
+
rect?: ClientRectValues;
|
|
160
344
|
}
|
|
161
345
|
|
|
162
346
|
export interface POImageIface {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
347
|
+
name: 'PO_VIEW_IMAGE';
|
|
348
|
+
variables: POImageVariables;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export interface POLabelsAndValuesVariables {
|
|
352
|
+
name: string;
|
|
353
|
+
designClassName?: string;
|
|
354
|
+
shadowClassName?: string;
|
|
355
|
+
className?: string;
|
|
356
|
+
addFooterButton?: boolean;
|
|
357
|
+
footerButtonText?: string;
|
|
358
|
+
gridLayoutStyle?: string;
|
|
359
|
+
notReady?: boolean;
|
|
360
|
+
description?: string;
|
|
361
|
+
flipInputOrder?: boolean;
|
|
362
|
+
forceNumericValues?: boolean;
|
|
363
|
+
includeQuantity?: boolean;
|
|
364
|
+
includeUnit?: boolean;
|
|
365
|
+
labels: string[];
|
|
366
|
+
inputs: POLabelsAndValuesInputObj[];
|
|
169
367
|
}
|
|
170
368
|
|
|
171
369
|
export interface POLabelsAndValuesIface {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
quantity?: number;
|
|
190
|
-
}[];
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export type PopOverIface = POListIface | POCheckListIface | POImageIface | POLabelsAndValuesIface;
|
|
370
|
+
name: 'PO_LABELS_AND_VALUES';
|
|
371
|
+
variables: POLabelsAndValuesVariables;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface POReactiveEventsIface {
|
|
375
|
+
name: 'PO_REACTIVE_EVENTS';
|
|
376
|
+
variables: Record<string, never>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export type PopOverIface =
|
|
380
|
+
| POListIface
|
|
381
|
+
| POCheckListIface
|
|
382
|
+
| POImageIface
|
|
383
|
+
| POLabelsAndValuesIface
|
|
384
|
+
| POReactiveEventsIface;
|
|
385
|
+
export type PopOverName = PopOverIface['name'];
|
|
386
|
+
export type PopOverVariables = PopOverIface['variables'];
|
|
195
387
|
|
|
196
388
|
/**
|
|
197
389
|
* Pop overs
|
|
198
390
|
*/
|
|
199
391
|
|
|
200
|
-
export
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
export interface UpdatePopOverParams {
|
|
233
|
-
name: string;
|
|
234
|
-
variables: Record<string, any>;
|
|
392
|
+
export interface PopOverPositionProps {
|
|
393
|
+
className?: string;
|
|
394
|
+
position?: POPosition;
|
|
395
|
+
popOverWidth?: number;
|
|
396
|
+
popOverHeight?: number;
|
|
397
|
+
rect?: ClientRectValues;
|
|
398
|
+
offsetX?: number;
|
|
399
|
+
offsetY?: number;
|
|
400
|
+
leftEdgeThreshold?: number;
|
|
401
|
+
rightEdgeThreshold?: number;
|
|
402
|
+
leftEdgePosition?: number;
|
|
403
|
+
rightEdgePosition?: number;
|
|
404
|
+
hover?: boolean;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
export interface PopOverCommonProps extends PopOverPositionProps {
|
|
408
|
+
id?: string;
|
|
409
|
+
closing?: boolean;
|
|
410
|
+
zClassName?: string;
|
|
411
|
+
animationClassName?: string;
|
|
412
|
+
dismissOnExternalScroll?: boolean;
|
|
413
|
+
doNotTrackHover?: boolean;
|
|
414
|
+
doNotFixToBottom?: boolean;
|
|
415
|
+
doNotRemoveOnPageEvents?: boolean;
|
|
416
|
+
scrollAreaDOMId?: string | null;
|
|
417
|
+
globalState?: PopOverGlobalStateObj | null;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export type PopOverProps = PopOverCommonProps & PopOverIface;
|
|
421
|
+
|
|
422
|
+
export interface UpdatePopOverParams extends Record<string, POStateValue> {
|
|
423
|
+
name: PopOverName;
|
|
235
424
|
}
|
|
236
425
|
|
|
237
426
|
export interface PopOverGlobalStateParams {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
427
|
+
action: 'ITEM' | 'ITEM_AUTO' | 'SUBMIT' | 'MOUNT' | 'UNMOUNT';
|
|
428
|
+
name?: string | null;
|
|
429
|
+
value: POStateValue;
|
|
430
|
+
doNotClosePopOver?: boolean;
|
|
242
431
|
}
|
|
243
432
|
|
|
244
433
|
export interface PopOverGlobalStateObj extends PopOverGlobalStateParams {
|
|
245
|
-
|
|
434
|
+
id?: string;
|
|
246
435
|
}
|
|
247
436
|
|
|
248
437
|
export type OpenPopOverFn = (data: PopOverProps) => void;
|
|
@@ -251,27 +440,94 @@ export type UpdatePopOverFn = (data: UpdatePopOverParams) => void;
|
|
|
251
440
|
export type SetPopOverStateFn = (data: PopOverGlobalStateParams | null) => void;
|
|
252
441
|
|
|
253
442
|
export interface PopOverHandlerProps {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
443
|
+
openPopOver: OpenPopOverFn;
|
|
444
|
+
closePopOver: ClosePopOverFn;
|
|
445
|
+
updatePopOver: UpdatePopOverFn;
|
|
446
|
+
setPopOverState: SetPopOverStateFn;
|
|
258
447
|
}
|
|
259
448
|
|
|
260
449
|
export interface PopOverHookProps extends PopOverHandlerProps {
|
|
261
|
-
|
|
262
|
-
|
|
450
|
+
pathname?: string;
|
|
451
|
+
popOver: PopOverProps | null;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export interface PopOverButtonProps extends PopOverPositionProps {
|
|
455
|
+
activeClassName?: string;
|
|
456
|
+
animationClassName?: string;
|
|
457
|
+
as?: ElementType;
|
|
458
|
+
children: ReactNode;
|
|
459
|
+
className?: string;
|
|
460
|
+
disabled?: boolean;
|
|
461
|
+
dismissOnExternalScroll?: boolean;
|
|
462
|
+
doNotFixToBottom?: boolean;
|
|
463
|
+
doNotRemoveOnPageEvents?: boolean;
|
|
464
|
+
doNotTrackHover?: boolean;
|
|
465
|
+
domId?: string;
|
|
466
|
+
id?: string;
|
|
467
|
+
iface: PopOverIface;
|
|
468
|
+
leftEdgePosition?: number;
|
|
469
|
+
leftEdgeThreshold?: number;
|
|
470
|
+
linkClassName?: string;
|
|
471
|
+
notActiveClassName?: string;
|
|
472
|
+
offsetX?: number;
|
|
473
|
+
offsetY?: number;
|
|
474
|
+
onClick?: (e: MouseEvent) => void;
|
|
475
|
+
popOverClassName?: string;
|
|
476
|
+
position?: POPosition;
|
|
477
|
+
rightEdgePosition?: number;
|
|
478
|
+
rightEdgeThreshold?: number;
|
|
479
|
+
scrollAreaDOMId?: string | null;
|
|
480
|
+
zClassName?: string;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export interface PopOverMoreButtonProps {
|
|
484
|
+
allowActiveTransform?: boolean;
|
|
485
|
+
size?: 'xxs' | 'xs' | 'sm';
|
|
486
|
+
disabled?: boolean;
|
|
487
|
+
editOptions: POListIfaceItem[];
|
|
488
|
+
zClassName?: string;
|
|
489
|
+
borderClassName?: string;
|
|
263
490
|
}
|
|
264
491
|
|
|
265
492
|
/**
|
|
266
493
|
* Tooltips
|
|
267
494
|
*/
|
|
268
495
|
|
|
269
|
-
export interface TooltipProps extends
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
496
|
+
export interface TooltipProps extends Omit<PopOverPositionProps, 'variables'> {
|
|
497
|
+
id?: string;
|
|
498
|
+
absolute?: AbsolutePosition;
|
|
499
|
+
__html?: string;
|
|
500
|
+
title?: string;
|
|
501
|
+
message?: string;
|
|
502
|
+
tooltipClassName?: string;
|
|
503
|
+
fontClassName?: string;
|
|
504
|
+
leftIconName?: string;
|
|
505
|
+
rightIconName?: string;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export interface TooltipButtonProps {
|
|
509
|
+
__html?: string;
|
|
510
|
+
absolute?: AbsolutePosition;
|
|
511
|
+
as?: ElementType;
|
|
512
|
+
children: ReactNode;
|
|
513
|
+
className?: string;
|
|
514
|
+
closeWhilePointerDown?: boolean;
|
|
515
|
+
disabled?: boolean;
|
|
516
|
+
fontClassName?: string;
|
|
517
|
+
leftIconName?: string;
|
|
518
|
+
message?: string;
|
|
519
|
+
messageAfterClick?: string;
|
|
520
|
+
offsetX?: number;
|
|
521
|
+
offsetY?: number;
|
|
522
|
+
onClick?: (e: MouseEvent) => void;
|
|
523
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
524
|
+
position?: POPosition;
|
|
525
|
+
reopenAfterPointerUp?: boolean;
|
|
526
|
+
rightIconName?: string;
|
|
527
|
+
showDelayMs?: number;
|
|
528
|
+
style?: CSSProperties;
|
|
529
|
+
title?: string;
|
|
530
|
+
tooltipClassName?: string;
|
|
275
531
|
}
|
|
276
532
|
|
|
277
533
|
export type OpenTooltipFn = (data: TooltipProps) => void;
|
|
@@ -279,11 +535,11 @@ export type CloseTooltipFn = (removeId: string) => void;
|
|
|
279
535
|
export type UpdateTooltipFn = (data: TooltipProps) => void;
|
|
280
536
|
|
|
281
537
|
export interface TooltipHandlerProps {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
538
|
+
openTooltip: OpenTooltipFn;
|
|
539
|
+
closeTooltip: CloseTooltipFn;
|
|
540
|
+
updateTooltip: UpdateTooltipFn;
|
|
285
541
|
}
|
|
286
542
|
|
|
287
543
|
export interface TooltipHookProps extends TooltipHandlerProps {
|
|
288
|
-
|
|
544
|
+
tooltip: TooltipProps | null;
|
|
289
545
|
}
|