@memobit/libs 3.18.0 → 3.19.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/README.md +1 -1
- package/dist/components/AnalogClock/AnalogClock.css +1 -1
- package/dist/components/Calendar/Calendar.css +1 -1
- package/dist/components/DataView/DataView.CardView.js +58 -55
- package/dist/components/DataView/DataView.TableView.js +171 -0
- package/dist/components/DataView/DataView.css +1 -1
- package/dist/components/DataView/DataView.helpers.js +17 -15
- package/dist/components/DataView/DataView2.js +251 -358
- package/dist/components/DatePicker/DatePicker.css +1 -1
- package/dist/components/MiniStatsCard/MiniStatsCard2.js +28 -21
- package/dist/components/RollingNumber/RollingNumber.css +1 -1
- package/dist/components/RollingNumber/RollingNumber.helpers.js +7 -0
- package/dist/components/RollingNumber/RollingNumber2.js +34 -35
- package/dist/components/Stats/Stats2.js +23 -16
- package/dist/components/TimePicker/TimePicker.css +1 -1
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useListMotion/ListMotion.css +1 -0
- package/dist/hooks/useListMotion/useHighlight.js +11 -0
- package/dist/hooks/useListMotion/useListMotion.js +228 -0
- package/dist/index.d.ts +57 -1
- package/dist/index.js +303 -298
- package/dist/styles/effects.scss +4 -4
- package/dist/styles/variables.scss +20 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { ReactElement } from 'react';
|
|
|
17
17
|
import { ReactNode } from 'react';
|
|
18
18
|
import { ReactPortal } from 'react';
|
|
19
19
|
import { RefAttributes } from 'react';
|
|
20
|
+
import { RefObject } from 'react';
|
|
20
21
|
import { SyntheticEvent } from 'react';
|
|
21
22
|
import { THEME_CONFIGS } from '@memobit/themes';
|
|
22
23
|
import { ThemeConfig } from '@memobit/themes';
|
|
@@ -1061,7 +1062,7 @@ export declare const CSRF_HEADER = "X-CSRF-Token";
|
|
|
1061
1062
|
|
|
1062
1063
|
export declare const DATA_FILES_PATH = "/data-files";
|
|
1063
1064
|
|
|
1064
|
-
declare function DataView_2<T>({ columns, data, rowKey, pinnedIds, selectable, onSelectionChange, selectedIds: controlledSelectedIds, pageSizeOptions, initialPageSize, showPageSize, card, actions, actionsWidth, timeline, onRowClick, rowHref, rowClassName, rowDetail, empty, initialSortKey, initialSortDirection, sortKey: controlledSortKey, sortDirection: controlledSortDirection, onSortChange, miniSort, showCardSortControls, desktopView, cardMaxWidth, className, onPageChange, onPageSizeChange, currentPage: controlledCurrentPage, totalItems: controlledTotalItems, group, showResultsCount, totalCount, itemNoun, columnSelector, }: DataViewProps<T>): default_2.JSX.Element;
|
|
1065
|
+
declare function DataView_2<T>({ columns, data, rowKey, pinnedIds, selectable, onSelectionChange, selectedIds: controlledSelectedIds, pageSizeOptions, initialPageSize, showPageSize, card, actions, actionsWidth, timeline, onRowClick, rowHref, rowClassName, rowDetail, empty, initialSortKey, initialSortDirection, sortKey: controlledSortKey, sortDirection: controlledSortDirection, onSortChange, miniSort, showCardSortControls, desktopView, cardMaxWidth, className, onPageChange, onPageSizeChange, currentPage: controlledCurrentPage, totalItems: controlledTotalItems, group, showResultsCount, totalCount, itemNoun, columnSelector, animateChanges, highlightIds, }: DataViewProps<T>): default_2.JSX.Element;
|
|
1065
1066
|
export { DataView_2 as DataView }
|
|
1066
1067
|
|
|
1067
1068
|
export declare interface DataViewCardConfig<T> {
|
|
@@ -1219,6 +1220,11 @@ export declare interface DataViewProps<T> {
|
|
|
1219
1220
|
itemNoun?: string;
|
|
1220
1221
|
/** Optional column-visibility selector rendered in the top controls. Hidden when `options` is empty. */
|
|
1221
1222
|
columnSelector?: DataViewColumnSelectorConfig;
|
|
1223
|
+
/** Animate rows and cards joining, leaving and moving. Needs `rowKey`; index keys cannot be tracked. Default: true. */
|
|
1224
|
+
animateChanges?: boolean;
|
|
1225
|
+
/** Row keys to scroll into view and flash, e.g. after an add or edit. A new array replays the
|
|
1226
|
+
* highlight; `useHighlight` manages it. A row on another page is paged to first. */
|
|
1227
|
+
highlightIds?: ReadonlyArray<string | number>;
|
|
1222
1228
|
}
|
|
1223
1229
|
|
|
1224
1230
|
export declare interface DataViewTimelineConfig<T> {
|
|
@@ -2463,12 +2469,17 @@ export declare const LIB_VERSION: string;
|
|
|
2463
2469
|
|
|
2464
2470
|
export declare const List: default_2.FC<ListProps>;
|
|
2465
2471
|
|
|
2472
|
+
/** Set on each element the hook should animate; the value is the item's stable id. */
|
|
2473
|
+
export declare const LIST_MOTION_KEY_ATTRIBUTE = "data-motion-key";
|
|
2474
|
+
|
|
2466
2475
|
declare interface ListItem {
|
|
2467
2476
|
id: string | number;
|
|
2468
2477
|
label: default_2.ReactNode;
|
|
2469
2478
|
disabled?: boolean;
|
|
2470
2479
|
}
|
|
2471
2480
|
|
|
2481
|
+
export declare type ListMotionKey = string | number;
|
|
2482
|
+
|
|
2472
2483
|
declare interface ListProps {
|
|
2473
2484
|
items: ListItem[];
|
|
2474
2485
|
direction?: 'vertical' | 'horizontal';
|
|
@@ -2642,6 +2653,8 @@ export declare interface MiniStatsCardProps {
|
|
|
2642
2653
|
footer?: default_2.ReactNode;
|
|
2643
2654
|
/** Tint the whole card with a soft background matching the variant. */
|
|
2644
2655
|
filled?: boolean;
|
|
2656
|
+
/** Roll numeric values to their new figure when they change. Default: true. */
|
|
2657
|
+
animated?: boolean;
|
|
2645
2658
|
/** Additional CSS class */
|
|
2646
2659
|
className?: string;
|
|
2647
2660
|
}
|
|
@@ -2987,6 +3000,8 @@ export declare interface RollingNumberProps {
|
|
|
2987
3000
|
decimalSeparator?: string;
|
|
2988
3001
|
/** Roll duration in milliseconds. */
|
|
2989
3002
|
duration?: number;
|
|
3003
|
+
/** Take font size, weight and colour from the surrounding text instead of `size` and `variant`. */
|
|
3004
|
+
inheritStyle?: boolean;
|
|
2990
3005
|
/** Thousands separator. Pass an empty string to switch grouping off. */
|
|
2991
3006
|
groupSeparator?: string;
|
|
2992
3007
|
prefix?: string;
|
|
@@ -3265,6 +3280,8 @@ export declare interface StatsProps {
|
|
|
3265
3280
|
align?: StatsAlign;
|
|
3266
3281
|
/** Visual size. Default: 'medium'. */
|
|
3267
3282
|
size?: StatsSize;
|
|
3283
|
+
/** Roll numeric values to their new figure when they change. Default: true. */
|
|
3284
|
+
animated?: boolean;
|
|
3268
3285
|
className?: string;
|
|
3269
3286
|
}
|
|
3270
3287
|
|
|
@@ -3791,6 +3808,45 @@ export declare const useControlPanel: () => ControlPanelContextValue;
|
|
|
3791
3808
|
|
|
3792
3809
|
export declare const useControlPanelContext: () => ControlPanelContextValue | null;
|
|
3793
3810
|
|
|
3811
|
+
/** Points the user at items after an add, edit or undo, so they can see where the change landed. */
|
|
3812
|
+
export declare const useHighlight: () => UseHighlightReturn;
|
|
3813
|
+
|
|
3814
|
+
export declare interface UseHighlightReturn {
|
|
3815
|
+
/** Pass to DataView `highlightIds` (or useListMotion `highlightKeys`). */
|
|
3816
|
+
highlightIds: ListMotionKey[];
|
|
3817
|
+
/** Scroll to and flash these items. Safe to call before they are in the list: it waits for them. */
|
|
3818
|
+
highlight: (...ids: ListMotionKey[]) => void;
|
|
3819
|
+
}
|
|
3820
|
+
|
|
3821
|
+
/**
|
|
3822
|
+
* Animates a keyed list as it changes: items that join fade and grow in, items that leave fade
|
|
3823
|
+
* out where they stood, and the rest slide to their new places instead of jumping (FLIP).
|
|
3824
|
+
*
|
|
3825
|
+
* Put `data-motion-key={id}` on every item element inside the container. Changes larger than
|
|
3826
|
+
* the limits (a new filter, another page) are left unanimated, as is the first fill of the list.
|
|
3827
|
+
*/
|
|
3828
|
+
export declare const useListMotion: (containerRef: RefObject<HTMLElement | null>, options?: UseListMotionOptions) => UseListMotionReturn;
|
|
3829
|
+
|
|
3830
|
+
export declare interface UseListMotionOptions {
|
|
3831
|
+
/** Switch the animations off without changing the markup. Default: true. */
|
|
3832
|
+
enabled?: boolean;
|
|
3833
|
+
/** Flash items that join the list. Default: true. */
|
|
3834
|
+
flashEntering?: boolean;
|
|
3835
|
+
/** Ids to scroll into view and flash. Passing a new array replays the highlight. */
|
|
3836
|
+
highlightKeys?: ReadonlyArray<ListMotionKey>;
|
|
3837
|
+
/** Most items that may join or leave in one change and still animate. A bigger change (a filter, a page) just updates. Default: 10. */
|
|
3838
|
+
maxMembershipChanges?: number;
|
|
3839
|
+
/** Most items that may move in a pure reorder and still animate. A bigger one (a sort) just updates. Default: 40. */
|
|
3840
|
+
maxReorderMoves?: number;
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
export declare interface UseListMotionReturn {
|
|
3844
|
+
/** Animate the next change even when it is over the limits, e.g. a group the user opened or closed. */
|
|
3845
|
+
forceNext: () => void;
|
|
3846
|
+
/** Let the next change through without animating, e.g. a page switch. */
|
|
3847
|
+
skipNext: () => void;
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3794
3850
|
/**
|
|
3795
3851
|
* Hook pentru multiple popover-uri cu ID-uri
|
|
3796
3852
|
* Util când ai multe popover-uri și vrei să le controlezi individual
|