fixed warnings.
This commit is contained in:
@@ -5,20 +5,21 @@
|
||||
[cljs-time.core :as t]
|
||||
[cljs-time.format :as format]
|
||||
[cljs.tools.reader.edn :as edn]
|
||||
[clojure.spec.alpha :as s]
|
||||
[clojure.string :as str]
|
||||
[goog.crypt.base64 :as base64]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-transition-group :as react-transition-group]
|
||||
#_{:clj-kondo/ignore [:unused-namespace]}
|
||||
[reagent.core :as reagent]
|
||||
[reagent.core :as r]
|
||||
[react :as react]
|
||||
[auto-ap.entities.shared :as shared])
|
||||
[reagent.core :as r])
|
||||
(:import
|
||||
(goog.i18n NumberFormat)
|
||||
(goog.i18n.NumberFormat Format)))
|
||||
|
||||
|
||||
(def date-regex #"[2]{1}[0-9]{3}-[0-9]{1,2}-[0-9]{1,2}")
|
||||
(def money-regex #"\-?[0-9]+(\.[0-9]{2})?$")
|
||||
|
||||
(def nff
|
||||
(NumberFormat. Format/CURRENCY))
|
||||
|
||||
@@ -98,32 +99,24 @@
|
||||
(when d
|
||||
(format/unparse format d))))
|
||||
|
||||
(defn date-time->str [d]
|
||||
(when d
|
||||
(format/unparse pretty-long d)))
|
||||
|
||||
(defn str->date [d f]
|
||||
(when d
|
||||
(format/parse f d)))
|
||||
|
||||
(defn with-keys [children]
|
||||
(map-indexed (fn [i c] ^{:key i} c) children))
|
||||
|
||||
|
||||
(def css-transition-group
|
||||
(reagent/adapt-react-class react-transition-group/CSSTransition))
|
||||
(r/adapt-react-class react-transition-group/CSSTransition))
|
||||
|
||||
(def transition
|
||||
(reagent/adapt-react-class react-transition-group/Transition))
|
||||
(r/adapt-react-class react-transition-group/Transition))
|
||||
|
||||
(def transition-group
|
||||
(reagent/adapt-react-class react-transition-group/TransitionGroup))
|
||||
(r/adapt-react-class react-transition-group/TransitionGroup))
|
||||
|
||||
(def switch-transition
|
||||
(reagent/adapt-react-class react-transition-group/SwitchTransition))
|
||||
(r/adapt-react-class react-transition-group/SwitchTransition))
|
||||
|
||||
(defn appearing [{:keys [visible? enter-class exit-class timeout]}]
|
||||
(let [final-state (reagent/atom visible?)]
|
||||
(let [final-state (r/atom visible?)]
|
||||
(fn [{:keys [visible?]} & children]
|
||||
[css-transition-group {:in visible? :class-names {:exit exit-class :enter enter-class} :timeout timeout :onEnter (fn [] (reset! final-state true )) :onExited (fn [] (reset! final-state false))}
|
||||
(if (or @final-state visible?)
|
||||
@@ -210,7 +203,7 @@
|
||||
;; if it's a perfect match, change it on the spot
|
||||
;; especially important for calendar clicking, don't
|
||||
;; want to wait for blur
|
||||
(when (or (re-matches shared/date-regex (.. e -target -value))
|
||||
(when (or (re-matches date-regex (.. e -target -value))
|
||||
(nil? (.. e -target -value)))
|
||||
(swap-external-value (some-> (.. e -target -value) coerce-date))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user