@digdir/designsystemet-react 1.0.0 → 1.0.2
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/README.md +6 -3
- package/dist/cjs/components/MultiSuggestion/MultiSuggestion.js +160 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionChips.js +20 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionClear.js +52 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionEmpty.js +23 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionInput.js +37 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionList.js +30 -0
- package/dist/cjs/components/MultiSuggestion/MultiSuggestionOption.js +12 -0
- package/dist/cjs/components/MultiSuggestion/index.js +34 -0
- package/dist/cjs/index.js +14 -0
- package/dist/cjs/utilities/hooks/useCheckboxGroup/useCheckboxGroup.js +35 -27
- package/dist/cjs/utilities/hooks/useRadioGroup/useRadioGroup.js +22 -19
- package/dist/esm/components/MultiSuggestion/MultiSuggestion.js +157 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionChips.js +18 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionClear.js +49 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionEmpty.js +21 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionInput.js +35 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionList.js +28 -0
- package/dist/esm/components/MultiSuggestion/MultiSuggestionOption.js +10 -0
- package/dist/esm/components/MultiSuggestion/index.js +26 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/utilities/hooks/useCheckboxGroup/useCheckboxGroup.js +35 -27
- package/dist/esm/utilities/hooks/useRadioGroup/useRadioGroup.js +23 -20
- package/dist/types/components/Combobox/ComboboxIdContext.d.ts.map +1 -1
- package/dist/types/components/Combobox/Option/useComboboxOption.d.ts.map +1 -1
- package/dist/types/components/Combobox/useComboboxKeyboard.d.ts.map +1 -1
- package/dist/types/components/Combobox/useFloatingCombobox.d.ts.map +1 -1
- package/dist/types/components/Combobox/useFormField/useFormField.d.ts.map +1 -1
- package/dist/types/components/Combobox/utilities.d.ts.map +1 -1
- package/dist/types/components/Field/fieldObserver.d.ts.map +1 -1
- package/dist/types/components/MultiSuggestion/MultiSuggestionClear.d.ts.map +1 -1
- package/dist/types/components/Suggestion/SuggestionClear.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/utilities/RovingFocus/useRovingFocus.d.ts.map +1 -1
- package/dist/types/utilities/hooks/useCheckboxGroup/useCheckboxGroup.d.ts.map +1 -1
- package/dist/types/utilities/hooks/usePagination/usePagination.d.ts.map +1 -1
- package/dist/types/utilities/hooks/useRadioGroup/useRadioGroup.d.ts.map +1 -1
- package/dist/types/utilities/omit/omit.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, createContext, useState, useId, useRef, useEffect, useCallback } from 'react';
|
|
4
|
+
import '@u-elements/u-tags';
|
|
5
|
+
import { useMergeRefs } from '@floating-ui/react';
|
|
6
|
+
import { getDatalistValue, syncDatalistState } from '@u-elements/u-datalist';
|
|
7
|
+
import cl from 'clsx/lite';
|
|
8
|
+
|
|
9
|
+
const MultiSuggestionContext = createContext({});
|
|
10
|
+
const MultiSuggestion = forwardRef(function MultiSuggestion({ value, defaultValue, onValueChange, name, filter = true, allowCreate = false, className, ...rest }, ref) {
|
|
11
|
+
const [listId, setListId] = useState(useId());
|
|
12
|
+
const [selectedItems, setSelectedItems] = useState({});
|
|
13
|
+
const inputRef = useRef(null);
|
|
14
|
+
const uTagsRef = useRef(null);
|
|
15
|
+
const mergedRefs = useMergeRefs([ref, uTagsRef]);
|
|
16
|
+
const isControlled = Boolean(value);
|
|
17
|
+
const [controlledDirty, setControlledDirty] = useState(false);
|
|
18
|
+
/**
|
|
19
|
+
* If we have set a default value, set it on initial render
|
|
20
|
+
*/
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!defaultValue)
|
|
23
|
+
return;
|
|
24
|
+
if (value) {
|
|
25
|
+
console.warn('defaultValue can not be used in combination with value');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const items = uTagsRef.current?.querySelectorAll('u-option');
|
|
29
|
+
if (!items)
|
|
30
|
+
return;
|
|
31
|
+
const defaultItems = Array.from(items).filter((item) => defaultValue.includes(item.value));
|
|
32
|
+
for (const item of defaultItems) {
|
|
33
|
+
uTagsRef.current?.dispatchEvent(new CustomEvent('add', {
|
|
34
|
+
detail: { item },
|
|
35
|
+
}));
|
|
36
|
+
setSelectedItems((prevItems) => ({
|
|
37
|
+
...prevItems,
|
|
38
|
+
[item.value]: item,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
return () => {
|
|
42
|
+
console.error('Default value changed during render');
|
|
43
|
+
};
|
|
44
|
+
}, [defaultValue]);
|
|
45
|
+
/**
|
|
46
|
+
* Controlled state management
|
|
47
|
+
*/
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!value)
|
|
50
|
+
return;
|
|
51
|
+
const items = inputRef.current?.list?.options;
|
|
52
|
+
if (!items)
|
|
53
|
+
return;
|
|
54
|
+
const itemsArray = Array.from(items);
|
|
55
|
+
const itemsArrayValues = itemsArray.map((item) => item.value);
|
|
56
|
+
const selectedArray = Object.keys(selectedItems);
|
|
57
|
+
const validValues = value.filter((val) => itemsArrayValues.includes(val));
|
|
58
|
+
const itemsToAdd = validValues.filter((val) => !selectedArray.includes(val));
|
|
59
|
+
const itemsToRemove = selectedArray.filter((val) => !validValues.includes(val));
|
|
60
|
+
for (const item of itemsArray) {
|
|
61
|
+
if (itemsToAdd.includes(item.value)) {
|
|
62
|
+
uTagsRef.current?.dispatchEvent(new CustomEvent('add', {
|
|
63
|
+
detail: { item },
|
|
64
|
+
}));
|
|
65
|
+
setSelectedItems((prevItems) => ({
|
|
66
|
+
...prevItems,
|
|
67
|
+
[item.value]: item,
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
if (itemsToRemove.includes(item.value)) {
|
|
71
|
+
uTagsRef.current?.dispatchEvent(new CustomEvent('remove', {
|
|
72
|
+
detail: { item },
|
|
73
|
+
}));
|
|
74
|
+
setSelectedItems((prevItems) => {
|
|
75
|
+
const { [item.value]: _, ...rest } = prevItems;
|
|
76
|
+
return rest;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}, [value]);
|
|
81
|
+
/**
|
|
82
|
+
* Listerners and handling of adding/removing
|
|
83
|
+
*/
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (!uTagsRef?.current)
|
|
86
|
+
return;
|
|
87
|
+
const handleItemsChange = (e) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
const item = e.detail.item;
|
|
90
|
+
if (e.detail.action === 'add') {
|
|
91
|
+
/**
|
|
92
|
+
* If creating is off, check if the value is allowed to be added
|
|
93
|
+
*/
|
|
94
|
+
if (!allowCreate) {
|
|
95
|
+
const optionExists = Array.from(inputRef.current?.list?.options || [], getDatalistValue).includes(item.value);
|
|
96
|
+
if (!optionExists)
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
setSelectedItems((prevItems) => ({
|
|
100
|
+
...prevItems,
|
|
101
|
+
[item.value]: item,
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
if (e.detail.action === 'remove') {
|
|
105
|
+
setSelectedItems((prevItems) => {
|
|
106
|
+
const { [item.value]: _, ...rest } = prevItems;
|
|
107
|
+
return rest;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (isControlled)
|
|
111
|
+
setControlledDirty(true);
|
|
112
|
+
};
|
|
113
|
+
uTagsRef.current.addEventListener('tags', handleItemsChange);
|
|
114
|
+
return () => {
|
|
115
|
+
uTagsRef.current?.removeEventListener('tags', handleItemsChange);
|
|
116
|
+
};
|
|
117
|
+
}, [uTagsRef, setSelectedItems]);
|
|
118
|
+
/**
|
|
119
|
+
* When controlled, trigger onValueChange callback for ordinary add/remove
|
|
120
|
+
*/
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!controlledDirty)
|
|
123
|
+
return;
|
|
124
|
+
onValueChange?.(Object.keys(selectedItems));
|
|
125
|
+
setControlledDirty(false);
|
|
126
|
+
}, [controlledDirty]);
|
|
127
|
+
const handleFilter = useCallback((input) => {
|
|
128
|
+
const list = input?.list;
|
|
129
|
+
// Let <datalist> handle filtering if filter is true
|
|
130
|
+
if (filter === true || !list)
|
|
131
|
+
return;
|
|
132
|
+
// Handle custom filter
|
|
133
|
+
if (filter !== false) {
|
|
134
|
+
let index = 0;
|
|
135
|
+
for (const option of list.getElementsByTagName('u-option')) {
|
|
136
|
+
if (!option.hasAttribute('data-empty'))
|
|
137
|
+
option.disabled = !filter({
|
|
138
|
+
index: index++, // Increment index for each <option>
|
|
139
|
+
input,
|
|
140
|
+
optionElement: option,
|
|
141
|
+
text: option.text,
|
|
142
|
+
value: getDatalistValue(option),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
syncDatalistState(input); // Sync the datalist state if filter is custom or false
|
|
147
|
+
}, [filter]);
|
|
148
|
+
return (jsxs(MultiSuggestionContext.Provider, { value: {
|
|
149
|
+
inputRef,
|
|
150
|
+
listId,
|
|
151
|
+
selectedItems,
|
|
152
|
+
setListId,
|
|
153
|
+
handleFilter,
|
|
154
|
+
}, children: [jsx("u-tags", { class: cl('ds-multi-suggestion', className), ref: mergedRefs, ...rest }), name && (jsx("select", { multiple: true, hidden: true, name: name, children: Object.values(selectedItems).map((item) => (jsx("option", { value: item.value }, item.value))) }))] }));
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
export { MultiSuggestion, MultiSuggestionContext };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { Chip } from '../Chip/index.js';
|
|
5
|
+
import { MultiSuggestionContext } from './MultiSuggestion.js';
|
|
6
|
+
|
|
7
|
+
const MultiSuggestionChips = ({ render = ({ value }) => value, }) => {
|
|
8
|
+
const { selectedItems } = useContext(MultiSuggestionContext);
|
|
9
|
+
return (jsx(Fragment, { children: selectedItems &&
|
|
10
|
+
Object.values(selectedItems).map((item) => (jsx(Chip.Removable, { value: item.value, asChild: true, children: jsx("data", { children: render({
|
|
11
|
+
text: item.textContent || item.value,
|
|
12
|
+
value: item.value,
|
|
13
|
+
element: item,
|
|
14
|
+
}) }) }, item.value))) }));
|
|
15
|
+
};
|
|
16
|
+
MultiSuggestionChips.displayName = 'MultiSuggestionChips';
|
|
17
|
+
|
|
18
|
+
export { MultiSuggestionChips };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useContext } from 'react';
|
|
4
|
+
import { MultiSuggestionContext } from './MultiSuggestion.js';
|
|
5
|
+
import { Button } from '../Button/Button.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component that provides a clear button for the MultiSuggestion input.
|
|
9
|
+
*
|
|
10
|
+
* Place as a descendant of `MultiSuggestion`
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <MultiSuggestion>
|
|
14
|
+
* <MultiSuggestion.Input />
|
|
15
|
+
* <MultiSuggestion.Clear />
|
|
16
|
+
* <MultiSuggestion.List />
|
|
17
|
+
* </MultiSuggestion>
|
|
18
|
+
*/
|
|
19
|
+
const MultiSuggestionClear = forwardRef(function MultiSuggestionClear({ 'aria-label': label = 'Tøm', onClick, ...rest }, ref) {
|
|
20
|
+
const { inputRef } = useContext(MultiSuggestionContext); //, handleValueChange
|
|
21
|
+
const handleClear = (event) => {
|
|
22
|
+
if (!inputRef?.current)
|
|
23
|
+
throw new Error('Input is missing');
|
|
24
|
+
/* narrow type to make TS happy */
|
|
25
|
+
if (!(inputRef?.current instanceof HTMLInputElement))
|
|
26
|
+
throw new Error('Input is not an input element');
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
setReactInputValue(inputRef.current, '');
|
|
29
|
+
inputRef.current.focus();
|
|
30
|
+
onClick?.(event);
|
|
31
|
+
};
|
|
32
|
+
return (jsx(Button, { ref: ref, variant: 'tertiary', type: 'reset', "aria-label": label, onClick: handleClear, icon: true, ...rest }));
|
|
33
|
+
});
|
|
34
|
+
// Copied from https://github.com/facebook/react/issues/11488#issuecomment-1300987446
|
|
35
|
+
const setReactInputValue = (input, value) => {
|
|
36
|
+
const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;
|
|
37
|
+
if (nativeInputValueSetter) {
|
|
38
|
+
nativeInputValueSetter.call(input, value);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
throw new Error('Unable to find the native input value setter');
|
|
42
|
+
}
|
|
43
|
+
const inputEvent = new Event('input', { bubbles: true });
|
|
44
|
+
const changeEvent = new Event('change', { bubbles: true });
|
|
45
|
+
input.dispatchEvent(inputEvent);
|
|
46
|
+
input.dispatchEvent(changeEvent);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { MultiSuggestionClear, setReactInputValue };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Component that provides an empty MultiSuggestion list.
|
|
7
|
+
*
|
|
8
|
+
* Place as a descendant of `MultiSuggestion.List`
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <MultiSuggestion.List>
|
|
12
|
+
* <MultiSuggestion.Empty>Tomt</MultiSuggestion.Empty>
|
|
13
|
+
* </MultiSuggestion.List>
|
|
14
|
+
*/
|
|
15
|
+
const MultiSuggestionEmpty = forwardRef(function MultiSuggestionEmpty(rest, ref) {
|
|
16
|
+
return (
|
|
17
|
+
// biome-ignore lint/a11y/noInteractiveElementToNoninteractiveRole: Empty option shoult not be interactive
|
|
18
|
+
jsx("u-option", { "data-empty": true, role: 'none', ref: ref, ...rest }));
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export { MultiSuggestionEmpty };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMergeRefs } from '@floating-ui/react';
|
|
4
|
+
import { isDatalistClick } from '@u-elements/u-datalist';
|
|
5
|
+
import { forwardRef, useContext, useEffect } from 'react';
|
|
6
|
+
import { MultiSuggestionContext } from './MultiSuggestion.js';
|
|
7
|
+
import { Input } from '../Input/Input.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Component that provides an input field for the MultiSuggestion list.
|
|
11
|
+
*
|
|
12
|
+
* Place as a descendant of `MultiSuggestion`
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <MultiSuggestion>
|
|
16
|
+
* <MultiSuggestion.Input />
|
|
17
|
+
* <MultiSuggestion.List />
|
|
18
|
+
* </MultiSuggestion>
|
|
19
|
+
*/
|
|
20
|
+
const MultiSuggestionInput = forwardRef(function MultiSuggestionList({ value, onInput, ...rest }, ref) {
|
|
21
|
+
const { listId, inputRef, handleFilter } = useContext(MultiSuggestionContext);
|
|
22
|
+
const mergedRefs = useMergeRefs([inputRef, ref]);
|
|
23
|
+
// Update also if controlled value
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
handleFilter?.(inputRef?.current);
|
|
26
|
+
}, [value]);
|
|
27
|
+
return (jsx(Input, { ref: mergedRefs, list: listId, value: value, onInput: (event) => {
|
|
28
|
+
onInput?.(event); // Should run first
|
|
29
|
+
if (!isDatalistClick(event.nativeEvent))
|
|
30
|
+
handleFilter?.(inputRef?.current);
|
|
31
|
+
}, placeholder: '' // We need an empty placeholder for the clear button to be able to show/hide
|
|
32
|
+
, ...rest }));
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { MultiSuggestionInput };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef, useContext, useEffect } from 'react';
|
|
4
|
+
import '@u-elements/u-datalist';
|
|
5
|
+
import { MultiSuggestionContext } from './MultiSuggestion.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Component that provides a MultiSuggestion list.
|
|
9
|
+
*
|
|
10
|
+
* Place as a descendant of `MultiSuggestion`
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <MultiSuggestion>
|
|
14
|
+
* <MultiSuggestion.Input />
|
|
15
|
+
* <MultiSuggestion.List />
|
|
16
|
+
* </MultiSuggestion>
|
|
17
|
+
*/
|
|
18
|
+
const MultiSuggestionList = forwardRef(function MultiSuggestionList({ singular = '%d forslag', plural = '%d forslag', className, id, ...rest }, ref) {
|
|
19
|
+
const { inputRef, listId, setListId, handleFilter } = useContext(MultiSuggestionContext);
|
|
20
|
+
useEffect(() => handleFilter?.(inputRef?.current)); // Must run on every render
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (id && listId !== id)
|
|
23
|
+
setListId?.(id);
|
|
24
|
+
}, [listId, id, setListId]);
|
|
25
|
+
return (jsx("u-datalist", { "data-sr-singular": singular, "data-sr-plural": plural, class: className, id: listId, ref: ref, ...rest }));
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { MultiSuggestionList };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import '@u-elements/u-datalist';
|
|
5
|
+
|
|
6
|
+
const MultiSuggestionOption = forwardRef(function MultiSuggestionOption({ className, ...rest }, ref) {
|
|
7
|
+
return (jsx("u-option", { class: className, ref: ref, ...rest }));
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { MultiSuggestionOption };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { MultiSuggestion as MultiSuggestion$1 } from './MultiSuggestion.js';
|
|
3
|
+
import { MultiSuggestionChips } from './MultiSuggestionChips.js';
|
|
4
|
+
import { MultiSuggestionClear } from './MultiSuggestionClear.js';
|
|
5
|
+
import { MultiSuggestionEmpty } from './MultiSuggestionEmpty.js';
|
|
6
|
+
import { MultiSuggestionInput } from './MultiSuggestionInput.js';
|
|
7
|
+
import { MultiSuggestionList } from './MultiSuggestionList.js';
|
|
8
|
+
import { MultiSuggestionOption } from './MultiSuggestionOption.js';
|
|
9
|
+
|
|
10
|
+
const MultiSuggestion = Object.assign(MultiSuggestion$1, {
|
|
11
|
+
Input: MultiSuggestionInput,
|
|
12
|
+
List: MultiSuggestionList,
|
|
13
|
+
Option: MultiSuggestionOption,
|
|
14
|
+
Chips: MultiSuggestionChips,
|
|
15
|
+
Empty: MultiSuggestionEmpty,
|
|
16
|
+
Clear: MultiSuggestionClear,
|
|
17
|
+
});
|
|
18
|
+
MultiSuggestion.displayName = 'EXPERIMENTRAL_MultiSuggestion';
|
|
19
|
+
MultiSuggestion.Input.displayName = 'EXPERIMENTRAL_MultiSuggestion.Input';
|
|
20
|
+
MultiSuggestion.List.displayName = 'EXPERIMENTRAL_MultiSuggestion.List';
|
|
21
|
+
MultiSuggestion.Option.displayName = 'EXPERIMENTRAL_MultiSuggestion.Option';
|
|
22
|
+
MultiSuggestion.Chips.displayName = 'EXPERIMENTRAL_MultiSuggestion.Chips';
|
|
23
|
+
MultiSuggestion.Empty.displayName = 'EXPERIMENTRAL_MultiSuggestion.Empty';
|
|
24
|
+
MultiSuggestion.Clear.displayName = 'EXPERIMENTRAL_MultiSuggestion.Clear';
|
|
25
|
+
|
|
26
|
+
export { MultiSuggestion as EXPERIMENTAL_MultiSuggestion, MultiSuggestionChips as EXPERIMENTAL_MultiSuggestionChips, MultiSuggestionClear as EXPERIMENTAL_MultiSuggestionClear, MultiSuggestionEmpty as EXPERIMENTAL_MultiSuggestionEmpty, MultiSuggestionInput as EXPERIMENTAL_MultiSuggestionInput, MultiSuggestionList as EXPERIMENTAL_MultiSuggestionList, MultiSuggestionOption as EXPERIMENTAL_MultiSuggestionOption };
|
package/dist/esm/index.js
CHANGED
|
@@ -94,6 +94,13 @@ export { SuggestionInput as EXPERIMENTAL_SuggestionInput } from './components/Su
|
|
|
94
94
|
export { SuggestionEmpty as EXPERIMENTAL_SuggestionEmpty } from './components/Suggestion/SuggestionEmpty.js';
|
|
95
95
|
export { SuggestionOption as EXPERIMENTAL_SuggestionOption } from './components/Suggestion/SuggestionOption.js';
|
|
96
96
|
export { SuggestionClear as EXPERIMENTAL_SuggestionClear } from './components/Suggestion/SuggestionClear.js';
|
|
97
|
+
export { EXPERIMENTAL_MultiSuggestion } from './components/MultiSuggestion/index.js';
|
|
98
|
+
export { MultiSuggestionInput as EXPERIMENTAL_MultiSuggestionInput } from './components/MultiSuggestion/MultiSuggestionInput.js';
|
|
99
|
+
export { MultiSuggestionList as EXPERIMENTAL_MultiSuggestionList } from './components/MultiSuggestion/MultiSuggestionList.js';
|
|
100
|
+
export { MultiSuggestionOption as EXPERIMENTAL_MultiSuggestionOption } from './components/MultiSuggestion/MultiSuggestionOption.js';
|
|
101
|
+
export { MultiSuggestionChips as EXPERIMENTAL_MultiSuggestionChips } from './components/MultiSuggestion/MultiSuggestionChips.js';
|
|
102
|
+
export { MultiSuggestionEmpty as EXPERIMENTAL_MultiSuggestionEmpty } from './components/MultiSuggestion/MultiSuggestionEmpty.js';
|
|
103
|
+
export { MultiSuggestionClear as EXPERIMENTAL_MultiSuggestionClear } from './components/MultiSuggestion/MultiSuggestionClear.js';
|
|
97
104
|
export { omit } from './utilities/omit/omit.js';
|
|
98
105
|
export { useCheckboxGroup } from './utilities/hooks/useCheckboxGroup/useCheckboxGroup.js';
|
|
99
106
|
export { useDebounceCallback } from './utilities/hooks/useDebounceCallback/useDebounceCallback.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useMergeRefs } from '@floating-ui/react';
|
|
3
2
|
import { useState, useId, useRef, useEffect } from 'react';
|
|
4
3
|
|
|
5
4
|
const toggleIndeterminate = (getIndeterminateInputs, getInputs) => {
|
|
@@ -18,8 +17,12 @@ function useCheckboxGroup(props) {
|
|
|
18
17
|
const errorId = useId();
|
|
19
18
|
const checkboxRefs = useRef(new Set());
|
|
20
19
|
const indeterminateRefs = useRef(new Set());
|
|
20
|
+
const inputRefs = useRef(new Map());
|
|
21
21
|
const getInputs = (checked) => Array.from(checkboxRefs.current.values()).filter((input) => input.checked === checked);
|
|
22
22
|
const getIndeterminateInputs = () => Array.from(indeterminateRefs.current.values());
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
toggleIndeterminate(getIndeterminateInputs, getInputs);
|
|
25
|
+
}, [groupValue]);
|
|
23
26
|
return {
|
|
24
27
|
/**
|
|
25
28
|
* Current value of the group.
|
|
@@ -45,44 +48,49 @@ function useCheckboxGroup(props) {
|
|
|
45
48
|
const props = typeof propsOrValue === 'string'
|
|
46
49
|
? { value: propsOrValue }
|
|
47
50
|
: propsOrValue || {};
|
|
48
|
-
const { allowIndeterminate = false, ref = undefined, value = '', ...rest } = props;
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
+
const { allowIndeterminate = false, ref: forwardedRef = undefined, value = '', ...rest } = props;
|
|
52
|
+
const handleRef = (element) => {
|
|
53
|
+
if (element) {
|
|
54
|
+
const refs = allowIndeterminate ? indeterminateRefs : checkboxRefs;
|
|
55
|
+
refs.current.add(element);
|
|
56
|
+
inputRefs.current.set(value, element);
|
|
57
|
+
if (getIndeterminateInputs().length) {
|
|
58
|
+
toggleIndeterminate(getIndeterminateInputs, getInputs);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const oldElement = inputRefs.current.get(value);
|
|
63
|
+
if (oldElement) {
|
|
64
|
+
checkboxRefs.current.delete(oldElement);
|
|
65
|
+
indeterminateRefs.current.delete(oldElement);
|
|
66
|
+
inputRefs.current.delete(value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (forwardedRef) {
|
|
70
|
+
if (typeof forwardedRef === 'function') {
|
|
71
|
+
forwardedRef(element);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
forwardedRef.current = element;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
51
78
|
const handleChange = () => {
|
|
52
79
|
const nextGroupValue = Array.from(getInputs(true), ({ value }) => value);
|
|
53
80
|
setGroupValue(nextGroupValue);
|
|
54
81
|
onChange?.(nextGroupValue, groupValue);
|
|
55
82
|
};
|
|
56
83
|
const indeterminateChange = () => {
|
|
57
|
-
|
|
84
|
+
const element = inputRefs.current.get(value);
|
|
85
|
+
if (!element)
|
|
58
86
|
return;
|
|
59
|
-
const checked = !!
|
|
87
|
+
const checked = !!element.checked;
|
|
60
88
|
for (const input of getInputs(!checked)) {
|
|
61
|
-
/* We use click to send both event and change checked state */
|
|
62
89
|
input.click();
|
|
63
90
|
}
|
|
64
91
|
};
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
if (!allowIndeterminate)
|
|
67
|
-
return;
|
|
68
|
-
toggleIndeterminate(getIndeterminateInputs, getInputs);
|
|
69
|
-
}, [groupValue]);
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
if (!inputRef.current)
|
|
72
|
-
return;
|
|
73
|
-
const input = inputRef.current;
|
|
74
|
-
const refs = allowIndeterminate ? indeterminateRefs : checkboxRefs;
|
|
75
|
-
refs.current.add(input);
|
|
76
|
-
if (getIndeterminateInputs().length)
|
|
77
|
-
toggleIndeterminate(getIndeterminateInputs, getInputs);
|
|
78
|
-
return () => {
|
|
79
|
-
refs.current.delete(input);
|
|
80
|
-
};
|
|
81
|
-
}, [value]);
|
|
82
92
|
return {
|
|
83
|
-
/* Spread anything the user has set first */
|
|
84
93
|
...rest,
|
|
85
|
-
/* Concat ours with the user prop */
|
|
86
94
|
'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
|
|
87
95
|
undefined,
|
|
88
96
|
'aria-invalid': !!error || rest['aria-invalid'],
|
|
@@ -95,7 +103,7 @@ function useCheckboxGroup(props) {
|
|
|
95
103
|
allowIndeterminate && indeterminateChange();
|
|
96
104
|
handleChange();
|
|
97
105
|
},
|
|
98
|
-
ref:
|
|
106
|
+
ref: handleRef,
|
|
99
107
|
value,
|
|
100
108
|
disabled: disabled || rest.disabled,
|
|
101
109
|
readOnly: readOnly || rest.readOnly,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useId, useRef, useEffect } from 'react';
|
|
2
|
+
import { useState, useId } from 'react';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* useRadioGroup is used to group multiple <Radio> components
|
|
@@ -41,34 +40,38 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
|
|
|
41
40
|
const props = typeof propsOrValue === 'string'
|
|
42
41
|
? { value: propsOrValue }
|
|
43
42
|
: propsOrValue;
|
|
44
|
-
const { ref = undefined, value = '', ...rest } = props;
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const { ref: forwardedRef = undefined, value = '', ...rest } = props;
|
|
44
|
+
const handleRef = (element) => {
|
|
45
|
+
if (element) {
|
|
46
|
+
// Set initial checked state
|
|
47
|
+
element.checked = value === groupValue;
|
|
48
|
+
}
|
|
49
|
+
// Handle forwarded ref
|
|
50
|
+
if (forwardedRef) {
|
|
51
|
+
if (typeof forwardedRef === 'function') {
|
|
52
|
+
forwardedRef(element);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
forwardedRef.current = element;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const handleChange = (e) => {
|
|
60
|
+
if (e.target.name === radioGroupName) {
|
|
51
61
|
setGroupValue((prevValue) => {
|
|
52
|
-
onChange?.(
|
|
53
|
-
return
|
|
62
|
+
onChange?.(e.target.value, prevValue);
|
|
63
|
+
return e.target.value;
|
|
54
64
|
});
|
|
55
65
|
}
|
|
56
66
|
};
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (!localRef.current)
|
|
59
|
-
return;
|
|
60
|
-
localRef.current.checked = value === groupValue;
|
|
61
|
-
}, [groupValue, value]);
|
|
62
67
|
return {
|
|
63
|
-
/* Spread anything the user has set first */
|
|
64
68
|
...rest,
|
|
65
|
-
/* Concat ours with the user prop */
|
|
66
69
|
name: radioGroupName,
|
|
67
70
|
'aria-describedby': `${error ? errorId : ''} ${rest['aria-describedby'] || ''}`.trim() ||
|
|
68
71
|
undefined,
|
|
69
72
|
'aria-invalid': !!error || rest['aria-invalid'],
|
|
70
73
|
value,
|
|
71
|
-
ref:
|
|
74
|
+
ref: handleRef,
|
|
72
75
|
required: required || rest.required,
|
|
73
76
|
readOnly: readOnly || rest.readOnly,
|
|
74
77
|
disabled: disabled || rest.disabled,
|
|
@@ -76,7 +79,7 @@ function useRadioGroup({ error, readOnly, required, disabled, name, onChange, va
|
|
|
76
79
|
rest.onChange?.(e);
|
|
77
80
|
if (e.defaultPrevented)
|
|
78
81
|
return;
|
|
79
|
-
handleChange();
|
|
82
|
+
handleChange(e);
|
|
80
83
|
},
|
|
81
84
|
};
|
|
82
85
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxIdContext.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/ComboboxIdContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,sCAE5B,CAAC;AAEH,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,uBAAuB,GAAG,oBAAoB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ComboboxIdContext.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/ComboboxIdContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjD,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,sCAE5B,CAAC;AAEH,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,uBAAuB,GAAG,oBAAoB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,GAC5B,OAAO,qBAAqB,EAC5B,QAAQ,uBAAuB,0BAWhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,+CAI7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,GAAI,eAEhC;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,4CAYA,CAAC;AAEF,wBAAgB,qBAAqB,mCAEpC;AAED,wBAAgB,aAAa,0BAE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComboboxOption.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/Option/useComboboxOption.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,KAAK,sBAAsB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useComboboxOption.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/Option/useComboboxOption.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAG7C,KAAK,sBAAsB,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,uBAAuB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,qBAI/B,sBAAsB,KAAG,uBAuD3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComboboxKeyboard.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/useComboboxKeyboard.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aA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EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,iBAAiB,CAAC,CAAC;IACnE,mBAAmB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,qBAAqB,CAAC,CAAC;IAC3E,OAAO,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,SAAS,CAAC,CAAC;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,kBAAkB,EAAE,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,kJAYjC,wBAAwB,gDA2E1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingCombobox.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/useFloatingCombobox.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAK9C,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,gBAAgB,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"useFloatingCombobox.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/useFloatingCombobox.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAK9C,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,gBAAgB,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,aAAa,wBAAwB;;;;;;kBAwEw0N,MAAO,gBAAgB;;;;;;;;;;;;;wBAA5X,MAAO,aAAa;;;;iBAAoe,MAAO,gBAAgB;;;;;;oCAA6yxB,MAAO,SAAS;mCAA0E,MAAO,SAAS;oCAAgF,MAAM,SAAS;;;;CADhjgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormField.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/useFormField/useFormField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,MAAM,cAAc,GAAG;IAC3B,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,IAAI,CACN,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,UAAU,GAAG,cAAc,GAAG,kBAAkB,CACjD,CAAC;CACH,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"useFormField.d.ts","sourceRoot":"","sources":["../../../../src/components/Combobox/useFormField/useFormField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAG3C,MAAM,MAAM,cAAc,GAAG;IAC3B,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,GAAG,IAAI,CACN,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,UAAU,GAAG,cAAc,GAAG,kBAAkB,CACjD,CAAC;CACH,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,cAAc,EACrB,QAAQ,MAAM,KACb,SAkCF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/utilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAID;;;;GAIG;AACH,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/utilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,SAAS,GACf,KAAK,IAAI,YAAY,CAAC,mBAAmB,CAAC,CAE5C;AAID;;;;GAIG;AACH,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,KAAG,MAEvC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAE5C,CAAC;AAIF,KAAK,iBAAiB,GAAG;IAAE,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,kBAAkB,GAC7B,OAAO,gBAAgB,GAAG,iBAAiB,EAC3C,OAAO,MAAM,KACZ,IAaF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldObserver.d.ts","sourceRoot":"","sources":["../../../src/components/Field/fieldObserver.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,4BA4E7D;AAGD,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"fieldObserver.d.ts","sourceRoot":"","sources":["../../../src/components/Field/fieldObserver.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,YAAY,EAAE,WAAW,GAAG,IAAI,4BA4E7D;AAGD,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,oBAA4B,CAAC;AACjE,eAAO,MAAM,OAAO,GAAI,MAAM,IAAI,6BAAqC,CAAC;AACxE,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,gBAGd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSuggestionClear.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSuggestion/MultiSuggestionClear.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAIrD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,WAAW,EACX,SAAS,GAAG,UAAU,CACvB,GAAG;IACF;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB;IAnB/B;;;OAGG;mBACY,MAAM;2CAiDrB,CAAC;AAIH,KAAK,iBAAiB,GAAG;IAAE,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAG/E,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"MultiSuggestionClear.d.ts","sourceRoot":"","sources":["../../../src/components/MultiSuggestion/MultiSuggestionClear.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAIrD,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,WAAW,EACX,SAAS,GAAG,UAAU,CACvB,GAAG;IACF;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB;IAnB/B;;;OAGG;mBACY,MAAM;2CAiDrB,CAAC;AAIH,KAAK,iBAAiB,GAAG;IAAE,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAG/E,eAAO,MAAM,kBAAkB,GAC7B,OAAO,gBAAgB,GAAG,iBAAiB,EAC3C,OAAO,MAAM,KACZ,IAcF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SuggestionClear.d.ts","sourceRoot":"","sources":["../../../src/components/Suggestion/SuggestionClear.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAIrD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,UAAU,CAAC,GAAG;IAC7E;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe;IAnB1B;;;OAGG;mBACY,MAAM;2CAkDrB,CAAC;AAIH,KAAK,iBAAiB,GAAG;IAAE,aAAa,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;CAAE,CAAC;AAG/E,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"SuggestionClear.d.ts","sourceRoot":"","sources":["../../../src/components/Suggestion/SuggestionClear.tsx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C;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRovingFocus.d.ts","sourceRoot":"","sources":["../../../src/utilities/RovingFocus/useRovingFocus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,wEAAwE;AACxE,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"useRovingFocus.d.ts","sourceRoot":"","sources":["../../../src/utilities/RovingFocus/useRovingFocus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,wEAAwE;AACxE,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM;;;;qBAcvB,CAAC,SAAS,WAAW,SAAS,cAAc,CAAC,CAAC,CAAC;uBAE/C,WAAW,GAAG,IAAI;uBAOlB,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;qBAOxB,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/useCheckboxGroup/useCheckboxGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/utilities/hooks/useCheckboxGroup/useCheckboxGroup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAClE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,aAAa,EACX,QAAQ,GACR,MAAM,GACN,MAAM,GACN,MAAM,GACN,YAAY,GACZ,iBAAiB,GACjB,OAAO,GACP,SAAS,GACT,OAAO,CACV,GAAG;IACF,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,GAAG,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAA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