Preskoči na vsebino

std-search

Level: Atom | Entity: SearchResult | Persistence: runtime

2 states, 3 events, 4 transitions

Live Preview

orbital SearchResultOrbital {
entity SearchResult [runtime] {
id : string
name : string
description : string
status : string
createdAt : string
}
trait SearchResultSearch -> SearchResult [interaction] {
initial: idle
state idle {
INIT -> idle
(fetch SearchResult)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "search", size: "lg" }, { type: "typography", content: "Search SearchResults", variant: "h2" }] }, { type: "divider" }, { type: "search-input", placeholder: "Search...", event: "SEARCH" }, { type: "empty-state", icon: "search", title: "Search to find results", description: "Type a query to search across searchresults." }] })
SEARCH -> searching
(fetch SearchResult)
(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: "search", size: "lg" }, { type: "typography", content: ["concat", "Results for \"", "@payload.query", "\""], variant: "h2" }] }, { type: "button", label: "Clear", event: "CLEAR", variant: "ghost", icon: "x" }] }, { type: "divider" }, { type: "popover", position: "bottom", trigger: "click", children: [{ type: "data-grid", entity: "SearchResult", emptyIcon: "search", emptyTitle: "No results found", emptyDescription: "Try a different search term.", renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "typography", variant: "h4", content: "@item.name" }] }] }] }] })
}
state searching {
SEARCH -> searching
(fetch SearchResult)
(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: "search", size: "lg" }, { type: "typography", content: ["concat", "Results for \"", "@payload.query", "\""], variant: "h2" }] }, { type: "button", label: "Clear", event: "CLEAR", variant: "ghost", icon: "x" }] }, { type: "divider" }, { type: "popover", position: "bottom", trigger: "click", children: [{ type: "data-grid", entity: "SearchResult", emptyIcon: "search", emptyTitle: "No results found", emptyDescription: "Try a different search term.", renderItem: ["fn", "item", { type: "stack", direction: "vertical", gap: "sm", children: [{ type: "typography", variant: "h4", content: "@item.name" }] }] }] }] })
CLEAR -> idle
(fetch SearchResult)
(render-ui main { type: "stack", direction: "vertical", gap: "lg", children: [{ type: "stack", direction: "horizontal", gap: "md", align: "center", children: [{ type: "icon", name: "search", size: "lg" }, { type: "typography", content: "Search SearchResults", variant: "h2" }] }, { type: "divider" }, { type: "search-input", placeholder: "Search...", event: "SEARCH" }, { type: "empty-state", icon: "search", title: "Search to find results", description: "Type a query to search across searchresults." }] })
}
}
page "/searchresults/search" -> SearchResultSearch
}
Loading preview...

Orbital Visualization

Loading visualization...

Entity Fields

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

States

StateType
idleInitial
searching-

Events

EventPayload
INIT-
SEARCHquery: string
CLEAR-

Transitions

FromEventToEffects
idleINITidle2 effects
idleSEARCHsearching2 effects
searchingSEARCHsearching2 effects
searchingCLEARidle2 effects