@react-aria/grid 3.10.4 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/GridKeyboardDelegate.main.js +104 -43
- package/dist/GridKeyboardDelegate.main.js.map +1 -1
- package/dist/GridKeyboardDelegate.mjs +104 -43
- package/dist/GridKeyboardDelegate.module.js +104 -43
- package/dist/GridKeyboardDelegate.module.js.map +1 -1
- package/dist/ar-AE.main.js.map +1 -1
- package/dist/ar-AE.module.js.map +1 -1
- package/dist/bg-BG.main.js.map +1 -1
- package/dist/bg-BG.module.js.map +1 -1
- package/dist/cs-CZ.main.js.map +1 -1
- package/dist/cs-CZ.module.js.map +1 -1
- package/dist/da-DK.main.js.map +1 -1
- package/dist/da-DK.module.js.map +1 -1
- package/dist/de-DE.main.js.map +1 -1
- package/dist/de-DE.module.js.map +1 -1
- package/dist/el-GR.main.js.map +1 -1
- package/dist/el-GR.module.js.map +1 -1
- package/dist/en-US.main.js.map +1 -1
- package/dist/en-US.module.js.map +1 -1
- package/dist/es-ES.main.js.map +1 -1
- package/dist/es-ES.module.js.map +1 -1
- package/dist/et-EE.main.js.map +1 -1
- package/dist/et-EE.module.js.map +1 -1
- package/dist/fi-FI.main.js.map +1 -1
- package/dist/fi-FI.module.js.map +1 -1
- package/dist/fr-FR.main.js.map +1 -1
- package/dist/fr-FR.module.js.map +1 -1
- package/dist/he-IL.main.js.map +1 -1
- package/dist/he-IL.module.js.map +1 -1
- package/dist/hr-HR.main.js.map +1 -1
- package/dist/hr-HR.module.js.map +1 -1
- package/dist/hu-HU.main.js.map +1 -1
- package/dist/hu-HU.module.js.map +1 -1
- package/dist/it-IT.main.js.map +1 -1
- package/dist/it-IT.module.js.map +1 -1
- package/dist/ja-JP.main.js.map +1 -1
- package/dist/ja-JP.module.js.map +1 -1
- package/dist/ko-KR.main.js.map +1 -1
- package/dist/ko-KR.module.js.map +1 -1
- package/dist/lt-LT.main.js.map +1 -1
- package/dist/lt-LT.module.js.map +1 -1
- package/dist/lv-LV.main.js.map +1 -1
- package/dist/lv-LV.module.js.map +1 -1
- package/dist/nb-NO.main.js.map +1 -1
- package/dist/nb-NO.module.js.map +1 -1
- package/dist/nl-NL.main.js.map +1 -1
- package/dist/nl-NL.module.js.map +1 -1
- package/dist/pl-PL.main.js.map +1 -1
- package/dist/pl-PL.module.js.map +1 -1
- package/dist/pt-BR.main.js.map +1 -1
- package/dist/pt-BR.module.js.map +1 -1
- package/dist/pt-PT.main.js.map +1 -1
- package/dist/pt-PT.module.js.map +1 -1
- package/dist/ro-RO.main.js.map +1 -1
- package/dist/ro-RO.module.js.map +1 -1
- package/dist/ru-RU.main.js.map +1 -1
- package/dist/ru-RU.module.js.map +1 -1
- package/dist/sk-SK.main.js.map +1 -1
- package/dist/sk-SK.module.js.map +1 -1
- package/dist/sl-SI.main.js.map +1 -1
- package/dist/sl-SI.module.js.map +1 -1
- package/dist/sr-SP.main.js.map +1 -1
- package/dist/sr-SP.module.js.map +1 -1
- package/dist/sv-SE.main.js.map +1 -1
- package/dist/sv-SE.module.js.map +1 -1
- package/dist/tr-TR.main.js.map +1 -1
- package/dist/tr-TR.module.js.map +1 -1
- package/dist/types.d.ts +12 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/uk-UA.main.js.map +1 -1
- package/dist/uk-UA.module.js.map +1 -1
- package/dist/useGrid.main.js +1 -1
- package/dist/useGrid.main.js.map +1 -1
- package/dist/useGrid.mjs +1 -1
- package/dist/useGrid.module.js +1 -1
- package/dist/useGrid.module.js.map +1 -1
- package/dist/useGridCell.main.js +27 -20
- package/dist/useGridCell.main.js.map +1 -1
- package/dist/useGridCell.mjs +27 -20
- package/dist/useGridCell.module.js +27 -20
- package/dist/useGridCell.module.js.map +1 -1
- package/dist/useGridRow.main.js +4 -1
- package/dist/useGridRow.main.js.map +1 -1
- package/dist/useGridRow.mjs +4 -1
- package/dist/useGridRow.module.js +4 -1
- package/dist/useGridRow.module.js.map +1 -1
- package/dist/useGridSelectionAnnouncement.main.js.map +1 -1
- package/dist/useGridSelectionAnnouncement.module.js.map +1 -1
- package/dist/useHighlightSelectionDescription.main.js +1 -1
- package/dist/useHighlightSelectionDescription.main.js.map +1 -1
- package/dist/useHighlightSelectionDescription.mjs +1 -1
- package/dist/useHighlightSelectionDescription.module.js +1 -1
- package/dist/useHighlightSelectionDescription.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/dist/zh-CN.main.js.map +1 -1
- package/dist/zh-CN.module.js.map +1 -1
- package/dist/zh-TW.main.js.map +1 -1
- package/dist/zh-TW.module.js.map +1 -1
- package/package.json +18 -17
- package/src/GridKeyboardDelegate.ts +120 -53
- package/src/useGrid.ts +1 -1
- package/src/useGridCell.ts +37 -33
- package/src/useGridRow.ts +2 -2
- package/src/useGridSelectionAnnouncement.ts +1 -1
- package/src/useHighlightSelectionDescription.ts +1 -1
- package/src/utils.ts +2 -2
package/dist/pt-PT.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,oBAAiB,CAAC;IAC7E,qBAAqB,CAAC,yDAAmD,CAAC;IAC1E,UAAU,CAAC,UAAU,CAAC;IACtB,eAAe,CAAC,4BAA4B,CAAC;IAC7C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,mBAAmB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC7O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/pt-PT.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} não selecionado.\",\n \"longPressToSelect\": \"Prima continuamente para entrar no modo de seleção.\",\n \"select\": \"Selecionar\",\n \"selectedAll\": \"Todos os itens selecionados.\",\n \"selectedCount\": \"{count, plural, =0 {Nenhum item selecionado} one {# item selecionado} other {# itens selecionados}}.\",\n \"selectedItem\": \"{item} selecionado.\"\n}\n"],"names":[],"version":3,"file":"pt-PT.module.js.map"}
|
package/dist/ro-RO.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC;IACxE,qBAAqB,CAAC,iEAAkD,CAAC;IACzE,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,2BAA2B,CAAC;IAC5C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,mBAAmB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC7O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;AACpD","sources":["packages/@react-aria/grid/intl/ro-RO.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} neselectat.\",\n \"longPressToSelect\": \"Apăsați lung pentru a intra în modul de selectare.\",\n \"select\": \"Selectare\",\n \"selectedAll\": \"Toate elementele selectate.\",\n \"selectedCount\": \"{count, plural, =0 {Niciun element selectat} one {# element selectat} other {# elemente selectate}}.\",\n \"selectedItem\": \"{item} selectat.\"\n}\n"],"names":[],"version":3,"file":"ro-RO.main.js.map"}
|
package/dist/ro-RO.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,YAAY,CAAC;IACxE,qBAAqB,CAAC,iEAAkD,CAAC;IACzE,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,2BAA2B,CAAC;IAC5C,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,mBAAmB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC7O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;AACpD","sources":["packages/@react-aria/grid/intl/ro-RO.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} neselectat.\",\n \"longPressToSelect\": \"Apăsați lung pentru a intra în modul de selectare.\",\n \"select\": \"Selectare\",\n \"selectedAll\": \"Toate elementele selectate.\",\n \"selectedCount\": \"{count, plural, =0 {Niciun element selectat} one {# element selectat} other {# elemente selectate}}.\",\n \"selectedItem\": \"{item} selectat.\"\n}\n"],"names":[],"version":3,"file":"ro-RO.module.js.map"}
|
package/dist/ru-RU.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,kEAAY,CAAC;IACxE,qBAAqB,CAAC,yRAA+C,CAAC;IACtE,UAAU,CAAC,iDAAO,CAAC;IACnB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qJAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,6FAAe,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kHAAkB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC1O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mDAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/ru-RU.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не выбрано.\",\n \"longPressToSelect\": \"Нажмите и удерживайте для входа в режим выбора.\",\n \"select\": \"Выбрать\",\n \"selectedAll\": \"Выбраны все элементы.\",\n \"selectedCount\": \"{count, plural, =0 {Нет выбранных элементов} one {# элемент выбран} other {# элементов выбрано}}.\",\n \"selectedItem\": \"{item} выбрано.\"\n}\n"],"names":[],"version":3,"file":"ru-RU.main.js.map"}
|
package/dist/ru-RU.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,kEAAY,CAAC;IACxE,qBAAqB,CAAC,yRAA+C,CAAC;IACtE,UAAU,CAAC,iDAAO,CAAC;IACnB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qJAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,6FAAe,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kHAAkB,CAAC;QAAA,GAAG,CAAC,CAAC;IAC1O,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mDAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/ru-RU.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не выбрано.\",\n \"longPressToSelect\": \"Нажмите и удерживайте для входа в режим выбора.\",\n \"select\": \"Выбрать\",\n \"selectedAll\": \"Выбраны все элементы.\",\n \"selectedCount\": \"{count, plural, =0 {Нет выбранных элементов} one {# элемент выбран} other {# элементов выбрано}}.\",\n \"selectedItem\": \"{item} выбрано.\"\n}\n"],"names":[],"version":3,"file":"ru-RU.module.js.map"}
|
package/dist/sk-SK.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,4BAAmB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,qBAAqB,CAAC,sEAA2C,CAAC;IAClE,UAAU,CAAC,YAAM,CAAC;IAClB,eAAe,CAAC,sCAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,4BAAmB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,qBAAqB,CAAC,sEAA2C,CAAC;IAClE,UAAU,CAAC,YAAM,CAAC;IAClB,eAAe,CAAC,sCAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qCAAsB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAgB,CAAC;YAAE,OAAO,IAAM,CAAC,wCAAyB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IACjP,gBAAgB,CAAC,OAAS,CAAC,0BAAiB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;AAC5D","sources":["packages/@react-aria/grid/intl/sk-SK.json"],"sourcesContent":["{\n \"deselectedItem\": \"Nevybraté položky: {item}.\",\n \"longPressToSelect\": \"Dlhším stlačením prejdite do režimu výberu.\",\n \"select\": \"Vybrať\",\n \"selectedAll\": \"Všetky vybraté položky.\",\n \"selectedCount\": \"{count, plural, =0 {Žiadne vybraté položky} one {# vybratá položka} other {Počet vybratých položiek:#}}.\",\n \"selectedItem\": \"Vybraté položky: {item}.\"\n}\n"],"names":[],"version":3,"file":"sk-SK.main.js.map"}
|
package/dist/sk-SK.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,4BAAmB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,qBAAqB,CAAC,sEAA2C,CAAC;IAClE,UAAU,CAAC,YAAM,CAAC;IAClB,eAAe,CAAC,sCAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,4BAAmB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,qBAAqB,CAAC,sEAA2C,CAAC;IAClE,UAAU,CAAC,YAAM,CAAC;IAClB,eAAe,CAAC,sCAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qCAAsB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,yBAAgB,CAAC;YAAE,OAAO,IAAM,CAAC,wCAAyB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IACjP,gBAAgB,CAAC,OAAS,CAAC,0BAAiB,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;AAC5D","sources":["packages/@react-aria/grid/intl/sk-SK.json"],"sourcesContent":["{\n \"deselectedItem\": \"Nevybraté položky: {item}.\",\n \"longPressToSelect\": \"Dlhším stlačením prejdite do režimu výberu.\",\n \"select\": \"Vybrať\",\n \"selectedAll\": \"Všetky vybraté položky.\",\n \"selectedCount\": \"{count, plural, =0 {Žiadne vybraté položky} one {# vybratá položka} other {Počet vybratých položiek:#}}.\",\n \"selectedItem\": \"Vybraté položky: {item}.\"\n}\n"],"names":[],"version":3,"file":"sk-SK.module.js.map"}
|
package/dist/sl-SI.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;IAC/E,qBAAqB,CAAC,kEAAgD,CAAC;IACvE,UAAU,CAAC,QAAQ,CAAC;IACpB,eAAe,CAAC,wBAAwB,CAAC;IACzC,iBAAiB,CAAC,MAAM,YAAc,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;IAC/E,qBAAqB,CAAC,kEAAgD,CAAC;IACvE,UAAU,CAAC,QAAQ,CAAC;IACpB,eAAe,CAAC,wBAAwB,CAAC;IACzC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAkB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,sBAAsB,CAAC;QAAA,GAAG,CAAC,CAAC;IACjP,gBAAgB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;AAC7D","sources":["packages/@react-aria/grid/intl/sl-SI.json"],"sourcesContent":["{\n \"deselectedItem\": \"Element {item} ni izbran.\",\n \"longPressToSelect\": \"Za izbirni način pritisnite in dlje časa držite.\",\n \"select\": \"Izberite\",\n \"selectedAll\": \"Vsi elementi so izbrani.\",\n \"selectedCount\": \"{count, plural, =0 {Noben element ni izbran} one {# element je izbran} other {# elementov je izbranih}}.\",\n \"selectedItem\": \"Element {item} je izbran.\"\n}\n"],"names":[],"version":3,"file":"sl-SI.main.js.map"}
|
package/dist/sl-SI.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;IAC/E,qBAAqB,CAAC,kEAAgD,CAAC;IACvE,UAAU,CAAC,QAAQ,CAAC;IACpB,eAAe,CAAC,wBAAwB,CAAC;IACzC,iBAAiB,CAAC,MAAM,YAAc,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;IAC/E,qBAAqB,CAAC,kEAAgD,CAAC;IACvE,UAAU,CAAC,QAAQ,CAAC;IACpB,eAAe,CAAC,wBAAwB,CAAC;IACzC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,uBAAuB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAkB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,sBAAsB,CAAC;QAAA,GAAG,CAAC,CAAC;IACjP,gBAAgB,CAAC,OAAS,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC;AAC7D","sources":["packages/@react-aria/grid/intl/sl-SI.json"],"sourcesContent":["{\n \"deselectedItem\": \"Element {item} ni izbran.\",\n \"longPressToSelect\": \"Za izbirni način pritisnite in dlje časa držite.\",\n \"select\": \"Izberite\",\n \"selectedAll\": \"Vsi elementi so izbrani.\",\n \"selectedCount\": \"{count, plural, =0 {Noben element ni izbran} one {# element je izbran} other {# elementov je izbranih}}.\",\n \"selectedItem\": \"Element {item} je izbran.\"\n}\n"],"names":[],"version":3,"file":"sl-SI.module.js.map"}
|
package/dist/sr-SP.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,eAAe,CAAC;IAC3E,qBAAqB,CAAC,gDAA0C,CAAC;IACjE,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,uBAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,4BAA4B,CAAC;YAAE,KAAK,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;YAAE,OAAO,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;QAAA,GAAG,CAAC,CAAC;IACpP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/sr-SP.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} nije izabrano.\",\n \"longPressToSelect\": \"Dugo pritisnite za ulazak u režim biranja.\",\n \"select\": \"Izaberite\",\n \"selectedAll\": \"Izabrane su sve stavke.\",\n \"selectedCount\": \"{count, plural, =0 {Nije izabrana nijedna stavka} one {Izabrana je # stavka} other {Izabrano je # stavki}}.\",\n \"selectedItem\": \"{item} je izabrano.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.main.js.map"}
|
package/dist/sr-SP.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,eAAe,CAAC;IAC3E,qBAAqB,CAAC,gDAA0C,CAAC;IACjE,UAAU,CAAC,SAAS,CAAC;IACrB,eAAe,CAAC,uBAAuB,CAAC;IACxC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,4BAA4B,CAAC;YAAE,KAAK,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;YAAE,OAAO,IAAM,CAAC,YAAY,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,OAAO,CAAC;QAAA,GAAG,CAAC,CAAC;IACpP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;AACvD","sources":["packages/@react-aria/grid/intl/sr-SP.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} nije izabrano.\",\n \"longPressToSelect\": \"Dugo pritisnite za ulazak u režim biranja.\",\n \"select\": \"Izaberite\",\n \"selectedAll\": \"Izabrane su sve stavke.\",\n \"selectedCount\": \"{count, plural, =0 {Nije izabrana nijedna stavka} one {Izabrana je # stavka} other {Izabrano je # stavki}}.\",\n \"selectedItem\": \"{item} je izabrano.\"\n}\n"],"names":[],"version":3,"file":"sr-SP.module.js.map"}
|
package/dist/sv-SE.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;IACzE,qBAAqB,CAAC,wDAAyC,CAAC;IAChE,UAAU,CAAC,OAAO,CAAC;IACnB,eAAe,CAAC,sBAAsB,CAAC;IACvC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qBAAqB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,gBAAgB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;QAAA,GAAG,CAAC,CAAC;IACxO,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;AACpD","sources":["packages/@react-aria/grid/intl/sv-SE.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} ej markerat.\",\n \"longPressToSelect\": \"Tryck länge när du vill öppna väljarläge.\",\n \"select\": \"Markera\",\n \"selectedAll\": \"Alla markerade objekt.\",\n \"selectedCount\": \"{count, plural, =0 {Inga markerade objekt} one {# markerat objekt} other {# markerade objekt}}.\",\n \"selectedItem\": \"{item} markerat.\"\n}\n"],"names":[],"version":3,"file":"sv-SE.main.js.map"}
|
package/dist/sv-SE.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,aAAa,CAAC;IACzE,qBAAqB,CAAC,wDAAyC,CAAC;IAChE,UAAU,CAAC,OAAO,CAAC;IACnB,eAAe,CAAC,sBAAsB,CAAC;IACvC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,qBAAqB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,gBAAgB,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,iBAAiB,CAAC;QAAA,GAAG,CAAC,CAAC;IACxO,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,UAAU,CAAC;AACpD","sources":["packages/@react-aria/grid/intl/sv-SE.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} ej markerat.\",\n \"longPressToSelect\": \"Tryck länge när du vill öppna väljarläge.\",\n \"select\": \"Markera\",\n \"selectedAll\": \"Alla markerade objekt.\",\n \"selectedCount\": \"{count, plural, =0 {Inga markerade objekt} one {# markerat objekt} other {# markerade objekt}}.\",\n \"selectedItem\": \"{item} markerat.\"\n}\n"],"names":[],"version":3,"file":"sv-SE.module.js.map"}
|
package/dist/tr-TR.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,cAAW,CAAC;IACvE,qBAAqB,CAAC,gDAAoC,CAAC;IAC3D,UAAU,CAAC,MAAG,CAAC;IACf,eAAe,CAAC,4BAAmB,CAAC;IACpC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,6BAAoB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;QAAA,GAAG,CAAC,CAAC;IAC9N,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,YAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/tr-TR.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} seçilmedi.\",\n \"longPressToSelect\": \"Seçim moduna girmek için uzun basın.\",\n \"select\": \"Seç\",\n \"selectedAll\": \"Tüm ögeler seçildi.\",\n \"selectedCount\": \"{count, plural, =0 {Hiçbir öge seçilmedi} one {# öge seçildi} other {# öge seçildi}}.\",\n \"selectedItem\": \"{item} seçildi.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.main.js.map"}
|
package/dist/tr-TR.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,cAAW,CAAC;IACvE,qBAAqB,CAAC,gDAAoC,CAAC;IAC3D,UAAU,CAAC,MAAG,CAAC;IACf,eAAe,CAAC,4BAAmB,CAAC;IACpC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,6BAAoB,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;YAAE,OAAO,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,kBAAY,CAAC;QAAA,GAAG,CAAC,CAAC;IAC9N,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,YAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/tr-TR.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} seçilmedi.\",\n \"longPressToSelect\": \"Seçim moduna girmek için uzun basın.\",\n \"select\": \"Seç\",\n \"selectedAll\": \"Tüm ögeler seçildi.\",\n \"selectedCount\": \"{count, plural, =0 {Hiçbir öge seçilmedi} one {# öge seçildi} other {# öge seçildi}}.\",\n \"selectedItem\": \"{item} seçildi.\"\n}\n"],"names":[],"version":3,"file":"tr-TR.module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -21,23 +21,23 @@ export class GridKeyboardDelegate<T, C extends GridCollection<T>> implements Key
|
|
|
21
21
|
protected disabledKeys: Set<Key>;
|
|
22
22
|
protected disabledBehavior: DisabledBehavior;
|
|
23
23
|
protected direction: Direction;
|
|
24
|
-
protected collator: Intl.Collator;
|
|
24
|
+
protected collator: Intl.Collator | undefined;
|
|
25
25
|
protected layoutDelegate: LayoutDelegate;
|
|
26
26
|
protected focusMode: any;
|
|
27
27
|
constructor(options: GridKeyboardDelegateOptions<C>);
|
|
28
28
|
protected isCell(node: Node<T>): boolean;
|
|
29
29
|
protected isRow(node: Node<T>): boolean;
|
|
30
|
-
protected findPreviousKey(fromKey?: Key, pred?: (item: Node<T>) => boolean): Key;
|
|
31
|
-
protected findNextKey(fromKey?: Key, pred?: (item: Node<T>) => boolean): Key;
|
|
32
|
-
getKeyBelow(
|
|
33
|
-
getKeyAbove(
|
|
34
|
-
getKeyRightOf(key: Key): Key;
|
|
35
|
-
getKeyLeftOf(key: Key): Key;
|
|
36
|
-
getFirstKey(
|
|
37
|
-
getLastKey(
|
|
38
|
-
getKeyPageAbove(
|
|
39
|
-
getKeyPageBelow(
|
|
40
|
-
getKeyForSearch(search: string, fromKey?: Key): Key;
|
|
30
|
+
protected findPreviousKey(fromKey?: Key, pred?: (item: Node<T>) => boolean): Key | null;
|
|
31
|
+
protected findNextKey(fromKey?: Key, pred?: (item: Node<T>) => boolean): Key | null;
|
|
32
|
+
getKeyBelow(fromKey: Key): Key | null;
|
|
33
|
+
getKeyAbove(fromKey: Key): Key | null;
|
|
34
|
+
getKeyRightOf(key: Key): Key | null;
|
|
35
|
+
getKeyLeftOf(key: Key): Key | null;
|
|
36
|
+
getFirstKey(fromKey?: Key, global?: boolean): Key | null;
|
|
37
|
+
getLastKey(fromKey?: Key, global?: boolean): Key | null;
|
|
38
|
+
getKeyPageAbove(fromKey: Key): Key | null;
|
|
39
|
+
getKeyPageBelow(fromKey: Key): Key | null;
|
|
40
|
+
getKeyForSearch(search: string, fromKey?: Key): Key | null;
|
|
41
41
|
}
|
|
42
42
|
interface DeprecatedLayout {
|
|
43
43
|
getLayoutInfo(key: Key): DeprecatedLayoutInfo;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAiBA,6CAA6C,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC;IACd,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,GAAG,CAAC,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,QAAQ,CAAC;IACzB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gDAAgD;IAChD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAC3B;AAED,kCAAkC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,CAAE,YAAW,gBAAgB;IAC3F,UAAU,EAAE,CAAC,CAAC;IACd,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC7C,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAC/B,SAAS,CAAC,QAAQ,EAAE,KAAK,QAAQ,CAAC;
|
|
1
|
+
{"mappings":";;;;;;AAiBA,6CAA6C,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC;IACd,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,GAAG,CAAC,EAAE,UAAU,WAAW,GAAG,IAAI,CAAC,CAAC;IACpC,SAAS,E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IAAI,CAAC,GAAG,WAAW,CAqC5K;AC5DD;IACE,+GAA+G;IAC/G,IAAI,EAAE,SAAS,OAAO,CAAC,CAAC;IACxB,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6GAA6G;IAC7G,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,wEAAwE;IACxE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;QAII;IACJ,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;CACtB;AAED;IACE,uCAAuC;IACvC,aAAa,EAAE,aAAa,CAAC;IAC7B,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;;;GAIG;AACH,4BAA4B,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,YAAY,CAqO/J;AChRD;IACE,qCAAqC;IACrC,GAAG,EAAE,GAAG,CAAA;CACT;AAED;IACE,oDAAoD;IACpD,aAAa,EAAE,iBAAiB,CAAA;CACjC;AAGD;;;;GAIG;AACH,yCAAyC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,8BAA8B,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,yBAAyB,CAsBjK","sources":["packages/@react-aria/grid/src/packages/@react-aria/grid/src/GridKeyboardDelegate.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/utils.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridSelectionAnnouncement.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useHighlightSelectionDescription.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGrid.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridRowGroup.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridRow.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridCell.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/useGridSelectionCheckbox.ts","packages/@react-aria/grid/src/packages/@react-aria/grid/src/index.ts","packages/@react-aria/grid/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,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 {GridKeyboardDelegate} from './GridKeyboardDelegate';\nexport {useGrid} from './useGrid';\nexport {useGridRowGroup} from './useGridRowGroup';\nexport {useGridRow} from './useGridRow';\nexport {useGridCell} from './useGridCell';\nexport {useGridSelectionCheckbox} from './useGridSelectionCheckbox';\nexport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nexport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\n\nexport type {GridProps, GridAria} from './useGrid';\nexport type {GridCellAria, GridCellProps} from './useGridCell';\nexport type {GridRowGroupAria} from './useGridRowGroup';\nexport type {GridRowProps, GridRowAria} from './useGridRow';\nexport type {GridKeyboardDelegateOptions} from './GridKeyboardDelegate';\nexport type {AriaGridSelectionCheckboxProps, GridSelectionCheckboxAria} from './useGridSelectionCheckbox';\nexport type {HighlightSelectionDescriptionProps} from './useHighlightSelectionDescription';\nexport type {GridSelectionAnnouncementProps} from './useGridSelectionAnnouncement';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/dist/uk-UA.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":"AAAA,iBAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,kEAAY,CAAC;IACxE,qBAAqB,CAAC,2UAAuD,CAAC;IAC9E,UAAU,CAAC,iDAAO,CAAC;IACnB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,2KAA2B,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,oGAAgB,CAAC;YAAE,OAAO,IAAM,CAAC,mHAAmB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IAChP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mDAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/uk-UA.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не вибрано.\",\n \"longPressToSelect\": \"Виконайте довге натиснення, щоб перейти в режим вибору.\",\n \"select\": \"Вибрати\",\n \"selectedAll\": \"Усі елементи вибрано.\",\n \"selectedCount\": \"{count, plural, =0 {Жодних елементів не вибрано} one {# елемент вибрано} other {Вибрано елементів: #}}.\",\n \"selectedItem\": \"{item} вибрано.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.main.js.map"}
|
package/dist/uk-UA.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,
|
|
1
|
+
{"mappings":";AAAA,4BAAiB;IAAG,kBAAkB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,kEAAY,CAAC;IACxE,qBAAqB,CAAC,2UAAuD,CAAC;IAC9E,UAAU,CAAC,iDAAO,CAAC;IACnB,eAAe,CAAC,iIAAqB,CAAC;IACtC,iBAAiB,CAAC,MAAM,YAAc,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE;YAAC,MAAM,CAAC,2KAA2B,CAAC;YAAE,KAAK,IAAM,GAAG,UAAU,MAAM,CAAC,KAAK,KAAK,EAAE,oGAAgB,CAAC;YAAE,OAAO,IAAM,CAAC,mHAAmB,EAAE,UAAU,MAAM,CAAC,KAAK,KAAK,GAAG;QAAA,GAAG,CAAC,CAAC;IAChP,gBAAgB,CAAC,OAAS,GAAG,KAAK,IAAI,CAAC,mDAAS,CAAC;AACnD","sources":["packages/@react-aria/grid/intl/uk-UA.json"],"sourcesContent":["{\n \"deselectedItem\": \"{item} не вибрано.\",\n \"longPressToSelect\": \"Виконайте довге натиснення, щоб перейти в режим вибору.\",\n \"select\": \"Вибрати\",\n \"selectedAll\": \"Усі елементи вибрано.\",\n \"selectedCount\": \"{count, plural, =0 {Жодних елементів не вибрано} one {# елемент вибрано} other {Вибрано елементів: #}}.\",\n \"selectedItem\": \"{item} вибрано.\"\n}\n"],"names":[],"version":3,"file":"uk-UA.module.js.map"}
|
package/dist/useGrid.main.js
CHANGED
|
@@ -115,7 +115,7 @@ function $11d770dfabe45077$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
115
115
|
}, state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
|
|
116
116
|
state.collection.size === 0 && {
|
|
117
117
|
tabIndex: hasTabbableChild ? -1 : 0
|
|
118
|
-
}, descriptionProps);
|
|
118
|
+
} || undefined, descriptionProps);
|
|
119
119
|
if (isVirtualized) {
|
|
120
120
|
gridProps['aria-rowcount'] = state.collection.size;
|
|
121
121
|
gridProps['aria-colcount'] = state.collection.columnCount;
|
package/dist/useGrid.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuDM,SAAS,0CAAW,KAAgB,EAAE,KAAsC,EAAE,GAAkC;IACrH,IAAI,iB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,mBAAmB,CAAA,GAAA,yCAAkB,EAAE,KAAK;QAC9C,YAAY,MAAM,UAAU,CAAC,IAAI,KAAK;IACxC;IAEA,IAAI,YAA2B,CAAA,GAAA,gCAAS,EACtC,UACA;QACE,MAAM;YACN;QACA,wBAAwB,QAAQ,aAAa,KAAK,aAAa,SAAS;IAC1E,GACA,MAAM,4BAA4B,GAAG,sBAAsB,iBAE3D,AADA,mGAAmG;IAClG,MAAM,UAAU,CAAC,IAAI,KAAK,KAAK;QAAC,UAAU,mBAAmB,KAAK;IAAC,KAAM,WAC1E;IAGF,IAAI,eAAe;QACjB,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,IAAI;QAClD,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,WAAW;IAC3D;IAEA,CAAA,GAAA,sDAA2B,EAAE;oBAAC;IAAU,GAAG;IAC3C,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/grid/src/useGrid.ts"],"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\nimport {AriaLabelingProps, DOMAttributes, DOMProps, Key, KeyboardDelegate, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {GridCollection} from '@react-types/grid';\nimport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {useCallback, useMemo} from 'react';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nimport {useSelectableCollection} from '@react-aria/selection';\n\nexport interface GridProps extends DOMProps, AriaLabelingProps {\n /** Whether the grid uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether initial grid focus should be placed on the grid row or grid cell.\n * @default 'row'\n */\n focusMode?: 'row' | 'cell',\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string,\n /**\n * The ref attached to the scrollable body. Used to provided automatic scrolling on item focus for non-virtualized grids.\n */\n scrollRef?: RefObject<HTMLElement | null>,\n /** Handler that is called when a user performs an action on the row. */\n onRowAction?: (key: Key) => void,\n /** Handler that is called when a user performs an action on the cell. */\n onCellAction?: (key: Key) => void\n}\n\nexport interface GridAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a grid component.\n * A grid displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the grid.\n * @param state - State for the grid, as returned by `useGridState`.\n * @param ref - The ref attached to the grid element.\n */\nexport function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement | null>): GridAria {\n let {\n isVirtualized,\n keyboardDelegate,\n focusMode,\n scrollRef,\n getRowText,\n onRowAction,\n onCellAction\n } = props;\n let {selectionManager: manager} = state;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n focusMode\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, focusMode]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager: manager,\n keyboardDelegate: delegate,\n isVirtualized,\n scrollRef\n });\n\n let id = useId(props.id);\n gridMap.set(state, {keyboardDelegate: delegate, actions: {onRowAction, onCellAction}});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: manager,\n hasItemActions: !!(onRowAction || onCellAction)\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n let onFocus = useCallback((e) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n }, [manager]);\n\n // Continue to track collection focused state even if keyboard navigation is disabled\n let navDisabledHandlers = useMemo(() => ({\n onBlur: collectionProps.onBlur,\n onFocus\n }), [onFocus, collectionProps.onBlur]);\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': manager.selectionMode === 'multiple' ? 'true' : undefined\n },\n state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps,\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n (state.collection.size === 0 && {tabIndex: hasTabbableChild ? -1 : 0}) || undefined,\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = state.collection.columnCount;\n }\n\n useGridSelectionAnnouncement({getRowText}, state);\n return {\n gridProps\n };\n}\n"],"names":[],"version":3,"file":"useGrid.main.js.map"}
|
package/dist/useGrid.mjs
CHANGED
|
@@ -109,7 +109,7 @@ function $83c6e2eafa584c67$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
109
109
|
}, state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
|
|
110
110
|
state.collection.size === 0 && {
|
|
111
111
|
tabIndex: hasTabbableChild ? -1 : 0
|
|
112
|
-
}, descriptionProps);
|
|
112
|
+
} || undefined, descriptionProps);
|
|
113
113
|
if (isVirtualized) {
|
|
114
114
|
gridProps['aria-rowcount'] = state.collection.size;
|
|
115
115
|
gridProps['aria-colcount'] = state.collection.columnCount;
|
package/dist/useGrid.module.js
CHANGED
|
@@ -109,7 +109,7 @@ function $83c6e2eafa584c67$export$f6b86a04e5d66d90(props, state, ref) {
|
|
|
109
109
|
}, state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps, // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.
|
|
110
110
|
state.collection.size === 0 && {
|
|
111
111
|
tabIndex: hasTabbableChild ? -1 : 0
|
|
112
|
-
}, descriptionProps);
|
|
112
|
+
} || undefined, descriptionProps);
|
|
113
113
|
if (isVirtualized) {
|
|
114
114
|
gridProps['aria-rowcount'] = state.collection.size;
|
|
115
115
|
gridProps['aria-colcount'] = state.collection.columnCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAuDM,SAAS,0CAAW,KAAgB,EAAE,KAAsC,EAAE,GAAkC;IACrH,IAAI,iBACF,aAAa,oBACb,gBAAgB,aAChB,SAAS,aACT,SAAS,cACT,UAAU,eACV,WAAW,gBACX,YAAY,EACb,GAAG;IACJ,IAAI,EAAC,kBAAkB,OAAO,EAAC,GAAG;IAElC,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACnD,QAAQ,IAAI,CAAC;IAGf,0HAA0H;IAC1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IAClG,MAAM,UAAU,CAAC,IAAI,KAAK,KAAK;QAAC,UAAU,mBAAmB,KAAK;IAAC,KAAM,WAC1E;IAGF,IAAI,eAAe;QACjB,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,IAAI;QAClD,SAAS,CAAC,gBAAgB,GAAG,MAAM,UAAU,CAAC,WAAW;IAC3D;IAEA,CAAA,GAAA,yCAA2B,EAAE;oBAAC;IAAU,GAAG;IAC3C,OAAO;mBACL;IACF;AACF","sources":["packages/@react-aria/grid/src/useGrid.ts"],"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\nimport {AriaLabelingProps, DOMAttributes, DOMProps, Key, KeyboardDelegate, RefObject} from '@react-types/shared';\nimport {filterDOMProps, mergeProps, useId} from '@react-aria/utils';\nimport {GridCollection} from '@react-types/grid';\nimport {GridKeyboardDelegate} from './GridKeyboardDelegate';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {useCallback, useMemo} from 'react';\nimport {useCollator, useLocale} from '@react-aria/i18n';\nimport {useGridSelectionAnnouncement} from './useGridSelectionAnnouncement';\nimport {useHasTabbableChild} from '@react-aria/focus';\nimport {useHighlightSelectionDescription} from './useHighlightSelectionDescription';\nimport {useSelectableCollection} from '@react-aria/selection';\n\nexport interface GridProps extends DOMProps, AriaLabelingProps {\n /** Whether the grid uses virtual scrolling. */\n isVirtualized?: boolean,\n /**\n * An optional keyboard delegate implementation for type to select,\n * to override the default.\n */\n keyboardDelegate?: KeyboardDelegate,\n /**\n * Whether initial grid focus should be placed on the grid row or grid cell.\n * @default 'row'\n */\n focusMode?: 'row' | 'cell',\n /**\n * A function that returns the text that should be announced by assistive technology when a row is added or removed from selection.\n * @default (key) => state.collection.getItem(key)?.textValue\n */\n getRowText?: (key: Key) => string,\n /**\n * The ref attached to the scrollable body. Used to provided automatic scrolling on item focus for non-virtualized grids.\n */\n scrollRef?: RefObject<HTMLElement | null>,\n /** Handler that is called when a user performs an action on the row. */\n onRowAction?: (key: Key) => void,\n /** Handler that is called when a user performs an action on the cell. */\n onCellAction?: (key: Key) => void\n}\n\nexport interface GridAria {\n /** Props for the grid element. */\n gridProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a grid component.\n * A grid displays data in one or more rows and columns and enables a user to navigate its contents via directional navigation keys.\n * @param props - Props for the grid.\n * @param state - State for the grid, as returned by `useGridState`.\n * @param ref - The ref attached to the grid element.\n */\nexport function useGrid<T>(props: GridProps, state: GridState<T, GridCollection<T>>, ref: RefObject<HTMLElement | null>): GridAria {\n let {\n isVirtualized,\n keyboardDelegate,\n focusMode,\n scrollRef,\n getRowText,\n onRowAction,\n onCellAction\n } = props;\n let {selectionManager: manager} = state;\n\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn('An aria-label or aria-labelledby prop is required for accessibility.');\n }\n\n // By default, a KeyboardDelegate is provided which uses the DOM to query layout information (e.g. for page up/page down).\n // When virtualized, the layout object will be passed in as a prop and override this.\n let collator = useCollator({usage: 'search', sensitivity: 'base'});\n let {direction} = useLocale();\n let disabledBehavior = state.selectionManager.disabledBehavior;\n let delegate = useMemo(() => keyboardDelegate || new GridKeyboardDelegate({\n collection: state.collection,\n disabledKeys: state.disabledKeys,\n disabledBehavior,\n ref,\n direction,\n collator,\n focusMode\n }), [keyboardDelegate, state.collection, state.disabledKeys, disabledBehavior, ref, direction, collator, focusMode]);\n\n let {collectionProps} = useSelectableCollection({\n ref,\n selectionManager: manager,\n keyboardDelegate: delegate,\n isVirtualized,\n scrollRef\n });\n\n let id = useId(props.id);\n gridMap.set(state, {keyboardDelegate: delegate, actions: {onRowAction, onCellAction}});\n\n let descriptionProps = useHighlightSelectionDescription({\n selectionManager: manager,\n hasItemActions: !!(onRowAction || onCellAction)\n });\n\n let domProps = filterDOMProps(props, {labelable: true});\n\n let onFocus = useCallback((e) => {\n if (manager.isFocused) {\n // If a focus event bubbled through a portal, reset focus state.\n if (!e.currentTarget.contains(e.target)) {\n manager.setFocused(false);\n }\n\n return;\n }\n\n // Focus events can bubble through portals. Ignore these events.\n if (!e.currentTarget.contains(e.target)) {\n return;\n }\n\n manager.setFocused(true);\n }, [manager]);\n\n // Continue to track collection focused state even if keyboard navigation is disabled\n let navDisabledHandlers = useMemo(() => ({\n onBlur: collectionProps.onBlur,\n onFocus\n }), [onFocus, collectionProps.onBlur]);\n\n let hasTabbableChild = useHasTabbableChild(ref, {\n isDisabled: state.collection.size !== 0\n });\n\n let gridProps: DOMAttributes = mergeProps(\n domProps,\n {\n role: 'grid',\n id,\n 'aria-multiselectable': manager.selectionMode === 'multiple' ? 'true' : undefined\n },\n state.isKeyboardNavigationDisabled ? navDisabledHandlers : collectionProps,\n // If collection is empty, make sure the grid is tabbable unless there is a child tabbable element.\n (state.collection.size === 0 && {tabIndex: hasTabbableChild ? -1 : 0}) || undefined,\n descriptionProps\n );\n\n if (isVirtualized) {\n gridProps['aria-rowcount'] = state.collection.size;\n gridProps['aria-colcount'] = state.collection.columnCount;\n }\n\n useGridSelectionAnnouncement({getRowText}, state);\n return {\n gridProps\n };\n}\n"],"names":[],"version":3,"file":"useGrid.module.js.map"}
|
package/dist/useGridCell.main.js
CHANGED
|
@@ -39,17 +39,19 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
39
39
|
// Handles focusing the cell. If there is a focusable child,
|
|
40
40
|
// it is focused, otherwise the cell itself is focused.
|
|
41
41
|
let focus = ()=>{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
if (ref.current) {
|
|
43
|
+
let treeWalker = (0, $9yLAi$reactariafocus.getFocusableTreeWalker)(ref.current);
|
|
44
|
+
if (focusMode === 'child') {
|
|
45
|
+
// If focus is already on a focusable child within the cell, early return so we don't shift focus
|
|
46
|
+
if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) return;
|
|
47
|
+
let focusable = state.selectionManager.childFocusStrategy === 'last' ? $cf2021be63b01ef4$var$last(treeWalker) : treeWalker.firstChild();
|
|
48
|
+
if (focusable) {
|
|
49
|
+
(0, $9yLAi$reactariafocus.focusSafely)(focusable);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
50
52
|
}
|
|
53
|
+
if (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !ref.current.contains(document.activeElement)) (0, $9yLAi$reactariafocus.focusSafely)(ref.current);
|
|
51
54
|
}
|
|
52
|
-
if (keyWhenFocused.current != null && node.key !== keyWhenFocused.current || !ref.current.contains(document.activeElement)) (0, $9yLAi$reactariafocus.focusSafely)(ref.current);
|
|
53
55
|
};
|
|
54
56
|
let { itemProps: itemProps, isPressed: isPressed } = (0, $9yLAi$reactariaselection.useSelectableItem)({
|
|
55
57
|
selectionManager: state.selectionManager,
|
|
@@ -62,7 +64,7 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
62
64
|
isDisabled: state.collection.size === 0
|
|
63
65
|
});
|
|
64
66
|
let onKeyDownCapture = (e)=>{
|
|
65
|
-
if (!e.currentTarget.contains(e.target) || state.isKeyboardNavigationDisabled) return;
|
|
67
|
+
if (!e.currentTarget.contains(e.target) || state.isKeyboardNavigationDisabled || !ref.current || !document.activeElement) return;
|
|
66
68
|
let walker = (0, $9yLAi$reactariafocus.getFocusableTreeWalker)(ref.current);
|
|
67
69
|
walker.currentNode = document.activeElement;
|
|
68
70
|
switch(e.key){
|
|
@@ -80,17 +82,19 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
80
82
|
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
|
|
81
83
|
});
|
|
82
84
|
} else {
|
|
85
|
+
var _keyboardDelegate_getKeyLeftOf;
|
|
83
86
|
// If there is no next focusable child, then move to the next cell to the left of this one.
|
|
84
87
|
// This will be handled by useSelectableCollection. However, if there is no cell to the left
|
|
85
88
|
// of this one, only one column, and the grid doesn't focus rows, then the next key will be the
|
|
86
89
|
// same as this one. In that case we need to handle focusing either the cell or the first/last
|
|
87
90
|
// child, depending on the focus mode.
|
|
88
|
-
let prev = keyboardDelegate.getKeyLeftOf(node.key);
|
|
91
|
+
let prev = (_keyboardDelegate_getKeyLeftOf = keyboardDelegate.getKeyLeftOf) === null || _keyboardDelegate_getKeyLeftOf === void 0 ? void 0 : _keyboardDelegate_getKeyLeftOf.call(keyboardDelegate, node.key);
|
|
89
92
|
if (prev !== node.key) {
|
|
90
|
-
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
93
|
+
var // We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
91
94
|
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
92
95
|
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
93
|
-
|
|
96
|
+
_ref_current_parentElement;
|
|
97
|
+
(_ref_current_parentElement = ref.current.parentElement) === null || _ref_current_parentElement === void 0 ? void 0 : _ref_current_parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
94
98
|
break;
|
|
95
99
|
}
|
|
96
100
|
if (focusMode === 'cell' && direction === 'rtl') {
|
|
@@ -123,12 +127,14 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
123
127
|
containingElement: (0, $9yLAi$reactariautils.getScrollParent)(ref.current)
|
|
124
128
|
});
|
|
125
129
|
} else {
|
|
126
|
-
|
|
130
|
+
var _keyboardDelegate_getKeyRightOf;
|
|
131
|
+
let next = (_keyboardDelegate_getKeyRightOf = keyboardDelegate.getKeyRightOf) === null || _keyboardDelegate_getKeyRightOf === void 0 ? void 0 : _keyboardDelegate_getKeyRightOf.call(keyboardDelegate, node.key);
|
|
127
132
|
if (next !== node.key) {
|
|
128
|
-
// We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
133
|
+
var // We prevent the capturing event from reaching children of the cell, e.g. pickers.
|
|
129
134
|
// We want arrow keys to navigate to the next cell instead. We need to re-dispatch
|
|
130
135
|
// the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.
|
|
131
|
-
|
|
136
|
+
_ref_current_parentElement1;
|
|
137
|
+
(_ref_current_parentElement1 = ref.current.parentElement) === null || _ref_current_parentElement1 === void 0 ? void 0 : _ref_current_parentElement1.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
132
138
|
break;
|
|
133
139
|
}
|
|
134
140
|
if (focusMode === 'cell' && direction === 'ltr') {
|
|
@@ -155,9 +161,10 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
155
161
|
// to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still
|
|
156
162
|
// bubbles and gets handled by useSelectableCollection.
|
|
157
163
|
if (!e.altKey && ref.current.contains(e.target)) {
|
|
164
|
+
var _ref_current_parentElement2;
|
|
158
165
|
e.stopPropagation();
|
|
159
166
|
e.preventDefault();
|
|
160
|
-
ref.current.parentElement.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
167
|
+
(_ref_current_parentElement2 = ref.current.parentElement) === null || _ref_current_parentElement2 === void 0 ? void 0 : _ref_current_parentElement2.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent));
|
|
161
168
|
}
|
|
162
169
|
break;
|
|
163
170
|
}
|
|
@@ -198,7 +205,7 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
198
205
|
let tabindex = el.getAttribute('tabindex');
|
|
199
206
|
el.removeAttribute('tabindex');
|
|
200
207
|
requestAnimationFrame(()=>{
|
|
201
|
-
el.setAttribute('tabindex', tabindex);
|
|
208
|
+
if (tabindex != null) el.setAttribute('tabindex', tabindex);
|
|
202
209
|
});
|
|
203
210
|
};
|
|
204
211
|
return {
|
|
@@ -207,8 +214,8 @@ function $cf2021be63b01ef4$export$c7e10bfc0c59f67c(props, state, ref) {
|
|
|
207
214
|
};
|
|
208
215
|
}
|
|
209
216
|
function $cf2021be63b01ef4$var$last(walker) {
|
|
210
|
-
let next;
|
|
211
|
-
let last;
|
|
217
|
+
let next = null;
|
|
218
|
+
let last = null;
|
|
212
219
|
do {
|
|
213
220
|
last = walker.lastChild();
|
|
214
221
|
if (last) next = last;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0CM,SAAS,0CAA4C,KAAoB,EAAE,KAAsB,EAAE,GAAuC;IAC/I,IAAI,QACF,IAAI,iBACJ,aAAa,aACb,YAAY,gCACZ,qBAAqB,YACrB,QAAQ,EACT,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,oBAAC,gBAAgB,EAAE,SAAS,gBAAC,YAAY,EAAC,EAAC,GAAG,CAAA,GAAA,iCAAM,EAAE,GAAG,CAAC;IAE9D,wFAAwF;IACxF,6FAA6F;IAC7F,IAAI,iBAAiB,CAAA,GAAA,mBAAK,EAAE;IAE5B,4DAA4D;IAC5D,uDAAuD;IACvD,IAAI,QAAQ;QACV,IAAI,aAAa,CAAA,GAAA,4CAAqB,EAAE,IAAI,OAAO;QACnD,IAAI,cAAc,SAAS;YACzB,iGAAiG;YACjG,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,aAAa,KAAK,IAAI,OAAO,KAAK,SAAS,aAAa,EACxF;YAGF,IAAI,YAAY,MAAM,gBAAgB,CAAC,kBAAkB,KAAK,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sB;YACpB,IAAI,cAAc,WAAW,SAAS,aAAa,KAAK,IAAI,OAAO,EACjE;QAEJ;IACF;IAEA,IAAI,gBAA+B,CAAA,GAAA,gCAAS,EAAE,WAAW;QACvD,MAAM;0BACN;iBACA;IACF;QAGoC;IADpC,IAAI,eACF,aAAa,CAAC,gBAAgB,GAAG,AAAC,CAAA,CAAA,iBAAA,KAAK,QAAQ,cAAb,4BAAA,iBAAiB,KAAK,KAAK,AAAD,IAAK,GAAG,2BAA2B;IAGjG,kGAAkG;IAClG,+FAA+F;IAC/F,2FAA2F;IAC3F,4EAA4E;IAC5E,IAAI,yBAAyB,cAAc,QAAQ,IAAI,QAAQ,cAAc,aAAa,IAAI,MAC5F,cAAc,aAAa,GAAG,CAAC;QAC7B,IAAI,KAAK,EAAE,aAAa;QACxB,IAAI,WAAW,GAAG,YAAY,CAAC;QAC/B,GAAG,eAAe,CAAC;QACnB,sBAAsB;YACpB,GAAG,YAAY,CAAC,YAAY;QAC9B;IACF;IAGF,OAAO;uBACL;mBACA;IACF;AACF;AAEA,SAAS,2BAAK,MAAkB;IAC9B,IAAI;IACJ,IAAI;IACJ,GAAG;QACD,OAAO,OAAO,SAAS;QACvB,IAAI,MACF,OAAO;IAEX,QAAS,MAAM;IACf,OAAO;AACT","sources":["packages/@react-aria/grid/src/useGridCell.ts"],"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\nimport {DOMAttributes, FocusableElement, RefObject} from '@react-types/shared';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {getScrollParent, mergeProps, scrollIntoViewport} from '@react-aria/utils';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {isFocusVisible} from '@react-aria/interactions';\nimport {KeyboardEvent as ReactKeyboardEvent, useRef} from 'react';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface GridCellProps {\n /** An object representing the grid cell. Contains all the relevant information that makes up the grid cell. */\n node: GridNode<unknown>,\n /** Whether the grid cell is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */\n focusMode?: 'child' | 'cell',\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridCellAria {\n /** Props for the grid cell element. */\n gridCellProps: DOMAttributes,\n /** Whether the cell is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a cell in a grid.\n * @param props - Props for the cell.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<FocusableElement | null>): GridCellAria {\n let {\n node,\n isVirtualized,\n focusMode = 'child',\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {direction} = useLocale();\n let {keyboardDelegate, actions: {onCellAction}} = gridMap.get(state);\n\n // We need to track the key of the item at the time it was last focused so that we force\n // focus to go to the item when the DOM node is reused for a different item in a virtualizer.\n let keyWhenFocused = useRef(null);\n\n // Handles focusing the cell. If there is a focusable child,\n // it is focused, otherwise the cell itself is focused.\n let focus = () => {\n let treeWalker = getFocusableTreeWalker(ref.current);\n if (focusMode === 'child') {\n // If focus is already on a focusable child within the cell, early return so we don't shift focus\n if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) {\n return;\n }\n\n let focusable = state.selectionManager.childFocusStrategy === 'last'\n ? last(treeWalker)\n : treeWalker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n return;\n }\n }\n\n if (\n (keyWhenFocused.current != null && node.key !== keyWhenFocused.current) ||\n !ref.current.contains(document.activeElement)\n ) {\n focusSafely(ref.current);\n }\n };\n\n let {itemProps, isPressed} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n focus,\n shouldSelectOnPressUp,\n onAction: onCellAction ? () => onCellAction(node.key) : onAction,\n isDisabled: state.collection.size === 0\n });\n\n let onKeyDownCapture = (e: ReactKeyboardEvent) => {\n if (!e.currentTarget.contains(e.target as Element) || state.isKeyboardNavigationDisabled) {\n return;\n }\n\n let walker = getFocusableTreeWalker(ref.current);\n walker.currentNode = document.activeElement;\n\n switch (e.key) {\n case 'ArrowLeft': {\n // Find the next focusable element within the cell.\n let focusable = direction === 'rtl'\n ? walker.nextNode() as FocusableElement\n : walker.previousNode() as FocusableElement;\n\n // Don't focus the cell itself if focusMode is \"child\"\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n // If there is no next focusable child, then move to the next cell to the left of this one.\n // This will be handled by useSelectableCollection. However, if there is no cell to the left\n // of this one, only one column, and the grid doesn't focus rows, then the next key will be the\n // same as this one. In that case we need to handle focusing either the cell or the first/last\n // child, depending on the focus mode.\n let prev = keyboardDelegate.getKeyLeftOf(node.key);\n if (prev !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch\n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'rtl') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? walker.firstChild() as FocusableElement\n : last(walker);\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n let focusable = direction === 'rtl'\n ? walker.previousNode() as FocusableElement\n : walker.nextNode() as FocusableElement;\n\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n let next = keyboardDelegate.getKeyRightOf(node.key);\n if (next !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch\n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'ltr') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? last(walker)\n : walker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n // Prevent this event from reaching cell children, e.g. menu buttons. We want arrow keys to navigate\n // to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still\n // bubbles and gets handled by useSelectableCollection.\n if (!e.altKey && ref.current.contains(e.target as Element)) {\n e.stopPropagation();\n e.preventDefault();\n ref.current.parentElement.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n }\n break;\n }\n };\n\n // Grid cells can have focusable elements inside them. In this case, focus should\n // be marshalled to that element rather than focusing the cell itself.\n let onFocus = (e) => {\n keyWhenFocused.current = node.key;\n if (e.target !== ref.current) {\n // useSelectableItem only handles setting the focused key when\n // the focused element is the gridcell itself. We also want to\n // set the focused key when a child element receives focus.\n // If focus is currently visible (e.g. the user is navigating with the keyboard),\n // then skip this. We want to restore focus to the previously focused row/cell\n // in that case since the table should act like a single tab stop.\n if (!isFocusVisible()) {\n state.selectionManager.setFocusedKey(node.key);\n }\n return;\n }\n\n // If the cell itself is focused, wait a frame so that focus finishes propagatating\n // up to the tree, and move focus to a focusable child if possible.\n requestAnimationFrame(() => {\n if (focusMode === 'child' && document.activeElement === ref.current) {\n focus();\n }\n });\n };\n\n let gridCellProps: DOMAttributes = mergeProps(itemProps, {\n role: 'gridcell',\n onKeyDownCapture,\n onFocus\n });\n\n if (isVirtualized) {\n gridCellProps['aria-colindex'] = (node.colIndex ?? node.index) + 1; // aria-colindex is 1-based\n }\n\n // When pressing with a pointer and cell selection is not enabled, usePress will be applied to the\n // row rather than the cell. However, when the row is draggable, usePress cannot preventDefault\n // on pointer down, so the browser will try to focus the cell which has a tabIndex applied.\n // To avoid this, remove the tabIndex from the cell briefly on pointer down.\n if (shouldSelectOnPressUp && gridCellProps.tabIndex != null && gridCellProps.onPointerDown == null) {\n gridCellProps.onPointerDown = (e) => {\n let el = e.currentTarget;\n let tabindex = el.getAttribute('tabindex');\n el.removeAttribute('tabindex');\n requestAnimationFrame(() => {\n el.setAttribute('tabindex', tabindex);\n });\n };\n }\n\n return {\n gridCellProps,\n isPressed\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement;\n let last: FocusableElement;\n do {\n last = walker.lastChild() as FocusableElement;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n"],"names":[],"version":3,"file":"useGridCell.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA0CM,SAAS,0CAA4C,KAAoB,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IAClG,+FAA+F;IAC/F,2FAA2F;IAC3F,4EAA4E;IAC5E,IAAI,yBAAyB,cAAc,QAAQ,IAAI,QAAQ,cAAc,aAAa,IAAI,MAC5F,cAAc,aAAa,GAAG,CAAC;QAC7B,IAAI,KAAK,EAAE,aAAa;QACxB,IAAI,WAAW,GAAG,YAAY,CAAC;QAC/B,GAAG,eAAe,CAAC;QACnB,sBAAsB;YACpB,IAAI,YAAY,MACd,GAAG,YAAY,CAAC,YAAY;QAEhC;IACF;IAGF,OAAO;uBACL;mBACA;IACF;AACF;AAEA,SAAS,2BAAK,MAAkB;IAC9B,IAAI,OAAgC;IACpC,IAAI,OAAgC;IACpC,GAAG;QACD,OAAO,OAAO,SAAS;QACvB,IAAI,MACF,OAAO;IAEX,QAAS,MAAM;IACf,OAAO;AACT","sources":["packages/@react-aria/grid/src/useGridCell.ts"],"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\nimport {DOMAttributes, FocusableElement, Key, RefObject} from '@react-types/shared';\nimport {focusSafely, getFocusableTreeWalker} from '@react-aria/focus';\nimport {getScrollParent, mergeProps, scrollIntoViewport} from '@react-aria/utils';\nimport {GridCollection, GridNode} from '@react-types/grid';\nimport {gridMap} from './utils';\nimport {GridState} from '@react-stately/grid';\nimport {isFocusVisible} from '@react-aria/interactions';\nimport {KeyboardEvent as ReactKeyboardEvent, useRef} from 'react';\nimport {useLocale} from '@react-aria/i18n';\nimport {useSelectableItem} from '@react-aria/selection';\n\nexport interface GridCellProps {\n /** An object representing the grid cell. Contains all the relevant information that makes up the grid cell. */\n node: GridNode<unknown>,\n /** Whether the grid cell is contained in a virtual scroller. */\n isVirtualized?: boolean,\n /** Whether the cell or its first focusable child element should be focused when the grid cell is focused. */\n focusMode?: 'child' | 'cell',\n /** Whether selection should occur on press up instead of press down. */\n shouldSelectOnPressUp?: boolean,\n /**\n * Handler that is called when a user performs an action on the cell.\n * Please use onCellAction at the collection level instead.\n * @deprecated\n **/\n onAction?: () => void\n}\n\nexport interface GridCellAria {\n /** Props for the grid cell element. */\n gridCellProps: DOMAttributes,\n /** Whether the cell is currently in a pressed state. */\n isPressed: boolean\n}\n\n/**\n * Provides the behavior and accessibility implementation for a cell in a grid.\n * @param props - Props for the cell.\n * @param state - State of the parent grid, as returned by `useGridState`.\n */\nexport function useGridCell<T, C extends GridCollection<T>>(props: GridCellProps, state: GridState<T, C>, ref: RefObject<FocusableElement | null>): GridCellAria {\n let {\n node,\n isVirtualized,\n focusMode = 'child',\n shouldSelectOnPressUp,\n onAction\n } = props;\n\n let {direction} = useLocale();\n let {keyboardDelegate, actions: {onCellAction}} = gridMap.get(state)!;\n\n // We need to track the key of the item at the time it was last focused so that we force\n // focus to go to the item when the DOM node is reused for a different item in a virtualizer.\n let keyWhenFocused = useRef<Key | null>(null);\n\n // Handles focusing the cell. If there is a focusable child,\n // it is focused, otherwise the cell itself is focused.\n let focus = () => {\n if (ref.current) {\n let treeWalker = getFocusableTreeWalker(ref.current);\n if (focusMode === 'child') {\n // If focus is already on a focusable child within the cell, early return so we don't shift focus\n if (ref.current.contains(document.activeElement) && ref.current !== document.activeElement) {\n return;\n }\n\n let focusable = state.selectionManager.childFocusStrategy === 'last'\n ? last(treeWalker)\n : treeWalker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n return;\n }\n }\n\n if (\n (keyWhenFocused.current != null && node.key !== keyWhenFocused.current) ||\n !ref.current.contains(document.activeElement)\n ) {\n focusSafely(ref.current);\n }\n }\n };\n\n let {itemProps, isPressed} = useSelectableItem({\n selectionManager: state.selectionManager,\n key: node.key,\n ref,\n isVirtualized,\n focus,\n shouldSelectOnPressUp,\n onAction: onCellAction ? () => onCellAction(node.key) : onAction,\n isDisabled: state.collection.size === 0\n });\n\n let onKeyDownCapture = (e: ReactKeyboardEvent) => {\n if (!e.currentTarget.contains(e.target as Element) || state.isKeyboardNavigationDisabled || !ref.current || !document.activeElement) {\n return;\n }\n\n let walker = getFocusableTreeWalker(ref.current);\n walker.currentNode = document.activeElement;\n\n switch (e.key) {\n case 'ArrowLeft': {\n // Find the next focusable element within the cell.\n let focusable: FocusableElement | null = direction === 'rtl'\n ? walker.nextNode() as FocusableElement\n : walker.previousNode() as FocusableElement;\n\n // Don't focus the cell itself if focusMode is \"child\"\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n // If there is no next focusable child, then move to the next cell to the left of this one.\n // This will be handled by useSelectableCollection. However, if there is no cell to the left\n // of this one, only one column, and the grid doesn't focus rows, then the next key will be the\n // same as this one. In that case we need to handle focusing either the cell or the first/last\n // child, depending on the focus mode.\n let prev = keyboardDelegate.getKeyLeftOf?.(node.key);\n if (prev !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch\n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'rtl') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? walker.firstChild() as FocusableElement\n : last(walker);\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowRight': {\n let focusable: FocusableElement | null = direction === 'rtl'\n ? walker.previousNode() as FocusableElement\n : walker.nextNode() as FocusableElement;\n\n if (focusMode === 'child' && focusable === ref.current) {\n focusable = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n } else {\n let next = keyboardDelegate.getKeyRightOf?.(node.key);\n if (next !== node.key) {\n // We prevent the capturing event from reaching children of the cell, e.g. pickers.\n // We want arrow keys to navigate to the next cell instead. We need to re-dispatch\n // the event from a higher parent so it still bubbles and gets handled by useSelectableCollection.\n ref.current.parentElement?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n break;\n }\n\n if (focusMode === 'cell' && direction === 'ltr') {\n focusSafely(ref.current);\n scrollIntoViewport(ref.current, {containingElement: getScrollParent(ref.current)});\n } else {\n walker.currentNode = ref.current;\n focusable = direction === 'rtl'\n ? last(walker)\n : walker.firstChild() as FocusableElement;\n if (focusable) {\n focusSafely(focusable);\n scrollIntoViewport(focusable, {containingElement: getScrollParent(ref.current)});\n }\n }\n }\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n // Prevent this event from reaching cell children, e.g. menu buttons. We want arrow keys to navigate\n // to the cell above/below instead. We need to re-dispatch the event from a higher parent so it still\n // bubbles and gets handled by useSelectableCollection.\n if (!e.altKey && ref.current.contains(e.target as Element)) {\n e.stopPropagation();\n e.preventDefault();\n ref.current.parentElement?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n );\n }\n break;\n }\n };\n\n // Grid cells can have focusable elements inside them. In this case, focus should\n // be marshalled to that element rather than focusing the cell itself.\n let onFocus = (e) => {\n keyWhenFocused.current = node.key;\n if (e.target !== ref.current) {\n // useSelectableItem only handles setting the focused key when\n // the focused element is the gridcell itself. We also want to\n // set the focused key when a child element receives focus.\n // If focus is currently visible (e.g. the user is navigating with the keyboard),\n // then skip this. We want to restore focus to the previously focused row/cell\n // in that case since the table should act like a single tab stop.\n if (!isFocusVisible()) {\n state.selectionManager.setFocusedKey(node.key);\n }\n return;\n }\n\n // If the cell itself is focused, wait a frame so that focus finishes propagatating\n // up to the tree, and move focus to a focusable child if possible.\n requestAnimationFrame(() => {\n if (focusMode === 'child' && document.activeElement === ref.current) {\n focus();\n }\n });\n };\n\n let gridCellProps: DOMAttributes = mergeProps(itemProps, {\n role: 'gridcell',\n onKeyDownCapture,\n onFocus\n });\n\n if (isVirtualized) {\n gridCellProps['aria-colindex'] = (node.colIndex ?? node.index) + 1; // aria-colindex is 1-based\n }\n\n // When pressing with a pointer and cell selection is not enabled, usePress will be applied to the\n // row rather than the cell. However, when the row is draggable, usePress cannot preventDefault\n // on pointer down, so the browser will try to focus the cell which has a tabIndex applied.\n // To avoid this, remove the tabIndex from the cell briefly on pointer down.\n if (shouldSelectOnPressUp && gridCellProps.tabIndex != null && gridCellProps.onPointerDown == null) {\n gridCellProps.onPointerDown = (e) => {\n let el = e.currentTarget;\n let tabindex = el.getAttribute('tabindex');\n el.removeAttribute('tabindex');\n requestAnimationFrame(() => {\n if (tabindex != null) {\n el.setAttribute('tabindex', tabindex);\n }\n });\n };\n }\n\n return {\n gridCellProps,\n isPressed\n };\n}\n\nfunction last(walker: TreeWalker) {\n let next: FocusableElement | null = null;\n let last: FocusableElement | null = null;\n do {\n last = walker.lastChild() as FocusableElement | null;\n if (last) {\n next = last;\n }\n } while (last);\n return next;\n}\n"],"names":[],"version":3,"file":"useGridCell.main.js.map"}
|