@ssa-ui-kit/core 3.26.4 → 3.27.0
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 +100 -37
- package/dist/components/Calendar/Calendar.d.ts +11 -3
- package/dist/components/Calendar/CalendarContext.d.ts +12 -1
- package/dist/components/Calendar/components/CalendarToolbar.d.ts +5 -1
- package/dist/components/Calendar/components/DayView.d.ts +4 -2
- package/dist/components/Calendar/components/TimeZoneSelect.d.ts +14 -0
- package/dist/components/Calendar/consts.d.ts +14 -1
- package/dist/components/Calendar/styles.d.ts +37 -1
- package/dist/components/Calendar/types.d.ts +93 -5
- package/dist/components/Calendar/utils.d.ts +35 -5
- package/dist/components/DataTable/DataTable.d.ts +79 -0
- package/dist/components/DataTable/DataTableColumnPicker.d.ts +66 -0
- package/dist/components/DataTable/ExpanderCell.d.ts +10 -0
- package/dist/components/DataTable/SelectionCell.d.ts +25 -0
- package/dist/components/DataTable/index.d.ts +4 -0
- package/dist/components/DataTable/styles.d.ts +47 -0
- package/dist/components/DataTable/types.d.ts +378 -0
- package/dist/components/DataTable/useColumnReorder.d.ts +31 -0
- package/dist/components/DataTable/useDataTableModel.d.ts +36 -0
- package/dist/components/DataTable/utils.d.ts +82 -0
- package/dist/components/NestedTable/WithNestedTableRow.d.ts +4 -0
- package/dist/components/NestedTable/components/NestedTable.d.ts +4 -0
- package/dist/components/NestedTable/components/NestedTableCell.d.ts +4 -0
- package/dist/components/NestedTable/components/NestedTableCellHeader.d.ts +4 -0
- package/dist/components/NestedTable/components/NestedTableRow.d.ts +4 -0
- package/dist/components/Table/ColumnFreezeMenu.d.ts +11 -1
- package/dist/components/Table/ColumnMenu.d.ts +30 -0
- package/dist/components/Table/Table.d.ts +4 -4
- package/dist/components/Table/types.d.ts +77 -6
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +1 -1
- package/dist/components/TableCellHeader/types.d.ts +14 -5
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +2615 -565
- package/dist/index.mjs +2615 -566
- package/dist/tsbuildcache +1 -1
- package/package.json +6 -5
package/dist/ai/source-map.md
CHANGED
|
@@ -4,7 +4,7 @@ Generated from the TypeScript program at build time — do not edit by hand.
|
|
|
4
4
|
|
|
5
5
|
**Everything below is imported from the package root:** `import { X } from '@ssa-ui-kit/core'`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
198 components · 20 contexts · 23 hooks · 21 functions · 16 constants · 359 exported types
|
|
8
8
|
|
|
9
9
|
## Reading this file
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ Generated from the TypeScript program at build time — do not edit by hand.
|
|
|
20
20
|
|
|
21
21
|
**Form Structure** — Filters, FiltersMultiSelect, FiltersMultiSelectEmpty, FiltersMultiSelectOption, FiltersMultiSelectOptions, Form, FormAction, FormCheckbox, FormGroup, FormHelperText, FormRadioGroup
|
|
22
22
|
|
|
23
|
-
**Data Display** — Avatar, Badge, BarGaugeChart, BarGaugeChartComponent, BarLineComplexChart, BigNumberChart, BigNumberChartComponent, Calendar, CalendarEventDetails, CandlestickChart, CandlestickChartComponent, Card, CardBase, CardContent, CardHeader, CardList, Carousel, ChartBackground, Chip, ColumnFreezeMenu, ColumnResizeHandle, Counter, FunnelChart, GaugeChart, ImageItem, Indicator, Label, NestedTable, NestedTableCell, NestedTableCellHeader, NestedTableCellSubHeader, NestedTableRow, PieChart, PieChartComponent, PieChartLegend, Progress, ProgressBar, ProgressCircle, ProgressInfo, ProgressInfoTotals, ProgressLegend, ProgressLegendItem, ProgressVertical, ResponsiveImage, SegmentedPieChart, SegmentedPieChartComponent, Table, TableBody, TableCell, TableCellHeader, TableContainer, TableFilterCheckbox, TableFilters, TableFiltersAccordion, TableFiltersAccordionContent, TableFiltersButtons, TableFiltersCancelButton, TableFiltersClearButton, TableFilterTrigger, TableFilterTriggerWithNotification, TableHead, TableRow, Tag, TreeMapChart, TreeMapChartComponent, TreeMapTooltipBase, Typography, WithNestedTableRow
|
|
23
|
+
**Data Display** — Avatar, Badge, BarGaugeChart, BarGaugeChartComponent, BarLineComplexChart, BigNumberChart, BigNumberChartComponent, Calendar, CalendarEventDetails, CandlestickChart, CandlestickChartComponent, Card, CardBase, CardContent, CardHeader, CardList, Carousel, ChartBackground, Chip, ColumnFreezeMenu, ColumnResizeHandle, Counter, DataTable, DataTableColumnPicker, FunnelChart, GaugeChart, ImageItem, Indicator, Label, NestedTable, NestedTableCell, NestedTableCellHeader, NestedTableCellSubHeader, NestedTableRow, PieChart, PieChartComponent, PieChartLegend, Progress, ProgressBar, ProgressCircle, ProgressInfo, ProgressInfoTotals, ProgressLegend, ProgressLegendItem, ProgressVertical, ResponsiveImage, SegmentedPieChart, SegmentedPieChartComponent, Table, TableBody, TableCell, TableCellHeader, TableContainer, TableFilterCheckbox, TableFilters, TableFiltersAccordion, TableFiltersAccordionContent, TableFiltersButtons, TableFiltersCancelButton, TableFiltersClearButton, TableFilterTrigger, TableFilterTriggerWithNotification, TableHead, TableRow, Tag, TreeMapChart, TreeMapChartComponent, TreeMapTooltipBase, Typography, WithNestedTableRow
|
|
24
24
|
|
|
25
25
|
**Navigation & Layout** — CollapsibleNavBar, CollapsibleNavBarCustomIconSVG, Footer, Header, History, LargeTab, Link, LinksTabBar, NavBar, Pagination, Step, StepConnector, StepLabel, Stepper, Tab, TabBar, TreeView, WithLink, WithPagination, WithVisibleLG, WithVisibleMD, WithVisibleSM, WithVisibleUpToLG, Wrapper
|
|
26
26
|
|
|
@@ -135,7 +135,7 @@ The list of options shown inside a dropdown, typeahead, filter or action menu.
|
|
|
135
135
|
- `renderGroupLabel?: (group: ContextMenuGroup<V>) => ReactNode` — Replaces the content of group titles.
|
|
136
136
|
- `emptyState?: ReactNode` `= 'No items'` — Shown when `items` has no options.
|
|
137
137
|
- `maxHeight?: string | number` — Scrolls the list beyond this height (px or any CSS length).
|
|
138
|
-
- `selectionMode?: 'none' | '
|
|
138
|
+
- `selectionMode?: 'none' | 'single' | 'multiple' | 'includeExclude'`
|
|
139
139
|
- `value?: V | V[] | ContextMenuIncludeExcludeEntry<V>[] | null` — Controlled selected value. `null` for none. Controlled selected values. Controlled chosen rows.
|
|
140
140
|
- `defaultValue?: V | V[] | ContextMenuIncludeExcludeEntry<V>[] | null` — Initially selected value when uncontrolled. Initially selected values when uncontrolled. Initially chosen…
|
|
141
141
|
- `onChange?: ((value: V) => void) | ((value: V[], toggled: V) => void) | …(1 more)` — Fires with the newly selected value. Choosing the selected option again keeps it selected. Fires with the new…
|
|
@@ -1015,7 +1015,17 @@ Shows entries on a month grid or on a single day's hour timeline.
|
|
|
1015
1015
|
- `timeFormat?: '24h' | '12h'` `= '24h'` — Clock used for event times and the hour labels of the day view.
|
|
1016
1016
|
- `dayHeader?: 'weekday' | 'monthYear'` `= 'monthYear'` — Header of the day view: the weekday name, or the month and year.
|
|
1017
1017
|
- `locale?: string` — Locale for weekday and month names, e.g. `'uk'`. Defaults to the browser's.
|
|
1018
|
-
- `scrollToHour?: number` — Hour the day view scrolls to when it opens. Defaults to an hour before the current time on today, and to
|
|
1018
|
+
- `scrollToHour?: number` — Hour the day view scrolls to when it opens. Defaults to an hour before the current time on today, and to the…
|
|
1019
|
+
- `workingHours?: CalendarWorkingHours | …(1 more)` — Working time of the day view: the hours outside it get a grey background. They stay open for adding entries —…
|
|
1020
|
+
- `hourHeight?: number` — Height of one hour on the day view's timeline, in px. Passing it makes it controlled: change it from…
|
|
1021
|
+
- `defaultHourHeight?: number` `= 68` — Hour height to start with when `hourHeight` isn't controlled, and the one a double click on the hour labels…
|
|
1022
|
+
- `onHourHeightChange?: (hourHeight: number) => void` — Called as the user resizes the hours — see `resizableHours`.
|
|
1023
|
+
- `resizableHours?: boolean` `= false` — Lets the user make the day view's hours taller or shorter by dragging the hour labels column up or down, or…
|
|
1024
|
+
- `timeZone?: string` `= the browser's time zone` — IANA time zone the calendar shows times in, e.g. `'Europe/Kyiv'` or `'UTC'`. Passing it makes it controlled:…
|
|
1025
|
+
- `defaultTimeZone?: string` — Time zone to start in when `timeZone` isn't controlled.
|
|
1026
|
+
- `onTimeZoneChange?: (timeZone: string) => void` — Called when the user picks a time zone — see `timeZoneSelector`.
|
|
1027
|
+
- `timeZoneSelector?: boolean` `= false` — Shows a time zone button that opens a searchable list of zones. It sits in the toolbar next to the Month/Day…
|
|
1028
|
+
- `timeZones?: string[]` `= every zone the browser knows` — Zones the selector offers.
|
|
1019
1029
|
- `aria-label?: string` — Accessible name of the calendar region.
|
|
1020
1030
|
- `style?: CSSProperties`
|
|
1021
1031
|
|
|
@@ -1154,6 +1164,52 @@ Compact numeric indicator for displaying counts or notification badges.
|
|
|
1154
1164
|
- `size?: keyof MainSizes` `= 'medium'` — Size of the counter. Ignored when `count` is undefined — the component uses `dot` automatically.
|
|
1155
1165
|
- `color?: string` — Optional color override. Accepts a `theme.colors` key or any valid CSS color string. When provided, overrides…
|
|
1156
1166
|
|
|
1167
|
+
#### DataTable<Row>
|
|
1168
|
+
A table driven by data: give it rows and column definitions and it renders, sorts and lays out the columns itself.
|
|
1169
|
+
|
|
1170
|
+
- `data: Row[]` — Rows to show, in the order to show them unless a column sorts them.
|
|
1171
|
+
- `columns: DataTableColumn<Row>[]` — Column definitions. Every `id` must be unique. Need not be memoised: the table only rebuilds its model when…
|
|
1172
|
+
- `getRowId?: (row: Row, index: number) => string` `= (row) => String(row.id)` — Stable id of a row, for rows whose id is not in an `id` field, such as `employeeId` or a key built from…
|
|
1173
|
+
- `columnState?: Partial<DataTableColumnState>` — Column layout, for the controlled case. Partial values are filled in with defaults. Hold it in state and…
|
|
1174
|
+
- `defaultColumnState?: Partial<DataTableColumnState>` — Starting column layout, for the uncontrolled case.
|
|
1175
|
+
- `onColumnStateChange?: (columnState: DataTableColumnState) => void` — Called whenever the user changes the layout: on every frame of a resize drag, when moving or hiding a column,…
|
|
1176
|
+
- `resizableColumns?: boolean` `= false` — Lets the user resize columns by dragging the right edge of the header.
|
|
1177
|
+
- `columnResizeMode?: ColumnResizeMode` `= 'fit'` — How a resize spends width. `fit` keeps the table's width: the resizable columns to the right share the…
|
|
1178
|
+
- `minColumnWidth?: number` `= 64` — Narrowest a column can be resized to, in pixels. A column's own `minWidth` wins.
|
|
1179
|
+
- `maxColumnWidth?: number` — Widest a column can be resized to, in pixels. A column's own `maxWidth` wins. Unbounded when omitted.
|
|
1180
|
+
- `freezeControls?: boolean` `= false` — Gives every header a menu to freeze its column to either edge.
|
|
1181
|
+
- `reorderableColumns?: boolean` `= false` — Lets the user move columns: by dragging the grip at the left of the header, or with "Move left" and "Move…
|
|
1182
|
+
- `hideableColumns?: boolean` `= false` — Adds "Hide column" to the header menu. The last visible column cannot be hidden. Hidden columns are kept in…
|
|
1183
|
+
- `stickyHeader?: boolean` `= false` — Keeps the header in view while the rows scroll. Give the table a height limit through `maxHeight`.
|
|
1184
|
+
- `maxHeight?: string | number` — Tallest the table gets before it scrolls vertically. Any CSS value. Unbounded when omitted, so only…
|
|
1185
|
+
- `sort?: DataTableSort | null` — Sorted column, for the controlled case. `null` for none.
|
|
1186
|
+
- `defaultSort?: DataTableSort | null` — Starting sort, for the uncontrolled case.
|
|
1187
|
+
- `onSortChange?: (sort: DataTableSort | null, sortKey: string | null) => void` — Called when a sortable header is clicked. A column starts ascending and toggles between ascending and…
|
|
1188
|
+
- `isLoading?: boolean` `= false` — Marks the table busy. Rows already shown stay, dimmed, so a re-fetch after sorting does not make the table…
|
|
1189
|
+
- `loadingState?: ReactNode` `= 'Loading…'` — Shown in place of the rows while loading with none to show.
|
|
1190
|
+
- `emptyState?: ReactNode` `= 'No results'` — Shown in place of the rows when there are none.
|
|
1191
|
+
- `onRowClick?: (row: Row, event: MouseEvent<HTMLTableRowElement> | KeyboardEvent<HTMLT…` — Called when a row is clicked, or when Enter is pressed on a focused row; rows become focusable when this is…
|
|
1192
|
+
- `getRowProps?: (row: Row, rowIndex: number) => DataTableElementProps` — Class name, style, background or data attributes for a body row, such as tinting rows that need attention.…
|
|
1193
|
+
- `getSubRows?: (row: Row) => Row[] | undefined` — Children of a row, shown nested under it, to any depth. Rows with children get an expand button in a column…
|
|
1194
|
+
- `expandedRowIds?: string[]` — Ids of the expanded rows, for the controlled case.
|
|
1195
|
+
- `defaultExpanded?: boolean | string[]` `= false` — Which rows start expanded, for the uncontrolled case: `true` for all, including rows that arrive later, or a…
|
|
1196
|
+
- `onExpandedChange?: (expandedRowIds: string[]) => void` — Called with the ids of the expanded rows whenever the user changes them.
|
|
1197
|
+
- `selectionMode?: DataTableSelectionMode` `= 'none'` — Lets the user select rows: `multiple` adds a checkbox column whose header checkbox selects or clears the rows…
|
|
1198
|
+
- `selectedRowIds?: string[]` — Ids of the selected rows, for the controlled case.
|
|
1199
|
+
- `defaultSelectedRowIds?: string[]` — Ids of the rows selected at first, for the uncontrolled case.
|
|
1200
|
+
- `onSelectionChange?: (selectedRowIds: string[]) => void` — Called with the ids of the selected rows whenever the user changes them.
|
|
1201
|
+
- `isRowSelectable?: (row: Row) => boolean` — Whether a row can be selected. Rows that cannot get a disabled checkbox and are skipped by the header…
|
|
1202
|
+
- `getRowLabel?: (row: Row, rowIndex: number) => string` `= (row, rowIndex) => `Select row ${rowIndex + 1}`` — Accessible name of a row's selection checkbox, such as the person's name. Without it the row is named by its…
|
|
1203
|
+
- `footer?: ReactNode` — Rendered below the table, such as `Pagination`.
|
|
1204
|
+
|
|
1205
|
+
#### DataTableColumnPicker<Row>
|
|
1206
|
+
A button that opens a checklist of a {@link DataTable }'s columns, to show or hide each one.
|
|
1207
|
+
|
|
1208
|
+
- `columns: DataTableColumn<Row>[]` — The same columns the table gets.
|
|
1209
|
+
- `columnState?: Partial<DataTableColumnState>` — The table's column state, as passed to its `columnState`.
|
|
1210
|
+
- `onColumnStateChange: (columnState: DataTableColumnState) => void` — Called with the whole new column state when a column is shown or hidden.
|
|
1211
|
+
- `label?: ReactNode` `= 'Columns'` — Text of the button that opens the list.
|
|
1212
|
+
|
|
1157
1213
|
#### FunnelChart
|
|
1158
1214
|
Stage diagram drawn as a funnel or a triangle
|
|
1159
1215
|
|
|
@@ -1221,17 +1277,17 @@ Stage diagram drawn as a funnel or a triangle
|
|
|
1221
1277
|
Table whose rows collapse into expandable groups.
|
|
1222
1278
|
|
|
1223
1279
|
- `resizableColumns?: boolean` `= false` — Lets columns be resized by dragging the right edge of each header cell.
|
|
1224
|
-
- `columnWidths?: number[]` — Column widths in pixels, one per column
|
|
1225
|
-
- `defaultColumnWidths?: number[]` — Starting column widths in pixels, for the uncontrolled case.
|
|
1226
|
-
- `onColumnWidthsChange?: (columnWidths: number[]) => void` — Called on every width change, including each frame of a drag.
|
|
1227
|
-
- `minColumnWidth?: number`
|
|
1228
|
-
- `maxColumnWidth?: number` — Widest a column can be dragged, in pixels.
|
|
1229
|
-
- `columnResizeMode?: ColumnResizeMode`
|
|
1230
|
-
- `frozenColumns?: FrozenColumns` — Columns frozen to each edge
|
|
1231
|
-
- `defaultFrozenColumns?: FrozenColumns` — Columns frozen to each edge to begin with
|
|
1232
|
-
- `onFrozenColumnsChange?: (frozenColumns: Required<FrozenColumns>) => void` — Called whenever the user freezes or unfreezes columns
|
|
1233
|
-
- `freezeControls?: boolean`
|
|
1234
|
-
- `stickyHeader?: boolean`
|
|
1280
|
+
- `columnWidths?: number[]` — Column widths in pixels, one per column, for the controlled case.
|
|
1281
|
+
- `defaultColumnWidths?: number[]` — Starting column widths in pixels, for the uncontrolled case.
|
|
1282
|
+
- `onColumnWidthsChange?: (columnWidths: number[]) => void` — Called on every width change, including each frame of a drag.
|
|
1283
|
+
- `minColumnWidth?: number` — Narrowest a column can be dragged, in pixels.
|
|
1284
|
+
- `maxColumnWidth?: number` — Widest a column can be dragged, in pixels.
|
|
1285
|
+
- `columnResizeMode?: ColumnResizeMode` — Whether a resize is paid for by the columns to the right or by the table's own width.
|
|
1286
|
+
- `frozenColumns?: FrozenColumns` — Columns frozen to each edge, for the controlled case.
|
|
1287
|
+
- `defaultFrozenColumns?: FrozenColumns` — Columns frozen to each edge to begin with.
|
|
1288
|
+
- `onFrozenColumnsChange?: (frozenColumns: Required<FrozenColumns>) => void` — Called whenever the user freezes or unfreezes columns.
|
|
1289
|
+
- `freezeControls?: boolean` — Gives every `TableCellHeader` a menu to freeze its column.
|
|
1290
|
+
- `stickyHeader?: boolean` — Keeps the header row in view while the table scrolls vertically.
|
|
1235
1291
|
- `collapsedIconName?: 'reset' | 'archive' | 'arrow-down' | 'arrow-up' | …(237 more — full list under "Icon.name")` `= 'carrot-up'` — Toggle icon shown while a group is collapsed.
|
|
1236
1292
|
- `expandedIconName?: 'reset' | 'archive' | 'arrow-down' | 'arrow-up' | …(237 more — full list under "Icon.name")` `= 'carrot-down'` — Toggle icon shown while a group is expanded.
|
|
1237
1293
|
- `defaultCollapsed?: boolean` `= false` — Whether groups start collapsed. Applies to every group in the table; a single `WithNestedTableRow` can…
|
|
@@ -1248,6 +1304,8 @@ Column header cell for a `NestedTable`.
|
|
|
1248
1304
|
|
|
1249
1305
|
- `resizable?: boolean` `= true` — Whether this column can be resized inside a `Table` with `resizableColumns`. Set it to `false` to pin a…
|
|
1250
1306
|
- `freezable?: boolean` `= true` — Whether this header cell offers the freeze menu inside a `Table` with `freezeControls`. Set it to `false` for…
|
|
1307
|
+
- `minWidth?: number` — Narrowest this column can be resized to, in pixels, inside a `Table` with `resizableColumns`. Overrides the…
|
|
1308
|
+
- `maxWidth?: number` — Widest this column can be resized to, in pixels, inside a `Table` with `resizableColumns`. Overrides the…
|
|
1251
1309
|
- `columnId?: ColumnId` — Stable id for this column, used by `frozenColumns` on the `Table`. Give every header one when the app can…
|
|
1252
1310
|
- `align?: 'center' | 'left' | 'right' | 'justify'` `= 'left'` — Text alignment for the cell content
|
|
1253
1311
|
- _plus native element attributes_
|
|
@@ -1411,17 +1469,17 @@ A simple wrapper over the `<img />` tag.
|
|
|
1411
1469
|
Base table component for displaying tabular data
|
|
1412
1470
|
|
|
1413
1471
|
- `resizableColumns?: boolean` `= false` — Lets columns be resized by dragging the right edge of each header cell.
|
|
1414
|
-
- `columnWidths?: number[]` — Column widths in pixels, one per column
|
|
1415
|
-
- `defaultColumnWidths?: number[]` — Starting column widths in pixels, for the uncontrolled case.
|
|
1416
|
-
- `onColumnWidthsChange?: (columnWidths: number[]) => void` — Called on every width change, including each frame of a drag.
|
|
1417
|
-
- `minColumnWidth?: number`
|
|
1418
|
-
- `maxColumnWidth?: number` — Widest a column can be dragged, in pixels.
|
|
1419
|
-
- `columnResizeMode?: ColumnResizeMode`
|
|
1420
|
-
- `frozenColumns?: FrozenColumns` — Columns frozen to each edge
|
|
1421
|
-
- `defaultFrozenColumns?: FrozenColumns` — Columns frozen to each edge to begin with
|
|
1422
|
-
- `onFrozenColumnsChange?: (frozenColumns: Required<FrozenColumns>) => void` — Called whenever the user freezes or unfreezes columns
|
|
1423
|
-
- `freezeControls?: boolean`
|
|
1424
|
-
- `stickyHeader?: boolean`
|
|
1472
|
+
- `columnWidths?: number[]` — Column widths in pixels, one per column, for the controlled case.
|
|
1473
|
+
- `defaultColumnWidths?: number[]` — Starting column widths in pixels, for the uncontrolled case.
|
|
1474
|
+
- `onColumnWidthsChange?: (columnWidths: number[]) => void` — Called on every width change, including each frame of a drag.
|
|
1475
|
+
- `minColumnWidth?: number` — Narrowest a column can be dragged, in pixels.
|
|
1476
|
+
- `maxColumnWidth?: number` — Widest a column can be dragged, in pixels.
|
|
1477
|
+
- `columnResizeMode?: ColumnResizeMode` — Whether a resize is paid for by the columns to the right or by the table's own width.
|
|
1478
|
+
- `frozenColumns?: FrozenColumns` — Columns frozen to each edge, for the controlled case.
|
|
1479
|
+
- `defaultFrozenColumns?: FrozenColumns` — Columns frozen to each edge to begin with.
|
|
1480
|
+
- `onFrozenColumnsChange?: (frozenColumns: Required<FrozenColumns>) => void` — Called whenever the user freezes or unfreezes columns.
|
|
1481
|
+
- `freezeControls?: boolean` — Gives every `TableCellHeader` a menu to freeze its column.
|
|
1482
|
+
- `stickyHeader?: boolean` — Keeps the header row in view while the table scrolls vertically.
|
|
1425
1483
|
- _plus native element attributes_
|
|
1426
1484
|
|
|
1427
1485
|
#### TableBody
|
|
@@ -1441,6 +1499,8 @@ Table header cell component
|
|
|
1441
1499
|
|
|
1442
1500
|
- `resizable?: boolean` `= true` — Whether this column can be resized inside a `Table` with `resizableColumns`. Set it to `false` to pin a…
|
|
1443
1501
|
- `freezable?: boolean` `= true` — Whether this header cell offers the freeze menu inside a `Table` with `freezeControls`. Set it to `false` for…
|
|
1502
|
+
- `minWidth?: number` — Narrowest this column can be resized to, in pixels, inside a `Table` with `resizableColumns`. Overrides the…
|
|
1503
|
+
- `maxWidth?: number` — Widest this column can be resized to, in pixels, inside a `Table` with `resizableColumns`. Overrides the…
|
|
1444
1504
|
- `columnId?: ColumnId` — Stable id for this column, used by `frozenColumns` on the `Table`. Give every header one when the app can…
|
|
1445
1505
|
- `align?: 'center' | 'left' | 'right' | 'justify'` `= 'left'` — Text alignment for the cell content
|
|
1446
1506
|
- _plus native element attributes_
|
|
@@ -1738,11 +1798,11 @@ A nestable list of rows, up to three levels deep.
|
|
|
1738
1798
|
- `expandedIds?: string[]` — Ids of expanded nodes. Pass to control expansion yourself.
|
|
1739
1799
|
- `defaultExpandedIds?: string[]` — Ids expanded on mount, when expansion is uncontrolled.
|
|
1740
1800
|
- `onExpandedIdsChange?: (ids: string[]) => void`
|
|
1741
|
-
- `expandMode?: '
|
|
1801
|
+
- `expandMode?: 'single' | 'multiple'` `= 'multiple'` — `single` collapses siblings when a node expands, accordion-style.
|
|
1742
1802
|
- `selectedIds?: string[]` — Ids of selected nodes. Always an array, even in `single` mode — which is what lets a consumer move to…
|
|
1743
1803
|
- `defaultSelectedIds?: string[]`
|
|
1744
1804
|
- `onSelectedIdsChange?: (ids: string[], item: AnyTreeItem<TMeta>) => void` — Receives the full next selection, plus the node that was acted on.
|
|
1745
|
-
- `selectionMode?: '
|
|
1805
|
+
- `selectionMode?: 'single' | 'multiple'` `= 'single'` — `single` replaces the selection on click, `multiple` toggles membership.
|
|
1746
1806
|
- `renderItem?: (props: TreeItemRenderProps<TMeta>) => React.ReactNode` — Replaces the row's interior. The `li`, ARIA and keyboard stay with `TreeView`.
|
|
1747
1807
|
- `activeColor?: string` — Overrides the selected row's colour (and the chevron and icon on it), for a consumer whose accent isn't the…
|
|
1748
1808
|
- `semantics?: 'list' | 'tree'` `= 'tree'` — `tree` gives a real `role="tree"` with roving focus and arrow-key navigation — right for a file tree. `list`…
|
|
@@ -2453,20 +2513,23 @@ _Names only — read the `.d.ts` for their shape._
|
|
|
2453
2513
|
`CalendarEventDetailsControls` · `CalendarEventDetailsField` · `CalendarEventDetailsProps`
|
|
2454
2514
|
`CalendarEventProps` · `CalendarEventRenderContext` · `CalendarEventSlotContext` · `CalendarEvent`
|
|
2455
2515
|
`CalendarHighlightColor` · `CalendarProps` · `CalendarRange` · `CalendarType` · `CalendarVariant`
|
|
2456
|
-
`CalendarView` · `CalendarWeek` · `
|
|
2457
|
-
`
|
|
2458
|
-
`
|
|
2459
|
-
`
|
|
2460
|
-
`
|
|
2461
|
-
`
|
|
2462
|
-
`
|
|
2463
|
-
`
|
|
2464
|
-
`
|
|
2516
|
+
`CalendarView` · `CalendarWeek` · `CalendarWeekday` · `CalendarWorkingHoursByWeekday`
|
|
2517
|
+
`CalendarWorkingHours` · `CandlestickChartFeatures` · `CandlestickChartProps` · `CardListProps`
|
|
2518
|
+
`CardProps` · `CarouselControlsPosition` · `CarouselFit` · `CarouselItem` · `CarouselOpenFullMode`
|
|
2519
|
+
`CarouselProps` · `CarouselThumbnailsPosition` · `CheckboxProps` · `ChildrenDataProps` · `ChipColor`
|
|
2520
|
+
`ChipProps` · `ChipSize` · `ChipVariant` · `CollapsibleNavBarExtendedProps`
|
|
2521
|
+
`CollapsibleNavBarGroup` · `CollapsibleNavBarHeader` · `CollapsibleNavBarItem`
|
|
2522
|
+
`ColoredButtonTextProps` · `ColorsKeys` · `ColumnFreezeApi` · `ColumnFreezeMenuProps`
|
|
2523
|
+
`ColumnFreezeOptions` · `ColumnId` · `ColumnResizeApi` · `ColumnResizeHandleProps`
|
|
2524
|
+
`ColumnResizeMode` · `ColumnResizeOptions` · `CommonProps` · `ContextMenuBaseProps`
|
|
2525
|
+
`ContextMenuEntry` · `ContextMenuGroup` · `ContextMenuIncludeExcludeEntry`
|
|
2465
2526
|
`ContextMenuIncludeExcludeSelectionProps` · `ContextMenuIncludeExcludeType` · `ContextMenuIndicator`
|
|
2466
2527
|
`ContextMenuItemState` · `ContextMenuItem` · `ContextMenuMultipleSelectionProps`
|
|
2467
2528
|
`ContextMenuNoSelectionProps` · `ContextMenuProps` · `ContextMenuSelectionProps`
|
|
2468
2529
|
`ContextMenuSingleSelectionProps` · `ContextMenuValue` · `ContextType` · `ControlledButtonProps`
|
|
2469
2530
|
`CounterProps` · `CounterSizes` · `CounterVariants` · `CustomIconProps` · `CustomTagStyles`
|
|
2531
|
+
`DataTableColumnPickerProps` · `DataTableColumnState` · `DataTableColumn` · `DataTableElementProps`
|
|
2532
|
+
`DataTableProps` · `DataTableSelectionMode` · `DataTableSortDirection` · `DataTableSort`
|
|
2470
2533
|
`DatePickerContextProps` · `DatePickerFormat` · `DatePickerProps` · `DateRangePickerContextProps`
|
|
2471
2534
|
`DateRangePickerFormBridgeProps` · `DateRangePickerFormBridgeValue` · `DateRangePickerOnChangeDates`
|
|
2472
2535
|
`DateRangePickerProps` · `DateRangePresetValue` · `DateRangePreset` · `DateTimeTuple`
|
|
@@ -22,10 +22,18 @@ import { CalendarProps } from './types';
|
|
|
22
22
|
* adds anything up itself — totals are whatever the consumer renders.
|
|
23
23
|
*
|
|
24
24
|
* ### Day view
|
|
25
|
-
* Untimed entries are listed above 00:00
|
|
26
|
-
* timeline, side by side where they
|
|
25
|
+
* Untimed entries are listed in a row above 00:00, shown only when there are
|
|
26
|
+
* some; timed ones are placed on the hour timeline, side by side where they
|
|
27
|
+
* overlap, with text that grows with their box. A timed entry that runs past
|
|
27
28
|
* midnight continues on the next day's timeline. Today shows a line at the
|
|
28
|
-
* current time.
|
|
29
|
+
* current time. `workingHours` shades the hours outside the working time
|
|
30
|
+
* (per weekday if needed); `resizableHours` lets the user drag the hour
|
|
31
|
+
* labels to make the hours taller or shorter.
|
|
32
|
+
*
|
|
33
|
+
* ### Time zones
|
|
34
|
+
* `timeZone` (or `defaultTimeZone`) shows timed entries in another IANA
|
|
35
|
+
* zone; untimed entries and day values stay on their date.
|
|
36
|
+
* `timeZoneSelector` adds a button that lets the user pick the zone.
|
|
29
37
|
*
|
|
30
38
|
* ### Multi-day entries
|
|
31
39
|
* An untimed entry with an `end`, or a timed one lasting 24 hours or more,
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { DateTime } from 'luxon';
|
|
2
3
|
import { CalendarEvent, CalendarProps } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Props every part of the calendar reads, shared through context so the
|
|
5
6
|
* views don't have to pass them down level by level.
|
|
6
7
|
*/
|
|
7
|
-
export type CalendarContextValue = Pick<CalendarProps, 'getDayProps' | 'onAddEvent' | 'onTaskToggle' | 'onDayClick' | 'renderEvent' | 'renderEventActions' | 'getEventProps' | 'locale'> & {
|
|
8
|
+
export type CalendarContextValue = Pick<CalendarProps, 'getDayProps' | 'onAddEvent' | 'onTaskToggle' | 'onDayClick' | 'renderEvent' | 'renderEventActions' | 'getEventProps' | 'locale' | 'workingHours'> & {
|
|
8
9
|
timeFormat: '24h' | '12h';
|
|
10
|
+
/** Zone times are shown in; `undefined` — local time. */
|
|
11
|
+
timeZone?: string;
|
|
12
|
+
/** Height of one hour on the day view's timeline, in px. */
|
|
13
|
+
hourHeight: number;
|
|
14
|
+
/** Resizes the hours; `undefined` when they can't be resized. */
|
|
15
|
+
setHourHeight?: (height: number) => void;
|
|
16
|
+
/** Hour height a double click on the hour labels goes back to. */
|
|
17
|
+
defaultHourHeight: number;
|
|
18
|
+
/** Extra controls for the day view's header, e.g. the time zone picker. */
|
|
19
|
+
dayHeaderEnd?: ReactNode;
|
|
9
20
|
/**
|
|
10
21
|
* Whether a day gets an add button, going by `onAddEvent` and
|
|
11
22
|
* `minAddDate` / `maxAddDate` (not `getDayProps`, which the views apply).
|
|
@@ -5,6 +5,10 @@ type CalendarToolbarProps = {
|
|
|
5
5
|
view: CalendarView;
|
|
6
6
|
date: DateTime;
|
|
7
7
|
locale?: string;
|
|
8
|
+
/** Zone "Today" is taken in; `undefined` — local time. */
|
|
9
|
+
timeZone?: string;
|
|
10
|
+
/** The time zone button, when the calendar offers one. */
|
|
11
|
+
timeZonePicker?: ReactNode;
|
|
8
12
|
/** Moves to a date; `undefined` when the date can't move. */
|
|
9
13
|
onNavigate?: (date: DateTime) => void;
|
|
10
14
|
/** Views to toggle between; the toggle shows with two or more. */
|
|
@@ -16,5 +20,5 @@ type CalendarToolbarProps = {
|
|
|
16
20
|
* The bar above the grid: previous / today / next, the date on show, the
|
|
17
21
|
* consumer's content and the view toggle.
|
|
18
22
|
*/
|
|
19
|
-
export declare const CalendarToolbar: ({ view, date, locale, onNavigate, views, onViewChange, end, }: CalendarToolbarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const CalendarToolbar: ({ view, date, locale, timeZone, timeZonePicker, onNavigate, views, onViewChange, end, }: CalendarToolbarProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
24
|
export {};
|
|
@@ -7,8 +7,10 @@ type DayViewProps = {
|
|
|
7
7
|
scrollToHour?: number;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
|
-
* A single day: header, untimed entries above 00:00
|
|
11
|
-
* with the timed entries placed by
|
|
10
|
+
* A single day: header, untimed entries above 00:00 (a row shown only when
|
|
11
|
+
* there are some), and an hour timeline with the timed entries placed by
|
|
12
|
+
* time. Overlapping entries share the width; hours outside the working time
|
|
13
|
+
* are shaded.
|
|
12
14
|
*/
|
|
13
15
|
export declare const DayView: ({ date, items, header, scrollToHour, }: DayViewProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type TimeZoneSelectProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
/** Zones to offer; every zone the browser knows when missing. */
|
|
4
|
+
options?: string[];
|
|
5
|
+
onChange: (zone: string) => void;
|
|
6
|
+
};
|
|
7
|
+
/** `GMT+2`, `GMT-3:30`, or `GMT` for UTC — the zone's offset right now. */
|
|
8
|
+
export declare const formatTimeZoneOffset: (zone: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* The calendar's time zone button: shows the zone's offset and opens a
|
|
11
|
+
* searchable list of zones, sorted by offset.
|
|
12
|
+
*/
|
|
13
|
+
export declare const TimeZoneSelect: ({ value, options, onChange, }: TimeZoneSelectProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -7,8 +7,21 @@ export declare const TOTAL_COLUMN_WIDTH: {
|
|
|
7
7
|
readonly 7: 91;
|
|
8
8
|
readonly 5: 160;
|
|
9
9
|
};
|
|
10
|
-
/** Height of one hour on the day view's timeline. */
|
|
10
|
+
/** Height of one hour on the day view's timeline, unless resized. */
|
|
11
11
|
export declare const HOUR_HEIGHT = 68;
|
|
12
|
+
/**
|
|
13
|
+
* Resize limits for when the view can't be measured (before layout, or with
|
|
14
|
+
* no height). Otherwise an hour goes from the whole day fitting the view to
|
|
15
|
+
* a single hour filling it.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HOUR_HEIGHT_FALLBACK_LIMITS: {
|
|
18
|
+
readonly min: 16;
|
|
19
|
+
readonly max: 480;
|
|
20
|
+
};
|
|
21
|
+
/** Shortest an hour is ever drawn, whatever `hourHeight` says. */
|
|
22
|
+
export declare const HOUR_HEIGHT_FLOOR = 8;
|
|
23
|
+
/** Hour height change per arrow key press on the resize handle. */
|
|
24
|
+
export declare const HOUR_HEIGHT_STEP = 8;
|
|
12
25
|
/**
|
|
13
26
|
* Space above the 00:00 line. It holds untimed entries, and leaves room for
|
|
14
27
|
* the 00:00 label, which is centred on its line.
|
|
@@ -12,6 +12,9 @@ export declare const toolbar: (theme: Theme) => import("@emotion/react").Seriali
|
|
|
12
12
|
export declare const toolbarNav: import("@emotion/react").SerializedStyles;
|
|
13
13
|
export declare const toolbarTitle: import("@emotion/react").SerializedStyles;
|
|
14
14
|
export declare const toolbarViews: import("@emotion/react").SerializedStyles;
|
|
15
|
+
export declare const timeZoneButton: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
16
|
+
export declare const timeZonePopover: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
17
|
+
export declare const timeZoneSearch: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
15
18
|
export declare const toolbarEnd: import("@emotion/react").SerializedStyles;
|
|
16
19
|
/**
|
|
17
20
|
* The header and the week rows scroll together, so the header can't drift
|
|
@@ -103,6 +106,8 @@ export declare const dayLeadRow: (theme: Theme) => import("@emotion/react").Seri
|
|
|
103
106
|
export declare const hourLabelFirst: import("@emotion/react").SerializedStyles;
|
|
104
107
|
/** Above 00:00. Grows to fit untimed entries. */
|
|
105
108
|
export declare const dayLead: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
109
|
+
/** Set on the timeline to the hour height in px; the hour cells follow it. */
|
|
110
|
+
export declare const HOUR_HEIGHT_VARIABLE = "--calendar-hour-height";
|
|
106
111
|
export declare const hourCell: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
107
112
|
export declare const hourCellLast: import("@emotion/react").SerializedStyles;
|
|
108
113
|
export declare const hourCellAddable: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
@@ -110,14 +115,45 @@ export declare const dayHighlight: (outline: string | undefined, tint: string) =
|
|
|
110
115
|
export declare const dayHighlightLabel: import("@emotion/react").SerializedStyles;
|
|
111
116
|
/** Where the timeline's hours start, below the lead area. */
|
|
112
117
|
export declare const timeline: import("@emotion/react").SerializedStyles;
|
|
118
|
+
/** Holds the shading of the hours outside the working time. */
|
|
119
|
+
export declare const offHoursLayer: import("@emotion/react").SerializedStyles;
|
|
120
|
+
/**
|
|
121
|
+
* Multiplied over the cells rather than painted on them, so the hour lines
|
|
122
|
+
* and the cells' hover still show through.
|
|
123
|
+
*/
|
|
124
|
+
export declare const offHours: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
125
|
+
/** Lies over the hour labels; dragging it resizes the hours. */
|
|
126
|
+
export declare const hourResizer: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
113
127
|
/** Holds the timed events over the hour cells, right of the labels. */
|
|
114
128
|
export declare const dayEventsLayer: import("@emotion/react").SerializedStyles;
|
|
115
129
|
/** Places a timed entry; its content fills it. */
|
|
116
130
|
export declare const dayEventBox: import("@emotion/react").SerializedStyles;
|
|
117
|
-
export type DayEventSize = '
|
|
131
|
+
export type DayEventSize = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
132
|
+
/**
|
|
133
|
+
* Text of a timed entry by its size, and the box height each size starts
|
|
134
|
+
* at. `small` lays the title and time out in a row; the rest stack them.
|
|
135
|
+
*/
|
|
136
|
+
export declare const DAY_EVENT_TEXT: Record<DayEventSize, {
|
|
137
|
+
minHeight: number;
|
|
138
|
+
padding: number;
|
|
139
|
+
title: {
|
|
140
|
+
fontSize: number;
|
|
141
|
+
fontWeight: number;
|
|
142
|
+
lineHeight: string;
|
|
143
|
+
};
|
|
144
|
+
titleLineHeight: number;
|
|
145
|
+
time: {
|
|
146
|
+
fontSize: number;
|
|
147
|
+
fontWeight: number;
|
|
148
|
+
lineHeight: string;
|
|
149
|
+
};
|
|
150
|
+
timeLineHeight: number;
|
|
151
|
+
}>;
|
|
118
152
|
export declare const dayEvent: (theme: Theme, stripe: string | undefined, size: DayEventSize) => import("@emotion/react").SerializedStyles;
|
|
119
153
|
export declare const dayEventContent: (size: DayEventSize) => import("@emotion/react").SerializedStyles;
|
|
120
154
|
export declare const dayEventTitle: (size: DayEventSize) => import("@emotion/react").SerializedStyles;
|
|
155
|
+
/** A title with room for more lines; the line count is set inline. */
|
|
156
|
+
export declare const dayEventTitleWrap: import("@emotion/react").SerializedStyles;
|
|
121
157
|
export declare const dayEventTime: (size: DayEventSize) => import("@emotion/react").SerializedStyles;
|
|
122
158
|
export declare const dayTask: import("@emotion/react").SerializedStyles;
|
|
123
159
|
export declare const nowPointer: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
@@ -99,10 +99,33 @@ export type CalendarDayHighlight = {
|
|
|
99
99
|
/** Makes the badge row clickable. */
|
|
100
100
|
onClick?: () => void;
|
|
101
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* A day's working time on the day view's timeline, in hours from midnight —
|
|
104
|
+
* `{ start: 8, end: 20 }` is 08:00–20:00, `17.5` is 17:30. The hours
|
|
105
|
+
* outside it are shaded grey, but stay open for adding entries.
|
|
106
|
+
*/
|
|
107
|
+
export type CalendarWorkingHours = {
|
|
108
|
+
/** Hour the working time starts, 0–24. */
|
|
109
|
+
start: number;
|
|
110
|
+
/** Hour the working time ends, 0–24; after `start`. */
|
|
111
|
+
end: number;
|
|
112
|
+
};
|
|
113
|
+
/** A weekday, as keyed in {@link CalendarWorkingHoursByWeekday}. */
|
|
114
|
+
export type CalendarWeekday = 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun';
|
|
115
|
+
/**
|
|
116
|
+
* Working time per weekday. A weekday left out, or set to `null`, has no
|
|
117
|
+
* working time — the whole day is shaded.
|
|
118
|
+
*/
|
|
119
|
+
export type CalendarWorkingHoursByWeekday = Partial<Record<CalendarWeekday, CalendarWorkingHours | null>>;
|
|
102
120
|
/**
|
|
103
121
|
* Per-day options returned by `getDayProps`.
|
|
104
122
|
*/
|
|
105
123
|
export type CalendarDayProps = {
|
|
124
|
+
/**
|
|
125
|
+
* The day's working time, over `workingHours` — e.g. a short day before a
|
|
126
|
+
* holiday. `null` shades the whole day.
|
|
127
|
+
*/
|
|
128
|
+
workingHours?: CalendarWorkingHours | null;
|
|
106
129
|
/** Turns the day into a highlighted, whole-day cell. */
|
|
107
130
|
highlight?: CalendarDayHighlight;
|
|
108
131
|
/**
|
|
@@ -189,13 +212,16 @@ export type CalendarEventDetailsControls = {
|
|
|
189
212
|
close: () => void;
|
|
190
213
|
};
|
|
191
214
|
/**
|
|
192
|
-
* The days a view shows, handed to `onRangeChange`.
|
|
215
|
+
* The days a view shows, handed to `onRangeChange`. Unlike the calendar's
|
|
216
|
+
* other day values, `start` and `end` are moments — the span to fetch timed
|
|
217
|
+
* entries for — so with a `timeZone` they're that zone's midnights, not
|
|
218
|
+
* local ones.
|
|
193
219
|
*/
|
|
194
220
|
export type CalendarRange = {
|
|
195
221
|
view: CalendarView;
|
|
196
|
-
/** Start of the first day shown. */
|
|
222
|
+
/** Start of the first day shown, in the calendar's time zone. */
|
|
197
223
|
start: Date;
|
|
198
|
-
/** End of the last day shown (23:59:59.999). */
|
|
224
|
+
/** End of the last day shown (23:59:59.999), in the calendar's time zone. */
|
|
199
225
|
end: Date;
|
|
200
226
|
};
|
|
201
227
|
/**
|
|
@@ -302,7 +328,9 @@ export type CalendarProps<TData = unknown> = {
|
|
|
302
328
|
getDayProps?: (date: Date) => CalendarDayProps | undefined;
|
|
303
329
|
/**
|
|
304
330
|
* Shows an add button on each day (on hover in the month grid) and in the
|
|
305
|
-
* day view header. Receives the day clicked
|
|
331
|
+
* day view header. Receives the day clicked (its start, in local time
|
|
332
|
+
* like every day value), or the hour clicked on the day view's timeline
|
|
333
|
+
* — a moment, which in another `timeZone` reads differently locally.
|
|
306
334
|
*/
|
|
307
335
|
onAddEvent?: (date: Date) => void;
|
|
308
336
|
/**
|
|
@@ -373,9 +401,69 @@ export type CalendarProps<TData = unknown> = {
|
|
|
373
401
|
locale?: string;
|
|
374
402
|
/**
|
|
375
403
|
* Hour the day view scrolls to when it opens. Defaults to an hour before
|
|
376
|
-
* the current time on today, and to
|
|
404
|
+
* the current time on today, and to the start of the working time (see
|
|
405
|
+
* `workingHours`) or 8:00 on other days.
|
|
377
406
|
*/
|
|
378
407
|
scrollToHour?: number;
|
|
408
|
+
/**
|
|
409
|
+
* Working time of the day view: the hours outside it get a grey
|
|
410
|
+
* background. They stay open for adding entries — the shading is only a
|
|
411
|
+
* hint. One range for every day, or a range per weekday; for one-off days
|
|
412
|
+
* use `getDayProps(date).workingHours`.
|
|
413
|
+
*
|
|
414
|
+
* Unset, no hours are shaded.
|
|
415
|
+
*/
|
|
416
|
+
workingHours?: CalendarWorkingHours | CalendarWorkingHoursByWeekday;
|
|
417
|
+
/**
|
|
418
|
+
* Height of one hour on the day view's timeline, in px. Passing it makes
|
|
419
|
+
* it controlled: change it from `onHourHeightChange`.
|
|
420
|
+
*/
|
|
421
|
+
hourHeight?: number;
|
|
422
|
+
/**
|
|
423
|
+
* Hour height to start with when `hourHeight` isn't controlled, and the
|
|
424
|
+
* one a double click on the hour labels goes back to.
|
|
425
|
+
* @default 68
|
|
426
|
+
*/
|
|
427
|
+
defaultHourHeight?: number;
|
|
428
|
+
/** Called as the user resizes the hours — see `resizableHours`. */
|
|
429
|
+
onHourHeightChange?: (hourHeight: number) => void;
|
|
430
|
+
/**
|
|
431
|
+
* Lets the user make the day view's hours taller or shorter by dragging
|
|
432
|
+
* the hour labels column up or down, or with the arrow keys when it's
|
|
433
|
+
* focused — from the whole day fitting the view to a single hour filling
|
|
434
|
+
* it. A double click on the column goes back to `defaultHourHeight`.
|
|
435
|
+
* @default false
|
|
436
|
+
*/
|
|
437
|
+
resizableHours?: boolean;
|
|
438
|
+
/**
|
|
439
|
+
* IANA time zone the calendar shows times in, e.g. `'Europe/Kyiv'` or
|
|
440
|
+
* `'UTC'`. Passing it makes it controlled: change it from
|
|
441
|
+
* `onTimeZoneChange`.
|
|
442
|
+
*
|
|
443
|
+
* Timed entries are moved into the zone — an entry at 09:00 in Kyiv shows
|
|
444
|
+
* at 07:00 in `'UTC'`. Untimed entries, `date` and the other day values
|
|
445
|
+
* are calendar days and stay on their day. "Today" and the now line follow
|
|
446
|
+
* the zone.
|
|
447
|
+
*
|
|
448
|
+
* @default the browser's time zone
|
|
449
|
+
*/
|
|
450
|
+
timeZone?: string;
|
|
451
|
+
/** Time zone to start in when `timeZone` isn't controlled. */
|
|
452
|
+
defaultTimeZone?: string;
|
|
453
|
+
/** Called when the user picks a time zone — see `timeZoneSelector`. */
|
|
454
|
+
onTimeZoneChange?: (timeZone: string) => void;
|
|
455
|
+
/**
|
|
456
|
+
* Shows a time zone button that opens a searchable list of zones. It sits
|
|
457
|
+
* in the toolbar next to the Month/Day toggle; without `toolbar`, in the
|
|
458
|
+
* day view's header.
|
|
459
|
+
* @default false
|
|
460
|
+
*/
|
|
461
|
+
timeZoneSelector?: boolean;
|
|
462
|
+
/**
|
|
463
|
+
* Zones the selector offers.
|
|
464
|
+
* @default every zone the browser knows
|
|
465
|
+
*/
|
|
466
|
+
timeZones?: string[];
|
|
379
467
|
/** Accessible name of the calendar region. */
|
|
380
468
|
'aria-label'?: string;
|
|
381
469
|
className?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DateTime } from 'luxon';
|
|
3
|
-
import { CalendarDateInput, CalendarEvent } from './types';
|
|
3
|
+
import { CalendarDateInput, CalendarEvent, CalendarWorkingHours, CalendarWorkingHoursByWeekday } from './types';
|
|
4
4
|
/** Length given to a timed event that has no `end`. */
|
|
5
5
|
export declare const DEFAULT_EVENT_MINUTES = 30;
|
|
6
6
|
/**
|
|
@@ -8,8 +8,23 @@ export declare const DEFAULT_EVENT_MINUTES = 30;
|
|
|
8
8
|
* otherwise fill every cell up to it.
|
|
9
9
|
*/
|
|
10
10
|
export declare const MAX_SPAN_DAYS = 366;
|
|
11
|
-
/**
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* `Date` or ISO string → luxon. A string without an offset is read in local
|
|
13
|
+
* time. With a `zone`, the moment is then shown in that zone.
|
|
14
|
+
*/
|
|
15
|
+
export declare const toDateTime: (value: CalendarDateInput, zone?: string) => DateTime;
|
|
16
|
+
/**
|
|
17
|
+
* A day value (`date`, an untimed entry, an add limit): its local calendar
|
|
18
|
+
* date, as the start of that day in `zone`. Days stay on their date whatever
|
|
19
|
+
* the zone — only moments move.
|
|
20
|
+
*/
|
|
21
|
+
export declare const toZonedDay: (value: CalendarDateInput, zone?: string) => DateTime;
|
|
22
|
+
/** The reverse of `toZonedDay`: the same calendar day, as local midnight. */
|
|
23
|
+
export declare const toLocalDayDate: (day: DateTime) => Date;
|
|
24
|
+
/** The current moment, in `zone` when given. */
|
|
25
|
+
export declare const nowIn: (zone?: string) => DateTime<true> | DateTime<false>;
|
|
26
|
+
/** The browser's IANA time zone. */
|
|
27
|
+
export declare const getLocalTimeZone: () => string;
|
|
13
28
|
/** `yyyy-MM-dd` of a date — the key events are grouped by. */
|
|
14
29
|
export declare const toDayKey: (value: DateTime) => string;
|
|
15
30
|
/**
|
|
@@ -26,7 +41,7 @@ export type NormalizedEvent<TData = unknown> = {
|
|
|
26
41
|
/** Which of those days this copy is on, from 1. */
|
|
27
42
|
dayOfSpan: number;
|
|
28
43
|
};
|
|
29
|
-
export declare const normalizeEvent: <TData>(event: CalendarEvent<TData
|
|
44
|
+
export declare const normalizeEvent: <TData>(event: CalendarEvent<TData>, zone?: string) => NormalizedEvent<TData> | undefined;
|
|
30
45
|
/**
|
|
31
46
|
* Whether an entry fills a day: untimed, or timed and running from before
|
|
32
47
|
* the day starts to after it ends. Such entries are listed above the day
|
|
@@ -38,7 +53,7 @@ export declare const isWholeDay: (item: NormalizedEvent, day: DateTime) => boole
|
|
|
38
53
|
* spanning several days (see `NormalizedEvent.spanDays`) is repeated on
|
|
39
54
|
* each, with its `dayOfSpan`. Events with an unparsable `start` are dropped.
|
|
40
55
|
*/
|
|
41
|
-
export declare const groupEventsByDay: <TData>(events: CalendarEvent<TData>[]) => Map<string, NormalizedEvent<TData>[]>;
|
|
56
|
+
export declare const groupEventsByDay: <TData>(events: CalendarEvent<TData>[], zone?: string) => Map<string, NormalizedEvent<TData>[]>;
|
|
42
57
|
/** A cell of the month grid. */
|
|
43
58
|
export type MonthDay = {
|
|
44
59
|
date: DateTime;
|
|
@@ -98,6 +113,21 @@ export type PositionedEvent<TData = unknown> = {
|
|
|
98
113
|
* past either midnight are clipped to the day; events not on it are skipped.
|
|
99
114
|
*/
|
|
100
115
|
export declare const layoutDayEvents: <TData>(items: NormalizedEvent<TData>[], day: DateTime) => PositionedEvent<TData>[];
|
|
116
|
+
/**
|
|
117
|
+
* A day's working time: the day's own override, else its weekday's entry or
|
|
118
|
+
* the single range. `null` — none, the whole day is shaded; `undefined` —
|
|
119
|
+
* working hours aren't set, nothing is shaded.
|
|
120
|
+
*/
|
|
121
|
+
export declare const resolveWorkingHours: (workingHours: CalendarWorkingHours | CalendarWorkingHoursByWeekday | undefined, day: DateTime, override?: CalendarWorkingHours | null) => CalendarWorkingHours | null | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* The stretches of a day outside its working time, in minutes from
|
|
124
|
+
* midnight. Hours are clamped to the day; a range that ends before it
|
|
125
|
+
* starts leaves the whole day outside.
|
|
126
|
+
*/
|
|
127
|
+
export declare const getNonWorkingRanges: (hours: CalendarWorkingHours | null) => {
|
|
128
|
+
start: number;
|
|
129
|
+
end: number;
|
|
130
|
+
}[];
|
|
101
131
|
/** Applies `locale` when given; otherwise keeps luxon's default. */
|
|
102
132
|
export declare const withLocale: (value: DateTime, locale?: string) => DateTime<boolean>;
|
|
103
133
|
/**
|