@ssa-ui-kit/core 3.23.1 → 3.24.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/dist/ai/source-map.md +149 -43
- package/dist/components/Calendar/Calendar.d.ts +130 -0
- package/dist/components/Calendar/CalendarContext.d.ts +25 -0
- package/dist/components/Calendar/CalendarEventDetails.d.ts +80 -0
- package/dist/components/Calendar/components/CalendarToolbar.d.ts +20 -0
- package/dist/components/Calendar/components/DayView.d.ts +14 -0
- package/dist/components/Calendar/components/EventDetailsLayer.d.ts +17 -0
- package/dist/components/Calendar/components/EventSlot.d.ts +17 -0
- package/dist/components/Calendar/components/HighlightBadge.d.ts +5 -0
- package/dist/components/Calendar/components/MonthView.d.ts +19 -0
- package/dist/components/Calendar/components/MoreEventsPopover.d.ts +16 -0
- package/dist/components/Calendar/components/TaskCheckbox.d.ts +8 -0
- package/dist/components/Calendar/components/useEventClick.d.ts +10 -0
- package/dist/components/Calendar/consts.d.ts +49 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Calendar/styles.d.ts +137 -0
- package/dist/components/Calendar/types.d.ts +383 -0
- package/dist/components/Calendar/utils.d.ts +116 -0
- package/dist/components/Carousel/Carousel.d.ts +8 -2
- package/dist/components/Carousel/FullImageModal.d.ts +12 -0
- package/dist/components/Carousel/styles.d.ts +5 -0
- package/dist/components/Carousel/types.d.ts +17 -4
- package/dist/components/Charts/FunnelChart/FunnelChart.d.ts +4 -3
- package/dist/components/Charts/FunnelChart/types.d.ts +11 -1
- package/dist/components/Charts/FunnelChart/utils.d.ts +12 -1
- package/dist/components/NestedTable/NestedTableContext.d.ts +3 -3
- package/dist/components/NestedTable/components/NestedTable.d.ts +37 -4
- package/dist/components/NestedTable/components/NestedTableCell.d.ts +2 -3
- package/dist/components/NestedTable/components/NestedTableCellBase.d.ts +16 -0
- package/dist/components/NestedTable/components/NestedTableCellHeader.d.ts +36 -0
- package/dist/components/NestedTable/components/index.d.ts +1 -0
- package/dist/components/NestedTable/consts.d.ts +5 -0
- package/dist/components/NestedTable/hooks/useNestedTableContext.d.ts +1 -1
- package/dist/components/NestedTable/types.d.ts +31 -0
- package/dist/components/Table/ColumnFreezeContext.d.ts +27 -0
- package/dist/components/Table/ColumnFreezeMenu.d.ts +33 -0
- package/dist/components/Table/TableBase.d.ts +8 -1
- package/dist/components/Table/hooks/useColumnFreeze.d.ts +44 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/types.d.ts +97 -2
- package/dist/components/Table/utils.d.ts +21 -0
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +2 -1
- package/dist/components/TableCellHeader/types.d.ts +17 -0
- package/dist/components/TableContainer/TableContainer.d.ts +50 -0
- package/dist/components/TableContainer/index.d.ts +2 -0
- package/dist/components/TableContainer/types.d.ts +21 -0
- package/dist/components/index.d.ts +6 -2
- package/dist/index.js +4158 -386
- package/dist/index.mjs +4154 -388
- package/dist/tsbuildcache +1 -1
- package/dist/types/emotion.d.ts +2 -0
- package/package.json +3 -3
|
@@ -97,6 +97,12 @@ export interface UseColumnResizeOptions extends ColumnResizeOptions {
|
|
|
97
97
|
export interface ColumnResizeApi {
|
|
98
98
|
/** Current width of each column, in pixels. Empty until measured. */
|
|
99
99
|
columnWidths: number[];
|
|
100
|
+
/**
|
|
101
|
+
* Positions of the columns the table added on its own, such as the toggle
|
|
102
|
+
* column of a `NestedTable`. In `fit` mode they keep their width exactly,
|
|
103
|
+
* and only the other columns share out any space the table has to spare.
|
|
104
|
+
*/
|
|
105
|
+
fixedColumns: number[];
|
|
100
106
|
/** Attach to the `table` element so the hook can measure its columns. */
|
|
101
107
|
tableRef: RefObject<HTMLTableElement | null>;
|
|
102
108
|
/** Whether a drag is in progress. */
|
|
@@ -119,11 +125,100 @@ export interface ColumnResizeApi {
|
|
|
119
125
|
/** Builds the props for the drag handle of a given column. */
|
|
120
126
|
getResizeHandleProps: (index: number) => ResizeHandleProps;
|
|
121
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Identifies a table column: the `columnId` of its `TableCellHeader`, or its
|
|
130
|
+
* zero-based position when the header has none. Ids are compared as strings,
|
|
131
|
+
* so `3` and `'3'` are the same column.
|
|
132
|
+
*/
|
|
133
|
+
export type ColumnId = string | number;
|
|
134
|
+
/**
|
|
135
|
+
* Which columns of a {@link Table} are frozen, and to which edge.
|
|
136
|
+
*
|
|
137
|
+
* A frozen column stays where it is until scrolling would take it out of view;
|
|
138
|
+
* from then on it sticks to its edge and the columns between it and the edge
|
|
139
|
+
* slide underneath. Several frozen columns on one edge stack up in column
|
|
140
|
+
* order.
|
|
141
|
+
*
|
|
142
|
+
* Give the header cells a `columnId` so the frozen state follows the column
|
|
143
|
+
* when the app hides or reorders columns; without one, a column is
|
|
144
|
+
* identified by its position.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```tsx
|
|
148
|
+
* const frozen: FrozenColumns = { start: ['name', 'status'], end: ['actions'] };
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export interface FrozenColumns {
|
|
152
|
+
/**
|
|
153
|
+
* Columns that stick to the left edge.
|
|
154
|
+
* @default []
|
|
155
|
+
*/
|
|
156
|
+
start?: ColumnId[];
|
|
157
|
+
/**
|
|
158
|
+
* Columns that stick to the right edge.
|
|
159
|
+
* @default []
|
|
160
|
+
*/
|
|
161
|
+
end?: ColumnId[];
|
|
162
|
+
}
|
|
163
|
+
/** Which columns, by position, are frozen to each edge, in column order. */
|
|
164
|
+
export interface FrozenColumnIndices {
|
|
165
|
+
start: number[];
|
|
166
|
+
end: number[];
|
|
167
|
+
}
|
|
168
|
+
/** Options for freezing columns and the header row of a `Table`. */
|
|
169
|
+
export interface ColumnFreezeOptions {
|
|
170
|
+
/**
|
|
171
|
+
* Columns frozen to each edge. Passing this prop puts freezing into
|
|
172
|
+
* controlled mode — hold the value in state and update it from
|
|
173
|
+
* `onFrozenColumnsChange`, or the header controls will have no effect.
|
|
174
|
+
*/
|
|
175
|
+
frozenColumns?: FrozenColumns;
|
|
176
|
+
/** Columns frozen to each edge to begin with, for the uncontrolled case. */
|
|
177
|
+
defaultFrozenColumns?: FrozenColumns;
|
|
178
|
+
/**
|
|
179
|
+
* Called whenever the user freezes or unfreezes columns from the header
|
|
180
|
+
* controls. Always receives both lists.
|
|
181
|
+
*/
|
|
182
|
+
onFrozenColumnsChange?: (frozenColumns: Required<FrozenColumns>) => void;
|
|
183
|
+
/**
|
|
184
|
+
* Gives every `TableCellHeader` a menu to freeze its column to either edge,
|
|
185
|
+
* or unfreeze it. Independent of `frozenColumns` — a table can have frozen
|
|
186
|
+
* columns without letting the user change them.
|
|
187
|
+
*
|
|
188
|
+
* @default false
|
|
189
|
+
*/
|
|
190
|
+
freezeControls?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Keeps the header row in view while the table scrolls vertically. Needs a
|
|
193
|
+
* scroll container with a height limit, such as `TableContainer` with
|
|
194
|
+
* `maxHeight`.
|
|
195
|
+
*
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
198
|
+
stickyHeader?: boolean;
|
|
199
|
+
}
|
|
200
|
+
/** Props for {@link ColumnFreezeMenu}. */
|
|
201
|
+
export interface ColumnFreezeMenuProps {
|
|
202
|
+
/**
|
|
203
|
+
* The column the menu freezes. Defaults to the `data-column-id` of the
|
|
204
|
+
* header cell it sits in, or that cell's position.
|
|
205
|
+
*/
|
|
206
|
+
columnId?: ColumnId;
|
|
207
|
+
}
|
|
208
|
+
/** What the freezing context hands to header cells. */
|
|
209
|
+
export interface ColumnFreezeApi {
|
|
210
|
+
/** Current frozen columns, both lists always present. */
|
|
211
|
+
frozenColumns: Required<FrozenColumns>;
|
|
212
|
+
/** Replaces the frozen columns and notifies `onFrozenColumnsChange`. */
|
|
213
|
+
setFrozenColumns: (frozenColumns: Required<FrozenColumns>) => void;
|
|
214
|
+
/** Whether header cells should render the freeze menu. */
|
|
215
|
+
freezeControls: boolean;
|
|
216
|
+
}
|
|
122
217
|
/**
|
|
123
218
|
* Props for the {@link Table} component.
|
|
124
219
|
*
|
|
125
220
|
* Every attribute of a `table` element, plus the column-resizing options that
|
|
126
|
-
* `resizableColumns` turns on.
|
|
221
|
+
* `resizableColumns` turns on and the column-freezing options.
|
|
127
222
|
*
|
|
128
223
|
* @example
|
|
129
224
|
* ```tsx
|
|
@@ -132,7 +227,7 @@ export interface ColumnResizeApi {
|
|
|
132
227
|
* </Table>
|
|
133
228
|
* ```
|
|
134
229
|
*/
|
|
135
|
-
export interface TableProps extends CommonProps, ColumnResizeOptions, TableHTMLAttributes<HTMLTableElement> {
|
|
230
|
+
export interface TableProps extends CommonProps, ColumnResizeOptions, ColumnFreezeOptions, TableHTMLAttributes<HTMLTableElement> {
|
|
136
231
|
/**
|
|
137
232
|
* Lets columns be resized by dragging the right edge of each header cell.
|
|
138
233
|
*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ColumnId } from './types';
|
|
2
|
+
/** The cells that define the column grid — the first header row, or row one. */
|
|
3
|
+
export declare const getHeaderCells: (table: HTMLTableElement | null) => HTMLTableCellElement[];
|
|
4
|
+
/**
|
|
5
|
+
* Marks a structural column the table adds on its own, such as the toggle
|
|
6
|
+
* column `NestedTableRow` puts in front of every row. It has no id of its own,
|
|
7
|
+
* is skipped when columns are numbered, and freezes to the start only when the
|
|
8
|
+
* column right after it does.
|
|
9
|
+
*/
|
|
10
|
+
export declare const EXPANDER_ATTR = "data-column-expander";
|
|
11
|
+
export declare const isExpanderCell: (cell: HTMLTableCellElement) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The id each cell answers to: its `columnId`, else its position counting only
|
|
14
|
+
* the columns the app itself rendered. `null` for expander cells.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getColumnKeys: (cells: HTMLTableCellElement[]) => (string | null)[];
|
|
17
|
+
/**
|
|
18
|
+
* The id of the column a header cell belongs to: its `columnId`, else its
|
|
19
|
+
* position as a number. `null` for an expander. See getColumnKeys.
|
|
20
|
+
*/
|
|
21
|
+
export declare const getColumnIdOf: (cell: HTMLTableCellElement) => ColumnId | null;
|
|
@@ -54,6 +54,7 @@ import { TableCellHeaderProps } from './types';
|
|
|
54
54
|
* @see {@link TableCell} - Data cell component (use in TableBody)
|
|
55
55
|
* @see {@link TableBody} - Body section component
|
|
56
56
|
* @see {@link ColumnResizeHandle} - the handle rendered inside resizable headers
|
|
57
|
+
* @see {@link ColumnFreezeMenu} - the menu rendered when the table has `freezeControls`
|
|
57
58
|
*
|
|
58
59
|
* @accessibility
|
|
59
60
|
* - Semantic HTML th element (renders as th)
|
|
@@ -61,5 +62,5 @@ import { TableCellHeaderProps } from './types';
|
|
|
61
62
|
* - Supports ARIA attributes via TableCellProps
|
|
62
63
|
* - Better accessibility than using TableCell in headers
|
|
63
64
|
*/
|
|
64
|
-
declare const TableCellHeader: ({ children, resizable, ...props }: React.PropsWithChildren<TableCellHeaderProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
65
|
+
declare const TableCellHeader: ({ children, resizable, freezable, columnId, ...props }: React.PropsWithChildren<TableCellHeaderProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
65
66
|
export default TableCellHeader;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TableCellProps } from '../TableCell/types';
|
|
2
|
+
import { ColumnId } from '../Table/types';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the TableCellHeader component
|
|
4
5
|
*
|
|
@@ -42,4 +43,20 @@ export interface TableCellHeaderProps extends TableCellProps {
|
|
|
42
43
|
* @default true
|
|
43
44
|
*/
|
|
44
45
|
resizable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether this header cell offers the freeze menu inside a `Table` with
|
|
48
|
+
* `freezeControls`. Set it to `false` for columns the user should not
|
|
49
|
+
* freeze, such as a checkbox column. The app can still freeze it through
|
|
50
|
+
* `frozenColumns`.
|
|
51
|
+
*
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
54
|
+
freezable?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Stable id for this column, used by `frozenColumns` on the `Table`. Give
|
|
57
|
+
* every header one when the app can hide or reorder columns, so frozen
|
|
58
|
+
* state follows the column rather than its position. Without it the column
|
|
59
|
+
* is identified by its zero-based position.
|
|
60
|
+
*/
|
|
61
|
+
columnId?: ColumnId;
|
|
45
62
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TableContainerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* TableContainer - The scroll area around a table
|
|
4
|
+
*
|
|
5
|
+
* Caps the table at the width of its parent and, with `maxHeight`, at a
|
|
6
|
+
* height, scrolling whatever does not fit. It is what frozen columns and a
|
|
7
|
+
* sticky header stick to, but it is just as useful around a plain wide
|
|
8
|
+
* table.
|
|
9
|
+
*
|
|
10
|
+
* It draws the white, 20px-rounded card the table sits on, so the scrollbars
|
|
11
|
+
* stay inside the card. Override the look with `css` or `className`.
|
|
12
|
+
*
|
|
13
|
+
* @category Components
|
|
14
|
+
* @subcategory Data Display
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // A wide table that scrolls sideways
|
|
19
|
+
* <TableContainer>
|
|
20
|
+
* <Table>{children}</Table>
|
|
21
|
+
* </TableContainer>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // Frozen first column and header in a 480px-tall scroll area
|
|
27
|
+
* <TableContainer maxHeight={480}>
|
|
28
|
+
* <Table stickyHeader defaultFrozenColumns={{ start: [0] }} freezeControls>
|
|
29
|
+
* {children}
|
|
30
|
+
* </Table>
|
|
31
|
+
* </TableContainer>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // A different card
|
|
37
|
+
* <TableContainer css={{ borderRadius: 8, background: 'transparent' }}>
|
|
38
|
+
* <Table>{children}</Table>
|
|
39
|
+
* </TableContainer>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see {@link Table} - `frozenColumns`, `freezeControls` and `stickyHeader`
|
|
43
|
+
*
|
|
44
|
+
* @accessibility
|
|
45
|
+
* - A plain `div`; give it `tabIndex={0}`, a `role="region"` and an
|
|
46
|
+
* `aria-label` when the table has no focusable content, so keyboard users
|
|
47
|
+
* can still scroll it
|
|
48
|
+
*/
|
|
49
|
+
declare const TableContainer: import("react").ForwardRefExoticComponent<TableContainerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
|
+
export default TableContainer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes } from 'react';
|
|
2
|
+
import { CommonProps } from '../../types/emotion';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link TableContainer} component.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <TableContainer maxHeight={480}>
|
|
9
|
+
* <Table stickyHeader>{children}</Table>
|
|
10
|
+
* </TableContainer>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export interface TableContainerProps extends CommonProps, HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
/**
|
|
15
|
+
* Tallest the container gets before the table scrolls vertically. Any CSS
|
|
16
|
+
* value: a number of pixels, `'60vh'`, or `'100%'` to fill a parent that
|
|
17
|
+
* has a height of its own. Unbounded when omitted, so only horizontal
|
|
18
|
+
* overflow scrolls.
|
|
19
|
+
*/
|
|
20
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
21
|
+
}
|
|
@@ -57,11 +57,13 @@ export * from './Filters';
|
|
|
57
57
|
export * from './FiltersMultiSelect';
|
|
58
58
|
export * as JsonSchema from './JsonSchemaForm';
|
|
59
59
|
export { default as Table } from './Table';
|
|
60
|
-
export { ColumnResizeHandle, useColumnResize, useColumnResizeContext, } from './Table';
|
|
61
|
-
export type { ColumnResizeApi, ColumnResizeHandleProps, ColumnResizeMode, ColumnResizeOptions, ResizeHandleProps, TableProps, UseColumnResizeOptions, } from './Table';
|
|
60
|
+
export { ColumnFreezeMenu, ColumnResizeHandle, useColumnFreezeContext, useColumnResize, useColumnResizeContext, } from './Table';
|
|
61
|
+
export type { ColumnFreezeApi, ColumnFreezeMenuProps, ColumnFreezeOptions, ColumnId, ColumnResizeApi, ColumnResizeHandleProps, ColumnResizeMode, ColumnResizeOptions, FrozenColumns, ResizeHandleProps, TableProps, UseColumnResizeOptions, } from './Table';
|
|
62
62
|
export { default as TableBody } from './TableBody';
|
|
63
63
|
export { default as TableCell } from './TableCell';
|
|
64
64
|
export { default as TableCellHeader } from './TableCellHeader';
|
|
65
|
+
export { default as TableContainer } from './TableContainer';
|
|
66
|
+
export type { TableContainerProps } from './TableContainer';
|
|
65
67
|
export * from './TableFilters';
|
|
66
68
|
export { default as TableHead } from './TableHead';
|
|
67
69
|
export { default as TableRow } from './TableRow';
|
|
@@ -105,6 +107,8 @@ export * from './Charts';
|
|
|
105
107
|
export * from './ImageItem';
|
|
106
108
|
export * from './Carousel';
|
|
107
109
|
export type * from './Carousel/types';
|
|
110
|
+
export * from './Calendar';
|
|
111
|
+
export type * from './Calendar/types';
|
|
108
112
|
export { default as ResponsiveImage } from './ResponsiveImage';
|
|
109
113
|
export * from './ResponsiveImage';
|
|
110
114
|
export type * from './ResponsiveImage/types';
|