@commercetools-uikit/data-table-manager 20.2.3 → 20.3.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/column-settings-manager/dist/commercetools-uikit-data-table-manager-column-settings-manager.cjs.dev.js +2 -2
- package/column-settings-manager/dist/commercetools-uikit-data-table-manager-column-settings-manager.cjs.prod.js +2 -2
- package/column-settings-manager/dist/commercetools-uikit-data-table-manager-column-settings-manager.esm.js +2 -2
- package/dist/{column-settings-manager-cb1d164e.cjs.dev.js → column-settings-manager-07b065fc.cjs.dev.js} +56 -37
- package/dist/{column-settings-manager-58769e7c.cjs.prod.js → column-settings-manager-8ec9b25f.cjs.prod.js} +56 -37
- package/dist/{column-settings-manager-144dfa13.esm.js → column-settings-manager-b4e2fd60.esm.js} +55 -36
- package/dist/commercetools-uikit-data-table-manager.cjs.dev.js +92 -63
- package/dist/commercetools-uikit-data-table-manager.cjs.prod.js +91 -62
- package/dist/commercetools-uikit-data-table-manager.esm.js +93 -63
- package/package.json +27 -27
|
@@ -20,7 +20,6 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
20
20
|
var _styled = require('@emotion/styled/base');
|
|
21
21
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
22
22
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
23
|
-
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
24
23
|
var utils = require('@commercetools-uikit/utils');
|
|
25
24
|
var reactIntl = require('react-intl');
|
|
26
25
|
var icons = require('@commercetools-uikit/icons');
|
|
@@ -33,7 +32,7 @@ var Grid = require('@commercetools-uikit/grid');
|
|
|
33
32
|
var RadioInput = require('@commercetools-uikit/radio-input');
|
|
34
33
|
var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
|
|
35
34
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
36
|
-
var columnSettingsManager = require('./column-settings-manager-
|
|
35
|
+
var columnSettingsManager = require('./column-settings-manager-07b065fc.cjs.dev.js');
|
|
37
36
|
var hooks = require('@commercetools-uikit/hooks');
|
|
38
37
|
var dataTableManagerProvider = require('./data-table-manager-provider-fc238633.cjs.dev.js');
|
|
39
38
|
require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
@@ -47,6 +46,7 @@ require('@commercetools-uikit/accessible-button');
|
|
|
47
46
|
require('@commercetools-uikit/collapsible-motion');
|
|
48
47
|
require('@commercetools-uikit/card');
|
|
49
48
|
require('@commercetools-uikit/text');
|
|
49
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
50
50
|
require('@commercetools-uikit/tag');
|
|
51
51
|
|
|
52
52
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -64,7 +64,6 @@ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
|
64
64
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
65
65
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
66
66
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
67
|
-
var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
|
|
68
67
|
var DropdownMenu__default = /*#__PURE__*/_interopDefault(DropdownMenu);
|
|
69
68
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
70
69
|
var Tooltip__default = /*#__PURE__*/_interopDefault(Tooltip);
|
|
@@ -85,44 +84,60 @@ const DISPLAY_SETTINGS = 'displaySettings';
|
|
|
85
84
|
|
|
86
85
|
var messages$2 = reactIntl.defineMessages({
|
|
87
86
|
title: {
|
|
88
|
-
id:
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
id: "UIKit.DataTableManager.DensityManager.title",
|
|
88
|
+
defaultMessage: [{
|
|
89
|
+
"type": 0,
|
|
90
|
+
"value": "Display settings"
|
|
91
|
+
}]
|
|
91
92
|
},
|
|
92
93
|
textWrappingSubtitle: {
|
|
93
|
-
id:
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingSubtitle",
|
|
95
|
+
defaultMessage: [{
|
|
96
|
+
"type": 0,
|
|
97
|
+
"value": "Text wrapping"
|
|
98
|
+
}]
|
|
96
99
|
},
|
|
97
100
|
densityDisplaySubtitle: {
|
|
98
|
-
id:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplaySubtitle",
|
|
102
|
+
defaultMessage: [{
|
|
103
|
+
"type": 0,
|
|
104
|
+
"value": "Density display"
|
|
105
|
+
}]
|
|
101
106
|
},
|
|
102
107
|
textWrappingAllWrapVisibleOption: {
|
|
103
|
-
id:
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingAllWrapVisibleOption",
|
|
109
|
+
defaultMessage: [{
|
|
110
|
+
"type": 0,
|
|
111
|
+
"value": "Make all wrapped texts visible"
|
|
112
|
+
}]
|
|
106
113
|
},
|
|
107
114
|
textWrappingShowHideOnDemandOption: {
|
|
108
|
-
id:
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingShowHideOnDemandOption",
|
|
116
|
+
defaultMessage: [{
|
|
117
|
+
"type": 0,
|
|
118
|
+
"value": "Show / hide texts by row on demand"
|
|
119
|
+
}]
|
|
111
120
|
},
|
|
112
121
|
densityDisplayComfortableOption: {
|
|
113
|
-
id:
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplayComfortableOption",
|
|
123
|
+
defaultMessage: [{
|
|
124
|
+
"type": 0,
|
|
125
|
+
"value": "Comfortable"
|
|
126
|
+
}]
|
|
116
127
|
},
|
|
117
128
|
densityDisplayCompactOption: {
|
|
118
|
-
id:
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplayCompactOption",
|
|
130
|
+
defaultMessage: [{
|
|
131
|
+
"type": 0,
|
|
132
|
+
"value": "Compact"
|
|
133
|
+
}]
|
|
121
134
|
},
|
|
122
135
|
closeButtonLabel: {
|
|
123
|
-
id:
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
id: "UIKit.DataTableManager.DensityManager.closeButtonLabel",
|
|
137
|
+
defaultMessage: [{
|
|
138
|
+
"type": 0,
|
|
139
|
+
"value": "Close"
|
|
140
|
+
}]
|
|
126
141
|
}
|
|
127
142
|
});
|
|
128
143
|
|
|
@@ -215,9 +230,11 @@ var DisplaySettingsManager = DensityManager;
|
|
|
215
230
|
|
|
216
231
|
var messages$1 = reactIntl.defineMessages({
|
|
217
232
|
closeButtonLabel: {
|
|
218
|
-
id:
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
id: "UIKit.DataTableManager.CustomSettingsManager.closeButtonLabel",
|
|
234
|
+
defaultMessage: [{
|
|
235
|
+
"type": 0,
|
|
236
|
+
"value": "Close"
|
|
237
|
+
}]
|
|
221
238
|
}
|
|
222
239
|
});
|
|
223
240
|
|
|
@@ -237,24 +254,30 @@ var CustomSettingsManager$1 = CustomSettingsManager;
|
|
|
237
254
|
|
|
238
255
|
var messages = reactIntl.defineMessages({
|
|
239
256
|
placeholder: {
|
|
240
|
-
id:
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
id: "UIKit.DataTableManager.TableSettings.placeholder",
|
|
258
|
+
defaultMessage: [{
|
|
259
|
+
"type": 0,
|
|
260
|
+
"value": "Table settings"
|
|
261
|
+
}]
|
|
243
262
|
},
|
|
244
263
|
displaySettingsOption: {
|
|
245
|
-
id:
|
|
246
|
-
|
|
247
|
-
|
|
264
|
+
id: "UIKit.DataTableManager.TableSettings.displaySettingsOption",
|
|
265
|
+
defaultMessage: [{
|
|
266
|
+
"type": 0,
|
|
267
|
+
"value": "Display settings"
|
|
268
|
+
}]
|
|
248
269
|
},
|
|
249
270
|
columnManagerOption: {
|
|
250
|
-
id:
|
|
251
|
-
|
|
252
|
-
|
|
271
|
+
id: "UIKit.DataTableManager.TableSettings.columnManagerOption",
|
|
272
|
+
defaultMessage: [{
|
|
273
|
+
"type": 0,
|
|
274
|
+
"value": "Column manager"
|
|
275
|
+
}]
|
|
253
276
|
}
|
|
254
277
|
});
|
|
255
278
|
|
|
256
279
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
257
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
280
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
258
281
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
259
282
|
const TopBarContainer = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
260
283
|
target: "e3i1gnv0"
|
|
@@ -311,7 +334,7 @@ const getSelectedColumns = function (mappedColumns) {
|
|
|
311
334
|
return _mapInstanceProperty__default["default"](visibleColumnsKeys).call(visibleColumnsKeys, columnKey => mappedColumns[columnKey]);
|
|
312
335
|
};
|
|
313
336
|
const DataTableSettings = props => {
|
|
314
|
-
var
|
|
337
|
+
var _props$customColumnMa, _props$columnManager, _props$displaySetting, _props$displaySetting2, _props$columnManager2, _props$columnManager$, _props$columnManager3, _context3;
|
|
315
338
|
const getEnabledDisplaySettings = () => {
|
|
316
339
|
if (!props.displaySettings || _Object$keys__default["default"](props.displaySettings).length < 0) return undefined;
|
|
317
340
|
return Boolean(props.displaySettings && !props.displaySettings.disableDisplaySettings);
|
|
@@ -322,8 +345,8 @@ const DataTableSettings = props => {
|
|
|
322
345
|
};
|
|
323
346
|
const areDisplaySettingsEnabled = getEnabledDisplaySettings();
|
|
324
347
|
const areColumnSettingsEnabled = getEnabledColumnSettings();
|
|
325
|
-
const areCustomColumnSettingsEnabled = Boolean(props.customColumnManager && !props.customColumnManager
|
|
326
|
-
process.env.NODE_ENV !== "production" ? utils.warning(areDisplaySettingsEnabled || areColumnSettingsEnabled ? typeof props.onSettingsChange === 'function' : true,
|
|
348
|
+
const areCustomColumnSettingsEnabled = Boolean(props.customColumnManager && !((_props$customColumnMa = props.customColumnManager) !== null && _props$customColumnMa !== void 0 && _props$customColumnMa.disableCustomColumnManager));
|
|
349
|
+
process.env.NODE_ENV !== "production" ? utils.warning(areDisplaySettingsEnabled || areColumnSettingsEnabled ? typeof props.onSettingsChange === 'function' : true, "ui-kit/DataTableManager: the prop \"onSettingsChange\" is required when either the display settings or the column settings are enabled.") : void 0;
|
|
327
350
|
const intl = reactIntl.useIntl();
|
|
328
351
|
const _useState = react.useState(null),
|
|
329
352
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -334,8 +357,8 @@ const DataTableSettings = props => {
|
|
|
334
357
|
areDisplaySettingsEnabled,
|
|
335
358
|
areColumnSettingsEnabled,
|
|
336
359
|
customSettings: props.customSettings,
|
|
337
|
-
columnManagerLabel: props.columnManager
|
|
338
|
-
displaySettingsLabel: props.displaySettings
|
|
360
|
+
columnManagerLabel: (_props$columnManager = props.columnManager) === null || _props$columnManager === void 0 ? void 0 : _props$columnManager.columnManagerLabel,
|
|
361
|
+
displaySettingsLabel: (_props$displaySetting = props.displaySettings) === null || _props$displaySetting === void 0 ? void 0 : _props$displaySetting.displaySettingsLabel,
|
|
339
362
|
formatMessage: intl.formatMessage
|
|
340
363
|
});
|
|
341
364
|
const mappedColumns = getMappedColumns(areColumnSettingsEnabled ? props.columnManager.hideableColumns : undefined);
|
|
@@ -359,36 +382,40 @@ const DataTableSettings = props => {
|
|
|
359
382
|
menuHorizontalConstraint: 'auto',
|
|
360
383
|
menuPosition: "right",
|
|
361
384
|
menuType: "list",
|
|
362
|
-
children:
|
|
385
|
+
children: dropdownOptions === null || dropdownOptions === void 0 ? void 0 : _mapInstanceProperty__default["default"](dropdownOptions).call(dropdownOptions, option => jsxRuntime.jsx(DropdownMenu__default["default"].ListMenuItem, {
|
|
363
386
|
onClick: () => {
|
|
364
|
-
setOpenedPanelId(option
|
|
387
|
+
setOpenedPanelId(option === null || option === void 0 ? void 0 : option.value);
|
|
365
388
|
},
|
|
366
|
-
isDisabled: option
|
|
367
|
-
children: option
|
|
368
|
-
}, option
|
|
389
|
+
isDisabled: option === null || option === void 0 ? void 0 : option.isDisabled,
|
|
390
|
+
children: option === null || option === void 0 ? void 0 : option.label
|
|
391
|
+
}, option === null || option === void 0 ? void 0 : option.label))
|
|
369
392
|
})
|
|
370
393
|
})]
|
|
371
394
|
}), openedPanelId === DISPLAY_SETTINGS && jsxRuntime.jsx(DisplaySettingsManager, _objectSpread$1(_objectSpread$1({}, props.displaySettings || {}), {}, {
|
|
372
|
-
title: props.displaySettings
|
|
395
|
+
title: (_props$displaySetting2 = props.displaySettings) === null || _props$displaySetting2 === void 0 ? void 0 : _props$displaySetting2.displaySettingsLabel,
|
|
373
396
|
onClose: handleSettingsPanelChange,
|
|
374
397
|
onDensityDisplayChange: event => {
|
|
375
|
-
|
|
398
|
+
var _props$onSettingsChan;
|
|
399
|
+
(_props$onSettingsChan = props.onSettingsChange) === null || _props$onSettingsChan === void 0 || _props$onSettingsChan.call(props, UPDATE_ACTIONS.IS_TABLE_CONDENSED_UPDATE, event.target.value === DENSITY_COMPACT);
|
|
376
400
|
},
|
|
377
401
|
onTextWrappingChange: event => {
|
|
378
|
-
|
|
402
|
+
var _props$onSettingsChan2;
|
|
403
|
+
(_props$onSettingsChan2 = props.onSettingsChange) === null || _props$onSettingsChan2 === void 0 || _props$onSettingsChan2.call(props, UPDATE_ACTIONS.IS_TABLE_WRAPPING_TEXT_UPDATE, event.target.value === SHOW_HIDE_ON_DEMAND);
|
|
379
404
|
},
|
|
380
405
|
managerTheme: props.managerTheme
|
|
381
406
|
})), openedPanelId === COLUMN_MANAGER && jsxRuntime.jsx(columnSettingsManager.ColumnSettingsManager, _objectSpread$1(_objectSpread$1({}, props.columnManager || {}), {}, {
|
|
382
|
-
title: props.columnManager
|
|
383
|
-
availableColumns: props.columnManager
|
|
407
|
+
title: (_props$columnManager2 = props.columnManager) === null || _props$columnManager2 === void 0 ? void 0 : _props$columnManager2.columnManagerLabel,
|
|
408
|
+
availableColumns: (_props$columnManager$ = (_props$columnManager3 = props.columnManager) === null || _props$columnManager3 === void 0 ? void 0 : _props$columnManager3.hideableColumns) !== null && _props$columnManager$ !== void 0 ? _props$columnManager$ : [],
|
|
384
409
|
selectedColumns: selectedColumns,
|
|
385
410
|
onClose: handleSettingsPanelChange,
|
|
386
411
|
onUpdateColumns: nextVisibleColumns => {
|
|
412
|
+
var _props$onSettingsChan3;
|
|
387
413
|
const keysOfVisibleColumns = _mapInstanceProperty__default["default"](nextVisibleColumns).call(nextVisibleColumns, visibleColumn => visibleColumn.key);
|
|
388
|
-
props.onSettingsChange
|
|
414
|
+
(_props$onSettingsChan3 = props.onSettingsChange) === null || _props$onSettingsChan3 === void 0 || _props$onSettingsChan3.call(props, UPDATE_ACTIONS.COLUMNS_UPDATE, keysOfVisibleColumns);
|
|
389
415
|
},
|
|
390
416
|
managerTheme: props.managerTheme
|
|
391
|
-
})), props.customSettings && _mapInstanceProperty__default["default"](
|
|
417
|
+
})), props.customSettings && _mapInstanceProperty__default["default"](_context3 = _Object$entries__default["default"](props.customSettings)).call(_context3, _ref4 => {
|
|
418
|
+
var _props$customColumnMa2;
|
|
392
419
|
let _ref5 = _slicedToArray(_ref4, 2),
|
|
393
420
|
key = _ref5[0],
|
|
394
421
|
customSetting = _ref5[1];
|
|
@@ -402,17 +429,19 @@ const DataTableSettings = props => {
|
|
|
402
429
|
onClose: handleSettingsPanelChange,
|
|
403
430
|
managerTheme: props.managerTheme,
|
|
404
431
|
selectedColumns: props.selectedColumns,
|
|
405
|
-
availableColumns: props.customColumnManager
|
|
432
|
+
availableColumns: (_props$customColumnMa2 = props.customColumnManager) !== null && _props$customColumnMa2 !== void 0 ? _props$customColumnMa2 : undefined,
|
|
406
433
|
onUpdateColumns: (nextVisibleColumns, key) => {
|
|
434
|
+
var _props$onSettingsChan4;
|
|
407
435
|
const keysOfVisibleColumns = _mapInstanceProperty__default["default"](nextVisibleColumns).call(nextVisibleColumns, visibleColumn => visibleColumn.key);
|
|
408
|
-
props.onSettingsChange
|
|
436
|
+
(_props$onSettingsChan4 = props.onSettingsChange) === null || _props$onSettingsChan4 === void 0 || _props$onSettingsChan4.call(props, UPDATE_ACTIONS.CUSTOM_COLUMNS_UPDATE, keysOfVisibleColumns, key);
|
|
409
437
|
}
|
|
410
438
|
})) : jsxRuntime.jsx(CustomSettingsManager$1, _objectSpread$1(_objectSpread$1({}, customSetting || {}), {}, {
|
|
411
439
|
onClose: handleSettingsPanelChange,
|
|
412
440
|
managerTheme: props.managerTheme,
|
|
413
441
|
children: CustomComponent && jsxRuntime.jsx(CustomComponent, {
|
|
414
442
|
updateCustomSettings: settings => {
|
|
415
|
-
|
|
443
|
+
var _props$onSettingsChan5;
|
|
444
|
+
(_props$onSettingsChan5 = props.onSettingsChange) === null || _props$onSettingsChan5 === void 0 || _props$onSettingsChan5.call(props, UPDATE_ACTIONS.CUSTOM_SETTINGS_UPDATE, settings);
|
|
416
445
|
},
|
|
417
446
|
additionalSettings: _objectSpread$1(_objectSpread$1({}, customSetting), props.additionalSettings)
|
|
418
447
|
})
|
|
@@ -466,8 +495,8 @@ const DataTableManager = props => {
|
|
|
466
495
|
managerTheme: "light",
|
|
467
496
|
additionalSettings: additionalCustomSetting,
|
|
468
497
|
updateCustomSettings: settings => updateCustomSettings(settings),
|
|
469
|
-
selectedColumns: selectedColumns
|
|
470
|
-
customColumnManager: customColumnManager
|
|
498
|
+
selectedColumns: selectedColumns !== null && selectedColumns !== void 0 ? selectedColumns : [],
|
|
499
|
+
customColumnManager: customColumnManager !== null && customColumnManager !== void 0 ? customColumnManager : undefined
|
|
471
500
|
}), props.children ? /*#__PURE__*/react.cloneElement(props.children, {
|
|
472
501
|
columns,
|
|
473
502
|
customColumns,
|
|
@@ -479,7 +508,7 @@ DataTableManager.displayName = 'DataTableManager';
|
|
|
479
508
|
var DataTableManager$1 = DataTableManager;
|
|
480
509
|
|
|
481
510
|
// NOTE: This string will be replaced on build time with the package version.
|
|
482
|
-
var version = "20.
|
|
511
|
+
var version = "20.3.1";
|
|
483
512
|
|
|
484
513
|
exports.ColumnSettingsManager = columnSettingsManager.ColumnSettingsManager;
|
|
485
514
|
Object.defineProperty(exports, 'useRowSelection', {
|
|
@@ -20,7 +20,6 @@ var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
|
20
20
|
var _styled = require('@emotion/styled/base');
|
|
21
21
|
var _Object$entries = require('@babel/runtime-corejs3/core-js-stable/object/entries');
|
|
22
22
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
23
|
-
var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
|
|
24
23
|
require('@commercetools-uikit/utils');
|
|
25
24
|
var reactIntl = require('react-intl');
|
|
26
25
|
var icons = require('@commercetools-uikit/icons');
|
|
@@ -33,7 +32,7 @@ var Grid = require('@commercetools-uikit/grid');
|
|
|
33
32
|
var RadioInput = require('@commercetools-uikit/radio-input');
|
|
34
33
|
var AccessibleHidden = require('@commercetools-uikit/accessible-hidden');
|
|
35
34
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
36
|
-
var columnSettingsManager = require('./column-settings-manager-
|
|
35
|
+
var columnSettingsManager = require('./column-settings-manager-8ec9b25f.cjs.prod.js');
|
|
37
36
|
var hooks = require('@commercetools-uikit/hooks');
|
|
38
37
|
var dataTableManagerProvider = require('./data-table-manager-provider-c64c81aa.cjs.prod.js');
|
|
39
38
|
require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
@@ -47,6 +46,7 @@ require('@commercetools-uikit/accessible-button');
|
|
|
47
46
|
require('@commercetools-uikit/collapsible-motion');
|
|
48
47
|
require('@commercetools-uikit/card');
|
|
49
48
|
require('@commercetools-uikit/text');
|
|
49
|
+
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
50
50
|
require('@commercetools-uikit/tag');
|
|
51
51
|
|
|
52
52
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -64,7 +64,6 @@ var Spacings__default = /*#__PURE__*/_interopDefault(Spacings);
|
|
|
64
64
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
65
65
|
var _Object$entries__default = /*#__PURE__*/_interopDefault(_Object$entries);
|
|
66
66
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
67
|
-
var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
|
|
68
67
|
var DropdownMenu__default = /*#__PURE__*/_interopDefault(DropdownMenu);
|
|
69
68
|
var IconButton__default = /*#__PURE__*/_interopDefault(IconButton);
|
|
70
69
|
var Tooltip__default = /*#__PURE__*/_interopDefault(Tooltip);
|
|
@@ -85,44 +84,60 @@ const DISPLAY_SETTINGS = 'displaySettings';
|
|
|
85
84
|
|
|
86
85
|
var messages$2 = reactIntl.defineMessages({
|
|
87
86
|
title: {
|
|
88
|
-
id:
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
id: "UIKit.DataTableManager.DensityManager.title",
|
|
88
|
+
defaultMessage: [{
|
|
89
|
+
"type": 0,
|
|
90
|
+
"value": "Display settings"
|
|
91
|
+
}]
|
|
91
92
|
},
|
|
92
93
|
textWrappingSubtitle: {
|
|
93
|
-
id:
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingSubtitle",
|
|
95
|
+
defaultMessage: [{
|
|
96
|
+
"type": 0,
|
|
97
|
+
"value": "Text wrapping"
|
|
98
|
+
}]
|
|
96
99
|
},
|
|
97
100
|
densityDisplaySubtitle: {
|
|
98
|
-
id:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplaySubtitle",
|
|
102
|
+
defaultMessage: [{
|
|
103
|
+
"type": 0,
|
|
104
|
+
"value": "Density display"
|
|
105
|
+
}]
|
|
101
106
|
},
|
|
102
107
|
textWrappingAllWrapVisibleOption: {
|
|
103
|
-
id:
|
|
104
|
-
|
|
105
|
-
|
|
108
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingAllWrapVisibleOption",
|
|
109
|
+
defaultMessage: [{
|
|
110
|
+
"type": 0,
|
|
111
|
+
"value": "Make all wrapped texts visible"
|
|
112
|
+
}]
|
|
106
113
|
},
|
|
107
114
|
textWrappingShowHideOnDemandOption: {
|
|
108
|
-
id:
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
id: "UIKit.DataTableManager.DensityManager.textWrappingShowHideOnDemandOption",
|
|
116
|
+
defaultMessage: [{
|
|
117
|
+
"type": 0,
|
|
118
|
+
"value": "Show / hide texts by row on demand"
|
|
119
|
+
}]
|
|
111
120
|
},
|
|
112
121
|
densityDisplayComfortableOption: {
|
|
113
|
-
id:
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplayComfortableOption",
|
|
123
|
+
defaultMessage: [{
|
|
124
|
+
"type": 0,
|
|
125
|
+
"value": "Comfortable"
|
|
126
|
+
}]
|
|
116
127
|
},
|
|
117
128
|
densityDisplayCompactOption: {
|
|
118
|
-
id:
|
|
119
|
-
|
|
120
|
-
|
|
129
|
+
id: "UIKit.DataTableManager.DensityManager.densityDisplayCompactOption",
|
|
130
|
+
defaultMessage: [{
|
|
131
|
+
"type": 0,
|
|
132
|
+
"value": "Compact"
|
|
133
|
+
}]
|
|
121
134
|
},
|
|
122
135
|
closeButtonLabel: {
|
|
123
|
-
id:
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
id: "UIKit.DataTableManager.DensityManager.closeButtonLabel",
|
|
137
|
+
defaultMessage: [{
|
|
138
|
+
"type": 0,
|
|
139
|
+
"value": "Close"
|
|
140
|
+
}]
|
|
126
141
|
}
|
|
127
142
|
});
|
|
128
143
|
|
|
@@ -215,9 +230,11 @@ var DisplaySettingsManager = DensityManager;
|
|
|
215
230
|
|
|
216
231
|
var messages$1 = reactIntl.defineMessages({
|
|
217
232
|
closeButtonLabel: {
|
|
218
|
-
id:
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
id: "UIKit.DataTableManager.CustomSettingsManager.closeButtonLabel",
|
|
234
|
+
defaultMessage: [{
|
|
235
|
+
"type": 0,
|
|
236
|
+
"value": "Close"
|
|
237
|
+
}]
|
|
221
238
|
}
|
|
222
239
|
});
|
|
223
240
|
|
|
@@ -237,24 +254,30 @@ var CustomSettingsManager$1 = CustomSettingsManager;
|
|
|
237
254
|
|
|
238
255
|
var messages = reactIntl.defineMessages({
|
|
239
256
|
placeholder: {
|
|
240
|
-
id:
|
|
241
|
-
|
|
242
|
-
|
|
257
|
+
id: "UIKit.DataTableManager.TableSettings.placeholder",
|
|
258
|
+
defaultMessage: [{
|
|
259
|
+
"type": 0,
|
|
260
|
+
"value": "Table settings"
|
|
261
|
+
}]
|
|
243
262
|
},
|
|
244
263
|
displaySettingsOption: {
|
|
245
|
-
id:
|
|
246
|
-
|
|
247
|
-
|
|
264
|
+
id: "UIKit.DataTableManager.TableSettings.displaySettingsOption",
|
|
265
|
+
defaultMessage: [{
|
|
266
|
+
"type": 0,
|
|
267
|
+
"value": "Display settings"
|
|
268
|
+
}]
|
|
248
269
|
},
|
|
249
270
|
columnManagerOption: {
|
|
250
|
-
id:
|
|
251
|
-
|
|
252
|
-
|
|
271
|
+
id: "UIKit.DataTableManager.TableSettings.columnManagerOption",
|
|
272
|
+
defaultMessage: [{
|
|
273
|
+
"type": 0,
|
|
274
|
+
"value": "Column manager"
|
|
275
|
+
}]
|
|
253
276
|
}
|
|
254
277
|
});
|
|
255
278
|
|
|
256
279
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
257
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
280
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys$1(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys$1(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
258
281
|
const TopBarContainer = /*#__PURE__*/_styled__default["default"]("div", {
|
|
259
282
|
target: "e3i1gnv0"
|
|
260
283
|
} )({
|
|
@@ -303,7 +326,7 @@ const getSelectedColumns = function (mappedColumns) {
|
|
|
303
326
|
return _mapInstanceProperty__default["default"](visibleColumnsKeys).call(visibleColumnsKeys, columnKey => mappedColumns[columnKey]);
|
|
304
327
|
};
|
|
305
328
|
const DataTableSettings = props => {
|
|
306
|
-
var
|
|
329
|
+
var _props$customColumnMa, _props$columnManager, _props$displaySetting, _props$displaySetting2, _props$columnManager2, _props$columnManager$, _props$columnManager3, _context3;
|
|
307
330
|
const getEnabledDisplaySettings = () => {
|
|
308
331
|
if (!props.displaySettings || _Object$keys__default["default"](props.displaySettings).length < 0) return undefined;
|
|
309
332
|
return Boolean(props.displaySettings && !props.displaySettings.disableDisplaySettings);
|
|
@@ -314,7 +337,7 @@ const DataTableSettings = props => {
|
|
|
314
337
|
};
|
|
315
338
|
const areDisplaySettingsEnabled = getEnabledDisplaySettings();
|
|
316
339
|
const areColumnSettingsEnabled = getEnabledColumnSettings();
|
|
317
|
-
const areCustomColumnSettingsEnabled = Boolean(props.customColumnManager && !props.customColumnManager
|
|
340
|
+
const areCustomColumnSettingsEnabled = Boolean(props.customColumnManager && !((_props$customColumnMa = props.customColumnManager) !== null && _props$customColumnMa !== void 0 && _props$customColumnMa.disableCustomColumnManager));
|
|
318
341
|
const intl = reactIntl.useIntl();
|
|
319
342
|
const _useState = react.useState(null),
|
|
320
343
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -325,8 +348,8 @@ const DataTableSettings = props => {
|
|
|
325
348
|
areDisplaySettingsEnabled,
|
|
326
349
|
areColumnSettingsEnabled,
|
|
327
350
|
customSettings: props.customSettings,
|
|
328
|
-
columnManagerLabel: props.columnManager
|
|
329
|
-
displaySettingsLabel: props.displaySettings
|
|
351
|
+
columnManagerLabel: (_props$columnManager = props.columnManager) === null || _props$columnManager === void 0 ? void 0 : _props$columnManager.columnManagerLabel,
|
|
352
|
+
displaySettingsLabel: (_props$displaySetting = props.displaySettings) === null || _props$displaySetting === void 0 ? void 0 : _props$displaySetting.displaySettingsLabel,
|
|
330
353
|
formatMessage: intl.formatMessage
|
|
331
354
|
});
|
|
332
355
|
const mappedColumns = getMappedColumns(areColumnSettingsEnabled ? props.columnManager.hideableColumns : undefined);
|
|
@@ -350,36 +373,40 @@ const DataTableSettings = props => {
|
|
|
350
373
|
menuHorizontalConstraint: 'auto',
|
|
351
374
|
menuPosition: "right",
|
|
352
375
|
menuType: "list",
|
|
353
|
-
children:
|
|
376
|
+
children: dropdownOptions === null || dropdownOptions === void 0 ? void 0 : _mapInstanceProperty__default["default"](dropdownOptions).call(dropdownOptions, option => jsxRuntime.jsx(DropdownMenu__default["default"].ListMenuItem, {
|
|
354
377
|
onClick: () => {
|
|
355
|
-
setOpenedPanelId(option
|
|
378
|
+
setOpenedPanelId(option === null || option === void 0 ? void 0 : option.value);
|
|
356
379
|
},
|
|
357
|
-
isDisabled: option
|
|
358
|
-
children: option
|
|
359
|
-
}, option
|
|
380
|
+
isDisabled: option === null || option === void 0 ? void 0 : option.isDisabled,
|
|
381
|
+
children: option === null || option === void 0 ? void 0 : option.label
|
|
382
|
+
}, option === null || option === void 0 ? void 0 : option.label))
|
|
360
383
|
})
|
|
361
384
|
})]
|
|
362
385
|
}), openedPanelId === DISPLAY_SETTINGS && jsxRuntime.jsx(DisplaySettingsManager, _objectSpread$1(_objectSpread$1({}, props.displaySettings || {}), {}, {
|
|
363
|
-
title: props.displaySettings
|
|
386
|
+
title: (_props$displaySetting2 = props.displaySettings) === null || _props$displaySetting2 === void 0 ? void 0 : _props$displaySetting2.displaySettingsLabel,
|
|
364
387
|
onClose: handleSettingsPanelChange,
|
|
365
388
|
onDensityDisplayChange: event => {
|
|
366
|
-
|
|
389
|
+
var _props$onSettingsChan;
|
|
390
|
+
(_props$onSettingsChan = props.onSettingsChange) === null || _props$onSettingsChan === void 0 || _props$onSettingsChan.call(props, UPDATE_ACTIONS.IS_TABLE_CONDENSED_UPDATE, event.target.value === DENSITY_COMPACT);
|
|
367
391
|
},
|
|
368
392
|
onTextWrappingChange: event => {
|
|
369
|
-
|
|
393
|
+
var _props$onSettingsChan2;
|
|
394
|
+
(_props$onSettingsChan2 = props.onSettingsChange) === null || _props$onSettingsChan2 === void 0 || _props$onSettingsChan2.call(props, UPDATE_ACTIONS.IS_TABLE_WRAPPING_TEXT_UPDATE, event.target.value === SHOW_HIDE_ON_DEMAND);
|
|
370
395
|
},
|
|
371
396
|
managerTheme: props.managerTheme
|
|
372
397
|
})), openedPanelId === COLUMN_MANAGER && jsxRuntime.jsx(columnSettingsManager.ColumnSettingsManager, _objectSpread$1(_objectSpread$1({}, props.columnManager || {}), {}, {
|
|
373
|
-
title: props.columnManager
|
|
374
|
-
availableColumns: props.columnManager
|
|
398
|
+
title: (_props$columnManager2 = props.columnManager) === null || _props$columnManager2 === void 0 ? void 0 : _props$columnManager2.columnManagerLabel,
|
|
399
|
+
availableColumns: (_props$columnManager$ = (_props$columnManager3 = props.columnManager) === null || _props$columnManager3 === void 0 ? void 0 : _props$columnManager3.hideableColumns) !== null && _props$columnManager$ !== void 0 ? _props$columnManager$ : [],
|
|
375
400
|
selectedColumns: selectedColumns,
|
|
376
401
|
onClose: handleSettingsPanelChange,
|
|
377
402
|
onUpdateColumns: nextVisibleColumns => {
|
|
403
|
+
var _props$onSettingsChan3;
|
|
378
404
|
const keysOfVisibleColumns = _mapInstanceProperty__default["default"](nextVisibleColumns).call(nextVisibleColumns, visibleColumn => visibleColumn.key);
|
|
379
|
-
props.onSettingsChange
|
|
405
|
+
(_props$onSettingsChan3 = props.onSettingsChange) === null || _props$onSettingsChan3 === void 0 || _props$onSettingsChan3.call(props, UPDATE_ACTIONS.COLUMNS_UPDATE, keysOfVisibleColumns);
|
|
380
406
|
},
|
|
381
407
|
managerTheme: props.managerTheme
|
|
382
|
-
})), props.customSettings && _mapInstanceProperty__default["default"](
|
|
408
|
+
})), props.customSettings && _mapInstanceProperty__default["default"](_context3 = _Object$entries__default["default"](props.customSettings)).call(_context3, _ref4 => {
|
|
409
|
+
var _props$customColumnMa2;
|
|
383
410
|
let _ref5 = _slicedToArray(_ref4, 2),
|
|
384
411
|
key = _ref5[0],
|
|
385
412
|
customSetting = _ref5[1];
|
|
@@ -393,17 +420,19 @@ const DataTableSettings = props => {
|
|
|
393
420
|
onClose: handleSettingsPanelChange,
|
|
394
421
|
managerTheme: props.managerTheme,
|
|
395
422
|
selectedColumns: props.selectedColumns,
|
|
396
|
-
availableColumns: props.customColumnManager
|
|
423
|
+
availableColumns: (_props$customColumnMa2 = props.customColumnManager) !== null && _props$customColumnMa2 !== void 0 ? _props$customColumnMa2 : undefined,
|
|
397
424
|
onUpdateColumns: (nextVisibleColumns, key) => {
|
|
425
|
+
var _props$onSettingsChan4;
|
|
398
426
|
const keysOfVisibleColumns = _mapInstanceProperty__default["default"](nextVisibleColumns).call(nextVisibleColumns, visibleColumn => visibleColumn.key);
|
|
399
|
-
props.onSettingsChange
|
|
427
|
+
(_props$onSettingsChan4 = props.onSettingsChange) === null || _props$onSettingsChan4 === void 0 || _props$onSettingsChan4.call(props, UPDATE_ACTIONS.CUSTOM_COLUMNS_UPDATE, keysOfVisibleColumns, key);
|
|
400
428
|
}
|
|
401
429
|
})) : jsxRuntime.jsx(CustomSettingsManager$1, _objectSpread$1(_objectSpread$1({}, customSetting || {}), {}, {
|
|
402
430
|
onClose: handleSettingsPanelChange,
|
|
403
431
|
managerTheme: props.managerTheme,
|
|
404
432
|
children: CustomComponent && jsxRuntime.jsx(CustomComponent, {
|
|
405
433
|
updateCustomSettings: settings => {
|
|
406
|
-
|
|
434
|
+
var _props$onSettingsChan5;
|
|
435
|
+
(_props$onSettingsChan5 = props.onSettingsChange) === null || _props$onSettingsChan5 === void 0 || _props$onSettingsChan5.call(props, UPDATE_ACTIONS.CUSTOM_SETTINGS_UPDATE, settings);
|
|
407
436
|
},
|
|
408
437
|
additionalSettings: _objectSpread$1(_objectSpread$1({}, customSetting), props.additionalSettings)
|
|
409
438
|
})
|
|
@@ -457,8 +486,8 @@ const DataTableManager = props => {
|
|
|
457
486
|
managerTheme: "light",
|
|
458
487
|
additionalSettings: additionalCustomSetting,
|
|
459
488
|
updateCustomSettings: settings => updateCustomSettings(settings),
|
|
460
|
-
selectedColumns: selectedColumns
|
|
461
|
-
customColumnManager: customColumnManager
|
|
489
|
+
selectedColumns: selectedColumns !== null && selectedColumns !== void 0 ? selectedColumns : [],
|
|
490
|
+
customColumnManager: customColumnManager !== null && customColumnManager !== void 0 ? customColumnManager : undefined
|
|
462
491
|
}), props.children ? /*#__PURE__*/react.cloneElement(props.children, {
|
|
463
492
|
columns,
|
|
464
493
|
customColumns,
|
|
@@ -470,7 +499,7 @@ DataTableManager.displayName = 'DataTableManager';
|
|
|
470
499
|
var DataTableManager$1 = DataTableManager;
|
|
471
500
|
|
|
472
501
|
// NOTE: This string will be replaced on build time with the package version.
|
|
473
|
-
var version = "20.
|
|
502
|
+
var version = "20.3.1";
|
|
474
503
|
|
|
475
504
|
exports.ColumnSettingsManager = columnSettingsManager.ColumnSettingsManager;
|
|
476
505
|
Object.defineProperty(exports, 'useRowSelection', {
|