dinocollab-core 2.2.13 → 2.2.15
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/data-surface/index.js +1 -1
- package/dist/form/index.js +1 -1
- package/dist/src/components/image-with-fallback.js +1 -1
- package/dist/src/components/image-with-fallback.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/helpers.js +1 -1
- package/dist/src/data-surface/helpers.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/filter-bar/components/chip-viewer.js +1 -1
- package/dist/src/filter-bar/components/chip-viewer.js.map +1 -1
- package/dist/src/filter-bar/components/filter-input.mobile.js +1 -1
- package/dist/src/filter-bar/components/filter-input.mobile.js.map +1 -1
- package/dist/src/filter-bar/components/filter-summary.js +1 -1
- package/dist/src/filter-bar/components/filter-summary.js.map +1 -1
- package/dist/src/filter-bar/components/popper-custom.js +1 -1
- package/dist/src/filter-bar/components/popper-custom.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/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/menu/create-form-field-datetime.js +2 -0
- package/dist/src/filter-bar/menu/create-form-field-datetime.js.map +1 -0
- package/dist/src/filter-bar/menu/create-form-field-select-multiple.js +1 -1
- package/dist/src/filter-bar/menu/create-form-field-select-multiple.js.map +1 -1
- package/dist/src/filter-bar/menu/create-form-field-select.js +1 -1
- package/dist/src/filter-bar/menu/create-form-field-select.js.map +1 -1
- package/dist/src/filter-bar/menu/create-form-field-string.js +1 -1
- package/dist/src/filter-bar/menu/create-form-field-string.js.map +1 -1
- package/dist/src/filter-bar/menu/create.js +1 -1
- package/dist/src/filter-bar/menu/create.js.map +1 -1
- package/dist/src/filter-bar/types.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-base.js +1 -1
- package/dist/src/form/create.form-base.js.map +1 -1
- package/dist/src/form/create.form-grid-layout.js +1 -1
- package/dist/src/form/create.form-grid-layout.js.map +1 -1
- package/dist/src/form/create.form-grid-layout.units.js +1 -1
- package/dist/src/form/create.form-grid-layout.units.js.map +1 -1
- package/dist/src/form/create.select-simple.js +1 -1
- package/dist/src/form/create.select-simple.js.map +1 -1
- package/dist/src/form/create.select-with-api.js +1 -1
- package/dist/src/form/create.select-with-api.js.map +1 -1
- package/dist/src/form/dino-form.js.map +1 -1
- package/dist/src/table/create.table.js +1 -1
- package/dist/src/table/create.table.js.map +1 -1
- package/dist/src/table/helpers.js +1 -1
- package/dist/src/table/helpers.js.map +1 -1
- package/dist/src/table/styled.js +2 -0
- package/dist/src/table/styled.js.map +1 -0
- package/dist/src/table/toolbar-pannel.js +1 -1
- package/dist/src/table/toolbar-pannel.js.map +1 -1
- package/dist/src/utils/helpers.js +1 -1
- package/dist/src/utils/helpers.js.map +1 -1
- package/dist/table/index.js +1 -1
- package/dist/types/components/image-with-fallback.d.ts +7 -2
- package/dist/types/data-surface/button-switch.d.ts +1 -0
- package/dist/types/data-surface/helpers.d.ts +5 -3
- package/dist/types/data-surface/ui.units.d.ts +4 -2
- package/dist/types/data-view/dino.d.ts +1 -1
- package/dist/types/data-view/query-param-url.d.ts +1 -1
- package/dist/types/filter-bar/components/filter-summary.types.d.ts +2 -1
- package/dist/types/filter-bar/components/hint-icon.types.d.ts +1 -1
- package/dist/types/filter-bar/components/popper-custom.d.ts +1 -0
- package/dist/types/filter-bar/components/ui.units.d.ts +8 -1
- package/dist/types/filter-bar/index.d.ts +2 -0
- package/dist/types/filter-bar/index.dino.d.ts +2 -0
- package/dist/types/filter-bar/menu/create-form-field-datetime.d.ts +53 -0
- package/dist/types/filter-bar/menu/create-form-field-select-multiple.d.ts +17 -0
- package/dist/types/filter-bar/menu/create-form-field-select.d.ts +17 -0
- package/dist/types/filter-bar/menu/create-form-field-string.d.ts +16 -0
- package/dist/types/filter-bar/menu/create.d.ts +17 -0
- package/dist/types/filter-bar/menu/types.d.ts +6 -1
- package/dist/types/filter-bar/types.d.ts +3 -0
- package/dist/types/form/create.date-expired.d.ts +10 -5
- package/dist/types/form/create.form-base.d.ts +1 -0
- package/dist/types/form/create.form-grid-layout.d.ts +6 -4
- package/dist/types/form/create.form-grid-layout.units.d.ts +12 -6
- package/dist/types/form/create.select-simple.d.ts +13 -3
- package/dist/types/form/create.select-with-api.d.ts +56 -4
- package/dist/types/form/dino-form.d.ts +4 -3
- package/dist/types/form/index.d.ts +2 -1
- package/dist/types/table/helpers.d.ts +0 -3
- package/dist/types/table/index.d.ts +1 -1
- package/dist/types/table/styled.d.ts +8 -0
- package/dist/types/table/toolbar-pannel.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { TDateLogic } from '../types';
|
|
3
|
+
import type { IFieldMenuConfig, IFilterMenuFormProps } from './types';
|
|
4
|
+
/** Date logic options available in `single` mode. */
|
|
5
|
+
export type TDateSingleLogic = Exclude<TDateLogic, 'range'>;
|
|
6
|
+
/** The MUI picker variant to render inside the filter menu. */
|
|
7
|
+
export type TDateTimePickerType = 'date' | 'datetime' | 'time';
|
|
8
|
+
/**
|
|
9
|
+
* Selection mode for the DateTime filter.
|
|
10
|
+
* - `'single'` — one value per Apply; values accumulate with OR / AND logic.
|
|
11
|
+
* - `'range'` — two pickers (From / To); always stores exactly `[fromISO, toISO]`.
|
|
12
|
+
*/
|
|
13
|
+
export type TDateTimeMode = 'single' | 'range';
|
|
14
|
+
/** Props for the `FormFieldDateTime` component returned by `createFormFieldDateTime`. Extends the base filter-menu form props. */
|
|
15
|
+
export interface IFormFieldDateTimeProps<T> extends IFilterMenuFormProps<T> {
|
|
16
|
+
}
|
|
17
|
+
/** Parameters passed to `createFormFieldDateTime` to configure the generated component. */
|
|
18
|
+
export interface IFormFieldDateTimeParam<T> {
|
|
19
|
+
/** Optional field-level configuration overrides. */
|
|
20
|
+
config?: IFieldMenuConfig<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Controls which MUI picker is rendered.
|
|
23
|
+
* - `'date'` → `DatePicker` (default)
|
|
24
|
+
* - `'datetime'` → `DateTimePicker`
|
|
25
|
+
* - `'time'` → `TimePicker`
|
|
26
|
+
* @default 'datetime'
|
|
27
|
+
*/
|
|
28
|
+
pickerType?: TDateTimePickerType;
|
|
29
|
+
/**
|
|
30
|
+
* Controls the selection mode.
|
|
31
|
+
* - `'single'` (default) — one value per Apply click; multiple values accumulate with OR / AND logic.
|
|
32
|
+
* - `'range'` — two pickers (From / To); always stores exactly `[fromISO, toISO]`.
|
|
33
|
+
* @default 'single'
|
|
34
|
+
*/
|
|
35
|
+
mode?: TDateTimeMode;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Factory function that creates a `FormFieldDateTime` filter-menu component.
|
|
39
|
+
*
|
|
40
|
+
* The generated component renders a date / time picker inside a popper/menu panel.
|
|
41
|
+
* It supports two selection modes:
|
|
42
|
+
* - **single** (default) — user picks one value per submission; values accumulate
|
|
43
|
+
* and an OR / AND logic toggle appears when more than one value is active.
|
|
44
|
+
* - **range** — two pickers rendered (From / To); always stores exactly
|
|
45
|
+
* `[fromISO, toISO]`, replacing any previous range on each Apply.
|
|
46
|
+
*
|
|
47
|
+
* All stored values are ISO 8601 strings (`TFieldValid = string`).
|
|
48
|
+
*
|
|
49
|
+
* @param params - Static configuration (picker type, mode, optional field config override)
|
|
50
|
+
* @returns A React FC ready to be used as a date/time filter-menu field component
|
|
51
|
+
*/
|
|
52
|
+
declare function createFormFieldDateTime<T>(params?: IFormFieldDateTimeParam<T>): FC<IFormFieldDateTimeProps<T>>;
|
|
53
|
+
export default createFormFieldDateTime;
|
|
@@ -1,13 +1,30 @@
|
|
|
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[];
|
|
11
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Factory function that creates a `FormFieldSelectMultiple` filter-menu component.
|
|
16
|
+
*
|
|
17
|
+
* The generated component renders a checkbox list of options inside a
|
|
18
|
+
* popper/menu panel, allowing the user to select **multiple values** at once.
|
|
19
|
+
* It supports:
|
|
20
|
+
* - Controlled checkbox state to prevent uncontrolled→controlled React warnings
|
|
21
|
+
* - OR / AND logic toggle when more than one value is applied
|
|
22
|
+
* - Chip viewers showing the currently applied values
|
|
23
|
+
* - Built-in validation via an optional `validator` prop
|
|
24
|
+
* - A loading overlay that disables interaction while `isLoading` is true
|
|
25
|
+
*
|
|
26
|
+
* @param params - Static configuration (option list, optional field config override)
|
|
27
|
+
* @returns A React FC ready to be used as a multi-select filter-menu field component
|
|
28
|
+
*/
|
|
12
29
|
declare function createFormFieldSelectMultiple<T>(params?: IFormFieldSelectMultipleParam<T>): FC<IFormFieldSelectMultipleProps<T>>;
|
|
13
30
|
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,16 @@
|
|
|
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
|
+
/** Default logic for combining multiple values for the field */
|
|
11
|
+
defaultLogic?: TLogic;
|
|
12
|
+
/** Tooltip for the field */
|
|
13
|
+
tooltip?: string | ((values?: TFieldValid[]) => string);
|
|
9
14
|
/** Default form component for the field is `String` */
|
|
10
15
|
FormComponent?: ComponentType<IFilterMenuFormProps<T>>;
|
|
11
16
|
}
|
|
@@ -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,16 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TextFieldProps, SwitchProps } from '@mui/material';
|
|
2
|
+
import { TextFieldProps, SwitchProps, BoxProps } from '@mui/material';
|
|
3
3
|
import { IFormInputBase } from './types';
|
|
4
4
|
interface ISlots<T> {
|
|
5
|
+
rootProps?: BoxProps;
|
|
6
|
+
switchProps?: SwitchProps;
|
|
7
|
+
textFieldProps?: Partial<TextFieldProps>;
|
|
8
|
+
}
|
|
9
|
+
interface IDateExpiredConfig<T> extends ISlots<T> {
|
|
10
|
+
defaultValue?: any;
|
|
5
11
|
/** @default string */
|
|
6
|
-
|
|
12
|
+
inputType?: 'number' | 'string';
|
|
7
13
|
textFieldProps?: Partial<TextFieldProps>;
|
|
8
|
-
switchProps?: SwitchProps;
|
|
9
14
|
switchChecked?: boolean;
|
|
10
15
|
switchCheckedGetter?: (value: any, model?: Partial<T>) => boolean;
|
|
11
16
|
}
|
|
12
|
-
interface IProps<T> extends IFormInputBase<T> {
|
|
17
|
+
interface IProps<T> extends IFormInputBase<T>, IDateExpiredConfig<T> {
|
|
13
18
|
slots?: ISlots<T>;
|
|
14
19
|
}
|
|
15
|
-
declare function CreateDateExpired<T>(
|
|
20
|
+
declare function CreateDateExpired<T>(param?: IDateExpiredConfig<T>): React.ComponentType<IProps<T>>;
|
|
16
21
|
export default CreateDateExpired;
|
|
@@ -15,6 +15,7 @@ export interface IFormBaseConfigs<T> {
|
|
|
15
15
|
export interface IFormBaseParams<T> extends IFormBaseConfigs<T> {
|
|
16
16
|
}
|
|
17
17
|
export interface IFormBaseProps<T> extends PropsWithChildren, IFormBaseConfigs<T> {
|
|
18
|
+
className?: string;
|
|
18
19
|
onSubmit: (data: Partial<T>, e: React.FormEvent<HTMLFormElement>) => Promise<void>;
|
|
19
20
|
onError?: (error: IPartialError<T>) => void;
|
|
20
21
|
slots?: IFormBaseSlots;
|
|
@@ -9,13 +9,13 @@ export interface IFormGridLayoutConfig<T> {
|
|
|
9
9
|
placeholder?: string;
|
|
10
10
|
sizes?: RegularBreakpoints;
|
|
11
11
|
defaultValue?: any;
|
|
12
|
+
className?: string;
|
|
12
13
|
inputElement?: ComponentType<IFormInputBase<T>>;
|
|
13
14
|
}
|
|
14
15
|
export type IPreSubmitEvent<T> = (value: Partial<T>, oldValue?: T) => Partial<T>;
|
|
15
16
|
export interface IFormGridLayoutMergedConfigs<T> {
|
|
16
|
-
hiddenFields?: Partial<Record<keyof T, boolean
|
|
17
|
-
|
|
18
|
-
disabledFields?: Partial<Record<keyof T, boolean>>;
|
|
17
|
+
hiddenFields?: Partial<Record<keyof T, boolean>> | ((state: Partial<T>, model?: Partial<T>) => Partial<Record<keyof T, boolean>>);
|
|
18
|
+
disabledFields?: Partial<Record<keyof T, boolean>> | ((state: Partial<T>, model?: Partial<T>) => Partial<Record<keyof T, boolean>>);
|
|
19
19
|
}
|
|
20
20
|
export interface IFormGridLayoutSlots<T> extends IFormGridLayoutMergedConfigs<T> {
|
|
21
21
|
action?: ComponentType<IFormBase<T>>;
|
|
@@ -26,13 +26,14 @@ export interface IFormGridLayoutSlots<T> extends IFormGridLayoutMergedConfigs<T>
|
|
|
26
26
|
Success?: boolean;
|
|
27
27
|
Fail?: boolean;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
rootProps?: BoxProps;
|
|
30
30
|
preSubmit?: IPreSubmitEvent<T>;
|
|
31
31
|
formSlots?: IFormBaseSlots;
|
|
32
32
|
}
|
|
33
33
|
export interface IFormGridLayoutParams<T> extends IFormGridLayoutSlots<T> {
|
|
34
34
|
configs: IFormGridLayoutConfig<T>[];
|
|
35
35
|
validate: FormValidator<Partial<T>>;
|
|
36
|
+
autoHeight?: boolean;
|
|
36
37
|
}
|
|
37
38
|
export interface IFormGridLayoutProps<T> {
|
|
38
39
|
data?: T;
|
|
@@ -42,6 +43,7 @@ export interface IFormGridLayoutProps<T> {
|
|
|
42
43
|
onClose?: () => void;
|
|
43
44
|
sx?: SxProps<Theme>;
|
|
44
45
|
slots?: IFormGridLayoutSlots<T>;
|
|
46
|
+
autoHeight?: boolean;
|
|
45
47
|
}
|
|
46
48
|
export interface IFormGridLayoutState {
|
|
47
49
|
loadding?: boolean;
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { IFormBase } from './types';
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
3
|
+
export declare const formGridLayoutClasses: {
|
|
4
|
+
root: string;
|
|
5
|
+
form: string;
|
|
6
|
+
bottomBar: string;
|
|
7
|
+
autoHeight: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const FormGridLayoutStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
11
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
6
12
|
export interface IFormBottomBarProps<T> extends IFormBase<T> {
|
|
7
13
|
before?: ReactNode;
|
|
8
14
|
}
|
|
9
|
-
export declare function CreateFormBottomBar<T>():
|
|
10
|
-
export declare const FormBottomBarWrap: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<
|
|
11
|
-
ref?: ((instance: HTMLDivElement | null) => void) |
|
|
15
|
+
export declare function CreateFormBottomBar<T>(): FC<IFormBottomBarProps<T>>;
|
|
16
|
+
export declare const FormBottomBarWrap: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
12
18
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { SelectProps } from '@mui/material';
|
|
3
|
-
import { IFormInputBase } from '
|
|
3
|
+
import type { IFormInputBase } from '../form/types';
|
|
4
4
|
import type { IRichTooltipPanelConfig } from '../components/rich-tooltip';
|
|
5
5
|
export interface ISelectSimpleOption<T extends string = string> {
|
|
6
6
|
name: string;
|
|
@@ -11,10 +11,12 @@ export interface ISelectSimpleSlots {
|
|
|
11
11
|
}
|
|
12
12
|
export interface ISelectSimpleProps<T> extends Partial<IFormInputBase<T>> {
|
|
13
13
|
options?: ISelectSimpleOption[];
|
|
14
|
+
value?: any;
|
|
14
15
|
onChange?: (value: ISelectSimpleOption) => void;
|
|
15
16
|
slots?: ISelectSimpleSlots;
|
|
16
17
|
fullWidth?: boolean;
|
|
17
18
|
tooltip?: IRichTooltipPanelConfig;
|
|
19
|
+
endAdornment?: React.ReactNode;
|
|
18
20
|
}
|
|
19
21
|
export interface ISelectSimpleState {
|
|
20
22
|
value?: string;
|
|
@@ -22,6 +24,14 @@ export interface ISelectSimpleState {
|
|
|
22
24
|
export interface ISelectSimpleParams extends ISelectSimpleSlots {
|
|
23
25
|
options?: ISelectSimpleOption[];
|
|
24
26
|
tooltip?: IRichTooltipPanelConfig;
|
|
27
|
+
endAdornment?: React.ReactNode;
|
|
25
28
|
}
|
|
26
|
-
declare function
|
|
27
|
-
export default
|
|
29
|
+
declare function createSelectSimple<T>(args?: ISelectSimpleParams): ComponentType<ISelectSimpleProps<T>>;
|
|
30
|
+
export default createSelectSimple;
|
|
31
|
+
export declare const selectSimpleClasses: {
|
|
32
|
+
root: string;
|
|
33
|
+
tooltipWrap: string;
|
|
34
|
+
small: string;
|
|
35
|
+
tooltip: string;
|
|
36
|
+
endAdornment: string;
|
|
37
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import type { TextFieldProps, AutocompleteRenderOptionState } from '@mui/material';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { IFormInputBase } from './types';
|
|
3
|
+
import type { FilterOptionsState, TextFieldProps, AutocompleteRenderOptionState } from '@mui/material';
|
|
4
4
|
import type { IRichTooltipPanelConfig } from '../components/rich-tooltip';
|
|
5
5
|
export interface ISelectWithApiOption<TOther = any> {
|
|
6
6
|
Id: string;
|
|
@@ -30,5 +30,57 @@ export interface ISelectWithApiParams<O extends ISelectWithApiOption> {
|
|
|
30
30
|
tooltip?: IRichTooltipPanelConfig;
|
|
31
31
|
renderOption?: (props: React.HTMLAttributes<HTMLElement>, option: O, state: AutocompleteRenderOptionState) => React.ReactNode;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export interface ISelectWithApiHandle {
|
|
34
|
+
clear: () => void;
|
|
35
|
+
}
|
|
36
|
+
declare function createSelectWithApi<T, O extends ISelectWithApiOption = ISelectWithApiOption>(params?: ISelectWithApiParams<O>): {
|
|
37
|
+
new (props: ISelectWithApiProps<T, O>): {
|
|
38
|
+
abortController: {
|
|
39
|
+
signalController: AbortController;
|
|
40
|
+
};
|
|
41
|
+
refInput: HTMLInputElement | null;
|
|
42
|
+
existedIds: string[];
|
|
43
|
+
componentDidMount(): void;
|
|
44
|
+
componentWillUnmount(): void;
|
|
45
|
+
componentDidUpdate(prevProps: Readonly<ISelectWithApiProps<T, O>>): void;
|
|
46
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
renderTooltip: () => import("react/jsx-runtime").JSX.Element | null;
|
|
48
|
+
getRootClasses: () => string;
|
|
49
|
+
getFetchDataFunc: () => ISelectWithApiFetchData<O>;
|
|
50
|
+
getWrappedRenderOption: () => ((props: any, option: O, state: AutocompleteRenderOptionState) => import("react/jsx-runtime").JSX.Element) | undefined;
|
|
51
|
+
timer: {
|
|
52
|
+
_timer: number;
|
|
53
|
+
_second: number;
|
|
54
|
+
callback: (value: string) => Promise<void>;
|
|
55
|
+
start: (text: string) => void;
|
|
56
|
+
clear: () => void;
|
|
57
|
+
};
|
|
58
|
+
fetchData: () => Promise<void>;
|
|
59
|
+
handleChange: (_: React.SyntheticEvent, value: O | null) => void;
|
|
60
|
+
handleInputChange: (_: React.SyntheticEvent, value: string) => void;
|
|
61
|
+
fillterOptions: (options: O[], state: FilterOptionsState<O>) => O[];
|
|
62
|
+
getLabel: () => string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | undefined;
|
|
63
|
+
getDefaultValue: () => any;
|
|
64
|
+
getOptionsFilter<O_1 extends ISelectWithApiOption<any> = ISelectWithApiOption<any>>(options: O_1[], existedId?: string[]): O_1[];
|
|
65
|
+
clear: () => void;
|
|
66
|
+
context: unknown;
|
|
67
|
+
setState<K extends keyof ISelectWithApiState<O>>(state: ISelectWithApiState<O> | ((prevState: Readonly<ISelectWithApiState<O>>, props: Readonly<ISelectWithApiProps<T, O>>) => ISelectWithApiState<O> | Pick<ISelectWithApiState<O>, K> | null) | Pick<ISelectWithApiState<O>, K> | null, callback?: (() => void) | undefined): void;
|
|
68
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
69
|
+
readonly props: Readonly<ISelectWithApiProps<T, O>>;
|
|
70
|
+
state: Readonly<ISelectWithApiState<O>>;
|
|
71
|
+
refs: {
|
|
72
|
+
[key: string]: import("react").ReactInstance;
|
|
73
|
+
};
|
|
74
|
+
shouldComponentUpdate?(nextProps: Readonly<ISelectWithApiProps<T, O>>, nextState: Readonly<ISelectWithApiState<O>>, nextContext: any): boolean;
|
|
75
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
76
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<ISelectWithApiProps<T, O>>, prevState: Readonly<ISelectWithApiState<O>>): any;
|
|
77
|
+
componentWillMount?(): void;
|
|
78
|
+
UNSAFE_componentWillMount?(): void;
|
|
79
|
+
componentWillReceiveProps?(nextProps: Readonly<ISelectWithApiProps<T, O>>, nextContext: any): void;
|
|
80
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ISelectWithApiProps<T, O>>, nextContext: any): void;
|
|
81
|
+
componentWillUpdate?(nextProps: Readonly<ISelectWithApiProps<T, O>>, nextState: Readonly<ISelectWithApiState<O>>, nextContext: any): void;
|
|
82
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<ISelectWithApiProps<T, O>>, nextState: Readonly<ISelectWithApiState<O>>, nextContext: any): void;
|
|
83
|
+
};
|
|
84
|
+
contextType?: import("react").Context<any> | undefined;
|
|
85
|
+
};
|
|
86
|
+
export default createSelectWithApi;
|
|
@@ -5,7 +5,8 @@ import CreateInputFile from './create.input.file';
|
|
|
5
5
|
import CreateTextEditor from './create.text-editor';
|
|
6
6
|
import createColorPicker from './create.color-picker';
|
|
7
7
|
import CreateDateExpired from './create.date-expired';
|
|
8
|
-
import
|
|
8
|
+
import createSelectSimple from './create.select-simple';
|
|
9
|
+
import createSelectWithApi from './create.select-with-api';
|
|
9
10
|
import createInputImageFile from './create.input.image-file';
|
|
10
11
|
import CreateAutocompleteChip from './create.autocomplete.chips';
|
|
11
12
|
declare class DinoFormBase {
|
|
@@ -28,8 +29,8 @@ declare class DinoFormBase {
|
|
|
28
29
|
createInputFile: typeof CreateInputFile;
|
|
29
30
|
createInputImageFile: typeof createInputImageFile;
|
|
30
31
|
createInput: <T>(params?: import("./create.input").IInputParams<T> | undefined) => import("react").ComponentType<import("./create.input").IInputProps<T>>;
|
|
31
|
-
createSelectSimple: typeof
|
|
32
|
-
createSelectWithApi:
|
|
32
|
+
createSelectSimple: typeof createSelectSimple;
|
|
33
|
+
createSelectWithApi: typeof createSelectWithApi;
|
|
33
34
|
createTextEditor: typeof CreateTextEditor;
|
|
34
35
|
}
|
|
35
36
|
declare const DinoForm: DinoFormBase;
|
|
@@ -3,8 +3,9 @@ export { default as FormValidator } from './validator';
|
|
|
3
3
|
export * from './validator';
|
|
4
4
|
export { default as DinoForm } from './dino-form';
|
|
5
5
|
export { getErrorMessage, convertFormDataToJson, validateCsvModel } from './helpers';
|
|
6
|
-
export type { ISelectWithApiOption, ISelectWithApiFetchData, ISelectWithApiParams } from './create.select-with-api';
|
|
6
|
+
export type { ISelectWithApiOption, ISelectWithApiFetchData, ISelectWithApiParams, ISelectWithApiHandle } from './create.select-with-api';
|
|
7
7
|
export type { InputBaseImage } from './create.input';
|
|
8
8
|
export type { ISelectSimpleOption } from './create.select-simple';
|
|
9
9
|
export * from './decorator';
|
|
10
10
|
export * from './decorator.form';
|
|
11
|
+
export { formGridLayoutClasses } from './create.form-grid-layout.units';
|
|
@@ -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 './
|
|
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;
|