@platned/ui 1.0.0 → 1.1.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/README.md +30 -7
- package/dist/blocks-charts.cjs +1 -0
- package/dist/blocks-charts.cjs.map +1 -1
- package/dist/blocks-charts.js +2 -0
- package/dist/blocks-charts.js.map +1 -1
- package/dist/blocks.cjs +282 -186
- package/dist/blocks.cjs.map +1 -1
- package/dist/blocks.d.cts +85 -5
- package/dist/blocks.d.ts +85 -5
- package/dist/blocks.js +280 -169
- package/dist/blocks.js.map +1 -1
- package/dist/chart.cjs +1 -0
- package/dist/chart.cjs.map +1 -1
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +2 -1
- package/dist/chart.js.map +1 -1
- package/dist/{chunk-327NSKZW.js → chunk-6BJ3OMUZ.js} +4 -3
- package/dist/{chunk-327NSKZW.js.map → chunk-6BJ3OMUZ.js.map} +1 -1
- package/dist/{chunk-GJJWRZ4B.js → chunk-7RXFHQL5.js} +4 -3
- package/dist/{chunk-GJJWRZ4B.js.map → chunk-7RXFHQL5.js.map} +1 -1
- package/dist/{chunk-2L5XAYNK.js → chunk-MJC4A7I4.js} +3 -1
- package/dist/{chunk-2L5XAYNK.js.map → chunk-MJC4A7I4.js.map} +1 -1
- package/dist/{chunk-WGCAQEZ4.js → chunk-QYFD7KIK.js} +3 -2
- package/dist/{chunk-WGCAQEZ4.js.map → chunk-QYFD7KIK.js.map} +1 -1
- package/dist/code-block-highlight.cjs +1 -0
- package/dist/code-block-highlight.cjs.map +1 -1
- package/dist/code-block-highlight.js +4 -3
- package/dist/code-block-highlight.js.map +1 -1
- package/dist/{data-table-Dec6t8NO.d.ts → data-table-CcIINjPg.d.ts} +30 -3
- package/dist/data-table.cjs +200 -124
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +156 -79
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +10632 -7124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +204 -8
- package/dist/index.js +5933 -2507
- package/dist/index.js.map +1 -1
- package/dist/map.cjs +1 -0
- package/dist/map.cjs.map +1 -1
- package/dist/map.d.cts +2 -0
- package/dist/map.d.ts +2 -0
- package/dist/map.js +6 -0
- package/dist/map.js.map +1 -1
- package/package.json +2 -7
package/dist/blocks.d.cts
CHANGED
|
@@ -87,7 +87,10 @@ interface SidebarNavItem {
|
|
|
87
87
|
disabled?: boolean;
|
|
88
88
|
/** Overrides route matching. */
|
|
89
89
|
isActive?: boolean;
|
|
90
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Child rows, one level deep, in a foldable sub-menu. With a `to` or `href` of its own (from 1.1.1), the row opens
|
|
92
|
+
* that page (a section's overview, say) and a chevron button beside it folds the children.
|
|
93
|
+
*/
|
|
91
94
|
children?: SidebarNavItem[];
|
|
92
95
|
/** Whether the children start open. Default: open when one of them is the current route. */
|
|
93
96
|
defaultOpen?: boolean;
|
|
@@ -297,13 +300,18 @@ interface DataTableFilterOptions {
|
|
|
297
300
|
variant?: 'menu' | 'buttons' | 'tabs';
|
|
298
301
|
/** Label of the "everything" choice of `buttons` and `tabs`. Default "All". */
|
|
299
302
|
allLabel?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Show the filter but don't let it be used, e.g. while the server can't filter by this column yet. A string says
|
|
305
|
+
* why, on hover. New in 1.1.1.
|
|
306
|
+
*/
|
|
307
|
+
disabled?: boolean | string;
|
|
300
308
|
}
|
|
301
309
|
type DataTableField<TData> = ValueField<TData> & {
|
|
302
310
|
/** Column id. Default: the key. */
|
|
303
311
|
id?: string;
|
|
304
312
|
/** Sort by this column. Default `true`, except for `badge` columns (lists). */
|
|
305
313
|
sortable?: boolean;
|
|
306
|
-
/** Can be hidden from the
|
|
314
|
+
/** Can be hidden from its header menu and the View menu. Default `true`. */
|
|
307
315
|
hideable?: boolean;
|
|
308
316
|
/** A faceted filter for this column in the toolbar. */
|
|
309
317
|
filter?: boolean | DataTableFilterOptions;
|
|
@@ -341,6 +349,8 @@ interface DataTableFilterMeta {
|
|
|
341
349
|
options?: string[];
|
|
342
350
|
variant: 'menu' | 'buttons' | 'tabs';
|
|
343
351
|
allLabel: string;
|
|
352
|
+
/** Shown but not usable; a string says why. */
|
|
353
|
+
disabled?: boolean | string;
|
|
344
354
|
/** The label and badge colour for one value, as the column shows it. */
|
|
345
355
|
describe: (value: string) => {
|
|
346
356
|
label: string;
|
|
@@ -475,6 +485,12 @@ interface DataTableManual {
|
|
|
475
485
|
pagination?: boolean;
|
|
476
486
|
/** Total rows on the server. Needed with `pagination`, so the pager knows the page count. */
|
|
477
487
|
rowCount?: number;
|
|
488
|
+
/**
|
|
489
|
+
* With `filtering`: each filter's counts from the server, by column id, then value, e.g.
|
|
490
|
+
* `{ status: { active: 120, inactive: 4 } }`. The rows on hand are one page, so the table can't
|
|
491
|
+
* count them itself; a filter the server sends no counts for shows none. New in 1.1.1.
|
|
492
|
+
*/
|
|
493
|
+
facets?: Record<string, Record<string, number>>;
|
|
478
494
|
}
|
|
479
495
|
interface DataTableSearchOptions {
|
|
480
496
|
/** Filter one column instead of every column. */
|
|
@@ -482,6 +498,11 @@ interface DataTableSearchOptions {
|
|
|
482
498
|
placeholder?: string;
|
|
483
499
|
/** Accessible name. Default "Search". */
|
|
484
500
|
label?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Show the box but don't let it be used, e.g. while the server can't search yet. A string says why, on hover.
|
|
503
|
+
* New in 1.1.1.
|
|
504
|
+
*/
|
|
505
|
+
disabled?: boolean | string;
|
|
485
506
|
}
|
|
486
507
|
interface DataTableRowLinkProps {
|
|
487
508
|
href: string;
|
|
@@ -609,8 +630,13 @@ interface DataTableProps<TData, TValue = unknown> {
|
|
|
609
630
|
* header row pinned. Works with horizontal scrolling and sticky columns, and caps the card list
|
|
610
631
|
* in the responsive layout. The pattern of MUI's `TableContainer` + `stickyHeader` and Ant
|
|
611
632
|
* Design's `scroll.y`. New in 0.7.1.
|
|
633
|
+
*
|
|
634
|
+
* `'fill'` takes the height of the parent instead (a flex column, or a box with a set height): the
|
|
635
|
+
* toolbar and pager stay put and the rows scroll in what is left, as on a list page whose heading
|
|
636
|
+
* stays fixed. Where the parent has no set height (a page that scrolls as a whole, on a phone) the
|
|
637
|
+
* table simply grows. New in 1.1.1.
|
|
612
638
|
*/
|
|
613
|
-
maxHeight?: number | string;
|
|
639
|
+
maxHeight?: number | string | 'fill';
|
|
614
640
|
manual?: DataTableManual;
|
|
615
641
|
/** Controlled state. Any key you pass is controlled; the rest stay internal. */
|
|
616
642
|
state?: Partial<DataTableState>;
|
|
@@ -701,6 +727,14 @@ interface MenuItemData {
|
|
|
701
727
|
separator?: boolean;
|
|
702
728
|
/** Shown only when `can(permission)` is true. */
|
|
703
729
|
permission?: string;
|
|
730
|
+
/** A submenu: these items open beside this one. A submenu left with no visible item is dropped. */
|
|
731
|
+
items?: MenuItemData[];
|
|
732
|
+
/**
|
|
733
|
+
* With `items`: they are choices (radio items), and this is the chosen one's `value`. In a
|
|
734
|
+
* choice submenu, an item's `value` names it; `onValueChange` gets the one picked.
|
|
735
|
+
*/
|
|
736
|
+
value?: string;
|
|
737
|
+
onValueChange?: (value: string) => void;
|
|
704
738
|
}
|
|
705
739
|
/** A badge colour, a chart colour (`chart-1`…`chart-5`), or a CSS colour. */
|
|
706
740
|
type ChartColor = BadgeColor | `chart-${1 | 2 | 3 | 4 | 5}` | (string & Record<never, never>);
|
|
@@ -964,13 +998,19 @@ interface AppShellProps {
|
|
|
964
998
|
placeholder?: string;
|
|
965
999
|
onSearch?: (query: string) => void;
|
|
966
1000
|
};
|
|
1001
|
+
/**
|
|
1002
|
+
* `padded` (default): the page gets the title row (`title`, `description`, `actions`) and padding.
|
|
1003
|
+
* `fill`: for an app whose pages draw their own header (a `PageHeader`): the page is rendered as it
|
|
1004
|
+
* is, fills the space under the header and scrolls on its own, so a page can pin a toolbar or footer.
|
|
1005
|
+
*/
|
|
1006
|
+
page?: 'padded' | 'fill';
|
|
967
1007
|
/** The sidebar starts collapsed to icons. */
|
|
968
1008
|
defaultCollapsed?: boolean;
|
|
969
1009
|
/** Content of the page. */
|
|
970
1010
|
children?: ReactNode;
|
|
971
1011
|
className?: string;
|
|
972
1012
|
}
|
|
973
|
-
declare function AppShell({ variant, side, submenus, brand, nav, aside, panelSearch, footerNav, user, workspaces, workspace, onWorkspaceChange, icons, currentPath, linkComponent, can, title, description, breadcrumbs, actions, search, defaultCollapsed, children, className, }: AppShellProps): react.JSX.Element;
|
|
1013
|
+
declare function AppShell({ variant, side, submenus, brand, nav, aside, panelSearch, footerNav, user, workspaces, workspace, onWorkspaceChange, icons, currentPath, linkComponent, can, title, description, breadcrumbs, actions, search, page: pageMode, defaultCollapsed, children, className, }: AppShellProps): react.JSX.Element;
|
|
974
1014
|
|
|
975
1015
|
/**
|
|
976
1016
|
* SettingsDialog: settings in a dialog, with a sidebar of sections, from JSON.
|
|
@@ -2836,6 +2876,46 @@ interface RecordPageProps<T = Record<string, unknown>> {
|
|
|
2836
2876
|
}
|
|
2837
2877
|
declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
|
|
2838
2878
|
|
|
2879
|
+
/**
|
|
2880
|
+
* ShortcutsDialog: the keyboard shortcuts of an app, from JSON, in groups.
|
|
2881
|
+
*
|
|
2882
|
+
* <ShortcutsDialog
|
|
2883
|
+
* groups={[
|
|
2884
|
+
* { title: 'Anywhere', shortcuts: [{ keys: ['?'], label: 'Show keyboard shortcuts' }] },
|
|
2885
|
+
* { title: 'Week grid', shortcuts: [{ keys: ['Mod', 'D'], label: 'Fill the selection' }] },
|
|
2886
|
+
* ]}
|
|
2887
|
+
* />
|
|
2888
|
+
*
|
|
2889
|
+
* `Mod` reads ⌘ on Apple devices and Ctrl elsewhere (also `Alt` → ⌥, `Shift` → ⇧ there). Pressing
|
|
2890
|
+
* `hotkey` (default `?`) anywhere outside a text field opens it; `hotkey={false}` turns that off.
|
|
2891
|
+
* Controlled with `open` / `onOpenChange`, or uncontrolled with `defaultOpen`.
|
|
2892
|
+
*/
|
|
2893
|
+
interface ShortcutData {
|
|
2894
|
+
/** The keys pressed together, e.g. `['Mod', 'Shift', 'K']`. */
|
|
2895
|
+
keys: string[];
|
|
2896
|
+
/** Another way to do the same thing, shown after "or". */
|
|
2897
|
+
alt?: string[];
|
|
2898
|
+
label: string;
|
|
2899
|
+
}
|
|
2900
|
+
interface ShortcutGroupData {
|
|
2901
|
+
title: string;
|
|
2902
|
+
shortcuts: ShortcutData[];
|
|
2903
|
+
}
|
|
2904
|
+
interface ShortcutsDialogProps {
|
|
2905
|
+
groups: ShortcutGroupData[];
|
|
2906
|
+
title?: string;
|
|
2907
|
+
description?: ReactNode;
|
|
2908
|
+
/** The key that opens the dialog from anywhere outside a text field. Default `?`. */
|
|
2909
|
+
hotkey?: string | false;
|
|
2910
|
+
open?: boolean;
|
|
2911
|
+
defaultOpen?: boolean;
|
|
2912
|
+
onOpenChange?: (open: boolean) => void;
|
|
2913
|
+
/** An element that opens it, e.g. a help button. */
|
|
2914
|
+
trigger?: ReactNode;
|
|
2915
|
+
modal?: boolean;
|
|
2916
|
+
}
|
|
2917
|
+
declare function ShortcutsDialog({ groups, title, description, hotkey, open, defaultOpen, onOpenChange, trigger, modal, }: ShortcutsDialogProps): react.JSX.Element;
|
|
2918
|
+
|
|
2839
2919
|
/**
|
|
2840
2920
|
* ConfirmDialog: a decision from JSON. Asks before an action and gathers what the action needs:
|
|
2841
2921
|
*
|
|
@@ -3079,4 +3159,4 @@ interface PersonCardsProps<P extends Person = Person> extends PersonViewProps<P>
|
|
|
3079
3159
|
}
|
|
3080
3160
|
declare function PersonCards<P extends Person = Person>({ people, getId, layout, columns, title, description, headerActions, onHeaderAction, emptyText, className, ...view }: PersonCardsProps<P>): react.JSX.Element;
|
|
3081
3161
|
|
|
3082
|
-
export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
|
|
3162
|
+
export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
|
package/dist/blocks.d.ts
CHANGED
|
@@ -87,7 +87,10 @@ interface SidebarNavItem {
|
|
|
87
87
|
disabled?: boolean;
|
|
88
88
|
/** Overrides route matching. */
|
|
89
89
|
isActive?: boolean;
|
|
90
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Child rows, one level deep, in a foldable sub-menu. With a `to` or `href` of its own (from 1.1.1), the row opens
|
|
92
|
+
* that page (a section's overview, say) and a chevron button beside it folds the children.
|
|
93
|
+
*/
|
|
91
94
|
children?: SidebarNavItem[];
|
|
92
95
|
/** Whether the children start open. Default: open when one of them is the current route. */
|
|
93
96
|
defaultOpen?: boolean;
|
|
@@ -297,13 +300,18 @@ interface DataTableFilterOptions {
|
|
|
297
300
|
variant?: 'menu' | 'buttons' | 'tabs';
|
|
298
301
|
/** Label of the "everything" choice of `buttons` and `tabs`. Default "All". */
|
|
299
302
|
allLabel?: string;
|
|
303
|
+
/**
|
|
304
|
+
* Show the filter but don't let it be used, e.g. while the server can't filter by this column yet. A string says
|
|
305
|
+
* why, on hover. New in 1.1.1.
|
|
306
|
+
*/
|
|
307
|
+
disabled?: boolean | string;
|
|
300
308
|
}
|
|
301
309
|
type DataTableField<TData> = ValueField<TData> & {
|
|
302
310
|
/** Column id. Default: the key. */
|
|
303
311
|
id?: string;
|
|
304
312
|
/** Sort by this column. Default `true`, except for `badge` columns (lists). */
|
|
305
313
|
sortable?: boolean;
|
|
306
|
-
/** Can be hidden from the
|
|
314
|
+
/** Can be hidden from its header menu and the View menu. Default `true`. */
|
|
307
315
|
hideable?: boolean;
|
|
308
316
|
/** A faceted filter for this column in the toolbar. */
|
|
309
317
|
filter?: boolean | DataTableFilterOptions;
|
|
@@ -341,6 +349,8 @@ interface DataTableFilterMeta {
|
|
|
341
349
|
options?: string[];
|
|
342
350
|
variant: 'menu' | 'buttons' | 'tabs';
|
|
343
351
|
allLabel: string;
|
|
352
|
+
/** Shown but not usable; a string says why. */
|
|
353
|
+
disabled?: boolean | string;
|
|
344
354
|
/** The label and badge colour for one value, as the column shows it. */
|
|
345
355
|
describe: (value: string) => {
|
|
346
356
|
label: string;
|
|
@@ -475,6 +485,12 @@ interface DataTableManual {
|
|
|
475
485
|
pagination?: boolean;
|
|
476
486
|
/** Total rows on the server. Needed with `pagination`, so the pager knows the page count. */
|
|
477
487
|
rowCount?: number;
|
|
488
|
+
/**
|
|
489
|
+
* With `filtering`: each filter's counts from the server, by column id, then value, e.g.
|
|
490
|
+
* `{ status: { active: 120, inactive: 4 } }`. The rows on hand are one page, so the table can't
|
|
491
|
+
* count them itself; a filter the server sends no counts for shows none. New in 1.1.1.
|
|
492
|
+
*/
|
|
493
|
+
facets?: Record<string, Record<string, number>>;
|
|
478
494
|
}
|
|
479
495
|
interface DataTableSearchOptions {
|
|
480
496
|
/** Filter one column instead of every column. */
|
|
@@ -482,6 +498,11 @@ interface DataTableSearchOptions {
|
|
|
482
498
|
placeholder?: string;
|
|
483
499
|
/** Accessible name. Default "Search". */
|
|
484
500
|
label?: string;
|
|
501
|
+
/**
|
|
502
|
+
* Show the box but don't let it be used, e.g. while the server can't search yet. A string says why, on hover.
|
|
503
|
+
* New in 1.1.1.
|
|
504
|
+
*/
|
|
505
|
+
disabled?: boolean | string;
|
|
485
506
|
}
|
|
486
507
|
interface DataTableRowLinkProps {
|
|
487
508
|
href: string;
|
|
@@ -609,8 +630,13 @@ interface DataTableProps<TData, TValue = unknown> {
|
|
|
609
630
|
* header row pinned. Works with horizontal scrolling and sticky columns, and caps the card list
|
|
610
631
|
* in the responsive layout. The pattern of MUI's `TableContainer` + `stickyHeader` and Ant
|
|
611
632
|
* Design's `scroll.y`. New in 0.7.1.
|
|
633
|
+
*
|
|
634
|
+
* `'fill'` takes the height of the parent instead (a flex column, or a box with a set height): the
|
|
635
|
+
* toolbar and pager stay put and the rows scroll in what is left, as on a list page whose heading
|
|
636
|
+
* stays fixed. Where the parent has no set height (a page that scrolls as a whole, on a phone) the
|
|
637
|
+
* table simply grows. New in 1.1.1.
|
|
612
638
|
*/
|
|
613
|
-
maxHeight?: number | string;
|
|
639
|
+
maxHeight?: number | string | 'fill';
|
|
614
640
|
manual?: DataTableManual;
|
|
615
641
|
/** Controlled state. Any key you pass is controlled; the rest stay internal. */
|
|
616
642
|
state?: Partial<DataTableState>;
|
|
@@ -701,6 +727,14 @@ interface MenuItemData {
|
|
|
701
727
|
separator?: boolean;
|
|
702
728
|
/** Shown only when `can(permission)` is true. */
|
|
703
729
|
permission?: string;
|
|
730
|
+
/** A submenu: these items open beside this one. A submenu left with no visible item is dropped. */
|
|
731
|
+
items?: MenuItemData[];
|
|
732
|
+
/**
|
|
733
|
+
* With `items`: they are choices (radio items), and this is the chosen one's `value`. In a
|
|
734
|
+
* choice submenu, an item's `value` names it; `onValueChange` gets the one picked.
|
|
735
|
+
*/
|
|
736
|
+
value?: string;
|
|
737
|
+
onValueChange?: (value: string) => void;
|
|
704
738
|
}
|
|
705
739
|
/** A badge colour, a chart colour (`chart-1`…`chart-5`), or a CSS colour. */
|
|
706
740
|
type ChartColor = BadgeColor | `chart-${1 | 2 | 3 | 4 | 5}` | (string & Record<never, never>);
|
|
@@ -964,13 +998,19 @@ interface AppShellProps {
|
|
|
964
998
|
placeholder?: string;
|
|
965
999
|
onSearch?: (query: string) => void;
|
|
966
1000
|
};
|
|
1001
|
+
/**
|
|
1002
|
+
* `padded` (default): the page gets the title row (`title`, `description`, `actions`) and padding.
|
|
1003
|
+
* `fill`: for an app whose pages draw their own header (a `PageHeader`): the page is rendered as it
|
|
1004
|
+
* is, fills the space under the header and scrolls on its own, so a page can pin a toolbar or footer.
|
|
1005
|
+
*/
|
|
1006
|
+
page?: 'padded' | 'fill';
|
|
967
1007
|
/** The sidebar starts collapsed to icons. */
|
|
968
1008
|
defaultCollapsed?: boolean;
|
|
969
1009
|
/** Content of the page. */
|
|
970
1010
|
children?: ReactNode;
|
|
971
1011
|
className?: string;
|
|
972
1012
|
}
|
|
973
|
-
declare function AppShell({ variant, side, submenus, brand, nav, aside, panelSearch, footerNav, user, workspaces, workspace, onWorkspaceChange, icons, currentPath, linkComponent, can, title, description, breadcrumbs, actions, search, defaultCollapsed, children, className, }: AppShellProps): react.JSX.Element;
|
|
1013
|
+
declare function AppShell({ variant, side, submenus, brand, nav, aside, panelSearch, footerNav, user, workspaces, workspace, onWorkspaceChange, icons, currentPath, linkComponent, can, title, description, breadcrumbs, actions, search, page: pageMode, defaultCollapsed, children, className, }: AppShellProps): react.JSX.Element;
|
|
974
1014
|
|
|
975
1015
|
/**
|
|
976
1016
|
* SettingsDialog: settings in a dialog, with a sidebar of sections, from JSON.
|
|
@@ -2836,6 +2876,46 @@ interface RecordPageProps<T = Record<string, unknown>> {
|
|
|
2836
2876
|
}
|
|
2837
2877
|
declare function RecordPage<T = Record<string, unknown>>({ record, header, banners, tabs, sections, tab, defaultTab, onTabChange, aside, onAction, loading, notFound, children, icons, linkComponent: Link, can, className, }: RecordPageProps<T>): react.JSX.Element;
|
|
2838
2878
|
|
|
2879
|
+
/**
|
|
2880
|
+
* ShortcutsDialog: the keyboard shortcuts of an app, from JSON, in groups.
|
|
2881
|
+
*
|
|
2882
|
+
* <ShortcutsDialog
|
|
2883
|
+
* groups={[
|
|
2884
|
+
* { title: 'Anywhere', shortcuts: [{ keys: ['?'], label: 'Show keyboard shortcuts' }] },
|
|
2885
|
+
* { title: 'Week grid', shortcuts: [{ keys: ['Mod', 'D'], label: 'Fill the selection' }] },
|
|
2886
|
+
* ]}
|
|
2887
|
+
* />
|
|
2888
|
+
*
|
|
2889
|
+
* `Mod` reads ⌘ on Apple devices and Ctrl elsewhere (also `Alt` → ⌥, `Shift` → ⇧ there). Pressing
|
|
2890
|
+
* `hotkey` (default `?`) anywhere outside a text field opens it; `hotkey={false}` turns that off.
|
|
2891
|
+
* Controlled with `open` / `onOpenChange`, or uncontrolled with `defaultOpen`.
|
|
2892
|
+
*/
|
|
2893
|
+
interface ShortcutData {
|
|
2894
|
+
/** The keys pressed together, e.g. `['Mod', 'Shift', 'K']`. */
|
|
2895
|
+
keys: string[];
|
|
2896
|
+
/** Another way to do the same thing, shown after "or". */
|
|
2897
|
+
alt?: string[];
|
|
2898
|
+
label: string;
|
|
2899
|
+
}
|
|
2900
|
+
interface ShortcutGroupData {
|
|
2901
|
+
title: string;
|
|
2902
|
+
shortcuts: ShortcutData[];
|
|
2903
|
+
}
|
|
2904
|
+
interface ShortcutsDialogProps {
|
|
2905
|
+
groups: ShortcutGroupData[];
|
|
2906
|
+
title?: string;
|
|
2907
|
+
description?: ReactNode;
|
|
2908
|
+
/** The key that opens the dialog from anywhere outside a text field. Default `?`. */
|
|
2909
|
+
hotkey?: string | false;
|
|
2910
|
+
open?: boolean;
|
|
2911
|
+
defaultOpen?: boolean;
|
|
2912
|
+
onOpenChange?: (open: boolean) => void;
|
|
2913
|
+
/** An element that opens it, e.g. a help button. */
|
|
2914
|
+
trigger?: ReactNode;
|
|
2915
|
+
modal?: boolean;
|
|
2916
|
+
}
|
|
2917
|
+
declare function ShortcutsDialog({ groups, title, description, hotkey, open, defaultOpen, onOpenChange, trigger, modal, }: ShortcutsDialogProps): react.JSX.Element;
|
|
2918
|
+
|
|
2839
2919
|
/**
|
|
2840
2920
|
* ConfirmDialog: a decision from JSON. Asks before an action and gathers what the action needs:
|
|
2841
2921
|
*
|
|
@@ -3079,4 +3159,4 @@ interface PersonCardsProps<P extends Person = Person> extends PersonViewProps<P>
|
|
|
3079
3159
|
}
|
|
3080
3160
|
declare function PersonCards<P extends Person = Person>({ people, getId, layout, columns, title, description, headerActions, onHeaderAction, emptyText, className, ...view }: PersonCardsProps<P>): react.JSX.Element;
|
|
3081
3161
|
|
|
3082
|
-
export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
|
|
3162
|
+
export { type ActionData, AppShell, type AppShellAction, type AppShellChecklistItem, type AppShellGroupAction, type AppShellListItem, type AppShellNavEntry, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, type AppShellSection, type AppShellTreeNode, type AppShellUser, type AppShellWorkspace, type BadgeData, type BlockIcons, type CardBlockAction, type CardBlockProps, ChartCard, type ChartCardProps, type ChartColor, type ChartSegment, type ChartSeries, type ChartView, ConfirmDialog, type ConfirmDialogBlocker, type ConfirmDialogOption, type ConfirmDialogProps, type ConfirmDialogSummaryItem, type ConfirmDialogValues, DASHBOARD_SIZES, Dashboard, type DashboardChartWidget, type DashboardComponents, type DashboardCustomWidget, type DashboardHeatmapWidget, type DashboardHeight, type DashboardLayoutItem, type DashboardMapWidget, type DashboardProps, type DashboardRankedListWidget, type DashboardSize, type DashboardStatWidget, type DashboardTableWidget, type DashboardTier, type DashboardWidget, DashboardWidgetView, type DashboardWidgetViewProps, type DashboardWidth, DataGrid, type DataGridCellState, type DataGridChange, type DataGridColumn, type DataGridNotes, type DataGridOption, type DataGridProps, DataTable, type DataTableColumnDef, DataTableFacetedFilter, type DataTableField, type DataTableProps, type DataTableRowAction, type DependentOptions, type DetailField, type DetailSection, DetailSections, type DetailSectionsProps, type FieldPath, Form, type FormActionsApi, type FormCheckField, type FormComboboxField, type FormCountryField, type FormCustomField, type FormDateField, type FormErrors, type FormField, type FormFieldBase, type FormFieldContext, type FormFieldInput, type FormFieldMap, type FormFieldMapEntry, type FormFieldShort, type FormFieldSize, type FormFieldType, type FormFields, type FormJsonSchema, type FormLayout, type FormListField, type FormOptionInput, type FormProps, type FormRadioField, type FormResult, type FormSchema, type FormSegmentedField, type FormSegmentedOption, type FormSelectField, type FormStandardSchema, type FormState, type FormStep, type FormSubmitOn, type FormTextField, type FormTextType, type FormTextareaField, type FormTimeZoneField, type FormValues, type FormatOptions, FormatProvider, type FormatProviderProps, FullscreenDialog, type FullscreenDialogProps, HEIGHT_ROWS, Heatmap, type HeatmapCell, type HeatmapDay, type HeatmapProps, type IconRef, Kanban, type KanbanAction, type KanbanCardFields, type KanbanChange, type KanbanDrop, type KanbanLane, type KanbanLaneAction, type KanbanPaletteItem, type KanbanProps, type KanbanRequire, type KanbanSwimlanes, ListDetail, type ListDetailItemFields, type ListDetailProps, type MenuItemData, PageHeader, type PageHeaderAvatar, type PageHeaderMeta, type PageHeaderProps, type Person, PersonCard, type PersonCardLayout, type PersonCardProps, PersonCards, type PersonCardsProps, type PersonStat, type Presence, RankedList, type RankedListItem, type RankedListProps, type RecordBanner, RecordPage, type RecordPageProps, type RecordTab, SettingsDialog, type SettingsDialogProps, type SettingsDialogSection, type ShortcutData, type ShortcutGroupData, ShortcutsDialog, type ShortcutsDialogProps, type Stat, type StatBreakdownItem, StatCard, type StatCardProps, type StatCardSize, StatCards, type StatCardsProps, type StatPoint, type StatView, TIER_COLUMNS, TableCard, type TableCardProps, Value, type ValueField, type ValueFormat, type ValueProps, type ValueType, chartColor, coerceSize, formatValue, getValueAt, humanize, isEmptyValue, isNumericType, linkAdapter, moveItem, renderValue, resolveIcon, sizeLabel, useDependentOptions, useFormat, widgetSizes, widgetTitle };
|