@react-aria/tag 3.3.0 → 3.3.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/dist/import.mjs +8 -7
- package/dist/main.js +8 -7
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -7
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/useTag.ts +8 -7
- package/src/useTagGroup.ts +1 -1
package/dist/import.mjs
CHANGED
|
@@ -77,7 +77,7 @@ function $d7323bca8d074eeb$export$4f8b5cda58b7e8ff(props, state, ref) {
|
|
|
77
77
|
// If the last tag is removed, focus the container.
|
|
78
78
|
let prevCount = (0, $aIvin$useRef)(state.collection.size);
|
|
79
79
|
(0, $aIvin$useEffect)(()=>{
|
|
80
|
-
if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
80
|
+
if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
81
81
|
prevCount.current = state.collection.size;
|
|
82
82
|
}, [
|
|
83
83
|
state.collection.size,
|
|
@@ -385,7 +385,7 @@ $3bb15cc24d006ec5$exports = {
|
|
|
385
385
|
|
|
386
386
|
function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
387
387
|
let { item: item } = props;
|
|
388
|
-
let stringFormatter = (0, $aIvin$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3bb15cc24d006ec5$exports))));
|
|
388
|
+
let stringFormatter = (0, $aIvin$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3bb15cc24d006ec5$exports))), "@react-aria/tag");
|
|
389
389
|
let buttonId = (0, $aIvin$useId)();
|
|
390
390
|
let { onRemove: onRemove } = (0, $d7323bca8d074eeb$export$653eddfc964b0f8a).get(state) || {};
|
|
391
391
|
let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $aIvin$useGridListItem)({
|
|
@@ -393,18 +393,19 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
393
393
|
}, state, ref);
|
|
394
394
|
// We want the group to handle keyboard navigation between tags.
|
|
395
395
|
delete rowProps.onKeyDownCapture;
|
|
396
|
-
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
397
|
+
let { descriptionProps: _, ...stateWithoutDescription } = states;
|
|
397
398
|
let onKeyDown = (e)=>{
|
|
398
399
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
399
400
|
e.preventDefault();
|
|
400
|
-
if (state.selectionManager.isSelected(item.key)) onRemove(new Set(state.selectionManager.selectedKeys));
|
|
401
|
-
else onRemove(new Set([
|
|
401
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
402
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
402
403
|
item.key
|
|
403
404
|
]));
|
|
404
405
|
}
|
|
405
406
|
};
|
|
406
407
|
let modality = (0, $aIvin$useInteractionModality)();
|
|
407
|
-
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "
|
|
408
|
+
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
|
|
408
409
|
let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
|
|
409
410
|
let descProps = (0, $aIvin$useDescription)(description);
|
|
410
411
|
let isFocused = item.key === state.selectionManager.focusedKey;
|
|
@@ -430,7 +431,7 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
430
431
|
"aria-errormessage": props["aria-errormessage"],
|
|
431
432
|
"aria-label": props["aria-label"]
|
|
432
433
|
}),
|
|
433
|
-
...
|
|
434
|
+
...stateWithoutDescription,
|
|
434
435
|
allowsRemoving: !!onRemove
|
|
435
436
|
};
|
|
436
437
|
}
|
package/dist/main.js
CHANGED
|
@@ -84,7 +84,7 @@ function $09704b0efefe5140$export$4f8b5cda58b7e8ff(props, state, ref) {
|
|
|
84
84
|
// If the last tag is removed, focus the container.
|
|
85
85
|
let prevCount = (0, $bSzeT$react.useRef)(state.collection.size);
|
|
86
86
|
(0, $bSzeT$react.useEffect)(()=>{
|
|
87
|
-
if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
87
|
+
if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
88
88
|
prevCount.current = state.collection.size;
|
|
89
89
|
}, [
|
|
90
90
|
state.collection.size,
|
|
@@ -392,7 +392,7 @@ $b6a2538ff098a9ff$exports = {
|
|
|
392
392
|
|
|
393
393
|
function $a442534c81d8ad16$export$3f568fff7dff2f03(props, state, ref) {
|
|
394
394
|
let { item: item } = props;
|
|
395
|
-
let stringFormatter = (0, $bSzeT$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($b6a2538ff098a9ff$exports))));
|
|
395
|
+
let stringFormatter = (0, $bSzeT$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($b6a2538ff098a9ff$exports))), "@react-aria/tag");
|
|
396
396
|
let buttonId = (0, $bSzeT$reactariautils.useId)();
|
|
397
397
|
let { onRemove: onRemove } = (0, $09704b0efefe5140$export$653eddfc964b0f8a).get(state) || {};
|
|
398
398
|
let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $bSzeT$reactariagridlist.useGridListItem)({
|
|
@@ -400,18 +400,19 @@ function $a442534c81d8ad16$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
400
400
|
}, state, ref);
|
|
401
401
|
// We want the group to handle keyboard navigation between tags.
|
|
402
402
|
delete rowProps.onKeyDownCapture;
|
|
403
|
-
|
|
403
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
404
|
+
let { descriptionProps: _, ...stateWithoutDescription } = states;
|
|
404
405
|
let onKeyDown = (e)=>{
|
|
405
406
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
406
407
|
e.preventDefault();
|
|
407
|
-
if (state.selectionManager.isSelected(item.key)) onRemove(new Set(state.selectionManager.selectedKeys));
|
|
408
|
-
else onRemove(new Set([
|
|
408
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
409
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
409
410
|
item.key
|
|
410
411
|
]));
|
|
411
412
|
}
|
|
412
413
|
};
|
|
413
414
|
let modality = (0, $bSzeT$reactariainteractions.useInteractionModality)();
|
|
414
|
-
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "
|
|
415
|
+
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
|
|
415
416
|
let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
|
|
416
417
|
let descProps = (0, $bSzeT$reactariautils.useDescription)(description);
|
|
417
418
|
let isFocused = item.key === state.selectionManager.focusedKey;
|
|
@@ -437,7 +438,7 @@ function $a442534c81d8ad16$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
437
438
|
"aria-errormessage": props["aria-errormessage"],
|
|
438
439
|
"aria-label": props["aria-label"]
|
|
439
440
|
}),
|
|
440
|
-
...
|
|
441
|
+
...stateWithoutDescription,
|
|
441
442
|
allowsRemoving: !!onRemove
|
|
442
443
|
};
|
|
443
444
|
}
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,4CAAW,IAAI;AASrB,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAA2B;IAC5G,IAAI,aAAC,S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;YACJ,SAAS,IAAM,WAAW,SAAS,IAAI,IAAI;oBAAC,KAAK,GAAG;iBAAC,KAAK;YAC1D,qBAAqB;QACvB;QACA,UAAU,CAAA,GAAA,gCAAS,EAAE,UAAU,UAAU,WAAW;YAClD,UAAU,AAAC,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,gCAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,MAAM;QACT,gBAAgB,CAAC,CAAC;IACpB;AACF;;CD9FC","sources":["packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/*.js","packages/@react-aria/tag/intl/ar-AE.json","packages/@react-aria/tag/intl/bg-BG.json","packages/@react-aria/tag/intl/cs-CZ.json","packages/@react-aria/tag/intl/da-DK.json","packages/@react-aria/tag/intl/de-DE.json","packages/@react-aria/tag/intl/el-GR.json","packages/@react-aria/tag/intl/en-US.json","packages/@react-aria/tag/intl/es-ES.json","packages/@react-aria/tag/intl/et-EE.json","packages/@react-aria/tag/intl/fi-FI.json","packages/@react-aria/tag/intl/fr-FR.json","packages/@react-aria/tag/intl/he-IL.json","packages/@react-aria/tag/intl/hr-HR.json","packages/@react-aria/tag/intl/hu-HU.json","packages/@react-aria/tag/intl/it-IT.json","packages/@react-aria/tag/intl/ja-JP.json","packages/@react-aria/tag/intl/ko-KR.json","packages/@react-aria/tag/intl/lt-LT.json","packages/@react-aria/tag/intl/lv-LV.json","packages/@react-aria/tag/intl/nb-NO.json","packages/@react-aria/tag/intl/nl-NL.json","packages/@react-aria/tag/intl/pl-PL.json","packages/@react-aria/tag/intl/pt-BR.json","packages/@react-aria/tag/intl/pt-PT.json","packages/@react-aria/tag/intl/ro-RO.json","packages/@react-aria/tag/intl/ru-RU.json","packages/@react-aria/tag/intl/sk-SK.json","packages/@react-aria/tag/intl/sl-SI.json","packages/@react-aria/tag/intl/sr-SP.json","packages/@react-aria/tag/intl/sv-SE.json","packages/@react-aria/tag/intl/tr-TR.json","packages/@react-aria/tag/intl/uk-UA.json","packages/@react-aria/tag/intl/zh-CN.json","packages/@react-aria/tag/intl/zh-TW.json"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n delete states.descriptionProps;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove(new Set([item.key]));\n }\n }\n };\n\n let modality: string = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'touch';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...states,\n allowsRemoving: !!onRemove\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport type {ListState} from '@react-stately/list';\nimport {ReactNode, RefObject, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useGridList} from '@react-aria/gridlist';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface TagGroupAria {\n /** Props for the tag grouping element. */\n gridProps: DOMAttributes,\n /** Props for the tag group's visible label (if any). */\n labelProps: DOMAttributes,\n /** Props for the tag group description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tag group error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\nexport interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Handler that is called when a user deletes a tag. */\n onRemove?: (keys: Set<Key>) => void,\n /** An error message for the field. */\n errorMessage?: ReactNode\n}\n\nexport interface AriaTagGroupOptions<T> extends Omit<AriaTagGroupProps<T>, 'children'> {\n /**\n * An optional keyboard delegate to handle arrow key navigation,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface HookData {\n onRemove?: (keys: Set<Key>) => void\n}\n\nexport const hookData = new WeakMap<ListState<any>, HookData>();\n\n/**\n * Provides the behavior and accessibility implementation for a tag group component.\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n * @param props - Props to be applied to the tag group.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag group.\n */\nexport function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): TagGroupAria {\n let {direction} = useLocale();\n let keyboardDelegate = props.keyboardDelegate || new ListKeyboardDelegate({\n collection: state.collection,\n ref,\n orientation: 'horizontal',\n direction,\n disabledKeys: state.disabledKeys\n });\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span'\n });\n let {gridProps} = useGridList({\n ...props,\n ...fieldProps,\n keyboardDelegate,\n shouldFocusWrap: true,\n linkBehavior: 'override'\n }, state, ref);\n\n let [isFocusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setFocusWithin\n });\n let domProps = filterDOMProps(props);\n\n // If the last tag is removed, focus the container.\n let prevCount = useRef(state.collection.size);\n useEffect(() => {\n if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {\n ref.current.focus();\n }\n prevCount.current = state.collection.size;\n }, [state.collection.size, isFocusWithin, ref]);\n\n hookData.set(state, {onRemove: props.onRemove});\n\n return {\n gridProps: mergeProps(gridProps, domProps, {\n role: state.collection.size ? 'grid' : null,\n 'aria-atomic': false,\n 'aria-relevant': 'additions',\n 'aria-live': isFocusWithin ? 'polite' : 'off',\n ...focusWithinProps,\n ...fieldProps\n }),\n labelProps,\n descriptionProps,\n errorMessageProps\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"removeButtonLabel\": \"إزالة\",\n \"removeDescription\": \"اضغط على مفتاح DELETE لإزالة علامة.\"\n}\n","{\n \"removeButtonLabel\": \"Премахване\",\n \"removeDescription\": \"Натиснете Delete, за да премахнете маркера.\"\n}\n","{\n \"removeButtonLabel\": \"Odebrat\",\n \"removeDescription\": \"Stisknutím klávesy Delete odeberete značku.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Tryk på Slet for at fjerne tag.\"\n}\n","{\n \"removeButtonLabel\": \"Entfernen\",\n \"removeDescription\": \"Auf „Löschen“ drücken, um das Tag zu entfernen.\"\n}\n","{\n \"removeButtonLabel\": \"Κατάργηση\",\n \"removeDescription\": \"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα.\"\n}\n","{ \n \"removeDescription\": \"Press Delete to remove tag.\",\n \"removeButtonLabel\": \"Remove\"\n}\n","{\n \"removeButtonLabel\": \"Quitar\",\n \"removeDescription\": \"Pulse Eliminar para quitar la etiqueta.\"\n}\n","{\n \"removeButtonLabel\": \"Eemalda\",\n \"removeDescription\": \"Sildi eemaldamiseks vajutage kustutusklahvi Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Poista\",\n \"removeDescription\": \"Poista tunniste painamalla Poista-painiketta.\"\n}\n","{\n \"removeButtonLabel\": \"Supprimer\",\n \"removeDescription\": \"Appuyez sur Supprimer pour supprimer l’étiquette.\"\n}\n","{\n \"removeButtonLabel\": \"הסר\",\n \"removeDescription\": \"לחץ על מחק כדי להסיר תג.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Delete za uklanjanje oznake.\"\n}\n","{\n \"removeButtonLabel\": \"Eltávolítás\",\n \"removeDescription\": \"Nyomja meg a Delete billentyűt a címke eltávolításához.\"\n}\n","{\n \"removeButtonLabel\": \"Rimuovi\",\n \"removeDescription\": \"Premi Elimina per rimuovere il tag.\"\n}\n","{\n \"removeButtonLabel\": \"削除\",\n \"removeDescription\": \"タグを削除するには、Delete キーを押します。\"\n}\n","{\n \"removeButtonLabel\": \"제거\",\n \"removeDescription\": \"태그를 제거하려면 Delete 키를 누르십시오.\"\n}\n","{\n \"removeButtonLabel\": \"Pašalinti\",\n \"removeDescription\": \"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą.\"\n}\n","{\n \"removeButtonLabel\": \"Noņemt\",\n \"removeDescription\": \"Nospiediet Delete [Dzēst], lai noņemtu tagu.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Trykk på Slett for å fjerne taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Verwijderen\",\n \"removeDescription\": \"Druk op Verwijderen om de tag te verwijderen.\"\n}\n","{\n \"removeButtonLabel\": \"Usuń\",\n \"removeDescription\": \"Naciśnij Usuń, aby usunąć znacznik.\"\n}\n","{\n \"removeButtonLabel\": \"Remover\",\n \"removeDescription\": \"Pressione Delete para remover a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Eliminar\",\n \"removeDescription\": \"Prima Delete para eliminar a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Îndepărtaţi\",\n \"removeDescription\": \"Apăsați pe Delete (Ștergere) pentru a elimina eticheta.\"\n}\n","{\n \"removeButtonLabel\": \"Удалить\",\n \"removeDescription\": \"Нажмите DELETE, чтобы удалить тег.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrániť\",\n \"removeDescription\": \"Ak chcete odstrániť značku, stlačte kláves Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrani\",\n \"removeDescription\": \"Pritisnite Delete, da odstranite oznako.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Obriši da biste uklonili oznaku.\"\n}\n","{\n \"removeButtonLabel\": \"Ta bort\",\n \"removeDescription\": \"Tryck på Radera för att ta bort taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Kaldır\",\n \"removeDescription\": \"Etiketi kaldırmak için Sil tuşuna basın.\"\n}\n","{\n \"removeButtonLabel\": \"Вилучити\",\n \"removeDescription\": \"Натисніть Delete, щоб вилучити тег.\"\n}\n","{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n","{\n \"removeButtonLabel\": \"移除\",\n \"removeDescription\": \"按 Delete 鍵以移除標記。\"\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,4CAAW,IAAI;AASrB,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAA2B;IAC5G,IAAI,aAAC,SAAS,EAAC,GAAG,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rC,mBAAmB,CAAC,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;YAC/C,IAAI;YACJ,SAAS,IAAM,WAAW,SAAS,IAAI,IAAI;oBAAC,KAAK,GAAG;iBAAC,KAAK;YAC1D,qBAAqB;QACvB;QACA,UAAU,CAAA,GAAA,gCAAS,EAAE,UAAU,UAAU,WAAW;YAClD,UAAU,AAAC,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,gCAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,uBAAuB;QAC1B,gBAAgB,CAAC,CAAC;IACpB;AACF;;CD/FC","sources":["packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/*.js","packages/@react-aria/tag/intl/ar-AE.json","packages/@react-aria/tag/intl/bg-BG.json","packages/@react-aria/tag/intl/cs-CZ.json","packages/@react-aria/tag/intl/da-DK.json","packages/@react-aria/tag/intl/de-DE.json","packages/@react-aria/tag/intl/el-GR.json","packages/@react-aria/tag/intl/en-US.json","packages/@react-aria/tag/intl/es-ES.json","packages/@react-aria/tag/intl/et-EE.json","packages/@react-aria/tag/intl/fi-FI.json","packages/@react-aria/tag/intl/fr-FR.json","packages/@react-aria/tag/intl/he-IL.json","packages/@react-aria/tag/intl/hr-HR.json","packages/@react-aria/tag/intl/hu-HU.json","packages/@react-aria/tag/intl/it-IT.json","packages/@react-aria/tag/intl/ja-JP.json","packages/@react-aria/tag/intl/ko-KR.json","packages/@react-aria/tag/intl/lt-LT.json","packages/@react-aria/tag/intl/lv-LV.json","packages/@react-aria/tag/intl/nb-NO.json","packages/@react-aria/tag/intl/nl-NL.json","packages/@react-aria/tag/intl/pl-PL.json","packages/@react-aria/tag/intl/pt-BR.json","packages/@react-aria/tag/intl/pt-PT.json","packages/@react-aria/tag/intl/ro-RO.json","packages/@react-aria/tag/intl/ru-RU.json","packages/@react-aria/tag/intl/sk-SK.json","packages/@react-aria/tag/intl/sl-SI.json","packages/@react-aria/tag/intl/sr-SP.json","packages/@react-aria/tag/intl/sv-SE.json","packages/@react-aria/tag/intl/tr-TR.json","packages/@react-aria/tag/intl/uk-UA.json","packages/@react-aria/tag/intl/zh-CN.json","packages/@react-aria/tag/intl/zh-TW.json"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n };\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'pointer';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport type {ListState} from '@react-stately/list';\nimport {ReactNode, RefObject, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useGridList} from '@react-aria/gridlist';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface TagGroupAria {\n /** Props for the tag grouping element. */\n gridProps: DOMAttributes,\n /** Props for the tag group's visible label (if any). */\n labelProps: DOMAttributes,\n /** Props for the tag group description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tag group error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\nexport interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Handler that is called when a user deletes a tag. */\n onRemove?: (keys: Set<Key>) => void,\n /** An error message for the field. */\n errorMessage?: ReactNode\n}\n\nexport interface AriaTagGroupOptions<T> extends Omit<AriaTagGroupProps<T>, 'children'> {\n /**\n * An optional keyboard delegate to handle arrow key navigation,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface HookData {\n onRemove?: (keys: Set<Key>) => void\n}\n\nexport const hookData = new WeakMap<ListState<any>, HookData>();\n\n/**\n * Provides the behavior and accessibility implementation for a tag group component.\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n * @param props - Props to be applied to the tag group.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag group.\n */\nexport function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): TagGroupAria {\n let {direction} = useLocale();\n let keyboardDelegate = props.keyboardDelegate || new ListKeyboardDelegate({\n collection: state.collection,\n ref,\n orientation: 'horizontal',\n direction,\n disabledKeys: state.disabledKeys\n });\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span'\n });\n let {gridProps} = useGridList({\n ...props,\n ...fieldProps,\n keyboardDelegate,\n shouldFocusWrap: true,\n linkBehavior: 'override'\n }, state, ref);\n\n let [isFocusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setFocusWithin\n });\n let domProps = filterDOMProps(props);\n\n // If the last tag is removed, focus the container.\n let prevCount = useRef(state.collection.size);\n useEffect(() => {\n if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {\n ref.current.focus();\n }\n prevCount.current = state.collection.size;\n }, [state.collection.size, isFocusWithin, ref]);\n\n hookData.set(state, {onRemove: props.onRemove});\n\n return {\n gridProps: mergeProps(gridProps, domProps, {\n role: state.collection.size ? 'grid' : null,\n 'aria-atomic': false,\n 'aria-relevant': 'additions',\n 'aria-live': isFocusWithin ? 'polite' : 'off',\n ...focusWithinProps,\n ...fieldProps\n }),\n labelProps,\n descriptionProps,\n errorMessageProps\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"removeButtonLabel\": \"إزالة\",\n \"removeDescription\": \"اضغط على مفتاح DELETE لإزالة علامة.\"\n}\n","{\n \"removeButtonLabel\": \"Премахване\",\n \"removeDescription\": \"Натиснете Delete, за да премахнете маркера.\"\n}\n","{\n \"removeButtonLabel\": \"Odebrat\",\n \"removeDescription\": \"Stisknutím klávesy Delete odeberete značku.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Tryk på Slet for at fjerne tag.\"\n}\n","{\n \"removeButtonLabel\": \"Entfernen\",\n \"removeDescription\": \"Auf „Löschen“ drücken, um das Tag zu entfernen.\"\n}\n","{\n \"removeButtonLabel\": \"Κατάργηση\",\n \"removeDescription\": \"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα.\"\n}\n","{ \n \"removeDescription\": \"Press Delete to remove tag.\",\n \"removeButtonLabel\": \"Remove\"\n}\n","{\n \"removeButtonLabel\": \"Quitar\",\n \"removeDescription\": \"Pulse Eliminar para quitar la etiqueta.\"\n}\n","{\n \"removeButtonLabel\": \"Eemalda\",\n \"removeDescription\": \"Sildi eemaldamiseks vajutage kustutusklahvi Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Poista\",\n \"removeDescription\": \"Poista tunniste painamalla Poista-painiketta.\"\n}\n","{\n \"removeButtonLabel\": \"Supprimer\",\n \"removeDescription\": \"Appuyez sur Supprimer pour supprimer l’étiquette.\"\n}\n","{\n \"removeButtonLabel\": \"הסר\",\n \"removeDescription\": \"לחץ על מחק כדי להסיר תג.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Delete za uklanjanje oznake.\"\n}\n","{\n \"removeButtonLabel\": \"Eltávolítás\",\n \"removeDescription\": \"Nyomja meg a Delete billentyűt a címke eltávolításához.\"\n}\n","{\n \"removeButtonLabel\": \"Rimuovi\",\n \"removeDescription\": \"Premi Elimina per rimuovere il tag.\"\n}\n","{\n \"removeButtonLabel\": \"削除\",\n \"removeDescription\": \"タグを削除するには、Delete キーを押します。\"\n}\n","{\n \"removeButtonLabel\": \"제거\",\n \"removeDescription\": \"태그를 제거하려면 Delete 키를 누르십시오.\"\n}\n","{\n \"removeButtonLabel\": \"Pašalinti\",\n \"removeDescription\": \"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą.\"\n}\n","{\n \"removeButtonLabel\": \"Noņemt\",\n \"removeDescription\": \"Nospiediet Delete [Dzēst], lai noņemtu tagu.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Trykk på Slett for å fjerne taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Verwijderen\",\n \"removeDescription\": \"Druk op Verwijderen om de tag te verwijderen.\"\n}\n","{\n \"removeButtonLabel\": \"Usuń\",\n \"removeDescription\": \"Naciśnij Usuń, aby usunąć znacznik.\"\n}\n","{\n \"removeButtonLabel\": \"Remover\",\n \"removeDescription\": \"Pressione Delete para remover a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Eliminar\",\n \"removeDescription\": \"Prima Delete para eliminar a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Îndepărtaţi\",\n \"removeDescription\": \"Apăsați pe Delete (Ștergere) pentru a elimina eticheta.\"\n}\n","{\n \"removeButtonLabel\": \"Удалить\",\n \"removeDescription\": \"Нажмите DELETE, чтобы удалить тег.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrániť\",\n \"removeDescription\": \"Ak chcete odstrániť značku, stlačte kláves Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrani\",\n \"removeDescription\": \"Pritisnite Delete, da odstranite oznako.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Obriši da biste uklonili oznaku.\"\n}\n","{\n \"removeButtonLabel\": \"Ta bort\",\n \"removeDescription\": \"Tryck på Radera för att ta bort taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Kaldır\",\n \"removeDescription\": \"Etiketi kaldırmak için Sil tuşuna basın.\"\n}\n","{\n \"removeButtonLabel\": \"Вилучити\",\n \"removeDescription\": \"Натисніть Delete, щоб вилучити тег.\"\n}\n","{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n","{\n \"removeButtonLabel\": \"移除\",\n \"removeDescription\": \"按 Delete 鍵以移除標記。\"\n}\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -77,7 +77,7 @@ function $d7323bca8d074eeb$export$4f8b5cda58b7e8ff(props, state, ref) {
|
|
|
77
77
|
// If the last tag is removed, focus the container.
|
|
78
78
|
let prevCount = (0, $aIvin$useRef)(state.collection.size);
|
|
79
79
|
(0, $aIvin$useEffect)(()=>{
|
|
80
|
-
if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
80
|
+
if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) ref.current.focus();
|
|
81
81
|
prevCount.current = state.collection.size;
|
|
82
82
|
}, [
|
|
83
83
|
state.collection.size,
|
|
@@ -385,7 +385,7 @@ $3bb15cc24d006ec5$exports = {
|
|
|
385
385
|
|
|
386
386
|
function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
387
387
|
let { item: item } = props;
|
|
388
|
-
let stringFormatter = (0, $aIvin$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3bb15cc24d006ec5$exports))));
|
|
388
|
+
let stringFormatter = (0, $aIvin$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($3bb15cc24d006ec5$exports))), "@react-aria/tag");
|
|
389
389
|
let buttonId = (0, $aIvin$useId)();
|
|
390
390
|
let { onRemove: onRemove } = (0, $d7323bca8d074eeb$export$653eddfc964b0f8a).get(state) || {};
|
|
391
391
|
let { rowProps: rowProps, gridCellProps: gridCellProps, ...states } = (0, $aIvin$useGridListItem)({
|
|
@@ -393,18 +393,19 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
393
393
|
}, state, ref);
|
|
394
394
|
// We want the group to handle keyboard navigation between tags.
|
|
395
395
|
delete rowProps.onKeyDownCapture;
|
|
396
|
-
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
397
|
+
let { descriptionProps: _, ...stateWithoutDescription } = states;
|
|
397
398
|
let onKeyDown = (e)=>{
|
|
398
399
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
399
400
|
e.preventDefault();
|
|
400
|
-
if (state.selectionManager.isSelected(item.key)) onRemove(new Set(state.selectionManager.selectedKeys));
|
|
401
|
-
else onRemove(new Set([
|
|
401
|
+
if (state.selectionManager.isSelected(item.key)) onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set(state.selectionManager.selectedKeys));
|
|
402
|
+
else onRemove === null || onRemove === void 0 ? void 0 : onRemove(new Set([
|
|
402
403
|
item.key
|
|
403
404
|
]));
|
|
404
405
|
}
|
|
405
406
|
};
|
|
406
407
|
let modality = (0, $aIvin$useInteractionModality)();
|
|
407
|
-
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "
|
|
408
|
+
if (modality === "virtual" && typeof window !== "undefined" && "ontouchstart" in window) modality = "pointer";
|
|
408
409
|
let description = onRemove && (modality === "keyboard" || modality === "virtual") ? stringFormatter.format("removeDescription") : "";
|
|
409
410
|
let descProps = (0, $aIvin$useDescription)(description);
|
|
410
411
|
let isFocused = item.key === state.selectionManager.focusedKey;
|
|
@@ -430,7 +431,7 @@ function $fc6126c82a4601f1$export$3f568fff7dff2f03(props, state, ref) {
|
|
|
430
431
|
"aria-errormessage": props["aria-errormessage"],
|
|
431
432
|
"aria-label": props["aria-label"]
|
|
432
433
|
}),
|
|
433
|
-
...
|
|
434
|
+
...stateWithoutDescription,
|
|
434
435
|
allowsRemoving: !!onRemove
|
|
435
436
|
};
|
|
436
437
|
}
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,4CAAW,IAAI;AASrB,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAA2B;IAC5G,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,IAAI,IAAI,CAAA,GAAA,2BAAmB,EAAE;QACxE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BAAS,EAAE,UAAU,UAAU,WAAW;YAClD,UAAU,AAAC,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,iBAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,MAAM;QACT,gBAAgB,CAAC,CAAC;IACpB;AACF;;CD9FC","sources":["packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/*.js","packages/@react-aria/tag/intl/ar-AE.json","packages/@react-aria/tag/intl/bg-BG.json","packages/@react-aria/tag/intl/cs-CZ.json","packages/@react-aria/tag/intl/da-DK.json","packages/@react-aria/tag/intl/de-DE.json","packages/@react-aria/tag/intl/el-GR.json","packages/@react-aria/tag/intl/en-US.json","packages/@react-aria/tag/intl/es-ES.json","packages/@react-aria/tag/intl/et-EE.json","packages/@react-aria/tag/intl/fi-FI.json","packages/@react-aria/tag/intl/fr-FR.json","packages/@react-aria/tag/intl/he-IL.json","packages/@react-aria/tag/intl/hr-HR.json","packages/@react-aria/tag/intl/hu-HU.json","packages/@react-aria/tag/intl/it-IT.json","packages/@react-aria/tag/intl/ja-JP.json","packages/@react-aria/tag/intl/ko-KR.json","packages/@react-aria/tag/intl/lt-LT.json","packages/@react-aria/tag/intl/lv-LV.json","packages/@react-aria/tag/intl/nb-NO.json","packages/@react-aria/tag/intl/nl-NL.json","packages/@react-aria/tag/intl/pl-PL.json","packages/@react-aria/tag/intl/pt-BR.json","packages/@react-aria/tag/intl/pt-PT.json","packages/@react-aria/tag/intl/ro-RO.json","packages/@react-aria/tag/intl/ru-RU.json","packages/@react-aria/tag/intl/sk-SK.json","packages/@react-aria/tag/intl/sl-SI.json","packages/@react-aria/tag/intl/sr-SP.json","packages/@react-aria/tag/intl/sv-SE.json","packages/@react-aria/tag/intl/tr-TR.json","packages/@react-aria/tag/intl/uk-UA.json","packages/@react-aria/tag/intl/zh-CN.json","packages/@react-aria/tag/intl/zh-TW.json"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages);\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n delete states.descriptionProps;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove(new Set([item.key]));\n }\n }\n };\n\n let modality: string = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'touch';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...states,\n allowsRemoving: !!onRemove\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport type {ListState} from '@react-stately/list';\nimport {ReactNode, RefObject, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useGridList} from '@react-aria/gridlist';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface TagGroupAria {\n /** Props for the tag grouping element. */\n gridProps: DOMAttributes,\n /** Props for the tag group's visible label (if any). */\n labelProps: DOMAttributes,\n /** Props for the tag group description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tag group error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\nexport interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Handler that is called when a user deletes a tag. */\n onRemove?: (keys: Set<Key>) => void,\n /** An error message for the field. */\n errorMessage?: ReactNode\n}\n\nexport interface AriaTagGroupOptions<T> extends Omit<AriaTagGroupProps<T>, 'children'> {\n /**\n * An optional keyboard delegate to handle arrow key navigation,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface HookData {\n onRemove?: (keys: Set<Key>) => void\n}\n\nexport const hookData = new WeakMap<ListState<any>, HookData>();\n\n/**\n * Provides the behavior and accessibility implementation for a tag group component.\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n * @param props - Props to be applied to the tag group.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag group.\n */\nexport function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): TagGroupAria {\n let {direction} = useLocale();\n let keyboardDelegate = props.keyboardDelegate || new ListKeyboardDelegate({\n collection: state.collection,\n ref,\n orientation: 'horizontal',\n direction,\n disabledKeys: state.disabledKeys\n });\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span'\n });\n let {gridProps} = useGridList({\n ...props,\n ...fieldProps,\n keyboardDelegate,\n shouldFocusWrap: true,\n linkBehavior: 'override'\n }, state, ref);\n\n let [isFocusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setFocusWithin\n });\n let domProps = filterDOMProps(props);\n\n // If the last tag is removed, focus the container.\n let prevCount = useRef(state.collection.size);\n useEffect(() => {\n if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {\n ref.current.focus();\n }\n prevCount.current = state.collection.size;\n }, [state.collection.size, isFocusWithin, ref]);\n\n hookData.set(state, {onRemove: props.onRemove});\n\n return {\n gridProps: mergeProps(gridProps, domProps, {\n role: state.collection.size ? 'grid' : null,\n 'aria-atomic': false,\n 'aria-relevant': 'additions',\n 'aria-live': isFocusWithin ? 'polite' : 'off',\n ...focusWithinProps,\n ...fieldProps\n }),\n labelProps,\n descriptionProps,\n errorMessageProps\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"removeButtonLabel\": \"إزالة\",\n \"removeDescription\": \"اضغط على مفتاح DELETE لإزالة علامة.\"\n}\n","{\n \"removeButtonLabel\": \"Премахване\",\n \"removeDescription\": \"Натиснете Delete, за да премахнете маркера.\"\n}\n","{\n \"removeButtonLabel\": \"Odebrat\",\n \"removeDescription\": \"Stisknutím klávesy Delete odeberete značku.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Tryk på Slet for at fjerne tag.\"\n}\n","{\n \"removeButtonLabel\": \"Entfernen\",\n \"removeDescription\": \"Auf „Löschen“ drücken, um das Tag zu entfernen.\"\n}\n","{\n \"removeButtonLabel\": \"Κατάργηση\",\n \"removeDescription\": \"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα.\"\n}\n","{ \n \"removeDescription\": \"Press Delete to remove tag.\",\n \"removeButtonLabel\": \"Remove\"\n}\n","{\n \"removeButtonLabel\": \"Quitar\",\n \"removeDescription\": \"Pulse Eliminar para quitar la etiqueta.\"\n}\n","{\n \"removeButtonLabel\": \"Eemalda\",\n \"removeDescription\": \"Sildi eemaldamiseks vajutage kustutusklahvi Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Poista\",\n \"removeDescription\": \"Poista tunniste painamalla Poista-painiketta.\"\n}\n","{\n \"removeButtonLabel\": \"Supprimer\",\n \"removeDescription\": \"Appuyez sur Supprimer pour supprimer l’étiquette.\"\n}\n","{\n \"removeButtonLabel\": \"הסר\",\n \"removeDescription\": \"לחץ על מחק כדי להסיר תג.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Delete za uklanjanje oznake.\"\n}\n","{\n \"removeButtonLabel\": \"Eltávolítás\",\n \"removeDescription\": \"Nyomja meg a Delete billentyűt a címke eltávolításához.\"\n}\n","{\n \"removeButtonLabel\": \"Rimuovi\",\n \"removeDescription\": \"Premi Elimina per rimuovere il tag.\"\n}\n","{\n \"removeButtonLabel\": \"削除\",\n \"removeDescription\": \"タグを削除するには、Delete キーを押します。\"\n}\n","{\n \"removeButtonLabel\": \"제거\",\n \"removeDescription\": \"태그를 제거하려면 Delete 키를 누르십시오.\"\n}\n","{\n \"removeButtonLabel\": \"Pašalinti\",\n \"removeDescription\": \"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą.\"\n}\n","{\n \"removeButtonLabel\": \"Noņemt\",\n \"removeDescription\": \"Nospiediet Delete [Dzēst], lai noņemtu tagu.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Trykk på Slett for å fjerne taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Verwijderen\",\n \"removeDescription\": \"Druk op Verwijderen om de tag te verwijderen.\"\n}\n","{\n \"removeButtonLabel\": \"Usuń\",\n \"removeDescription\": \"Naciśnij Usuń, aby usunąć znacznik.\"\n}\n","{\n \"removeButtonLabel\": \"Remover\",\n \"removeDescription\": \"Pressione Delete para remover a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Eliminar\",\n \"removeDescription\": \"Prima Delete para eliminar a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Îndepărtaţi\",\n \"removeDescription\": \"Apăsați pe Delete (Ștergere) pentru a elimina eticheta.\"\n}\n","{\n \"removeButtonLabel\": \"Удалить\",\n \"removeDescription\": \"Нажмите DELETE, чтобы удалить тег.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrániť\",\n \"removeDescription\": \"Ak chcete odstrániť značku, stlačte kláves Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrani\",\n \"removeDescription\": \"Pritisnite Delete, da odstranite oznako.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Obriši da biste uklonili oznaku.\"\n}\n","{\n \"removeButtonLabel\": \"Ta bort\",\n \"removeDescription\": \"Tryck på Radera för att ta bort taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Kaldır\",\n \"removeDescription\": \"Etiketi kaldırmak için Sil tuşuna basın.\"\n}\n","{\n \"removeButtonLabel\": \"Вилучити\",\n \"removeDescription\": \"Натисніть Delete, щоб вилучити тег.\"\n}\n","{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n","{\n \"removeButtonLabel\": \"移除\",\n \"removeDescription\": \"按 Delete 鍵以移除標記。\"\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;ACAA;;;;;;;;;;CAUC;ACVD;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,4CAAW,IAAI;AASrB,SAAS,0CAAe,KAA6B,EAAE,KAAmB,EAAE,GAA2B;IAC5G,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,mBAAmB,MAAM,gBAAgB,IAAI,IAAI,CAAA,GAAA,2BAAmB,EAAE;QACxE,YAAY,MAAM,UAAU;aAC5B;QACA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GAAG;iBAAC,KAAK;YAC1D,qBAAqB;QACvB;QACA,UAAU,CAAA,GAAA,iBAAS,EAAE,UAAU,UAAU,WAAW;YAClD,UAAU,AAAC,aAAa,MAAM,gBAAgB,CAAC,UAAU,IAAI,OAAQ,IAAI;YACzE,WAAW,WAAW,YAAY;YAClC,oBAAoB,SAAS,CAAC,mBAAmB;QACnD;QACA,eAAe,CAAA,GAAA,iBAAS,EAAE,eAAe;YACvC,qBAAqB,KAAK,CAAC,oBAAoB;YAC/C,cAAc,KAAK,CAAC,aAAa;QACnC;QACA,GAAG,uBAAuB;QAC1B,gBAAgB,CAAC,CAAC;IACpB;AACF;;CD/FC","sources":["packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/*.js","packages/@react-aria/tag/intl/ar-AE.json","packages/@react-aria/tag/intl/bg-BG.json","packages/@react-aria/tag/intl/cs-CZ.json","packages/@react-aria/tag/intl/da-DK.json","packages/@react-aria/tag/intl/de-DE.json","packages/@react-aria/tag/intl/el-GR.json","packages/@react-aria/tag/intl/en-US.json","packages/@react-aria/tag/intl/es-ES.json","packages/@react-aria/tag/intl/et-EE.json","packages/@react-aria/tag/intl/fi-FI.json","packages/@react-aria/tag/intl/fr-FR.json","packages/@react-aria/tag/intl/he-IL.json","packages/@react-aria/tag/intl/hr-HR.json","packages/@react-aria/tag/intl/hu-HU.json","packages/@react-aria/tag/intl/it-IT.json","packages/@react-aria/tag/intl/ja-JP.json","packages/@react-aria/tag/intl/ko-KR.json","packages/@react-aria/tag/intl/lt-LT.json","packages/@react-aria/tag/intl/lv-LV.json","packages/@react-aria/tag/intl/nb-NO.json","packages/@react-aria/tag/intl/nl-NL.json","packages/@react-aria/tag/intl/pl-PL.json","packages/@react-aria/tag/intl/pt-BR.json","packages/@react-aria/tag/intl/pt-PT.json","packages/@react-aria/tag/intl/ro-RO.json","packages/@react-aria/tag/intl/ru-RU.json","packages/@react-aria/tag/intl/sk-SK.json","packages/@react-aria/tag/intl/sl-SI.json","packages/@react-aria/tag/intl/sr-SP.json","packages/@react-aria/tag/intl/sv-SE.json","packages/@react-aria/tag/intl/tr-TR.json","packages/@react-aria/tag/intl/uk-UA.json","packages/@react-aria/tag/intl/zh-CN.json","packages/@react-aria/tag/intl/zh-TW.json"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes, FocusableElement, Node} from '@react-types/shared';\nimport {filterDOMProps, getSyntheticLinkProps, mergeProps, useDescription, useId} from '@react-aria/utils';\nimport {hookData} from './useTagGroup';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {KeyboardEvent, RefObject} from 'react';\nimport type {ListState} from '@react-stately/list';\nimport {SelectableItemStates} from '@react-aria/selection';\nimport {useGridListItem} from '@react-aria/gridlist';\nimport {useInteractionModality} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\n\nexport interface TagAria extends Omit<SelectableItemStates, 'hasAction'> {\n /** Props for the tag row element. */\n rowProps: DOMAttributes,\n /** Props for the tag cell element. */\n gridCellProps: DOMAttributes,\n /** Props for the tag remove button. */\n removeButtonProps: AriaButtonProps,\n /** Whether the tag can be removed. */\n allowsRemoving: boolean\n}\n\nexport interface AriaTagProps<T> {\n /** An object representing the tag. Contains all the relevant information that makes up the tag. */\n item: Node<T>\n}\n\n/**\n * Provides the behavior and accessibility implementation for a tag component.\n * @param props - Props to be applied to the tag.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag.\n */\nexport function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {\n let {item} = props;\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');\n let buttonId = useId();\n\n let {onRemove} = hookData.get(state) || {};\n let {rowProps, gridCellProps, ...states} = useGridListItem({\n node: item\n }, state, ref);\n\n // We want the group to handle keyboard navigation between tags.\n delete rowProps.onKeyDownCapture;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n let {descriptionProps: _, ...stateWithoutDescription} = states;\n\n let onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Delete' || e.key === 'Backspace') {\n e.preventDefault();\n if (state.selectionManager.isSelected(item.key)) {\n onRemove?.(new Set(state.selectionManager.selectedKeys));\n } else {\n onRemove?.(new Set([item.key]));\n }\n }\n };\n\n let modality = useInteractionModality();\n if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {\n modality = 'pointer';\n }\n let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';\n let descProps = useDescription(description);\n\n let isFocused = item.key === state.selectionManager.focusedKey;\n // @ts-ignore - data attributes are ok but TS doesn't know about them.\n let domProps = filterDOMProps(item.props);\n let linkProps = getSyntheticLinkProps(item.props);\n return {\n removeButtonProps: {\n 'aria-label': stringFormatter.format('removeButtonLabel'),\n 'aria-labelledby': `${buttonId} ${rowProps.id}`,\n id: buttonId,\n onPress: () => onRemove ? onRemove(new Set([item.key])) : null,\n excludeFromTabOrder: true\n },\n rowProps: mergeProps(rowProps, domProps, linkProps, {\n tabIndex: (isFocused || state.selectionManager.focusedKey == null) ? 0 : -1,\n onKeyDown: onRemove ? onKeyDown : undefined,\n 'aria-describedby': descProps['aria-describedby']\n }),\n gridCellProps: mergeProps(gridCellProps, {\n 'aria-errormessage': props['aria-errormessage'],\n 'aria-label': props['aria-label']\n }),\n ...stateWithoutDescription,\n allowsRemoving: !!onRemove\n };\n}\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, CollectionBase, DOMAttributes, DOMProps, HelpTextProps, Key, KeyboardDelegate, LabelableProps, MultipleSelection, SelectionBehavior} from '@react-types/shared';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {ListKeyboardDelegate} from '@react-aria/selection';\nimport type {ListState} from '@react-stately/list';\nimport {ReactNode, RefObject, useEffect, useRef, useState} from 'react';\nimport {useField} from '@react-aria/label';\nimport {useFocusWithin} from '@react-aria/interactions';\nimport {useGridList} from '@react-aria/gridlist';\nimport {useLocale} from '@react-aria/i18n';\n\nexport interface TagGroupAria {\n /** Props for the tag grouping element. */\n gridProps: DOMAttributes,\n /** Props for the tag group's visible label (if any). */\n labelProps: DOMAttributes,\n /** Props for the tag group description element, if any. */\n descriptionProps: DOMAttributes,\n /** Props for the tag group error message element, if any. */\n errorMessageProps: DOMAttributes\n}\n\nexport interface AriaTagGroupProps<T> extends CollectionBase<T>, MultipleSelection, DOMProps, LabelableProps, AriaLabelingProps, Omit<HelpTextProps, 'errorMessage'> {\n /** How multiple selection should behave in the collection. */\n selectionBehavior?: SelectionBehavior,\n /** Handler that is called when a user deletes a tag. */\n onRemove?: (keys: Set<Key>) => void,\n /** An error message for the field. */\n errorMessage?: ReactNode\n}\n\nexport interface AriaTagGroupOptions<T> extends Omit<AriaTagGroupProps<T>, 'children'> {\n /**\n * An optional keyboard delegate to handle arrow key navigation,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate\n}\n\ninterface HookData {\n onRemove?: (keys: Set<Key>) => void\n}\n\nexport const hookData = new WeakMap<ListState<any>, HookData>();\n\n/**\n * Provides the behavior and accessibility implementation for a tag group component.\n * A tag group is a focusable list of labels, categories, keywords, filters, or other items, with support for keyboard navigation, selection, and removal.\n * @param props - Props to be applied to the tag group.\n * @param state - State for the tag group, as returned by `useListState`.\n * @param ref - A ref to a DOM element for the tag group.\n */\nexport function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T>, ref: RefObject<HTMLElement>): TagGroupAria {\n let {direction} = useLocale();\n let keyboardDelegate = props.keyboardDelegate || new ListKeyboardDelegate({\n collection: state.collection,\n ref,\n orientation: 'horizontal',\n direction,\n disabledKeys: state.disabledKeys\n });\n let {labelProps, fieldProps, descriptionProps, errorMessageProps} = useField({\n ...props,\n labelElementType: 'span'\n });\n let {gridProps} = useGridList({\n ...props,\n ...fieldProps,\n keyboardDelegate,\n shouldFocusWrap: true,\n linkBehavior: 'override'\n }, state, ref);\n\n let [isFocusWithin, setFocusWithin] = useState(false);\n let {focusWithinProps} = useFocusWithin({\n onFocusWithinChange: setFocusWithin\n });\n let domProps = filterDOMProps(props);\n\n // If the last tag is removed, focus the container.\n let prevCount = useRef(state.collection.size);\n useEffect(() => {\n if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {\n ref.current.focus();\n }\n prevCount.current = state.collection.size;\n }, [state.collection.size, isFocusWithin, ref]);\n\n hookData.set(state, {onRemove: props.onRemove});\n\n return {\n gridProps: mergeProps(gridProps, domProps, {\n role: state.collection.size ? 'grid' : null,\n 'aria-atomic': false,\n 'aria-relevant': 'additions',\n 'aria-live': isFocusWithin ? 'polite' : 'off',\n ...focusWithinProps,\n ...fieldProps\n }),\n labelProps,\n descriptionProps,\n errorMessageProps\n };\n}\n","const _temp0 = require(\"../intl/ar-AE.json\");\nconst _temp1 = require(\"../intl/bg-BG.json\");\nconst _temp2 = require(\"../intl/cs-CZ.json\");\nconst _temp3 = require(\"../intl/da-DK.json\");\nconst _temp4 = require(\"../intl/de-DE.json\");\nconst _temp5 = require(\"../intl/el-GR.json\");\nconst _temp6 = require(\"../intl/en-US.json\");\nconst _temp7 = require(\"../intl/es-ES.json\");\nconst _temp8 = require(\"../intl/et-EE.json\");\nconst _temp9 = require(\"../intl/fi-FI.json\");\nconst _temp10 = require(\"../intl/fr-FR.json\");\nconst _temp11 = require(\"../intl/he-IL.json\");\nconst _temp12 = require(\"../intl/hr-HR.json\");\nconst _temp13 = require(\"../intl/hu-HU.json\");\nconst _temp14 = require(\"../intl/it-IT.json\");\nconst _temp15 = require(\"../intl/ja-JP.json\");\nconst _temp16 = require(\"../intl/ko-KR.json\");\nconst _temp17 = require(\"../intl/lt-LT.json\");\nconst _temp18 = require(\"../intl/lv-LV.json\");\nconst _temp19 = require(\"../intl/nb-NO.json\");\nconst _temp20 = require(\"../intl/nl-NL.json\");\nconst _temp21 = require(\"../intl/pl-PL.json\");\nconst _temp22 = require(\"../intl/pt-BR.json\");\nconst _temp23 = require(\"../intl/pt-PT.json\");\nconst _temp24 = require(\"../intl/ro-RO.json\");\nconst _temp25 = require(\"../intl/ru-RU.json\");\nconst _temp26 = require(\"../intl/sk-SK.json\");\nconst _temp27 = require(\"../intl/sl-SI.json\");\nconst _temp28 = require(\"../intl/sr-SP.json\");\nconst _temp29 = require(\"../intl/sv-SE.json\");\nconst _temp30 = require(\"../intl/tr-TR.json\");\nconst _temp31 = require(\"../intl/uk-UA.json\");\nconst _temp32 = require(\"../intl/zh-CN.json\");\nconst _temp33 = require(\"../intl/zh-TW.json\");\nmodule.exports = {\n \"ar-AE\": _temp0,\n \"bg-BG\": _temp1,\n \"cs-CZ\": _temp2,\n \"da-DK\": _temp3,\n \"de-DE\": _temp4,\n \"el-GR\": _temp5,\n \"en-US\": _temp6,\n \"es-ES\": _temp7,\n \"et-EE\": _temp8,\n \"fi-FI\": _temp9,\n \"fr-FR\": _temp10,\n \"he-IL\": _temp11,\n \"hr-HR\": _temp12,\n \"hu-HU\": _temp13,\n \"it-IT\": _temp14,\n \"ja-JP\": _temp15,\n \"ko-KR\": _temp16,\n \"lt-LT\": _temp17,\n \"lv-LV\": _temp18,\n \"nb-NO\": _temp19,\n \"nl-NL\": _temp20,\n \"pl-PL\": _temp21,\n \"pt-BR\": _temp22,\n \"pt-PT\": _temp23,\n \"ro-RO\": _temp24,\n \"ru-RU\": _temp25,\n \"sk-SK\": _temp26,\n \"sl-SI\": _temp27,\n \"sr-SP\": _temp28,\n \"sv-SE\": _temp29,\n \"tr-TR\": _temp30,\n \"uk-UA\": _temp31,\n \"zh-CN\": _temp32,\n \"zh-TW\": _temp33\n}","{\n \"removeButtonLabel\": \"إزالة\",\n \"removeDescription\": \"اضغط على مفتاح DELETE لإزالة علامة.\"\n}\n","{\n \"removeButtonLabel\": \"Премахване\",\n \"removeDescription\": \"Натиснете Delete, за да премахнете маркера.\"\n}\n","{\n \"removeButtonLabel\": \"Odebrat\",\n \"removeDescription\": \"Stisknutím klávesy Delete odeberete značku.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Tryk på Slet for at fjerne tag.\"\n}\n","{\n \"removeButtonLabel\": \"Entfernen\",\n \"removeDescription\": \"Auf „Löschen“ drücken, um das Tag zu entfernen.\"\n}\n","{\n \"removeButtonLabel\": \"Κατάργηση\",\n \"removeDescription\": \"Πατήστε Διαγραφή για να καταργήσετε την ετικέτα.\"\n}\n","{ \n \"removeDescription\": \"Press Delete to remove tag.\",\n \"removeButtonLabel\": \"Remove\"\n}\n","{\n \"removeButtonLabel\": \"Quitar\",\n \"removeDescription\": \"Pulse Eliminar para quitar la etiqueta.\"\n}\n","{\n \"removeButtonLabel\": \"Eemalda\",\n \"removeDescription\": \"Sildi eemaldamiseks vajutage kustutusklahvi Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Poista\",\n \"removeDescription\": \"Poista tunniste painamalla Poista-painiketta.\"\n}\n","{\n \"removeButtonLabel\": \"Supprimer\",\n \"removeDescription\": \"Appuyez sur Supprimer pour supprimer l’étiquette.\"\n}\n","{\n \"removeButtonLabel\": \"הסר\",\n \"removeDescription\": \"לחץ על מחק כדי להסיר תג.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Delete za uklanjanje oznake.\"\n}\n","{\n \"removeButtonLabel\": \"Eltávolítás\",\n \"removeDescription\": \"Nyomja meg a Delete billentyűt a címke eltávolításához.\"\n}\n","{\n \"removeButtonLabel\": \"Rimuovi\",\n \"removeDescription\": \"Premi Elimina per rimuovere il tag.\"\n}\n","{\n \"removeButtonLabel\": \"削除\",\n \"removeDescription\": \"タグを削除するには、Delete キーを押します。\"\n}\n","{\n \"removeButtonLabel\": \"제거\",\n \"removeDescription\": \"태그를 제거하려면 Delete 키를 누르십시오.\"\n}\n","{\n \"removeButtonLabel\": \"Pašalinti\",\n \"removeDescription\": \"Norėdami pašalinti žymą, paspauskite „Delete“ klavišą.\"\n}\n","{\n \"removeButtonLabel\": \"Noņemt\",\n \"removeDescription\": \"Nospiediet Delete [Dzēst], lai noņemtu tagu.\"\n}\n","{\n \"removeButtonLabel\": \"Fjern\",\n \"removeDescription\": \"Trykk på Slett for å fjerne taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Verwijderen\",\n \"removeDescription\": \"Druk op Verwijderen om de tag te verwijderen.\"\n}\n","{\n \"removeButtonLabel\": \"Usuń\",\n \"removeDescription\": \"Naciśnij Usuń, aby usunąć znacznik.\"\n}\n","{\n \"removeButtonLabel\": \"Remover\",\n \"removeDescription\": \"Pressione Delete para remover a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Eliminar\",\n \"removeDescription\": \"Prima Delete para eliminar a tag.\"\n}\n","{\n \"removeButtonLabel\": \"Îndepărtaţi\",\n \"removeDescription\": \"Apăsați pe Delete (Ștergere) pentru a elimina eticheta.\"\n}\n","{\n \"removeButtonLabel\": \"Удалить\",\n \"removeDescription\": \"Нажмите DELETE, чтобы удалить тег.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrániť\",\n \"removeDescription\": \"Ak chcete odstrániť značku, stlačte kláves Delete.\"\n}\n","{\n \"removeButtonLabel\": \"Odstrani\",\n \"removeDescription\": \"Pritisnite Delete, da odstranite oznako.\"\n}\n","{\n \"removeButtonLabel\": \"Ukloni\",\n \"removeDescription\": \"Pritisnite Obriši da biste uklonili oznaku.\"\n}\n","{\n \"removeButtonLabel\": \"Ta bort\",\n \"removeDescription\": \"Tryck på Radera för att ta bort taggen.\"\n}\n","{\n \"removeButtonLabel\": \"Kaldır\",\n \"removeDescription\": \"Etiketi kaldırmak için Sil tuşuna basın.\"\n}\n","{\n \"removeButtonLabel\": \"Вилучити\",\n \"removeDescription\": \"Натисніть Delete, щоб вилучити тег.\"\n}\n","{\n \"removeButtonLabel\": \"删除\",\n \"removeDescription\": \"按下“删除”以删除标记。\"\n}\n","{\n \"removeButtonLabel\": \"移除\",\n \"removeDescription\": \"按 Delete 鍵以移除標記。\"\n}\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAsBA;IACE,0CAA0C;IAC1C,SAAS,EAAE,aAAa,CAAC;IACzB,wDAAwD;IACxD,UAAU,EAAE,aAAa,CAAC;IAC1B,2DAA2D;IAC3D,gBAAg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;AAED;;;;;GAKG;AACH,uBAAuB,CAAC,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,CAAC,GAAG,OAAO,CAyDhH","sources":["packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTagGroup.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/useTag.ts","packages/@react-aria/tag/src/packages/@react-aria/tag/src/index.ts","packages/@react-aria/tag/src/index.ts"],"sourcesContent":[null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useTag} from './useTag';\nexport {useTagGroup} from './useTagGroup';\n\nexport type {TagGroupAria, AriaTagGroupProps} from './useTagGroup';\nexport type {AriaTagProps, TagAria} from './useTag';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-aria/tag",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"url": "https://github.com/adobe/react-spectrum"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@react-aria/gridlist": "^3.7.
|
|
26
|
-
"@react-aria/i18n": "^3.
|
|
27
|
-
"@react-aria/interactions": "^3.
|
|
28
|
-
"@react-aria/label": "^3.7.
|
|
29
|
-
"@react-aria/selection": "^3.17.
|
|
30
|
-
"@react-aria/utils": "^3.
|
|
31
|
-
"@react-stately/list": "^3.10.
|
|
25
|
+
"@react-aria/gridlist": "^3.7.4",
|
|
26
|
+
"@react-aria/i18n": "^3.10.1",
|
|
27
|
+
"@react-aria/interactions": "^3.21.0",
|
|
28
|
+
"@react-aria/label": "^3.7.5",
|
|
29
|
+
"@react-aria/selection": "^3.17.4",
|
|
30
|
+
"@react-aria/utils": "^3.23.1",
|
|
31
|
+
"@react-stately/list": "^3.10.2",
|
|
32
32
|
"@react-types/button": "^3.9.1",
|
|
33
33
|
"@react-types/shared": "^3.22.0",
|
|
34
34
|
"@swc/helpers": "^0.5.0"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "f040ff62678e6a31375b96c05396df0bae660350"
|
|
44
44
|
}
|
package/src/useTag.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface AriaTagProps<T> {
|
|
|
48
48
|
*/
|
|
49
49
|
export function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefObject<FocusableElement>): TagAria {
|
|
50
50
|
let {item} = props;
|
|
51
|
-
let stringFormatter = useLocalizedStringFormatter(intlMessages);
|
|
51
|
+
let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/tag');
|
|
52
52
|
let buttonId = useId();
|
|
53
53
|
|
|
54
54
|
let {onRemove} = hookData.get(state) || {};
|
|
@@ -58,22 +58,23 @@ export function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefO
|
|
|
58
58
|
|
|
59
59
|
// We want the group to handle keyboard navigation between tags.
|
|
60
60
|
delete rowProps.onKeyDownCapture;
|
|
61
|
-
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
+
let {descriptionProps: _, ...stateWithoutDescription} = states;
|
|
62
63
|
|
|
63
64
|
let onKeyDown = (e: KeyboardEvent) => {
|
|
64
65
|
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
65
66
|
e.preventDefault();
|
|
66
67
|
if (state.selectionManager.isSelected(item.key)) {
|
|
67
|
-
onRemove(new Set(state.selectionManager.selectedKeys));
|
|
68
|
+
onRemove?.(new Set(state.selectionManager.selectedKeys));
|
|
68
69
|
} else {
|
|
69
|
-
onRemove(new Set([item.key]));
|
|
70
|
+
onRemove?.(new Set([item.key]));
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
74
|
|
|
74
|
-
let modality
|
|
75
|
+
let modality = useInteractionModality();
|
|
75
76
|
if (modality === 'virtual' && (typeof window !== 'undefined' && 'ontouchstart' in window)) {
|
|
76
|
-
modality = '
|
|
77
|
+
modality = 'pointer';
|
|
77
78
|
}
|
|
78
79
|
let description = onRemove && (modality === 'keyboard' || modality === 'virtual') ? stringFormatter.format('removeDescription') : '';
|
|
79
80
|
let descProps = useDescription(description);
|
|
@@ -99,7 +100,7 @@ export function useTag<T>(props: AriaTagProps<T>, state: ListState<T>, ref: RefO
|
|
|
99
100
|
'aria-errormessage': props['aria-errormessage'],
|
|
100
101
|
'aria-label': props['aria-label']
|
|
101
102
|
}),
|
|
102
|
-
...
|
|
103
|
+
...stateWithoutDescription,
|
|
103
104
|
allowsRemoving: !!onRemove
|
|
104
105
|
};
|
|
105
106
|
}
|
package/src/useTagGroup.ts
CHANGED
|
@@ -91,7 +91,7 @@ export function useTagGroup<T>(props: AriaTagGroupOptions<T>, state: ListState<T
|
|
|
91
91
|
// If the last tag is removed, focus the container.
|
|
92
92
|
let prevCount = useRef(state.collection.size);
|
|
93
93
|
useEffect(() => {
|
|
94
|
-
if (prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {
|
|
94
|
+
if (ref.current && prevCount.current > 0 && state.collection.size === 0 && isFocusWithin) {
|
|
95
95
|
ref.current.focus();
|
|
96
96
|
}
|
|
97
97
|
prevCount.current = state.collection.size;
|