@acusti/dropdown 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acusti/dropdown",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": "./dist/Dropdown.js",
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "homepage": "https://github.com/acusti/uikit/tree/main/packages/dropdown#readme",
23
23
  "devDependencies": {
24
- "@types/classnames": "^2.2.11",
25
- "@types/react": "^17.0.3",
26
- "typescript": "^4.4.3"
24
+ "@types/react": "^18.0.15",
25
+ "classnames": "^2",
26
+ "typescript": "~4.6.4"
27
27
  },
28
28
  "dependencies": {
29
- "@acusti/input-text": "^0.9.0",
29
+ "@acusti/input-text": "^0.10.0",
30
30
  "@acusti/matchmaking": "^0.3.0",
31
31
  "@acusti/styling": "^0.5.0",
32
32
  "@acusti/use-is-out-of-bounds": "^0.5.0"
@@ -1,33 +0,0 @@
1
- import * as React from 'react';
2
- export declare type Item = {
3
- element: HTMLElement | null;
4
- value: string;
5
- };
6
- export declare type Props = {
7
- /** Boolean indicating if the user can submit an empty value (i.e. clear the value); defaults to true */
8
- allowEmpty?: boolean;
9
- /** Can take a single React element (e.g. ReactChild) or exactly two renderable children */
10
- children: React.ReactChild | [React.ReactNode, React.ReactNode];
11
- className?: string;
12
- disabled?: boolean;
13
- /** Group identifier string links dropdowns together into a menu (like macOS top menubar) */
14
- group?: string;
15
- hasItems?: boolean;
16
- isOpenOnMount?: boolean;
17
- isSearchable?: boolean;
18
- label?: string;
19
- /** Only usable in conjunction with {isSearchable: true}; used as search input’s name */
20
- name?: string;
21
- onSubmitItem?: (payload: Item) => void;
22
- /** Only usable in conjunction with {isSearchable: true}; used as search input’s placeholder */
23
- placeholder?: string;
24
- /** Only usable in conjunction with {isSearchable: true}; used as search input’s tabIndex */
25
- tabIndex?: number;
26
- /**
27
- * Used as search input’s value if props.isSearchable === true
28
- * Used to determine if value has changed to avoid triggering onSubmitItem if not
29
- */
30
- value?: string;
31
- };
32
- declare const Dropdown: React.FC<Props>;
33
- export default Dropdown;
package/dist/Dropdown.js DELETED
@@ -1,497 +0,0 @@
1
- import InputText from '@acusti/input-text';
2
- import { Style } from '@acusti/styling';
3
- import useIsOutOfBounds from '@acusti/use-is-out-of-bounds';
4
- import classnames from 'classnames';
5
- import * as React from 'react';
6
- import {
7
- BODY_CLASS_NAME,
8
- BODY_SELECTOR,
9
- LABEL_CLASS_NAME,
10
- LABEL_TEXT_CLASS_NAME,
11
- ROOT_CLASS_NAME,
12
- STYLES,
13
- TRIGGER_CLASS_NAME,
14
- } from './styles.js';
15
- import {
16
- getActiveItemElement,
17
- getItemElements,
18
- ITEM_SELECTOR,
19
- KEY_EVENT_ELEMENTS,
20
- setActiveItem,
21
- } from './helpers.js';
22
- const { Children, Fragment, useCallback, useLayoutEffect, useRef, useState } = React;
23
- const noop = () => {};
24
- const CHILDREN_ERROR =
25
- '@acusti/dropdown requires either 1 child (the dropdown body) or 2 children: the dropdown trigger and the dropdown body.';
26
- const Dropdown = ({
27
- allowEmpty = true,
28
- children,
29
- className,
30
- disabled,
31
- hasItems = true,
32
- isOpenOnMount,
33
- isSearchable,
34
- label,
35
- name,
36
- onSubmitItem,
37
- placeholder,
38
- tabIndex,
39
- value,
40
- }) => {
41
- const childrenCount = Children.count(children);
42
- if (childrenCount !== 1 && childrenCount !== 2) {
43
- if (childrenCount === 0) {
44
- throw new Error(CHILDREN_ERROR + ' Received no children.');
45
- }
46
- console.error(`${CHILDREN_ERROR} Received ${childrenCount} children.`);
47
- }
48
- let trigger = childrenCount > 1 ? children[0] : null;
49
- const isTriggerFromProps = React.isValidElement(trigger);
50
- const [isOpen, setIsOpen] = useState(isOpenOnMount || false);
51
- const [isOpening, setIsOpening] = useState(!isOpenOnMount);
52
- const [dropdownBodyElement, setDropdownBodyElement] = useState(null);
53
- const dropdownElementRef = useRef(null);
54
- const inputElementRef = useRef(null);
55
- const closingTimerRef = useRef(null);
56
- const isOpeningTimerRef = useRef(null);
57
- const currentInputMethodRef = useRef('mouse');
58
- const clearEnteredCharactersTimerRef = useRef(null);
59
- const enteredCharactersRef = useRef('');
60
- const mouseDownPositionRef = useRef(null);
61
- const outOfBounds = useIsOutOfBounds(dropdownBodyElement);
62
- const allowEmptyRef = useRef(allowEmpty);
63
- const hasItemsRef = useRef(hasItems);
64
- const isOpenRef = useRef(isOpen);
65
- const isOpeningRef = useRef(isOpening);
66
- const isTriggerFromPropsRef = useRef(isOpening);
67
- const onSubmitItemRef = useRef(onSubmitItem);
68
- const valueRef = useRef(value);
69
- useLayoutEffect(() => {
70
- allowEmptyRef.current = allowEmpty;
71
- hasItemsRef.current = hasItems;
72
- isOpenRef.current = isOpen;
73
- isOpeningRef.current = isOpening;
74
- isTriggerFromPropsRef.current = isTriggerFromProps;
75
- onSubmitItemRef.current = onSubmitItem;
76
- valueRef.current = value;
77
- }, [
78
- allowEmpty,
79
- hasItems,
80
- isOpen,
81
- isOpening,
82
- isTriggerFromProps,
83
- onSubmitItem,
84
- value,
85
- ]);
86
- const closeDropdown = useCallback(() => {
87
- setIsOpen(false);
88
- setIsOpening(false);
89
- mouseDownPositionRef.current = null;
90
- if (closingTimerRef.current) {
91
- clearTimeout(closingTimerRef.current);
92
- closingTimerRef.current = null;
93
- }
94
- }, []);
95
- const handleSubmitItem = useCallback(() => {
96
- var _a;
97
- if (isOpenRef.current) {
98
- // A short timeout before closing is better UX when user selects an item so dropdown
99
- // doesn’t close before expected. It also enables using <Link />s in the dropdown body.
100
- closingTimerRef.current = setTimeout(closeDropdown, 90);
101
- }
102
- if (!hasItemsRef.current) return;
103
- const nextElement = getActiveItemElement(dropdownElementRef.current);
104
- if (!nextElement) {
105
- // If not allowEmpty, don’t allow submitting an empty item
106
- if (!allowEmptyRef.current) return;
107
- // If we have an input element as trigger & the user didn’t clear the text, do nothing
108
- if (
109
- (_a = inputElementRef.current) === null || _a === void 0
110
- ? void 0
111
- : _a.value
112
- )
113
- return;
114
- }
115
- const label =
116
- (nextElement === null || nextElement === void 0
117
- ? void 0
118
- : nextElement.innerText) || '';
119
- const nextValue =
120
- (nextElement === null || nextElement === void 0
121
- ? void 0
122
- : nextElement.dataset.uktValue) || label;
123
- const nextItem = { element: nextElement, value: nextValue };
124
- if (inputElementRef.current) {
125
- inputElementRef.current.value = label;
126
- if (
127
- inputElementRef.current ===
128
- inputElementRef.current.ownerDocument.activeElement
129
- ) {
130
- inputElementRef.current.blur();
131
- }
132
- }
133
- // If parent is controlling Dropdown via props.value and nextValue is the same, do nothing
134
- if (valueRef.current && valueRef.current === nextValue) return;
135
- if (onSubmitItemRef.current) {
136
- onSubmitItemRef.current(nextItem);
137
- }
138
- }, [closeDropdown]);
139
- const handleMouseMove = useCallback(({ clientX, clientY }) => {
140
- currentInputMethodRef.current = 'mouse';
141
- const initialPosition = mouseDownPositionRef.current;
142
- if (!initialPosition) return;
143
- if (
144
- Math.abs(initialPosition.clientX - clientX) < 12 &&
145
- Math.abs(initialPosition.clientY - clientY) < 12
146
- ) {
147
- return;
148
- }
149
- setIsOpening(false);
150
- }, []);
151
- const handleMouseOver = useCallback((event) => {
152
- if (!hasItemsRef.current) return;
153
- // If user isn’t currently using the mouse to navigate the dropdown, do nothing
154
- if (currentInputMethodRef.current !== 'mouse') return;
155
- // Ensure we have the dropdown root HTMLElement
156
- const dropdownElement = dropdownElementRef.current;
157
- if (!dropdownElement) return;
158
- const itemElements = getItemElements(dropdownElement);
159
- if (!itemElements) return;
160
- const eventTarget = event.target;
161
- const item = eventTarget.closest(ITEM_SELECTOR);
162
- const element = item || eventTarget;
163
- for (let index = 0; index < itemElements.length; index++) {
164
- if (itemElements[index] === element) {
165
- setActiveItem({
166
- dropdownElement,
167
- element,
168
- });
169
- return;
170
- }
171
- }
172
- }, []);
173
- const cleanupEventListenersRef = useRef(noop);
174
- const handleRef = useCallback(
175
- (ref) => {
176
- dropdownElementRef.current = ref;
177
- if (!ref) {
178
- // If component was unmounted, cleanup handlers
179
- cleanupEventListenersRef.current();
180
- cleanupEventListenersRef.current = noop;
181
- return;
182
- }
183
- const { ownerDocument } = ref;
184
- let inputElement = inputElementRef.current;
185
- // Check if trigger from props is an input or textarea element
186
- if (isTriggerFromProps && !inputElement && ref.firstElementChild) {
187
- inputElement = ref.firstElementChild.querySelector(
188
- 'input:not([type=radio]):not([type=checkbox]):not([type=range]),textarea',
189
- );
190
- inputElementRef.current = inputElement;
191
- }
192
- const handleMouseDown = ({ clientX, clientY, target }) => {
193
- const eventTarget = target;
194
- if (
195
- dropdownElementRef.current &&
196
- !dropdownElementRef.current.contains(eventTarget)
197
- ) {
198
- // Close dropdown on an outside click
199
- closeDropdown();
200
- return;
201
- }
202
- if (isOpenRef.current) return;
203
- setIsOpen(true);
204
- setIsOpening(true);
205
- mouseDownPositionRef.current = { clientX, clientY };
206
- isOpeningTimerRef.current = setTimeout(() => {
207
- setIsOpening(false);
208
- isOpeningTimerRef.current = null;
209
- }, 1000);
210
- };
211
- const handleMouseUp = ({ target }) => {
212
- if (!isOpenRef.current || closingTimerRef.current) return;
213
- // If still isOpening (gets set false 1s after open triggers), set it to false onMouseUp
214
- if (isOpeningRef.current) {
215
- setIsOpening(false);
216
- if (isOpeningTimerRef.current) {
217
- clearTimeout(isOpeningTimerRef.current);
218
- isOpeningTimerRef.current = null;
219
- }
220
- return;
221
- }
222
- const isTargetInBody = target.closest(BODY_SELECTOR);
223
- // If mouseup is on dropdown body and there are no items, don’t close the dropdown
224
- if (!hasItemsRef.current && isTargetInBody) return;
225
- // If mouseup is on an item, trigger submit item, else close the dropdown
226
- if (isTargetInBody) {
227
- handleSubmitItem();
228
- } else if (
229
- !inputElementRef.current ||
230
- (dropdownElementRef.current &&
231
- dropdownElementRef.current.contains(ownerDocument.activeElement))
232
- ) {
233
- // If dropdown is searchable and ref is still focused, this won’t be invoked
234
- closeDropdown();
235
- }
236
- };
237
- const handleKeyDown = (event) => {
238
- const { altKey, ctrlKey, key, metaKey } = event;
239
- const eventTarget = event.target;
240
- const dropdownElement = dropdownElementRef.current;
241
- if (!dropdownElement) return;
242
- const onEventHandled = () => {
243
- event.stopPropagation();
244
- event.preventDefault();
245
- currentInputMethodRef.current = 'keyboard';
246
- };
247
- const isEventTargetingDropdown = dropdownElement.contains(eventTarget);
248
- if (!isOpenRef.current) {
249
- // If dropdown is closed, don’t handle key events if event target isn’t within dropdown
250
- if (!isEventTargetingDropdown) return;
251
- // Open the dropdown on spacebar, enter, or if isSearchable and user hits the up/down arrows
252
- if (
253
- key === ' ' ||
254
- key === 'Enter' ||
255
- (hasItemsRef.current &&
256
- (key === 'ArrowUp' || key === 'ArrowDown'))
257
- ) {
258
- onEventHandled();
259
- setIsOpen(true);
260
- return;
261
- }
262
- return;
263
- }
264
- // If dropdown isOpen, hasItems, and not isSearchable, handle entering characters
265
- if (hasItemsRef.current && !inputElementRef.current) {
266
- let isEditingCharacters =
267
- !ctrlKey && !metaKey && /^[A-Za-z0-9]$/.test(key);
268
- // User could also be editing characters if there are already characters entered
269
- // and they are hitting delete or spacebar
270
- if (!isEditingCharacters && enteredCharactersRef.current) {
271
- isEditingCharacters = key === ' ' || key === 'Backspace';
272
- }
273
- if (isEditingCharacters) {
274
- onEventHandled();
275
- if (key === 'Backspace') {
276
- enteredCharactersRef.current =
277
- enteredCharactersRef.current.slice(0, -1);
278
- } else {
279
- enteredCharactersRef.current += key;
280
- }
281
- setActiveItem({
282
- dropdownElement,
283
- // If input element came from props, only override the input’s value
284
- // with an exact text match so user can enter a value not in items
285
- isExactMatch: isTriggerFromPropsRef.current,
286
- text: enteredCharactersRef.current,
287
- });
288
- if (clearEnteredCharactersTimerRef.current) {
289
- clearTimeout(clearEnteredCharactersTimerRef.current);
290
- }
291
- clearEnteredCharactersTimerRef.current = setTimeout(() => {
292
- enteredCharactersRef.current = '';
293
- clearEnteredCharactersTimerRef.current = null;
294
- }, 1500);
295
- return;
296
- }
297
- }
298
- // If dropdown isOpen, handle submitting the value
299
- if (key === 'Enter' || (key === ' ' && !inputElementRef.current)) {
300
- onEventHandled();
301
- handleSubmitItem();
302
- return;
303
- }
304
- // If dropdown isOpen, handle closing it on escape or spacebar if !hasItems
305
- if (
306
- key === 'Escape' ||
307
- (isEventTargetingDropdown && key === ' ' && !hasItemsRef.current)
308
- ) {
309
- // If there are no items & event target element uses key events, don’t close it
310
- if (
311
- !hasItemsRef.current &&
312
- (eventTarget.isContentEditable ||
313
- KEY_EVENT_ELEMENTS.has(eventTarget.tagName))
314
- ) {
315
- return;
316
- }
317
- closeDropdown();
318
- return;
319
- }
320
- // Handle ↑/↓ arrows
321
- if (hasItemsRef.current) {
322
- if (key === 'ArrowUp') {
323
- onEventHandled();
324
- if (altKey || metaKey) {
325
- setActiveItem({
326
- dropdownElement,
327
- index: 0,
328
- });
329
- } else {
330
- setActiveItem({
331
- dropdownElement,
332
- indexAddend: -1,
333
- });
334
- }
335
- return;
336
- }
337
- if (key === 'ArrowDown') {
338
- onEventHandled();
339
- if (altKey || metaKey) {
340
- // Using a negative index counts back from the end
341
- setActiveItem({
342
- dropdownElement,
343
- index: -1,
344
- });
345
- } else {
346
- setActiveItem({
347
- dropdownElement,
348
- indexAddend: 1,
349
- });
350
- }
351
- return;
352
- }
353
- }
354
- };
355
- // Close dropdown if any element is focused outside of this dropdown
356
- const handleFocusIn = (event) => {
357
- if (!isOpenRef.current) return;
358
- const eventTarget = event.target;
359
- // If focused element is a descendant or a parent of the dropdown, do nothing
360
- if (
361
- !dropdownElementRef.current ||
362
- dropdownElementRef.current.contains(eventTarget) ||
363
- eventTarget.contains(dropdownElementRef.current)
364
- ) {
365
- return;
366
- }
367
- closeDropdown();
368
- };
369
- document.addEventListener('focusin', handleFocusIn);
370
- document.addEventListener('keydown', handleKeyDown);
371
- document.addEventListener('mousedown', handleMouseDown);
372
- document.addEventListener('mouseup', handleMouseUp);
373
- if (ownerDocument !== document) {
374
- ownerDocument.addEventListener('focusin', handleFocusIn);
375
- ownerDocument.addEventListener('keydown', handleKeyDown);
376
- ownerDocument.addEventListener('mousedown', handleMouseDown);
377
- ownerDocument.addEventListener('mouseup', handleMouseUp);
378
- }
379
- // If dropdown should be open on mount, focus it
380
- if (isOpenOnMount) {
381
- ref.focus();
382
- }
383
- const handleInput = (event) => {
384
- const dropdownElement = dropdownElementRef.current;
385
- if (!dropdownElement) return;
386
- if (!isOpenRef.current) setIsOpen(true);
387
- const input = event.target;
388
- const isDeleting =
389
- enteredCharactersRef.current.length > input.value.length;
390
- enteredCharactersRef.current = input.value;
391
- // Don’t set a new active item if user is deleting text unless text is now empty
392
- if (isDeleting && input.value.length) return;
393
- setActiveItem({
394
- dropdownElement,
395
- // If input element came from props, only override the input’s value
396
- // with an exact text match so user can enter a value not in items
397
- isExactMatch: isTriggerFromPropsRef.current,
398
- text: enteredCharactersRef.current,
399
- });
400
- };
401
- if (inputElement) {
402
- inputElement.addEventListener('input', handleInput);
403
- }
404
- cleanupEventListenersRef.current = () => {
405
- document.removeEventListener('focusin', handleFocusIn);
406
- document.removeEventListener('keydown', handleKeyDown);
407
- document.removeEventListener('mousedown', handleMouseDown);
408
- document.removeEventListener('mouseup', handleMouseUp);
409
- if (ownerDocument !== document) {
410
- ownerDocument.removeEventListener('focusin', handleFocusIn);
411
- ownerDocument.removeEventListener('keydown', handleKeyDown);
412
- ownerDocument.removeEventListener('mousedown', handleMouseDown);
413
- ownerDocument.removeEventListener('mouseup', handleMouseUp);
414
- }
415
- if (inputElement) {
416
- inputElement.removeEventListener('input', handleInput);
417
- }
418
- };
419
- },
420
- [closeDropdown, handleSubmitItem, isOpenOnMount, isTriggerFromProps],
421
- );
422
- const handleTriggerFocus = useCallback(() => {
423
- setIsOpen(true);
424
- }, []);
425
- if (!isTriggerFromProps) {
426
- if (isSearchable) {
427
- trigger = React.createElement(InputText, {
428
- className: TRIGGER_CLASS_NAME,
429
- disabled: disabled,
430
- initialValue: value || '',
431
- name: name,
432
- onFocus: handleTriggerFocus,
433
- placeholder: placeholder,
434
- ref: inputElementRef,
435
- selectTextOnFocus: true,
436
- tabIndex: tabIndex,
437
- type: 'text',
438
- });
439
- } else {
440
- trigger = React.createElement(
441
- 'button',
442
- { className: TRIGGER_CLASS_NAME, tabIndex: 0 },
443
- trigger,
444
- );
445
- }
446
- }
447
- if (label) {
448
- trigger = React.createElement(
449
- 'label',
450
- { className: LABEL_CLASS_NAME },
451
- React.createElement('div', { className: LABEL_TEXT_CLASS_NAME }, label),
452
- trigger,
453
- );
454
- }
455
- return React.createElement(
456
- Fragment,
457
- null,
458
- React.createElement(Style, null, STYLES),
459
- React.createElement(
460
- 'div',
461
- {
462
- className: classnames(ROOT_CLASS_NAME, className, {
463
- disabled,
464
- 'is-open': isOpen,
465
- 'is-searchable': isSearchable,
466
- }),
467
- onMouseMove: handleMouseMove,
468
- onMouseOver: handleMouseOver,
469
- ref: handleRef,
470
- tabIndex:
471
- isSearchable || inputElementRef.current || !isTriggerFromProps
472
- ? undefined
473
- : 0,
474
- },
475
- trigger,
476
- isOpen
477
- ? React.createElement(
478
- 'div',
479
- {
480
- className: classnames(BODY_CLASS_NAME, {
481
- 'calculating-position': !outOfBounds.hasLayout,
482
- 'has-items': hasItems,
483
- 'out-of-bounds-bottom': outOfBounds.bottom,
484
- 'out-of-bounds-left': outOfBounds.left,
485
- 'out-of-bounds-right': outOfBounds.right,
486
- 'out-of-bounds-top': outOfBounds.top,
487
- }),
488
- ref: setDropdownBodyElement,
489
- },
490
- children[1] || children[0] || children,
491
- )
492
- : null,
493
- ),
494
- );
495
- };
496
- export default Dropdown;
497
- //# sourceMappingURL=Dropdown.js.map
@@ -1,58 +0,0 @@
1
- /**
2
- * Flowtype definitions for Dropdown
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.14.1
5
- * @flow
6
- */
7
-
8
- import * as React from 'react';
9
- export type Item = {|
10
- element: HTMLElement | null,
11
- value: string,
12
- |};
13
- export type Props = {|
14
- /**
15
- * Boolean indicating if the user can submit an empty value (i.e. clear the value); defaults to true
16
- */
17
- allowEmpty?: boolean,
18
-
19
- /**
20
- * Can take a single React element (e.g. ReactChild) or exactly two renderable children
21
- */
22
- children: React.Element<any> | [React.Node, React.Node],
23
- className?: string,
24
- disabled?: boolean,
25
-
26
- /**
27
- * Group identifier string links dropdowns together into a menu (like macOS top menubar)
28
- */
29
- group?: string,
30
- hasItems?: boolean,
31
- isOpenOnMount?: boolean,
32
- isSearchable?: boolean,
33
- label?: string,
34
-
35
- /**
36
- * Only usable in conjunction with {isSearchable: true}; used as search input’s name
37
- */
38
- name?: string,
39
- onSubmitItem?: (payload: Item) => void,
40
-
41
- /**
42
- * Only usable in conjunction with {isSearchable: true}; used as search input’s placeholder
43
- */
44
- placeholder?: string,
45
-
46
- /**
47
- * Only usable in conjunction with {isSearchable: true}; used as search input’s tabIndex
48
- */
49
- tabIndex?: number,
50
-
51
- /**
52
- * Used as search input’s value if props.isSearchable === true
53
- * Used to determine if value has changed to avoid triggering onSubmitItem if not
54
- */
55
- value?: string,
56
- |};
57
- declare var Dropdown: React.StatelessFunctionalComponent<Props>;
58
- declare export default typeof Dropdown;
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../src/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,gBAAgB,MAAM,8BAA8B,CAAC;AAC5D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACH,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,MAAM,EACN,kBAAkB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,kBAA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C,mBAAmB,EAAE,WAAW,CAAC,GAAG;iBACvC,CAAC,EACF,GAAG,EAAE,sBAAsB,IAE1B,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CACrC,CACT,CAAC,CAAC,CAAC,IAAI,CACN,CACC,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/dist/helpers.d.ts DELETED
@@ -1,48 +0,0 @@
1
- export declare const ITEM_SELECTOR = '[data-ukt-item], [data-ukt-value]';
2
- export declare const KEY_EVENT_ELEMENTS: Set<string>;
3
- export declare const getItemElements: (
4
- dropdownElement: HTMLElement | null,
5
- ) => NodeListOf<Element> | HTMLCollection | null;
6
- export declare const getActiveItemElement: (
7
- dropdownElement: HTMLElement | null,
8
- ) => HTMLElement | null;
9
- export declare const setActiveItem: ({
10
- dropdownElement,
11
- element,
12
- index,
13
- indexAddend,
14
- isExactMatch,
15
- text,
16
- }:
17
- | {
18
- dropdownElement: HTMLElement;
19
- element: HTMLElement;
20
- index?: null | undefined;
21
- indexAddend?: null | undefined;
22
- isExactMatch?: null | undefined;
23
- text?: null | undefined;
24
- }
25
- | {
26
- dropdownElement: HTMLElement;
27
- element?: null | undefined;
28
- index: number;
29
- indexAddend?: null | undefined;
30
- isExactMatch?: null | undefined;
31
- text?: null | undefined;
32
- }
33
- | {
34
- dropdownElement: HTMLElement;
35
- element?: null | undefined;
36
- index?: null | undefined;
37
- indexAddend: number;
38
- isExactMatch?: null | undefined;
39
- text?: null | undefined;
40
- }
41
- | {
42
- dropdownElement: HTMLElement;
43
- element?: null | undefined;
44
- index?: null | undefined;
45
- indexAddend?: null | undefined;
46
- isExactMatch?: boolean | undefined;
47
- text: string;
48
- }) => void;
package/dist/helpers.js DELETED
@@ -1,130 +0,0 @@
1
- import { getBestMatch } from '@acusti/matchmaking';
2
- import { BODY_SELECTOR } from './styles.js';
3
- export const ITEM_SELECTOR = `[data-ukt-item], [data-ukt-value]`;
4
- export const KEY_EVENT_ELEMENTS = new Set(['INPUT', 'TEXTAREA']);
5
- export const getItemElements = (dropdownElement) => {
6
- if (!dropdownElement) return null;
7
- const bodyElement = dropdownElement.querySelector(BODY_SELECTOR);
8
- if (!bodyElement) return null;
9
- let items = bodyElement.querySelectorAll(ITEM_SELECTOR);
10
- if (items.length) return items;
11
- // If no items found via [data-ukt-item] or [data-ukt-value] selector,
12
- // use first instance of multiple children found
13
- items = bodyElement.children;
14
- while (items.length === 1) {
15
- if (!items[0].children) break;
16
- items = items[0].children;
17
- }
18
- // If unable to find an element with more than one child, treat direct child as items
19
- if (items.length === 1) {
20
- items = bodyElement.children;
21
- }
22
- return items;
23
- };
24
- export const getActiveItemElement = (dropdownElement) => {
25
- if (!dropdownElement) return null;
26
- return dropdownElement.querySelector('[data-ukt-active]');
27
- };
28
- const clearItemElementsState = (itemElements) => {
29
- itemElements.forEach((itemElement) => {
30
- if (itemElement.hasAttribute('data-ukt-active')) {
31
- delete itemElement.dataset.uktActive;
32
- }
33
- });
34
- };
35
- export const setActiveItem = ({
36
- dropdownElement,
37
- element,
38
- index,
39
- indexAddend,
40
- isExactMatch,
41
- text,
42
- }) => {
43
- const items = getItemElements(dropdownElement);
44
- if (!items) return;
45
- const itemElements = Array.from(items);
46
- if (!itemElements.length) return;
47
- const lastIndex = itemElements.length - 1;
48
- const currentActiveIndex = itemElements.findIndex((itemElement) =>
49
- itemElement.hasAttribute('data-ukt-active'),
50
- );
51
- let nextActiveIndex = currentActiveIndex;
52
- if (typeof index === 'number') {
53
- // Negative index means count back from the end
54
- nextActiveIndex = index < 0 ? itemElements.length + index : index;
55
- }
56
- if (element) {
57
- nextActiveIndex = itemElements.findIndex(
58
- (itemElement) => itemElement === element,
59
- );
60
- } else if (typeof indexAddend === 'number') {
61
- // If there’s no currentActiveIndex and we are handling -1, start at lastIndex
62
- if (currentActiveIndex === -1 && indexAddend === -1) {
63
- nextActiveIndex = lastIndex;
64
- } else {
65
- nextActiveIndex += indexAddend;
66
- }
67
- // Keep it within the bounds of the items list
68
- if (nextActiveIndex < 0) {
69
- nextActiveIndex = 0;
70
- } else if (nextActiveIndex > lastIndex) {
71
- nextActiveIndex = lastIndex;
72
- }
73
- } else if (typeof text === 'string') {
74
- // If text is empty, clear existing active items and early return
75
- if (!text) {
76
- clearItemElementsState(itemElements);
77
- return;
78
- }
79
- const itemTexts = itemElements.map((itemElement) => itemElement.innerText);
80
- if (isExactMatch) {
81
- const textToCompare = text.toLowerCase();
82
- nextActiveIndex = itemTexts.findIndex((itemText) =>
83
- itemText.toLowerCase().startsWith(textToCompare),
84
- );
85
- // If isExactMatch is required and no exact match was found, clear active items
86
- if (nextActiveIndex === -1) {
87
- clearItemElementsState(itemElements);
88
- }
89
- } else {
90
- const bestMatch = getBestMatch({ items: itemTexts, text });
91
- nextActiveIndex = itemTexts.findIndex((text) => text === bestMatch);
92
- }
93
- }
94
- if (nextActiveIndex === -1 || nextActiveIndex === currentActiveIndex) return;
95
- // Clear any existing active dropdown body item state
96
- clearItemElementsState(itemElements);
97
- const nextActiveItem = items[nextActiveIndex];
98
- if (nextActiveItem) {
99
- nextActiveItem.setAttribute('data-ukt-active', '');
100
- // Find closest scrollable parent and ensure that next active item is visible
101
- let { parentElement } = nextActiveItem;
102
- let scrollableParent = null;
103
- while (!scrollableParent && parentElement && parentElement !== dropdownElement) {
104
- const isScrollable =
105
- parentElement.scrollHeight > parentElement.clientHeight + 15;
106
- if (isScrollable) {
107
- scrollableParent = parentElement;
108
- } else {
109
- parentElement = parentElement.parentElement;
110
- }
111
- }
112
- if (scrollableParent) {
113
- const parentRect = scrollableParent.getBoundingClientRect();
114
- const itemRect = nextActiveItem.getBoundingClientRect();
115
- const isAboveTop = itemRect.top < parentRect.top;
116
- const isBelowBottom = itemRect.bottom > parentRect.bottom;
117
- if (isAboveTop || isBelowBottom) {
118
- let { scrollTop } = scrollableParent;
119
- // Item isn’t fully visible; adjust scrollTop to put item within closest edge
120
- if (isAboveTop) {
121
- scrollTop -= parentRect.top - itemRect.top;
122
- } else {
123
- scrollTop += itemRect.bottom - parentRect.bottom;
124
- }
125
- scrollableParent.scrollTop = scrollTop;
126
- }
127
- }
128
- }
129
- };
130
- //# sourceMappingURL=helpers.js.map
@@ -1,50 +0,0 @@
1
- /**
2
- * Flowtype definitions for helpers
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.14.1
5
- * @flow
6
- */
7
-
8
- declare export var ITEM_SELECTOR: '[data-ukt-item], [data-ukt-value]';
9
- declare export var KEY_EVENT_ELEMENTS: Set<string>;
10
- declare export var getItemElements: (
11
- dropdownElement: HTMLElement | null,
12
- ) => NodeListOf<Element> | HTMLCollection | null;
13
- declare export var getActiveItemElement: (
14
- dropdownElement: HTMLElement | null,
15
- ) => HTMLElement | null;
16
- declare export var setActiveItem: (
17
- x:
18
- | {|
19
- dropdownElement: HTMLElement,
20
- element: HTMLElement,
21
- index?: null | void,
22
- indexAddend?: null | void,
23
- isExactMatch?: null | void,
24
- text?: null | void,
25
- |}
26
- | {|
27
- dropdownElement: HTMLElement,
28
- element?: null | void,
29
- index: number,
30
- indexAddend?: null | void,
31
- isExactMatch?: null | void,
32
- text?: null | void,
33
- |}
34
- | {|
35
- dropdownElement: HTMLElement,
36
- element?: null | void,
37
- index?: null | void,
38
- indexAddend: number,
39
- isExactMatch?: null | void,
40
- text?: null | void,
41
- |}
42
- | {|
43
- dropdownElement: HTMLElement,
44
- element?: null | void,
45
- index?: null | void,
46
- indexAddend?: null | void,
47
- isExactMatch?: boolean | void,
48
- text: string,
49
- |},
50
- ) => void;
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG,mCAAmC,CAAC;AACjE,MAAM,CAA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,IAAI,CAAC;QAC5B,OAAO,CAAC,gBAAgB,IAAI,aAAa,IAAI,aAAa,KAAK,eAAe,EAAE;YAC5E,MAAM,YAAY,GACd,aAAa,CAAC,YAAY,GAAG,aAAa,CAAC,YAAY,GAAG,EAAE,CAAC;YACjE,IAAI,YAAY,EAAE;gBACd,gBAAgB,GAAG,aAAa,CAAC;aACpC;iBAAM;gBACH,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC;aAC/C;SACJ;QAED,IAAI,gBAAgB,EAAE;YAClB,MAAM,UAAU,GAAG,gBAAgB,CAAC,qBAAqB,EAAE,CAAC;YAC5D,MAAM,QAAQ,GAAG,cAAc,CAAC,qBAAqB,EAAE,CAAC;YACxD,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;YACjD,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;YAC1D,IAAI,UAAU,IAAI,aAAa,EAAE;gBAC7B,IAAI,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC;gBACrC,6EAA6E;gBAC7E,IAAI,UAAU,EAAE;oBACZ,SAAS,IAAI,UAAU,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;iBAC9C;qBAAM;oBACH,SAAS,IAAI,QAAQ,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;iBACpD;gBACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAC;aAC1C;SACJ;KACJ;AACL,CAAC,CAAC"}
package/dist/styles.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export declare const ROOT_CLASS_NAME = 'uktdropdown';
2
- export declare const ROOT_SELECTOR: string;
3
- export declare const BODY_CLASS_NAME: string;
4
- export declare const LABEL_CLASS_NAME: string;
5
- export declare const LABEL_TEXT_CLASS_NAME: string;
6
- export declare const TRIGGER_CLASS_NAME: string;
7
- export declare const BODY_SELECTOR: string;
8
- export declare const LABEL_SELECTOR: string;
9
- export declare const LABEL_TEXT_SELECTOR: string;
10
- export declare const TRIGGER_SELECTOR: string;
11
- export declare const STYLES: string;
package/dist/styles.js DELETED
@@ -1,80 +0,0 @@
1
- import { SYSTEM_UI_FONT } from '@acusti/styling';
2
- export const ROOT_CLASS_NAME = 'uktdropdown';
3
- export const ROOT_SELECTOR = `.${ROOT_CLASS_NAME}`;
4
- export const BODY_CLASS_NAME = `${ROOT_CLASS_NAME}-body`;
5
- export const LABEL_CLASS_NAME = `${ROOT_CLASS_NAME}-label`;
6
- export const LABEL_TEXT_CLASS_NAME = `${ROOT_CLASS_NAME}-label-text`;
7
- export const TRIGGER_CLASS_NAME = `${ROOT_CLASS_NAME}-trigger`;
8
- export const BODY_SELECTOR = `.${BODY_CLASS_NAME}`;
9
- export const LABEL_SELECTOR = `.${LABEL_CLASS_NAME}`;
10
- export const LABEL_TEXT_SELECTOR = `.${LABEL_TEXT_CLASS_NAME}`;
11
- export const TRIGGER_SELECTOR = `.${TRIGGER_CLASS_NAME}`;
12
- export const STYLES = `
13
- :root {
14
- --uktdd-font-family: ${SYSTEM_UI_FONT};
15
- --uktdd-body-bg-color: #fff;
16
- --uktdd-body-bg-color-hover: rgb(105,162,249);
17
- --uktdd-body-color-hover: #fff;
18
- --uktdd-body-pad-bottom: 10px;
19
- --uktdd-body-pad-left: 12px;
20
- --uktdd-body-pad-right: 12px;
21
- --uktdd-body-pad-top: 10px;
22
- --uktdd-label-pad-right: 10px;
23
- }
24
- ${ROOT_SELECTOR},
25
- ${TRIGGER_SELECTOR} {
26
- font-family: var(--uktdd-font-family);
27
- }
28
- ${ROOT_SELECTOR} {
29
- position: relative;
30
- display: inline-block;
31
- }
32
- ${ROOT_SELECTOR}.disabled {
33
- pointer-events: none;
34
- }
35
- ${ROOT_SELECTOR} > * {
36
- cursor: default;
37
- }
38
- ${LABEL_SELECTOR} {
39
- display: flex;
40
- }
41
- ${LABEL_TEXT_SELECTOR} {
42
- padding-right: var(--uktdd-label-pad-right);
43
- }
44
- ${BODY_SELECTOR} {
45
- box-sizing: border-box;
46
- position: absolute;
47
- top: 100%;
48
- max-height: calc(100vh - 50px);
49
- min-height: 50px;
50
- min-width: 100%;
51
- overflow: auto;
52
- z-index: 2;
53
- padding: var(--uktdd-body-pad-top) var(--uktdd-body-pad-right) var(--uktdd-body-pad-bottom) var(--uktdd-body-pad-left);
54
- background-color: var(--uktdd-body-bg-color);
55
- box-shadow: 0 8px 18px rgba(0,0,0,0.25);
56
- }
57
- ${BODY_SELECTOR}.calculating-position {
58
- visibility: hidden;
59
- }
60
- ${BODY_SELECTOR}.out-of-bounds-bottom:not(.out-of-bounds-top) {
61
- top: auto;
62
- bottom: 100%;
63
- }
64
- ${BODY_SELECTOR}.out-of-bounds-right:not(.out-of-bounds-left) {
65
- left: auto;
66
- right: 0px;
67
- }
68
- ${LABEL_SELECTOR} + ${BODY_SELECTOR} {
69
- left: auto;
70
- right: 0;
71
- }
72
- ${BODY_SELECTOR}.has-items {
73
- user-select: none;
74
- }
75
- ${BODY_SELECTOR} [data-ukt-active] {
76
- background-color: var(--uktdd-body-bg-color-hover);
77
- color: var(--uktdd-body-color-hover);
78
- }
79
- `;
80
- //# sourceMappingURL=styles.js.map
@@ -1,18 +0,0 @@
1
- /**
2
- * Flowtype definitions for styles
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.14.1
5
- * @flow
6
- */
7
-
8
- declare export var ROOT_CLASS_NAME: 'uktdropdown';
9
- declare export var ROOT_SELECTOR: string;
10
- declare export var BODY_CLASS_NAME: string;
11
- declare export var LABEL_CLASS_NAME: string;
12
- declare export var LABEL_TEXT_CLASS_NAME: string;
13
- declare export var TRIGGER_CLASS_NAME: string;
14
- declare export var BODY_SELECTOR: string;
15
- declare export var LABEL_SELECTOR: string;
16
- declare export var LABEL_TEXT_SELECTOR: string;
17
- declare export var TRIGGER_SELECTOR: string;
18
- declare export var STYLES: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,eAAe,EAAE,CAAC;AAEnD,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,eAAe,OAAO,CAAC;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,eAAe,QAAQ,CAAC;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,eAAe,aAAa,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,eAAe,UAAU,CAAC;AAE/D,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,eAAe,EAAE,CAAC;AACnD,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,gBAAgB,EAAE,CAAC;AACrD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,qBAAqB,EAAE,CAAC;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,kBAAkB,EAAE,CAAC;AAEzD,MAAM,CAAC,MAAM,MAAM,GAAG;;yBAEG,cAAc;;;;;;;;;;EAUrC,aAAa;EACb,gBAAgB;;;EAGhB,aAAa;;;;EAIb,aAAa;;;EAGb,aAAa;;;EAGb,cAAc;;;EAGd,mBAAmB;;;EAGnB,aAAa;;;;;;;;;;;;;EAab,aAAa;;;EAGb,aAAa;;;;EAIb,aAAa;;;;EAIb,cAAc,MAAM,aAAa;;;;EAIjC,aAAa;;;EAGb,aAAa;;;;CAId,CAAC"}