@jsb188/react 1.1.10 → 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 -16
- package/states/appContext.ts +364 -311
- package/states/connected.ts +135 -11
- package/states/index.ts +1 -1
- package/states/keyDown.ts +32 -27
- package/states/modal.ts +291 -260
- package/states/popOver.ts +268 -229
- package/states/reactiveEvents.ts +56 -0
- package/states/uploads.ts +41 -27
- package/types/PopOver.d.ts +424 -230
- package/utils/hooks.ts +306 -271
- package/utils/schema.ts +144 -132
- package/states/toasts.ts +0 -30
package/types/PopOver.d.ts
CHANGED
|
@@ -1,306 +1,437 @@
|
|
|
1
1
|
import type { ColorEnum } from '@jsb188/app/types/app.d.ts';
|
|
2
|
-
import type { CSSProperties, ElementType } from 'react';
|
|
2
|
+
import type { CSSProperties, ElementType, MouseEvent, ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Utility types
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export interface ClientRectValues {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type POPosition =
|
|
20
|
-
|
|
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
|
+
>;
|
|
21
30
|
|
|
22
31
|
export type POItemValue = string | number | boolean | null;
|
|
32
|
+
export type POPrimitiveStateValue = POItemValue | undefined;
|
|
33
|
+
export interface POStateRecord {
|
|
34
|
+
[key: string]: POStateValue;
|
|
35
|
+
}
|
|
23
36
|
export type POStateValue = any;
|
|
24
37
|
export type POFormState = Record<string, POStateValue>;
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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;
|
|
53
|
+
}
|
|
31
54
|
|
|
32
55
|
/**
|
|
33
56
|
* Pop over list items
|
|
34
57
|
*/
|
|
35
58
|
|
|
36
59
|
export interface POItemBase {
|
|
37
|
-
|
|
38
|
-
|
|
60
|
+
__type: string;
|
|
61
|
+
hidden?: boolean;
|
|
39
62
|
}
|
|
40
63
|
|
|
41
64
|
export interface POListSubtitleObj extends POItemBase {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
65
|
+
__type: 'LIST_SUBTITLE';
|
|
66
|
+
text: string;
|
|
67
|
+
textClassName?: string;
|
|
68
|
+
colorIndicator?: ColorEnum;
|
|
46
69
|
}
|
|
47
70
|
|
|
48
71
|
export type PONListSubtitleObj = POListSubtitleObj;
|
|
49
72
|
|
|
50
73
|
export interface POListBreakObj extends POItemBase {
|
|
51
|
-
|
|
74
|
+
__type: 'BREAK';
|
|
52
75
|
}
|
|
53
76
|
|
|
54
77
|
export interface POActionListItemBase extends POItemBase {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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;
|
|
74
97
|
}
|
|
75
98
|
|
|
76
99
|
export interface POListItemObj extends POActionListItemBase {
|
|
77
|
-
|
|
100
|
+
__type: 'LIST_ITEM' | 'LIST_ITEM_COPY';
|
|
78
101
|
}
|
|
79
102
|
|
|
80
|
-
export interface POCheckListItemObj
|
|
81
|
-
|
|
103
|
+
export interface POCheckListItemObj
|
|
104
|
+
extends Omit<POActionListItemBase, 'onClick' | 'value'> {
|
|
105
|
+
__type: 'CHECK_LIST_ITEM' | 'SINGLE_OPTION_LIST_ITEM';
|
|
106
|
+
value?: POItemValue;
|
|
82
107
|
}
|
|
83
108
|
|
|
84
|
-
export interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
export interface POModalVariables {
|
|
110
|
+
name: string;
|
|
111
|
+
preset?: string;
|
|
112
|
+
color?: ColorEnum | null;
|
|
113
|
+
props?: Record<string, POStateValue>;
|
|
88
114
|
}
|
|
89
115
|
|
|
90
|
-
export interface
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
116
|
+
export interface POModalItemObj extends Omit<POActionListItemBase, 'onClick'> {
|
|
117
|
+
__type: 'LIST_ITEM_POPUP' | 'LIST_ITEM_MODAL';
|
|
118
|
+
variables: POModalVariables;
|
|
119
|
+
useMutationArgs?: POStateValue[];
|
|
120
|
+
}
|
|
121
|
+
|
|
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';
|
|
96
134
|
|
|
97
|
-
export interface
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
135
|
+
export interface POListItemPickerOptionObj {
|
|
136
|
+
iconName: string;
|
|
137
|
+
selectedIconName: string;
|
|
138
|
+
className?: string;
|
|
139
|
+
value: POStateValue;
|
|
140
|
+
}
|
|
141
|
+
|
|
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>);
|
|
106
166
|
}
|
|
107
167
|
|
|
108
168
|
export interface POListColorsObj extends POItemBase {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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;
|
|
178
|
+
}
|
|
179
|
+
|
|
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;
|
|
188
|
+
}
|
|
189
|
+
|
|
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;
|
|
221
|
+
}
|
|
222
|
+
|
|
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;
|
|
125
240
|
}
|
|
126
241
|
|
|
127
242
|
export interface PONavAvatarItemObj extends POItemBase {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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;
|
|
142
257
|
}
|
|
143
258
|
|
|
144
259
|
export interface PODateItemBase extends POItemBase {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
260
|
+
name?: string;
|
|
261
|
+
minDate?: Date;
|
|
262
|
+
maxDate?: Date;
|
|
148
263
|
}
|
|
149
264
|
|
|
150
265
|
export interface PODatePickerObj extends PODateItemBase {
|
|
151
|
-
|
|
266
|
+
__type: 'DATE_PICKER';
|
|
152
267
|
}
|
|
153
268
|
|
|
154
269
|
export interface PODateRangeObj extends PODateItemBase {
|
|
155
|
-
|
|
270
|
+
__type: 'DATE_RANGE';
|
|
156
271
|
}
|
|
157
272
|
|
|
158
273
|
export interface POTextObj extends POItemBase {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
274
|
+
__type: 'TEXT';
|
|
275
|
+
text: string;
|
|
276
|
+
className?: POClassNameValue;
|
|
277
|
+
designClassName?: POClassNameValue;
|
|
163
278
|
}
|
|
164
279
|
|
|
165
280
|
export type POListIfaceItem =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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;
|
|
180
300
|
|
|
181
301
|
/**
|
|
182
302
|
* Pop over ifaces
|
|
183
303
|
*/
|
|
184
304
|
|
|
185
305
|
export interface POListVariables {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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;
|
|
202
322
|
}
|
|
203
323
|
|
|
204
324
|
export interface POListIface {
|
|
205
|
-
|
|
206
|
-
|
|
325
|
+
name: 'PO_LIST';
|
|
326
|
+
variables: POListVariables;
|
|
207
327
|
}
|
|
208
328
|
|
|
209
|
-
export interface POCheckListVariables
|
|
210
|
-
|
|
211
|
-
|
|
329
|
+
export interface POCheckListVariables
|
|
330
|
+
extends Omit<POListVariables, 'options' | 'initialState'> {
|
|
331
|
+
options: POCheckListIfaceItem[];
|
|
332
|
+
initialState?: POItemValue[];
|
|
212
333
|
}
|
|
213
334
|
|
|
214
335
|
export interface POCheckListIface {
|
|
215
|
-
|
|
216
|
-
|
|
336
|
+
name: 'PO_CHECK_LIST';
|
|
337
|
+
variables: POCheckListVariables;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export interface POImageVariables {
|
|
341
|
+
imageUri: string;
|
|
342
|
+
alt?: string;
|
|
343
|
+
rect?: ClientRectValues;
|
|
217
344
|
}
|
|
218
345
|
|
|
219
346
|
export interface POImageIface {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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[];
|
|
226
367
|
}
|
|
227
368
|
|
|
228
369
|
export interface POLabelsAndValuesIface {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
label: string;
|
|
247
|
-
value: string;
|
|
248
|
-
quantity?: number;
|
|
249
|
-
unit?: string;
|
|
250
|
-
}[];
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export type PopOverIface = POListIface | POCheckListIface | POImageIface | POLabelsAndValuesIface;
|
|
255
|
-
export type PopOverName = PopOverIface['name'] | (string & {});
|
|
256
|
-
export type PopOverVariables = PopOverIface['variables'] | Record<string, POStateValue>;
|
|
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'];
|
|
257
387
|
|
|
258
388
|
/**
|
|
259
389
|
* Pop overs
|
|
260
390
|
*/
|
|
261
391
|
|
|
262
392
|
export interface PopOverPositionProps {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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;
|
|
290
421
|
|
|
291
422
|
export interface UpdatePopOverParams extends Record<string, POStateValue> {
|
|
292
|
-
|
|
423
|
+
name: PopOverName;
|
|
293
424
|
}
|
|
294
425
|
|
|
295
426
|
export interface PopOverGlobalStateParams {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
427
|
+
action: 'ITEM' | 'ITEM_AUTO' | 'SUBMIT' | 'MOUNT' | 'UNMOUNT';
|
|
428
|
+
name?: string | null;
|
|
429
|
+
value: POStateValue;
|
|
430
|
+
doNotClosePopOver?: boolean;
|
|
300
431
|
}
|
|
301
432
|
|
|
302
433
|
export interface PopOverGlobalStateObj extends PopOverGlobalStateParams {
|
|
303
|
-
|
|
434
|
+
id?: string;
|
|
304
435
|
}
|
|
305
436
|
|
|
306
437
|
export type OpenPopOverFn = (data: PopOverProps) => void;
|
|
@@ -309,31 +440,94 @@ export type UpdatePopOverFn = (data: UpdatePopOverParams) => void;
|
|
|
309
440
|
export type SetPopOverStateFn = (data: PopOverGlobalStateParams | null) => void;
|
|
310
441
|
|
|
311
442
|
export interface PopOverHandlerProps {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
443
|
+
openPopOver: OpenPopOverFn;
|
|
444
|
+
closePopOver: ClosePopOverFn;
|
|
445
|
+
updatePopOver: UpdatePopOverFn;
|
|
446
|
+
setPopOverState: SetPopOverStateFn;
|
|
316
447
|
}
|
|
317
448
|
|
|
318
449
|
export interface PopOverHookProps extends PopOverHandlerProps {
|
|
319
|
-
|
|
320
|
-
|
|
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;
|
|
321
490
|
}
|
|
322
491
|
|
|
323
492
|
/**
|
|
324
493
|
* Tooltips
|
|
325
494
|
*/
|
|
326
495
|
|
|
327
|
-
export interface TooltipProps extends
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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;
|
|
337
531
|
}
|
|
338
532
|
|
|
339
533
|
export type OpenTooltipFn = (data: TooltipProps) => void;
|
|
@@ -341,11 +535,11 @@ export type CloseTooltipFn = (removeId: string) => void;
|
|
|
341
535
|
export type UpdateTooltipFn = (data: TooltipProps) => void;
|
|
342
536
|
|
|
343
537
|
export interface TooltipHandlerProps {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
538
|
+
openTooltip: OpenTooltipFn;
|
|
539
|
+
closeTooltip: CloseTooltipFn;
|
|
540
|
+
updateTooltip: UpdateTooltipFn;
|
|
347
541
|
}
|
|
348
542
|
|
|
349
543
|
export interface TooltipHookProps extends TooltipHandlerProps {
|
|
350
|
-
|
|
544
|
+
tooltip: TooltipProps | null;
|
|
351
545
|
}
|