@ram_28/kf-ai-sdk 2.0.13 → 2.0.14

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/docs/bdo.md CHANGED
@@ -130,10 +130,10 @@ product.product_name.defaultValue // unknown
130
130
  | `BooleanField` | — | |
131
131
  | `DateField` | — | Format: YYYY-MM-DD |
132
132
  | `DateTimeField` | `precision` | Format: YYYY-MM-DDTHH:MM:SS |
133
- | `SelectField` | **`options`**, `fetchOptions()` | `.options` returns `{ value, label }[]` |
134
- | `ReferenceField` | `fetchOptions()`, `referenceBdo` | Value is object `{ _id, _name, ... }` |
133
+ | `SelectField` | **`options`**, `fetchOptions(instanceId)` | `.options` returns `{ value, label }[]` |
134
+ | `ReferenceField` | `fetchOptions(instanceId)`, `referenceBdo` | Value is object `{ _id, _name, ... }` |
135
135
  | `TextField` | `format` | Long text |
136
- | `UserField` | | Value: `{ _id, _name }` |
136
+ | `UserField` | `fetchOptions(instanceId)` | Value: `{ _id, _name }` |
137
137
  | `ImageField` | — | Value: `FileType \| null` |
138
138
  | `FileField` | — | Value: `FileType[]` |
139
139
 
package/docs/useForm.md CHANGED
@@ -111,6 +111,7 @@ ReferenceField stores an object `{ _id, _name, ... }`, not a string. Use the pre
111
111
  // ✅ CORRECT
112
112
  <ReferenceSelect
113
113
  bdoField={bdo.category}
114
+ instanceId={id || String(watch("_id") ?? "")}
114
115
  value={watch(bdo.category.id)}
115
116
  onChange={(val) => setValue(bdo.category.id, val, { shouldDirty: true })}
116
117
  />
@@ -251,6 +252,7 @@ export default function ProductForm() {
251
252
  <label>{bdo.category.label}</label>
252
253
  <ReferenceSelect
253
254
  bdoField={bdo.category}
255
+ instanceId={id || String(watch("_id") ?? "")}
254
256
  value={watch(bdo.category.id)}
255
257
  onChange={(val) => setValue(bdo.category.id, val, { shouldDirty: true })}
256
258
  />
@@ -368,6 +370,7 @@ ValidationMode.OnBlur / .OnChange / .OnSubmit / .OnTouched / .All
368
370
  | `BooleanField` | `<Checkbox checked={watch()} onCheckedChange={v => setValue()} />` |
369
371
  | `DateField` | `<input type="date" {...register(bdo.field.id)} />` |
370
372
  | `DateTimeField` | `<input type="datetime-local" {...register(bdo.field.id)} />` |
371
- | `ReferenceField` | `<ReferenceSelect bdoField={bdo.field} value={watch()} onChange={...} />` |
373
+ | `ReferenceField` | `<ReferenceSelect bdoField={bdo.field} instanceId={id \|\| String(watch("_id") ?? "")} value={watch()} onChange={...} />` |
374
+ | `UserField` | `<ReferenceSelect bdoField={bdo.field} instanceId={id \|\| String(watch("_id") ?? "")} value={watch()} onChange={...} />` |
372
375
  | `ImageField` | `<ImageUpload field={item.field} value={watch()} boId={} instanceId={} fieldId={} />` |
373
376
  | `FileField` | `<FileUpload field={item.field} value={watch()} boId={} instanceId={} fieldId={} />` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ram_28/kf-ai-sdk",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "description": "Type-safe, AI-driven SDK for building modern web applications with role-based access control",
5
5
  "author": "Ramprasad",
6
6
  "license": "MIT",