@carbon/ibm-products 2.43.2-canary.78 → 2.43.2-canary.80
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/css/index-full-carbon.css +241 -56
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +3 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +61 -18
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +162 -42
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionBar/ActionBarItem.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +33 -1
- package/es/components/StringFormatter/StringFormatter.js +14 -3
- package/es/components/StringFormatter/utils/enums.d.ts +20 -1
- package/es/components/StringFormatter/utils/enums.js +22 -2
- package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
- package/lib/components/ActionBar/ActionBarItem.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +32 -0
- package/lib/components/StringFormatter/StringFormatter.js +13 -2
- package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
- package/lib/components/StringFormatter/utils/enums.js +23 -1
- package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
- package/package.json +4 -4
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
@@ -43,7 +43,7 @@ exports.ActionBarItem = /*#__PURE__*/React__default["default"].forwardRef(functi
|
|
43
43
|
className: cx__default["default"](blockClass, className),
|
44
44
|
kind: 'ghost',
|
45
45
|
size: 'md',
|
46
|
-
align: 'bottom-
|
46
|
+
align: 'bottom-end',
|
47
47
|
type: 'button',
|
48
48
|
label: label
|
49
49
|
}), Icon ? /*#__PURE__*/React__default["default"].createElement(Icon, null) : null);
|
@@ -17,6 +17,7 @@ var OverflowCheckboxes = require('../OverflowCheckboxes.js');
|
|
17
17
|
var utils = require('../utils.js');
|
18
18
|
var FilterProvider = require('../FilterProvider.js');
|
19
19
|
var handleCheckboxChange = require('../handleCheckboxChange.js');
|
20
|
+
var uuidv4 = require('../../../../../../global/js/utils/uuidv4.js');
|
20
21
|
var usePreviousValue = require('../../../../../../global/js/hooks/usePreviousValue.js');
|
21
22
|
|
22
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -55,6 +56,7 @@ var useFilters = function useFilters(_ref) {
|
|
55
56
|
var previousState = usePreviousValue.usePreviousValue({
|
56
57
|
panelOpen: panelOpen
|
57
58
|
});
|
59
|
+
var filteredItemsRef = React.useRef();
|
58
60
|
|
59
61
|
// When using batch actions we have to store the filters to then apply them later
|
60
62
|
var prevFiltersRef = React.useRef(JSON.stringify(filtersState));
|
@@ -315,8 +317,18 @@ var useFilters = function useFilters(_ref) {
|
|
315
317
|
}
|
316
318
|
return null;
|
317
319
|
}).filter(Boolean);
|
320
|
+
var isEqual = compareFilterItems(filteredItems);
|
321
|
+
if (!isEqual) {
|
322
|
+
filteredItemsRef.current = _rollupPluginBabelHelpers.toConsumableArray(filteredItems);
|
323
|
+
}
|
324
|
+
var getKey = function getKey() {
|
325
|
+
return isEqual ? {
|
326
|
+
key: uuidv4["default"]()
|
327
|
+
} : column;
|
328
|
+
};
|
318
329
|
filter = /*#__PURE__*/React__default["default"].createElement(react.MultiSelect, _rollupPluginBabelHelpers["extends"]({}, components.MultiSelect, {
|
319
330
|
selectedItems: filteredItems,
|
331
|
+
key: getKey(),
|
320
332
|
onChange: function onChange(_ref9) {
|
321
333
|
var _components$MultiSele, _components$MultiSele2;
|
322
334
|
var selectedItems = _ref9.selectedItems;
|
@@ -332,6 +344,7 @@ var useFilters = function useFilters(_ref) {
|
|
332
344
|
}
|
333
345
|
return null;
|
334
346
|
}).filter(Boolean);
|
347
|
+
filteredItemsRef.current = _rollupPluginBabelHelpers.toConsumableArray(foundItems);
|
335
348
|
|
336
349
|
// Change selected state for those items that have been selected
|
337
350
|
allOptions.map(function (a) {
|
@@ -374,6 +387,25 @@ var useFilters = function useFilters(_ref) {
|
|
374
387
|
key: column
|
375
388
|
}, filter);
|
376
389
|
};
|
390
|
+
var compareFilterItems = function compareFilterItems(filteredItems) {
|
391
|
+
var _filteredItems$map, _filteredItemsRef$cur, _filteredItemsRef$cur2;
|
392
|
+
var filteredItemsId = (_filteredItems$map = filteredItems.map(function (item) {
|
393
|
+
return item.id;
|
394
|
+
})) !== null && _filteredItems$map !== void 0 ? _filteredItems$map : [];
|
395
|
+
var previousFilteredItemsId = (_filteredItemsRef$cur = filteredItemsRef === null || filteredItemsRef === void 0 || (_filteredItemsRef$cur2 = filteredItemsRef.current) === null || _filteredItemsRef$cur2 === void 0 ? void 0 : _filteredItemsRef$cur2.map(function (item) {
|
396
|
+
return item.id;
|
397
|
+
})) !== null && _filteredItemsRef$cur !== void 0 ? _filteredItemsRef$cur : [];
|
398
|
+
var set1 = new Set(filteredItemsId);
|
399
|
+
var set2 = new Set(previousFilteredItemsId);
|
400
|
+
// Check if the sets have the same size (same number of unique elements)
|
401
|
+
if (set1.size !== set2.size) {
|
402
|
+
return false;
|
403
|
+
}
|
404
|
+
// Check if all elements in set1 are also present in set2 (using spread syntax)
|
405
|
+
return _rollupPluginBabelHelpers.toConsumableArray(set1).every(function (element) {
|
406
|
+
return set2.has(element);
|
407
|
+
});
|
408
|
+
};
|
377
409
|
|
378
410
|
/** This useEffect will properly handle the previous filters when the panel closes
|
379
411
|
* 1. If the panel closes we need to call the reset fn but also store the
|
@@ -17,6 +17,7 @@ var devtools = require('../../global/js/utils/devtools.js');
|
|
17
17
|
var settings = require('../../settings.js');
|
18
18
|
var react = require('@carbon/react');
|
19
19
|
var enums = require('./utils/enums.js');
|
20
|
+
var propsHelper = require('../../global/js/utils/props-helper.js');
|
20
21
|
|
21
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
22
23
|
|
@@ -28,7 +29,7 @@ var blockClass = "".concat(settings.pkg.prefix, "--string-formatter");
|
|
28
29
|
var componentName = 'StringFormatter';
|
29
30
|
var defaults = {
|
30
31
|
lines: 1,
|
31
|
-
tooltipDirection: enums.StringFormatterAlignment.
|
32
|
+
tooltipDirection: enums.StringFormatterAlignment.BOTTOM_START,
|
32
33
|
truncate: false,
|
33
34
|
width: null
|
34
35
|
};
|
@@ -68,6 +69,16 @@ exports.StringFormatter = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
68
69
|
});
|
69
70
|
exports.StringFormatter = settings.pkg.checkComponentEnabled(exports.StringFormatter, componentName);
|
70
71
|
exports.StringFormatter.displayName = componentName;
|
72
|
+
exports.StringFormatter.validateAlignment = function () {
|
73
|
+
return function (props, propName, componentName) {
|
74
|
+
var prop = props[propName];
|
75
|
+
var deprecatedAlignValues = Object.values(enums.deprecated_StringFormatterAlignment);
|
76
|
+
if (deprecatedAlignValues.includes(prop)) {
|
77
|
+
var mappedNewProp = enums.propMappingFunction(prop);
|
78
|
+
console.warn("\"".concat(prop, "\" is a deprecated value for the \"").concat(propName, "\" prop on the \"").concat(componentName, "\" component. Use \"").concat(mappedNewProp, "\" instead. Allowable values are: ").concat(Object.values(enums.StringFormatterAlignment).join(', '), "."));
|
79
|
+
}
|
80
|
+
};
|
81
|
+
};
|
71
82
|
exports.StringFormatter.propTypes = {
|
72
83
|
/**
|
73
84
|
* Provide an optional class to be applied to the containing node.
|
@@ -76,7 +87,7 @@ exports.StringFormatter.propTypes = {
|
|
76
87
|
/** Number of lines to clamp value. */
|
77
88
|
lines: index["default"].number,
|
78
89
|
/** Specify the direction of the tooltip. Can be either top or bottom. */
|
79
|
-
tooltipDirection: index["default"].oneOf(Object.values(enums.StringFormatterAlignment)),
|
90
|
+
tooltipDirection: propsHelper.allPropTypes([exports.StringFormatter.validateAlignment(), index["default"].oneOf(Object.values(enums.deprecated_StringFormatterAlignment), Object.values(enums.StringFormatterAlignment))]),
|
80
91
|
/** Whether or not the value should be truncated. */
|
81
92
|
truncate: index["default"].bool,
|
82
93
|
/** Value to format. */
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export namespace
|
1
|
+
export namespace deprecated_StringFormatterAlignment {
|
2
2
|
let TOP: string;
|
3
3
|
let TOP_LEFT: string;
|
4
4
|
let TOP_RIGHT: string;
|
@@ -12,3 +12,22 @@ export namespace StringFormatterAlignment {
|
|
12
12
|
let RIGHT_BOTTOM: string;
|
13
13
|
let RIGHT_TOP: string;
|
14
14
|
}
|
15
|
+
export namespace StringFormatterAlignment {
|
16
|
+
let TOP_1: string;
|
17
|
+
export { TOP_1 as TOP };
|
18
|
+
export let TOP_START: string;
|
19
|
+
export let TOP_END: string;
|
20
|
+
let BOTTOM_1: string;
|
21
|
+
export { BOTTOM_1 as BOTTOM };
|
22
|
+
export let BOTTOM_START: string;
|
23
|
+
export let BOTTOM_END: string;
|
24
|
+
let LEFT_1: string;
|
25
|
+
export { LEFT_1 as LEFT };
|
26
|
+
export let LEFT_END: string;
|
27
|
+
export let LEFT_START: string;
|
28
|
+
let RIGHT_1: string;
|
29
|
+
export { RIGHT_1 as RIGHT };
|
30
|
+
export let RIGHT_END: string;
|
31
|
+
export let RIGHT_START: string;
|
32
|
+
}
|
33
|
+
export function propMappingFunction(deprecatedValue: any): string;
|
@@ -9,7 +9,9 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
-
var
|
12
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
|
+
|
14
|
+
var deprecated_StringFormatterAlignment = {
|
13
15
|
TOP: 'top',
|
14
16
|
TOP_LEFT: 'top-left',
|
15
17
|
TOP_RIGHT: 'top-right',
|
@@ -23,5 +25,25 @@ var StringFormatterAlignment = {
|
|
23
25
|
RIGHT_BOTTOM: 'right-bottom',
|
24
26
|
RIGHT_TOP: 'right-top'
|
25
27
|
};
|
28
|
+
var StringFormatterAlignment = {
|
29
|
+
TOP: 'top',
|
30
|
+
TOP_START: 'top-start',
|
31
|
+
TOP_END: 'top-end',
|
32
|
+
BOTTOM: 'bottom',
|
33
|
+
BOTTOM_START: 'bottom-start',
|
34
|
+
BOTTOM_END: 'bottom-end',
|
35
|
+
LEFT: 'left',
|
36
|
+
LEFT_END: 'left-end',
|
37
|
+
LEFT_START: 'left-start',
|
38
|
+
RIGHT: 'right',
|
39
|
+
RIGHT_END: 'right-end',
|
40
|
+
RIGHT_START: 'right-start'
|
41
|
+
};
|
42
|
+
var propMappingFunction = function propMappingFunction(deprecatedValue) {
|
43
|
+
var mapping = _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, deprecated_StringFormatterAlignment.TOP_LEFT, StringFormatterAlignment.TOP_START), deprecated_StringFormatterAlignment.TOP_RIGHT, StringFormatterAlignment.TOP_END), deprecated_StringFormatterAlignment.BOTTOM_LEFT, StringFormatterAlignment.BOTTOM_START), deprecated_StringFormatterAlignment.BOTTOM_RIGHT, StringFormatterAlignment.BOTTOM_END), deprecated_StringFormatterAlignment.LEFT_BOTTOM, StringFormatterAlignment.LEFT_END), deprecated_StringFormatterAlignment.LEFT_TOP, StringFormatterAlignment.LEFT_START), deprecated_StringFormatterAlignment.RIGHT_BOTTOM, StringFormatterAlignment.RIGHT_END), deprecated_StringFormatterAlignment.RIGHT_START, StringFormatterAlignment.RIGHT_START);
|
44
|
+
return mapping[deprecatedValue];
|
45
|
+
};
|
26
46
|
|
27
47
|
exports.StringFormatterAlignment = StringFormatterAlignment;
|
48
|
+
exports.deprecated_StringFormatterAlignment = deprecated_StringFormatterAlignment;
|
49
|
+
exports.propMappingFunction = propMappingFunction;
|
@@ -11,81 +11,68 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
|
14
|
-
function
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
return keys;
|
14
|
+
function _defineProperty(e, r, t) {
|
15
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
16
|
+
value: t,
|
17
|
+
enumerable: !0,
|
18
|
+
configurable: !0,
|
19
|
+
writable: !0
|
20
|
+
}) : e[r] = t, e;
|
23
21
|
}
|
24
|
-
function
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
});
|
22
|
+
function ownKeys(e, r) {
|
23
|
+
var t = Object.keys(e);
|
24
|
+
if (Object.getOwnPropertySymbols) {
|
25
|
+
var o = Object.getOwnPropertySymbols(e);
|
26
|
+
r && (o = o.filter(function (r) {
|
27
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
28
|
+
})), t.push.apply(t, o);
|
32
29
|
}
|
33
|
-
return
|
30
|
+
return t;
|
34
31
|
}
|
35
|
-
function
|
36
|
-
|
37
|
-
|
38
|
-
Object
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
writable: true
|
32
|
+
function _objectSpread2(e) {
|
33
|
+
for (var r = 1; r < arguments.length; r++) {
|
34
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
35
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
36
|
+
_defineProperty(e, r, t[r]);
|
37
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
38
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
43
39
|
});
|
44
|
-
} else {
|
45
|
-
obj[key] = value;
|
46
40
|
}
|
47
|
-
return
|
41
|
+
return e;
|
48
42
|
}
|
49
|
-
function
|
50
|
-
if (
|
51
|
-
var
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
target[key] = source[key];
|
43
|
+
function _objectWithoutProperties(e, t) {
|
44
|
+
if (null == e) return {};
|
45
|
+
var o,
|
46
|
+
r,
|
47
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
48
|
+
if (Object.getOwnPropertySymbols) {
|
49
|
+
var n = Object.getOwnPropertySymbols(e);
|
50
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
58
51
|
}
|
59
|
-
return
|
52
|
+
return i;
|
60
53
|
}
|
61
|
-
function
|
62
|
-
if (
|
63
|
-
var
|
64
|
-
var
|
65
|
-
|
66
|
-
|
67
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
68
|
-
key = sourceSymbolKeys[i];
|
69
|
-
if (excluded.indexOf(key) >= 0) continue;
|
70
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
71
|
-
target[key] = source[key];
|
72
|
-
}
|
54
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
55
|
+
if (null == r) return {};
|
56
|
+
var t = {};
|
57
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
58
|
+
if (e.indexOf(n) >= 0) continue;
|
59
|
+
t[n] = r[n];
|
73
60
|
}
|
74
|
-
return
|
61
|
+
return t;
|
75
62
|
}
|
76
|
-
function _toPrimitive(
|
77
|
-
if (_rollupPluginBabelHelpers["typeof"](
|
78
|
-
var
|
79
|
-
if (
|
80
|
-
var
|
81
|
-
if (_rollupPluginBabelHelpers["typeof"](
|
63
|
+
function _toPrimitive(t, r) {
|
64
|
+
if ("object" != _rollupPluginBabelHelpers["typeof"](t) || !t) return t;
|
65
|
+
var e = t[Symbol.toPrimitive];
|
66
|
+
if (void 0 !== e) {
|
67
|
+
var i = e.call(t, r || "default");
|
68
|
+
if ("object" != _rollupPluginBabelHelpers["typeof"](i)) return i;
|
82
69
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
83
70
|
}
|
84
|
-
return (
|
71
|
+
return ("string" === r ? String : Number)(t);
|
85
72
|
}
|
86
|
-
function _toPropertyKey(
|
87
|
-
var
|
88
|
-
return _rollupPluginBabelHelpers["typeof"](
|
73
|
+
function _toPropertyKey(t) {
|
74
|
+
var i = _toPrimitive(t, "string");
|
75
|
+
return "symbol" == _rollupPluginBabelHelpers["typeof"](i) ? i : i + "";
|
89
76
|
}
|
90
77
|
var _excluded = ["width", "height", "viewBox"],
|
91
78
|
_excluded2 = ["tabindex"];
|