@qynpm/ui 1.0.23 → 1.0.25
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 +194 -20
- package/dist/index.cjs +16 -6
- package/dist/index.mjs +51 -34
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-button/index.cjs +1 -1
- package/dist/qy-button/index.mjs +1 -1
- package/dist/qy-checkbox/index.cjs +1 -1
- package/dist/qy-checkbox/index.mjs +4 -3
- package/dist/qy-checkbox-group/index.cjs +1 -0
- package/dist/qy-checkbox-group/index.mjs +7 -0
- package/dist/qy-date-picker/index.cjs +1 -1
- package/dist/qy-date-picker/index.mjs +4 -3
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +2 -2
- package/dist/qy-dropdown/index.cjs +1 -1
- package/dist/qy-dropdown/index.mjs +1 -1
- package/dist/qy-file-picker/index.cjs +1 -0
- package/dist/qy-file-picker/index.mjs +7 -0
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +1 -1
- package/dist/qy-image/index.cjs +1 -1
- package/dist/qy-image/index.mjs +1 -1
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input/index.cjs +2 -2
- package/dist/qy-input/index.mjs +6 -3
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/index.mjs +5 -3
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +2 -2
- 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 +2 -2
- package/dist/qy-popover/index.cjs +2 -0
- package/dist/qy-popover/index.mjs +8 -0
- package/dist/qy-radio/index.cjs +1 -0
- package/dist/qy-radio/index.mjs +7 -0
- package/dist/qy-radio-group/index.cjs +1 -1
- package/dist/qy-radio-group/index.mjs +5 -2
- 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 +2 -2
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +2 -2
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +4 -3
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-switch/index.cjs +1 -0
- package/dist/qy-switch/index.mjs +7 -0
- package/dist/qy-table-column-settings/index.cjs +1 -1
- package/dist/qy-table-column-settings/index.mjs +1 -1
- package/dist/qy-tag/index.cjs +1 -0
- package/dist/qy-tag/index.mjs +7 -0
- package/dist/qy-tooltip/index.cjs +2 -0
- package/dist/qy-tooltip/index.mjs +8 -0
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/index-528z_q7d.cjs +1 -0
- package/dist/shared/index-9v7CIwzO.cjs +1 -0
- package/dist/shared/{index-D7lMppIb.mjs → index-B7uyWUhS.mjs} +63 -63
- package/dist/shared/index-BTPk2zzq.cjs +1 -0
- package/dist/shared/index-BcCZMWAj.cjs +1 -0
- package/dist/shared/index-C1YwUATr.cjs +1 -0
- package/dist/shared/index-C6jcSQSF.mjs +129 -0
- package/dist/shared/index-CbCpXtYr.mjs +68 -0
- package/dist/shared/index-Cl5cuyVG.mjs +54 -0
- package/dist/shared/index-CuusBxhR.cjs +1 -0
- package/dist/shared/{index-BXlQSIWX.mjs → index-DZroPZ8B.mjs} +8 -8
- package/dist/shared/{index-DyK6vf5h.cjs → index-DmhpD4Cp.cjs} +1 -1
- package/dist/shared/index-DrJuMzr1.mjs +90 -0
- package/dist/shared/index-Du2IqeCI.mjs +149 -0
- package/dist/shared/{index-ZLoAI88M.mjs → index-DvQdcj7u.mjs} +1327 -1389
- package/dist/shared/index-EGnVOaC9.cjs +1 -0
- package/dist/shared/index-QQkDJv3q.cjs +1 -0
- package/dist/shared/index-R5B1rjXo.mjs +225 -0
- package/dist/shared/index-yf2Ijz_G.mjs +72 -0
- package/dist/shared/index-zJN0M-bx.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C3F8M9sD.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CKZHI_y-.mjs +106 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CsKjCWIN.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-N12Nn2uu.mjs +61 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BtbAft4t.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CJhIFeBC.mjs +166 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DSur831A.mjs +68 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DVqGYfD9.mjs +132 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Dm1r1WBK.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Q2gFF0PP.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs +140 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-ztD-It-2.mjs +121 -0
- package/index.d.ts +145 -7
- package/package.json +43 -1
- package/qy-autocomplete/index.d.ts +5 -5
- package/qy-checkbox/index.d.ts +45 -5
- package/qy-checkbox-group/index.d.ts +48 -0
- package/qy-date-picker/index.d.ts +137 -2
- package/qy-file-picker/index.d.ts +49 -0
- package/qy-image/index.d.ts +28 -28
- package/qy-image-preview/index.d.ts +20 -20
- package/qy-input/index.d.ts +46 -1
- package/qy-input-number/index.d.ts +41 -1
- package/qy-menu-actions/index.d.ts +29 -29
- package/qy-popover/index.d.ts +63 -0
- package/qy-radio/index.d.ts +44 -0
- package/qy-radio-group/index.d.ts +57 -9
- package/qy-select/index.d.ts +64 -2
- package/qy-switch/index.d.ts +46 -0
- package/qy-table-column-settings/index.d.ts +18 -18
- package/qy-tag/index.d.ts +44 -0
- package/qy-tooltip/index.d.ts +54 -0
- package/qy-tree-select/index.d.ts +5 -5
- package/dist/shared/index-B3U7dqMt.cjs +0 -1
- package/dist/shared/index-BbpD7hM0.cjs +0 -1
- package/dist/shared/index-D3l7tLgw.cjs +0 -1
- package/dist/shared/index-NCpeoBUZ.mjs +0 -153
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BJakDlgd.mjs +0 -70
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CelW13DE.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DA1Nh7U1.mjs +0 -130
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DEpXmMj5.mjs +0 -162
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DNEVwqm7.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DfKTEci_.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-gTkP1LWg.mjs +0 -61
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-svvSFv2K.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-B_A4Nq6v.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DKFiK2fQ.mjs +0 -152
- /package/dist/shared/{index-CagHZ25z.mjs → index-BYLXkIxS.mjs} +0 -0
- /package/dist/shared/{index-CRZsiNVW.cjs → index-C1p86ezL.cjs} +0 -0
- /package/dist/shared/{index-BO5aWk3f.cjs → index-ClUqUsAv.cjs} +0 -0
- /package/dist/shared/{index-CSxCewXP.mjs → index-Cy_Glkc-.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),d=require("element-plus"),v=require("@element-plus/icons-vue"),s=require("./utils-D2KAQCCB.cjs"),E=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={class:"qy-image__state qy-image__state--error"},V={class:"qy-image__state qy-image__state--empty"},k=e.defineComponent({name:"QyImage",__name:"index",props:{src:{default:""},width:{},height:{},size:{default:64},fit:{default:"cover"},placeholder:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},compressor:{type:[Boolean,Object],default:!0},preview:{type:Boolean,default:!1},previewList:{default:()=>[]},initialIndex:{default:0}},emits:["load","error","fallback","preview"],setup(n,{emit:h}){const t=n,i=h,l=e.ref(!1),o=e.ref("");let c=0;const u=e.computed(()=>s.normalizeImageSrc(t.src)),m=e.computed(()=>({width:t.width??t.size,height:t.height??t.size})),y=e.computed(()=>({width:f(m.value.width),height:f(m.value.height)})),g=e.computed(()=>t.placeholder||l.value),p=e.computed(()=>t.preview&&!!u.value),w=e.computed(()=>(t.previewList.length?t.previewList:[t.src]).map(a=>s.normalizeImageSrc(a)).filter(Boolean));e.watch(()=>[t.src,t.compressor],_,{immediate:!0,deep:!0});async function _(){const r=++c;if(o.value="",l.value=!1,!!t.src)try{const a=await s.resolveQyImageDisplaySrc(t.src,{compressor:t.compressor});if(r!==c)return;o.value=a.src,a.source==="fallback"&&i("fallback",a.src)}catch{if(r!==c)return;l.value=!1,o.value=u.value}}function z(r){i("load",r)}function I(r){l.value=!0,i("error",r)}function q(){p.value&&(s.openQyImagePreview({urlList:w.value,initialIndex:t.initialIndex}),i("preview",u.value))}function f(r){return typeof r=="number"?`${r}px`:r}return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-image",{"qy-image--previewable":p.value}]),style:e.normalizeStyle(y.value),onClick:q},[o.value&&!l.value?(e.openBlock(),e.createBlock(e.unref(d.ElImage),{key:0,class:"qy-image__inner",src:o.value,fit:n.fit,lazy:n.lazy,onLoad:z,onError:I},{placeholder:e.withCtx(()=>[e.renderSlot(r.$slots,"placeholder",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"qy-image__state"},[e.createElementVNode("span",{class:"qy-image__loading"})],-1))],!0)]),error:e.withCtx(()=>[e.renderSlot(r.$slots,"error",{},()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(d.ElIcon),{size:20},{default:e.withCtx(()=>[e.createVNode(e.unref(v.PictureFilled))]),_:1})])],!0)]),_:3},8,["src","fit","lazy"])):g.value?e.renderSlot(r.$slots,"empty",{},()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(d.ElIcon),{size:20},{default:e.withCtx(()=>[e.createVNode(e.unref(v.PictureFilled))]),_:1})])],!0,1):e.createCommentVNode("",!0)],6))}}),x=E._export_sfc(k,[["__scopeId","data-v-
|
|
1
|
+
"use strict";const e=require("vue"),d=require("element-plus"),v=require("@element-plus/icons-vue"),s=require("./utils-D2KAQCCB.cjs"),E=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={class:"qy-image__state qy-image__state--error"},V={class:"qy-image__state qy-image__state--empty"},k=e.defineComponent({name:"QyImage",__name:"index",props:{src:{default:""},width:{},height:{},size:{default:64},fit:{default:"cover"},placeholder:{type:Boolean,default:!0},lazy:{type:Boolean,default:!0},compressor:{type:[Boolean,Object],default:!0},preview:{type:Boolean,default:!1},previewList:{default:()=>[]},initialIndex:{default:0}},emits:["load","error","fallback","preview"],setup(n,{emit:h}){const t=n,i=h,l=e.ref(!1),o=e.ref("");let c=0;const u=e.computed(()=>s.normalizeImageSrc(t.src)),m=e.computed(()=>({width:t.width??t.size,height:t.height??t.size})),y=e.computed(()=>({width:f(m.value.width),height:f(m.value.height)})),g=e.computed(()=>t.placeholder||l.value),p=e.computed(()=>t.preview&&!!u.value),w=e.computed(()=>(t.previewList.length?t.previewList:[t.src]).map(a=>s.normalizeImageSrc(a)).filter(Boolean));e.watch(()=>[t.src,t.compressor],_,{immediate:!0,deep:!0});async function _(){const r=++c;if(o.value="",l.value=!1,!!t.src)try{const a=await s.resolveQyImageDisplaySrc(t.src,{compressor:t.compressor});if(r!==c)return;o.value=a.src,a.source==="fallback"&&i("fallback",a.src)}catch{if(r!==c)return;l.value=!1,o.value=u.value}}function z(r){i("load",r)}function I(r){l.value=!0,i("error",r)}function q(){p.value&&(s.openQyImagePreview({urlList:w.value,initialIndex:t.initialIndex}),i("preview",u.value))}function f(r){return typeof r=="number"?`${r}px`:r}return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-image",{"qy-image--previewable":p.value}]),style:e.normalizeStyle(y.value),onClick:q},[o.value&&!l.value?(e.openBlock(),e.createBlock(e.unref(d.ElImage),{key:0,class:"qy-image__inner",src:o.value,fit:n.fit,lazy:n.lazy,onLoad:z,onError:I},{placeholder:e.withCtx(()=>[e.renderSlot(r.$slots,"placeholder",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"qy-image__state"},[e.createElementVNode("span",{class:"qy-image__loading"})],-1))],!0)]),error:e.withCtx(()=>[e.renderSlot(r.$slots,"error",{},()=>[e.createElementVNode("div",S,[e.createVNode(e.unref(d.ElIcon),{size:20},{default:e.withCtx(()=>[e.createVNode(e.unref(v.PictureFilled))]),_:1})])],!0)]),_:3},8,["src","fit","lazy"])):g.value?e.renderSlot(r.$slots,"empty",{},()=>[e.createElementVNode("div",V,[e.createVNode(e.unref(d.ElIcon),{size:20},{default:e.withCtx(()=>[e.createVNode(e.unref(v.PictureFilled))]),_:1})])],!0,1):e.createCommentVNode("",!0)],6))}}),x=E._export_sfc(k,[["__scopeId","data-v-c58a417b"]]);exports.Image=x;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { defineComponent as g, useAttrs as y, computed as n, ref as V, onMounted as x, onBeforeUnmount as B, openBlock as C, createBlock as N, unref as S, mergeProps as R, withCtx as w, renderSlot as z, createTextVNode as E, toDisplayString as L } from "vue";
|
|
2
|
+
import { ElRadio as U } from "element-plus";
|
|
3
|
+
import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const q = /* @__PURE__ */ g({
|
|
5
|
+
name: "QyRadio",
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: [Boolean, String, Number] },
|
|
10
|
+
value: { type: [Boolean, String, Number], default: !0 },
|
|
11
|
+
label: {},
|
|
12
|
+
disabled: { type: Boolean, default: !1 },
|
|
13
|
+
size: { default: void 0 },
|
|
14
|
+
name: {},
|
|
15
|
+
border: { type: Boolean, default: !1 },
|
|
16
|
+
id: {},
|
|
17
|
+
tabindex: {},
|
|
18
|
+
ariaLabel: {},
|
|
19
|
+
ariaControls: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
22
|
+
setup(s, { emit: c }) {
|
|
23
|
+
const a = s, o = c, f = y(), m = n(
|
|
24
|
+
() => Object.fromEntries(
|
|
25
|
+
Object.entries(f).filter(
|
|
26
|
+
([e]) => e === "class" || e === "style" || e === "role" || e === "title" || e.startsWith("data-") || e.startsWith("aria-")
|
|
27
|
+
)
|
|
28
|
+
)
|
|
29
|
+
), l = n(() => a.value), i = V(null);
|
|
30
|
+
let t = null;
|
|
31
|
+
const b = n(() => a.modelValue !== void 0 ? a.modelValue : l.value === !0 ? !1 : l.value === !1 ? !0 : typeof l.value == "string" ? `__qy-radio-unselected__${l.value}` : Number.NaN);
|
|
32
|
+
x(() => {
|
|
33
|
+
var e;
|
|
34
|
+
t = ((e = i.value) == null ? void 0 : e.$el.querySelector("input.el-radio__original")) ?? null, t == null || t.addEventListener("keydown", d);
|
|
35
|
+
}), B(() => {
|
|
36
|
+
t == null || t.removeEventListener("keydown", d);
|
|
37
|
+
});
|
|
38
|
+
function u() {
|
|
39
|
+
return !a.disabled && a.modelValue !== l.value;
|
|
40
|
+
}
|
|
41
|
+
function p() {
|
|
42
|
+
u() && o("update:modelValue", l.value);
|
|
43
|
+
}
|
|
44
|
+
function v() {
|
|
45
|
+
u() && o("change", l.value);
|
|
46
|
+
}
|
|
47
|
+
function d(e) {
|
|
48
|
+
if (e.key !== " " && e.code !== "Space") return;
|
|
49
|
+
const r = e.target;
|
|
50
|
+
!r || r.tagName !== "INPUT" || r.type !== "radio" || r.disabled || r.checked || (e.preventDefault(), r.click());
|
|
51
|
+
}
|
|
52
|
+
function _(e) {
|
|
53
|
+
o("focus", e);
|
|
54
|
+
}
|
|
55
|
+
function h(e) {
|
|
56
|
+
o("blur", e);
|
|
57
|
+
}
|
|
58
|
+
return (e, r) => (C(), N(S(U), R({
|
|
59
|
+
ref_key: "radioRef",
|
|
60
|
+
ref: i
|
|
61
|
+
}, m.value, {
|
|
62
|
+
class: "qy-radio",
|
|
63
|
+
"model-value": b.value,
|
|
64
|
+
value: l.value,
|
|
65
|
+
label: a.label,
|
|
66
|
+
disabled: a.disabled,
|
|
67
|
+
size: a.size,
|
|
68
|
+
name: a.name,
|
|
69
|
+
border: a.border,
|
|
70
|
+
id: a.id,
|
|
71
|
+
tabindex: a.tabindex,
|
|
72
|
+
"aria-label": a.ariaLabel,
|
|
73
|
+
"aria-controls": a.ariaControls,
|
|
74
|
+
"onUpdate:modelValue": p,
|
|
75
|
+
onChange: v,
|
|
76
|
+
onFocusCapture: _,
|
|
77
|
+
onBlurCapture: h
|
|
78
|
+
}), {
|
|
79
|
+
default: w(() => [
|
|
80
|
+
z(e.$slots, "default", {}, () => [
|
|
81
|
+
E(L(a.label), 1)
|
|
82
|
+
], !0)
|
|
83
|
+
]),
|
|
84
|
+
_: 3
|
|
85
|
+
}, 16, ["model-value", "value", "label", "disabled", "size", "name", "border", "id", "tabindex", "aria-label", "aria-controls"]));
|
|
86
|
+
}
|
|
87
|
+
}), j = /* @__PURE__ */ k(q, [["__scopeId", "data-v-b75376cc"]]);
|
|
88
|
+
export {
|
|
89
|
+
j as R
|
|
90
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { defineComponent as V, computed as h, ref as w, onBeforeUnmount as I, openBlock as o, createElementBlock as s, normalizeClass as v, createBlock as $, withCtx as T, createElementVNode as l, Fragment as b, renderList as C, normalizeStyle as M, createCommentVNode as m, toDisplayString as y } from "vue";
|
|
2
|
+
import { _ as D } from "./index.vue_vue_type_style_index_0_lang-ztD-It-2.mjs";
|
|
3
|
+
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const N = { class: "qy-menu-actions__panel" }, U = ["disabled", "data-action-key", "onClick"], W = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "qy-menu-actions__loading"
|
|
7
|
+
}, F = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "qy-menu-actions__empty"
|
|
10
|
+
}, H = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "qy-menu-actions__inline"
|
|
13
|
+
}, K = ["disabled", "data-action-key", "onClick"], P = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "qy-menu-actions__loading"
|
|
16
|
+
}, Q = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "qy-menu-actions__empty"
|
|
19
|
+
}, j = /* @__PURE__ */ V({
|
|
20
|
+
name: "QyMenuActions",
|
|
21
|
+
__name: "index",
|
|
22
|
+
props: {
|
|
23
|
+
actions: { default: () => [] },
|
|
24
|
+
row: {},
|
|
25
|
+
rowIndex: {},
|
|
26
|
+
context: {},
|
|
27
|
+
mode: { default: "inline" },
|
|
28
|
+
emptyText: { default: "无数据" },
|
|
29
|
+
popoverWidth: { default: 150 },
|
|
30
|
+
confirmMethod: {}
|
|
31
|
+
},
|
|
32
|
+
emits: ["action", "confirm-required"],
|
|
33
|
+
setup(a, { emit: A }) {
|
|
34
|
+
const r = a, g = A, q = h(() => {
|
|
35
|
+
var t, n;
|
|
36
|
+
return {
|
|
37
|
+
...r.context,
|
|
38
|
+
row: r.row ?? ((t = r.context) == null ? void 0 : t.row),
|
|
39
|
+
rowIndex: r.rowIndex ?? ((n = r.context) == null ? void 0 : n.rowIndex)
|
|
40
|
+
};
|
|
41
|
+
}), p = w(!1), u = w(/* @__PURE__ */ new Set()), z = (t, n) => ({
|
|
42
|
+
...q.value,
|
|
43
|
+
target: n.currentTarget,
|
|
44
|
+
hide: L,
|
|
45
|
+
setLoading: (e) => S(t, e)
|
|
46
|
+
}), f = (t) => typeof t == "function" ? t(q.value) : !!t, c = h(
|
|
47
|
+
() => r.actions.filter((t) => !f(t.hidden))
|
|
48
|
+
), B = h(
|
|
49
|
+
() => c.value.some((t) => i(t))
|
|
50
|
+
), _ = (t) => f(t.disabled) || i(t), i = (t) => u.value.has(t.key) || f(t.loading), k = (t, n) => {
|
|
51
|
+
const e = t.type || n;
|
|
52
|
+
return {
|
|
53
|
+
default: "var(--el-text-color-primary)",
|
|
54
|
+
primary: "var(--el-color-primary)",
|
|
55
|
+
success: "var(--el-color-success)",
|
|
56
|
+
warning: "var(--el-color-warning)",
|
|
57
|
+
danger: "var(--el-color-danger)"
|
|
58
|
+
}[e];
|
|
59
|
+
}, x = async (t, n) => {
|
|
60
|
+
if (n.stopPropagation(), _(t)) return;
|
|
61
|
+
const e = z(t, n);
|
|
62
|
+
if (t.confirm) {
|
|
63
|
+
if (!r.confirmMethod) {
|
|
64
|
+
g("confirm-required", t, e);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!await r.confirmMethod(t, e)) return;
|
|
68
|
+
}
|
|
69
|
+
g("action", t, e);
|
|
70
|
+
};
|
|
71
|
+
function L() {
|
|
72
|
+
p.value = !1;
|
|
73
|
+
}
|
|
74
|
+
function S(t, n) {
|
|
75
|
+
const e = new Set(u.value);
|
|
76
|
+
n ? e.add(t.key) : e.delete(t.key), u.value = e;
|
|
77
|
+
}
|
|
78
|
+
return I(() => {
|
|
79
|
+
u.value = /* @__PURE__ */ new Set();
|
|
80
|
+
}), (t, n) => (o(), s("div", {
|
|
81
|
+
class: v(["qy-menu-actions", `is-${a.mode}`])
|
|
82
|
+
}, [
|
|
83
|
+
a.mode === "popover" ? (o(), $(D, {
|
|
84
|
+
key: 0,
|
|
85
|
+
open: p.value,
|
|
86
|
+
"onUpdate:open": n[0] || (n[0] = (e) => p.value = e),
|
|
87
|
+
trigger: "hover",
|
|
88
|
+
placement: "left",
|
|
89
|
+
width: a.popoverWidth,
|
|
90
|
+
"hide-delay": B.value ? 999999 : 100,
|
|
91
|
+
"show-arrow": !1
|
|
92
|
+
}, {
|
|
93
|
+
reference: T(() => [...n[1] || (n[1] = [
|
|
94
|
+
l("button", {
|
|
95
|
+
class: "qy-menu-actions__trigger",
|
|
96
|
+
type: "button",
|
|
97
|
+
"aria-label": "行操作"
|
|
98
|
+
}, [
|
|
99
|
+
l("svg", {
|
|
100
|
+
class: "qy-menu-actions__trigger-icon",
|
|
101
|
+
viewBox: "0 0 24 24",
|
|
102
|
+
"aria-hidden": "true"
|
|
103
|
+
}, [
|
|
104
|
+
l("path", {
|
|
105
|
+
fill: "currentColor",
|
|
106
|
+
d: "M8 17q.425 0 .713-.288T9 16q0-.425-.288-.712T8 15q-.425 0-.712.288T7 16q0 .425.288.713T8 17m0-4q.425 0 .713-.288T9 12q0-.425-.288-.712T8 11q-.425 0-.712.288T7 12q0 .425.288.713T8 13m0-4q.425 0 .713-.288T9 8q0-.425-.288-.712T8 7q-.425 0-.712.288T7 8q0 .425.288.713T8 9m3 8h6v-2h-6zm0-4h6v-2h-6zm0-4h6V7h-6zM5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-2h14V5H5z"
|
|
107
|
+
})
|
|
108
|
+
])
|
|
109
|
+
], -1)
|
|
110
|
+
])]),
|
|
111
|
+
default: T(() => [
|
|
112
|
+
l("div", N, [
|
|
113
|
+
(o(!0), s(b, null, C(c.value, (e) => (o(), s("button", {
|
|
114
|
+
key: e.key,
|
|
115
|
+
class: v(["qy-menu-actions__item", [`is-${e.type || "default"}`, { "is-loading": i(e) }]]),
|
|
116
|
+
disabled: _(e),
|
|
117
|
+
"data-action-key": e.key,
|
|
118
|
+
style: M({ color: k(e, "default") }),
|
|
119
|
+
type: "button",
|
|
120
|
+
onClick: (d) => x(e, d)
|
|
121
|
+
}, [
|
|
122
|
+
i(e) ? (o(), s("span", W)) : m("", !0),
|
|
123
|
+
l("span", null, y(e.label), 1)
|
|
124
|
+
], 14, U))), 128)),
|
|
125
|
+
c.value.length ? m("", !0) : (o(), s("div", F, y(a.emptyText), 1))
|
|
126
|
+
])
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["open", "width", "hide-delay"])) : (o(), s("div", H, [
|
|
130
|
+
(o(!0), s(b, null, C(c.value, (e) => (o(), s("button", {
|
|
131
|
+
key: e.key,
|
|
132
|
+
class: v(["qy-menu-actions__item", [`is-${e.type || "primary"}`, { "is-loading": i(e) }]]),
|
|
133
|
+
disabled: _(e),
|
|
134
|
+
"data-action-key": e.key,
|
|
135
|
+
style: M({ color: k(e, "primary") }),
|
|
136
|
+
type: "button",
|
|
137
|
+
onClick: (d) => x(e, d)
|
|
138
|
+
}, [
|
|
139
|
+
i(e) ? (o(), s("span", P)) : m("", !0),
|
|
140
|
+
l("span", null, y(e.label), 1)
|
|
141
|
+
], 14, K))), 128)),
|
|
142
|
+
c.value.length ? m("", !0) : (o(), s("span", Q, y(a.emptyText), 1))
|
|
143
|
+
]))
|
|
144
|
+
], 2));
|
|
145
|
+
}
|
|
146
|
+
}), R = /* @__PURE__ */ E(j, [["__scopeId", "data-v-44454ac9"]]);
|
|
147
|
+
export {
|
|
148
|
+
R as M
|
|
149
|
+
};
|