@nivaro/react 0.1.199 → 0.1.200

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 (3) hide show
  1. package/dist/index.d.ts +16 -2
  2. package/dist/index.js +17777 -17691
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1226,7 +1226,7 @@ export declare interface FieldInterfaceProps {
1226
1226
  itemId: string | null;
1227
1227
  }
1228
1228
 
1229
- export declare function FieldRenderer({ field, value, onChange, relations, collection, itemId, cascadeFilter, requiredParentLabel, onCountChange, displayOnly, prefillParentId }: {
1229
+ export declare function FieldRenderer({ field, value, onChange, relations, collection, itemId, cascadeFilter, requiredParentLabel, narrowedBy, onCountChange, displayOnly, prefillParentId }: {
1230
1230
  field: CMSField;
1231
1231
  value: unknown;
1232
1232
  onChange: (v: unknown) => void;
@@ -1235,6 +1235,12 @@ export declare function FieldRenderer({ field, value, onChange, relations, colle
1235
1235
  itemId: string;
1236
1236
  cascadeFilter?: Record<string, unknown>;
1237
1237
  requiredParentLabel?: string | null;
1238
+ /** Cascade parents currently narrowing an M2O picker (see RelationCombobox). */
1239
+ narrowedBy?: {
1240
+ labels: string[];
1241
+ keys: string[];
1242
+ onClear?: (key: string) => void;
1243
+ };
1238
1244
  onCountChange?: (count: number) => void;
1239
1245
  displayOnly?: boolean;
1240
1246
  prefillParentId?: string;
@@ -3326,13 +3332,21 @@ export declare function RelatedRecordsPanel({ collection, itemId, title, default
3326
3332
  defaultExpanded?: boolean;
3327
3333
  }): JSX.Element;
3328
3334
 
3329
- export declare function RelationCombobox({ collection, value, onChange, disabled, placeholder, extraFilter, autoSelectSingle, optionSort, requiredParent, facets, fieldKey }: {
3335
+ export declare function RelationCombobox({ collection, value, onChange, disabled, placeholder, extraFilter, autoSelectSingle, optionSort, requiredParent, facets, fieldKey, narrowedBy }: {
3330
3336
  collection: string;
3331
3337
  value: unknown;
3332
3338
  onChange: (v: unknown) => void;
3333
3339
  disabled?: boolean;
3334
3340
  placeholder?: string;
3335
3341
  extraFilter?: Record<string, unknown>;
3342
+ /** The parent fields whose current values narrow this picker (cascade
3343
+ * filters). When the narrowed list is EMPTY the panel says which parents
3344
+ * did it and offers to clear one — instead of a blank "No results". */
3345
+ narrowedBy?: {
3346
+ labels: string[];
3347
+ keys: string[];
3348
+ onClear?: (key: string) => void;
3349
+ };
3336
3350
  /** When the filtered option set has EXACTLY one option and the field is
3337
3351
  * empty, pick it automatically (options.auto_select_single). Two or more
3338
3352
  * options — or zero — leave the field blank; an existing value is never