إنتقل إلى المحتوى الرئيسي

std-drawer

Level: Atom | Entity: DrawerContent | Persistence: runtime

2 states, 3 events, 3 transitions

Live Preview

orbital DrawerContentOrbital {
entity DrawerContent [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
}
trait DrawerContentDrawer -> DrawerContent [interaction] {
initial: closed
state closed {
INIT -> closed
(fetch DrawerContent)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "panel-right", size: "lg" }, { type: "typography", content: "Details", variant: "h2" }] }, { type: "button", label: "Open", event: "OPEN", variant: "primary", icon: "panel-right" }] }, { type: "divider" }, { type: "data-grid", entity: "DrawerContent", emptyIcon: "inbox", emptyTitle: "No drawercontents yet", emptyDescription: "Add drawercontents to see them here.", renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "typography", variant: "h4", content: "@item.name" }] }] }] })
OPEN -> open
(fetch DrawerContent)
(render-ui drawer { type: "stack", direction: "vertical", gap: "none", children: [{ type: "drawer", title: "Details", isOpen: true, children: [{ type: "stack", direction: "vertical", gap: "md", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }, { type: "divider" }, { type: "stack", direction: "horizontal", gap: "sm", justify: "end", children: [{ type: "button", label: "Close", event: "CLOSE", variant: "ghost" }] }] }] }, { type: "side-panel", title: "Details", isOpen: true, position: "right", children: [{ type: "stack", direction: "vertical", gap: "md", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Name" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "name"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Description" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "description"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "Status" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "status"] }] }, { type: "stack", direction: "horizontal", gap: "md", justify: "space-between", children: [{ type: "typography", variant: "caption", content: "CreatedAt" }, { type: "typography", variant: "body", content: ["object/get", ["array/first", "@entity"], "createdAt"] }] }] }] }] })
}
state open {
CLOSE -> closed
(render-ui drawer null)
(fetch DrawerContent)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", justify: "space-between", align: "center", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "panel-right", size: "lg" }, { type: "typography", content: "Details", variant: "h2" }] }, { type: "button", label: "Open", event: "OPEN", variant: "primary", icon: "panel-right" }] }, { type: "divider" }, { type: "data-grid", entity: "DrawerContent", emptyIcon: "inbox", emptyTitle: "No drawercontents yet", emptyDescription: "Add drawercontents to see them here.", renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "typography", variant: "h4", content: "@item.name" }] }] }] })
}
}
page "/drawercontents/drawer" -> DrawerContentDrawer
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

FieldTypeDefault
idstring-
namestring-
descriptionstring-
statusstring"active"
createdAtstring-

States

StateType
closedInitial
open-

Events

EventPayload
INIT-
OPEN-
CLOSE-

Transitions

FromEventToEffects
closedINITclosed2 effects
closedOPENopen2 effects
openCLOSEclosed3 effects