mirror of
https://github.com/penpot/penpot.git
synced 2025-07-16 19:15:16 +02:00
✨ Fix linter issues.
This commit is contained in:
parent
6c47df20af
commit
f509d9acd0
1 changed files with 10 additions and 10 deletions
|
@ -9,15 +9,14 @@
|
||||||
|
|
||||||
(ns app.main.ui.components.forms
|
(ns app.main.ui.components.forms
|
||||||
(:require
|
(:require
|
||||||
[rumext.alpha :as mf]
|
|
||||||
[cuerdas.core :as str]
|
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.object :as obj]
|
[app.util.dom :as dom]
|
||||||
[app.util.forms :as fm]
|
[app.util.forms :as fm]
|
||||||
[app.util.i18n :as i18n :refer [t tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
["react" :as react]
|
[app.util.object :as obj]
|
||||||
[app.util.dom :as dom]))
|
[cuerdas.core :as str]
|
||||||
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
(def form-ctx (mf/create-context nil))
|
(def form-ctx (mf/create-context nil))
|
||||||
(def use-form fm/use-form)
|
(def use-form fm/use-form)
|
||||||
|
@ -32,6 +31,7 @@
|
||||||
|
|
||||||
type' (mf/use-state input-type)
|
type' (mf/use-state input-type)
|
||||||
focus? (mf/use-state false)
|
focus? (mf/use-state false)
|
||||||
|
|
||||||
is-checkbox? (= @type' "checkbox")
|
is-checkbox? (= @type' "checkbox")
|
||||||
is-radio? (= @type' "radio")
|
is-radio? (= @type' "radio")
|
||||||
is-text? (or (= @type' "password")
|
is-text? (or (= @type' "password")
|
||||||
|
@ -64,8 +64,8 @@
|
||||||
:empty (and is-text? (str/empty? value))
|
:empty (and is-text? (str/empty? value))
|
||||||
:with-icon (not (nil? help-icon'))
|
:with-icon (not (nil? help-icon'))
|
||||||
:custom-input is-text?
|
:custom-input is-text?
|
||||||
:input-radio (= @type' "radio")
|
:input-radio is-radio?
|
||||||
:input-checkbox (= @type' "checkbox")))
|
:input-checkbox is-checkbox?))
|
||||||
|
|
||||||
swap-text-password
|
swap-text-password
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
on-change (fm/on-input-change form input-name trim)
|
on-change (fm/on-input-change form input-name trim)
|
||||||
|
|
||||||
on-blur
|
on-blur
|
||||||
(fn [event]
|
(fn [_]
|
||||||
(reset! focus? false)
|
(reset! focus? false)
|
||||||
(when-not (get-in @form [:touched input-name])
|
(when-not (get-in @form [:touched input-name])
|
||||||
(swap! form assoc-in [:touched input-name] true)))
|
(swap! form assoc-in [:touched input-name] true)))
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
on-change (fm/on-input-change form input-name trim)
|
on-change (fm/on-input-change form input-name trim)
|
||||||
|
|
||||||
on-blur
|
on-blur
|
||||||
(fn [event]
|
(fn [_]
|
||||||
(reset! focus? false)
|
(reset! focus? false)
|
||||||
(when-not (get-in @form [:touched input-name])
|
(when-not (get-in @form [:touched input-name])
|
||||||
(swap! form assoc-in [:touched input-name] true)))
|
(swap! form assoc-in [:touched input-name] true)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue