fix(icons): render FA glyphs in the SPA picker grid and harden item clicks
The server catalog ships bare glyph names, but the SPA grid preview composed "fas home" instead of "fas fa-home" — every FA icon rendered blank (the old curated lists carried the fa- prefix, so the regression appeared with the catalog switch). Item clicks move from per-element @click to a delegated panel handler reading data-icon (immunity to DOM-replacing extensions/userscripts, matching the PHP picker's pattern), and selecting now closes the popover so the choice is visible in the field immediately.
This commit is contained in:
1 parent
27d8a9ea71
commit
39bafb65c4
12 files changed
+33
-20
No files matched your search
@@ -0,0 +1 @@
|
||||
import{d as E}from"./vendor-draggable.BooRVfGb.js";import{a as D}from"./shared-api.DnsQ5cxS.js";import{P as pe}from"./PageHeader.CtT29f8Y.js";import{I as j,F as L}from"./FaIconPicker.C_p6xA0k.js";import{_ as _e}from"./index.js";import{u as ce,a as be,B as m,b as z}from"./vendor-naive.CKYCZmXD.js";import{o as me,X as y,a4 as o,a3 as s,r as C,a1 as _,e as W,W as i,N as p,f as u,Y as n,Z as w,a2 as c,a5 as v,F as $,R as ye,c as ve}from"./vendor-vue.BxZIRU0_.js";import"./FaIcon.NZ6TDkNu.js";import"./vendor-misc.bELTaXdf.js";const ge={class:"aksrt-page-container content-page"},ke={class:"aksrt-card-header-row"},we={class:"aksrt-card-header-row__left"},he={class:"aksrt-card-header-row__title"},xe={class:"section-desc section-desc--tight"},Te={class:"tabbar-sort__item"},Ue={class:"tabbar-sort__main"},Ce={class:"tabbar-sort__icon"},$e={class:"tabbar-sort__meta"},Ie={class:"tabbar-sort__title-row"},ze={class:"tabbar-sort__desc"},Fe={class:"tabbar-sort__actions"},Ve={class:"aksrt-form-actions"},Ae={class:"icon-preview-row"},De={key:1,class:"muted-text"},Se={key:5,class:"add-items-editor"},Ne={class:"add-items-editor__head"},Pe={class:"add-items-editor__presets"},Be={key:0,class:"add-items-editor__list"},Oe={class:"add-items-editor__row"},Me={key:1,class:"muted-text"},qe={class:"aksrt-modal-footer"},Ee={__name:"FooterTabbarSettings",setup(je){const b=ce(),G=be(),F=C(!0),I=C(!1),x=C(!1),h=C(-1),V=C([]),d=W({enabled:!0,scroll_hide:!1,scroll_down_hide:!0,footer_tabbar_single:"default",items:[]}),a=W({id:"",type:"link",icon:"",text:"",link:"",badge:"",badge_mode:"static",category_id:null,search_default_type:"post",new_window:!1,add_items:[],enabled:!0,sort_order:0,ontop:!1}),H=[{label:"首页",value:"home"},{label:"分类页",value:"category"},{label:"链接",value:"link"},{label:"中央发布按钮",value:"add"},{label:"用户中心",value:"user"},{label:"登录/我的",value:"auth"},{label:"搜索",value:"search"},{label:"消息中心",value:"msg"},{label:"开通会员",value:"pay_vip"}],R={home:"首页",category:"分类页",link:"链接",add:"中央发布按钮",user:"用户中心",auth:"登录/我的",search:"搜索",msg:"消息中心",pay_vip:"开通会员"},S={home:{icon:"fa fas fa-home",text:"首页"},category:{icon:"fa fas fa-th-large",text:"分类"},link:{icon:"fa fas fa-link",text:"链接"},add:{icon:"fa fas fa-plus",text:"发布"},user:{icon:"fa fas fa-user",text:"用户中心"},auth:{icon:"fa fas fa-user",text:"我的"},search:{icon:"fa fas fa-search",text:"搜索"},msg:{icon:"fa fas fa-bell",text:"消息"},pay_vip:{icon:"fa fas fa-gem",text:"会员"}},X=ve(()=>d.items.filter(t=>t.enabled));function Y(t){var e;if(t.type==="home")return t.ontop?"首页按钮,滚动后切换返回顶部":"首页按钮";if(t.type==="category"){if(t.category_id){const r=V.value.find(f=>f.value===t.category_id);return r?`跳转到分类: ${r.label}`:`跳转到分类 ID ${t.category_id}`}return"跳转到分类聚合页"}return t.type==="add"?(e=t.add_items)!=null&&e.length?`展开 ${t.add_items.length} 个发布入口`:"点击后打开默认发布入口":t.type==="search"?`打开顶部搜索面板,默认搜索${t.search_default_type==="category"?"分类":t.search_default_type==="tag"?"标签":"文章"}`:t.type==="user"?"自动跳转到用户中心或登录页":t.type==="auth"?"登录用户显示我的,游客显示登录":t.type==="msg"?"跳转到消息中心页面":t.type==="pay_vip"?t.link||"跳转到会员开通页":t.link||"自定义链接按钮"}const Z=[{label:"写文章",icon:"fa fas fa-pen",url:"/submit"},{label:"投稿页",icon:"fa fas fa-file-alt",url:"/submit"},{label:"发布资源",icon:"fa fas fa-cloud-upload-alt",url:"/resource-new"},{label:"创作中心",icon:"fa fas fa-paint-brush",url:"/creator"}];function J(t){a.add_items.some(e=>e.url===t.url)||a.add_items.push({id:`add_${Date.now()}_${a.add_items.length}`,label:t.label,icon:t.icon,url:t.url})}function K(){a.add_items.push({id:`add_${Date.now()}_${a.add_items.length}`,label:"",icon:"fa fas fa-pen",url:""})}function Q(t){a.add_items.splice(t,1)}function N(){d.items=d.items.map((t,e)=>({...t,sort_order:e}))}function ee(t,e=!1){const r=S[t]||S.link;(e||!a.icon)&&(a.icon=r.icon),(e||!a.text)&&(a.text=r.text),["link","msg","pay_vip"].includes(t)||(a.link=""),t!=="category"&&(a.category_id=null),t!=="search"&&(a.search_default_type="post"),t!=="add"&&(a.add_items=[]),t!=="home"&&(a.ontop=!1)}function ae(t){ee(t,!1)}function te(){if(d.items.length>=5){b.warning("底部Tab最多只能配置 5 个按钮");return}Object.assign(a,{id:`tab_${Date.now()}`,type:"link",icon:"fa fas fa-link",text:"链接",link:"",badge:"",badge_mode:"static",category_id:null,search_default_type:"post",new_window:!1,add_items:[],enabled:!0,sort_order:d.items.length,ontop:!1}),h.value=-1,x.value=!0}function le(t){const e=d.items[t];Object.assign(a,{id:e.id,type:e.type||"link",icon:e.icon||"",text:e.text||"",link:e.link||"",badge:e.badge||"",badge_mode:e.badge_mode||"static",category_id:e.cateLine truncated
|
||||
Reference in new issue
Block a user