@atlaskit/dropdown-menu 16.1.4 → 16.2.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 16.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#187681](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/187681)
|
|
8
|
+
[`64c917433bf89`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64c917433bf89) -
|
|
9
|
+
Cleans up `platform_dst_dropdown_radio_default_selected_fix` feature gate. Default selected items
|
|
10
|
+
for radio group dropdowns are now correctly persisted.
|
|
11
|
+
|
|
3
12
|
## 16.1.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -8,10 +8,8 @@ exports.default = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _dropdownItemRadioGroup = require("../../radio/dropdown-item-radio-group");
|
|
13
12
|
var _selectionStore = require("../context/selection-store");
|
|
14
|
-
var _resetOptionsInGroup = _interopRequireDefault(require("../utils/reset-options-in-group"));
|
|
15
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
15
|
function useRadioState(_ref) {
|
|
@@ -63,9 +61,7 @@ function useRadioState(_ref) {
|
|
|
63
61
|
*/
|
|
64
62
|
if (persistedIsSelected === undefined) {
|
|
65
63
|
var existing = getGroupState(group);
|
|
66
|
-
var newGroupState = (0,
|
|
67
|
-
_objectSpread(_objectSpread({}, existing), {}, (0, _defineProperty2.default)({}, id, defaultSelected || false)) : // FF off: everything else also gets set to false
|
|
68
|
-
_objectSpread(_objectSpread({}, (0, _resetOptionsInGroup.default)(existing || {})), {}, (0, _defineProperty2.default)({}, id, defaultSelected || false));
|
|
64
|
+
var newGroupState = _objectSpread(_objectSpread({}, existing), {}, (0, _defineProperty2.default)({}, id, defaultSelected || false));
|
|
69
65
|
setGroupState(group, newGroupState);
|
|
70
66
|
}
|
|
71
67
|
return [localIsSelected, setLocalState];
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { RadioGroupContext } from '../../radio/dropdown-item-radio-group';
|
|
4
3
|
import { SelectionStoreContext } from '../context/selection-store';
|
|
5
|
-
import resetOptionsInGroup from '../utils/reset-options-in-group';
|
|
6
4
|
function useRadioState({
|
|
7
5
|
id,
|
|
8
6
|
isSelected,
|
|
@@ -48,16 +46,9 @@ function useRadioState({
|
|
|
48
46
|
*/
|
|
49
47
|
if (persistedIsSelected === undefined) {
|
|
50
48
|
const existing = getGroupState(group);
|
|
51
|
-
const newGroupState =
|
|
52
|
-
// FF on: only the current is changed
|
|
53
|
-
{
|
|
49
|
+
const newGroupState = {
|
|
54
50
|
...existing,
|
|
55
51
|
[id]: defaultSelected || false
|
|
56
|
-
} :
|
|
57
|
-
// FF off: everything else also gets set to false
|
|
58
|
-
{
|
|
59
|
-
...resetOptionsInGroup(existing || {}),
|
|
60
|
-
[id]: defaultSelected || false
|
|
61
52
|
};
|
|
62
53
|
setGroupState(group, newGroupState);
|
|
63
54
|
}
|
|
@@ -3,10 +3,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { RadioGroupContext } from '../../radio/dropdown-item-radio-group';
|
|
8
7
|
import { SelectionStoreContext } from '../context/selection-store';
|
|
9
|
-
import resetOptionsInGroup from '../utils/reset-options-in-group';
|
|
10
8
|
function useRadioState(_ref) {
|
|
11
9
|
var id = _ref.id,
|
|
12
10
|
isSelected = _ref.isSelected,
|
|
@@ -56,9 +54,7 @@ function useRadioState(_ref) {
|
|
|
56
54
|
*/
|
|
57
55
|
if (persistedIsSelected === undefined) {
|
|
58
56
|
var existing = getGroupState(group);
|
|
59
|
-
var newGroupState =
|
|
60
|
-
_objectSpread(_objectSpread({}, existing), {}, _defineProperty({}, id, defaultSelected || false)) : // FF off: everything else also gets set to false
|
|
61
|
-
_objectSpread(_objectSpread({}, resetOptionsInGroup(existing || {})), {}, _defineProperty({}, id, defaultSelected || false));
|
|
57
|
+
var newGroupState = _objectSpread(_objectSpread({}, existing), {}, _defineProperty({}, id, defaultSelected || false));
|
|
62
58
|
setGroupState(group, newGroupState);
|
|
63
59
|
}
|
|
64
60
|
return [localIsSelected, setLocalState];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.2.0",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/button": "^23.2.0",
|
|
28
28
|
"@atlaskit/css": "^0.12.0",
|
|
29
|
-
"@atlaskit/ds-lib": "^4.
|
|
29
|
+
"@atlaskit/ds-lib": "^4.1.0",
|
|
30
30
|
"@atlaskit/icon": "^27.3.0",
|
|
31
31
|
"@atlaskit/layering": "^3.0.0",
|
|
32
32
|
"@atlaskit/menu": "^8.0.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/primitives": "^14.10.0",
|
|
36
36
|
"@atlaskit/spinner": "^18.0.0",
|
|
37
37
|
"@atlaskit/theme": "^19.0.0",
|
|
38
|
-
"@atlaskit/tokens": "^5.
|
|
38
|
+
"@atlaskit/tokens": "^5.5.0",
|
|
39
39
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"bind-event-listener": "^3.0.0"
|
|
@@ -91,9 +91,6 @@
|
|
|
91
91
|
},
|
|
92
92
|
"platform_design_system_team_dropdown_return_focus": {
|
|
93
93
|
"type": "boolean"
|
|
94
|
-
},
|
|
95
|
-
"platform_dst_dropdown_radio_default_selected_fix": {
|
|
96
|
-
"type": "boolean"
|
|
97
94
|
}
|
|
98
95
|
},
|
|
99
96
|
"techstack": {
|