@ashley-shrok/viewmodel-shell 0.15.0 → 1.0.1
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/browser.d.ts +20 -9
- package/dist/browser.js +168 -266
- package/dist/index.d.ts +142 -45
- package/dist/index.js +262 -11
- package/dist/server.d.ts +79 -2
- package/dist/server.js +293 -12
- package/dist/tui.d.ts +2 -2
- package/dist/tui.js +62 -97
- package/package.json +1 -1
- package/styles/default.css +27 -9
package/dist/browser.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import type { ViewNode, ActionEvent, Adapter } from "./index.js";
|
|
1
|
+
import type { ViewNode, ActionEvent, Adapter, StateAccess } from "./index.js";
|
|
2
2
|
export declare class BrowserAdapter implements Adapter {
|
|
3
3
|
private container;
|
|
4
4
|
private fileRegistry;
|
|
5
|
+
private sa;
|
|
5
6
|
constructor(container: HTMLElement);
|
|
6
|
-
render(vm: ViewNode, onAction: (action: ActionEvent) => void): void;
|
|
7
|
+
render(vm: ViewNode, onAction: (action: ActionEvent) => void, stateAccess?: StateAccess): void;
|
|
7
8
|
navigate(url: string): void;
|
|
8
9
|
storage(scope: "local" | "session", key: string, value: string): void;
|
|
9
|
-
/** Save an authenticated-download blob via the browser's native Save-As.
|
|
10
|
-
* contentType is informational — the Blob's own .type takes precedence in
|
|
11
|
-
* browsers. We accept the arg for adapter symmetry (other adapters use it). */
|
|
12
10
|
saveFile(data: Blob, filename: string, _contentType: string): void;
|
|
13
|
-
|
|
14
|
-
* calls this on every response with `response.preventUnload ?? false`, so
|
|
15
|
-
* the lock-and-clear cycle is just "server sets preventUnload:true while
|
|
16
|
-
* work is pending, omits it (or sets false) when done." Idempotent. */
|
|
11
|
+
setBusy(active: boolean): void;
|
|
17
12
|
private unloadHandler;
|
|
18
13
|
setPreventUnload(active: boolean): void;
|
|
19
14
|
transport(input: string, init: {
|
|
@@ -29,17 +24,33 @@ export declare class BrowserAdapter implements Adapter {
|
|
|
29
24
|
private section;
|
|
30
25
|
private list;
|
|
31
26
|
private listItem;
|
|
27
|
+
/** FormNode — no harvest. Field values live in state via their bind paths;
|
|
28
|
+
* submit dispatches just `{name}`. File inputs are walked for binaries to
|
|
29
|
+
* attach to action.files (multipart side channel). */
|
|
32
30
|
private form;
|
|
31
|
+
/** FieldNode — reads value from `sa.read(bind)`; writes back on input/change.
|
|
32
|
+
* When `action` is set, it fires on Enter (text-like) or change (select) —
|
|
33
|
+
* the new value is already in state by that point. */
|
|
33
34
|
private field;
|
|
35
|
+
/** CheckboxNode (standalone, immediate-dispatch) — bound boolean; on toggle,
|
|
36
|
+
* write to state then dispatch the action name (if any). */
|
|
34
37
|
private checkbox;
|
|
35
38
|
private button;
|
|
36
39
|
private text;
|
|
37
40
|
private link;
|
|
38
41
|
private statBar;
|
|
42
|
+
/** TabsNode — on click, write tab.value to state at node.bind, then dispatch
|
|
43
|
+
* the tab's own action name. */
|
|
39
44
|
private tabs;
|
|
40
45
|
private image;
|
|
41
46
|
private progress;
|
|
42
47
|
private modal;
|
|
48
|
+
/** TableNode — sort writes {column, direction} to sortBind then dispatches
|
|
49
|
+
* sortActions[col.key]; filter inputs are bound to filterBinds[col.key],
|
|
50
|
+
* every keystroke writes, Enter dispatches filterAction; pagination
|
|
51
|
+
* prev/next write the target page to paginationBind then dispatch
|
|
52
|
+
* prevAction/nextAction. Per-row buttons are plain ButtonNodes. Selection
|
|
53
|
+
* is no longer a framework concept. */
|
|
43
54
|
private table;
|
|
44
55
|
private copyButton;
|
|
45
56
|
}
|