ab-ui-library 1.56.0 → 1.56.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.
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TTableProps } from './types';
|
|
2
2
|
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
-
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange, rowClassName, }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Table<TData>({ data, columns, isLoading, hasError, isActionsVisible, totalCount, emptyTitle, emptySubTitle, emptyButtonProps, emptyIllustration, withSelect, withBorder, defaultPageIndex, defaultPageSize, defaultHiddenColumns, collapsibleRows, renderExpandedContent, renderHeader, renderFooter, onSortChange, onRowClick, tableSettings, onRowSelection, onColumnSizing, onPaginationChange, rowEventsProps, activeRowId, getRowId, resetExpandedOnPageChange, rowClassName, }: TTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -88,6 +88,7 @@ function Table(_ref2) {
|
|
|
88
88
|
totalCount = _ref2$totalCount === void 0 ? 0 : _ref2$totalCount,
|
|
89
89
|
emptyTitle = _ref2.emptyTitle,
|
|
90
90
|
emptySubTitle = _ref2.emptySubTitle,
|
|
91
|
+
emptyButtonProps = _ref2.emptyButtonProps,
|
|
91
92
|
emptyIllustration = _ref2.emptyIllustration,
|
|
92
93
|
_ref2$withSelect = _ref2.withSelect,
|
|
93
94
|
withSelect = _ref2$withSelect === void 0 ? false : _ref2$withSelect,
|
|
@@ -232,7 +233,8 @@ function Table(_ref2) {
|
|
|
232
233
|
}, !isLoading && (!(data !== null && data !== void 0 && data.length) || hasError) ? /*#__PURE__*/React.createElement(Empty, {
|
|
233
234
|
mainMessage: emptyTitle,
|
|
234
235
|
paragraphMessage: emptySubTitle,
|
|
235
|
-
illustration: emptyIllustration
|
|
236
|
+
illustration: emptyIllustration,
|
|
237
|
+
buttonProps: emptyButtonProps
|
|
236
238
|
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("thead", {
|
|
237
239
|
className: "advanced-table__thead"
|
|
238
240
|
}, table.getHeaderGroups().map(function (headerGroup) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColumnDef, ColumnSizingState, PaginationState, RowSelectionState, Table, Row } from '@tanstack/react-table';
|
|
2
2
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
import type { TButtonPropTypes } from '../Button/types';
|
|
3
4
|
export type TTable<TData> = Table<TData>;
|
|
4
5
|
export type TRowSelectionState = RowSelectionState;
|
|
5
6
|
export type TColumnSizingState = ColumnSizingState;
|
|
@@ -18,6 +19,7 @@ export type TTableProps<TData> = {
|
|
|
18
19
|
hasError?: boolean;
|
|
19
20
|
emptyTitle?: string;
|
|
20
21
|
emptySubTitle?: string;
|
|
22
|
+
emptyButtonProps?: TButtonPropTypes;
|
|
21
23
|
emptyIllustration?: string;
|
|
22
24
|
className?: string;
|
|
23
25
|
withSelect?: boolean;
|
|
@@ -247,6 +247,10 @@ var Select = function Select(props) {
|
|
|
247
247
|
return onItemSelect(null);
|
|
248
248
|
};
|
|
249
249
|
var onOpenOptions = function onOpenOptions(e) {
|
|
250
|
+
var selected = getSelectedOption();
|
|
251
|
+
if (selected !== null && selected !== void 0 && selected.label && isCreateOnOutsideClick) {
|
|
252
|
+
setSearchValue("".concat(selected.label));
|
|
253
|
+
}
|
|
250
254
|
var result = e === null || e === void 0 ? void 0 : e.target;
|
|
251
255
|
var className = result === null || result === void 0 ? void 0 : result.getAttribute('class');
|
|
252
256
|
if (e && className && (className.indexOf('icon-') !== -1 || className.indexOf('svg-icon') !== -1)) {
|