@memobit/libs 3.28.1 → 3.29.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 +27 -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 +257 -0
- package/dist/components/PageShell/PageShell.css +1 -0
- package/dist/components/PageShell/PageShell2.js +11 -0
- package/dist/components/PageShell/WorkbenchPhone.js +139 -0
- package/dist/components/PageShell/WorkbenchShell.js +154 -0
- package/dist/components/PageShell/filterRules.js +123 -0
- package/dist/components/PageShell/filterValues.js +30 -0
- package/dist/components/PageShell/menuItems.js +9 -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/Popover/Popover2.js +77 -67
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
- package/dist/components/ScrollToTop/ScrollToTop2.js +20 -19
- package/dist/contexts/LanguageContext/libMessages.js +55 -7
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAccountMenu.js +6 -6
- package/dist/index.d.ts +299 -0
- package/dist/index.js +235 -213
- 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,20 @@ 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
|
+
/** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
|
|
167
|
+
account?: UseAccountMenuOptions;
|
|
168
|
+
/** App-specific menu entries, listed before the account ones. Page actions join them on small screens. */
|
|
169
|
+
menuItems?: MenuHamburgerItem[];
|
|
170
|
+
children: ReactNode;
|
|
171
|
+
}
|
|
172
|
+
|
|
159
173
|
export declare const AppHeader: default_2.FC<AppHeaderProps>;
|
|
160
174
|
|
|
161
175
|
export declare interface AppHeaderProps {
|
|
@@ -169,6 +183,14 @@ export declare interface AppHeaderProps {
|
|
|
169
183
|
showSeparator?: boolean;
|
|
170
184
|
}
|
|
171
185
|
|
|
186
|
+
export declare interface AppIdentity {
|
|
187
|
+
name: string;
|
|
188
|
+
icon?: IconName;
|
|
189
|
+
/** The app's own logo, used instead of `icon`: an image URL (e.g. '/icon.svg') or any element. */
|
|
190
|
+
logo?: ReactNode;
|
|
191
|
+
onHomeClick?: () => void;
|
|
192
|
+
}
|
|
193
|
+
|
|
172
194
|
export declare interface AppPersistenceDefaults<TPages, TTheme> {
|
|
173
195
|
pages?: TPages;
|
|
174
196
|
theme: TTheme;
|
|
@@ -188,6 +210,18 @@ declare interface AppVersionInfo {
|
|
|
188
210
|
buildDate: string;
|
|
189
211
|
}
|
|
190
212
|
|
|
213
|
+
/** A single filter's selected key, if it is one of `allowed`. */
|
|
214
|
+
export declare const asFilterKey: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K | undefined;
|
|
215
|
+
|
|
216
|
+
/** A multi filter's selected keys, limited to `allowed`. */
|
|
217
|
+
export declare const asFilterKeys: <K extends string | number>(value: FilterValue | undefined, allowed: readonly K[]) => K[];
|
|
218
|
+
|
|
219
|
+
/** A range filter's [min, max], or null when the range is off. */
|
|
220
|
+
export declare const asFilterRange: (value: FilterValue | undefined) => [number, number] | null;
|
|
221
|
+
|
|
222
|
+
/** A text filter's text and match mode, or null for any other value. */
|
|
223
|
+
export declare const asFilterText: (value: FilterValue | undefined) => TextFilterValue | null;
|
|
224
|
+
|
|
191
225
|
export declare interface AuthConfig {
|
|
192
226
|
apiBaseUrl: string;
|
|
193
227
|
appName?: string;
|
|
@@ -355,6 +389,9 @@ export declare const breakpoints: {
|
|
|
355
389
|
|
|
356
390
|
export declare const buildRequestHeaders: (method: HttpMethod, json?: boolean) => Record<string, string>;
|
|
357
391
|
|
|
392
|
+
/** View modes the lib knows: name one and it brings its own translated label and icon. */
|
|
393
|
+
export declare type BuiltInViewMode = 'cards' | 'table' | 'gallery' | 'calendar' | 'map';
|
|
394
|
+
|
|
358
395
|
export declare interface BulkAction {
|
|
359
396
|
key: string;
|
|
360
397
|
label: string;
|
|
@@ -1068,6 +1105,8 @@ export declare interface CopyButtonProps {
|
|
|
1068
1105
|
|
|
1069
1106
|
export declare type CopyButtonStatus = 'idle' | 'copied' | 'error';
|
|
1070
1107
|
|
|
1108
|
+
export declare const countActiveFilters: (filters: FilterSpec[], values: PageFilterValues) => number;
|
|
1109
|
+
|
|
1071
1110
|
export declare const CountryWithFlag: default_2.FC<CountryWithFlagProps>;
|
|
1072
1111
|
|
|
1073
1112
|
declare interface CountryWithFlagProps {
|
|
@@ -1286,6 +1325,12 @@ export declare interface DataViewTimelineConfig<T> {
|
|
|
1286
1325
|
granularity?: 'day' | 'month';
|
|
1287
1326
|
}
|
|
1288
1327
|
|
|
1328
|
+
export declare interface DateFilterSpec extends FilterSpecBase {
|
|
1329
|
+
kind: 'date';
|
|
1330
|
+
/** Whether items on or after the date match (`since`, the default) or on or before it (`until`). */
|
|
1331
|
+
relation?: 'since' | 'until';
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1289
1334
|
export declare const DatePicker: default_2.FC<DatePickerProps>;
|
|
1290
1335
|
|
|
1291
1336
|
export declare interface DatePickerProps extends Omit<CalendarProps, 'onChange' | 'value'> {
|
|
@@ -1391,6 +1436,8 @@ export declare interface DayAgendaProps<T = unknown> {
|
|
|
1391
1436
|
className?: string;
|
|
1392
1437
|
}
|
|
1393
1438
|
|
|
1439
|
+
export declare const defaultFilterValue: (spec: FilterSpec) => FilterValue;
|
|
1440
|
+
|
|
1394
1441
|
declare type DiffLang = 'javascript' | 'typescript' | 'jsx' | 'tsx' | 'css' | 'scss' | 'html' | 'json' | 'python' | 'bash' | 'plaintext';
|
|
1395
1442
|
|
|
1396
1443
|
declare type DiffMode = 'split' | 'inline';
|
|
@@ -1708,6 +1755,22 @@ export declare interface FileDropzoneProps {
|
|
|
1708
1755
|
onFiles?: (files: File[]) => void;
|
|
1709
1756
|
}
|
|
1710
1757
|
|
|
1758
|
+
/** Where a filter is drawn: the desktop side column or tablet drawer (`panel`), or the phone sheet (`sheet`). */
|
|
1759
|
+
export declare type FilterContext = 'panel' | 'sheet';
|
|
1760
|
+
|
|
1761
|
+
/** Forces one widget for a `single` or `multi` filter instead of letting the shell choose. */
|
|
1762
|
+
export declare type FilterControl = 'segmented' | 'radio' | 'chips' | 'checklist' | 'search-list';
|
|
1763
|
+
|
|
1764
|
+
/** One filter, drawn with the widget that suits its kind, option count and context. */
|
|
1765
|
+
export declare const FilterField: FC<FilterFieldProps>;
|
|
1766
|
+
|
|
1767
|
+
export declare interface FilterFieldProps {
|
|
1768
|
+
spec: FilterSpec;
|
|
1769
|
+
value: FilterValue | undefined;
|
|
1770
|
+
context: FilterContext;
|
|
1771
|
+
onChange: (value: FilterValue) => void;
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1711
1774
|
/** Reads an item's lookup id(s): a single id for one-to-one fields, an array for many-to-many (tags). */
|
|
1712
1775
|
export declare type FilterIdGetter<T> = (item: T) => number | number[] | null | undefined;
|
|
1713
1776
|
|
|
@@ -1719,11 +1782,45 @@ export declare interface FilterKeyLookup {
|
|
|
1719
1782
|
name: string;
|
|
1720
1783
|
}
|
|
1721
1784
|
|
|
1785
|
+
/** What a filter's data is. The widget is chosen from this, the option count and where the filter sits. */
|
|
1786
|
+
export declare type FilterKind = 'single' | 'multi' | 'range' | 'rating' | 'toggle' | 'text' | 'date';
|
|
1787
|
+
|
|
1722
1788
|
export declare interface FilterLookup {
|
|
1723
1789
|
id: number;
|
|
1724
1790
|
name: string;
|
|
1725
1791
|
}
|
|
1726
1792
|
|
|
1793
|
+
export declare interface FilterMode {
|
|
1794
|
+
value: string;
|
|
1795
|
+
label: string;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
export declare interface FilterOption {
|
|
1799
|
+
value: string | number;
|
|
1800
|
+
label: string;
|
|
1801
|
+
/** How many items carry this option. Shown next to the option when present. */
|
|
1802
|
+
count?: number | string;
|
|
1803
|
+
icon?: IconName;
|
|
1804
|
+
color?: string;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/** `pinned` filters start open and stay in sight; `secondary` ones sit at the end. */
|
|
1808
|
+
export declare type FilterPriority = 'pinned' | 'default' | 'secondary';
|
|
1809
|
+
|
|
1810
|
+
export declare type FilterSpec = SingleFilterSpec | MultiFilterSpec | RangeFilterSpec | RatingFilterSpec | ToggleFilterSpec | TextFilterSpec | DateFilterSpec;
|
|
1811
|
+
|
|
1812
|
+
declare interface FilterSpecBase {
|
|
1813
|
+
id: string;
|
|
1814
|
+
label: string;
|
|
1815
|
+
priority?: FilterPriority;
|
|
1816
|
+
}
|
|
1817
|
+
|
|
1818
|
+
/**
|
|
1819
|
+
* A filter's value. By kind: single → option value or null; multi → option values; range → [min, max]
|
|
1820
|
+
* or null; rating → the minimum (0 for any); toggle → boolean; text → TextFilterValue; date → 'YYYY-MM-DD' or null.
|
|
1821
|
+
*/
|
|
1822
|
+
export declare type FilterValue = string | number | boolean | null | Array<string | number> | TextFilterValue;
|
|
1823
|
+
|
|
1727
1824
|
export declare const Flag: default_2.FC<FlagsProps>;
|
|
1728
1825
|
|
|
1729
1826
|
declare interface FlagsProps {
|
|
@@ -1922,6 +2019,12 @@ export declare const getRangeLabel: (range: BMIRange, index: number, total: numb
|
|
|
1922
2019
|
|
|
1923
2020
|
export declare const getResultsCount: (visiblePageSize: number, filteredItemsCount: number, totalItemsCount: number, currentPage: number, itemNoun?: string, language?: Language) => string;
|
|
1924
2021
|
|
|
2022
|
+
/**
|
|
2023
|
+
* The fixes that bring saved option filters in line with their current options: selected values that no option
|
|
2024
|
+
* offers anymore (a deleted lookup, a value no item carries) are dropped. Pass filter specs built from loaded data.
|
|
2025
|
+
*/
|
|
2026
|
+
export declare const getStaleFilterChanges: (filters: FilterSpec[], values: PageFilterValues) => StaleFilterChange[];
|
|
2027
|
+
|
|
1925
2028
|
export { getThemeConfig }
|
|
1926
2029
|
|
|
1927
2030
|
export declare const getTodayDateString: () => string;
|
|
@@ -2487,6 +2590,8 @@ export declare const isClientErrorStatus: (status: number) => boolean;
|
|
|
2487
2590
|
*/
|
|
2488
2591
|
export declare const isDateInRange: (date: Date, start: Date, end: Date) => boolean;
|
|
2489
2592
|
|
|
2593
|
+
export declare const isFilterActive: (spec: FilterSpec, value: FilterValue | undefined) => boolean;
|
|
2594
|
+
|
|
2490
2595
|
/**
|
|
2491
2596
|
* Checks if two dates are the same day (ignoring time)
|
|
2492
2597
|
*/
|
|
@@ -2809,6 +2914,12 @@ declare interface ModalProps {
|
|
|
2809
2914
|
usePortal?: boolean;
|
|
2810
2915
|
}
|
|
2811
2916
|
|
|
2917
|
+
export declare interface MultiFilterSpec extends FilterSpecBase {
|
|
2918
|
+
kind: 'multi';
|
|
2919
|
+
options: FilterOption[];
|
|
2920
|
+
control?: FilterControl;
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2812
2923
|
export declare const NavBar: default_2.FC<NavBarProps>;
|
|
2813
2924
|
|
|
2814
2925
|
export declare interface NavBarItem {
|
|
@@ -2854,6 +2965,116 @@ declare interface NotificationPanelProps {
|
|
|
2854
2965
|
|
|
2855
2966
|
declare type OutputFormat = 'html' | 'markdown';
|
|
2856
2967
|
|
|
2968
|
+
export declare interface PageAction {
|
|
2969
|
+
id: string;
|
|
2970
|
+
label: string;
|
|
2971
|
+
icon?: IconName;
|
|
2972
|
+
variant?: ButtonVariant;
|
|
2973
|
+
disabled?: boolean;
|
|
2974
|
+
onClick: () => void;
|
|
2975
|
+
}
|
|
2976
|
+
|
|
2977
|
+
export declare interface PageColumns {
|
|
2978
|
+
options: Array<{
|
|
2979
|
+
value: string;
|
|
2980
|
+
label: string;
|
|
2981
|
+
}>;
|
|
2982
|
+
/** The visible ones. */
|
|
2983
|
+
value: string[];
|
|
2984
|
+
onChange: (value: string[]) => void;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
export declare interface PageCounts {
|
|
2988
|
+
/** Items left after filtering and search. */
|
|
2989
|
+
shown: number;
|
|
2990
|
+
/** All items. */
|
|
2991
|
+
total: number;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
export declare type PageFilterValues = Record<string, FilterValue | undefined>;
|
|
2995
|
+
|
|
2996
|
+
/** What the list holds, singular and plural, in the app's language: { one: 'recipe', other: 'recipes' }. */
|
|
2997
|
+
export declare interface PageNoun {
|
|
2998
|
+
one: string;
|
|
2999
|
+
other: string;
|
|
3000
|
+
}
|
|
3001
|
+
|
|
3002
|
+
export declare interface PagePagination {
|
|
3003
|
+
/** 1-indexed. */
|
|
3004
|
+
page: number;
|
|
3005
|
+
pageCount: number;
|
|
3006
|
+
onChange: (page: number) => void;
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
export declare interface PageSearch {
|
|
3010
|
+
value: string;
|
|
3011
|
+
placeholder?: string;
|
|
3012
|
+
onChange: (value: string) => void;
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
/** Lays out a page's title, actions, search, sort, filters and view options around its content, per device. */
|
|
3016
|
+
export declare const PageShell: FC<PageShellProps>;
|
|
3017
|
+
|
|
3018
|
+
/** The layouts built so far. More shells (bar, catalog, scope, focus) arrive as pages need them. */
|
|
3019
|
+
export declare type PageShellLayout = 'workbench';
|
|
3020
|
+
|
|
3021
|
+
export declare interface PageShellProps {
|
|
3022
|
+
layout?: PageShellLayout;
|
|
3023
|
+
title: string;
|
|
3024
|
+
/** The list's size. With `noun` it heads the page ("38 of 171 recipes") and labels the "Show 38 recipes" buttons. */
|
|
3025
|
+
counts?: PageCounts;
|
|
3026
|
+
noun?: PageNoun;
|
|
3027
|
+
/** Extra text for the line under the title, after the counts: e.g. "12 favourites". */
|
|
3028
|
+
heading?: string;
|
|
3029
|
+
primaryAction?: PageAction;
|
|
3030
|
+
/** Secondary actions: shown as buttons on desktop, folded into the menu on smaller screens. */
|
|
3031
|
+
actions?: PageAction[];
|
|
3032
|
+
search?: PageSearch;
|
|
3033
|
+
sort?: PageSort;
|
|
3034
|
+
view?: PageView;
|
|
3035
|
+
filters?: FilterSpec[];
|
|
3036
|
+
values?: PageFilterValues;
|
|
3037
|
+
onFilterChange?: (id: string, value: FilterValue) => void;
|
|
3038
|
+
onClearFilters?: () => void;
|
|
3039
|
+
/** Overrides the text of the "Show N" buttons, which otherwise comes from `noun` ("Show N results" without one). */
|
|
3040
|
+
resultLabel?: (count: number) => string;
|
|
3041
|
+
/** The list's current page, shown at the top (beside the applied filters) once there is more than one. */
|
|
3042
|
+
pagination?: PagePagination;
|
|
3043
|
+
children: ReactNode;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
export declare interface PageSort {
|
|
3047
|
+
fields: Array<{
|
|
3048
|
+
value: string;
|
|
3049
|
+
label: string;
|
|
3050
|
+
}>;
|
|
3051
|
+
value: PageSortValue;
|
|
3052
|
+
/** Marks the sort as changed from the page's default. */
|
|
3053
|
+
highlighted?: boolean;
|
|
3054
|
+
onChange: (value: PageSortValue) => void;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
export declare type PageSortDirection = 'asc' | 'desc';
|
|
3058
|
+
|
|
3059
|
+
export declare interface PageSortValue {
|
|
3060
|
+
field: string;
|
|
3061
|
+
direction: PageSortDirection;
|
|
3062
|
+
}
|
|
3063
|
+
|
|
3064
|
+
export declare interface PageView {
|
|
3065
|
+
modes: Array<BuiltInViewMode | PageViewMode>;
|
|
3066
|
+
value: string;
|
|
3067
|
+
onChange: (value: string) => void;
|
|
3068
|
+
/** Optional fields the user can show or hide. Listed with the view options, closed until opened. */
|
|
3069
|
+
columns?: PageColumns;
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
export declare interface PageViewMode {
|
|
3073
|
+
value: string;
|
|
3074
|
+
label: string;
|
|
3075
|
+
icon: IconName;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
2857
3078
|
export declare const Pagination: FC<PaginationProps>;
|
|
2858
3079
|
|
|
2859
3080
|
declare interface PaginationProps {
|
|
@@ -2869,6 +3090,18 @@ declare interface PaginationProps {
|
|
|
2869
3090
|
horizontalAlign?: 'left' | 'center' | 'right';
|
|
2870
3091
|
}
|
|
2871
3092
|
|
|
3093
|
+
export declare interface PagingState {
|
|
3094
|
+
/** 1-indexed, and never past the last page. */
|
|
3095
|
+
page: number;
|
|
3096
|
+
pageSize: number;
|
|
3097
|
+
pageCount: number;
|
|
3098
|
+
setPage: (page: number) => void;
|
|
3099
|
+
/** Changes the page size and starts again from page 1. */
|
|
3100
|
+
setPageSize: (pageSize: number) => void;
|
|
3101
|
+
/** Ready for PageShell's `pagination` prop. */
|
|
3102
|
+
pagination: PagePagination;
|
|
3103
|
+
}
|
|
3104
|
+
|
|
2872
3105
|
export declare const PEDIATRIC_THRESHOLDS: Record<'male' | 'female', Record<number, [number, number, number]>>;
|
|
2873
3106
|
|
|
2874
3107
|
export declare const PieChart: default_2.FC<PieChartProps>;
|
|
@@ -3030,6 +3263,14 @@ export declare interface RadioProps {
|
|
|
3030
3263
|
className?: string;
|
|
3031
3264
|
}
|
|
3032
3265
|
|
|
3266
|
+
export declare interface RangeFilterSpec extends FilterSpecBase {
|
|
3267
|
+
kind: 'range';
|
|
3268
|
+
min: number;
|
|
3269
|
+
max: number;
|
|
3270
|
+
step?: number;
|
|
3271
|
+
unit?: string;
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3033
3274
|
export declare const RangeSlider: FC<RangeSliderProps>;
|
|
3034
3275
|
|
|
3035
3276
|
export declare interface RangeSliderProps {
|
|
@@ -3062,6 +3303,11 @@ export declare const Rating: FC<RatingProps>;
|
|
|
3062
3303
|
|
|
3063
3304
|
export declare type RatingFilled = 'full' | 'half' | 'empty';
|
|
3064
3305
|
|
|
3306
|
+
export declare interface RatingFilterSpec extends FilterSpecBase {
|
|
3307
|
+
kind: 'rating';
|
|
3308
|
+
max: number;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3065
3311
|
export declare type RatingIconType = 'star' | 'bullet' | 'bar' | 'emoji';
|
|
3066
3312
|
|
|
3067
3313
|
declare interface RatingProps {
|
|
@@ -3252,6 +3498,12 @@ declare interface SignalStrengthProps {
|
|
|
3252
3498
|
className?: string;
|
|
3253
3499
|
}
|
|
3254
3500
|
|
|
3501
|
+
export declare interface SingleFilterSpec extends FilterSpecBase {
|
|
3502
|
+
kind: 'single';
|
|
3503
|
+
options: FilterOption[];
|
|
3504
|
+
control?: FilterControl;
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3255
3507
|
export declare const Skeleton: default_2.FC<SkeletonProps>;
|
|
3256
3508
|
|
|
3257
3509
|
export declare type SkeletonAnimation = 'pulse' | 'wave' | 'none';
|
|
@@ -3387,6 +3639,11 @@ export declare type StackedBarSegmentPattern = 'solid' | 'striped' | 'hatched';
|
|
|
3387
3639
|
|
|
3388
3640
|
export declare type StackedBarSegmentState = 'default' | 'danger' | 'success' | 'warning' | 'info';
|
|
3389
3641
|
|
|
3642
|
+
export declare interface StaleFilterChange {
|
|
3643
|
+
id: string;
|
|
3644
|
+
value: FilterValue;
|
|
3645
|
+
}
|
|
3646
|
+
|
|
3390
3647
|
export declare const Stats: default_2.FC<StatsProps>;
|
|
3391
3648
|
|
|
3392
3649
|
export declare type StatsAlign = 'left' | 'center';
|
|
@@ -3463,6 +3720,20 @@ export declare interface SwipeHandlers {
|
|
|
3463
3720
|
onTouchCancel: () => void;
|
|
3464
3721
|
}
|
|
3465
3722
|
|
|
3723
|
+
export declare interface TextFilterSpec extends FilterSpecBase {
|
|
3724
|
+
kind: 'text';
|
|
3725
|
+
placeholder?: string;
|
|
3726
|
+
/** Adds the standard "Any word / All words" choice; the value's `mode` is then a LogicalOperator ('or' or 'and'). */
|
|
3727
|
+
wordMatch?: boolean;
|
|
3728
|
+
/** Custom ways to match the typed text, when `wordMatch` doesn't fit. The first one is the default. */
|
|
3729
|
+
modes?: FilterMode[];
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
export declare interface TextFilterValue {
|
|
3733
|
+
text: string;
|
|
3734
|
+
mode?: string;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3466
3737
|
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
3738
|
|
|
3468
3739
|
export { THEME_CONFIGS }
|
|
@@ -3658,6 +3929,10 @@ export declare type ToastType = 'info' | 'success' | 'warning' | 'danger';
|
|
|
3658
3929
|
|
|
3659
3930
|
export declare const ToggleButtons: FC<ToggleProps>;
|
|
3660
3931
|
|
|
3932
|
+
export declare interface ToggleFilterSpec extends FilterSpecBase {
|
|
3933
|
+
kind: 'toggle';
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3661
3936
|
declare interface ToggleProps {
|
|
3662
3937
|
activeVariant?: ButtonVariant;
|
|
3663
3938
|
onToggleChange: (mode: string) => void;
|
|
@@ -3952,6 +4227,9 @@ export declare interface UseAccountMenuReturn {
|
|
|
3952
4227
|
modals: ReactElement;
|
|
3953
4228
|
}
|
|
3954
4229
|
|
|
4230
|
+
/** The app identity and menu set by the nearest AppFrame, or null outside one. */
|
|
4231
|
+
export declare const useAppFrame: () => AppFrameContextValue | null;
|
|
4232
|
+
|
|
3955
4233
|
export declare function useAppPersistence<TPages, TTheme>(appId: string, defaults: AppPersistenceDefaults<TPages, TTheme>): UseAppPersistenceReturn<TPages, TTheme>;
|
|
3956
4234
|
|
|
3957
4235
|
export declare interface UseAppPersistenceReturn<TPages, TTheme> {
|
|
@@ -4032,6 +4310,17 @@ export declare interface UseListMotionReturn {
|
|
|
4032
4310
|
|
|
4033
4311
|
export declare const useMessages: <T>(messages: Localized<T>) => T;
|
|
4034
4312
|
|
|
4313
|
+
/** The current page of a list, held by the page so its header and the list agree. */
|
|
4314
|
+
export declare const usePaging: ({ itemCount, initialPageSize, resetOn }: UsePagingOptions) => PagingState;
|
|
4315
|
+
|
|
4316
|
+
declare interface UsePagingOptions {
|
|
4317
|
+
/** Items in the list as shown (after filters and search). */
|
|
4318
|
+
itemCount: number;
|
|
4319
|
+
initialPageSize?: number;
|
|
4320
|
+
/** Values whose change sends the list back to page 1: usually the filters, the search and the sort. */
|
|
4321
|
+
resetOn?: unknown[];
|
|
4322
|
+
}
|
|
4323
|
+
|
|
4035
4324
|
/**
|
|
4036
4325
|
* Hook pentru multiple popover-uri cu ID-uri
|
|
4037
4326
|
* Util când ai multe popover-uri și vrei să le controlezi individual
|
|
@@ -4044,6 +4333,16 @@ export declare const usePopover: () => {
|
|
|
4044
4333
|
getAnchorEl: (id: string) => HTMLElement | null;
|
|
4045
4334
|
};
|
|
4046
4335
|
|
|
4336
|
+
/** Drops saved filter values whose options are gone, once the data has loaded and whenever the options change. */
|
|
4337
|
+
export declare const usePruneStaleFilters: (filters: FilterSpec[], values: PageFilterValues, { isLoaded, onPrune }: UsePruneStaleFiltersOptions) => void;
|
|
4338
|
+
|
|
4339
|
+
declare interface UsePruneStaleFiltersOptions {
|
|
4340
|
+
/** False until the data the options come from has loaded: an empty list then would wipe valid saved filters. */
|
|
4341
|
+
isLoaded: boolean;
|
|
4342
|
+
/** Applies all the fixes at once (one state update, so none overwrites another). */
|
|
4343
|
+
onPrune: (changes: StaleFilterChange[]) => void;
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4047
4346
|
export declare interface User {
|
|
4048
4347
|
id: string;
|
|
4049
4348
|
username: string;
|