@soei/flyweight 0.3.6 → 0.3.8
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/Flyweight.cjs +1 -1
- package/Flyweight.js +31 -31
- package/package.json +1 -1
- package/style.css +1 -1
- package/vue2/index.cjs +1 -1
- package/vue2/index.js +87 -87
- package/vue2/style.css +1 -1
package/Flyweight.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@soei/util"),i=require("vue");let
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@soei/util"),i=require("vue");let I=/(\d+|[+\-\*/]|%)/g,N={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t,s)=>parseFloat(e)/100*s},C=(e,t)=>{let s;if(s=o.runer("match",e,I)){let l=s.length,h,n=0,r,c=[];for(;l--;)n=s.shift(),n in N?(h&&c.push(h),n==="%"&&(c.length=2),r=n):+n&&c.push(+n),c.length==2&&(c.push(t),h=N[r].apply(null,c),c.length=0);+h||(h=+c.pop()),e=h>>0}return e},O={},f=(e,t)=>(e+"").replace(/\w+\((.*)\)/g,"$1").replace(O[t]||(O[t]=new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)","g")),"$1px");const E=(e,t)=>{const s=e.__vccOpts||e;for(const[l,h]of t)s[l]=h;return s};let A=e=>e==null||e==null,M=(...e)=>{console.info("::::FLYWEIGHT",...e)};const V={name:"Flyweight",props:{flys:{type:Array,default:()=>[]},width:{type:[String,Number],default:0},height:{type:[String,Number],default:100},w:{type:[Number,String]},h:{type:[Number,String]},offset:{type:Array,default:()=>[0,0]},lazy:{type:Number,default:100},view:{type:Object,default:()=>({id:0})},index:{type:Number,default:0},top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},auto:{type:[Boolean,String],default:!1},space:{type:Object,default:()=>null},padding:{type:Boolean,default:!1}},computed:{flyweight(){return this.$refs.flyweight||""},style(){var e=this.w,t=this.h,s=this.Size,l={};return o.merge(l,{"--width":f(this.realW),"--height":f(this.realH),"--flyweight-content":f(s)},t&&{"--flyweight-h":f(t)},e&&l,{"--flyweight-w":f(e)},"mix"),l}},data(){return{flyweights:[],actice:!1,Size:null,column:1,row:1,expand:10,count:0,task:[],realW:0,realH:0}},watch:{flys(e){this.count=e.length,this.rebuild();let t=this.task.shift();t&&this.$nextTick(()=>{this.setview(t)})},view:{handler(e){this.setview(e)},immediate:!0,deep:!0},index(e){this.setindex(e)},top(e){this.flyweight.scrollTop=e},left(e){this.flyweight.scrollLeft=e}},mounted(){this.flyweights=[],this.$set||(this.$set=(e,t,s)=>{e[t]=s}),this.setindex(this.index);try{new ResizeObserver(()=>{this.rebuild(),this.$emit("resize")}).observe(this.flyweight)}catch(e){M(e)}this.scrollx=o.runer("hasAttribute",this.flyweight,"scroll-x"),this.BoxRule="clientHeight=>height,clientWidth=>width",this.direction=this.scrollx?"scrollLeft":"scrollTop"},methods:{exec:f,trigger(e,t){o.isArray(e)||(e=e&&t?[[e,t]]:[]),e.length&&this.lazyrun(()=>{o.each(e,(s,l)=>{this.$emit(l[0],A(l[1])?!0:l[1])})})},cheackflys(e){if(!this.flys.length)return e&&this.task.push(e),!0},setview(e){o.runer([this.cheackflys,t=>{t=t||{};let s=t.index||o.each(this.flys,(l,h,n,r)=>{if(h[n]==r)return l},t.picker,t.id);A(s)||this.setindex(s)}],this,e)},setindex(e){o.runer([this.cheackflys,({index:t})=>{this.selectIndex=t,this.$nextTick(()=>{let s=t/this.column>>0,l=this.expand;(this.flyweight[this.direction]/l>>0)+this.row-s-1>0||(this.flyweight[this.direction]=s*l,this.scroll())})}],this,{index:e})},lazyrun(e,t){clearTimeout(this.time),this.time=setTimeout(()=>{o.runer(e)},t||this.lazy)},run(e){let t=[],s=o.runer(this.direction,e.target),l={offset:s,top:s,width:this.realW,height:this.realH,index:s/this.expand>>0};o.merge(l,this.space),e.from||t.push(["onscroll",l]);let h=!1;o.each(this.flyweights,(n,r,c,d,g,u,p,y,a)=>{if(c=n/g>>0,y=c+d*(+(c<u%d)+(u/d>>0)),a=y*g+n%g,a>=this.count){h||(t.push(["onend"]),h=!0);return}r.index=y,r.i=a,r.data=this.flys[a];let m=[y*this.expand+r.x,r.space];p&&m.reverse(),r.top=m[0],r.left=m[1]},null,this.row,this.column,l.index,this.scrollx),this.trigger(t),t=null},scroll(e){this.run(e||{target:this.flyweight,from:"space"})},rebuild(){let e=this.count||this.flys.length,t=this.flyweights;if(!e)return t.length=e;this.count=e;let s=this.scrollx,l=this.flyweight,h=o.picker(l,this.BoxRule);this.$nextTick(()=>{let n=/true/.test(this.auto),[r,c]=this.offset,d=h.width,g=h.height,u=(C(this.width,d)||d)+r,p=C(this.height,g)+c,y=[d/u>>0||1,g/p>>0||1];s&&y.reverse();let[a,m]=y,_=this.padding,b,k=0,w,z;s?(w=u,u-=r,z=S=>S*(p-c)+(S+1)*c):(n?(u=(d-r*(a+2*_-1))/a,b=!_*r,k=_*r):(b=0,k=(d%u+r*a)/(a+1)>>0,u-=r),z=S=>S*(u+b)+(S+1)*k,w=p),this.row=m+2,this.column=a,this.realH=p-c,this.realW=u,this.expand=w,this.Size=Math.ceil(e/a)*w;let T=Math.min(e,a*this.row),x=T-1,$;for(;T-- >0;)$=x-T,this.$set(t,$,{x:r,y:c,width:u,height:p-c,space:z($%a),data:{}});t.length=x+1;let v=[];g/w>x/a&&v.push(["onend"]),this.flyweight&&(this.flyweight[this.direction]=0),this.$nextTick(()=>{this.setindex(this.selectIndex||0),this.scroll()}),v.push(["update:space",{row:(x/a>>0)+1,column:a,showrow:this.row,showcolumn:this.column}]),this.trigger(v)})}}},W={class:"flyweight-all"};function P(e,t,s,l,h,n){return i.openBlock(),i.createElementBlock("div",{ref:"flyweight",class:i.normalizeClass(["flyweight",{"flyweight-active":h.actice}]),style:i.normalizeStyle(n.style),onScroll:t[0]||(t[0]=(...r)=>n.scroll&&n.scroll(...r))},[i.createElementVNode("div",W,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.flyweights,(r,c)=>(i.openBlock(),i.createElementBlock("div",{key:c,style:i.normalizeStyle({top:r.top+"px",left:r.left+"px"})},[i.renderSlot(e.$slots,"default",i.mergeProps({ref_for:!0},r),void 0,!0)],4))),128))]),h.flyweights.length?i.renderSlot(e.$slots,"end",{key:0},void 0,!0):i.createCommentVNode("",!0)],38)}const L=E(V,[["render",P],["__scopeId","data-v-35b94e9b"]]);function B(e,t){return t&&(e=e.replace(/[a-z]/g,"")),e.toLowerCase()}let R={close:{handler(e){this.change(e)},deep:!0},offset:{handler(e){this.margin(e)},deep:!0}},q=["BackGround","BordeR","Height","Width","Top","Right","Bottom","Left"],F={};o.each(q,(e,t,s)=>{e=B(t),F["--"+B(t,!0)]=e,s[e]=function(){this.trigger++}},R);const D={name:"Card",props:{offset:{type:[String,Array],default:()=>[0,0,0,0]},background:{type:String,default:""},border:{type:String,default:"1px"},height:{type:String,default:"100%"},width:{type:String,default:"100%"},show:{type:String,default:""},close:{type:Object,default:null},title:{type:String,default:""}},data(){return{closecss:{},trigger:0,default:{top:"0px",right:"0px",bottom:"0px",left:"0px",height:"100%",width:"100%",background:"",border:"1px"}}},computed:{style(){return this.tr()}},watch:R,methods:{exec:f,isEmpty:o.isEmpty,isSimplyType:o.isSimplyType,tr(){let e={};return this.margin(this.offset),o.each(F,(t,s)=>{this.css(e,t,s)}),e},tolower:B,css(e,t,s){let l=this[s]||this.default[s];!l||this.default[s]==l||(e[t]=f(l))},change(e){o.isSimplyType(e)||(this.closecss=o.picker(e,"color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"))},margin(e){o.merge(this,o.picker(o.isString(e)?e.split(/\s*(?:,|\s+)\s*/):e,"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",!0),!0)}},mounted(){this.change(this.close)}},G={class:"card-title"},U=["title"],X={class:"card-content"};function Y(e,t,s,l,h,n){return i.openBlock(),i.createElementBlock("div",{class:"card",key:h.trigger,style:i.normalizeStyle(n.isEmpty(n.style)?n.tr():n.style)},[i.renderSlot(e.$slots,"default",{},()=>[i.renderSlot(e.$slots,"title",{},()=>{var r;return[i.createElementVNode("div",G,[i.createTextVNode(i.toDisplayString(s.show||s.title)+" ",1),i.createElementVNode("div",{class:i.normalizeClass(["card-close",{hide:n.isSimplyType(s.close)?!s.close:!1}]),style:i.normalizeStyle(h.closecss),onClick:t[0]||(t[0]=c=>e.$emit("close")),title:(r=s.close)==null?void 0:r.tips},null,14,U)])]},!0),i.renderSlot(e.$slots,"content",{},()=>[i.createElementVNode("div",X,[i.renderSlot(e.$slots,"inner",{},void 0,!0)])],!0)],!0)],4)}const H=E(D,[["render",Y],["__scopeId","data-v-2008eeb3"]]),J={name:"Stream",computed:{column(){let{columns:e,T:t}=this,s=e||t;return o.isEmpty(s)?[]:o.isArray(s)?s:[s]}},props:{bridge:{type:String,default:"slot"},type:{type:String,default:"div"},data:{type:Array,default:()=>[]},columns:{type:[Object,Array],default:()=>null},T:{type:[Array,Object],default:()=>null}},methods:{trigger(e){let t=e[this.bridge]||e.type;return(this.$slots||this.$scopedSlots)[t]?t:"default"}}};function K(e,t,s,l,h,n){return i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.type),i.normalizeProps(i.guardReactiveProps(e.$attrs)),{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.column,r=>i.renderSlot(e.$slots,n.trigger(r),i.mergeProps({key:r.type,ref_for:!0},r))),128))]),_:3},16)}const j=E(J,[["render",K]]),Q=[L,H,j],Z={install(e){Q.forEach(t=>{e.component("S"+t.name,t),e.component(t.name+"S",t)})}};exports.Card=H;exports.Flyweight=L;exports.Stream=j;exports.default=Z;
|
package/Flyweight.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { runer as y, merge as A, isArray as P, each as b, picker as H, isEmpty as V, isSimplyType as F, isString as J } from "@soei/util";
|
|
2
|
-
import { openBlock as m, createElementBlock as S, normalizeClass as D, normalizeStyle as
|
|
2
|
+
import { openBlock as m, createElementBlock as S, normalizeClass as D, normalizeStyle as z, createElementVNode as k, Fragment as G, renderList as U, renderSlot as p, mergeProps as X, createCommentVNode as K, createTextVNode as Q, toDisplayString as Z, createBlock as tt, resolveDynamicComponent as et, normalizeProps as st, guardReactiveProps as it, withCtx as lt } from "vue";
|
|
3
3
|
let rt = /(\d+|[+\-\*/]|%)/g, I = {
|
|
4
4
|
"+": (t, e) => t + e,
|
|
5
5
|
"-": (t, e) => t - e,
|
|
@@ -22,7 +22,7 @@ let rt = /(\d+|[+\-\*/]|%)/g, I = {
|
|
|
22
22
|
j[e] || (j[e] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
|
|
23
23
|
"$1px"
|
|
24
24
|
);
|
|
25
|
-
const
|
|
25
|
+
const E = (t, e) => {
|
|
26
26
|
const s = t.__vccOpts || t;
|
|
27
27
|
for (const [l, h] of e)
|
|
28
28
|
s[l] = h;
|
|
@@ -39,11 +39,11 @@ const nt = {
|
|
|
39
39
|
default: () => []
|
|
40
40
|
},
|
|
41
41
|
width: {
|
|
42
|
-
type: Number,
|
|
42
|
+
type: [String, Number],
|
|
43
43
|
default: 0
|
|
44
44
|
},
|
|
45
45
|
height: {
|
|
46
|
-
type: Number,
|
|
46
|
+
type: [String, Number],
|
|
47
47
|
default: 100
|
|
48
48
|
},
|
|
49
49
|
w: {
|
|
@@ -69,12 +69,12 @@ const nt = {
|
|
|
69
69
|
default: 0
|
|
70
70
|
},
|
|
71
71
|
top: {
|
|
72
|
-
type: Number,
|
|
73
|
-
default:
|
|
72
|
+
type: [String, Number],
|
|
73
|
+
default: 0
|
|
74
74
|
},
|
|
75
75
|
left: {
|
|
76
|
-
type: Number,
|
|
77
|
-
default:
|
|
76
|
+
type: [String, Number],
|
|
77
|
+
default: 0
|
|
78
78
|
},
|
|
79
79
|
auto: {
|
|
80
80
|
type: [Boolean, String],
|
|
@@ -244,19 +244,19 @@ const nt = {
|
|
|
244
244
|
this.$nextTick(() => {
|
|
245
245
|
let r = /true/.test(this.auto), [i, n] = this.offset, c = h.width, d = h.height, a = (W(this.width, c) || c) + i, f = W(this.height, d) + n, g = [c / a >> 0 || 1, d / f >> 0 || 1];
|
|
246
246
|
s && g.reverse();
|
|
247
|
-
let [o, w] = g,
|
|
247
|
+
let [o, w] = g, T = this.padding, v, N = 0, x, B;
|
|
248
248
|
s ? (x = a, a -= i, B = (_) => (
|
|
249
249
|
/* 计算top偏移量 */
|
|
250
250
|
_ * (f - n) + (_ + 1) * n
|
|
251
|
-
)) : (r ? (a = (c - i * (o + 2 *
|
|
252
|
-
let C = Math.min(t, o * this.row), $ = C - 1,
|
|
251
|
+
)) : (r ? (a = (c - i * (o + 2 * T - 1)) / o, v = !T * i, N = T * i) : (v = 0, N = (c % a + i * o) / (o + 1) >> 0, a -= i), B = (_) => _ * (a + v) + (_ + 1) * N, x = f), this.row = w + 2, this.column = o, this.realH = f - n, this.realW = a, this.expand = x, this.Size = Math.ceil(t / o) * x;
|
|
252
|
+
let C = Math.min(t, o * this.row), $ = C - 1, O;
|
|
253
253
|
for (; C-- > 0; )
|
|
254
|
-
|
|
254
|
+
O = $ - C, this.$set(e, O, {
|
|
255
255
|
x: i,
|
|
256
256
|
y: n,
|
|
257
257
|
width: a,
|
|
258
258
|
height: f - n,
|
|
259
|
-
space: B(
|
|
259
|
+
space: B(O % o),
|
|
260
260
|
data: {}
|
|
261
261
|
});
|
|
262
262
|
e.length = $ + 1;
|
|
@@ -279,13 +279,13 @@ function at(t, e, s, l, h, r) {
|
|
|
279
279
|
class: D(["flyweight", {
|
|
280
280
|
"flyweight-active": h.actice
|
|
281
281
|
}]),
|
|
282
|
-
style:
|
|
282
|
+
style: z(r.style),
|
|
283
283
|
onScroll: e[0] || (e[0] = (...i) => r.scroll && r.scroll(...i))
|
|
284
284
|
}, [
|
|
285
|
-
|
|
285
|
+
k("div", ot, [
|
|
286
286
|
(m(!0), S(G, null, U(h.flyweights, (i, n) => (m(), S("div", {
|
|
287
287
|
key: n,
|
|
288
|
-
style:
|
|
288
|
+
style: z({
|
|
289
289
|
top: i.top + "px",
|
|
290
290
|
left: i.left + "px"
|
|
291
291
|
})
|
|
@@ -296,8 +296,8 @@ function at(t, e, s, l, h, r) {
|
|
|
296
296
|
h.flyweights.length ? p(t.$slots, "end", { key: 0 }, void 0, !0) : K("", !0)
|
|
297
297
|
], 38);
|
|
298
298
|
}
|
|
299
|
-
const ct = /* @__PURE__ */
|
|
300
|
-
function
|
|
299
|
+
const ct = /* @__PURE__ */ E(nt, [["render", at], ["__scopeId", "data-v-35b94e9b"]]);
|
|
300
|
+
function L(t, e) {
|
|
301
301
|
return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
|
|
302
302
|
}
|
|
303
303
|
let Y = {
|
|
@@ -326,7 +326,7 @@ let Y = {
|
|
|
326
326
|
b(
|
|
327
327
|
ut,
|
|
328
328
|
(t, e, s) => {
|
|
329
|
-
t =
|
|
329
|
+
t = L(e), q["--" + L(e, !0)] = t, s[t] = function() {
|
|
330
330
|
this.trigger++;
|
|
331
331
|
};
|
|
332
332
|
},
|
|
@@ -402,7 +402,7 @@ const dt = {
|
|
|
402
402
|
this.css(t, e, s);
|
|
403
403
|
}), t;
|
|
404
404
|
},
|
|
405
|
-
tolower:
|
|
405
|
+
tolower: L,
|
|
406
406
|
css(t, e, s) {
|
|
407
407
|
let l = this[s] || this.default[s];
|
|
408
408
|
!l || this.default[s] == l || (t[e] = u(l));
|
|
@@ -433,17 +433,17 @@ function yt(t, e, s, l, h, r) {
|
|
|
433
433
|
return m(), S("div", {
|
|
434
434
|
class: "card",
|
|
435
435
|
key: h.trigger,
|
|
436
|
-
style:
|
|
436
|
+
style: z(r.isEmpty(r.style) ? r.tr() : r.style)
|
|
437
437
|
}, [
|
|
438
438
|
p(t.$slots, "default", {}, () => [
|
|
439
439
|
p(t.$slots, "title", {}, () => {
|
|
440
440
|
var i;
|
|
441
441
|
return [
|
|
442
|
-
|
|
442
|
+
k("div", ft, [
|
|
443
443
|
Q(Z(s.show || s.title) + " ", 1),
|
|
444
|
-
|
|
444
|
+
k("div", {
|
|
445
445
|
class: D(["card-close", { hide: r.isSimplyType(s.close) ? !s.close : !1 }]),
|
|
446
|
-
style:
|
|
446
|
+
style: z(h.closecss),
|
|
447
447
|
onClick: e[0] || (e[0] = (n) => t.$emit("close")),
|
|
448
448
|
title: (i = s.close) == null ? void 0 : i.tips
|
|
449
449
|
}, null, 14, gt)
|
|
@@ -451,14 +451,14 @@ function yt(t, e, s, l, h, r) {
|
|
|
451
451
|
];
|
|
452
452
|
}, !0),
|
|
453
453
|
p(t.$slots, "content", {}, () => [
|
|
454
|
-
|
|
454
|
+
k("div", pt, [
|
|
455
455
|
p(t.$slots, "inner", {}, void 0, !0)
|
|
456
456
|
])
|
|
457
457
|
], !0)
|
|
458
458
|
], !0)
|
|
459
459
|
], 4);
|
|
460
460
|
}
|
|
461
|
-
const mt = /* @__PURE__ */
|
|
461
|
+
const mt = /* @__PURE__ */ E(dt, [["render", yt], ["__scopeId", "data-v-2008eeb3"]]), wt = {
|
|
462
462
|
name: "Stream",
|
|
463
463
|
computed: {
|
|
464
464
|
column() {
|
|
@@ -481,18 +481,18 @@ const mt = /* @__PURE__ */ O(dt, [["render", yt], ["__scopeId", "data-v-c1ad1d74
|
|
|
481
481
|
default: () => []
|
|
482
482
|
},
|
|
483
483
|
columns: {
|
|
484
|
-
type: Array,
|
|
484
|
+
type: [Object, Array],
|
|
485
485
|
default: () => null
|
|
486
486
|
},
|
|
487
487
|
T: {
|
|
488
|
-
type: Array,
|
|
488
|
+
type: [Array, Object],
|
|
489
489
|
default: () => null
|
|
490
490
|
}
|
|
491
491
|
},
|
|
492
492
|
methods: {
|
|
493
493
|
trigger(t) {
|
|
494
494
|
let e = t[this.bridge] || t.type;
|
|
495
|
-
return (this.$
|
|
495
|
+
return (this.$slots || this.$scopedSlots)[e] ? e : "default";
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
};
|
|
@@ -507,7 +507,7 @@ function xt(t, e, s, l, h, r) {
|
|
|
507
507
|
_: 3
|
|
508
508
|
}, 16);
|
|
509
509
|
}
|
|
510
|
-
const _t = /* @__PURE__ */
|
|
510
|
+
const _t = /* @__PURE__ */ E(wt, [["render", xt]]), bt = [ct, mt, _t], kt = {
|
|
511
511
|
install(t) {
|
|
512
512
|
bt.forEach((e) => {
|
|
513
513
|
t.component("S" + e.name, e), t.component(e.name + "S", e);
|
|
@@ -518,5 +518,5 @@ export {
|
|
|
518
518
|
mt as Card,
|
|
519
519
|
ct as Flyweight,
|
|
520
520
|
_t as Stream,
|
|
521
|
-
|
|
521
|
+
kt as default
|
|
522
522
|
};
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.flyweight[data-v-
|
|
1
|
+
@charset "UTF-8";.flyweight[data-v-35b94e9b]{height:var(--flyweight-h, 100%);width:var(--flyweight-w, 100%);overflow:auto;position:relative}.flyweight[hover-scroll][data-v-35b94e9b]::-webkit-scrollbar-track,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar-track{border-radius:10px}.flyweight[hover-scroll][data-v-35b94e9b]::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.flyweight[hover-scroll][data-v-35b94e9b]::-webkit-scrollbar,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.flyweight[hover-scroll][data-v-35b94e9b]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.flyweight[hover-scroll][data-v-35b94e9b]:hover::-webkit-scrollbar-thumb:hover,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.flyweight[hover-scroll][data-v-35b94e9b]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-35b94e9b]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.flyweight[scroll-x] .flyweight-all[data-v-35b94e9b]{width:var(--flyweight-content);height:auto;min-height:100%}.flyweight[scroll-x] .flyweight-all[data-v-35b94e9b]+*{left:var(--flyweight-content);position:absolute;top:0;height:100%}.flyweight .flyweight-all[data-v-35b94e9b]{height:var(--flyweight-content)}.flyweight .flyweight-all[data-v-35b94e9b]>*{width:calc(var(--width));height:var(--height);position:absolute}@media screen and (-apple-system: Macintosh){.flyweight .flyweight-all[data-v-35b94e9b]{background-color:red!important}}.card[data-v-2008eeb3]{--t: 0px;--r: 0px;--b: 0px;--l: 0px;--h: 100%;--w: 100%;--br: 1px;position:relative;background-color:var(--bg, var(--card-background-color, #fff));padding:var(--card-padding, 10px);border-radius:var(--card-border-radius, 10px);box-sizing:border-box;border-style:solid;border-color:var(--card-border-color, #555);border-width:var(--br);justify-content:flex-start;margin:var(--t) var(--r) var(--b) var(--l);height:calc(var(--h) - var(--t) - var(--b));width:calc(var(--w) - var(--l) - var(--r));overflow:auto}.card[hover-scroll][data-v-2008eeb3]::-webkit-scrollbar-track,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar-track{border-radius:10px}.card[hover-scroll][data-v-2008eeb3]::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.card[hover-scroll][data-v-2008eeb3]::-webkit-scrollbar,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.card[hover-scroll][data-v-2008eeb3]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.card[hover-scroll][data-v-2008eeb3]:hover::-webkit-scrollbar-thumb:hover,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.card[hover-scroll][data-v-2008eeb3]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-2008eeb3]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.card[simply][data-v-2008eeb3],.card [simply][data-v-2008eeb3]{background-color:inherit;border:0!important}.card[flex][data-v-2008eeb3],.card [flex][data-v-2008eeb3]{display:flex}.card[column][data-v-2008eeb3],.card [column][data-v-2008eeb3]{flex-direction:column}.card[row][data-v-2008eeb3],.card [row][data-v-2008eeb3]{flex-direction:row}.card[center][data-v-2008eeb3],.card [center][data-v-2008eeb3]{justify-content:center}.card[vcenter][data-v-2008eeb3],.card [vcenter][data-v-2008eeb3]{align-items:center}.card .card-title[data-v-2008eeb3]{max-height:40px}.card .card-close[data-v-2008eeb3]{position:absolute;width:20px;height:20px;right:10px;top:10px;border-radius:10px;z-index:1;--s-transform: 45deg;--s-hover-transform: 35deg;--s-close-width: 11px;--s-close-height: 2px;cursor:pointer;background-color:var(--s-card-close-background-color, transparent);transition:all .3s ease}.card .card-close.hide[data-v-2008eeb3]{display:none}.card .card-close[data-v-2008eeb3]:before,.card .card-close[data-v-2008eeb3]:after{content:"";width:var(--s-close-width, 11px);height:var(--s-close-height, 2px);background-color:var(--s-card-close-color, #555);transform-origin:center;position:inherit;border-radius:10px;top:calc(50% - var(--s-close-height, 2px) / 2);left:calc(50% - var(--s-close-width, 11px) / 2)}.card .card-close[data-v-2008eeb3]:before{transform:rotate(var(--s-transform, 45deg))}.card .card-close[data-v-2008eeb3]:after{transform:rotate(calc(0deg - var(--s-transform, 45deg)))}.card .card-close[data-v-2008eeb3]:hover:before{transform:rotate(var(--s-hover-transform, 45deg))}.card .card-close[data-v-2008eeb3]:hover:after{transform:rotate(calc(0deg - var(--s-hover-transform, 45deg)))}.card .card-content[data-v-2008eeb3]{overflow:auto;height:100%}.card .card-content[data-v-2008eeb3]:before{background:linear-gradient(90deg,transparent,var(--card-line-color, transparent),var(--card-line-color, transparent),transparent);content:"";display:block;position:sticky;top:0;width:100%;height:1px;z-index:10;transition:opacity .5s ease-in-out}
|
package/vue2/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@soei/util");let W=/(\d+|[+\-\*/]|%)/g,R={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t,i)=>parseFloat(e)/100*i},N=(e,t)=>{let i;if(i=h.runer("match",e,W)){let s=i.length,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@soei/util");let W=/(\d+|[+\-\*/]|%)/g,R={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t,i)=>parseFloat(e)/100*i},N=(e,t)=>{let i;if(i=h.runer("match",e,W)){let s=i.length,r,c=0,l,o=[];for(;s--;)c=i.shift(),c in R?(r&&o.push(r),c==="%"&&(o.length=2),l=c):+c&&o.push(+c),o.length==2&&(o.push(t),r=R[l].apply(null,o),o.length=0);+r||(r=+o.pop()),e=r>>0}return e},O={},y=(e,t)=>(e+"").replace(/\w+\((.*)\)/g,"$1").replace(O[t]||(O[t]=new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)","g")),"$1px");function k(e,t,i,s,r,c,l,o){var n=typeof e=="function"?e.options:e;t&&(n.render=t,n.staticRenderFns=i,n._compiled=!0),s&&(n.functional=!0),c&&(n._scopeId="data-v-"+c);var f;if(l?(f=function(u){u=u||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!u&&typeof __VUE_SSR_CONTEXT__<"u"&&(u=__VUE_SSR_CONTEXT__),r&&r.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(l)},n._ssrRegister=f):r&&(f=o?function(){r.call(this,(n.functional?this.parent:this).$root.$options.shadowRoot)}:r),f)if(n.functional){n._injectStyles=f;var d=n.render;n.render=function(a,g){return f.call(g),d(a,g)}}else{var p=n.beforeCreate;n.beforeCreate=p?[].concat(p,f):[f]}return{exports:e,options:n}}let F=e=>e==null||e==null,M=(...e)=>{console.info("::::FLYWEIGHT",...e)};const j={name:"Flyweight",props:{flys:{type:Array,default:()=>[]},width:{type:[String,Number],default:0},height:{type:[String,Number],default:100},w:{type:[Number,String]},h:{type:[Number,String]},offset:{type:Array,default:()=>[0,0]},lazy:{type:Number,default:100},view:{type:Object,default:()=>({id:0})},index:{type:Number,default:0},top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},auto:{type:[Boolean,String],default:!1},space:{type:Object,default:()=>null},padding:{type:Boolean,default:!1}},computed:{flyweight(){return this.$refs.flyweight||""},style(){var e=this.w,t=this.h,i=this.Size,s={};return h.merge(s,{"--width":y(this.realW),"--height":y(this.realH),"--flyweight-content":y(i)},t&&{"--flyweight-h":y(t)},e&&s,{"--flyweight-w":y(e)},"mix"),s}},data(){return{flyweights:[],actice:!1,Size:null,column:1,row:1,expand:10,count:0,task:[],realW:0,realH:0}},watch:{flys(e){this.count=e.length,this.rebuild();let t=this.task.shift();t&&this.$nextTick(()=>{this.setview(t)})},view:{handler(e){this.setview(e)},immediate:!0,deep:!0},index(e){this.setindex(e)},top(e){this.flyweight.scrollTop=e},left(e){this.flyweight.scrollLeft=e}},mounted(){this.flyweights=[],this.$set||(this.$set=(e,t,i)=>{e[t]=i}),this.setindex(this.index);try{new ResizeObserver(()=>{this.rebuild(),this.$emit("resize")}).observe(this.flyweight)}catch(e){M(e)}this.scrollx=h.runer("hasAttribute",this.flyweight,"scroll-x"),this.BoxRule="clientHeight=>height,clientWidth=>width",this.direction=this.scrollx?"scrollLeft":"scrollTop"},methods:{exec:y,trigger(e,t){h.isArray(e)||(e=e&&t?[[e,t]]:[]),e.length&&this.lazyrun(()=>{h.each(e,(i,s)=>{this.$emit(s[0],F(s[1])?!0:s[1])})})},cheackflys(e){if(!this.flys.length)return e&&this.task.push(e),!0},setview(e){h.runer([this.cheackflys,t=>{t=t||{};let i=t.index||h.each(this.flys,(s,r,c,l)=>{if(r[c]==l)return s},t.picker,t.id);F(i)||this.setindex(i)}],this,e)},setindex(e){h.runer([this.cheackflys,({index:t})=>{this.selectIndex=t,this.$nextTick(()=>{let i=t/this.column>>0,s=this.expand;(this.flyweight[this.direction]/s>>0)+this.row-i-1>0||(this.flyweight[this.direction]=i*s,this.scroll())})}],this,{index:e})},lazyrun(e,t){clearTimeout(this.time),this.time=setTimeout(()=>{h.runer(e)},t||this.lazy)},run(e){let t=[],i=h.runer(this.direction,e.target),s={offset:i,top:i,width:this.realW,height:this.realH,index:i/this.expand>>0};h.merge(s,this.space),e.from||t.push(["onscroll",s]);let r=!1;h.each(this.flyweights,(c,l,o,n,f,d,p,u,a)=>{if(o=c/f>>0,u=o+n*(+(o<d%n)+(d/n>>0)),a=u*f+c%f,a>=this.count){r||(t.push(["onend"]),r=!0);return}l.index=u,l.i=a,l.data=this.flys[a];let g=[u*this.expand+l.x,l.space];p&&g.reverse(),l.top=g[0],l.left=g[1]},null,this.row,this.column,s.index,this.scrollx),this.trigger(t),t=null},scroll(e){this.run(e||{target:this.flyweight,from:"space"})},rebuild(){let e=this.count||this.flys.length,t=this.flyweights;if(!e)return t.length=e;this.count=e;let i=this.scrollx,s=this.flyweight,r=h.picker(s,this.BoxRule);this.$nextTick(()=>{let c=/true/.test(this.auto),[l,o]=this.offset,n=r.width,f=r.height,d=(N(this.width,n)||n)+l,p=N(this.height,f)+o,u=[n/d>>0||1,f/p>>0||1];i&&u.reverse();let[a,g]=u,x=this.padding,b,v=0,_,S;i?(_=d,d-=l,S=m=>m*(p-o)+(m+1)*o):(c?(d=(n-l*(a+2*x-1))/a,b=!x*l,v=x*l):(b=0,v=(n%d+l*a)/(a+1)>>0,d-=l),S=m=>m*(d+b)+(m+1)*v,_=p),this.row=g+2,this.column=a,this.realH=p-o,this.realW=d,this.expand=_,this.Size=Math.ceil(e/a)*_;let $=Math.min(e,a*this.row),w=$-1,T;for(;$-- >0;)T=w-$,this.$set(t,T,{x:l,y:o,width:d,height:p-o,space:S(T%a),data:{}});t.length=w+1;let C=[];f/_>w/a&&C.push(["onend"]),this.flyweight&&(this.flyweight[this.direction]=0),this.$nextTick(()=>{this.setindex(this.selectIndex||0),this.scroll()}),C.push(["update:space",{row:(w/a>>0)+1,column:a,showrow:this.row,showcolumn:this.column}]),this.trigger(C)})}}};var I=function(){var t=this,i=t._self._c;return i("div",{ref:"flyweight",staticClass:"flyweight",class:{"flyweight-active":t.actice},style:t.style,on:{scroll:t.scroll}},[i("div",{staticClass:"flyweight-all"},t._l(t.flyweights,function(s,r){return i("div",{key:r,style:{top:s.top+"px",left:s.left+"px"}},[t._t("default",null,null,s)],2)}),0),t.flyweights.length?t._t("end"):t._e()],2)},U=[],X=k(j,I,U,!1,null,"d5f1cd63",null,null);const A=X.exports;function z(e,t){return t&&(e=e.replace(/[a-z]/g,"")),e.toLowerCase()}let E={close:{handler(e){this.change(e)},deep:!0},offset:{handler(e){this.margin(e)},deep:!0}},G=["BackGround","BordeR","Height","Width","Top","Right","Bottom","Left"],H={};h.each(G,(e,t,i)=>{e=z(t),H["--"+z(t,!0)]=e,i[e]=function(){this.trigger++}},E);const V={name:"Card",props:{offset:{type:[String,Array],default:()=>[0,0,0,0]},background:{type:String,default:""},border:{type:String,default:"1px"},height:{type:String,default:"100%"},width:{type:String,default:"100%"},show:{type:String,default:""},close:{type:Object,default:null},title:{type:String,default:""}},data(){return{closecss:{},trigger:0,default:{top:"0px",right:"0px",bottom:"0px",left:"0px",height:"100%",width:"100%",background:"",border:"1px"}}},computed:{style(){return this.tr()}},watch:E,methods:{exec:y,isEmpty:h.isEmpty,isSimplyType:h.isSimplyType,tr(){let e={};return this.margin(this.offset),h.each(H,(t,i)=>{this.css(e,t,i)}),e},tolower:z,css(e,t,i){let s=this[i]||this.default[i];!s||this.default[i]==s||(e[t]=y(s))},change(e){h.isSimplyType(e)||(this.closecss=h.picker(e,"color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"))},margin(e){h.merge(this,h.picker(h.isString(e)?e.split(/\s*(?:,|\s+)\s*/):e,"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",!0),!0)}},mounted(){this.change(this.close)}};var q=function(){var t=this,i=t._self._c;return i("div",{key:t.trigger,staticClass:"card",style:t.isEmpty(t.style)?t.tr():t.style},[t._t("default",function(){return[t._t("title",function(){var s;return[i("div",{staticClass:"card-title"},[t._v(" "+t._s(t.show||t.title)+" "),i("div",{staticClass:"card-close",class:{hide:t.isSimplyType(t.close)?!t.close:!1},style:t.closecss,attrs:{title:(s=t.close)==null?void 0:s.tips},on:{click:function(r){return t.$emit("close")}}})])]}),t._t("content",function(){return[i("div",{staticClass:"card-content"},[t._t("inner")],2)]})]})],2)},P=[],Y=k(V,q,P,!1,null,"ec96bb2a",null,null);const B=Y.exports,D={name:"Stream",computed:{column(){let{columns:e,T:t}=this,i=e||t;return h.isEmpty(i)?[]:h.isArray(i)?i:[i]}},props:{bridge:{type:String,default:"slot"},type:{type:String,default:"div"},data:{type:Array,default:()=>[]},columns:{type:[Object,Array],default:()=>null},T:{type:[Array,Object],default:()=>null}},methods:{trigger(e){let t=e[this.bridge]||e.type;return(this.$slots||this.$scopedSlots)[t]?t:"default"}}};var J=function(){var t=this,i=t._self._c;return i(t.type,t._b({tag:"component"},"component",t.$attrs,!1),[t._l(t.column,function(s){return t._t(t.trigger(s),null,null,s)})],2)},K=[],Q=k(D,J,K,!1,null,null,null,null);const L=Q.exports,Z=[A,B,L],tt={install(e){Z.forEach(t=>{e.component("S"+t.name,t),e.component(t.name+"S",t)})}};exports.Card=B;exports.Flyweight=A;exports.Stream=L;exports.default=tt;
|
package/vue2/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { runer as y, merge as R, isArray as W, each as w, picker as k, isEmpty as E, isSimplyType as
|
|
2
|
-
let
|
|
1
|
+
import { runer as y, merge as R, isArray as W, each as w, picker as k, isEmpty as E, isSimplyType as F, isString as j } from "@soei/util";
|
|
2
|
+
let U = /(\d+|[+\-\*/]|%)/g, A = {
|
|
3
3
|
"+": (e, t) => e + t,
|
|
4
4
|
"-": (e, t) => e - t,
|
|
5
5
|
"*": (e, t) => e * t,
|
|
6
6
|
"/": (e, t) => e / t,
|
|
7
|
-
"%": (e, t,
|
|
8
|
-
},
|
|
9
|
-
let
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
for (;
|
|
13
|
-
a =
|
|
7
|
+
"%": (e, t, i) => parseFloat(e) / 100 * i
|
|
8
|
+
}, H = (e, t) => {
|
|
9
|
+
let i;
|
|
10
|
+
if (i = y("match", e, U)) {
|
|
11
|
+
let s = i.length, l, a = 0, r, h = [];
|
|
12
|
+
for (; s--; )
|
|
13
|
+
a = i.shift(), a in A ? (l && h.push(l), a === "%" && (h.length = 2), r = a) : +a && h.push(+a), h.length == 2 && (h.push(t), l = A[r].apply(null, h), h.length = 0);
|
|
14
14
|
+l || (l = +h.pop()), e = l >> 0;
|
|
15
15
|
}
|
|
16
16
|
return e;
|
|
17
|
-
},
|
|
17
|
+
}, B = {}, g = (e, t) => (e + "").replace(
|
|
18
18
|
/\w+\((.*)\)/g,
|
|
19
19
|
"$1"
|
|
20
20
|
).replace(
|
|
21
|
-
|
|
21
|
+
B[t] || (B[t] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
|
|
22
22
|
"$1px"
|
|
23
23
|
);
|
|
24
|
-
function
|
|
24
|
+
function O(e, t, i, s, l, a, r, h) {
|
|
25
25
|
var n = typeof e == "function" ? e.options : e;
|
|
26
|
-
t && (n.render = t, n.staticRenderFns =
|
|
26
|
+
t && (n.render = t, n.staticRenderFns = i, n._compiled = !0), s && (n.functional = !0), a && (n._scopeId = "data-v-" + a);
|
|
27
27
|
var u;
|
|
28
28
|
if (r ? (u = function(c) {
|
|
29
29
|
c = c || // cached call
|
|
@@ -50,10 +50,10 @@ function F(e, t, s, i, l, a, r, h) {
|
|
|
50
50
|
options: n
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
let
|
|
53
|
+
let L = (e) => e == null || e == null, X = (...e) => {
|
|
54
54
|
console.info("::::FLYWEIGHT", ...e);
|
|
55
55
|
};
|
|
56
|
-
const
|
|
56
|
+
const G = {
|
|
57
57
|
name: "Flyweight",
|
|
58
58
|
props: {
|
|
59
59
|
flys: {
|
|
@@ -61,11 +61,11 @@ const V = {
|
|
|
61
61
|
default: () => []
|
|
62
62
|
},
|
|
63
63
|
width: {
|
|
64
|
-
type: Number,
|
|
64
|
+
type: [String, Number],
|
|
65
65
|
default: 0
|
|
66
66
|
},
|
|
67
67
|
height: {
|
|
68
|
-
type: Number,
|
|
68
|
+
type: [String, Number],
|
|
69
69
|
default: 100
|
|
70
70
|
},
|
|
71
71
|
w: {
|
|
@@ -91,12 +91,12 @@ const V = {
|
|
|
91
91
|
default: 0
|
|
92
92
|
},
|
|
93
93
|
top: {
|
|
94
|
-
type: Number,
|
|
95
|
-
default:
|
|
94
|
+
type: [String, Number],
|
|
95
|
+
default: 0
|
|
96
96
|
},
|
|
97
97
|
left: {
|
|
98
|
-
type: Number,
|
|
99
|
-
default:
|
|
98
|
+
type: [String, Number],
|
|
99
|
+
default: 0
|
|
100
100
|
},
|
|
101
101
|
auto: {
|
|
102
102
|
type: [Boolean, String],
|
|
@@ -116,16 +116,16 @@ const V = {
|
|
|
116
116
|
return this.$refs.flyweight || "";
|
|
117
117
|
},
|
|
118
118
|
style() {
|
|
119
|
-
var e = this.w, t = this.h,
|
|
120
|
-
return R(
|
|
119
|
+
var e = this.w, t = this.h, i = this.Size, s = {};
|
|
120
|
+
return R(s, {
|
|
121
121
|
"--width": g(this.realW),
|
|
122
122
|
"--height": g(this.realH),
|
|
123
|
-
"--flyweight-content": g(
|
|
123
|
+
"--flyweight-content": g(i)
|
|
124
124
|
}, t && {
|
|
125
125
|
"--flyweight-h": g(t)
|
|
126
|
-
}, e &&
|
|
126
|
+
}, e && s, {
|
|
127
127
|
"--flyweight-w": g(e)
|
|
128
|
-
}, "mix"),
|
|
128
|
+
}, "mix"), s;
|
|
129
129
|
}
|
|
130
130
|
},
|
|
131
131
|
data() {
|
|
@@ -168,15 +168,15 @@ const V = {
|
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
mounted() {
|
|
171
|
-
this.flyweights = [], this.$set || (this.$set = (e, t,
|
|
172
|
-
e[t] =
|
|
171
|
+
this.flyweights = [], this.$set || (this.$set = (e, t, i) => {
|
|
172
|
+
e[t] = i;
|
|
173
173
|
}), this.setindex(this.index);
|
|
174
174
|
try {
|
|
175
175
|
new ResizeObserver(() => {
|
|
176
176
|
this.rebuild(), this.$emit("resize");
|
|
177
177
|
}).observe(this.flyweight);
|
|
178
178
|
} catch (e) {
|
|
179
|
-
|
|
179
|
+
X(e);
|
|
180
180
|
}
|
|
181
181
|
this.scrollx = y("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
|
|
182
182
|
"clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
|
|
@@ -185,8 +185,8 @@ const V = {
|
|
|
185
185
|
exec: g,
|
|
186
186
|
trigger(e, t) {
|
|
187
187
|
W(e) || (e = e && t ? [[e, t]] : []), e.length && this.lazyrun(() => {
|
|
188
|
-
w(e, (
|
|
189
|
-
this.$emit(
|
|
188
|
+
w(e, (i, s) => {
|
|
189
|
+
this.$emit(s[0], L(s[1]) ? !0 : s[1]);
|
|
190
190
|
});
|
|
191
191
|
});
|
|
192
192
|
},
|
|
@@ -197,18 +197,18 @@ const V = {
|
|
|
197
197
|
setview(e) {
|
|
198
198
|
y([this.cheackflys, (t) => {
|
|
199
199
|
t = t || {};
|
|
200
|
-
let
|
|
200
|
+
let i = t.index || w(this.flys, (s, l, a, r) => {
|
|
201
201
|
if (l[a] == r)
|
|
202
|
-
return
|
|
202
|
+
return s;
|
|
203
203
|
}, t.picker, t.id);
|
|
204
|
-
|
|
204
|
+
L(i) || this.setindex(i);
|
|
205
205
|
}], this, e);
|
|
206
206
|
},
|
|
207
207
|
setindex(e) {
|
|
208
208
|
y([this.cheackflys, ({ index: t }) => {
|
|
209
209
|
this.selectIndex = t, this.$nextTick(() => {
|
|
210
|
-
let
|
|
211
|
-
(this.flyweight[this.direction] /
|
|
210
|
+
let i = t / this.column >> 0, s = this.expand;
|
|
211
|
+
(this.flyweight[this.direction] / s >> 0) + this.row - i - 1 > 0 || (this.flyweight[this.direction] = i * s, this.scroll());
|
|
212
212
|
});
|
|
213
213
|
}], this, { index: e });
|
|
214
214
|
},
|
|
@@ -218,16 +218,16 @@ const V = {
|
|
|
218
218
|
}, t || this.lazy);
|
|
219
219
|
},
|
|
220
220
|
run(e) {
|
|
221
|
-
let t = [],
|
|
221
|
+
let t = [], i = y(this.direction, e.target), s = {
|
|
222
222
|
// ...this
|
|
223
|
-
offset:
|
|
224
|
-
top:
|
|
223
|
+
offset: i,
|
|
224
|
+
top: i,
|
|
225
225
|
width: this.realW,
|
|
226
226
|
height: this.realH,
|
|
227
227
|
/* 显示区域第一行的索引 */
|
|
228
|
-
index:
|
|
228
|
+
index: i / this.expand >> 0
|
|
229
229
|
};
|
|
230
|
-
R(
|
|
230
|
+
R(s, this.space), e.from || t.push(["onscroll", s]);
|
|
231
231
|
let l = !1;
|
|
232
232
|
w(
|
|
233
233
|
this.flyweights,
|
|
@@ -250,7 +250,7 @@ const V = {
|
|
|
250
250
|
this.row,
|
|
251
251
|
this.column,
|
|
252
252
|
/* 显示区域第一行的索引 */
|
|
253
|
-
|
|
253
|
+
s.index,
|
|
254
254
|
this.scrollx
|
|
255
255
|
), this.trigger(t), t = null;
|
|
256
256
|
},
|
|
@@ -262,15 +262,15 @@ const V = {
|
|
|
262
262
|
if (!e)
|
|
263
263
|
return t.length = e;
|
|
264
264
|
this.count = e;
|
|
265
|
-
let
|
|
265
|
+
let i = this.scrollx, s = this.flyweight, l = k(s, this.BoxRule);
|
|
266
266
|
this.$nextTick(() => {
|
|
267
|
-
let a = /true/.test(this.auto), [r, h] = this.offset, n = l.width, u = l.height, f = (
|
|
268
|
-
|
|
269
|
-
let [o, p] = c,
|
|
270
|
-
|
|
267
|
+
let a = /true/.test(this.auto), [r, h] = this.offset, n = l.width, u = l.height, f = (H(this.width, n) || n) + r, d = H(this.height, u) + h, c = [n / f >> 0 || 1, u / d >> 0 || 1];
|
|
268
|
+
i && c.reverse();
|
|
269
|
+
let [o, p] = c, b = this.padding, v, $ = 0, _, S;
|
|
270
|
+
i ? (_ = f, f -= r, S = (m) => (
|
|
271
271
|
/* 计算top偏移量 */
|
|
272
272
|
m * (d - h) + (m + 1) * h
|
|
273
|
-
)) : (a ? (f = (n - r * (o + 2 *
|
|
273
|
+
)) : (a ? (f = (n - r * (o + 2 * b - 1)) / o, v = !b * r, $ = b * r) : (v = 0, $ = (n % f + r * o) / (o + 1) >> 0, f -= r), S = (m) => m * (f + v) + (m + 1) * $, _ = d), this.row = p + 2, this.column = o, this.realH = d - h, this.realW = f, this.expand = _, this.Size = Math.ceil(e / o) * _;
|
|
274
274
|
let T = Math.min(e, o * this.row), x = T - 1, C;
|
|
275
275
|
for (; T-- > 0; )
|
|
276
276
|
C = x - T, this.$set(t, C, {
|
|
@@ -295,23 +295,23 @@ const V = {
|
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
-
var
|
|
299
|
-
var t = this,
|
|
300
|
-
return
|
|
298
|
+
var V = function() {
|
|
299
|
+
var t = this, i = t._self._c;
|
|
300
|
+
return i("div", { ref: "flyweight", staticClass: "flyweight", class: {
|
|
301
301
|
"flyweight-active": t.actice
|
|
302
|
-
}, style: t.style, on: { scroll: t.scroll } }, [
|
|
303
|
-
return
|
|
304
|
-
top:
|
|
305
|
-
left:
|
|
306
|
-
} }, [t._t("default", null, null,
|
|
302
|
+
}, style: t.style, on: { scroll: t.scroll } }, [i("div", { staticClass: "flyweight-all" }, t._l(t.flyweights, function(s, l) {
|
|
303
|
+
return i("div", { key: l, style: {
|
|
304
|
+
top: s.top + "px",
|
|
305
|
+
left: s.left + "px"
|
|
306
|
+
} }, [t._t("default", null, null, s)], 2);
|
|
307
307
|
}), 0), t.flyweights.length ? t._t("end") : t._e()], 2);
|
|
308
|
-
}, Y = [], q = /* @__PURE__ */
|
|
308
|
+
}, Y = [], q = /* @__PURE__ */ O(
|
|
309
|
+
G,
|
|
309
310
|
V,
|
|
310
|
-
j,
|
|
311
311
|
Y,
|
|
312
312
|
!1,
|
|
313
313
|
null,
|
|
314
|
-
"
|
|
314
|
+
"d5f1cd63",
|
|
315
315
|
null,
|
|
316
316
|
null
|
|
317
317
|
);
|
|
@@ -344,8 +344,8 @@ let I = {
|
|
|
344
344
|
], M = {};
|
|
345
345
|
w(
|
|
346
346
|
J,
|
|
347
|
-
(e, t,
|
|
348
|
-
e = N(t), M["--" + N(t, !0)] = e,
|
|
347
|
+
(e, t, i) => {
|
|
348
|
+
e = N(t), M["--" + N(t, !0)] = e, i[e] = function() {
|
|
349
349
|
this.trigger++;
|
|
350
350
|
};
|
|
351
351
|
},
|
|
@@ -414,20 +414,20 @@ const K = {
|
|
|
414
414
|
methods: {
|
|
415
415
|
exec: g,
|
|
416
416
|
isEmpty: E,
|
|
417
|
-
isSimplyType:
|
|
417
|
+
isSimplyType: F,
|
|
418
418
|
tr() {
|
|
419
419
|
let e = {};
|
|
420
|
-
return this.margin(this.offset), w(M, (t,
|
|
421
|
-
this.css(e, t,
|
|
420
|
+
return this.margin(this.offset), w(M, (t, i) => {
|
|
421
|
+
this.css(e, t, i);
|
|
422
422
|
}), e;
|
|
423
423
|
},
|
|
424
424
|
tolower: N,
|
|
425
|
-
css(e, t,
|
|
426
|
-
let
|
|
427
|
-
!
|
|
425
|
+
css(e, t, i) {
|
|
426
|
+
let s = this[i] || this.default[i];
|
|
427
|
+
!s || this.default[i] == s || (e[t] = g(s));
|
|
428
428
|
},
|
|
429
429
|
change(e) {
|
|
430
|
-
|
|
430
|
+
F(e) || (this.closecss = k(
|
|
431
431
|
e,
|
|
432
432
|
"color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"
|
|
433
433
|
));
|
|
@@ -436,7 +436,7 @@ const K = {
|
|
|
436
436
|
R(
|
|
437
437
|
this,
|
|
438
438
|
k(
|
|
439
|
-
|
|
439
|
+
j(e) ? e.split(/\s*(?:,|\s+)\s*/) : e,
|
|
440
440
|
"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
|
|
441
441
|
!0
|
|
442
442
|
),
|
|
@@ -449,24 +449,24 @@ const K = {
|
|
|
449
449
|
}
|
|
450
450
|
};
|
|
451
451
|
var P = function() {
|
|
452
|
-
var t = this,
|
|
453
|
-
return
|
|
452
|
+
var t = this, i = t._self._c;
|
|
453
|
+
return i("div", { key: t.trigger, staticClass: "card", style: t.isEmpty(t.style) ? t.tr() : t.style }, [t._t("default", function() {
|
|
454
454
|
return [t._t("title", function() {
|
|
455
|
-
var
|
|
456
|
-
return [
|
|
455
|
+
var s;
|
|
456
|
+
return [i("div", { staticClass: "card-title" }, [t._v(" " + t._s(t.show || t.title) + " "), i("div", { staticClass: "card-close", class: { hide: t.isSimplyType(t.close) ? !t.close : !1 }, style: t.closecss, attrs: { title: (s = t.close) == null ? void 0 : s.tips }, on: { click: function(l) {
|
|
457
457
|
return t.$emit("close");
|
|
458
458
|
} } })])];
|
|
459
459
|
}), t._t("content", function() {
|
|
460
|
-
return [
|
|
460
|
+
return [i("div", { staticClass: "card-content" }, [t._t("inner")], 2)];
|
|
461
461
|
})];
|
|
462
462
|
})], 2);
|
|
463
|
-
}, Q = [], Z = /* @__PURE__ */
|
|
463
|
+
}, Q = [], Z = /* @__PURE__ */ O(
|
|
464
464
|
K,
|
|
465
465
|
P,
|
|
466
466
|
Q,
|
|
467
467
|
!1,
|
|
468
468
|
null,
|
|
469
|
-
"
|
|
469
|
+
"ec96bb2a",
|
|
470
470
|
null,
|
|
471
471
|
null
|
|
472
472
|
);
|
|
@@ -474,8 +474,8 @@ const tt = Z.exports, et = {
|
|
|
474
474
|
name: "Stream",
|
|
475
475
|
computed: {
|
|
476
476
|
column() {
|
|
477
|
-
let { columns: e, T: t } = this,
|
|
478
|
-
return E(
|
|
477
|
+
let { columns: e, T: t } = this, i = e || t;
|
|
478
|
+
return E(i) ? [] : W(i) ? i : [i];
|
|
479
479
|
}
|
|
480
480
|
},
|
|
481
481
|
props: {
|
|
@@ -493,30 +493,30 @@ const tt = Z.exports, et = {
|
|
|
493
493
|
default: () => []
|
|
494
494
|
},
|
|
495
495
|
columns: {
|
|
496
|
-
type: Array,
|
|
496
|
+
type: [Object, Array],
|
|
497
497
|
default: () => null
|
|
498
498
|
},
|
|
499
499
|
T: {
|
|
500
|
-
type: Array,
|
|
500
|
+
type: [Array, Object],
|
|
501
501
|
default: () => null
|
|
502
502
|
}
|
|
503
503
|
},
|
|
504
504
|
methods: {
|
|
505
505
|
trigger(e) {
|
|
506
506
|
let t = e[this.bridge] || e.type;
|
|
507
|
-
return (this.$
|
|
507
|
+
return (this.$slots || this.$scopedSlots)[t] ? t : "default";
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
};
|
|
511
|
-
var
|
|
512
|
-
var t = this,
|
|
513
|
-
return
|
|
514
|
-
return t._t(t.trigger(
|
|
511
|
+
var it = function() {
|
|
512
|
+
var t = this, i = t._self._c;
|
|
513
|
+
return i(t.type, t._b({ tag: "component" }, "component", t.$attrs, !1), [t._l(t.column, function(s) {
|
|
514
|
+
return t._t(t.trigger(s), null, null, s);
|
|
515
515
|
})], 2);
|
|
516
|
-
},
|
|
516
|
+
}, st = [], lt = /* @__PURE__ */ O(
|
|
517
517
|
et,
|
|
518
|
-
st,
|
|
519
518
|
it,
|
|
519
|
+
st,
|
|
520
520
|
!1,
|
|
521
521
|
null,
|
|
522
522
|
null,
|
package/vue2/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.flyweight[data-v-
|
|
1
|
+
@charset "UTF-8";.flyweight[data-v-d5f1cd63]{height:var(--flyweight-h, 100%);width:var(--flyweight-w, 100%);overflow:auto;position:relative}.flyweight[hover-scroll][data-v-d5f1cd63]::-webkit-scrollbar-track,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar-track{border-radius:10px}.flyweight[hover-scroll][data-v-d5f1cd63]::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.flyweight[hover-scroll][data-v-d5f1cd63]::-webkit-scrollbar,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.flyweight[hover-scroll][data-v-d5f1cd63]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.flyweight[hover-scroll][data-v-d5f1cd63]:hover::-webkit-scrollbar-thumb:hover,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.flyweight[hover-scroll][data-v-d5f1cd63]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-d5f1cd63]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.flyweight[scroll-x] .flyweight-all[data-v-d5f1cd63]{width:var(--flyweight-content);height:auto;min-height:100%}.flyweight[scroll-x] .flyweight-all+*[data-v-d5f1cd63]{left:var(--flyweight-content);position:absolute;top:0;height:100%}.flyweight .flyweight-all[data-v-d5f1cd63]{height:var(--flyweight-content)}.flyweight .flyweight-all>*[data-v-d5f1cd63]{width:calc(var(--width));height:var(--height);position:absolute}@media screen and (-apple-system: Macintosh){.flyweight .flyweight-all[data-v-d5f1cd63]{background-color:red!important}}.card[data-v-ec96bb2a]{--t: 0px;--r: 0px;--b: 0px;--l: 0px;--h: 100%;--w: 100%;--br: 1px;position:relative;background-color:var(--bg, var(--card-background-color, #fff));padding:var(--card-padding, 10px);border-radius:var(--card-border-radius, 10px);box-sizing:border-box;border-style:solid;border-color:var(--card-border-color, #555);border-width:var(--br);justify-content:flex-start;margin:var(--t) var(--r) var(--b) var(--l);height:calc(var(--h) - var(--t) - var(--b));width:calc(var(--w) - var(--l) - var(--r));overflow:auto}.card[hover-scroll][data-v-ec96bb2a]::-webkit-scrollbar-track,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar-track{border-radius:10px}.card[hover-scroll][data-v-ec96bb2a]::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.card[hover-scroll][data-v-ec96bb2a]::-webkit-scrollbar,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.card[hover-scroll][data-v-ec96bb2a]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.card[hover-scroll][data-v-ec96bb2a]:hover::-webkit-scrollbar-thumb:hover,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.card[hover-scroll][data-v-ec96bb2a]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-ec96bb2a]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.card[simply][data-v-ec96bb2a],.card [simply][data-v-ec96bb2a]{background-color:inherit;border:0!important}.card[flex][data-v-ec96bb2a],.card [flex][data-v-ec96bb2a]{display:flex}.card[column][data-v-ec96bb2a],.card [column][data-v-ec96bb2a]{flex-direction:column}.card[row][data-v-ec96bb2a],.card [row][data-v-ec96bb2a]{flex-direction:row}.card[center][data-v-ec96bb2a],.card [center][data-v-ec96bb2a]{justify-content:center}.card[vcenter][data-v-ec96bb2a],.card [vcenter][data-v-ec96bb2a]{align-items:center}.card .card-title[data-v-ec96bb2a]{max-height:40px}.card .card-close[data-v-ec96bb2a]{position:absolute;width:20px;height:20px;right:10px;top:10px;border-radius:10px;z-index:1;--s-transform: 45deg;--s-hover-transform: 35deg;--s-close-width: 11px;--s-close-height: 2px;cursor:pointer;background-color:var(--s-card-close-background-color, transparent);transition:all .3s ease}.card .card-close.hide[data-v-ec96bb2a]{display:none}.card .card-close[data-v-ec96bb2a]:before,.card .card-close[data-v-ec96bb2a]:after{content:"";width:var(--s-close-width, 11px);height:var(--s-close-height, 2px);background-color:var(--s-card-close-color, #555);transform-origin:center;position:inherit;border-radius:10px;top:calc(50% - var(--s-close-height, 2px) / 2);left:calc(50% - var(--s-close-width, 11px) / 2)}.card .card-close[data-v-ec96bb2a]:before{transform:rotate(var(--s-transform, 45deg))}.card .card-close[data-v-ec96bb2a]:after{transform:rotate(calc(0deg - var(--s-transform, 45deg)))}.card .card-close[data-v-ec96bb2a]:hover:before{transform:rotate(var(--s-hover-transform, 45deg))}.card .card-close[data-v-ec96bb2a]:hover:after{transform:rotate(calc(0deg - var(--s-hover-transform, 45deg)))}.card .card-content[data-v-ec96bb2a]{overflow:auto;height:100%}.card .card-content[data-v-ec96bb2a]:before{background:linear-gradient(90deg,transparent,var(--card-line-color, transparent),var(--card-line-color, transparent),transparent);content:"";display:block;position:sticky;top:0;width:100%;height:1px;z-index:10;transition:opacity .5s ease-in-out}
|