@factorialco/f0-react 2.53.0 → 2.55.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.
- package/dist/experimental.js +2 -2
- package/dist/f0.d.ts +155 -0
- package/dist/f0.js +15427 -14999
- package/dist/{useDataCollectionSource-B5h-cwWc.js → useDataCollectionSource-D0OxkURJ.js} +25 -24
- package/package.json +1 -1
package/dist/experimental.js
CHANGED
|
@@ -2,8 +2,8 @@ import { g as ca, B as da, h as ua, i as fa, j as Ft, k as De, l as ma, m as g,
|
|
|
2
2
|
import { bW as Ac, bV as Lc, c6 as Ec, bS as _c, bT as Oc, bL as Dc, bM as Tc, bN as zc, c7 as Pc, bU as Bc, c2 as Rc, c3 as $c, bO as Wc, bY as Mc, bX as jc, bP as Vc, bQ as Gc, c4 as Hc, c8 as Uc, c5 as Kc, c1 as qc, b_ as Yc, c0 as Zc, bZ as Xc, bR as Jc, b$ as Qc } from "./F0CanvasPanel-Cb-XPsWw.js";
|
|
3
3
|
import { jsx as e, jsxs as o, Fragment as U } from "react/jsx-runtime";
|
|
4
4
|
import se, { forwardRef as j, useRef as G, useTransition as Kr, useState as _, useLayoutEffect as Fn, useId as ct, useContext as Ke, createContext as yt, useEffect as $, useCallback as Q, useMemo as q, Fragment as qr, isValidElement as Yr, cloneElement as An, Children as Ln } from "react";
|
|
5
|
-
import { C as Zr, P as Xr, a as En, M as Jr, R as Dt, b as _n, u as Qr, c as On, S as el, A as tl, B as nl, L as al, d as rl, V as ll, e as il, f as sl, g as ol, O as cl } from "./useDataCollectionSource-
|
|
6
|
-
import { l as td, m as nd, j as ad, x as rd, n as ld, s as id, a3 as sd, w as od, k as cd, D as dd, F as ud, J as fd, E as md, z as hd, a9 as gd, I as pd, K as bd, Q as xd, o as vd, a5 as wd, a6 as yd, a4 as Nd, a7 as Cd, N as kd, U as Sd, a0 as Id, a2 as Fd, p as Ad, r as Ld, t as Ed, G as _d, a8 as Od, H as Dd, T as Td, q as zd, v as Pd, h as Bd, i as Rd, X as $d, Y as Wd, a1 as Md, y as jd, Z as Vd, _ as Gd, W as Hd, $ as Ud } from "./useDataCollectionSource-
|
|
5
|
+
import { C as Zr, P as Xr, a as En, M as Jr, R as Dt, b as _n, u as Qr, c as On, S as el, A as tl, B as nl, L as al, d as rl, V as ll, e as il, f as sl, g as ol, O as cl } from "./useDataCollectionSource-D0OxkURJ.js";
|
|
6
|
+
import { l as td, m as nd, j as ad, x as rd, n as ld, s as id, a3 as sd, w as od, k as cd, D as dd, F as ud, J as fd, E as md, z as hd, a9 as gd, I as pd, K as bd, Q as xd, o as vd, a5 as wd, a6 as yd, a4 as Nd, a7 as Cd, N as kd, U as Sd, a0 as Id, a2 as Fd, p as Ad, r as Ld, t as Ed, G as _d, a8 as Od, H as Dd, T as Td, q as zd, v as Pd, h as Bd, i as Rd, X as $d, Y as Wd, a1 as Md, y as jd, Z as Vd, _ as Gd, W as Hd, $ as Ud } from "./useDataCollectionSource-D0OxkURJ.js";
|
|
7
7
|
const dl = ca("Search", [
|
|
8
8
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
9
9
|
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
package/dist/f0.d.ts
CHANGED
|
@@ -1048,6 +1048,11 @@ declare const alertAvatarVariants: (props?: ({
|
|
|
1048
1048
|
className?: ClassValue;
|
|
1049
1049
|
})) | undefined) => string;
|
|
1050
1050
|
|
|
1051
|
+
export declare type AlertDialogOptions = NotificationDialogBaseOptions & {
|
|
1052
|
+
/** The alert action (default: label "Ok", value true). */
|
|
1053
|
+
confirm?: DialogSimpleAction;
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1051
1056
|
declare type AlertTagProps = ComponentProps<typeof F0TagAlert>;
|
|
1052
1057
|
|
|
1053
1058
|
export declare type AlertVariant = (typeof alertVariantOptions)[number];
|
|
@@ -3097,6 +3102,13 @@ declare const componentTypes: readonly ["layout", "info", "action", "form"];
|
|
|
3097
3102
|
|
|
3098
3103
|
export declare function computeSectionEndIds(elements: SurveyFormBuilderElement[]): Set<string>;
|
|
3099
3104
|
|
|
3105
|
+
export declare type ConfirmDialogOptions = NotificationDialogBaseOptions & {
|
|
3106
|
+
/** The confirm action (default: label "Ok", value true). */
|
|
3107
|
+
confirm?: DialogSimpleAction;
|
|
3108
|
+
/** The cancel action (default: label "Cancel", value false). */
|
|
3109
|
+
cancel?: DialogSimpleAction;
|
|
3110
|
+
};
|
|
3111
|
+
|
|
3100
3112
|
export declare type ContentType = (typeof contentTypes)[number];
|
|
3101
3113
|
|
|
3102
3114
|
export declare const contentTypes: readonly ["text", "person", "people", "team", "company", "alert", "balance", "sparkline"];
|
|
@@ -5033,6 +5045,41 @@ declare type DetailsItemContent = (ComponentProps<typeof DataList.Item> & {
|
|
|
5033
5045
|
type: "file";
|
|
5034
5046
|
});
|
|
5035
5047
|
|
|
5048
|
+
/**
|
|
5049
|
+
* Imperative API for centered dialogs. Requires `<F0Provider>` (which mounts
|
|
5050
|
+
* `DialogsAlikeLayoutProvider`) to be present in the tree.
|
|
5051
|
+
*
|
|
5052
|
+
* @example
|
|
5053
|
+
* const result = await dialog.open({ title, content, actions: { primary: { label: "OK", value: true } } })
|
|
5054
|
+
*/
|
|
5055
|
+
export declare const dialog: {
|
|
5056
|
+
/** Open a dialog. Resolves with the value of the action the user picked. */
|
|
5057
|
+
open: (definition: Optional<DialogDefinition, "id">) => Promise<DialogActionValue>;
|
|
5058
|
+
/** Open a notification-style dialog (info/warning/critical/positive). */
|
|
5059
|
+
notification: (options: NotificationDialogOptions) => Promise<DialogActionValue>;
|
|
5060
|
+
/** Notification dialog with a single confirm action (defaults to "Ok"). */
|
|
5061
|
+
alert: (options: AlertDialogOptions) => Promise<DialogActionValue>;
|
|
5062
|
+
/** Notification dialog with confirm + cancel actions (defaults to Ok/Cancel). */
|
|
5063
|
+
confirm: (options: ConfirmDialogOptions) => Promise<DialogActionValue>;
|
|
5064
|
+
/** Programmatically close a dialog by id (resolves its promise with undefined). */
|
|
5065
|
+
close: (id: DialogId) => void;
|
|
5066
|
+
};
|
|
5067
|
+
|
|
5068
|
+
export declare type DialogAction = Optional<Pick<F0ButtonProps, "label" | "icon" | "disabled">, "icon" | "disabled"> & {
|
|
5069
|
+
value: DialogActionValue;
|
|
5070
|
+
keepOpen?: boolean;
|
|
5071
|
+
nonBlocking?: boolean;
|
|
5072
|
+
};
|
|
5073
|
+
|
|
5074
|
+
export declare type DialogActions = {
|
|
5075
|
+
primary: DialogAction | DialogAction[];
|
|
5076
|
+
secondary?: DialogAction | DialogAction[];
|
|
5077
|
+
};
|
|
5078
|
+
|
|
5079
|
+
export declare type DialogActionValue = DialogActionValuePrimitive | (() => Promise<DialogActionValuePrimitive>);
|
|
5080
|
+
|
|
5081
|
+
declare type DialogActionValuePrimitive = string | boolean | number | undefined | null;
|
|
5082
|
+
|
|
5036
5083
|
declare type DialogAlikeAction = {
|
|
5037
5084
|
value?: string;
|
|
5038
5085
|
label: string;
|
|
@@ -5065,10 +5112,58 @@ export declare type DialogControls = {
|
|
|
5065
5112
|
onClick: () => void;
|
|
5066
5113
|
};
|
|
5067
5114
|
|
|
5115
|
+
export declare type DialogDefinition = {
|
|
5116
|
+
size?: F0DialogSize;
|
|
5117
|
+
id: DialogId;
|
|
5118
|
+
title: string;
|
|
5119
|
+
description?: string;
|
|
5120
|
+
content: ReactNode;
|
|
5121
|
+
actions: DialogActions;
|
|
5122
|
+
keepOpen?: boolean;
|
|
5123
|
+
/**
|
|
5124
|
+
* If true, the dialog will be modal (cannot be closed by clicking outside or pressing Escape).
|
|
5125
|
+
* @default false
|
|
5126
|
+
*/
|
|
5127
|
+
modal?: boolean;
|
|
5128
|
+
/**
|
|
5129
|
+
* The module of the dialog.
|
|
5130
|
+
*/
|
|
5131
|
+
module?: DialogModule;
|
|
5132
|
+
};
|
|
5133
|
+
|
|
5134
|
+
export declare type DialogId = string;
|
|
5135
|
+
|
|
5136
|
+
/**
|
|
5137
|
+
* Module configuration shown in a dialog/drawer header.
|
|
5138
|
+
*
|
|
5139
|
+
* Kept in its own module (free of any F0Dialog/F0Drawer dependency) so the
|
|
5140
|
+
* shared `dialog-alike/common` layer can reference it without creating a
|
|
5141
|
+
* circular dependency back through `dialogs-alike/types`.
|
|
5142
|
+
*/
|
|
5143
|
+
declare type DialogModule = {
|
|
5144
|
+
id: ModuleId;
|
|
5145
|
+
label: string;
|
|
5146
|
+
href: string;
|
|
5147
|
+
};
|
|
5148
|
+
|
|
5149
|
+
declare type DialogNotificationType = (typeof dialogNotificationTypes)[number];
|
|
5150
|
+
|
|
5151
|
+
/**
|
|
5152
|
+
* The levels of the alert.
|
|
5153
|
+
*/
|
|
5154
|
+
declare const dialogNotificationTypes: readonly ["info", "warning", "critical", "positive"];
|
|
5155
|
+
|
|
5068
5156
|
export declare type DialogPosition = (typeof dialogPositions)[number];
|
|
5069
5157
|
|
|
5070
5158
|
declare const dialogPositions: readonly ["center", "left", "right", "fullscreen"];
|
|
5071
5159
|
|
|
5160
|
+
declare type DialogSimpleAction = {
|
|
5161
|
+
label?: string;
|
|
5162
|
+
value?: DialogActionValue;
|
|
5163
|
+
};
|
|
5164
|
+
|
|
5165
|
+
declare const dialogSizes: readonly ["sm", "md", "lg", "xl", "fullscreen"];
|
|
5166
|
+
|
|
5072
5167
|
export declare type DialogWidth = (typeof dialogWidths)[number];
|
|
5073
5168
|
|
|
5074
5169
|
declare const dialogWidths: readonly ["sm", "md", "lg", "xl"];
|
|
@@ -5148,8 +5243,54 @@ export declare type DragPayload<T = unknown> = {
|
|
|
5148
5243
|
data?: T;
|
|
5149
5244
|
};
|
|
5150
5245
|
|
|
5246
|
+
/**
|
|
5247
|
+
* Imperative API for side drawers. Requires `<F0Provider>` to be present.
|
|
5248
|
+
*
|
|
5249
|
+
* @example
|
|
5250
|
+
* const result = await drawer.open({ title, content, actions: { primary: { label: "Save", value: "save" } } })
|
|
5251
|
+
*/
|
|
5252
|
+
export declare const drawer: {
|
|
5253
|
+
/** Open a drawer. Resolves with the value of the action the user picked. */
|
|
5254
|
+
open: (definition: Optional<DrawerDefinition, "id">) => Promise<DialogActionValue>;
|
|
5255
|
+
/** Programmatically close a drawer by id (resolves its promise with undefined). */
|
|
5256
|
+
close: (id: DialogId) => void;
|
|
5257
|
+
};
|
|
5258
|
+
|
|
5259
|
+
export declare type DrawerDefinition = {
|
|
5260
|
+
/** The size of the drawer. */
|
|
5261
|
+
size?: DrawerSize;
|
|
5262
|
+
/** The id of the drawer. Auto-generated if not provided. */
|
|
5263
|
+
id: DialogId;
|
|
5264
|
+
/** The title of the drawer. */
|
|
5265
|
+
title: string;
|
|
5266
|
+
/** The description of the drawer. */
|
|
5267
|
+
description?: string;
|
|
5268
|
+
/** The content of the drawer. */
|
|
5269
|
+
content: ReactNode;
|
|
5270
|
+
/** The actions of the drawer. */
|
|
5271
|
+
actions: DialogActions;
|
|
5272
|
+
/**
|
|
5273
|
+
* If true, the drawer will not be closed automatically when an action is
|
|
5274
|
+
* clicked. Useful for drawers that need to be closed manually.
|
|
5275
|
+
*/
|
|
5276
|
+
keepOpen?: boolean;
|
|
5277
|
+
/**
|
|
5278
|
+
* The position of the drawer.
|
|
5279
|
+
* @default "right"
|
|
5280
|
+
*/
|
|
5281
|
+
position?: F0DrawerPosition;
|
|
5282
|
+
/** If true, the drawer will be modal. */
|
|
5283
|
+
modal?: boolean;
|
|
5284
|
+
/** The module of the drawer. */
|
|
5285
|
+
module?: DialogModule;
|
|
5286
|
+
};
|
|
5287
|
+
|
|
5151
5288
|
declare const drawerPositions: readonly ["left", "right"];
|
|
5152
5289
|
|
|
5290
|
+
declare type DrawerSize = (typeof drawerSizes)[number];
|
|
5291
|
+
|
|
5292
|
+
declare const drawerSizes: readonly ["md"];
|
|
5293
|
+
|
|
5153
5294
|
declare type DropdownItem = DropdownItemObject | DropdownItemSeparator | DropdownItemLabel;
|
|
5154
5295
|
|
|
5155
5296
|
declare type DropdownItemLabel = {
|
|
@@ -7931,6 +8072,8 @@ export declare type F0DialogSecondaryAction = {
|
|
|
7931
8072
|
|
|
7932
8073
|
export declare type F0DialogSecondaryActionItem = F0DialogActionItem;
|
|
7933
8074
|
|
|
8075
|
+
declare type F0DialogSize = (typeof dialogSizes)[number];
|
|
8076
|
+
|
|
7934
8077
|
/**
|
|
7935
8078
|
* @experimental This is an experimental component use it at your own risk
|
|
7936
8079
|
*/
|
|
@@ -10323,7 +10466,10 @@ declare interface F0WizardFormBaseProps {
|
|
|
10323
10466
|
isOpen: boolean;
|
|
10324
10467
|
onClose?: () => void;
|
|
10325
10468
|
title?: string;
|
|
10469
|
+
/** @deprecated Use `size` instead. */
|
|
10326
10470
|
width?: DialogWidth;
|
|
10471
|
+
/** The size of the wizard dialog. Preferred over the deprecated `width`. */
|
|
10472
|
+
size?: F0DialogSize;
|
|
10327
10473
|
defaultStepIndex?: number;
|
|
10328
10474
|
nextLabel?: string;
|
|
10329
10475
|
previousLabel?: string;
|
|
@@ -12275,6 +12421,15 @@ export declare class NotesTextEditorUnsupportedPatchTypeError extends Error {
|
|
|
12275
12421
|
constructor(patchType: unknown);
|
|
12276
12422
|
}
|
|
12277
12423
|
|
|
12424
|
+
declare type NotificationDialogBaseOptions = Optional<Pick<DialogDefinition, "id" | "title">, "id"> & {
|
|
12425
|
+
msg: string;
|
|
12426
|
+
type?: DialogNotificationType;
|
|
12427
|
+
};
|
|
12428
|
+
|
|
12429
|
+
export declare type NotificationDialogOptions = NotificationDialogBaseOptions & {
|
|
12430
|
+
actions: DialogActions;
|
|
12431
|
+
};
|
|
12432
|
+
|
|
12278
12433
|
declare type NumberCellConfig<R extends RecordType = RecordType> = {
|
|
12279
12434
|
min?: number;
|
|
12280
12435
|
max?: number;
|