@vectara/vectara-ui 15.5.1 → 15.5.3
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.
|
@@ -37,5 +37,5 @@ export const VuiNotification = ({ color, message, onDismiss, children, hasCopyBu
|
|
|
37
37
|
icon = null;
|
|
38
38
|
}
|
|
39
39
|
const copyValue = code ? `${message}\n\n${code.content}` : message;
|
|
40
|
-
return (_jsx("div", Object.assign({ className: classes, "data-testid": `notification-${color}` }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "s" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: 1 }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "xs" }, { children: [icon, _jsxs("div", { children: [_jsx(VuiText, { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: message })) }), code && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCode, Object.assign({ language: code.language }, { children: code.content }))] })), hasCopyButton && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: copyValue, size: "s", label: "Copy" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] })), link && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiLink, Object.assign({}, link))] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
40
|
+
return (_jsx("div", Object.assign({ className: classes, "data-testid": `notification-${color}` }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "s" }, { children: [_jsx(VuiFlexItem, Object.assign({ grow: 1 }, { children: _jsxs(VuiFlexContainer, Object.assign({ alignItems: "start", spacing: "xs" }, { children: [icon, _jsxs("div", { children: [_jsx(VuiText, { children: _jsx(VuiTextColor, Object.assign({ color: color }, { children: message })) }), code && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCode, Object.assign({ language: code.language }, { children: code.content }))] })), hasCopyButton && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiCopyButton, { value: copyValue, size: "s", label: "Copy" })] })), children && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), children] })), link && (_jsxs(_Fragment, { children: [_jsx(VuiSpacer, { size: "s" }), _jsx(VuiLink, Object.assign({}, link))] }))] })] })) })), _jsx(VuiFlexItem, Object.assign({ grow: false, shrink: false }, { children: _jsx(VuiIconButton, { "aria-label": "Dismiss message", size: "xs", color: "neutral", icon: _jsx(VuiIcon, { children: _jsx(BiX, {}) }), onClick: () => onDismiss(), "data-testid": `dismissNotificationButton-${color}` }) }))] })) })));
|
|
41
41
|
};
|
|
@@ -28,6 +28,8 @@ type Props<T> = {
|
|
|
28
28
|
isHeaderSticky?: boolean;
|
|
29
29
|
isResponsive?: boolean;
|
|
30
30
|
collapsedContent?: (row: T) => React.ReactNode;
|
|
31
|
+
defaultSortColumn?: string;
|
|
32
|
+
defaultSortDirection?: "asc" | "desc";
|
|
31
33
|
};
|
|
32
34
|
type BodyStyle = {
|
|
33
35
|
verticalAlign?: "top" | "middle" | "bottom";
|
|
@@ -39,5 +41,5 @@ type Selection<T> = {
|
|
|
39
41
|
selectedRows?: T[];
|
|
40
42
|
};
|
|
41
43
|
type Search = TextInputProps;
|
|
42
|
-
export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, isHeaderSticky, isResponsive, collapsedContent, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, isHeaderSticky, isResponsive, collapsedContent, defaultSortColumn, defaultSortDirection, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
export {};
|
|
@@ -44,10 +44,10 @@ const extractId = (row, idField) => {
|
|
|
44
44
|
// https://github.com/typescript-eslint/typescript-eslint/issues/4062
|
|
45
45
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint
|
|
46
46
|
export const VuiTable = (_a) => {
|
|
47
|
-
var { isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled = false, bodyStyle, isHeaderSticky, isResponsive = true, collapsedContent } = _a, rest = __rest(_a, ["isLoading", "idField", "rowDecorator", "columns", "rows", "actions", "actionsTestIdProvider", "reloadTestId", "pagination", "selection", "search", "customControls", "onSort", "onReload", "content", "className", "fluid", "isDisabled", "bodyStyle", "isHeaderSticky", "isResponsive", "collapsedContent"]);
|
|
47
|
+
var { isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled = false, bodyStyle, isHeaderSticky, isResponsive = true, collapsedContent, defaultSortColumn, defaultSortDirection } = _a, rest = __rest(_a, ["isLoading", "idField", "rowDecorator", "columns", "rows", "actions", "actionsTestIdProvider", "reloadTestId", "pagination", "selection", "search", "customControls", "onSort", "onReload", "content", "className", "fluid", "isDisabled", "bodyStyle", "isHeaderSticky", "isResponsive", "collapsedContent", "defaultSortColumn", "defaultSortDirection"]);
|
|
48
48
|
const [rowBeingActedUpon, setRowBeingActedUpon] = useState(undefined);
|
|
49
|
-
const [sortColumn, setSortColumn] = useState(null);
|
|
50
|
-
const [sortDirection, setSortDirection] = useState("none");
|
|
49
|
+
const [sortColumn, setSortColumn] = useState(defaultSortColumn !== null && defaultSortColumn !== void 0 ? defaultSortColumn : null);
|
|
50
|
+
const [sortDirection, setSortDirection] = useState(defaultSortDirection !== null && defaultSortDirection !== void 0 ? defaultSortDirection : "none");
|
|
51
51
|
const [expandedRowIds, setExpandedRowIds] = useState(new Set());
|
|
52
52
|
const { bulkActions, isRowSelectable, onSelectRow, selectedRows } = selection || {};
|
|
53
53
|
const { value: searchValue } = search || {};
|