Commit 44add4d8 authored by Bruno Burke's avatar Bruno Burke 😁

fix disabled? parameter in dropdown-select, change param name from disabled to disabled?

parent 7891afe6
Pipeline #45489 failed with stages
in 57 seconds
......@@ -25,7 +25,7 @@
(defn input-text
[{:keys [field-class input-class input-size label-icon
placeholder value on-change label icons expanded?
disabled tooltip autocomplete readonly? help]}]
disabled? tooltip autocomplete readonly? help]}]
(let [id (gensym "input-text")]
(reagent/create-class
{:component-did-mount (fn []
......@@ -42,7 +42,7 @@
:reagent-render
(fn [{:keys [field-class input-class input-size label-icon
placeholder value on-change label icons expanded?
disabled tooltip autocomplete readonly? help]}]
disabled? tooltip autocomplete readonly? help]}]
[:<> ;;:div.field {:class field-class}
#_(when label
[:label.label {:for id} label])
......@@ -55,7 +55,7 @@
:value value
:placeholder (or placeholder "")
:size input-size
:disabled disabled
:disabled disabled?
:read-only readonly?
:on-change #(on-change (-> %
.-target
......@@ -72,14 +72,14 @@
(defn input-range
[{:keys [field-class input-class input-size label-icon
placeholder value on-change label
disabled tooltip autocomplete icons expanded?
disabled? tooltip autocomplete icons expanded?
min max]}]
(let [id (gensym "input-range")]
(reagent/create-class
{:reagent-render
(fn [{:keys [field-class input-class input-size label-icon
placeholder value on-change label
disabled tooltip autocomplete
disabled? tooltip autocomplete
min max]}]
[field {:addons? true}
[control {:icons icons
......@@ -99,7 +99,7 @@
:min min
:max max
:placeholder (or placeholder "")
:disabled disabled
:disabled disabled?
:on-change #(on-change
(-> % .-target .-value js/parseInt))
:id (str id "number")}]]
......
......@@ -34,7 +34,7 @@
(.removeEventListener js/window "scroll" close-fn)))
:reagent-render
(fn [{:keys [value on-change options label multiple icons
expanded? choose-option-label]}]
expanded? choose-option-label disabled?]}]
[:div.dropdown {:id (str id)
:class (str (when @active?
" is-active"))
......@@ -50,7 +50,8 @@
:style (when expanded?
{:width "100%"})}
[:button.button
{:style (when expanded?
{:disabled disabled?
:style (when expanded?
{:width "100%"
:justify-content :left})
:on-click #(swap! active? not)}
......@@ -78,12 +79,12 @@
)})))
(defn native-select [params]
(fn [{:keys [value on-change options label disabled multiple
(fn [{:keys [value on-change options label disabled? multiple
choose-option-label icons expanded?] :as params}]
(reagent/with-let [id (gensym "select")]
[:select
{:id id
:disabled disabled
:disabled disabled?
:multiple multiple
:value (if multiple
(or value [])
......@@ -125,7 +126,7 @@
(reagent/create-class
{:display-name "input-select-component"
:reagent-render
(fn [{:keys [value on-change options label disabled multiple
(fn [{:keys [value on-change options label disabled? multiple
choose-option-label icons expanded? node-type] :as params}]
[:<>
[control {:icons icons
......@@ -153,12 +154,13 @@
:reagent-render
(fn [{:keys [cursor options label multiple
choose-option-label on-change
expanded? node-type]}]
expanded? node-type disabled?]}]
[select
{:value @cursor
:options options
:label label
:multiple multiple
:disabled? disabled?
:expanded? expanded?
:node-type node-type
:choose-option-label choose-option-label
......
......@@ -166,7 +166,7 @@
0 "Missing"
1 (:sign (find-in-vec-by-id assocs (:assoc-id step)))
[ui/select
{:disabled step-result
{:disabled? step-result
:label ""
:value (:assoc-id step)
:options (map (fn [assoc] {:key (:id assoc) :title (:sign assoc)}) assocs)
......@@ -174,7 +174,7 @@
[:td
[ui/select
{:node-type :dropdown
:disabled step-result
:disabled? step-result
:label ""
:value (:assignment-id step)
:options (map (fn [assignment]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment