Created
September 24, 2019 01:16
-
-
Save olivergeorge/1ad6b25f63646644bbbba4ff304f247c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MaskedInput from 'react-text-mask'; | |
window.MaskedInput = MaskedInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns interop.masked-input | |
(:require [reagent.core :as r])) | |
(def masked-input (r/adapt-react-class js/MaskedInput)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"dependencies": { | |
"react-text-mask": "^5.4.3", | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn masked-text-widget | |
[{:keys [mask value placeholder disabled on-change on-blur]}] | |
[masked-input/masked-input | |
{:mask mask | |
:disabled disabled | |
:value value | |
:placeholder placeholder | |
:on-change on-change | |
:on-blur on-blur}]) | |
(def date-mask #js [#"[0-3]" #"\d" "/" #"[0-2]" #"\d" "/" #"\d" #"\d" #"\d" #"\d"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment