@ram_28/kf-ai-sdk 1.0.11 → 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.
Files changed (193) hide show
  1. package/README.md +55 -48
  2. package/dist/api/client.d.ts +14 -14
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/datetime.d.ts +5 -5
  5. package/dist/api/datetime.d.ts.map +1 -1
  6. package/dist/api/index.d.ts +1 -1
  7. package/dist/api/index.d.ts.map +1 -1
  8. package/dist/api/metadata.d.ts +2 -2
  9. package/dist/api/metadata.d.ts.map +1 -1
  10. package/dist/api.cjs +1 -0
  11. package/dist/api.d.ts +4 -0
  12. package/dist/api.d.ts.map +1 -0
  13. package/dist/api.mjs +27 -0
  14. package/dist/api.types.cjs +1 -0
  15. package/dist/api.types.d.ts +4 -0
  16. package/dist/api.types.d.ts.map +1 -0
  17. package/dist/api.types.mjs +1 -0
  18. package/dist/auth/AuthProvider.d.ts +3 -3
  19. package/dist/auth/AuthProvider.d.ts.map +1 -1
  20. package/dist/auth/authClient.d.ts +4 -4
  21. package/dist/auth/authClient.d.ts.map +1 -1
  22. package/dist/auth/authConfig.d.ts +5 -5
  23. package/dist/auth/authConfig.d.ts.map +1 -1
  24. package/dist/auth/index.d.ts +1 -1
  25. package/dist/auth/index.d.ts.map +1 -1
  26. package/dist/auth/types.d.ts +21 -21
  27. package/dist/auth/types.d.ts.map +1 -1
  28. package/dist/auth/useAuth.d.ts +2 -2
  29. package/dist/auth/useAuth.d.ts.map +1 -1
  30. package/dist/auth.cjs +1 -0
  31. package/dist/auth.d.ts +5 -0
  32. package/dist/auth.d.ts.map +1 -0
  33. package/dist/auth.mjs +280 -0
  34. package/dist/auth.types.cjs +1 -0
  35. package/dist/auth.types.d.ts +2 -0
  36. package/dist/auth.types.d.ts.map +1 -0
  37. package/dist/auth.types.mjs +1 -0
  38. package/dist/base-types.d.ts +2 -0
  39. package/dist/base-types.d.ts.map +1 -0
  40. package/dist/client-C15j4O5B.cjs +1 -0
  41. package/dist/client-CfvLiGfP.js +233 -0
  42. package/dist/cn-Dr87sK3i.js +2775 -0
  43. package/dist/cn-mXUIg4vp.cjs +1 -0
  44. package/dist/components/hooks/index.d.ts +3 -3
  45. package/dist/components/hooks/index.d.ts.map +1 -1
  46. package/dist/components/hooks/useFilter/index.d.ts +2 -2
  47. package/dist/components/hooks/useFilter/index.d.ts.map +1 -1
  48. package/dist/components/hooks/useFilter/types.d.ts +19 -31
  49. package/dist/components/hooks/useFilter/types.d.ts.map +1 -1
  50. package/dist/components/hooks/useFilter/useFilter.d.ts +2 -2
  51. package/dist/components/hooks/useFilter/useFilter.d.ts.map +1 -1
  52. package/dist/components/hooks/useForm/apiClient.d.ts +6 -6
  53. package/dist/components/hooks/useForm/apiClient.d.ts.map +1 -1
  54. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts +7 -7
  55. package/dist/components/hooks/useForm/expressionValidator.utils.d.ts.map +1 -1
  56. package/dist/components/hooks/useForm/index.d.ts +5 -5
  57. package/dist/components/hooks/useForm/index.d.ts.map +1 -1
  58. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts +10 -10
  59. package/dist/components/hooks/useForm/optimizedExpressionValidator.utils.d.ts.map +1 -1
  60. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts +7 -12
  61. package/dist/components/hooks/useForm/ruleClassifier.utils.d.ts.map +1 -1
  62. package/dist/components/hooks/useForm/schemaParser.utils.d.ts +7 -7
  63. package/dist/components/hooks/useForm/schemaParser.utils.d.ts.map +1 -1
  64. package/dist/components/hooks/useForm/types.d.ts +67 -76
  65. package/dist/components/hooks/useForm/types.d.ts.map +1 -1
  66. package/dist/components/hooks/useForm/useForm.d.ts +2 -2
  67. package/dist/components/hooks/useForm/useForm.d.ts.map +1 -1
  68. package/dist/components/hooks/useKanban/apiClient.d.ts +16 -16
  69. package/dist/components/hooks/useKanban/apiClient.d.ts.map +1 -1
  70. package/dist/components/hooks/useKanban/context.d.ts +3 -3
  71. package/dist/components/hooks/useKanban/context.d.ts.map +1 -1
  72. package/dist/components/hooks/useKanban/dragDropManager.d.ts +7 -7
  73. package/dist/components/hooks/useKanban/dragDropManager.d.ts.map +1 -1
  74. package/dist/components/hooks/useKanban/index.d.ts +1 -1
  75. package/dist/components/hooks/useKanban/index.d.ts.map +1 -1
  76. package/dist/components/hooks/useKanban/types.d.ts +65 -67
  77. package/dist/components/hooks/useKanban/types.d.ts.map +1 -1
  78. package/dist/components/hooks/useKanban/useKanban.d.ts +2 -2
  79. package/dist/components/hooks/useKanban/useKanban.d.ts.map +1 -1
  80. package/dist/components/hooks/useTable/index.d.ts +1 -1
  81. package/dist/components/hooks/useTable/index.d.ts.map +1 -1
  82. package/dist/components/hooks/useTable/types.d.ts +10 -10
  83. package/dist/components/hooks/useTable/types.d.ts.map +1 -1
  84. package/dist/components/hooks/useTable/useTable.d.ts +2 -2
  85. package/dist/components/hooks/useTable/useTable.d.ts.map +1 -1
  86. package/dist/filter.cjs +1 -0
  87. package/dist/filter.d.ts +3 -0
  88. package/dist/filter.d.ts.map +1 -0
  89. package/dist/filter.mjs +6 -0
  90. package/dist/filter.types.cjs +1 -0
  91. package/dist/filter.types.d.ts +2 -0
  92. package/dist/filter.types.d.ts.map +1 -0
  93. package/dist/filter.types.mjs +1 -0
  94. package/dist/form.cjs +1 -0
  95. package/dist/form.d.ts +3 -0
  96. package/dist/form.d.ts.map +1 -0
  97. package/dist/form.mjs +1346 -0
  98. package/dist/form.types.cjs +1 -0
  99. package/dist/form.types.d.ts +2 -0
  100. package/dist/form.types.d.ts.map +1 -0
  101. package/dist/form.types.mjs +1 -0
  102. package/dist/jsx-runtime-BYECrxsp.cjs +30 -0
  103. package/dist/jsx-runtime-DGlMoOmv.js +630 -0
  104. package/dist/kanban.cjs +13 -0
  105. package/dist/kanban.d.ts +5 -0
  106. package/dist/kanban.d.ts.map +1 -0
  107. package/dist/kanban.mjs +694 -0
  108. package/dist/kanban.types.cjs +1 -0
  109. package/dist/kanban.types.d.ts +2 -0
  110. package/dist/kanban.types.d.ts.map +1 -0
  111. package/dist/kanban.types.mjs +1 -0
  112. package/dist/kanban.ui.cjs +1 -0
  113. package/dist/kanban.ui.d.ts +2 -0
  114. package/dist/kanban.ui.d.ts.map +1 -0
  115. package/dist/kanban.ui.mjs +104 -0
  116. package/dist/metadata-2FLBsFcf.cjs +1 -0
  117. package/dist/metadata-DBcoDth-.js +43 -0
  118. package/dist/table.cjs +1 -0
  119. package/dist/table.d.ts +2 -0
  120. package/dist/table.d.ts.map +1 -0
  121. package/dist/table.mjs +148 -0
  122. package/dist/table.types.cjs +1 -0
  123. package/dist/table.types.d.ts +2 -0
  124. package/dist/table.types.d.ts.map +1 -0
  125. package/dist/table.types.mjs +1 -0
  126. package/dist/types/base-fields.d.ts +45 -45
  127. package/dist/types/base-fields.d.ts.map +1 -1
  128. package/dist/types/common.d.ts +45 -61
  129. package/dist/types/common.d.ts.map +1 -1
  130. package/dist/types.cjs +1 -0
  131. package/dist/types.mjs +1 -0
  132. package/dist/useFilter-CXFqEHyI.js +129 -0
  133. package/dist/useFilter-D-bCDo6Z.cjs +1 -0
  134. package/dist/utils/formatting.d.ts +4 -4
  135. package/dist/utils/formatting.d.ts.map +1 -1
  136. package/dist/utils.cjs +4 -0
  137. package/dist/utils.d.ts +3 -0
  138. package/dist/utils.d.ts.map +1 -0
  139. package/dist/utils.mjs +105 -0
  140. package/package.json +147 -9
  141. package/sdk/api/client.ts +51 -51
  142. package/sdk/api/datetime.ts +5 -5
  143. package/sdk/api/index.ts +28 -33
  144. package/sdk/api/metadata.ts +4 -4
  145. package/sdk/api.ts +24 -0
  146. package/sdk/api.types.ts +58 -0
  147. package/sdk/auth/AuthProvider.tsx +18 -18
  148. package/sdk/auth/authClient.ts +9 -9
  149. package/sdk/auth/authConfig.ts +9 -9
  150. package/sdk/auth/index.ts +5 -5
  151. package/sdk/auth/types.ts +21 -21
  152. package/sdk/auth/useAuth.ts +2 -2
  153. package/sdk/auth.ts +22 -0
  154. package/sdk/auth.types.ts +28 -0
  155. package/sdk/base-types.ts +45 -0
  156. package/sdk/components/hooks/index.ts +22 -22
  157. package/sdk/components/hooks/useFilter/index.ts +8 -14
  158. package/sdk/components/hooks/useFilter/types.ts +29 -58
  159. package/sdk/components/hooks/useFilter/useFilter.ts +41 -44
  160. package/sdk/components/hooks/useForm/apiClient.ts +8 -8
  161. package/sdk/components/hooks/useForm/expressionValidator.utils.ts +18 -18
  162. package/sdk/components/hooks/useForm/index.ts +24 -24
  163. package/sdk/components/hooks/useForm/optimizedExpressionValidator.utils.ts +22 -22
  164. package/sdk/components/hooks/useForm/ruleClassifier.utils.ts +26 -62
  165. package/sdk/components/hooks/useForm/schemaParser.utils.ts +24 -24
  166. package/sdk/components/hooks/useForm/types.ts +66 -82
  167. package/sdk/components/hooks/useForm/useForm.ts +15 -21
  168. package/sdk/components/hooks/useKanban/apiClient.ts +54 -54
  169. package/sdk/components/hooks/useKanban/context.ts +3 -3
  170. package/sdk/components/hooks/useKanban/dragDropManager.ts +19 -19
  171. package/sdk/components/hooks/useKanban/index.ts +26 -26
  172. package/sdk/components/hooks/useKanban/types.ts +69 -71
  173. package/sdk/components/hooks/useKanban/useKanban.ts +43 -51
  174. package/sdk/components/hooks/useKanban/useKanbanSimple.ts +4 -4
  175. package/sdk/components/hooks/useTable/index.ts +5 -1
  176. package/sdk/components/hooks/useTable/types.ts +10 -10
  177. package/sdk/components/hooks/useTable/useTable.ts +10 -10
  178. package/sdk/filter.ts +13 -0
  179. package/sdk/filter.types.ts +17 -0
  180. package/sdk/form.ts +15 -0
  181. package/sdk/form.types.ts +46 -0
  182. package/sdk/kanban.ts +23 -0
  183. package/sdk/kanban.types.ts +50 -0
  184. package/sdk/kanban.ui.ts +16 -0
  185. package/sdk/table.ts +7 -0
  186. package/sdk/table.types.ts +13 -0
  187. package/sdk/types/base-fields.ts +47 -47
  188. package/sdk/types/common.ts +47 -71
  189. package/sdk/types/index.ts +1 -1
  190. package/sdk/utils/formatting.ts +4 -4
  191. package/sdk/utils.ts +10 -0
  192. package/dist/index.cjs +0 -45
  193. package/dist/index.mjs +0 -6387
@@ -1,93 +1,77 @@
1
1
  /**
2
2
  * Sort direction for API queries (matching API spec)
3
3
  */
4
- export type SortDirection = "ASC" | "DESC";
4
+ export type SortDirectionType = "ASC" | "DESC";
5
5
  /**
6
6
  * Sort configuration: array of field-direction mappings
7
7
  * Format: [{ "fieldName": "ASC" }, { "anotherField": "DESC" }]
8
8
  */
9
- export type SortOption = Record<string, SortDirection>;
9
+ export type SortOptionType = Record<string, SortDirectionType>;
10
10
  /**
11
11
  * Sort configuration: array of sort options
12
12
  */
13
- export type Sort = SortOption[];
13
+ export type SortType = SortOptionType[];
14
14
  /**
15
15
  * Condition operators for individual conditions (leaf nodes)
16
16
  * Used in Condition.Operator
17
17
  */
18
- export type ConditionOperator = "EQ" | "NE" | "GT" | "GTE" | "LT" | "LTE" | "Between" | "NotBetween" | "IN" | "NIN" | "Empty" | "NotEmpty" | "Contains" | "NotContains" | "MinLength" | "MaxLength";
18
+ export type ConditionOperatorType = "EQ" | "NE" | "GT" | "GTE" | "LT" | "LTE" | "Between" | "NotBetween" | "IN" | "NIN" | "Empty" | "NotEmpty" | "Contains" | "NotContains" | "MinLength" | "MaxLength";
19
19
  /**
20
20
  * Operators for combining conditions in a group (tree nodes)
21
21
  * Used in ConditionGroup.Operator
22
22
  */
23
- export type ConditionGroupOperator = "And" | "Or" | "Not";
23
+ export type ConditionGroupOperatorType = "And" | "Or" | "Not";
24
24
  /**
25
25
  * RHS value type for filter conditions
26
26
  */
27
- export type FilterRHSType = "Constant" | "BOField" | "AppVariable";
27
+ export type FilterRHSTypeType = "Constant" | "BOField" | "AppVariable";
28
28
  /**
29
29
  * Leaf condition (actual field comparison)
30
30
  */
31
- export interface Condition {
31
+ export interface ConditionType {
32
32
  /** Optional ID for hook state management (omitted in API payload) */
33
33
  id?: string;
34
34
  /** Condition operator */
35
- Operator: ConditionOperator;
35
+ Operator: ConditionOperatorType;
36
36
  /** Left-hand side field name */
37
37
  LHSField: string;
38
38
  /** Right-hand side value */
39
39
  RHSValue: any;
40
40
  /** Right-hand side type (optional, defaults to Constant) */
41
- RHSType?: FilterRHSType;
41
+ RHSType?: FilterRHSTypeType;
42
42
  }
43
43
  /**
44
44
  * Group combining conditions (recursive structure)
45
45
  */
46
- export interface ConditionGroup {
46
+ export interface ConditionGroupType {
47
47
  /** Optional ID for hook state management (omitted in API payload) */
48
48
  id?: string;
49
49
  /** Group operator (And, Or, Not) */
50
- Operator: ConditionGroupOperator;
50
+ Operator: ConditionGroupOperatorType;
51
51
  /** Nested conditions (can be Condition or ConditionGroup) */
52
- Condition: Array<Condition | ConditionGroup>;
52
+ Condition: Array<ConditionType | ConditionGroupType>;
53
53
  }
54
54
  /**
55
55
  * Root filter type (alias for ConditionGroup)
56
56
  */
57
- export type Filter = ConditionGroup;
58
- /**
59
- * @deprecated Use `Condition` instead
60
- */
61
- export type FilterCondition = Condition;
62
- /**
63
- * @deprecated Use `ConditionGroup` instead
64
- */
65
- export type FilterLogical = ConditionGroup;
66
- /**
67
- * @deprecated Use `ConditionGroupOperator` instead
68
- */
69
- export type FilterOperator = ConditionGroupOperator;
70
- /**
71
- * @deprecated Use `Condition | ConditionGroup` instead
72
- */
73
- export type FilterNode = Condition | ConditionGroup;
57
+ export type FilterType = ConditionGroupType;
74
58
  /**
75
59
  * DateTime encoding format used by the API
76
60
  */
77
- export interface DateTimeEncoded {
61
+ export interface DateTimeEncodedType {
78
62
  $__dt__: number;
79
63
  }
80
64
  /**
81
65
  * Date encoding format used by the API
82
66
  */
83
- export interface DateEncoded {
67
+ export interface DateEncodedType {
84
68
  $__d__: string;
85
69
  }
86
70
  /**
87
71
  * Standard paginated list response
88
72
  * @template T - Type of items in the list
89
73
  */
90
- export interface ListResponse<T> {
74
+ export interface ListResponseType<T> {
91
75
  /** Array of items for current page */
92
76
  Data: T[];
93
77
  }
@@ -95,43 +79,43 @@ export interface ListResponse<T> {
95
79
  * Read API response wrapper
96
80
  * @template T - Type of the data object
97
81
  */
98
- export interface ReadResponse<T> {
82
+ export interface ReadResponseType<T> {
99
83
  /** The data object */
100
84
  Data: T;
101
85
  }
102
86
  /**
103
87
  * Create/Update API response
104
88
  */
105
- export interface CreateUpdateResponse {
89
+ export interface CreateUpdateResponseType {
106
90
  /** ID of the created/updated record */
107
91
  _id: string;
108
92
  }
109
93
  /**
110
94
  * Delete API response
111
95
  */
112
- export interface DeleteResponse {
96
+ export interface DeleteResponseType {
113
97
  /** Status of the delete operation */
114
98
  status: "success";
115
99
  }
116
100
  /**
117
101
  * Count API response
118
102
  */
119
- export interface CountResponse {
103
+ export interface CountResponseType {
120
104
  /** Total count of matching records */
121
105
  Count: number;
122
106
  }
123
107
  /**
124
108
  * Options for list queries (API request format)
125
109
  */
126
- export interface ListOptions {
110
+ export interface ListOptionsType {
127
111
  /** Query type (defaults to "List") */
128
112
  Type?: "List";
129
113
  /** Specific fields to return */
130
114
  Field?: string[];
131
115
  /** Filter criteria */
132
- Filter?: Filter;
116
+ Filter?: FilterType;
133
117
  /** Sort configuration */
134
- Sort?: Sort;
118
+ Sort?: SortType;
135
119
  /** Search query (separate from filters) */
136
120
  Search?: string;
137
121
  /** Page number (1-indexed) */
@@ -142,60 +126,60 @@ export interface ListOptions {
142
126
  /**
143
127
  * Metric aggregation function types
144
128
  */
145
- export type MetricType = "Sum" | "Avg" | "Count" | "Max" | "Min" | "DistinctCount" | "BlankCount" | "NotBlankCount" | "Concat" | "DistinctConcat";
129
+ export type MetricTypeType = "Sum" | "Avg" | "Count" | "Max" | "Min" | "DistinctCount" | "BlankCount" | "NotBlankCount" | "Concat" | "DistinctConcat";
146
130
  /**
147
131
  * Metric field configuration
148
132
  */
149
- export interface MetricField {
133
+ export interface MetricFieldType {
150
134
  /** Field to aggregate */
151
135
  Field: string;
152
136
  /** Aggregation function type */
153
- Type: MetricType;
137
+ Type: MetricTypeType;
154
138
  }
155
139
  /**
156
140
  * Options for metric/aggregate queries
157
141
  */
158
- export interface MetricOptions {
142
+ export interface MetricOptionsType {
159
143
  /** Query type (always "Metric") */
160
144
  Type: "Metric";
161
145
  /** Fields to group by */
162
146
  GroupBy: string[];
163
147
  /** Metric definitions */
164
- Metric: MetricField[];
148
+ Metric: MetricFieldType[];
165
149
  /** Optional filter criteria */
166
- Filter?: Filter;
150
+ Filter?: FilterType;
167
151
  }
168
152
  /**
169
153
  * Response from metric endpoint
170
154
  */
171
- export interface MetricResponse {
155
+ export interface MetricResponseType {
172
156
  /** Aggregated data rows */
173
157
  Data: Record<string, any>[];
174
158
  }
175
159
  /**
176
160
  * Pivot table header item (hierarchical)
177
161
  */
178
- export interface PivotHeaderItem {
162
+ export interface PivotHeaderItemType {
179
163
  /** Header key/label */
180
164
  Key: string;
181
165
  /** Child headers for nested grouping */
182
- Children?: PivotHeaderItem[] | null;
166
+ Children?: PivotHeaderItemType[] | null;
183
167
  }
184
168
  /**
185
169
  * Pivot response data structure
186
170
  */
187
- export interface PivotResponseData {
171
+ export interface PivotResponseDataType {
188
172
  /** Row headers */
189
- RowHeader: PivotHeaderItem[];
173
+ RowHeader: PivotHeaderItemType[];
190
174
  /** Column headers */
191
- ColumnHeader: PivotHeaderItem[];
175
+ ColumnHeader: PivotHeaderItemType[];
192
176
  /** Value matrix [row][column] */
193
177
  Value: (number | string | null)[][];
194
178
  }
195
179
  /**
196
180
  * Options for pivot queries
197
181
  */
198
- export interface PivotOptions {
182
+ export interface PivotOptionsType {
199
183
  /** Query type (always "Pivot") */
200
184
  Type: "Pivot";
201
185
  /** Row dimension fields */
@@ -203,35 +187,35 @@ export interface PivotOptions {
203
187
  /** Column dimension fields */
204
188
  Column: string[];
205
189
  /** Metric definitions */
206
- Metric: MetricField[];
190
+ Metric: MetricFieldType[];
207
191
  /** Optional filter criteria */
208
- Filter?: Filter;
192
+ Filter?: FilterType;
209
193
  }
210
194
  /**
211
195
  * Response from pivot endpoint
212
196
  */
213
- export interface PivotResponse {
197
+ export interface PivotResponseType {
214
198
  /** Pivot data including headers and values */
215
- Data: PivotResponseData;
199
+ Data: PivotResponseDataType;
216
200
  }
217
201
  /**
218
202
  * Response from draft operations
219
203
  */
220
- export interface DraftResponse {
204
+ export interface DraftResponseType {
221
205
  /** Computed field values */
222
206
  [fieldName: string]: any;
223
207
  }
224
208
  /**
225
209
  * Response from fields endpoint
226
210
  */
227
- export interface FieldsResponse {
211
+ export interface FieldsResponseType {
228
212
  /** Field metadata */
229
213
  Data: Record<string, any>[];
230
214
  }
231
215
  /**
232
216
  * Single option returned from fetch field endpoint
233
217
  */
234
- export interface FetchFieldOption {
218
+ export interface FetchFieldOptionType {
235
219
  /** The value to be stored */
236
220
  Value: string;
237
221
  /** The display label */
@@ -240,8 +224,8 @@ export interface FetchFieldOption {
240
224
  /**
241
225
  * Response from fetch field endpoint
242
226
  */
243
- export interface FetchFieldResponse {
227
+ export interface FetchFieldResponseType {
244
228
  /** Array of field options */
245
- Data: FetchFieldOption[];
229
+ Data: FetchFieldOptionType[];
246
230
  }
247
231
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../sdk/types/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;AAEhC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GACzC,SAAS,GAAG,YAAY,GAAG,IAAI,GAAG,KAAK,GACvC,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,aAAa,GACjD,WAAW,GAAG,WAAW,CA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AAE,CAAC;IACjB,yBAAyB;IACzB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,+BAA+B;IAC/B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,IAAI,EAAE,qBAAqB,CAAC;CAC7B;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAAC;CAC1B;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;CAC7B;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,6BAA6B;IAC7B,IAAI,EAAE,oBAAoB,EAAE,CAAC;CAC9B"}
package/dist/types.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";
package/dist/types.mjs ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,129 @@
1
+ import { useState as I, useMemo as B, useCallback as u } from "react";
2
+ const c = (t) => "Condition" in t, M = (t) => "LHSField" in t;
3
+ let D = 0;
4
+ const a = () => `filter_${Date.now()}_${++D}`, H = (t) => t.id ? t : { ...t, id: a() }, h = (t) => t.map((o) => {
5
+ const n = H(o);
6
+ return c(n) ? {
7
+ ...n,
8
+ Condition: h(n.Condition)
9
+ } : n;
10
+ }), w = (t) => t.map((o) => {
11
+ if (c(o)) {
12
+ const { id: O, ...C } = o;
13
+ return {
14
+ ...C,
15
+ Condition: w(o.Condition)
16
+ };
17
+ }
18
+ const { id: n, ...r } = o;
19
+ return r;
20
+ }), G = (t, o) => {
21
+ for (const n of t) {
22
+ if (n.id === o)
23
+ return n;
24
+ if (c(n)) {
25
+ const r = G(n.Condition, o);
26
+ if (r) return r;
27
+ }
28
+ }
29
+ }, f = (t, o, n) => t.map((r) => r.id === o ? n(r) : c(r) ? {
30
+ ...r,
31
+ Condition: f(r.Condition, o, n)
32
+ } : r), T = (t, o) => t.filter((n) => n.id !== o).map((n) => c(n) ? {
33
+ ...n,
34
+ Condition: T(n.Condition, o)
35
+ } : n), l = (t, o, n) => t.map((r) => r.id === o && c(r) ? {
36
+ ...r,
37
+ Condition: [...r.Condition, n]
38
+ } : c(r) ? {
39
+ ...r,
40
+ Condition: l(r.Condition, o, n)
41
+ } : r);
42
+ function P(t = {}) {
43
+ const [o, n] = I(
44
+ () => h(t.initialConditions || [])
45
+ ), [r, O] = I(
46
+ t.initialOperator || "And"
47
+ ), C = B(() => {
48
+ if (o.length !== 0)
49
+ return {
50
+ Operator: r,
51
+ Condition: w(o)
52
+ };
53
+ }, [o, r]), g = o.length > 0, v = u((i) => {
54
+ const e = a(), d = { ...i, id: e };
55
+ return n((s) => [...s, d]), e;
56
+ }, []), F = u((i) => {
57
+ const e = a(), d = {
58
+ id: e,
59
+ Operator: i,
60
+ Condition: []
61
+ };
62
+ return n((s) => [...s, d]), e;
63
+ }, []), S = u(
64
+ (i, e) => {
65
+ const d = a(), s = { ...e, id: d };
66
+ return n((p) => l(p, i, s)), d;
67
+ },
68
+ []
69
+ ), y = u(
70
+ (i, e) => {
71
+ const d = a(), s = {
72
+ id: d,
73
+ Operator: e,
74
+ Condition: []
75
+ };
76
+ return n((p) => l(p, i, s)), d;
77
+ },
78
+ []
79
+ ), _ = u(
80
+ (i, e) => {
81
+ n(
82
+ (d) => f(d, i, (s) => c(s) ? s : { ...s, ...e })
83
+ );
84
+ },
85
+ []
86
+ ), $ = u(
87
+ (i, e) => {
88
+ n(
89
+ (d) => f(d, i, (s) => c(s) ? { ...s, Operator: e } : s)
90
+ );
91
+ },
92
+ []
93
+ ), b = u((i) => {
94
+ n((e) => T(e, i));
95
+ }, []), k = u(
96
+ (i) => G(o, i),
97
+ [o]
98
+ ), x = u(() => {
99
+ n([]);
100
+ }, []), A = u((i) => {
101
+ O(i);
102
+ }, []);
103
+ return {
104
+ // State
105
+ operator: r,
106
+ items: o,
107
+ payload: C,
108
+ hasConditions: g,
109
+ // Add operations
110
+ add: v,
111
+ addGroup: F,
112
+ addTo: S,
113
+ addGroupTo: y,
114
+ // Update operations
115
+ update: _,
116
+ updateOperator: $,
117
+ // Remove & access
118
+ remove: b,
119
+ get: k,
120
+ // Utility
121
+ clear: x,
122
+ setOperator: A
123
+ };
124
+ }
125
+ export {
126
+ c as a,
127
+ M as i,
128
+ P as u
129
+ };
@@ -0,0 +1 @@
1
+ "use strict";const d=require("react"),a=r=>"Condition"in r,A=r=>"LHSField"in r;let B=0;const c=()=>`filter_${Date.now()}_${++B}`,D=r=>r.id?r:{...r,id:c()},k=r=>r.map(o=>{const n=D(o);return a(n)?{...n,Condition:k(n.Condition)}:n}),O=r=>r.map(o=>{if(a(o)){const{id:b,...C}=o;return{...C,Condition:O(o.Condition)}}const{id:n,...t}=o;return t}),G=(r,o)=>{for(const n of r){if(n.id===o)return n;if(a(n)){const t=G(n.Condition,o);if(t)return t}}},p=(r,o,n)=>r.map(t=>t.id===o?n(t):a(t)?{...t,Condition:p(t.Condition,o,n)}:t),I=(r,o)=>r.filter(n=>n.id!==o).map(n=>a(n)?{...n,Condition:I(n.Condition,o)}:n),f=(r,o,n)=>r.map(t=>t.id===o&&a(t)?{...t,Condition:[...t.Condition,n]}:a(t)?{...t,Condition:f(t.Condition,o,n)}:t);function H(r={}){const[o,n]=d.useState(()=>k(r.initialConditions||[])),[t,b]=d.useState(r.initialOperator||"And"),C=d.useMemo(()=>{if(o.length!==0)return{Operator:t,Condition:O(o)}},[o,t]),h=o.length>0,w=d.useCallback(e=>{const i=c(),u={...e,id:i};return n(s=>[...s,u]),i},[]),T=d.useCallback(e=>{const i=c(),u={id:i,Operator:e,Condition:[]};return n(s=>[...s,u]),i},[]),g=d.useCallback((e,i)=>{const u=c(),s={...i,id:u};return n(l=>f(l,e,s)),u},[]),v=d.useCallback((e,i)=>{const u=c(),s={id:u,Operator:i,Condition:[]};return n(l=>f(l,e,s)),u},[]),F=d.useCallback((e,i)=>{n(u=>p(u,e,s=>a(s)?s:{...s,...i}))},[]),S=d.useCallback((e,i)=>{n(u=>p(u,e,s=>a(s)?{...s,Operator:i}:s))},[]),y=d.useCallback(e=>{n(i=>I(i,e))},[]),_=d.useCallback(e=>G(o,e),[o]),$=d.useCallback(()=>{n([])},[]),q=d.useCallback(e=>{b(e)},[]);return{operator:t,items:o,payload:C,hasConditions:h,add:w,addGroup:T,addTo:g,addGroupTo:v,update:F,updateOperator:S,remove:y,get:_,clear:$,setOperator:q}}exports.isCondition=A;exports.isConditionGroup=a;exports.useFilter=H;
@@ -1,15 +1,15 @@
1
- import type { CurrencyValue, JSONValue } from '../types/base-fields';
1
+ import type { CurrencyValueType, JSONValueType } from '../types/base-fields';
2
2
  /**
3
3
  * Data formatting utilities for display and conversion
4
4
  */
5
5
  /**
6
6
  * Format currency value for display
7
7
  */
8
- export declare function formatCurrency(value: CurrencyValue): string;
8
+ export declare function formatCurrency(value: CurrencyValueType): string;
9
9
  /**
10
10
  * Parse currency string to currency object
11
11
  */
12
- export declare function parseCurrency(value: string): CurrencyValue | null;
12
+ export declare function parseCurrency(value: string): CurrencyValueType | null;
13
13
  /**
14
14
  * Format date for display
15
15
  */
@@ -25,7 +25,7 @@ export declare function formatNumber(value: number, precision?: number): string;
25
25
  /**
26
26
  * Format JSON value for display
27
27
  */
28
- export declare function formatJSON(value: JSONValue, indent?: number): string;
28
+ export declare function formatJSON(value: JSONValueType, indent?: number): string;
29
29
  /**
30
30
  * Format array values for display
31
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../sdk/utils/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,M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,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,MAAM,CAQT;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,MAAW,GAAG,MAAM,CAU5E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAYvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GACpH,MAAM,CAsCR"}
package/dist/utils.cjs ADDED
@@ -0,0 +1,4 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("./cn-mXUIg4vp.cjs");function i(r){return typeof r=="string"?r:typeof r=="object"&&r!==null?new Intl.NumberFormat("en-US",{style:"currency",currency:r.currency}).format(r.value):"Invalid Currency"}function l(r){const t=r.match(/^(?:([A-Z]{3})\s+(\d+\.?\d*))|(?:(\d+\.?\d*)\s+([A-Z]{3}))$/);if(t){const n=t[1]||t[4],e=parseFloat(t[2]||t[3]);if(!isNaN(e))return{value:e,currency:n}}return null}function o(r,t="medium"){if(!(r instanceof Date)||isNaN(r.getTime()))return"Invalid Date";const n={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"}}[t];return new Intl.DateTimeFormat("en-US",n).format(r)}function a(r,t="medium"){if(!(r instanceof Date)||isNaN(r.getTime()))return"Invalid Date";const n={short:{dateStyle:"short",timeStyle:"short"},medium:{dateStyle:"medium",timeStyle:"medium"},long:{dateStyle:"long",timeStyle:"long"}}[t];return new Intl.DateTimeFormat("en-US",n).format(r)}function c(r,t=2){return typeof r!="number"||isNaN(r)?"Invalid Number":r.toFixed(t)}function f(r,t=2){try{return JSON.stringify(r,null,t)}catch{return"Invalid JSON"}}function m(r,t,n=", "){return Array.isArray(r)?t?r.map(t).join(n):r.map(e=>String(e)).join(n):"Invalid Array"}function u(r,t){return typeof r!="boolean"?"Invalid Boolean":r?(t==null?void 0:t.trueLabel)||"Yes":(t==null?void 0:t.falseLabel)||"No"}function d(r,t=50){return typeof r!="string"?"Invalid String":r.length<=t?r:r.slice(0,t-3)+"..."}function s(r,t){if(typeof r!="string")return"Invalid Text";const n=r.split(`
2
+ `);return t&&n.length>t?n.slice(0,t).join(`
3
+ `)+`
4
+ ...`:r}function S(r,t){if(r==null)return"";switch(t||(typeof r=="boolean"?t="boolean":typeof r=="number"?t="number":r instanceof Date?t="datetime":Array.isArray(r)?t="array":typeof r=="object"?t="json":t="string"),t){case"id":case"string":return String(r);case"textarea":return s(String(r));case"number":return c(r);case"boolean":return u(r);case"date":return o(r);case"datetime":return a(r);case"currency":return i(r);case"json":return f(r);case"array":return m(r);default:return String(r)}}exports.cn=y.cn;exports.formatArray=m;exports.formatBoolean=u;exports.formatCurrency=i;exports.formatDate=o;exports.formatDateTime=a;exports.formatFieldValue=S;exports.formatJSON=f;exports.formatNumber=c;exports.formatTextArea=s;exports.parseCurrency=l;exports.truncateString=d;
@@ -0,0 +1,3 @@
1
+ export * from './utils/formatting';
2
+ export * from './utils/cn';
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../sdk/utils.ts"],"names":[],"mappings":"AAMA,cAAc,oBAAoB,CAAC;AAGnC,cAAc,YAAY,CAAC"}
package/dist/utils.mjs ADDED
@@ -0,0 +1,105 @@
1
+ import { c as b } from "./cn-Dr87sK3i.js";
2
+ function i(r) {
3
+ return typeof r == "string" ? r : typeof r == "object" && r !== null ? new Intl.NumberFormat("en-US", {
4
+ style: "currency",
5
+ currency: r.currency
6
+ }).format(r.value) : "Invalid Currency";
7
+ }
8
+ function y(r) {
9
+ const t = r.match(/^(?:([A-Z]{3})\s+(\d+\.?\d*))|(?:(\d+\.?\d*)\s+([A-Z]{3}))$/);
10
+ if (t) {
11
+ const n = t[1] || t[4], e = parseFloat(t[2] || t[3]);
12
+ if (!isNaN(e))
13
+ return { value: e, currency: n };
14
+ }
15
+ return null;
16
+ }
17
+ function o(r, t = "medium") {
18
+ if (!(r instanceof Date) || isNaN(r.getTime()))
19
+ return "Invalid Date";
20
+ const n = {
21
+ short: { dateStyle: "short" },
22
+ medium: { dateStyle: "medium" },
23
+ long: { dateStyle: "long" }
24
+ }[t];
25
+ return new Intl.DateTimeFormat("en-US", n).format(r);
26
+ }
27
+ function c(r, t = "medium") {
28
+ if (!(r instanceof Date) || isNaN(r.getTime()))
29
+ return "Invalid Date";
30
+ const n = {
31
+ short: { dateStyle: "short", timeStyle: "short" },
32
+ medium: { dateStyle: "medium", timeStyle: "medium" },
33
+ long: { dateStyle: "long", timeStyle: "long" }
34
+ }[t];
35
+ return new Intl.DateTimeFormat("en-US", n).format(r);
36
+ }
37
+ function a(r, t = 2) {
38
+ return typeof r != "number" || isNaN(r) ? "Invalid Number" : r.toFixed(t);
39
+ }
40
+ function f(r, t = 2) {
41
+ try {
42
+ return JSON.stringify(r, null, t);
43
+ } catch {
44
+ return "Invalid JSON";
45
+ }
46
+ }
47
+ function m(r, t, n = ", ") {
48
+ return Array.isArray(r) ? t ? r.map(t).join(n) : r.map((e) => String(e)).join(n) : "Invalid Array";
49
+ }
50
+ function u(r, t) {
51
+ return typeof r != "boolean" ? "Invalid Boolean" : r ? (t == null ? void 0 : t.trueLabel) || "Yes" : (t == null ? void 0 : t.falseLabel) || "No";
52
+ }
53
+ function l(r, t = 50) {
54
+ return typeof r != "string" ? "Invalid String" : r.length <= t ? r : r.slice(0, t - 3) + "...";
55
+ }
56
+ function s(r, t) {
57
+ if (typeof r != "string")
58
+ return "Invalid Text";
59
+ const n = r.split(`
60
+ `);
61
+ return t && n.length > t ? n.slice(0, t).join(`
62
+ `) + `
63
+ ...` : r;
64
+ }
65
+ function d(r, t) {
66
+ if (r == null)
67
+ return "";
68
+ switch (t || (typeof r == "boolean" ? t = "boolean" : typeof r == "number" ? t = "number" : r instanceof Date ? t = "datetime" : Array.isArray(r) ? t = "array" : typeof r == "object" ? t = "json" : t = "string"), t) {
69
+ case "id":
70
+ case "string":
71
+ return String(r);
72
+ case "textarea":
73
+ return s(String(r));
74
+ case "number":
75
+ return a(r);
76
+ case "boolean":
77
+ return u(r);
78
+ case "date":
79
+ return o(r);
80
+ case "datetime":
81
+ return c(r);
82
+ case "currency":
83
+ return i(r);
84
+ case "json":
85
+ return f(r);
86
+ case "array":
87
+ return m(r);
88
+ default:
89
+ return String(r);
90
+ }
91
+ }
92
+ export {
93
+ b as cn,
94
+ m as formatArray,
95
+ u as formatBoolean,
96
+ i as formatCurrency,
97
+ o as formatDate,
98
+ c as formatDateTime,
99
+ d as formatFieldValue,
100
+ f as formatJSON,
101
+ a as formatNumber,
102
+ s as formatTextArea,
103
+ y as parseCurrency,
104
+ l as truncateString
105
+ };