diff --git a/project-cljs.clj b/project-cljs.clj index a53a755..29b346b 100644 --- a/project-cljs.clj +++ b/project-cljs.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-common-cljs "0.3.2-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-common-cljs "0.3.4-SNAPSHOT" :description "Contains predicates and tools for c4k" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" diff --git a/project.clj b/project.clj index 9b35490..5de56ab 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.domaindrivenarchitecture/c4k-common-clj "0.3.2-SNAPSHOT" +(defproject org.domaindrivenarchitecture/c4k-common-clj "0.3.4-SNAPSHOT" :description "Contains predicates and tools for c4k" :url "https://domaindrivenarchitecture.org" :license {:name "Apache License, Version 2.0" diff --git a/src/main/cljs/dda/c4k_common/browser.cljs b/src/main/cljs/dda/c4k_common/browser.cljs index 056b488..53e275b 100644 --- a/src/main/cljs/dda/c4k_common/browser.cljs +++ b/src/main/cljs/dda/c4k_common/browser.cljs @@ -83,41 +83,47 @@ label] {:type :element :attrs {:for id-for :class "form-label"} :tag :label :content [label]}) +(defn generate-br + [] + {:type :element, :attrs nil, :tag :br, :content nil}) + (defn generate-input-field [id label - default-value] + default-value + project-file-path] [(generate-label id label) - {:type :element :attrs {:class "form-control" :type "text" :name id :value default-value} :tag :input :content nil} - (generate-feedback-tag id)]) + {:type :element :attrs {:class "form-control" :type "text" :name id :id id :value default-value :onblur (str project-file-path ".validate_all_BANG_()")} :tag :input :content nil} + (generate-feedback-tag id) + (generate-br)]) (defn generate-text-area [id label default-value - rows] + rows + project-file-path] [(generate-label id label) - {:type :element :attrs {:name id :id id :class "form-control" :rows rows} :tag :textarea :content [default-value]} - (generate-feedback-tag id)]) + {:type :element :attrs {:name id :id id :class "form-control" :rows rows :onblur (str project-file-path ".validate_all_BANG_()")} :tag :textarea :content [default-value]} + (generate-feedback-tag id) + (generate-br)]) (defn generate-button [id label] - {:type :element + [{:type :element :attrs {:type "button", :id id, :class "btn btn-primary"} :tag :button - :content [label]}) - -(defn generate-br - [] - {:type :element, :attrs nil, :tag :br, :content nil}) + :content [label]} + (generate-br)]) (defn generate-output [id label rows] - {:type :element, :attrs {:id id}, :tag :div, :content [{:type :element, :attrs {:for "output", :class "form-label"}, :tag :label, :content [label]} - {:type :element, :attrs {:name "output", :id "output", :class "form-control", :rows rows}, :tag :textarea, :content []}]}) + [{:type :element, :attrs {:id id}, :tag :div, :content [{:type :element, :attrs {:for "output", :class "form-label"}, :tag :label, :content [label]} + {:type :element, :attrs {:name "output", :id "output", :class "form-control", :rows rows}, :tag :textarea, :content []}]} + (generate-br)]) (defn generate-needs-validation []