@atlaskit/react-select 4.0.0 → 4.0.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/react-select
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0f8f79a02f3d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0f8f79a02f3d5) -
|
|
8
|
+
Fix `MultiValueContainer` component override being silently ignored when the
|
|
9
|
+
`platform-dst-lozenge-tag-badge-visual-uplifts` feature gate is enabled.
|
|
10
|
+
|
|
11
|
+
When the gate is on, `MultiValue` previously bypassed the `Container` (i.e. `MultiValueContainer`)
|
|
12
|
+
component entirely and rendered a `<Tag>` or tag-like `<div>` directly, causing consumers who use
|
|
13
|
+
`MultiValueContainer: () => null` to suppress selected tag display to see broken dropdown
|
|
14
|
+
positioning.
|
|
15
|
+
|
|
16
|
+
The fix detects when `Container` has been overridden and falls back to the default
|
|
17
|
+
`Container`-based render path, restoring the expected suppression behaviour.
|
|
18
|
+
|
|
3
19
|
## 4.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -17,6 +17,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
17
17
|
var _tag = _interopRequireDefault(require("@atlaskit/tag"));
|
|
18
18
|
var _getStyleProps4 = require("../get-style-props");
|
|
19
19
|
var _useSelectGetStyles = require("../internal/use-select-get-styles");
|
|
20
|
+
var _multiValueContainer = require("./containers/multi-value-container");
|
|
20
21
|
var _multiValueLabel = require("./multi-value-label");
|
|
21
22
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
22
23
|
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; }
|
|
@@ -92,6 +93,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
92
93
|
removeCss = _getStyleProps3.css,
|
|
93
94
|
removeClassName = _getStyleProps3.className;
|
|
94
95
|
var hasCustomLabel = Label !== _multiValueLabel.MultiValueLabel;
|
|
96
|
+
var hasCustomContainer = Container !== _multiValueContainer.MultiValueContainer;
|
|
95
97
|
var selectStyles = selectProps.styles;
|
|
96
98
|
var hasCustomMultiValueStyles = Boolean((selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValue) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueLabel) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueRemove));
|
|
97
99
|
var selectClassNames = selectProps.classNames;
|
|
@@ -103,7 +105,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
103
105
|
var selectGetStyles = (0, _useSelectGetStyles.useSelectGetStyles)();
|
|
104
106
|
var hasOverriddenGetStyles = selectGetStyles !== undefined && props.getStyles !== selectGetStyles;
|
|
105
107
|
var hasCustomContainerStyles = hasCustomMultiValueStyles || hasCustomMultiValueClassNames || hasOverriddenGetStyles;
|
|
106
|
-
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainerStyles) {
|
|
108
|
+
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainer && !hasCustomContainerStyles) {
|
|
107
109
|
var _ref = data !== null && data !== void 0 ? data : {},
|
|
108
110
|
elemBefore = _ref.elemBefore,
|
|
109
111
|
tagColor = _ref.color;
|
|
@@ -126,7 +128,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
126
128
|
}
|
|
127
129
|
|
|
128
130
|
// FF on + custom content → tag-like path
|
|
129
|
-
if (ffTagUplifts) {
|
|
131
|
+
if (ffTagUplifts && !hasCustomContainer) {
|
|
130
132
|
var colorKey = data === null || data === void 0 ? void 0 : data.color;
|
|
131
133
|
return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
|
|
132
134
|
"data-multi-value-tag-like": "true"
|
|
@@ -8,6 +8,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import Tag from '@atlaskit/tag';
|
|
9
9
|
import { getStyleProps } from '../get-style-props';
|
|
10
10
|
import { useSelectGetStyles } from '../internal/use-select-get-styles';
|
|
11
|
+
import { MultiValueContainer as DefaultMultiValueContainer } from './containers/multi-value-container';
|
|
11
12
|
import { MultiValueLabel } from './multi-value-label';
|
|
12
13
|
const multiValueTagWrapperStyles = {
|
|
13
14
|
root: "_16jlidpf _1o9zkb7n _i0dl1wug _1mouze3t _195gze3t _4cvr1h6o _1e0c1txw _1ul9ze3t _zdxokb7n _v5ynkb7n _13lsf1ug _3pxh1h6o _d0dz1txw _1ouwze3t"
|
|
@@ -87,6 +88,7 @@ const MultiValue = props => {
|
|
|
87
88
|
'multi-value__remove': true
|
|
88
89
|
});
|
|
89
90
|
const hasCustomLabel = Label !== MultiValueLabel;
|
|
91
|
+
const hasCustomContainer = Container !== DefaultMultiValueContainer;
|
|
90
92
|
const selectStyles = selectProps.styles;
|
|
91
93
|
const hasCustomMultiValueStyles = Boolean((selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValue) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueLabel) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueRemove));
|
|
92
94
|
const selectClassNames = selectProps.classNames;
|
|
@@ -98,7 +100,7 @@ const MultiValue = props => {
|
|
|
98
100
|
const selectGetStyles = useSelectGetStyles();
|
|
99
101
|
const hasOverriddenGetStyles = selectGetStyles !== undefined && props.getStyles !== selectGetStyles;
|
|
100
102
|
const hasCustomContainerStyles = hasCustomMultiValueStyles || hasCustomMultiValueClassNames || hasOverriddenGetStyles;
|
|
101
|
-
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainerStyles) {
|
|
103
|
+
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainer && !hasCustomContainerStyles) {
|
|
102
104
|
const {
|
|
103
105
|
elemBefore,
|
|
104
106
|
color: tagColor
|
|
@@ -122,7 +124,7 @@ const MultiValue = props => {
|
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
// FF on + custom content → tag-like path
|
|
125
|
-
if (ffTagUplifts) {
|
|
127
|
+
if (ffTagUplifts && !hasCustomContainer) {
|
|
126
128
|
const colorKey = data === null || data === void 0 ? void 0 : data.color;
|
|
127
129
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
128
130
|
"data-multi-value-tag-like": "true"
|
|
@@ -11,6 +11,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
11
11
|
import Tag from '@atlaskit/tag';
|
|
12
12
|
import { getStyleProps } from '../get-style-props';
|
|
13
13
|
import { useSelectGetStyles } from '../internal/use-select-get-styles';
|
|
14
|
+
import { MultiValueContainer as DefaultMultiValueContainer } from './containers/multi-value-container';
|
|
14
15
|
import { MultiValueLabel } from './multi-value-label';
|
|
15
16
|
var multiValueTagWrapperStyles = {
|
|
16
17
|
root: "_16jlidpf _1o9zkb7n _i0dl1wug _1mouze3t _195gze3t _4cvr1h6o _1e0c1txw _1ul9ze3t _zdxokb7n _v5ynkb7n _13lsf1ug _3pxh1h6o _d0dz1txw _1ouwze3t"
|
|
@@ -83,6 +84,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
83
84
|
removeCss = _getStyleProps3.css,
|
|
84
85
|
removeClassName = _getStyleProps3.className;
|
|
85
86
|
var hasCustomLabel = Label !== MultiValueLabel;
|
|
87
|
+
var hasCustomContainer = Container !== DefaultMultiValueContainer;
|
|
86
88
|
var selectStyles = selectProps.styles;
|
|
87
89
|
var hasCustomMultiValueStyles = Boolean((selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValue) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueLabel) || (selectStyles === null || selectStyles === void 0 ? void 0 : selectStyles.multiValueRemove));
|
|
88
90
|
var selectClassNames = selectProps.classNames;
|
|
@@ -94,7 +96,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
94
96
|
var selectGetStyles = useSelectGetStyles();
|
|
95
97
|
var hasOverriddenGetStyles = selectGetStyles !== undefined && props.getStyles !== selectGetStyles;
|
|
96
98
|
var hasCustomContainerStyles = hasCustomMultiValueStyles || hasCustomMultiValueClassNames || hasOverriddenGetStyles;
|
|
97
|
-
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainerStyles) {
|
|
99
|
+
if (ffTagUplifts && isPlainLabel && !hasCustomLabel && !hasCustomContainer && !hasCustomContainerStyles) {
|
|
98
100
|
var _ref = data !== null && data !== void 0 ? data : {},
|
|
99
101
|
elemBefore = _ref.elemBefore,
|
|
100
102
|
tagColor = _ref.color;
|
|
@@ -117,7 +119,7 @@ var MultiValue = function MultiValue(props) {
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
// FF on + custom content → tag-like path
|
|
120
|
-
if (ffTagUplifts) {
|
|
122
|
+
if (ffTagUplifts && !hasCustomContainer) {
|
|
121
123
|
var colorKey = data === null || data === void 0 ? void 0 : data.color;
|
|
122
124
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
123
125
|
"data-multi-value-tag-like": "true"
|