@react-aria/grid 3.9.1-nightly.4624 → 3.9.1

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.
@@ -29,7 +29,7 @@ function $92599c3fd427b763$export$137e594ef3218a10(props, state) {
29
29
  var _state_collection_getTextValue1;
30
30
  return (_state_collection_getTextValue1 = (_state_collection_getTextValue = (_state_collection = state.collection).getTextValue) === null || _state_collection_getTextValue === void 0 ? void 0 : _state_collection_getTextValue.call(_state_collection, key)) !== null && _state_collection_getTextValue1 !== void 0 ? _state_collection_getTextValue1 : (_state_collection_getItem = state.collection.getItem(key)) === null || _state_collection_getItem === void 0 ? void 0 : _state_collection_getItem.textValue;
31
31
  } } = props;
32
- let stringFormatter = (0, $4stjr$useLocalizedStringFormatter)((0, ($parcel$interopDefault($4stjr$intlStringsmodulejs))), "@react-aria/grid");
32
+ let stringFormatter = (0, $4stjr$useLocalizedStringFormatter)((0, ($parcel$interopDefault($4stjr$intlStringsmodulejs))), '@react-aria/grid');
33
33
  // Many screen readers do not announce when items in a grid are selected/deselected.
34
34
  // We do this using an ARIA live region.
35
35
  let selection = state.selectionManager.rawSelection;
@@ -43,35 +43,35 @@ function $92599c3fd427b763$export$137e594ef3218a10(props, state) {
43
43
  let addedKeys = $92599c3fd427b763$var$diffSelection(selection, lastSelection.current);
44
44
  let removedKeys = $92599c3fd427b763$var$diffSelection(lastSelection.current, selection);
45
45
  // If adding or removing a single row from the selection, announce the name of that item.
46
- let isReplace = state.selectionManager.selectionBehavior === "replace";
46
+ let isReplace = state.selectionManager.selectionBehavior === 'replace';
47
47
  let messages = [];
48
48
  if (state.selectionManager.selectedKeys.size === 1 && isReplace) {
49
49
  if (state.collection.getItem(state.selectionManager.selectedKeys.keys().next().value)) {
50
50
  let currentSelectionText = getRowText(state.selectionManager.selectedKeys.keys().next().value);
51
- if (currentSelectionText) messages.push(stringFormatter.format("selectedItem", {
51
+ if (currentSelectionText) messages.push(stringFormatter.format('selectedItem', {
52
52
  item: currentSelectionText
53
53
  }));
54
54
  }
55
55
  } else if (addedKeys.size === 1 && removedKeys.size === 0) {
56
56
  let addedText = getRowText(addedKeys.keys().next().value);
57
- if (addedText) messages.push(stringFormatter.format("selectedItem", {
57
+ if (addedText) messages.push(stringFormatter.format('selectedItem', {
58
58
  item: addedText
59
59
  }));
60
60
  } else if (removedKeys.size === 1 && addedKeys.size === 0) {
61
61
  if (state.collection.getItem(removedKeys.keys().next().value)) {
62
62
  let removedText = getRowText(removedKeys.keys().next().value);
63
- if (removedText) messages.push(stringFormatter.format("deselectedItem", {
63
+ if (removedText) messages.push(stringFormatter.format('deselectedItem', {
64
64
  item: removedText
65
65
  }));
66
66
  }
67
67
  }
68
68
  // Announce how many items are selected, except when selecting the first item.
69
- if (state.selectionManager.selectionMode === "multiple") {
70
- if (messages.length === 0 || selection === "all" || selection.size > 1 || lastSelection.current === "all" || ((_lastSelection_current = lastSelection.current) === null || _lastSelection_current === void 0 ? void 0 : _lastSelection_current.size) > 1) messages.push(selection === "all" ? stringFormatter.format("selectedAll") : stringFormatter.format("selectedCount", {
69
+ if (state.selectionManager.selectionMode === 'multiple') {
70
+ if (messages.length === 0 || selection === 'all' || selection.size > 1 || lastSelection.current === 'all' || ((_lastSelection_current = lastSelection.current) === null || _lastSelection_current === void 0 ? void 0 : _lastSelection_current.size) > 1) messages.push(selection === 'all' ? stringFormatter.format('selectedAll') : stringFormatter.format('selectedCount', {
71
71
  count: selection.size
72
72
  }));
73
73
  }
74
- if (messages.length > 0) (0, $4stjr$announce)(messages.join(" "));
74
+ if (messages.length > 0) (0, $4stjr$announce)(messages.join(' '));
75
75
  lastSelection.current = selection;
76
76
  }, [
77
77
  selection
@@ -79,7 +79,7 @@ function $92599c3fd427b763$export$137e594ef3218a10(props, state) {
79
79
  }
80
80
  function $92599c3fd427b763$var$diffSelection(a, b) {
81
81
  let res = new Set();
82
- if (a === "all" || b === "all") return res;
82
+ if (a === 'all' || b === 'all') return res;
83
83
  for (let key of a.keys())if (!b.has(key)) res.add(key);
84
84
  return res;
85
85
  }
@@ -22,11 +22,11 @@ function $d8385f73d3701365$export$70e2eed1a92976ad(props, state) {
22
22
  let isDisabled = !state.selectionManager.canSelectItem(key);
23
23
  let isSelected = state.selectionManager.isSelected(key);
24
24
  let onChange = ()=>manager.select(key);
25
- const stringFormatter = (0, $kbAeD$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($085250522aa37816$exports))), "@react-aria/grid");
25
+ const stringFormatter = (0, $kbAeD$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($085250522aa37816$exports))), '@react-aria/grid');
26
26
  return {
27
27
  checkboxProps: {
28
28
  id: checkboxId,
29
- "aria-label": stringFormatter.format("select"),
29
+ 'aria-label': stringFormatter.format('select'),
30
30
  isSelected: isSelected,
31
31
  isDisabled: isDisabled,
32
32
  onChange: onChange
@@ -16,11 +16,11 @@ function $7cb39d07f245a780$export$70e2eed1a92976ad(props, state) {
16
16
  let isDisabled = !state.selectionManager.canSelectItem(key);
17
17
  let isSelected = state.selectionManager.isSelected(key);
18
18
  let onChange = ()=>manager.select(key);
19
- const stringFormatter = (0, $fkdHx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($fkdHx$intlStringsmodulejs))), "@react-aria/grid");
19
+ const stringFormatter = (0, $fkdHx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($fkdHx$intlStringsmodulejs))), '@react-aria/grid');
20
20
  return {
21
21
  checkboxProps: {
22
22
  id: checkboxId,
23
- "aria-label": stringFormatter.format("select"),
23
+ 'aria-label': stringFormatter.format('select'),
24
24
  isSelected: isSelected,
25
25
  isDisabled: isDisabled,
26
26
  onChange: onChange
@@ -16,11 +16,11 @@ function $7cb39d07f245a780$export$70e2eed1a92976ad(props, state) {
16
16
  let isDisabled = !state.selectionManager.canSelectItem(key);
17
17
  let isSelected = state.selectionManager.isSelected(key);
18
18
  let onChange = ()=>manager.select(key);
19
- const stringFormatter = (0, $fkdHx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($fkdHx$intlStringsmodulejs))), "@react-aria/grid");
19
+ const stringFormatter = (0, $fkdHx$useLocalizedStringFormatter)((0, ($parcel$interopDefault($fkdHx$intlStringsmodulejs))), '@react-aria/grid');
20
20
  return {
21
21
  checkboxProps: {
22
22
  id: checkboxId,
23
- "aria-label": stringFormatter.format("select"),
23
+ 'aria-label': stringFormatter.format('select'),
24
24
  isSelected: isSelected,
25
25
  isDisabled: isDisabled,
26
26
  onChange: onChange
@@ -30,16 +30,16 @@ $parcel$export(module.exports, "useHighlightSelectionDescription", () => $340f2f
30
30
 
31
31
 
32
32
  function $340f2fcd0ef9ce8d$export$be42ebdab07ae4c2(props) {
33
- let stringFormatter = (0, $98baH$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($085250522aa37816$exports))), "@react-aria/grid");
33
+ let stringFormatter = (0, $98baH$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($085250522aa37816$exports))), '@react-aria/grid');
34
34
  let modality = (0, $98baH$reactariainteractions.useInteractionModality)();
35
35
  // null is the default if the user hasn't interacted with the table at all yet or the rest of the page
36
- let shouldLongPress = (modality === "pointer" || modality === "virtual" || modality == null) && typeof window !== "undefined" && "ontouchstart" in window;
36
+ let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null) && typeof window !== 'undefined' && 'ontouchstart' in window;
37
37
  let interactionDescription = (0, $98baH$react.useMemo)(()=>{
38
38
  let selectionMode = props.selectionManager.selectionMode;
39
39
  let selectionBehavior = props.selectionManager.selectionBehavior;
40
40
  let message = undefined;
41
- if (shouldLongPress) message = stringFormatter.format("longPressToSelect");
42
- return selectionBehavior === "replace" && selectionMode !== "none" && props.hasItemActions ? message : undefined;
41
+ if (shouldLongPress) message = stringFormatter.format('longPressToSelect');
42
+ return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;
43
43
  }, [
44
44
  props.selectionManager.selectionMode,
45
45
  props.selectionManager.selectionBehavior,
@@ -24,16 +24,16 @@ function $parcel$interopDefault(a) {
24
24
 
25
25
 
26
26
  function $5b9b5b5723db6ae1$export$be42ebdab07ae4c2(props) {
27
- let stringFormatter = (0, $kh5JA$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kh5JA$intlStringsmodulejs))), "@react-aria/grid");
27
+ let stringFormatter = (0, $kh5JA$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kh5JA$intlStringsmodulejs))), '@react-aria/grid');
28
28
  let modality = (0, $kh5JA$useInteractionModality)();
29
29
  // null is the default if the user hasn't interacted with the table at all yet or the rest of the page
30
- let shouldLongPress = (modality === "pointer" || modality === "virtual" || modality == null) && typeof window !== "undefined" && "ontouchstart" in window;
30
+ let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null) && typeof window !== 'undefined' && 'ontouchstart' in window;
31
31
  let interactionDescription = (0, $kh5JA$useMemo)(()=>{
32
32
  let selectionMode = props.selectionManager.selectionMode;
33
33
  let selectionBehavior = props.selectionManager.selectionBehavior;
34
34
  let message = undefined;
35
- if (shouldLongPress) message = stringFormatter.format("longPressToSelect");
36
- return selectionBehavior === "replace" && selectionMode !== "none" && props.hasItemActions ? message : undefined;
35
+ if (shouldLongPress) message = stringFormatter.format('longPressToSelect');
36
+ return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;
37
37
  }, [
38
38
  props.selectionManager.selectionMode,
39
39
  props.selectionManager.selectionBehavior,
@@ -24,16 +24,16 @@ function $parcel$interopDefault(a) {
24
24
 
25
25
 
26
26
  function $5b9b5b5723db6ae1$export$be42ebdab07ae4c2(props) {
27
- let stringFormatter = (0, $kh5JA$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kh5JA$intlStringsmodulejs))), "@react-aria/grid");
27
+ let stringFormatter = (0, $kh5JA$useLocalizedStringFormatter)((0, ($parcel$interopDefault($kh5JA$intlStringsmodulejs))), '@react-aria/grid');
28
28
  let modality = (0, $kh5JA$useInteractionModality)();
29
29
  // null is the default if the user hasn't interacted with the table at all yet or the rest of the page
30
- let shouldLongPress = (modality === "pointer" || modality === "virtual" || modality == null) && typeof window !== "undefined" && "ontouchstart" in window;
30
+ let shouldLongPress = (modality === 'pointer' || modality === 'virtual' || modality == null) && typeof window !== 'undefined' && 'ontouchstart' in window;
31
31
  let interactionDescription = (0, $kh5JA$useMemo)(()=>{
32
32
  let selectionMode = props.selectionManager.selectionMode;
33
33
  let selectionBehavior = props.selectionManager.selectionBehavior;
34
34
  let message = undefined;
35
- if (shouldLongPress) message = stringFormatter.format("longPressToSelect");
36
- return selectionBehavior === "replace" && selectionMode !== "none" && props.hasItemActions ? message : undefined;
35
+ if (shouldLongPress) message = stringFormatter.format('longPressToSelect');
36
+ return selectionBehavior === 'replace' && selectionMode !== 'none' && props.hasItemActions ? message : undefined;
37
37
  }, [
38
38
  props.selectionManager.selectionMode,
39
39
  props.selectionManager.selectionBehavior,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/grid",
3
- "version": "3.9.1-nightly.4624+d80999e89",
3
+ "version": "3.9.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -22,19 +22,19 @@
22
22
  "url": "https://github.com/adobe/react-spectrum"
23
23
  },
24
24
  "dependencies": {
25
- "@react-aria/focus": "3.0.0-nightly.2912+d80999e89",
26
- "@react-aria/i18n": "3.0.0-nightly.2912+d80999e89",
27
- "@react-aria/interactions": "3.0.0-nightly.2912+d80999e89",
28
- "@react-aria/live-announcer": "3.0.0-nightly.2912+d80999e89",
29
- "@react-aria/selection": "3.0.0-nightly.2912+d80999e89",
30
- "@react-aria/utils": "3.0.0-nightly.2912+d80999e89",
31
- "@react-stately/collections": "3.0.0-nightly.2912+d80999e89",
32
- "@react-stately/grid": "3.8.7-nightly.4624+d80999e89",
33
- "@react-stately/selection": "3.0.0-nightly.2912+d80999e89",
34
- "@react-stately/virtualizer": "3.7.1-nightly.4624+d80999e89",
35
- "@react-types/checkbox": "3.0.0-nightly.2912+d80999e89",
36
- "@react-types/grid": "3.2.6-nightly.4624+d80999e89",
37
- "@react-types/shared": "3.0.0-nightly.2912+d80999e89",
25
+ "@react-aria/focus": "^3.17.1",
26
+ "@react-aria/i18n": "^3.11.1",
27
+ "@react-aria/interactions": "^3.21.3",
28
+ "@react-aria/live-announcer": "^3.3.4",
29
+ "@react-aria/selection": "^3.18.1",
30
+ "@react-aria/utils": "^3.24.1",
31
+ "@react-stately/collections": "^3.10.7",
32
+ "@react-stately/grid": "^3.8.7",
33
+ "@react-stately/selection": "^3.15.1",
34
+ "@react-stately/virtualizer": "^3.7.1",
35
+ "@react-types/checkbox": "^3.8.1",
36
+ "@react-types/grid": "^3.2.6",
37
+ "@react-types/shared": "^3.23.1",
38
38
  "@swc/helpers": "^0.5.0"
39
39
  },
40
40
  "peerDependencies": {
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "d80999e897b4d4db9fcfb4e9b8fcdc9fdd700882"
47
+ "gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
48
48
  }