@ram_28/kf-ai-sdk 1.0.10 → 1.0.12
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 +55 -48
- package/dist/api/client.d.ts +23 -13
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/datetime.d.ts +5 -5
- package/dist/api/datetime.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/metadata.d.ts +2 -2
- package/dist/api/metadata.d.ts.map +1 -1
- package/dist/api.cjs +1 -0
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.mjs +27 -0
- package/dist/api.types.cjs +1 -0
- package/dist/api.types.d.ts +4 -0
- package/dist/api.types.d.ts.map +1 -0
- package/dist/api.types.mjs +1 -0
- package/dist/auth/AuthProvider.d.ts +3 -3
- package/dist/auth/AuthProvider.d.ts.map +1 -1
- package/dist/auth/authClient.d.ts +4 -4
- package/dist/auth/authClient.d.ts.map +1 -1
- package/dist/auth/authConfig.d.ts +5 -5
- package/dist/auth/authConfig.d.ts.map +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/types.d.ts +21 -21
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/useAuth.d.ts +2 -2
- package/dist/auth/useAuth.d.ts.map +1 -1
- package/dist/auth.cjs +1 -0
- package/dist/auth.d.ts +5 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.mjs +280 -0
- package/dist/auth.types.cjs +1 -0
- package/dist/auth.types.d.ts +2 -0
- package/dist/auth.types.d.ts.map +1 -0
- package/dist/auth.types.mjs +1 -0
- package/dist/base-types.d.ts +2 -0
- package/dist/base-types.d.ts.map +1 -0
- package/dist/client-C15j4O5B.cjs +1 -0
- package/dist/client-CfvLiGfP.js +233 -0
- package/dist/cn-Dr87sK3i.js +2775 -0
- package/dist/cn-mXUIg4vp.cjs +1 -0
- package/dist/components/hooks/index.d.ts +3 -3
- package/dist/components/hooks/index.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/index.d.ts +2 -2
- package/dist/components/hooks/useFilter/index.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/types.d.ts +19 -31
- package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
- package/dist/components/hooks/useFilter/useFilter.d.ts +2 -2
- package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
- package/dist/components/hooks/useForm/apiClient.d.ts +6 -6
- package/dist/components/hooks/useForm/apiClient.d.ts.map +1 -1
- package/dist/components/hooks/useForm/expressionValidator.utils.d.ts +7 -7
- package/dist/components/hooks/useForm/expressionValidator.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/index.d.ts +5 -5
- package/dist/components/hooks/useForm/index.d.ts.map +1 -1
- package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts +10 -10
- package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts +7 -12
- package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/schemaParser.utils.d.ts +7 -7
- package/dist/components/hooks/useForm/schemaParser.utils.d.ts.map +1 -1
- package/dist/components/hooks/useForm/types.d.ts +79 -70
- package/dist/components/hooks/useForm/types.d.ts.map +1 -1
- package/dist/components/hooks/useForm/useForm.d.ts +2 -2
- package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/apiClient.d.ts +16 -16
- package/dist/components/hooks/useKanban/apiClient.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/context.d.ts +3 -3
- package/dist/components/hooks/useKanban/context.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/dragDropManager.d.ts +7 -7
- package/dist/components/hooks/useKanban/dragDropManager.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/index.d.ts +1 -1
- package/dist/components/hooks/useKanban/index.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/types.d.ts +65 -67
- package/dist/components/hooks/useKanban/types.d.ts.map +1 -1
- package/dist/components/hooks/useKanban/useKanban.d.ts +2 -2
- package/dist/components/hooks/useKanban/useKanban.d.ts.map +1 -1
- package/dist/components/hooks/useTable/index.d.ts +1 -1
- package/dist/components/hooks/useTable/index.d.ts.map +1 -1
- package/dist/components/hooks/useTable/types.d.ts +10 -10
- package/dist/components/hooks/useTable/types.d.ts.map +1 -1
- package/dist/components/hooks/useTable/useTable.d.ts +2 -2
- package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
- package/dist/filter.cjs +1 -0
- package/dist/filter.d.ts +3 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.mjs +6 -0
- package/dist/filter.types.cjs +1 -0
- package/dist/filter.types.d.ts +2 -0
- package/dist/filter.types.d.ts.map +1 -0
- package/dist/filter.types.mjs +1 -0
- package/dist/form.cjs +1 -0
- package/dist/form.d.ts +3 -0
- package/dist/form.d.ts.map +1 -0
- package/dist/form.mjs +1346 -0
- package/dist/form.types.cjs +1 -0
- package/dist/form.types.d.ts +2 -0
- package/dist/form.types.d.ts.map +1 -0
- package/dist/form.types.mjs +1 -0
- package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
- package/dist/jsx-runtime-DGlMoOmv.js +630 -0
- package/dist/kanban.cjs +13 -0
- package/dist/kanban.d.ts +5 -0
- package/dist/kanban.d.ts.map +1 -0
- package/dist/kanban.mjs +694 -0
- package/dist/kanban.types.cjs +1 -0
- package/dist/kanban.types.d.ts +2 -0
- package/dist/kanban.types.d.ts.map +1 -0
- package/dist/kanban.types.mjs +1 -0
- package/dist/kanban.ui.cjs +1 -0
- package/dist/kanban.ui.d.ts +2 -0
- package/dist/kanban.ui.d.ts.map +1 -0
- package/dist/kanban.ui.mjs +104 -0
- package/dist/metadata-2FLBsFcf.cjs +1 -0
- package/dist/metadata-DBcoDth-.js +43 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.mjs +148 -0
- package/dist/table.types.cjs +1 -0
- package/dist/table.types.d.ts +2 -0
- package/dist/table.types.d.ts.map +1 -0
- package/dist/table.types.mjs +1 -0
- package/dist/types/base-fields.d.ts +45 -45
- package/dist/types/base-fields.d.ts.map +1 -1
- package/dist/types/common.d.ts +45 -61
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types.cjs +1 -0
- package/dist/types.mjs +1 -0
- package/dist/useFilter-CXFqEHyI.js +129 -0
- package/dist/useFilter-D-bCDo6Z.cjs +1 -0
- package/dist/utils/formatting.d.ts +4 -4
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils.cjs +4 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.mjs +105 -0
- package/package.json +147 -9
- package/sdk/api/client.ts +76 -49
- package/sdk/api/datetime.ts +5 -5
- package/sdk/api/index.ts +28 -33
- package/sdk/api/metadata.ts +4 -4
- package/sdk/api.ts +24 -0
- package/sdk/api.types.ts +58 -0
- package/sdk/auth/AuthProvider.tsx +18 -18
- package/sdk/auth/authClient.ts +9 -9
- package/sdk/auth/authConfig.ts +9 -9
- package/sdk/auth/index.ts +5 -5
- package/sdk/auth/types.ts +21 -21
- package/sdk/auth/useAuth.ts +2 -2
- package/sdk/auth.ts +22 -0
- package/sdk/auth.types.ts +28 -0
- package/sdk/base-types.ts +45 -0
- package/sdk/components/hooks/index.ts +22 -22
- package/sdk/components/hooks/useFilter/index.ts +8 -14
- package/sdk/components/hooks/useFilter/types.ts +29 -58
- package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
- package/sdk/components/hooks/useForm/apiClient.ts +8 -8
- package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
- package/sdk/components/hooks/useForm/index.ts +24 -24
- package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
- package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
- package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
- package/sdk/components/hooks/useForm/types.ts +85 -75
- package/sdk/components/hooks/useForm/useForm.ts +160 -40
- package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
- package/sdk/components/hooks/useKanban/context.ts +3 -3
- package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
- package/sdk/components/hooks/useKanban/index.ts +26 -26
- package/sdk/components/hooks/useKanban/types.ts +69 -71
- package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
- package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
- package/sdk/components/hooks/useTable/index.ts +5 -1
- package/sdk/components/hooks/useTable/types.ts +10 -10
- package/sdk/components/hooks/useTable/useTable.ts +10 -10
- package/sdk/filter.ts +13 -0
- package/sdk/filter.types.ts +17 -0
- package/sdk/form.ts +15 -0
- package/sdk/form.types.ts +46 -0
- package/sdk/kanban.ts +23 -0
- package/sdk/kanban.types.ts +50 -0
- package/sdk/kanban.ui.ts +16 -0
- package/sdk/table.ts +7 -0
- package/sdk/table.types.ts +13 -0
- package/sdk/types/base-fields.ts +47 -47
- package/sdk/types/common.ts +47 -71
- package/sdk/types/index.ts +1 -1
- package/sdk/utils/formatting.ts +4 -4
- package/sdk/utils.ts +10 -0
- package/dist/index.cjs +0 -45
- package/dist/index.mjs +0 -6327
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UseFormRegister, Mode, FieldValues as RHFFieldValues, FieldErrors, Path, PathValue, RegisterOptions, SetValueConfig
|
|
1
|
+
import type { UseFormRegister, Mode, FieldValues as RHFFieldValues, FieldErrors, Path, PathValue, RegisterOptions, SetValueConfig } from "react-hook-form";
|
|
2
2
|
/**
|
|
3
3
|
* HandleSubmit follows React Hook Form's signature pattern
|
|
4
4
|
*
|
|
@@ -10,16 +10,16 @@ import type { UseFormRegister, Mode, FieldValues as RHFFieldValues, FieldErrors,
|
|
|
10
10
|
* 2. Clean data & call API → FAILS → onError(apiError)
|
|
11
11
|
* 3. SUCCESS → onSuccess(responseData)
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type HandleSubmitType<T extends RHFFieldValues> = (onSuccess?: (data: T, e?: React.BaseSyntheticEvent) => void | Promise<void>, onError?: (error: FieldErrors<T> | Error, e?: React.BaseSyntheticEvent) => void | Promise<void>) => (e?: React.BaseSyntheticEvent) => Promise<void>;
|
|
14
14
|
/**
|
|
15
15
|
* Expression tree node types from backend validation system
|
|
16
16
|
* Used for evaluating validation rules, computed fields, and default values
|
|
17
17
|
*/
|
|
18
|
-
export interface
|
|
18
|
+
export interface ExpressionTreeType {
|
|
19
19
|
Type: "BinaryExpression" | "LogicalExpression" | "CallExpression" | "MemberExpression" | "AssignmentExpression" | "SystemIdentifier" | "Identifier" | "Literal";
|
|
20
20
|
Operator?: string;
|
|
21
21
|
Callee?: string;
|
|
22
|
-
Arguments?:
|
|
22
|
+
Arguments?: ExpressionTreeType[];
|
|
23
23
|
Name?: string;
|
|
24
24
|
Source?: string;
|
|
25
25
|
Property?: {
|
|
@@ -34,37 +34,37 @@ export interface ExpressionTree {
|
|
|
34
34
|
* Validation rule from BDO schema
|
|
35
35
|
* Defines a validation, computation, or business logic rule
|
|
36
36
|
*/
|
|
37
|
-
export interface
|
|
37
|
+
export interface SchemaValidationRuleType {
|
|
38
38
|
Id: string;
|
|
39
39
|
Name: string;
|
|
40
40
|
Description: string;
|
|
41
41
|
Expression: string;
|
|
42
|
-
ExpressionTree:
|
|
42
|
+
ExpressionTree: ExpressionTreeType;
|
|
43
43
|
ResultType: string;
|
|
44
44
|
Message?: string;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* Formula definition for computed fields
|
|
48
48
|
*/
|
|
49
|
-
export interface
|
|
49
|
+
export interface ComputedFieldFormulaType {
|
|
50
50
|
Id?: string;
|
|
51
51
|
Name?: string;
|
|
52
52
|
Description?: string;
|
|
53
53
|
Expression: string;
|
|
54
|
-
ExpressionTree:
|
|
54
|
+
ExpressionTree: ExpressionTreeType;
|
|
55
55
|
ResultType?: string;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Default value expression for a field
|
|
59
59
|
*/
|
|
60
|
-
export interface
|
|
60
|
+
export interface DefaultValueExpressionType {
|
|
61
61
|
Expression: string;
|
|
62
|
-
ExpressionTree:
|
|
62
|
+
ExpressionTree: ExpressionTreeType;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Reference field configuration for dynamic lookups
|
|
66
66
|
*/
|
|
67
|
-
export interface
|
|
67
|
+
export interface ReferenceFieldConfigType {
|
|
68
68
|
Mode: "Dynamic" | "Static";
|
|
69
69
|
Reference?: {
|
|
70
70
|
BusinessObject: string;
|
|
@@ -74,7 +74,7 @@ export interface ReferenceFieldConfig {
|
|
|
74
74
|
LhsField: string;
|
|
75
75
|
Operator: string;
|
|
76
76
|
RhsType: string;
|
|
77
|
-
RhsValue?:
|
|
77
|
+
RhsValue?: DefaultValueExpressionType;
|
|
78
78
|
}>;
|
|
79
79
|
};
|
|
80
80
|
Sort?: Array<{
|
|
@@ -86,47 +86,47 @@ export interface ReferenceFieldConfig {
|
|
|
86
86
|
/**
|
|
87
87
|
* Field options configuration for select/dropdown fields
|
|
88
88
|
*/
|
|
89
|
-
export interface
|
|
89
|
+
export interface FieldOptionsConfigType {
|
|
90
90
|
Mode: "Static" | "Dynamic";
|
|
91
91
|
Items?: Array<{
|
|
92
92
|
Value: string | number | boolean;
|
|
93
93
|
Label: string;
|
|
94
94
|
}>;
|
|
95
|
-
Reference?:
|
|
95
|
+
Reference?: ReferenceFieldConfigType["Reference"];
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* BDO field definition structure
|
|
99
99
|
*/
|
|
100
|
-
export interface
|
|
100
|
+
export interface BDOFieldDefinitionType {
|
|
101
101
|
Id: string;
|
|
102
102
|
Name: string;
|
|
103
103
|
Type: "String" | "Number" | "Boolean" | "Date" | "DateTime" | "Reference" | "Array" | "Object" | "ActivityFlow";
|
|
104
104
|
Required?: boolean;
|
|
105
105
|
Unique?: boolean;
|
|
106
|
-
DefaultValue?:
|
|
107
|
-
Formula?:
|
|
106
|
+
DefaultValue?: DefaultValueExpressionType;
|
|
107
|
+
Formula?: ComputedFieldFormulaType;
|
|
108
108
|
Computed?: boolean;
|
|
109
|
-
Validation?: string[] |
|
|
110
|
-
Values?:
|
|
109
|
+
Validation?: string[] | SchemaValidationRuleType[];
|
|
110
|
+
Values?: FieldOptionsConfigType;
|
|
111
111
|
Items?: {
|
|
112
112
|
Type: string;
|
|
113
|
-
Property?: Record<string,
|
|
113
|
+
Property?: Record<string, BDOFieldDefinitionType>;
|
|
114
114
|
};
|
|
115
|
-
Property?: Record<string,
|
|
115
|
+
Property?: Record<string, BDOFieldDefinitionType>;
|
|
116
116
|
Description?: string;
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* Business Object Rule definitions from BDO schema
|
|
120
120
|
*/
|
|
121
|
-
export interface
|
|
122
|
-
Computation?: Record<string,
|
|
123
|
-
Validation?: Record<string,
|
|
124
|
-
BusinessLogic?: Record<string,
|
|
121
|
+
export interface BusinessObjectRulesType {
|
|
122
|
+
Computation?: Record<string, SchemaValidationRuleType>;
|
|
123
|
+
Validation?: Record<string, SchemaValidationRuleType>;
|
|
124
|
+
BusinessLogic?: Record<string, SchemaValidationRuleType>;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
127
|
* Role permission definition from BDO schema
|
|
128
128
|
*/
|
|
129
|
-
export interface
|
|
129
|
+
export interface RolePermissionType {
|
|
130
130
|
Editable?: string[];
|
|
131
131
|
ReadOnly?: string[];
|
|
132
132
|
Methods?: string[];
|
|
@@ -143,14 +143,14 @@ export interface RolePermission {
|
|
|
143
143
|
/**
|
|
144
144
|
* Complete BDO (Business Data Object) schema structure
|
|
145
145
|
*/
|
|
146
|
-
export interface
|
|
146
|
+
export interface BDOSchemaType {
|
|
147
147
|
Id: string;
|
|
148
148
|
Name: string;
|
|
149
149
|
Kind: "BusinessObject";
|
|
150
150
|
Description: string;
|
|
151
|
-
Rules:
|
|
152
|
-
Fields: Record<string,
|
|
153
|
-
RolePermission: Record<string,
|
|
151
|
+
Rules: BusinessObjectRulesType;
|
|
152
|
+
Fields: Record<string, BDOFieldDefinitionType>;
|
|
153
|
+
RolePermission: Record<string, RolePermissionType>;
|
|
154
154
|
Roles: Record<string, {
|
|
155
155
|
Name: string;
|
|
156
156
|
Description: string;
|
|
@@ -159,23 +159,29 @@ export interface BDOSchema {
|
|
|
159
159
|
/**
|
|
160
160
|
* Form operation mode
|
|
161
161
|
*/
|
|
162
|
-
export type
|
|
162
|
+
export type FormOperationType = "create" | "update";
|
|
163
|
+
/**
|
|
164
|
+
* Form interaction mode
|
|
165
|
+
* - "interactive" (default): Real-time server-side validation and computation on every field blur
|
|
166
|
+
* - "non-interactive": Draft only for computed field dependencies (legacy behavior)
|
|
167
|
+
*/
|
|
168
|
+
export type InteractionModeType = "interactive" | "non-interactive";
|
|
163
169
|
/**
|
|
164
170
|
* Form validation mode (from react-hook-form)
|
|
165
171
|
*/
|
|
166
|
-
export type
|
|
172
|
+
export type FormModeType = Mode;
|
|
167
173
|
/**
|
|
168
174
|
* Rule classification types
|
|
169
175
|
*/
|
|
170
|
-
export type
|
|
176
|
+
export type RuleTypeType = "Validation" | "Computation" | "BusinessLogic";
|
|
171
177
|
/**
|
|
172
178
|
* useForm hook options with strict typing
|
|
173
179
|
*/
|
|
174
|
-
export interface
|
|
180
|
+
export interface UseFormOptionsType<T extends Record<string, any> = Record<string, any>> {
|
|
175
181
|
/** Data source identifier (Business Object name) */
|
|
176
182
|
source: string;
|
|
177
183
|
/** Form operation type */
|
|
178
|
-
operation:
|
|
184
|
+
operation: FormOperationType;
|
|
179
185
|
/** Record ID for update operations */
|
|
180
186
|
recordId?: string;
|
|
181
187
|
/** Default form values */
|
|
@@ -197,7 +203,7 @@ export interface UseFormOptions<T extends Record<string, any> = Record<string, a
|
|
|
197
203
|
* @default "onBlur"
|
|
198
204
|
* @see https://react-hook-form.com/docs/useform for more details on validation modes
|
|
199
205
|
*/
|
|
200
|
-
mode?:
|
|
206
|
+
mode?: FormModeType;
|
|
201
207
|
/** Whether to enable schema fetching and form initialization (default: true) */
|
|
202
208
|
enabled?: boolean;
|
|
203
209
|
/** User role for permission enforcement */
|
|
@@ -207,18 +213,19 @@ export interface UseFormOptions<T extends Record<string, any> = Record<string, a
|
|
|
207
213
|
/** Skip schema fetching (use for testing) */
|
|
208
214
|
skipSchemaFetch?: boolean;
|
|
209
215
|
/** Manual schema (use instead of fetching) */
|
|
210
|
-
schema?:
|
|
216
|
+
schema?: BDOSchemaType;
|
|
211
217
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
218
|
+
* Form interaction mode
|
|
219
|
+
* - "interactive" (default): Real-time server-side validation and computation on every field blur
|
|
220
|
+
* - "non-interactive": Draft only for computed field dependencies
|
|
221
|
+
* @default "interactive"
|
|
215
222
|
*/
|
|
216
|
-
|
|
223
|
+
interactionMode?: InteractionModeType;
|
|
217
224
|
}
|
|
218
225
|
/**
|
|
219
226
|
* Field permission for current user
|
|
220
227
|
*/
|
|
221
|
-
export interface
|
|
228
|
+
export interface FieldPermissionType {
|
|
222
229
|
/** Can user edit this field */
|
|
223
230
|
editable: boolean;
|
|
224
231
|
/** Can user see this field */
|
|
@@ -229,18 +236,18 @@ export interface FieldPermission {
|
|
|
229
236
|
/**
|
|
230
237
|
* Field input types for form rendering
|
|
231
238
|
*/
|
|
232
|
-
export type
|
|
239
|
+
export type FormFieldTypeType = "text" | "number" | "email" | "password" | "date" | "datetime-local" | "checkbox" | "select" | "textarea" | "reference";
|
|
233
240
|
/**
|
|
234
241
|
* Select option for dropdown fields
|
|
235
242
|
*/
|
|
236
|
-
export interface
|
|
243
|
+
export interface SelectOptionType {
|
|
237
244
|
value: any;
|
|
238
245
|
label: string;
|
|
239
246
|
}
|
|
240
247
|
/**
|
|
241
248
|
* Field rule IDs by category
|
|
242
249
|
*/
|
|
243
|
-
export interface
|
|
250
|
+
export interface FieldRuleIdsType {
|
|
244
251
|
validation: string[];
|
|
245
252
|
computation: string[];
|
|
246
253
|
businessLogic: string[];
|
|
@@ -249,11 +256,11 @@ export interface FieldRuleIds {
|
|
|
249
256
|
* Form field configuration for rendering
|
|
250
257
|
* Contains all metadata needed to render and validate a form field
|
|
251
258
|
*/
|
|
252
|
-
export interface
|
|
259
|
+
export interface FormFieldConfigType {
|
|
253
260
|
/** Field name/identifier */
|
|
254
261
|
name: string;
|
|
255
262
|
/** Field input type */
|
|
256
|
-
type:
|
|
263
|
+
type: FormFieldTypeType;
|
|
257
264
|
/** Display label */
|
|
258
265
|
label: string;
|
|
259
266
|
/** Whether field is required */
|
|
@@ -263,25 +270,25 @@ export interface FormFieldConfig {
|
|
|
263
270
|
/** Default value */
|
|
264
271
|
defaultValue?: any;
|
|
265
272
|
/** Select options (for select/reference fields) */
|
|
266
|
-
options?:
|
|
273
|
+
options?: SelectOptionType[];
|
|
267
274
|
/** Validation configuration */
|
|
268
275
|
validation: any;
|
|
269
276
|
/** Field description/help text */
|
|
270
277
|
description?: string;
|
|
271
278
|
/** Original BDO field definition (for advanced use) */
|
|
272
|
-
_bdoField:
|
|
279
|
+
_bdoField: BDOFieldDefinitionType;
|
|
273
280
|
/** Field permissions for current user */
|
|
274
|
-
permission:
|
|
281
|
+
permission: FieldPermissionType;
|
|
275
282
|
/** Associated rule IDs by category */
|
|
276
|
-
rules:
|
|
283
|
+
rules: FieldRuleIdsType;
|
|
277
284
|
}
|
|
278
285
|
/**
|
|
279
286
|
* Form schema configuration after processing
|
|
280
287
|
* Contains all fields and rules ready for form rendering
|
|
281
288
|
*/
|
|
282
|
-
export interface
|
|
289
|
+
export interface FormSchemaConfigType {
|
|
283
290
|
/** All fields by name */
|
|
284
|
-
fields: Record<string,
|
|
291
|
+
fields: Record<string, FormFieldConfigType>;
|
|
285
292
|
/** Field names in display order */
|
|
286
293
|
fieldOrder: string[];
|
|
287
294
|
/** Names of computed fields */
|
|
@@ -289,22 +296,22 @@ export interface FormSchemaConfig {
|
|
|
289
296
|
/** Names of required fields */
|
|
290
297
|
requiredFields: string[];
|
|
291
298
|
/** Cross-field validation rules */
|
|
292
|
-
crossFieldValidation:
|
|
299
|
+
crossFieldValidation: SchemaValidationRuleType[];
|
|
293
300
|
/** Classified rules by type */
|
|
294
301
|
rules: {
|
|
295
|
-
validation: Record<string,
|
|
296
|
-
computation: Record<string,
|
|
297
|
-
businessLogic: Record<string,
|
|
302
|
+
validation: Record<string, SchemaValidationRuleType>;
|
|
303
|
+
computation: Record<string, SchemaValidationRuleType>;
|
|
304
|
+
businessLogic: Record<string, SchemaValidationRuleType>;
|
|
298
305
|
};
|
|
299
306
|
/** Field-to-rule mapping for quick lookup */
|
|
300
|
-
fieldRules: Record<string,
|
|
307
|
+
fieldRules: Record<string, FieldRuleIdsType>;
|
|
301
308
|
/** Role permissions */
|
|
302
|
-
rolePermissions?: Record<string,
|
|
309
|
+
rolePermissions?: Record<string, RolePermissionType>;
|
|
303
310
|
}
|
|
304
311
|
/**
|
|
305
312
|
* useForm hook return type with flattened state access and strict typing
|
|
306
313
|
*/
|
|
307
|
-
export interface
|
|
314
|
+
export interface UseFormReturnType<T extends Record<string, any> = Record<string, any>> {
|
|
308
315
|
/** Register field for validation and form handling with strict typing */
|
|
309
316
|
register: <K extends Path<T>>(name: K, options?: RegisterOptions<T, K>) => ReturnType<UseFormRegister<T>>;
|
|
310
317
|
/**
|
|
@@ -338,7 +345,7 @@ export interface UseFormReturn<T extends Record<string, any> = Record<string, an
|
|
|
338
345
|
* // Programmatic submission
|
|
339
346
|
* await form.handleSubmit(onSuccess, onError)();
|
|
340
347
|
*/
|
|
341
|
-
handleSubmit:
|
|
348
|
+
handleSubmit: HandleSubmitType<T>;
|
|
342
349
|
/** Watch field values with strict typing */
|
|
343
350
|
watch: <K extends Path<T> | readonly Path<T>[]>(name?: K) => K extends Path<T> ? PathValue<T, K> : K extends readonly Path<T>[] ? PathValue<T, K[number]>[] : T;
|
|
344
351
|
/** Set field value programmatically with strict typing */
|
|
@@ -355,30 +362,32 @@ export interface UseFormReturn<T extends Record<string, any> = Record<string, an
|
|
|
355
362
|
isSubmitting: boolean;
|
|
356
363
|
/** Form submission was successful - direct access */
|
|
357
364
|
isSubmitSuccessful: boolean;
|
|
358
|
-
/** Form state object (for backward compatibility with existing components) */
|
|
359
|
-
formState: FormState<T>;
|
|
360
365
|
/** Loading initial schema/data */
|
|
361
366
|
isLoadingInitialData: boolean;
|
|
362
367
|
/** Loading record data for update */
|
|
363
368
|
isLoadingRecord: boolean;
|
|
364
369
|
/** Any loading state active */
|
|
365
370
|
isLoading: boolean;
|
|
371
|
+
/** Draft ID for interactive create mode */
|
|
372
|
+
draftId: string | null;
|
|
373
|
+
/** Whether draft is being created (interactive create only) */
|
|
374
|
+
isCreatingDraft: boolean;
|
|
366
375
|
/** Schema fetch error */
|
|
367
376
|
loadError: Error | null;
|
|
368
377
|
/** Any error active */
|
|
369
378
|
hasError: boolean;
|
|
370
379
|
/** Raw BDO schema */
|
|
371
|
-
schema:
|
|
380
|
+
schema: BDOSchemaType | null;
|
|
372
381
|
/** Processed schema configuration for rendering */
|
|
373
|
-
schemaConfig:
|
|
382
|
+
schemaConfig: FormSchemaConfigType | null;
|
|
374
383
|
/** Computed field names as typed array */
|
|
375
384
|
computedFields: Array<keyof T>;
|
|
376
385
|
/** Required field names as typed array */
|
|
377
386
|
requiredFields: Array<keyof T>;
|
|
378
387
|
/** Get field configuration with strict typing */
|
|
379
|
-
getField: <K extends keyof T>(fieldName: K) =>
|
|
388
|
+
getField: <K extends keyof T>(fieldName: K) => FormFieldConfigType | null;
|
|
380
389
|
/** Get all field configurations with strict typing */
|
|
381
|
-
getFields: () => Record<keyof T,
|
|
390
|
+
getFields: () => Record<keyof T, FormFieldConfigType>;
|
|
382
391
|
/** Check if field exists with strict typing */
|
|
383
392
|
hasField: <K extends keyof T>(fieldName: K) => boolean;
|
|
384
393
|
/** Check if field is required with strict typing */
|
|
@@ -395,7 +404,7 @@ export interface UseFormReturn<T extends Record<string, any> = Record<string, an
|
|
|
395
404
|
/**
|
|
396
405
|
* Expression evaluation context
|
|
397
406
|
*/
|
|
398
|
-
export interface
|
|
407
|
+
export interface ExpressionContextType<T = Record<string, any>> {
|
|
399
408
|
/** Current form values */
|
|
400
409
|
formValues: Partial<T>;
|
|
401
410
|
/** System values (NOW, TODAY, CURRENT_USER, etc.) */
|
|
@@ -406,7 +415,7 @@ export interface ExpressionContext<T = Record<string, any>> {
|
|
|
406
415
|
/**
|
|
407
416
|
* Field validation result
|
|
408
417
|
*/
|
|
409
|
-
export interface
|
|
418
|
+
export interface FieldValidationResultType<T = Record<string, any>> {
|
|
410
419
|
/** Is validation passing */
|
|
411
420
|
isValid: boolean;
|
|
412
421
|
/** Error message if validation fails */
|
|
@@ -417,7 +426,7 @@ export interface FieldValidationResult<T = Record<string, any>> {
|
|
|
417
426
|
/**
|
|
418
427
|
* Form submission result
|
|
419
428
|
*/
|
|
420
|
-
export interface
|
|
429
|
+
export interface SubmissionResultType {
|
|
421
430
|
/** Was submission successful */
|
|
422
431
|
success: boolean;
|
|
423
432
|
/** Response data */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useForm/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,IAAI,EACJ,WAAW,IAAI,cAAc,EAC7B,WAAW,EACX,IAAI,EACJ,SAAS,EACT,eAAe,EACf,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useForm/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,eAAe,EACf,IAAI,EACJ,WAAW,IAAI,cAAc,EAC7B,WAAW,EACX,IAAI,EACJ,SAAS,EACT,eAAe,EACf,cA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,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnC,6BAA6B;IAC7B,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC,uBAAuB;IACvB,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC5D,0BAA0B;IAC1B,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAEvB,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAElC,2BAA2B;IAC3B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAChE,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAC;IAEjB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IAEjB,oBAAoB;IACpB,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,iCAAiC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function useForm<T extends Record<string, any> = Record<string, any>>(options:
|
|
1
|
+
import type { UseFormOptionsType, UseFormReturnType } from "./types";
|
|
2
|
+
export declare function useForm<T extends Record<string, any> = Record<string, any>>(options: UseFormOptionsType<T>): UseFormReturnType<T>;
|
|
3
3
|
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useForm/useForm.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useForm/useForm.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EAIlB,MAAM,SAAS,CAAC;AAwBjB,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzE,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,iBAAiB,CAAC,CAAC,CAAC,CA+4BtB"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ListOptionsType, ListResponseType, CreateUpdateResponseType, DeleteResponseType } from "../../../types/common";
|
|
2
|
+
import type { KanbanCardType, KanbanColumnType, BulkCardUpdateRequestType, BulkColumnUpdateRequestType } from "./types";
|
|
3
3
|
/**
|
|
4
4
|
* Fetch columns from backend with optional filtering and sorting
|
|
5
5
|
*/
|
|
6
|
-
export declare function fetchColumns<T>(source: string, options?:
|
|
6
|
+
export declare function fetchColumns<T>(source: string, options?: ListOptionsType): Promise<KanbanColumnType<T>[]>;
|
|
7
7
|
/**
|
|
8
8
|
* Create a new column
|
|
9
9
|
*/
|
|
10
|
-
export declare function createColumn<T>(source: string, column: Partial<
|
|
10
|
+
export declare function createColumn<T>(source: string, column: Partial<KanbanColumnType<T>>): Promise<string>;
|
|
11
11
|
/**
|
|
12
12
|
* Update an existing column
|
|
13
13
|
*/
|
|
14
|
-
export declare function updateColumn<T>(source: string, id: string, updates: Partial<
|
|
14
|
+
export declare function updateColumn<T>(source: string, id: string, updates: Partial<KanbanColumnType<T>>): Promise<void>;
|
|
15
15
|
/**
|
|
16
16
|
* Delete a column
|
|
17
17
|
*/
|
|
@@ -23,17 +23,17 @@ export declare function reorderColumns<T>(source: string, columnIds: string[]):
|
|
|
23
23
|
/**
|
|
24
24
|
* Fetch cards from backend with optional filtering and sorting
|
|
25
25
|
*/
|
|
26
|
-
export declare function fetchCards<T>(source: string, options?:
|
|
26
|
+
export declare function fetchCards<T>(source: string, options?: ListOptionsType): Promise<KanbanCardType<T>[]>;
|
|
27
27
|
/**
|
|
28
28
|
* Create a new card
|
|
29
29
|
*/
|
|
30
|
-
export declare function createCard<T>(source: string, card: Partial<
|
|
30
|
+
export declare function createCard<T>(source: string, card: Partial<KanbanCardType<T>> & {
|
|
31
31
|
columnId: string;
|
|
32
32
|
}): Promise<string>;
|
|
33
33
|
/**
|
|
34
34
|
* Update an existing card
|
|
35
35
|
*/
|
|
36
|
-
export declare function updateCard<T>(source: string, id: string, updates: Partial<
|
|
36
|
+
export declare function updateCard<T>(source: string, id: string, updates: Partial<KanbanCardType<T>>): Promise<void>;
|
|
37
37
|
/**
|
|
38
38
|
* Delete a card
|
|
39
39
|
*/
|
|
@@ -49,11 +49,11 @@ export declare function reorderCards<T>(source: string, cardIds: string[], colum
|
|
|
49
49
|
/**
|
|
50
50
|
* Bulk update multiple cards
|
|
51
51
|
*/
|
|
52
|
-
export declare function bulkUpdateCards<T>(source: string, request:
|
|
52
|
+
export declare function bulkUpdateCards<T>(source: string, request: BulkCardUpdateRequestType<T>): Promise<void>;
|
|
53
53
|
/**
|
|
54
54
|
* Bulk update multiple columns
|
|
55
55
|
*/
|
|
56
|
-
export declare function bulkUpdateColumns<T>(source: string, request:
|
|
56
|
+
export declare function bulkUpdateColumns<T>(source: string, request: BulkColumnUpdateRequestType<T>): Promise<void>;
|
|
57
57
|
/**
|
|
58
58
|
* Move multiple cards to a new column
|
|
59
59
|
*/
|
|
@@ -65,23 +65,23 @@ export declare function getCardCount(source: string, columnId: string): Promise<
|
|
|
65
65
|
/**
|
|
66
66
|
* Get total count of all cards across columns
|
|
67
67
|
*/
|
|
68
|
-
export declare function getTotalCardCount(source: string, options?:
|
|
68
|
+
export declare function getTotalCardCount(source: string, options?: ListOptionsType): Promise<number>;
|
|
69
69
|
/**
|
|
70
70
|
* Search cards across all columns
|
|
71
71
|
*/
|
|
72
|
-
export declare function searchCards<T>(source: string, searchQuery: string, additionalOptions?:
|
|
72
|
+
export declare function searchCards<T>(source: string, searchQuery: string, additionalOptions?: ListOptionsType): Promise<KanbanCardType<T>[]>;
|
|
73
73
|
/**
|
|
74
74
|
* Merge cards into their respective columns
|
|
75
75
|
*/
|
|
76
|
-
export declare function mergeCardsIntoColumns<T>(columns:
|
|
76
|
+
export declare function mergeCardsIntoColumns<T>(columns: KanbanColumnType<T>[], cards: KanbanCardType<T>[]): KanbanColumnType<T>[];
|
|
77
77
|
/**
|
|
78
78
|
* Calculate optimal position for inserting a new card
|
|
79
79
|
*/
|
|
80
|
-
export declare function calculateCardPosition<T>(column:
|
|
80
|
+
export declare function calculateCardPosition<T>(column: KanbanColumnType<T>, insertIndex?: number): number;
|
|
81
81
|
/**
|
|
82
82
|
* Calculate optimal position for inserting a new column
|
|
83
83
|
*/
|
|
84
|
-
export declare function calculateColumnPosition<T>(columns:
|
|
84
|
+
export declare function calculateColumnPosition<T>(columns: KanbanColumnType<T>[], insertIndex?: number): number;
|
|
85
85
|
/**
|
|
86
86
|
* Recalculate positions to ensure proper ordering
|
|
87
87
|
*/
|
|
@@ -95,5 +95,5 @@ export declare function handleKanbanApiError(error: unknown, operation: string,
|
|
|
95
95
|
/**
|
|
96
96
|
* Validate API response structure
|
|
97
97
|
*/
|
|
98
|
-
export declare function validateApiResponse<T>(response: any, expectedType: 'list' | 'single' | 'create' | 'delete'): response is
|
|
98
|
+
export declare function validateApiResponse<T>(response: any, expectedType: 'list' | 'single' | 'create' | 'delete'): response is ListResponseType<T> | T | CreateUpdateResponseType | DeleteResponseType;
|
|
99
99
|
//# sourceMappingURL=apiClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/apiClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"apiClient.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/apiClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAMjB;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAkBhC;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACnC,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACpC,OAAO,CAAC,IAAI,CAAC,CAOf;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC,CAef;AAMD;;GAEG;AACH,wBAAsB,UA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AAC,EAAE,GACT,CAAC,EAAE,CAOL;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,QAAQ,EAC7B,QAAQ,CAAC,EAAE,MAAM,GAChB,KAAK,CASP;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,QAAQ,EAAE,GAAG,EACb,YAAY,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GACpD,QAAQ,IAAI,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,wBAAwB,GAAG,kBAAkB,CAarF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const KanbanContext: import("react").Context<
|
|
3
|
-
export declare function useKanbanContext<T extends Record<string, any> = any>():
|
|
1
|
+
import { UseKanbanReturnType } from "./types";
|
|
2
|
+
export declare const KanbanContext: import("react").Context<UseKanbanReturnType<any> | null>;
|
|
3
|
+
export declare function useKanbanContext<T extends Record<string, any> = any>(): UseKanbanReturnType<T>;
|
|
4
4
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,aAAa,0DAAuD,CAAC;AAElF,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,KAOhD,mBAAmB,CAAC,CAAC,CAAC,CACzC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KanbanCardType, KanbanColumnType, DragDropManagerType } from "./types";
|
|
2
2
|
export declare function useDragDropManager<T>({ onCardMove, onError, columns, announceMove }: {
|
|
3
|
-
onCardMove?: (card:
|
|
3
|
+
onCardMove?: (card: KanbanCardType<T>, fromColumnId: string, toColumnId: string) => void;
|
|
4
4
|
onError?: (error: Error) => void;
|
|
5
|
-
columns:
|
|
6
|
-
announceMove?: (card:
|
|
7
|
-
}):
|
|
5
|
+
columns: KanbanColumnType<T>[];
|
|
6
|
+
announceMove?: (card: KanbanCardType<T>, fromColumn: string, toColumn: string) => void;
|
|
7
|
+
}): DragDropManagerType<T>;
|
|
8
8
|
/**
|
|
9
9
|
* Calculate drop position based on mouse coordinates
|
|
10
10
|
*/
|
|
11
|
-
export declare function calculateDropPosition<T>(event: DragEvent, column:
|
|
11
|
+
export declare function calculateDropPosition<T>(event: DragEvent, column: KanbanColumnType<T>, cardHeight?: number): number;
|
|
12
12
|
/**
|
|
13
13
|
* Add visual feedback classes to elements during drag
|
|
14
14
|
*/
|
|
@@ -20,7 +20,7 @@ export declare function removeDragFeedback(element: HTMLElement): void;
|
|
|
20
20
|
/**
|
|
21
21
|
* Check if a column can accept a drop
|
|
22
22
|
*/
|
|
23
|
-
export declare function canAcceptDrop<T>(column:
|
|
23
|
+
export declare function canAcceptDrop<T>(column: KanbanColumnType<T>, draggedCard: KanbanCardType<T>): {
|
|
24
24
|
canDrop: boolean;
|
|
25
25
|
reason?: string;
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dragDropManager.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/dragDropManager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"dragDropManager.d.ts","sourceRoot":"","sources":["../../../../sdk/components/hooks/useKanban/dragDropManager.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAEhB,mBAA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