@jsb188/react 1.1.10 → 1.1.12
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/libs/README.md +75 -0
- package/libs/page-filters.helpers.ts +65 -0
- package/libs/page-filters.ts +223 -0
- package/libs/use-page-filters.ts +147 -0
- package/package.json +24 -20
- package/states/apiData.ts +18 -16
- package/states/appContext.ts +327 -312
- package/states/connected.ts +135 -11
- package/states/index.ts +2 -1
- package/states/keyDown.ts +148 -47
- package/states/keyboardLayer.ts +57 -0
- package/states/modal.ts +369 -268
- package/states/popOver.ts +374 -244
- package/states/reactiveEvents.ts +99 -0
- package/states/uploads.ts +39 -27
- package/types/PopOver.d.ts +552 -223
- package/utils/hooks.ts +387 -272
- package/utils/lazy.ts +183 -0
- package/states/toasts.ts +0 -30
- package/utils/schema.ts +0 -158
package/types/PopOver.d.ts
CHANGED
|
@@ -1,180 +1,393 @@
|
|
|
1
1
|
import type { ColorEnum } from '@jsb188/app/types/app.d.ts';
|
|
2
|
-
import type { CSSProperties, ElementType } from 'react';
|
|
2
|
+
import type { AriaAttributes, CSSProperties, ElementType, FocusEvent, KeyboardEvent, 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 =
|
|
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
|
+
/** Above the anchor and centered on it, flipping below when the viewport top would clip it; `top` keeps its left-aligned placement. */
|
|
22
|
+
| 'top_center'
|
|
23
|
+
| 'left'
|
|
24
|
+
| 'right'
|
|
25
|
+
| 'bottom'
|
|
26
|
+
| 'bottom_left'
|
|
27
|
+
| 'bottom_right';
|
|
20
28
|
export type AbsolutePosition = Pick<CSSProperties, 'left' | 'right' | 'top' | 'bottom'>;
|
|
21
29
|
|
|
22
30
|
export type POItemValue = string | number | boolean | null;
|
|
23
|
-
export type
|
|
31
|
+
export type POPrimitiveStateValue = POItemValue | undefined;
|
|
32
|
+
export interface POStateRecord {
|
|
33
|
+
[key: string]: POStateValue;
|
|
34
|
+
}
|
|
35
|
+
export type POStateValue = POPrimitiveStateValue | Date | readonly POStateValue[] | POStateRecord | object;
|
|
24
36
|
export type POFormState = Record<string, POStateValue>;
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
export type POClassNameValue = string | false | null | undefined;
|
|
38
|
+
export type POListItemClickFn = {
|
|
39
|
+
bivarianceHack(name: string | null, value?: POStateValue, notEventBased?: boolean, dismissOnClick?: boolean): void;
|
|
40
|
+
}['bivarianceHack'];
|
|
41
|
+
|
|
42
|
+
export interface POLabelsAndValuesInputObj {
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
quantity?: number;
|
|
46
|
+
unit?: string;
|
|
47
|
+
}
|
|
31
48
|
|
|
32
49
|
/**
|
|
33
50
|
* Pop over list items
|
|
34
51
|
*/
|
|
35
52
|
|
|
36
53
|
export interface POItemBase {
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
__type: string;
|
|
55
|
+
id?: string;
|
|
56
|
+
hidden?: boolean;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
export interface POListSubtitleObj extends POItemBase {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
60
|
+
__type: 'LIST_SUBTITLE';
|
|
61
|
+
text: string;
|
|
62
|
+
textClassName?: string;
|
|
63
|
+
colorIndicator?: ColorEnum;
|
|
46
64
|
}
|
|
47
65
|
|
|
48
66
|
export type PONListSubtitleObj = POListSubtitleObj;
|
|
49
67
|
|
|
68
|
+
export interface POListBannerActionObj {
|
|
69
|
+
name: string;
|
|
70
|
+
text: string;
|
|
71
|
+
value?: POStateValue;
|
|
72
|
+
designClassName?: POClassNameValue;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
loading?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface POListBannerItemObj extends POItemBase {
|
|
78
|
+
__type: 'LIST_BANNER_ITEM';
|
|
79
|
+
title: string;
|
|
80
|
+
subtitle: string;
|
|
81
|
+
description: string;
|
|
82
|
+
actions?: POListBannerActionObj[];
|
|
83
|
+
bannerClassName?: POClassNameValue;
|
|
84
|
+
bannerDesignClassName?: POClassNameValue;
|
|
85
|
+
titleDotColorClassName?: POClassNameValue;
|
|
86
|
+
}
|
|
87
|
+
|
|
50
88
|
export interface POListBreakObj extends POItemBase {
|
|
51
|
-
|
|
89
|
+
__type: 'BREAK';
|
|
52
90
|
}
|
|
53
91
|
|
|
54
92
|
export interface POActionListItemBase extends POItemBase {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
93
|
+
ariaControls?: string;
|
|
94
|
+
ariaExpanded?: boolean;
|
|
95
|
+
ariaHasPopup?: AriaAttributes['aria-haspopup'];
|
|
96
|
+
name?: string;
|
|
97
|
+
value?: POStateValue;
|
|
98
|
+
text: string;
|
|
99
|
+
secondaryText?: string | null;
|
|
100
|
+
description?: string | null;
|
|
101
|
+
className?: POClassNameValue;
|
|
102
|
+
textClassName?: POClassNameValue;
|
|
103
|
+
colorIndicator?: ColorEnum;
|
|
104
|
+
/** CSS color rendered as an icon-sized square after any leading icon. */
|
|
105
|
+
colorValue?: string | null;
|
|
106
|
+
avatarDisplayName?: string;
|
|
107
|
+
photoUri?: string | null;
|
|
108
|
+
LinkComponent?: ElementType;
|
|
109
|
+
allowDisabledOnClick?: boolean;
|
|
110
|
+
iconName?: string;
|
|
111
|
+
rightIconName?: string;
|
|
112
|
+
rightIconClassName?: POClassNameValue;
|
|
113
|
+
rightText?: ReactNode;
|
|
114
|
+
selected?: boolean;
|
|
115
|
+
disabled?: boolean;
|
|
116
|
+
loading?: boolean;
|
|
117
|
+
preserveStyleWhenDisabled?: boolean;
|
|
118
|
+
onClick?: POListItemClickFn;
|
|
119
|
+
preset?: 'delete' | 'delete_hover' | 'small' | 'default';
|
|
120
|
+
to?: string;
|
|
74
121
|
}
|
|
75
122
|
|
|
76
123
|
export interface POListItemObj extends POActionListItemBase {
|
|
77
|
-
|
|
124
|
+
__type: 'LIST_ITEM' | 'LIST_ITEM_COPY';
|
|
125
|
+
/** Defaults to mt_4; an empty string removes the description's added spacing. */
|
|
126
|
+
descriptionSpacingClassName?: string;
|
|
127
|
+
truncateText?: boolean;
|
|
78
128
|
}
|
|
79
129
|
|
|
80
|
-
export interface POCheckListItemObj extends Omit<POActionListItemBase, 'onClick'> {
|
|
81
|
-
|
|
130
|
+
export interface POCheckListItemObj extends Omit<POActionListItemBase, 'onClick' | 'value'> {
|
|
131
|
+
__type: 'CHECK_LIST_ITEM' | 'SINGLE_OPTION_LIST_ITEM';
|
|
132
|
+
value?: POItemValue;
|
|
82
133
|
}
|
|
83
134
|
|
|
84
|
-
export interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
135
|
+
export interface POModalVariables {
|
|
136
|
+
name: string;
|
|
137
|
+
preset?: string;
|
|
138
|
+
color?: ColorEnum | null;
|
|
139
|
+
props?: Record<string, POStateValue>;
|
|
88
140
|
}
|
|
89
141
|
|
|
142
|
+
export interface POModalItemObj extends Omit<POActionListItemBase, 'onClick'> {
|
|
143
|
+
__type: 'LIST_ITEM_POPUP' | 'LIST_ITEM_MODAL';
|
|
144
|
+
variables: POModalVariables;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type POListColorValue = ColorEnum | (string & {}) | null;
|
|
148
|
+
|
|
149
|
+
export interface POLayoutDesignerObj extends POItemBase {
|
|
150
|
+
__type: 'LAYOUT_DESIGNER';
|
|
151
|
+
canvasColor: string;
|
|
152
|
+
contentColor: string;
|
|
153
|
+
contentWidth: number;
|
|
154
|
+
contentWidthMax: number;
|
|
155
|
+
contentWidthMin: number;
|
|
156
|
+
disabled: boolean;
|
|
157
|
+
fontFamily: string;
|
|
158
|
+
linkColor: string;
|
|
159
|
+
onChangeCanvasColor: (value: string) => void;
|
|
160
|
+
onChangeContentColor: (value: string) => void;
|
|
161
|
+
onChangeContentWidth: (value: number) => void;
|
|
162
|
+
onChangePadding: (value: string) => void;
|
|
163
|
+
padding: string;
|
|
164
|
+
textColor: string;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type POListBorderStyleValue =
|
|
168
|
+
| 'outlineAllCells'
|
|
169
|
+
| 'outlineInnerCells'
|
|
170
|
+
| 'outlineInnerVertical'
|
|
171
|
+
| 'outlineInnerHorizontal'
|
|
172
|
+
| 'outlineAllSides'
|
|
173
|
+
| 'outlineLeft'
|
|
174
|
+
| 'outlineTop'
|
|
175
|
+
| 'outlineRight'
|
|
176
|
+
| 'outlineBottom'
|
|
177
|
+
| 'outlineNone';
|
|
178
|
+
|
|
90
179
|
export interface POListItemPickerOptionObj {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
180
|
+
ariaLabel: string;
|
|
181
|
+
iconName: string;
|
|
182
|
+
selectedIconName: string;
|
|
183
|
+
className?: string;
|
|
184
|
+
value: POStateValue;
|
|
95
185
|
}
|
|
96
186
|
|
|
97
187
|
export interface POListItemPickerObj extends Omit<POActionListItemBase, '__type' | 'text' | 'value' | 'iconName' | 'onClick'> {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
mutationVariables?: Record<string, POStateValue> | ((value: POStateValue) => Record<string, POStateValue>);
|
|
188
|
+
__type: 'LIST_ITEM_PICKER';
|
|
189
|
+
label: string;
|
|
190
|
+
options: POListItemPickerOptionObj[];
|
|
191
|
+
selectedValue?: POStateValue;
|
|
192
|
+
allowEdit?: boolean;
|
|
193
|
+
/** Return false or reject to keep the picker open without committing its selection. */
|
|
194
|
+
onSelect: (value: POStateValue) => boolean | undefined | Promise<boolean | undefined>;
|
|
106
195
|
}
|
|
107
196
|
|
|
108
197
|
export interface POListColorsObj extends POItemBase {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
198
|
+
__type: 'LIST_COLORS';
|
|
199
|
+
name?: string;
|
|
200
|
+
iconName?: string;
|
|
201
|
+
label?: ReactNode;
|
|
202
|
+
onClickCustomize?: POListItemClickFn;
|
|
203
|
+
colors?: readonly POListColorValue[];
|
|
204
|
+
colorsPerRow?: number;
|
|
205
|
+
hideReset?: boolean;
|
|
206
|
+
selectedValue?: POListColorValue | null;
|
|
207
|
+
className?: POClassNameValue;
|
|
208
|
+
disabled?: boolean;
|
|
209
|
+
stretchToFit?: boolean;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface POListBoxItemOptionObj {
|
|
213
|
+
className?: POClassNameValue;
|
|
214
|
+
iconName?: string;
|
|
215
|
+
text: ReactNode;
|
|
216
|
+
value: POItemValue;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface POListBoxItemsObj extends POItemBase {
|
|
220
|
+
__type: 'LIST_BOX_ITEMS';
|
|
221
|
+
boxesPerRow: number;
|
|
222
|
+
name?: string;
|
|
223
|
+
options: readonly POListBoxItemOptionObj[];
|
|
224
|
+
selectedClassName?: POClassNameValue;
|
|
225
|
+
selectedValue?: POItemValue;
|
|
226
|
+
unselectedClassName?: POClassNameValue;
|
|
227
|
+
className?: POClassNameValue;
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface POListBorderStylesObj extends POItemBase {
|
|
232
|
+
__type: 'LIST_BORDER_STYLES';
|
|
233
|
+
name?: string;
|
|
234
|
+
label?: ReactNode;
|
|
235
|
+
onClickCustomize?: POListItemClickFn;
|
|
236
|
+
selectedValue?: POListBorderStyleValue | null;
|
|
237
|
+
className?: POClassNameValue;
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export interface POListTextFormatControlsObj extends POItemBase {
|
|
242
|
+
__type: 'LIST_TEXT_FORMAT_CONTROLS';
|
|
243
|
+
name?: string;
|
|
244
|
+
markdownName?: string;
|
|
245
|
+
textStyleNames?: {
|
|
246
|
+
bold?: string;
|
|
247
|
+
italic?: string;
|
|
248
|
+
underline?: string;
|
|
249
|
+
strikethrough?: string;
|
|
250
|
+
};
|
|
251
|
+
selectedTextStyles?: {
|
|
252
|
+
bold?: boolean | null;
|
|
253
|
+
italic?: boolean | null;
|
|
254
|
+
underline?: boolean | null;
|
|
255
|
+
strikethrough?: boolean | null;
|
|
256
|
+
};
|
|
257
|
+
fontSizeLabel?: ReactNode;
|
|
258
|
+
textStyleLabel?: ReactNode;
|
|
259
|
+
textStyleButtonLabels?: {
|
|
260
|
+
bold: ReactNode;
|
|
261
|
+
italic: ReactNode;
|
|
262
|
+
markdown?: ReactNode;
|
|
263
|
+
underline: ReactNode;
|
|
264
|
+
strikethrough: ReactNode;
|
|
265
|
+
};
|
|
266
|
+
selectedFontSize?: number | null;
|
|
267
|
+
disableMarkdown?: boolean | null;
|
|
268
|
+
minFontSize?: number;
|
|
269
|
+
maxFontSize?: number;
|
|
270
|
+
className?: POClassNameValue;
|
|
271
|
+
disabled?: boolean;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface POListSubmenuObj
|
|
275
|
+
extends Pick<
|
|
276
|
+
POListVariables,
|
|
277
|
+
| 'notReady'
|
|
278
|
+
| 'designClassName'
|
|
279
|
+
| 'fontSizeClassName'
|
|
280
|
+
| 'shadowClassName'
|
|
281
|
+
| 'className'
|
|
282
|
+
| 'savingValue'
|
|
283
|
+
| 'addFooterButton'
|
|
284
|
+
| 'footerButtonText'
|
|
285
|
+
> {
|
|
286
|
+
initialState?: POFormState | null;
|
|
287
|
+
/** `initial` seeds once per mounted submenu; `controlled` adopts later `initialState` changes. */
|
|
288
|
+
stateMode?: 'initial' | 'controlled';
|
|
289
|
+
options: POListIfaceItem[];
|
|
120
290
|
}
|
|
121
291
|
|
|
122
292
|
export interface POListSubmenuItemObj extends Omit<POActionListItemBase, '__type' | 'onClick'> {
|
|
123
|
-
|
|
124
|
-
|
|
293
|
+
__type: 'LIST_SUBMENU_ITEM';
|
|
294
|
+
/** Stable identity used to reconcile this submenu while its definition changes. */
|
|
295
|
+
id: string;
|
|
296
|
+
submenu: POListSubmenuObj;
|
|
125
297
|
}
|
|
126
298
|
|
|
127
299
|
export interface PONavAvatarItemObj extends POItemBase {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
300
|
+
__type: 'AVATAR_ITEM';
|
|
301
|
+
name?: string;
|
|
302
|
+
value?: POStateValue;
|
|
303
|
+
text: string;
|
|
304
|
+
label: string;
|
|
305
|
+
avatarDisplayName?: string;
|
|
306
|
+
photoUri?: string | null;
|
|
307
|
+
className?: POClassNameValue;
|
|
308
|
+
LinkComponent?: ElementType;
|
|
309
|
+
allowDisabledOnClick?: boolean;
|
|
310
|
+
rightIconName?: string;
|
|
311
|
+
square?: boolean;
|
|
312
|
+
disabled?: boolean;
|
|
313
|
+
loading?: boolean;
|
|
314
|
+
to?: string;
|
|
142
315
|
}
|
|
143
316
|
|
|
144
317
|
export interface PODateItemBase extends POItemBase {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
318
|
+
name: string;
|
|
319
|
+
minDate?: Date;
|
|
320
|
+
maxDate?: Date;
|
|
148
321
|
}
|
|
149
322
|
|
|
150
323
|
export interface PODatePickerObj extends PODateItemBase {
|
|
151
|
-
|
|
324
|
+
__type: 'DATE_PICKER';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface POTimePickerObj extends POItemBase {
|
|
328
|
+
__type: 'TIME_PICKER';
|
|
329
|
+
name: string;
|
|
330
|
+
minTime?: string;
|
|
331
|
+
maxTime?: string;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface PODateTimePickerObj extends PODateItemBase {
|
|
335
|
+
__type: 'DATE_TIME_PICKER';
|
|
336
|
+
disabled?: boolean;
|
|
337
|
+
defaultHour?: number;
|
|
338
|
+
defaultMinute?: number;
|
|
339
|
+
defaultPeriod?: 'AM' | 'PM';
|
|
340
|
+
minTime?: string;
|
|
341
|
+
maxTime?: string;
|
|
342
|
+
submitText?: ReactNode;
|
|
152
343
|
}
|
|
153
344
|
|
|
154
345
|
export interface PODateRangeObj extends PODateItemBase {
|
|
155
|
-
|
|
346
|
+
__type: 'DATE_RANGE';
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface POInputObj extends POItemBase {
|
|
350
|
+
__type: 'INPUT';
|
|
351
|
+
name: string;
|
|
352
|
+
preset?: 'tiny';
|
|
353
|
+
type?: 'text' | 'search' | 'email' | 'url' | 'tel' | 'password';
|
|
354
|
+
label?: string;
|
|
355
|
+
ariaLabel?: string;
|
|
356
|
+
placeholder?: string;
|
|
357
|
+
autoFocus?: boolean;
|
|
358
|
+
disabled?: boolean;
|
|
359
|
+
maxLength?: number;
|
|
156
360
|
}
|
|
157
361
|
|
|
158
362
|
export interface POTextObj extends POItemBase {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
363
|
+
__type: 'TEXT';
|
|
364
|
+
fontClassName?: string;
|
|
365
|
+
text: string;
|
|
366
|
+
className?: POClassNameValue;
|
|
367
|
+
designClassName?: POClassNameValue;
|
|
163
368
|
}
|
|
164
369
|
|
|
165
370
|
export type POListIfaceItem =
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
371
|
+
| PONavAvatarItemObj
|
|
372
|
+
| POListSubtitleObj
|
|
373
|
+
| POListBannerItemObj
|
|
374
|
+
| POListBreakObj
|
|
375
|
+
| POListItemObj
|
|
376
|
+
| POCheckListItemObj
|
|
377
|
+
| POListItemPickerObj
|
|
378
|
+
| POLayoutDesignerObj
|
|
379
|
+
| POListColorsObj
|
|
380
|
+
| POListBoxItemsObj
|
|
381
|
+
| POListBorderStylesObj
|
|
382
|
+
| POListTextFormatControlsObj
|
|
383
|
+
| POListSubmenuItemObj
|
|
384
|
+
| POModalItemObj
|
|
385
|
+
| PODatePickerObj
|
|
386
|
+
| POTimePickerObj
|
|
387
|
+
| PODateTimePickerObj
|
|
388
|
+
| PODateRangeObj
|
|
389
|
+
| POTextObj
|
|
390
|
+
| POInputObj;
|
|
178
391
|
|
|
179
392
|
export type POCheckListIfaceItem = POListSubtitleObj | POListBreakObj | POCheckListItemObj;
|
|
180
393
|
|
|
@@ -183,157 +396,273 @@ export type POCheckListIfaceItem = POListSubtitleObj | POListBreakObj | POCheckL
|
|
|
183
396
|
*/
|
|
184
397
|
|
|
185
398
|
export interface POListVariables {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
399
|
+
fontSizeClassName?: string;
|
|
400
|
+
notReady?: boolean;
|
|
401
|
+
designClassName?: string;
|
|
402
|
+
shadowClassName?: string;
|
|
403
|
+
className?: string;
|
|
404
|
+
savingValue?: POStateValue;
|
|
405
|
+
iconName?: string;
|
|
406
|
+
title?: string;
|
|
407
|
+
description?: string;
|
|
408
|
+
displayName?: string;
|
|
409
|
+
photoUri?: string | null;
|
|
410
|
+
initialState?: POFormState | POStateValue[] | POStateValue;
|
|
411
|
+
/** `initial` seeds once per popover instance; `controlled` adopts later `initialState` changes. */
|
|
412
|
+
stateMode?: 'initial' | 'controlled';
|
|
413
|
+
options: POListIfaceItem[];
|
|
414
|
+
addFooterButton?: boolean;
|
|
415
|
+
footerButtonText?: string;
|
|
416
|
+
LinkComponent?: ElementType;
|
|
417
|
+
remainingHeight?: number;
|
|
202
418
|
}
|
|
203
419
|
|
|
204
420
|
export interface POListIface {
|
|
205
|
-
|
|
206
|
-
|
|
421
|
+
name: 'PO_LIST';
|
|
422
|
+
variables: POListVariables;
|
|
207
423
|
}
|
|
208
424
|
|
|
209
425
|
export interface POCheckListVariables extends Omit<POListVariables, 'options' | 'initialState'> {
|
|
210
|
-
|
|
211
|
-
|
|
426
|
+
options: POCheckListIfaceItem[];
|
|
427
|
+
initialState?: POItemValue[];
|
|
212
428
|
}
|
|
213
429
|
|
|
214
430
|
export interface POCheckListIface {
|
|
215
|
-
|
|
216
|
-
|
|
431
|
+
name: 'PO_CHECK_LIST';
|
|
432
|
+
variables: POCheckListVariables;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export interface POImageVariables {
|
|
436
|
+
imageUri: string;
|
|
437
|
+
alt?: string;
|
|
438
|
+
rect?: ClientRectValues;
|
|
217
439
|
}
|
|
218
440
|
|
|
219
441
|
export interface POImageIface {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
442
|
+
name: 'PO_VIEW_IMAGE';
|
|
443
|
+
variables: POImageVariables;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export interface POLabelsAndValuesVariables {
|
|
447
|
+
name: string;
|
|
448
|
+
designClassName?: string;
|
|
449
|
+
shadowClassName?: string;
|
|
450
|
+
className?: string;
|
|
451
|
+
addFooterButton?: boolean;
|
|
452
|
+
footerButtonText?: string;
|
|
453
|
+
gridLayoutStyle?: string;
|
|
454
|
+
notReady?: boolean;
|
|
455
|
+
description?: string;
|
|
456
|
+
flipInputOrder?: boolean;
|
|
457
|
+
forceNumericValues?: boolean;
|
|
458
|
+
includeQuantity?: boolean;
|
|
459
|
+
includeUnit?: boolean;
|
|
460
|
+
labels: string[];
|
|
461
|
+
inputs: POLabelsAndValuesInputObj[];
|
|
226
462
|
}
|
|
227
463
|
|
|
228
464
|
export interface POLabelsAndValuesIface {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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>;
|
|
465
|
+
name: 'PO_LABELS_AND_VALUES';
|
|
466
|
+
variables: POLabelsAndValuesVariables;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export interface POReactiveEventsIface {
|
|
470
|
+
name: 'PO_REACTIVE_EVENTS';
|
|
471
|
+
variables: Record<string, never>;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface POContentIface {
|
|
475
|
+
name: 'PO_CONTENT';
|
|
476
|
+
variables: {
|
|
477
|
+
children: ReactNode;
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export type PopOverIface =
|
|
482
|
+
| POListIface
|
|
483
|
+
| POCheckListIface
|
|
484
|
+
| POImageIface
|
|
485
|
+
| POLabelsAndValuesIface
|
|
486
|
+
| POReactiveEventsIface
|
|
487
|
+
| POContentIface;
|
|
488
|
+
export type PopOverName = PopOverIface['name'];
|
|
489
|
+
export type PopOverVariables = PopOverIface['variables'];
|
|
257
490
|
|
|
258
491
|
/**
|
|
259
492
|
* Pop overs
|
|
260
493
|
*/
|
|
261
494
|
|
|
262
495
|
export interface PopOverPositionProps {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
hover: boolean;
|
|
496
|
+
className?: string;
|
|
497
|
+
position?: POPosition;
|
|
498
|
+
popOverWidth?: number;
|
|
499
|
+
popOverHeight?: number;
|
|
500
|
+
rect?: ClientRectValues;
|
|
501
|
+
offsetX?: number;
|
|
502
|
+
offsetY?: number;
|
|
503
|
+
leftEdgeThreshold?: number;
|
|
504
|
+
rightEdgeThreshold?: number;
|
|
505
|
+
leftEdgePosition?: number;
|
|
506
|
+
rightEdgePosition?: number;
|
|
507
|
+
hover?: boolean;
|
|
276
508
|
}
|
|
277
509
|
|
|
278
|
-
export interface
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
510
|
+
export interface PopOverCommonProps extends PopOverPositionProps {
|
|
511
|
+
id?: string;
|
|
512
|
+
instanceId?: string;
|
|
513
|
+
closing?: boolean;
|
|
514
|
+
style?: CSSProperties;
|
|
515
|
+
zClassName?: string;
|
|
516
|
+
animationClassName?: string;
|
|
517
|
+
dismissOnExternalScroll?: boolean;
|
|
518
|
+
doNotTrackHover?: boolean;
|
|
519
|
+
doNotFixToBottom?: boolean;
|
|
520
|
+
doNotRemoveOnPageEvents?: boolean;
|
|
521
|
+
scrollAreaDOMId?: string | null;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export type PopOverProps = PopOverCommonProps & PopOverIface;
|
|
525
|
+
|
|
526
|
+
export interface UpdatePopOverParams {
|
|
527
|
+
iface: PopOverIface;
|
|
289
528
|
}
|
|
290
529
|
|
|
291
|
-
export interface
|
|
292
|
-
|
|
530
|
+
export interface PopOverEventParams {
|
|
531
|
+
action: 'ITEM' | 'ITEM_AUTO' | 'SUBMIT' | 'MOUNT' | 'UNMOUNT';
|
|
532
|
+
name?: string | null;
|
|
533
|
+
value: POStateValue;
|
|
534
|
+
doNotClosePopOver?: boolean;
|
|
293
535
|
}
|
|
294
536
|
|
|
295
|
-
export interface
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
537
|
+
export interface PopOverEventObj extends PopOverEventParams {
|
|
538
|
+
id?: string;
|
|
539
|
+
/** Monotonically increasing identity for deduplicating user events. */
|
|
540
|
+
eventId: number;
|
|
541
|
+
/** Identity of the single open session that emitted this event. */
|
|
542
|
+
instanceId: string;
|
|
300
543
|
}
|
|
301
544
|
|
|
302
|
-
export interface
|
|
303
|
-
|
|
545
|
+
export interface PopOverEventFilter {
|
|
546
|
+
instanceId?: string | null;
|
|
547
|
+
popOverId?: string | null;
|
|
304
548
|
}
|
|
305
549
|
|
|
306
550
|
export type OpenPopOverFn = (data: PopOverProps) => void;
|
|
307
|
-
export type ClosePopOverFn = (
|
|
551
|
+
export type ClosePopOverFn = (dismissIf?: string | { id?: string; name?: string }) => void;
|
|
308
552
|
export type UpdatePopOverFn = (data: UpdatePopOverParams) => void;
|
|
309
|
-
export type
|
|
553
|
+
export type PublishPopOverEventFn = (data: PopOverEventParams) => void;
|
|
554
|
+
export type AcknowledgePopOverEventFn = (eventId: number) => void;
|
|
310
555
|
|
|
311
556
|
export interface PopOverHandlerProps {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
557
|
+
openPopOver: OpenPopOverFn;
|
|
558
|
+
closePopOver: ClosePopOverFn;
|
|
559
|
+
updatePopOver: UpdatePopOverFn;
|
|
560
|
+
publishPopOverEvent: PublishPopOverEventFn;
|
|
316
561
|
}
|
|
317
562
|
|
|
318
563
|
export interface PopOverHookProps extends PopOverHandlerProps {
|
|
319
|
-
|
|
320
|
-
|
|
564
|
+
acknowledgePopOverEvent: AcknowledgePopOverEventFn;
|
|
565
|
+
pathname?: string;
|
|
566
|
+
popOver: PopOverProps | null;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export interface PopOverButtonProps extends PopOverPositionProps {
|
|
570
|
+
activeClassName?: string;
|
|
571
|
+
animationClassName?: string;
|
|
572
|
+
ariaLabel?: string;
|
|
573
|
+
as?: ElementType;
|
|
574
|
+
children: ReactNode;
|
|
575
|
+
className?: string;
|
|
576
|
+
disabled?: boolean;
|
|
577
|
+
dismissOnExternalScroll?: boolean;
|
|
578
|
+
doNotFixToBottom?: boolean;
|
|
579
|
+
doNotRemoveOnPageEvents?: boolean;
|
|
580
|
+
doNotTrackHover?: boolean;
|
|
581
|
+
domId?: string;
|
|
582
|
+
id?: string;
|
|
583
|
+
iface: PopOverIface;
|
|
584
|
+
/** Build the interface synchronously only when a closed trigger opens. */
|
|
585
|
+
getOpenIface?: () => PopOverIface;
|
|
586
|
+
leftEdgePosition?: number;
|
|
587
|
+
leftEdgeThreshold?: number;
|
|
588
|
+
linkClassName?: string;
|
|
589
|
+
matchTriggerWidth?: boolean;
|
|
590
|
+
notActiveClassName?: string;
|
|
591
|
+
offsetX?: number;
|
|
592
|
+
offsetY?: number;
|
|
593
|
+
onClick?: (e: MouseEvent) => void;
|
|
594
|
+
popOverClassName?: string;
|
|
595
|
+
position?: POPosition;
|
|
596
|
+
rightEdgePosition?: number;
|
|
597
|
+
rightEdgeThreshold?: number;
|
|
598
|
+
scrollAreaDOMId?: string | null;
|
|
599
|
+
/** Update the active popover when its trigger-owned interface meaningfully changes. */
|
|
600
|
+
syncOpenIface?: boolean;
|
|
601
|
+
/** Stable semantic value that changes when an already-open interface should be synchronized. */
|
|
602
|
+
syncOpenIfaceKey?: unknown;
|
|
603
|
+
tabIndex?: number;
|
|
604
|
+
title?: string;
|
|
605
|
+
zClassName?: string;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
export interface PopOverMoreButtonProps {
|
|
609
|
+
allowActiveTransform?: boolean;
|
|
610
|
+
id?: string;
|
|
611
|
+
size?: 'xxs' | 'xs' | 'sm';
|
|
612
|
+
disabled?: boolean;
|
|
613
|
+
editOptions: POListIfaceItem[];
|
|
614
|
+
zClassName?: string;
|
|
615
|
+
borderClassName?: string;
|
|
616
|
+
syncOpenIface?: boolean;
|
|
617
|
+
syncOpenIfaceKey?: unknown;
|
|
321
618
|
}
|
|
322
619
|
|
|
323
620
|
/**
|
|
324
621
|
* Tooltips
|
|
325
622
|
*/
|
|
326
623
|
|
|
327
|
-
export interface TooltipProps extends
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
624
|
+
export interface TooltipProps extends Omit<PopOverPositionProps, 'variables'> {
|
|
625
|
+
id?: string;
|
|
626
|
+
absolute?: AbsolutePosition;
|
|
627
|
+
__html?: string;
|
|
628
|
+
title?: string;
|
|
629
|
+
message?: string;
|
|
630
|
+
tooltipClassName?: string;
|
|
631
|
+
fontClassName?: string;
|
|
632
|
+
leftIconName?: string;
|
|
633
|
+
rightIconName?: string;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export interface TooltipButtonProps {
|
|
637
|
+
type?: 'button' | 'submit' | 'reset';
|
|
638
|
+
__html?: string;
|
|
639
|
+
absolute?: AbsolutePosition;
|
|
640
|
+
ariaLabel?: string;
|
|
641
|
+
as?: ElementType;
|
|
642
|
+
children: ReactNode;
|
|
643
|
+
className?: string;
|
|
644
|
+
closeWhilePointerDown?: boolean;
|
|
645
|
+
disabled?: boolean;
|
|
646
|
+
fontClassName?: string;
|
|
647
|
+
hideDelayMs?: number;
|
|
648
|
+
leftIconName?: string;
|
|
649
|
+
message?: string;
|
|
650
|
+
messageAfterClick?: string;
|
|
651
|
+
offsetX?: number;
|
|
652
|
+
offsetY?: number;
|
|
653
|
+
onBlur?: (e: FocusEvent<HTMLElement>) => void;
|
|
654
|
+
onClick?: (e: MouseEvent) => void;
|
|
655
|
+
onFocus?: (e: FocusEvent<HTMLElement>) => void;
|
|
656
|
+
onKeyDown?: (e: KeyboardEvent<HTMLElement>) => void;
|
|
657
|
+
onMouseEnter?: (e: MouseEvent) => void;
|
|
658
|
+
position?: POPosition;
|
|
659
|
+
reopenAfterPointerUp?: boolean;
|
|
660
|
+
rightIconName?: string;
|
|
661
|
+
showDelayMs?: number;
|
|
662
|
+
showTooltipWhenDisabled?: boolean;
|
|
663
|
+
style?: CSSProperties;
|
|
664
|
+
title?: string;
|
|
665
|
+
tooltipClassName?: string;
|
|
337
666
|
}
|
|
338
667
|
|
|
339
668
|
export type OpenTooltipFn = (data: TooltipProps) => void;
|
|
@@ -341,11 +670,11 @@ export type CloseTooltipFn = (removeId: string) => void;
|
|
|
341
670
|
export type UpdateTooltipFn = (data: TooltipProps) => void;
|
|
342
671
|
|
|
343
672
|
export interface TooltipHandlerProps {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
673
|
+
openTooltip: OpenTooltipFn;
|
|
674
|
+
closeTooltip: CloseTooltipFn;
|
|
675
|
+
updateTooltip: UpdateTooltipFn;
|
|
347
676
|
}
|
|
348
677
|
|
|
349
678
|
export interface TooltipHookProps extends TooltipHandlerProps {
|
|
350
|
-
|
|
679
|
+
tooltip: TooltipProps | null;
|
|
351
680
|
}
|