@factorialco/f0-react 1.403.1 → 1.404.0

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.
@@ -2936,6 +2936,16 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
2936
2936
  * When omitted, the cell is always rendered read-only.
2937
2937
  */
2938
2938
  editType?: (item: R) => EditableTableCellEditType | undefined;
2939
+ /**
2940
+ * Configuration for `"select"` cells. Required when `editType` returns `"select"`.
2941
+ * Accepts either static `options` or a `source` + `mapOptions` for async data.
2942
+ *
2943
+ * If `editType` returns `"select"` but `selectConfig` is missing, the cell
2944
+ * falls back to a non-editable display with a `console.warn` at runtime.
2945
+ * Type-level enforcement is not possible because `editType` is a per-row
2946
+ * function whose return value isn't statically known.
2947
+ */
2948
+ selectConfig?: SelectCellConfig<R>;
2939
2949
  };
2940
2950
 
2941
2951
  declare type EditableTableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = Omit<TableVisualizationOptions<R, _Filters, Sortings, Summaries>, "columns"> & {
@@ -5808,6 +5818,26 @@ export declare const Select: <T extends string = string, R = unknown>(props: F0S
5808
5818
  ref?: React.Ref<HTMLButtonElement>;
5809
5819
  }) => React.ReactElement;
5810
5820
 
5821
+ /**
5822
+ * Configuration for select-type cells. Mirrors F0Select's two data modes:
5823
+ * - Static `options` (array or per-row function)
5824
+ * - Async `source` (DataSourceDefinition) with `mapOptions`
5825
+ */
5826
+ declare type SelectCellConfig<R extends RecordType> = {
5827
+ placeholder?: string;
5828
+ clearable?: boolean;
5829
+ showSearchBox?: boolean;
5830
+ defaultItem?: (item: R) => F0SelectItemObject<string, RecordType> | undefined;
5831
+ } & ({
5832
+ options: F0SelectItemProps<string>[] | ((item: R) => F0SelectItemProps<string>[]);
5833
+ source?: never;
5834
+ mapOptions?: never;
5835
+ } | {
5836
+ source: Omit<DataSourceDefinition<RecordType, FiltersDefinition, SortingsDefinition, GroupingDefinition<RecordType>>, "selectable" | "grouping" | "defaultGrouping" | "currentGrouping" | "fetchChildren" | "itemsWithChildren" | "childrenCount">;
5837
+ mapOptions: (record: RecordType) => F0SelectItemProps<string, RecordType>;
5838
+ options?: never;
5839
+ });
5840
+
5811
5841
  /**
5812
5842
  * Represents a collection of selected items.
5813
5843
  * @template T - The type of items in the collection
@@ -3,8 +3,8 @@ import { dw as HI, dv as VI, dq as WI, dr as UI, du as GI, dE as KI, dF as qI, d
3
3
  import { jsx as c, jsxs as g, Fragment as re } from "react/jsx-runtime";
4
4
  import * as Sn from "react";
5
5
  import z, { PureComponent as Cp, forwardRef as P, useRef as K, useTransition as Sp, useState as R, useLayoutEffect as Va, useContext as js, createContext as Hs, useCallback as J, useMemo as ee, useEffect as W, useId as Wa, useImperativeHandle as Ua, memo as Ga, Fragment as Np, isValidElement as Ip, cloneElement as Ka, Children as qa } from "react";
6
- import { f as Yt, p as Nn, i as tr, D as Ap, L as bi, P as _p, A as Ep, a as nr, b as Tp, c as Dp, G as Lp, g as Do, l as Rp, d as Lo, e as Op, h as Ya, j as Ja, k as Mp, C as Pp, m as Fp, N as je, n as ot, o as Ee, q as zp, r as mr, T as Ue, s as Xa, S as Me, t as Vs, u as $e, v as Ro, w as $p, x as Za, F as Ie, y as Fe, z as In, B as Tr, E as Qa, H as Bp, I as Vt, J as jp, K as Hp, M as Vp, R as Vn, O as Wn, Q as Ws, U as Wp, V as ec, W as tc, X as nc, Y as Up, Z as rc, _ as ic, $ as sc, a0 as oc, a1 as lc, a2 as ac, a3 as Oo, a4 as Gp, a5 as Mo, a6 as Kp, a7 as qp, a8 as Yp, a9 as Jp, aa as Xp, ab as Zp, ac as Qp, ad as em, ae as tm, af as cc, ag as nm, ah as rm, ai as im, aj as dc, ak as Wi, al as sm, am as om, an as Po, ao as uc, ap as lm, aq as am, ar as cm, as as dm, at as um, au as fm, av as hm, aw as pm, ax as mm, ay as fc, az as gm, aA as bm, aB as wm, aC as hc, aD as xm, aE as ym, aF as vm, aG as km, aH as Cm, aI as Sm, aJ as Nm, aK as Fo, aL as Im, aM as Am, aN as _m, aO as Em } from "./useDataCollectionSource-T2-Pxmlu.js";
7
- import { aP as oA, aR as lA, b5 as aA, aQ as cA, aX as dA, b8 as uA, b6 as fA, aY as hA, aZ as pA, aT as mA, a_ as gA, b2 as bA, b4 as wA, aV as xA, b7 as yA, aW as vA, aU as kA, b3 as CA, aS as SA, a$ as NA, b0 as IA, b1 as AA } from "./useDataCollectionSource-T2-Pxmlu.js";
6
+ import { f as Yt, p as Nn, i as tr, D as Ap, L as bi, P as _p, A as Ep, a as nr, b as Tp, c as Dp, G as Lp, g as Do, l as Rp, d as Lo, e as Op, h as Ya, j as Ja, k as Mp, C as Pp, m as Fp, N as je, n as ot, o as Ee, q as zp, r as mr, T as Ue, s as Xa, S as Me, t as Vs, u as $e, v as Ro, w as $p, x as Za, F as Ie, y as Fe, z as In, B as Tr, E as Qa, H as Bp, I as Vt, J as jp, K as Hp, M as Vp, R as Vn, O as Wn, Q as Ws, U as Wp, V as ec, W as tc, X as nc, Y as Up, Z as rc, _ as ic, $ as sc, a0 as oc, a1 as lc, a2 as ac, a3 as Oo, a4 as Gp, a5 as Mo, a6 as Kp, a7 as qp, a8 as Yp, a9 as Jp, aa as Xp, ab as Zp, ac as Qp, ad as em, ae as tm, af as cc, ag as nm, ah as rm, ai as im, aj as dc, ak as Wi, al as sm, am as om, an as Po, ao as uc, ap as lm, aq as am, ar as cm, as as dm, at as um, au as fm, av as hm, aw as pm, ax as mm, ay as fc, az as gm, aA as bm, aB as wm, aC as hc, aD as xm, aE as ym, aF as vm, aG as km, aH as Cm, aI as Sm, aJ as Nm, aK as Fo, aL as Im, aM as Am, aN as _m, aO as Em } from "./useDataCollectionSource-8uOMe8BJ.js";
7
+ import { aP as oA, aR as lA, b5 as aA, aQ as cA, aX as dA, b8 as uA, b6 as fA, aY as hA, aZ as pA, aT as mA, a_ as gA, b2 as bA, b4 as wA, aV as xA, b7 as yA, aW as vA, aU as kA, b3 as CA, aS as SA, a$ as NA, b0 as IA, b1 as AA } from "./useDataCollectionSource-8uOMe8BJ.js";
8
8
  import './experimental.css';const Tm = hf("Search", [
9
9
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
10
10
  ["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
package/dist/f0.d.ts CHANGED
@@ -3121,6 +3121,16 @@ declare type EditableTableColumnDefinition<R extends RecordType, Sortings extend
3121
3121
  * When omitted, the cell is always rendered read-only.
3122
3122
  */
3123
3123
  editType?: (item: R) => EditableTableCellEditType | undefined;
3124
+ /**
3125
+ * Configuration for `"select"` cells. Required when `editType` returns `"select"`.
3126
+ * Accepts either static `options` or a `source` + `mapOptions` for async data.
3127
+ *
3128
+ * If `editType` returns `"select"` but `selectConfig` is missing, the cell
3129
+ * falls back to a non-editable display with a `console.warn` at runtime.
3130
+ * Type-level enforcement is not possible because `editType` is a per-row
3131
+ * function whose return value isn't statically known.
3132
+ */
3133
+ selectConfig?: SelectCellConfig<R>;
3124
3134
  };
3125
3135
 
3126
3136
  declare type EditableTableVisualizationOptions<R extends RecordType, _Filters extends FiltersDefinition, Sortings extends SortingsDefinition, Summaries extends SummariesDefinition> = Omit<TableVisualizationOptions<R, _Filters, Sortings, Summaries>, "columns"> & {
@@ -8265,6 +8275,26 @@ declare type SectionProps = {
8265
8275
  */
8266
8276
  export declare type SectionRenderIf = RenderIfCondition | F0BaseFieldRenderIfFunction;
8267
8277
 
8278
+ /**
8279
+ * Configuration for select-type cells. Mirrors F0Select's two data modes:
8280
+ * - Static `options` (array or per-row function)
8281
+ * - Async `source` (DataSourceDefinition) with `mapOptions`
8282
+ */
8283
+ declare type SelectCellConfig<R extends RecordType> = {
8284
+ placeholder?: string;
8285
+ clearable?: boolean;
8286
+ showSearchBox?: boolean;
8287
+ defaultItem?: (item: R) => F0SelectItemObject<string, RecordType> | undefined;
8288
+ } & ({
8289
+ options: F0SelectItemProps<string>[] | ((item: R) => F0SelectItemProps<string>[]);
8290
+ source?: never;
8291
+ mapOptions?: never;
8292
+ } | {
8293
+ source: Omit<DataSourceDefinition<RecordType, FiltersDefinition, SortingsDefinition, GroupingDefinition<RecordType>>, "selectable" | "grouping" | "defaultGrouping" | "currentGrouping" | "fetchChildren" | "itemsWithChildren" | "childrenCount">;
8294
+ mapOptions: (record: RecordType) => F0SelectItemProps<string, RecordType>;
8295
+ options?: never;
8296
+ });
8297
+
8268
8298
  /**
8269
8299
  * Represents a collection of selected items.
8270
8300
  * @template T - The type of items in the collection
package/dist/f0.js CHANGED
@@ -4,8 +4,8 @@ import { jsx as C, jsxs as W, Fragment as fn } from "react/jsx-runtime";
4
4
  import * as Kn from "react";
5
5
  import Ie, { forwardRef as Qr, useRef as ge, useImperativeHandle as XG, Children as Qv, createContext as Tn, useContext as kr, useState as Ee, useMemo as se, useEffect as Fe, useCallback as oe, useLayoutEffect as n_, createElement as Qd, isValidElement as Hk, Fragment as Wk, memo as $k, useReducer as qG, cloneElement as jG, PureComponent as KG, useId as Q1 } from "react";
6
6
  import { createPortal as Uk, unstable_batchedUpdates as Jd, flushSync as QG } from "react-dom";
7
- import { b9 as Zk, C as JG, b as Yk, ba as uT, bb as eH, f as ey, L as yc, bc as tH, A as rH, a as eh, bd as Xk, be as nH, g as xv, bf as iH, i as aH, bg as oH, d as ru, c as qk, bh as sH, G as lH, aN as uH, bi as cT, bj as cH, e as fH, bk as jk, bl as dH, bm as Kk, bn as Qk, bo as i_, bp as hH, ae as Jk, bq as vH, br as pH, a9 as gH, aa as mH, bs as yH, ab as bH, bt as _H, bu as xH, bv as fT, bw as wH, ac as SH, ad as CH, aE as TH, aF as DH, aJ as AH, aG as MH, aH as EH, aI as LH, ay as IH, aQ as a_, bx as eR, aT as tR, b7 as NH, aU as kH, aR as RH, aW as rR, aX as J1, b5 as PH, by as OH, bz as BH, ao as Fg, a3 as VH, an as ew, ap as tw, aV as zH, aO as nR, bA as iR, bB as aR, aP as FH, b0 as GH, a_ as HH, bC as WH, bD as $H, am as UH } from "./useDataCollectionSource-T2-Pxmlu.js";
8
- import { bF as L0e, ak as I0e, m as N0e, bE as k0e, b3 as R0e, aS as P0e, bG as O0e, bH as B0e, bI as V0e, aC as z0e } from "./useDataCollectionSource-T2-Pxmlu.js";
7
+ import { b9 as Zk, C as JG, b as Yk, ba as uT, bb as eH, f as ey, L as yc, bc as tH, A as rH, a as eh, bd as Xk, be as nH, g as xv, bf as iH, i as aH, bg as oH, d as ru, c as qk, bh as sH, G as lH, aN as uH, bi as cT, bj as cH, e as fH, bk as jk, bl as dH, bm as Kk, bn as Qk, bo as i_, bp as hH, ae as Jk, bq as vH, br as pH, a9 as gH, aa as mH, bs as yH, ab as bH, bt as _H, bu as xH, bv as fT, bw as wH, ac as SH, ad as CH, aE as TH, aF as DH, aJ as AH, aG as MH, aH as EH, aI as LH, ay as IH, aQ as a_, bx as eR, aT as tR, b7 as NH, aU as kH, aR as RH, aW as rR, aX as J1, b5 as PH, by as OH, bz as BH, ao as Fg, a3 as VH, an as ew, ap as tw, aV as zH, aO as nR, bA as iR, bB as aR, aP as FH, b0 as GH, a_ as HH, bC as WH, bD as $H, am as UH } from "./useDataCollectionSource-8uOMe8BJ.js";
8
+ import { bF as L0e, ak as I0e, m as N0e, bE as k0e, b3 as R0e, aS as P0e, bG as O0e, bH as B0e, bI as V0e, aC as z0e } from "./useDataCollectionSource-8uOMe8BJ.js";
9
9
  import { A as G0e, F as H0e, c as W0e, d as $0e, b as U0e, a as Z0e, o as Y0e, u as X0e } from "./F0HILActionConfirmation-B3Hwp5tS.js";
10
10
  import { defaultTranslations as j0e } from "./i18n-provider-defaults.js";
11
11
  import './f0.css';const ZH = {