@tipp/ui 2.1.24 → 2.1.25
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/app/index.cjs.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +1 -1
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +1 -1
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +1 -1
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +1 -1
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +1 -1
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +1 -1
- package/dist/chunk-4OWVGO4Q.js +359 -0
- package/dist/chunk-4OWVGO4Q.js.map +1 -0
- package/dist/chunk-5JWXURRT.js +371 -0
- package/dist/chunk-5JWXURRT.js.map +1 -0
- package/dist/chunk-5V3HBI7J.js +363 -0
- package/dist/chunk-5V3HBI7J.js.map +1 -0
- package/dist/chunk-65AXEA2I.js +362 -0
- package/dist/chunk-65AXEA2I.js.map +1 -0
- package/dist/chunk-7PMPVRQ7.js +361 -0
- package/dist/chunk-7PMPVRQ7.js.map +1 -0
- package/dist/chunk-A3ZVKMWK.js +364 -0
- package/dist/chunk-A3ZVKMWK.js.map +1 -0
- package/dist/chunk-AZO6RISE.js +371 -0
- package/dist/chunk-AZO6RISE.js.map +1 -0
- package/dist/chunk-DV2L5NBN.js +64 -0
- package/dist/chunk-DV2L5NBN.js.map +1 -0
- package/dist/chunk-EDGTAXYO.js +363 -0
- package/dist/chunk-EDGTAXYO.js.map +1 -0
- package/dist/chunk-FHCRGIFR.js +362 -0
- package/dist/chunk-FHCRGIFR.js.map +1 -0
- package/dist/chunk-FRBDP5QD.js +363 -0
- package/dist/chunk-FRBDP5QD.js.map +1 -0
- package/dist/chunk-LAED566B.js +364 -0
- package/dist/chunk-LAED566B.js.map +1 -0
- package/dist/chunk-LWN767FK.js +363 -0
- package/dist/chunk-LWN767FK.js.map +1 -0
- package/dist/chunk-MCODG3QE.js +360 -0
- package/dist/chunk-MCODG3QE.js.map +1 -0
- package/dist/chunk-OICCEZIQ.js +196 -0
- package/dist/chunk-OICCEZIQ.js.map +1 -0
- package/dist/chunk-RBSUJ7YF.js +357 -0
- package/dist/chunk-RBSUJ7YF.js.map +1 -0
- package/dist/chunk-TJMSZLL7.js +364 -0
- package/dist/chunk-TJMSZLL7.js.map +1 -0
- package/dist/chunk-UHE622OE.js +363 -0
- package/dist/chunk-UHE622OE.js.map +1 -0
- package/dist/chunk-X2AXJ6Z5.js +364 -0
- package/dist/chunk-X2AXJ6Z5.js.map +1 -0
- package/dist/chunk-ZYX24XDH.js +364 -0
- package/dist/chunk-ZYX24XDH.js.map +1 -0
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/molecules/index.cjs +11 -2
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +1 -1
- package/dist/molecules/tag-selector.cjs +11 -2
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +1 -1
- package/package.json +1 -1
- package/src/molecules/tag-selector.tsx +15 -6
|
@@ -29,6 +29,11 @@ interface Item {
|
|
|
29
29
|
|
|
30
30
|
const OPTION_HEIGHT = 32;
|
|
31
31
|
|
|
32
|
+
const stopDefaultEvents = (e: React.KeyboardEvent):void => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
};
|
|
36
|
+
|
|
32
37
|
export interface TagSelectorProps<T extends Item> {
|
|
33
38
|
options?: T[];
|
|
34
39
|
selected?: ID[];
|
|
@@ -127,14 +132,14 @@ export function TagSelector<T extends Item>(
|
|
|
127
132
|
}, [options, selected]);
|
|
128
133
|
|
|
129
134
|
const onDelete = useCallback(
|
|
130
|
-
(id: string) => {
|
|
135
|
+
(id: string) => {
|
|
131
136
|
setSelected(selected.filter((el) => el !== id));
|
|
132
137
|
},
|
|
133
138
|
[selected, setSelected]
|
|
134
139
|
);
|
|
135
140
|
|
|
136
141
|
const onSelect = useCallback(
|
|
137
|
-
(id: string) => {
|
|
142
|
+
(id: string) => {
|
|
138
143
|
if (maxCount && selected.length + 1 > maxCount) return;
|
|
139
144
|
setSelected([...selected, id]);
|
|
140
145
|
},
|
|
@@ -142,7 +147,7 @@ export function TagSelector<T extends Item>(
|
|
|
142
147
|
);
|
|
143
148
|
|
|
144
149
|
const toggleItem = useCallback(
|
|
145
|
-
(id: string) => {
|
|
150
|
+
(id: string) => {
|
|
146
151
|
if (selected.includes(id)) {
|
|
147
152
|
onDelete(id);
|
|
148
153
|
} else {
|
|
@@ -171,7 +176,7 @@ export function TagSelector<T extends Item>(
|
|
|
171
176
|
|
|
172
177
|
switch (key) {
|
|
173
178
|
case 'ArrowDown': {
|
|
174
|
-
e
|
|
179
|
+
stopDefaultEvents(e);
|
|
175
180
|
let newFocus = 0;
|
|
176
181
|
if (typeof focusIndex === 'number') {
|
|
177
182
|
newFocus = focusIndex + 1 >= options.length ? 0 : focusIndex + 1;
|
|
@@ -182,7 +187,7 @@ export function TagSelector<T extends Item>(
|
|
|
182
187
|
}
|
|
183
188
|
|
|
184
189
|
case 'ArrowUp': {
|
|
185
|
-
e
|
|
190
|
+
stopDefaultEvents(e);
|
|
186
191
|
let newFocus = 0;
|
|
187
192
|
if (typeof focusIndex === 'number') {
|
|
188
193
|
newFocus = focusIndex - 1 < 0 ? options.length - 1 : focusIndex - 1;
|
|
@@ -193,19 +198,21 @@ export function TagSelector<T extends Item>(
|
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
case 'Enter':
|
|
201
|
+
stopDefaultEvents(e);
|
|
196
202
|
setValue('');
|
|
197
203
|
if (focusIndex !== null) {
|
|
198
204
|
toggleItem(filteredOptions[focusIndex]?.id);
|
|
199
205
|
}
|
|
200
206
|
break;
|
|
201
207
|
|
|
202
|
-
case 'Backspace':
|
|
208
|
+
case 'Backspace':
|
|
203
209
|
if (value.length === 0) {
|
|
204
210
|
setSelected(selected.slice(0, -1));
|
|
205
211
|
}
|
|
206
212
|
break;
|
|
207
213
|
|
|
208
214
|
case 'Escape':
|
|
215
|
+
stopDefaultEvents(e);
|
|
209
216
|
setOpen(false);
|
|
210
217
|
break;
|
|
211
218
|
}
|
|
@@ -340,6 +347,8 @@ export function TagSelector<T extends Item>(
|
|
|
340
347
|
onTouchMove={stopPropagationTouch}
|
|
341
348
|
onWheel={stopPropagationWheel}
|
|
342
349
|
sticky="always"
|
|
350
|
+
style={{
|
|
351
|
+
pointerEvents: 'fill',}}
|
|
343
352
|
>
|
|
344
353
|
<DropdownContainer
|
|
345
354
|
currentItem={filteredOptions[focusIndex || 0]}
|