dinocollab-core 2.2.55 → 2.2.57
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 -23
- package/dist/components/index.js +1 -1
- package/dist/data-surface/index.js +1 -1
- package/dist/filter-bar/index.js +1 -1
- package/dist/form/index.js +1 -1
- package/dist/redux/index.js +1 -1
- package/dist/src/api-context/drawer-global.js +1 -1
- package/dist/src/api-context/drawer-global.js.map +1 -1
- package/dist/src/components/breadcrumbs.js.map +1 -1
- package/dist/src/components/confirm-button.js +1 -1
- package/dist/src/components/confirm-button.js.map +1 -1
- package/dist/src/components/copy-to-clipboard.js +1 -1
- package/dist/src/components/copy-to-clipboard.js.map +1 -1
- package/dist/src/components/help-tooltip.js.map +1 -1
- package/dist/src/components/image-with-fallback.js.map +1 -1
- package/dist/src/components/loading-button.js +2 -0
- package/dist/src/components/loading-button.js.map +1 -0
- package/dist/src/components/loading-icon-button.js +2 -0
- package/dist/src/components/loading-icon-button.js.map +1 -0
- package/dist/src/components/rich-tooltip.js.map +1 -1
- package/dist/src/data-surface/button-switch.js +1 -1
- package/dist/src/data-surface/button-switch.js.map +1 -1
- package/dist/src/data-surface/index.create.js +1 -1
- package/dist/src/data-surface/index.create.js.map +1 -1
- package/dist/src/data-surface/index.dino.js +1 -1
- package/dist/src/data-surface/index.dino.js.map +1 -1
- package/dist/src/data-surface/ui.units.js +1 -1
- package/dist/src/data-surface/ui.units.js.map +1 -1
- package/dist/src/data-surface/view-grid/index.js +1 -1
- package/dist/src/data-surface/view-grid/index.js.map +1 -1
- package/dist/src/data-surface/view-list/column-selector.js +2 -0
- package/dist/src/data-surface/view-list/column-selector.js.map +1 -0
- package/dist/src/data-surface/view-list/helpers.js +1 -1
- package/dist/src/data-surface/view-list/helpers.js.map +1 -1
- package/dist/src/data-surface/view-list/hooks.js +1 -1
- package/dist/src/data-surface/view-list/hooks.js.map +1 -1
- package/dist/src/data-surface/view-list/index.js +1 -1
- package/dist/src/data-surface/view-list/index.js.map +1 -1
- package/dist/src/data-surface/view-list/types.js.map +1 -1
- package/dist/src/filter-bar/components/chip-viewer.js.map +1 -1
- package/dist/src/filter-bar/components/hint-icon.js.map +1 -1
- package/dist/src/filter-bar/components/ui.units.js +1 -1
- package/dist/src/filter-bar/components/ui.units.js.map +1 -1
- package/dist/src/filter-bar/convert-to-graphql.js +1 -1
- package/dist/src/filter-bar/convert-to-graphql.js.map +1 -1
- package/dist/src/filter-bar/filter-input.js +2 -0
- package/dist/src/filter-bar/filter-input.js.map +1 -0
- package/dist/src/filter-bar/filter-input.types.js +2 -0
- package/dist/src/filter-bar/filter-input.types.js.map +1 -0
- package/dist/src/filter-bar/filter-input.units.js +2 -0
- package/dist/src/filter-bar/filter-input.units.js.map +1 -0
- package/dist/src/filter-bar/filter-menu.helpers.js +2 -0
- package/dist/src/filter-bar/filter-menu.helpers.js.map +1 -0
- package/dist/src/filter-bar/filter-menu.js +2 -0
- package/dist/src/filter-bar/filter-menu.js.map +1 -0
- package/dist/src/filter-bar/filter-menu.styled.js +2 -0
- package/dist/src/filter-bar/filter-menu.styled.js.map +1 -0
- package/dist/src/filter-bar/filter-menu.units.js +2 -0
- package/dist/src/filter-bar/filter-menu.units.js.map +1 -0
- package/dist/src/filter-bar/filter-sort.js +2 -0
- package/dist/src/filter-bar/filter-sort.js.map +1 -0
- package/dist/src/filter-bar/filter-sort.types.js +2 -0
- package/dist/src/filter-bar/filter-sort.types.js.map +1 -0
- package/dist/src/filter-bar/filter-summary.js +2 -0
- package/dist/src/filter-bar/filter-summary.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-boolean.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-boolean.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-datetime.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-datetime.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-number.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-number.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-select-with-api.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-select-with-api.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-select.fallback.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-select.fallback.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-select.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-select.js.map +1 -0
- package/dist/src/filter-bar/form-field/create-form-field-string.js +2 -0
- package/dist/src/filter-bar/form-field/create-form-field-string.js.map +1 -0
- package/dist/src/filter-bar/helpers.js +1 -1
- package/dist/src/filter-bar/helpers.js.map +1 -1
- package/dist/src/filter-bar/hooks.js.map +1 -1
- package/dist/src/filter-bar/index.context.js.map +1 -1
- package/dist/src/filter-bar/index.create.js +1 -1
- package/dist/src/filter-bar/index.create.js.map +1 -1
- package/dist/src/filter-bar/index.dino.js +1 -1
- package/dist/src/filter-bar/index.dino.js.map +1 -1
- package/dist/src/filter-bar/local-filter-builder.js +1 -1
- package/dist/src/filter-bar/local-filter-builder.js.map +1 -1
- package/dist/src/filter-bar/popper-custom.js +2 -0
- package/dist/src/filter-bar/popper-custom.js.map +1 -0
- package/dist/src/filter-bar/types.js.map +1 -1
- package/dist/src/form/create.autocomplete.chips.js +1 -1
- package/dist/src/form/create.autocomplete.chips.js.map +1 -1
- package/dist/src/form/create.checkbox.js +1 -1
- package/dist/src/form/create.checkbox.js.map +1 -1
- package/dist/src/form/create.color-picker.js +1 -1
- package/dist/src/form/create.color-picker.js.map +1 -1
- package/dist/src/form/create.date-expired.js +1 -1
- package/dist/src/form/create.date-expired.js.map +1 -1
- package/dist/src/form/create.form-comfirm.js +1 -1
- package/dist/src/form/create.form-comfirm.js.map +1 -1
- package/dist/src/form/create.input.file.js +1 -1
- package/dist/src/form/create.input.file.js.map +1 -1
- package/dist/src/form/create.input.object.js +2 -0
- package/dist/src/form/create.input.object.js.map +1 -0
- package/dist/src/form/create.input.object.styled.js +2 -0
- package/dist/src/form/create.input.object.styled.js.map +1 -0
- package/dist/src/form/decorator.form.js.map +1 -1
- package/dist/src/form/decorator.js.map +1 -1
- package/dist/src/form/dino-form.js +1 -1
- package/dist/src/form/dino-form.js.map +1 -1
- package/dist/src/form/helpers.js +1 -1
- package/dist/src/form/helpers.js.map +1 -1
- package/dist/src/form/modal-wrapper.js +1 -1
- package/dist/src/form/modal-wrapper.js.map +1 -1
- package/dist/src/form/v2/create.autocomplete.chips.js +1 -1
- package/dist/src/form/v2/create.autocomplete.chips.js.map +1 -1
- package/dist/src/form/v2/create.color-picker.js +1 -1
- package/dist/src/form/v2/create.color-picker.js.map +1 -1
- package/dist/src/form/v2/create.input.js.map +1 -1
- package/dist/src/http-service/graphql/request-param.js +1 -1
- package/dist/src/http-service/graphql/request-param.js.map +1 -1
- package/dist/src/redux/create.hoc-lazy.js +1 -1
- package/dist/src/redux/create.hoc-lazy.js.map +1 -1
- package/dist/src/redux/dino.js +1 -1
- package/dist/src/redux/dino.js.map +1 -1
- package/dist/src/redux/ui.error-page.js +1 -1
- package/dist/src/redux/ui.error-page.js.map +1 -1
- package/dist/src/table-grid/toolbar-pannel.js +1 -1
- package/dist/types/components/breadcrumbs.d.ts +2 -2
- package/dist/types/components/confirm-button.d.ts +14 -30
- package/dist/types/components/copy-to-clipboard.d.ts +13 -5
- package/dist/types/components/index.d.ts +2 -4
- package/dist/types/components/loading-button.d.ts +36 -0
- package/dist/types/components/loading-icon-button.d.ts +21 -0
- package/dist/types/data-surface/button-switch.d.ts +4 -0
- package/dist/types/data-surface/index.create.d.ts +13 -5
- package/dist/types/data-surface/index.dino.d.ts +6 -7
- package/dist/types/data-surface/ui.units.d.ts +1 -0
- package/dist/types/data-surface/view-grid/index.d.ts +0 -1
- package/dist/types/data-surface/view-list/column-selector.d.ts +6 -0
- package/dist/types/data-surface/view-list/helpers.d.ts +3 -2
- package/dist/types/data-surface/view-list/index.d.ts +1 -1
- package/dist/types/data-surface/view-list/types.d.ts +30 -2
- package/dist/types/filter-bar/components/chip-viewer.d.ts +34 -2
- package/dist/types/filter-bar/components/filter-input.mobile.d.ts +1 -7
- package/dist/types/filter-bar/components/hint-icon.d.ts +25 -1
- package/dist/types/filter-bar/components/ui.units.d.ts +50 -0
- package/dist/types/filter-bar/convert-to-graphql.d.ts +65 -33
- package/dist/types/filter-bar/{components/filter-input.d.ts → filter-input.d.ts} +5 -1
- package/dist/types/filter-bar/{components/filter-input.types.d.ts → filter-input.types.d.ts} +1 -16
- package/dist/types/filter-bar/{components/filter-input.units.d.ts → filter-input.units.d.ts} +7 -2
- package/dist/types/filter-bar/{menu/create.d.ts → filter-menu.d.ts} +4 -13
- package/dist/types/filter-bar/filter-menu.helpers.d.ts +31 -0
- package/dist/types/filter-bar/filter-menu.styled.d.ts +20 -0
- package/dist/types/filter-bar/filter-menu.types.d.ts +63 -0
- package/dist/types/filter-bar/filter-menu.units.d.ts +20 -0
- package/dist/types/filter-bar/{components/filter-sort.d.ts → filter-sort.d.ts} +21 -2
- package/dist/types/filter-bar/filter-sort.types.d.ts +30 -0
- package/dist/types/filter-bar/filter-summary.types.d.ts +14 -0
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-boolean.d.ts +2 -2
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-datetime.d.ts +2 -2
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-number.d.ts +2 -2
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-select-with-api.d.ts +2 -2
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-select.d.ts +2 -2
- package/dist/types/filter-bar/form-field/create-form-field-select.fallback.d.ts +24 -0
- package/dist/types/filter-bar/{menu → form-field}/create-form-field-string.d.ts +2 -2
- package/dist/types/filter-bar/helpers.d.ts +11 -0
- package/dist/types/filter-bar/index.create.d.ts +10 -28
- package/dist/types/filter-bar/index.d.ts +9 -8
- package/dist/types/filter-bar/index.dino.d.ts +7 -7
- package/dist/types/filter-bar/local-filter-builder.d.ts +12 -3
- package/dist/types/filter-bar/types.d.ts +123 -49
- package/dist/types/form/create.autocomplete.chips.d.ts +3 -3
- package/dist/types/form/create.checkbox.d.ts +42 -5
- package/dist/types/form/create.color-picker.d.ts +9 -4
- package/dist/types/form/create.date-expired.d.ts +2 -2
- package/dist/types/form/create.form-comfirm.d.ts +9 -9
- package/dist/types/form/create.input.file.d.ts +4 -9
- package/dist/types/form/create.input.object.d.ts +93 -0
- package/dist/types/form/create.input.object.styled.d.ts +32 -0
- package/dist/types/form/decorator.d.ts +1 -4
- package/dist/types/form/dino-form.d.ts +8 -5
- package/dist/types/form/helpers.d.ts +8 -0
- package/dist/types/form/index.d.ts +2 -0
- package/dist/types/form/modal-wrapper.d.ts +7 -1
- package/dist/types/form/v2/create.autocomplete.chips.d.ts +4 -4
- package/dist/types/form/v2/create.color-picker.d.ts +3 -1
- package/dist/types/http-service/graphql/request-param.d.ts +1 -1
- package/dist/types/redux/create.hoc-lazy.d.ts +5 -8
- package/dist/types/redux/dino.d.ts +2 -2
- package/dist/types/redux/index.d.ts +1 -2
- package/dist/types/redux/ui.error-page.d.ts +1 -2
- package/package.json +1 -1
- package/dist/src/components/buttons.js +0 -2
- package/dist/src/components/buttons.js.map +0 -1
- package/dist/src/components/create.multi-select-dropdown.js +0 -2
- package/dist/src/components/create.multi-select-dropdown.js.map +0 -1
- package/dist/src/filter-bar/components/filter-input.js +0 -2
- package/dist/src/filter-bar/components/filter-input.js.map +0 -1
- package/dist/src/filter-bar/components/filter-input.units.js +0 -2
- package/dist/src/filter-bar/components/filter-input.units.js.map +0 -1
- package/dist/src/filter-bar/components/filter-sort.js +0 -2
- package/dist/src/filter-bar/components/filter-sort.js.map +0 -1
- package/dist/src/filter-bar/components/filter-summary.js +0 -2
- package/dist/src/filter-bar/components/filter-summary.js.map +0 -1
- package/dist/src/filter-bar/components/popper-custom.js +0 -2
- package/dist/src/filter-bar/components/popper-custom.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-boolean.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-boolean.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-datetime.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-datetime.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-number.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-number.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-select-with-api.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-select-with-api.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-select.fallback.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-select.fallback.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-select.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-select.js.map +0 -1
- package/dist/src/filter-bar/menu/create-form-field-string.js +0 -2
- package/dist/src/filter-bar/menu/create-form-field-string.js.map +0 -1
- package/dist/src/filter-bar/menu/create.js +0 -2
- package/dist/src/filter-bar/menu/create.js.map +0 -1
- package/dist/src/filter-bar/menu/ui.units.js +0 -2
- package/dist/src/filter-bar/menu/ui.units.js.map +0 -1
- package/dist/types/components/buttons.d.ts +0 -6
- package/dist/types/filter-bar/components/filter-sort.types.d.ts +0 -49
- package/dist/types/filter-bar/components/filter-summary.types.d.ts +0 -21
- package/dist/types/filter-bar/menu/create-form-field-select.fallback.d.ts +0 -11
- package/dist/types/filter-bar/menu/types.d.ts +0 -70
- package/dist/types/filter-bar/menu/ui.units.d.ts +0 -6
- /package/dist/types/filter-bar/{components/filter-summary.d.ts → filter-summary.d.ts} +0 -0
- /package/dist/types/filter-bar/{components/popper-custom.d.ts → popper-custom.d.ts} +0 -0
- /package/dist/types/{components → lab}/create.multi-select-dropdown.d.ts +0 -0
- /package/dist/types/{components → lab}/input-debounce-timer.d.ts +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BoxProps, PopperProps } from '@mui/material';
|
|
3
|
+
import type { FormValidator, IFormValidatorConfig } from '../form/validator';
|
|
4
|
+
import type { TFieldModelValid, TFieldType, TFieldValid, TFieldValue, TFilterFieldConfig, TFilterFieldConfigs } from './types';
|
|
5
|
+
export type TFetchStatus = 'loading' | 'loaded' | 'error';
|
|
6
|
+
/** Selectable option item for subMenu mode or select form dropdowns */
|
|
7
|
+
export interface IFilterMenuOption {
|
|
8
|
+
value: TFieldValid;
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Field-level configuration for Filter Menu item and subMenu behavior */
|
|
12
|
+
export interface IFilterMenuConfig<T> {
|
|
13
|
+
/** Subtitle description for the field */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Element to render before the form component or menu item */
|
|
16
|
+
before?: ReactNode;
|
|
17
|
+
/** Element to render after the form component or menu item */
|
|
18
|
+
after?: ReactNode;
|
|
19
|
+
/** Hover tooltip displayed on the menu item */
|
|
20
|
+
tooltip?: string | ((values?: TFieldValid[]) => string);
|
|
21
|
+
/** Mode for rendering default menu form: 'view' (custom form view) or 'subMenu' (selectable list). @default 'view' */
|
|
22
|
+
mode?: 'view' | 'subMenu';
|
|
23
|
+
/** List of selectable options when mode is 'subMenu' */
|
|
24
|
+
options?: IFilterMenuOption[];
|
|
25
|
+
/** If true, closes the filter menu popover after submitting a value @default true */
|
|
26
|
+
closeAfterSubmit?: boolean;
|
|
27
|
+
/** If true, closes the filter menu popover after clearing field values @default true */
|
|
28
|
+
closeAfterClear?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IFilterMenuSlots {
|
|
31
|
+
popperProps?: Partial<PopperProps>;
|
|
32
|
+
rootProps?: BoxProps;
|
|
33
|
+
}
|
|
34
|
+
/** Parameter passed to `createFilterMenu(param)` */
|
|
35
|
+
export interface IFilterMenuParam<T> extends IFilterMenuSlots {
|
|
36
|
+
fields?: TFilterFieldConfigs<T>;
|
|
37
|
+
validation?: IFormValidatorConfig<Partial<TFieldModelValid<T>>>;
|
|
38
|
+
quickSearchHint?: string | ((currentHint: string) => string);
|
|
39
|
+
/** Option to enable or disable quick search @default false */
|
|
40
|
+
enableQuickSearch?: boolean;
|
|
41
|
+
/** Option to close the menu after submitting a value @default true */
|
|
42
|
+
closeAfterSubmit?: boolean;
|
|
43
|
+
/** Option to close the menu after clearing a value @default true */
|
|
44
|
+
closeAfterClear?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface IFilterMenuProps<T> {
|
|
47
|
+
slots?: IFilterMenuSlots;
|
|
48
|
+
}
|
|
49
|
+
/** Props passed to custom form components rendered inside filter menu */
|
|
50
|
+
export interface IFilterMenuFormProps<T> {
|
|
51
|
+
/** Field key being configured */
|
|
52
|
+
field: TFieldType<T>;
|
|
53
|
+
/** Unified field configuration */
|
|
54
|
+
currentConfig: TFilterFieldConfig<T>;
|
|
55
|
+
isLoading?: boolean;
|
|
56
|
+
value?: TFieldValue;
|
|
57
|
+
validator?: FormValidator<Partial<TFieldModelValid<T>>>;
|
|
58
|
+
onBack: () => void;
|
|
59
|
+
onClose: () => void;
|
|
60
|
+
onSubmit: (key: TFieldType<T>, value?: TFieldValue, config?: TFilterFieldConfig<T>) => void;
|
|
61
|
+
onRemove?: (key: TFieldType<T>, value: TFieldValid) => void;
|
|
62
|
+
onRemoveField?: (key: TFieldType<T>, config?: TFilterFieldConfig<T>) => void;
|
|
63
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { TFieldType, TFieldValue, TFieldValid, TFilterFieldConfig } from './types';
|
|
3
|
+
export interface IFilterMenuItemProps<T> {
|
|
4
|
+
field: TFieldType<T>;
|
|
5
|
+
item: TFilterFieldConfig<T>;
|
|
6
|
+
info?: TFieldValue;
|
|
7
|
+
fieldValue?: any;
|
|
8
|
+
quickSearchHint?: string | ((currentHint: string) => string);
|
|
9
|
+
onClick: (event: React.MouseEvent<HTMLElement>, field: TFieldType<T>, item: TFilterFieldConfig<T>) => void;
|
|
10
|
+
onRemoveField?: (field: TFieldType<T>, config?: TFilterFieldConfig<T>) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createFilterMenuItem<T>(): FC<IFilterMenuItemProps<T>>;
|
|
13
|
+
export interface IFilterSubMenuProps<T> {
|
|
14
|
+
anchorEl: HTMLElement | null;
|
|
15
|
+
field: TFieldType<T> | null;
|
|
16
|
+
item: TFilterFieldConfig<T> | null;
|
|
17
|
+
activeValues?: TFieldValid[];
|
|
18
|
+
onOptionClick: (field: TFieldType<T>, optionValue: TFieldValid, fieldConfig: TFilterFieldConfig<T>) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function createFilterSubMenu<T>(): FC<IFilterSubMenuProps<T>>;
|
|
@@ -1,15 +1,34 @@
|
|
|
1
1
|
import { FieldSortDirection } from './filter-sort.types';
|
|
2
2
|
import type { FC, ReactNode } from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IFilterSortParam, IFilterSortProps } from './filter-sort.types';
|
|
4
|
+
/** Map sort direction to human-readable tooltip label ('Ascending' | 'Descending') */
|
|
4
5
|
export declare const mapSortDirectionLabel: {
|
|
5
6
|
[key in FieldSortDirection]: string;
|
|
6
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Returns human-readable sort direction label ('Ascending' | 'Descending') for a given sort direction.
|
|
10
|
+
*/
|
|
7
11
|
export declare const getSortDirectionLabel: (direction?: FieldSortDirection) => string;
|
|
12
|
+
/** Map sort direction to React icon component */
|
|
8
13
|
export declare const mapSortDirectionIcon: {
|
|
9
14
|
[key in FieldSortDirection]: ReactNode;
|
|
10
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Returns React icon corresponding to sort direction (`ArrowUpwardIcon` for 'asc', `ArrowDownwardIcon` for 'desc').
|
|
18
|
+
*/
|
|
11
19
|
export declare const getSortDirectionIcon: (direction?: FieldSortDirection) => ReactNode;
|
|
12
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Factory function that creates a `FilterSort` component from static field configuration.
|
|
22
|
+
*
|
|
23
|
+
* The generated component renders a sort icon button opening a popper panel with:
|
|
24
|
+
* - A list of sortable fields configured with `sortable: true`
|
|
25
|
+
* - Sorting direction toggles ('asc' | 'desc')
|
|
26
|
+
* - Optional shuffle/randomize ordering action (`enableShuffle: true`)
|
|
27
|
+
*
|
|
28
|
+
* @param config - Static sort configuration (fields schema, slots, shuffle toggle)
|
|
29
|
+
* @returns A React FC ready to be dropped into a `FilterBarProvider` context
|
|
30
|
+
*/
|
|
31
|
+
export declare function createFilterSort<T>(config: IFilterSortParam<T>): FC<IFilterSortProps<T>>;
|
|
13
32
|
export declare const filterSortClasses: {
|
|
14
33
|
root: string;
|
|
15
34
|
menu: string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BoxProps, IconButtonProps, PopperProps } from '@mui/material';
|
|
2
|
+
import type { TFilterFieldConfigs } from './types';
|
|
3
|
+
/** Supported sort directions for column sorting ('asc' | 'desc') */
|
|
4
|
+
export declare const FieldSortDirection: {
|
|
5
|
+
readonly asc: "asc";
|
|
6
|
+
readonly desc: "desc";
|
|
7
|
+
};
|
|
8
|
+
export type FieldSortDirection = keyof typeof FieldSortDirection;
|
|
9
|
+
/** Slot overrides for sub-components of `FilterSort` */
|
|
10
|
+
export interface IFilterSortSlots {
|
|
11
|
+
popperProps?: Partial<PopperProps>;
|
|
12
|
+
rootProps?: BoxProps;
|
|
13
|
+
buttonSortProps?: IconButtonProps;
|
|
14
|
+
buttonShuffleProps?: IconButtonProps;
|
|
15
|
+
}
|
|
16
|
+
/** Props passed to the generated `FilterSort` component */
|
|
17
|
+
export interface IFilterSortProps<T> {
|
|
18
|
+
sx?: BoxProps['sx'];
|
|
19
|
+
slots?: IFilterSortSlots;
|
|
20
|
+
}
|
|
21
|
+
/** Static configuration passed to `createFilterSort(config)` factory function */
|
|
22
|
+
export interface IFilterSortConfig<T> extends IFilterSortSlots {
|
|
23
|
+
/** Optional flag to enable shuffle functionality */
|
|
24
|
+
enableShuffle?: boolean;
|
|
25
|
+
/** Position for shuffle button ('left' | 'right') @default 'right' */
|
|
26
|
+
shufflePosition?: 'left' | 'right';
|
|
27
|
+
}
|
|
28
|
+
export interface IFilterSortParam<T> extends IFilterSortConfig<T> {
|
|
29
|
+
fields?: TFilterFieldConfigs<T>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BoxProps } from '@mui/material';
|
|
2
|
+
import type { TFilterFieldConfigs } from './types';
|
|
3
|
+
/** Configuration parameters passed to `createFilterSummary(config)` factory function */
|
|
4
|
+
export interface IFilterSummaryConfig<T> {
|
|
5
|
+
/** Field configuration schema map */
|
|
6
|
+
fields?: TFilterFieldConfigs<T>;
|
|
7
|
+
/** Option to enable or disable quick search chip in summary @default true */
|
|
8
|
+
enableQuickSearch?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** Props passed to the generated `FilterSummary` component */
|
|
11
|
+
export interface IFilterSummaryProps<T> {
|
|
12
|
+
/** Custom MUI styling object for the root container */
|
|
13
|
+
sx?: BoxProps['sx'];
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC, ReactNode } from 'react';
|
|
2
2
|
import type { TValueFormatterParam } from '../types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
4
4
|
/** Props for the `FormFieldBoolean` component returned by `createFormFieldBoolean`. Extends the base filter-menu form props. */
|
|
5
5
|
export interface IFormFieldBooleanProps<T> extends IFilterMenuFormProps<T> {
|
|
6
6
|
/** Optional content to render at the top of the form */
|
|
@@ -9,7 +9,7 @@ export interface IFormFieldBooleanProps<T> extends IFilterMenuFormProps<T> {
|
|
|
9
9
|
/** Parameters passed to `createFormFieldBoolean` to configure the generated component. */
|
|
10
10
|
export interface IFormFieldBooleanParam<T> {
|
|
11
11
|
/** Optional configuration for the form field */
|
|
12
|
-
config?:
|
|
12
|
+
config?: IFilterMenuConfig<T>;
|
|
13
13
|
/** Label for the `true` option. @default "Yes" */
|
|
14
14
|
trueLabel?: string;
|
|
15
15
|
/** Label for the `false` option. @default "No" */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
2
3
|
import type { TDateLogic, TValueFormatterParam } from '../types';
|
|
3
|
-
import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
|
|
4
4
|
/** The MUI picker variant to render inside the filter menu. */
|
|
5
5
|
export type TDateTimePickerType = 'date' | 'datetime';
|
|
6
6
|
/** Props for the `FormFieldDateTime` component returned by `createFormFieldDateTime`. Extends the base filter-menu form props. */
|
|
@@ -9,7 +9,7 @@ export interface IFormFieldDateTimeProps<T> extends IFilterMenuFormProps<T> {
|
|
|
9
9
|
/** Parameters passed to `createFormFieldDateTime` to configure the generated component. */
|
|
10
10
|
export interface IFormFieldDateTimeParam<T> {
|
|
11
11
|
/** Optional field-level configuration overrides. */
|
|
12
|
-
config?:
|
|
12
|
+
config?: IFilterMenuConfig<T>;
|
|
13
13
|
/**
|
|
14
14
|
* Controls which MUI picker is rendered.
|
|
15
15
|
* - `'date'` → `DatePicker` (default)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
3
3
|
import type { TFieldValid, TValueFormatterParam, TNumberOperator } from '../types';
|
|
4
4
|
/** Encodes operator + number into a single string stored in `values[]`. e.g. `"gt:18"` */
|
|
5
5
|
export declare function encodeNumberValue(operator: TNumberOperator, num: number): string;
|
|
@@ -16,7 +16,7 @@ export interface IFormFieldNumberProps<T> extends IFilterMenuFormProps<T> {
|
|
|
16
16
|
/** Parameters passed to `createFormFieldNumber` to configure the generated component. */
|
|
17
17
|
export interface IFormFieldNumberParam<T> {
|
|
18
18
|
/** Optional configuration for the form field */
|
|
19
|
-
config?:
|
|
19
|
+
config?: IFilterMenuConfig<T>;
|
|
20
20
|
/** Default operator shown when the menu first opens. @default 'eq' */
|
|
21
21
|
defaultOperator?: TNumberOperator;
|
|
22
22
|
/** Step for the number input. @default 1 */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
export { DEFAULT_STORAGE_KEY, getOptionLabelFromLocal, saveOptionLabelToLocal, saveOptionLabelsToLocal } from '../helpers';
|
|
3
3
|
import type { IFieldSelectOption } from './create-form-field-select';
|
|
4
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
4
5
|
import type { TFieldType, TFieldValid, TLogic, TValueFormatterParam } from '../types';
|
|
5
|
-
import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
|
|
6
6
|
/** Props for the `FormFieldSelectWithApi` component returned by `createFormFieldSelectWithApi`. Extends the base filter-menu form props. */
|
|
7
7
|
export interface IFormFieldSelectWithApiProps<T> extends IFilterMenuFormProps<T> {
|
|
8
8
|
/** Callback function to handle errors */
|
|
@@ -13,7 +13,7 @@ export interface IFormFieldSelectWithApiProps<T> extends IFilterMenuFormProps<T>
|
|
|
13
13
|
/** Parameters passed to `createFormFieldSelectWithApi` to configure the generated component. */
|
|
14
14
|
export interface IFormFieldSelectWithApiParam<T> {
|
|
15
15
|
/** Optional configuration for the form field */
|
|
16
|
-
config?:
|
|
16
|
+
config?: IFilterMenuConfig<T>;
|
|
17
17
|
/** Function to fetch options asynchronously based on user input query */
|
|
18
18
|
fetchOptions: (query: string, signal?: AbortSignal) => Promise<IFieldSelectOption[]> | IFieldSelectOption[];
|
|
19
19
|
/** Debounce delay for typing in milliseconds @default 300 */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
2
3
|
import type { TFieldType, TFieldValid, TLogic, TValueFormatterParam } from '../types';
|
|
3
|
-
import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
|
|
4
4
|
/** Props for the `FormFieldSelect` component returned by `createFormFieldSelect`. Extends the base filter-menu form props. */
|
|
5
5
|
export interface IFormFieldSelectProps<T> extends IFilterMenuFormProps<T> {
|
|
6
6
|
/** Callback function to handle errors */
|
|
@@ -16,7 +16,7 @@ export interface IFieldSelectOption {
|
|
|
16
16
|
/** Parameters passed to `createFormFieldSelect` to configure the generated component. */
|
|
17
17
|
export interface IFormFieldSelectParam<T> {
|
|
18
18
|
/** Optional configuration for the form field */
|
|
19
|
-
config?:
|
|
19
|
+
config?: IFilterMenuConfig<T>;
|
|
20
20
|
/** List of options for the select field */
|
|
21
21
|
options?: IFieldSelectOption[];
|
|
22
22
|
/** Function to fetch options asynchronously based on user input */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Dispatch, FC, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
import { TFetchStatus } from '../filter-menu.types';
|
|
3
|
+
import { IFormFieldSelectParam, IFormFieldSelectProps } from './create-form-field-select';
|
|
4
|
+
/**
|
|
5
|
+
* Base parameters for fallback rendering behavior when select option fetching fails.
|
|
6
|
+
*/
|
|
7
|
+
export type IFallbackPropsBase = {
|
|
8
|
+
/** Custom renderer function for rendering error/status feedback content at the top of the form */
|
|
9
|
+
renderTop?: (param?: {
|
|
10
|
+
setStatus: Dispatch<SetStateAction<TFetchStatus>>;
|
|
11
|
+
status: TFetchStatus;
|
|
12
|
+
}) => ReactNode;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Factory function that creates a resilient `FormFieldSelect` component with automatic string fallback.
|
|
16
|
+
*
|
|
17
|
+
* If option loading fails or encounters an error status, the generated component automatically switches
|
|
18
|
+
* from option list selection (`createFormFieldSelect`) to a free-text input (`createFormFieldString`)
|
|
19
|
+
* with a retry option panel, ensuring users can always filter even during API outages.
|
|
20
|
+
*
|
|
21
|
+
* @param params - Configuration options including option fetchers and fallback renderers
|
|
22
|
+
* @returns A React FC ready to be used as a fallback-enabled select field component
|
|
23
|
+
*/
|
|
24
|
+
export declare function createFormFieldSelectWithFallback<T>(params: IFormFieldSelectParam<T> & IFallbackPropsBase): FC<IFormFieldSelectProps<T>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFilterMenuConfig, IFilterMenuFormProps } from '../filter-menu.types';
|
|
3
3
|
/** Props for the `FormFieldString` component returned by `createFormFieldString`. Extends the base filter-menu form props. */
|
|
4
4
|
export interface IFormFieldStringProps<T> extends IFilterMenuFormProps<T> {
|
|
5
5
|
top?: ReactNode;
|
|
@@ -7,7 +7,7 @@ export interface IFormFieldStringProps<T> extends IFilterMenuFormProps<T> {
|
|
|
7
7
|
/** Parameters passed to `createFormFieldString` to configure the generated component. */
|
|
8
8
|
export interface IFormFieldStringParam<T> {
|
|
9
9
|
/** Optional configuration for the form field */
|
|
10
|
-
config?:
|
|
10
|
+
config?: IFilterMenuConfig<T>;
|
|
11
11
|
top?: ReactNode;
|
|
12
12
|
multiline?: boolean;
|
|
13
13
|
}
|
|
@@ -48,3 +48,14 @@ export declare function saveOptionLabelsToLocal(field: string, options: {
|
|
|
48
48
|
}[], storageKey?: string): void;
|
|
49
49
|
export declare function saveOptionLabelToLocal(field: string, value: string, label: string, storageKey?: string): void;
|
|
50
50
|
export declare function getOptionLabelFromLocal(field: string, value: string, storageKey?: string): string | undefined;
|
|
51
|
+
export interface IFieldGroup<TItem> {
|
|
52
|
+
name?: string;
|
|
53
|
+
items: TItem[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Groups visible filter field configs by their `group` property.
|
|
57
|
+
* Items without a `group` property (including quickSearch) are placed first in an unnamed group (`name: undefined`).
|
|
58
|
+
*/
|
|
59
|
+
export declare function groupFields<TItem extends {
|
|
60
|
+
group?: string;
|
|
61
|
+
}>(fields: TItem[]): IFieldGroup<TItem>[];
|
|
@@ -1,33 +1,15 @@
|
|
|
1
1
|
import { BoxProps } from '@mui/material';
|
|
2
|
-
import type {
|
|
3
|
-
import type { TFilterState } from './types';
|
|
4
|
-
|
|
5
|
-
import type { IFilterSortConfig, IFilterSortProps } from './components/filter-sort.types';
|
|
6
|
-
import type { IFilterInputConfig, IFilterInputProps } from './components/filter-input.types';
|
|
7
|
-
import type { IFilterSummaryConfig, IFilterSummaryProps } from './components/filter-summary.types';
|
|
8
|
-
export interface IFilterBarConfigs<T> {
|
|
9
|
-
/** Debounce delay for filter input changes in milliseconds @default 300 */
|
|
10
|
-
debounceDelay?: number;
|
|
11
|
-
defaultFilterState?: TFilterState<T>;
|
|
12
|
-
/** Default filter logic, can be overridden by individual filters @default "and" */
|
|
13
|
-
defaultFilterLogic?: 'and' | 'or';
|
|
14
|
-
InputComponent?: ComponentType<IFilterInputProps<T>>;
|
|
15
|
-
inputConfig?: IFilterInputConfig<T>;
|
|
16
|
-
MenuComponent?: ComponentType<IFilterMenuProps<T>>;
|
|
17
|
-
menuConfig?: IFilterMenuConfig<T>;
|
|
18
|
-
sortConfig?: IFilterSortConfig<T>;
|
|
19
|
-
SortComponent?: ComponentType<IFilterSortProps<T>>;
|
|
20
|
-
/** Enable or disable the summary component. Default is true. */
|
|
21
|
-
enableSummary?: boolean;
|
|
22
|
-
SummaryComponent?: ComponentType<IFilterSummaryProps<T>>;
|
|
23
|
-
summaryConfig?: IFilterSummaryConfig<T>;
|
|
24
|
-
}
|
|
2
|
+
import type { FC, ReactNode } from 'react';
|
|
3
|
+
import type { TFilterState, TFilterBarConfigs } from './types';
|
|
4
|
+
export type IFilterBarConfigs<T> = TFilterBarConfigs<T>;
|
|
25
5
|
export interface IFilterBarSlots {
|
|
26
6
|
summaryWrapProps?: BoxProps;
|
|
27
|
-
summaryBefore?:
|
|
28
|
-
summaryAfter?:
|
|
29
|
-
before?:
|
|
30
|
-
after?:
|
|
7
|
+
summaryBefore?: ReactNode | ReactNode[];
|
|
8
|
+
summaryAfter?: ReactNode | ReactNode[];
|
|
9
|
+
before?: ReactNode | ReactNode[];
|
|
10
|
+
after?: ReactNode | ReactNode[];
|
|
11
|
+
actionsBefore?: ReactNode | ReactNode[];
|
|
12
|
+
actionsAfter?: ReactNode | ReactNode[];
|
|
31
13
|
}
|
|
32
14
|
export interface IFilterBarProps<T> {
|
|
33
15
|
sx?: BoxProps['sx'];
|
|
@@ -37,4 +19,4 @@ export interface IFilterBarProps<T> {
|
|
|
37
19
|
slots?: IFilterBarSlots;
|
|
38
20
|
loading?: boolean;
|
|
39
21
|
}
|
|
40
|
-
export declare function createFilterBar<T>(configs:
|
|
22
|
+
export declare function createFilterBar<T>(configs: TFilterBarConfigs<T>): FC<IFilterBarProps<T>>;
|
|
@@ -4,12 +4,13 @@ export * from './components/hint-icon';
|
|
|
4
4
|
export * from './convert-to-graphql';
|
|
5
5
|
export * from './local-filter-builder';
|
|
6
6
|
export * from './index.dino';
|
|
7
|
-
export type { IFieldSelectOption } from './
|
|
8
|
-
export { formatterSelect } from './
|
|
9
|
-
export type { IFormFieldDateTimeParam, TDateTimePickerType } from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export
|
|
7
|
+
export type { IFieldSelectOption } from './form-field/create-form-field-select';
|
|
8
|
+
export { formatterSelect } from './form-field/create-form-field-select';
|
|
9
|
+
export type { IFormFieldDateTimeParam, TDateTimePickerType } from './form-field/create-form-field-datetime';
|
|
10
|
+
export * from './form-field/create-form-field-datetime';
|
|
11
|
+
export * from './form-field/create-form-field-number';
|
|
12
|
+
export * from './form-field/create-form-field-select-with-api';
|
|
13
|
+
export * from './filter-input.types';
|
|
14
|
+
export * from './filter-menu.types';
|
|
15
|
+
export * from './filter-sort.types';
|
|
15
16
|
export { mergeValueToStoreFilter, mergeSingleValueToStoreFilter } from './hooks';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createFilterBar } from './index.create';
|
|
2
2
|
import { getFilterFromURL, isEmptyFilterState, isFilterStateEqual, removeNullValues, setFilterToURL } from './helpers';
|
|
3
|
-
import { createFormFieldSelectWithFallback } from './
|
|
4
|
-
import createFormFieldNumber, { formatterNumber } from './
|
|
5
|
-
import createFormFieldDateTime, { formatterDateTime } from './
|
|
6
|
-
import createFormFieldSelect, { formatterSelect } from './
|
|
7
|
-
import createFormFieldBoolean, { formatterBoolean } from './
|
|
8
|
-
import createFormFieldSelectWithApi, { formatterSelectWithApi } from './
|
|
9
|
-
import createFormFieldString from './
|
|
3
|
+
import { createFormFieldSelectWithFallback } from './form-field/create-form-field-select.fallback';
|
|
4
|
+
import createFormFieldNumber, { formatterNumber } from './form-field/create-form-field-number';
|
|
5
|
+
import createFormFieldDateTime, { formatterDateTime } from './form-field/create-form-field-datetime';
|
|
6
|
+
import createFormFieldSelect, { formatterSelect } from './form-field/create-form-field-select';
|
|
7
|
+
import createFormFieldBoolean, { formatterBoolean } from './form-field/create-form-field-boolean';
|
|
8
|
+
import createFormFieldSelectWithApi, { formatterSelectWithApi } from './form-field/create-form-field-select-with-api';
|
|
9
|
+
import createFormFieldString from './form-field/create-form-field-string';
|
|
10
10
|
export declare class DinoFilterBar {
|
|
11
11
|
createFilterBar: typeof createFilterBar;
|
|
12
12
|
createConvertToGraphQL: <TSource extends Record<string, any>, TTarget extends object, U extends object = {}>(state: import("./types").TFilterState<TSource>) => import("./convert-to-graphql").TableFileterConverter<TSource, TTarget, U>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TFilterState } from './types';
|
|
2
|
-
type TOperation = 'equal' | 'contains';
|
|
2
|
+
type TOperation = 'equal' | 'contains' | 'number' | 'datetime' | 'boolean' | 'enum';
|
|
3
3
|
type TAutoMapField = {
|
|
4
|
-
/** The operation to use for filtering.
|
|
4
|
+
/** The operation to use for filtering. @default 'contains' */
|
|
5
5
|
operation?: TOperation;
|
|
6
6
|
};
|
|
7
7
|
type TAutoMapFields<T> = Partial<Record<keyof T, TAutoMapField>>;
|
|
@@ -10,13 +10,16 @@ type TAutoMapConfigs<T> = {
|
|
|
10
10
|
sortFields?: (keyof T)[];
|
|
11
11
|
quickSearchFields?: (keyof T)[];
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Utility builder class for applying `TFilterState` filtering, quick-searching, and sorting in-memory on client-side array data.
|
|
15
|
+
*/
|
|
13
16
|
export declare class LocalFilterBuilder<T> {
|
|
14
|
-
private operation;
|
|
15
17
|
private data;
|
|
16
18
|
private dataFiltered;
|
|
17
19
|
private filterState;
|
|
18
20
|
constructor(data: T[], filterState: TFilterState<T>);
|
|
19
21
|
private autoMapConfigs;
|
|
22
|
+
/** Register auto-mapping configuration for in-memory field filtering, sorting, and quick search. */
|
|
20
23
|
autoMap(configs?: TAutoMapConfigs<T>): this;
|
|
21
24
|
/** Register field filter config. Merged with autoMap.fields. */
|
|
22
25
|
filter(config?: {
|
|
@@ -33,7 +36,13 @@ export declare class LocalFilterBuilder<T> {
|
|
|
33
36
|
sortFields?: (keyof T)[];
|
|
34
37
|
}): this;
|
|
35
38
|
private handleSort;
|
|
39
|
+
/**
|
|
40
|
+
* Executes filtering, quick search, and sorting logic on the raw data array, returning the processed subset.
|
|
41
|
+
*/
|
|
36
42
|
build(): T[];
|
|
37
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Factory function to instantiate a `LocalFilterBuilder` for client-side array filtering.
|
|
46
|
+
*/
|
|
38
47
|
export declare const createLocalFilterBuilder: <T>(data: T[], filterState: TFilterState<T>) => LocalFilterBuilder<T>;
|
|
39
48
|
export {};
|