Browse Source

enhance(ux): months/years navigation for shui datepicker

charlie 1 year ago
parent
commit
c5010b6679
2 changed files with 7 additions and 7 deletions
  1. 3 3
      resources/css/shui.css
  2. 4 4
      src/main/frontend/components/property/value.cljs

+ 3 - 3
resources/css/shui.css

@@ -371,14 +371,14 @@ div[data-radix-popper-content-wrapper] {
     }
 
     .months-years-nav {
-      @apply flex items-center relative left-2 opacity-80;
+      @apply flex items-center relative left-1 opacity-80;
 
       select {
-        @apply px-2 py-0 border-none;
+        @apply px-2 py-0 border-none bg-transparent;
       }
 
       input {
-        @apply border-none ml-0.5;
+        @apply border-none ml-0.5 bg-transparent;
       }
     }
   }

+ 4 - 4
src/main/frontend/components/property/value.cljs

@@ -155,10 +155,10 @@
   [:div.months-years-nav
    (if (= name "years")
      [:label [:input.py-0.px-1.w-auto
-              {:type "number" :default-value value :on-change onChange :min 1 :max 9999}]]
+              {:type "number" :value value :on-change onChange :min 1 :max 9999}]]
 
      ;; months
-     [:select children])])
+     [:select {:on-change onChange :value value} children])])
 
 (rum/defcs calendar-inner <
   (rum/local (str "calendar-inner-" (js/Date.now)) ::identity)
@@ -201,8 +201,8 @@
         {:mode "single"
          :initial-focus true
          :caption-layout "dropdown-buttons"
-         :fromYear 2019
-         :toYear 2024
+         :fromYear 1899
+         :toYear 2099
          :components (cond-> {:Dropdown #(DateNavSelect (bean/bean %))}
                        del-btn? (assoc :Head #(DelDateButton on-delete)))
          :selected initial-day