@luminati-io/uikit 3.4.16 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -37853,28 +37853,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
37853
37853
|
/* harmony export */ defaultContextValue: () => (/* binding */ defaultContextValue),
|
37854
37854
|
/* harmony export */ useTableContext: () => (/* binding */ useTableContext)
|
37855
37855
|
/* harmony export */ });
|
37856
|
-
/* harmony import */ var
|
37857
|
-
/* harmony import */ var
|
37858
|
-
/* harmony import */ var
|
37859
|
-
/* harmony import */ var
|
37860
|
-
/* harmony import */ var
|
37861
|
-
/* harmony import */ var
|
37862
|
-
/* harmony import */ var
|
37863
|
-
/* harmony import */ var
|
37864
|
-
/* harmony import */ var
|
37865
|
-
/* harmony import */ var
|
37866
|
-
/* harmony import */ var
|
37867
|
-
/* harmony import */ var
|
37868
|
-
/* harmony import */ var
|
37869
|
-
/* harmony import */ var
|
37870
|
-
/* harmony import */ var
|
37871
|
-
/* harmony import */ var
|
37856
|
+
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/omit */ "./node_modules/lodash/omit.js");
|
37857
|
+
/* harmony import */ var lodash_omit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_omit__WEBPACK_IMPORTED_MODULE_0__);
|
37858
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "prop-types");
|
37859
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
37860
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "react");
|
37861
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
37862
|
+
/* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-table */ "react-table");
|
37863
|
+
/* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_table__WEBPACK_IMPORTED_MODULE_3__);
|
37864
|
+
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../layout */ "./src/layout/index.js");
|
37865
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
37866
|
+
/* harmony import */ var _typography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typography */ "./src/typography/index.js");
|
37867
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
37868
|
+
/* harmony import */ var _editable_columns__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./editable_columns */ "./src/table/editable_columns.js");
|
37869
|
+
/* harmony import */ var _pinned_columns__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pinned_columns */ "./src/table/pinned_columns.js");
|
37870
|
+
/* harmony import */ var _expandable_rows__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./expandable_rows */ "./src/table/expandable_rows.js");
|
37871
|
+
/* harmony import */ var _select_rows__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./select_rows */ "./src/table/select_rows.js");
|
37872
|
+
/* harmony import */ var _row_menu__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./row_menu */ "./src/table/row_menu.js");
|
37873
|
+
/* harmony import */ var _order_logic__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./order_logic */ "./src/table/order_logic.js");
|
37872
37874
|
// LICENSE_CODE ZON
|
37873
37875
|
|
37874
37876
|
|
37875
37877
|
/*jslint react:true*/
|
37876
37878
|
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); }
|
37877
|
-
|
37879
|
+
|
37880
|
+
var _excluded = ["data", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns", "rowActions", "onColumnSortChanged"];
|
37878
37881
|
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; }
|
37879
37882
|
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; }
|
37880
37883
|
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; }
|
@@ -37910,48 +37913,37 @@ var defaultPropGetter = function defaultPropGetter() {
|
|
37910
37913
|
return {};
|
37911
37914
|
};
|
37912
37915
|
var defaultContextValue = {};
|
37913
|
-
var TableContext = /*#__PURE__*/
|
37916
|
+
var TableContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createContext(defaultContextValue);
|
37914
37917
|
TableContext.displayName = 'TableContext';
|
37915
37918
|
var Cell = function Cell(props) {
|
37916
|
-
return /*#__PURE__*/
|
37919
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_6__.Paragraph, {
|
37917
37920
|
variant: "sm",
|
37918
37921
|
color: "gray-11-50"
|
37919
37922
|
}, String(props.value));
|
37920
37923
|
};
|
37921
37924
|
var Provider = function Provider(props) {
|
37922
|
-
var defaultColumn = (0,
|
37925
|
+
var defaultColumn = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
37923
37926
|
return {
|
37924
37927
|
minWidth: 100,
|
37925
37928
|
Cell: Cell
|
37926
37929
|
};
|
37927
37930
|
}, []);
|
37928
|
-
var
|
37929
|
-
data = _props$data === void 0 ? [] : _props$data,
|
37930
|
-
_props$columnsSort = props.columnsSort,
|
37931
|
-
columnsSort = _props$columnsSort === void 0 ? {} : _props$columnsSort,
|
37931
|
+
var data = props.data,
|
37932
37932
|
pageSize = props.pageSize,
|
37933
|
-
|
37934
|
-
pageSizes = _props$pageSizes === void 0 ? [5, 10, 20, 30] : _props$pageSizes,
|
37933
|
+
pageSizes = props.pageSizes,
|
37935
37934
|
children = props.children,
|
37936
37935
|
stateManager = props.stateManager,
|
37937
|
-
|
37938
|
-
hooks = _props$hooks === void 0 ? [] : _props$hooks,
|
37936
|
+
hooks = props.hooks,
|
37939
37937
|
NoDataComp = props.NoDataComp,
|
37940
37938
|
LoadingComp = props.LoadingComp,
|
37941
|
-
|
37942
|
-
|
37943
|
-
|
37944
|
-
|
37945
|
-
_props$loadingText = props.loadingText,
|
37946
|
-
loadingText = _props$loadingText === void 0 ? 'Loading...' : _props$loadingText,
|
37947
|
-
_props$isLoading = props.isLoading,
|
37948
|
-
isLoading = _props$isLoading === void 0 ? false : _props$isLoading,
|
37939
|
+
ExpandHandleComp = props.ExpandHandleComp,
|
37940
|
+
noDataText = props.noDataText,
|
37941
|
+
loadingText = props.loadingText,
|
37942
|
+
isLoading = props.isLoading,
|
37949
37943
|
onPageChange = props.onPageChange,
|
37950
|
-
|
37951
|
-
manualPagination = _props$manualPaginati === void 0 ? false : _props$manualPaginati,
|
37944
|
+
manualPagination = props.manualPagination,
|
37952
37945
|
totalCount = props.totalCount,
|
37953
|
-
|
37954
|
-
paginateExpandedRows = _props$paginateExpand === void 0 ? false : _props$paginateExpand,
|
37946
|
+
paginateExpandedRows = props.paginateExpandedRows,
|
37955
37947
|
_props$getHeaderProps = props.getHeaderProps,
|
37956
37948
|
getHeaderProps = _props$getHeaderProps === void 0 ? defaultPropGetter : _props$getHeaderProps,
|
37957
37949
|
_props$getColumnProps = props.getColumnProps,
|
@@ -37963,18 +37955,18 @@ var Provider = function Provider(props) {
|
|
37963
37955
|
_props$getFooterProps = props.getFooterProps,
|
37964
37956
|
getFooterProps = _props$getFooterProps === void 0 ? defaultPropGetter : _props$getFooterProps,
|
37965
37957
|
selectedRowIds = props.selectedRowIds,
|
37966
|
-
|
37967
|
-
canOrderColumns = _props$canOrderColumn === void 0 ? false : _props$canOrderColumn,
|
37958
|
+
canOrderColumns = props.canOrderColumns,
|
37968
37959
|
rowActions = props.rowActions,
|
37960
|
+
onColumnSortChanged = props.onColumnSortChanged,
|
37969
37961
|
rest = _objectWithoutProperties(props, _excluded);
|
37970
|
-
var _useState = (0,
|
37962
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
37971
37963
|
_useState2 = _slicedToArray(_useState, 2),
|
37972
37964
|
pageCount = _useState2[0],
|
37973
37965
|
setPageCount = _useState2[1];
|
37974
|
-
var hiddenColumns = (stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('hiddenColumns')
|
37975
|
-
var pinnedColumns = (stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('pinnedColumns')
|
37976
|
-
var columnOrder = (stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('columnOrder')
|
37977
|
-
var initialState = assign({}, pageSize && {
|
37966
|
+
var hiddenColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('hiddenColumns'), props.hiddenColumns);
|
37967
|
+
var pinnedColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('pinnedColumns'), props.pinnedColumns);
|
37968
|
+
var columnOrder = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('columnOrder'), props.columnOrder);
|
37969
|
+
var initialState = assign({}, props.initialState, pageSize && {
|
37978
37970
|
pageSize: pageSize
|
37979
37971
|
}, hiddenColumns && {
|
37980
37972
|
hiddenColumns: hiddenColumns
|
@@ -37985,7 +37977,8 @@ var Provider = function Provider(props) {
|
|
37985
37977
|
}, selectedRowIds && {
|
37986
37978
|
selectedRowIds: selectedRowIds
|
37987
37979
|
});
|
37988
|
-
var
|
37980
|
+
var columnSort = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(props.columnSort, props.columnsSort);
|
37981
|
+
var table = react_table__WEBPACK_IMPORTED_MODULE_3__.useTable.apply(void 0, [_objectSpread({
|
37989
37982
|
data: data,
|
37990
37983
|
defaultColumn: defaultColumn,
|
37991
37984
|
initialState: initialState,
|
@@ -38001,14 +37994,14 @@ var Provider = function Provider(props) {
|
|
38001
37994
|
getCellProps: getCellProps,
|
38002
37995
|
getFooterProps: getFooterProps,
|
38003
37996
|
ExpandHandleComp: ExpandHandleComp
|
38004
|
-
}, rest), useCanHideColumns,
|
37997
|
+
}, lodash_omit__WEBPACK_IMPORTED_MODULE_0___default()(rest, 'initialState', 'hiddenColumns', 'pinnedColumns', 'columnOrder', 'columnSort', 'columnsSort')), useCanHideColumns, react_table__WEBPACK_IMPORTED_MODULE_3__.useExpanded, _expandable_rows__WEBPACK_IMPORTED_MODULE_10__.useExpandHandle, react_table__WEBPACK_IMPORTED_MODULE_3__.usePagination, props.fullWidth ? react_table__WEBPACK_IMPORTED_MODULE_3__.useFlexLayout : react_table__WEBPACK_IMPORTED_MODULE_3__.useBlockLayout, react_table__WEBPACK_IMPORTED_MODULE_3__.useResizeColumns, react_table__WEBPACK_IMPORTED_MODULE_3__.useColumnOrder, _pinned_columns__WEBPACK_IMPORTED_MODULE_9__.usePinnedColumns, _editable_columns__WEBPACK_IMPORTED_MODULE_8__.useEditableColumns, react_table__WEBPACK_IMPORTED_MODULE_3__.useRowSelect, _select_rows__WEBPACK_IMPORTED_MODULE_11__.useSelectRows].concat(_toConsumableArray(rowActions !== null && rowActions !== void 0 && rowActions.length ? [_row_menu__WEBPACK_IMPORTED_MODULE_12__.useRowMenu] : []), _toConsumableArray(hooks)));
|
38005
37998
|
var _table$state = table.state,
|
38006
37999
|
pageIndex = _table$state.pageIndex,
|
38007
38000
|
_pageSize = _table$state.pageSize;
|
38008
|
-
(0,
|
38001
|
+
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
38009
38002
|
stateManager === null || stateManager === void 0 || stateManager.onStateChange(table.state);
|
38010
38003
|
}, [table.state]);
|
38011
|
-
(0,
|
38004
|
+
(0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
38012
38005
|
if (!manualPagination) return;
|
38013
38006
|
setPageCount(calcPageCount(totalCount, _pageSize));
|
38014
38007
|
onPageChange === null || onPageChange === void 0 || onPageChange({
|
@@ -38018,9 +38011,10 @@ var Provider = function Provider(props) {
|
|
38018
38011
|
}, [manualPagination, totalCount, pageIndex, _pageSize]);
|
38019
38012
|
var _LoadingComp = useComp(loadingText, LoadingComp);
|
38020
38013
|
var _NoDataComp = useComp(noDataText, NoDataComp);
|
38021
|
-
var orderLogic = (0,
|
38014
|
+
var orderLogic = (0,_order_logic__WEBPACK_IMPORTED_MODULE_13__.useOrderLogic)(table);
|
38022
38015
|
var value = _objectSpread(_objectSpread({
|
38023
|
-
|
38016
|
+
columnSort: columnSort,
|
38017
|
+
onColumnSortChanged: onColumnSortChanged
|
38024
38018
|
}, table), {}, {
|
38025
38019
|
canOrderColumns: canOrderColumns,
|
38026
38020
|
orderLogic: orderLogic,
|
@@ -38028,17 +38022,17 @@ var Provider = function Provider(props) {
|
|
38028
38022
|
NoDataComp: _NoDataComp,
|
38029
38023
|
rowActions: rowActions
|
38030
38024
|
});
|
38031
|
-
return /*#__PURE__*/
|
38025
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableContext.Provider, {
|
38032
38026
|
value: value
|
38033
38027
|
}, children);
|
38034
38028
|
};
|
38035
38029
|
Provider.displayName = 'Table.Provider';
|
38036
38030
|
Provider.defaultProps = {
|
38037
38031
|
data: [],
|
38038
|
-
|
38032
|
+
columnSort: {},
|
38039
38033
|
pageSizes: [5, 10, 20, 30],
|
38040
38034
|
hooks: [],
|
38041
|
-
ExpandHandleComp:
|
38035
|
+
ExpandHandleComp: _expandable_rows__WEBPACK_IMPORTED_MODULE_10__.ExpandHandle,
|
38042
38036
|
noDataText: 'No data',
|
38043
38037
|
loadingText: 'Loading...',
|
38044
38038
|
isLoading: false,
|
@@ -38053,66 +38047,69 @@ Provider.defaultProps = {
|
|
38053
38047
|
canOrderColumns: false
|
38054
38048
|
};
|
38055
38049
|
Provider.propTypes = {
|
38056
|
-
columns:
|
38057
|
-
id: (
|
38058
|
-
accessor:
|
38059
|
-
type:
|
38060
|
-
Header:
|
38061
|
-
Cell: (
|
38062
|
-
Footer:
|
38063
|
-
can_sort:
|
38064
|
-
on_sort:
|
38065
|
-
|
38066
|
-
|
38067
|
-
|
38068
|
-
|
38069
|
-
|
38070
|
-
|
38071
|
-
|
38072
|
-
|
38050
|
+
columns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
38051
|
+
id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
|
38052
|
+
accessor: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
38053
|
+
type: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['string', 'number']),
|
38054
|
+
Header: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().node), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
38055
|
+
Cell: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38056
|
+
Footer: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().node), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
38057
|
+
// can_sort: PT.oneOfType([PT.bool, PT.number]),
|
38058
|
+
// on_sort: PT.func,
|
38059
|
+
canSort: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38060
|
+
disableHiding: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38061
|
+
width: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
38062
|
+
minWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
38063
|
+
maxWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
38064
|
+
disableResizing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38065
|
+
disablePinning: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38066
|
+
canEdit: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38067
|
+
className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
|
38073
38068
|
})),
|
38074
|
-
data: (
|
38075
|
-
columnsSort:
|
38076
|
-
|
38077
|
-
|
38078
|
-
|
38079
|
-
|
38080
|
-
|
38081
|
-
|
38082
|
-
|
38083
|
-
|
38084
|
-
|
38085
|
-
|
38086
|
-
|
38087
|
-
|
38088
|
-
|
38089
|
-
|
38090
|
-
|
38091
|
-
|
38092
|
-
|
38093
|
-
|
38094
|
-
|
38095
|
-
|
38096
|
-
|
38097
|
-
|
38098
|
-
|
38099
|
-
|
38100
|
-
|
38101
|
-
|
38102
|
-
|
38103
|
-
|
38104
|
-
|
38105
|
-
|
38106
|
-
|
38107
|
-
|
38108
|
-
|
38109
|
-
|
38069
|
+
data: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
38070
|
+
// columnsSort: PT.object,
|
38071
|
+
columnSort: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
|
38072
|
+
onColumnSortChanged: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38073
|
+
pageSize: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
38074
|
+
pageSizes: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)),
|
38075
|
+
manualPagination: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38076
|
+
totalCount: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
|
38077
|
+
paginateExpandedRows: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38078
|
+
onPageChange: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38079
|
+
isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38080
|
+
hiddenColumns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)),
|
38081
|
+
pinnedColumns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)),
|
38082
|
+
fullWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38083
|
+
disableHiding: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38084
|
+
disableResizing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38085
|
+
disablePinning: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38086
|
+
canEdit: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38087
|
+
hideHeader: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38088
|
+
hideFooter: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38089
|
+
getHeaderProps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38090
|
+
getColumnProps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38091
|
+
getRowProps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38092
|
+
getCellProps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38093
|
+
getFooterProps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38094
|
+
noDataText: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
38095
|
+
loadingText: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
38096
|
+
renderRowSubComponent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38097
|
+
rowDensity: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['busy_bee', 'diamond_hand', 'white_spaced']),
|
38098
|
+
onRowClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38099
|
+
stickyHeader: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)]),
|
38100
|
+
scrollTarget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().any),
|
38101
|
+
className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
38102
|
+
onSelectRows: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38103
|
+
canOrderColumns: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38104
|
+
rowActions: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
38105
|
+
scrollable: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38106
|
+
scrollHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
|
38110
38107
|
};
|
38111
38108
|
var calcPageCount = function calcPageCount(totalCount, pageSize) {
|
38112
38109
|
return Math.ceil(totalCount / pageSize);
|
38113
38110
|
};
|
38114
38111
|
var useTableContext = function useTableContext() {
|
38115
|
-
return (0,
|
38112
|
+
return (0,react__WEBPACK_IMPORTED_MODULE_2__.useContext)(TableContext);
|
38116
38113
|
};
|
38117
38114
|
|
38118
38115
|
// can hide columns
|
@@ -38122,25 +38119,25 @@ var useCanHideColumns = function useCanHideColumns(hooks) {
|
|
38122
38119
|
var disableHiding = instance.disableHiding,
|
38123
38120
|
flatHeaders = instance.flatHeaders;
|
38124
38121
|
flatHeaders.forEach(function (header) {
|
38125
|
-
header.canHide = (0,
|
38122
|
+
header.canHide = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(header.disableHiding === true ? false : undefined, disableHiding === true ? false : undefined, true);
|
38126
38123
|
});
|
38127
38124
|
});
|
38128
38125
|
};
|
38129
38126
|
useCanHideColumns.pluginName = 'useCanHideColumns';
|
38130
38127
|
var useComp = function useComp(text, Comp) {
|
38131
|
-
return (0,
|
38128
|
+
return (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
38132
38129
|
if (Comp) return Comp;
|
38133
38130
|
if (!text || typeof text != 'string' || text.trim() == '') return text;
|
38134
|
-
return /*#__PURE__*/
|
38131
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(EmptyBody, null, text);
|
38135
38132
|
}, [text, Comp]);
|
38136
38133
|
};
|
38137
38134
|
var EmptyBody = function EmptyBody(_ref) {
|
38138
38135
|
var children = _ref.children;
|
38139
|
-
return /*#__PURE__*/
|
38136
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_layout__WEBPACK_IMPORTED_MODULE_4__.Flex, {
|
38140
38137
|
align_items: "center",
|
38141
38138
|
width: "100%",
|
38142
|
-
padding: "".concat(
|
38143
|
-
}, /*#__PURE__*/
|
38139
|
+
padding: "".concat(_theme__WEBPACK_IMPORTED_MODULE_5__["default"].spacing['04'], " ").concat(_theme__WEBPACK_IMPORTED_MODULE_5__["default"].spacing['05'])
|
38140
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_6__.Label, {
|
38144
38141
|
color: "gray_11_50"
|
38145
38142
|
}, children));
|
38146
38143
|
};
|
@@ -38827,27 +38824,26 @@ var HeaderCell = function HeaderCell(props) {
|
|
38827
38824
|
isLast = props.isLast;
|
38828
38825
|
var id = header.id,
|
38829
38826
|
name = header.name,
|
38830
|
-
on_sort = header.on_sort,
|
38831
38827
|
isResizing = header.isResizing,
|
38832
38828
|
getResizerProps = header.getResizerProps;
|
38833
38829
|
var _useTableContext2 = (0,_context__WEBPACK_IMPORTED_MODULE_8__.useTableContext)(),
|
38834
38830
|
getColumnProps = _useTableContext2.getColumnProps,
|
38835
38831
|
getHeaderProps = _useTableContext2.getHeaderProps,
|
38836
|
-
|
38832
|
+
columnSort = _useTableContext2.columnSort,
|
38837
38833
|
fullWidth = _useTableContext2.fullWidth,
|
38838
38834
|
canOrderColumns = _useTableContext2.canOrderColumns,
|
38839
|
-
orderLogic = _useTableContext2.orderLogic
|
38840
|
-
|
38841
|
-
var
|
38842
|
-
var
|
38843
|
-
|
38844
|
-
|
38845
|
-
|
38846
|
-
|
38847
|
-
|
38848
|
-
|
38849
|
-
}
|
38850
|
-
}, [id, sort,
|
38835
|
+
orderLogic = _useTableContext2.orderLogic,
|
38836
|
+
onColumnSortChanged = _useTableContext2.onColumnSortChanged;
|
38837
|
+
var sort = columnSort[id];
|
38838
|
+
var onSortChanged = (0,_util__WEBPACK_IMPORTED_MODULE_5__.firstDefined)(onColumnSortChanged, header.on_sort);
|
38839
|
+
var canSort = (0,_util__WEBPACK_IMPORTED_MODULE_5__.firstDefined)(header.canSort, header.can_sort) && !!onColumnSortChanged;
|
38840
|
+
var onSort = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function () {
|
38841
|
+
onSortChanged === null || onSortChanged === void 0 || onSortChanged(id, {
|
38842
|
+
asc: 'desc',
|
38843
|
+
desc: undefined,
|
38844
|
+
none: 'asc'
|
38845
|
+
}[sort || 'none']);
|
38846
|
+
}, [id, sort, onColumnSortChanged]);
|
38851
38847
|
var canResize = header.canResize && !(fullWidth && isLast) && !compact;
|
38852
38848
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false),
|
38853
38849
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -38866,29 +38862,32 @@ var HeaderCell = function HeaderCell(props) {
|
|
38866
38862
|
return setHovered(false);
|
38867
38863
|
}
|
38868
38864
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(HeaderCellWrapper, null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(HeaderCellLeft, {
|
38869
|
-
|
38870
|
-
|
38865
|
+
style: canSort ? {
|
38866
|
+
cursor: 'pointer'
|
38867
|
+
} : undefined,
|
38868
|
+
onClick: onSort
|
38871
38869
|
}, !compact && renderCellContent(header, 'Header', {
|
38872
38870
|
compact: compact
|
38873
38871
|
}), compact && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_4__.Label, {
|
38874
38872
|
variant: "sm",
|
38875
38873
|
color: "gray_11",
|
38876
38874
|
no_wrap: true
|
38877
|
-
}, name || id), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_sort_icon__WEBPACK_IMPORTED_MODULE_10__.SortIcon, {
|
38875
|
+
}, name || id), canSort && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_sort_icon__WEBPACK_IMPORTED_MODULE_10__.SortIcon, {
|
38878
38876
|
visible: !!iconVisible,
|
38879
38877
|
reverse: sort == 'desc'
|
38880
38878
|
})), !compact && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_header_functions__WEBPACK_IMPORTED_MODULE_9__.HeaderFunctions, {
|
38881
38879
|
header: header,
|
38882
38880
|
visible: hovered,
|
38881
|
+
canSort: canSort,
|
38883
38882
|
onItemClick: function onItemClick() {
|
38884
38883
|
return setHovered(false);
|
38885
38884
|
},
|
38886
|
-
orderLogic: canOrderColumns && orderLogic
|
38885
|
+
orderLogic: canOrderColumns && orderLogic,
|
38886
|
+
onSortChanged: onSortChanged
|
38887
38887
|
}), canResize && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(HeaderCellResizer, _extends({}, getResizerProps(), {
|
38888
38888
|
$isResizing: isResizing
|
38889
38889
|
}))));
|
38890
38890
|
};
|
38891
|
-
HeaderCell.displayName = 'HeaderCell';
|
38892
38891
|
var HeaderCellContent = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withConfig({
|
38893
38892
|
displayName: "HeaderCellContent",
|
38894
38893
|
componentId: "sc-8zg5t0-0"
|
@@ -38897,14 +38896,10 @@ var HeaderCellWrapper = styled_components__WEBPACK_IMPORTED_MODULE_2___default()
|
|
38897
38896
|
displayName: "HeaderCellWrapper",
|
38898
38897
|
componentId: "sc-8zg5t0-1"
|
38899
38898
|
})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 8px 8px 16px;"]);
|
38900
|
-
HeaderCellWrapper.displayName = 'HeaderCellWrapper';
|
38901
38899
|
var HeaderCellLeft = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withConfig({
|
38902
38900
|
displayName: "HeaderCellLeft",
|
38903
38901
|
componentId: "sc-8zg5t0-2"
|
38904
|
-
})(["display:flex;flex-direction:row;align-items:center;padding:0px;gap:4px;min-height:16px;overflow-x:clip;"
|
38905
|
-
return props.$canSort ? 'cursor: pointer;' : null;
|
38906
|
-
});
|
38907
|
-
HeaderCellLeft.displayName = 'HeaderCellLeft';
|
38902
|
+
})(["display:flex;flex-direction:row;align-items:center;padding:0px;gap:4px;min-height:16px;overflow-x:clip;"]);
|
38908
38903
|
var HeaderCellResizer = styled_components__WEBPACK_IMPORTED_MODULE_2___default().div.withConfig({
|
38909
38904
|
displayName: "HeaderCellResizer",
|
38910
38905
|
componentId: "sc-8zg5t0-3"
|
@@ -38913,7 +38908,6 @@ var HeaderCellResizer = styled_components__WEBPACK_IMPORTED_MODULE_2___default()
|
|
38913
38908
|
return (0,styled_components__WEBPACK_IMPORTED_MODULE_2__.css)(["&:after{content:\" \";display:block;width:2px;height:24px;background:", ";position:absolute;bottom:0;left:4px;}"], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].color.blue_10);
|
38914
38909
|
}
|
38915
38910
|
});
|
38916
|
-
HeaderCellResizer.displayName = 'HeaderCellResizer';
|
38917
38911
|
var renderCellContent = function renderCellContent(column, type, props) {
|
38918
38912
|
var content = column[type];
|
38919
38913
|
if (lodash_isString__WEBPACK_IMPORTED_MODULE_0___default()(content)) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_typography__WEBPACK_IMPORTED_MODULE_4__.Label, {
|
@@ -38968,14 +38962,14 @@ var HeaderFunctions = function HeaderFunctions(props) {
|
|
38968
38962
|
var header = props.header,
|
38969
38963
|
visible = props.visible,
|
38970
38964
|
onItemClick = props.onItemClick,
|
38971
|
-
orderLogic = props.orderLogic
|
38965
|
+
orderLogic = props.orderLogic,
|
38966
|
+
canSort = props.canSort,
|
38967
|
+
onSortChanged = props.onSortChanged;
|
38972
38968
|
if ((0,_order_logic__WEBPACK_IMPORTED_MODULE_9__.isSysColumn)(header.id)) return null;
|
38973
38969
|
var id = header.id,
|
38974
|
-
on_sort = header.on_sort,
|
38975
38970
|
canHide = header.canHide,
|
38976
|
-
|
38977
|
-
|
38978
|
-
var canSort = header.can_sort && header.on_sort;
|
38971
|
+
canPin = header.canPin,
|
38972
|
+
getToggleHiddenProps = header.getToggleHiddenProps;
|
38979
38973
|
var items = [];
|
38980
38974
|
if (orderLogic) {
|
38981
38975
|
var firsts = orderLogic.firsts,
|
@@ -39014,14 +39008,14 @@ var HeaderFunctions = function HeaderFunctions(props) {
|
|
39014
39008
|
id: 'sort_asc',
|
39015
39009
|
children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SortColumn, {
|
39016
39010
|
id: id,
|
39017
|
-
onSort:
|
39011
|
+
onSort: onSortChanged,
|
39018
39012
|
sort: "asc"
|
39019
39013
|
})
|
39020
39014
|
}, {
|
39021
39015
|
id: 'sort_desc',
|
39022
39016
|
children: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(SortColumn, {
|
39023
39017
|
id: id,
|
39024
|
-
onSort:
|
39018
|
+
onSort: onSortChanged,
|
39025
39019
|
sort: "desc"
|
39026
39020
|
})
|
39027
39021
|
});
|