@mercurjs/dashboard-shared 2.2.0-rc.0 → 2.2.0-rc.2
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/index.d.ts +314 -5
- package/dist/index.js +1900 -1398
- package/package.json +13 -13
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,16 @@ import * as React$1 from 'react';
|
|
|
5
5
|
import React__default, { ReactNode, PropsWithChildren, ComponentPropsWithoutRef, CSSProperties, ComponentType, Ref, RefCallback } from 'react';
|
|
6
6
|
import { Tooltip, Heading, Text, DataTableColumnDef, DataTableFilter, DataTableCommand, DataTableEmptyStateProps, DataTableRowSelectionState, DataTableRow, Drawer, FocusModal, ProgressStatus } from '@medusajs/ui';
|
|
7
7
|
import * as react_hook_form from 'react-hook-form';
|
|
8
|
-
import { FieldValues, FieldPath, ControllerProps, UseFormReturn, Control } from 'react-hook-form';
|
|
9
|
-
import { Label
|
|
8
|
+
import { FieldValues, FieldPath, ControllerProps, UseFormReturn, Control, UseFormProps } from 'react-hook-form';
|
|
9
|
+
import { Label } from 'radix-ui';
|
|
10
10
|
import { Link, Path } from 'react-router-dom';
|
|
11
11
|
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
12
12
|
import * as _tanstack_react_table from '@tanstack/react-table';
|
|
13
13
|
import { CellContext, Row, ColumnDef, ColumnDefTemplate, HeaderContext, Table, RowSelectionState, OnChangeFn } from '@tanstack/react-table';
|
|
14
14
|
import { TFunction } from 'i18next';
|
|
15
|
-
import { z } from 'zod';
|
|
15
|
+
import { z, ZodObject } from 'zod';
|
|
16
16
|
import { ClientError } from '@mercurjs/client';
|
|
17
|
+
import { CustomFieldsConfig, NavItemOverride, CustomFormField, CustomDisplayField, SectionAction, CustomListExtension } from '@mercurjs/dashboard-sdk';
|
|
17
18
|
|
|
18
19
|
type TQueryKey<TKey, TListQuery = any, TDetailQuery = string> = {
|
|
19
20
|
all: readonly [TKey];
|
|
@@ -284,7 +285,9 @@ declare const Form: (<TFieldValues extends FieldValues, TContext = any, TTransfo
|
|
|
284
285
|
tooltip?: ReactNode;
|
|
285
286
|
icon?: ReactNode;
|
|
286
287
|
} & React__default.RefAttributes<HTMLLabelElement>>;
|
|
287
|
-
Control: React__default.ForwardRefExoticComponent<Omit<
|
|
288
|
+
Control: React__default.ForwardRefExoticComponent<Omit<React__default.HTMLAttributes<HTMLElement> & {
|
|
289
|
+
children?: React__default.ReactNode;
|
|
290
|
+
} & React__default.RefAttributes<HTMLElement>, "ref"> & React__default.RefAttributes<HTMLElement>>;
|
|
288
291
|
Hint: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLParagraphElement> & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
289
292
|
ErrorMessage: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLParagraphElement> & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
290
293
|
Field: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => react_jsx_runtime.JSX.Element;
|
|
@@ -1023,6 +1026,8 @@ type TabbedFormProps<T extends FieldValues> = {
|
|
|
1023
1026
|
isLoading?: boolean;
|
|
1024
1027
|
footer?: (props: FooterRenderProps) => ReactNode;
|
|
1025
1028
|
transformTabs?: (tabs: TabDefinition<T>[]) => TabDefinition<T>[];
|
|
1029
|
+
model?: string;
|
|
1030
|
+
zone?: string;
|
|
1026
1031
|
};
|
|
1027
1032
|
declare function Root<T extends FieldValues>({ form, onSubmit, children, isLoading, footer, transformTabs, }: TabbedFormProps<T>): react_jsx_runtime.JSX.Element;
|
|
1028
1033
|
declare const TabbedForm: typeof Root & {
|
|
@@ -1264,4 +1269,308 @@ type QueryParams<T extends string> = {
|
|
|
1264
1269
|
};
|
|
1265
1270
|
declare function useQueryParams<T extends string>(keys: T[], prefix?: string): QueryParams<T>;
|
|
1266
1271
|
|
|
1267
|
-
|
|
1272
|
+
type WidgetPlacement = "before" | "after";
|
|
1273
|
+
type Widget = {
|
|
1274
|
+
Component: ComponentType<{
|
|
1275
|
+
data?: unknown;
|
|
1276
|
+
}>;
|
|
1277
|
+
zone: string[];
|
|
1278
|
+
widgetId: string;
|
|
1279
|
+
};
|
|
1280
|
+
type WidgetModule = {
|
|
1281
|
+
widgets?: Widget[];
|
|
1282
|
+
};
|
|
1283
|
+
type NavigationModule = {
|
|
1284
|
+
items?: NavItemOverride[];
|
|
1285
|
+
};
|
|
1286
|
+
type CustomFieldsModule = {
|
|
1287
|
+
configs?: CustomFieldsConfig[];
|
|
1288
|
+
};
|
|
1289
|
+
type ResolvedFormField = {
|
|
1290
|
+
name: string;
|
|
1291
|
+
field: CustomFormField;
|
|
1292
|
+
};
|
|
1293
|
+
type ResolvedDisplays = {
|
|
1294
|
+
fields: CustomDisplayField[];
|
|
1295
|
+
actions: SectionAction[];
|
|
1296
|
+
};
|
|
1297
|
+
type ResolvedWidget = {
|
|
1298
|
+
Component: Widget["Component"];
|
|
1299
|
+
widgetId: string;
|
|
1300
|
+
};
|
|
1301
|
+
type ZoneWidgets = {
|
|
1302
|
+
before: ResolvedWidget[];
|
|
1303
|
+
after: ResolvedWidget[];
|
|
1304
|
+
};
|
|
1305
|
+
/**
|
|
1306
|
+
* Per-panel singleton mirroring Medusa's `DashboardApp`. Built once at app root
|
|
1307
|
+
* from the aggregated `virtual:mercur/{widgets,navigation}` modules; the zone
|
|
1308
|
+
* hosts read from it via `useExtension()`.
|
|
1309
|
+
*/
|
|
1310
|
+
declare class ExtensionRegistry {
|
|
1311
|
+
private widgets;
|
|
1312
|
+
private navOverrides;
|
|
1313
|
+
private customFields;
|
|
1314
|
+
constructor(input?: {
|
|
1315
|
+
widgets?: WidgetModule;
|
|
1316
|
+
navigation?: NavigationModule;
|
|
1317
|
+
customFields?: CustomFieldsModule;
|
|
1318
|
+
});
|
|
1319
|
+
private ensureSlot;
|
|
1320
|
+
private populateWidgets;
|
|
1321
|
+
getWidgets(slot: string): ZoneWidgets;
|
|
1322
|
+
getNavOverrides(): NavItemOverride[];
|
|
1323
|
+
private configsFor;
|
|
1324
|
+
/** Distinct module links declared across a model's configs. */
|
|
1325
|
+
getLinks(model: string): string[];
|
|
1326
|
+
/** Custom form fields for a model's form zone (and optional tab). */
|
|
1327
|
+
getFormFields(model: string, zone: string, tab?: string): ResolvedFormField[];
|
|
1328
|
+
/** All custom form fields for a model, keyed for schema/default building. */
|
|
1329
|
+
getAllFormFields(model: string): ResolvedFormField[];
|
|
1330
|
+
/** Section display contributions (field add/replace/remove + actions). */
|
|
1331
|
+
getDisplays(model: string, zone: string): ResolvedDisplays;
|
|
1332
|
+
/** Merged list-table extension for a model. */
|
|
1333
|
+
getListExtension(model: string): CustomListExtension;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
type ExtensionProviderProps = {
|
|
1337
|
+
widgets?: WidgetModule;
|
|
1338
|
+
navigation?: NavigationModule;
|
|
1339
|
+
customFields?: CustomFieldsModule;
|
|
1340
|
+
children: ReactNode;
|
|
1341
|
+
};
|
|
1342
|
+
/**
|
|
1343
|
+
* Reads the panel's extension registry outside React (e.g. in a react-router
|
|
1344
|
+
* `loader`, which can't call hooks). Returns null until `ExtensionProvider` has
|
|
1345
|
+
* mounted; callers should fall back to built-in behavior when null.
|
|
1346
|
+
*/
|
|
1347
|
+
declare const getExtensionRegistry: () => ExtensionRegistry | null;
|
|
1348
|
+
declare const ExtensionProvider: ({ widgets, navigation, customFields, children, }: ExtensionProviderProps) => react_jsx_runtime.JSX.Element;
|
|
1349
|
+
/**
|
|
1350
|
+
* Reads the panel's extension registry. Returns an empty registry when no
|
|
1351
|
+
* provider is mounted so hosts render their built-in content untouched.
|
|
1352
|
+
*/
|
|
1353
|
+
declare const useExtension: () => ExtensionRegistry;
|
|
1354
|
+
|
|
1355
|
+
type WidgetZoneProps = {
|
|
1356
|
+
/** Stable slot id, e.g. `product.list` or `product.detail`. Placement suffixes
|
|
1357
|
+
* (`before | after | replace`) are matched against it at render time. */
|
|
1358
|
+
id: string;
|
|
1359
|
+
/** Optional data passed to each widget component (e.g. the detail entity). */
|
|
1360
|
+
data?: unknown;
|
|
1361
|
+
/** The built-in content, rendered between `before` and `after` widgets. */
|
|
1362
|
+
children?: ReactNode;
|
|
1363
|
+
};
|
|
1364
|
+
/**
|
|
1365
|
+
* Injection-zone host. Renders `before` widgets → the built-in child →
|
|
1366
|
+
* `after` widgets. A zone that no page renders as a host can never be targeted.
|
|
1367
|
+
*/
|
|
1368
|
+
declare const WidgetZone: ({ id, data, children }: WidgetZoneProps) => react_jsx_runtime.JSX.Element;
|
|
1369
|
+
|
|
1370
|
+
type CoreNavItem = {
|
|
1371
|
+
id: string;
|
|
1372
|
+
label: string;
|
|
1373
|
+
to: string;
|
|
1374
|
+
icon?: ReactNode;
|
|
1375
|
+
items?: CoreNavItem[];
|
|
1376
|
+
};
|
|
1377
|
+
/**
|
|
1378
|
+
* Applies host-owned `_navigation.ts` overrides to a panel's built-in core
|
|
1379
|
+
* routes: reorder (`rank`), hide (`hidden`), relabel (`label`/`icon`), and
|
|
1380
|
+
* re-parent (`nested`). Operates on the two-level `useCoreRoutes()` shape;
|
|
1381
|
+
* items without a matching override are preserved in their original order.
|
|
1382
|
+
*/
|
|
1383
|
+
declare function applyNavOverrides(coreRoutes: CoreNavItem[], overrides?: NavItemOverride[]): CoreNavItem[];
|
|
1384
|
+
|
|
1385
|
+
type FormExtensionZoneProps = {
|
|
1386
|
+
model: string;
|
|
1387
|
+
zone: string;
|
|
1388
|
+
tab?: string;
|
|
1389
|
+
control: Control<any>;
|
|
1390
|
+
data?: unknown;
|
|
1391
|
+
};
|
|
1392
|
+
/**
|
|
1393
|
+
* Renders a model's custom form fields for a given zone/tab under the
|
|
1394
|
+
* `additional_data.<field>` RHF namespace (Medusa's convention), through the
|
|
1395
|
+
* mandated `Form.Field → Form.Item` primitive chain.
|
|
1396
|
+
*/
|
|
1397
|
+
declare const FormExtensionZone: ({ model, zone, tab, control, data, }: FormExtensionZoneProps) => react_jsx_runtime.JSX.Element | null;
|
|
1398
|
+
|
|
1399
|
+
type DisplayExtensionZoneProps = {
|
|
1400
|
+
model: string;
|
|
1401
|
+
zone: string;
|
|
1402
|
+
data?: unknown;
|
|
1403
|
+
/**
|
|
1404
|
+
* Ids of the section's built-in fields — those are overridden inline by
|
|
1405
|
+
* `<DisplayField>`, so the zone skips them and only renders genuinely added
|
|
1406
|
+
* fields (unknown ids). Defaults to none.
|
|
1407
|
+
*/
|
|
1408
|
+
builtInFieldIds?: string[];
|
|
1409
|
+
};
|
|
1410
|
+
/**
|
|
1411
|
+
* Renders a model's ADDED section fields (non-null component, id not a built-in
|
|
1412
|
+
* field) plus the section's custom `ActionMenu` contributions. Built-in fields
|
|
1413
|
+
* are overridden in place by `<DisplayField>` / `useDisplayFieldOverride`.
|
|
1414
|
+
*/
|
|
1415
|
+
declare const DisplayExtensionZone: ({ model, zone, data, builtInFieldIds, }: DisplayExtensionZoneProps) => react_jsx_runtime.JSX.Element | null;
|
|
1416
|
+
type DisplayFieldProps = {
|
|
1417
|
+
model: string;
|
|
1418
|
+
zone: string;
|
|
1419
|
+
/** Stable id of this built-in field (e.g. `title`, `description`). */
|
|
1420
|
+
id: string;
|
|
1421
|
+
data?: unknown;
|
|
1422
|
+
/** The built-in default rendering, shown when there is no override. */
|
|
1423
|
+
children?: ReactNode;
|
|
1424
|
+
};
|
|
1425
|
+
/**
|
|
1426
|
+
* Wraps a single built-in detail field so a `displays[].fields` entry can
|
|
1427
|
+
* override its render (a different `component`) or remove it (`component: null`).
|
|
1428
|
+
* With no matching override, renders the built-in `children` unchanged. This is
|
|
1429
|
+
* the host the panel codegen scans to type `displayFieldIds`.
|
|
1430
|
+
*/
|
|
1431
|
+
declare const DisplayField: ({ model, zone, id, data, children, }: DisplayFieldProps) => react_jsx_runtime.JSX.Element | null;
|
|
1432
|
+
type DisplaySectionField = {
|
|
1433
|
+
/** Stable id of the built-in field (matches a `displays[].fields[].id`). */
|
|
1434
|
+
id: string;
|
|
1435
|
+
/** The built-in default rendering (e.g. a `<SectionRow />`). */
|
|
1436
|
+
render: ReactNode;
|
|
1437
|
+
};
|
|
1438
|
+
type DisplaySectionProps = {
|
|
1439
|
+
model: string;
|
|
1440
|
+
zone: string;
|
|
1441
|
+
data?: unknown;
|
|
1442
|
+
/** Built-in fields of this section, each overridable/removable by id. */
|
|
1443
|
+
fields: DisplaySectionField[];
|
|
1444
|
+
};
|
|
1445
|
+
/**
|
|
1446
|
+
* One-line helper for a row-style detail section: renders each built-in field
|
|
1447
|
+
* through `<DisplayField>` (so `displays[].fields` can replace/remove it) and
|
|
1448
|
+
* appends the section's added fields + actions via `<DisplayExtensionZone>`,
|
|
1449
|
+
* deriving `builtInFieldIds` from `fields`.
|
|
1450
|
+
*/
|
|
1451
|
+
declare const DisplaySection: ({ model, zone, data, fields, }: DisplaySectionProps) => react_jsx_runtime.JSX.Element;
|
|
1452
|
+
/**
|
|
1453
|
+
* For a built-in detail section to honor a `displays[].fields` override of one
|
|
1454
|
+
* of its own fields: returns `{ overridden, Component }`. `overridden && !
|
|
1455
|
+
* Component` means remove (render nothing); `Component` means replace.
|
|
1456
|
+
*/
|
|
1457
|
+
declare function useDisplayFieldOverride(model: string, zone: string, id: string): {
|
|
1458
|
+
overridden: boolean;
|
|
1459
|
+
Component: ComponentType<{
|
|
1460
|
+
data?: unknown;
|
|
1461
|
+
}> | null;
|
|
1462
|
+
};
|
|
1463
|
+
|
|
1464
|
+
type UseExtendableTableProps<TData> = {
|
|
1465
|
+
/** Model whose custom-fields `list` block extends this table (e.g. `product`). */
|
|
1466
|
+
model: string;
|
|
1467
|
+
/** Base columns to extend. */
|
|
1468
|
+
columns: ColumnDef<TData, unknown>[];
|
|
1469
|
+
};
|
|
1470
|
+
type ExtendableTable<TData> = {
|
|
1471
|
+
/** Base columns with custom override/add/hide/order applied. */
|
|
1472
|
+
columns: ColumnDef<TData, unknown>[];
|
|
1473
|
+
/** Extra list filters contributed by custom-fields configs. */
|
|
1474
|
+
filters: unknown[];
|
|
1475
|
+
/** Extra multi-select bulk actions (rank-sorted). */
|
|
1476
|
+
bulkActions: SectionAction[];
|
|
1477
|
+
};
|
|
1478
|
+
/**
|
|
1479
|
+
* Applies a model's custom-fields `list` block to a table's base columns —
|
|
1480
|
+
* mirrors `useExtendableForm` for tables. A `columns[]` entry whose `id` matches
|
|
1481
|
+
* a base column **overrides** it (custom header/cell), an unknown `id` **adds** a
|
|
1482
|
+
* column, `viewDefaults.columnVisibility[id] === false` **hides** it, and
|
|
1483
|
+
* `viewDefaults.columnOrder` reorders. Also surfaces the config's `filters` and
|
|
1484
|
+
* `bulkActions` for the caller to render.
|
|
1485
|
+
*/
|
|
1486
|
+
declare function useExtendableTable<TData>({ model, columns: baseColumns, }: UseExtendableTableProps<TData>): ExtendableTable<TData>;
|
|
1487
|
+
|
|
1488
|
+
/** Turn a model's `link` relations into `+link.*` merge tokens. */
|
|
1489
|
+
declare const linkFields: (links: string[]) => string;
|
|
1490
|
+
/**
|
|
1491
|
+
* Merge a model's custom-fields `link` relations into a curated fields string
|
|
1492
|
+
* using the `+` merge convention (`+link.*`), so linked-module data is fetched
|
|
1493
|
+
* alongside the entity without replacing the route's default fields. Returns the
|
|
1494
|
+
* base `fields` unchanged when there are no links.
|
|
1495
|
+
*/
|
|
1496
|
+
declare const withLinkFields: (fields: string, links: string[]) => string;
|
|
1497
|
+
/**
|
|
1498
|
+
* Build a spreadable `{ fields }` query fragment that adds a model's custom-fields
|
|
1499
|
+
* `link` relations. Pass `base` to merge onto a curated field set (list/detail
|
|
1500
|
+
* queries); omit it to merge purely onto the route defaults (`+link.*` only), so
|
|
1501
|
+
* unprefixed base fields never replace the route defaults. Returns `{}` (or
|
|
1502
|
+
* `{ fields: base }`) when the model declares no links, leaving the fetch
|
|
1503
|
+
* unchanged. Non-hook variant for react-router loaders.
|
|
1504
|
+
*/
|
|
1505
|
+
declare const getLinkQuery: (model: string, base?: string) => {
|
|
1506
|
+
fields?: string;
|
|
1507
|
+
};
|
|
1508
|
+
/** Hook variant of {@link getLinkQuery} for use inside components. */
|
|
1509
|
+
declare const useLinkQuery: (model: string, base?: string) => {
|
|
1510
|
+
fields?: string;
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Zod-backed form surface (mirrors Medusa's `createFormHelper`, no `unstable_`).
|
|
1515
|
+
* Lives here rather than in `@mercurjs/dashboard-sdk` because the SDK is a
|
|
1516
|
+
* zod-free build-time package; re-exported from `@mercurjs/dashboard-sdk` for
|
|
1517
|
+
* authoring parity is a docs concern only.
|
|
1518
|
+
*/
|
|
1519
|
+
declare function createFormHelper<TData>(): {
|
|
1520
|
+
define: (field: CustomFormField<TData>) => CustomFormField<TData>;
|
|
1521
|
+
string: () => z.ZodString;
|
|
1522
|
+
number: () => z.ZodNumber;
|
|
1523
|
+
boolean: () => z.ZodBoolean;
|
|
1524
|
+
date: () => z.ZodDate;
|
|
1525
|
+
array: <El extends z.ZodTypeAny>(schema: El, params?: z.RawCreateParams) => z.ZodArray<El>;
|
|
1526
|
+
object: <Shape extends z.ZodRawShape>(shape: Shape, params?: z.RawCreateParams) => z.ZodObject<Shape, "strip", z.ZodTypeAny, z.objectOutputType<Shape, z.ZodTypeAny, "strip">, z.objectInputType<Shape, z.ZodTypeAny, "strip">>;
|
|
1527
|
+
null: () => z.ZodNull;
|
|
1528
|
+
nullable: <Inner extends z.ZodTypeAny>(type: Inner, params?: z.RawCreateParams) => z.ZodNullable<Inner>;
|
|
1529
|
+
coerce: {
|
|
1530
|
+
string: (typeof z.ZodString)["create"];
|
|
1531
|
+
number: (typeof z.ZodNumber)["create"];
|
|
1532
|
+
boolean: (typeof z.ZodBoolean)["create"];
|
|
1533
|
+
bigint: (typeof z.ZodBigInt)["create"];
|
|
1534
|
+
date: (typeof z.ZodDate)["create"];
|
|
1535
|
+
};
|
|
1536
|
+
};
|
|
1537
|
+
/**
|
|
1538
|
+
* Build the `additional_data` zod object for a model's custom fields, to merge
|
|
1539
|
+
* into a form's base schema. Custom-field values live under `additional_data`
|
|
1540
|
+
* so the built-in create/edit validators never see them.
|
|
1541
|
+
*/
|
|
1542
|
+
declare function buildAdditionalDataSchema(registry: ExtensionRegistry, model: string, zone?: string, tab?: string): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
1543
|
+
/** Resolve default values for a model's custom fields from the loaded entity. */
|
|
1544
|
+
declare function buildAdditionalDataDefaults(registry: ExtensionRegistry, model: string, data?: unknown, zone?: string, tab?: string): Record<string, unknown>;
|
|
1545
|
+
|
|
1546
|
+
type WithAdditionalData<T> = T & {
|
|
1547
|
+
additional_data?: Record<string, unknown>;
|
|
1548
|
+
};
|
|
1549
|
+
interface UseExtendableFormProps<TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TData = unknown> extends Omit<UseFormProps<z.infer<TSchema>, TContext>, "resolver" | "defaultValues"> {
|
|
1550
|
+
/** Base schema for the built-in fields. */
|
|
1551
|
+
schema: TSchema;
|
|
1552
|
+
/** Base default values for the built-in fields. */
|
|
1553
|
+
defaultValues: z.infer<TSchema>;
|
|
1554
|
+
/** Custom-field model whose fields extend this form (e.g. `"product"`). */
|
|
1555
|
+
model: string;
|
|
1556
|
+
/** Loaded entity, used to resolve custom-field default values. */
|
|
1557
|
+
data?: TData;
|
|
1558
|
+
/**
|
|
1559
|
+
* Form zone (and optional tab) this form renders. When set, only custom
|
|
1560
|
+
* fields registered for that zone extend the schema/defaults — so a required
|
|
1561
|
+
* field defined for another zone (e.g. onboarding) doesn't block this form.
|
|
1562
|
+
* Omit to include every field for the model (legacy behaviour).
|
|
1563
|
+
*/
|
|
1564
|
+
zone?: string;
|
|
1565
|
+
tab?: string;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* `useForm` that merges a model's registered custom fields into the base
|
|
1569
|
+
* schema and defaults under an `additional_data` key — mirrors Medusa's
|
|
1570
|
+
* `useExtendableForm`. Custom-field values live under `additional_data` so the
|
|
1571
|
+
* built-in validators never see them; the extension registry provides the
|
|
1572
|
+
* per-field zod validation and default values.
|
|
1573
|
+
*/
|
|
1574
|
+
declare const useExtendableForm: <TSchema extends ZodObject<Record<string, z.ZodTypeAny>>, TContext = unknown, TTransformedValues extends FieldValues | undefined = undefined>({ schema: baseSchema, defaultValues: baseDefaultValues, model, data, zone, tab, ...props }: UseExtendableFormProps<TSchema, TContext>) => react_hook_form.UseFormReturn<WithAdditionalData<z.TypeOf<TSchema>>, TContext, TTransformedValues>;
|
|
1575
|
+
|
|
1576
|
+
export { type Action, type ActionGroup, ActionMenu, AddressForm, type AttributeChange, type AttributeChangeKind, BadgeListSummary, ChipGroup, CodeCell, CodeHeader, type Command, ConditionalTooltip, ConfirmPrompt, type ConfirmPromptProps, type CoreNavItem, CreatedAtCell, CreatedAtHeader, type CustomFieldsModule, CustomerInfo, DataGrid, DataTable, DateCell, DateHeader, DateRangeDisplay, DisplayExtensionZone, type DisplayExtensionZoneProps, DisplayField, type DisplayFieldProps, DisplaySection, type DisplaySectionField, type DisplaySectionProps, EmailCell, EmailForm, EmailHeader, type ExtendableTable, ExtensionProvider, type ExtensionProviderProps, ExtensionRegistry, type FieldDiff, FilePreview, type FileType, FileUpload, type FileUploadProps, type Filter, FilterGroup, Form, FormExtensionZone, type FormExtensionZoneProps, GeneralSectionSkeleton, HeadingSkeleton, IconAvatar, IconButtonSkeleton, ImageAvatar, type ImageRef, IncludesTaxTooltip, InfiniteList, JsonViewSection, JsonViewSectionSkeleton, LinkButton, ListBadge, ListSummary, Listicle, type ListicleProps, type MediaDiff, MetadataForm, MetadataSection, MoneyAmountCell, NameCell, NameHeader, type NavigationModule, NoRecords, NoResults, type NoResultsProps, OrderBy, PlaceholderCell, type ProductChangeAttribute, ProductChangePanel, type ProductChangePanelProps, type ProductChangeProduct, type ProductChangeResolvers, type ProductChangeVariant, type ProductChangeView, ProgressBar, Query, REFERENCE_FIELDS, type ReferenceField, type ResolvedAttribute, type ResolvedDisplays, type ResolvedFormField, RouteDrawer, RouteFocusModal, SectionRow, type SectionRowProps, SegmentedControl, type SegmentedControlOption, SidebarLink, type SidebarLinkProps, SingleColumnPage, SingleColumnPageSkeleton, Skeleton, SortableList, SortableTree, StackedDrawer, StackedFocusModal, StatusCell, SwitchBox, type TQueryKey, type TabDefinition, TabbedForm, TableFooterSkeleton, TableSectionSkeleton, TableSkeleton, TextCell, TextHeader, TextSkeleton, Thumbnail, TwoColumnPage, TwoColumnPageSkeleton, type UseExtendableFormProps, type UseExtendableTableProps, type UseQueryOptionsWrapper, type VariantGroup, type Widget, type WidgetModule, type WidgetPlacement, WidgetZone, type WidgetZoneProps, type ZoneWidgets, _DataTable, applyNavOverrides, buildAdditionalDataDefaults, buildAdditionalDataSchema, buildProductChangeView, createDataGridHelper, createDataGridPriceColumns, createFormHelper, extractReferenceIds, formatFieldValue, getExtensionRegistry, getLinkQuery, humanizeFieldName, isImageList, isReferenceField, linkFields, productChangeViewHasContent, queryKeysFactory, useCombinedRefs, useCommandHistory, useDataTable, useDate, useDisplayFieldOverride, useDocumentDirection, useExtendableForm, useExtendableTable, useExtension, useLinkQuery, useQueryParams, useRouteModal, useStackedModal, useTabManagement, useTabbedForm, withLinkFields };
|