@ashley-shrok/viewmodel-shell 0.3.6 → 0.3.8
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/package.json +1 -1
- package/src/browser.ts +1 -1
- package/src/index.ts +3 -0
- package/styles/default.css +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashley-shrok/viewmodel-shell",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "A server-driven UI framework where the wire format is structured enough that agents can build full-stack apps without ever opening a browser and all UI tests are pure unit tests with no browser runtime. Server returns a JSON tree of typed nodes; a thin TypeScript adapter renders it to DOM. Backend-agnostic — a .NET reference backend ships with the repo, but any language can produce the JSON contract.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/browser.ts
CHANGED
|
@@ -424,7 +424,7 @@ export class BrowserAdapter implements Adapter {
|
|
|
424
424
|
backdrop.className = "vms-modal-backdrop";
|
|
425
425
|
|
|
426
426
|
const modal = document.createElement("div");
|
|
427
|
-
modal.className =
|
|
427
|
+
modal.className = `vms-modal${n.size ? ` vms-modal--${n.size}` : ""}`;
|
|
428
428
|
modal.setAttribute("role", "dialog");
|
|
429
429
|
modal.setAttribute("aria-modal", "true");
|
|
430
430
|
|
package/src/index.ts
CHANGED
|
@@ -145,6 +145,9 @@ export interface ModalNode {
|
|
|
145
145
|
footer?: ViewNode[];
|
|
146
146
|
/** Dispatched when the close button is clicked. If omitted, no close button is rendered. */
|
|
147
147
|
dismissAction?: ActionEvent;
|
|
148
|
+
/** Width variant. Default is "medium" (~520px). "wide" (~800px) suits tables/dashboards;
|
|
149
|
+
* "fullscreen" (~95vw/95vh) for content that needs the whole viewport. */
|
|
150
|
+
size?: "narrow" | "medium" | "wide" | "fullscreen";
|
|
148
151
|
}
|
|
149
152
|
|
|
150
153
|
export interface TableColumn {
|
package/styles/default.css
CHANGED
|
@@ -321,6 +321,12 @@ select.vms-field__input { cursor: pointer; padding-right: 2.25rem; }
|
|
|
321
321
|
display: flex;
|
|
322
322
|
flex-direction: column;
|
|
323
323
|
}
|
|
324
|
+
/* Size variants — pick via ModalNode.size = "narrow" | "wide" | "fullscreen".
|
|
325
|
+
Default (no modifier) = ~520px, the same as .vms-modal--medium. */
|
|
326
|
+
.vms-modal--narrow { max-width: 400px; }
|
|
327
|
+
.vms-modal--medium { max-width: 520px; }
|
|
328
|
+
.vms-modal--wide { max-width: 800px; }
|
|
329
|
+
.vms-modal--fullscreen { max-width: 95vw; max-height: 95vh; }
|
|
324
330
|
.vms-modal__header {
|
|
325
331
|
display: flex;
|
|
326
332
|
align-items: center;
|
|
@@ -345,6 +351,11 @@ select.vms-field__input { cursor: pointer; padding-right: 2.25rem; }
|
|
|
345
351
|
flex-direction: column;
|
|
346
352
|
gap: 0.75rem;
|
|
347
353
|
}
|
|
354
|
+
/* Children of the modal body must not be flex-shrunk below their natural
|
|
355
|
+
height — otherwise a table-wrapper (overflow:hidden) inside the modal
|
|
356
|
+
gets squeezed and clips rows. The modal body's overflow-y:auto handles
|
|
357
|
+
the scroll. */
|
|
358
|
+
.vms-modal__body > * { flex-shrink: 0; }
|
|
348
359
|
.vms-modal__footer {
|
|
349
360
|
display: flex;
|
|
350
361
|
justify-content: flex-end;
|
|
@@ -360,7 +371,9 @@ select.vms-field__input { cursor: pointer; padding-right: 2.25rem; }
|
|
|
360
371
|
.vms-table-wrapper {
|
|
361
372
|
border: 1px solid var(--vms-border);
|
|
362
373
|
border-radius: var(--vms-radius);
|
|
363
|
-
|
|
374
|
+
/* Horizontal scroll when the table is wider than its container (e.g. a
|
|
375
|
+
7-column table inside a medium modal). Always-reachable beats clipped. */
|
|
376
|
+
overflow-x: auto;
|
|
364
377
|
}
|
|
365
378
|
.vms-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
366
379
|
.vms-table__th {
|