dinocollab-core 2.2.14 → 2.2.16

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.
Files changed (71) hide show
  1. package/dist/src/components/image-with-fallback.js +1 -1
  2. package/dist/src/components/image-with-fallback.js.map +1 -1
  3. package/dist/src/data-surface/helpers.js +1 -1
  4. package/dist/src/data-surface/helpers.js.map +1 -1
  5. package/dist/src/data-surface/view-grid/helpers.js +1 -1
  6. package/dist/src/data-surface/view-grid/helpers.js.map +1 -1
  7. package/dist/src/data-surface/view-grid/hooks.js +1 -1
  8. package/dist/src/data-surface/view-grid/hooks.js.map +1 -1
  9. package/dist/src/data-surface/view-grid/index.js +1 -1
  10. package/dist/src/data-surface/view-grid/index.js.map +1 -1
  11. package/dist/src/filter-bar/components/chip-viewer.js +1 -1
  12. package/dist/src/filter-bar/components/chip-viewer.js.map +1 -1
  13. package/dist/src/filter-bar/components/filter-input.mobile.js +1 -1
  14. package/dist/src/filter-bar/components/filter-input.mobile.js.map +1 -1
  15. package/dist/src/filter-bar/components/filter-summary.js +1 -1
  16. package/dist/src/filter-bar/components/filter-summary.js.map +1 -1
  17. package/dist/src/filter-bar/components/popper-custom.js +1 -1
  18. package/dist/src/filter-bar/components/popper-custom.js.map +1 -1
  19. package/dist/src/filter-bar/components/ui.units.js +1 -1
  20. package/dist/src/filter-bar/components/ui.units.js.map +1 -1
  21. package/dist/src/filter-bar/convert-to-graphql.js +1 -1
  22. package/dist/src/filter-bar/convert-to-graphql.js.map +1 -1
  23. package/dist/src/filter-bar/index.create.js +1 -1
  24. package/dist/src/filter-bar/index.create.js.map +1 -1
  25. package/dist/src/filter-bar/index.dino.js +1 -1
  26. package/dist/src/filter-bar/index.dino.js.map +1 -1
  27. package/dist/src/filter-bar/menu/create-form-field-datetime.js +2 -0
  28. package/dist/src/filter-bar/menu/create-form-field-datetime.js.map +1 -0
  29. package/dist/src/filter-bar/menu/create-form-field-select-multiple.js +1 -1
  30. package/dist/src/filter-bar/menu/create-form-field-select-multiple.js.map +1 -1
  31. package/dist/src/filter-bar/menu/create-form-field-select.js +1 -1
  32. package/dist/src/filter-bar/menu/create-form-field-select.js.map +1 -1
  33. package/dist/src/filter-bar/menu/create-form-field-string.js +1 -1
  34. package/dist/src/filter-bar/menu/create-form-field-string.js.map +1 -1
  35. package/dist/src/filter-bar/menu/create.js +1 -1
  36. package/dist/src/filter-bar/menu/create.js.map +1 -1
  37. package/dist/src/filter-bar/types.js.map +1 -1
  38. package/dist/src/form/create.form-grid-layout.units.js +1 -1
  39. package/dist/src/form/create.form-grid-layout.units.js.map +1 -1
  40. package/dist/src/table/create.table.js +1 -1
  41. package/dist/src/table/create.table.js.map +1 -1
  42. package/dist/src/table/helpers.js +1 -1
  43. package/dist/src/table/helpers.js.map +1 -1
  44. package/dist/src/table/styled.js +2 -0
  45. package/dist/src/table/styled.js.map +1 -0
  46. package/dist/src/table/toolbar-pannel.js +1 -1
  47. package/dist/src/table/toolbar-pannel.js.map +1 -1
  48. package/dist/table/index.js +1 -1
  49. package/dist/types/components/image-with-fallback.d.ts +7 -2
  50. package/dist/types/data-surface/helpers.d.ts +5 -3
  51. package/dist/types/data-surface/view-grid/helpers.d.ts +4 -0
  52. package/dist/types/data-surface/view-grid/hooks.d.ts +1 -0
  53. package/dist/types/data-surface/view-grid/types.d.ts +2 -0
  54. package/dist/types/filter-bar/components/filter-summary.types.d.ts +2 -1
  55. package/dist/types/filter-bar/components/hint-icon.types.d.ts +1 -1
  56. package/dist/types/filter-bar/components/popper-custom.d.ts +1 -0
  57. package/dist/types/filter-bar/components/ui.units.d.ts +8 -1
  58. package/dist/types/filter-bar/index.d.ts +2 -0
  59. package/dist/types/filter-bar/index.dino.d.ts +2 -0
  60. package/dist/types/filter-bar/menu/create-form-field-datetime.d.ts +53 -0
  61. package/dist/types/filter-bar/menu/create-form-field-select-multiple.d.ts +19 -0
  62. package/dist/types/filter-bar/menu/create-form-field-select.d.ts +17 -0
  63. package/dist/types/filter-bar/menu/create-form-field-string.d.ts +16 -0
  64. package/dist/types/filter-bar/menu/create.d.ts +17 -0
  65. package/dist/types/filter-bar/menu/types.d.ts +12 -1
  66. package/dist/types/filter-bar/types.d.ts +3 -0
  67. package/dist/types/table/helpers.d.ts +0 -3
  68. package/dist/types/table/index.d.ts +1 -1
  69. package/dist/types/table/styled.d.ts +8 -0
  70. package/dist/types/table/toolbar-pannel.d.ts +5 -0
  71. package/package.json +1 -1
@@ -1,13 +1,32 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IFieldSelectOption } from './create-form-field-select';
3
3
  import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
4
+ /** Props for the `FormFieldSelectMultiple` component returned by `createFormFieldSelectMultiple`. Extends the base filter-menu form props. */
4
5
  export interface IFormFieldSelectMultipleProps<T> extends IFilterMenuFormProps<T> {
5
6
  }
7
+ /** Parameters passed to `createFormFieldSelectMultiple` to configure the generated component. */
6
8
  export interface IFormFieldSelectMultipleParam<T> {
7
9
  /** Optional configuration for the form field */
8
10
  config?: IFieldMenuConfig<T>;
9
11
  /** List of options for the select field */
10
12
  options: IFieldSelectOption[];
13
+ /** If true, disables the field after submission. @default false */
14
+ disabledAfterSubmit?: boolean;
11
15
  }
16
+ /**
17
+ * Factory function that creates a `FormFieldSelectMultiple` filter-menu component.
18
+ *
19
+ * The generated component renders a checkbox list of options inside a
20
+ * popper/menu panel, allowing the user to select **multiple values** at once.
21
+ * It supports:
22
+ * - Controlled checkbox state to prevent uncontrolled→controlled React warnings
23
+ * - OR / AND logic toggle when more than one value is applied
24
+ * - Chip viewers showing the currently applied values
25
+ * - Built-in validation via an optional `validator` prop
26
+ * - A loading overlay that disables interaction while `isLoading` is true
27
+ *
28
+ * @param params - Static configuration (option list, optional field config override)
29
+ * @returns A React FC ready to be used as a multi-select filter-menu field component
30
+ */
12
31
  declare function createFormFieldSelectMultiple<T>(params?: IFormFieldSelectMultipleParam<T>): FC<IFormFieldSelectMultipleProps<T>>;
13
32
  export default createFormFieldSelectMultiple;
@@ -1,17 +1,34 @@
1
1
  import { FC } from 'react';
2
2
  import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
3
3
  import type { TFieldValid } from '../types';
4
+ /** Props for the `FormFieldSelect` component returned by `createFormFieldSelect`. Extends the base filter-menu form props. */
4
5
  export interface IFormFieldSelectProps<T> extends IFilterMenuFormProps<T> {
5
6
  }
7
+ /** A single option item rendered as a radio button inside the select filter menu. */
6
8
  export interface IFieldSelectOption {
7
9
  value: TFieldValid;
8
10
  label?: string;
9
11
  }
12
+ /** Parameters passed to `createFormFieldSelect` to configure the generated component. */
10
13
  export interface IFormFieldSelectParams<T> {
11
14
  /** Optional configuration for the form field */
12
15
  config?: IFieldMenuConfig<T>;
13
16
  /** List of options for the select field */
14
17
  options: IFieldSelectOption[];
15
18
  }
19
+ /**
20
+ * Factory function that creates a `FormFieldSelect` filter-menu component.
21
+ *
22
+ * The generated component renders a radio-button list of options inside a
23
+ * popper/menu panel. It supports:
24
+ * - Single or multi-value selection (controlled by `config.singleValue`)
25
+ * - OR / AND logic toggle when more than one value is selected
26
+ * - Chip viewers showing the currently applied values
27
+ * - Built-in validation via an optional `validator` prop
28
+ * - A loading overlay that disables interaction while `isLoading` is true
29
+ *
30
+ * @param params - Static configuration (option list, optional field config override)
31
+ * @returns A React FC ready to be used as a filter-menu field component
32
+ */
16
33
  declare function createFormFieldSelect<T>(params: IFormFieldSelectParams<T>): FC<IFormFieldSelectProps<T>>;
17
34
  export default createFormFieldSelect;
@@ -1,10 +1,26 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
3
+ /** Props for the `FormFieldString` component returned by `createFormFieldString`. Extends the base filter-menu form props. */
3
4
  export interface IFormFieldStringProps<T> extends IFilterMenuFormProps<T> {
4
5
  }
6
+ /** Parameters passed to `createFormFieldString` to configure the generated component. */
5
7
  export interface IFormFieldStringParam<T> {
6
8
  /** Optional configuration for the form field */
7
9
  config?: IFieldMenuConfig<T>;
8
10
  }
11
+ /**
12
+ * Factory function that creates a `FormFieldString` filter-menu component.
13
+ *
14
+ * The generated component renders a free-text input inside a popper/menu panel,
15
+ * letting the user type arbitrary string values as filter criteria. It supports:
16
+ * - OR / AND logic toggle when more than one value is applied
17
+ * - Chip viewers showing the currently applied values
18
+ * - Auto-focus and input reset after each successful submission
19
+ * - Built-in validation via an optional `validator` prop
20
+ * - A loading overlay that disables interaction while `isLoading` is true
21
+ *
22
+ * @param params - Static configuration (optional field config override)
23
+ * @returns A React FC ready to be used as a free-text filter-menu field component
24
+ */
9
25
  declare function createFormFieldString<T>(params?: IFormFieldStringParam<T>): FC<IFormFieldStringProps<T>>;
10
26
  export default createFormFieldString;
@@ -1,7 +1,24 @@
1
1
  import type { FC } from 'react';
2
2
  import type { IFilterMenuProps } from './types';
3
3
  import type { IFilterMenuConfig } from './types';
4
+ /**
5
+ * Factory function that creates a `FilterMenu` component from a static field configuration.
6
+ *
7
+ * The generated component renders a badge icon button that opens a popper panel with:
8
+ * - A **field list** view — lists all configured filter fields with applied-value counts
9
+ * - A **field form** view — renders the appropriate input component for the selected field
10
+ * - A **quick-search** field (opt-out via `enableQuickSearch: false`)
11
+ * - OR / AND logic toggle support per field
12
+ * - "Clear All" action to reset all active filters at once
13
+ *
14
+ * All state (open/close, selected field) is local; filter values are read/written through
15
+ * `FilterBarContext` via `useFilterActions`.
16
+ *
17
+ * @param config - Static filter-menu configuration (fields, validation, slots, etc.)
18
+ * @returns A React FC ready to be dropped anywhere inside a `FilterBarProvider`
19
+ */
4
20
  export declare function createFilterMenu<T>(config: IFilterMenuConfig<T>): FC<IFilterMenuProps<T>>;
21
+ /** CSS class names used by the `FilterMenu` component for external style overrides. */
5
22
  export declare const filterMenuClasses: {
6
23
  root: string;
7
24
  input: string;
@@ -1,11 +1,20 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { BoxProps, PopperProps } from '@mui/material';
3
3
  import type { FormValidator, IFormValidatorConfig } from '../../form/validator';
4
- import type { TFieldModelValid, TFieldType, TFieldValid, TFieldValue } from '../types';
4
+ import type { TFieldModelValid, TFieldType, TFieldValid, TFieldValue, TLogic } from '../types';
5
5
  export interface IFieldMenuConfig<T> {
6
6
  field: TFieldType<T>;
7
7
  label?: string;
8
+ /** If true, the form will only allow a single value to be added for the field */
8
9
  singleValue?: boolean;
10
+ /** If true, the form will replace the existing value with the new value */
11
+ replaceValue?: boolean;
12
+ /** If true, the menu will close after submitting a value @default true */
13
+ closeAfterSubmit?: boolean;
14
+ /** Default logic for combining multiple values for the field */
15
+ defaultLogic?: TLogic;
16
+ /** Tooltip for the field */
17
+ tooltip?: string | ((values?: TFieldValid[]) => string);
9
18
  /** Default form component for the field is `String` */
10
19
  FormComponent?: ComponentType<IFilterMenuFormProps<T>>;
11
20
  }
@@ -33,6 +42,8 @@ export interface IFilterMenuConfig<T> extends IFilterMenuSlots {
33
42
  quickSearchHint?: string | ((currentHint: string) => string);
34
43
  /** Option to enable or disable quick search @default true */
35
44
  enableQuickSearch?: boolean;
45
+ /** Option to close the menu after submitting a value @default true */
46
+ closeAfterSubmit?: boolean;
36
47
  }
37
48
  export interface IFilterMenuConfigInternal<T> extends Omit<IFilterMenuConfig<T>, 'fields'> {
38
49
  fields: TFieldMenuConfigsInternal<T>;
@@ -59,6 +59,7 @@ export type TFieldSort<T> = {
59
59
  * @vi Dinh nghia cac kieu co ban cho he thong filter bar, bao gom gia tri filter, kieu field va cau truc tong the cua filter state.
60
60
  */
61
61
  export type TLogic = 'and' | 'or';
62
+ export type TDateLogic = 'before' | 'after' | 'on' | 'range';
62
63
  /**
63
64
  * @en
64
65
  * - Structure for storing filter values and their logical relationship (AND/OR) for each field.
@@ -68,6 +69,8 @@ export type TLogic = 'and' | 'or';
68
69
  export type TFieldValue = {
69
70
  /** Logical operator for combining values within this field. Default is 'and'. */
70
71
  logic?: TLogic;
72
+ /** Logical operator for date-specific filtering. Optional. */
73
+ dateLogic?: TDateLogic;
71
74
  values: TFieldValid[];
72
75
  };
73
76
  /**
@@ -1,9 +1,6 @@
1
1
  import { GridFilterModel, GridSortModel } from '@mui/x-data-grid';
2
2
  import { GridInitialStateCommunity } from '@mui/x-data-grid/models/gridStateCommunity';
3
3
  import { ICustomGridSortModel, ITableQueryParams, ITableQueryDetail } from './types';
4
- export declare const dinoTableClasses: {
5
- whiteSpacePre: string;
6
- };
7
4
  export interface ITableQueryParamModel {
8
5
  table?: string;
9
6
  }
@@ -3,6 +3,6 @@ export * from './model-filter';
3
3
  export * from './create.action-row';
4
4
  export * from './create.table';
5
5
  export { default as DinoTable } from './dino';
6
- export { dinoTableClasses } from './helpers';
6
+ export { dinoTableClasses } from './styled';
7
7
  export type { IStatusCellConfig } from './ui.units';
8
8
  export type { IExportCsvOptionsModel } from './csv-export-helper';
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const dinoTableClasses: {
3
+ root: string;
4
+ whiteSpacePre: string;
5
+ };
6
+ export declare const TableStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
7
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
8
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -25,6 +25,11 @@ export interface IToolbarPannelProps {
25
25
  exportCsvOptions?: IExportCsvOptionsModel;
26
26
  }
27
27
  declare class ToolbarPannel extends Component<React.PropsWithChildren<IToolbarPannelProps>> {
28
+ private _popperObserver;
29
+ private _elementObserver;
30
+ private _observedPopper;
31
+ componentDidMount(): void;
32
+ componentWillUnmount(): void;
28
33
  render(): import("react/jsx-runtime").JSX.Element;
29
34
  renderTitle: () => import("react/jsx-runtime").JSX.Element;
30
35
  renderEndAdornment: () => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinocollab-core",
3
- "version": "2.2.14",
3
+ "version": "2.2.16",
4
4
  "description": "Dinocollab core - libraries for building collaborative applications with React 18",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",