dinocollab-core 2.2.43 → 2.2.44

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 (50) hide show
  1. package/bin/codegen.js +2 -1
  2. package/dist/form/index.js +1 -1
  3. package/dist/src/api-context/alert-global.js +1 -1
  4. package/dist/src/api-context/alert-global.js.map +1 -1
  5. package/dist/src/components/text-editor.js +1 -1
  6. package/dist/src/components/text-editor.js.map +1 -1
  7. package/dist/src/data-surface/view-list/styled.js +1 -1
  8. package/dist/src/data-surface/view-list/styled.js.map +1 -1
  9. package/dist/src/filter-bar/components/filter-summary.js +1 -1
  10. package/dist/src/filter-bar/components/filter-summary.js.map +1 -1
  11. package/dist/src/filter-bar/menu/create-form-field-select-multiple.js +1 -1
  12. package/dist/src/filter-bar/menu/create-form-field-select-multiple.js.map +1 -1
  13. package/dist/src/filter-bar/menu/create-form-field-select.js +1 -1
  14. package/dist/src/filter-bar/menu/create-form-field-select.js.map +1 -1
  15. package/dist/src/form/create.input-file.csv-local-parser.js +1 -1
  16. package/dist/src/form/create.input-file.csv-local-parser.js.map +1 -1
  17. package/dist/src/form/create.text-editor.js +1 -1
  18. package/dist/src/form/create.text-editor.js.map +1 -1
  19. package/dist/src/form/decorator.form.js +1 -1
  20. package/dist/src/form/decorator.form.js.map +1 -1
  21. package/dist/src/form/decorator.js +1 -1
  22. package/dist/src/form/decorator.js.map +1 -1
  23. package/dist/src/form/decorator.units.js +2 -0
  24. package/dist/src/form/decorator.units.js.map +1 -0
  25. package/dist/src/form/dino-form.js +1 -1
  26. package/dist/src/form/dino-form.js.map +1 -1
  27. package/dist/src/form/helpers.js +1 -1
  28. package/dist/src/form/helpers.js.map +1 -1
  29. package/dist/src/table/dino.js +1 -1
  30. package/dist/src/table/dino.js.map +1 -1
  31. package/dist/src/table/toolbar-pannel.js +1 -1
  32. package/dist/src/table/toolbar-pannel.js.map +1 -1
  33. package/dist/src/table/ui.units.js +1 -1
  34. package/dist/src/table/ui.units.js.map +1 -1
  35. package/dist/src/table-grid/toolbar-pannel.js +1 -1
  36. package/dist/src/table-grid/toolbar-pannel.js.map +1 -1
  37. package/dist/src/utils/query-param.js +1 -1
  38. package/dist/src/utils/query-param.js.map +1 -1
  39. package/dist/types/api-context/alert-global.d.ts +1 -1
  40. package/dist/types/components/text-editor.d.ts +0 -1
  41. package/dist/types/filter-bar/menu/create-form-field-select-multiple.d.ts +1 -1
  42. package/dist/types/filter-bar/menu/create-form-field-select.d.ts +1 -1
  43. package/dist/types/form/create.input-file.csv-local-parser.d.ts +15 -0
  44. package/dist/types/form/decorator.d.ts +9 -8
  45. package/dist/types/form/decorator.form.d.ts +11 -17
  46. package/dist/types/form/decorator.units.d.ts +17 -0
  47. package/dist/types/form/dino-form.d.ts +1 -2
  48. package/dist/types/form/helpers.d.ts +4 -1
  49. package/dist/types/form/types.d.ts +1 -1
  50. package/package.json +1 -1
@@ -17,7 +17,7 @@ export interface IApiContext {
17
17
  ApiAlert?: IApiAlert;
18
18
  }
19
19
  export declare const ApiAlertContext: IApiContext;
20
- declare function AlertGlobal(): import("react/jsx-runtime").JSX.Element;
20
+ declare function AlertGlobal(): React.ReactPortal;
21
21
  export default AlertGlobal;
22
22
  interface AlertDialogProps {
23
23
  IsOpen: boolean;
@@ -1,6 +1,5 @@
1
1
  import { Component } from 'react';
2
2
  import { SxProps, Theme } from '@mui/material';
3
- import 'react-quill/dist/quill.snow.css';
4
3
  export declare const textEditorClasses: {
5
4
  root: string;
6
5
  fullscreen: string;
@@ -16,7 +16,7 @@ export interface IFormFieldSelectMultipleParam<T> {
16
16
  /** List of options for the select field */
17
17
  options?: IFieldSelectOption[];
18
18
  /** Function to fetch options asynchronously */
19
- fetchOptions?: (signal?: AbortSignal) => Promise<IFieldSelectOption[]>;
19
+ fetchOptions?: (signal?: AbortSignal) => Promise<IFieldSelectOption[]> | IFieldSelectOption[];
20
20
  /** If true, disables the field after submission. @default false */
21
21
  disabledAfterSubmit?: boolean;
22
22
  /** Force a fixed logic value, hiding the logic toggle */
@@ -20,7 +20,7 @@ export interface IFormFieldSelectParam<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 */
23
- fetchOptions?: (signal?: AbortSignal) => Promise<IFieldSelectOption[]>;
23
+ fetchOptions?: (signal?: AbortSignal) => Promise<IFieldSelectOption[]> | IFieldSelectOption[];
24
24
  /** Force a specific logic (and/or) for this field, overriding the default or user-selected logic */
25
25
  forceLogic?: TLogic;
26
26
  /** Maximum number of values that can be selected for this field */
@@ -13,6 +13,14 @@ export interface IInputFileCsvLocalParserSlots {
13
13
  * Useful for guiding users on how to use or fill out the CSV file.
14
14
  */
15
15
  instructionalText?: string;
16
+ /**
17
+ * The title text displayed at the top.
18
+ */
19
+ titleText?: string;
20
+ /**
21
+ * Optional sub text displayed below the title or above the download link.
22
+ */
23
+ subText?: string;
16
24
  /**
17
25
  * Props to customize the TextField used for uploading the CSV file.
18
26
  * Allows customization of appearance and behavior (e.g., placeholder, onChange, disabled).
@@ -31,6 +39,13 @@ export interface IInputFileCsvLocalParserSlots {
31
39
  labelShrink?: boolean;
32
40
  }
33
41
  export interface IInputFileCsvLocalParserParams extends IInputFileCsvLocalParserSlots {
42
+ /** Optional sub name for the input field. */
43
+ subName?: string;
44
+ /**
45
+ * Optional suffix name for the input field. When `subName` is provided, `suffixName` will be not used.
46
+ * @default '_file'
47
+ * */
48
+ suffixName?: string;
34
49
  }
35
50
  export interface IInputFileCsvLocalParserProps<T, C> extends IFormInputBase<T, IInputFileCsvLocalParserSlots> {
36
51
  onChange?: (value: C[]) => void;
@@ -22,23 +22,24 @@ export declare function registerForm(name?: string): <T extends new (...args: an
22
22
  */
23
23
  export declare function isFormRegistered(target: any): boolean;
24
24
  export interface IPreSubmitMetadata<T = any> {
25
- handler: (data: T, oldData: T) => Promise<any> | any;
25
+ handler: (data: Partial<T>, oldData?: T) => Promise<any> | any;
26
26
  }
27
27
  export declare function formPreSubmit<T = any>(handler: IPreSubmitMetadata<T>['handler']): <T_1 extends new (...args: any[]) => {}>(constructor: T_1) => T_1;
28
- export declare function getFormPreSubmit(targetClass: any): IPreSubmitMetadata | undefined;
28
+ export declare function getFormPreSubmit<T = any>(targetClass: any): IPreSubmitMetadata<T> | undefined;
29
+ export type ISizes = Partial<Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>>;
29
30
  export interface IFieldMetadata<T = any, O = {}> {
30
- name: keyof T | string;
31
+ name: keyof T;
31
32
  label?: string;
32
33
  placeholder?: string;
33
34
  defaultValue?: any;
34
35
  type?: any;
35
- size?: Partial<Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>>;
36
- visible?: boolean | ((data?: T) => boolean);
37
- disabled?: boolean | ((data?: T) => boolean);
36
+ sizes?: ISizes | ((data?: T, formState?: Partial<T>) => ISizes);
37
+ visible?: boolean | ((data?: T, formState?: Partial<T>) => boolean);
38
+ disabled?: boolean | ((data?: T, formState?: Partial<T>) => boolean);
38
39
  renderInput?: ComponentType<IFormInputBase<T>>;
39
40
  }
40
- export declare function formField(options: Omit<IFieldMetadata, 'name'>): (target: any, propertyKey: string) => void;
41
- export declare const getFormFields: (targetClass: any) => IFieldMetadata[];
41
+ export declare function formField<T = any>(options: Omit<IFieldMetadata<T>, 'name'>): (target: any, propertyKey: string) => void;
42
+ export declare function getFormFields<T = any>(targetClass: any): IFieldMetadata<T>[];
42
43
  export interface IValidationMetadata extends IConfigValue {
43
44
  name: string;
44
45
  }
@@ -1,40 +1,34 @@
1
- import { ComponentType, FC } from 'react';
1
+ import { ComponentType } from 'react';
2
2
  import { BoxProps, GridProps } from '@mui/material';
3
3
  import { IFormInputBase } from './types';
4
4
  import { IPartialError } from './validator';
5
5
  import { IFormBaseSlots } from './create.form-base';
6
+ import { IFormFooterProps, IFormFooterSlots } from './decorator.units';
6
7
  export interface IDecoratorFieldProps<T = any> extends IFormInputBase<T> {
7
8
  type?: any;
8
9
  visible?: boolean | ((data: T) => boolean);
9
10
  renderInput?: ComponentType<IFormInputBase<T>>;
10
11
  }
11
- export declare const DecoratorField: FC<IDecoratorFieldProps>;
12
- export interface IDecoratorFormSlots {
12
+ export interface IDecoratorFormSlots<T> {
13
13
  top?: React.ReactNode;
14
14
  bottom?: React.ReactNode;
15
15
  isFooter?: React.ReactNode | boolean;
16
16
  contentProps?: GridProps;
17
17
  formBase?: IFormBaseSlots;
18
- footer?: ComponentType<any>;
19
- footerProps?: BoxProps & {
20
- [key: string]: any;
21
- };
22
- footerSlots?: {
23
- after?: React.ReactNode;
24
- before?: React.ReactNode;
25
- };
18
+ footer?: ComponentType<IFormFooterProps<T>>;
19
+ footerProps?: Omit<BoxProps, 'slots'>;
20
+ footerSlots?: IFormFooterSlots;
26
21
  }
27
22
  export interface IDecoratorFormProps<T = any> {
28
23
  configClass?: any;
29
- data?: Partial<T>;
24
+ data?: T;
30
25
  onSubmit?: (data: Partial<T>, signal?: AbortSignal) => Promise<void>;
31
26
  onError?: (error: any) => void;
32
27
  onSubmitError?: (error: IPartialError<T>) => void;
33
28
  onSuccess?: (data: Partial<T>) => void;
34
29
  enableStickyFooter?: boolean;
35
- slots?: IDecoratorFormSlots;
30
+ slots?: IDecoratorFormSlots<T>;
36
31
  }
37
- export declare const DecoratorForm: FC<IDecoratorFormProps>;
38
- export default DecoratorForm;
39
- type IDecoratorFormOptions<T> = Partial<Omit<IDecoratorFormProps<T>, 'configClass'>>;
40
- export declare const createDecoratorForm: <T>(configClass: any, params?: Partial<Omit<IDecoratorFormProps<T>, "configClass">> | undefined) => ComponentType<IDecoratorFormProps<T>>;
32
+ type IDecoratorFormParam<T> = Partial<Omit<IDecoratorFormProps<T>, 'configClass'>>;
33
+ export declare const createDecoratorForm: <T>(configClass: any, param?: Partial<Omit<IDecoratorFormProps<T>, "configClass">> | undefined) => ComponentType<IDecoratorFormProps<T>>;
34
+ export default createDecoratorForm;
@@ -0,0 +1,17 @@
1
+ import { FC } from 'react';
2
+ import { BoxProps } from '@mui/material';
3
+ import { IFormBaseContext } from './types';
4
+ export interface IFormFooterSlots {
5
+ after?: React.ReactNode;
6
+ before?: React.ReactNode;
7
+ }
8
+ export interface IFormFooterProps<T = any> extends Omit<BoxProps, 'slots'> {
9
+ formContext?: IFormBaseContext<T>;
10
+ }
11
+ interface IInternalFormFooterProps<T = any> extends IFormFooterProps<T> {
12
+ isSticky?: boolean;
13
+ slots?: IFormFooterSlots;
14
+ errorMessage?: string;
15
+ }
16
+ export declare const FormFooter: FC<IInternalFormFooterProps<any>>;
17
+ export {};
@@ -19,8 +19,7 @@ declare class DinoFormBase {
19
19
  createFormBase: <T>(params?: import("./create.form-base").IFormBaseParams<T> | undefined) => import("./create.form-base").IFormBaseResult<T>;
20
20
  createFormComfirm: <T = any>(param?: import("./create.form-comfirm").IFormComfirmParam<T> | undefined) => import("react").ComponentType<import("react").PropsWithChildren<import("./create.form-comfirm").IFormComfirmProps<T>>>;
21
21
  createFormGridLayout: <T>(params: import("./create.form-grid-layout").IFormGridLayoutParams<T>) => import("react").ComponentType<import("./create.form-grid-layout").IFormGridLayoutProps<T>>;
22
- DecoratorForm: import("react").FC<import("./decorator.form").IDecoratorFormProps<any>>;
23
- createDecoratorForm: <T>(configClass: any, params?: Partial<Omit<import("./decorator.form").IDecoratorFormProps<T>, "configClass">> | undefined) => import("react").ComponentType<import("./decorator.form").IDecoratorFormProps<T>>;
22
+ createDecoratorForm: <T>(configClass: any, param?: Partial<Omit<import("./decorator.form").IDecoratorFormProps<T>, "configClass">> | undefined) => import("react").ComponentType<import("./decorator.form").IDecoratorFormProps<T>>;
24
23
  createColorPicker: typeof createColorPicker;
25
24
  createDateExpired: typeof CreateDateExpired;
26
25
  createDatePicker: <T extends Object>(params?: import("./create.date-picker").IDatePickerSlots | undefined) => import("react").ComponentType<import("./create.date-picker").IDatePickerProps<T>>;
@@ -22,6 +22,9 @@ export interface IValidateCsv {
22
22
  /** Optional message providing error details if validation fails */
23
23
  message?: string;
24
24
  }
25
+ interface IValidateCsvOptions {
26
+ maxRows?: number;
27
+ }
25
28
  /**
26
29
  * Validates a parsed CSV data array against a list of required column keys.
27
30
  *
@@ -29,5 +32,5 @@ export interface IValidateCsv {
29
32
  * @param requiredKeys - An array of keys that must exist in the CSV headers and each row.
30
33
  * @returns An object indicating whether the data is valid and an optional error message.
31
34
  */
32
- export declare const validateCsvModel: <T extends Record<string, any>>(data: T[], requiredKeys: (keyof T)[]) => IValidateCsv;
35
+ export declare const validateCsvModel: <T extends Record<string, any>>(data: T[], requiredKeys: (keyof T)[], options?: IValidateCsvOptions) => IValidateCsv;
33
36
  export {};
@@ -8,7 +8,7 @@ export interface IFormBaseContext<T> {
8
8
  onBlur: (keyName: keyof T) => void;
9
9
  setError: (keyName: keyof T, message: string) => void;
10
10
  removeError: (keyNames: keyof T | (keyof T)[]) => void;
11
- clearErrorAll: (keyName: keyof T) => void;
11
+ clearErrorAll: () => void;
12
12
  }
13
13
  export interface IFormBase<T> {
14
14
  data?: Partial<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dinocollab-core",
3
- "version": "2.2.43",
3
+ "version": "2.2.44",
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",