@qynpm/ui 1.0.11 → 1.0.12

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.
Files changed (65) hide show
  1. package/README.md +52 -15
  2. package/dist/index.cjs +2 -2
  3. package/dist/index.mjs +2 -2
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +1 -1
  6. package/dist/qy-autocomplete/index.cjs +1 -1
  7. package/dist/qy-autocomplete/index.mjs +1 -1
  8. package/dist/qy-checkbox/index.cjs +1 -1
  9. package/dist/qy-checkbox/index.mjs +1 -1
  10. package/dist/qy-date-picker/index.cjs +1 -1
  11. package/dist/qy-date-picker/index.mjs +1 -1
  12. package/dist/qy-dialog/index.cjs +1 -1
  13. package/dist/qy-dialog/index.mjs +1 -1
  14. package/dist/qy-form-section/index.cjs +1 -1
  15. package/dist/qy-form-section/index.mjs +1 -1
  16. package/dist/qy-image/index.cjs +1 -1
  17. package/dist/qy-image/index.mjs +1 -1
  18. package/dist/qy-image-preview/index.cjs +1 -1
  19. package/dist/qy-image-preview/index.mjs +1 -1
  20. package/dist/qy-image-upload/index.cjs +1 -1
  21. package/dist/qy-image-upload/index.mjs +1 -1
  22. package/dist/qy-input/index.cjs +1 -1
  23. package/dist/qy-input/index.mjs +1 -1
  24. package/dist/qy-input-number/index.cjs +1 -1
  25. package/dist/qy-input-number/index.mjs +1 -1
  26. package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
  27. package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
  28. package/dist/qy-menu-actions/index.cjs +1 -1
  29. package/dist/qy-menu-actions/index.mjs +1 -1
  30. package/dist/qy-money-input/index.cjs +1 -1
  31. package/dist/qy-money-input/index.mjs +1 -1
  32. package/dist/qy-radio-group/index.cjs +1 -1
  33. package/dist/qy-radio-group/index.mjs +1 -1
  34. package/dist/qy-record-quote-search/index.cjs +1 -1
  35. package/dist/qy-record-quote-search/index.mjs +1 -1
  36. package/dist/qy-remark-image/index.cjs +1 -1
  37. package/dist/qy-remark-image/index.mjs +1 -1
  38. package/dist/qy-remote-select/index.cjs +1 -1
  39. package/dist/qy-remote-select/index.mjs +1 -1
  40. package/dist/qy-search-input/index.cjs +1 -1
  41. package/dist/qy-search-input/index.mjs +1 -1
  42. package/dist/qy-select/index.cjs +1 -1
  43. package/dist/qy-select/index.mjs +1 -1
  44. package/dist/qy-selection-dialog/index.cjs +1 -1
  45. package/dist/qy-selection-dialog/index.mjs +1 -1
  46. package/dist/qy-table-column-settings/index.cjs +1 -1
  47. package/dist/qy-table-column-settings/index.mjs +1 -1
  48. package/dist/qy-tree-select/index.cjs +1 -1
  49. package/dist/qy-tree-select/index.mjs +1 -1
  50. package/dist/qy-upload/index.cjs +1 -1
  51. package/dist/qy-upload/index.mjs +1 -1
  52. package/dist/shared/index-B4JNbDHG.mjs +153 -0
  53. package/dist/shared/index-B7ZgDgHR.cjs +1 -0
  54. package/dist/shared/index-BWIOoRpy.mjs +293 -0
  55. package/dist/shared/index-CQPIT5by.cjs +1 -0
  56. package/dist/shared/index-ClPd2qa5.cjs +1 -0
  57. package/dist/shared/{index-DAHl11pF.mjs → index-D9hV_AKF.mjs} +1722 -1693
  58. package/package.json +1 -1
  59. package/qy-menu-actions/index.d.ts +2 -2
  60. package/qy-table-column-settings/index.d.ts +2 -2
  61. package/dist/shared/index-B1BqPX66.cjs +0 -1
  62. package/dist/shared/index-BCxeV3b1.mjs +0 -219
  63. package/dist/shared/index-BZaLAQWR.mjs +0 -106
  64. package/dist/shared/index-Cy8BKei3.cjs +0 -1
  65. package/dist/shared/index-D5Hges_w.cjs +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qynpm/ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "起印公共 UI 组件包。",
5
5
  "author": "qy",
6
6
  "license": "MIT",
@@ -1,4 +1,4 @@
1
- import type { Plugin } from 'vue'
1
+ import type { DefineComponent, Plugin } from 'vue'
2
2
 
3
3
  export type QyMenuActionType =
4
4
  | 'default'
@@ -23,7 +23,7 @@ export interface QyMenuAction<Row = Record<string, unknown>> {
23
23
  meta?: Record<string, unknown>
24
24
  }
25
25
 
26
- declare const QyMenuActions: Plugin
26
+ declare const QyMenuActions: DefineComponent<any, any, any> & Plugin
27
27
 
28
28
  export { QyMenuActions }
29
29
  export default QyMenuActions
@@ -1,4 +1,4 @@
1
- import type { Plugin } from 'vue'
1
+ import type { DefineComponent, Plugin } from 'vue'
2
2
 
3
3
  export type QyColumnFixed = 'left' | 'right' | false
4
4
 
@@ -12,7 +12,7 @@ export interface QyTableColumnSetting {
12
12
  fixed: QyColumnFixed
13
13
  }
14
14
 
15
- declare const QyTableColumnSettings: Plugin
15
+ declare const QyTableColumnSettings: DefineComponent<any, any, any> & Plugin
16
16
 
17
17
  export { QyTableColumnSettings }
18
18
  export default QyTableColumnSettings
@@ -1 +0,0 @@
1
- "use strict";const r=require("element-plus/es"),e=require("vue"),z=require("./install-DNgKRKb2.cjs"),$={class:"qy-table-column-settings"},D={class:"qy-table-column-settings__list"},M=["data-testid","onClick"],U={class:"qy-table-column-settings__name"},F={class:"qy-table-column-settings__fixed-mark"},L={class:"qy-table-column-settings__actions"},K=e.defineComponent({name:"QyTableColumnSettings",__name:"index",props:{modelValue:{type:Boolean},settings:{default:()=>[]},defaultSettings:{default:void 0},title:{default:"列设置"},width:{default:"700px"},showDeleteCache:{type:Boolean,default:!0},unconfigurableTypes:{default:()=>["index","selection","expand","setup"]}},emits:["update:modelValue","confirm","reset","cancel","delete-cache","change"],setup(m,{emit:_}){const u=m,c=_,a=e.ref([]),f=e.ref(""),p=l=>l.map(t=>({...t})),g=()=>{var l;a.value=p(u.settings),f.value=((l=a.value[0])==null?void 0:l.key)||""};e.watch(()=>u.modelValue,l=>{l&&g()},{immediate:!0});const v=()=>{c("change",p(a.value))},h=l=>a.value.find(t=>t.key===l),b=l=>!!(l.type&&u.unconfigurableTypes.includes(l.type)),w=l=>l==="left"?"左":l==="right"?"右":"-",C=(l,t)=>{if(l===t||l<0||l>=a.value.length||t<0||t>=a.value.length)return;const o=[...a.value],[k]=o.splice(l,1);o.splice(t,0,k),a.value=o,f.value=k.key,v()},N=(l,t)=>{const o=h(l);!o||b(o)||(o.visible=t,v())},x=(l,t)=>{const o=h(l);o&&(o.fixed=t,v())},E=(l,t)=>{const o=h(l);o&&(o.width=t,v())},T=()=>{var t,o;const l=(t=u.defaultSettings)!=null&&t.length?u.defaultSettings:u.settings;a.value=p(l),f.value=((o=a.value[0])==null?void 0:o.key)||"",c("reset",p(a.value)),v()},y=()=>{c("cancel"),c("update:modelValue",!1)},B=()=>{c("confirm",p(a.value)),c("update:modelValue",!1)};return(l,t)=>{const o=r.ElInput,k=r.ElCheckbox,V=r.ElOption,S=r.ElSelect,d=r.ElButton,q=r.ElDialog;return e.openBlock(),e.createBlock(q,{"model-value":m.modelValue,title:m.title,width:m.width,"append-to-body":"",onClose:y},{footer:e.withCtx(()=>[e.createVNode(d,{"data-action":"reset",onClick:T},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode(" 恢复默认 ",-1)])]),_:1}),m.showDeleteCache?(e.openBlock(),e.createBlock(d,{key:0,type:"danger",plain:"","data-action":"delete-cache",onClick:t[0]||(t[0]=n=>c("delete-cache"))},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" 删除缓存 ",-1)])]),_:1})):e.createCommentVNode("",!0),e.createVNode(d,{"data-action":"cancel",onClick:y},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode(" 取消 ",-1)])]),_:1}),e.createVNode(d,{type:"primary","data-action":"confirm",onClick:B},{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode(" 确定 ",-1)])]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",$,[e.createElementVNode("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:n.key,class:e.normalizeClass(["qy-table-column-settings__row",{"is-active":n.key===f.value}]),"data-testid":`row-${n.key}`,onClick:s=>f.value=n.key},[e.createElementVNode("div",U,[e.createElementVNode("span",F,e.toDisplayString(w(n.fixed)),1),e.createElementVNode("span",null,e.toDisplayString(n.label||n.prop||n.key),1)]),e.createVNode(o,{"model-value":n.width,size:"small",placeholder:"自动",class:"qy-table-column-settings__width","onUpdate:modelValue":s=>E(n.key,s)},null,8,["model-value","onUpdate:modelValue"]),e.createVNode(k,{"model-value":n.visible,disabled:b(n),onChange:s=>N(n.key,!!s)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 显示 ",-1)])]),_:1},8,["model-value","disabled","onChange"]),e.createVNode(S,{"model-value":n.fixed,size:"small",class:"qy-table-column-settings__fixed",onChange:s=>x(n.key,s)},{default:e.withCtx(()=>[e.createVNode(V,{label:"不固定",value:!1}),e.createVNode(V,{label:"左固定",value:"left"}),e.createVNode(V,{label:"右固定",value:"right"})]),_:1},8,["model-value","onChange"]),e.createElementVNode("div",L,[e.createVNode(d,{text:"",size:"small",disabled:i===0,"data-action":"top",onClick:e.withModifiers(s=>C(i,0),["stop"])},{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode(" 置顶 ",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(d,{text:"",size:"small",disabled:i===0,"data-action":"up",onClick:e.withModifiers(s=>C(i,i-1),["stop"])},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode(" 上移 ",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(d,{text:"",size:"small",disabled:i===a.value.length-1,"data-action":"down",onClick:e.withModifiers(s=>C(i,i+1),["stop"])},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode(" 下移 ",-1)])]),_:1},8,["disabled","onClick"]),e.createVNode(d,{text:"",size:"small",disabled:i===a.value.length-1,"data-action":"bottom",onClick:e.withModifiers(s=>C(i,a.value.length-1),["stop"])},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode(" 置底 ",-1)])]),_:1},8,["disabled","onClick"])])],10,M))),128))])])]),_:1},8,["model-value","title","width"])}}}),O=z._export_sfc(K,[["__scopeId","data-v-cd1604ef"]]);exports.TableColumnSettings=O;
@@ -1,219 +0,0 @@
1
- import { ElDialog as O, ElInput as Q, ElCheckbox as W, ElSelect as j, ElOption as A, ElButton as G } from "element-plus/es";
2
- import { defineComponent as H, ref as q, watch as J, openBlock as g, createBlock as x, withCtx as s, createElementVNode as f, createElementBlock as B, Fragment as P, renderList as R, normalizeClass as X, toDisplayString as E, createVNode as o, createTextVNode as u, withModifiers as C, createCommentVNode as Y } from "vue";
3
- import { _ as Z } from "./install-DMq9RQ-h.mjs";
4
- const I = { class: "qy-table-column-settings" }, ee = { class: "qy-table-column-settings__list" }, te = ["data-testid", "onClick"], le = { class: "qy-table-column-settings__name" }, ae = { class: "qy-table-column-settings__fixed-mark" }, ne = { class: "qy-table-column-settings__actions" }, oe = /* @__PURE__ */ H({
5
- name: "QyTableColumnSettings",
6
- __name: "index",
7
- props: {
8
- modelValue: { type: Boolean },
9
- settings: { default: () => [] },
10
- defaultSettings: { default: void 0 },
11
- title: { default: "列设置" },
12
- width: { default: "700px" },
13
- showDeleteCache: { type: Boolean, default: !0 },
14
- unconfigurableTypes: { default: () => ["index", "selection", "expand", "setup"] }
15
- },
16
- emits: ["update:modelValue", "confirm", "reset", "cancel", "delete-cache", "change"],
17
- setup(p, { emit: z }) {
18
- const m = p, r = z, a = q([]), v = q(""), _ = (t) => t.map((e) => ({ ...e })), $ = () => {
19
- var t;
20
- a.value = _(m.settings), v.value = ((t = a.value[0]) == null ? void 0 : t.key) || "";
21
- };
22
- J(
23
- () => m.modelValue,
24
- (t) => {
25
- t && $();
26
- },
27
- {
28
- immediate: !0
29
- }
30
- );
31
- const b = () => {
32
- r("change", _(a.value));
33
- }, h = (t) => a.value.find((e) => e.key === t), V = (t) => !!(t.type && m.unconfigurableTypes.includes(t.type)), T = (t) => t === "left" ? "左" : t === "right" ? "右" : "-", y = (t, e) => {
34
- if (t === e || t < 0 || t >= a.value.length || e < 0 || e >= a.value.length) return;
35
- const l = [...a.value], [k] = l.splice(t, 1);
36
- l.splice(e, 0, k), a.value = l, v.value = k.key, b();
37
- }, D = (t, e) => {
38
- const l = h(t);
39
- !l || V(l) || (l.visible = e, b());
40
- }, N = (t, e) => {
41
- const l = h(t);
42
- l && (l.fixed = e, b());
43
- }, U = (t, e) => {
44
- const l = h(t);
45
- l && (l.width = e, b());
46
- }, F = () => {
47
- var e, l;
48
- const t = (e = m.defaultSettings) != null && e.length ? m.defaultSettings : m.settings;
49
- a.value = _(t), v.value = ((l = a.value[0]) == null ? void 0 : l.key) || "", r("reset", _(a.value)), b();
50
- }, S = () => {
51
- r("cancel"), r("update:modelValue", !1);
52
- }, L = () => {
53
- r("confirm", _(a.value)), r("update:modelValue", !1);
54
- };
55
- return (t, e) => {
56
- const l = Q, k = W, w = A, K = j, c = G, M = O;
57
- return g(), x(M, {
58
- "model-value": p.modelValue,
59
- title: p.title,
60
- width: p.width,
61
- "append-to-body": "",
62
- onClose: S
63
- }, {
64
- footer: s(() => [
65
- o(c, {
66
- "data-action": "reset",
67
- onClick: F
68
- }, {
69
- default: s(() => [...e[6] || (e[6] = [
70
- u(" 恢复默认 ", -1)
71
- ])]),
72
- _: 1
73
- }),
74
- p.showDeleteCache ? (g(), x(c, {
75
- key: 0,
76
- type: "danger",
77
- plain: "",
78
- "data-action": "delete-cache",
79
- onClick: e[0] || (e[0] = (n) => r("delete-cache"))
80
- }, {
81
- default: s(() => [...e[7] || (e[7] = [
82
- u(" 删除缓存 ", -1)
83
- ])]),
84
- _: 1
85
- })) : Y("", !0),
86
- o(c, {
87
- "data-action": "cancel",
88
- onClick: S
89
- }, {
90
- default: s(() => [...e[8] || (e[8] = [
91
- u(" 取消 ", -1)
92
- ])]),
93
- _: 1
94
- }),
95
- o(c, {
96
- type: "primary",
97
- "data-action": "confirm",
98
- onClick: L
99
- }, {
100
- default: s(() => [...e[9] || (e[9] = [
101
- u(" 确定 ", -1)
102
- ])]),
103
- _: 1
104
- })
105
- ]),
106
- default: s(() => [
107
- f("div", I, [
108
- f("div", ee, [
109
- (g(!0), B(P, null, R(a.value, (n, i) => (g(), B("div", {
110
- key: n.key,
111
- class: X(["qy-table-column-settings__row", { "is-active": n.key === v.value }]),
112
- "data-testid": `row-${n.key}`,
113
- onClick: (d) => v.value = n.key
114
- }, [
115
- f("div", le, [
116
- f("span", ae, E(T(n.fixed)), 1),
117
- f("span", null, E(n.label || n.prop || n.key), 1)
118
- ]),
119
- o(l, {
120
- "model-value": n.width,
121
- size: "small",
122
- placeholder: "自动",
123
- class: "qy-table-column-settings__width",
124
- "onUpdate:modelValue": (d) => U(n.key, d)
125
- }, null, 8, ["model-value", "onUpdate:modelValue"]),
126
- o(k, {
127
- "model-value": n.visible,
128
- disabled: V(n),
129
- onChange: (d) => D(n.key, !!d)
130
- }, {
131
- default: s(() => [...e[1] || (e[1] = [
132
- u(" 显示 ", -1)
133
- ])]),
134
- _: 1
135
- }, 8, ["model-value", "disabled", "onChange"]),
136
- o(K, {
137
- "model-value": n.fixed,
138
- size: "small",
139
- class: "qy-table-column-settings__fixed",
140
- onChange: (d) => N(n.key, d)
141
- }, {
142
- default: s(() => [
143
- o(w, {
144
- label: "不固定",
145
- value: !1
146
- }),
147
- o(w, {
148
- label: "左固定",
149
- value: "left"
150
- }),
151
- o(w, {
152
- label: "右固定",
153
- value: "right"
154
- })
155
- ]),
156
- _: 1
157
- }, 8, ["model-value", "onChange"]),
158
- f("div", ne, [
159
- o(c, {
160
- text: "",
161
- size: "small",
162
- disabled: i === 0,
163
- "data-action": "top",
164
- onClick: C((d) => y(i, 0), ["stop"])
165
- }, {
166
- default: s(() => [...e[2] || (e[2] = [
167
- u(" 置顶 ", -1)
168
- ])]),
169
- _: 1
170
- }, 8, ["disabled", "onClick"]),
171
- o(c, {
172
- text: "",
173
- size: "small",
174
- disabled: i === 0,
175
- "data-action": "up",
176
- onClick: C((d) => y(i, i - 1), ["stop"])
177
- }, {
178
- default: s(() => [...e[3] || (e[3] = [
179
- u(" 上移 ", -1)
180
- ])]),
181
- _: 1
182
- }, 8, ["disabled", "onClick"]),
183
- o(c, {
184
- text: "",
185
- size: "small",
186
- disabled: i === a.value.length - 1,
187
- "data-action": "down",
188
- onClick: C((d) => y(i, i + 1), ["stop"])
189
- }, {
190
- default: s(() => [...e[4] || (e[4] = [
191
- u(" 下移 ", -1)
192
- ])]),
193
- _: 1
194
- }, 8, ["disabled", "onClick"]),
195
- o(c, {
196
- text: "",
197
- size: "small",
198
- disabled: i === a.value.length - 1,
199
- "data-action": "bottom",
200
- onClick: C((d) => y(i, a.value.length - 1), ["stop"])
201
- }, {
202
- default: s(() => [...e[5] || (e[5] = [
203
- u(" 置底 ", -1)
204
- ])]),
205
- _: 1
206
- }, 8, ["disabled", "onClick"])
207
- ])
208
- ], 10, te))), 128))
209
- ])
210
- ])
211
- ]),
212
- _: 1
213
- }, 8, ["model-value", "title", "width"]);
214
- };
215
- }
216
- }), ue = /* @__PURE__ */ Z(oe, [["__scopeId", "data-v-cd1604ef"]]);
217
- export {
218
- ue as T
219
- };
@@ -1,106 +0,0 @@
1
- import { ElPopover as C } from "element-plus/es";
2
- import { defineComponent as M, computed as b, openBlock as n, createElementBlock as o, normalizeClass as f, createBlock as A, withCtx as g, createElementVNode as c, Fragment as q, renderList as x, createCommentVNode as u, toDisplayString as m } from "vue";
3
- import { _ as B } from "./install-DMq9RQ-h.mjs";
4
- const I = { class: "qy-menu-actions__panel" }, E = ["disabled", "data-action-key", "onClick"], T = {
5
- key: 0,
6
- class: "qy-menu-actions__loading"
7
- }, $ = {
8
- key: 0,
9
- class: "qy-menu-actions__empty"
10
- }, D = {
11
- key: 1,
12
- class: "qy-menu-actions__inline"
13
- }, L = ["disabled", "data-action-key", "onClick"], N = {
14
- key: 0,
15
- class: "qy-menu-actions__loading"
16
- }, P = {
17
- key: 0,
18
- class: "qy-menu-actions__empty"
19
- }, S = /* @__PURE__ */ M({
20
- name: "QyMenuActions",
21
- __name: "index",
22
- props: {
23
- actions: { default: () => [] },
24
- row: {},
25
- rowIndex: {},
26
- mode: { default: "inline" },
27
- emptyText: { default: "无数据" },
28
- popoverWidth: { default: 150 },
29
- confirmMethod: {}
30
- },
31
- emits: ["action", "confirm-required"],
32
- setup(s, { emit: w }) {
33
- const i = s, k = w, r = b(() => ({
34
- row: i.row,
35
- rowIndex: i.rowIndex
36
- })), y = (e) => typeof e == "function" ? e(r.value) : !!e, l = b(
37
- () => i.actions.filter((e) => !y(e.hidden))
38
- ), p = (e) => y(e.disabled) || a(e), a = (e) => y(e.loading), h = async (e, d) => {
39
- if (d.stopPropagation(), !p(e)) {
40
- if (e.confirm) {
41
- if (!i.confirmMethod) {
42
- k("confirm-required", e, r.value);
43
- return;
44
- }
45
- if (!await i.confirmMethod(e, r.value)) return;
46
- }
47
- k("action", e, r.value);
48
- }
49
- };
50
- return (e, d) => {
51
- const v = C;
52
- return n(), o("div", {
53
- class: f(["qy-menu-actions", `is-${s.mode}`])
54
- }, [
55
- s.mode === "popover" ? (n(), A(v, {
56
- key: 0,
57
- trigger: "hover",
58
- placement: "left",
59
- width: s.popoverWidth,
60
- "popper-class": "qy-menu-actions__popover"
61
- }, {
62
- reference: g(() => [...d[0] || (d[0] = [
63
- c("button", {
64
- class: "qy-menu-actions__trigger",
65
- type: "button",
66
- "aria-label": "行操作"
67
- }, " ⋮ ", -1)
68
- ])]),
69
- default: g(() => [
70
- c("div", I, [
71
- (n(!0), o(q, null, x(l.value, (t) => (n(), o("button", {
72
- key: t.key,
73
- class: f(["qy-menu-actions__item", [`is-${t.type || "default"}`, { "is-loading": a(t) }]]),
74
- disabled: p(t),
75
- "data-action-key": t.key,
76
- type: "button",
77
- onClick: (_) => h(t, _)
78
- }, [
79
- a(t) ? (n(), o("span", T)) : u("", !0),
80
- c("span", null, m(t.label), 1)
81
- ], 10, E))), 128)),
82
- l.value.length ? u("", !0) : (n(), o("div", $, m(s.emptyText), 1))
83
- ])
84
- ]),
85
- _: 1
86
- }, 8, ["width"])) : (n(), o("div", D, [
87
- (n(!0), o(q, null, x(l.value, (t) => (n(), o("button", {
88
- key: t.key,
89
- class: f(["qy-menu-actions__item", [`is-${t.type || "primary"}`, { "is-loading": a(t) }]]),
90
- disabled: p(t),
91
- "data-action-key": t.key,
92
- type: "button",
93
- onClick: (_) => h(t, _)
94
- }, [
95
- a(t) ? (n(), o("span", N)) : u("", !0),
96
- c("span", null, m(t.label), 1)
97
- ], 10, L))), 128)),
98
- l.value.length ? u("", !0) : (n(), o("span", P, m(s.emptyText), 1))
99
- ]))
100
- ], 2);
101
- };
102
- }
103
- }), F = /* @__PURE__ */ B(S, [["__scopeId", "data-v-0d19f791"]]);
104
- export {
105
- F as M
106
- };
@@ -1 +0,0 @@
1
- "use strict";const _=require("element-plus/es"),e=require("vue"),f=require("./install-DNgKRKb2.cjs"),B={class:"qy-menu-actions__panel"},h=["disabled","data-action-key","onClick"],v={key:0,class:"qy-menu-actions__loading"},g={key:0,class:"qy-menu-actions__empty"},b={key:1,class:"qy-menu-actions__inline"},q=["disabled","data-action-key","onClick"],C={key:0,class:"qy-menu-actions__loading"},E={key:0,class:"qy-menu-actions__empty"},x=e.defineComponent({name:"QyMenuActions",__name:"index",props:{actions:{default:()=>[]},row:{},rowIndex:{},mode:{default:"inline"},emptyText:{default:"无数据"},popoverWidth:{default:150},confirmMethod:{}},emits:["action","confirm-required"],setup(o,{emit:k}){const l=o,u=k,c=e.computed(()=>({row:l.row,rowIndex:l.rowIndex})),a=t=>typeof t=="function"?t(c.value):!!t,i=e.computed(()=>l.actions.filter(t=>!a(t.hidden))),d=t=>a(t.disabled)||s(t),s=t=>a(t.loading),p=async(t,r)=>{if(r.stopPropagation(),!d(t)){if(t.confirm){if(!l.confirmMethod){u("confirm-required",t,c.value);return}if(!await l.confirmMethod(t,c.value))return}u("action",t,c.value)}};return(t,r)=>{const y=_.ElPopover;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-menu-actions",`is-${o.mode}`])},[o.mode==="popover"?(e.openBlock(),e.createBlock(y,{key:0,trigger:"hover",placement:"left",width:o.popoverWidth,"popper-class":"qy-menu-actions__popover"},{reference:e.withCtx(()=>[...r[0]||(r[0]=[e.createElementVNode("button",{class:"qy-menu-actions__trigger",type:"button","aria-label":"行操作"}," ⋮ ",-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${n.type||"default"}`,{"is-loading":s(n)}]]),disabled:d(n),"data-action-key":n.key,type:"button",onClick:m=>p(n,m)},[s(n)?(e.openBlock(),e.createElementBlock("span",v)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.label),1)],10,h))),128)),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",g,e.toDisplayString(o.emptyText),1))])]),_:1},8,["width"])):(e.openBlock(),e.createElementBlock("div",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${n.type||"primary"}`,{"is-loading":s(n)}]]),disabled:d(n),"data-action-key":n.key,type:"button",onClick:m=>p(n,m)},[s(n)?(e.openBlock(),e.createElementBlock("span",C)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.label),1)],10,q))),128)),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(o.emptyText),1))]))],2)}}}),w=f._export_sfc(x,[["__scopeId","data-v-0d19f791"]]);exports.MenuActions=w;