浏览代码

enhance(ui): polish ui details for the property rows

charlie 1 年之前
父节点
当前提交
b898a39ff2
共有 3 个文件被更改,包括 20 次插入8 次删除
  1. 10 0
      resources/css/shui.css
  2. 2 1
      src/main/frontend/components/plugins.cljs
  3. 8 7
      src/main/frontend/components/property/value.cljs

+ 10 - 0
resources/css/shui.css

@@ -223,6 +223,16 @@ html[data-theme=dark] {
   }
 }
 
+.ui__dialog-content {
+  &[side=start] {
+    @apply translate-y-0 top-[56px];
+  }
+
+  &[side=end] {
+
+  }
+}
+
 .ui__button-shortcut-key {
   @apply text-xs font-normal h-5 w-5 flex items-center justify-center rounded bg-gray-06-alpha;
 

+ 2 - 1
src/main/frontend/components/plugins.cljs

@@ -1403,7 +1403,8 @@
   []
   (shui/dialog-open!
     (plugins-page)
-    {:label "plugins-dashboard"}))
+    {:label :plugins-dashboard
+     :side :start}))
 
 (defn open-waiting-updates-modal!
   []

+ 8 - 7
src/main/frontend/components/property/value.cljs

@@ -72,7 +72,7 @@
     (route-handler/redirect-to-page! (date/js-date->journal-title value))))
 
 (rum/defc date-picker
-  [value {:keys [on-change editing?]}]
+  [value {:keys [on-change editing? multiple-values?]}]
   (let [;; FIXME: Remove ignore when editing bug is fixed
         #_:clj-kondo/ignore
         [open? set-open!] (rum/use-state editing?)
@@ -92,6 +92,11 @@
         initial-month (when value'
                         (js/Date. (.getYear value') (.getMonth value')))]
     [:div.flex.flex-row.gap-1.items-center
+     (when page
+       (when-let [page-cp (state/get-component :block/page-cp)]
+         (page-cp {:disable-preview? true
+                   :hide-close-button? true} page)))
+
      (let [content-fn
            (fn [{:keys [id]}]
              (let [select-handler!
@@ -118,6 +123,7 @@
                                     (when (= "Enter" (.-key e))
                                       (select-handler! d)))
                  :on-select select-handler!})))]
+
        (shui/button
         {:class "jtrigger !p-1"
          :variant :text
@@ -129,12 +135,7 @@
                          (util/stop e)
                          (shui/popup-show! (.-target e) content-fn
                                            {:align "start" :auto-focus? true}))))}
-        (ui/icon "calendar" {:size 16})))
-
-     (when page
-       (when-let [page-cp (state/get-component :block/page-cp)]
-         (page-cp {:disable-preview? true
-                   :hide-close-button? true} page)))]))
+        (ui/icon (if multiple-values? "calendar-plus" "calendar") {:size 16})))]))
 
 
 (rum/defc property-value-date-picker