@aplus-frontend/ui 0.4.29 → 0.4.30
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, ref as
|
|
1
|
+
import { defineComponent as O, ref as g, computed as r, unref as n, openBlock as B, createElementBlock as P, createVNode as d, withCtx as A, createBlock as T, normalizeStyle as z, createCommentVNode as K, mergeProps as M } from "vue";
|
|
2
2
|
import "../../ap-field/index.mjs";
|
|
3
3
|
import { Space as $ } from "@aplus-frontend/antdv";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
@@ -12,7 +12,7 @@ import { useLocale as H } from "../../config-provider/hooks/use-locale.mjs";
|
|
|
12
12
|
import Y from "../../ap-field/select/index.vue.mjs";
|
|
13
13
|
import { ApFieldText as J } from "../../ap-field/text/index.mjs";
|
|
14
14
|
import Q from "./popover-input/index.vue2.mjs";
|
|
15
|
-
const
|
|
15
|
+
const c = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
16
16
|
__name: "index",
|
|
17
17
|
props: {
|
|
18
18
|
style: { type: [Boolean, null, String, Object, Array] },
|
|
@@ -69,31 +69,31 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
69
69
|
},
|
|
70
70
|
emits: ["update:value"],
|
|
71
71
|
setup(b, { emit: V }) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const l = b, C = N("Text", l), S = V, { value: a, updateValue: i } = q(
|
|
73
|
+
l,
|
|
74
74
|
S
|
|
75
|
-
),
|
|
76
|
-
{ value:
|
|
77
|
-
...
|
|
78
|
-
] :
|
|
75
|
+
), s = g(), f = g(), { t: I } = H(), U = r(() => l.options ? l.options.length > 1 && l.hasAll ? [
|
|
76
|
+
{ value: c, label: I("ap.apGroupSearch.all") },
|
|
77
|
+
...l.options
|
|
78
|
+
] : l.options : []), w = r(() => l.options ? l.options.map((e) => e.value) : []), k = r(() => {
|
|
79
79
|
var e, t;
|
|
80
|
-
return (t = (e =
|
|
80
|
+
return (t = (e = n(a)) == null ? void 0 : e.value) != null && t.length ? n(a).value.join(",") : "";
|
|
81
81
|
}), x = r(() => {
|
|
82
82
|
var e, t;
|
|
83
|
-
return (t = (e =
|
|
83
|
+
return (t = (e = n(a)) == null ? void 0 : e.value) != null && t.length ? n(a).value.join(`
|
|
84
84
|
`) : "";
|
|
85
85
|
}), R = r(() => {
|
|
86
86
|
var t;
|
|
87
|
-
const e = (t =
|
|
87
|
+
const e = (t = n(a)) == null ? void 0 : t.key;
|
|
88
88
|
if (e != null && e.length)
|
|
89
|
-
return e.length === 1 ? e[0] :
|
|
89
|
+
return e.length === 1 ? e[0] : c;
|
|
90
90
|
}), _ = r(() => {
|
|
91
91
|
var o;
|
|
92
|
-
const e = (o =
|
|
93
|
-
return !e || (e == null ? void 0 : e.length) <= 1 ?
|
|
92
|
+
const e = (o = n(a)) == null ? void 0 : o.key;
|
|
93
|
+
return !e || (e == null ? void 0 : e.length) <= 1 ? n(C) : (l.options || []).filter((u) => e.includes(u.value)).map((u) => u.label).join("/");
|
|
94
94
|
});
|
|
95
95
|
function j(e) {
|
|
96
|
-
const t =
|
|
96
|
+
const t = n(a) || {}, o = e === c ? n(w) : G(e) ? [e] : [];
|
|
97
97
|
i({
|
|
98
98
|
...t,
|
|
99
99
|
key: o
|
|
@@ -101,19 +101,19 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
101
101
|
}
|
|
102
102
|
function E(e) {
|
|
103
103
|
var v, y;
|
|
104
|
-
const t =
|
|
104
|
+
const t = n(a) || {}, o = e.target.value || "", u = o.replace(/[,]+/g, ",");
|
|
105
105
|
if (o !== u) {
|
|
106
|
-
const h = (y = (v =
|
|
106
|
+
const h = (y = (v = f.value) == null ? void 0 : v.$el) == null ? void 0 : y.querySelector("input");
|
|
107
107
|
h && (h.value = u);
|
|
108
108
|
}
|
|
109
|
-
let
|
|
110
|
-
|
|
109
|
+
let p = u.split(",");
|
|
110
|
+
p.length === 1 && p[0] === "" && (p = []), i({
|
|
111
111
|
...t,
|
|
112
|
-
value:
|
|
112
|
+
value: p
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
function F(e) {
|
|
116
|
-
const t =
|
|
116
|
+
const t = n(a) || {};
|
|
117
117
|
let o = e.split(/,|\n/);
|
|
118
118
|
i({
|
|
119
119
|
...t,
|
|
@@ -122,7 +122,7 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
122
122
|
}
|
|
123
123
|
function m() {
|
|
124
124
|
var o;
|
|
125
|
-
const e =
|
|
125
|
+
const e = n(a) || {}, t = (o = e.value) == null ? void 0 : o.filter(Boolean);
|
|
126
126
|
i({
|
|
127
127
|
...e,
|
|
128
128
|
value: t
|
|
@@ -130,22 +130,22 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
130
130
|
}
|
|
131
131
|
function L(e) {
|
|
132
132
|
var t;
|
|
133
|
-
m(), (t =
|
|
133
|
+
m(), (t = l.onBlur) == null || t.call(l, e);
|
|
134
134
|
}
|
|
135
|
-
return (e, t) => (
|
|
135
|
+
return (e, t) => (B(), P("div", {
|
|
136
136
|
ref_key: "containerRef",
|
|
137
|
-
ref:
|
|
137
|
+
ref: s,
|
|
138
138
|
style: { position: "relative" },
|
|
139
139
|
onFocus: t[0] || (t[0] = //@ts-ignore
|
|
140
140
|
(...o) => e.onFocus && e.onFocus(...o)),
|
|
141
141
|
onBlur: t[1] || (t[1] = //@ts-ignore
|
|
142
142
|
(...o) => e.onBlur && e.onBlur(...o))
|
|
143
143
|
}, [
|
|
144
|
-
|
|
144
|
+
d(n($).Compact, { block: "" }, {
|
|
145
145
|
default: A(() => {
|
|
146
146
|
var o;
|
|
147
147
|
return [
|
|
148
|
-
(o = e.options) != null && o.length ? (
|
|
148
|
+
(o = e.options) != null && o.length ? (B(), T(n(Y), {
|
|
149
149
|
key: 0,
|
|
150
150
|
style: z(e.style),
|
|
151
151
|
options: U.value,
|
|
@@ -153,10 +153,11 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
153
153
|
"allow-clear": !1,
|
|
154
154
|
"dropdown-match-select-width": !1,
|
|
155
155
|
disabled: e.disabled,
|
|
156
|
+
"get-popup-container": () => s.value,
|
|
156
157
|
"onUpdate:value": j
|
|
157
|
-
}, null, 8, ["style", "options", "value", "disabled"])) : K("", !0),
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
}, null, 8, ["style", "options", "value", "disabled", "get-popup-container"])) : K("", !0),
|
|
159
|
+
d(n(J), M(
|
|
160
|
+
n(D)(l, [
|
|
160
161
|
"style",
|
|
161
162
|
"value",
|
|
162
163
|
"onUpdate:value",
|
|
@@ -166,7 +167,7 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
166
167
|
]),
|
|
167
168
|
{
|
|
168
169
|
ref_key: "inputRef",
|
|
169
|
-
ref:
|
|
170
|
+
ref: f,
|
|
170
171
|
style: e.inputStyle,
|
|
171
172
|
value: k.value,
|
|
172
173
|
placeholder: _.value,
|
|
@@ -175,8 +176,8 @@ const d = "GROUP_SEARCH_ALL", de = /* @__PURE__ */ O({
|
|
|
175
176
|
}
|
|
176
177
|
), {
|
|
177
178
|
suffix: A(() => [
|
|
178
|
-
|
|
179
|
-
_parent:
|
|
179
|
+
d(Q, {
|
|
180
|
+
_parent: s.value,
|
|
180
181
|
value: x.value,
|
|
181
182
|
disabled: e.disabled,
|
|
182
183
|
"onUpdate:value": F,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../ap-field/index.js");const k=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const R=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const j=require("../../utils/index.js"),L=require("../../ap-field/hooks/use-default-placeholder.js"),O=require("../../hooks/useControllableValue.js"),P=require("../../config-provider/hooks/use-locale.js"),E=require("../../ap-field/select/index.vue.js"),F=require("../../ap-field/text/index.js"),T=require("./popover-input/index.vue2.js"),
|
|
2
|
-
`):""}),q=t.computed(()=>{var n;const e=(n=t.unref(u))==null?void 0:n.key;if(e!=null&&e.length)return e.length===1?e[0]:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("../../ap-field/index.js");const k=require("@aplus-frontend/antdv");require("../../config-provider/index.js");const R=require("lodash-unified");require("./popover-input/index.vue.js");require("../../hooks/index.js");const j=require("../../utils/index.js"),L=require("../../ap-field/hooks/use-default-placeholder.js"),O=require("../../hooks/useControllableValue.js"),P=require("../../config-provider/hooks/use-locale.js"),E=require("../../ap-field/select/index.vue.js"),F=require("../../ap-field/text/index.js"),T=require("./popover-input/index.vue2.js"),p="GROUP_SEARCH_ALL",M=t.defineComponent({__name:"index",props:{style:{type:[Boolean,null,String,Object,Array]},inputStyle:{type:[Boolean,null,String,Object,Array]},options:{},hasAll:{type:Boolean,default:!0},value:{},"onUpdate:value":{},mode:{default:"edit"},class:{},id:{},placeholder:{},autocomplete:{},type:{default:"text"},name:{},size:{},autofocus:{type:Boolean},lazy:{type:Boolean,default:!0},maxlength:{},loading:{type:Boolean},bordered:{type:Boolean,default:!0},showCount:{type:[Boolean,Object]},htmlSize:{},onPressEnter:{},onKeydown:{},onKeyup:{},onMousedown:{},onMouseUp:{},onFocus:{},onBlur:{},onChange:{},onInput:{},onRawInput:{},onCompositionstart:{},onCompositionend:{},valueModifiers:{},hidden:{type:Boolean},status:{},defaultValue:{},inputElement:{},prefixCls:{},disabled:{type:Boolean},focused:{type:Boolean},triggerFocus:{},readonly:{type:Boolean},handleReset:{},addonBefore:{},addonAfter:{},prefix:{},suffix:{},clearIcon:{},allowClear:{type:Boolean,default:!0},emptyText:{default:"--"}},emits:["update:value"],setup(m,{emit:h}){const l=m,g=L.useDefaultPlaceholder("Text",l),B=h,{value:u,updateValue:r}=O.useControllableValue(l,B),i=t.ref(),d=t.ref(),{t:_}=P.useLocale(),b=t.computed(()=>l.options?l.options.length>1&&l.hasAll?[{value:p,label:_("ap.apGroupSearch.all")},...l.options]:l.options:[]),V=t.computed(()=>l.options?l.options.map(e=>e.value):[]),A=t.computed(()=>{var e,n;return(n=(e=t.unref(u))==null?void 0:e.value)!=null&&n.length?t.unref(u).value.join(","):""}),C=t.computed(()=>{var e,n;return(n=(e=t.unref(u))==null?void 0:e.value)!=null&&n.length?t.unref(u).value.join(`
|
|
2
|
+
`):""}),q=t.computed(()=>{var n;const e=(n=t.unref(u))==null?void 0:n.key;if(e!=null&&e.length)return e.length===1?e[0]:p}),S=t.computed(()=>{var o;const e=(o=t.unref(u))==null?void 0:o.key;return!e||(e==null?void 0:e.length)<=1?t.unref(g):(l.options||[]).filter(a=>e.includes(a.value)).map(a=>a.label).join("/")});function x(e){const n=t.unref(u)||{},o=e===p?t.unref(V):j.isDef(e)?[e]:[];r({...n,key:o})}function U(e){var f,v;const n=t.unref(u)||{},o=e.target.value||"",a=o.replace(/[,]+/g,",");if(o!==a){const y=(v=(f=d.value)==null?void 0:f.$el)==null?void 0:v.querySelector("input");y&&(y.value=a)}let s=a.split(",");s.length===1&&s[0]===""&&(s=[]),r({...n,value:s})}function w(e){const n=t.unref(u)||{};let o=e.split(/,|\n/);r({...n,value:o})}function c(){var o;const e=t.unref(u)||{},n=(o=e.value)==null?void 0:o.filter(Boolean);r({...e,value:n})}function I(e){var n;c(),(n=l.onBlur)==null||n.call(l,e)}return(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"containerRef",ref:i,style:{position:"relative"},onFocus:n[0]||(n[0]=(...o)=>e.onFocus&&e.onFocus(...o)),onBlur:n[1]||(n[1]=(...o)=>e.onBlur&&e.onBlur(...o))},[t.createVNode(t.unref(k.Space).Compact,{block:""},{default:t.withCtx(()=>{var o;return[(o=e.options)!=null&&o.length?(t.openBlock(),t.createBlock(t.unref(E.default),{key:0,style:t.normalizeStyle(e.style),options:b.value,value:q.value,"allow-clear":!1,"dropdown-match-select-width":!1,disabled:e.disabled,"get-popup-container":()=>i.value,"onUpdate:value":x},null,8,["style","options","value","disabled","get-popup-container"])):t.createCommentVNode("",!0),t.createVNode(t.unref(F.ApFieldText),t.mergeProps(t.unref(R.omit)(l,["style","value","onUpdate:value","inputStyle","hasAll","options"]),{ref_key:"inputRef",ref:d,style:e.inputStyle,value:A.value,placeholder:S.value,onInput:U,onBlur:I}),{suffix:t.withCtx(()=>[t.createVNode(T.default,{_parent:i.value,value:C.value,disabled:e.disabled,"onUpdate:value":w,onClose:c},null,8,["_parent","value","disabled"])]),_:1},16,["style","value","placeholder"])]}),_:1})],544))}});exports.default=M;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.30",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"sortablejs": "^1.15.2",
|
|
66
66
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
67
67
|
"vuedraggable": "^4.1.0",
|
|
68
|
-
"@aplus-frontend/
|
|
69
|
-
"@aplus-frontend/
|
|
68
|
+
"@aplus-frontend/utils": "1.0.51",
|
|
69
|
+
"@aplus-frontend/hooks": "1.0.7"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@aplus-frontend/antdv": "^1.0.12",
|