@luminati-io/uikit 3.4.7 → 3.4.9
Sign up to get free protection for your applications and to get access to all the features.
@@ -30467,11 +30467,13 @@ var CodeBlock = function CodeBlock(props) {
|
|
30467
30467
|
themeProp = props.theme,
|
30468
30468
|
lineNumbers = props.lineNumbers,
|
30469
30469
|
copyButton = props.copyButton,
|
30470
|
-
onCopy = props.onCopy
|
30470
|
+
onCopy = props.onCopy,
|
30471
|
+
with_dropdown = props.with_dropdown;
|
30471
30472
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockWrapper, {
|
30472
30473
|
className: className,
|
30473
30474
|
"data-testid": "code_block"
|
30474
30475
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CodeBlockHeader, {
|
30476
|
+
$with_dropdown: with_dropdown,
|
30475
30477
|
$theme: themeProp
|
30476
30478
|
}, header), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_code_snippet__WEBPACK_IMPORTED_MODULE_5__.CodeSnippet, {
|
30477
30479
|
max_height: max_height,
|
@@ -30503,16 +30505,16 @@ var CodeBlockWrapper = styled_components__WEBPACK_IMPORTED_MODULE_1___default().
|
|
30503
30505
|
})(["border-radius:4px;overflow:hidden;font-family:", ";font-size:", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].font_family.sans, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].font_size.md);
|
30504
30506
|
var CodeBlockHeader = styled_components__WEBPACK_IMPORTED_MODULE_1___default()(_layout__WEBPACK_IMPORTED_MODULE_4__.Flex).attrs({
|
30505
30507
|
align_items: 'center',
|
30506
|
-
justify_content: 'space-between'
|
30507
|
-
padding: '0.9em 1em'
|
30508
|
+
justify_content: 'space-between'
|
30508
30509
|
}).withConfig({
|
30509
30510
|
displayName: "CodeBlockHeader",
|
30510
30511
|
componentId: "sc-dgi5hi-1"
|
30511
30512
|
})(["", ""], function (props) {
|
30513
|
+
var padding = props.$with_dropdown ? '0.5em 0.8em' : '0.9em 1em';
|
30512
30514
|
if (props.$theme == 'white') {
|
30513
|
-
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["background-color:", ";color:", ";border-bottom:1px solid ", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_2, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_5);
|
30515
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["padding:", ";background-color:", ";color:", ";border-bottom:1px solid ", ";"], padding, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_2, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_5);
|
30514
30516
|
}
|
30515
|
-
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["background-color:", ";color:", ";"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_11_50, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9);
|
30517
|
+
return (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["padding:", ";background-color:", ";color:", ";"], padding, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_11_50, _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.gray_9);
|
30516
30518
|
});
|
30517
30519
|
|
30518
30520
|
/***/ }),
|
@@ -31765,7 +31767,7 @@ Icon.propTypes = {
|
|
31765
31767
|
name: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(_utils__WEBPACK_IMPORTED_MODULE_5__.iconNames).isRequired,
|
31766
31768
|
color: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(_utils__WEBPACK_IMPORTED_MODULE_5__.colorNames),
|
31767
31769
|
size: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['xxs', 'xs', 'sm', 'md', 'lg', 'xl']),
|
31768
|
-
verticalAlign: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['top', 'middle', 'bottom', 'baseline', 'text-top', 'text-bottom', 'super'])
|
31770
|
+
verticalAlign: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(['top', 'middle', 'bottom', 'baseline', 'text-top', 'text-bottom', 'super', 'sub'])
|
31769
31771
|
};
|
31770
31772
|
var StyledSvg = styled_components__WEBPACK_IMPORTED_MODULE_1___default().svg.withConfig({
|
31771
31773
|
displayName: "StyledSvg",
|
@@ -33193,7 +33195,7 @@ var DraggableItem = function DraggableItem(props) {
|
|
33193
33195
|
Dragger = props.Dragger,
|
33194
33196
|
isDragging = props.isDragging;
|
33195
33197
|
return /*#__PURE__*/React.createElement(DraggedContainer, {
|
33196
|
-
|
33198
|
+
$dragging: isDragging
|
33197
33199
|
}, /*#__PURE__*/React.createElement(Dragger, null, !disableDrag && /*#__PURE__*/React.createElement(_icon__WEBPACK_IMPORTED_MODULE_3__.Icon, {
|
33198
33200
|
name: "DragAndDrop",
|
33199
33201
|
size: "xs",
|
@@ -33214,7 +33216,7 @@ var DraggedContainer = styled_components__WEBPACK_IMPORTED_MODULE_0___default()(
|
|
33214
33216
|
displayName: "DraggedContainer",
|
33215
33217
|
componentId: "sc-167vnen-0"
|
33216
33218
|
})(["border-radius:4px;&:hover{background-color:", ";}", ""], _theme__WEBPACK_IMPORTED_MODULE_4__["default"].color.gray_2, function (props) {
|
33217
|
-
return props
|
33219
|
+
return props.$dragging && (0,styled_components__WEBPACK_IMPORTED_MODULE_0__.css)(["background-color:", ";"], _theme__WEBPACK_IMPORTED_MODULE_4__["default"].color.gray_3);
|
33218
33220
|
});
|
33219
33221
|
var Truncated_label = styled_components__WEBPACK_IMPORTED_MODULE_0___default()(_typography__WEBPACK_IMPORTED_MODULE_2__.Label).withConfig({
|
33220
33222
|
displayName: "Truncated_label",
|
@@ -33309,8 +33311,8 @@ var DroppableArea = function DroppableArea(props) {
|
|
33309
33311
|
var DropComp = function DropComp(props) {
|
33310
33312
|
return /*#__PURE__*/React.createElement(SectionFlex, {
|
33311
33313
|
flex_direction: "column",
|
33312
|
-
|
33313
|
-
|
33314
|
+
$last: props.isLast,
|
33315
|
+
$direction: props.containerDirection
|
33314
33316
|
}, /*#__PURE__*/React.createElement(_typography__WEBPACK_IMPORTED_MODULE_4__.Label, {
|
33315
33317
|
style: {
|
33316
33318
|
marginTop: '6px',
|
@@ -33319,14 +33321,14 @@ var DropComp = function DropComp(props) {
|
|
33319
33321
|
}, props.name || 'Section ' + props.index), props.children);
|
33320
33322
|
};
|
33321
33323
|
var borderProp = function borderProp(_ref) {
|
33322
|
-
var
|
33323
|
-
return 'border-' + (
|
33324
|
+
var $direction = _ref.$direction;
|
33325
|
+
return 'border-' + ($direction == 'row' ? 'right' : 'bottom');
|
33324
33326
|
};
|
33325
33327
|
var SectionFlex = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(_layout__WEBPACK_IMPORTED_MODULE_3__.Flex).withConfig({
|
33326
33328
|
displayName: "SectionFlex",
|
33327
33329
|
componentId: "sc-2htus7-0"
|
33328
33330
|
})(["padding-right:8px;padding-left:8px;", ""], function (props) {
|
33329
|
-
return !props
|
33331
|
+
return !props.$last && (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["", ":1px solid ", ";"], borderProp(props), _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.gray_4);
|
33330
33332
|
});
|
33331
33333
|
DroppableArea.displayName = 'DroppableArea';
|
33332
33334
|
DropComp.displayName = 'DropComp';
|
@@ -33909,7 +33911,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
33909
33911
|
|
33910
33912
|
var useStyles = function useStyles(_ref) {
|
33911
33913
|
var styles = _ref.styles,
|
33912
|
-
size = _ref.size
|
33914
|
+
size = _ref.size,
|
33915
|
+
menuPortalTarget = _ref.menuPortalTarget;
|
33913
33916
|
return (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
33914
33917
|
return (0,_util_with_user_styles__WEBPACK_IMPORTED_MODULE_5__.withUserStyles)(styles, {
|
33915
33918
|
control: function control(baseStyles, _ref2) {
|
@@ -33976,7 +33979,8 @@ var useStyles = function useStyles(_ref) {
|
|
33976
33979
|
width: '100%',
|
33977
33980
|
backgroundColor: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].color.white,
|
33978
33981
|
borderRadius: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].spacing['02'],
|
33979
|
-
boxShadow: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].box_shadow.md
|
33982
|
+
boxShadow: _theme__WEBPACK_IMPORTED_MODULE_1__["default"].box_shadow.md,
|
33983
|
+
zIndex: menuPortalTarget ? baseStyles.zIndex : _constants__WEBPACK_IMPORTED_MODULE_3__.Z_INDEX.dropdown
|
33980
33984
|
});
|
33981
33985
|
},
|
33982
33986
|
menuPortal: function menuPortal(baseStyles) {
|
@@ -34022,7 +34026,7 @@ var useStyles = function useStyles(_ref) {
|
|
34022
34026
|
});
|
34023
34027
|
}
|
34024
34028
|
});
|
34025
|
-
}, [styles, size]);
|
34029
|
+
}, [styles, size, menuPortalTarget]);
|
34026
34030
|
};
|
34027
34031
|
|
34028
34032
|
/***/ }),
|
@@ -36112,8 +36116,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
36112
36116
|
/*jslint react:true*/
|
36113
36117
|
|
36114
36118
|
|
36115
|
-
_menu__WEBPACK_IMPORTED_MODULE_0__
|
36116
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_menu__WEBPACK_IMPORTED_MODULE_0__
|
36119
|
+
_menu__WEBPACK_IMPORTED_MODULE_0__.Menu.Item = _menu_item__WEBPACK_IMPORTED_MODULE_1__.MenuItem;
|
36120
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_menu__WEBPACK_IMPORTED_MODULE_0__.Menu);
|
36117
36121
|
|
36118
36122
|
/***/ }),
|
36119
36123
|
|
@@ -36126,7 +36130,7 @@ _menu__WEBPACK_IMPORTED_MODULE_0__["default"].Item = _menu_item__WEBPACK_IMPORTE
|
|
36126
36130
|
"use strict";
|
36127
36131
|
__webpack_require__.r(__webpack_exports__);
|
36128
36132
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
36129
|
-
/* harmony export */
|
36133
|
+
/* harmony export */ Menu: () => (/* binding */ Menu)
|
36130
36134
|
/* harmony export */ });
|
36131
36135
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "prop-types");
|
36132
36136
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
|
@@ -36173,7 +36177,6 @@ Menu.propTypes = {
|
|
36173
36177
|
size: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(['sm', 'md', 'lg']),
|
36174
36178
|
items: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().any)).isRequired
|
36175
36179
|
};
|
36176
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Menu);
|
36177
36180
|
|
36178
36181
|
/***/ }),
|
36179
36182
|
|
@@ -36186,7 +36189,7 @@ Menu.propTypes = {
|
|
36186
36189
|
"use strict";
|
36187
36190
|
__webpack_require__.r(__webpack_exports__);
|
36188
36191
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
36189
|
-
/* harmony export */
|
36192
|
+
/* harmony export */ MenuItem: () => (/* binding */ MenuItem)
|
36190
36193
|
/* harmony export */ });
|
36191
36194
|
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js");
|
36192
36195
|
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__);
|
@@ -36214,7 +36217,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
36214
36217
|
var _excluded = ["type", "text", "secondaryText", "tertiaryText", "description", "size", "children", "variant", "tag", "disabled", "selected", "subMenu", "tooltip", "isFirstItem"],
|
36215
36218
|
_excluded2 = ["isLeft"],
|
36216
36219
|
_excluded3 = ["subItems", "children"],
|
36217
|
-
_excluded4 = ["popover"];
|
36220
|
+
_excluded4 = ["popover", "onClick"];
|
36218
36221
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
36219
36222
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
36220
36223
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
@@ -36231,7 +36234,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
36231
36234
|
|
36232
36235
|
|
36233
36236
|
|
36234
|
-
var MenuItem = /*#__PURE__*/
|
36237
|
+
var MenuItem = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
36235
36238
|
var type = props.type,
|
36236
36239
|
text = props.text,
|
36237
36240
|
secondaryText = props.secondaryText,
|
@@ -36314,7 +36317,7 @@ MenuItem.propTypes = {
|
|
36314
36317
|
subMenu: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
36315
36318
|
tooltip: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
|
36316
36319
|
};
|
36317
|
-
var MenuItemComp = /*#__PURE__*/
|
36320
|
+
var MenuItemComp = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
36318
36321
|
var subItems = props.subItems,
|
36319
36322
|
children = props.children,
|
36320
36323
|
rest = _objectWithoutProperties(props, _excluded3);
|
@@ -36342,13 +36345,19 @@ var MenuItemButton = styled_components__WEBPACK_IMPORTED_MODULE_3___default().di
|
|
36342
36345
|
}, function (props) {
|
36343
36346
|
return props['aria-disabled'] ? 'not-allowed' : 'pointer';
|
36344
36347
|
}, _theme__WEBPACK_IMPORTED_MODULE_6__["default"].color.gray_2, _theme__WEBPACK_IMPORTED_MODULE_6__["default"].color.gray_4);
|
36345
|
-
var
|
36346
|
-
var popover =
|
36347
|
-
|
36348
|
+
var MenuItemPopoverTrigger = function MenuItemPopoverTrigger(props) {
|
36349
|
+
var popover = props.popover,
|
36350
|
+
onClick = props.onClick,
|
36351
|
+
rest = _objectWithoutProperties(props, _excluded4);
|
36352
|
+
var _onClick = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (evt) {
|
36353
|
+
onClick === null || onClick === void 0 || onClick(evt);
|
36354
|
+
popover.toggle();
|
36355
|
+
}, [onClick, popover.toggle]);
|
36348
36356
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(MenuItemButton, _extends({}, rest, {
|
36349
|
-
onClick:
|
36357
|
+
onClick: _onClick
|
36350
36358
|
}));
|
36351
|
-
}
|
36359
|
+
};
|
36360
|
+
var MenuItemPopover = (0,_hoc__WEBPACK_IMPORTED_MODULE_4__.withPopover)(MenuItemPopoverTrigger, function (props) {
|
36352
36361
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_shared__WEBPACK_IMPORTED_MODULE_13__.MenuContainer, {
|
36353
36362
|
onClick: props.popover.hide
|
36354
36363
|
}, props.subItems);
|
@@ -36416,14 +36425,13 @@ var Description = styled_components__WEBPACK_IMPORTED_MODULE_3___default()(_typo
|
|
36416
36425
|
})(["width:100%;overflow-x:clip;text-overflow:ellipsis;"]);
|
36417
36426
|
var buildSubItems = function buildSubItems(children, itemProps) {
|
36418
36427
|
return Array.isArray(children) && children.length > 0 ? children.map(function (item, ind) {
|
36419
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_10__
|
36428
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_10__.Menu.Item, _extends({
|
36420
36429
|
key: item.key
|
36421
36430
|
}, item, itemProps, {
|
36422
36431
|
isFirstItem: ind == 0
|
36423
36432
|
}));
|
36424
36433
|
}) : undefined;
|
36425
36434
|
};
|
36426
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MenuItem);
|
36427
36435
|
|
36428
36436
|
/***/ }),
|
36429
36437
|
|
@@ -37823,12 +37831,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
37823
37831
|
/* harmony import */ var _pinned_columns__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pinned_columns */ "./src/table/pinned_columns.js");
|
37824
37832
|
/* harmony import */ var _expandable_rows__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./expandable_rows */ "./src/table/expandable_rows.js");
|
37825
37833
|
/* harmony import */ var _select_rows__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./select_rows */ "./src/table/select_rows.js");
|
37834
|
+
/* harmony import */ var _order_logic__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./order_logic */ "./src/table/order_logic.js");
|
37826
37835
|
// LICENSE_CODE ZON
|
37827
37836
|
|
37828
37837
|
|
37829
37838
|
/*jslint react:true*/
|
37830
37839
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
37831
|
-
var _excluded = ["data", "columnsSort", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds"];
|
37840
|
+
var _excluded = ["data", "columnsSort", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns"];
|
37832
37841
|
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; }
|
37833
37842
|
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; }
|
37834
37843
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -37857,6 +37866,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
37857
37866
|
|
37858
37867
|
|
37859
37868
|
|
37869
|
+
|
37860
37870
|
var assign = Object.assign;
|
37861
37871
|
var defaultPropGetter = function defaultPropGetter() {
|
37862
37872
|
return {};
|
@@ -37915,6 +37925,8 @@ var Provider = function Provider(props) {
|
|
37915
37925
|
_props$getFooterProps = props.getFooterProps,
|
37916
37926
|
getFooterProps = _props$getFooterProps === void 0 ? defaultPropGetter : _props$getFooterProps,
|
37917
37927
|
selectedRowIds = props.selectedRowIds,
|
37928
|
+
_props$canOrderColumn = props.canOrderColumns,
|
37929
|
+
canOrderColumns = _props$canOrderColumn === void 0 ? false : _props$canOrderColumn,
|
37918
37930
|
rest = _objectWithoutProperties(props, _excluded);
|
37919
37931
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
|
37920
37932
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -37967,9 +37979,12 @@ var Provider = function Provider(props) {
|
|
37967
37979
|
}, [manualPagination, totalCount, pageIndex, _pageSize]);
|
37968
37980
|
var _LoadingComp = useComp(loadingText, LoadingComp);
|
37969
37981
|
var _NoDataComp = useComp(noDataText, NoDataComp);
|
37982
|
+
var orderLogic = (0,_order_logic__WEBPACK_IMPORTED_MODULE_11__.useOrderLogic)(table);
|
37970
37983
|
var value = _objectSpread(_objectSpread({
|
37971
37984
|
columnsSort: columnsSort
|
37972
37985
|
}, table), {}, {
|
37986
|
+
canOrderColumns: canOrderColumns,
|
37987
|
+
orderLogic: orderLogic,
|
37973
37988
|
LoadingComp: _LoadingComp,
|
37974
37989
|
NoDataComp: _NoDataComp
|
37975
37990
|
});
|
@@ -37994,7 +38009,8 @@ Provider.defaultProps = {
|
|
37994
38009
|
getRowProps: defaultPropGetter,
|
37995
38010
|
getCellProps: defaultPropGetter,
|
37996
38011
|
getFooterProps: defaultPropGetter,
|
37997
|
-
rowDensity: 'busy_bee'
|
38012
|
+
rowDensity: 'busy_bee',
|
38013
|
+
canOrderColumns: false
|
37998
38014
|
};
|
37999
38015
|
Provider.propTypes = {
|
38000
38016
|
columns: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
|
@@ -38046,7 +38062,8 @@ Provider.propTypes = {
|
|
38046
38062
|
stickyHeader: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
|
38047
38063
|
scrollTarget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().any),
|
38048
38064
|
className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
|
38049
|
-
onSelectRows: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
|
38065
|
+
onSelectRows: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
|
38066
|
+
canOrderColumns: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
|
38050
38067
|
};
|
38051
38068
|
var calcPageCount = function calcPageCount(totalCount, pageSize) {
|
38052
38069
|
return Math.ceil(totalCount / pageSize);
|
@@ -38679,7 +38696,9 @@ var HeaderCell = function HeaderCell(props) {
|
|
38679
38696
|
getColumnProps = _useTableContext2.getColumnProps,
|
38680
38697
|
getHeaderProps = _useTableContext2.getHeaderProps,
|
38681
38698
|
columnsSort = _useTableContext2.columnsSort,
|
38682
|
-
fullWidth = _useTableContext2.fullWidth
|
38699
|
+
fullWidth = _useTableContext2.fullWidth,
|
38700
|
+
canOrderColumns = _useTableContext2.canOrderColumns,
|
38701
|
+
orderLogic = _useTableContext2.orderLogic;
|
38683
38702
|
var sort = columnsSort[id];
|
38684
38703
|
var canSort = header.can_sort && header.on_sort;
|
38685
38704
|
var handleSort = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
@@ -38725,7 +38744,8 @@ var HeaderCell = function HeaderCell(props) {
|
|
38725
38744
|
visible: hovered,
|
38726
38745
|
onItemClick: function onItemClick() {
|
38727
38746
|
return setHovered(false);
|
38728
|
-
}
|
38747
|
+
},
|
38748
|
+
orderLogic: canOrderColumns && orderLogic
|
38729
38749
|
}), canResize && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(HeaderCellResizer, _extends({}, getResizerProps(), {
|
38730
38750
|
$isResizing: isResizing
|
38731
38751
|
}))));
|
@@ -38807,7 +38827,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
38807
38827
|
var HeaderFunctions = function HeaderFunctions(props) {
|
38808
38828
|
var header = props.header,
|
38809
38829
|
visible = props.visible,
|
38810
|
-
onItemClick = props.onItemClick
|
38830
|
+
onItemClick = props.onItemClick,
|
38831
|
+
orderLogic = props.orderLogic;
|
38811
38832
|
var id = header.id,
|
38812
38833
|
on_sort = header.on_sort,
|
38813
38834
|
canHide = header.canHide,
|
@@ -38815,6 +38836,38 @@ var HeaderFunctions = function HeaderFunctions(props) {
|
|
38815
38836
|
canPin = header.canPin;
|
38816
38837
|
var canSort = header.can_sort && header.on_sort;
|
38817
38838
|
var items = [];
|
38839
|
+
if (orderLogic) {
|
38840
|
+
var firsts = orderLogic.firsts,
|
38841
|
+
lasts = orderLogic.lasts,
|
38842
|
+
moveBackwards = orderLogic.moveBackwards,
|
38843
|
+
moveForward = orderLogic.moveForward;
|
38844
|
+
if (!Object.keys(firsts).includes(id)) {
|
38845
|
+
items.push({
|
38846
|
+
id: 'move_back',
|
38847
|
+
children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(OrderColumn, {
|
38848
|
+
id: id,
|
38849
|
+
dir: "back",
|
38850
|
+
action: moveBackwards
|
38851
|
+
})
|
38852
|
+
});
|
38853
|
+
}
|
38854
|
+
if (!Object.keys(lasts).includes(id)) {
|
38855
|
+
items.push({
|
38856
|
+
id: 'move_forward',
|
38857
|
+
children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(OrderColumn, {
|
38858
|
+
id: id,
|
38859
|
+
dir: "forward",
|
38860
|
+
action: moveForward
|
38861
|
+
})
|
38862
|
+
});
|
38863
|
+
}
|
38864
|
+
if ((canSort || canHide || canPin) && (!Object.keys(firsts).includes(id) || !Object.keys(lasts).includes(id))) {
|
38865
|
+
items.push({
|
38866
|
+
id: 'sep',
|
38867
|
+
$separator: true
|
38868
|
+
});
|
38869
|
+
}
|
38870
|
+
}
|
38818
38871
|
if (canSort) {
|
38819
38872
|
items.push({
|
38820
38873
|
id: 'sort_asc',
|
@@ -38902,6 +38955,25 @@ var MenuItem = styled_components__WEBPACK_IMPORTED_MODULE_1___default().li.withC
|
|
38902
38955
|
})(["list-style:none;&:hover{background-color:", ";}", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.gray_2, function (props) {
|
38903
38956
|
return props.$separator && (0,styled_components__WEBPACK_IMPORTED_MODULE_1__.css)(["padding:0;height:1px;background-color:", ";&:hover{background-color:", ";}"], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.gray_4, _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.gray_4);
|
38904
38957
|
});
|
38958
|
+
var OrderColumn = function OrderColumn(props) {
|
38959
|
+
var id = props.id,
|
38960
|
+
dir = props.dir,
|
38961
|
+
action = props.action;
|
38962
|
+
var text = dir == 'back' ? 'Column Left' : 'Column Right';
|
38963
|
+
var handleClick = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
38964
|
+
return action(id);
|
38965
|
+
}, [id, action]);
|
38966
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(FunctionWrapper, {
|
38967
|
+
onClick: handleClick
|
38968
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon__WEBPACK_IMPORTED_MODULE_3__.Icon, {
|
38969
|
+
name: dir == 'back' ? 'ArrowLeft' : 'ArrowRight',
|
38970
|
+
color: "gray_9",
|
38971
|
+
size: "xs"
|
38972
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_6__.Label, {
|
38973
|
+
variant: "sm",
|
38974
|
+
color: "gray_11_50"
|
38975
|
+
}, text));
|
38976
|
+
};
|
38905
38977
|
var SortColumn = function SortColumn(props) {
|
38906
38978
|
var id = props.id,
|
38907
38979
|
sort = props.sort,
|
@@ -39000,6 +39072,150 @@ _table__WEBPACK_IMPORTED_MODULE_3__["default"].plugins = _plugin__WEBPACK_IMPORT
|
|
39000
39072
|
|
39001
39073
|
/***/ }),
|
39002
39074
|
|
39075
|
+
/***/ "./src/table/order_logic.js":
|
39076
|
+
/*!**********************************!*\
|
39077
|
+
!*** ./src/table/order_logic.js ***!
|
39078
|
+
\**********************************/
|
39079
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
39080
|
+
|
39081
|
+
"use strict";
|
39082
|
+
__webpack_require__.r(__webpack_exports__);
|
39083
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
39084
|
+
/* harmony export */ useOrderLogic: () => (/* binding */ useOrderLogic)
|
39085
|
+
/* harmony export */ });
|
39086
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
39087
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
39088
|
+
// LICENSE_CODE ZON
|
39089
|
+
|
39090
|
+
|
39091
|
+
/*jslint react:true*/
|
39092
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
39093
|
+
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; }
|
39094
|
+
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; }
|
39095
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
39096
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
39097
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
39098
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
39099
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
39100
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
39101
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
39102
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
39103
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
39104
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
39105
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
39106
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
39107
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
39108
|
+
|
39109
|
+
var useOrderLogic = function useOrderLogic(table) {
|
39110
|
+
var _table$state = table.state,
|
39111
|
+
columnOrder = _table$state.columnOrder,
|
39112
|
+
hiddenColumns = _table$state.hiddenColumns,
|
39113
|
+
pinnedColumns = _table$state.pinnedColumns,
|
39114
|
+
setColumnOrder = table.setColumnOrder,
|
39115
|
+
setHiddenColumns = table.setHiddenColumns,
|
39116
|
+
setPinnedColumns = table.setPinnedColumns,
|
39117
|
+
allColumns = table.allColumns;
|
39118
|
+
var getColumnCategory = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
|
39119
|
+
if (hiddenColumns.includes(id)) return 'hidden';
|
39120
|
+
if (pinnedColumns.includes(id)) return 'pinned';
|
39121
|
+
return 'visible';
|
39122
|
+
}, [hiddenColumns, pinnedColumns]);
|
39123
|
+
var fullOrder = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
39124
|
+
var rest;
|
39125
|
+
if (columnOrder.length == allColumns.length) rest = [];else {
|
39126
|
+
rest = allColumns.filter(function (c) {
|
39127
|
+
return !columnOrder.includes(c.id);
|
39128
|
+
}).map(function (c) {
|
39129
|
+
return c.id;
|
39130
|
+
});
|
39131
|
+
}
|
39132
|
+
return [].concat(_toConsumableArray(columnOrder), _toConsumableArray(rest));
|
39133
|
+
}, [columnOrder, allColumns]);
|
39134
|
+
var orders = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
39135
|
+
var _orders = {
|
39136
|
+
visible: [],
|
39137
|
+
pinned: [],
|
39138
|
+
hidden: []
|
39139
|
+
};
|
39140
|
+
for (var i = 0, l = fullOrder.length; i < l; i++) _orders[getColumnCategory(fullOrder[i])].push(fullOrder[i]);
|
39141
|
+
return _orders;
|
39142
|
+
}, [fullOrder, getColumnCategory]);
|
39143
|
+
var firsts = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
39144
|
+
return Object.fromEntries(Object.entries(orders).map(function (_ref) {
|
39145
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
39146
|
+
key = _ref2[0],
|
39147
|
+
_ref2$ = _slicedToArray(_ref2[1], 1),
|
39148
|
+
first = _ref2$[0];
|
39149
|
+
return first && [key, first];
|
39150
|
+
}).filter(Boolean));
|
39151
|
+
}, [orders]);
|
39152
|
+
var lasts = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
39153
|
+
return Object.fromEntries(Object.entries(orders).map(function (_ref3) {
|
39154
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
39155
|
+
key = _ref4[0],
|
39156
|
+
arr = _ref4[1];
|
39157
|
+
return arr.length && [key, arr[arr.length - 1]];
|
39158
|
+
}).filter(Boolean));
|
39159
|
+
}, [orders]);
|
39160
|
+
var setOrders = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (_ref5) {
|
39161
|
+
var pinned = _ref5.pinned,
|
39162
|
+
visible = _ref5.visible,
|
39163
|
+
hidden = _ref5.hidden;
|
39164
|
+
return setColumnOrder([].concat(_toConsumableArray(pinned), _toConsumableArray(visible), _toConsumableArray(hidden)));
|
39165
|
+
}, [setColumnOrder]);
|
39166
|
+
var moveBackwards = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
|
39167
|
+
var category = getColumnCategory(id);
|
39168
|
+
var arr = orders[category];
|
39169
|
+
var n = arr.indexOf(id);
|
39170
|
+
console.log('orders1', orders, category, n);
|
39171
|
+
if (n <= 0) return;
|
39172
|
+
var new_arr = arr.toSpliced(n, 1);
|
39173
|
+
new_arr.splice(n - 1, 0, id);
|
39174
|
+
var newOrder = _objectSpread({}, orders);
|
39175
|
+
newOrder[category] = new_arr;
|
39176
|
+
console.log('orders', orders, newOrder);
|
39177
|
+
setOrders(newOrder);
|
39178
|
+
}, [getColumnCategory, orders, setOrders]);
|
39179
|
+
var moveForward = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
|
39180
|
+
var category = getColumnCategory(id);
|
39181
|
+
var arr = orders[category];
|
39182
|
+
var n = arr.indexOf(id);
|
39183
|
+
if (n == -1 || n == arr.length - 1) return;
|
39184
|
+
var new_arr = arr.toSpliced(n, 1);
|
39185
|
+
new_arr.splice(n + 1, 0, id);
|
39186
|
+
var newOrder = _objectSpread({}, orders);
|
39187
|
+
newOrder[category] = new_arr;
|
39188
|
+
setOrders(newOrder);
|
39189
|
+
}, [getColumnCategory, orders, setOrders]);
|
39190
|
+
var moveColumn = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id, cat, n) {
|
39191
|
+
var srcCat = getColumnCategory(id);
|
39192
|
+
if (srcCat == cat && orders[srcCat][n] == id) return;
|
39193
|
+
var newOrders = _objectSpread({}, orders);
|
39194
|
+
newOrders[srcCat] = newOrders[srcCat].filter(function (_id) {
|
39195
|
+
return _id != id;
|
39196
|
+
});
|
39197
|
+
newOrders[cat] = newOrders.toSpliced(n, 0, id);
|
39198
|
+
setOrders(newOrders);
|
39199
|
+
if (srcCat == cat) return;
|
39200
|
+
if (srcCat == 'hidden' || cat == 'hidden') setHiddenColumns(newOrders.hidden);
|
39201
|
+
if (srcCat == 'pinned' || cat == 'pinned') setPinnedColumns(newOrders.pinned);
|
39202
|
+
}, [getColumnCategory, orders, setOrders, setHiddenColumns, setPinnedColumns]);
|
39203
|
+
var res = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
39204
|
+
return {
|
39205
|
+
orders: orders,
|
39206
|
+
firsts: firsts,
|
39207
|
+
lasts: lasts,
|
39208
|
+
setOrders: setOrders,
|
39209
|
+
moveBackwards: moveBackwards,
|
39210
|
+
moveForward: moveForward,
|
39211
|
+
moveColumn: moveColumn
|
39212
|
+
};
|
39213
|
+
}, [orders, firsts, lasts, setOrders, moveBackwards, moveForward, moveColumn]);
|
39214
|
+
return res;
|
39215
|
+
};
|
39216
|
+
|
39217
|
+
/***/ }),
|
39218
|
+
|
39003
39219
|
/***/ "./src/table/pagination.js":
|
39004
39220
|
/*!*********************************!*\
|
39005
39221
|
!*** ./src/table/pagination.js ***!
|