Skip to content

Instantly share code, notes, and snippets.

@MawiraIke
Created May 19, 2021 16:09
Show Gist options
  • Save MawiraIke/24c749bea2edb03452e48207039cf6ef to your computer and use it in GitHub Desktop.
Save MawiraIke/24c749bea2edb03452e48207039cf6ef to your computer and use it in GitHub Desktop.
@startuml
hide empty description
state disabledchoice <<choice>>
state disabled
state enabled{
state freetextchoice <<choice>>
state default_drop {
state no_focus
state open {
state filter_choice <<choice>>
state filtering as "filter-box?"{
state blank_fb as "blank"{
state blank_fb_choice <<choice>>
state placeholder_fb as "placeholder"
state blank_fb2 as "blank"
[*] -> blank_fb_choice
blank_fb_choice -> placeholder_fb : [filter-placeholder = true]
blank_fb_choice -> blank_fb2 : [filter-placeholder = false]
}
state text_fb as "filtering"
[*] -> blank_fb
blank_fb -> text_fb : press-key
text_fb -> blank_fb : clear filter box
}
state no_filtering as "no_filter_box"
[*] -> filter_choice
filter_choice -> filtering : [filter-box? = true]
filter_choice --> no_filtering : [filter-box? = false]
--
state keybd_highlight
state no_highlight
state keybd_highlight_choice <<choice>>
[*] -> keybd_highlight_choice
keybd_highlight_choice -> no_highlight : [choices list is empty || \n selected-choice = false || \n (selected-choice = true && \n selected-choice not in choices) ]
keybd_highlight_choice --> keybd_highlight : [selected-choice = true && \n choices list is not empty && \n selected-choice in choices]
no_highlight --> keybd_highlight : press-up \n [choices list not empty]
no_highlight --> keybd_highlight : press-down \n [choices list not empty]
no_highlight --> keybd_highlight : press-home \n [choices list not empty]
no_highlight --> keybd_highlight : press-end \n [choices list not empty]
no_highlight --> keybd_highlight : press-page-up \n [choices list not empty]
--
state mouse_highlight
state no_mouse_highlight
[*] -> no_mouse_highlight
no_mouse_highlight --> mouse_highlight : on-mouse-over [choices list not empty]
mouse_highlight --> no_mouse_highlight : on-mouse-out
--
state no_choices
state choices
state choices_choice <<choice>>
[*] -> choices_choice
choices_choice --> choices : [choices list not empty]
choices_choice -> no_choices : [empty choices list]
}
state focused
[*] -> no_focus
no_focus --> open : on-mouse-click
open --> no_focus: on-mouse-focus-lost
open --> no_focus: press-escape
open --> focused : on-mouse-click
focused -> open : on-mouse-click
focused -> open : press-up
focused -> open : press-down
focused -> open : press-end
focused -> open : press-page-up
focused -> open : press-page-down
focused -> open : press-enter[enter-drop? = true]
focused -> focused : press-home
focused -> focused : press-escape[cancelable? = true]
focused -down-> no_focus : on-mouse-focus-lost
--
state show_tooltip
state hide_tooltip
[*] -> hide_tooltip
hide_tooltip -> show_tooltip : [on-mouse-over && tooltip = true]
show_tooltip -> hide_tooltip : [on-mouse-out]
}
'Free text state
state free_text{
state idle as "no_focus?"
state typing as "focused?"
[*] -> idle
idle -> typing : on-mouse-click
typing -> idle : on-mouse-focus-lost
typing -> typing : press-key
--
state text_open as "open?"
state text_closed as "closed?"
[*] -> text_closed
text_closed -> text_open : click dropdown
text_open -> text_closed : click dropdown
text_open -> text_closed : press-escape
}
[*] -> freetextchoice
freetextchoice --> free_text : [free-text? = true]
freetextchoice -> default_drop : [free-text? = false]
--
state freetextselectchoice <<choice>>
state blank_ft as "blank?" {
state blankplaceholderchoice <<choice>>
state blank_placeholder_ft as "blank"
state text_placeholder_ft as "selected"
[*] -> blankplaceholderchoice
blankplaceholderchoice -> blank_placeholder_ft : [placeholder is nil]
blankplaceholderchoice -> text_placeholder_ft : [placeholder not nil]
}
state selected_ft as "selected-choice?"
[*] -> freetextselectchoice
freetextselectchoice -> blank_ft : [selected-choice = false]
freetextselectchoice --> selected_ft : [selected-choice = true]
}
[*] --> disabledchoice
disabledchoice --> disabled : [disabled? = true]
disabledchoice -> enabled : [disabled? = false]
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment