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
|
@@ -1,21 +1,16 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { IFilterInputConfig, TFieldMatch } from './filter-input.types';
|
|
3
|
+
import type { IFilterMenuConfig, IFilterMenuParam } from './filter-menu.types';
|
|
4
|
+
import type { IFieldValidateConfig } from '../form/validator';
|
|
1
5
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* - Use ISO date strings or a discriminated union if date/serialization handling is needed.
|
|
6
|
-
* @vi
|
|
7
|
-
* - Gia tri nguyen thuy hop le cho cac field filter.
|
|
8
|
-
* - Kieu runtime: string, number, boolean.
|
|
9
|
-
* - Neu can xu ly Date qua mang/serialize thi dung chuoi ISO hoac discriminated union.
|
|
6
|
+
* Allowed primitive values for filter fields.
|
|
7
|
+
* Runtime types: string, number, boolean.
|
|
8
|
+
* Use ISO date strings or a discriminated union if date/serialization handling is needed.
|
|
10
9
|
*/
|
|
11
10
|
export type TFieldValid = string | number | boolean;
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* - Kept as const so `TypeScript` preserves literal types.
|
|
16
|
-
* @vi
|
|
17
|
-
* - Khoa filter dac biet cho UI (vi dụ: quickSearch).
|
|
18
|
-
* - Giu const de `TypeScript` giu literal types.
|
|
12
|
+
* Special UI-only filter keys (e.g. quickSearch, sortShuffle).
|
|
13
|
+
* Kept as const so `TypeScript` preserves literal types.
|
|
19
14
|
*/
|
|
20
15
|
export declare const KeySpecial: {
|
|
21
16
|
readonly quickSearch: "quickSearch";
|
|
@@ -23,80 +18,159 @@ export declare const KeySpecial: {
|
|
|
23
18
|
};
|
|
24
19
|
export type KeySpecial = keyof typeof KeySpecial;
|
|
25
20
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* - Purpose: allow filters to reference either a model property or a special UI key.
|
|
29
|
-
* @vi
|
|
30
|
-
* - Tap hop cac khoa cua model va cac khoa filter dac biet cho he thong filter.
|
|
31
|
-
* - Muc dich: cho phep filter tham chieu truong model hoac key UI dac biet.
|
|
21
|
+
* Union of model field keys and special filter keys used by the filter system.
|
|
22
|
+
* Purpose: allow filters to reference either a model property or a special UI key.
|
|
32
23
|
*/
|
|
33
24
|
export type TFieldType<T> = keyof T | keyof typeof KeySpecial;
|
|
25
|
+
/**
|
|
26
|
+
* Merge external model with special filter keys so filters can reference both for safe typing.
|
|
27
|
+
*/
|
|
28
|
+
export type TFieldModelValid<T> = T & Record<keyof typeof KeySpecial, any>;
|
|
29
|
+
/**
|
|
30
|
+
* Parameters passed to `TValueFormatter` callback for custom value display formatting.
|
|
31
|
+
*/
|
|
34
32
|
export type TValueFormatterParam<T> = {
|
|
33
|
+
/** Field key being formatted */
|
|
35
34
|
key: TFieldType<T>;
|
|
35
|
+
/** Current primitive value item */
|
|
36
36
|
value: TFieldValid;
|
|
37
|
+
/** Index of the value within the field's values array */
|
|
37
38
|
index: number;
|
|
39
|
+
/** Complete field value state */
|
|
38
40
|
fieldValue: TFieldValue;
|
|
39
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Custom formatter callback function for converting raw field values to user-facing display strings.
|
|
44
|
+
*/
|
|
40
45
|
export type TValueFormatter<T> = (param: TValueFormatterParam<T>) => string | undefined;
|
|
41
46
|
/**
|
|
42
|
-
*
|
|
43
|
-
* - Merge external model with special filter keys so filters can reference both.
|
|
44
|
-
* - Purpose: extend a model type with UI special keys (e.g. quickSearch) for safe typing.
|
|
45
|
-
* @vi
|
|
46
|
-
* - Gop model ngoai voi cac key filter dac biet de filter co the tham chieu ca hai.
|
|
47
|
-
* - Muc dich: mo rong kieu model de chua cac key UI (vd quickSearch) de type an toan.
|
|
47
|
+
* Configuration options for rendering active filter summary chips.
|
|
48
48
|
*/
|
|
49
|
-
export
|
|
49
|
+
export interface ISummaryChipConfig {
|
|
50
|
+
/** Mode for rendering chips: 'single' collapses all values into 1 chip, 'multiple' renders separate chips per value. @default 'multiple' */
|
|
51
|
+
mode?: 'single' | 'multiple';
|
|
52
|
+
/** Separator string used when mode is 'single'. @default ', ' */
|
|
53
|
+
separator?: string;
|
|
54
|
+
/** Minimum CSS width for the summary chip */
|
|
55
|
+
minWidth?: number | string;
|
|
56
|
+
}
|
|
57
|
+
export type { IFilterMenuConfig } from './filter-menu.types';
|
|
58
|
+
/**
|
|
59
|
+
* Field-level sorting configuration options.
|
|
60
|
+
*/
|
|
61
|
+
export interface ISortFieldConfig {
|
|
62
|
+
/** Default direction for field sorting ('asc' | 'desc') @default 'desc' */
|
|
63
|
+
defaultDirection?: TDirection;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Unified field configuration schema for FilterBar.
|
|
67
|
+
* Each field is declared once with feature activation flags and sub-component specifics.
|
|
68
|
+
*/
|
|
69
|
+
export type TFilterFieldConfig<T> = {
|
|
70
|
+
/** Display label for the field across all components */
|
|
71
|
+
label?: string;
|
|
72
|
+
/** Category group name for visual section grouping in dropdowns */
|
|
73
|
+
group?: string;
|
|
74
|
+
/** Global visibility toggle. If false, field is hidden from all menus. @default true */
|
|
75
|
+
visible?: boolean;
|
|
76
|
+
/** If true, only 1 value is allowed at a time; submitting a new value replaces the previous one. @default false */
|
|
77
|
+
singleValue?: boolean;
|
|
78
|
+
/** Default logical operator ('and' | 'or') within this field's values. @default 'or' */
|
|
79
|
+
defaultLogic?: TLogic;
|
|
80
|
+
/** Custom formatter function for converting raw field values into display strings */
|
|
81
|
+
valueFormatter?: TValueFormatter<T>;
|
|
82
|
+
/** Enables field suggestion in Quick Input bar @default false */
|
|
83
|
+
inputable?: boolean;
|
|
84
|
+
/** Matching rules or keyword patterns for Quick Input parsing */
|
|
85
|
+
inputMatch?: TFieldMatch | TFieldMatch[];
|
|
86
|
+
/** Enables field entry in Sort dropdown @default false */
|
|
87
|
+
sortable?: boolean;
|
|
88
|
+
/** Enables field menu item in Filter Menu popover @default false */
|
|
89
|
+
menuable?: boolean;
|
|
90
|
+
/** Custom React component for editing this field inside the filter menu form view */
|
|
91
|
+
MenuForm?: ComponentType<any>;
|
|
92
|
+
/** Specific options for Filter Menu item and subMenu form behavior */
|
|
93
|
+
menuConfig?: IFilterMenuConfig<T>;
|
|
94
|
+
/** Field-level validation configuration for default menu form */
|
|
95
|
+
menuValidation?: IFieldValidateConfig<Partial<TFieldModelValid<T>>>;
|
|
96
|
+
/** Specific options for active summary chips representation */
|
|
97
|
+
summaryConfig?: ISummaryChipConfig;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Dictionary map of field configurations indexed by field key.
|
|
101
|
+
*/
|
|
102
|
+
export type TFilterFieldConfigs<T> = Partial<Record<TFieldType<T>, TFilterFieldConfig<T>>>;
|
|
50
103
|
/**
|
|
51
|
-
*
|
|
52
|
-
|
|
104
|
+
* Root configuration for FilterBar instance creation.
|
|
105
|
+
*/
|
|
106
|
+
export type TFilterBarConfigs<T> = {
|
|
107
|
+
/** Map of unified field configurations indexed by field key */
|
|
108
|
+
fields?: TFilterFieldConfigs<T>;
|
|
109
|
+
/** Initial default filter state containing active filters and sort directions */
|
|
110
|
+
defaultFilterState?: TFilterState<T>;
|
|
111
|
+
/** Default logical operator ('and' | 'or') for combining active field filters @default 'or' */
|
|
112
|
+
defaultFilterLogic?: TLogic;
|
|
113
|
+
/** Debounce delay in milliseconds for filter input state updates @default 300 */
|
|
114
|
+
debounceDelay?: number;
|
|
115
|
+
/** Configuration options for the Filter Input component */
|
|
116
|
+
inputConfig?: IFilterInputConfig<T>;
|
|
117
|
+
/** Configuration options for the Filter Menu component */
|
|
118
|
+
menuConfig?: Omit<IFilterMenuParam<T>, 'fields'>;
|
|
119
|
+
/** Toggle active summary chips bar below the filter bar @default true */
|
|
120
|
+
enableSummary?: boolean;
|
|
121
|
+
/** Toggle quick search pseudo-field in filter menu @default false */
|
|
122
|
+
enableQuickSearch?: boolean;
|
|
123
|
+
/** Specific options for Field Sorting behavior */
|
|
124
|
+
sortConfig?: ISortFieldConfig;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Sorting direction for fields ('asc' | 'desc').
|
|
53
128
|
*/
|
|
54
129
|
export type TDirection = 'asc' | 'desc';
|
|
55
130
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @vi Giao dien de dinh nghia cach sap xep tren mot truong.
|
|
131
|
+
* Interface for defining active sorting state on a field.
|
|
58
132
|
*/
|
|
59
133
|
export type TFieldSort<T> = {
|
|
134
|
+
/** Field key being sorted */
|
|
60
135
|
field: TFieldType<T>;
|
|
61
|
-
/** Sorting direction
|
|
136
|
+
/** Sorting direction ('asc' | 'desc') @default 'desc' */
|
|
62
137
|
direction?: TDirection;
|
|
63
138
|
};
|
|
64
139
|
/**
|
|
65
|
-
*
|
|
66
|
-
* @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.
|
|
140
|
+
* Logical operator for combining filters or values ('and' | 'or').
|
|
67
141
|
*/
|
|
68
142
|
export type TLogic = 'and' | 'or';
|
|
143
|
+
/**
|
|
144
|
+
* Specific date filter logical condition ('before' | 'after' | 'range').
|
|
145
|
+
*/
|
|
69
146
|
export type TDateLogic = 'before' | 'after' | 'range';
|
|
147
|
+
/**
|
|
148
|
+
* Numeric comparison operator ('eq' | 'lt' | 'lte' | 'gt' | 'gte').
|
|
149
|
+
*/
|
|
70
150
|
export type TNumberOperator = 'eq' | 'lt' | 'lte' | 'gt' | 'gte';
|
|
71
151
|
/**
|
|
72
|
-
*
|
|
73
|
-
* - Structure for storing filter values and their logical relationship (AND/OR) for each field.
|
|
74
|
-
* @vi
|
|
75
|
-
* - Cau truc de luu tru cac gia tri filter va moi quan he logic (AND/OR) cho moi field.
|
|
152
|
+
* Structure for storing active filter values and logical relationship for a single field.
|
|
76
153
|
*/
|
|
77
154
|
export type TFieldValue = {
|
|
78
|
-
/** Logical operator for combining values within this field
|
|
155
|
+
/** Logical operator for combining values within this field ('and' | 'or') @default 'or' */
|
|
79
156
|
logic?: TLogic;
|
|
80
|
-
/** Logical operator for date-specific filtering
|
|
157
|
+
/** Logical operator for date-specific filtering ('before' | 'after' | 'range') */
|
|
81
158
|
dateLogic?: TDateLogic;
|
|
159
|
+
/** Array of active filter values */
|
|
82
160
|
values: TFieldValid[];
|
|
83
161
|
};
|
|
84
162
|
/**
|
|
85
|
-
*
|
|
86
|
-
* - Type for storing active filters in the filter state, mapping field keys to their filter values.
|
|
87
|
-
* @vi
|
|
88
|
-
* - Kieu de luu tru cac filter dang hoat dong trong filter state, map cac khoa field voi gia tri filter cua chung.
|
|
163
|
+
* Dictionary storing active field filter states mapped by field key.
|
|
89
164
|
*/
|
|
90
165
|
export type TFieldStore<T> = Partial<Record<TFieldType<T>, TFieldValue>>;
|
|
91
166
|
/**
|
|
92
|
-
*
|
|
93
|
-
* - Overall filter state structure, including the logical operator for combining filters and optional storage for active filters and sorting.
|
|
94
|
-
* @vi
|
|
95
|
-
* - Cau truc tong the cho filter state, bao gom toan tu logic de ket hop cac filter va luu tru tuy chon cho cac filter dang hoat dong va sap xep.
|
|
167
|
+
* Complete filter state structure including global logic, stored filters, and active sort.
|
|
96
168
|
*/
|
|
97
169
|
export type TFilterState<T> = {
|
|
98
|
-
/** Logical operator for combining filters
|
|
170
|
+
/** Logical operator for combining active field filters ('and' | 'or') @default 'or' */
|
|
99
171
|
filterLogic?: TLogic;
|
|
172
|
+
/** Active filter values stored by field key */
|
|
100
173
|
storeFilter?: TFieldStore<T>;
|
|
174
|
+
/** Active sort configuration */
|
|
101
175
|
storeSort?: TFieldSort<T>;
|
|
102
176
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
1
|
import { IFormInputBase } from './types';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
3
|
export interface IAutocompleteChipSlots {
|
|
4
4
|
optionItems?: string[];
|
|
5
5
|
limitTags?: number;
|
|
@@ -12,5 +12,5 @@ export interface IAutocompleteChipState {
|
|
|
12
12
|
value: string[];
|
|
13
13
|
options: string[];
|
|
14
14
|
}
|
|
15
|
-
declare function
|
|
16
|
-
export default
|
|
15
|
+
export declare function createAutocompleteChips<T>(params?: IAutocompleteChipSlots): ComponentType<IAutocompleteChipProps<T>>;
|
|
16
|
+
export default createAutocompleteChips;
|
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
2
|
-
import { BoxProps, CheckboxProps, TypographyProps } from '@mui/material';
|
|
3
1
|
import { IFormInputBase } from './types';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import type { BoxProps, CheckboxProps, TypographyProps } from '@mui/material';
|
|
4
|
+
/** Position of the checkbox button relative to its label/description text. */
|
|
5
|
+
export type TCheckboxPosition = 'left' | 'right';
|
|
6
|
+
/** Common configuration options for DinoCheckbox layout and behavior. */
|
|
7
|
+
export interface ICheckboxOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Position of the checkbox button relative to the label/description text.
|
|
10
|
+
* @default 'left'
|
|
11
|
+
*/
|
|
12
|
+
checkboxPosition?: TCheckboxPosition;
|
|
13
|
+
/**
|
|
14
|
+
* Stretch the checkbox container to take up 100% of the parent container's width.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Secondary description text rendered directly below the main label.
|
|
20
|
+
* When provided, renders a modern thin border card container around the field.
|
|
21
|
+
*/
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Slots configuration interface for DinoCheckbox sub-components. */
|
|
4
25
|
export interface ICheckboxSlots {
|
|
26
|
+
/** Props forwarded to the root wrapper container Box. */
|
|
5
27
|
wrapProps?: BoxProps;
|
|
28
|
+
/** Props forwarded to the underlying checkbox element. */
|
|
6
29
|
checkboxProps?: CheckboxProps;
|
|
30
|
+
/** Props forwarded to the primary label Typography component. */
|
|
7
31
|
labelProps?: TypographyProps;
|
|
8
32
|
}
|
|
9
|
-
|
|
33
|
+
/** Props for the DinoCheckbox component instance. */
|
|
34
|
+
export interface ICheckboxProps<T = any> extends IFormInputBase<T, ICheckboxSlots>, ICheckboxOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Callback function triggered when the checkbox state changes.
|
|
37
|
+
* @param checked Current boolean state of the checkbox
|
|
38
|
+
*/
|
|
10
39
|
onChange?: (checked: boolean) => void;
|
|
11
40
|
}
|
|
41
|
+
/** Internal state interface for DinoCheckbox. */
|
|
12
42
|
export interface ICheckboxState {
|
|
43
|
+
/** Indicates whether the checkbox is currently checked. */
|
|
13
44
|
checked: boolean;
|
|
14
45
|
}
|
|
15
|
-
|
|
46
|
+
/** Factory configuration parameters passed into `createCheckbox()`. */
|
|
47
|
+
export interface ICheckboxParams<T = any> extends ICheckboxSlots, ICheckboxOptions {
|
|
16
48
|
}
|
|
17
49
|
/** Standard class names for styling DinoCheckbox sub-components. */
|
|
18
50
|
export declare const checkboxClasses: {
|
|
@@ -20,9 +52,14 @@ export declare const checkboxClasses: {
|
|
|
20
52
|
row: string;
|
|
21
53
|
box: string;
|
|
22
54
|
label: string;
|
|
55
|
+
description: string;
|
|
56
|
+
labelWrap: string;
|
|
23
57
|
error: string;
|
|
24
58
|
checked: string;
|
|
25
59
|
disabled: string;
|
|
60
|
+
fullWidth: string;
|
|
61
|
+
hasDescription: string;
|
|
62
|
+
posRight: string;
|
|
26
63
|
};
|
|
27
64
|
/**
|
|
28
65
|
* Modern Custom Styled Checkbox Component Creator for Boolean fields in DinoForm V2.
|
|
@@ -33,7 +70,7 @@ export declare const checkboxClasses: {
|
|
|
33
70
|
* @formField({
|
|
34
71
|
* type: Boolean,
|
|
35
72
|
* label: 'Same as billing address',
|
|
36
|
-
* renderInput: DinoForm.createCheckbox()
|
|
73
|
+
* renderInput: DinoForm.createCheckbox({ description: 'Use shipping address for billing', checkboxPosition: 'right' })
|
|
37
74
|
* })
|
|
38
75
|
* isSameBilling?: boolean
|
|
39
76
|
*/
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { ChangeEventHandler } from 'react';
|
|
2
2
|
import { IFormInputBase } from './types';
|
|
3
3
|
export interface IColorPickerProps<T> extends IFormInputBase<T> {
|
|
4
|
+
onChange?: (value: string) => void;
|
|
4
5
|
}
|
|
5
6
|
export interface IColorPickerState {
|
|
6
|
-
|
|
7
|
+
displayValue: string;
|
|
8
|
+
actualValue: string;
|
|
9
|
+
formatMode: 'hex' | 'rgb';
|
|
7
10
|
}
|
|
8
11
|
export declare function createColorPicker<T>(): {
|
|
9
12
|
new (props: IColorPickerProps<T>): {
|
|
10
|
-
|
|
13
|
+
componentDidUpdate(prevProps: IColorPickerProps<T>): void;
|
|
14
|
+
getHexColor(val: string): string;
|
|
11
15
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
12
16
|
getDefaultValue(currentProps: IColorPickerProps<T>): string;
|
|
17
|
+
toggleFormat: () => void;
|
|
13
18
|
handleColorChange: ChangeEventHandler<HTMLInputElement>;
|
|
14
19
|
handleInputChange: ChangeEventHandler<HTMLInputElement>;
|
|
15
20
|
handleBlur: () => void;
|
|
16
21
|
context: unknown;
|
|
17
|
-
setState<K extends
|
|
22
|
+
setState<K extends keyof IColorPickerState>(state: IColorPickerState | ((prevState: Readonly<IColorPickerState>, props: Readonly<IColorPickerProps<T>>) => IColorPickerState | Pick<IColorPickerState, K> | null) | Pick<IColorPickerState, K> | null, callback?: (() => void) | undefined): void;
|
|
18
23
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
19
24
|
readonly props: Readonly<IColorPickerProps<T>>;
|
|
20
25
|
state: Readonly<IColorPickerState>;
|
|
@@ -22,10 +27,10 @@ export declare function createColorPicker<T>(): {
|
|
|
22
27
|
[key: string]: import("react").ReactInstance;
|
|
23
28
|
};
|
|
24
29
|
componentDidMount?(): void;
|
|
30
|
+
shouldComponentUpdate?(nextProps: Readonly<IColorPickerProps<T>>, nextState: Readonly<IColorPickerState>, nextContext: any): boolean;
|
|
25
31
|
componentWillUnmount?(): void;
|
|
26
32
|
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
27
33
|
getSnapshotBeforeUpdate?(prevProps: Readonly<IColorPickerProps<T>>, prevState: Readonly<IColorPickerState>): any;
|
|
28
|
-
componentDidUpdate?(prevProps: Readonly<IColorPickerProps<T>>, prevState: Readonly<IColorPickerState>, snapshot?: any): void;
|
|
29
34
|
componentWillMount?(): void;
|
|
30
35
|
UNSAFE_componentWillMount?(): void;
|
|
31
36
|
componentWillReceiveProps?(nextProps: Readonly<IColorPickerProps<T>>, nextContext: any): void;
|
|
@@ -17,5 +17,5 @@ interface IDateExpiredConfig<T> extends ISlots<T> {
|
|
|
17
17
|
interface IProps<T> extends IFormInputBase<T>, IDateExpiredConfig<T> {
|
|
18
18
|
slots?: ISlots<T>;
|
|
19
19
|
}
|
|
20
|
-
declare function
|
|
21
|
-
export default
|
|
20
|
+
export declare function createDateExpired<T>(param?: IDateExpiredConfig<T>): React.ComponentType<IProps<T>>;
|
|
21
|
+
export default createDateExpired;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ButtonProps } from '@mui/material';
|
|
2
|
+
import type { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
2
3
|
export interface IFormComfirmParam<T> {
|
|
3
|
-
title?:
|
|
4
|
-
content: (value?: T) =>
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
content: (value?: T) => ReactNode;
|
|
5
6
|
colors?: {
|
|
6
|
-
|
|
7
|
-
no?: 'inherit' | 'error' | 'primary' | 'secondary' | 'success' | 'info' | 'warning';
|
|
7
|
+
[key in 'yes' | 'no']?: ButtonProps['color'];
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export interface IFormComfirmProps<T> {
|
|
10
|
+
export interface IFormComfirmProps<T> extends PropsWithChildren {
|
|
11
11
|
data?: T;
|
|
12
|
-
title?:
|
|
12
|
+
title?: ReactNode;
|
|
13
13
|
onSubmit: (value?: T) => Promise<void>;
|
|
14
14
|
onCancel?: () => void;
|
|
15
15
|
}
|
|
16
16
|
export interface IFormComfirmState {
|
|
17
17
|
loading?: boolean;
|
|
18
18
|
}
|
|
19
|
-
declare
|
|
20
|
-
export default
|
|
19
|
+
export declare function createFormComfirm<T = any>(param?: IFormComfirmParam<T>): ComponentType<IFormComfirmProps<T>>;
|
|
20
|
+
export default createFormComfirm;
|
|
@@ -3,9 +3,7 @@ import { ComponentType, ReactNode } from 'react';
|
|
|
3
3
|
import { IFormInputBase } from './types';
|
|
4
4
|
/** Supported operation modes for the file input component. */
|
|
5
5
|
export type IInputFileMode = 'file' | 'image' | 'csv';
|
|
6
|
-
/**
|
|
7
|
-
* Slots and customizable parameters for file input components.
|
|
8
|
-
*/
|
|
6
|
+
/** Slots and customizable parameters for file input components. */
|
|
9
7
|
export interface IInputFileSlots<T = any> {
|
|
10
8
|
/** Custom BoxProps passed to the outer wrapper container. */
|
|
11
9
|
wrapProps?: BoxProps;
|
|
@@ -30,9 +28,7 @@ export interface IInputFileSlots<T = any> {
|
|
|
30
28
|
/** Async upload function for mode 'image'. Returns remote image URL string. */
|
|
31
29
|
upload?: (file: File, data?: Partial<T>) => Promise<string | null>;
|
|
32
30
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Props passed to the rendered file input component.
|
|
35
|
-
*/
|
|
31
|
+
/** Props passed to the rendered file input component. */
|
|
36
32
|
export interface IInputFileProps<T> extends IFormInputBase<T, IInputFileSlots<T>> {
|
|
37
33
|
/** Mode of operation: 'file' (generic), 'image' (with preview/upload), 'csv' (local CSV parser). */
|
|
38
34
|
mode?: IInputFileMode;
|
|
@@ -49,6 +45,7 @@ export interface IInputFileProps<T> extends IFormInputBase<T, IInputFileSlots<T>
|
|
|
49
45
|
/** Tooltip configuration panel. */
|
|
50
46
|
tooltip?: any;
|
|
51
47
|
}
|
|
48
|
+
/** File Input Component Internal State */
|
|
52
49
|
export interface IInputFileState {
|
|
53
50
|
isDragOver: boolean;
|
|
54
51
|
selectedFiles: File[];
|
|
@@ -57,9 +54,7 @@ export interface IInputFileState {
|
|
|
57
54
|
isParsingCsv?: boolean;
|
|
58
55
|
isUploading?: boolean;
|
|
59
56
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Parameters passed to `createInputFile` factory function.
|
|
62
|
-
*/
|
|
57
|
+
/** Parameters passed to `createInputFile` factory function. */
|
|
63
58
|
export interface IInputFileParams<T = any> extends IInputFileSlots<T> {
|
|
64
59
|
/** Mode of operation: 'file' | 'image' | 'csv'. Defaults to 'file' or auto-detection. */
|
|
65
60
|
mode?: IInputFileMode;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
3
|
+
import { IFormInputBase } from './types';
|
|
4
|
+
import { inputObjectClasses } from './create.input.object.styled';
|
|
5
|
+
export { inputObjectClasses };
|
|
6
|
+
/** Option entry for select input dropdown. */
|
|
7
|
+
export interface ISelectOption {
|
|
8
|
+
value: string | number;
|
|
9
|
+
/** Display label for the option. Defaults to value if omitted. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
interface INumberInputOptions {
|
|
13
|
+
min?: number;
|
|
14
|
+
max?: number;
|
|
15
|
+
step?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Configuration for an individual field column in an object row. */
|
|
18
|
+
export interface IInputObjectField<J = any> {
|
|
19
|
+
label?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
/** @default 'string' */
|
|
22
|
+
inputType?: 'string' | 'number' | 'select';
|
|
23
|
+
/** @default [] */
|
|
24
|
+
selectItems?: ISelectOption[] | ((item: Partial<J>) => ISelectOption[]);
|
|
25
|
+
numberOptions?: INumberInputOptions | ((item: Partial<J>) => INumberInputOptions);
|
|
26
|
+
/** @default '' */
|
|
27
|
+
defaultValue?: any;
|
|
28
|
+
/**
|
|
29
|
+
* Determine the flex layout space the field occupies.
|
|
30
|
+
* Can be a number, string, or a function evaluating the current row item values.
|
|
31
|
+
* @default 1
|
|
32
|
+
*/
|
|
33
|
+
flex?: number | string | ((item: Partial<J>) => number | string);
|
|
34
|
+
/**
|
|
35
|
+
* Determine if the field should be disabled.
|
|
36
|
+
* Can be a boolean or a function evaluating the current row item values.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean | ((item: Partial<J>) => boolean);
|
|
40
|
+
/**
|
|
41
|
+
* Determine if the field should be visible.
|
|
42
|
+
* Can be a boolean or a function evaluating the current row item values.
|
|
43
|
+
* If false, the field will not be rendered (returns null).
|
|
44
|
+
* @default true
|
|
45
|
+
*/
|
|
46
|
+
visible?: boolean | ((item: Partial<J>) => boolean);
|
|
47
|
+
/**
|
|
48
|
+
* End icon for the input.
|
|
49
|
+
* Can be a ReactNode or a function evaluating the current row item values.
|
|
50
|
+
* @default undefined
|
|
51
|
+
*/
|
|
52
|
+
endIcon?: ReactNode | ((item: Partial<J>) => ReactNode);
|
|
53
|
+
}
|
|
54
|
+
/** Field configuration map for row item model J. */
|
|
55
|
+
export type IInputObjectFields<J = any> = {
|
|
56
|
+
[key in keyof J]?: IInputObjectField<J>;
|
|
57
|
+
};
|
|
58
|
+
/** Internal row item state wrapper. */
|
|
59
|
+
export interface IInputObjectItem<J = any> {
|
|
60
|
+
id: string;
|
|
61
|
+
values: Partial<J>;
|
|
62
|
+
}
|
|
63
|
+
/** Customizable slots and options for InputObject component. */
|
|
64
|
+
export interface IInputObjectSlots<J = any> {
|
|
65
|
+
/** @default 'Object Registry' */
|
|
66
|
+
title?: string;
|
|
67
|
+
/** @default 'Manage dynamic object entries.' */
|
|
68
|
+
subtitle?: string;
|
|
69
|
+
/** @default 'Add Item' */
|
|
70
|
+
addButtonText?: string;
|
|
71
|
+
/** @default 'No items added' */
|
|
72
|
+
emptyTitle?: string;
|
|
73
|
+
/** @default 'Click button above to add a new item.' */
|
|
74
|
+
emptySubtitle?: string;
|
|
75
|
+
wrapProps?: BoxProps;
|
|
76
|
+
/** @default <CategoryOutlinedIcon /> */
|
|
77
|
+
icon?: ReactNode;
|
|
78
|
+
fields?: IInputObjectFields<J>;
|
|
79
|
+
/** Optional maximum number of object row items allowed. */
|
|
80
|
+
maxItems?: number;
|
|
81
|
+
}
|
|
82
|
+
/** Parameters passed to createInputObject factory function. */
|
|
83
|
+
export interface IInputObjectParams<J = any> extends IInputObjectSlots<J> {
|
|
84
|
+
fields?: IInputObjectFields<J>;
|
|
85
|
+
}
|
|
86
|
+
/** Props accepted by the generated InputObject component. */
|
|
87
|
+
export interface IInputObjectProps<T = any, J = any> extends IFormInputBase<T, IInputObjectSlots<J>> {
|
|
88
|
+
onChange?: (value: string) => void;
|
|
89
|
+
fields?: IInputObjectFields<J>;
|
|
90
|
+
maxItems?: number;
|
|
91
|
+
}
|
|
92
|
+
export declare function createInputObject<T = any, J = any>(params?: IInputObjectParams<J>): ComponentType<IInputObjectProps<T, J>>;
|
|
93
|
+
export default createInputObject;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const inputObjectClasses: {
|
|
3
|
+
root: string;
|
|
4
|
+
label: string;
|
|
5
|
+
card: string;
|
|
6
|
+
header: string;
|
|
7
|
+
headerContent: string;
|
|
8
|
+
title: string;
|
|
9
|
+
titleIcon: string;
|
|
10
|
+
subtitle: string;
|
|
11
|
+
createBtn: string;
|
|
12
|
+
rowList: string;
|
|
13
|
+
row: string;
|
|
14
|
+
field: string;
|
|
15
|
+
deleteBtn: string;
|
|
16
|
+
noDataPanel: string;
|
|
17
|
+
noDataIcon: string;
|
|
18
|
+
noDataTitle: string;
|
|
19
|
+
noDataSubtitle: string;
|
|
20
|
+
errorHelperText: string;
|
|
21
|
+
error: string;
|
|
22
|
+
disabled: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const RootStyled: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
25
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
26
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
27
|
+
export declare const CreateButtonStyled: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
28
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
+
}, "classes" | "className" | "style" | "children" | "sx" | "variant" | "tabIndex" | "color" | "action" | "href" | "disabled" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
30
|
+
export declare const StyledTextField: import("@emotion/styled").StyledComponent<{
|
|
31
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
32
|
+
} & Omit<import("@mui/material").StandardTextFieldProps | import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -46,10 +46,7 @@ export interface IFieldMetadata<T = any, O = {}> {
|
|
|
46
46
|
placeholder?: string;
|
|
47
47
|
/** Default value for the field */
|
|
48
48
|
defaultValue?: any;
|
|
49
|
-
/**
|
|
50
|
-
* Type constructor or type identifier for the field.
|
|
51
|
-
* @default 'string'
|
|
52
|
-
*/
|
|
49
|
+
/** Type constructor or type identifier for the field. @default 'string' */
|
|
53
50
|
type?: any;
|
|
54
51
|
/** Grid sizing configuration or factory function based on form state */
|
|
55
52
|
sizes?: ISizes | ((data?: T, formState?: Partial<T>) => ISizes);
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import FormValidator from './validator';
|
|
3
|
+
import createFormComfirm from './create.form-comfirm';
|
|
3
4
|
import createCheckbox from './create.checkbox';
|
|
4
5
|
import createInputFile from './create.input.file';
|
|
5
6
|
import createDatePickerV2 from './v2/create.date-picker';
|
|
6
7
|
import createColorPicker from './create.color-picker';
|
|
7
8
|
import createColorPickerV2 from './v2/create.color-picker';
|
|
8
|
-
import
|
|
9
|
+
import createDateExpired from './create.date-expired';
|
|
9
10
|
import createDateExpiredV2 from './v2/create.date-expired';
|
|
10
11
|
import createSelectSimple from './create.select-simple';
|
|
11
12
|
import createSelectSimpleV2 from './v2/create.select-simple';
|
|
12
13
|
import createSelectWithApi from './create.select-with-api';
|
|
13
14
|
import createSelectWithApiV2 from './v2/create.select-with-api';
|
|
14
|
-
import
|
|
15
|
+
import createAutocompleteChips from './create.autocomplete.chips';
|
|
15
16
|
import createAutocompleteChipV2 from './v2/create.autocomplete.chips';
|
|
17
|
+
import createInputObject from './create.input.object';
|
|
16
18
|
export declare class DinoForm {
|
|
17
19
|
ModalWrap: import("react").FC<import("./modal-wrapper").IFormModalWrapperProps>;
|
|
18
20
|
BottomBarWrap: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -21,16 +23,16 @@ export declare class DinoForm {
|
|
|
21
23
|
FormValidator: typeof FormValidator;
|
|
22
24
|
validator: <T>(configs: import("./validator").IFormValidatorConfig<T>) => FormValidator<T>;
|
|
23
25
|
createFormBase: <T>(config?: import("./create.form-base").IFormBaseConfig<T> | undefined) => import("./create.form-base").IFormBaseResult<T>;
|
|
24
|
-
createFormComfirm:
|
|
26
|
+
createFormComfirm: typeof createFormComfirm;
|
|
25
27
|
createFormGridLayout: <T>(params: import("./create.form-grid-layout").IFormGridLayoutParams<T>) => import("react").ComponentType<import("./create.form-grid-layout").IFormGridLayoutProps<T>>;
|
|
26
28
|
createDecoratorForm: <T>(configClass?: any, config?: Partial<Omit<import("./decorator.form").IDecoratorFormProps<T>, "configClass">> | undefined) => import("react").ComponentType<import("./decorator.form").IDecoratorFormProps<T>>;
|
|
27
29
|
createColorPicker: typeof createColorPicker;
|
|
28
30
|
createColorPickerV2: typeof createColorPickerV2;
|
|
29
|
-
createDateExpired: typeof
|
|
31
|
+
createDateExpired: typeof createDateExpired;
|
|
30
32
|
createDateExpiredV2: typeof createDateExpiredV2;
|
|
31
33
|
createDatePicker: <T extends Object>(params?: import("./create.date-picker").IDatePickerSlots | undefined) => import("react").ComponentType<import("./create.date-picker").IDatePickerProps<T>>;
|
|
32
34
|
createDatePickerV2: typeof createDatePickerV2;
|
|
33
|
-
createAutocompleteChip: typeof
|
|
35
|
+
createAutocompleteChip: typeof createAutocompleteChips;
|
|
34
36
|
createAutocompleteChipV2: typeof createAutocompleteChipV2;
|
|
35
37
|
createInputFile: typeof createInputFile;
|
|
36
38
|
createInput: <T>(params?: import("./create.input").IInputParams<T> | undefined) => import("react").ComponentType<import("./create.input").IInputProps<T>>;
|
|
@@ -40,6 +42,7 @@ export declare class DinoForm {
|
|
|
40
42
|
createSelectSimpleV2: typeof createSelectSimpleV2;
|
|
41
43
|
createSelectWithApi: typeof createSelectWithApi;
|
|
42
44
|
createSelectWithApiV2: typeof createSelectWithApiV2;
|
|
45
|
+
createInputObject: typeof createInputObject;
|
|
43
46
|
}
|
|
44
47
|
export default DinoForm;
|
|
45
48
|
export declare const dinoForm: DinoForm;
|
|
@@ -30,4 +30,12 @@ interface IValidateCsvOptions {
|
|
|
30
30
|
export declare const validateCsvModel: <T extends Record<string, any>>(data: T[], requiredKeys: (keyof T)[], options?: IValidateCsvOptions) => IValidateCsv;
|
|
31
31
|
export declare const isValueEqual: (val1: any, val2: any) => boolean;
|
|
32
32
|
export declare function isChanged<T extends Record<string, any>>(value: T, oldValue?: T): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Validates whether a given string matches a specified color format (HEX or RGB/RGBA).
|
|
35
|
+
*
|
|
36
|
+
* @param val - The color string to validate.
|
|
37
|
+
* @param format - The expected format type ('hex' or 'rgb').
|
|
38
|
+
* @returns True if the string matches the format and is within valid ranges, false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
export declare const isValidColorFormat: (val: string, format: 'hex' | 'rgb') => boolean;
|
|
33
41
|
export {};
|