diff --git a/src/re_com/validate.cljs b/src/re_com/validate.cljs index 0f91d968..56457b94 100644 --- a/src/re_com/validate.cljs +++ b/src/re_com/validate.cljs @@ -177,73 +177,100 @@ ;; Custom :validate-fn functions ;; ---------------------------------------------------------------------------- -;; Reference: http://facebook.github.io/react/docs/tags-and-attributes.html#html-attributes -;; http://facebook.github.io/react/docs/events.html#supported-events (https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events for more) - (def html-attrs #{; ----- HTML attributes (:class and :style commented out as they are not valid in re-com) - :accept :accept-charset :access-key :action :allow-full-screen :allow-transparency :alt :async :auto-complete :auto-focus :auto-play - :cell-padding :cell-spacing :char-set :checked #_:class :class-name :cols :col-span :content :content-editable :context-menu :controls - :coords :cross-origin :data :date-time :defer :dir :disabled :download :draggable :enc-type :form :form-action :form-enc-type :form-method - :form-no-validate :form-target :frame-border :height :hidden :href :href-lang :html-for :http-equiv :icon :id :label :lang :list :loop :manifest - :margin-height :margin-width :max :max-length :media :media-group :method :min :multiple :muted :name :no-validate :open :pattern :placeholder - :poster :preload :radio-group :read-only :rel :required :role :rows :row-span :sandbox :scope :scrolling :seamless :selected :shape :size :sizes - :span :spell-check :src :src-doc :src-set :start :step #_:style :tab-index :target :title :type :use-map :value :width :wmode + ; ----- Reference: https://facebook.github.io/react/docs/dom-elements.html#all-supported-html-attributes + :accept :accept-charset :access-key :action :allow-full-screen :allow-transparency :alt :async :auto-complete :auto-focus :auto-play :capture + :cell-padding :cell-spacing :challenge :char-set :checked :cite #_:class :class-name :cols :col-span :content :content-editable :context-menu :controls + :coords :cross-origin :data :date-time :default :defer :dir :disabled :download :draggable :enc-type :form :form-action :form-enc-type :form-method + :form-no-validate :form-target :frame-border :headers :height :hidden :high :href :href-lang :html-for :http-equiv :icon :id :input-mode :integrity + :is :key-params :key-type :kind :label :lang :list :loop :low :manifest + :margin-height :margin-width :max :max-length :media :media-group :method :min :min-length :multiple :muted :name :no-validate :nonce :open :optimum :pattern :placeholder + :poster :preload :profile :radio-group :read-only :rel :required :reversed :role :rows :row-span :sandbox :scope :scoped :scrolling :seamless :selected :shape :size :sizes + :span :spell-check :src :src-doc :src-lang :src-set :start :step #_:style :summary :tab-index :target :title :type :use-map :value :width :wmode :wrap ; ----- SVG attributes - :cx :cy :d :dx :dy :fill :fill-opacity :font-family :font-size :fx :fy :gradient-transform :gradient-units :marker-end :marker-mid :marker-start - :offset :opacity :pattern-content-units :pattern-units :points :preserve-aspect-ratio :r :rx :ry :spread-method :stop-color :stop-opacity :stroke - :stroke-dasharray :stroke-linecap :stroke-opacity :stroke-width :text-anchor :transform :version :view-box :x :x1 :x2 :y :y1 :y2 + ; ----- Reference: https://facebook.github.io/react/docs/dom-elements.html#all-supported-svg-attributes + :accentheight :accumulate :additive :alignment-baseline :allow-reorder :alphabetic :amplitude :arabic-form :ascent :attribute-name :attribute-type + :auto-reverse :azimuth :base-frequency :base-profile :baseline-shift :bbox :begin :bias :by :calc-mode :cap-height :clip :clip-path :clip-path-units + :clip-rule :color-interpolation :color-interpolation-filters :color-profile :color-rendering :content-script-type :content-style-type :cursor :cx :cy :d + :decelerate :descent :diffuse-constant :direction :display :divisor :dominant-baseline :dur :dx :dy :edge-mode :elevation :enable-background :end :exponent + :external-resources-required :fill :fill-opacity :fill-rule :filter :filter-res :filter-units :flood-color :flood-opacity :focusable :font-family :font-size + :font-size-adjust :font-stretch :font-style :font-variant :font-weight :format :from :fx :fy :g1 :g2 :glyph-name :glyph-orientation-horizontal :glyph-orientation-vertical + :glyph-ref :gradient-transform :gradient-units :hanging :horiz-adv-x :horiz-origin-x :ideographic :image-rendering :in :in2 :intercept :k :k1 :k2 :k3 :k4 + :kernel-matrix :kernel-unit-length :kerning :key-points :key-splines :key-times :length-adjust :letter-spacing :lighting-color :limiting-cone-angle :local + :marker-end :marker-height :marker-mid :marker-start :marker-units :marker-width :mask :mask-content-units :mask-units :mathematical :mode :num-octaves + :offset :opacity :operator :order :orient :orientation :origin :overflow :overline-position :overline-thickness :paint-order :panose1 :path-length + :pattern-content-units :pattern-transform :pattern-units :pointer-events :points :points-at-x :points-at-y :points-at-z :preserve-alpha :preserve-aspect-ratio + :primitive-units :r :radius :ref-x :ref-y :rendering-intent :repeat-count :repeat-dur :required-extensions :required-features :restart :result :rotate :rx :ry + :scale :seed :shape-rendering :slope :spacing :specular-constant :specular-exponent :speed :spread-method :start-offset :std-deviation :stemh :stemv :stitch-tiles + :stop-color :stop-opacity :strikethrough-position :strikethrough-thickness :string :stroke :stroke-dasharray :stroke-dashoffset :stroke-linecap :stroke-linejoin + :stroke-miterlimit :stroke-opacity :stroke-width :surface-scale :system-language :table-values :target-x :target-y :text-anchor :text-decoration :text-length + :text-rendering :to :transform :u1 :u2 :underline-position :underline-thickness :unicode :unicode-bidi :unicode-range :units-per-em :v-alphabetic :v-hanging + :v-ideographic :v-mathematical :values :vector-effect :version :vert-adv-y :vert-origin-x :vert-origin-y :view-box :view-target :visibility :widths :word-spacing + :writing-mode :x :x1 :x2 :x-channel-selector :x-height :xlink-actuate :xlink-arcrole :xlink-href :xlink-role :xlink-show :xlink-title :xlink-type :xml-base + :xml-lang :xml-space :y :y1 :y2 :y-channel-selector :z :zoom-and-pan ; ----- Event attributes - :on-blur :on-change :on-click :on-copy :on-cut :on-double-click :on-drag :on-drag-end :on-drag-enter :on-drag-exit :on-drag-leave - :on-drag-over :on-drag-start :on-drop :on-focus :on-input :on-key-down :on-key-press :on-key-up :on-mouse-down :on-mouse-enter - :on-mouse-leave :on-mouse-move :on-mouse-out :on-mouse-over :on-mouse-up :on-paste :on-scroll :on-submit :on-touch-cancel - :on-touch-end :on-touch-move :on-touch-start :on-wheel - :on-blur-capture :on-change-capture :on-click-capture :on-copy-capture :on-cut-capture :on-double-click-capture :on-drag-capture - :on-drag-end-capture :on-drag-enter-capture :on-drag-exit-capture :on-drag-leave-capture :on-drag-over-capture :on-drag-start-capture - :on-drop-capture :on-focus-capture :on-input-capture :on-key-down-capture :on-key-press-capture :on-key-up-capture :on-mouse-down-capture - :on-mouse-enter-capture :on-mouse-leave-capture :on-mouse-move-capture :on-mouse-out-capture :on-mouse-over-capture :on-mouse-up-capture - :on-paste-capture :on-scroll-capture :on-submit-capture :on-touch-cancel-capture :on-touch-end-capture :on-touch-move-capture - :on-touch-start-capture :on-wheel-capture}) - -;; Reference: http://facebook.github.io/react/docs/tags-and-attributes.html#supported-attributes - + ; ----- Reference: https://facebook.github.io/react/docs/events.html#supported-events + :on-copy :on-cut :on-paste :on-composition-end :on-composition-start :on-composition-update :on-key-down + :on-key-press :on-key-up :on-focus :on-blur :on-change :on-input :on-submit :on-click + :on-context-menu :on-double-click :on-drag :on-drag-end :on-drag-enter :on-drag-exit :on-drag-leave + :on-drag-over :on-drag-start :on-drop :on-mouse-down :on-mouse-enter :on-mouse-leave :on-mouse-move + :on-mouse-out :on-mouse-over :on-mouse-up :on-select :on-touch-cancel :on-touch-end :on-touch-move + :on-touch-start :on-scroll :on-wheel :on-abort :on-can-play :on-can-play-through :on-duration-change + :on-emptied :on-encrypted :on-ended :on-error :on-loaded-data :on-loaded-metadata :on-load-start + :on-pause :on-play :on-playing :on-progress :on-rate-change :on-seeked :on-seeking :on-stalled + :on-suspend :on-time-update :on-volume-change :on-waiting :on-load #_:on-error :on-animation-start + :on-animation-end :on-animation-iteration :on-transition-end + ; ----- '--capture' versions of the above events + :on-copy-capture :on-cut-capture :on-paste-capture :on-composition-end-capture :on-composition-start-capture :on-composition-update-capture :on-key-down-capture + :on-key-press-capture :on-key-up-capture :on-focus-capture :on-blur-capture :on-change-capture :on-input-capture :on-submit-capture :on-click-capture + :on-context-menu-capture :on-double-click-capture :on-drag-capture :on-drag-end-capture :on-drag-enter-capture :on-drag-exit-capture :on-drag-leave-capture + :on-drag-over-capture :on-drag-start-capture :on-drop-capture :on-mouse-down-capture :on-mouse-enter-capture :on-mouse-leave-capture :on-mouse-move-capture + :on-mouse-out-capture :on-mouse-over-capture :on-mouse-up-capture :on-select-capture :on-touch-cancel-capture :on-touch-end-capture :on-touch-move-capture + :on-touch-start-capture :on-scroll-capture :on-wheel-capture :on-abort-capture :on-can-play-capture :on-can-play-through-capture :on-duration-change-capture + :on-emptied-capture :on-encrypted-capture :on-ended-capture :on-error-capture :on-loaded-data-capture :on-loaded-metadata-capture :on-load-start-capture + :on-pause-capture :on-play-capture :on-playing-capture :on-progress-capture :on-rate-change-capture :on-seeked-capture :on-seeking-capture :on-stalled-capture + :on-suspend-capture :on-time-update-capture :on-volume-change-capture :on-waiting-capture :on-load-capture #_:on-error-capture :on-animation-start-capture + :on-animation-end-capture :on-animation-iteration-capture :on-transition-end-capture}) + +; ----- Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/data-* +; ----- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA (def extension-attrs #{:data :aria}) -;; Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference - (def css-styles #{; ----- Standard CSS styles + ; ----- Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference :align-content :align-items :align-self :all :animation :animation-delay :animation-direction :animation-duration :animation-fill-mode :animation-iteration-count :animation-name :animation-play-state :animation-timing-function :backface-visibility :background :background-attachment :background-blend-mode :background-clip :background-color :background-image :background-origin :background-position - :background-repeat :background-size :block-size :border :border-block-end :border-block-end-color :border-block-end-style - :border-block-end-width :border-block-start :border-block-start-color :border-block-start-style :border-block-start-width :border-bottom - :border-bottom-color :border-bottom-left-radius :border-bottom-right-radius :border-bottom-style :border-bottom-width :border-collapse - :border-color :border-image :border-image-outset :border-image-repeat :border-image-slice :border-image-source :border-image-width - :border-inline-end :border-inline-end-color :border-inline-end-style :border-inline-end-width :border-inline-start :border-inline-start-color - :border-inline-start-style :border-inline-start-width :border-left :border-left-color :border-left-style :border-left-width :border-radius - :border-right :border-right-color :border-right-style :border-right-width :border-spacing :border-style :border-top :border-top-color - :border-top-left-radius :border-top-right-radius :border-top-style :border-top-width :border-width :bottom :box-decoration-break :box-shadow - :box-sizing :break-after :break-before :break-inside :caption-side :ch :clear :clip :clip-path :cm :color :column-count :column-fill - :column-gap :column-rule :column-rule-color :column-rule-style :column-rule-width :columns :column-span :column-width :content - :counter-increment :counter-reset :cursor :deg :direction :display :dpcm :dpi :dppx :em :empty-cells :ex :filter :flex :flex-basis - :flex-direction :flex-flow :flex-grow :flex-shrink :flex-wrap :float :font :font-family :font-feature-settings :font-kerning - :font-language-override :font-size :font-size-adjust :font-stretch :font-style :font-synthesis :font-variant :font-variant-alternates - :font-variant-caps :font-variant-east-asian :font-variant-ligatures :font-variant-numeric :font-variant-position :font-weight :grad :grid - :grid-area :grid-auto-columns :grid-auto-flow :grid-auto-position :grid-auto-rows :grid-column :grid-column-end :grid-column-start :grid-row - :grid-row-end :grid-row-start :grid-template :grid-template-areas :grid-template-columns :grid-template-rows :height :hyphens :hz - :image-orientation :image-rendering :image-resolution :ime-mode :in :inherit :initial :inline-size :isolation :justify-content :khz :left - :letter-spacing :line-break :line-height :list-style :list-style-image :list-style-position :list-style-type :margin :margin-block-end - :margin-block-start :margin-bottom :margin-inline-end :margin-inline-start :margin-left :margin-right :margin-top :marks :mask :mask-type - :max-block-size :max-height :max-inline-size :max-width :min-block-size :min-height :min-inline-size :min-width :mix-blend-mode :mm :ms - :object-fit :object-position :offset-block-end :offset-block-start :offset-inline-end :offset-inline-start :opacity :order :orphans :outline - :outline-color :outline-offset :outline-style :outline-width :overflow :overflow-wrap :overflow-x :overflow-y :padding :padding-block-end - :padding-block-start :padding-bottom :padding-inline-end :padding-inline-start :padding-left :padding-right :padding-top :page-break-after - :page-break-before :page-break-inside :pc :perspective :perspective-origin :pointer-events :position :pt :px :quotes :rad :rem :resize - :right :ruby-align :ruby-merge :ruby-position :s :scroll-behavior :shape-image-threshold :shape-margin :shape-outside :table-layout :tab-size - :text-align :text-align-last :text-combine-upright :text-decoration :text-decoration-color :text-decoration-line :text-decoration-style - :text-indent :text-orientation :text-overflow :text-rendering :text-shadow :text-transform :text-underline-position :top :touch-action - :transform :transform-origin :transform-style :transition :transition-delay :transition-duration :transition-property - :transition-timing-function :turn :unicode-bidi :unicode-range :unset :vertical-align :vh :visibility :vmax :vmin :vw :white-space :widows - :width :will-change :word-break :word-spacing :word-wrap :writing-mode :z-index + :background-repeat :background-size :block-size :border :border-block-end :border-block-end-color :border-block-end-style :border-block-end-width + :border-block-start :border-block-start-color :border-block-start-style :border-block-start-width :border-bottom :border-bottom-color + :border-bottom-left-radius :border-bottom-right-radius :border-bottom-style :border-bottom-width :border-collapse :border-color :border-image + :border-image-outset :border-image-repeat :border-image-slice :border-image-source :border-image-width :border-inline-end :border-inline-end-color + :border-inline-end-style :border-inline-end-width :border-inline-start :border-inline-start-color :border-inline-start-style :border-inline-start-width + :border-left :border-left-color :border-left-style :border-left-width :border-radius :border-right :border-right-color :border-right-style + :border-right-width :border-spacing :border-style :border-top :border-top-color :border-top-left-radius :border-top-right-radius :border-top-style + :border-top-width :border-width :bottom :box-decoration-break :box-shadow :box-sizing :break-after :break-before :break-inside :caption-side :ch :clear + :clip :clip-path :cm :color :column-count :column-fill :column-gap :column-rule :column-rule-color :column-rule-style :column-rule-width :columns + :column-span :column-width :content :counter-increment :counter-reset :cursor :deg :direction :display :dpcm :dpi :dppx :em :empty-cells :ex :filter + :flex :flex-basis :flex-direction :flex-flow :flex-grow :flex-shrink :flex-wrap :float :font :font-family :font-feature-settings :font-kerning + :font-language-override :font-size :font-size-adjust :font-stretch :font-style :font-synthesis :font-variant :font-variant-alternates :font-variant-caps + :font-variant-east-asian :font-variant-ligatures :font-variant-numeric :font-variant-position :font-weight :fr :grad :grid :grid-area :grid-auto-columns + :grid-auto-flow :grid-auto-position :grid-auto-rows :grid-column :grid-column-end :grid-column-gap :grid-column-start :grid-gap :grid-row :grid-row-end + :grid-row-gap :grid-row-start :grid-template :grid-template-areas :grid-template-columns :grid-template-rows :height :hyphens :hz :image-orientation + :image-rendering :image-resolution :ime-mode :in :inherit :initial :inline-size :isolation :justify-content :khz :left :letter-spacing :line-break + :line-height :list-style :list-style-image :list-style-position :list-style-type :margin :margin-block-end :margin-block-start :margin-bottom + :margin-inline-end :margin-inline-start :margin-left :margin-right :margin-top :marks :mask :mask-clip :mask-composite :mask-image :mask-mode + :mask-origin :mask-position :mask-repeat :mask-size :mask-type :max-block-size :max-height :max-inline-size :max-width :min-block-size :min-height + :min-inline-size :min-width :mix-blend-mode :mm :ms :object-fit :object-position :offset-block-end :offset-block-start :offset-inline-end + :offset-inline-start :opacity :order :orphans :outline :outline-color :outline-offset :outline-style :outline-width :overflow :overflow-wrap + :overflow-x :overflow-y :padding :padding-block-end :padding-block-start :padding-bottom :padding-inline-end :padding-inline-start :padding-left + :padding-right :padding-top :page-break-after :page-break-before :page-break-inside :pc :perspective :perspective-origin :pointer-events :position + :pt :px :quotes :rad :rem :resize :revert :right :ruby-align :ruby-merge :ruby-position :s :scroll-behavior :scroll-snap-coordinate :scroll-snap-destination + :scroll-snap-type :shape-image-threshold :shape-margin :shape-outside :table-layout :tab-size :text-align :text-align-last :text-combine-upright + :text-decoration :text-decoration-color :text-decoration-line :text-decoration-style :text-emphasis :text-emphasis-color :text-emphasis-position + :text-emphasis-style :text-indent :text-orientation :text-overflow :text-rendering :text-shadow :text-transform :text-underline-position :top + :touch-action :transform :transform-box :transform-origin :transform-style :transition :transition-delay :transition-duration :transition-property + :transition-timing-function :turn :unicode-bidi :unicode-range :unset :vertical-align :vh :visibility :vmax :vmin :vw :white-space :widows :width + :will-change :word-break :word-spacing :word-wrap :writing-mode :z-index ; ----- Browser specific styles :-webkit-user-select :-moz-user-select :-ms-user-select :user-select :-webkit-flex-flow :-webkit-flex-direction :-webkit-flex-wrap :-webkit-justify-content :-webkit-align-items :-webkit-align-content