@darajs/ui-components 1.9.5 → 1.9.6
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/combo-box/combo-box.d.ts +1 -290
- package/dist/combo-box/combo-box.d.ts.map +1 -1
- package/dist/combo-box/combo-box.js +12 -37
- package/dist/combo-box/combo-box.js.map +1 -1
- package/dist/context-menu/context-menu.d.ts +1 -1
- package/dist/context-menu/context-menu.d.ts.map +1 -1
- package/dist/context-menu/context-menu.js +9 -11
- package/dist/context-menu/context-menu.js.map +1 -1
- package/dist/datepicker/datepicker-select.d.ts +0 -2
- package/dist/datepicker/datepicker-select.d.ts.map +1 -1
- package/dist/datepicker/datepicker-select.js +34 -30
- package/dist/datepicker/datepicker-select.js.map +1 -1
- package/dist/filter/datetime-filter.d.ts.map +1 -1
- package/dist/filter/datetime-filter.js +2 -27
- package/dist/filter/datetime-filter.js.map +1 -1
- package/dist/multiselect/multiselect.d.ts.map +1 -1
- package/dist/multiselect/multiselect.js +12 -52
- package/dist/multiselect/multiselect.js.map +1 -1
- package/dist/sectioned-list/sectioned-list.d.ts +1 -1
- package/dist/sectioned-list/sectioned-list.d.ts.map +1 -1
- package/dist/sectioned-list/sectioned-list.js +37 -34
- package/dist/sectioned-list/sectioned-list.js.map +1 -1
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select/select.js +8 -25
- package/dist/select/select.js.map +1 -1
- package/dist/shared/chevron-button.d.ts +13 -0
- package/dist/shared/chevron-button.d.ts.map +1 -0
- package/dist/shared/chevron-button.js +35 -0
- package/dist/shared/chevron-button.js.map +1 -0
- package/dist/shared/dropdown-list.d.ts +34 -0
- package/dist/shared/dropdown-list.d.ts.map +1 -0
- package/dist/shared/dropdown-list.js +27 -0
- package/dist/shared/dropdown-list.js.map +1 -0
- package/dist/shared/list-item.d.ts +35 -0
- package/dist/shared/list-item.d.ts.map +1 -0
- package/dist/shared/list-item.js +66 -0
- package/dist/shared/list-item.js.map +1 -0
- package/dist/utils/chevron.d.ts +1 -1
- package/dist/utils/chevron.d.ts.map +1 -1
- package/dist/utils/chevron.js +2 -4
- package/dist/utils/chevron.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/list-styles.d.ts +2 -6
- package/dist/utils/list-styles.d.ts.map +1 -1
- package/dist/utils/list-styles.js +9 -24
- package/dist/utils/list-styles.js.map +1 -1
- package/dist/utils/syncKbdHighlightIdx.d.ts +23 -0
- package/dist/utils/syncKbdHighlightIdx.d.ts.map +1 -0
- package/dist/utils/syncKbdHighlightIdx.js +41 -0
- package/dist/utils/syncKbdHighlightIdx.js.map +1 -0
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { InteractiveComponentProps, Item } from '../types';
|
|
3
3
|
interface WrapperProps {
|
|
4
4
|
isDisabled: boolean;
|
|
@@ -12,295 +12,6 @@ interface InputWrapperProps {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const InputWrapper: import("styled-components").StyledComponent<"div", import("@darajs/styled-components").DefaultTheme, InputWrapperProps, never>;
|
|
14
14
|
export declare const Input: import("styled-components").StyledComponent<"input", import("@darajs/styled-components").DefaultTheme, {}, never>;
|
|
15
|
-
export declare const NoItemsLabel: import("styled-components").StyledComponent<"span", import("@darajs/styled-components").DefaultTheme, {}, never>;
|
|
16
|
-
export declare const ChevronButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../button/button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, import("@darajs/styled-components").DefaultTheme, {
|
|
17
|
-
styling: "ghost";
|
|
18
|
-
autoFocus?: boolean;
|
|
19
|
-
children: import("react").ReactNode;
|
|
20
|
-
className?: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
download?: string;
|
|
23
|
-
href?: string;
|
|
24
|
-
id?: string;
|
|
25
|
-
loading?: boolean;
|
|
26
|
-
onClick?: (e?: import("react").SyntheticEvent<HTMLButtonElement, Event>) => void | Promise<void>;
|
|
27
|
-
outline?: boolean;
|
|
28
|
-
style?: import("react").CSSProperties;
|
|
29
|
-
form?: string;
|
|
30
|
-
formAction?: string;
|
|
31
|
-
formEncType?: string;
|
|
32
|
-
formMethod?: string;
|
|
33
|
-
formNoValidate?: boolean;
|
|
34
|
-
formTarget?: string;
|
|
35
|
-
name?: string;
|
|
36
|
-
type?: "button" | "reset" | "submit";
|
|
37
|
-
value?: string | number | readonly string[];
|
|
38
|
-
defaultChecked?: boolean;
|
|
39
|
-
defaultValue?: string | number | readonly string[];
|
|
40
|
-
suppressContentEditableWarning?: boolean;
|
|
41
|
-
suppressHydrationWarning?: boolean;
|
|
42
|
-
accessKey?: string;
|
|
43
|
-
contentEditable?: "inherit" | (boolean | "false" | "true");
|
|
44
|
-
contextMenu?: string;
|
|
45
|
-
dir?: string;
|
|
46
|
-
draggable?: boolean | "false" | "true";
|
|
47
|
-
hidden?: boolean;
|
|
48
|
-
lang?: string;
|
|
49
|
-
nonce?: string;
|
|
50
|
-
placeholder?: string;
|
|
51
|
-
slot?: string;
|
|
52
|
-
spellCheck?: boolean | "false" | "true";
|
|
53
|
-
tabIndex?: number;
|
|
54
|
-
title?: string;
|
|
55
|
-
translate?: "no" | "yes";
|
|
56
|
-
radioGroup?: string;
|
|
57
|
-
role?: import("react").AriaRole;
|
|
58
|
-
about?: string;
|
|
59
|
-
content?: string;
|
|
60
|
-
datatype?: string;
|
|
61
|
-
inlist?: any;
|
|
62
|
-
prefix?: string;
|
|
63
|
-
property?: string;
|
|
64
|
-
rel?: string;
|
|
65
|
-
resource?: string;
|
|
66
|
-
rev?: string;
|
|
67
|
-
typeof?: string;
|
|
68
|
-
vocab?: string;
|
|
69
|
-
autoCapitalize?: string;
|
|
70
|
-
autoCorrect?: string;
|
|
71
|
-
autoSave?: string;
|
|
72
|
-
color?: string;
|
|
73
|
-
itemProp?: string;
|
|
74
|
-
itemScope?: boolean;
|
|
75
|
-
itemType?: string;
|
|
76
|
-
itemID?: string;
|
|
77
|
-
itemRef?: string;
|
|
78
|
-
results?: number;
|
|
79
|
-
security?: string;
|
|
80
|
-
unselectable?: "off" | "on";
|
|
81
|
-
inputMode?: "search" | "text" | "none" | "email" | "tel" | "url" | "numeric" | "decimal";
|
|
82
|
-
is?: string;
|
|
83
|
-
'aria-activedescendant'?: string;
|
|
84
|
-
'aria-atomic'?: boolean | "false" | "true";
|
|
85
|
-
'aria-autocomplete'?: "both" | "none" | "inline" | "list";
|
|
86
|
-
'aria-braillelabel'?: string;
|
|
87
|
-
'aria-brailleroledescription'?: string;
|
|
88
|
-
'aria-busy'?: boolean | "false" | "true";
|
|
89
|
-
'aria-checked'?: boolean | "mixed" | "false" | "true";
|
|
90
|
-
'aria-colcount'?: number;
|
|
91
|
-
'aria-colindex'?: number;
|
|
92
|
-
'aria-colindextext'?: string;
|
|
93
|
-
'aria-colspan'?: number;
|
|
94
|
-
'aria-controls'?: string;
|
|
95
|
-
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "step" | "date" | "location";
|
|
96
|
-
'aria-describedby'?: string;
|
|
97
|
-
'aria-description'?: string;
|
|
98
|
-
'aria-details'?: string;
|
|
99
|
-
'aria-disabled'?: boolean | "false" | "true";
|
|
100
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup";
|
|
101
|
-
'aria-errormessage'?: string;
|
|
102
|
-
'aria-expanded'?: boolean | "false" | "true";
|
|
103
|
-
'aria-flowto'?: string;
|
|
104
|
-
'aria-grabbed'?: boolean | "false" | "true";
|
|
105
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree";
|
|
106
|
-
'aria-hidden'?: boolean | "false" | "true";
|
|
107
|
-
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling";
|
|
108
|
-
'aria-keyshortcuts'?: string;
|
|
109
|
-
'aria-label'?: string;
|
|
110
|
-
'aria-labelledby'?: string;
|
|
111
|
-
'aria-level'?: number;
|
|
112
|
-
'aria-live'?: "off" | "assertive" | "polite";
|
|
113
|
-
'aria-modal'?: boolean | "false" | "true";
|
|
114
|
-
'aria-multiline'?: boolean | "false" | "true";
|
|
115
|
-
'aria-multiselectable'?: boolean | "false" | "true";
|
|
116
|
-
'aria-orientation'?: "horizontal" | "vertical";
|
|
117
|
-
'aria-owns'?: string;
|
|
118
|
-
'aria-placeholder'?: string;
|
|
119
|
-
'aria-posinset'?: number;
|
|
120
|
-
'aria-pressed'?: boolean | "mixed" | "false" | "true";
|
|
121
|
-
'aria-readonly'?: boolean | "false" | "true";
|
|
122
|
-
'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals";
|
|
123
|
-
'aria-required'?: boolean | "false" | "true";
|
|
124
|
-
'aria-roledescription'?: string;
|
|
125
|
-
'aria-rowcount'?: number;
|
|
126
|
-
'aria-rowindex'?: number;
|
|
127
|
-
'aria-rowindextext'?: string;
|
|
128
|
-
'aria-rowspan'?: number;
|
|
129
|
-
'aria-selected'?: boolean | "false" | "true";
|
|
130
|
-
'aria-setsize'?: number;
|
|
131
|
-
'aria-sort'?: "none" | "ascending" | "descending" | "other";
|
|
132
|
-
'aria-valuemax'?: number;
|
|
133
|
-
'aria-valuemin'?: number;
|
|
134
|
-
'aria-valuenow'?: number;
|
|
135
|
-
'aria-valuetext'?: string;
|
|
136
|
-
dangerouslySetInnerHTML?: {
|
|
137
|
-
__html: string | TrustedHTML;
|
|
138
|
-
};
|
|
139
|
-
onCopy?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
140
|
-
onCopyCapture?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
141
|
-
onCut?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
142
|
-
onCutCapture?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
143
|
-
onPaste?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
144
|
-
onPasteCapture?: import("react").ClipboardEventHandler<HTMLButtonElement>;
|
|
145
|
-
onCompositionEnd?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
146
|
-
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
147
|
-
onCompositionStart?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
148
|
-
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
149
|
-
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
150
|
-
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLButtonElement>;
|
|
151
|
-
onFocus?: import("react").FocusEventHandler<HTMLButtonElement>;
|
|
152
|
-
onFocusCapture?: import("react").FocusEventHandler<HTMLButtonElement>;
|
|
153
|
-
onBlur?: import("react").FocusEventHandler<HTMLButtonElement>;
|
|
154
|
-
onBlurCapture?: import("react").FocusEventHandler<HTMLButtonElement>;
|
|
155
|
-
onChange?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
156
|
-
onChangeCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
157
|
-
onBeforeInput?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
158
|
-
onBeforeInputCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
159
|
-
onInput?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
160
|
-
onInputCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
161
|
-
onReset?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
162
|
-
onResetCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
163
|
-
onSubmit?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
164
|
-
onSubmitCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
165
|
-
onInvalid?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
166
|
-
onInvalidCapture?: import("react").FormEventHandler<HTMLButtonElement>;
|
|
167
|
-
onLoad?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
168
|
-
onLoadCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
169
|
-
onError?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
170
|
-
onErrorCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
171
|
-
onKeyDown?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
172
|
-
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
173
|
-
onKeyPress?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
174
|
-
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
175
|
-
onKeyUp?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
176
|
-
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLButtonElement>;
|
|
177
|
-
onAbort?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
178
|
-
onAbortCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
179
|
-
onCanPlay?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
180
|
-
onCanPlayCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
181
|
-
onCanPlayThrough?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
182
|
-
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
183
|
-
onDurationChange?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
184
|
-
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
185
|
-
onEmptied?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
186
|
-
onEmptiedCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
187
|
-
onEncrypted?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
188
|
-
onEncryptedCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
189
|
-
onEnded?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
190
|
-
onEndedCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
191
|
-
onLoadedData?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
192
|
-
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
193
|
-
onLoadedMetadata?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
194
|
-
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
195
|
-
onLoadStart?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
196
|
-
onLoadStartCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
197
|
-
onPause?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
198
|
-
onPauseCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
199
|
-
onPlay?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
200
|
-
onPlayCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
201
|
-
onPlaying?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
202
|
-
onPlayingCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
203
|
-
onProgress?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
204
|
-
onProgressCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
205
|
-
onRateChange?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
206
|
-
onRateChangeCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
207
|
-
onResize?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
208
|
-
onResizeCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
209
|
-
onSeeked?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
210
|
-
onSeekedCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
211
|
-
onSeeking?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
212
|
-
onSeekingCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
213
|
-
onStalled?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
214
|
-
onStalledCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
215
|
-
onSuspend?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
216
|
-
onSuspendCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
217
|
-
onTimeUpdate?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
218
|
-
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
219
|
-
onVolumeChange?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
220
|
-
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
221
|
-
onWaiting?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
222
|
-
onWaitingCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
223
|
-
onAuxClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
224
|
-
onAuxClickCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
225
|
-
onClickCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
226
|
-
onContextMenu?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
227
|
-
onContextMenuCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
228
|
-
onDoubleClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
229
|
-
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
230
|
-
onDrag?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
231
|
-
onDragCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
232
|
-
onDragEnd?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
233
|
-
onDragEndCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
234
|
-
onDragEnter?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
235
|
-
onDragEnterCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
236
|
-
onDragExit?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
237
|
-
onDragExitCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
238
|
-
onDragLeave?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
239
|
-
onDragLeaveCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
240
|
-
onDragOver?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
241
|
-
onDragOverCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
242
|
-
onDragStart?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
243
|
-
onDragStartCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
244
|
-
onDrop?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
245
|
-
onDropCapture?: import("react").DragEventHandler<HTMLButtonElement>;
|
|
246
|
-
onMouseDown?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
247
|
-
onMouseDownCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
248
|
-
onMouseEnter?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
249
|
-
onMouseLeave?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
250
|
-
onMouseMove?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
251
|
-
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
252
|
-
onMouseOut?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
253
|
-
onMouseOutCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
254
|
-
onMouseOver?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
255
|
-
onMouseOverCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
256
|
-
onMouseUp?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
257
|
-
onMouseUpCapture?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
258
|
-
onSelect?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
259
|
-
onSelectCapture?: import("react").ReactEventHandler<HTMLButtonElement>;
|
|
260
|
-
onTouchCancel?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
261
|
-
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
262
|
-
onTouchEnd?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
263
|
-
onTouchEndCapture?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
264
|
-
onTouchMove?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
265
|
-
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
266
|
-
onTouchStart?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
267
|
-
onTouchStartCapture?: import("react").TouchEventHandler<HTMLButtonElement>;
|
|
268
|
-
onPointerDown?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
269
|
-
onPointerDownCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
270
|
-
onPointerMove?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
271
|
-
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
272
|
-
onPointerUp?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
273
|
-
onPointerUpCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
274
|
-
onPointerCancel?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
275
|
-
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
276
|
-
onPointerEnter?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
277
|
-
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
278
|
-
onPointerLeave?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
279
|
-
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
280
|
-
onPointerOver?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
281
|
-
onPointerOverCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
282
|
-
onPointerOut?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
283
|
-
onPointerOutCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
284
|
-
onGotPointerCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
285
|
-
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
286
|
-
onLostPointerCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
287
|
-
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
288
|
-
onScroll?: import("react").UIEventHandler<HTMLButtonElement>;
|
|
289
|
-
onScrollCapture?: import("react").UIEventHandler<HTMLButtonElement>;
|
|
290
|
-
onWheel?: import("react").WheelEventHandler<HTMLButtonElement>;
|
|
291
|
-
onWheelCapture?: import("react").WheelEventHandler<HTMLButtonElement>;
|
|
292
|
-
onAnimationStart?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
293
|
-
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
294
|
-
onAnimationEnd?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
295
|
-
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
296
|
-
onAnimationIteration?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
297
|
-
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLButtonElement>;
|
|
298
|
-
onTransitionEnd?: import("react").TransitionEventHandler<HTMLButtonElement>;
|
|
299
|
-
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLButtonElement>;
|
|
300
|
-
ref?: import("react").Ref<HTMLButtonElement>;
|
|
301
|
-
key?: import("react").Key;
|
|
302
|
-
theme: import("@darajs/styled-components").DefaultTheme;
|
|
303
|
-
}, "form" | "slot" | "style" | "title" | "type" | "name" | "theme" | "ref" | "children" | "suppressHydrationWarning" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "disabled" | "hidden" | "content" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "download" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "loading" | "outline" | "styling">;
|
|
304
15
|
export interface ComboBoxProps extends InteractiveComponentProps<Item> {
|
|
305
16
|
/** Whether to open the select dropdown on load or not, defaults to false */
|
|
306
17
|
initialIsOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../src/combo-box/combo-box.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAQ5D,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAM3D,UAAU,YAAY;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,2HAgCnB,CAAC;AAEF,UAAU,iBAAiB;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,YAAY,gIAuBxB,CAAC;AAEF,eAAO,MAAM,KAAK,mHAuBjB,CAAC;AAEF,MAAM,WAAW,aAAc,SAAQ,yBAAyB,CAAC,IAAI,CAAC;IAClE,4EAA4E;IAC5E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4EAA4E;IAC5E,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+HAA+H;IAC/H,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B;AAED;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA0JnD;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createElement as _createElement } from "react";
|
|
2
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
/**
|
|
4
3
|
* Copyright 2023 Impulse Innovations Limited
|
|
@@ -18,12 +17,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
17
|
*/
|
|
19
18
|
import { autoUpdate, flip, offset, shift, useFloating, useInteractions, useRole } from '@floating-ui/react';
|
|
20
19
|
import { useCombobox } from 'downshift';
|
|
21
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
20
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
22
21
|
import ReactDOM from 'react-dom';
|
|
23
22
|
import styled from '@darajs/styled-components';
|
|
24
|
-
import
|
|
23
|
+
import ChevronButton from '../shared/chevron-button';
|
|
24
|
+
import DropdownList from '../shared/dropdown-list';
|
|
25
25
|
import Tooltip from '../tooltip/tooltip';
|
|
26
|
-
import {
|
|
26
|
+
import { matchWidthToReference } from '../utils';
|
|
27
|
+
import { syncKbdHighlightIdx } from '../utils/syncKbdHighlightIdx';
|
|
27
28
|
const { stateChangeTypes } = useCombobox;
|
|
28
29
|
export const Wrapper = styled.div `
|
|
29
30
|
display: inline-flex;
|
|
@@ -104,32 +105,6 @@ export const Input = styled.input `
|
|
|
104
105
|
color: ${(props) => props.theme.colors.grey2};
|
|
105
106
|
}
|
|
106
107
|
`;
|
|
107
|
-
export const NoItemsLabel = styled.span `
|
|
108
|
-
display: flex;
|
|
109
|
-
flex: 1 1 auto;
|
|
110
|
-
align-items: center;
|
|
111
|
-
justify-content: center;
|
|
112
|
-
|
|
113
|
-
height: 2rem;
|
|
114
|
-
|
|
115
|
-
font-size: 1rem;
|
|
116
|
-
color: ${(props) => props.theme.colors.text};
|
|
117
|
-
|
|
118
|
-
background-color: ${(props) => props.theme.colors.blue1};
|
|
119
|
-
`;
|
|
120
|
-
const DropdownList = styled(List) `
|
|
121
|
-
margin-left: -1px;
|
|
122
|
-
border-radius: 0 0 0.25rem 0.25rem;
|
|
123
|
-
box-shadow: ${(props) => props.theme.shadow.light};
|
|
124
|
-
`;
|
|
125
|
-
export const ChevronButton = styled(Button).attrs((attrs) => (Object.assign(Object.assign({}, attrs), { styling: 'ghost' }))) `
|
|
126
|
-
min-width: 0;
|
|
127
|
-
height: auto;
|
|
128
|
-
margin: 0;
|
|
129
|
-
padding: 0 0.25rem;
|
|
130
|
-
|
|
131
|
-
background-color: transparent !important;
|
|
132
|
-
`;
|
|
133
108
|
/**
|
|
134
109
|
* A single select combobox component, accepts a list of items to select from and an onSelect handler to listen for
|
|
135
110
|
* changes. Allows to search for item by typing in combo box.
|
|
@@ -140,8 +115,9 @@ function ComboBox(props) {
|
|
|
140
115
|
var _a, _b, _c, _d, _e, _f;
|
|
141
116
|
const [inputValue, setInputValue] = useState((_d = (_b = (_a = props.initialValue) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = props.selectedItem) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : '');
|
|
142
117
|
const [pendingHighlight, setPendingHighlight] = useState(null);
|
|
143
|
-
const filteredItems = props.items.filter((item) => { var _a; return inputValue ? (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()) : true; });
|
|
144
|
-
const
|
|
118
|
+
const filteredItems = useMemo(() => props.items.filter((item) => { var _a; return inputValue ? (_a = item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()) : true; }), [inputValue, props.items]);
|
|
119
|
+
const [kbdHighlightIdx, setKbdHighlightIdx] = React.useState();
|
|
120
|
+
const { selectedItem, isOpen, getMenuProps, getInputProps, getToggleButtonProps, getItemProps, setHighlightedIndex, } = useCombobox(Object.assign(Object.assign(Object.assign({ initialIsOpen: props.initialIsOpen, initialSelectedItem: (_e = props.initialValue) !== null && _e !== void 0 ? _e : props.selectedItem, itemToString: (item) => (item ? item.label : ''), items: filteredItems, onInputValueChange: (change) => {
|
|
145
121
|
setInputValue(change.inputValue);
|
|
146
122
|
}, onSelectedItemChange: (changes) => {
|
|
147
123
|
var _a, _b;
|
|
@@ -151,7 +127,7 @@ function ComboBox(props) {
|
|
|
151
127
|
props.onSelect(changes.selectedItem);
|
|
152
128
|
}
|
|
153
129
|
}
|
|
154
|
-
}, stateReducer: (state, { changes, type }) => {
|
|
130
|
+
} }, syncKbdHighlightIdx(setKbdHighlightIdx)), { stateReducer: (state, { changes, type }) => {
|
|
155
131
|
var _a;
|
|
156
132
|
// This resets the input when the dropdown is opened
|
|
157
133
|
if (type === stateChangeTypes.InputFocus ||
|
|
@@ -172,7 +148,7 @@ function ComboBox(props) {
|
|
|
172
148
|
return Object.assign(Object.assign({}, changes), { inputValue: ((_a = changes.selectedItem) === null || _a === void 0 ? void 0 : _a.label) || '' });
|
|
173
149
|
}
|
|
174
150
|
return changes;
|
|
175
|
-
} }, ('selectedItem' in props && { selectedItem: props.selectedItem })));
|
|
151
|
+
} }), ('selectedItem' in props && { selectedItem: props.selectedItem })));
|
|
176
152
|
useEffect(() => {
|
|
177
153
|
if (isOpen && pendingHighlight !== null) {
|
|
178
154
|
setHighlightedIndex(pendingHighlight);
|
|
@@ -189,13 +165,12 @@ function ComboBox(props) {
|
|
|
189
165
|
middleware: [flip(), shift(), offset({ crossAxis: 1 }), matchWidthToReference(+2)],
|
|
190
166
|
whileElementsMounted: isOpen ? autoUpdate : undefined,
|
|
191
167
|
});
|
|
168
|
+
const dropdownStyle = useMemo(() => (Object.assign(Object.assign({}, floatingStyles), { marginLeft: -1 })), [floatingStyles]);
|
|
192
169
|
const role = useRole(context, { role: 'combobox' });
|
|
193
170
|
const { getReferenceProps, getFloatingProps } = useInteractions([role]);
|
|
194
|
-
const menuProps = useMemo(() => getMenuProps({ ref: refs.setFloating }), [refs.setFloating, getMenuProps]);
|
|
195
171
|
return (_jsx(Tooltip, { content: props.errorMsg, disabled: !props.errorMsg, styling: "error", children: _jsxs(Wrapper, { className: props.className, isDisabled: props.disabled, isErrored: !!props.errorMsg, isOpen: isOpen, style: props.style, children: [_jsxs(InputWrapper, { disabled: props.disabled, isOpen: isOpen, ref: refs.setReference, children: [_jsx(Input, Object.assign({}, getInputProps({
|
|
196
172
|
disabled: props.disabled,
|
|
197
|
-
}), getReferenceProps(), { placeholder: (_f = (selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label)) !== null && _f !== void 0 ? _f : props.placeholder, size: props.size })), _jsx(ChevronButton,
|
|
198
|
-
filteredItems.map((item, index) => (_createElement(ListItem, Object.assign({}, getItemProps({ index, item }), { hovered: index === highlightedIndex, key: `item-${index}`, size: props.size, title: item.label }), item.label))), filteredItems.length === 0 && _jsx(NoItemsLabel, { children: "No Items" })] })), document.body)] }) }));
|
|
173
|
+
}), getReferenceProps(), { placeholder: (_f = (selectedItem === null ? props.placeholder : selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label)) !== null && _f !== void 0 ? _f : props.placeholder, size: props.size })), _jsx(ChevronButton, { disabled: props.disabled, isOpen: isOpen, getToggleButtonProps: getToggleButtonProps })] }), ReactDOM.createPortal(_jsx(DropdownList, { items: filteredItems, getItemProps: getItemProps, getFloatingProps: getFloatingProps, style: dropdownStyle, isOpen: isOpen, getMenuProps: getMenuProps, size: props.size, ref: refs.setFloating, selectedItem: selectedItem, kbdHighlightIdx: kbdHighlightIdx }), document.body)] }) }));
|
|
199
174
|
}
|
|
200
175
|
export default ComboBox;
|
|
201
176
|
//# sourceMappingURL=combo-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../src/combo-box/combo-box.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAuD,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7F,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAEzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,EAAE,gBAAgB,EAAE,GA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3B,CAAC,EACE,iBAAiB,EAAE,IACvB,WAAW,EACP,MAAA,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,KAAK,CAAC,mCAAI,KAAK,CAAC,WAAW,EAE1F,IAAI,EAAE,KAAK,CAAC,IAAI,IAClB,EACF,KAAC,aAAa,IACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,oBAAoB,GAC5C,IACS,EACd,QAAQ,CAAC,YAAY,CAClB,KAAC,YAAY,IACT,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAClC,EACF,QAAQ,CAAC,IAAI,CAChB,IACK,GACJ,CACb,CAAC;AACN,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/context-menu/context-menu.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/context-menu/context-menu.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAC/B,sDAAsD;IACtD,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,CAAC;CACpB;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAgI/G;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -16,15 +16,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { flip, offset, shift, useFloating, useInteractions, useRole } from '@floating-ui/react';
|
|
19
|
-
import { useEffect, useState } from 'react';
|
|
19
|
+
import React, { useEffect, useState } from 'react';
|
|
20
20
|
import ReactDOM from 'react-dom';
|
|
21
|
-
import styled from '@darajs/styled-components';
|
|
22
21
|
import { Key } from '../constants';
|
|
23
|
-
import
|
|
24
|
-
const DropdownList = styled(List) `
|
|
25
|
-
overflow-y: auto;
|
|
26
|
-
box-shadow: ${(props) => props.theme.shadow.light};
|
|
27
|
-
`;
|
|
22
|
+
import DropdownList from '../shared/dropdown-list';
|
|
28
23
|
/**
|
|
29
24
|
* The ContextMenu is a higher order component that wraps another react component and overrides its context menu to be a
|
|
30
25
|
* custom list of actions, defined by the actions prop.
|
|
@@ -34,7 +29,6 @@ const DropdownList = styled(List) `
|
|
|
34
29
|
function ContextMenu(Component) {
|
|
35
30
|
function WrappedContextMenu(props) {
|
|
36
31
|
const [showMenu, setShowMenu] = useState(false);
|
|
37
|
-
const [hoveredItem, setHoveredItem] = useState(-1);
|
|
38
32
|
// Handle clicking outside the menu or hitting escape and make sure the menu closes.
|
|
39
33
|
useEffect(() => {
|
|
40
34
|
const keyHandler = (e) => {
|
|
@@ -102,15 +96,19 @@ function ContextMenu(Component) {
|
|
|
102
96
|
});
|
|
103
97
|
setShowMenu(true);
|
|
104
98
|
};
|
|
105
|
-
const onAction = (action) => {
|
|
99
|
+
const onAction = React.useCallback((action) => {
|
|
106
100
|
if (canClose) {
|
|
107
101
|
setShowMenu(false);
|
|
108
102
|
action.action();
|
|
109
103
|
}
|
|
110
|
-
};
|
|
104
|
+
}, [canClose]);
|
|
111
105
|
const role = useRole(context, { role: 'menu' });
|
|
112
106
|
const { getFloatingProps } = useInteractions([role]);
|
|
113
|
-
|
|
107
|
+
const dropdownStyle = React.useMemo(() => (Object.assign(Object.assign({}, floatingStyles), { 'overflow-y': 'auto', minWidth: 150, borderRadius: '0.25rem' })), [floatingStyles]);
|
|
108
|
+
const getItemProps = React.useCallback(({ item }) => ({
|
|
109
|
+
onMouseUp: () => onAction(item),
|
|
110
|
+
}), [onAction]);
|
|
111
|
+
return (_jsxs(_Fragment, { children: [_jsx(Component, Object.assign({}, props.elementProps, { className: props.className, onContextMenu: onContextMenu, children: props.children })), ReactDOM.createPortal(_jsx(DropdownList, { items: props.actions, getItemProps: getItemProps, getFloatingProps: getFloatingProps, style: dropdownStyle, isOpen: showMenu, ref: refs.setFloating }), document.body)] }));
|
|
114
112
|
}
|
|
115
113
|
return WrappedContextMenu;
|
|
116
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../src/context-menu/context-menu.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../../src/context-menu/context-menu.tsx"],"names":[],"mappings":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X,QAAQ,CAAC,YAAY,CAClB,KAAC,YAAY,IACT,KAAK,EAAE,KAAK,CAAC,OAA4B,EACzC,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,QAAQ,EAChB,GAAG,EAAE,IAAI,CAAC,WAAW,GACvB,EACF,QAAQ,CAAC,IAAI,CAChB,IACF,CACN,CAAC;IACN,CAAC;IAED,OAAO,kBAAkB,CAAC;AAC9B,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -26,8 +26,6 @@ export interface SelectProps extends InteractiveComponentProps<Item> {
|
|
|
26
26
|
itemClass?: string;
|
|
27
27
|
/** The items to pick from the list. Each should have a label and a value */
|
|
28
28
|
items: Array<Item>;
|
|
29
|
-
/** The maximum number of items to display, defaults to 5 */
|
|
30
|
-
maxItems?: number;
|
|
31
29
|
/** onClick event. */
|
|
32
30
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void | Promise<void>;
|
|
33
31
|
/** An optional onSelect handler for listening to changes in the selected item */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datepicker-select.d.ts","sourceRoot":"","sources":["../../src/datepicker/datepicker-select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,SAAS,EAA0E,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"datepicker-select.d.ts","sourceRoot":"","sources":["../../src/datepicker/datepicker-select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,SAAS,EAA0E,MAAM,oBAAoB,CAAC;AAEvH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,OAAO,EAAE,yBAAyB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAqO3D,MAAM,WAAW,WAAY,SAAQ,yBAAyB,CAAC,IAAI,CAAC;IAChE,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,gDAAgD;IAChD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,iBAAS,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAyGzD;AAED,eAAe,gBAAgB,CAAC"}
|