Content-Length: 39100 | pFad | http://github.com/postgresml/postgresml/pull/1048.patch
thub.com From d722b51c28c0b6c70749e587d6f388bc78cfb249 Mon Sep 17 00:00:00 2001 From: Dan <39170265+chillenberger@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:39:57 -0600 Subject: [PATCH 1/7] create select component from dropdown --- .../src/components/dropdown/dropdown.scss | 6 +- pgml-dashboard/src/components/dropdown/mod.rs | 46 ++++++- .../src/components/dropdown/template.html | 13 +- pgml-dashboard/src/components/inputs/mod.rs | 4 + .../src/components/inputs/select/mod.rs | 111 +++++++++++++++ .../src/components/inputs/select/option.html | 4 + .../src/components/inputs/select/select.scss | 3 + .../inputs/select/select_controller.js | 11 ++ .../components/inputs/select/template.html | 33 +++++ .../inputs/text/editable_header/mod.rs | 40 +----- .../components/left_nav_web_app/template.html | 2 +- pgml-dashboard/src/components/mod.rs | 3 + .../components/navbar_web_app/template.html | 2 +- .../dropdown_link/dropdown_link.scss | 3 + .../navigation/dropdown_link/mod.rs | 17 +++ .../navigation/dropdown_link/template.html | 8 ++ .../src/components/navigation/mod.rs | 4 + pgml-dashboard/src/components/stimulus/mod.rs | 10 ++ .../stimulus/stimulus_action/mod.rs | 126 ++++++++++++++++++ .../stimulus/stimulus_action/template.html | 1 + .../stimulus/stimulus_target/mod.rs | 36 +++++ .../stimulus/stimulus_target/template.html | 1 + pgml-dashboard/static/css/modules.scss | 2 + .../static/css/scss/abstracts/variables.scss | 23 +++- .../templates/content/playground.html | 31 +++-- 25 files changed, 472 insertions(+), 68 deletions(-) create mode 100644 pgml-dashboard/src/components/inputs/select/mod.rs create mode 100644 pgml-dashboard/src/components/inputs/select/option.html create mode 100644 pgml-dashboard/src/components/inputs/select/select.scss create mode 100644 pgml-dashboard/src/components/inputs/select/select_controller.js create mode 100644 pgml-dashboard/src/components/inputs/select/template.html create mode 100644 pgml-dashboard/src/components/navigation/dropdown_link/dropdown_link.scss create mode 100644 pgml-dashboard/src/components/navigation/dropdown_link/mod.rs create mode 100644 pgml-dashboard/src/components/navigation/dropdown_link/template.html create mode 100644 pgml-dashboard/src/components/stimulus/mod.rs create mode 100644 pgml-dashboard/src/components/stimulus/stimulus_action/mod.rs create mode 100644 pgml-dashboard/src/components/stimulus/stimulus_action/template.html create mode 100644 pgml-dashboard/src/components/stimulus/stimulus_target/mod.rs create mode 100644 pgml-dashboard/src/components/stimulus/stimulus_target/template.html diff --git a/pgml-dashboard/src/components/dropdown/dropdown.scss b/pgml-dashboard/src/components/dropdown/dropdown.scss index 79c0d89ba..8d73f49ad 100644 --- a/pgml-dashboard/src/components/dropdown/dropdown.scss +++ b/pgml-dashboard/src/components/dropdown/dropdown.scss @@ -48,6 +48,10 @@ --bs-btn-active-color: #{$gray-100}; --bs-btn-hover-color: #{$gray-100}; + &.error { + border-color: #{$error}; + } + .material-symbols-outlined { color: #{$neon-shade-100}; } @@ -73,7 +77,7 @@ } .menu-item { - a { + a, div { padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; diff --git a/pgml-dashboard/src/components/dropdown/mod.rs b/pgml-dashboard/src/components/dropdown/mod.rs index a53394e1b..77f71b1ce 100644 --- a/pgml-dashboard/src/components/dropdown/mod.rs +++ b/pgml-dashboard/src/components/dropdown/mod.rs @@ -1,3 +1,5 @@ +use crate::components::navigation::dropdown_link::DropdownLink; +use crate::components::stimulus::stimulus_target::StimulusTarget; use pgml_components::component; use pgml_components::Component; use sailfish::TemplateOnce; @@ -21,35 +23,57 @@ pub struct Dropdown { //github.com/ The currently selected value. value: DropdownValue, - //github.com/ The list of dropdown links to render. - links: Vec