@qynpm/ui 1.0.28 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -8
- package/dist/index.cjs +9 -4
- package/dist/index.mjs +90 -62
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-aside/index.cjs +1 -0
- package/dist/qy-aside/index.mjs +7 -0
- package/dist/qy-cascader/index.cjs +1 -1
- package/dist/qy-cascader/index.mjs +1 -1
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +1 -1
- package/dist/qy-checkbox-group/index.cjs +1 -1
- package/dist/qy-checkbox-group/index.mjs +1 -1
- package/dist/qy-col/index.cjs +1 -0
- package/dist/qy-col/index.mjs +7 -0
- package/dist/qy-collapse/index.cjs +1 -1
- package/dist/qy-collapse/index.mjs +1 -1
- package/dist/qy-container/index.cjs +1 -0
- package/dist/qy-container/index.mjs +7 -0
- package/dist/qy-date-picker/index.cjs +1 -1
- package/dist/qy-date-picker/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-drawer/index.cjs +1 -0
- package/dist/qy-drawer/index.mjs +5 -0
- package/dist/qy-file-picker/index.cjs +1 -1
- package/dist/qy-file-picker/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -2
- package/dist/qy-fullscreen/index.cjs +1 -0
- package/dist/qy-fullscreen/index.mjs +7 -0
- package/dist/qy-icon/index.cjs +1 -0
- package/dist/qy-icon/index.mjs +11 -0
- package/dist/qy-icon-picker/index.cjs +5 -0
- package/dist/qy-icon-picker/index.mjs +11 -0
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input/index.cjs +1 -1
- package/dist/qy-input/index.mjs +4 -5
- package/dist/qy-input-number/index.cjs +2 -2
- package/dist/qy-input-number/index.mjs +2 -2
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
- package/dist/qy-link/index.cjs +1 -1
- package/dist/qy-link/index.mjs +1 -1
- package/dist/qy-loading/index.cjs +1 -0
- package/dist/qy-loading/index.mjs +9 -0
- package/dist/qy-main/index.cjs +1 -0
- package/dist/qy-main/index.mjs +7 -0
- package/dist/qy-menu-actions/index.cjs +1 -1
- package/dist/qy-menu-actions/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +1 -1
- package/dist/qy-popover/index.cjs +1 -1
- package/dist/qy-popover/index.mjs +1 -1
- package/dist/qy-radio/index.cjs +1 -1
- package/dist/qy-radio/index.mjs +1 -1
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +1 -1
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-result/index.cjs +1 -0
- package/dist/qy-result/index.mjs +7 -0
- package/dist/qy-row/index.cjs +1 -0
- package/dist/qy-row/index.mjs +7 -0
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-statistic/index.cjs +1 -0
- package/dist/qy-statistic/index.mjs +7 -0
- package/dist/qy-switch/index.cjs +1 -1
- package/dist/qy-switch/index.mjs +1 -1
- package/dist/qy-table-column-settings/index.cjs +1 -1
- package/dist/qy-table-column-settings/index.mjs +1 -1
- package/dist/qy-tabs/index.cjs +1 -1
- package/dist/qy-tabs/index.mjs +1 -1
- package/dist/qy-tag/index.cjs +1 -1
- package/dist/qy-tag/index.mjs +1 -1
- package/dist/qy-tooltip/index.cjs +1 -1
- package/dist/qy-tooltip/index.mjs +1 -1
- package/dist/qy-tree-select/index.cjs +1 -1
- package/dist/qy-tree-select/index.mjs +1 -1
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/{index-C7V-LeFg.mjs → index-1LT6Q6XJ.mjs} +1 -1
- package/dist/shared/{index-DleLvEzf.mjs → index-4wZQbpy3.mjs} +1039 -1002
- package/dist/shared/index-AirHUQwm.cjs +1 -0
- package/dist/shared/index-B1zDCCqy.mjs +78 -0
- package/dist/shared/index-B6xIO6kg.cjs +1 -0
- package/dist/shared/{index-B9RYNZUh.cjs → index-BWDaV6FO.cjs} +1 -1
- package/dist/shared/index-BmJPEXUM.mjs +222 -0
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs → index-Bs2OQHXk.mjs} +33 -31
- package/dist/shared/index-BvKFjDgX.cjs +1 -0
- package/dist/shared/index-CaNxcPSD.mjs +254 -0
- package/dist/shared/{index-DEkng5wh.cjs → index-CwzztWPU.cjs} +1 -1
- package/dist/shared/index-D-YyFaZ6.cjs +1 -0
- package/dist/shared/{index-BTL45WYB.cjs → index-DLLDXfic.cjs} +1 -1
- package/dist/shared/{index-CVoiIRas.mjs → index-D_rRdrge.mjs} +1 -1
- package/dist/shared/{index-CYn7TvRx.mjs → index-DfR8Z9MN.mjs} +1 -1
- package/dist/shared/index-Dvf1zJ7h.cjs +1 -0
- package/dist/shared/index-rcu9CzSn.cjs +1 -0
- package/dist/shared/index-xuTVtF4x.mjs +6 -0
- package/dist/shared/index.vue_vue_type_script_lang-8AT3-xU-.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-BaIOvoQn.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_lang-BgapsQjI.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-Bk0kLg5l.mjs +34 -0
- package/dist/shared/index.vue_vue_type_script_lang-BnmY1ndj.mjs +77 -0
- package/dist/shared/index.vue_vue_type_script_lang-By3jd4gw.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CCL57H5c.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CKZUcaZ5.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CWnNQBPN.mjs +31 -0
- package/dist/shared/index.vue_vue_type_script_lang-CfjfZCT3.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-ChS-3_vl.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_lang-DRvk4-_O.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BLF3RNlY.mjs +331 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BXnZt9UT.mjs +63 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXtovY1E.mjs → index.vue_vue_type_script_setup_true_lang-C91DUwOD.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-DXGjuA2f.cjs → index.vue_vue_type_script_setup_true_lang-CuXBYNXZ.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-D7BlbHN5.cjs +1 -0
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CUox3Lm-.mjs → index.vue_vue_type_script_setup_true_lang-DP-jqqo2.mjs} +1 -1
- package/dist/shared/{index.vue_vue_type_script_setup_true_lang-kje3Rtlw.cjs → index.vue_vue_type_script_setup_true_lang-DkDEcB4G.cjs} +1 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-S6QPMZay.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BJXS2dVf.mjs +126 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CL_IFx-Z.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CUqnwExG.mjs +80 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DXQ9l1XF.mjs +286 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-M0qKRXd2.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-lmRmXLwB.cjs +1 -0
- package/index.d.ts +156 -23
- package/package.json +74 -1
- package/qy-aside/index.d.ts +47 -0
- package/qy-col/index.d.ts +65 -0
- package/qy-container/index.d.ts +49 -0
- package/qy-drawer/index.d.ts +55 -0
- package/qy-fullscreen/index.d.ts +72 -0
- package/qy-icon/index.d.ts +105 -0
- package/qy-icon-picker/index.d.ts +56 -0
- package/qy-loading/index.d.ts +25 -0
- package/qy-main/index.d.ts +45 -0
- package/qy-result/index.d.ts +64 -0
- package/qy-row/index.d.ts +59 -0
- package/qy-statistic/index.d.ts +61 -0
- package/dist/shared/index-B8phg478.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CmQLfhRo.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DobP199g.mjs +0 -63
- package/dist/shared/index.vue_vue_type_style_index_0_lang-C6urLjSf.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CVxWn-Vs.mjs +0 -121
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Dm1r1WBK.cjs +0 -1
- /package/dist/shared/{index-PlyLRNmb.cjs → index-Bmw9BNXm.cjs} +0 -0
- /package/dist/shared/{index-UGOgNLvm.cjs → index-BpI0jwYK.cjs} +0 -0
- /package/dist/shared/{index-DA3GVIZY.cjs → index-BxvS3vlc.cjs} +0 -0
- /package/dist/shared/{index-DMiZy6gD.cjs → index-Bxz4crCd.cjs} +0 -0
- /package/dist/shared/{index-YsBzyp9n.mjs → index-C-ZAw_DP.mjs} +0 -0
- /package/dist/shared/{index-CUITnlPr.mjs → index-C31wpivi.mjs} +0 -0
- /package/dist/shared/{index-BqV6vW9P.cjs → index-CCZttbsg.cjs} +0 -0
- /package/dist/shared/{index-DjyaOKUS.cjs → index-CltDZpF9.cjs} +0 -0
- /package/dist/shared/{index-mTWXYnLm.mjs → index-CmRclPWX.mjs} +0 -0
- /package/dist/shared/{index-DvA3Wy_F.mjs → index-Co0_4YEV.mjs} +0 -0
- /package/dist/shared/{index-WP9Dbscv.mjs → index-D6ybNdgn.mjs} +0 -0
- /package/dist/shared/{index-DHJf8Zto.mjs → index-kiAR2M_e.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CWz689KH.cjs → index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DVqGYfD9.mjs → index.vue_vue_type_style_index_0_lang-B0CXLnL1.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DIMCVnQm.mjs → index.vue_vue_type_style_index_0_lang-CPxbKjvY.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CJhIFeBC.mjs → index.vue_vue_type_style_index_0_lang-CcVf5MXE.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CnL4aeg1.cjs → index.vue_vue_type_style_index_0_lang-D9DraThL.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Cb4yMk-r.cjs → index.vue_vue_type_style_index_0_lang-DFAaBzkW.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-D1kpIund.mjs → index.vue_vue_type_style_index_0_lang-DSur831A.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-BXTkWo5P.cjs → index.vue_vue_type_style_index_0_lang-DUgOOzEZ.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-C1n-zAZh.mjs → index.vue_vue_type_style_index_0_lang-DWiolYb3.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-BtbAft4t.cjs → index.vue_vue_type_style_index_0_lang-DccRGtZE.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Q2gFF0PP.cjs → index.vue_vue_type_style_index_0_lang-RiwA2WPO.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-dLpQXf6x.mjs → index.vue_vue_type_style_index_0_lang-gs0YJI91.mjs} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as u, useAttrs as m, computed as r, openBlock as p, createBlock as g, unref as h, mergeProps as b, withCtx as i, renderSlot as l } from "vue";
|
|
2
|
+
import { ElLink as v } from "element-plus";
|
|
3
|
+
const j = /* @__PURE__ */ u({
|
|
4
|
+
name: "QyLink",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
type: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
underline: {
|
|
13
|
+
type: [Boolean, String],
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
16
|
+
disabled: Boolean,
|
|
17
|
+
href: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
target: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "_self"
|
|
24
|
+
},
|
|
25
|
+
icon: {
|
|
26
|
+
type: [String, Object, Function],
|
|
27
|
+
default: void 0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
emits: ["click"],
|
|
31
|
+
setup(t, { emit: a }) {
|
|
32
|
+
const n = t, o = a, d = m(), s = r(() => n.underline === !0 ? "hover" : n.underline === !1 ? "never" : n.underline), c = r(
|
|
33
|
+
() => Object.fromEntries(
|
|
34
|
+
Object.entries(d).filter(
|
|
35
|
+
([e]) => e === "class" || e === "style" || e === "id" || e === "role" || e === "title" || e === "rel" || e === "download" || e === "hreflang" || e === "referrerpolicy" || e === "ping" || e === "tabindex" || e.startsWith("data-") || e.startsWith("aria-")
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
function f(e) {
|
|
40
|
+
o("click", e);
|
|
41
|
+
}
|
|
42
|
+
return (e, S) => (p(), g(h(v), b(c.value, {
|
|
43
|
+
type: t.type,
|
|
44
|
+
underline: s.value,
|
|
45
|
+
disabled: t.disabled,
|
|
46
|
+
href: t.href,
|
|
47
|
+
target: t.target,
|
|
48
|
+
icon: t.icon,
|
|
49
|
+
onClick: f
|
|
50
|
+
}), {
|
|
51
|
+
icon: i(() => [
|
|
52
|
+
l(e.$slots, "icon")
|
|
53
|
+
]),
|
|
54
|
+
default: i(() => [
|
|
55
|
+
l(e.$slots, "default")
|
|
56
|
+
]),
|
|
57
|
+
_: 3
|
|
58
|
+
}, 16, ["type", "underline", "disabled", "href", "target", "icon"]));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
j as _
|
|
63
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as p, useAttrs as b, computed as h, openBlock as t, createBlock as s, unref as v, mergeProps as x, withCtx as i, renderSlot as g, createElementBlock as C, Fragment as V, renderList as _, createTextVNode as z, toDisplayString as B } from "vue";
|
|
2
2
|
import { ElCheckboxGroup as $ } from "element-plus";
|
|
3
|
-
import { C as A } from "./index-
|
|
3
|
+
import { C as A } from "./index-D6ybNdgn.mjs";
|
|
4
4
|
const k = /* @__PURE__ */ p({
|
|
5
5
|
name: "QyCheckboxGroup",
|
|
6
6
|
inheritAttrs: !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),m=require("element-plus"),f=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),m=require("element-plus"),f=require("./index-Bmw9BNXm.cjs"),b=e.defineComponent({name:"QyCheckboxGroup",inheritAttrs:!1,__name:"index",props:{modelValue:{default:()=>[]},options:{default:()=>[]},disabled:{type:Boolean,default:!1},min:{},max:{},size:{default:void 0},ariaLabel:{}},emits:["update:modelValue","change"],setup(d,{emit:i}){const l=d,s=i,o=e.useAttrs(),n=e.computed(()=>Object.fromEntries(Object.entries(o).filter(([a])=>a==="class"||a==="style"||a==="role"||a==="title"||a==="id"||a.startsWith("data-")||a.startsWith("aria-"))));function r(a){s("update:modelValue",a.slice())}function u(a){s("change",a.slice())}return(a,p)=>(e.openBlock(),e.createBlock(e.unref(m.ElCheckboxGroup),e.mergeProps(n.value,{"model-value":l.modelValue,disabled:l.disabled,min:l.min,max:l.max,size:l.size,"aria-label":l.ariaLabel,"onUpdate:modelValue":r,onChange:u}),{default:e.withCtx(()=>[a.$slots.default?e.renderSlot(a.$slots,"default",{},void 0,void 0,0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.options,(t,c)=>(e.openBlock(),e.createBlock(f.Checkbox,{key:`${String(t.value)}-${c}`,"model-value":l.modelValue.includes(t.value),value:t.value,disabled:l.disabled||t.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:2},1032,["model-value","value","disabled"]))),128))]),_:3},16,["model-value","disabled","min","max","size","aria-label"]))}});exports._sfc_main=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),c=require("element-plus"),u=t.defineComponent({name:"QyLink",inheritAttrs:!1,__name:"index",props:{type:{type:String,default:void 0},underline:{type:[Boolean,String],default:void 0},disabled:Boolean,href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:[String,Object,Function],default:void 0}},emits:["click"],setup(n,{emit:i}){const r=n,l=i,a=t.useAttrs(),o=t.computed(()=>r.underline===!0?"hover":r.underline===!1?"never":r.underline),s=t.computed(()=>Object.fromEntries(Object.entries(a).filter(([e])=>e==="class"||e==="style"||e==="id"||e==="role"||e==="title"||e==="rel"||e==="download"||e==="hreflang"||e==="referrerpolicy"||e==="ping"||e==="tabindex"||e.startsWith("data-")||e.startsWith("aria-"))));function d(e){l("click",e)}return(e,f)=>(t.openBlock(),t.createBlock(t.unref(c.ElLink),t.mergeProps(s.value,{type:n.type,underline:o.value,disabled:n.disabled,href:n.href,target:n.target,icon:n.icon,onClick:d}),{icon:t.withCtx(()=>[t.renderSlot(e.$slots,"icon")]),default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["type","underline","disabled","href","target","icon"]))}});exports._sfc_main=u;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as C, useAttrs as G, computed as d, ref as S, openBlock as o, createBlock as u, unref as $, mergeProps as i, withCtx as f, renderSlot as m, createElementBlock as E, Fragment as O, renderList as w, resolveDynamicComponent as x, createTextVNode as A, toDisplayString as P } from "vue";
|
|
2
2
|
import { ElRadioButton as j, ElRadioGroup as D } from "element-plus";
|
|
3
|
-
import { R as N } from "./index-
|
|
3
|
+
import { R as N } from "./index-C31wpivi.mjs";
|
|
4
4
|
const I = /* @__PURE__ */ C({
|
|
5
5
|
name: "QyRadioGroup",
|
|
6
6
|
inheritAttrs: !1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("vue"),u=require("element-plus"),R=require("./index-
|
|
1
|
+
"use strict";const a=require("vue"),u=require("element-plus"),R=require("./index-CCZttbsg.cjs"),_=a.defineComponent({name:"QyRadioGroup",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[Boolean,String,Number,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},disabled:{type:Boolean,default:!1},size:{default:void 0},name:{default:void 0},type:{default:"radio"},border:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(s,{expose:i,emit:c}){const l=s,d=c,f=a.useAttrs(),m=a.computed(()=>Object.fromEntries(Object.entries(f).filter(([e])=>e==="class"||e==="style"||e==="role"||e==="title"||e==="id"||e.startsWith("data-")||e.startsWith("aria-")))),n=a.ref(null),b=a.computed(()=>l.type==="button"?u.ElRadioButton:R.Radio),p=a.computed(()=>l.options.map(e=>{const r=e[l.labelKey],t=e[l.valueKey],o=v(t)?t:e.value??e.label??"";return{raw:e,label:String(r??e.label??e.value??""),value:o,disabled:!!e[l.disabledKey]}}));function v(e){return typeof e=="boolean"||typeof e=="string"||typeof e=="number"}function y(e){const r={modelValue:l.modelValue??void 0,value:e.value,label:e.label,disabled:e.disabled,size:l.size,name:l.name};return l.type==="button"?r:{...r,border:l.border}}function g(e,r){return`${String(e.value??e.label)}-${r}`}function h(e){d("update:modelValue",e)}function V(e){d("change",e)}function B(){return n.value}return i({getRadioGroupInstance:B}),(e,r)=>(a.openBlock(),a.createBlock(a.unref(u.ElRadioGroup),a.mergeProps({ref_key:"radioGroupRef",ref:n},m.value,{"model-value":l.modelValue,disabled:l.disabled,size:l.size,name:l.name,"onUpdate:modelValue":h,onChange:V}),{default:a.withCtx(()=>[e.$slots.default?a.renderSlot(e.$slots,"default",{},void 0,void 0,0):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:1},a.renderList(p.value,(t,o)=>(a.openBlock(),a.createBlock(a.resolveDynamicComponent(b.value),a.mergeProps({key:g(t,o)},{ref_for:!0},y(t)),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"option",{option:t.raw,label:t.label,value:t.value,disabled:t.disabled},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:2},1040))),128))]),_:3},16,["model-value","disabled","size","name"]))}});exports._sfc_main=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("vue"),F=require("element-plus"),T={class:"qy-drawer__header"},x={class:"qy-drawer__header-content"},P={class:"qy-drawer__title"},N=o.defineComponent({name:"QyDrawerElementRenderer",inheritAttrs:!1,__name:"ElementDrawerRenderer",props:{id:{},modelValue:{type:Boolean},direction:{},size:{},teleportTo:{},title:{},showHeader:{type:Boolean},showClose:{type:Boolean},showOverlay:{type:Boolean},destroyOnClose:{type:Boolean},bodyPadding:{},overlayVariant:{},close:{type:Function}},emits:["opened","closed"],setup(e,{expose:n}){const t=e,a=o.computed(()=>t.bodyPadding==="none"?"qy-drawer__body--none":"qy-drawer__body--default"),y=o.computed(()=>t.overlayVariant==="transparent"?"qy-drawer__overlay--transparent":"qy-drawer__overlay--default"),d=o.computed(()=>["qy-drawer",`qy-drawer--body-${t.bodyPadding}`,`qy-drawer--overlay-${t.overlayVariant}`]),i=t.close;function m(){return typeof document>"u"?null:document.querySelector(`[data-qy-drawer-id="${t.id}"]`)}function p(){const r=m();return(r==null?void 0:r.closest(".el-overlay"))||null}return n({getPanelElement:m,getOverlayElement:p}),(r,u)=>(o.openBlock(),o.createBlock(o.unref(F.ElDrawer),{"model-value":e.modelValue,direction:e.direction,size:e.size,"append-to":e.teleportTo,title:e.title,"with-header":e.showHeader,"show-close":!1,modal:e.showOverlay,"close-on-click-modal":!1,"close-on-press-escape":!1,"destroy-on-close":e.destroyOnClose,"lock-scroll":!1,"body-class":a.value,"modal-class":y.value,class:o.normalizeClass(d.value),"data-qy-drawer-id":e.id,onOpened:u[1]||(u[1]=v=>r.$emit("opened")),onClosed:u[2]||(u[2]=v=>r.$emit("closed"))},o.createSlots({header:o.withCtx(({titleId:v})=>[o.createElementVNode("div",T,[o.createElementVNode("div",x,[o.renderSlot(r.$slots,"header",{close:o.unref(i),titleId:v},()=>[o.createElementVNode("span",P,o.toDisplayString(e.title),1)])]),e.showClose?(o.openBlock(),o.createElementBlock("button",{key:0,"data-testid":"qy-drawer-close",class:"qy-drawer__close",type:"button","aria-label":"关闭抽屉",onClick:u[0]||(u[0]=(...w)=>o.unref(i)&&o.unref(i)(...w))},[...u[3]||(u[3]=[o.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):o.createCommentVNode("",!0)])]),default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{close:o.unref(i)})]),_:2},[r.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(r.$slots,"footer",{close:o.unref(i)})]),key:"0"}:void 0]),1032,["model-value","direction","size","append-to","title","with-header","modal","destroy-on-close","body-class","modal-class","class","data-qy-drawer-id"]))}}),S=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","object","embed",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function I(){if(typeof document>"u")return null;const e=document.activeElement;return e instanceof HTMLElement?e:null}function A(e){var t,a;if(!e)return;(a=(t=e.querySelector(S)||e).focus)==null||a.call(t)}function M(e){return!!(e!=null&&e.querySelector(S))}function _(e){!e||!e.isConnected||e.focus()}const f=[],h=new Set;let C=null;function V(){return[...f].reverse().find(e=>e.isOpen())}function g(e){if(!e.isConnected)return!1;const n=window.getComputedStyle(e);return n.display!=="none"&&n.visibility!=="hidden"}function R(e){const{panel:n,overlay:t}=e.getLayerElements();return t&&g(t)?t:n&&g(n)?n:null}function B(e){const n=Number.parseInt(window.getComputedStyle(e).zIndex,10);return Number.isFinite(n)?n:0}function H(e,n){const t=B(e),a=B(n);return t!==a?t>a:!!(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING)}function G(e){return Array.from(document.querySelectorAll(".el-overlay, .el-drawer, .el-dialog")).filter(g).some(t=>t===e||!t.matches(".el-overlay")&&t.closest(".el-overlay")?!1:H(t,e))}function U(e){const n=R(e);return!!(n&&!G(n))}function Z(e){return f.some(n=>n.id!==e&&n.isOpen())}function j(e){return[...f].reverse().filter(n=>n.id!==e).map(n=>n.getFocusTarget()).find(n=>n==null?void 0:n.isConnected)||null}function Q(e){return f.push(e),()=>{const n=f.indexOf(e);n>=0&&f.splice(n,1)}}function K(e){const n=f.findIndex(a=>a.id===e);if(n<0)return;const[t]=f.splice(n,1);f.push(t)}function O(e,n){if(!(typeof document>"u"||!document.body)){if(n){if(h.has(e))return;h.size===0&&(C=document.body.style.overflow),h.add(e),document.body.style.overflow="hidden";return}!h.delete(e)||h.size>0||(document.body.style.overflow=C??"",C=null)}}function W(e){if(e.key!=="Escape"&&e.code!=="Escape")return;const n=V();!n||!U(n)||(e.preventDefault(),e.stopPropagation(),n.requestClose("escape"))}function J(e){const n=V();!n||!n.isMaskTarget(e.target)||(e.preventDefault(),e.stopPropagation(),n.requestClose("mask"))}typeof window<"u"&&(window.addEventListener("keydown",W,!0),document.addEventListener("click",J,!0));const X={class:"qy-drawer__title"},Y=o.defineComponent({name:"QyDrawer",inheritAttrs:!1,__name:"index",props:{modelValue:{type:Boolean},placement:{default:"right"},size:{default:"30%"},title:{default:""},showHeader:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeOnMask:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},restoreFocus:{type:Boolean,default:!0},closeDisabled:{type:Boolean,default:!1},teleportTo:{default:"body"},bodyPadding:{default:"default"},overlayVariant:{default:"default"}},emits:["update:modelValue","close","opened","closed"],setup(e,{emit:n}){const t=e,a=n,y=o.ref(null),d=`qy-drawer-${Math.random().toString(36).slice(2,10)}`,i=o.ref(!1),m=o.ref(!1),p=o.ref(null);let r;const u=o.computed(()=>({left:"ltr",right:"rtl",top:"ttb",bottom:"btt"})[t.placement]),v=o.computed(()=>typeof t.size=="number"?`${t.size}px`:t.size),w=()=>E("close-button");function D(){return t.modelValue}function $(l){var b,q;if(!t.showOverlay||!t.closeOnMask)return!1;const s=(b=y.value)==null?void 0:b.getPanelElement(),c=(q=y.value)==null?void 0:q.getOverlayElement();return!s||!c||!(l instanceof Node)?!1:c.contains(l)&&!s.contains(l)}function E(l){!t.modelValue||t.closeDisabled||l==="mask"&&!t.closeOnMask||l==="escape"&&!t.closeOnEscape||i.value||(i.value=!0,a("update:modelValue",!1),a("close",l))}function k(){t.modelValue&&(i.value=!1,m.value=!0,p.value=I(),K(d),O(d,t.lockScroll))}function z(){!t.modelValue||!m.value||(t.autoFocus&&o.nextTick(()=>{var c;const l=((c=y.value)==null?void 0:c.getPanelElement())||null,s=(l==null?void 0:l.querySelector(".el-drawer__body"))||null;A(M(s)?s:l)}),a("opened"))}function L(){var s;if(t.modelValue||!m.value)return;m.value=!1,O(d,!1),a("closed");const l=Z(d);if(t.restoreFocus&&!l){const c=(s=p.value)!=null&&s.isConnected?p.value:j(d);_(c)}l||(p.value=null),i.value=!1}return o.watch(()=>t.modelValue,(l,s)=>{l&&k()}),o.onMounted(()=>{r=Q({id:d,isOpen:D,isMaskTarget:$,requestClose:E,getFocusTarget:()=>p.value,getLayerElements:()=>{var l,s;return{panel:((l=y.value)==null?void 0:l.getPanelElement())||null,overlay:((s=y.value)==null?void 0:s.getOverlayElement())||null}}}),k()}),o.onBeforeUnmount(()=>{r==null||r(),O(d,!1),m.value=!1}),(l,s)=>(o.openBlock(),o.createBlock(N,{ref_key:"rendererRef",ref:y,id:d,"model-value":t.modelValue,direction:u.value,size:v.value,"teleport-to":t.teleportTo,title:t.title,"show-header":t.showHeader,"show-close":t.showClose,"show-overlay":t.showOverlay,"destroy-on-close":t.destroyOnClose,"body-padding":t.bodyPadding,"overlay-variant":t.overlayVariant,close:w,onOpened:z,onClosed:L},o.createSlots({header:o.withCtx(({close:c,titleId:b})=>[o.renderSlot(l.$slots,"header",{close:c,titleId:b},()=>[o.createElementVNode("span",X,o.toDisplayString(t.title),1)])]),default:o.withCtx(()=>[o.renderSlot(l.$slots,"default",{close:w})]),_:2},[l.$slots.footer?{name:"footer",fn:o.withCtx(()=>[o.renderSlot(l.$slots,"footer",{close:w})]),key:"0"}:void 0]),1032,["model-value","direction","size","teleport-to","title","show-header","show-close","show-overlay","destroy-on-close","body-padding","overlay-variant"]))}});exports._sfc_main=Y;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { defineComponent as z, computed as d, ref as v, useSlots as F, watch as m, onBeforeUnmount as M, onMounted as Q, openBlock as g, createBlock as B, unref as R, withCtx as L, renderSlot as j, createElementBlock as G, Fragment as H, renderList as J, resolveDynamicComponent as X } from "vue";
|
|
2
|
+
import { ElPopover as Y } from "element-plus";
|
|
3
|
+
const Z = 1e3, V = /* @__PURE__ */ z({
|
|
4
|
+
name: "QyPopover",
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
trigger: { type: String, default: "click" },
|
|
9
|
+
placement: { type: String, default: "bottom" },
|
|
10
|
+
effect: { type: String, default: "light" },
|
|
11
|
+
width: { type: [Number, String], default: 240 },
|
|
12
|
+
offset: { type: Number, default: 12 },
|
|
13
|
+
showDelay: { type: Number, default: 0 },
|
|
14
|
+
hideDelay: { type: Number, default: 200 },
|
|
15
|
+
showArrow: { type: Boolean, default: !0 },
|
|
16
|
+
disabled: { type: Boolean, default: !1 },
|
|
17
|
+
open: { type: Boolean, default: void 0 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:open", "open-change", "open", "close"],
|
|
20
|
+
setup(r, { expose: N, emit: S }) {
|
|
21
|
+
const t = r, c = S, u = d(() => t.open !== void 0), w = u.value && t.open === !0 && !t.disabled, i = v(w), l = v(w), k = v(w), o = v(null), A = d(() => t.disabled ? !1 : u.value ? t.open === !0 : i.value);
|
|
22
|
+
let n, f = !1, s;
|
|
23
|
+
const C = d(
|
|
24
|
+
() => typeof t.width == "number" ? `${t.width}px` : t.width
|
|
25
|
+
), q = d(() => ({
|
|
26
|
+
"--qy-popover-width": C.value,
|
|
27
|
+
"--qy-popover-mobile-gutter": "24px"
|
|
28
|
+
})), h = F(), W = d(
|
|
29
|
+
() => {
|
|
30
|
+
var e;
|
|
31
|
+
return ((e = h.reference) == null ? void 0 : e.call(h)) ?? [];
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
function y() {
|
|
35
|
+
n && (clearTimeout(n), n = void 0), o.value = null;
|
|
36
|
+
}
|
|
37
|
+
function I(e) {
|
|
38
|
+
n && clearTimeout(n), n = setTimeout(() => {
|
|
39
|
+
n = void 0, o.value === e && (o.value = null);
|
|
40
|
+
}, Z);
|
|
41
|
+
}
|
|
42
|
+
function a() {
|
|
43
|
+
if (f) return;
|
|
44
|
+
const e = A.value;
|
|
45
|
+
l.value !== e && (f = !0, s = e, l.value = e);
|
|
46
|
+
}
|
|
47
|
+
function p(e) {
|
|
48
|
+
if (!(e && t.disabled)) {
|
|
49
|
+
if (!u.value) {
|
|
50
|
+
if (i.value === e) return;
|
|
51
|
+
i.value = e, c("update:open", e), a();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
o.value !== e && (o.value === null && t.open === e || (o.value = e, e ? I(e) : n && (clearTimeout(n), n = void 0), c("update:open", e), a()));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function D(e) {
|
|
58
|
+
e === l.value && (!f || s !== e || (f = !1, s = void 0, e !== k.value && (k.value = e, o.value === e && y(), c("open-change", e), c(e ? "open" : "close"), a())));
|
|
59
|
+
}
|
|
60
|
+
function K(e) {
|
|
61
|
+
p(e), a();
|
|
62
|
+
}
|
|
63
|
+
function O() {
|
|
64
|
+
D(!0);
|
|
65
|
+
}
|
|
66
|
+
function P() {
|
|
67
|
+
D(!1);
|
|
68
|
+
}
|
|
69
|
+
function U() {
|
|
70
|
+
p(!1);
|
|
71
|
+
}
|
|
72
|
+
function E(e) {
|
|
73
|
+
e.key !== "Escape" && e.code !== "Escape" || l.value && (e.preventDefault(), p(!1), a());
|
|
74
|
+
}
|
|
75
|
+
return m(
|
|
76
|
+
A,
|
|
77
|
+
() => a()
|
|
78
|
+
), m(u, (e) => {
|
|
79
|
+
y(), e ? i.value = t.open === !0 : i.value = l.value, a();
|
|
80
|
+
}), m(
|
|
81
|
+
() => t.open,
|
|
82
|
+
(e, b) => {
|
|
83
|
+
!u.value || o.value === null || (e === o.value || e !== b) && y();
|
|
84
|
+
}
|
|
85
|
+
), m(
|
|
86
|
+
() => t.disabled,
|
|
87
|
+
(e) => {
|
|
88
|
+
e ? p(!1) : a();
|
|
89
|
+
}
|
|
90
|
+
), M(() => {
|
|
91
|
+
window.removeEventListener("keydown", E), f = !1, s = void 0, n && clearTimeout(n);
|
|
92
|
+
}), Q(() => {
|
|
93
|
+
window.addEventListener("keydown", E);
|
|
94
|
+
}), N({ close: U }), (e, b) => (g(), B(R(Y), {
|
|
95
|
+
visible: l.value,
|
|
96
|
+
trigger: r.trigger,
|
|
97
|
+
placement: r.placement,
|
|
98
|
+
effect: r.effect,
|
|
99
|
+
width: r.width,
|
|
100
|
+
offset: r.offset,
|
|
101
|
+
"show-after": r.showDelay,
|
|
102
|
+
"hide-after": r.hideDelay,
|
|
103
|
+
"show-arrow": r.showArrow,
|
|
104
|
+
disabled: r.disabled,
|
|
105
|
+
enterable: !0,
|
|
106
|
+
"popper-style": q.value,
|
|
107
|
+
"popper-class": "qy-popover-popper",
|
|
108
|
+
"onUpdate:visible": K,
|
|
109
|
+
onAfterEnter: O,
|
|
110
|
+
onAfterLeave: P
|
|
111
|
+
}, {
|
|
112
|
+
reference: L(() => [
|
|
113
|
+
(g(!0), G(H, null, J(W.value, (T, $) => (g(), B(X(T), {
|
|
114
|
+
key: T.key ?? $
|
|
115
|
+
}))), 128))
|
|
116
|
+
]),
|
|
117
|
+
default: L(() => [
|
|
118
|
+
j(e.$slots, "default")
|
|
119
|
+
]),
|
|
120
|
+
_: 3
|
|
121
|
+
}, 8, ["visible", "trigger", "placement", "effect", "width", "offset", "show-after", "hide-after", "show-arrow", "disabled", "popper-style"]));
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
export {
|
|
125
|
+
V as _
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),E=require("./index-B6xIO6kg.cjs"),K=require("./index-rcu9CzSn.cjs"),j=require("../qy-popover/index.cjs"),L=require("./index-AirHUQwm.cjs");function F(l,p){const f=p==null?"":String(p),n=l&&f?l.resolve(f):void 0;return Object.freeze({value:f,known:!!n,canonicalName:n==null?void 0:n.name,definition:n})}function Y(l,p,f=""){const n=(l==null?void 0:l.list())??[],c=p===void 0?void 0:new Set(p.map(r=>{var s;return(s=l==null?void 0:l.resolve(r))==null?void 0:s.name}).filter(r=>!!r).map(P)),h=String(f).trim().toLocaleLowerCase();return Object.freeze(n.filter(r=>c&&!c.has(P(r.name))?!1:h?[r.name,r.label,...r.keywords??[]].some(s=>typeof s=="string"&&s.toLocaleLowerCase().includes(h)):!0))}function P(l){return L.normalizeQyIconName(l).toLocaleLowerCase()}const W={class:"qy-icon-picker"},G=["onKeydown"],H={class:"qy-icon-picker__preview","aria-hidden":"true"},J={key:1,class:"qy-icon-picker__missing","aria-hidden":"true"},X=["id"],Z={class:"qy-icon-picker__search","data-testid":"qy-icon-picker-search"},ee=["aria-label"],ae=["id","data-qy-icon-option","data-qy-icon-active","aria-selected","tabindex","onClick","onFocus","onKeydown"],ne={class:"qy-icon-picker__option-label"},oe={key:1,class:"qy-icon-picker__empty"};let te=0;const le=e.defineComponent({name:"QyIconPicker",__name:"index",props:{modelValue:{default:""},allowedNames:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:"点击选择图标"},searchPlaceholder:{default:"搜索图标名称、标签或关键词"},emptyText:{default:"暂无匹配图标"},panelWidth:{default:540},open:{type:Boolean,default:void 0},id:{},ariaLabel:{}},emits:["update:modelValue","change","clear","update:open","open-change"],setup(l,{expose:p,emit:f}){const n=l,c=f,h=e.inject(L.QY_ICON_REGISTRY_KEY,null),r=e.ref(""),s=e.ref(!1),i=e.ref(-1),b=e.ref([]),y=e.ref(null),x=e.ref(null),w=e.ref("pointer"),Q=`qy-icon-picker-${++te}`,v=e.computed(()=>F(h,n.modelValue)),d=e.computed(()=>Y(h,n.allowedNames,r.value)),k=e.computed(()=>n.open!==void 0),m=e.computed(()=>k.value?n.open===!0:s.value),R=e.computed(()=>"click"),g=e.computed(()=>`${n.id||Q}-panel`);e.watch(m,(a,o)=>{!a||o||(r.value="",i.value=M(),b.value=[],w.value==="keyboard"&&e.nextTick(()=>{var t,u;return(u=(t=x.value)==null?void 0:t.focus)==null?void 0:u.call(t)}))}),e.watch(d,()=>{if(!d.value.length){i.value=-1;return}i.value>=d.value.length&&(i.value=0),i.value<0&&(i.value=0)});function N(){n.disabled||(w.value="keyboard",I("keyboard"))}function T(a){n.disabled||k.value&&n.open!==!1||(a.stopImmediatePropagation(),I("pointer"))}function z(a){q(a)}function $(a){a===m.value&&(k.value||(s.value=a),c("open-change",a),a||e.nextTick(()=>{var o,t;return(t=(o=y.value)==null?void 0:o.focus)==null?void 0:t.call(o)}))}function q(a){a&&n.disabled||a!==m.value&&(k.value||(s.value=a),c("update:open",a))}function I(a="programmatic"){w.value=a,q(!0)}function B(){q(!1),e.nextTick(()=>{var a,o;return(o=(a=y.value)==null?void 0:a.focus)==null?void 0:o.call(a)})}function V(){n.disabled||(c("update:modelValue",""),c("change",""),c("clear"))}function C(a){n.disabled||(c("update:modelValue",a.name),c("change",a.name),B())}function S(a){if(a.key==="Escape"){a.preventDefault(),B();return}if(!d.value.length||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(a.key))return;a.preventDefault();const o=a.key==="ArrowUp"||a.key==="ArrowLeft"?-1:1,t=d.value.length;i.value=(i.value+o+t)%t,e.nextTick(()=>{var u;return(u=b.value[i.value])==null?void 0:u.focus()})}function M(){const a=v.value.canonicalName;if(!a)return d.value.length?0:-1;const o=d.value.findIndex(({name:t})=>t===a);return o>=0?o:d.value.length?0:-1}function A(a,o){a instanceof HTMLElement&&(b.value[o]=a)}function O(a){return`${g.value}-${encodeURIComponent(a)}`}function D(){var a,o;(o=(a=y.value)==null?void 0:a.focus)==null||o.call(a)}function U(){var a,o;(o=(a=y.value)==null?void 0:a.blur)==null||o.call(a)}return p({focus:D,blur:U,open:I,close:B}),(a,o)=>(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(j.QyPopover),{ref:"popoverRef",class:"qy-icon-picker__popover",open:m.value,trigger:R.value,placement:"bottom-start",width:n.panelWidth,"show-delay":0,"hide-delay":0,disabled:n.disabled||k.value&&n.open===!1,"onUpdate:open":z,onOpenChange:$},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:"qy-icon-picker__trigger","data-testid":"qy-icon-picker-trigger",onClick:T,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[e.createVNode(e.unref(K.QyInput),{ref_key:"triggerRef",ref:y,id:n.id,"model-value":v.value.value,size:n.size,disabled:n.disabled,clearable:n.clearable,readonly:"",placeholder:n.placeholder,"aria-label":n.ariaLabel,"aria-haspopup":"listbox","aria-expanded":m.value?"true":"false","aria-controls":g.value,onClear:V},{prefix:e.withCtx(()=>[e.createElementVNode("span",H,[v.value.definition?(e.openBlock(),e.createBlock(e.unref(E.QyIcon),{key:0,name:v.value.definition.name,size:18},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",J,"?"))])]),suffix:e.withCtx(()=>[n.clearable&&v.value.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"qy-icon-picker__clear","data-testid":"qy-icon-picker-clear","aria-label":"清空图标",onClick:e.withModifiers(V,["stop","prevent"])},[...o[1]||(o[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0)]),_:1},8,["id","model-value","size","disabled","clearable","placeholder","aria-label","aria-expanded","aria-controls"])],40,G)]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:g.value,class:"qy-icon-picker__panel",onKeydown:S},[e.createElementVNode("div",Z,[e.createVNode(e.unref(K.QyInput),{ref_key:"searchRef",ref:x,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=t=>r.value=t),type:"search",clearable:"",placeholder:n.searchPlaceholder,"aria-label":"搜索图标"},null,8,["modelValue","placeholder"])]),d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-icon-picker__grid",role:"listbox","aria-label":n.ariaLabel||"图标列表"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(t,u)=>(e.openBlock(),e.createElementBlock("div",{id:O(t.name),key:t.name,ref_for:!0,ref:_=>A(_,u),class:e.normalizeClass(["qy-icon-picker__option",{"is-active":i.value===u}]),"data-qy-icon-option":t.name,"data-qy-icon-active":i.value===u?"true":void 0,role:"option","aria-selected":v.value.canonicalName===t.name?"true":"false",tabindex:i.value===u?0:-1,onClick:_=>C(t),onFocus:_=>i.value=u,onKeydown:[e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["enter"]),e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["space"])]},[e.createVNode(e.unref(E.QyIcon),{name:t.name,size:18,"aria-hidden":"true"},null,8,["name"]),e.createElementVNode("span",ne,e.toDisplayString(t.label||t.name),1)],42,ae))),128))],8,ee)):(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)])]))],40,X)):e.createCommentVNode("",!0)]),_:3},8,["open","trigger","width","disabled"])]))}});exports._sfc_main=le;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { defineComponent as m, computed as a, h as s } from "vue";
|
|
2
|
+
import { ElResult as o } from "element-plus";
|
|
3
|
+
const u = ["success", "warning", "info", "error"], r = ["401", "403", "404", "500"], g = (t) => t === "class" || t === "style" || t === "id" || t === "role" || t === "title" || t.startsWith("data-") || t.startsWith("aria-"), v = {
|
|
4
|
+
status: {
|
|
5
|
+
type: String,
|
|
6
|
+
default: "info",
|
|
7
|
+
validator: (t) => [...u, ...r].includes(t)
|
|
8
|
+
},
|
|
9
|
+
title: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
},
|
|
17
|
+
image: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
imageAlt: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
}, h = m({
|
|
26
|
+
name: "QyResult",
|
|
27
|
+
inheritAttrs: !1,
|
|
28
|
+
props: v,
|
|
29
|
+
setup(t, { attrs: l, slots: e }) {
|
|
30
|
+
const n = a(
|
|
31
|
+
() => Object.fromEntries(Object.entries(l).filter(([i]) => g(i)))
|
|
32
|
+
), c = a(() => [
|
|
33
|
+
"qy-result",
|
|
34
|
+
`qy-result--${t.status}`,
|
|
35
|
+
n.value.class
|
|
36
|
+
]), d = a(() => [
|
|
37
|
+
"qy-result__renderer",
|
|
38
|
+
`qy-result--${t.status}`
|
|
39
|
+
]), f = () => {
|
|
40
|
+
if (e.visual) return e.visual();
|
|
41
|
+
if (t.image)
|
|
42
|
+
return s("img", {
|
|
43
|
+
class: "qy-result__image",
|
|
44
|
+
src: t.image,
|
|
45
|
+
alt: t.imageAlt
|
|
46
|
+
});
|
|
47
|
+
if (r.includes(t.status))
|
|
48
|
+
return s(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
class: "qy-result__http-visual",
|
|
52
|
+
"aria-hidden": "true"
|
|
53
|
+
},
|
|
54
|
+
t.status
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
return () => {
|
|
58
|
+
const i = {};
|
|
59
|
+
return (e.visual || t.image || r.includes(t.status)) && (i.icon = f), e.title && (i.title = e.title), e.description && (i["sub-title"] = e.description), e.actions && (i.extra = e.actions), s("div", {
|
|
60
|
+
...n.value,
|
|
61
|
+
class: c.value,
|
|
62
|
+
title: t.title
|
|
63
|
+
}, [
|
|
64
|
+
s(
|
|
65
|
+
o,
|
|
66
|
+
{
|
|
67
|
+
class: d.value,
|
|
68
|
+
icon: u.includes(t.status) ? t.status : void 0,
|
|
69
|
+
title: e.title ? "" : t.title,
|
|
70
|
+
subTitle: e.description ? "" : t.description
|
|
71
|
+
},
|
|
72
|
+
i
|
|
73
|
+
)
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
h as _
|
|
80
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as oe, inject as le, ref as m, computed as _, watch as E, nextTick as L, openBlock as d, createElementBlock as f, createVNode as P, unref as q, withCtx as Q, createElementVNode as I, Fragment as te, renderList as re, withKeys as R, withModifiers as C, normalizeClass as ie, toDisplayString as O, renderSlot as ce, createTextVNode as ue, createCommentVNode as U, createBlock as se } from "vue";
|
|
2
|
+
import { Q as D } from "./index-xuTVtF4x.mjs";
|
|
3
|
+
import { Q as j } from "./index-Bs2OQHXk.mjs";
|
|
4
|
+
import { QyPopover as de } from "../qy-popover/index.mjs";
|
|
5
|
+
import { n as pe, Q as fe } from "./index-CaNxcPSD.mjs";
|
|
6
|
+
function ve(l, p) {
|
|
7
|
+
const v = p == null ? "" : String(p), a = l && v ? l.resolve(v) : void 0;
|
|
8
|
+
return Object.freeze({
|
|
9
|
+
value: v,
|
|
10
|
+
known: !!a,
|
|
11
|
+
canonicalName: a == null ? void 0 : a.name,
|
|
12
|
+
definition: a
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function me(l, p, v = "") {
|
|
16
|
+
const a = (l == null ? void 0 : l.list()) ?? [], i = p === void 0 ? void 0 : new Set(
|
|
17
|
+
p.map((t) => {
|
|
18
|
+
var s;
|
|
19
|
+
return (s = l == null ? void 0 : l.resolve(t)) == null ? void 0 : s.name;
|
|
20
|
+
}).filter((t) => !!t).map(F)
|
|
21
|
+
), k = String(v).trim().toLocaleLowerCase();
|
|
22
|
+
return Object.freeze(
|
|
23
|
+
a.filter((t) => i && !i.has(F(t.name)) ? !1 : k ? [
|
|
24
|
+
t.name,
|
|
25
|
+
t.label,
|
|
26
|
+
...t.keywords ?? []
|
|
27
|
+
].some(
|
|
28
|
+
(s) => typeof s == "string" && s.toLocaleLowerCase().includes(k)
|
|
29
|
+
) : !0)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function F(l) {
|
|
33
|
+
return pe(l).toLocaleLowerCase();
|
|
34
|
+
}
|
|
35
|
+
const ye = { class: "qy-icon-picker" }, he = ["onKeydown"], _e = {
|
|
36
|
+
class: "qy-icon-picker__preview",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
}, ke = {
|
|
39
|
+
key: 1,
|
|
40
|
+
class: "qy-icon-picker__missing",
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
}, be = ["id"], ge = {
|
|
43
|
+
class: "qy-icon-picker__search",
|
|
44
|
+
"data-testid": "qy-icon-picker-search"
|
|
45
|
+
}, we = ["aria-label"], qe = ["id", "data-qy-icon-option", "data-qy-icon-active", "aria-selected", "tabindex", "onClick", "onFocus", "onKeydown"], Ie = { class: "qy-icon-picker__option-label" }, Ce = {
|
|
46
|
+
key: 1,
|
|
47
|
+
class: "qy-icon-picker__empty"
|
|
48
|
+
};
|
|
49
|
+
let Le = 0;
|
|
50
|
+
const Ne = /* @__PURE__ */ oe({
|
|
51
|
+
name: "QyIconPicker",
|
|
52
|
+
__name: "index",
|
|
53
|
+
props: {
|
|
54
|
+
modelValue: { default: "" },
|
|
55
|
+
allowedNames: {},
|
|
56
|
+
disabled: { type: Boolean, default: !1 },
|
|
57
|
+
clearable: { type: Boolean, default: !1 },
|
|
58
|
+
size: { default: "default" },
|
|
59
|
+
placeholder: { default: "点击选择图标" },
|
|
60
|
+
searchPlaceholder: { default: "搜索图标名称、标签或关键词" },
|
|
61
|
+
emptyText: { default: "暂无匹配图标" },
|
|
62
|
+
panelWidth: { default: 540 },
|
|
63
|
+
open: { type: Boolean, default: void 0 },
|
|
64
|
+
id: {},
|
|
65
|
+
ariaLabel: {}
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:modelValue", "change", "clear", "update:open", "open-change"],
|
|
68
|
+
setup(l, { expose: p, emit: v }) {
|
|
69
|
+
const a = l, i = v, k = le(fe, null), t = m(""), s = m(!1), r = m(-1), z = m([]), b = m(null), B = m(null), K = m("pointer"), M = `qy-icon-picker-${++Le}`, y = _(
|
|
70
|
+
() => ve(k, a.modelValue)
|
|
71
|
+
), u = _(
|
|
72
|
+
() => me(k, a.allowedNames, t.value)
|
|
73
|
+
), g = _(() => a.open !== void 0), h = _(
|
|
74
|
+
() => g.value ? a.open === !0 : s.value
|
|
75
|
+
), Y = _(() => "click"), N = _(() => `${a.id || M}-panel`);
|
|
76
|
+
E(
|
|
77
|
+
h,
|
|
78
|
+
(e, n) => {
|
|
79
|
+
!e || n || (t.value = "", r.value = X(), z.value = [], K.value === "keyboard" && L(() => {
|
|
80
|
+
var o, c;
|
|
81
|
+
return (c = (o = B.value) == null ? void 0 : o.focus) == null ? void 0 : c.call(o);
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
), E(u, () => {
|
|
85
|
+
if (!u.value.length) {
|
|
86
|
+
r.value = -1;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
r.value >= u.value.length && (r.value = 0), r.value < 0 && (r.value = 0);
|
|
90
|
+
});
|
|
91
|
+
function S() {
|
|
92
|
+
a.disabled || (K.value = "keyboard", V("keyboard"));
|
|
93
|
+
}
|
|
94
|
+
function W(e) {
|
|
95
|
+
a.disabled || g.value && a.open !== !1 || (e.stopImmediatePropagation(), V("pointer"));
|
|
96
|
+
}
|
|
97
|
+
function G(e) {
|
|
98
|
+
x(e);
|
|
99
|
+
}
|
|
100
|
+
function H(e) {
|
|
101
|
+
e === h.value && (g.value || (s.value = e), i("open-change", e), e || L(() => {
|
|
102
|
+
var n, o;
|
|
103
|
+
return (o = (n = b.value) == null ? void 0 : n.focus) == null ? void 0 : o.call(n);
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
function x(e) {
|
|
107
|
+
e && a.disabled || e !== h.value && (g.value || (s.value = e), i("update:open", e));
|
|
108
|
+
}
|
|
109
|
+
function V(e = "programmatic") {
|
|
110
|
+
K.value = e, x(!0);
|
|
111
|
+
}
|
|
112
|
+
function T() {
|
|
113
|
+
x(!1), L(() => {
|
|
114
|
+
var e, n;
|
|
115
|
+
return (n = (e = b.value) == null ? void 0 : e.focus) == null ? void 0 : n.call(e);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function A() {
|
|
119
|
+
a.disabled || (i("update:modelValue", ""), i("change", ""), i("clear"));
|
|
120
|
+
}
|
|
121
|
+
function $(e) {
|
|
122
|
+
a.disabled || (i("update:modelValue", e.name), i("change", e.name), T());
|
|
123
|
+
}
|
|
124
|
+
function J(e) {
|
|
125
|
+
if (e.key === "Escape") {
|
|
126
|
+
e.preventDefault(), T();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (!u.value.length || !["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(e.key)) return;
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
const n = e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1, o = u.value.length;
|
|
132
|
+
r.value = (r.value + n + o) % o, L(() => {
|
|
133
|
+
var c;
|
|
134
|
+
return (c = z.value[r.value]) == null ? void 0 : c.focus();
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function X() {
|
|
138
|
+
const e = y.value.canonicalName;
|
|
139
|
+
if (!e) return u.value.length ? 0 : -1;
|
|
140
|
+
const n = u.value.findIndex(({ name: o }) => o === e);
|
|
141
|
+
return n >= 0 ? n : u.value.length ? 0 : -1;
|
|
142
|
+
}
|
|
143
|
+
function Z(e, n) {
|
|
144
|
+
e instanceof HTMLElement && (z.value[n] = e);
|
|
145
|
+
}
|
|
146
|
+
function ee(e) {
|
|
147
|
+
return `${N.value}-${encodeURIComponent(e)}`;
|
|
148
|
+
}
|
|
149
|
+
function ae() {
|
|
150
|
+
var e, n;
|
|
151
|
+
(n = (e = b.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
152
|
+
}
|
|
153
|
+
function ne() {
|
|
154
|
+
var e, n;
|
|
155
|
+
(n = (e = b.value) == null ? void 0 : e.blur) == null || n.call(e);
|
|
156
|
+
}
|
|
157
|
+
return p({ focus: ae, blur: ne, open: V, close: T }), (e, n) => (d(), f("div", ye, [
|
|
158
|
+
P(q(de), {
|
|
159
|
+
ref: "popoverRef",
|
|
160
|
+
class: "qy-icon-picker__popover",
|
|
161
|
+
open: h.value,
|
|
162
|
+
trigger: Y.value,
|
|
163
|
+
placement: "bottom-start",
|
|
164
|
+
width: a.panelWidth,
|
|
165
|
+
"show-delay": 0,
|
|
166
|
+
"hide-delay": 0,
|
|
167
|
+
disabled: a.disabled || g.value && a.open === !1,
|
|
168
|
+
"onUpdate:open": G,
|
|
169
|
+
onOpenChange: H
|
|
170
|
+
}, {
|
|
171
|
+
reference: Q(() => [
|
|
172
|
+
I("div", {
|
|
173
|
+
class: "qy-icon-picker__trigger",
|
|
174
|
+
"data-testid": "qy-icon-picker-trigger",
|
|
175
|
+
onClick: W,
|
|
176
|
+
onKeydown: [
|
|
177
|
+
R(C(S, ["prevent"]), ["enter"]),
|
|
178
|
+
R(C(S, ["prevent"]), ["space"])
|
|
179
|
+
]
|
|
180
|
+
}, [
|
|
181
|
+
P(q(j), {
|
|
182
|
+
ref_key: "triggerRef",
|
|
183
|
+
ref: b,
|
|
184
|
+
id: a.id,
|
|
185
|
+
"model-value": y.value.value,
|
|
186
|
+
size: a.size,
|
|
187
|
+
disabled: a.disabled,
|
|
188
|
+
clearable: a.clearable,
|
|
189
|
+
readonly: "",
|
|
190
|
+
placeholder: a.placeholder,
|
|
191
|
+
"aria-label": a.ariaLabel,
|
|
192
|
+
"aria-haspopup": "listbox",
|
|
193
|
+
"aria-expanded": h.value ? "true" : "false",
|
|
194
|
+
"aria-controls": N.value,
|
|
195
|
+
onClear: A
|
|
196
|
+
}, {
|
|
197
|
+
prefix: Q(() => [
|
|
198
|
+
I("span", _e, [
|
|
199
|
+
y.value.definition ? (d(), se(q(D), {
|
|
200
|
+
key: 0,
|
|
201
|
+
name: y.value.definition.name,
|
|
202
|
+
size: 18
|
|
203
|
+
}, null, 8, ["name"])) : (d(), f("span", ke, "?"))
|
|
204
|
+
])
|
|
205
|
+
]),
|
|
206
|
+
suffix: Q(() => [
|
|
207
|
+
a.clearable && y.value.value ? (d(), f("button", {
|
|
208
|
+
key: 0,
|
|
209
|
+
type: "button",
|
|
210
|
+
class: "qy-icon-picker__clear",
|
|
211
|
+
"data-testid": "qy-icon-picker-clear",
|
|
212
|
+
"aria-label": "清空图标",
|
|
213
|
+
onClick: C(A, ["stop", "prevent"])
|
|
214
|
+
}, [...n[1] || (n[1] = [
|
|
215
|
+
I("span", { "aria-hidden": "true" }, "×", -1)
|
|
216
|
+
])])) : U("", !0)
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
}, 8, ["id", "model-value", "size", "disabled", "clearable", "placeholder", "aria-label", "aria-expanded", "aria-controls"])
|
|
220
|
+
], 40, he)
|
|
221
|
+
]),
|
|
222
|
+
default: Q(() => [
|
|
223
|
+
h.value ? (d(), f("div", {
|
|
224
|
+
key: 0,
|
|
225
|
+
id: N.value,
|
|
226
|
+
class: "qy-icon-picker__panel",
|
|
227
|
+
onKeydown: J
|
|
228
|
+
}, [
|
|
229
|
+
I("div", ge, [
|
|
230
|
+
P(q(j), {
|
|
231
|
+
ref_key: "searchRef",
|
|
232
|
+
ref: B,
|
|
233
|
+
modelValue: t.value,
|
|
234
|
+
"onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
|
|
235
|
+
type: "search",
|
|
236
|
+
clearable: "",
|
|
237
|
+
placeholder: a.searchPlaceholder,
|
|
238
|
+
"aria-label": "搜索图标"
|
|
239
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
240
|
+
]),
|
|
241
|
+
u.value.length ? (d(), f("div", {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "qy-icon-picker__grid",
|
|
244
|
+
role: "listbox",
|
|
245
|
+
"aria-label": a.ariaLabel || "图标列表"
|
|
246
|
+
}, [
|
|
247
|
+
(d(!0), f(te, null, re(u.value, (o, c) => (d(), f("div", {
|
|
248
|
+
id: ee(o.name),
|
|
249
|
+
key: o.name,
|
|
250
|
+
ref_for: !0,
|
|
251
|
+
ref: (w) => Z(w, c),
|
|
252
|
+
class: ie(["qy-icon-picker__option", { "is-active": r.value === c }]),
|
|
253
|
+
"data-qy-icon-option": o.name,
|
|
254
|
+
"data-qy-icon-active": r.value === c ? "true" : void 0,
|
|
255
|
+
role: "option",
|
|
256
|
+
"aria-selected": y.value.canonicalName === o.name ? "true" : "false",
|
|
257
|
+
tabindex: r.value === c ? 0 : -1,
|
|
258
|
+
onClick: (w) => $(o),
|
|
259
|
+
onFocus: (w) => r.value = c,
|
|
260
|
+
onKeydown: [
|
|
261
|
+
R(C((w) => $(o), ["prevent"]), ["enter"]),
|
|
262
|
+
R(C((w) => $(o), ["prevent"]), ["space"])
|
|
263
|
+
]
|
|
264
|
+
}, [
|
|
265
|
+
P(q(D), {
|
|
266
|
+
name: o.name,
|
|
267
|
+
size: 18,
|
|
268
|
+
"aria-hidden": "true"
|
|
269
|
+
}, null, 8, ["name"]),
|
|
270
|
+
I("span", Ie, O(o.label || o.name), 1)
|
|
271
|
+
], 42, qe))), 128))
|
|
272
|
+
], 8, we)) : (d(), f("div", Ce, [
|
|
273
|
+
ce(e.$slots, "empty", {}, () => [
|
|
274
|
+
ue(O(a.emptyText), 1)
|
|
275
|
+
])
|
|
276
|
+
]))
|
|
277
|
+
], 40, be)) : U("", !0)
|
|
278
|
+
]),
|
|
279
|
+
_: 3
|
|
280
|
+
}, 8, ["open", "trigger", "width", "disabled"])
|
|
281
|
+
]));
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
Ne as _
|
|
286
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),P=require("element-plus"),K=1e3,O=t.defineComponent({name:"QyPopover",inheritAttrs:!1,__name:"index",props:{trigger:{type:String,default:"click"},placement:{type:String,default:"bottom"},effect:{type:String,default:"light"},width:{type:[Number,String],default:240},offset:{type:Number,default:12},showDelay:{type:Number,default:0},hideDelay:{type:Number,default:200},showArrow:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},open:{type:Boolean,default:void 0}},emits:["update:open","open-change","open","close"],setup(r,{expose:B,emit:E}){const n=r,d=E,i=t.computed(()=>n.open!==void 0),v=i.value&&n.open===!0&&!n.disabled,f=t.ref(v),u=t.ref(v),h=t.ref(v),a=t.ref(null),y=t.computed(()=>n.disabled?!1:i.value?n.open===!0:f.value);let o,c=!1,s;const b=t.computed(()=>typeof n.width=="number"?`${n.width}px`:n.width),T=t.computed(()=>({"--qy-popover-width":b.value,"--qy-popover-mobile-gutter":"24px"})),m=t.useSlots(),q=t.computed(()=>{var e;return((e=m.reference)==null?void 0:e.call(m))??[]});function w(){o&&(clearTimeout(o),o=void 0),a.value=null}function C(e){o&&clearTimeout(o),o=setTimeout(()=>{o=void 0,a.value===e&&(a.value=null)},K)}function l(){if(c)return;const e=y.value;u.value!==e&&(c=!0,s=e,u.value=e)}function p(e){if(!(e&&n.disabled)){if(!i.value){if(f.value===e)return;f.value=e,d("update:open",e),l();return}a.value!==e&&(a.value===null&&n.open===e||(a.value=e,e?C(e):o&&(clearTimeout(o),o=void 0),d("update:open",e),l()))}}function g(e){e===u.value&&(!c||s!==e||(c=!1,s=void 0,e!==h.value&&(h.value=e,a.value===e&&w(),d("open-change",e),d(e?"open":"close"),l())))}function L(e){p(e),l()}function N(){g(!0)}function S(){g(!1)}function W(){p(!1)}function k(e){e.key!=="Escape"&&e.code!=="Escape"||u.value&&(e.preventDefault(),p(!1),l())}return t.watch(y,()=>l()),t.watch(i,e=>{w(),e?f.value=n.open===!0:f.value=u.value,l()}),t.watch(()=>n.open,(e,A)=>{!i.value||a.value===null||(e===a.value||e!==A)&&w()}),t.watch(()=>n.disabled,e=>{e?p(!1):l()}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",k),c=!1,s=void 0,o&&clearTimeout(o)}),t.onMounted(()=>{window.addEventListener("keydown",k)}),B({close:W}),(e,A)=>(t.openBlock(),t.createBlock(t.unref(P.ElPopover),{visible:u.value,trigger:r.trigger,placement:r.placement,effect:r.effect,width:r.width,offset:r.offset,"show-after":r.showDelay,"hide-after":r.hideDelay,"show-arrow":r.showArrow,disabled:r.disabled,enterable:!0,"popper-style":T.value,"popper-class":"qy-popover-popper","onUpdate:visible":L,onAfterEnter:N,onAfterLeave:S},{reference:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(q.value,(D,I)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(D),{key:D.key??I}))),128))]),default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},8,["visible","trigger","placement","effect","width","offset","show-after","hide-after","show-arrow","disabled","popper-style"]))}});exports._sfc_main=O;
|