@standardbeagle/edit-db 0.4.458 → 0.4.478
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/components/ui/button.d.ts +2 -2
- package/dist/edit-db.css +1 -1
- package/dist/editor.es.js +8988 -8768
- package/dist/editor.umd.cjs +30 -30
- package/dist/lib/field-validation.d.ts +12 -0
- package/dist/lib/field-validation.test.d.ts +1 -0
- package/dist/lib/m2m.d.ts +5 -0
- package/dist/lib/row-id.d.ts +7 -0
- package/dist/tableList.d.ts +6 -10
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Column } from '../types/schema';
|
|
2
|
+
/**
|
|
3
|
+
* Anchors a pattern the same way the HTML5 `pattern` attribute and the server
|
|
4
|
+
* validator do: wrap as ^(?:...)$ unless the author already anchored it with ^.
|
|
5
|
+
*/
|
|
6
|
+
export declare function anchorPattern(pattern: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Validates a single value against a column's schema constraints. Returns an
|
|
9
|
+
* error message, or undefined when valid. `isRequired` is passed explicitly so
|
|
10
|
+
* callers keep their own required policy (forms use !isNullable).
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateFieldValue(column: Column, value: unknown, isRequired: boolean): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/lib/m2m.d.ts
CHANGED
|
@@ -52,5 +52,10 @@ export declare function targetDisplay(junctionRow: Record<string, unknown>, m2m:
|
|
|
52
52
|
* The insert detail for a new link: the parent key on the junction source FK and
|
|
53
53
|
* the chosen target key on the junction target FK. Any payload columns are left
|
|
54
54
|
* unset so the database applies its defaults; the user edits them afterwards.
|
|
55
|
+
*
|
|
56
|
+
* Single-column junction FKs only. `parentId`/`targetId` are route-encoded
|
|
57
|
+
* strings; for a composite FK they carry multiple values joined by "::", which
|
|
58
|
+
* would be written verbatim into one column — silent data corruption. Rather
|
|
59
|
+
* than guess a decomposition, fail loudly until composite-FK support is built.
|
|
55
60
|
*/
|
|
56
61
|
export declare function attachJunctionDetail(m2m: ManyToManyJoin, parentId: string, targetId: string): Record<string, unknown>;
|
package/dist/lib/row-id.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ export interface PkEqFilterResult {
|
|
|
6
6
|
params: string[];
|
|
7
7
|
}
|
|
8
8
|
type TableLike = Pick<Table, 'primaryKeys'> & Partial<Pick<Table, 'columns'>>;
|
|
9
|
+
/**
|
|
10
|
+
* Encodes an ordered list of key values into a route string. The single source
|
|
11
|
+
* of truth for composite-key route encoding — every producer (row lists) and
|
|
12
|
+
* consumer (composite-FK selects) must funnel through this so the two sides can
|
|
13
|
+
* never drift apart and silently fail to match.
|
|
14
|
+
*/
|
|
15
|
+
export declare function encodeRouteParts(values: readonly unknown[]): string;
|
|
9
16
|
export declare function rowIdOf(row: Record<string, unknown> | null | undefined, table: TableLike, index: number): string;
|
|
10
17
|
export declare function pkFilterFor(row: Record<string, unknown> | null | undefined, table: TableLike): PkFilter | null;
|
|
11
18
|
export declare function buildPkEqFilter(row: Record<string, unknown> | null | undefined, table: Pick<Table, 'primaryKeys' | 'columns'>): PkEqFilterResult | null;
|
package/dist/tableList.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TableList
|
|
2
|
+
* TableList — searchable, paged, schema-grouped sidebar of database tables.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
7
|
-
* -
|
|
8
|
-
*
|
|
4
|
+
* Scales to several hundred tables:
|
|
5
|
+
* - Search filters by label, raw db name, and schema.
|
|
6
|
+
* - Tables group under collapsible schema headers (only when >1 schema exists).
|
|
7
|
+
* - The visible rows (headers + tables) are paged at {@link PAGE_SIZE} so the DOM
|
|
8
|
+
* stays small regardless of total table count.
|
|
9
9
|
*
|
|
10
10
|
* @component
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <TableList />
|
|
14
|
-
* ```
|
|
15
11
|
*/
|
|
16
12
|
export declare function TableList(): import("react").JSX.Element;
|