@qynpm/ui 1.0.22 → 1.0.24
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 +230 -54
- package/dist/index.cjs +16 -5
- package/dist/index.mjs +53 -34
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-autocomplete/index.cjs +1 -1
- package/dist/qy-autocomplete/index.mjs +4 -2
- 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 +5 -2
- 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 +5 -2
- 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 +4 -2
- package/dist/qy-image-preview/index.cjs +1 -1
- package/dist/qy-image-preview/index.mjs +6 -3
- 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 -2
- 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 +5 -2
- 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-tree-select/index.cjs +1 -1
- package/dist/qy-tree-select/index.mjs +4 -2
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/index-8u4DJZwd.mjs +90 -0
- package/dist/shared/index-9WJeVamR.cjs +1 -0
- package/dist/shared/index-BDFscU3G.mjs +72 -0
- package/dist/shared/index-BYme5QGm.cjs +1 -0
- package/dist/shared/index-B_mI-37S.cjs +1 -0
- package/dist/shared/index-BrV6CR4H.mjs +54 -0
- package/dist/shared/index-C8CA7nkO.cjs +1 -0
- package/dist/shared/index-CTtAQ1LD.cjs +1 -0
- package/dist/shared/index-CczrP1H7.mjs +149 -0
- package/dist/shared/index-ClmefDi6.cjs +1 -0
- package/dist/shared/{index-DaqN69ii.mjs → index-DJnmpqCc.mjs} +63 -63
- package/dist/shared/index-DMGXEAyl.mjs +119 -0
- package/dist/shared/index-DYohs_aV.mjs +225 -0
- package/dist/shared/index-DixSXWJj.mjs +68 -0
- package/dist/shared/index-M4vEHYZ_.cjs +1 -0
- package/dist/shared/index-aiJ7R6G-.cjs +1 -0
- package/dist/shared/index-c7lnX4vT.mjs +3356 -0
- package/dist/shared/index-dEWJKTS-.cjs +1 -0
- package/dist/shared/index-fBuu4V3A.mjs +129 -0
- package/dist/shared/index-wIXCDvwC.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-5gku7Zwv.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BF82tses.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BNjoxcAR.mjs +61 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-C-Pf9TJ0.mjs +152 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CKp87br2.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DWS8bsiP.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DmmW8UUK.mjs +106 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DoL8xnpo.mjs +48 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-EiHoQBXt.mjs +94 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-tyM4_aoa.cjs +1 -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/dist/shared/utils-D2KAQCCB.cjs +1 -0
- package/dist/shared/utils-DUntDntI.mjs +112 -0
- package/index.d.ts +155 -17
- package/package.json +260 -218
- package/qy-checkbox/index.d.ts +42 -2
- package/qy-checkbox-group/index.d.ts +48 -0
- package/qy-date-picker/index.d.ts +140 -5
- package/qy-file-picker/index.d.ts +49 -0
- package/qy-input/index.d.ts +50 -5
- package/qy-input-number/index.d.ts +45 -5
- package/qy-popover/index.d.ts +63 -0
- package/qy-radio/index.d.ts +44 -0
- package/qy-radio-group/index.d.ts +60 -12
- package/qy-select/index.d.ts +67 -5
- package/qy-switch/index.d.ts +46 -0
- package/qy-tag/index.d.ts +44 -0
- package/qy-tooltip/index.d.ts +54 -0
- package/dist/shared/index-BMqHC4GE.mjs +0 -4239
- package/dist/shared/index-BZ2L7Rch.cjs +0 -1
- package/dist/shared/index-BnMUdIAd.cjs +0 -1
- package/dist/shared/index-Cuw6WFH3.cjs +0 -1
- package/dist/shared/index-D8iNLsjJ.mjs +0 -153
- 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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineComponent as s, useAttrs as r, computed as m, openBlock as f, createBlock as v, unref as b, mergeProps as h } from "vue";
|
|
2
|
+
import { ElSwitch as x } from "element-plus";
|
|
3
|
+
import { _ as g } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const V = /* @__PURE__ */ s({
|
|
5
|
+
name: "QySwitch",
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "index",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: [Boolean, String, Number], default: !1 },
|
|
10
|
+
activeValue: { type: [Boolean, String, Number], default: !0 },
|
|
11
|
+
inactiveValue: { type: [Boolean, String, Number], default: !1 },
|
|
12
|
+
disabled: { type: Boolean, default: !1 },
|
|
13
|
+
loading: { type: Boolean, default: !1 },
|
|
14
|
+
size: {},
|
|
15
|
+
activeText: { default: "" },
|
|
16
|
+
inactiveText: { default: "" },
|
|
17
|
+
inlinePrompt: { type: Boolean, default: !1 },
|
|
18
|
+
name: { default: "" },
|
|
19
|
+
id: {},
|
|
20
|
+
tabindex: {},
|
|
21
|
+
ariaLabel: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
24
|
+
setup(e, { emit: i }) {
|
|
25
|
+
const t = i, l = r(), n = m(
|
|
26
|
+
() => Object.fromEntries(
|
|
27
|
+
Object.entries(l).filter(
|
|
28
|
+
([a]) => a === "class" || a === "style" || a === "role" || a === "title" || a.startsWith("data-") || a.startsWith("aria-")
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
function d(a) {
|
|
33
|
+
t("focus", a);
|
|
34
|
+
}
|
|
35
|
+
function u(a) {
|
|
36
|
+
t("blur", a);
|
|
37
|
+
}
|
|
38
|
+
function c(a) {
|
|
39
|
+
e.disabled || e.loading || t("update:modelValue", a);
|
|
40
|
+
}
|
|
41
|
+
function o(a) {
|
|
42
|
+
e.disabled || e.loading || t("change", a);
|
|
43
|
+
}
|
|
44
|
+
return (a, B) => (f(), v(b(x), h(n.value, {
|
|
45
|
+
class: "qy-switch",
|
|
46
|
+
"model-value": e.modelValue,
|
|
47
|
+
"active-value": e.activeValue,
|
|
48
|
+
"inactive-value": e.inactiveValue,
|
|
49
|
+
disabled: e.disabled,
|
|
50
|
+
loading: e.loading,
|
|
51
|
+
size: e.size,
|
|
52
|
+
"active-text": e.activeText,
|
|
53
|
+
"inactive-text": e.inactiveText,
|
|
54
|
+
"inline-prompt": e.inlinePrompt,
|
|
55
|
+
name: e.name,
|
|
56
|
+
id: e.id,
|
|
57
|
+
tabindex: e.tabindex,
|
|
58
|
+
"aria-label": e.ariaLabel,
|
|
59
|
+
"onUpdate:modelValue": c,
|
|
60
|
+
onChange: o,
|
|
61
|
+
onFocusin: d,
|
|
62
|
+
onFocusout: u
|
|
63
|
+
}), null, 16, ["model-value", "active-value", "inactive-value", "disabled", "loading", "size", "active-text", "inactive-text", "inline-prompt", "name", "id", "tabindex", "aria-label"]));
|
|
64
|
+
}
|
|
65
|
+
}), z = /* @__PURE__ */ g(V, [["__scopeId", "data-v-5ec5d1c7"]]);
|
|
66
|
+
export {
|
|
67
|
+
z as S
|
|
68
|
+
};
|
|
@@ -0,0 +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-02c4930c"]]);exports.Image=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),x=require("./index.vue_vue_type_style_index_0_lang-BZQLyvw8.cjs"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w={class:"qy-menu-actions__panel"},T=["disabled","data-action-key","onClick"],C={key:0,class:"qy-menu-actions__loading"},b={key:0,class:"qy-menu-actions__empty"},E={key:1,class:"qy-menu-actions__inline"},V=["disabled","data-action-key","onClick"],z={key:0,class:"qy-menu-actions__loading"},A={key:0,class:"qy-menu-actions__empty"},M=e.defineComponent({name:"QyMenuActions",__name:"index",props:{actions:{default:()=>[]},row:{},rowIndex:{},context:{},mode:{default:"inline"},emptyText:{default:"无数据"},popoverWidth:{default:150},confirmMethod:{}},emits:["action","confirm-required"],setup(r,{emit:f}){const l=r,y=f,p=e.computed(()=>{var n,o;return{...l.context,row:l.row??((n=l.context)==null?void 0:n.row),rowIndex:l.rowIndex??((o=l.context)==null?void 0:o.rowIndex)}}),d=e.ref(!1),i=e.ref(new Set),v=(n,o)=>({...p.value,target:o.currentTarget,hide:h,setLoading:t=>q(n,t)}),u=n=>typeof n=="function"?n(p.value):!!n,s=e.computed(()=>l.actions.filter(n=>!u(n.hidden))),g=e.computed(()=>s.value.some(n=>a(n))),m=n=>u(n.disabled)||a(n),a=n=>i.value.has(n.key)||u(n.loading),k=(n,o)=>{const t=n.type||o;return{default:"var(--el-text-color-primary)",primary:"var(--el-color-primary)",success:"var(--el-color-success)",warning:"var(--el-color-warning)",danger:"var(--el-color-danger)"}[t]},_=async(n,o)=>{if(o.stopPropagation(),m(n))return;const t=v(n,o);if(n.confirm){if(!l.confirmMethod){y("confirm-required",n,t);return}if(!await l.confirmMethod(n,t))return}y("action",n,t)};function h(){d.value=!1}function q(n,o){const t=new Set(i.value);o?t.add(n.key):t.delete(n.key),i.value=t}return e.onBeforeUnmount(()=>{i.value=new Set}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["qy-menu-actions",`is-${r.mode}`])},[r.mode==="popover"?(e.openBlock(),e.createBlock(x._sfc_main,{key:0,open:d.value,"onUpdate:open":o[0]||(o[0]=t=>d.value=t),trigger:"hover",placement:"left",width:r.popoverWidth,"hide-delay":g.value?999999:100,"show-arrow":!1},{reference:e.withCtx(()=>[...o[1]||(o[1]=[e.createElementVNode("button",{class:"qy-menu-actions__trigger",type:"button","aria-label":"行操作"},[e.createElementVNode("svg",{class:"qy-menu-actions__trigger-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[e.createElementVNode("path",{fill:"currentColor",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"})])],-1)])]),default:e.withCtx(()=>[e.createElementVNode("div",w,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${t.type||"default"}`,{"is-loading":a(t)}]]),disabled:m(t),"data-action-key":t.key,style:e.normalizeStyle({color:k(t,"default")}),type:"button",onClick:c=>_(t,c)},[a(t)?(e.openBlock(),e.createElementBlock("span",C)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],14,T))),128)),s.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",b,e.toDisplayString(r.emptyText),1))])]),_:1},8,["open","width","hide-delay"])):(e.openBlock(),e.createElementBlock("div",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["qy-menu-actions__item",[`is-${t.type||"primary"}`,{"is-loading":a(t)}]]),disabled:m(t),"data-action-key":t.key,style:e.normalizeStyle({color:k(t,"primary")}),type:"button",onClick:c=>_(t,c)},[a(t)?(e.openBlock(),e.createElementBlock("span",z)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.label),1)],14,V))),128)),s.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",A,e.toDisplayString(r.emptyText),1))]))],2))}}),N=B._export_sfc(M,[["__scopeId","data-v-18227456"]]);exports.MenuActions=N;
|