@qynpm/ui 1.0.4 → 1.0.6

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 (93) hide show
  1. package/README.md +169 -0
  2. package/dist/index.cjs +2 -1
  3. package/dist/index.mjs +54 -15
  4. package/dist/qy-action-bar/index.cjs +1 -1
  5. package/dist/qy-action-bar/index.mjs +4 -4
  6. package/dist/qy-dialog/index.cjs +1 -1
  7. package/dist/qy-dialog/index.mjs +4 -4
  8. package/dist/qy-form-section/index.cjs +1 -1
  9. package/dist/qy-form-section/index.mjs +2 -2
  10. package/dist/qy-input/index.cjs +1 -1
  11. package/dist/qy-input/index.mjs +4 -4
  12. package/dist/qy-money-input/index.cjs +1 -0
  13. package/dist/qy-money-input/index.mjs +6 -0
  14. package/dist/qy-radio-group/index.cjs +1 -0
  15. package/dist/qy-radio-group/index.mjs +6 -0
  16. package/dist/qy-record-quote-search/index.cjs +1 -1
  17. package/dist/qy-record-quote-search/index.mjs +2 -2
  18. package/dist/qy-remark-image/index.cjs +1 -2
  19. package/dist/qy-remark-image/index.mjs +3 -4
  20. package/dist/qy-remote-select/index.cjs +1 -0
  21. package/dist/qy-remote-select/index.mjs +6 -0
  22. package/dist/qy-search-input/index.cjs +1 -1
  23. package/dist/qy-search-input/index.mjs +3 -3
  24. package/dist/qy-select/index.cjs +1 -1
  25. package/dist/qy-select/index.mjs +4 -4
  26. package/dist/qy-upload/index.cjs +1 -1
  27. package/dist/qy-upload/index.mjs +3 -3
  28. package/dist/qy-voucher-upload/index.cjs +1 -0
  29. package/dist/qy-voucher-upload/index.mjs +6 -0
  30. package/dist/shared/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  31. package/dist/shared/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  32. package/dist/{lib/qy-action-bar/index.vue.mjs → shared/index-Bw9kVFsm.mjs} +13 -13
  33. package/dist/{lib/qy-record-quote-search/index.vue.mjs → shared/index-BzV4959-.mjs} +42 -43
  34. package/dist/{lib/qy-form-section/index.vue.mjs → shared/index-C0ADdL4S.mjs} +11 -12
  35. package/dist/shared/index-CBSjmD0C.mjs +217 -0
  36. package/dist/shared/index-CJb1S7CP.cjs +1 -0
  37. package/dist/shared/index-CO8lz02r.cjs +1 -0
  38. package/dist/shared/index-ClPxDFKd.cjs +1 -0
  39. package/dist/shared/index-CtOqRiaj.cjs +1 -0
  40. package/dist/shared/index-DXB7_Tb5.cjs +1 -0
  41. package/dist/shared/index-DeWkPj3O.mjs +484 -0
  42. package/dist/shared/index-PUYQxK94.mjs +123 -0
  43. package/dist/shared/index-UzZbxoqZ.cjs +1 -0
  44. package/dist/shared/index-a90QeEC4.cjs +1 -0
  45. package/dist/{lib/qy-search-input/index.vue.mjs → shared/index-wW02nNOp.mjs} +55 -55
  46. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BcZg8D-y.mjs +214 -0
  47. package/dist/shared/index.vue_vue_type_script_setup_true_lang-BmeBeCu0.mjs +162 -0
  48. package/dist/shared/index.vue_vue_type_script_setup_true_lang-C85575cL.cjs +1 -0
  49. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DkYwdYdF.mjs +90 -0
  50. package/dist/shared/index.vue_vue_type_script_setup_true_lang-Do5SZ8yS.cjs +1 -0
  51. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs +1 -0
  52. package/dist/shared/index.vue_vue_type_script_setup_true_lang-DuUkOqwY.cjs +1 -0
  53. package/dist/{lib/qy-input/index.vue.mjs → shared/index.vue_vue_type_script_setup_true_lang-Dvh1BFaR.mjs} +8 -7
  54. package/dist/shared/index.vue_vue_type_script_setup_true_lang-RtfqJ73A.mjs +171 -0
  55. package/dist/shared/index.vue_vue_type_script_setup_true_lang-VVjCLNMD.cjs +1 -0
  56. package/dist/{lib/dialog/index.vue.mjs → shared/index.vue_vue_type_style_index_0_lang-DpIL_6vO.mjs} +24 -25
  57. package/dist/shared/index.vue_vue_type_style_index_0_lang-haqCjB5x.cjs +1 -0
  58. package/dist/{lib/utils/install.mjs → shared/install-CxBnxbuN.mjs} +2 -2
  59. package/dist/shared/install-c8il9DQv.cjs +1 -0
  60. package/dist/shared/js.cookie-CojEIxHg.cjs +1 -0
  61. package/dist/{node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.mjs → shared/js.cookie-OLEfuq_g.mjs} +16 -16
  62. package/index.d.ts +9 -0
  63. package/package.json +25 -1
  64. package/qy-money-input/index.d.ts +12 -0
  65. package/qy-money-input/index.js +15 -0
  66. package/qy-radio-group/index.d.ts +12 -0
  67. package/qy-radio-group/index.js +15 -0
  68. package/qy-remote-select/index.d.ts +12 -0
  69. package/qy-remote-select/index.js +15 -0
  70. package/qy-voucher-upload/index.d.ts +12 -0
  71. package/qy-voucher-upload/index.js +15 -0
  72. package/dist/_virtual/plugin-vue_export-helper.cjs +0 -1
  73. package/dist/_virtual/plugin-vue_export-helper.mjs +0 -9
  74. package/dist/lib/dialog/index.vue.cjs +0 -1
  75. package/dist/lib/index.cjs +0 -1
  76. package/dist/lib/index.mjs +0 -40
  77. package/dist/lib/qy-action-bar/index.vue.cjs +0 -1
  78. package/dist/lib/qy-form-section/index.vue.cjs +0 -1
  79. package/dist/lib/qy-input/index.vue.cjs +0 -1
  80. package/dist/lib/qy-record-quote-search/index.vue.cjs +0 -1
  81. package/dist/lib/qy-search-input/index.vue.cjs +0 -1
  82. package/dist/lib/qy-select/index.vue.cjs +0 -1
  83. package/dist/lib/qy-select/index.vue.mjs +0 -137
  84. package/dist/lib/remark-image/index.vue.cjs +0 -1
  85. package/dist/lib/remark-image/index.vue.mjs +0 -198
  86. package/dist/lib/remark-image/utils.cjs +0 -1
  87. package/dist/lib/remark-image/utils.mjs +0 -22
  88. package/dist/lib/upload/index.vue.cjs +0 -1
  89. package/dist/lib/upload/index.vue.mjs +0 -382
  90. package/dist/lib/utils/auth.cjs +0 -1
  91. package/dist/lib/utils/auth.mjs +0 -8
  92. package/dist/lib/utils/install.cjs +0 -1
  93. package/dist/node_modules/.pnpm/js-cookie@3.0.1/node_modules/js-cookie/dist/js.cookie.cjs +0 -1
@@ -0,0 +1,90 @@
1
+ import { defineComponent as z, useAttrs as G, ref as $, computed as t, createBlock as f, openBlock as u, unref as n, mergeProps as m, withCtx as b, renderSlot as c, createElementBlock as E, Fragment as S, renderList as _, resolveDynamicComponent as w, createTextVNode as P, toDisplayString as A } from "vue";
2
+ import { ElRadioButton as D, ElRadio as N, ElRadioGroup as O } from "element-plus";
3
+ const I = /* @__PURE__ */ z({
4
+ name: "QyRadioGroup",
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ props: {
8
+ modelValue: { type: [String, Number, Boolean, null], default: void 0 },
9
+ options: { default: () => [] },
10
+ labelKey: { default: "label" },
11
+ valueKey: { default: "value" },
12
+ disabledKey: { default: "disabled" },
13
+ disabled: { type: Boolean, default: !1 },
14
+ size: { default: "default" },
15
+ name: { default: void 0 },
16
+ type: { default: "radio" },
17
+ border: { type: Boolean, default: !1 }
18
+ },
19
+ emits: ["update:modelValue", "change"],
20
+ setup(v, { expose: y, emit: i }) {
21
+ const a = v, r = i, g = G(), s = $(null), h = t(
22
+ () => a.type === "button" ? D : N
23
+ ), B = t(
24
+ () => (a.options || []).map((e) => ({
25
+ raw: e,
26
+ label: (e == null ? void 0 : e[a.labelKey]) ?? (e == null ? void 0 : e.label) ?? (e == null ? void 0 : e.value) ?? "",
27
+ value: (e == null ? void 0 : e[a.valueKey]) ?? (e == null ? void 0 : e.value) ?? (e == null ? void 0 : e.label),
28
+ disabled: !!(e != null && e[a.disabledKey])
29
+ }))
30
+ );
31
+ function R(e) {
32
+ const d = {
33
+ value: e.value,
34
+ label: e.value,
35
+ disabled: e.disabled
36
+ };
37
+ return a.type === "button" ? d : {
38
+ ...d,
39
+ border: a.border
40
+ };
41
+ }
42
+ function k(e, d) {
43
+ return `${String(e.value ?? e.label ?? "")}-${d}`;
44
+ }
45
+ function o(e) {
46
+ r("update:modelValue", e);
47
+ }
48
+ function K(e) {
49
+ r("change", e);
50
+ }
51
+ function V() {
52
+ return s.value;
53
+ }
54
+ return y({
55
+ getRadioGroupInstance: V
56
+ }), (e, d) => (u(), f(n(O), m({
57
+ ref_key: "radioGroupRef",
58
+ ref: s
59
+ }, n(g), {
60
+ "model-value": e.modelValue,
61
+ disabled: e.disabled,
62
+ size: e.size,
63
+ name: e.name,
64
+ "onUpdate:modelValue": o,
65
+ onChange: K
66
+ }), {
67
+ default: b(() => [
68
+ e.$slots.default ? c(e.$slots, "default", { key: 0 }) : (u(!0), E(S, { key: 1 }, _(B.value, (l, C) => (u(), f(w(h.value), m({
69
+ key: k(l, C)
70
+ }, { ref_for: !0 }, R(l)), {
71
+ default: b(() => [
72
+ c(e.$slots, "option", {
73
+ option: l.raw,
74
+ label: l.label,
75
+ value: l.value,
76
+ disabled: l.disabled
77
+ }, () => [
78
+ P(A(l.label), 1)
79
+ ])
80
+ ]),
81
+ _: 2
82
+ }, 1040))), 128))
83
+ ]),
84
+ _: 3
85
+ }, 16, ["model-value", "disabled", "size", "name"]));
86
+ }
87
+ });
88
+ export {
89
+ I as _
90
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),T=require("element-plus"),q=t.defineComponent({name:"QyInput",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},removeSpace:{type:Boolean,default:!1},trimMode:{default:"none"}},emits:["update:modelValue","input","change","focus","blur","clear","enter"],setup(c,{expose:d,emit:p}){const a=c,u=p,m=t.useAttrs(),l=t.ref(null),r=t.ref(o(a.modelValue)),h=t.computed(()=>o(a.modelValue));t.watch(()=>a.modelValue,e=>{r.value=o(e)});function o(e){return e==null?"":String(e)}function v(e){return a.removeSpace?e.replace(/\s+/g,""):e}function s(e,n){return a.trimMode!==n?e:e.trim()}function f(e){return v(o(e))}function i(e){r.value=e,u("update:modelValue",e)}function V(e){const n=f(e);i(n)}function x(e){r.value=o(e),u("input",o(e))}function g(e){const n=s(f(e),"change");n!==o(a.modelValue)&&i(n),u("change",n)}function y(e){u("focus",e)}function C(e){const n=s(r.value,"blur");n!==o(a.modelValue)&&i(n),u("blur",e)}function S(){r.value="",u("update:modelValue",""),u("clear")}function $(e){u("enter",e)}function k(){var e,n;(n=(e=l.value)==null?void 0:e.focus)==null||n.call(e)}function w(){var e,n;(n=(e=l.value)==null?void 0:e.blur)==null||n.call(e)}function I(){var e,n;(n=(e=l.value)==null?void 0:e.select)==null||n.call(e)}function b(){var e,n;(n=(e=l.value)==null?void 0:e.clear)==null||n.call(e)}function z(){var e,n;(n=(e=l.value)==null?void 0:e.resizeTextarea)==null||n.call(e)}function B(){var e;return((e=l.value)==null?void 0:e.input)||null}function M(){var e;return((e=l.value)==null?void 0:e.textarea)||null}return d({focus:k,blur:w,select:I,clear:b,resizeTextarea:z,getNativeInput:B,getTextarea:M}),(e,n)=>(t.openBlock(),t.createBlock(t.unref(T.ElInput),t.mergeProps({ref_key:"inputRef",ref:l},t.unref(m),{"model-value":h.value,"onUpdate:modelValue":V,onInput:x,onChange:g,onFocus:y,onBlur:C,onClear:S,onKeydown:t.withKeys($,["enter"])}),t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots.prepend?{name:"prepend",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prepend")]),key:"2"}:void 0,e.$slots.append?{name:"append",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"append")]),key:"3"}:void 0]),1040,["model-value"]))}});exports._sfc_main=q;
@@ -0,0 +1 @@
1
+ "use strict";const l=require("vue"),n=require("element-plus"),T=l.defineComponent({name:"QySelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""}},emits:["update:modelValue","change","clear","visible-change","focus","blur"],setup(o,{expose:f,emit:i}){const t=o,u=i,c=l.useAttrs(),p=l.useSlots(),r=l.ref(null),m=l.computed(()=>["qy-select__popper",t.popperClass].filter(Boolean).join(" ")),d=l.computed(()=>(t.options||[]).map(e=>({raw:e,label:(e==null?void 0:e[t.labelKey])??(e==null?void 0:e.label)??(e==null?void 0:e.value)??"",value:(e==null?void 0:e[t.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label),disabled:!!(e!=null&&e[t.disabledKey])}))),b=l.computed(()=>{const e=p.default;return e?e().some(a=>a.type!==l.Comment):!1});function y(e){return Array.isArray(e)?e.length===0:e===""||e===null||e===void 0}l.watch([d,()=>t.modelValue,()=>t.autoSelectSingle,()=>t.disabled,()=>t.multiple],([e])=>{if(!t.autoSelectSingle||t.disabled||!y(t.modelValue)||e.length!==1)return;const[a]=e;if(a.disabled)return;const s=t.multiple?[a.value]:a.value;u("update:modelValue",s),u("change",s)},{immediate:!0});function g(e,a){return`${String(e.value??e.label??"")}-${a}`}function h(e){u("update:modelValue",e)}function v(e){u("change",e)}function B(){u("clear")}function S(e){u("visible-change",e)}function C(e){u("focus",e)}function k(e){u("blur",e)}function V(){var e,a;(a=(e=r.value)==null?void 0:e.focus)==null||a.call(e)}function $(){var e,a;(a=(e=r.value)==null?void 0:e.blur)==null||a.call(e)}return f({focus:V,blur:$}),(e,a)=>(l.openBlock(),l.createBlock(l.unref(n.ElSelect),l.mergeProps({ref_key:"selectRef",ref:r},l.unref(c),{"model-value":e.modelValue,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:e.filterable,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,size:e.size,teleported:e.teleported,"fit-input-width":e.fitInputWidth,"popper-class":m.value,"append-to":e.appendTo,"onUpdate:modelValue":h,onChange:v,onClear:B,onVisibleChange:S,onFocus:C,onBlur:k}),l.createSlots({default:l.withCtx(()=>[b.value?l.renderSlot(e.$slots,"default",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(d.value,(s,w)=>(l.openBlock(),l.createBlock(l.unref(n.ElOption),{key:g(s,w),label:s.label,value:s.value,disabled:s.disabled},null,8,["label","value","disabled"]))),128))]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(s=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(s)))]),key:"3"}:void 0]),1040,["model-value","placeholder","disabled","clearable","filterable","multiple","collapse-tags","collapse-tags-tooltip","size","teleported","fit-input-width","popper-class","append-to"]))}});exports._sfc_main=T;
@@ -0,0 +1 @@
1
+ "use strict";const l=require("vue"),P=require("./index.vue_vue_type_script_setup_true_lang-DpZzyX5f.cjs"),U=l.defineComponent({name:"QyRemoteSelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Array,null],default:void 0},fetchMethod:{},defaultOptions:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},collapseTags:{type:Boolean,default:!1},collapseTagsTooltip:{type:Boolean,default:!1},autoSelectSingle:{type:Boolean,default:!1},size:{default:"default"},teleported:{type:Boolean,default:!0},appendTo:{default:"body"},fitInputWidth:{type:Boolean,default:!0},popperClass:{default:""},debounce:{default:300},minLength:{default:1},remoteOnFocus:{type:Boolean,default:!1},remoteShowSuffix:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},reserveSelectedOption:{type:Boolean,default:!0}},emits:["update:modelValue","change","clear","visible-change","focus","blur","options-change","loading-change","error"],setup(S,{expose:O,emit:B}){const a=S,o=B,V=l.useAttrs(),p=l.ref(null),s=l.ref([]),v=l.ref(new Map),m=l.ref(!1),d=l.ref("");let i=0,u=null;const C=l.computed(()=>a.loading||m.value),h=l.ref(!1),r=l.computed(()=>{const e=new Map,t=n=>{e.set(y(n),n)};return a.defaultOptions.forEach(t),a.reserveSelectedOption&&v.value.forEach(n=>t(n)),s.value.forEach(t),Array.from(e.values())});l.watch(()=>a.defaultOptions,e=>{e.forEach(f)},{immediate:!0}),l.watch(()=>a.modelValue,()=>{r.value.forEach(f)},{immediate:!0});function y(e){return(e==null?void 0:e[a.valueKey])??(e==null?void 0:e.value)??(e==null?void 0:e.label)}function w(e){return Array.isArray(a.modelValue)?a.modelValue.includes(e):a.modelValue===e}function f(e){if(!a.reserveSelectedOption)return;const t=y(e);w(t)&&v.value.set(t,e)}function T(e){return a.disabled?!1:e?e.length>=a.minLength:a.remoteOnFocus}function g(e){m.value!==e&&(m.value=e,o("loading-change",e))}async function c(e){if(d.value=e,!T(e)){i+=1,s.value=[],g(!1),o("options-change",r.value);return}const t=++i;g(!0);try{const n=await a.fetchMethod(e);if(t!==i)return;s.value=Array.isArray(n)?n:[],s.value.forEach(f),o("options-change",r.value)}catch(n){if(t!==i)return;s.value=[],o("error",n),o("options-change",r.value)}finally{t===i&&g(!1)}}function b(){h.value||(h.value=!0,c(""))}function k(e){u&&(clearTimeout(u),u=null),u=setTimeout(()=>{c(e)},a.debounce)}function F(){h.value=!0,c("")}function $(){c(d.value)}function A(e){o("update:modelValue",e)}function K(e){r.value.forEach(f),o("change",e)}function E(){o("clear")}function M(e){e&&a.remoteOnFocus&&!d.value&&b(),o("visible-change",e)}function I(e){a.remoteOnFocus&&!d.value&&b(),o("focus",e)}function R(e){o("blur",e)}function z(){var e,t;(t=(e=p.value)==null?void 0:e.focus)==null||t.call(e)}function L(){var e,t;(t=(e=p.value)==null?void 0:e.blur)==null||t.call(e)}function q(){o("update:modelValue",a.multiple?[]:""),o("clear")}return l.onBeforeUnmount(()=>{u&&clearTimeout(u)}),O({focus:z,blur:L,clear:q,retryFetch:$,fetchDefaultOptions:F}),(e,t)=>(l.openBlock(),l.createBlock(P._sfc_main,l.mergeProps({ref_key:"selectRef",ref:p},l.unref(V),{"model-value":e.modelValue,options:r.value,"label-key":e.labelKey,"value-key":e.valueKey,"disabled-key":e.disabledKey,placeholder:e.placeholder,disabled:e.disabled,clearable:e.clearable,filterable:!0,multiple:e.multiple,"collapse-tags":e.collapseTags,"collapse-tags-tooltip":e.collapseTagsTooltip,"auto-select-single":e.autoSelectSingle,size:e.size,teleported:e.teleported,"append-to":e.appendTo,"fit-input-width":e.fitInputWidth,"popper-class":e.popperClass,remote:"","remote-show-suffix":e.remoteShowSuffix,"remote-method":k,loading:C.value,"onUpdate:modelValue":A,onChange:K,onClear:E,onVisibleChange:M,onFocus:I,onBlur:R}),l.createSlots({default:l.withCtx(()=>[e.$slots.default?l.renderSlot(e.$slots,"default",{key:0}):l.createCommentVNode("",!0)]),_:2},[e.$slots.prefix?{name:"prefix",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"empty")]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"loading")]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:l.withCtx(n=>[l.renderSlot(e.$slots,"tag",l.normalizeProps(l.guardReactiveProps(n)))]),key:"3"}:void 0]),1040,["model-value","options","label-key","value-key","disabled-key","placeholder","disabled","clearable","multiple","collapse-tags","collapse-tags-tooltip","auto-select-single","size","teleported","append-to","fit-input-width","popper-class","remote-show-suffix","loading"]))}});exports._sfc_main=U;
@@ -1,6 +1,6 @@
1
- import { defineComponent as F, useAttrs as K, ref as d, computed as R, watch as U, createBlock as N, openBlock as P, unref as p, mergeProps as Q, withKeys as j, createSlots as q, withCtx as r, renderSlot as i } from "vue";
2
- import { ElInput as D } from "element-plus";
3
- const J = F({
1
+ import { defineComponent as F, useAttrs as K, ref as d, computed as R, watch as U, createBlock as N, openBlock as P, unref as p, mergeProps as Q, withKeys as _, createSlots as j, withCtx as r, renderSlot as i } from "vue";
2
+ import { ElInput as q } from "element-plus";
3
+ const H = /* @__PURE__ */ F({
4
4
  name: "QyInput",
5
5
  inheritAttrs: !1,
6
6
  __name: "index",
@@ -86,6 +86,7 @@ const J = F({
86
86
  return ((e = u.value) == null ? void 0 : e.textarea) || null;
87
87
  }
88
88
  return V({
89
+ // 暴露 Element Plus 常用输入框方法,方便业务弹窗做聚焦、选中和 textarea 重算高度。
89
90
  focus: z,
90
91
  blur: B,
91
92
  select: w,
@@ -93,7 +94,7 @@ const J = F({
93
94
  resizeTextarea: T,
94
95
  getNativeInput: A,
95
96
  getTextarea: E
96
- }), (e, n) => (P(), N(p(D), Q({
97
+ }), (e, n) => (P(), N(p(q), Q({
97
98
  ref_key: "inputRef",
98
99
  ref: u
99
100
  }, p(v), {
@@ -104,8 +105,8 @@ const J = F({
104
105
  onFocus: C,
105
106
  onBlur: I,
106
107
  onClear: S,
107
- onKeydown: j(b, ["enter"])
108
- }), q({ _: 2 }, [
108
+ onKeydown: _(b, ["enter"])
109
+ }), j({ _: 2 }, [
109
110
  e.$slots.prefix ? {
110
111
  name: "prefix",
111
112
  fn: r(() => [
@@ -138,5 +139,5 @@ const J = F({
138
139
  }
139
140
  });
140
141
  export {
141
- J as default
142
+ H as _
142
143
  };
@@ -0,0 +1,171 @@
1
+ import { defineComponent as U, useAttrs as D, ref as v, computed as Q, watch as _, createBlock as j, openBlock as q, unref as x, mergeProps as G, withKeys as H, createSlots as J, withCtx as m, renderSlot as p } from "vue";
2
+ import { ElInput as L } from "element-plus";
3
+ const X = /* @__PURE__ */ U({
4
+ name: "QyMoneyInput",
5
+ inheritAttrs: !1,
6
+ __name: "index",
7
+ props: {
8
+ modelValue: { default: "" },
9
+ precision: { default: 2 },
10
+ min: { default: void 0 },
11
+ max: { default: void 0 },
12
+ allowNegative: { type: Boolean, default: !1 },
13
+ formatTrigger: { default: "blur" },
14
+ emptyValue: { default: "" }
15
+ },
16
+ emits: ["update:modelValue", "input", "change", "focus", "blur", "clear", "enter"],
17
+ setup(b, { expose: N, emit: $ }) {
18
+ const t = b, l = $, M = D(), a = v(null), s = v(o(t.modelValue)), k = Q(() => o(t.modelValue));
19
+ _(
20
+ () => t.modelValue,
21
+ (e) => {
22
+ s.value = o(e);
23
+ }
24
+ );
25
+ function o(e) {
26
+ return e == null ? "" : String(e);
27
+ }
28
+ function V(e) {
29
+ return Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 2;
30
+ }
31
+ function c(e) {
32
+ const n = o(e);
33
+ let i = "", f = !1, y = !1;
34
+ const h = V(t.precision);
35
+ for (let r = 0; r < n.length; r += 1) {
36
+ const u = n[r];
37
+ if (u >= "0" && u <= "9") {
38
+ i += u;
39
+ continue;
40
+ }
41
+ if (u === "." && h > 0 && !f) {
42
+ i += u, f = !0;
43
+ continue;
44
+ }
45
+ u === "-" && t.allowNegative && r === 0 && !y && (i += u, y = !0);
46
+ }
47
+ if (h > 0 && f) {
48
+ const [r, u = ""] = i.split(".");
49
+ return `${r}.${u.slice(0, h)}`;
50
+ }
51
+ return i;
52
+ }
53
+ function w(e) {
54
+ let n = e;
55
+ return typeof t.min == "number" && Number.isFinite(t.min) && (n = Math.max(n, t.min)), typeof t.max == "number" && Number.isFinite(t.max) && (n = Math.min(n, t.max)), n;
56
+ }
57
+ function g(e) {
58
+ const n = c(e);
59
+ if (!n || n === "-" || n === ".")
60
+ return o(t.emptyValue);
61
+ const i = Number(n);
62
+ if (Number.isNaN(i)) return o(t.emptyValue);
63
+ const f = V(t.precision);
64
+ return w(i).toFixed(f);
65
+ }
66
+ function d(e) {
67
+ s.value = e, l("update:modelValue", e);
68
+ }
69
+ function C(e) {
70
+ const n = c(e);
71
+ d(n);
72
+ }
73
+ function F(e) {
74
+ const n = c(e);
75
+ s.value = n, l("input", n);
76
+ }
77
+ function I(e) {
78
+ const n = t.formatTrigger === "change" ? g(e) : c(e);
79
+ n !== o(t.modelValue) && d(n), l("change", n);
80
+ }
81
+ function B(e) {
82
+ l("focus", e);
83
+ }
84
+ function z(e) {
85
+ if (t.formatTrigger === "blur") {
86
+ const n = g(s.value);
87
+ n !== o(t.modelValue) && d(n);
88
+ }
89
+ l("blur", e);
90
+ }
91
+ function A() {
92
+ const e = o(t.emptyValue);
93
+ s.value = e, l("update:modelValue", e), l("clear");
94
+ }
95
+ function S(e) {
96
+ l("enter", e);
97
+ }
98
+ function T() {
99
+ var e, n;
100
+ (n = (e = a.value) == null ? void 0 : e.focus) == null || n.call(e);
101
+ }
102
+ function E() {
103
+ var e, n;
104
+ (n = (e = a.value) == null ? void 0 : e.blur) == null || n.call(e);
105
+ }
106
+ function K() {
107
+ var e, n;
108
+ (n = (e = a.value) == null ? void 0 : e.select) == null || n.call(e);
109
+ }
110
+ function P() {
111
+ var e, n;
112
+ (n = (e = a.value) == null ? void 0 : e.clear) == null || n.call(e);
113
+ }
114
+ function R() {
115
+ var e;
116
+ return ((e = a.value) == null ? void 0 : e.input) || null;
117
+ }
118
+ return N({
119
+ focus: T,
120
+ blur: E,
121
+ select: K,
122
+ clear: P,
123
+ getNativeInput: R
124
+ }), (e, n) => (q(), j(x(L), G({
125
+ ref_key: "inputRef",
126
+ ref: a
127
+ }, x(M), {
128
+ "model-value": k.value,
129
+ inputmode: "decimal",
130
+ "onUpdate:modelValue": C,
131
+ onInput: F,
132
+ onChange: I,
133
+ onFocus: B,
134
+ onBlur: z,
135
+ onClear: A,
136
+ onKeydown: H(S, ["enter"])
137
+ }), J({ _: 2 }, [
138
+ e.$slots.prefix ? {
139
+ name: "prefix",
140
+ fn: m(() => [
141
+ p(e.$slots, "prefix")
142
+ ]),
143
+ key: "0"
144
+ } : void 0,
145
+ e.$slots.suffix ? {
146
+ name: "suffix",
147
+ fn: m(() => [
148
+ p(e.$slots, "suffix")
149
+ ]),
150
+ key: "1"
151
+ } : void 0,
152
+ e.$slots.prepend ? {
153
+ name: "prepend",
154
+ fn: m(() => [
155
+ p(e.$slots, "prepend")
156
+ ]),
157
+ key: "2"
158
+ } : void 0,
159
+ e.$slots.append ? {
160
+ name: "append",
161
+ fn: m(() => [
162
+ p(e.$slots, "append")
163
+ ]),
164
+ key: "3"
165
+ } : void 0
166
+ ]), 1040, ["model-value"]));
167
+ }
168
+ });
169
+ export {
170
+ X as _
171
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),q=require("element-plus"),E=t.defineComponent({name:"QyMoneyInput",inheritAttrs:!1,__name:"index",props:{modelValue:{default:""},precision:{default:2},min:{default:void 0},max:{default:void 0},allowNegative:{type:Boolean,default:!1},formatTrigger:{default:"blur"},emptyValue:{default:""}},emits:["update:modelValue","input","change","focus","blur","clear","enter"],setup(g,{expose:v,emit:y}){const u=g,i=y,b=t.useAttrs(),r=t.ref(null),f=t.ref(o(u.modelValue)),N=t.computed(()=>o(u.modelValue));t.watch(()=>u.modelValue,e=>{f.value=o(e)});function o(e){return e==null?"":String(e)}function h(e){return Number.isFinite(e)?Math.max(0,Math.floor(e)):2}function d(e){const n=o(e);let a="",c=!1,x=!1;const p=h(u.precision);for(let s=0;s<n.length;s+=1){const l=n[s];if(l>="0"&&l<="9"){a+=l;continue}if(l==="."&&p>0&&!c){a+=l,c=!0;continue}l==="-"&&u.allowNegative&&s===0&&!x&&(a+=l,x=!0)}if(p>0&&c){const[s,l=""]=a.split(".");return`${s}.${l.slice(0,p)}`}return a}function $(e){let n=e;return typeof u.min=="number"&&Number.isFinite(u.min)&&(n=Math.max(n,u.min)),typeof u.max=="number"&&Number.isFinite(u.max)&&(n=Math.min(n,u.max)),n}function V(e){const n=d(e);if(!n||n==="-"||n===".")return o(u.emptyValue);const a=Number(n);if(Number.isNaN(a))return o(u.emptyValue);const c=h(u.precision);return $(a).toFixed(c)}function m(e){f.value=e,i("update:modelValue",e)}function w(e){const n=d(e);m(n)}function C(e){const n=d(e);f.value=n,i("input",n)}function M(e){const n=u.formatTrigger==="change"?V(e):d(e);n!==o(u.modelValue)&&m(n),i("change",n)}function k(e){i("focus",e)}function F(e){if(u.formatTrigger==="blur"){const n=V(f.value);n!==o(u.modelValue)&&m(n)}i("blur",e)}function I(){const e=o(u.emptyValue);f.value=e,i("update:modelValue",e),i("clear")}function S(e){i("enter",e)}function B(){var e,n;(n=(e=r.value)==null?void 0:e.focus)==null||n.call(e)}function z(){var e,n;(n=(e=r.value)==null?void 0:e.blur)==null||n.call(e)}function A(){var e,n;(n=(e=r.value)==null?void 0:e.select)==null||n.call(e)}function P(){var e,n;(n=(e=r.value)==null?void 0:e.clear)==null||n.call(e)}function T(){var e;return((e=r.value)==null?void 0:e.input)||null}return v({focus:B,blur:z,select:A,clear:P,getNativeInput:T}),(e,n)=>(t.openBlock(),t.createBlock(t.unref(q.ElInput),t.mergeProps({ref_key:"inputRef",ref:r},t.unref(b),{"model-value":N.value,inputmode:"decimal","onUpdate:modelValue":w,onInput:C,onChange:M,onFocus:k,onBlur:F,onClear:I,onKeydown:t.withKeys(S,["enter"])}),t.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots.prepend?{name:"prepend",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prepend")]),key:"2"}:void 0,e.$slots.append?{name:"append",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"append")]),key:"3"}:void 0]),1040,["model-value"]))}});exports._sfc_main=E;
@@ -1,9 +1,8 @@
1
1
  import { ElDialog as ae, ElIcon as se } from "element-plus/es";
2
- import { defineComponent as re, mergeModels as W, useSlots as de, ref as d, computed as C, createVNode as v, useModel as ue, watchEffect as ce, useAttrs as me, h as Y, unref as s, onMounted as fe, nextTick as ge, onUnmounted as pe, resolveComponent as ye, createElementBlock as i, openBlock as n, withDirectives as ve, mergeProps as we, createSlots as he, withCtx as w, createElementVNode as t, normalizeStyle as $, normalizeClass as Z, createCommentVNode as u, renderSlot as h, toDisplayString as G, withModifiers as a, createBlock as J, vShow as xe } from "vue";
2
+ import { defineComponent as re, mergeModels as W, useSlots as de, ref as d, computed as C, createVNode as v, useModel as ue, watchEffect as ce, useAttrs as me, h as Y, unref as s, onMounted as fe, nextTick as ge, onUnmounted as ye, resolveComponent as pe, createElementBlock as i, openBlock as n, withDirectives as ve, mergeProps as we, createSlots as he, withCtx as w, createElementVNode as t, normalizeStyle as E, normalizeClass as Z, createCommentVNode as u, renderSlot as h, toDisplayString as G, withModifiers as a, createBlock as J, vShow as xe } from "vue";
3
3
  import _e from "clsx";
4
4
  import { ElButton as K } from "element-plus";
5
5
  import { useBreakpoints as be, useDraggable as ke } from "@vueuse/core";
6
- /* empty css */
7
6
  const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]" }, Ce = { key: 0 }, qe = { key: 1 }, Me = {
8
7
  key: 0,
9
8
  class: "icon-[material-symbols--square-outline-rounded]",
@@ -17,7 +16,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
17
16
  }, Ie = {
18
17
  key: 0,
19
18
  class: "fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"
20
- }, Be = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, De = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, Ee = { class: "flex items-center gap-2" }, $e = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, Ze = { class: "flex items-center gap-2" }, Q = 5, A = 2e3, Te = re({
19
+ }, Be = { class: "flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center" }, De = { class: "flex items-center justify-between w-full pl-1 pr-4 h-full ml-2" }, $e = { class: "flex items-center gap-2" }, Ee = { class: "text-sm text-gray-700 truncate max-w-[200px]" }, Ze = { class: "flex items-center gap-2" }, Q = 5, A = 2e3, Fe = /* @__PURE__ */ re({
21
20
  __name: "index",
22
21
  props: /* @__PURE__ */ W({
23
22
  layout: { type: [Array, String, Boolean], default: () => ["confirm", "cancel"] },
@@ -46,13 +45,13 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
46
45
  ConfirmButton: v(P)
47
46
  })), j = C(() => q.footer || l.layout !== !1), I = d(!1), g = d(
48
47
  l.showFullscreen && te ? !0 : l.fullscreen
49
- ), p = oe, B = ue(H, "modelValue");
48
+ ), y = oe, B = ue(H, "modelValue");
50
49
  ce(() => {
51
50
  B.value && (I.value = !1);
52
51
  }), ee({});
53
52
  const D = me(), c = `qy-dialog-${Math.random().toString(36).slice(2, 11)}`, m = d(!1), x = d(null);
54
53
  window.minimizedCount || (window.minimizedCount = 0);
55
- const { x: N, y: E } = ke(x, {
54
+ const { x: N, y: $ } = ke(x, {
56
55
  initialValue: {
57
56
  x: 5,
58
57
  y: window.innerHeight - 100 - (window.minimizedCount || 0) * 60
@@ -62,7 +61,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
62
61
  (e = x.value) == null || e.classList.add("dragging"), document.body.classList.add("qy-dialog--dragging"), N.value = Math.max(
63
62
  0,
64
63
  Math.min(window.innerWidth - 300, o.x)
65
- ), E.value = Math.max(
64
+ ), $.value = Math.max(
66
65
  0,
67
66
  Math.min(window.innerHeight - 50, o.y)
68
67
  );
@@ -72,7 +71,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
72
71
  (o = x.value) == null || o.classList.remove("dragging"), document.body.classList.remove("qy-dialog--dragging");
73
72
  }
74
73
  }), le = C(() => ({
75
- transform: `translate(${N.value}px, ${E.value}px)`,
74
+ transform: `translate(${N.value}px, ${$.value}px)`,
76
75
  willChange: "transform"
77
76
  }));
78
77
  function F(o) {
@@ -80,13 +79,13 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
80
79
  L.value = r <= Q, M.value = f - (r + b) <= Q;
81
80
  }
82
81
  function ne() {
83
- document.querySelector(`.${c}.el-dialog`).addEventListener("scroll", F), _(), p("opened");
82
+ document.querySelector(`.${c}.el-dialog`).addEventListener("scroll", F), _(), y("opened");
84
83
  }
85
84
  function T() {
86
85
  g.value = !g.value, _();
87
86
  }
88
- function y() {
89
- I.value || (I.value = !0, m.value = !1, B.value = !1, p("cancel"), p("close"));
87
+ function p() {
88
+ I.value || (I.value = !0, m.value = !1, B.value = !1, y("cancel"), y("close"));
90
89
  }
91
90
  function ie(o) {
92
91
  l.showFullscreen && o.detail >= 2 && T();
@@ -99,7 +98,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
99
98
  type: "primary",
100
99
  class: "dialog__footerBtn",
101
100
  onClick: () => {
102
- p("confirm"), p("ok");
101
+ y("confirm"), y("ok");
103
102
  }
104
103
  },
105
104
  () => s(l.confirmProps).title || "确 认"
@@ -108,7 +107,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
108
107
  function R() {
109
108
  return Y(
110
109
  K,
111
- { class: "dialog__footerBtn", onClick: () => y() },
110
+ { class: "dialog__footerBtn", onClick: () => p() },
112
111
  () => "取 消"
113
112
  );
114
113
  }
@@ -135,7 +134,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
135
134
  e.style.zIndex = k.toString(), r.style.zIndex = (k + 1).toString(), O.value = k + 1;
136
135
  });
137
136
  }
138
- pe(() => {
137
+ ye(() => {
139
138
  const o = document.querySelector(
140
139
  `.${c} .qy-dialog__wrapper-container`
141
140
  );
@@ -145,10 +144,10 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
145
144
  var e;
146
145
  m.value = !m.value;
147
146
  const o = (e = document.querySelector(`.${c}`)) == null ? void 0 : e.closest(".el-overlay");
148
- m.value ? (o.style.display = "none", window.minimizedCount++, E.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (o.style.display = "block", window.minimizedCount--, _());
147
+ m.value ? (o.style.display = "none", window.minimizedCount++, $.value = window.innerHeight - 50 - (window.minimizedCount || 0) * 60) : (o.style.display = "block", window.minimizedCount--, _());
149
148
  }
150
149
  return (o, e) => {
151
- const r = ye("Close"), f = se, b = ae;
150
+ const r = pe("Close"), f = se, b = ae;
152
151
  return n(), i("div", null, [
153
152
  v(b, we({
154
153
  ref: "dialogRef",
@@ -165,14 +164,14 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
165
164
  "show-close": !1,
166
165
  fullscreen: g.value,
167
166
  "z-index": O.value,
168
- onClosed: y,
167
+ onClosed: p,
169
168
  onOpened: ne,
170
169
  draggable: ""
171
170
  }, s(D)), he({
172
171
  header: w(() => [
173
172
  l.size === "default" ? (n(), i("div", {
174
173
  key: 0,
175
- style: $({
174
+ style: E({
176
175
  borderBottom: "1px solid",
177
176
  borderColor: L.value ? "transparent" : "var(--block-outline-color)",
178
177
  transition: "border-color .2s linear"
@@ -214,7 +213,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
214
213
  ], 32)) : u("", !0),
215
214
  t("div", {
216
215
  class: "qy-dialog__btn qy-dialog__btn--danger",
217
- onClick: a(y, ["stop"]),
216
+ onClick: a(p, ["stop"]),
218
217
  onMousedown: e[2] || (e[2] = a(() => {
219
218
  }, ["stop"]))
220
219
  }, e[5] || (e[5] = [
@@ -230,7 +229,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
230
229
  default: w(() => [
231
230
  t("div", {
232
231
  class: Z(["qy-dialog__wrapper", s(_e)(g.value && "qy-dialog__wrapper--fullscreen")]),
233
- style: $({
232
+ style: E({
234
233
  maxHeight: j.value ? "calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))" : "calc(100vh - var(--header-height) - var(--sides-gap))",
235
234
  padding: l.size === "small" ? "var(--small-content-padding)" : "var(--content-padding)"
236
235
  })
@@ -239,7 +238,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
239
238
  v(f, {
240
239
  size: 36,
241
240
  class: "cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",
242
- onClick: y
241
+ onClick: p
243
242
  }, {
244
243
  default: w(() => [
245
244
  v(r)
@@ -292,12 +291,12 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
292
291
  ref_key: "minimizedRef",
293
292
  ref: x,
294
293
  class: "fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",
295
- style: $([le.value, { width: "300px", height: "50px", "will-change": "transform" }])
294
+ style: E([le.value, { width: "300px", height: "50px", "will-change": "transform" }])
296
295
  }, [
297
296
  t("div", De, [
298
- t("div", Ee, [
297
+ t("div", $e, [
299
298
  e[6] || (e[6] = t("div", { class: "icon-[mdi--window-restore] text-gray-600" }, null, -1)),
300
- t("span", $e, G(s(D).title), 1)
299
+ t("span", Ee, G(s(D).title), 1)
301
300
  ]),
302
301
  t("div", Ze, [
303
302
  t("div", {
@@ -308,7 +307,7 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
308
307
  ])),
309
308
  t("div", {
310
309
  class: "p-1 hover:bg-red-100 rounded",
311
- onClick: a(y, ["stop"])
310
+ onClick: a(p, ["stop"])
312
311
  }, e[8] || (e[8] = [
313
312
  t("div", { class: "icon-[mdi--close] text-red-600" }, null, -1)
314
313
  ]))
@@ -322,5 +321,5 @@ const ze = { class: "text-lg flex items-center pt-2 pl-[var(--content-padding)]"
322
321
  }
323
322
  });
324
323
  export {
325
- Te as default
324
+ Fe as _
326
325
  };
@@ -0,0 +1 @@
1
+ "use strict";const Z=require("element-plus/es"),e=require("vue"),U=require("clsx"),A=require("element-plus"),H=require("@vueuse/core"),X={class:"text-lg flex items-center pt-2 pl-[var(--content-padding)]"},W={key:0},Y={key:1},G={key:0,class:"icon-[material-symbols--square-outline-rounded]",role:"img","aria-hidden":"true"},J={key:1,class:"icon-[tdesign--fullscreen-exit-1]",role:"img","aria-hidden":"true"},K={key:0,class:"fixed -right-12 top-2 h-9 w-9 hover:bg-gray-600/80 transition-all"},Q={class:"flex justify-between h-[var(--footer-height)] px-[var(--content-padding)] items-center"},ee={class:"flex items-center justify-between w-full pl-1 pr-4 h-full ml-2"},te={class:"flex items-center gap-2"},oe={class:"text-sm text-gray-700 truncate max-w-[200px]"},le={class:"flex items-center gap-2"},L=5,C=2e3,ne=e.defineComponent({__name:"index",props:e.mergeModels({layout:{type:[Array,String,Boolean],default:()=>["confirm","cancel"]},fullscreen:{type:Boolean,default:!1},showFullscreen:{type:Boolean,default:!1},confirmProps:{default:()=>({})},size:{default:"default"},zIndex:{default:2e3}},{modelValue:{default:!0},modelModifiers:{}}),emits:e.mergeModels(["confirm","cancel","close","opened","ok"],["update:modelValue"]),setup(E,{expose:O,emit:j}){const l=E,y=e.useSlots(),M=e.ref(!0),v=e.ref(!1),z=e.ref(C),F=H.useBreakpoints({mobile:0,tablet:640,laptop:1024,desktop:1280}).isSmaller("tablet"),w=e.computed(()=>{if(Array.isArray(l.layout))return l.layout;if(typeof l.layout=="string")return l.layout.split(",").map(o=>o.trim())}),B=e.computed(()=>({CancelButton:e.createVNode(I),ConfirmButton:e.createVNode(S)})),b=e.computed(()=>y.footer||l.layout!==!1),h=e.ref(!1),s=e.ref(l.showFullscreen&&F?!0:l.fullscreen),d=j,x=e.useModel(E,"modelValue");e.watchEffect(()=>{x.value&&(h.value=!1)}),O({});const k=e.useAttrs(),i=`qy-dialog-${Math.random().toString(36).slice(2,11)}`,a=e.ref(!1),u=e.ref(null);window.minimizedCount||(window.minimizedCount=0);const{x:V,y:_}=H.useDraggable(u,{initialValue:{x:5,y:window.innerHeight-100-(window.minimizedCount||0)*60},onMove(o){var t;(t=u.value)==null||t.classList.add("dragging"),document.body.classList.add("qy-dialog--dragging"),V.value=Math.max(0,Math.min(window.innerWidth-300,o.x)),_.value=Math.max(0,Math.min(window.innerHeight-50,o.y))},onEnd(){var o;(o=u.value)==null||o.classList.remove("dragging"),document.body.classList.remove("qy-dialog--dragging")}}),P=e.computed(()=>({transform:`translate(${V.value}px, ${_.value}px)`,willChange:"transform"}));function q(o){const t=o.target,{scrollTop:n,scrollHeight:r,clientHeight:f}=t;M.value=n<=L,v.value=r-(n+f)<=L}function T(){document.querySelector(`.${i}.el-dialog`).addEventListener("scroll",q),m(),d("opened")}function N(){s.value=!s.value,m()}function c(){h.value||(h.value=!0,a.value=!1,x.value=!1,d("cancel"),d("close"))}function R(o){l.showFullscreen&&o.detail>=2&&N()}function S(){return e.h(A.ElButton,{...e.unref(l.confirmProps),type:"primary",class:"dialog__footerBtn",onClick:()=>{d("confirm"),d("ok")}},()=>e.unref(l.confirmProps).title||"确 认")}function I(){return e.h(A.ElButton,{class:"dialog__footerBtn",onClick:()=>c()},()=>"取 消")}e.onMounted(()=>{typeof window.qyDialogMaxZIndex>"u"&&(window.qyDialogMaxZIndex=C),m()});function m(){var $;const o=Array.from(document.querySelectorAll(".el-overlay")).filter(p=>window.getComputedStyle(p).display!=="none"&&!p.classList.contains("is-message")),t=($=document.querySelector(`.${i}`))==null?void 0:$.closest(".el-overlay"),n=document.querySelector(`.${i}.el-dialog`);if(!t||!n)return;const r=C;window.qyDialogMaxZIndex=window.qyDialogMaxZIndex||r;const g=Math.max(window.qyDialogMaxZIndex,...o.map(p=>parseInt(window.getComputedStyle(p).zIndex||r.toString())))+2;window.qyDialogMaxZIndex=g,e.nextTick(()=>{t.style.zIndex=g.toString(),n.style.zIndex=(g+1).toString(),z.value=g+1})}e.onUnmounted(()=>{const o=document.querySelector(`.${i} .qy-dialog__wrapper-container`);o&&o.removeEventListener("scroll",q),a.value&&window.minimizedCount--});function D(){var t;a.value=!a.value;const o=(t=document.querySelector(`.${i}`))==null?void 0:t.closest(".el-overlay");a.value?(o.style.display="none",window.minimizedCount++,_.value=window.innerHeight-50-(window.minimizedCount||0)*60):(o.style.display="block",window.minimizedCount--,m())}return(o,t)=>{const n=e.resolveComponent("Close"),r=Z.ElIcon,f=Z.ElDialog;return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(f,e.mergeProps({ref:"dialogRef",class:["qy-dialog",[l.size==="small"&&"[&_.el-dialog__header]:!hidden",i]],"model-value":x.value,"align-center":"","append-to-body":"",style:{"--el-dialog-padding-primary":0},"show-close":!1,fullscreen:s.value,"z-index":z.value,onClosed:c,onOpened:T,draggable:""},e.unref(k)),e.createSlots({header:e.withCtx(()=>[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({borderBottom:"1px solid",borderColor:M.value?"transparent":"var(--block-outline-color)",transition:"border-color .2s linear"}),class:"flex justify-between h-[var(--header-height)]",onDblclick:R},[e.createElementVNode("div",X,[e.unref(y).header?e.unref(y).header?(e.openBlock(),e.createElementBlock("div",Y,[e.renderSlot(o.$slots,"header")])):e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(e.unref(k).title),1))]),e.createElementVNode("div",{class:"flex",onMousedown:t[3]||(t[3]=e.withModifiers(()=>{},["stop"]))},[l.size==="default"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(D,["stop"]),onMousedown:t[0]||(t[0]=e.withModifiers(()=>{},["stop"]))},t[4]||(t[4]=[e.createElementVNode("span",{class:"icon-[material-symbols--minimize] text-xl mb-3",role:"img","aria-hidden":"true"},null,-1)]),32)):e.createCommentVNode("",!0),l.showFullscreen?(e.openBlock(),e.createElementBlock("div",{key:1,class:"qy-dialog__btn qy-dialog__btn--default",onClick:e.withModifiers(N,["stop"]),onMousedown:t[1]||(t[1]=e.withModifiers(()=>{},["stop"]))},[s.value?(e.openBlock(),e.createElementBlock("span",J)):(e.openBlock(),e.createElementBlock("span",G))],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"qy-dialog__btn qy-dialog__btn--danger",onClick:e.withModifiers(c,["stop"]),onMousedown:t[2]||(t[2]=e.withModifiers(()=>{},["stop"]))},t[5]||(t[5]=[e.createElementVNode("span",{class:"icon-[ri--close-line] text-xl",role:"img","aria-hidden":"true"},null,-1)]),32)],32)],36)):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["qy-dialog__wrapper",e.unref(U)(s.value&&"qy-dialog__wrapper--fullscreen")]),style:e.normalizeStyle({maxHeight:b.value?"calc(100vh - var(--header-height) - var(--footer-height) - var(--sides-gap))":"calc(100vh - var(--header-height) - var(--sides-gap))",padding:l.size==="small"?"var(--small-content-padding)":"var(--content-padding)"})},[l.size==="small"?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(r,{size:36,class:"cursor-pointer text-gray-100 active:scale-75 rounded-sm transition-all",onClick:c},{default:e.withCtx(()=>[e.createVNode(n)]),_:1})])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default")],6)]),_:2},[!o.$slots.footer&&Array.isArray(w.value)?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createElementVNode("div",null,[e.renderSlot(o.$slots,"footer-left")]),e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer flex items-center justify-end"])},[w.value.includes("cancel")?(e.openBlock(),e.createBlock(I,{key:0})):e.createCommentVNode("",!0),w.value.includes("confirm")?(e.openBlock(),e.createBlock(S,{key:1})):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"footer-append")],2)])]),key:"0"}:b.value?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass([{"qy-dialog__footer--outline":v.value},"qy-dialog__footer px-[var(--content-padding)] min-h-[var(--footer-height)] flex items-center justify-end"])},[e.renderSlot(o.$slots,"footer",{layouts:B.value,layoutsNode:Object.values(B.value)})],2)]),key:"1"}:void 0]),1040,["class","model-value","fullscreen","z-index"]),e.withDirectives(e.createElementVNode("div",{ref_key:"minimizedRef",ref:u,class:"fixed left-0 top-0 bg-white rounded shadow-lg cursor-pointer z-[9999] hover:bg-gray-50",style:e.normalizeStyle([P.value,{width:"300px",height:"50px","will-change":"transform"}])},[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[t[6]||(t[6]=e.createElementVNode("div",{class:"icon-[mdi--window-restore] text-gray-600"},null,-1)),e.createElementVNode("span",oe,e.toDisplayString(e.unref(k).title),1)]),e.createElementVNode("div",le,[e.createElementVNode("div",{class:"p-1 hover:bg-gray-200 rounded",onClick:e.withModifiers(D,["stop"])},t[7]||(t[7]=[e.createElementVNode("div",{class:"icon-[mdi--window-maximize] text-gray-600"},null,-1)])),e.createElementVNode("div",{class:"p-1 hover:bg-red-100 rounded",onClick:e.withModifiers(c,["stop"])},t[8]||(t[8]=[e.createElementVNode("div",{class:"icon-[mdi--close] text-red-600"},null,-1)]))])])],4),[[e.vShow,a.value]])])}}});exports._sfc_main=ne;
@@ -1,8 +1,8 @@
1
- function u(r, i = r == null ? void 0 : r.name) {
1
+ function a(r, i = r == null ? void 0 : r.name) {
2
2
  return i && (r.install = (l) => {
3
3
  l.component(i, r);
4
4
  }), r;
5
5
  }
6
6
  export {
7
- u as withInstall
7
+ a as w
8
8
  };
@@ -0,0 +1 @@
1
+ "use strict";function s(i,l=i==null?void 0:i.name){return l&&(i.install=r=>{r.component(l,i)}),i}exports.withInstall=s;
@@ -0,0 +1 @@
1
+ "use strict";/*! js-cookie v3.0.5 | MIT */function d(r){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var p in f)r[p]=f[p]}return r}var g={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function s(r,c){function f(n,t,e){if(!(typeof document>"u")){e=d({},c,e),typeof e.expires=="number"&&(e.expires=new Date(Date.now()+e.expires*864e5)),e.expires&&(e.expires=e.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var i in e)e[i]&&(o+="; "+i,e[i]!==!0&&(o+="="+e[i].split(";")[0]));return document.cookie=n+"="+r.write(t,n)+o}}function p(n){if(!(typeof document>"u"||arguments.length&&!n)){for(var t=document.cookie?document.cookie.split("; "):[],e={},o=0;o<t.length;o++){var i=t[o].split("="),v=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(e[u]=r.read(v,u),n===u)break}catch{}}return n?e[n]:e}}return Object.create({set:f,get:p,remove:function(n,t){f(n,"",d({},t,{expires:-1}))},withAttributes:function(n){return s(this.converter,d({},this.attributes,n))},withConverter:function(n){return s(d({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(c)},converter:{value:Object.freeze(r)}})}var C=s(g,{path:"/"});exports.api=C;