@memobit/libs 3.28.2 → 3.30.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/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +7 -7
- package/dist/components/Auth/Login/Login2.js +4 -4
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +6 -6
- package/dist/components/DataView/DataView.CardView.js +84 -84
- package/dist/components/MenuHamburger/MenuHamburger2.js +14 -14
- package/dist/components/PageShell/AppFrame.js +32 -0
- package/dist/components/PageShell/AppNav.js +55 -0
- package/dist/components/PageShell/BottomSheet.js +45 -0
- package/dist/components/PageShell/FilterField.css +1 -0
- package/dist/components/PageShell/FilterField2.js +294 -0
- package/dist/components/PageShell/FilterSections.js +86 -0
- package/dist/components/PageShell/PageParts.js +316 -0
- package/dist/components/PageShell/PageShell.css +1 -0
- package/dist/components/PageShell/PageShell2.js +11 -0
- package/dist/components/PageShell/WorkbenchPhone.js +142 -0
- package/dist/components/PageShell/WorkbenchShell.js +160 -0
- package/dist/components/PageShell/filterRules.js +123 -0
- package/dist/components/PageShell/filterValues.js +30 -0
- package/dist/components/PageShell/menuItems.js +17 -0
- package/dist/components/PageShell/shellText.js +39 -0
- package/dist/components/PageShell/useAppFrame.js +6 -0
- package/dist/components/PageShell/usePaging.js +23 -0
- package/dist/components/PageShell/usePruneStaleFilters.js +17 -0
- package/dist/components/PageShell/useSummaryMessages.js +17 -0
- package/dist/components/Pagination/Pagination.css +1 -1
- package/dist/components/Pagination/Pagination2.js +14 -13
- package/dist/components/RouterAppFrame/RouterAppFrame.js +37 -0
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
- package/dist/components/ScrollToTop/ScrollToTop2.js +20 -19
- package/dist/contexts/LanguageContext/libMessages.js +57 -7
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAccountMenu.js +6 -6
- package/dist/index.d.ts +335 -0
- package/dist/index.js +235 -213
- package/dist/router.d.ts +68 -0
- package/dist/router.js +4 -2
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +147 -147
package/dist/index.d.ts
CHANGED
|
@@ -156,6 +156,22 @@ declare interface AppData<TPages, TTheme> {
|
|
|
156
156
|
theme: TTheme;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/** Set once per app: its name, logo and app-wide menu. Every PageShell inside it shows them in the right place for the device. */
|
|
160
|
+
export declare const AppFrame: FC<AppFrameProps>;
|
|
161
|
+
|
|
162
|
+
declare type AppFrameContextValue = Omit<AppFrameProps, 'children'>;
|
|
163
|
+
|
|
164
|
+
export declare interface AppFrameProps {
|
|
165
|
+
app: AppIdentity;
|
|
166
|
+
/** The app's sections. With react-router, RouterAppFrame from '@memobit/libs/router' builds these from paths. */
|
|
167
|
+
nav?: AppNavItem[];
|
|
168
|
+
/** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
|
|
169
|
+
account?: UseAccountMenuOptions;
|
|
170
|
+
/** App-specific menu entries, listed before the account ones. Page actions join them on small screens. */
|
|
171
|
+
menuItems?: MenuHamburgerItem[];
|
|
172
|
+
children: ReactNode;
|
|
173
|
+
}
|
|
174
|
+
|
|
159
175
|
export declare const AppHeader: default_2.FC<AppHeaderProps>;
|
|
160
176
|
|
|
161
177
|
export declare interface AppHeaderProps {
|
|
@@ -169,6 +185,24 @@ export declare interface AppHeaderProps {
|
|
|
169
185
|
showSeparator?: boolean;
|
|
170
186
|
}
|
|
171
187
|
|
|
188
|
+
export declare interface AppIdentity {
|
|
189
|
+
name: string;
|
|
190
|
+
icon?: IconName;
|
|
191
|
+
/** The app's own logo, used instead of `icon`: an image URL (e.g. '/icon.svg') or any element. */
|
|
192
|
+
logo?: ReactNode;
|
|
193
|
+
onHomeClick?: () => void;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** One of the app's sections. Shown as a side list on desktop, an icon rail on tablet and a bottom tab bar on phone. */
|
|
197
|
+
export declare interface AppNavItem {
|
|
198
|
+
id: string;
|
|
199
|
+
label: string;
|
|
200
|
+
icon: IconName;
|
|
201
|
+
count?: number;
|
|
202
|
+
isActive: boolean;
|
|
203
|
+
onSelect: () => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
172
206
|
export declare interface AppPersistenceDefaults<TPages, TTheme> {
|
|
173
207
|
pages?: TPages;
|
|
174
208
|
theme: TTheme;
|
|
@@ -188,6 +222,18 @@ declare interface AppVersionInfo {
|
|
|
188
222
|
buildDate: string;
|
|
189
223
|
}
|
|
190
224
|
|
|
225
|
+
/** A single filter's selected key, if it is one of `allowed`. */
|
|
226
|
+
export declare const asFilterKey: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K | undefined;
|
|
227
|
+
|
|
228
|
+
/** A multi filter's selected keys, limited to `allowed`. */
|
|
229
|
+
export declare const asFilterKeys: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K[];
|
|
230
|
+
|
|
231
|
+
/** A range filter's [min, max], or null when the range is off. */
|
|
232
|
+
export declare const asFilterRange: (value: FilterValue | undefined) => [number, number] | null;
|
|
233
|
+
|
|
234
|
+
/** A text filter's text and match mode, or null for any other value. */
|
|
235
|
+
export declare const asFilterText: (value: FilterValue | undefined) => TextFilterValue | null;
|
|
236
|
+
|
|
191
237
|
export declare interface AuthConfig {
|
|
192
238
|
apiBaseUrl: string;
|
|
193
239
|
appName?: string;
|
|
@@ -355,6 +401,9 @@ export declare const breakpoints: {
|
|
|
355
401
|
|
|
356
402
|
export declare const buildRequestHeaders: (method: HttpMethod, json?: boolean) => Record<string, string>;
|
|
357
403
|
|
|
404
|
+
/** View modes the lib knows: name one and it brings its own translated label and icon. */
|
|
405
|
+
export declare type BuiltInViewMode = 'cards' | 'table' | 'gallery' | 'calendar' | 'map';
|
|
406
|
+
|
|
358
407
|
export declare interface BulkAction {
|
|
359
408
|
key: string;
|
|
360
409
|
label: string;
|
|
@@ -1068,6 +1117,8 @@ export declare interface CopyButtonProps {
|
|
|
1068
1117
|
|
|
1069
1118
|
export declare type CopyButtonStatus = 'idle' | 'copied' | 'error';
|
|
1070
1119
|
|
|
1120
|
+
export declare const countActiveFilters: (filters: FilterSpec[], values: PageFilterValues) => number;
|
|
1121
|
+
|
|
1071
1122
|
export declare const CountryWithFlag: default_2.FC<CountryWithFlagProps>;
|
|
1072
1123
|
|
|
1073
1124
|
declare interface CountryWithFlagProps {
|
|
@@ -1286,6 +1337,12 @@ export declare interface DataViewTimelineConfig<T> {
|
|
|
1286
1337
|
granularity?: 'day' | 'month';
|
|
1287
1338
|
}
|
|
1288
1339
|
|
|
1340
|
+
export declare interface DateFilterSpec extends FilterSpecBase {
|
|
1341
|
+
kind: 'date';
|
|
1342
|
+
/** Whether items on or after the date match (`since`, the default) or on or before it (`until`). */
|
|
1343
|
+
relation?: 'since' | 'until';
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1289
1346
|
export declare const DatePicker: default_2.FC<DatePickerProps>;
|
|
1290
1347
|
|
|
1291
1348
|
export declare interface DatePickerProps extends Omit<CalendarProps, 'onChange' | 'value'> {
|
|
@@ -1391,6 +1448,8 @@ export declare interface DayAgendaProps<T = unknown> {
|
|
|
1391
1448
|
className?: string;
|
|
1392
1449
|
}
|
|
1393
1450
|
|
|
1451
|
+
export declare const defaultFilterValue: (spec: FilterSpec) => FilterValue;
|
|
1452
|
+
|
|
1394
1453
|
declare type DiffLang = 'javascript' | 'typescript' | 'jsx' | 'tsx' | 'css' | 'scss' | 'html' | 'json' | 'python' | 'bash' | 'plaintext';
|
|
1395
1454
|
|
|
1396
1455
|
declare type DiffMode = 'split' | 'inline';
|
|
@@ -1708,6 +1767,22 @@ export declare interface FileDropzoneProps {
|
|
|
1708
1767
|
onFiles?: (files: File[]) => void;
|
|
1709
1768
|
}
|
|
1710
1769
|
|
|
1770
|
+
/** Where a filter is drawn: the desktop side column or tablet drawer (`panel`), or the phone sheet (`sheet`). */
|
|
1771
|
+
export declare type FilterContext = 'panel' | 'sheet';
|
|
1772
|
+
|
|
1773
|
+
/** Forces one widget for a `single` or `multi` filter instead of letting the shell choose. */
|
|
1774
|
+
export declare type FilterControl = 'segmented' | 'radio' | 'chips' | 'checklist' | 'search-list';
|
|
1775
|
+
|
|
1776
|
+
/** One filter, drawn with the widget that suits its kind, option count and context. */
|
|
1777
|
+
export declare const FilterField: FC<FilterFieldProps>;
|
|
1778
|
+
|
|
1779
|
+
export declare interface FilterFieldProps {
|
|
1780
|
+
spec: FilterSpec;
|
|
1781
|
+
value: FilterValue | undefined;
|
|
1782
|
+
context: FilterContext;
|
|
1783
|
+
onChange: (value: FilterValue) => void;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1711
1786
|
/** Reads an item's lookup id(s): a single id for one-to-one fields, an array for many-to-many (tags). */
|
|
1712
1787
|
export declare type FilterIdGetter<T> = (item: T) => number | number[] | null | undefined;
|
|
1713
1788
|
|
|
@@ -1719,11 +1794,45 @@ export declare interface FilterKeyLookup {
|
|
|
1719
1794
|
name: string;
|
|
1720
1795
|
}
|
|
1721
1796
|
|
|
1797
|
+
/** What a filter's data is. The widget is chosen from this, the option count and where the filter sits. */
|
|
1798
|
+
export declare type FilterKind = 'single' | 'multi' | 'range' | 'rating' | 'toggle' | 'text' | 'date';
|
|
1799
|
+
|
|
1722
1800
|
export declare interface FilterLookup {
|
|
1723
1801
|
id: number;
|
|
1724
1802
|
name: string;
|
|
1725
1803
|
}
|
|
1726
1804
|
|
|
1805
|
+
export declare interface FilterMode {
|
|
1806
|
+
value: string;
|
|
1807
|
+
label: string;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
export declare interface FilterOption {
|
|
1811
|
+
value: string | number;
|
|
1812
|
+
label: string;
|
|
1813
|
+
/** How many items carry this option. Shown next to the option when present. */
|
|
1814
|
+
count?: number | string;
|
|
1815
|
+
icon?: IconName;
|
|
1816
|
+
color?: string;
|
|
1817
|
+
}
|
|
1818
|
+
|
|
1819
|
+
/** `pinned` filters start open and stay in sight; `secondary` ones sit at the end. */
|
|
1820
|
+
export declare type FilterPriority = 'pinned' | 'default' | 'secondary';
|
|
1821
|
+
|
|
1822
|
+
export declare type FilterSpec = SingleFilterSpec | MultiFilterSpec | RangeFilterSpec | RatingFilterSpec | ToggleFilterSpec | TextFilterSpec | DateFilterSpec;
|
|
1823
|
+
|
|
1824
|
+
declare interface FilterSpecBase {
|
|
1825
|
+
id: string;
|
|
1826
|
+
label: string;
|
|
1827
|
+
priority?: FilterPriority;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* A filter's value. By kind: single → option value or null; multi → option values; range → [min, max]
|
|
1832
|
+
* or null; rating → the minimum (0 for any); toggle → boolean; text → TextFilterValue; date → 'YYYY-MM-DD' or null.
|
|
1833
|
+
*/
|
|
1834
|
+
export declare type FilterValue = string | number | boolean | null | Array<string | number> | TextFilterValue;
|
|
1835
|
+
|
|
1727
1836
|
export declare const Flag: default_2.FC<FlagsProps>;
|
|
1728
1837
|
|
|
1729
1838
|
declare interface FlagsProps {
|
|
@@ -1922,6 +2031,12 @@ export declare const getRangeLabel: (range: BMIRange, index: number, total: numb
|
|
|
1922
2031
|
|
|
1923
2032
|
export declare const getResultsCount: (visiblePageSize: number, filteredItemsCount: number, totalItemsCount: number, currentPage: number, itemNoun?: string, language?: Language) => string;
|
|
1924
2033
|
|
|
2034
|
+
/**
|
|
2035
|
+
* The fixes that bring saved option filters in line with their current options: selected values that no option
|
|
2036
|
+
* offers anymore (a deleted lookup, a value no item carries) are dropped. Pass filter specs built from loaded data.
|
|
2037
|
+
*/
|
|
2038
|
+
export declare const getStaleFilterChanges: (filters: FilterSpec[], values: PageFilterValues) => StaleFilterChange[];
|
|
2039
|
+
|
|
1925
2040
|
export { getThemeConfig }
|
|
1926
2041
|
|
|
1927
2042
|
export declare const getTodayDateString: () => string;
|
|
@@ -2487,6 +2602,8 @@ export declare const isClientErrorStatus: (status: number) => boolean;
|
|
|
2487
2602
|
*/
|
|
2488
2603
|
export declare const isDateInRange: (date: Date, start: Date, end: Date) => boolean;
|
|
2489
2604
|
|
|
2605
|
+
export declare const isFilterActive: (spec: FilterSpec, value: FilterValue | undefined) => boolean;
|
|
2606
|
+
|
|
2490
2607
|
/**
|
|
2491
2608
|
* Checks if two dates are the same day (ignoring time)
|
|
2492
2609
|
*/
|
|
@@ -2809,6 +2926,12 @@ declare interface ModalProps {
|
|
|
2809
2926
|
usePortal?: boolean;
|
|
2810
2927
|
}
|
|
2811
2928
|
|
|
2929
|
+
export declare interface MultiFilterSpec extends FilterSpecBase {
|
|
2930
|
+
kind: 'multi';
|
|
2931
|
+
options: FilterOption[];
|
|
2932
|
+
control?: FilterControl;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2812
2935
|
export declare const NavBar: default_2.FC<NavBarProps>;
|
|
2813
2936
|
|
|
2814
2937
|
export declare interface NavBarItem {
|
|
@@ -2854,6 +2977,140 @@ declare interface NotificationPanelProps {
|
|
|
2854
2977
|
|
|
2855
2978
|
declare type OutputFormat = 'html' | 'markdown';
|
|
2856
2979
|
|
|
2980
|
+
export declare interface PageAction {
|
|
2981
|
+
id: string;
|
|
2982
|
+
label: string;
|
|
2983
|
+
icon?: IconName;
|
|
2984
|
+
variant?: ButtonVariant;
|
|
2985
|
+
disabled?: boolean;
|
|
2986
|
+
/** Always listed in the page menu, never as a button: for occasional actions such as "Manage locations". */
|
|
2987
|
+
menu?: boolean;
|
|
2988
|
+
/** In the menu, draws a divider above this action to start a new group. */
|
|
2989
|
+
separator?: boolean;
|
|
2990
|
+
onClick: () => void;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
export declare interface PageColumns {
|
|
2994
|
+
options: Array<{
|
|
2995
|
+
value: string;
|
|
2996
|
+
label: string;
|
|
2997
|
+
}>;
|
|
2998
|
+
/** The visible ones. */
|
|
2999
|
+
value: string[];
|
|
3000
|
+
onChange: (value: string[]) => void;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
export declare interface PageCounts {
|
|
3004
|
+
/** Items left after filtering and search. */
|
|
3005
|
+
shown: number;
|
|
3006
|
+
/** All items. */
|
|
3007
|
+
total: number;
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
export declare type PageFilterValues = Record<string, FilterValue | undefined>;
|
|
3011
|
+
|
|
3012
|
+
export declare interface PageGroupBy {
|
|
3013
|
+
options: Array<{
|
|
3014
|
+
value: string;
|
|
3015
|
+
label: string;
|
|
3016
|
+
}>;
|
|
3017
|
+
/** The grouping field, or null for no grouping. */
|
|
3018
|
+
value: string | null;
|
|
3019
|
+
onChange: (value: string | null) => void;
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
/** What the list holds, singular and plural, in the app's language: { one: 'recipe', other: 'recipes' }. */
|
|
3023
|
+
export declare interface PageNoun {
|
|
3024
|
+
one: string;
|
|
3025
|
+
other: string;
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
export declare interface PagePagination {
|
|
3029
|
+
/** 1-indexed. */
|
|
3030
|
+
page: number;
|
|
3031
|
+
pageCount: number;
|
|
3032
|
+
onChange: (page: number) => void;
|
|
3033
|
+
}
|
|
3034
|
+
|
|
3035
|
+
export declare interface PageSearch {
|
|
3036
|
+
value: string;
|
|
3037
|
+
placeholder?: string;
|
|
3038
|
+
onChange: (value: string) => void;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
/** Lays out a page's title, actions, search, sort, filters and view options around its content, per device. */
|
|
3042
|
+
export declare const PageShell: FC<PageShellProps>;
|
|
3043
|
+
|
|
3044
|
+
/** The layouts built so far. More shells (bar, catalog, scope, focus) arrive as pages need them. */
|
|
3045
|
+
export declare type PageShellLayout = 'workbench';
|
|
3046
|
+
|
|
3047
|
+
export declare interface PageShellProps {
|
|
3048
|
+
layout?: PageShellLayout;
|
|
3049
|
+
title: string;
|
|
3050
|
+
/** The list's size. With `noun` it heads the page ("38 of 171 recipes") and labels the "Show 38 recipes" buttons. */
|
|
3051
|
+
counts?: PageCounts;
|
|
3052
|
+
noun?: PageNoun;
|
|
3053
|
+
/** Extra text for the line under the title, after the counts: e.g. "12 favourites". */
|
|
3054
|
+
heading?: string;
|
|
3055
|
+
primaryAction?: PageAction;
|
|
3056
|
+
/** Secondary actions: shown as buttons on desktop, folded into the menu on smaller screens. */
|
|
3057
|
+
actions?: PageAction[];
|
|
3058
|
+
search?: PageSearch;
|
|
3059
|
+
sort?: PageSort;
|
|
3060
|
+
view?: PageView;
|
|
3061
|
+
filters?: FilterSpec[];
|
|
3062
|
+
values?: PageFilterValues;
|
|
3063
|
+
onFilterChange?: (id: string, value: FilterValue) => void;
|
|
3064
|
+
onClearFilters?: () => void;
|
|
3065
|
+
/** Overrides the text of the "Show N" buttons, which otherwise comes from `noun` ("Show N results" without one). */
|
|
3066
|
+
resultLabel?: (count: number) => string;
|
|
3067
|
+
/** The list's current page, shown at the top (beside the applied filters) once there is more than one. */
|
|
3068
|
+
pagination?: PagePagination;
|
|
3069
|
+
children: ReactNode;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
export declare interface PageSort {
|
|
3073
|
+
fields: Array<{
|
|
3074
|
+
value: string;
|
|
3075
|
+
label: string;
|
|
3076
|
+
}>;
|
|
3077
|
+
value: PageSortValue;
|
|
3078
|
+
/** Marks the sort as changed from the page's default. */
|
|
3079
|
+
highlighted?: boolean;
|
|
3080
|
+
onChange: (value: PageSortValue) => void;
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
export declare type PageSortDirection = 'asc' | 'desc';
|
|
3084
|
+
|
|
3085
|
+
export declare interface PageSortValue {
|
|
3086
|
+
field: string;
|
|
3087
|
+
direction: PageSortDirection;
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
export declare interface PageView {
|
|
3091
|
+
modes: Array<BuiltInViewMode | PageViewMode>;
|
|
3092
|
+
value: string;
|
|
3093
|
+
onChange: (value: string) => void;
|
|
3094
|
+
/** Optional fields the user can show or hide. Listed with the view options, closed until opened. */
|
|
3095
|
+
columns?: PageColumns;
|
|
3096
|
+
groupBy?: PageGroupBy;
|
|
3097
|
+
toggles?: PageViewToggle[];
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
export declare interface PageViewMode {
|
|
3101
|
+
value: string;
|
|
3102
|
+
label: string;
|
|
3103
|
+
icon: IconName;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
/** An on/off display preference shown with the view options, e.g. "Hide empty fields in cards". */
|
|
3107
|
+
export declare interface PageViewToggle {
|
|
3108
|
+
id: string;
|
|
3109
|
+
label: string;
|
|
3110
|
+
value: boolean;
|
|
3111
|
+
onChange: (value: boolean) => void;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
2857
3114
|
export declare const Pagination: FC<PaginationProps>;
|
|
2858
3115
|
|
|
2859
3116
|
declare interface PaginationProps {
|
|
@@ -2869,6 +3126,18 @@ declare interface PaginationProps {
|
|
|
2869
3126
|
horizontalAlign?: 'left' | 'center' | 'right';
|
|
2870
3127
|
}
|
|
2871
3128
|
|
|
3129
|
+
export declare interface PagingState {
|
|
3130
|
+
/** 1-indexed, and never past the last page. */
|
|
3131
|
+
page: number;
|
|
3132
|
+
pageSize: number;
|
|
3133
|
+
pageCount: number;
|
|
3134
|
+
setPage: (page: number) => void;
|
|
3135
|
+
/** Changes the page size and starts again from page 1. */
|
|
3136
|
+
setPageSize: (pageSize: number) => void;
|
|
3137
|
+
/** Ready for PageShell's `pagination` prop. */
|
|
3138
|
+
pagination: PagePagination;
|
|
3139
|
+
}
|
|
3140
|
+
|
|
2872
3141
|
export declare const PEDIATRIC_THRESHOLDS: Record<'male' | 'female', Record<number, [number, number, number]>>;
|
|
2873
3142
|
|
|
2874
3143
|
export declare const PieChart: default_2.FC<PieChartProps>;
|
|
@@ -3030,6 +3299,14 @@ export declare interface RadioProps {
|
|
|
3030
3299
|
className?: string;
|
|
3031
3300
|
}
|
|
3032
3301
|
|
|
3302
|
+
export declare interface RangeFilterSpec extends FilterSpecBase {
|
|
3303
|
+
kind: 'range';
|
|
3304
|
+
min: number;
|
|
3305
|
+
max: number;
|
|
3306
|
+
step?: number;
|
|
3307
|
+
unit?: string;
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3033
3310
|
export declare const RangeSlider: FC<RangeSliderProps>;
|
|
3034
3311
|
|
|
3035
3312
|
export declare interface RangeSliderProps {
|
|
@@ -3062,6 +3339,11 @@ export declare const Rating: FC<RatingProps>;
|
|
|
3062
3339
|
|
|
3063
3340
|
export declare type RatingFilled = 'full' | 'half' | 'empty';
|
|
3064
3341
|
|
|
3342
|
+
export declare interface RatingFilterSpec extends FilterSpecBase {
|
|
3343
|
+
kind: 'rating';
|
|
3344
|
+
max: number;
|
|
3345
|
+
}
|
|
3346
|
+
|
|
3065
3347
|
export declare type RatingIconType = 'star' | 'bullet' | 'bar' | 'emoji';
|
|
3066
3348
|
|
|
3067
3349
|
declare interface RatingProps {
|
|
@@ -3252,6 +3534,12 @@ declare interface SignalStrengthProps {
|
|
|
3252
3534
|
className?: string;
|
|
3253
3535
|
}
|
|
3254
3536
|
|
|
3537
|
+
export declare interface SingleFilterSpec extends FilterSpecBase {
|
|
3538
|
+
kind: 'single';
|
|
3539
|
+
options: FilterOption[];
|
|
3540
|
+
control?: FilterControl;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3255
3543
|
export declare const Skeleton: default_2.FC<SkeletonProps>;
|
|
3256
3544
|
|
|
3257
3545
|
export declare type SkeletonAnimation = 'pulse' | 'wave' | 'none';
|
|
@@ -3387,6 +3675,11 @@ export declare type StackedBarSegmentPattern = 'solid' | 'striped' | 'hatched';
|
|
|
3387
3675
|
|
|
3388
3676
|
export declare type StackedBarSegmentState = 'default' | 'danger' | 'success' | 'warning' | 'info';
|
|
3389
3677
|
|
|
3678
|
+
export declare interface StaleFilterChange {
|
|
3679
|
+
id: string;
|
|
3680
|
+
value: FilterValue;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3390
3683
|
export declare const Stats: default_2.FC<StatsProps>;
|
|
3391
3684
|
|
|
3392
3685
|
export declare type StatsAlign = 'left' | 'center';
|
|
@@ -3463,6 +3756,20 @@ export declare interface SwipeHandlers {
|
|
|
3463
3756
|
onTouchCancel: () => void;
|
|
3464
3757
|
}
|
|
3465
3758
|
|
|
3759
|
+
export declare interface TextFilterSpec extends FilterSpecBase {
|
|
3760
|
+
kind: 'text';
|
|
3761
|
+
placeholder?: string;
|
|
3762
|
+
/** Adds the standard "Any word / All words" choice; the value's `mode` is then a LogicalOperator ('or' or 'and'). */
|
|
3763
|
+
wordMatch?: boolean;
|
|
3764
|
+
/** Custom ways to match the typed text, when `wordMatch` doesn't fit. The first one is the default. */
|
|
3765
|
+
modes?: FilterMode[];
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3768
|
+
export declare interface TextFilterValue {
|
|
3769
|
+
text: string;
|
|
3770
|
+
mode?: string;
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3466
3773
|
export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'circuit-harbor' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'indigo-stitch' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal' | 'war-room';
|
|
3467
3774
|
|
|
3468
3775
|
export { THEME_CONFIGS }
|
|
@@ -3658,6 +3965,10 @@ export declare type ToastType = 'info' | 'success' | 'warning' | 'danger';
|
|
|
3658
3965
|
|
|
3659
3966
|
export declare const ToggleButtons: FC<ToggleProps>;
|
|
3660
3967
|
|
|
3968
|
+
export declare interface ToggleFilterSpec extends FilterSpecBase {
|
|
3969
|
+
kind: 'toggle';
|
|
3970
|
+
}
|
|
3971
|
+
|
|
3661
3972
|
declare interface ToggleProps {
|
|
3662
3973
|
activeVariant?: ButtonVariant;
|
|
3663
3974
|
onToggleChange: (mode: string) => void;
|
|
@@ -3952,6 +4263,9 @@ export declare interface UseAccountMenuReturn {
|
|
|
3952
4263
|
modals: ReactElement;
|
|
3953
4264
|
}
|
|
3954
4265
|
|
|
4266
|
+
/** The app identity and menu set by the nearest AppFrame, or null outside one. */
|
|
4267
|
+
export declare const useAppFrame: () => AppFrameContextValue | null;
|
|
4268
|
+
|
|
3955
4269
|
export declare function useAppPersistence<TPages, TTheme>(appId: string, defaults: AppPersistenceDefaults<TPages, TTheme>): UseAppPersistenceReturn<TPages, TTheme>;
|
|
3956
4270
|
|
|
3957
4271
|
export declare interface UseAppPersistenceReturn<TPages, TTheme> {
|
|
@@ -4032,6 +4346,17 @@ export declare interface UseListMotionReturn {
|
|
|
4032
4346
|
|
|
4033
4347
|
export declare const useMessages: <T>(messages: Localized<T>) => T;
|
|
4034
4348
|
|
|
4349
|
+
/** The current page of a list, held by the page so its header and the list agree. */
|
|
4350
|
+
export declare const usePaging: ({ itemCount, initialPageSize, resetOn }: UsePagingOptions) => PagingState;
|
|
4351
|
+
|
|
4352
|
+
declare interface UsePagingOptions {
|
|
4353
|
+
/** Items in the list as shown (after filters and search). */
|
|
4354
|
+
itemCount: number;
|
|
4355
|
+
initialPageSize?: number;
|
|
4356
|
+
/** Values whose change sends the list back to page 1: usually the filters, the search and the sort. */
|
|
4357
|
+
resetOn?: unknown[];
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4035
4360
|
/**
|
|
4036
4361
|
* Hook pentru multiple popover-uri cu ID-uri
|
|
4037
4362
|
* Util când ai multe popover-uri și vrei să le controlezi individual
|
|
@@ -4044,6 +4369,16 @@ export declare const usePopover: () => {
|
|
|
4044
4369
|
getAnchorEl: (id: string) => HTMLElement | null;
|
|
4045
4370
|
};
|
|
4046
4371
|
|
|
4372
|
+
/** Drops saved filter values whose options are gone, once the data has loaded and whenever the options change. */
|
|
4373
|
+
export declare const usePruneStaleFilters: (filters: FilterSpec[], values: PageFilterValues, { isLoaded, onPrune }: UsePruneStaleFiltersOptions) => void;
|
|
4374
|
+
|
|
4375
|
+
declare interface UsePruneStaleFiltersOptions {
|
|
4376
|
+
/** False until the data the options come from has loaded: an empty list then would wipe valid saved filters. */
|
|
4377
|
+
isLoaded: boolean;
|
|
4378
|
+
/** Applies all the fixes at once (one state update, so none overwrites another). */
|
|
4379
|
+
onPrune: (changes: StaleFilterChange[]) => void;
|
|
4380
|
+
}
|
|
4381
|
+
|
|
4047
4382
|
export declare interface User {
|
|
4048
4383
|
id: string;
|
|
4049
4384
|
username: string;
|