@qynpm/ui 1.0.35 → 1.0.37
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 +85 -34
- package/dist/index.cjs +5 -4
- package/dist/index.mjs +61 -59
- package/dist/qy-action-bar/index.cjs +1 -1
- package/dist/qy-action-bar/index.mjs +1 -1
- package/dist/qy-dialog/index.cjs +1 -1
- package/dist/qy-dialog/index.mjs +1 -1
- package/dist/qy-drawer/index.cjs +1 -1
- package/dist/qy-drawer/index.mjs +1 -1
- package/dist/qy-file-picker/index.cjs +1 -1
- package/dist/qy-file-picker/index.mjs +1 -1
- package/dist/qy-form-section/index.cjs +1 -1
- package/dist/qy-form-section/index.mjs +1 -1
- package/dist/qy-fullscreen/index.cjs +1 -1
- package/dist/qy-fullscreen/index.mjs +1 -1
- package/dist/qy-icon/index.cjs +1 -1
- package/dist/qy-icon/index.mjs +2 -2
- package/dist/qy-icon-picker/index.cjs +2 -2
- package/dist/qy-icon-picker/index.mjs +2 -2
- package/dist/qy-image-upload/index.cjs +1 -1
- package/dist/qy-image-upload/index.mjs +1 -1
- package/dist/qy-input-number/index.cjs +1 -1
- package/dist/qy-input-number/index.mjs +1 -1
- package/dist/qy-input-tag/index.cjs +1 -0
- package/dist/qy-input-tag/index.mjs +7 -0
- package/dist/qy-legacy-selection-dialog/index.cjs +1 -1
- package/dist/qy-legacy-selection-dialog/index.mjs +1 -1
- package/dist/qy-money-input/index.cjs +1 -1
- package/dist/qy-money-input/index.mjs +5 -2
- package/dist/qy-record-quote-search/index.cjs +1 -1
- package/dist/qy-record-quote-search/index.mjs +1 -1
- package/dist/qy-remark-image/index.cjs +1 -1
- package/dist/qy-remark-image/index.mjs +1 -1
- package/dist/qy-remote-select/index.cjs +1 -1
- package/dist/qy-remote-select/index.mjs +1 -1
- package/dist/qy-search-input/index.cjs +1 -1
- package/dist/qy-search-input/index.mjs +1 -1
- package/dist/qy-selection-dialog/index.cjs +1 -1
- package/dist/qy-selection-dialog/index.mjs +1 -1
- package/dist/qy-upload/index.cjs +1 -1
- package/dist/qy-upload/index.mjs +5 -2
- package/dist/shared/index-3KGa3jVi.mjs +2754 -0
- package/dist/shared/{index-DY-CA7Vr.mjs → index-BF6f9QDU.mjs} +1 -1
- package/dist/shared/{index-Bi9wgcgT.cjs → index-BQEymEbE.cjs} +1 -1
- package/dist/shared/{index-3qEac4h8.cjs → index-BTbiht5h.cjs} +1 -1
- package/dist/shared/index-BYX0biqw.mjs +766 -0
- package/dist/shared/index-BxxwEr52.mjs +107 -0
- package/dist/shared/index-C1i-hd-W.cjs +1 -0
- package/dist/shared/{index-S8HW36Mc.mjs → index-Crr3HB8g.mjs} +1 -1
- package/dist/shared/index-D8kce2jH.cjs +1 -0
- package/dist/shared/index-Di_xbC7d.cjs +1 -0
- package/dist/shared/index-Dm8kY2v6.mjs +285 -0
- package/dist/shared/index-DnNIseRJ.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-BiIgNax-.cjs +1 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DIWWHODS.mjs +197 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-DwFGEW4B.mjs +143 -0
- package/dist/shared/index.vue_vue_type_script_setup_true_lang-ccFLNRry.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-B1FgJZbw.mjs +148 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CAW_QOyJ.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DVXf-yUs.cjs +1 -0
- package/dist/shared/index.vue_vue_type_style_index_0_lang-Dr9Elmzn.mjs +317 -0
- package/index.d.ts +82 -25
- package/package.json +490 -483
- package/qy-file-picker/index.d.ts +4 -1
- package/qy-icon/index.d.ts +9 -6
- package/qy-image-preview/index.d.ts +0 -1
- package/qy-image-upload/index.d.ts +69 -12
- package/qy-input/index.d.ts +76 -18
- package/qy-input-number/index.d.ts +64 -30
- package/qy-input-tag/index.d.ts +69 -0
- package/qy-money-input/index.d.ts +87 -12
- package/qy-upload/index.d.ts +99 -5
- package/dist/shared/index-AMu0L6uU.cjs +0 -1
- package/dist/shared/index-BekN1g_r.mjs +0 -3541
- package/dist/shared/index-BkX9xlbI.cjs +0 -1
- package/dist/shared/index-C91mzAI3.mjs +0 -254
- package/dist/shared/index-C_1KP3l9.mjs +0 -129
- package/dist/shared/index-Ce_hvR--.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-B0CXLnL1.mjs +0 -132
- package/dist/shared/index.vue_vue_type_style_index_0_lang-BcZb1U13.cjs +0 -1
- package/dist/shared/index.vue_vue_type_style_index_0_lang-CIcZet5j.mjs +0 -286
- package/dist/shared/index.vue_vue_type_style_index_0_lang-DccRGtZE.cjs +0 -1
- /package/dist/shared/{index.vue_vue_type_script_setup_true_lang-q37rBg6Z.mjs → index.vue_vue_type_script_setup_true_lang-CGsXVhJy.mjs} +0 -0
- /package/dist/shared/{index.vue_vue_type_script_setup_true_lang-CglCPcj-.cjs → index.vue_vue_type_script_setup_true_lang-Dk83TGiU.cjs} +0 -0
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, useAttrs as x, computed as B, ref as g, openBlock as $, createBlock as k, unref as C, mergeProps as S, createSlots as V, withCtx as l, renderSlot as i } from "vue";
|
|
2
|
-
import { ElInputNumber as z } from "element-plus";
|
|
3
|
-
const N = /* @__PURE__ */ p({
|
|
4
|
-
name: "QyInputNumber",
|
|
5
|
-
inheritAttrs: !1,
|
|
6
|
-
__name: "index",
|
|
7
|
-
props: {
|
|
8
|
-
id: {},
|
|
9
|
-
step: { default: 1 },
|
|
10
|
-
stepStrictly: { type: Boolean, default: !1 },
|
|
11
|
-
max: { default: void 0 },
|
|
12
|
-
min: { default: void 0 },
|
|
13
|
-
readonly: { type: Boolean, default: !1 },
|
|
14
|
-
disabled: { type: Boolean, default: !1 },
|
|
15
|
-
controls: { type: Boolean, default: !0 },
|
|
16
|
-
name: {},
|
|
17
|
-
placeholder: { default: "请输入数字" },
|
|
18
|
-
precision: { default: void 0 },
|
|
19
|
-
validateEvent: { type: Boolean },
|
|
20
|
-
ariaLabel: {},
|
|
21
|
-
inputmode: {},
|
|
22
|
-
align: {},
|
|
23
|
-
disabledScientific: { type: Boolean },
|
|
24
|
-
formatter: {},
|
|
25
|
-
parser: {},
|
|
26
|
-
tabindex: {},
|
|
27
|
-
modelValue: { default: void 0 },
|
|
28
|
-
valueOnClear: { default: null },
|
|
29
|
-
controlsPosition: { default: "" },
|
|
30
|
-
size: { default: void 0 }
|
|
31
|
-
},
|
|
32
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
33
|
-
setup(a, { expose: d, emit: s }) {
|
|
34
|
-
const n = s, u = x(), r = B(
|
|
35
|
-
() => Object.fromEntries(
|
|
36
|
-
Object.entries(u).filter(([e]) => !e.startsWith("on"))
|
|
37
|
-
)
|
|
38
|
-
), o = g(null);
|
|
39
|
-
function c(e) {
|
|
40
|
-
n("update:modelValue", e);
|
|
41
|
-
}
|
|
42
|
-
function f(e) {
|
|
43
|
-
n("input", e);
|
|
44
|
-
}
|
|
45
|
-
function m(e, t) {
|
|
46
|
-
n("change", e, t);
|
|
47
|
-
}
|
|
48
|
-
function b(e) {
|
|
49
|
-
n("focus", e);
|
|
50
|
-
}
|
|
51
|
-
function v(e) {
|
|
52
|
-
n("blur", e);
|
|
53
|
-
}
|
|
54
|
-
function y() {
|
|
55
|
-
var e, t;
|
|
56
|
-
(t = (e = o.value) == null ? void 0 : e.focus) == null || t.call(e);
|
|
57
|
-
}
|
|
58
|
-
function h() {
|
|
59
|
-
var e, t;
|
|
60
|
-
(t = (e = o.value) == null ? void 0 : e.blur) == null || t.call(e);
|
|
61
|
-
}
|
|
62
|
-
return d({
|
|
63
|
-
focus: y,
|
|
64
|
-
blur: h
|
|
65
|
-
}), (e, t) => ($(), k(C(z), S({
|
|
66
|
-
ref_key: "inputNumberRef",
|
|
67
|
-
ref: o
|
|
68
|
-
}, r.value, {
|
|
69
|
-
class: "qy-input-number",
|
|
70
|
-
"model-value": a.modelValue,
|
|
71
|
-
min: a.min,
|
|
72
|
-
max: a.max,
|
|
73
|
-
step: a.step,
|
|
74
|
-
"step-strictly": a.stepStrictly,
|
|
75
|
-
precision: a.precision,
|
|
76
|
-
controls: a.controls,
|
|
77
|
-
"controls-position": a.controlsPosition,
|
|
78
|
-
placeholder: a.placeholder,
|
|
79
|
-
disabled: a.disabled,
|
|
80
|
-
readonly: a.readonly,
|
|
81
|
-
size: a.size,
|
|
82
|
-
"value-on-clear": a.valueOnClear,
|
|
83
|
-
formatter: a.formatter,
|
|
84
|
-
parser: a.parser,
|
|
85
|
-
inputmode: a.inputmode,
|
|
86
|
-
align: a.align,
|
|
87
|
-
"disabled-scientific": a.disabledScientific,
|
|
88
|
-
"validate-event": a.validateEvent,
|
|
89
|
-
id: a.id,
|
|
90
|
-
name: a.name,
|
|
91
|
-
"aria-label": a.ariaLabel,
|
|
92
|
-
tabindex: a.tabindex,
|
|
93
|
-
"onUpdate:modelValue": c,
|
|
94
|
-
onInput: f,
|
|
95
|
-
onChange: m,
|
|
96
|
-
onFocus: b,
|
|
97
|
-
onBlur: v
|
|
98
|
-
}), V({ _: 2 }, [
|
|
99
|
-
e.$slots.prefix ? {
|
|
100
|
-
name: "prefix",
|
|
101
|
-
fn: l(() => [
|
|
102
|
-
i(e.$slots, "prefix")
|
|
103
|
-
]),
|
|
104
|
-
key: "0"
|
|
105
|
-
} : void 0,
|
|
106
|
-
e.$slots.suffix ? {
|
|
107
|
-
name: "suffix",
|
|
108
|
-
fn: l(() => [
|
|
109
|
-
i(e.$slots, "suffix")
|
|
110
|
-
]),
|
|
111
|
-
key: "1"
|
|
112
|
-
} : void 0,
|
|
113
|
-
e.$slots["increase-icon"] ? {
|
|
114
|
-
name: "increase-icon",
|
|
115
|
-
fn: l(() => [
|
|
116
|
-
i(e.$slots, "increase-icon")
|
|
117
|
-
]),
|
|
118
|
-
key: "2"
|
|
119
|
-
} : void 0,
|
|
120
|
-
e.$slots["decrease-icon"] ? {
|
|
121
|
-
name: "decrease-icon",
|
|
122
|
-
fn: l(() => [
|
|
123
|
-
i(e.$slots, "decrease-icon")
|
|
124
|
-
]),
|
|
125
|
-
key: "3"
|
|
126
|
-
} : void 0
|
|
127
|
-
]), 1040, ["model-value", "min", "max", "step", "step-strictly", "precision", "controls", "controls-position", "placeholder", "disabled", "readonly", "size", "value-on-clear", "formatter", "parser", "inputmode", "align", "disabled-scientific", "validate-event", "id", "name", "aria-label", "tabindex"]));
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
export {
|
|
131
|
-
N as _
|
|
132
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),E=require("./index-Bi9wgcgT.cjs"),K=require("./index-nSFTxVz8.cjs"),j=require("../qy-popover/index.cjs"),L=require("./index-AMu0L6uU.cjs");function F(l,p){const f=p==null?"":String(p),n=l&&f?l.resolve(f):void 0;return Object.freeze({value:f,known:!!n,canonicalName:n==null?void 0:n.name,definition:n})}function Y(l,p,f=""){const n=(l==null?void 0:l.list())??[],c=p===void 0?void 0:new Set(p.map(r=>{var s;return(s=l==null?void 0:l.resolve(r))==null?void 0:s.name}).filter(r=>!!r).map(P)),h=String(f).trim().toLocaleLowerCase();return Object.freeze(n.filter(r=>c&&!c.has(P(r.name))?!1:h?[r.name,r.label,...r.keywords??[]].some(s=>typeof s=="string"&&s.toLocaleLowerCase().includes(h)):!0))}function P(l){return L.normalizeQyIconName(l).toLocaleLowerCase()}const W={class:"qy-icon-picker"},G=["onKeydown"],H={class:"qy-icon-picker__preview","aria-hidden":"true"},J={key:1,class:"qy-icon-picker__missing","aria-hidden":"true"},X=["id"],Z={class:"qy-icon-picker__search","data-testid":"qy-icon-picker-search"},ee=["aria-label"],ae=["id","data-qy-icon-option","data-qy-icon-active","aria-selected","tabindex","onClick","onFocus","onKeydown"],ne={class:"qy-icon-picker__option-label"},oe={key:1,class:"qy-icon-picker__empty"};let te=0;const le=e.defineComponent({name:"QyIconPicker",__name:"index",props:{modelValue:{default:""},allowedNames:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{default:"default"},placeholder:{default:"点击选择图标"},searchPlaceholder:{default:"搜索图标名称、标签或关键词"},emptyText:{default:"暂无匹配图标"},panelWidth:{default:540},open:{type:Boolean,default:void 0},id:{},ariaLabel:{}},emits:["update:modelValue","change","clear","update:open","open-change"],setup(l,{expose:p,emit:f}){const n=l,c=f,h=e.inject(L.QY_ICON_REGISTRY_KEY,null),r=e.ref(""),s=e.ref(!1),i=e.ref(-1),b=e.ref([]),y=e.ref(null),x=e.ref(null),w=e.ref("pointer"),Q=`qy-icon-picker-${++te}`,v=e.computed(()=>F(h,n.modelValue)),d=e.computed(()=>Y(h,n.allowedNames,r.value)),k=e.computed(()=>n.open!==void 0),m=e.computed(()=>k.value?n.open===!0:s.value),R=e.computed(()=>"click"),g=e.computed(()=>`${n.id||Q}-panel`);e.watch(m,(a,o)=>{!a||o||(r.value="",i.value=M(),b.value=[],w.value==="keyboard"&&e.nextTick(()=>{var t,u;return(u=(t=x.value)==null?void 0:t.focus)==null?void 0:u.call(t)}))}),e.watch(d,()=>{if(!d.value.length){i.value=-1;return}i.value>=d.value.length&&(i.value=0),i.value<0&&(i.value=0)});function N(){n.disabled||(w.value="keyboard",I("keyboard"))}function T(a){n.disabled||k.value&&n.open!==!1||(a.stopImmediatePropagation(),I("pointer"))}function z(a){q(a)}function $(a){a===m.value&&(k.value||(s.value=a),c("open-change",a),a||e.nextTick(()=>{var o,t;return(t=(o=y.value)==null?void 0:o.focus)==null?void 0:t.call(o)}))}function q(a){a&&n.disabled||a!==m.value&&(k.value||(s.value=a),c("update:open",a))}function I(a="programmatic"){w.value=a,q(!0)}function B(){q(!1),e.nextTick(()=>{var a,o;return(o=(a=y.value)==null?void 0:a.focus)==null?void 0:o.call(a)})}function V(){n.disabled||(c("update:modelValue",""),c("change",""),c("clear"))}function C(a){n.disabled||(c("update:modelValue",a.name),c("change",a.name),B())}function S(a){if(a.key==="Escape"){a.preventDefault(),B();return}if(!d.value.length||!["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(a.key))return;a.preventDefault();const o=a.key==="ArrowUp"||a.key==="ArrowLeft"?-1:1,t=d.value.length;i.value=(i.value+o+t)%t,e.nextTick(()=>{var u;return(u=b.value[i.value])==null?void 0:u.focus()})}function M(){const a=v.value.canonicalName;if(!a)return d.value.length?0:-1;const o=d.value.findIndex(({name:t})=>t===a);return o>=0?o:d.value.length?0:-1}function A(a,o){a instanceof HTMLElement&&(b.value[o]=a)}function O(a){return`${g.value}-${encodeURIComponent(a)}`}function D(){var a,o;(o=(a=y.value)==null?void 0:a.focus)==null||o.call(a)}function U(){var a,o;(o=(a=y.value)==null?void 0:a.blur)==null||o.call(a)}return p({focus:D,blur:U,open:I,close:B}),(a,o)=>(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(e.unref(j.QyPopover),{ref:"popoverRef",class:"qy-icon-picker__popover",open:m.value,trigger:R.value,placement:"bottom-start",width:n.panelWidth,"show-delay":0,"hide-delay":0,disabled:n.disabled||k.value&&n.open===!1,"onUpdate:open":z,onOpenChange:$},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:"qy-icon-picker__trigger","data-testid":"qy-icon-picker-trigger",onClick:T,onKeydown:[e.withKeys(e.withModifiers(N,["prevent"]),["enter"]),e.withKeys(e.withModifiers(N,["prevent"]),["space"])]},[e.createVNode(e.unref(K.QyInput),{ref_key:"triggerRef",ref:y,id:n.id,"model-value":v.value.value,size:n.size,disabled:n.disabled,clearable:n.clearable,readonly:"",placeholder:n.placeholder,"aria-label":n.ariaLabel,"aria-haspopup":"listbox","aria-expanded":m.value?"true":"false","aria-controls":g.value,onClear:V},{prefix:e.withCtx(()=>[e.createElementVNode("span",H,[v.value.definition?(e.openBlock(),e.createBlock(e.unref(E.QyIcon),{key:0,name:v.value.definition.name,size:18},null,8,["name"])):(e.openBlock(),e.createElementBlock("span",J,"?"))])]),suffix:e.withCtx(()=>[n.clearable&&v.value.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"qy-icon-picker__clear","data-testid":"qy-icon-picker-clear","aria-label":"清空图标",onClick:e.withModifiers(V,["stop","prevent"])},[...o[1]||(o[1]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0)]),_:1},8,["id","model-value","size","disabled","clearable","placeholder","aria-label","aria-expanded","aria-controls"])],40,G)]),default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:g.value,class:"qy-icon-picker__panel",onKeydown:S},[e.createElementVNode("div",Z,[e.createVNode(e.unref(K.QyInput),{ref_key:"searchRef",ref:x,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=t=>r.value=t),type:"search",clearable:"",placeholder:n.searchPlaceholder,"aria-label":"搜索图标"},null,8,["modelValue","placeholder"])]),d.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,class:"qy-icon-picker__grid",role:"listbox","aria-label":n.ariaLabel||"图标列表"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(t,u)=>(e.openBlock(),e.createElementBlock("div",{id:O(t.name),key:t.name,ref_for:!0,ref:_=>A(_,u),class:e.normalizeClass(["qy-icon-picker__option",{"is-active":i.value===u}]),"data-qy-icon-option":t.name,"data-qy-icon-active":i.value===u?"true":void 0,role:"option","aria-selected":v.value.canonicalName===t.name?"true":"false",tabindex:i.value===u?0:-1,onClick:_=>C(t),onFocus:_=>i.value=u,onKeydown:[e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["enter"]),e.withKeys(e.withModifiers(_=>C(t),["prevent"]),["space"])]},[e.createVNode(e.unref(E.QyIcon),{name:t.name,size:18,"aria-hidden":"true"},null,8,["name"]),e.createElementVNode("span",ne,e.toDisplayString(t.label||t.name),1)],42,ae))),128))],8,ee)):(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(a.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(n.emptyText),1)])]))],40,X)):e.createCommentVNode("",!0)]),_:3},8,["open","trigger","width","disabled"])]))}});exports._sfc_main=le;
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { defineComponent as oe, inject as le, ref as m, computed as _, watch as E, nextTick as L, openBlock as d, createElementBlock as f, createVNode as P, unref as q, withCtx as Q, createElementVNode as I, Fragment as te, renderList as re, withKeys as R, withModifiers as C, normalizeClass as ie, toDisplayString as O, renderSlot as ce, createTextVNode as ue, createCommentVNode as U, createBlock as se } from "vue";
|
|
2
|
-
import { Q as D } from "./index-DY-CA7Vr.mjs";
|
|
3
|
-
import { Q as j } from "./index-JjHutKmT.mjs";
|
|
4
|
-
import { QyPopover as de } from "../qy-popover/index.mjs";
|
|
5
|
-
import { n as pe, Q as fe } from "./index-C91mzAI3.mjs";
|
|
6
|
-
function ve(l, p) {
|
|
7
|
-
const v = p == null ? "" : String(p), a = l && v ? l.resolve(v) : void 0;
|
|
8
|
-
return Object.freeze({
|
|
9
|
-
value: v,
|
|
10
|
-
known: !!a,
|
|
11
|
-
canonicalName: a == null ? void 0 : a.name,
|
|
12
|
-
definition: a
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
function me(l, p, v = "") {
|
|
16
|
-
const a = (l == null ? void 0 : l.list()) ?? [], i = p === void 0 ? void 0 : new Set(
|
|
17
|
-
p.map((t) => {
|
|
18
|
-
var s;
|
|
19
|
-
return (s = l == null ? void 0 : l.resolve(t)) == null ? void 0 : s.name;
|
|
20
|
-
}).filter((t) => !!t).map(F)
|
|
21
|
-
), k = String(v).trim().toLocaleLowerCase();
|
|
22
|
-
return Object.freeze(
|
|
23
|
-
a.filter((t) => i && !i.has(F(t.name)) ? !1 : k ? [
|
|
24
|
-
t.name,
|
|
25
|
-
t.label,
|
|
26
|
-
...t.keywords ?? []
|
|
27
|
-
].some(
|
|
28
|
-
(s) => typeof s == "string" && s.toLocaleLowerCase().includes(k)
|
|
29
|
-
) : !0)
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
function F(l) {
|
|
33
|
-
return pe(l).toLocaleLowerCase();
|
|
34
|
-
}
|
|
35
|
-
const ye = { class: "qy-icon-picker" }, he = ["onKeydown"], _e = {
|
|
36
|
-
class: "qy-icon-picker__preview",
|
|
37
|
-
"aria-hidden": "true"
|
|
38
|
-
}, ke = {
|
|
39
|
-
key: 1,
|
|
40
|
-
class: "qy-icon-picker__missing",
|
|
41
|
-
"aria-hidden": "true"
|
|
42
|
-
}, be = ["id"], ge = {
|
|
43
|
-
class: "qy-icon-picker__search",
|
|
44
|
-
"data-testid": "qy-icon-picker-search"
|
|
45
|
-
}, we = ["aria-label"], qe = ["id", "data-qy-icon-option", "data-qy-icon-active", "aria-selected", "tabindex", "onClick", "onFocus", "onKeydown"], Ie = { class: "qy-icon-picker__option-label" }, Ce = {
|
|
46
|
-
key: 1,
|
|
47
|
-
class: "qy-icon-picker__empty"
|
|
48
|
-
};
|
|
49
|
-
let Le = 0;
|
|
50
|
-
const Ne = /* @__PURE__ */ oe({
|
|
51
|
-
name: "QyIconPicker",
|
|
52
|
-
__name: "index",
|
|
53
|
-
props: {
|
|
54
|
-
modelValue: { default: "" },
|
|
55
|
-
allowedNames: {},
|
|
56
|
-
disabled: { type: Boolean, default: !1 },
|
|
57
|
-
clearable: { type: Boolean, default: !1 },
|
|
58
|
-
size: { default: "default" },
|
|
59
|
-
placeholder: { default: "点击选择图标" },
|
|
60
|
-
searchPlaceholder: { default: "搜索图标名称、标签或关键词" },
|
|
61
|
-
emptyText: { default: "暂无匹配图标" },
|
|
62
|
-
panelWidth: { default: 540 },
|
|
63
|
-
open: { type: Boolean, default: void 0 },
|
|
64
|
-
id: {},
|
|
65
|
-
ariaLabel: {}
|
|
66
|
-
},
|
|
67
|
-
emits: ["update:modelValue", "change", "clear", "update:open", "open-change"],
|
|
68
|
-
setup(l, { expose: p, emit: v }) {
|
|
69
|
-
const a = l, i = v, k = le(fe, null), t = m(""), s = m(!1), r = m(-1), z = m([]), b = m(null), B = m(null), K = m("pointer"), M = `qy-icon-picker-${++Le}`, y = _(
|
|
70
|
-
() => ve(k, a.modelValue)
|
|
71
|
-
), u = _(
|
|
72
|
-
() => me(k, a.allowedNames, t.value)
|
|
73
|
-
), g = _(() => a.open !== void 0), h = _(
|
|
74
|
-
() => g.value ? a.open === !0 : s.value
|
|
75
|
-
), Y = _(() => "click"), N = _(() => `${a.id || M}-panel`);
|
|
76
|
-
E(
|
|
77
|
-
h,
|
|
78
|
-
(e, n) => {
|
|
79
|
-
!e || n || (t.value = "", r.value = X(), z.value = [], K.value === "keyboard" && L(() => {
|
|
80
|
-
var o, c;
|
|
81
|
-
return (c = (o = B.value) == null ? void 0 : o.focus) == null ? void 0 : c.call(o);
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
), E(u, () => {
|
|
85
|
-
if (!u.value.length) {
|
|
86
|
-
r.value = -1;
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
r.value >= u.value.length && (r.value = 0), r.value < 0 && (r.value = 0);
|
|
90
|
-
});
|
|
91
|
-
function S() {
|
|
92
|
-
a.disabled || (K.value = "keyboard", V("keyboard"));
|
|
93
|
-
}
|
|
94
|
-
function W(e) {
|
|
95
|
-
a.disabled || g.value && a.open !== !1 || (e.stopImmediatePropagation(), V("pointer"));
|
|
96
|
-
}
|
|
97
|
-
function G(e) {
|
|
98
|
-
x(e);
|
|
99
|
-
}
|
|
100
|
-
function H(e) {
|
|
101
|
-
e === h.value && (g.value || (s.value = e), i("open-change", e), e || L(() => {
|
|
102
|
-
var n, o;
|
|
103
|
-
return (o = (n = b.value) == null ? void 0 : n.focus) == null ? void 0 : o.call(n);
|
|
104
|
-
}));
|
|
105
|
-
}
|
|
106
|
-
function x(e) {
|
|
107
|
-
e && a.disabled || e !== h.value && (g.value || (s.value = e), i("update:open", e));
|
|
108
|
-
}
|
|
109
|
-
function V(e = "programmatic") {
|
|
110
|
-
K.value = e, x(!0);
|
|
111
|
-
}
|
|
112
|
-
function T() {
|
|
113
|
-
x(!1), L(() => {
|
|
114
|
-
var e, n;
|
|
115
|
-
return (n = (e = b.value) == null ? void 0 : e.focus) == null ? void 0 : n.call(e);
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
function A() {
|
|
119
|
-
a.disabled || (i("update:modelValue", ""), i("change", ""), i("clear"));
|
|
120
|
-
}
|
|
121
|
-
function $(e) {
|
|
122
|
-
a.disabled || (i("update:modelValue", e.name), i("change", e.name), T());
|
|
123
|
-
}
|
|
124
|
-
function J(e) {
|
|
125
|
-
if (e.key === "Escape") {
|
|
126
|
-
e.preventDefault(), T();
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (!u.value.length || !["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"].includes(e.key)) return;
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
const n = e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1, o = u.value.length;
|
|
132
|
-
r.value = (r.value + n + o) % o, L(() => {
|
|
133
|
-
var c;
|
|
134
|
-
return (c = z.value[r.value]) == null ? void 0 : c.focus();
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function X() {
|
|
138
|
-
const e = y.value.canonicalName;
|
|
139
|
-
if (!e) return u.value.length ? 0 : -1;
|
|
140
|
-
const n = u.value.findIndex(({ name: o }) => o === e);
|
|
141
|
-
return n >= 0 ? n : u.value.length ? 0 : -1;
|
|
142
|
-
}
|
|
143
|
-
function Z(e, n) {
|
|
144
|
-
e instanceof HTMLElement && (z.value[n] = e);
|
|
145
|
-
}
|
|
146
|
-
function ee(e) {
|
|
147
|
-
return `${N.value}-${encodeURIComponent(e)}`;
|
|
148
|
-
}
|
|
149
|
-
function ae() {
|
|
150
|
-
var e, n;
|
|
151
|
-
(n = (e = b.value) == null ? void 0 : e.focus) == null || n.call(e);
|
|
152
|
-
}
|
|
153
|
-
function ne() {
|
|
154
|
-
var e, n;
|
|
155
|
-
(n = (e = b.value) == null ? void 0 : e.blur) == null || n.call(e);
|
|
156
|
-
}
|
|
157
|
-
return p({ focus: ae, blur: ne, open: V, close: T }), (e, n) => (d(), f("div", ye, [
|
|
158
|
-
P(q(de), {
|
|
159
|
-
ref: "popoverRef",
|
|
160
|
-
class: "qy-icon-picker__popover",
|
|
161
|
-
open: h.value,
|
|
162
|
-
trigger: Y.value,
|
|
163
|
-
placement: "bottom-start",
|
|
164
|
-
width: a.panelWidth,
|
|
165
|
-
"show-delay": 0,
|
|
166
|
-
"hide-delay": 0,
|
|
167
|
-
disabled: a.disabled || g.value && a.open === !1,
|
|
168
|
-
"onUpdate:open": G,
|
|
169
|
-
onOpenChange: H
|
|
170
|
-
}, {
|
|
171
|
-
reference: Q(() => [
|
|
172
|
-
I("div", {
|
|
173
|
-
class: "qy-icon-picker__trigger",
|
|
174
|
-
"data-testid": "qy-icon-picker-trigger",
|
|
175
|
-
onClick: W,
|
|
176
|
-
onKeydown: [
|
|
177
|
-
R(C(S, ["prevent"]), ["enter"]),
|
|
178
|
-
R(C(S, ["prevent"]), ["space"])
|
|
179
|
-
]
|
|
180
|
-
}, [
|
|
181
|
-
P(q(j), {
|
|
182
|
-
ref_key: "triggerRef",
|
|
183
|
-
ref: b,
|
|
184
|
-
id: a.id,
|
|
185
|
-
"model-value": y.value.value,
|
|
186
|
-
size: a.size,
|
|
187
|
-
disabled: a.disabled,
|
|
188
|
-
clearable: a.clearable,
|
|
189
|
-
readonly: "",
|
|
190
|
-
placeholder: a.placeholder,
|
|
191
|
-
"aria-label": a.ariaLabel,
|
|
192
|
-
"aria-haspopup": "listbox",
|
|
193
|
-
"aria-expanded": h.value ? "true" : "false",
|
|
194
|
-
"aria-controls": N.value,
|
|
195
|
-
onClear: A
|
|
196
|
-
}, {
|
|
197
|
-
prefix: Q(() => [
|
|
198
|
-
I("span", _e, [
|
|
199
|
-
y.value.definition ? (d(), se(q(D), {
|
|
200
|
-
key: 0,
|
|
201
|
-
name: y.value.definition.name,
|
|
202
|
-
size: 18
|
|
203
|
-
}, null, 8, ["name"])) : (d(), f("span", ke, "?"))
|
|
204
|
-
])
|
|
205
|
-
]),
|
|
206
|
-
suffix: Q(() => [
|
|
207
|
-
a.clearable && y.value.value ? (d(), f("button", {
|
|
208
|
-
key: 0,
|
|
209
|
-
type: "button",
|
|
210
|
-
class: "qy-icon-picker__clear",
|
|
211
|
-
"data-testid": "qy-icon-picker-clear",
|
|
212
|
-
"aria-label": "清空图标",
|
|
213
|
-
onClick: C(A, ["stop", "prevent"])
|
|
214
|
-
}, [...n[1] || (n[1] = [
|
|
215
|
-
I("span", { "aria-hidden": "true" }, "×", -1)
|
|
216
|
-
])])) : U("", !0)
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
}, 8, ["id", "model-value", "size", "disabled", "clearable", "placeholder", "aria-label", "aria-expanded", "aria-controls"])
|
|
220
|
-
], 40, he)
|
|
221
|
-
]),
|
|
222
|
-
default: Q(() => [
|
|
223
|
-
h.value ? (d(), f("div", {
|
|
224
|
-
key: 0,
|
|
225
|
-
id: N.value,
|
|
226
|
-
class: "qy-icon-picker__panel",
|
|
227
|
-
onKeydown: J
|
|
228
|
-
}, [
|
|
229
|
-
I("div", ge, [
|
|
230
|
-
P(q(j), {
|
|
231
|
-
ref_key: "searchRef",
|
|
232
|
-
ref: B,
|
|
233
|
-
modelValue: t.value,
|
|
234
|
-
"onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
|
|
235
|
-
type: "search",
|
|
236
|
-
clearable: "",
|
|
237
|
-
placeholder: a.searchPlaceholder,
|
|
238
|
-
"aria-label": "搜索图标"
|
|
239
|
-
}, null, 8, ["modelValue", "placeholder"])
|
|
240
|
-
]),
|
|
241
|
-
u.value.length ? (d(), f("div", {
|
|
242
|
-
key: 0,
|
|
243
|
-
class: "qy-icon-picker__grid",
|
|
244
|
-
role: "listbox",
|
|
245
|
-
"aria-label": a.ariaLabel || "图标列表"
|
|
246
|
-
}, [
|
|
247
|
-
(d(!0), f(te, null, re(u.value, (o, c) => (d(), f("div", {
|
|
248
|
-
id: ee(o.name),
|
|
249
|
-
key: o.name,
|
|
250
|
-
ref_for: !0,
|
|
251
|
-
ref: (w) => Z(w, c),
|
|
252
|
-
class: ie(["qy-icon-picker__option", { "is-active": r.value === c }]),
|
|
253
|
-
"data-qy-icon-option": o.name,
|
|
254
|
-
"data-qy-icon-active": r.value === c ? "true" : void 0,
|
|
255
|
-
role: "option",
|
|
256
|
-
"aria-selected": y.value.canonicalName === o.name ? "true" : "false",
|
|
257
|
-
tabindex: r.value === c ? 0 : -1,
|
|
258
|
-
onClick: (w) => $(o),
|
|
259
|
-
onFocus: (w) => r.value = c,
|
|
260
|
-
onKeydown: [
|
|
261
|
-
R(C((w) => $(o), ["prevent"]), ["enter"]),
|
|
262
|
-
R(C((w) => $(o), ["prevent"]), ["space"])
|
|
263
|
-
]
|
|
264
|
-
}, [
|
|
265
|
-
P(q(D), {
|
|
266
|
-
name: o.name,
|
|
267
|
-
size: 18,
|
|
268
|
-
"aria-hidden": "true"
|
|
269
|
-
}, null, 8, ["name"]),
|
|
270
|
-
I("span", Ie, O(o.label || o.name), 1)
|
|
271
|
-
], 42, qe))), 128))
|
|
272
|
-
], 8, we)) : (d(), f("div", Ce, [
|
|
273
|
-
ce(e.$slots, "empty", {}, () => [
|
|
274
|
-
ue(O(a.emptyText), 1)
|
|
275
|
-
])
|
|
276
|
-
]))
|
|
277
|
-
], 40, be)) : U("", !0)
|
|
278
|
-
]),
|
|
279
|
-
_: 3
|
|
280
|
-
}, 8, ["open", "trigger", "width", "disabled"])
|
|
281
|
-
]));
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
export {
|
|
285
|
-
Ne as _
|
|
286
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),h=require("element-plus"),p=n.defineComponent({name:"QyInputNumber",inheritAttrs:!1,__name:"index",props:{id:{},step:{default:1},stepStrictly:{type:Boolean,default:!1},max:{default:void 0},min:{default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},name:{},placeholder:{default:"请输入数字"},precision:{default:void 0},validateEvent:{type:Boolean},ariaLabel:{},inputmode:{},align:{},disabledScientific:{type:Boolean},formatter:{},parser:{},tabindex:{},modelValue:{default:void 0},valueOnClear:{default:null},controlsPosition:{default:""},size:{default:void 0}},emits:["update:modelValue","input","change","focus","blur"],setup(t,{expose:o,emit:d}){const l=d,s=n.useAttrs(),r=n.computed(()=>Object.fromEntries(Object.entries(s).filter(([e])=>!e.startsWith("on")))),i=n.ref(null);function u(e){l("update:modelValue",e)}function c(e){l("input",e)}function f(e,a){l("change",e,a)}function m(e){l("focus",e)}function b(e){l("blur",e)}function v(){var e,a;(a=(e=i.value)==null?void 0:e.focus)==null||a.call(e)}function y(){var e,a;(a=(e=i.value)==null?void 0:e.blur)==null||a.call(e)}return o({focus:v,blur:y}),(e,a)=>(n.openBlock(),n.createBlock(n.unref(h.ElInputNumber),n.mergeProps({ref_key:"inputNumberRef",ref:i},r.value,{class:"qy-input-number","model-value":t.modelValue,min:t.min,max:t.max,step:t.step,"step-strictly":t.stepStrictly,precision:t.precision,controls:t.controls,"controls-position":t.controlsPosition,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,size:t.size,"value-on-clear":t.valueOnClear,formatter:t.formatter,parser:t.parser,inputmode:t.inputmode,align:t.align,"disabled-scientific":t.disabledScientific,"validate-event":t.validateEvent,id:t.id,name:t.name,"aria-label":t.ariaLabel,tabindex:t.tabindex,"onUpdate:modelValue":u,onInput:c,onChange:f,onFocus:m,onBlur:b}),n.createSlots({_:2},[e.$slots.prefix?{name:"prefix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"prefix")]),key:"0"}:void 0,e.$slots.suffix?{name:"suffix",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"suffix")]),key:"1"}:void 0,e.$slots["increase-icon"]?{name:"increase-icon",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"increase-icon")]),key:"2"}:void 0,e.$slots["decrease-icon"]?{name:"decrease-icon",fn:n.withCtx(()=>[n.renderSlot(e.$slots,"decrease-icon")]),key:"3"}:void 0]),1040,["model-value","min","max","step","step-strictly","precision","controls","controls-position","placeholder","disabled","readonly","size","value-on-clear","formatter","parser","inputmode","align","disabled-scientific","validate-event","id","name","aria-label","tabindex"]))}});exports._sfc_main=p;
|
|
File without changes
|