@gnwebsoft/ui 3.0.0 → 3.0.2
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 +688 -0
- package/dist/chunk-4H3AFH7A.js +505 -0
- package/dist/chunk-DE62KYFK.js +122 -0
- package/dist/chunk-DEPJRTVT.js +1 -0
- package/dist/chunk-EBRUE2WR.cjs +493 -0
- package/dist/chunk-FD57PCAC.cjs +1 -0
- package/dist/chunk-H3GQLELL.js +2025 -0
- package/dist/chunk-MVPLBJRK.cjs +1 -0
- package/dist/chunk-OJF67RNM.js +1 -0
- package/dist/chunk-OT7COE7R.cjs +2025 -0
- package/dist/chunk-R2YK4LTT.cjs +122 -0
- package/dist/chunk-U6SDYCWF.js +493 -0
- package/dist/chunk-ZC7FGYL2.cjs +505 -0
- package/dist/components/index.cjs +25 -0
- package/dist/components/index.d.cts +752 -0
- package/dist/components/index.d.ts +664 -15
- package/dist/components/index.js +25 -24
- package/dist/enhanced-z-I7EHVS.d.cts +134 -0
- package/dist/enhanced-z-I7EHVS.d.ts +134 -0
- package/dist/hooks/index.cjs +12 -0
- package/dist/hooks/index.d.cts +95 -0
- package/dist/hooks/index.d.ts +82 -4
- package/dist/hooks/index.js +12 -7
- package/dist/index.cjs +127 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +4 -8
- package/dist/index.js +127 -58
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +241 -0
- package/dist/types/index.d.ts +212 -15
- package/dist/types/index.js +2 -1
- package/dist/utils/index.cjs +45 -0
- package/dist/utils/index.d.cts +366 -0
- package/dist/utils/index.d.ts +317 -10
- package/dist/utils/index.js +45 -22
- package/dist/wrappers/index.cjs +54 -0
- package/dist/wrappers/index.d.cts +1684 -0
- package/dist/wrappers/index.d.ts +1601 -118
- package/dist/wrappers/index.js +54 -8
- package/package.json +139 -92
- package/dist/AsyncSelectPayload-Cz4bgak0.d.mts +0 -10
- package/dist/AsyncSelectPayload-Cz4bgak0.d.ts +0 -10
- package/dist/OptionItem-oN6XnOTJ.d.mts +0 -14
- package/dist/OptionItem-oN6XnOTJ.d.ts +0 -14
- package/dist/chunk-2JFL7TS5.mjs +0 -0
- package/dist/chunk-5HOGPCEO.mjs +0 -1427
- package/dist/chunk-6BGQA4BQ.js +0 -1
- package/dist/chunk-6JZ35VQJ.js +0 -19
- package/dist/chunk-6NOXJGU2.js +0 -1427
- package/dist/chunk-7M2VOCYN.js +0 -1
- package/dist/chunk-BWQUYXUW.mjs +0 -1634
- package/dist/chunk-D3J7MWAU.js +0 -1634
- package/dist/chunk-EVPUCTZA.mjs +0 -0
- package/dist/chunk-FSU3H777.mjs +0 -473
- package/dist/chunk-GFSTK7KN.mjs +0 -19
- package/dist/chunk-I7EIUZKK.js +0 -332
- package/dist/chunk-JKUOV3MN.js +0 -473
- package/dist/chunk-RQS44YC7.mjs +0 -332
- package/dist/components/index.d.mts +0 -103
- package/dist/components/index.mjs +0 -24
- package/dist/hooks/index.d.mts +0 -17
- package/dist/hooks/index.mjs +0 -7
- package/dist/index.d.mts +0 -18
- package/dist/index.mjs +0 -58
- package/dist/types/index.d.mts +0 -44
- package/dist/types/index.mjs +0 -1
- package/dist/utils/index.d.mts +0 -59
- package/dist/utils/index.mjs +0 -22
- package/dist/wrappers/index.d.mts +0 -201
- package/dist/wrappers/index.mjs +0 -8
- package/dist/wrappers2/index.d.mts +0 -247
- package/dist/wrappers2/index.d.ts +0 -247
- package/dist/wrappers2/index.js +0 -8
- package/dist/wrappers2/index.mjs +0 -8
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.cjs';
|
|
2
|
+
export { UseTransformOptions, UseTransformReturn, useTransform } from './hooks/index.cjs';
|
|
3
|
+
export { E as EnhancedUseTransformOptions, a as EnhancedUseTransformReturn, F as FieldType, t as transformFactories, u as useEnhancedTransform } from './enhanced-z-I7EHVS.cjs';
|
|
4
|
+
export { ApiResponse, AsyncMultiSelectPayload, AsyncSelectMultiPayload, AsyncSelectPayload, ListResponse, OperationResponse, OptionItem, OptionItem2, PostModel, ValidationErrors, ValueLabel } from './types/index.cjs';
|
|
5
|
+
export { PathArray, api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools, typedWatch, useWatchBatch, useWatchBoolean, useWatchConditional, useWatchDebounced, useWatchDefault, useWatchField, useWatchFields, useWatchForm, useWatchSelector, useWatchTransform } from './utils/index.cjs';
|
|
6
|
+
export { AsyncMultiSelect2, AsyncMultiSelect2Props, AsyncSelect2Payload, BrandedDate, CheckboxElement, CheckboxElementProps, CheckboxGroup, CheckboxGroupProps, DatePickerElement, DatePickerElementCore, DatePickerElementCoreProps, DatePickerElementGridProps, DatePickerElementProps, DatePickerHookReturn, DatePickerValidationConfig, DateTransform, EnhancedTextFieldElement, EnhancedTextFieldElementProps, Option2Item, OptionObject, PasswordElement, RadioButtonGroup, SelectCascadeElement, SelectElement, SelectMultiElement, TextFieldElement, TimePickerElement, TypedDatePickerSlotProps, UseDatePickerStylesOptions, UseDatePickerStylesReturn, UseDatePickerValidationOptions, UseDatePickerValidationReturn, UseDatePickerValueOptions, UseDatePickerValueReturn, ValidatedDate, createDateInputTransform, createDateOutputTransform, createDefaultDatePickerConfig, createStableKey, extractErrorMessage, isParsableDateString, isValidDate, readDatePickerValueAsDate, useDatePickerStyles, useDatePickerValidation, useDatePickerValue } from './wrappers/index.cjs';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '@mui/material';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'react-hook-form';
|
|
11
|
+
import '@mui/x-data-grid';
|
|
12
|
+
import '@mui/x-date-pickers';
|
|
13
|
+
import '@mui/x-date-pickers/internals';
|
|
14
|
+
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
export { AuthorizedView, CancelButton, ClearButton, FilterButton, FilterWrapper, FormWrapper, LabelText, ListWrapper, SimpleButton, SimpleToolbar } from './components/index.js';
|
|
2
2
|
export { UseTransformOptions, UseTransformReturn, useTransform } from './hooks/index.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { a as AsyncSelectMultiPayload, A as AsyncSelectPayload } from './AsyncSelectPayload-Cz4bgak0.js';
|
|
8
|
-
export { A as AsyncMultiSelectPayload, O as OptionItem, a as OptionItem2 } from './OptionItem-oN6XnOTJ.js';
|
|
3
|
+
export { E as EnhancedUseTransformOptions, a as EnhancedUseTransformReturn, F as FieldType, t as transformFactories, u as useEnhancedTransform } from './enhanced-z-I7EHVS.js';
|
|
4
|
+
export { ApiResponse, AsyncMultiSelectPayload, AsyncSelectMultiPayload, AsyncSelectPayload, ListResponse, OperationResponse, OptionItem, OptionItem2, PostModel, ValidationErrors, ValueLabel } from './types/index.js';
|
|
5
|
+
export { PathArray, api, api2, flattenObjectKeys, getTimezone, handleServerErrors, propertyExists, readValueAsDate, removeLeadingTrailingSlashes, schemaTools, typedWatch, useWatchBatch, useWatchBoolean, useWatchConditional, useWatchDebounced, useWatchDefault, useWatchField, useWatchFields, useWatchForm, useWatchSelector, useWatchTransform } from './utils/index.js';
|
|
6
|
+
export { AsyncMultiSelect2, AsyncMultiSelect2Props, AsyncSelect2Payload, BrandedDate, CheckboxElement, CheckboxElementProps, CheckboxGroup, CheckboxGroupProps, DatePickerElement, DatePickerElementCore, DatePickerElementCoreProps, DatePickerElementGridProps, DatePickerElementProps, DatePickerHookReturn, DatePickerValidationConfig, DateTransform, EnhancedTextFieldElement, EnhancedTextFieldElementProps, Option2Item, OptionObject, PasswordElement, RadioButtonGroup, SelectCascadeElement, SelectElement, SelectMultiElement, TextFieldElement, TimePickerElement, TypedDatePickerSlotProps, UseDatePickerStylesOptions, UseDatePickerStylesReturn, UseDatePickerValidationOptions, UseDatePickerValidationReturn, UseDatePickerValueOptions, UseDatePickerValueReturn, ValidatedDate, createDateInputTransform, createDateOutputTransform, createDefaultDatePickerConfig, createStableKey, extractErrorMessage, isParsableDateString, isValidDate, readDatePickerValueAsDate, useDatePickerStyles, useDatePickerValidation, useDatePickerValue } from './wrappers/index.js';
|
|
9
7
|
import 'react/jsx-runtime';
|
|
10
8
|
import '@mui/material';
|
|
11
9
|
import 'react';
|
|
12
|
-
import '@mui/material/OverridableComponent';
|
|
13
10
|
import 'react-hook-form';
|
|
14
11
|
import '@mui/x-data-grid';
|
|
15
12
|
import '@mui/x-date-pickers';
|
|
16
13
|
import '@mui/x-date-pickers/internals';
|
|
17
14
|
import 'zod';
|
|
18
|
-
import '@mui/x-date-pickers/models';
|
package/dist/index.js
CHANGED
|
@@ -1,58 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
import {
|
|
2
|
+
AuthorizedView_default,
|
|
3
|
+
CancelButton_default,
|
|
4
|
+
ClearButton_default,
|
|
5
|
+
FilterButton_default,
|
|
6
|
+
FilterWrapper_default,
|
|
7
|
+
FormWrapper_default,
|
|
8
|
+
LabelText_default,
|
|
9
|
+
ListWrapper_default,
|
|
10
|
+
SimpleButton_default,
|
|
11
|
+
SimpleToolbar_default
|
|
12
|
+
} from "./chunk-U6SDYCWF.js";
|
|
13
|
+
import "./chunk-OJF67RNM.js";
|
|
14
|
+
import "./chunk-DEPJRTVT.js";
|
|
15
|
+
import {
|
|
16
|
+
api,
|
|
17
|
+
api2,
|
|
18
|
+
flattenObjectKeys,
|
|
19
|
+
getTimezone,
|
|
20
|
+
handleServerErrors,
|
|
21
|
+
propertyExists,
|
|
22
|
+
readValueAsDate,
|
|
23
|
+
removeLeadingTrailingSlashes,
|
|
24
|
+
schemaTools,
|
|
25
|
+
typedWatch,
|
|
26
|
+
useWatchBatch,
|
|
27
|
+
useWatchBoolean,
|
|
28
|
+
useWatchConditional,
|
|
29
|
+
useWatchDebounced,
|
|
30
|
+
useWatchDefault,
|
|
31
|
+
useWatchField,
|
|
32
|
+
useWatchFields,
|
|
33
|
+
useWatchForm,
|
|
34
|
+
useWatchSelector,
|
|
35
|
+
useWatchTransform
|
|
36
|
+
} from "./chunk-4H3AFH7A.js";
|
|
37
|
+
import {
|
|
38
|
+
AsyncMultiSelect2,
|
|
39
|
+
CheckboxElement,
|
|
40
|
+
CheckboxGroup,
|
|
41
|
+
DatePickerElement,
|
|
42
|
+
DatePickerElementCore,
|
|
43
|
+
EnhancedTextFieldElement,
|
|
44
|
+
PasswordElement_default,
|
|
45
|
+
RadioButtonGroup_default,
|
|
46
|
+
SelectCascadeElement_default,
|
|
47
|
+
SelectElement_default,
|
|
48
|
+
SelectMultiElement_default,
|
|
49
|
+
TextFieldElement_default,
|
|
50
|
+
TimePickerElement_default,
|
|
51
|
+
createDateInputTransform,
|
|
52
|
+
createDateOutputTransform,
|
|
53
|
+
createDefaultDatePickerConfig,
|
|
54
|
+
createStableKey,
|
|
55
|
+
extractErrorMessage,
|
|
56
|
+
isParsableDateString,
|
|
57
|
+
isValidDate,
|
|
58
|
+
readDatePickerValueAsDate,
|
|
59
|
+
useDatePickerStyles,
|
|
60
|
+
useDatePickerValidation,
|
|
61
|
+
useDatePickerValue
|
|
62
|
+
} from "./chunk-H3GQLELL.js";
|
|
63
|
+
import {
|
|
64
|
+
transformFactories,
|
|
65
|
+
useEnhancedTransform,
|
|
66
|
+
useTransform
|
|
67
|
+
} from "./chunk-DE62KYFK.js";
|
|
68
|
+
export {
|
|
69
|
+
AsyncMultiSelect2,
|
|
70
|
+
AuthorizedView_default as AuthorizedView,
|
|
71
|
+
CancelButton_default as CancelButton,
|
|
72
|
+
CheckboxElement,
|
|
73
|
+
CheckboxGroup,
|
|
74
|
+
ClearButton_default as ClearButton,
|
|
75
|
+
DatePickerElement,
|
|
76
|
+
DatePickerElementCore,
|
|
77
|
+
EnhancedTextFieldElement,
|
|
78
|
+
FilterButton_default as FilterButton,
|
|
79
|
+
FilterWrapper_default as FilterWrapper,
|
|
80
|
+
FormWrapper_default as FormWrapper,
|
|
81
|
+
LabelText_default as LabelText,
|
|
82
|
+
ListWrapper_default as ListWrapper,
|
|
83
|
+
PasswordElement_default as PasswordElement,
|
|
84
|
+
RadioButtonGroup_default as RadioButtonGroup,
|
|
85
|
+
SelectCascadeElement_default as SelectCascadeElement,
|
|
86
|
+
SelectElement_default as SelectElement,
|
|
87
|
+
SelectMultiElement_default as SelectMultiElement,
|
|
88
|
+
SimpleButton_default as SimpleButton,
|
|
89
|
+
SimpleToolbar_default as SimpleToolbar,
|
|
90
|
+
TextFieldElement_default as TextFieldElement,
|
|
91
|
+
TimePickerElement_default as TimePickerElement,
|
|
92
|
+
api,
|
|
93
|
+
api2,
|
|
94
|
+
createDateInputTransform,
|
|
95
|
+
createDateOutputTransform,
|
|
96
|
+
createDefaultDatePickerConfig,
|
|
97
|
+
createStableKey,
|
|
98
|
+
extractErrorMessage,
|
|
99
|
+
flattenObjectKeys,
|
|
100
|
+
getTimezone,
|
|
101
|
+
handleServerErrors,
|
|
102
|
+
isParsableDateString,
|
|
103
|
+
isValidDate,
|
|
104
|
+
propertyExists,
|
|
105
|
+
readDatePickerValueAsDate,
|
|
106
|
+
readValueAsDate,
|
|
107
|
+
removeLeadingTrailingSlashes,
|
|
108
|
+
schemaTools,
|
|
109
|
+
transformFactories,
|
|
110
|
+
typedWatch,
|
|
111
|
+
useDatePickerStyles,
|
|
112
|
+
useDatePickerValidation,
|
|
113
|
+
useDatePickerValue,
|
|
114
|
+
useEnhancedTransform,
|
|
115
|
+
useTransform,
|
|
116
|
+
useWatchBatch,
|
|
117
|
+
useWatchBoolean,
|
|
118
|
+
useWatchConditional,
|
|
119
|
+
useWatchDebounced,
|
|
120
|
+
useWatchDefault,
|
|
121
|
+
useWatchField,
|
|
122
|
+
useWatchFields,
|
|
123
|
+
useWatchForm,
|
|
124
|
+
useWatchSelector,
|
|
125
|
+
useWatchTransform
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";require('../chunk-FD57PCAC.cjs');
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImQ6XFxQcm9qZWN0c1xcZ253ZWItbW9ub3JlcG9cXHBhY2thZ2VzXFx1aVxcZGlzdFxcdHlwZXNcXGluZGV4LmNqcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSw4Q0FBOEIiLCJmaWxlIjoiRDpcXFByb2plY3RzXFxnbndlYi1tb25vcmVwb1xccGFja2FnZXNcXHVpXFxkaXN0XFx0eXBlc1xcaW5kZXguY2pzIn0=
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { GridSortModel } from '@mui/x-data-grid';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type definition for server validation errors structure.
|
|
5
|
+
*
|
|
6
|
+
* This type represents the format of validation errors returned from server APIs.
|
|
7
|
+
* It supports multiple error formats for each field, allowing flexibility in how
|
|
8
|
+
* validation errors are communicated and processed.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* String error messages:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const errors: ValidationErrors = {
|
|
14
|
+
* email: 'Email is required',
|
|
15
|
+
* username: 'Username must be unique'
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* Array of error messages:
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const errors: ValidationErrors = {
|
|
23
|
+
* password: [
|
|
24
|
+
* 'Password must be at least 8 characters',
|
|
25
|
+
* 'Password must contain at least one number',
|
|
26
|
+
* 'Password must contain at least one special character'
|
|
27
|
+
* ]
|
|
28
|
+
* };
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* Boolean flags for validation state:
|
|
33
|
+
* ```tsx
|
|
34
|
+
* const errors: ValidationErrors = {
|
|
35
|
+
* termsAccepted: false, // Field is invalid
|
|
36
|
+
* emailVerified: true // Field has an error
|
|
37
|
+
* };
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* Structured error objects:
|
|
42
|
+
* ```tsx
|
|
43
|
+
* const errors: ValidationErrors = {
|
|
44
|
+
* dateOfBirth: {
|
|
45
|
+
* key: 'DATE_INVALID',
|
|
46
|
+
* message: 'Date of birth must be in the past'
|
|
47
|
+
* }
|
|
48
|
+
* };
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
interface ValidationErrors {
|
|
54
|
+
[field: string]: string | string[] | boolean | {
|
|
55
|
+
key: string;
|
|
56
|
+
message: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Standardized API response structure for server communications.
|
|
62
|
+
*
|
|
63
|
+
* This type defines the common structure for API responses throughout the application,
|
|
64
|
+
* providing a consistent interface for handling server responses, errors, and data.
|
|
65
|
+
* It follows a standard error response format with optional success data.
|
|
66
|
+
*
|
|
67
|
+
* @template TModel - The type of data contained in the apiData field
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* Success response with data:
|
|
71
|
+
* ```tsx
|
|
72
|
+
* const userResponse: ApiResponse<User> = {
|
|
73
|
+
* status: 200,
|
|
74
|
+
* apiData: {
|
|
75
|
+
* id: 1,
|
|
76
|
+
* name: 'John Doe',
|
|
77
|
+
* email: 'john@example.com'
|
|
78
|
+
* }
|
|
79
|
+
* };
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* Error response with validation errors:
|
|
84
|
+
* ```tsx
|
|
85
|
+
* const errorResponse: ApiResponse<null> = {
|
|
86
|
+
* type: 'validation_error',
|
|
87
|
+
* title: 'Validation failed',
|
|
88
|
+
* status: 400,
|
|
89
|
+
* traceId: 'abc123',
|
|
90
|
+
* errors: {
|
|
91
|
+
* email: 'Email is required',
|
|
92
|
+
* password: ['Too short', 'Must contain numbers']
|
|
93
|
+
* },
|
|
94
|
+
* modelErrors: true
|
|
95
|
+
* };
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
interface ApiResponse<TModel> {
|
|
101
|
+
/**
|
|
102
|
+
* The type or category of the response/error
|
|
103
|
+
* @example "validation_error" | "server_error" | "success"
|
|
104
|
+
*/
|
|
105
|
+
type?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Human-readable title or summary of the response
|
|
108
|
+
* @example "Validation Failed" | "User Created Successfully"
|
|
109
|
+
*/
|
|
110
|
+
title?: string;
|
|
111
|
+
/**
|
|
112
|
+
* HTTP status code of the response
|
|
113
|
+
* @example 200 | 400 | 500
|
|
114
|
+
*/
|
|
115
|
+
status?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Unique identifier for tracing/debugging the request
|
|
118
|
+
* @example "abc123-def456-ghi789"
|
|
119
|
+
*/
|
|
120
|
+
traceId?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Field-specific validation errors
|
|
123
|
+
*/
|
|
124
|
+
errors?: ValidationErrors;
|
|
125
|
+
/**
|
|
126
|
+
* Flag indicating if there are model validation errors
|
|
127
|
+
*/
|
|
128
|
+
modelErrors?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* The actual response data/payload
|
|
131
|
+
*/
|
|
132
|
+
apiData?: TModel;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface AsyncSelectPayload {
|
|
136
|
+
query: string | null;
|
|
137
|
+
initialValue?: string | number | null;
|
|
138
|
+
}
|
|
139
|
+
interface AsyncSelectMultiPayload {
|
|
140
|
+
query: string | null;
|
|
141
|
+
initialValues?: string[] | number[] | null;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Standard option item structure for select components.
|
|
146
|
+
*
|
|
147
|
+
* This type defines the expected structure for option items used in
|
|
148
|
+
* select components throughout the application. It provides a consistent
|
|
149
|
+
* interface with string labels and values.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* Basic usage:
|
|
153
|
+
* ```tsx
|
|
154
|
+
* const categories: OptionItem[] = [
|
|
155
|
+
* { Label: 'Technology', Value: 'tech' },
|
|
156
|
+
* { Label: 'Finance', Value: 'finance' },
|
|
157
|
+
* { Label: 'Healthcare', Value: 'health' }
|
|
158
|
+
* ];
|
|
159
|
+
* ```
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
interface OptionItem {
|
|
164
|
+
/** Display text shown to the user */
|
|
165
|
+
Label: string;
|
|
166
|
+
/** Internal value used for form submission and identification */
|
|
167
|
+
Value: string;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Payload structure for async multi-select operations.
|
|
171
|
+
*
|
|
172
|
+
* This type defines the data structure used when performing asynchronous
|
|
173
|
+
* multi-select operations, typically for server-side filtering and loading
|
|
174
|
+
* of options with pre-selected values.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* Search with initial values:
|
|
178
|
+
* ```tsx
|
|
179
|
+
* const payload: AsyncMultiSelectPayload = {
|
|
180
|
+
* query: 'john',
|
|
181
|
+
* initialValues: ['user1', 'user2', 'user3']
|
|
182
|
+
* };
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
interface AsyncMultiSelectPayload {
|
|
188
|
+
/** Search query string for filtering options */
|
|
189
|
+
query: string | null;
|
|
190
|
+
/** Pre-selected values to be included in the selection */
|
|
191
|
+
initialValues?: string[] | number[] | null;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Extended option item structure supporting both string and number values.
|
|
195
|
+
*
|
|
196
|
+
* This type extends the basic OptionItem to support numeric values,
|
|
197
|
+
* providing flexibility for different data types while maintaining
|
|
198
|
+
* the same label-value structure.
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* Mixed value types:
|
|
202
|
+
* ```tsx
|
|
203
|
+
* const options: OptionItem2[] = [
|
|
204
|
+
* { Label: 'First Option', Value: 1 },
|
|
205
|
+
* { Label: 'Second Option', Value: 'second' },
|
|
206
|
+
* { Label: 'Third Option', Value: 3 }
|
|
207
|
+
* ];
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @public
|
|
211
|
+
*/
|
|
212
|
+
interface OptionItem2 {
|
|
213
|
+
/** Display text shown to the user */
|
|
214
|
+
Label: string;
|
|
215
|
+
/** Internal value that can be either a number or string */
|
|
216
|
+
Value: number | string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
interface OperationResponse {
|
|
220
|
+
id?: number;
|
|
221
|
+
rowsAffected: number;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
interface PostModel<TFilterModel> {
|
|
225
|
+
filterModel?: TFilterModel;
|
|
226
|
+
pageOffset: number;
|
|
227
|
+
pageSize: number;
|
|
228
|
+
sortField: string | null;
|
|
229
|
+
sortOrder: "asc" | "desc" | null | undefined;
|
|
230
|
+
sortModel?: GridSortModel;
|
|
231
|
+
}
|
|
232
|
+
interface ListResponse<TGridModel> {
|
|
233
|
+
Data: TGridModel[];
|
|
234
|
+
Total: number;
|
|
235
|
+
}
|
|
236
|
+
interface ValueLabel {
|
|
237
|
+
Value: number | string;
|
|
238
|
+
Label: string;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export type { ApiResponse, AsyncMultiSelectPayload, AsyncSelectMultiPayload, AsyncSelectPayload, ListResponse, OperationResponse, OptionItem, OptionItem2, PostModel, ValidationErrors, ValueLabel };
|