iking-web-ui-pro 0.3.1 → 0.3.2

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,14 +1,14 @@
1
- import { defineComponent as W, computed as y, resolveComponent as h, openBlock as u, createBlock as g, normalizeClass as D, normalizeStyle as I, withCtx as b, createElementBlock as v, createCommentVNode as B, createTextVNode as V, toDisplayString as x, ref as L, Fragment as m, renderList as _, unref as T, mergeProps as S, createVNode as O, createElementVNode as P, mergeModels as N, getCurrentInstance as M, useModel as z, withDirectives as E, vShow as H, renderSlot as R } from "vue";
1
+ import { defineComponent as A, computed as g, resolveComponent as C, openBlock as i, createBlock as b, normalizeClass as j, normalizeStyle as N, withCtx as m, createElementBlock as v, createCommentVNode as V, createTextVNode as x, toDisplayString as _, ref as D, Fragment as h, renderList as T, unref as W, mergeProps as S, createElementVNode as L, mergeModels as w, getCurrentInstance as P, useModel as M, withDirectives as z, createVNode as E, vShow as H, renderSlot as R } from "vue";
2
2
  import { ikDom as F } from "iking-utils-pro";
3
- const A = (e, p) => (e.install = (l) => {
4
- for (const a of [e, ...Object.values({})])
5
- l.component(a.name, a);
6
- }, e), j = (e, p) => {
7
- const l = e.__vccOpts || e;
8
- for (const [a, r] of p)
9
- l[a] = r;
10
- return l;
11
- }, U = /* @__PURE__ */ W({
3
+ const I = (l, f) => (l.install = (e) => {
4
+ for (const r of [l, ...Object.values({})])
5
+ e.component(r.name, r);
6
+ }, l), O = (l, f) => {
7
+ const e = l.__vccOpts || l;
8
+ for (const [r, n] of f)
9
+ e[r] = n;
10
+ return e;
11
+ }, U = /* @__PURE__ */ A({
12
12
  __name: "index",
13
13
  props: {
14
14
  title: {
@@ -17,7 +17,7 @@ const A = (e, p) => (e.install = (l) => {
17
17
  },
18
18
  type: {
19
19
  type: String,
20
- default: ""
20
+ default: "primary"
21
21
  },
22
22
  // 传了type时,color和background不生效
23
23
  // 文字颜色
@@ -36,7 +36,7 @@ const A = (e, p) => (e.install = (l) => {
36
36
  },
37
37
  effect: {
38
38
  type: String,
39
- default: "light"
39
+ default: "plain"
40
40
  },
41
41
  disabled: {
42
42
  type: Boolean,
@@ -66,45 +66,54 @@ const A = (e, p) => (e.install = (l) => {
66
66
  }
67
67
  },
68
68
  emits: ["close"],
69
- setup(e, { emit: p }) {
70
- const l = e, a = y(() => l.type ? l.type === "danger" ? `var(--el-color-${l.type})` : {
71
- color: `var(--ik-color-${l.type})`,
72
- backgroundColor: `var(--ik-color-${l.type}-light)`
73
- } : {
74
- color: l.color,
75
- backgroundColor: l.background,
76
- border: "none"
77
- }), r = p, n = () => {
78
- r("close");
69
+ setup(l, { emit: f }) {
70
+ const e = l, r = g(() => {
71
+ const o = e.type ? e.type === "danger" ? `var(--el-color-${e.type})` : {
72
+ color: `var(--ik-color-${e.type})`,
73
+ backgroundColor: `var(--ik-color-${e.type}-light)`
74
+ } : {
75
+ color: e.color,
76
+ backgroundColor: e.background,
77
+ border: "none"
78
+ };
79
+ if (e.effect === "plain" && e.type !== "danger")
80
+ o.backgroundColor = "transparent", o.borderColor = e.type ? `var(--ik-color-${e.type})` : e.color;
81
+ else if (e.effect === "dark" && e.type !== "danger") {
82
+ const y = e.type ? `var(--ik-color-${e.type})` : e.color;
83
+ o.backgroundColor = y, o.borderColor = y, o.color = "#fff";
84
+ }
85
+ return o;
86
+ }), n = f, s = () => {
87
+ n("close");
79
88
  };
80
- return (f, C) => {
81
- const k = h("el-tag");
82
- return u(), g(k, {
83
- effect: e.effect,
84
- class: D(["ik-statu-tag", { disabled: e.disabled }]),
85
- type: e.type,
86
- style: I(a.value),
87
- closable: f.$attrs.closable && !e.disabled,
88
- onClose: n
89
+ return (o, y) => {
90
+ const k = C("el-tag");
91
+ return i(), b(k, {
92
+ effect: l.effect,
93
+ class: j(["ik-statu-tag", { disabled: l.disabled }]),
94
+ type: l.type,
95
+ style: N(r.value),
96
+ closable: o.$attrs.closable && !l.disabled,
97
+ onClose: s
89
98
  }, {
90
- default: b(() => [
91
- e.circle ? (u(), v(
99
+ default: m(() => [
100
+ l.circle ? (i(), v(
92
101
  "span",
93
102
  {
94
103
  key: 0,
95
104
  class: "inline-block rounded-full",
96
- style: I({
97
- backgroundColor: e.type ? e.type === "danger" ? `var(--el-color-${e.type})` : `var(--ik-color-${e.type})` : e.circleColor,
98
- width: `${e.circleW}px`,
99
- height: `${e.circleH}px`
105
+ style: N({
106
+ backgroundColor: l.type ? l.type === "danger" ? `var(--el-color-${l.type})` : `var(--ik-color-${l.type})` : l.circleColor,
107
+ width: `${l.circleW}px`,
108
+ height: `${l.circleH}px`
100
109
  })
101
110
  },
102
111
  null,
103
112
  4
104
113
  /* STYLE */
105
- )) : B("v-if", !0),
106
- V(
107
- " " + x(e.title),
114
+ )) : V("v-if", !0),
115
+ x(
116
+ " " + _(l.title),
108
117
  1
109
118
  /* TEXT */
110
119
  )
@@ -114,7 +123,7 @@ const A = (e, p) => (e.install = (l) => {
114
123
  }, 8, ["effect", "class", "type", "style", "closable"]);
115
124
  };
116
125
  }
117
- }), q = /* @__PURE__ */ j(U, [["__scopeId", "data-v-5bcf3056"]]), w = A(q), G = /* @__PURE__ */ W({
126
+ }), q = /* @__PURE__ */ O(U, [["__scopeId", "data-v-a3967db7"]]), B = I(q), G = /* @__PURE__ */ A({
118
127
  __name: "index",
119
128
  props: {
120
129
  // 超出长度时以 +2 这样的方式显示
@@ -140,66 +149,65 @@ const A = (e, p) => (e.install = (l) => {
140
149
  }
141
150
  },
142
151
  emits: ["close"],
143
- setup(e, { emit: p }) {
144
- const l = e, a = y(() => Array.isArray(l.list) ? l.list : typeof l.list == "string" ? l.list.split(",").map((o, c) => {
145
- var d;
152
+ setup(l, { emit: f }) {
153
+ const e = l, r = g(() => Array.isArray(e.list) ? e.list : typeof e.list == "string" ? e.list.split(",").map((a, d) => {
154
+ var p;
146
155
  return {
147
- ...((d = l.data) == null ? void 0 : d[c]) || {},
148
- title: o,
156
+ ...((p = e.data) == null ? void 0 : p[d]) || {},
157
+ title: a,
149
158
  type: ""
150
159
  };
151
- }) : []), r = L(null), n = y(() => {
152
- if (r.value) {
153
- const o = r.value.clientWidth;
154
- let c = 24;
155
- const d = [];
156
- let i = 0;
157
- for (const t of a.value) {
160
+ }) : []), n = D(null), s = g(() => {
161
+ if (n.value) {
162
+ const a = n.value.clientWidth;
163
+ let d = 24;
164
+ const p = [];
165
+ let u = 0;
166
+ for (const t of r.value) {
158
167
  const $ = F.useTextWidth(String((t == null ? void 0 : t.title) || t));
159
- c += $ + 40, (c <= o || !i) && d.push(t), i++;
168
+ d += $ + 40, (d <= a || !u) && p.push(t), u++;
160
169
  }
161
- return d;
170
+ return p;
162
171
  }
163
- return a.value;
164
- }), f = y(() => a.value.length - n.value.length), C = y(() => a.value.slice(n.value.length)), k = p, s = (o) => {
165
- k("close", o);
172
+ return r.value;
173
+ }), o = g(() => r.value.length - s.value.length), y = g(() => r.value.slice(s.value.length)), k = f, c = (a) => {
174
+ k("close", a);
166
175
  };
167
- return (o, c) => {
168
- const d = h("el-tag"), i = h("el-popover");
169
- return u(), v(
176
+ return (a, d) => {
177
+ const p = C("el-tag"), u = C("el-popover");
178
+ return i(), v(
170
179
  "div",
171
180
  {
172
181
  ref_key: "containerRef",
173
- ref: r,
182
+ ref: n,
174
183
  class: "tag-container"
175
184
  },
176
185
  [
177
- (u(!0), v(
178
- m,
186
+ (i(!0), v(
187
+ h,
179
188
  null,
180
- _(n.value, (t) => (u(), v(
181
- m,
189
+ T(s.value, (t) => (i(), v(
190
+ h,
182
191
  {
183
192
  key: t.title
184
193
  },
185
194
  [
186
- t.title !== "--" ? (u(), g(T(w), S({
195
+ t.title !== "--" ? (i(), b(W(B), S({
187
196
  key: 0,
188
197
  title: t.title,
189
- onClose: ($) => s(t),
198
+ onClose: ($) => c(t),
190
199
  color: t.color,
191
- background: t.background,
192
- type: t.type,
200
+ type: t.type || "primary",
193
201
  ref_for: !0
194
- }, o.$attrs, {
202
+ }, a.$attrs, {
195
203
  circle: !1,
196
204
  disabled: t == null ? void 0 : t.disabled
197
- }), null, 16, ["title", "onClose", "color", "background", "type", "disabled"])) : (u(), v(
198
- m,
205
+ }), null, 16, ["title", "onClose", "color", "type", "disabled"])) : (i(), v(
206
+ h,
199
207
  { key: 1 },
200
208
  [
201
- V(
202
- x(t.title),
209
+ x(
210
+ _(t.title),
203
211
  1
204
212
  /* TEXT */
205
213
  )
@@ -214,46 +222,46 @@ const A = (e, p) => (e.install = (l) => {
214
222
  128
215
223
  /* KEYED_FRAGMENT */
216
224
  )),
217
- f.value ? (u(), g(i, {
225
+ o.value ? (i(), b(u, {
218
226
  key: 0,
219
227
  placement: "bottom",
220
228
  "popper-class": "ik-statu-over",
221
229
  trigger: "hover"
222
230
  }, {
223
- reference: b(() => [
224
- O(d, {
231
+ reference: m(() => [
232
+ o.value ? (i(), b(p, {
233
+ key: 0,
225
234
  class: "more-tags",
226
235
  type: "info",
227
236
  closable: !1
228
237
  }, {
229
- default: b(() => [
230
- V(
231
- " +" + x(f.value),
238
+ default: m(() => [
239
+ x(
240
+ " +" + _(o.value),
232
241
  1
233
242
  /* TEXT */
234
243
  )
235
244
  ]),
236
245
  _: 1
237
246
  /* STABLE */
238
- })
247
+ })) : V("v-if", !0)
239
248
  ]),
240
- default: b(() => [
241
- P("div", null, [
242
- (u(!0), v(
243
- m,
249
+ default: m(() => [
250
+ L("div", null, [
251
+ (i(!0), v(
252
+ h,
244
253
  null,
245
- _(C.value, (t) => (u(), g(T(w), S({
254
+ T(y.value, (t) => (i(), b(W(B), S({
246
255
  key: t.title,
247
256
  title: t.title,
248
257
  color: t.color,
249
- onClose: ($) => s(t),
250
- background: t.background,
251
- type: t.type,
258
+ onClose: ($) => c(t),
259
+ type: t.type || "primary",
252
260
  circle: !1,
253
261
  ref_for: !0
254
- }, o.$attrs, {
262
+ }, a.$attrs, {
255
263
  disabled: t == null ? void 0 : t.disabled
256
- }), null, 16, ["title", "color", "onClose", "background", "type", "disabled"]))),
264
+ }), null, 16, ["title", "color", "onClose", "type", "disabled"]))),
257
265
  128
258
266
  /* KEYED_FRAGMENT */
259
267
  ))
@@ -261,16 +269,16 @@ const A = (e, p) => (e.install = (l) => {
261
269
  ]),
262
270
  _: 1
263
271
  /* STABLE */
264
- })) : B("v-if", !0)
272
+ })) : V("v-if", !0)
265
273
  ],
266
274
  512
267
275
  /* NEED_PATCH */
268
276
  );
269
277
  };
270
278
  }
271
- }), J = /* @__PURE__ */ j(G, [["__scopeId", "data-v-e872e623"]]), K = A(J), Q = /* @__PURE__ */ W({
279
+ }), J = /* @__PURE__ */ O(G, [["__scopeId", "data-v-84c057e2"]]), K = I(J), Q = /* @__PURE__ */ A({
272
280
  __name: "index",
273
- props: /* @__PURE__ */ N({
281
+ props: /* @__PURE__ */ w({
274
282
  prop: {
275
283
  type: Object,
276
284
  default: () => ({})
@@ -286,49 +294,52 @@ const A = (e, p) => (e.install = (l) => {
286
294
  },
287
295
  modelModifiers: {}
288
296
  }),
289
- emits: /* @__PURE__ */ N(["close"], ["update:modelValue"]),
290
- setup(e, { emit: p }) {
291
- const l = e, a = M(), r = y(() => ({
297
+ emits: /* @__PURE__ */ w(["close"], ["update:modelValue"]),
298
+ setup(l, { emit: f }) {
299
+ const e = l, r = P(), n = g(() => ({
292
300
  label: "label",
293
301
  value: "value",
294
- ...l.prop
295
- })), n = z(e, "modelValue"), f = y(() => {
296
- let s = [];
297
- const o = a == null ? void 0 : a.attrs.options;
298
- return Array.isArray(n.value) ? s = n.value.map((c) => o.find((d) => d[r.value.value] === c)) : n.value && (s = [o.find((c) => c[r.value.value] === n.value)]), {
299
- list: s.map((c) => c[r.value.label]).join(","),
300
- data: s
302
+ ...e.prop
303
+ })), s = M(l, "modelValue"), o = g(() => {
304
+ let c = [];
305
+ const a = r == null ? void 0 : r.attrs.options;
306
+ return Array.isArray(s.value) ? c = s.value.map((d) => a.find((p) => p[n.value.value] === d)) : s.value && (c = [a.find((d) => d[n.value.value] === s.value)]), {
307
+ list: c.map((d) => d[n.value.label]).join(","),
308
+ data: c
301
309
  };
302
- }), C = p, k = (s) => {
303
- n.value = n.value.filter((o) => o !== s[r.value.value]), C("close", s, n.value);
310
+ }), y = f, k = (c) => {
311
+ s.value = s.value.filter((a) => a !== c[n.value.value]), y("close", c, s.value);
304
312
  };
305
- return (s, o) => {
306
- const c = h("el-option"), d = h("el-select");
307
- return u(), g(d, S(s.$attrs, {
313
+ return (c, a) => {
314
+ const d = C("el-option"), p = C("el-select");
315
+ return i(), b(p, S(c.$attrs, {
308
316
  "collapse-tags": !1,
309
- modelValue: n.value,
310
- "onUpdate:modelValue": o[0] || (o[0] = (i) => n.value = i),
317
+ modelValue: s.value,
318
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => s.value = u),
311
319
  "no-data-text": "暂无数据",
312
320
  "no-match-text": "无匹配项"
313
321
  }), {
314
- tag: b(() => [
315
- E(O(T(K), S({
316
- list: f.value.list,
317
- data: f.value.data
318
- }, e.tagProps, { onClose: k }), null, 16, ["list", "data"]), [
319
- [H, f.value]
320
- ])
321
- ]),
322
- default: b(() => [
323
- R(s.$slots, "default", {}, () => [
324
- (u(!0), v(
325
- m,
322
+ tag: m(() => {
323
+ var u, t;
324
+ return [
325
+ z(E(W(K), S({
326
+ list: o.value.list,
327
+ data: o.value.data
328
+ }, l.tagProps, { onClose: k }), null, 16, ["list", "data"]), [
329
+ [H, (t = (u = o.value) == null ? void 0 : u.list) == null ? void 0 : t.length]
330
+ ])
331
+ ];
332
+ }),
333
+ default: m(() => [
334
+ R(c.$slots, "default", {}, () => [
335
+ (i(!0), v(
336
+ h,
326
337
  null,
327
- _(s.$attrs.options, (i) => (u(), g(c, {
328
- key: i[r.value.value],
329
- label: i[r.value.label],
330
- value: i[r.value.value],
331
- disabled: i.disabled
338
+ T(c.$attrs.options, (u) => (i(), b(d, {
339
+ key: u[n.value.value],
340
+ label: u[n.value.label],
341
+ value: u[n.value.value],
342
+ disabled: u.disabled
332
343
  }, null, 8, ["label", "value", "disabled"]))),
333
344
  128
334
345
  /* KEYED_FRAGMENT */
@@ -340,7 +351,7 @@ const A = (e, p) => (e.install = (l) => {
340
351
  }, 16, ["modelValue"]);
341
352
  };
342
353
  }
343
- }), Z = A(Q);
354
+ }), Z = I(Q);
344
355
  export {
345
356
  Z as IkSelectTag,
346
357
  Z as default
@@ -1 +1 @@
1
- (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u.index={},u.vue,u["iking-utils-pro"]))})(this,function(u,e,S){"use strict";const k=(t,f)=>(t.install=o=>{for(const n of[t,...Object.values({})])o.component(n.name,n)},t),h=(t,f)=>{const o=t.__vccOpts||t;for(const[n,r]of f)o[n]=r;return o},C=k(h(e.defineComponent({__name:"index",props:{title:{type:String,default:""},type:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},circleColor:{type:String,default:""},effect:{type:String,default:"light"},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},circleW:{type:Number,default:8},circleH:{type:Number,default:8},borderWidth:{type:Number,default:1},borderType:{type:String,default:"solid"}},emits:["close"],setup(t,{emit:f}){const o=t,n=e.computed(()=>o.type?o.type==="danger"?`var(--el-color-${o.type})`:{color:`var(--ik-color-${o.type})`,backgroundColor:`var(--ik-color-${o.type}-light)`}:{color:o.color,backgroundColor:o.background,border:"none"}),r=f,c=()=>{r("close")};return(y,m)=>{const g=e.resolveComponent("el-tag");return e.openBlock(),e.createBlock(g,{effect:t.effect,class:e.normalizeClass(["ik-statu-tag",{disabled:t.disabled}]),type:t.type,style:e.normalizeStyle(n.value),closable:y.$attrs.closable&&!t.disabled,onClose:c},{default:e.withCtx(()=>[t.circle?(e.openBlock(),e.createElementBlock("span",{key:0,class:"inline-block rounded-full",style:e.normalizeStyle({backgroundColor:t.type?t.type==="danger"?`var(--el-color-${t.type})`:`var(--ik-color-${t.type})`:t.circleColor,width:`${t.circleW}px`,height:`${t.circleH}px`})},null,4)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(t.title),1)]),_:1},8,["effect","class","type","style","closable"])}}}),[["__scopeId","data-v-5bcf3056"]])),$=k(h(e.defineComponent({__name:"index",props:{overfolw:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["close"],setup(t,{emit:f}){const o=t,n=e.computed(()=>Array.isArray(o.list)?o.list:typeof o.list=="string"?o.list.split(",").map((a,i)=>{var d;return{...((d=o.data)==null?void 0:d[i])||{},title:a,type:""}}):[]),r=e.ref(null),c=e.computed(()=>{if(r.value){const a=r.value.clientWidth;let i=24;const d=[];let p=0;for(const l of n.value){const b=S.ikDom.useTextWidth(String((l==null?void 0:l.title)||l));i+=b+40,(i<=a||!p)&&d.push(l),p++}return d}return n.value}),y=e.computed(()=>n.value.length-c.value.length),m=e.computed(()=>n.value.slice(c.value.length)),g=f,s=a=>{g("close",a)};return(a,i)=>{const d=e.resolveComponent("el-tag"),p=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:r,class:"tag-container"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.title},[l.title!=="--"?(e.openBlock(),e.createBlock(e.unref(C),e.mergeProps({key:0,title:l.title,onClose:b=>s(l),color:l.color,background:l.background,type:l.type,ref_for:!0},a.$attrs,{circle:!1,disabled:l==null?void 0:l.disabled}),null,16,["title","onClose","color","background","type","disabled"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.title),1)],64))],64))),128)),y.value?(e.openBlock(),e.createBlock(p,{key:0,placement:"bottom","popper-class":"ik-statu-over",trigger:"hover"},{reference:e.withCtx(()=>[e.createVNode(d,{class:"more-tags",type:"info",closable:!1},{default:e.withCtx(()=>[e.createTextVNode(" +"+e.toDisplayString(y.value),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createBlock(e.unref(C),e.mergeProps({key:l.title,title:l.title,color:l.color,onClose:b=>s(l),background:l.background,type:l.type,circle:!1,ref_for:!0},a.$attrs,{disabled:l==null?void 0:l.disabled}),null,16,["title","color","onClose","background","type","disabled"]))),128))])]),_:1})):e.createCommentVNode("v-if",!0)],512)}}}),[["__scopeId","data-v-e872e623"]])),B=k(e.defineComponent({__name:"index",props:e.mergeModels({prop:{type:Object,default:()=>({})},tagProps:{type:Object,default:()=>({})}},{modelValue:{type:[Array,String],default:""},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(t,{emit:f}){const o=t,n=e.getCurrentInstance(),r=e.computed(()=>({label:"label",value:"value",...o.prop})),c=e.useModel(t,"modelValue"),y=e.computed(()=>{let s=[];const a=n==null?void 0:n.attrs.options;return Array.isArray(c.value)?s=c.value.map(i=>a.find(d=>d[r.value.value]===i)):c.value&&(s=[a.find(i=>i[r.value.value]===c.value)]),{list:s.map(i=>i[r.value.label]).join(","),data:s}}),m=f,g=s=>{c.value=c.value.filter(a=>a!==s[r.value.value]),m("close",s,c.value)};return(s,a)=>{const i=e.resolveComponent("el-option"),d=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(d,e.mergeProps(s.$attrs,{"collapse-tags":!1,modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=p=>c.value=p),"no-data-text":"暂无数据","no-match-text":"无匹配项"}),{tag:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref($),e.mergeProps({list:y.value.list,data:y.value.data},t.tagProps,{onClose:g}),null,16,["list","data"]),[[e.vShow,y.value]])]),default:e.withCtx(()=>[e.renderSlot(s.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.$attrs.options,p=>(e.openBlock(),e.createBlock(i,{key:p[r.value.value],label:p[r.value.label],value:p[r.value.value],disabled:p.disabled},null,8,["label","value","disabled"]))),128))])]),_:3},16,["modelValue"])}}}));u.IkSelectTag=B,u.default=B,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("iking-utils-pro")):typeof define=="function"&&define.amd?define(["exports","vue","iking-utils-pro"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u.index={},u.vue,u["iking-utils-pro"]))})(this,function(u,e,S){"use strict";const k=(o,y)=>(o.install=t=>{for(const n of[o,...Object.values({})])t.component(n.name,n)},o),C=(o,y)=>{const t=o.__vccOpts||o;for(const[n,c]of y)t[n]=c;return t},h=k(C(e.defineComponent({__name:"index",props:{title:{type:String,default:""},type:{type:String,default:"primary"},color:{type:String,default:""},background:{type:String,default:""},circleColor:{type:String,default:""},effect:{type:String,default:"plain"},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},circleW:{type:Number,default:8},circleH:{type:Number,default:8},borderWidth:{type:Number,default:1},borderType:{type:String,default:"solid"}},emits:["close"],setup(o,{emit:y}){const t=o,n=e.computed(()=>{const r=t.type?t.type==="danger"?`var(--el-color-${t.type})`:{color:`var(--ik-color-${t.type})`,backgroundColor:`var(--ik-color-${t.type}-light)`}:{color:t.color,backgroundColor:t.background,border:"none"};if(t.effect==="plain"&&t.type!=="danger")r.backgroundColor="transparent",r.borderColor=t.type?`var(--ik-color-${t.type})`:t.color;else if(t.effect==="dark"&&t.type!=="danger"){const m=t.type?`var(--ik-color-${t.type})`:t.color;r.backgroundColor=m,r.borderColor=m,r.color="#fff"}return r}),c=y,s=()=>{c("close")};return(r,m)=>{const g=e.resolveComponent("el-tag");return e.openBlock(),e.createBlock(g,{effect:o.effect,class:e.normalizeClass(["ik-statu-tag",{disabled:o.disabled}]),type:o.type,style:e.normalizeStyle(n.value),closable:r.$attrs.closable&&!o.disabled,onClose:s},{default:e.withCtx(()=>[o.circle?(e.openBlock(),e.createElementBlock("span",{key:0,class:"inline-block rounded-full",style:e.normalizeStyle({backgroundColor:o.type?o.type==="danger"?`var(--el-color-${o.type})`:`var(--ik-color-${o.type})`:o.circleColor,width:`${o.circleW}px`,height:`${o.circleH}px`})},null,4)):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(o.title),1)]),_:1},8,["effect","class","type","style","closable"])}}}),[["__scopeId","data-v-a3967db7"]])),$=k(C(e.defineComponent({__name:"index",props:{overfolw:{type:Boolean,default:!0},list:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["close"],setup(o,{emit:y}){const t=o,n=e.computed(()=>Array.isArray(t.list)?t.list:typeof t.list=="string"?t.list.split(",").map((a,p)=>{var f;return{...((f=t.data)==null?void 0:f[p])||{},title:a,type:""}}):[]),c=e.ref(null),s=e.computed(()=>{if(c.value){const a=c.value.clientWidth;let p=24;const f=[];let d=0;for(const l of n.value){const b=S.ikDom.useTextWidth(String((l==null?void 0:l.title)||l));p+=b+40,(p<=a||!d)&&f.push(l),d++}return f}return n.value}),r=e.computed(()=>n.value.length-s.value.length),m=e.computed(()=>n.value.slice(s.value.length)),g=y,i=a=>{g("close",a)};return(a,p)=>{const f=e.resolveComponent("el-tag"),d=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:c,class:"tag-container"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:l.title},[l.title!=="--"?(e.openBlock(),e.createBlock(e.unref(h),e.mergeProps({key:0,title:l.title,onClose:b=>i(l),color:l.color,type:l.type||"primary",ref_for:!0},a.$attrs,{circle:!1,disabled:l==null?void 0:l.disabled}),null,16,["title","onClose","color","type","disabled"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.title),1)],64))],64))),128)),r.value?(e.openBlock(),e.createBlock(d,{key:0,placement:"bottom","popper-class":"ik-statu-over",trigger:"hover"},{reference:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(f,{key:0,class:"more-tags",type:"info",closable:!1},{default:e.withCtx(()=>[e.createTextVNode(" +"+e.toDisplayString(r.value),1)]),_:1})):e.createCommentVNode("v-if",!0)]),default:e.withCtx(()=>[e.createElementVNode("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createBlock(e.unref(h),e.mergeProps({key:l.title,title:l.title,color:l.color,onClose:b=>i(l),type:l.type||"primary",circle:!1,ref_for:!0},a.$attrs,{disabled:l==null?void 0:l.disabled}),null,16,["title","color","onClose","type","disabled"]))),128))])]),_:1})):e.createCommentVNode("v-if",!0)],512)}}}),[["__scopeId","data-v-84c057e2"]])),B=k(e.defineComponent({__name:"index",props:e.mergeModels({prop:{type:Object,default:()=>({})},tagProps:{type:Object,default:()=>({})}},{modelValue:{type:[Array,String],default:""},modelModifiers:{}}),emits:e.mergeModels(["close"],["update:modelValue"]),setup(o,{emit:y}){const t=o,n=e.getCurrentInstance(),c=e.computed(()=>({label:"label",value:"value",...t.prop})),s=e.useModel(o,"modelValue"),r=e.computed(()=>{let i=[];const a=n==null?void 0:n.attrs.options;return Array.isArray(s.value)?i=s.value.map(p=>a.find(f=>f[c.value.value]===p)):s.value&&(i=[a.find(p=>p[c.value.value]===s.value)]),{list:i.map(p=>p[c.value.label]).join(","),data:i}}),m=y,g=i=>{s.value=s.value.filter(a=>a!==i[c.value.value]),m("close",i,s.value)};return(i,a)=>{const p=e.resolveComponent("el-option"),f=e.resolveComponent("el-select");return e.openBlock(),e.createBlock(f,e.mergeProps(i.$attrs,{"collapse-tags":!1,modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=d=>s.value=d),"no-data-text":"暂无数据","no-match-text":"无匹配项"}),{tag:e.withCtx(()=>{var d,l;return[e.withDirectives(e.createVNode(e.unref($),e.mergeProps({list:r.value.list,data:r.value.data},o.tagProps,{onClose:g}),null,16,["list","data"]),[[e.vShow,(l=(d=r.value)==null?void 0:d.list)==null?void 0:l.length]])]}),default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.$attrs.options,d=>(e.openBlock(),e.createBlock(p,{key:d[c.value.value],label:d[c.value.label],value:d[c.value.value],disabled:d.disabled},null,8,["label","value","disabled"]))),128))])]),_:3},16,["modelValue"])}}}));u.IkSelectTag=B,u.default=B,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1 +1 @@
1
- .ik-statu-tag[data-v-5bcf3056]{margin:5px 0}.ik-statu-tag[data-v-5bcf3056]:not(:first-child){margin-left:5px}.el-tag[data-v-5bcf3056]{border:none;border-radius:6px}.el-tag--danger[data-v-5bcf3056]{color:var(--ik-color-error);background-color:var(--ik-color-error-light)}.ik-statu-over{width:auto!important;min-width:0!important}.tag-container[data-v-e872e623]{display:flex;width:100%}.tag-container .ik-statu-tag[data-v-e872e623]{max-width:calc(100% - 46px)}.tag-container .el-tag[data-v-e872e623]:not(:last-child){margin-right:5px}.tag-container[data-v-e872e623] .el-tag__content{display:inline-block!important;width:100%;overflow:hidden;text-overflow:ellipsis}.more-tags[data-v-e872e623]{margin:5px 0}
1
+ .ik-statu-tag[data-v-a3967db7]{margin:5px 0}.ik-statu-tag[data-v-a3967db7]:not(:first-child){margin-left:5px}.el-tag[data-v-a3967db7]:not(.el-tag--plain){border:none}.el-tag--danger[data-v-a3967db7]:not(.el-tag--plain){color:var(--ik-color-error);background-color:var(--ik-color-error-light)}.ik-statu-over{width:auto!important;min-width:0!important}.tag-container[data-v-84c057e2]{display:flex;width:100%}.tag-container .ik-statu-tag[data-v-84c057e2]{max-width:calc(100% - 46px)}.tag-container .el-tag[data-v-84c057e2]:not(:last-child){margin-right:5px}.tag-container[data-v-84c057e2] .el-tag__content{display:inline-block!important;width:100%;overflow:hidden;text-overflow:ellipsis}.more-tags[data-v-84c057e2]{margin:5px 0}
@@ -1,8 +1,8 @@
1
- import { defineComponent as s, computed as u, resolveComponent as f, openBlock as a, createBlock as y, normalizeClass as g, normalizeStyle as r, withCtx as b, createElementBlock as p, createCommentVNode as m, createTextVNode as k, toDisplayString as v } from "vue";
2
- const C = (e, o) => (e.install = (t) => {
3
- for (const l of [e, ...Object.values({})])
4
- t.component(l.name, l);
5
- }, e), S = /* @__PURE__ */ s({
1
+ import { defineComponent as f, computed as y, resolveComponent as u, openBlock as n, createBlock as p, normalizeClass as g, normalizeStyle as d, withCtx as b, createElementBlock as k, createCommentVNode as m, createTextVNode as C, toDisplayString as v } from "vue";
2
+ const S = (t, r) => (t.install = (e) => {
3
+ for (const l of [t, ...Object.values({})])
4
+ e.component(l.name, l);
5
+ }, t), $ = /* @__PURE__ */ f({
6
6
  __name: "index",
7
7
  props: {
8
8
  title: {
@@ -11,7 +11,7 @@ const C = (e, o) => (e.install = (t) => {
11
11
  },
12
12
  type: {
13
13
  type: String,
14
- default: ""
14
+ default: "primary"
15
15
  },
16
16
  // 传了type时,color和background不生效
17
17
  // 文字颜色
@@ -30,7 +30,7 @@ const C = (e, o) => (e.install = (t) => {
30
30
  },
31
31
  effect: {
32
32
  type: String,
33
- default: "light"
33
+ default: "plain"
34
34
  },
35
35
  disabled: {
36
36
  type: Boolean,
@@ -60,45 +60,54 @@ const C = (e, o) => (e.install = (t) => {
60
60
  }
61
61
  },
62
62
  emits: ["close"],
63
- setup(e, { emit: o }) {
64
- const t = e, l = u(() => t.type ? t.type === "danger" ? `var(--el-color-${t.type})` : {
65
- color: `var(--ik-color-${t.type})`,
66
- backgroundColor: `var(--ik-color-${t.type}-light)`
67
- } : {
68
- color: t.color,
69
- backgroundColor: t.background,
70
- border: "none"
71
- }), c = o, n = () => {
63
+ setup(t, { emit: r }) {
64
+ const e = t, l = y(() => {
65
+ const o = e.type ? e.type === "danger" ? `var(--el-color-${e.type})` : {
66
+ color: `var(--ik-color-${e.type})`,
67
+ backgroundColor: `var(--ik-color-${e.type}-light)`
68
+ } : {
69
+ color: e.color,
70
+ backgroundColor: e.background,
71
+ border: "none"
72
+ };
73
+ if (e.effect === "plain" && e.type !== "danger")
74
+ o.backgroundColor = "transparent", o.borderColor = e.type ? `var(--ik-color-${e.type})` : e.color;
75
+ else if (e.effect === "dark" && e.type !== "danger") {
76
+ const a = e.type ? `var(--ik-color-${e.type})` : e.color;
77
+ o.backgroundColor = a, o.borderColor = a, o.color = "#fff";
78
+ }
79
+ return o;
80
+ }), c = r, i = () => {
72
81
  c("close");
73
82
  };
74
- return (i, $) => {
75
- const d = f("el-tag");
76
- return a(), y(d, {
77
- effect: e.effect,
78
- class: g(["ik-statu-tag", { disabled: e.disabled }]),
79
- type: e.type,
80
- style: r(l.value),
81
- closable: i.$attrs.closable && !e.disabled,
82
- onClose: n
83
+ return (o, a) => {
84
+ const s = u("el-tag");
85
+ return n(), p(s, {
86
+ effect: t.effect,
87
+ class: g(["ik-statu-tag", { disabled: t.disabled }]),
88
+ type: t.type,
89
+ style: d(l.value),
90
+ closable: o.$attrs.closable && !t.disabled,
91
+ onClose: i
83
92
  }, {
84
93
  default: b(() => [
85
- e.circle ? (a(), p(
94
+ t.circle ? (n(), k(
86
95
  "span",
87
96
  {
88
97
  key: 0,
89
98
  class: "inline-block rounded-full",
90
- style: r({
91
- backgroundColor: e.type ? e.type === "danger" ? `var(--el-color-${e.type})` : `var(--ik-color-${e.type})` : e.circleColor,
92
- width: `${e.circleW}px`,
93
- height: `${e.circleH}px`
99
+ style: d({
100
+ backgroundColor: t.type ? t.type === "danger" ? `var(--el-color-${t.type})` : `var(--ik-color-${t.type})` : t.circleColor,
101
+ width: `${t.circleW}px`,
102
+ height: `${t.circleH}px`
94
103
  })
95
104
  },
96
105
  null,
97
106
  4
98
107
  /* STYLE */
99
108
  )) : m("v-if", !0),
100
- k(
101
- " " + v(e.title),
109
+ C(
110
+ " " + v(t.title),
102
111
  1
103
112
  /* TEXT */
104
113
  )
@@ -108,12 +117,12 @@ const C = (e, o) => (e.install = (t) => {
108
117
  }, 8, ["effect", "class", "type", "style", "closable"]);
109
118
  };
110
119
  }
111
- }), h = (e, o) => {
112
- const t = e.__vccOpts || e;
113
- for (const [l, c] of o)
114
- t[l] = c;
115
- return t;
116
- }, x = /* @__PURE__ */ h(S, [["__scopeId", "data-v-5bcf3056"]]), N = C(x);
120
+ }), h = (t, r) => {
121
+ const e = t.__vccOpts || t;
122
+ for (const [l, c] of r)
123
+ e[l] = c;
124
+ return e;
125
+ }, x = /* @__PURE__ */ h($, [["__scopeId", "data-v-a3967db7"]]), N = S(x);
117
126
  export {
118
127
  N as IkStatu,
119
128
  N as default
@@ -1 +1 @@
1
- (function(o,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.index={},o.vue))})(this,function(o,t){"use strict";const r=((e,n)=>(e.install=l=>{for(const c of[e,...Object.values({})])l.component(c.name,c)},e))(((e,n)=>{const l=e.__vccOpts||e;for(const[c,a]of n)l[c]=a;return l})(t.defineComponent({__name:"index",props:{title:{type:String,default:""},type:{type:String,default:""},color:{type:String,default:""},background:{type:String,default:""},circleColor:{type:String,default:""},effect:{type:String,default:"light"},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},circleW:{type:Number,default:8},circleH:{type:Number,default:8},borderWidth:{type:Number,default:1},borderType:{type:String,default:"solid"}},emits:["close"],setup(e,{emit:n}){const l=e,c=t.computed(()=>l.type?l.type==="danger"?`var(--el-color-${l.type})`:{color:`var(--ik-color-${l.type})`,backgroundColor:`var(--ik-color-${l.type}-light)`}:{color:l.color,backgroundColor:l.background,border:"none"}),a=n,i=()=>{a("close")};return(d,g)=>{const s=t.resolveComponent("el-tag");return t.openBlock(),t.createBlock(s,{effect:e.effect,class:t.normalizeClass(["ik-statu-tag",{disabled:e.disabled}]),type:e.type,style:t.normalizeStyle(c.value),closable:d.$attrs.closable&&!e.disabled,onClose:i},{default:t.withCtx(()=>[e.circle?(t.openBlock(),t.createElementBlock("span",{key:0,class:"inline-block rounded-full",style:t.normalizeStyle({backgroundColor:e.type?e.type==="danger"?`var(--el-color-${e.type})`:`var(--ik-color-${e.type})`:e.circleColor,width:`${e.circleW}px`,height:`${e.circleH}px`})},null,4)):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.title),1)]),_:1},8,["effect","class","type","style","closable"])}}}),[["__scopeId","data-v-5bcf3056"]]));o.IkStatu=r,o.default=r,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.index={},l.vue))})(this,function(l,o){"use strict";const d=((t,n)=>(t.install=e=>{for(const c of[t,...Object.values({})])e.component(c.name,c)},t))(((t,n)=>{const e=t.__vccOpts||t;for(const[c,a]of n)e[c]=a;return e})(o.defineComponent({__name:"index",props:{title:{type:String,default:""},type:{type:String,default:"primary"},color:{type:String,default:""},background:{type:String,default:""},circleColor:{type:String,default:""},effect:{type:String,default:"plain"},disabled:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},circleW:{type:Number,default:8},circleH:{type:Number,default:8},borderWidth:{type:Number,default:1},borderType:{type:String,default:"solid"}},emits:["close"],setup(t,{emit:n}){const e=t,c=o.computed(()=>{const r=e.type?e.type==="danger"?`var(--el-color-${e.type})`:{color:`var(--ik-color-${e.type})`,backgroundColor:`var(--ik-color-${e.type}-light)`}:{color:e.color,backgroundColor:e.background,border:"none"};if(e.effect==="plain"&&e.type!=="danger")r.backgroundColor="transparent",r.borderColor=e.type?`var(--ik-color-${e.type})`:e.color;else if(e.effect==="dark"&&e.type!=="danger"){const i=e.type?`var(--ik-color-${e.type})`:e.color;r.backgroundColor=i,r.borderColor=i,r.color="#fff"}return r}),a=n,s=()=>{a("close")};return(r,i)=>{const f=o.resolveComponent("el-tag");return o.openBlock(),o.createBlock(f,{effect:t.effect,class:o.normalizeClass(["ik-statu-tag",{disabled:t.disabled}]),type:t.type,style:o.normalizeStyle(c.value),closable:r.$attrs.closable&&!t.disabled,onClose:s},{default:o.withCtx(()=>[t.circle?(o.openBlock(),o.createElementBlock("span",{key:0,class:"inline-block rounded-full",style:o.normalizeStyle({backgroundColor:t.type?t.type==="danger"?`var(--el-color-${t.type})`:`var(--ik-color-${t.type})`:t.circleColor,width:`${t.circleW}px`,height:`${t.circleH}px`})},null,4)):o.createCommentVNode("v-if",!0),o.createTextVNode(" "+o.toDisplayString(t.title),1)]),_:1},8,["effect","class","type","style","closable"])}}}),[["__scopeId","data-v-a3967db7"]]));l.IkStatu=d,l.default=d,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1 +1 @@
1
- .ik-statu-tag[data-v-5bcf3056]{margin:5px 0}.ik-statu-tag[data-v-5bcf3056]:not(:first-child){margin-left:5px}.el-tag[data-v-5bcf3056]{border:none;border-radius:6px}.el-tag--danger[data-v-5bcf3056]{color:var(--ik-color-error);background-color:var(--ik-color-error-light)}
1
+ .ik-statu-tag[data-v-a3967db7]{margin:5px 0}.ik-statu-tag[data-v-a3967db7]:not(:first-child){margin-left:5px}.el-tag[data-v-a3967db7]:not(.el-tag--plain){border:none}.el-tag--danger[data-v-a3967db7]:not(.el-tag--plain){color:var(--ik-color-error);background-color:var(--ik-color-error-light)}