@feasibleone/blong 1.18.0 → 1.18.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/CHANGELOG.md +15 -0
- package/dist/model.js +0 -8
- package/dist/model.js.map +1 -1
- package/dist/types.d.ts +342 -14
- package/dist/types.js.map +1 -1
- package/dist/widget.js +2 -0
- package/dist/widget.js.map +1 -0
- package/package.json +3 -1
- package/types.ts +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.18.2](https://github.com/feasibleone/blong/compare/blong-v1.18.1...blong-v1.18.2) (2026-05-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* avoid re-rendering ([183b718](https://github.com/feasibleone/blong/commit/183b718451e8166fa85bd1258ae62ede474db3d1))
|
|
9
|
+
|
|
10
|
+
## [1.18.1](https://github.com/feasibleone/blong/compare/blong-v1.18.0...blong-v1.18.1) (2026-05-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* improve model and mock ([20b530c](https://github.com/feasibleone/blong/commit/20b530cc9d00284a52ad99b63b95fbb7bd4e4e82))
|
|
16
|
+
* update widget imports to use centralized types from '@feasibleone/blong' ([5a2a4d2](https://github.com/feasibleone/blong/commit/5a2a4d23762de4eb9c00c2be1f3138673c1cb38f))
|
|
17
|
+
|
|
3
18
|
## [1.18.0](https://github.com/feasibleone/blong/compare/blong-v1.17.0...blong-v1.18.0) (2026-04-29)
|
|
4
19
|
|
|
5
20
|
|
package/dist/model.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model system types.
|
|
3
|
-
*
|
|
4
|
-
* A ModelSpec describes one "subject.object" domain entity and drives:
|
|
5
|
-
* - automatic Browse / New / Open / Report page generation
|
|
6
|
-
* - schema enrichment (server OpenAPI merged with browser overlay)
|
|
7
|
-
* - dropdown dependency tracking and caching
|
|
8
|
-
*/
|
|
9
1
|
export {};
|
|
10
2
|
//# sourceMappingURL=model.js.map
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../model.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Dirent, StatSyncFn } from 'node:fs';
|
|
|
9
9
|
import { Agent } from 'node:http';
|
|
10
10
|
import { Duplex } from 'node:stream';
|
|
11
11
|
import { Level, LogFn, Logger as PinoLogger } from 'pino';
|
|
12
|
+
import React$1 from 'react';
|
|
12
13
|
import { Readable, Writable } from 'stream';
|
|
13
14
|
import { ConnectionOptions as ConnectionOptions_2, TLSSocket, TLSSocketOptions } from 'tls';
|
|
14
15
|
import { Static, TArray, TBoolean, TFunction, TNever, TNumber, TObject, TSchema, TString, TUnknown, Type } from 'typebox';
|
|
@@ -17574,6 +17575,335 @@ declare namespace DeferredKeySelection {
|
|
|
17574
17575
|
}
|
|
17575
17576
|
export type AggregationQueryResult<TResult, TIntersectProps2 extends {}> = ArrayIfAlready<TResult, UnwrapArrayMember<TResult> extends DeferredKeySelection<infer TBase, infer TKeys, infer THasSelect, infer TAliasMapping, infer TSingle, infer TIntersectProps, infer TUnionProps> ? true extends THasSelect ? DeferredKeySelection<TBase, TKeys, THasSelect, TAliasMapping, TSingle, TIntersectProps & TIntersectProps2, TUnionProps> : DeferredKeySelection<{}, never, true, {}, false, TIntersectProps2> : TIntersectProps2>;
|
|
17576
17577
|
export type ResolveResult<S> = DeferredKeySelection.Resolve<S>;
|
|
17578
|
+
/** All supported widget types */
|
|
17579
|
+
export type WidgetType = "input" | "mask" | "text" | "textArea" | "password" | "number" | "integer" | "currency" | "percent" | "boolean" | "checkbox" | "switch" | "date" | "time" | "dateTime" | "dateRange" | "dropdown" | "dropdownTree" | "select" | "selectTable" | "multiSelect" | "multiSelectTree" | "multiSelectPanel" | "multiSelectTreeTable" | "chips" | "file" | "image" | "imageUpload" | "autocomplete" | "table" | "navigator" | "json" | "code" | "divider" | "label" | "link" | "custom";
|
|
17580
|
+
/** Base widget configuration (stored in schema x-widget) */
|
|
17581
|
+
export interface IWidgetConfig {
|
|
17582
|
+
type: WidgetType;
|
|
17583
|
+
/** For dropdown/multiSelect — action name to fetch options */
|
|
17584
|
+
fetch?: string;
|
|
17585
|
+
/** Named dropdown key — loads options via portal.dropdown.list */
|
|
17586
|
+
dropdown?: string;
|
|
17587
|
+
/** Options list for static select/multiSelect/select/tree widgets.
|
|
17588
|
+
* Flat options use `{value, label}`. TreeNode-style options use `{key, label, children}`. */
|
|
17589
|
+
options?: Array<{
|
|
17590
|
+
value?: unknown;
|
|
17591
|
+
label?: string;
|
|
17592
|
+
icon?: string;
|
|
17593
|
+
key?: string | number;
|
|
17594
|
+
children?: unknown[];
|
|
17595
|
+
[extra: string]: unknown;
|
|
17596
|
+
}>;
|
|
17597
|
+
/** Parent field name for cascaded dropdowns/tables (supports '$.selected.field' or just 'field') */
|
|
17598
|
+
parent?: string;
|
|
17599
|
+
/** Key mapping for cascaded table filtering: {ownKey: parentKey} */
|
|
17600
|
+
master?: Record<string, string>;
|
|
17601
|
+
/** Auto-select first filtered row when parent selection changes */
|
|
17602
|
+
autoSelect?: boolean;
|
|
17603
|
+
/** Copy-to-clipboard icon (input widget) */
|
|
17604
|
+
copy?: boolean;
|
|
17605
|
+
/** Mask pattern (mask widget) */
|
|
17606
|
+
mask?: string;
|
|
17607
|
+
/** Column definitions for table widget */
|
|
17608
|
+
columns?: string[] | Record<string, IFieldConfig>;
|
|
17609
|
+
/** Pivot config for static or dynamic pivots */
|
|
17610
|
+
pivot?: IPivotConfig;
|
|
17611
|
+
/** Field names to hide in table (used as implicit keys) */
|
|
17612
|
+
hidden?: string[];
|
|
17613
|
+
/** Selection mode for table widget */
|
|
17614
|
+
selectionMode?: "single" | "multiple";
|
|
17615
|
+
/** Label shown inside the widget (e.g. as table toolbar title instead of field label) */
|
|
17616
|
+
label?: string;
|
|
17617
|
+
/** Label field name in fetched options */
|
|
17618
|
+
labelField?: string;
|
|
17619
|
+
/** Value field name in fetched options */
|
|
17620
|
+
valueField?: string;
|
|
17621
|
+
/** Render this widget in read-only display mode regardless of card/form edit-ability */
|
|
17622
|
+
readOnly?: boolean;
|
|
17623
|
+
/** Custom component type (for 'custom' type) */
|
|
17624
|
+
component?: React$1.ComponentType<IWidgetProps>;
|
|
17625
|
+
/** Table action permissions */
|
|
17626
|
+
actions?: {
|
|
17627
|
+
allowAdd?: boolean;
|
|
17628
|
+
allowDelete?: boolean;
|
|
17629
|
+
allowEdit?: boolean;
|
|
17630
|
+
allowSelect?: boolean;
|
|
17631
|
+
};
|
|
17632
|
+
/** Whether to show the inline editor directly inside the cell (boolean/dropdown) */
|
|
17633
|
+
inlineEdit?: boolean;
|
|
17634
|
+
/** Accepted file types (file/imageUpload widgets) */
|
|
17635
|
+
accept?: string;
|
|
17636
|
+
/** Maximum file size in bytes (file/image widgets) */
|
|
17637
|
+
maxSize?: number;
|
|
17638
|
+
/** Base URL prefix for image display (image/imageUpload widgets) */
|
|
17639
|
+
basePath?: string;
|
|
17640
|
+
/** Exclude boundary times (dateRange widget: end = 23:59:59 instead of 00:00:00 next day) */
|
|
17641
|
+
exclusive?: boolean;
|
|
17642
|
+
/** Show time-only pickers (dateRange/time widget) */
|
|
17643
|
+
timeOnly?: boolean;
|
|
17644
|
+
/**
|
|
17645
|
+
* Action name to load list data from the server (table + navigator widgets).
|
|
17646
|
+
* When set, the widget manages its own data loading, pagination, search, and
|
|
17647
|
+
* sort independently of the react-hook-form value.
|
|
17648
|
+
*/
|
|
17649
|
+
listAction?: string;
|
|
17650
|
+
/** Static params merged into every `listAction` call */
|
|
17651
|
+
listParams?: Record<string, unknown>;
|
|
17652
|
+
/**
|
|
17653
|
+
* Property name in the `listAction` response that contains the rows array.
|
|
17654
|
+
* Defaults to `'items'`. Set to `''` to use the response directly as an array.
|
|
17655
|
+
*/
|
|
17656
|
+
resultSet?: string;
|
|
17657
|
+
/** Initial rows per page for listAction mode (default 25) */
|
|
17658
|
+
pageSize?: number;
|
|
17659
|
+
/**
|
|
17660
|
+
* Primary key field name in row data — used for template resolution (`${id}`)
|
|
17661
|
+
* and for the DataTable `dataKey`. Defaults to `'id'`.
|
|
17662
|
+
*/
|
|
17663
|
+
keyField?: string;
|
|
17664
|
+
/** Parent key field for navigator tree building (default 'parentId') */
|
|
17665
|
+
parentField?: string;
|
|
17666
|
+
/**
|
|
17667
|
+
* Custom toolbar buttons (left side). Support `${id}`, `${current}`, `${selected}`,
|
|
17668
|
+
* and `${current.field}` template resolution and `enabled: 'current' | 'selected'`.
|
|
17669
|
+
*/
|
|
17670
|
+
toolbar?: IWidgetToolbarButton[];
|
|
17671
|
+
/** Custom toolbar buttons (right side) */
|
|
17672
|
+
toolbarRight?: IWidgetToolbarButton[];
|
|
17673
|
+
}
|
|
17674
|
+
/**
|
|
17675
|
+
* Toolbar button for widget-level toolbars (table, navigator).
|
|
17676
|
+
* Similar to IToolbarButton but scoped to widget-level row context.
|
|
17677
|
+
*/
|
|
17678
|
+
export interface IWidgetToolbarButton {
|
|
17679
|
+
label?: string;
|
|
17680
|
+
icon?: string;
|
|
17681
|
+
/** Direct RPC method name called via dispatch */
|
|
17682
|
+
method?: string;
|
|
17683
|
+
permission?: string;
|
|
17684
|
+
/** Confirmation dialog message before invoking */
|
|
17685
|
+
confirm?: string;
|
|
17686
|
+
/** Enabled condition based on current row selection */
|
|
17687
|
+
enabled?: boolean | "current" | "selected";
|
|
17688
|
+
/**
|
|
17689
|
+
* Params passed to the method. Supports template strings:
|
|
17690
|
+
* `${id}` → keyField value, `${current}` → current row,
|
|
17691
|
+
* `${selected}` → selected rows array, `${current.field}` → field of current row.
|
|
17692
|
+
*/
|
|
17693
|
+
params?: Record<string, unknown> | string;
|
|
17694
|
+
/** Success hint text shown as overlay near the button after the action completes */
|
|
17695
|
+
successHint?: string;
|
|
17696
|
+
}
|
|
17697
|
+
/** Pivot config for table widget */
|
|
17698
|
+
export interface IPivotConfig {
|
|
17699
|
+
/** Static pivot: fixed row examples */
|
|
17700
|
+
examples?: Record<string, unknown>[];
|
|
17701
|
+
/** Dynamic pivot: field name of the dropdown whose options feed the rows */
|
|
17702
|
+
dropdown?: string;
|
|
17703
|
+
/** Key mapping from examples/options to data array */
|
|
17704
|
+
join: {
|
|
17705
|
+
example?: string;
|
|
17706
|
+
option?: string;
|
|
17707
|
+
item: string;
|
|
17708
|
+
};
|
|
17709
|
+
}
|
|
17710
|
+
/** Object entry in a card's widget list — renders the named array field as a table, showing only the specified columns */
|
|
17711
|
+
export interface ICardWidgetEntry {
|
|
17712
|
+
/** Field name from the schema (must be a table/array field) */
|
|
17713
|
+
name: string;
|
|
17714
|
+
/** Unique render key (allows showing the same field multiple times with different column subsets) */
|
|
17715
|
+
id: string;
|
|
17716
|
+
/** Column names from the field's items.properties to display */
|
|
17717
|
+
widgets: string[];
|
|
17718
|
+
}
|
|
17719
|
+
/** Field configuration within a card */
|
|
17720
|
+
export interface IFieldConfig {
|
|
17721
|
+
title?: string;
|
|
17722
|
+
widget?: Partial<IWidgetConfig>;
|
|
17723
|
+
readOnly?: boolean;
|
|
17724
|
+
hidden?: boolean;
|
|
17725
|
+
required?: boolean;
|
|
17726
|
+
}
|
|
17727
|
+
/** Card configuration */
|
|
17728
|
+
export interface ICardConfig {
|
|
17729
|
+
label?: string;
|
|
17730
|
+
/** Field list for this card (preferred alias: widgets) */
|
|
17731
|
+
fields?: Record<string, IFieldConfig> | string[];
|
|
17732
|
+
/** Alias for fields — supports plain field names or ICardWidgetEntry objects for column-subset table views */
|
|
17733
|
+
widgets?: (string | ICardWidgetEntry)[];
|
|
17734
|
+
className?: string;
|
|
17735
|
+
readOnly?: boolean;
|
|
17736
|
+
collapsible?: boolean;
|
|
17737
|
+
loading?: boolean;
|
|
17738
|
+
/** When true: card is not shown visually; fields render as hidden inputs */
|
|
17739
|
+
hidden?: boolean;
|
|
17740
|
+
/** Permission key required to display this card. If set and no checkPermission
|
|
17741
|
+
* callback is provided (or it returns false), the card is not rendered. */
|
|
17742
|
+
permission?: string;
|
|
17743
|
+
/** Watch path for reactive cards (e.g. '$.selected.personTable') */
|
|
17744
|
+
watch?: string;
|
|
17745
|
+
/** Match condition to show polymorphic detail cards */
|
|
17746
|
+
match?: Record<string, unknown>;
|
|
17747
|
+
/** Parent table path for master-detail */
|
|
17748
|
+
parent?: string;
|
|
17749
|
+
/** Master-detail key mapping */
|
|
17750
|
+
master?: Record<string, string>;
|
|
17751
|
+
autoSelect?: boolean;
|
|
17752
|
+
}
|
|
17753
|
+
/** Props that every widget component receives */
|
|
17754
|
+
export interface IWidgetProps {
|
|
17755
|
+
/** Field id — forwarded to the inner control for label/id association (same value as name) */
|
|
17756
|
+
id?: string;
|
|
17757
|
+
name: string;
|
|
17758
|
+
schema: IEnrichedFieldSchema;
|
|
17759
|
+
value: unknown;
|
|
17760
|
+
onChange: (value: unknown) => void;
|
|
17761
|
+
onBlur: () => void;
|
|
17762
|
+
error?: {
|
|
17763
|
+
message?: string;
|
|
17764
|
+
};
|
|
17765
|
+
readOnly?: boolean;
|
|
17766
|
+
loading?: boolean;
|
|
17767
|
+
disabled?: boolean;
|
|
17768
|
+
/** All current form values — enables inter-widget reactivity (cascaded dropdowns etc.) */
|
|
17769
|
+
formValues?: Record<string, unknown>;
|
|
17770
|
+
/**
|
|
17771
|
+
* Called by table widgets when a row is selected (selectionMode: 'single').
|
|
17772
|
+
* Passes null when the selection is cleared.
|
|
17773
|
+
*/
|
|
17774
|
+
onSelect?: (name: string, selection: {
|
|
17775
|
+
row: Record<string, unknown>;
|
|
17776
|
+
index: number;
|
|
17777
|
+
} | null) => void;
|
|
17778
|
+
/** Dropdown option maps — keyed by dropdown name, each value is the options array.
|
|
17779
|
+
* Passed to TableWidget so column-level dropdown schemas can resolve their options. */
|
|
17780
|
+
dropdowns?: Record<string, unknown[]>;
|
|
17781
|
+
}
|
|
17782
|
+
/** Widget registry interface */
|
|
17783
|
+
export interface IWidgetRegistry {
|
|
17784
|
+
register(type: string, component: React$1.ComponentType<IWidgetProps>): void;
|
|
17785
|
+
get(type: string): React$1.ComponentType<IWidgetProps> | undefined;
|
|
17786
|
+
list(): string[];
|
|
17787
|
+
}
|
|
17788
|
+
/** Enriched field schema — normalized JSON Schema with widget config */
|
|
17789
|
+
export interface IEnrichedFieldSchema {
|
|
17790
|
+
title?: string;
|
|
17791
|
+
type?: string;
|
|
17792
|
+
/** JSON Schema format (e.g. 'date', 'date-time', 'email') */
|
|
17793
|
+
format?: string;
|
|
17794
|
+
description?: string;
|
|
17795
|
+
/** Placeholder text for input widgets */
|
|
17796
|
+
placeholder?: string;
|
|
17797
|
+
minLength?: number;
|
|
17798
|
+
maxLength?: number;
|
|
17799
|
+
minimum?: number;
|
|
17800
|
+
maximum?: number;
|
|
17801
|
+
pattern?: string;
|
|
17802
|
+
enum?: unknown[];
|
|
17803
|
+
readOnly?: boolean;
|
|
17804
|
+
required?: boolean;
|
|
17805
|
+
/** Normalized widget config */
|
|
17806
|
+
widget?: IWidgetConfig;
|
|
17807
|
+
/** Nested object properties — for composite/grouped fields accessed via dot-notation paths */
|
|
17808
|
+
properties?: Record<string, IEnrichedFieldSchema>;
|
|
17809
|
+
/** JSON Schema items — describes the shape of array-field rows (used by TableWidget) */
|
|
17810
|
+
items?: {
|
|
17811
|
+
properties?: Record<string, IEnrichedFieldSchema | Record<string, unknown>>;
|
|
17812
|
+
};
|
|
17813
|
+
/** Include field in filter panel */
|
|
17814
|
+
"x-filter"?: boolean;
|
|
17815
|
+
/** Enable inline column filtering (shows filter row in DataTable) */
|
|
17816
|
+
"x-filterable"?: boolean;
|
|
17817
|
+
/** Enable column sorting */
|
|
17818
|
+
"x-sort"?: boolean;
|
|
17819
|
+
/** Action method name — renders the field cell as a clickable link */
|
|
17820
|
+
action?: string;
|
|
17821
|
+
/** Card names to show this field in */
|
|
17822
|
+
"x-cards"?: string[];
|
|
17823
|
+
/** Raw x-widget extension from OpenAPI */
|
|
17824
|
+
"x-widget"?: Partial<IWidgetConfig>;
|
|
17825
|
+
/** Field name */
|
|
17826
|
+
name?: string;
|
|
17827
|
+
}
|
|
17828
|
+
/** Enriched object schema — normalized JSON Schema for an entity */
|
|
17829
|
+
export interface IEnrichedSchema {
|
|
17830
|
+
title?: string;
|
|
17831
|
+
description?: string;
|
|
17832
|
+
properties?: Record<string, IEnrichedFieldSchema>;
|
|
17833
|
+
required?: string[];
|
|
17834
|
+
/** Schema name (e.g. 'model.tree') */
|
|
17835
|
+
name?: string;
|
|
17836
|
+
}
|
|
17837
|
+
/** Extended action reference — action name plus static params override */
|
|
17838
|
+
export interface IActionRef {
|
|
17839
|
+
name: string;
|
|
17840
|
+
params?: Record<string, unknown>;
|
|
17841
|
+
}
|
|
17842
|
+
/** Toolbar button configuration */
|
|
17843
|
+
export interface IToolbarButton {
|
|
17844
|
+
label?: string;
|
|
17845
|
+
icon?: string;
|
|
17846
|
+
/** Action name (string) or extended ref */
|
|
17847
|
+
action?: string | IActionRef;
|
|
17848
|
+
/** Direct RPC method name (bypass action registry) */
|
|
17849
|
+
method?: string;
|
|
17850
|
+
permission?: string;
|
|
17851
|
+
/** Trigger form submit before invoking */
|
|
17852
|
+
submit?: boolean;
|
|
17853
|
+
/** Confirmation dialog message before invoking */
|
|
17854
|
+
confirm?: string;
|
|
17855
|
+
/** Enabled condition */
|
|
17856
|
+
enabled?: boolean | "dirty" | "clean" | "current" | "selected";
|
|
17857
|
+
visible?: boolean;
|
|
17858
|
+
align?: "left" | "right";
|
|
17859
|
+
/** Split-button sub-items */
|
|
17860
|
+
menu?: IToolbarButton[];
|
|
17861
|
+
/** Extra params passed to the action/method on invocation.
|
|
17862
|
+
* May be a plain object or a string template using `${field}`, `${current}`,
|
|
17863
|
+
* `${selected}` and `${current.field}` syntax for row-context interpolation. */
|
|
17864
|
+
params?: Record<string, unknown> | string;
|
|
17865
|
+
/** Success hint text shown in an overlay near the button after the action completes */
|
|
17866
|
+
successHint?: string;
|
|
17867
|
+
}
|
|
17868
|
+
export type LayoutRow = string | (string | string[])[];
|
|
17869
|
+
export type FlatLayoutConfig = LayoutRow[];
|
|
17870
|
+
/** A single tab/step item in a tab or steps layout */
|
|
17871
|
+
export interface ILayoutTabItem {
|
|
17872
|
+
id: string;
|
|
17873
|
+
label?: string;
|
|
17874
|
+
icon?: string;
|
|
17875
|
+
/** Card names shown in this tab/step. A string is a single-card deck; a string[] is a
|
|
17876
|
+
* multi-card deck where all cards are stacked vertically in the same grid column. */
|
|
17877
|
+
widgets: (string | string[])[];
|
|
17878
|
+
/** Optional React component rendered in place of cards (e.g. Explorer) */
|
|
17879
|
+
component?: React$1.ComponentType;
|
|
17880
|
+
}
|
|
17881
|
+
/** Tab or steps layout (object form) */
|
|
17882
|
+
export interface ITabLayoutConfig {
|
|
17883
|
+
orientation?: "top" | "left" | "bottom" | "right";
|
|
17884
|
+
type?: "steps";
|
|
17885
|
+
items: ILayoutTabItem[];
|
|
17886
|
+
}
|
|
17887
|
+
/** A single panel in a split layout */
|
|
17888
|
+
export interface ISplitLayoutPanel {
|
|
17889
|
+
/** Panel size as percentage (default auto-distributed) */
|
|
17890
|
+
size?: number;
|
|
17891
|
+
/** Minimum size in pixels */
|
|
17892
|
+
minSize?: number;
|
|
17893
|
+
/** Card names rendered in this panel (stacked vertically) */
|
|
17894
|
+
cards: string[];
|
|
17895
|
+
}
|
|
17896
|
+
/**
|
|
17897
|
+
* Split layout — renders cards in resizable side-by-side panels using a Splitter.
|
|
17898
|
+
* Ideal for navigator + table + details explorer-style layouts.
|
|
17899
|
+
*/
|
|
17900
|
+
export interface ISplitLayoutConfig {
|
|
17901
|
+
type: "split";
|
|
17902
|
+
/** Panel orientation: 'horizontal' (default) = side by side, 'vertical' = top/bottom */
|
|
17903
|
+
orientation?: "horizontal" | "vertical";
|
|
17904
|
+
panels: ISplitLayoutPanel[];
|
|
17905
|
+
}
|
|
17906
|
+
export type LayoutConfig = FlatLayoutConfig | ITabLayoutConfig | ISplitLayoutConfig;
|
|
17577
17907
|
/**
|
|
17578
17908
|
* Model system types.
|
|
17579
17909
|
*
|
|
@@ -17665,20 +17995,22 @@ export interface IBrowserConfig {
|
|
|
17665
17995
|
title?: string;
|
|
17666
17996
|
icon?: string;
|
|
17667
17997
|
permission?: IBrowserPermissions;
|
|
17668
|
-
/** Column transformation applied to server fetch params */
|
|
17669
|
-
fetch?: (params: Record<string, unknown>) => Record<string, unknown>;
|
|
17670
17998
|
/** Default filter applied on page open */
|
|
17671
17999
|
filter?: Record<string, unknown>;
|
|
17672
18000
|
/** Result set key to use from server response */
|
|
17673
18001
|
resultSet?: string;
|
|
18002
|
+
/** Extra toolbar buttons */
|
|
18003
|
+
toolbar?: IToolbarButton[];
|
|
18004
|
+
}
|
|
18005
|
+
export interface IBrowserConfigOptional {
|
|
18006
|
+
/** Column transformation applied to server fetch params */
|
|
18007
|
+
fetch?: (params: Record<string, unknown>) => Record<string, unknown>;
|
|
17674
18008
|
/** Whether to show "Create" button */
|
|
17675
18009
|
create?: Array<{
|
|
17676
18010
|
title?: string;
|
|
17677
18011
|
type?: string;
|
|
17678
18012
|
permission?: string;
|
|
17679
18013
|
}>;
|
|
17680
|
-
/** Extra toolbar buttons */
|
|
17681
|
-
toolbar?: unknown[];
|
|
17682
18014
|
}
|
|
17683
18015
|
/** Editor page configuration */
|
|
17684
18016
|
export interface IEditorConfig {
|
|
@@ -17717,18 +18049,15 @@ export interface IModelSpec {
|
|
|
17717
18049
|
/** JSON Schema overlay merged on top of server OpenAPI schema */
|
|
17718
18050
|
schema?: ISchemaOverlay;
|
|
17719
18051
|
/** Named card layout definitions */
|
|
17720
|
-
cards?: Record<string,
|
|
18052
|
+
cards?: Record<string, ICardConfig>;
|
|
17721
18053
|
/** Browse page configuration */
|
|
17722
|
-
browser?: IBrowserConfig;
|
|
18054
|
+
browser?: IBrowserConfig & IBrowserConfigOptional;
|
|
17723
18055
|
/** Editor page configuration */
|
|
17724
18056
|
editor?: IEditorConfig;
|
|
17725
18057
|
/** Report page configuration */
|
|
17726
18058
|
report?: IReportConfig;
|
|
17727
18059
|
/** Tab layouts for editor */
|
|
17728
|
-
layouts?:
|
|
17729
|
-
edit?: ILayoutTab[] | string[];
|
|
17730
|
-
[key: string]: unknown;
|
|
17731
|
-
};
|
|
18060
|
+
layouts?: Record<string, LayoutConfig>;
|
|
17732
18061
|
/** Method name overrides */
|
|
17733
18062
|
methods?: IMethodsConfig;
|
|
17734
18063
|
}
|
|
@@ -17739,9 +18068,7 @@ export interface IResolvedModelSpec extends Required<IModelSpec> {
|
|
|
17739
18068
|
objectTitle: string;
|
|
17740
18069
|
keyField: string;
|
|
17741
18070
|
nameField: string;
|
|
17742
|
-
browser: Required<IBrowserConfig> &
|
|
17743
|
-
permission: IBrowserPermissions;
|
|
17744
|
-
};
|
|
18071
|
+
browser: Required<IBrowserConfig> & IBrowserConfigOptional;
|
|
17745
18072
|
editor: Required<IEditorConfig>;
|
|
17746
18073
|
report: Required<IReportConfig>;
|
|
17747
18074
|
methods: Required<IMethodsConfig>;
|
|
@@ -17801,7 +18128,7 @@ export type ConfigDiff = Map<string, {
|
|
|
17801
18128
|
/** Subscriber callback invoked after a successful reload */
|
|
17802
18129
|
export type ConfigSubscriber = (diff: ConfigDiff, next: object, prev: object) => void | Promise<void>;
|
|
17803
18130
|
/**
|
|
17804
|
-
* Mode used when the config proxy is queried during handler factory
|
|
18131
|
+
* Mode used when the config proxy is queried during handler factory initialization.
|
|
17805
18132
|
*
|
|
17806
18133
|
* - `'throw'` — throw immediately (default; keeps misuse from going unnoticed)
|
|
17807
18134
|
* - `'collect'` — accumulate errors and return them from exitConfigFactoryPhase()
|
|
@@ -17868,6 +18195,7 @@ export interface IPlatformApi {
|
|
|
17868
18195
|
isAfter: (time: HRTime, timeout: HRTime) => boolean;
|
|
17869
18196
|
spare: (time: HRTime, latency?: number) => number;
|
|
17870
18197
|
};
|
|
18198
|
+
configs: string[];
|
|
17871
18199
|
}
|
|
17872
18200
|
export interface IErrorFactory {
|
|
17873
18201
|
get(type?: string): unknown;
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,IAAI,GAWP,MAAM,SAAS,CAAC;AAQjB,OAAO,KAAK,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,IAAI,GAWP,MAAM,SAAS,CAAC;AAQjB,OAAO,KAAK,MAAM,mBAAmB,CAAC;AA6wBtC,MAAM,IAAI,GAAW,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AAG9C,MAAM,OAAgB,QAAQ;IAC1B,IAAI,CAAoB;IACd,GAAG,CAA8B;IAC3C,YAAmB,GAAkB;QACjC,IAAI,CAAC,IAAI,GAAG,GAAG,EAAE,GAAG,CAAC;IACzB,CAAC;IACS,KAAK,GAAkB,CAAC,GAAG,IAA+B,EAAE,EAAE;QACpE,MAAM,MAAM,GAAG,KAAK,CAAqB,GAAG,IAAI,CAAC,CAAC;QAClD,IAAI,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI;YAC5B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC,CAAC,CAAC;QAChF,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IACK,KAAK,CAAC,IAAI;QACb,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,6DAA6D;IACtD,KAAK,CAAC,KAAK,CAA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AC,UAAsD,EAAE,IAAI,EAAE;IAChF,KAAK,EAAE,SAAS;CACnB,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,KAAK,GAAG,CACjB,UAA4C,EACQ,EAAE,CACtD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG,CACnB,UAAiC,EACU,EAAE,CAC7C,MAAM,CAAC,cAAc,CAAC,UAAyD,EAAE,IAAI,EAAE;IACnF,KAAK,EAAE,SAAS;CACnB,CAAC,CAAC;AACP,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,UAAiC,EACe,EAAE,CAClD,MAAM,CAAC,cAAc,CAAC,UAA8D,EAAE,IAAI,EAAE;IACxF,KAAK,EAAE,cAAc;CACxB,CAAC,CAAC;AAeP,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,IAAiC,EAAS,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAEnF,eAAe;IACX,OAAO;IACP,aAAa;IACb,OAAO;IACP,UAAU;IACV,GAAG;IACH,KAAK;IACL,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,OAAO;IACP,IAAI;CACP,CAAC"}
|
package/dist/widget.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../widget.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@feasibleone/blong",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "API and DRY focused RAD framework https://feasibleone.github.io/blong-docs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blong",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@rushstack/heft-typescript-plugin": "^1.3.1",
|
|
35
35
|
"@slack/types": "^2.20.1",
|
|
36
36
|
"@slack/webhook": "^7.0.7",
|
|
37
|
+
"@types/react": "^19.1.2",
|
|
37
38
|
"@types/request": "^2.48.13",
|
|
38
39
|
"@types/ut-function.merge": "file:./types/ut-function.merge",
|
|
39
40
|
"bson": "^7.2.0",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"mongodb": "^7.1.0",
|
|
44
45
|
"node-vault": "^0.10.10",
|
|
45
46
|
"openapi-types": "^12.1.3",
|
|
47
|
+
"react": "^19.1.0",
|
|
46
48
|
"tarn": "^3.0.2",
|
|
47
49
|
"typescript": "^5.9.3"
|
|
48
50
|
},
|
package/types.ts
CHANGED
|
@@ -31,7 +31,7 @@ import type {Duplex} from 'node:stream';
|
|
|
31
31
|
import type {OpenAPI, OpenAPIV2, OpenAPIV3_1} from 'openapi-types';
|
|
32
32
|
import type {Level, LogFn, Logger as PinoLogger} from 'pino';
|
|
33
33
|
import merge from 'ut-function.merge';
|
|
34
|
-
import type {Knex} from './knex.
|
|
34
|
+
import type {Knex} from './knex.ts';
|
|
35
35
|
import type {IMock, IModelSpec} from './model.ts';
|
|
36
36
|
|
|
37
37
|
// export {
|
|
@@ -49,6 +49,7 @@ export type {IJsonSchema, OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1} from 'open
|
|
|
49
49
|
// export type {Level, LogFn, Logger as PinoLogger} from 'pino';
|
|
50
50
|
export type {Knex} from './knex.js';
|
|
51
51
|
export type * from './model.ts';
|
|
52
|
+
export type * from './widget.ts';
|
|
52
53
|
|
|
53
54
|
export type ServerContext = {
|
|
54
55
|
queryBuilder?: Knex;
|
|
@@ -94,7 +95,7 @@ export type ConfigSubscriber = (
|
|
|
94
95
|
) => void | Promise<void>;
|
|
95
96
|
|
|
96
97
|
/**
|
|
97
|
-
* Mode used when the config proxy is queried during handler factory
|
|
98
|
+
* Mode used when the config proxy is queried during handler factory initialization.
|
|
98
99
|
*
|
|
99
100
|
* - `'throw'` — throw immediately (default; keeps misuse from going unnoticed)
|
|
100
101
|
* - `'collect'` — accumulate errors and return them from exitConfigFactoryPhase()
|
|
@@ -160,6 +161,7 @@ export interface IPlatformApi {
|
|
|
160
161
|
isAfter: (time: HRTime, timeout: HRTime) => boolean;
|
|
161
162
|
spare: (time: HRTime, latency?: number) => number;
|
|
162
163
|
};
|
|
164
|
+
configs: string[];
|
|
163
165
|
}
|
|
164
166
|
|
|
165
167
|
export interface IErrorFactory {
|