@qynpm/ui 1.0.28 → 1.0.29
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 +88 -0
- package/dist/index.cjs +6 -3
- package/dist/index.mjs +80 -61
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-aside/index.cjs +1 -0
- package/dist/qy-aside/index.mjs +7 -0
- package/dist/qy-button/index.cjs +1 -1
- package/dist/qy-button/index.mjs +1 -1
- package/dist/qy-cascader/index.cjs +1 -1
- package/dist/qy-cascader/index.mjs +1 -1
- package/dist/qy-col/index.cjs +1 -0
- package/dist/qy-col/index.mjs +7 -0
- package/dist/qy-collapse/index.cjs +1 -1
- package/dist/qy-collapse/index.mjs +1 -1
- package/dist/qy-container/index.cjs +1 -0
- package/dist/qy-container/index.mjs +7 -0
- package/dist/qy-date-picker/index.cjs +1 -1
- package/dist/qy-date-picker/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-dropdown/index.cjs +1 -1
- package/dist/qy-dropdown/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +2 -2
- package/dist/qy-fullscreen/index.cjs +1 -0
- package/dist/qy-fullscreen/index.mjs +7 -0
- package/dist/qy-icon/index.cjs +1 -0
- package/dist/qy-icon/index.mjs +11 -0
- package/dist/qy-icon-picker/index.cjs +5 -0
- package/dist/qy-icon-picker/index.mjs +11 -0
- package/dist/qy-image/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 +1 -1
- package/dist/qy-input/index.mjs +4 -5
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/index.mjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
- package/dist/qy-link/index.cjs +1 -1
- package/dist/qy-link/index.mjs +1 -1
- package/dist/qy-main/index.cjs +1 -0
- package/dist/qy-main/index.mjs +7 -0
- package/dist/qy-menu-actions/index.cjs +1 -1
- package/dist/qy-menu-actions/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +1 -1
- package/dist/qy-popover/index.cjs +1 -1
- package/dist/qy-popover/index.mjs +1 -1
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-row/index.cjs +1 -0
- package/dist/qy-row/index.mjs +7 -0
- package/dist/qy-scrollbar/index.cjs +1 -1
- package/dist/qy-scrollbar/index.mjs +1 -1
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-select/index.cjs +1 -1
- package/dist/qy-select/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-statistic/index.cjs +1 -0
- package/dist/qy-statistic/index.mjs +7 -0
- package/dist/qy-tabs/index.cjs +1 -1
- package/dist/qy-tabs/index.mjs +1 -1
- package/dist/qy-tooltip/index.cjs +1 -1
- package/dist/qy-tooltip/index.mjs +1 -1
- package/dist/qy-tree/index.cjs +1 -1
- package/dist/qy-tree/index.mjs +1 -1
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +1 -1
- package/dist/shared/index-4cLP6sJP.cjs +1 -0
- package/dist/shared/index-AirHUQwm.cjs +1 -0
- package/dist/shared/index-B6xIO6kg.cjs +1 -0
- package/dist/shared/index-BNQxyXzB.cjs +1 -0
- package/dist/shared/{index-DleLvEzf.mjs → index-BQj_q6rA.mjs} +998 -972
- package/dist/shared/{index-CVoiIRas.mjs → index-BSxEaYHx.mjs} +1 -1
- package/dist/shared/{index-BTL45WYB.cjs → index-Bs6yjkZ5.cjs} +1 -1
- package/dist/shared/{index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs → index-C2n0R6rA.mjs} +33 -31
- package/dist/shared/{index-CYn7TvRx.mjs → index-CR6yQfR2.mjs} +1 -1
- package/dist/shared/index-CaNxcPSD.mjs +254 -0
- package/dist/shared/index-Czrv5jUt.mjs +222 -0
- package/dist/shared/{index-DEkng5wh.cjs → index-YM4DcbBZ.cjs} +1 -1
- package/dist/shared/index-qwzyfx9S.cjs +1 -0
- package/dist/shared/index-xuTVtF4x.mjs +6 -0
- package/dist/shared/index.vue_vue_type_script_lang-8AT3-xU-.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-BaIOvoQn.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_lang-BgapsQjI.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-Bk0kLg5l.mjs +34 -0
- package/dist/shared/index.vue_vue_type_script_lang-BnmY1ndj.mjs +77 -0
- package/dist/shared/index.vue_vue_type_script_lang-By3jd4gw.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CCL57H5c.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CKZUcaZ5.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-CWnNQBPN.mjs +31 -0
- package/dist/shared/index.vue_vue_type_script_lang-CfjfZCT3.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_lang-ChS-3_vl.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_lang-DRvk4-_O.mjs +43 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BXnZt9UT.mjs +63 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-D7BlbHN5.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BJXS2dVf.mjs +126 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BTqKOZ4L.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Bc-Ya_zS.mjs +286 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-M0qKRXd2.cjs +1 -0
- package/index.d.ts +101 -0
- package/package.json +55 -1
- package/qy-aside/index.d.ts +47 -0
- package/qy-col/index.d.ts +65 -0
- package/qy-container/index.d.ts +49 -0
- package/qy-fullscreen/index.d.ts +72 -0
- package/qy-icon/index.d.ts +105 -0
- package/qy-icon-picker/index.d.ts +56 -0
- package/qy-main/index.d.ts +45 -0
- package/qy-row/index.d.ts +59 -0
- package/qy-statistic/index.d.ts +61 -0
- package/dist/shared/index-B8phg478.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-CmQLfhRo.cjs +0 -1
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DobP199g.mjs +0 -63
- package/dist/shared/index.vue_vue_type_style_index_0_lang-C6urLjSf.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CVxWn-Vs.mjs +0 -121
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Dm1r1WBK.cjs +0 -1
- /package/dist/shared/{index-CpvFUems.cjs → index-C509sCx9.cjs} +0 -0
- /package/dist/shared/{index-DEZF-Fkt.mjs → index-CtF8Nz3g.mjs} +0 -0
- /package/dist/shared/{index-seQHtqdh.mjs → index-D0L-u1nt.mjs} +0 -0
- /package/dist/shared/{index-DIs6iPjF.cjs → index-D30m6gKz.cjs} +0 -0
- /package/dist/shared/{index-BDdhBEFr.cjs → index-D7A0RzWH.cjs} +0 -0
- /package/dist/shared/{index-hEy-3mcr.mjs → index-DJT4yz0h.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CWz689KH.cjs → index.vue_vue_type_style_index_0_lang-1cTut9Ql.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DVqGYfD9.mjs → index.vue_vue_type_style_index_0_lang-B0CXLnL1.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DOfJV2oz.cjs → index.vue_vue_type_style_index_0_lang-CC2-igG3.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-B-FeHatv.mjs → index.vue_vue_type_style_index_0_lang-CJaF7Ecm.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DIMCVnQm.mjs → index.vue_vue_type_style_index_0_lang-CPxbKjvY.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CJhIFeBC.mjs → index.vue_vue_type_style_index_0_lang-CcVf5MXE.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Cn3P9d4L.cjs → index.vue_vue_type_style_index_0_lang-CqKs13Fp.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-CnL4aeg1.cjs → index.vue_vue_type_style_index_0_lang-D9DraThL.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Cb4yMk-r.cjs → index.vue_vue_type_style_index_0_lang-DFAaBzkW.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-D1kpIund.mjs → index.vue_vue_type_style_index_0_lang-DSur831A.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-BXTkWo5P.cjs → index.vue_vue_type_style_index_0_lang-DUgOOzEZ.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-C1n-zAZh.mjs → index.vue_vue_type_style_index_0_lang-DWiolYb3.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-DzfGx6ce.mjs → index.vue_vue_type_style_index_0_lang-Dc84vYSd.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-BtbAft4t.cjs → index.vue_vue_type_style_index_0_lang-DccRGtZE.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-Q2gFF0PP.cjs → index.vue_vue_type_style_index_0_lang-RiwA2WPO.cjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_style_index_0_lang-dLpQXf6x.mjs → index.vue_vue_type_style_index_0_lang-gs0YJI91.mjs} +0 -0
|
@@ -219,7 +219,7 @@ const de = /* @__PURE__ */ D({
|
|
|
219
219
|
} : void 0
|
|
220
220
|
]), 1040, ["model-value", "placeholder", "disabled", "clearable", "filterable", "loading", "multiple", "collapse-tags", "collapse-tags-tooltip", "size", "teleported", "fit-input-width", "popper-class", "append-to", "value-key"]));
|
|
221
221
|
}
|
|
222
|
-
}), me = /* @__PURE__ */ se(de, [["__scopeId", "data-v-
|
|
222
|
+
}), me = /* @__PURE__ */ se(de, [["__scopeId", "data-v-722db6dd"]]);
|
|
223
223
|
export {
|
|
224
224
|
me as S
|
|
225
225
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),h=require("element-plus"),L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=t.defineComponent({name:"QySelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Object,Array,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},objectIdentityKey:{default:void 0},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!1},loading:{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:void 0},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:S,emit:V}){const u=Symbol("invalid-select-value"),a=o,r=V,B=t.useAttrs(),A=t.useSlots(),f=t.ref(null),C=t.computed(()=>Object.fromEntries(Object.entries(B).filter(([e])=>e==="class"||e==="style"||e==="id"||e==="name"||e==="role"||e==="title"||e==="tabindex"||e==="remote"||e==="remoteMethod"||e==="remote-method"||e==="debounce"||e==="remoteShowSuffix"||e==="remote-show-suffix"||e.startsWith("data-")||e.startsWith("aria-")))),K=t.computed(()=>["qy-select__popper",a.popperClass].filter(Boolean).join(" ")),g=t.computed(()=>{const e=b(a.modelValue);return e===u?void 0:e}),d=t.computed(()=>a.options.map(e=>({raw:e,label:I(e),value:O(e),disabled:!!e[a.disabledKey]}))),p=t.computed(()=>{const e=A.default;return e?e().some(v):!1}),j=t.computed(()=>{if(!a.objectIdentityKey)return;const e=g.value,l=Array.isArray(e)?e.some(c):c(e),n=!p.value&&d.value.some(s=>c(s.value));return l||n?a.objectIdentityKey:void 0});function v(e){return e.type===t.Comment?!1:e.type===t.Text?typeof e.children=="string"&&e.children.trim()!=="":e.type!==t.Fragment||!Array.isArray(e.children)?!0:e.children.some(l=>t.isVNode(l)?v(l):typeof l=="string"?l.trim()!=="":l!=null)}function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function m(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||c(e)?e:u}function b(e){if(e==null)return e;if(Array.isArray(e)){const l=e;return l.every(n=>m(n)!==u)?l:u}return m(e)}function I(e){const l=e[a.labelKey]??e.label??e.value??"";return typeof l=="string"||typeof l=="number"?l:typeof l=="boolean"?String(l):""}function O(e){const l=e[a.valueKey]??e.value??e.label,n=m(l);return n===u?void 0:n}function w(e){return Array.isArray(e)?e.length===0:e===""||e===null||e===void 0}let i=null;t.watch([d,()=>a.modelValue,()=>a.autoSelectSingle,()=>a.disabled,()=>a.multiple],([e])=>y(e),{flush:"post"}),t.onMounted(()=>y(d.value)),t.onUpdated(()=>y(d.value));function y(e){if(!w(a.modelValue)){i=null;return}if(!a.autoSelectSingle||a.disabled||p.value||e.length!==1)return;const[l]=e;if(l.disabled||l.value===void 0)return;const n=x(l.value);if(i&&i.identityKey===a.objectIdentityKey&&i.multiple===a.multiple&&Object.is(i.candidate,n))return;i={candidate:n,identityKey:a.objectIdentityKey,multiple:a.multiple};const s=a.multiple?[l.value]:l.value;r("update:modelValue",s),r("change",s)}function x(e){return!c(e)||!a.objectIdentityKey?e:e[a.objectIdentityKey]??e}function $(e,l){return`${String(e.value??e.label??"")}-${l}`}function T(e){const l=b(e);l!==u&&r("update:modelValue",l)}function z(e){const l=b(e);l!==u&&r("change",l)}function E(){r("clear")}function q(e){r("visible-change",e)}function M(e){r("focus",e)}function P(e){r("blur",e)}function F(){var e,l;(l=(e=f.value)==null?void 0:e.focus)==null||l.call(e)}function H(){var e,l;(l=(e=f.value)==null?void 0:e.blur)==null||l.call(e)}return S({focus:F,blur:H}),(e,l)=>(t.openBlock(),t.createBlock(t.unref(h.ElSelect),t.mergeProps({ref_key:"selectRef",ref:f,class:"qy-select"},C.value,{"model-value":g.value,placeholder:o.placeholder,disabled:o.disabled,clearable:o.clearable,filterable:o.filterable,loading:o.loading,multiple:o.multiple,"collapse-tags":o.collapseTags,"collapse-tags-tooltip":o.collapseTagsTooltip,size:o.size,teleported:o.teleported,"fit-input-width":o.fitInputWidth,"popper-class":K.value,"append-to":o.appendTo,"value-key":j.value,"onUpdate:modelValue":T,onChange:z,onClear:E,onVisibleChange:q,onFocus:M,onBlur:P}),t.createSlots({default:t.withCtx(()=>[p.value?t.renderSlot(e.$slots,"default",{},void 0,!0,0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(d.value,(n,s)=>(t.openBlock(),t.createBlock(t.unref(h.ElOption),{key:$(n,s),label:n.label,value:n.value,disabled:n.disabled},null,8,["label","value","disabled"]))),128))]),_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix",{},void 0,!0)]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"empty",{},void 0,!0)]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"loading",{},void 0,!0)]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:t.withCtx(n=>[t.renderSlot(e.$slots,"tag",t.normalizeProps(t.guardReactiveProps(n)),void 0,!0)]),key:"3"}:void 0]),1040,["model-value","placeholder","disabled","clearable","filterable","loading","multiple","collapse-tags","collapse-tags-tooltip","size","teleported","fit-input-width","popper-class","append-to","value-key"]))}}),W=L._export_sfc(U,[["__scopeId","data-v-
|
|
1
|
+
"use strict";const t=require("vue"),h=require("element-plus"),L=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=t.defineComponent({name:"QySelect",inheritAttrs:!1,__name:"index",props:{modelValue:{type:[String,Number,Boolean,Object,Array,null],default:void 0},options:{default:()=>[]},labelKey:{default:"label"},valueKey:{default:"value"},objectIdentityKey:{default:void 0},disabledKey:{default:"disabled"},placeholder:{default:"请选择"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},filterable:{type:Boolean,default:!1},loading:{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:void 0},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:S,emit:V}){const u=Symbol("invalid-select-value"),a=o,r=V,B=t.useAttrs(),A=t.useSlots(),f=t.ref(null),C=t.computed(()=>Object.fromEntries(Object.entries(B).filter(([e])=>e==="class"||e==="style"||e==="id"||e==="name"||e==="role"||e==="title"||e==="tabindex"||e==="remote"||e==="remoteMethod"||e==="remote-method"||e==="debounce"||e==="remoteShowSuffix"||e==="remote-show-suffix"||e.startsWith("data-")||e.startsWith("aria-")))),K=t.computed(()=>["qy-select__popper",a.popperClass].filter(Boolean).join(" ")),g=t.computed(()=>{const e=b(a.modelValue);return e===u?void 0:e}),d=t.computed(()=>a.options.map(e=>({raw:e,label:I(e),value:O(e),disabled:!!e[a.disabledKey]}))),p=t.computed(()=>{const e=A.default;return e?e().some(v):!1}),j=t.computed(()=>{if(!a.objectIdentityKey)return;const e=g.value,l=Array.isArray(e)?e.some(c):c(e),n=!p.value&&d.value.some(s=>c(s.value));return l||n?a.objectIdentityKey:void 0});function v(e){return e.type===t.Comment?!1:e.type===t.Text?typeof e.children=="string"&&e.children.trim()!=="":e.type!==t.Fragment||!Array.isArray(e.children)?!0:e.children.some(l=>t.isVNode(l)?v(l):typeof l=="string"?l.trim()!=="":l!=null)}function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function m(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||c(e)?e:u}function b(e){if(e==null)return e;if(Array.isArray(e)){const l=e;return l.every(n=>m(n)!==u)?l:u}return m(e)}function I(e){const l=e[a.labelKey]??e.label??e.value??"";return typeof l=="string"||typeof l=="number"?l:typeof l=="boolean"?String(l):""}function O(e){const l=e[a.valueKey]??e.value??e.label,n=m(l);return n===u?void 0:n}function w(e){return Array.isArray(e)?e.length===0:e===""||e===null||e===void 0}let i=null;t.watch([d,()=>a.modelValue,()=>a.autoSelectSingle,()=>a.disabled,()=>a.multiple],([e])=>y(e),{flush:"post"}),t.onMounted(()=>y(d.value)),t.onUpdated(()=>y(d.value));function y(e){if(!w(a.modelValue)){i=null;return}if(!a.autoSelectSingle||a.disabled||p.value||e.length!==1)return;const[l]=e;if(l.disabled||l.value===void 0)return;const n=x(l.value);if(i&&i.identityKey===a.objectIdentityKey&&i.multiple===a.multiple&&Object.is(i.candidate,n))return;i={candidate:n,identityKey:a.objectIdentityKey,multiple:a.multiple};const s=a.multiple?[l.value]:l.value;r("update:modelValue",s),r("change",s)}function x(e){return!c(e)||!a.objectIdentityKey?e:e[a.objectIdentityKey]??e}function $(e,l){return`${String(e.value??e.label??"")}-${l}`}function T(e){const l=b(e);l!==u&&r("update:modelValue",l)}function z(e){const l=b(e);l!==u&&r("change",l)}function E(){r("clear")}function q(e){r("visible-change",e)}function M(e){r("focus",e)}function P(e){r("blur",e)}function F(){var e,l;(l=(e=f.value)==null?void 0:e.focus)==null||l.call(e)}function H(){var e,l;(l=(e=f.value)==null?void 0:e.blur)==null||l.call(e)}return S({focus:F,blur:H}),(e,l)=>(t.openBlock(),t.createBlock(t.unref(h.ElSelect),t.mergeProps({ref_key:"selectRef",ref:f,class:"qy-select"},C.value,{"model-value":g.value,placeholder:o.placeholder,disabled:o.disabled,clearable:o.clearable,filterable:o.filterable,loading:o.loading,multiple:o.multiple,"collapse-tags":o.collapseTags,"collapse-tags-tooltip":o.collapseTagsTooltip,size:o.size,teleported:o.teleported,"fit-input-width":o.fitInputWidth,"popper-class":K.value,"append-to":o.appendTo,"value-key":j.value,"onUpdate:modelValue":T,onChange:z,onClear:E,onVisibleChange:q,onFocus:M,onBlur:P}),t.createSlots({default:t.withCtx(()=>[p.value?t.renderSlot(e.$slots,"default",{},void 0,!0,0):(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(d.value,(n,s)=>(t.openBlock(),t.createBlock(t.unref(h.ElOption),{key:$(n,s),label:n.label,value:n.value,disabled:n.disabled},null,8,["label","value","disabled"]))),128))]),_:2},[e.$slots.prefix?{name:"prefix",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"prefix",{},void 0,!0)]),key:"0"}:void 0,e.$slots.empty?{name:"empty",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"empty",{},void 0,!0)]),key:"1"}:void 0,e.$slots.loading?{name:"loading",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"loading",{},void 0,!0)]),key:"2"}:void 0,e.$slots.tag?{name:"tag",fn:t.withCtx(n=>[t.renderSlot(e.$slots,"tag",t.normalizeProps(t.guardReactiveProps(n)),void 0,!0)]),key:"3"}:void 0]),1040,["model-value","placeholder","disabled","clearable","filterable","loading","multiple","collapse-tags","collapse-tags-tooltip","size","teleported","fit-input-width","popper-class","append-to","value-key"]))}}),W=L._export_sfc(U,[["__scopeId","data-v-722db6dd"]]);exports.Select=W;
|
package/dist/shared/{index.vue_vue_type_style_index_0_lang-aqtfjdVm.mjs → index-C2n0R6rA.mjs}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { w as A } from "./install-CxBnxbuN.mjs";
|
|
2
|
+
import { defineComponent as E, useAttrs as F, ref as c, computed as K, watch as R, openBlock as U, createBlock as P, unref as v, mergeProps as _, withKeys as j, createSlots as D, withCtx as f, renderSlot as d } from "vue";
|
|
3
|
+
import { ElInput as G } from "element-plus";
|
|
4
|
+
const H = /* @__PURE__ */ E({
|
|
4
5
|
name: "QyInput",
|
|
5
6
|
inheritAttrs: !1,
|
|
6
7
|
__name: "index",
|
|
@@ -22,27 +23,27 @@ const J = /* @__PURE__ */ E({
|
|
|
22
23
|
function r(e) {
|
|
23
24
|
return e == null ? "" : String(e);
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function I(e) {
|
|
26
27
|
return u.removeSpace ? e.replace(/\s+/g, "") : e;
|
|
27
28
|
}
|
|
28
29
|
function m(e, n) {
|
|
29
30
|
return u.trimMode !== n ? e : e.trim();
|
|
30
31
|
}
|
|
31
32
|
function p(e) {
|
|
32
|
-
return
|
|
33
|
+
return I(r(e));
|
|
33
34
|
}
|
|
34
35
|
function s(e) {
|
|
35
36
|
o.value = e, i.value = e, t("update:modelValue", e);
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
+
function $(e) {
|
|
38
39
|
const n = p(e);
|
|
39
40
|
s(n), a.value = n === "" ? "updated" : "none";
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function k(e) {
|
|
42
43
|
const n = p(e);
|
|
43
44
|
o.value = n, t("input", n);
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
+
function S(e) {
|
|
46
47
|
const n = m(p(e), "change");
|
|
47
48
|
if (o.value = n, n === "" && a.value === "updated") {
|
|
48
49
|
a.value = "changed", t("change", n);
|
|
@@ -50,20 +51,20 @@ const J = /* @__PURE__ */ E({
|
|
|
50
51
|
}
|
|
51
52
|
n !== i.value && s(n), a.value = n === "" ? "changed" : "none", t("change", n);
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function w(e) {
|
|
54
55
|
t("focus", e);
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function C(e) {
|
|
57
58
|
const n = m(o.value, "blur");
|
|
58
59
|
o.value = n, n !== i.value && s(n), t("blur", e);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function b() {
|
|
61
62
|
a.value === "none" ? (s(""), t("change", "")) : a.value === "updated" && (a.value = "changed", t("change", "")), a.value = "cleared", t("clear");
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function z(e) {
|
|
64
65
|
t("enter", e);
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function B() {
|
|
67
68
|
var e, n;
|
|
68
69
|
(n = (e = l.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
69
70
|
}
|
|
@@ -71,39 +72,39 @@ const J = /* @__PURE__ */ E({
|
|
|
71
72
|
var e, n;
|
|
72
73
|
(n = (e = l.value) == null ? void 0 : e.blur) == null || n.call(e);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function Q() {
|
|
75
76
|
var e, n;
|
|
76
77
|
(n = (e = l.value) == null ? void 0 : e.select) == null || n.call(e);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function T() {
|
|
79
80
|
var e, n;
|
|
80
81
|
(n = (e = l.value) == null ? void 0 : e.clear) == null || n.call(e);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function q() {
|
|
83
84
|
var e, n;
|
|
84
85
|
(n = (e = l.value) == null ? void 0 : e.resizeTextarea) == null || n.call(e);
|
|
85
86
|
}
|
|
86
87
|
return V({
|
|
87
88
|
// 暴露 Element Plus 常用输入框方法,方便业务弹窗做聚焦、选中和 textarea 重算高度。
|
|
88
|
-
focus:
|
|
89
|
+
focus: B,
|
|
89
90
|
blur: M,
|
|
90
|
-
select:
|
|
91
|
-
clear:
|
|
92
|
-
resizeTextarea:
|
|
93
|
-
}), (e, n) => (U(), P(v(
|
|
91
|
+
select: Q,
|
|
92
|
+
clear: T,
|
|
93
|
+
resizeTextarea: q
|
|
94
|
+
}), (e, n) => (U(), P(v(G), _({
|
|
94
95
|
ref_key: "inputRef",
|
|
95
96
|
ref: l,
|
|
96
97
|
class: "qy-input"
|
|
97
98
|
}, v(y), {
|
|
98
99
|
"model-value": x.value,
|
|
99
|
-
"onUpdate:modelValue":
|
|
100
|
-
onInput:
|
|
101
|
-
onChange:
|
|
102
|
-
onFocus:
|
|
103
|
-
onBlur:
|
|
104
|
-
onClear:
|
|
105
|
-
onKeydown:
|
|
106
|
-
}),
|
|
100
|
+
"onUpdate:modelValue": $,
|
|
101
|
+
onInput: k,
|
|
102
|
+
onChange: S,
|
|
103
|
+
onFocus: w,
|
|
104
|
+
onBlur: C,
|
|
105
|
+
onClear: b,
|
|
106
|
+
onKeydown: j(z, ["enter"])
|
|
107
|
+
}), D({ _: 2 }, [
|
|
107
108
|
e.$slots.prefix ? {
|
|
108
109
|
name: "prefix",
|
|
109
110
|
fn: f(() => [
|
|
@@ -134,7 +135,8 @@ const J = /* @__PURE__ */ E({
|
|
|
134
135
|
} : void 0
|
|
135
136
|
]), 1040, ["model-value"]));
|
|
136
137
|
}
|
|
137
|
-
});
|
|
138
|
+
}), O = A(H, "QyInput");
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
O as Q,
|
|
141
|
+
H as _
|
|
140
142
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { _ as D } from "./index.vue_vue_type_style_index_0_lang-BJXS2dVf.mjs";
|
|
3
3
|
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const N = { class: "qy-menu-actions__panel" }, U = ["disabled", "data-action-key", "onClick"], W = {
|
|
5
5
|
key: 0,
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { defineComponent as L, useAttrs as P, useSlots as q, inject as B, computed as u, markRaw as T, toRaw as V, ref as M, watchEffect as k, openBlock as h, createElementBlock as I, mergeProps as W, unref as E, createBlock as S, resolveDynamicComponent as j, createElementVNode as Y, normalizeClass as F, renderSlot as Z, normalizeProps as G, guardReactiveProps as H, createCommentVNode as J } from "vue";
|
|
2
|
+
import { _ as U } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
3
|
+
const A = Symbol("QyIconRegistry"), _ = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function X(e) {
|
|
5
|
+
const t = [], n = /* @__PURE__ */ new Map();
|
|
6
|
+
for (const s of (e == null ? void 0 : e.icons) ?? []) {
|
|
7
|
+
const o = g(s == null ? void 0 : s.name);
|
|
8
|
+
if (!o)
|
|
9
|
+
throw new Error("QyIcon definition name must not be empty.");
|
|
10
|
+
const l = d(o);
|
|
11
|
+
if (n.has(l))
|
|
12
|
+
throw new Error(`Duplicate icon name "${o}".`);
|
|
13
|
+
const i = te(s, o);
|
|
14
|
+
t.push(i), n.set(l, i);
|
|
15
|
+
}
|
|
16
|
+
const a = [], c = /* @__PURE__ */ new Map();
|
|
17
|
+
for (const s of ee(e == null ? void 0 : e.aliases)) {
|
|
18
|
+
const o = g(s.name), l = g(s.target), i = d(o), v = d(l);
|
|
19
|
+
if (!o)
|
|
20
|
+
throw new Error("QyIcon alias name must not be empty.");
|
|
21
|
+
if (!l)
|
|
22
|
+
throw new Error(`QyIcon alias "${o}" target must not be empty.`);
|
|
23
|
+
if (n.has(i))
|
|
24
|
+
throw new Error(`Icon alias "${o}" conflicts with a canonical icon name.`);
|
|
25
|
+
if (c.has(i))
|
|
26
|
+
throw new Error(`Duplicate icon alias "${o}".`);
|
|
27
|
+
const m = n.get(v);
|
|
28
|
+
if (!m)
|
|
29
|
+
throw new Error(`Icon alias "${o}" target "${l}" not found.`);
|
|
30
|
+
c.set(i, d(m.name)), a.push(Object.freeze({ name: o, target: m.name }));
|
|
31
|
+
}
|
|
32
|
+
const b = Object.freeze({
|
|
33
|
+
definitions: Object.freeze(t),
|
|
34
|
+
aliases: Object.freeze(a),
|
|
35
|
+
byName: n,
|
|
36
|
+
aliasTargets: c
|
|
37
|
+
}), f = Object.freeze({
|
|
38
|
+
resolve(s) {
|
|
39
|
+
const o = d(g(s)), l = c.get(o) ?? o, i = n.get(l);
|
|
40
|
+
return i ? O(i) : void 0;
|
|
41
|
+
},
|
|
42
|
+
has(s) {
|
|
43
|
+
const o = d(g(s));
|
|
44
|
+
return n.has(c.get(o) ?? o);
|
|
45
|
+
},
|
|
46
|
+
list() {
|
|
47
|
+
return Object.freeze(t.map(O));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return _.set(f, b), f;
|
|
51
|
+
}
|
|
52
|
+
function ue(...e) {
|
|
53
|
+
const t = [], n = [];
|
|
54
|
+
for (const a of e) {
|
|
55
|
+
const c = _.get(a);
|
|
56
|
+
if (!c)
|
|
57
|
+
throw new TypeError("mergeQyIconRegistries accepts only QyIcon registries created by this package.");
|
|
58
|
+
t.push(...c.definitions), n.push(...c.aliases);
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
return X({ icons: t, aliases: n });
|
|
62
|
+
} catch (a) {
|
|
63
|
+
const c = a instanceof Error ? a.message : String(a);
|
|
64
|
+
throw new Error(`Icon registry merge conflict: ${c}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function fe(e) {
|
|
68
|
+
if (!_.has(e))
|
|
69
|
+
throw new TypeError("createQyIconPlugin accepts only a QyIcon registry created by this package.");
|
|
70
|
+
return Object.freeze({
|
|
71
|
+
install(t) {
|
|
72
|
+
t.provide(A, e);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function g(e) {
|
|
77
|
+
const t = typeof e == "string" || typeof e == "number" ? String(e).trim() : "";
|
|
78
|
+
if (!t) return "";
|
|
79
|
+
const n = /^#icon-(.+)$/i.exec(t);
|
|
80
|
+
if (n) return n[1].trim();
|
|
81
|
+
const a = /^icon-\[([^\[\]]+?)--([^\[\]]+?)\]$/i.exec(t);
|
|
82
|
+
return a ? `iconify:${a[1]}:${a[2]}` : t;
|
|
83
|
+
}
|
|
84
|
+
function d(e) {
|
|
85
|
+
return e.toLocaleLowerCase();
|
|
86
|
+
}
|
|
87
|
+
function ee(e) {
|
|
88
|
+
return e ? Array.isArray(e) ? [...e] : Object.entries(e).map(([t, n]) => ({ name: t, target: n })) : [];
|
|
89
|
+
}
|
|
90
|
+
function te(e, t) {
|
|
91
|
+
const n = {
|
|
92
|
+
...e.label === void 0 ? {} : { label: re(e.label, t) },
|
|
93
|
+
...e.keywords === void 0 ? {} : { keywords: ne(e.keywords, t) }
|
|
94
|
+
};
|
|
95
|
+
switch (e.source) {
|
|
96
|
+
case "symbol":
|
|
97
|
+
return p({
|
|
98
|
+
name: t,
|
|
99
|
+
source: "symbol",
|
|
100
|
+
value: z("symbol", e.value, t),
|
|
101
|
+
...n
|
|
102
|
+
});
|
|
103
|
+
case "component":
|
|
104
|
+
return p({
|
|
105
|
+
name: t,
|
|
106
|
+
source: "component",
|
|
107
|
+
value: z("component", e.value, t),
|
|
108
|
+
...n
|
|
109
|
+
});
|
|
110
|
+
case "class":
|
|
111
|
+
return p({
|
|
112
|
+
name: t,
|
|
113
|
+
source: "class",
|
|
114
|
+
value: z("class", e.value, t),
|
|
115
|
+
...n
|
|
116
|
+
});
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`QyIcon definition "${t}" has unsupported source "${String(e.source)}".`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function z(e, t, n) {
|
|
122
|
+
if (e === "symbol") {
|
|
123
|
+
if (typeof t != "string" || !/^#[^\s#]+$/.test(t))
|
|
124
|
+
throw new Error(`QyIcon symbol "${n}" must be a same-document #fragment.`);
|
|
125
|
+
return t;
|
|
126
|
+
}
|
|
127
|
+
if (e === "component") {
|
|
128
|
+
if (typeof t != "object" && typeof t != "function" || t === null)
|
|
129
|
+
throw new Error(`QyIcon component "${n}" must be a Vue component.`);
|
|
130
|
+
return t;
|
|
131
|
+
}
|
|
132
|
+
if (e !== "class")
|
|
133
|
+
throw new Error(`QyIcon definition "${n}" has unsupported source "${String(e)}".`);
|
|
134
|
+
if (typeof t != "string" || !t.trim() || !/^[A-Za-z0-9_:.\/\[\]%-]+(?:\s+[A-Za-z0-9_:.\/\[\]%-]+)*$/.test(t.trim()))
|
|
135
|
+
throw new Error(`QyIcon class "${n}" must be a trusted static class string.`);
|
|
136
|
+
return t.trim();
|
|
137
|
+
}
|
|
138
|
+
function re(e, t) {
|
|
139
|
+
if (typeof e != "string")
|
|
140
|
+
throw new Error(`QyIcon label "${t}" must be a string.`);
|
|
141
|
+
return e;
|
|
142
|
+
}
|
|
143
|
+
function ne(e, t) {
|
|
144
|
+
if (!Array.isArray(e) || e.some((n) => typeof n != "string"))
|
|
145
|
+
throw new Error(`QyIcon keywords "${t}" must be strings.`);
|
|
146
|
+
return Object.freeze([...e]);
|
|
147
|
+
}
|
|
148
|
+
function p(e) {
|
|
149
|
+
return e.keywords && !Object.isFrozen(e.keywords) && (e = { ...e, keywords: Object.freeze([...e.keywords]) }), Object.freeze(e);
|
|
150
|
+
}
|
|
151
|
+
function O(e) {
|
|
152
|
+
return p({
|
|
153
|
+
...e,
|
|
154
|
+
...e.keywords ? { keywords: [...e.keywords] } : {}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const oe = ["role", "aria-label", "aria-hidden", "data-qy-icon-missing"], se = {
|
|
158
|
+
key: 1,
|
|
159
|
+
"aria-hidden": "true",
|
|
160
|
+
focusable: "false"
|
|
161
|
+
}, ae = ["href", "xlink:href"], ce = /* @__PURE__ */ L({
|
|
162
|
+
name: "QyIcon",
|
|
163
|
+
inheritAttrs: !1,
|
|
164
|
+
__name: "index",
|
|
165
|
+
props: {
|
|
166
|
+
name: {},
|
|
167
|
+
icon: {},
|
|
168
|
+
size: { default: "1em" },
|
|
169
|
+
color: { default: "currentColor" },
|
|
170
|
+
spin: { type: Boolean, default: !1 },
|
|
171
|
+
label: {}
|
|
172
|
+
},
|
|
173
|
+
setup(e) {
|
|
174
|
+
const t = e, n = P(), a = q(), c = B(A, null), b = u(
|
|
175
|
+
() => t.icon ? T(V(t.icon)) : void 0
|
|
176
|
+
), f = u(
|
|
177
|
+
() => t.name === void 0 || t.name === null ? "" : g(t.name)
|
|
178
|
+
), s = u(() => {
|
|
179
|
+
if (!(t.icon || !c || !f.value))
|
|
180
|
+
return c.resolve(f.value);
|
|
181
|
+
}), o = M(null), l = u(() => !!(!t.icon && f.value && !s.value)), i = u(() => {
|
|
182
|
+
const r = typeof t.label == "string" ? t.label.trim() : "";
|
|
183
|
+
if (r) return r;
|
|
184
|
+
const y = n["aria-label"];
|
|
185
|
+
return K(y) ? String(y) : "";
|
|
186
|
+
}), v = u(() => i.value ? "img" : n.role), m = u(() => C(t.size)), x = u(() => ({
|
|
187
|
+
width: m.value,
|
|
188
|
+
height: m.value,
|
|
189
|
+
fontSize: m.value,
|
|
190
|
+
color: t.color || "currentColor"
|
|
191
|
+
})), N = u(() => {
|
|
192
|
+
const r = {};
|
|
193
|
+
for (const [y, w] of Object.entries(n))
|
|
194
|
+
D(y) && (r[y] = w);
|
|
195
|
+
return r;
|
|
196
|
+
}), R = u(() => Object.freeze({ name: f.value }));
|
|
197
|
+
k(() => {
|
|
198
|
+
const r = s.value;
|
|
199
|
+
o.value && (r == null ? void 0 : r.source) === "symbol" && (o.value.setAttributeNS(
|
|
200
|
+
"http://www.w3.org/1999/xlink",
|
|
201
|
+
"xlink:href",
|
|
202
|
+
r.value
|
|
203
|
+
), o.value.setAttribute("xlink:href", r.value));
|
|
204
|
+
}), k(() => {
|
|
205
|
+
});
|
|
206
|
+
function C(r) {
|
|
207
|
+
return typeof r == "number" ? Number.isFinite(r) && r > 0 ? `${r}px` : "1em" : r.trim() || "1em";
|
|
208
|
+
}
|
|
209
|
+
function K(r) {
|
|
210
|
+
return typeof r == "string" ? r.trim().length > 0 : r != null && r !== !1;
|
|
211
|
+
}
|
|
212
|
+
function D(r) {
|
|
213
|
+
return r !== "class" && r !== "style" && r !== "role" && r !== "aria-label" && r !== "aria-hidden" && r !== "data-qy-icon-missing" && (r === "id" || r === "title" || r.startsWith("data-") || r.startsWith("aria-"));
|
|
214
|
+
}
|
|
215
|
+
return (r, y) => {
|
|
216
|
+
var w, $, Q;
|
|
217
|
+
return h(), I("span", W(N.value, {
|
|
218
|
+
class: ["qy-icon", [E(n).class, { "is-spin": t.spin }]],
|
|
219
|
+
style: [E(n).style, x.value],
|
|
220
|
+
role: v.value,
|
|
221
|
+
"aria-label": i.value || void 0,
|
|
222
|
+
"aria-hidden": i.value ? void 0 : "true",
|
|
223
|
+
"data-qy-icon-missing": l.value ? f.value : void 0
|
|
224
|
+
}), [
|
|
225
|
+
b.value ? (h(), S(j(b.value), {
|
|
226
|
+
key: 0,
|
|
227
|
+
"aria-hidden": "true"
|
|
228
|
+
})) : ((w = s.value) == null ? void 0 : w.source) === "symbol" ? (h(), I("svg", se, [
|
|
229
|
+
Y("use", {
|
|
230
|
+
ref_key: "symbolElement",
|
|
231
|
+
ref: o,
|
|
232
|
+
href: s.value.value,
|
|
233
|
+
"xlink:href": s.value.value
|
|
234
|
+
}, null, 8, ae)
|
|
235
|
+
])) : (($ = s.value) == null ? void 0 : $.source) === "component" ? (h(), S(j(s.value.value), {
|
|
236
|
+
key: 2,
|
|
237
|
+
"aria-hidden": "true"
|
|
238
|
+
})) : ((Q = s.value) == null ? void 0 : Q.source) === "class" ? (h(), I("span", {
|
|
239
|
+
key: 3,
|
|
240
|
+
class: F(["qy-icon__class", s.value.value]),
|
|
241
|
+
"aria-hidden": "true"
|
|
242
|
+
}, null, 2)) : l.value && E(a).fallback ? Z(r.$slots, "fallback", G(H(R.value)), void 0, !0, 4) : J("", !0)
|
|
243
|
+
], 16, oe);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}), me = /* @__PURE__ */ U(ce, [["__scopeId", "data-v-e4e9c6ae"]]);
|
|
247
|
+
export {
|
|
248
|
+
me as I,
|
|
249
|
+
A as Q,
|
|
250
|
+
X as a,
|
|
251
|
+
fe as c,
|
|
252
|
+
ue as m,
|
|
253
|
+
g as n
|
|
254
|
+
};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { ref as S, computed as d, watch as Y, onBeforeUnmount as V, defineComponent as A, useSlots as G, inject as K, toRef as P, openBlock as _, createBlock as I, unref as F, withCtx as M, renderSlot as $, createTextVNode as H, toDisplayString as J } from "vue";
|
|
2
|
+
import { B as O } from "./index-D0L-u1nt.mjs";
|
|
3
|
+
import { Q as X, I as Z } from "./index-CaNxcPSD.mjs";
|
|
4
|
+
import { useFullscreen as W, useEventListener as D } from "@vueuse/core";
|
|
5
|
+
import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
6
|
+
const te = ["fullscreenchange", "webkitfullscreenchange"], le = [
|
|
7
|
+
"requestFullscreen",
|
|
8
|
+
"webkitRequestFullscreen",
|
|
9
|
+
"webkitEnterFullscreen",
|
|
10
|
+
"webkitEnterFullScreen",
|
|
11
|
+
"webkitRequestFullScreen",
|
|
12
|
+
"mozRequestFullScreen",
|
|
13
|
+
"msRequestFullscreen"
|
|
14
|
+
], ne = [
|
|
15
|
+
"exitFullscreen",
|
|
16
|
+
"webkitExitFullscreen",
|
|
17
|
+
"webkitExitFullScreen",
|
|
18
|
+
"webkitCancelFullScreen",
|
|
19
|
+
"mozCancelFullScreen",
|
|
20
|
+
"msExitFullscreen"
|
|
21
|
+
];
|
|
22
|
+
function re(e, l, o) {
|
|
23
|
+
const s = j(), a = S(null), i = S(!1), p = S(!1);
|
|
24
|
+
let r = null, c = !1;
|
|
25
|
+
const b = d(() => C(e.value)), g = d(
|
|
26
|
+
() => (a.value || b.value) ?? void 0
|
|
27
|
+
), x = W(g), w = S(!1);
|
|
28
|
+
function h() {
|
|
29
|
+
w.value = B(a.value || b.value);
|
|
30
|
+
}
|
|
31
|
+
function v() {
|
|
32
|
+
if (c) return;
|
|
33
|
+
const t = z(s), n = a.value || b.value, f = !!(t && t === n);
|
|
34
|
+
f ? a.value = t : (!t || t !== a.value) && (a.value = null), h(), f !== i.value && (i.value = f, o.onChange(f));
|
|
35
|
+
}
|
|
36
|
+
D(s, te, v), Y(e, v, { flush: "post" }), v();
|
|
37
|
+
function E() {
|
|
38
|
+
if (l.value || i.value) return Promise.resolve(!1);
|
|
39
|
+
if (r) return r;
|
|
40
|
+
const t = C(e.value);
|
|
41
|
+
return t ? B(t) ? (a.value = t, h(), y(async () => {
|
|
42
|
+
try {
|
|
43
|
+
return await L(t), v(), i.value && z(s) === t;
|
|
44
|
+
} catch {
|
|
45
|
+
return a.value = null, v(), u("enter", "request-rejected", "The browser rejected the fullscreen request.");
|
|
46
|
+
}
|
|
47
|
+
})) : Promise.resolve(u("enter", "unsupported", "Fullscreen is not supported by this browser.")) : Promise.resolve(u("enter", "target-unavailable", "Fullscreen target is unavailable."));
|
|
48
|
+
}
|
|
49
|
+
function m() {
|
|
50
|
+
if (l.value || !i.value) return Promise.resolve(!1);
|
|
51
|
+
if (r) return r;
|
|
52
|
+
const t = a.value || C(e.value);
|
|
53
|
+
return t ? B(t) ? y(async () => {
|
|
54
|
+
try {
|
|
55
|
+
return await U(t), v(), !i.value && z(s) !== t;
|
|
56
|
+
} catch {
|
|
57
|
+
return u("exit", "request-rejected", "The browser rejected the fullscreen request.");
|
|
58
|
+
}
|
|
59
|
+
}) : Promise.resolve(u("exit", "unsupported", "Fullscreen is not supported by this browser.")) : Promise.resolve(u("exit", "target-unavailable", "Fullscreen target is unavailable."));
|
|
60
|
+
}
|
|
61
|
+
function k() {
|
|
62
|
+
return r || (i.value ? m() : E());
|
|
63
|
+
}
|
|
64
|
+
function y(t) {
|
|
65
|
+
p.value = !0;
|
|
66
|
+
const n = t().finally(() => {
|
|
67
|
+
p.value = !1, r = null;
|
|
68
|
+
});
|
|
69
|
+
return r = n, n;
|
|
70
|
+
}
|
|
71
|
+
function u(t, n, f) {
|
|
72
|
+
const q = Object.freeze({ action: t, code: n, message: f });
|
|
73
|
+
return o.onError(q), !1;
|
|
74
|
+
}
|
|
75
|
+
async function L(t) {
|
|
76
|
+
const n = R(t);
|
|
77
|
+
if (n === "requestFullscreen") {
|
|
78
|
+
await t.requestFullscreen();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (x.isSupported.value) {
|
|
82
|
+
await x.enter();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (n) {
|
|
86
|
+
await Q(t, n);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
throw new Error("Fullscreen request is unavailable.");
|
|
90
|
+
}
|
|
91
|
+
async function U(t) {
|
|
92
|
+
var q;
|
|
93
|
+
const n = s, f = N(n, t);
|
|
94
|
+
if (f === "exitFullscreen") {
|
|
95
|
+
await ((q = n == null ? void 0 : n.exitFullscreen) == null ? void 0 : q.call(n));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (f) {
|
|
99
|
+
await Q(n, f);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
await x.exit();
|
|
103
|
+
}
|
|
104
|
+
return V(() => {
|
|
105
|
+
c = !0;
|
|
106
|
+
}), {
|
|
107
|
+
isFullscreen: i,
|
|
108
|
+
isSupported: w,
|
|
109
|
+
pending: p,
|
|
110
|
+
enter: E,
|
|
111
|
+
exit: m,
|
|
112
|
+
toggle: k
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function j() {
|
|
116
|
+
return typeof document > "u" ? void 0 : document;
|
|
117
|
+
}
|
|
118
|
+
function C(e) {
|
|
119
|
+
var l;
|
|
120
|
+
return e === null ? null : e !== void 0 ? e : ((l = j()) == null ? void 0 : l.documentElement) || null;
|
|
121
|
+
}
|
|
122
|
+
function z(e) {
|
|
123
|
+
return (e == null ? void 0 : e.fullscreenElement) || (e == null ? void 0 : e.webkitFullscreenElement) || null;
|
|
124
|
+
}
|
|
125
|
+
function B(e) {
|
|
126
|
+
if (!e || e === null) return !1;
|
|
127
|
+
const l = j();
|
|
128
|
+
return (l == null ? void 0 : l.fullscreenEnabled) !== !0 ? !1 : !!(R(e) && N(l, e));
|
|
129
|
+
}
|
|
130
|
+
function R(e) {
|
|
131
|
+
return le.find((l) => T(e, l));
|
|
132
|
+
}
|
|
133
|
+
function N(e, l) {
|
|
134
|
+
return ne.find(
|
|
135
|
+
(o) => T(e, o) || T(l, o)
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
async function Q(e, l) {
|
|
139
|
+
const o = e && e[l];
|
|
140
|
+
if (typeof o != "function") throw new Error("Fullscreen method is unavailable.");
|
|
141
|
+
await o.call(e);
|
|
142
|
+
}
|
|
143
|
+
function T(e, l) {
|
|
144
|
+
return typeof (e == null ? void 0 : e[l]) == "function";
|
|
145
|
+
}
|
|
146
|
+
const se = /* @__PURE__ */ A({
|
|
147
|
+
name: "QyFullscreen",
|
|
148
|
+
inheritAttrs: !1,
|
|
149
|
+
__name: "index",
|
|
150
|
+
props: {
|
|
151
|
+
target: {},
|
|
152
|
+
disabled: { type: Boolean, default: !1 },
|
|
153
|
+
size: { default: "default" },
|
|
154
|
+
enterLabel: { default: "进入全屏" },
|
|
155
|
+
exitLabel: { default: "退出全屏" },
|
|
156
|
+
enterIcon: { default: "fullscreen" },
|
|
157
|
+
exitIcon: { default: "exit-fullscreen" }
|
|
158
|
+
},
|
|
159
|
+
emits: ["change", "error"],
|
|
160
|
+
setup(e, { expose: l, emit: o }) {
|
|
161
|
+
const s = e, a = o, i = G(), p = K(X, null), r = re(P(s, "target"), P(s, "disabled"), {
|
|
162
|
+
onChange: (u) => a("change", u),
|
|
163
|
+
onError: (u) => a("error", u)
|
|
164
|
+
}), c = r.isFullscreen, b = r.pending, g = d(
|
|
165
|
+
() => c.value ? s.exitLabel : s.enterLabel
|
|
166
|
+
), x = d(
|
|
167
|
+
() => c.value ? s.exitIcon : s.enterIcon
|
|
168
|
+
), w = d(
|
|
169
|
+
() => c.value ? "exit-icon" : "enter-icon"
|
|
170
|
+
), h = d(() => !!i[w.value]), v = d(() => p == null ? void 0 : p.resolve(x.value)), E = d(() => h.value || !!v.value), m = d(() => ({ small: "sm", default: "md", large: "lg" })[s.size]), k = d(
|
|
171
|
+
() => s.disabled || !r.isSupported.value || b.value
|
|
172
|
+
);
|
|
173
|
+
function y() {
|
|
174
|
+
r.toggle();
|
|
175
|
+
}
|
|
176
|
+
return l({
|
|
177
|
+
enter: r.enter,
|
|
178
|
+
exit: r.exit,
|
|
179
|
+
toggle: r.toggle
|
|
180
|
+
}), (u, L) => E.value ? (_(), I(O, {
|
|
181
|
+
key: 0,
|
|
182
|
+
class: "qy-fullscreen",
|
|
183
|
+
size: m.value,
|
|
184
|
+
disabled: k.value,
|
|
185
|
+
loading: F(b),
|
|
186
|
+
active: F(c),
|
|
187
|
+
"icon-only": !0,
|
|
188
|
+
"aria-label": g.value,
|
|
189
|
+
"aria-pressed": F(c) ? "true" : "false",
|
|
190
|
+
title: g.value,
|
|
191
|
+
onClick: y
|
|
192
|
+
}, {
|
|
193
|
+
prefix: M(() => [
|
|
194
|
+
h.value ? $(u.$slots, w.value, {}, void 0, !0, 0) : (_(), I(Z, {
|
|
195
|
+
key: 1,
|
|
196
|
+
name: x.value
|
|
197
|
+
}, null, 8, ["name"]))
|
|
198
|
+
]),
|
|
199
|
+
_: 3
|
|
200
|
+
}, 8, ["size", "disabled", "loading", "active", "aria-label", "aria-pressed", "title"])) : (_(), I(O, {
|
|
201
|
+
key: 1,
|
|
202
|
+
class: "qy-fullscreen",
|
|
203
|
+
size: m.value,
|
|
204
|
+
disabled: k.value,
|
|
205
|
+
loading: F(b),
|
|
206
|
+
active: F(c),
|
|
207
|
+
"icon-only": !1,
|
|
208
|
+
"aria-label": g.value,
|
|
209
|
+
"aria-pressed": F(c) ? "true" : "false",
|
|
210
|
+
title: g.value,
|
|
211
|
+
onClick: y
|
|
212
|
+
}, {
|
|
213
|
+
default: M(() => [
|
|
214
|
+
H(J(g.value), 1)
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["size", "disabled", "loading", "active", "aria-label", "aria-pressed", "title"]));
|
|
218
|
+
}
|
|
219
|
+
}), fe = /* @__PURE__ */ ee(se, [["__scopeId", "data-v-4491aa7c"]]);
|
|
220
|
+
export {
|
|
221
|
+
fe as F
|
|
222
|
+
};
|