@soei/flyweight 0.3.2 → 0.3.3
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 +203 -183
- package/package.json +1 -1
- package/style.css +1 -1
- package/vue2/index.cjs +1 -1
- package/vue2/index.js +93 -73
- 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
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@soei/util"),i=require("vue");let V=/(\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,V)){let l=s.length,h,n=0,r,a=[];for(;l--;)n=s.shift(),n in N?(h&&a.push(h),n==="%"&&(a.length=2),r=n):+n&&a.push(+n),a.length==2&&(a.push(t),h=N[r].apply(null,a),a.length=0);+h||(h=+a.pop()),e=h>>0}return e},L={},f=(e,t)=>(e+"").replace(/\w+\((.*)\)/g,"$1").replace(L[t]||(L[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 F=e=>e==null||e==null,W=(...e)=>{console.info("::::FLYWEIGHT",...e)};const M={name:"Flyweight",props:{flys:{type:Array,default:()=>[]},width:{type:Number,default:0},height:{type: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:Number,default:!1},left:{type:Number,default:!1},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){W(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],F(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);F(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,a,d,g,u,p,y,c)=>{if(a=n/g>>0,y=a+d*(+(a<u%d)+(u/d>>0)),c=y*g+n%g,c>=this.count){h||(t.push(["onend"]),h=!0);return}r.index=y,r.i=c,r.data=this.flys[c];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,a]=this.offset,d=h.width,g=h.height,u=(C(this.width,d)||d)+r,p=C(this.height,g)+a,y=[d/u>>0||1,g/p>>0||1];s&&y.reverse();let[c,m]=y,_=this.padding,k,b=0,w,T;s?(w=u,u-=r,T=x=>x*(p-a)+(x+1)*a):(n?(u=(d-r*(c+2*_-1))/c,k=!_*r,b=_*r):(k=0,b=(d%u+r*c)/(c+1)>>0,u-=r),T=x=>x*(u+k)+(x+1)*b,w=p),this.row=m+2,this.column=c,this.realH=p-a,this.realW=u,this.expand=w,this.Size=Math.ceil(e/c)*w;let z=Math.min(e,c*this.row),S=z-1,$;for(;z-- >0;)$=S-z,this.$set(t,$,{x:r,y:a,width:u,height:p-a,space:T($%c),data:{}});t.length=S+1;let v=[];g/w>S/c&&v.push(["onend"]),this.flyweight&&(this.flyweight[this.direction]=0),this.$nextTick(()=>{this.setindex(this.selectIndex||0),this.scroll()}),v.push(["update:space",{row:(S/c>>0)+1,column:c,showrow:this.row,showcolumn:this.column}]),this.trigger(v)})}}},j={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",j,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.flyweights,(r,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,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 H=E(M,[["render",P],["__scopeId","data-v-ae52e0f1"]]);function B(e,t){return t&&(e=e.replace(/[a-z]/g,"")),e.toLowerCase()}let O={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"],R={};o.each(q,(e,t,s)=>{e=B(t),R["--"+B(t,!0)]=e,s[e]=function(){this.trigger++}},O);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:O,methods:{exec:f,isEmpty:o.isEmpty,isSimplyType:o.isSimplyType,tr(){let e={};return this.margin(this.offset),o.each(R,(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={class:"card-content"};function X(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",{},()=>[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]=r=>e.$emit("close"))},null,6)])],!0),i.renderSlot(e.$slots,"content",{},()=>[i.createElementVNode("div",U,[i.renderSlot(e.$slots,"inner",{},void 0,!0)])],!0)],!0)],4)}const A=E(D,[["render",X],["__scopeId","data-v-4c41de24"]]),Y={name:"Stream",props:{type:{type:String,default:"div"},data:{type:Array,default:()=>[]},T:{type:Array,default:()=>[]}},methods:{trigger(e){let t=e.slot||e.type;return(this.$scopedSlots||this.$slots)[t]?t:"default"}}};function J(e,t,s,l,h,n){return i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.type),i.mergeProps(e.$attrs,{data:s.data}),{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.T,r=>i.renderSlot(e.$slots,n.trigger(r),i.mergeProps({key:r.type,ref_for:!0},r))),128))]),_:3},16,["data"])}const I=E(Y,[["render",J]]),K=[H,A,I],Q={install(e){K.forEach(t=>{e.component("S"+t.name,t),e.component(t.name+"S",t)})}};exports.Card=A;exports.Flyweight=H;exports.Stream=I;exports.default=Q;
|
package/Flyweight.js
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
import { runer as
|
|
2
|
-
import { openBlock as
|
|
3
|
-
let
|
|
4
|
-
"+": (
|
|
5
|
-
"-": (
|
|
6
|
-
"*": (
|
|
7
|
-
"/": (
|
|
8
|
-
"%": (
|
|
9
|
-
},
|
|
1
|
+
import { runer as y, merge as R, isArray as Y, each as S, picker as A, isEmpty as q, isSimplyType as I, isString as J } from "@soei/util";
|
|
2
|
+
import { openBlock as w, createElementBlock as b, normalizeClass as D, normalizeStyle as k, createElementVNode as T, Fragment as G, renderList as P, renderSlot as p, mergeProps as E, createCommentVNode as K, createTextVNode as Q, toDisplayString as Z, createBlock as tt, resolveDynamicComponent as et, withCtx as st } from "vue";
|
|
3
|
+
let it = /(\d+|[+\-\*/]|%)/g, W = {
|
|
4
|
+
"+": (t, e) => t + e,
|
|
5
|
+
"-": (t, e) => t - e,
|
|
6
|
+
"*": (t, e) => t * e,
|
|
7
|
+
"/": (t, e) => t / e,
|
|
8
|
+
"%": (t, e, s) => parseFloat(t) / 100 * s
|
|
9
|
+
}, j = (t, e) => {
|
|
10
10
|
let s;
|
|
11
|
-
if (s =
|
|
12
|
-
let
|
|
13
|
-
for (;
|
|
14
|
-
r = s.shift(), r in
|
|
15
|
-
+
|
|
11
|
+
if (s = y("match", t, it)) {
|
|
12
|
+
let l = s.length, h, r = 0, i, n = [];
|
|
13
|
+
for (; l--; )
|
|
14
|
+
r = s.shift(), r in W ? (h && n.push(h), r === "%" && (n.length = 2), i = r) : +r && n.push(+r), n.length == 2 && (n.push(e), h = W[i].apply(null, n), n.length = 0);
|
|
15
|
+
+h || (h = +n.pop()), t = h >> 0;
|
|
16
16
|
}
|
|
17
|
-
return
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
return t;
|
|
18
|
+
}, M = {}, u = (t, e) => (t + "").replace(
|
|
19
|
+
/\w+\((.*)\)/g,
|
|
20
|
+
"$1"
|
|
21
|
+
).replace(
|
|
22
|
+
M[e] || (M[e] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
|
|
23
|
+
"$1px"
|
|
24
|
+
);
|
|
25
|
+
const F = (t, e) => {
|
|
26
|
+
const s = t.__vccOpts || t;
|
|
27
|
+
for (const [l, h] of e)
|
|
28
|
+
s[l] = h;
|
|
23
29
|
return s;
|
|
24
30
|
};
|
|
25
|
-
let
|
|
26
|
-
console.info("::::FLYWEIGHT", ...
|
|
31
|
+
let V = (t) => t == null || t == null, lt = (...t) => {
|
|
32
|
+
console.info("::::FLYWEIGHT", ...t);
|
|
27
33
|
};
|
|
28
|
-
const
|
|
34
|
+
const rt = {
|
|
29
35
|
name: "Flyweight",
|
|
30
36
|
props: {
|
|
31
37
|
flys: {
|
|
@@ -40,6 +46,12 @@ const le = {
|
|
|
40
46
|
type: Number,
|
|
41
47
|
default: 100
|
|
42
48
|
},
|
|
49
|
+
w: {
|
|
50
|
+
type: [Number, String]
|
|
51
|
+
},
|
|
52
|
+
h: {
|
|
53
|
+
type: [Number, String]
|
|
54
|
+
},
|
|
43
55
|
offset: {
|
|
44
56
|
type: Array,
|
|
45
57
|
default: () => [0, 0]
|
|
@@ -80,6 +92,18 @@ const le = {
|
|
|
80
92
|
computed: {
|
|
81
93
|
flyweight() {
|
|
82
94
|
return this.$refs.flyweight || "";
|
|
95
|
+
},
|
|
96
|
+
style() {
|
|
97
|
+
var t = this.w, e = this.h, s = this.Size, l = {};
|
|
98
|
+
return R(l, {
|
|
99
|
+
"--width": u(this.realW),
|
|
100
|
+
"--height": u(this.realH),
|
|
101
|
+
"--flyweight-content": u(s)
|
|
102
|
+
}, e && {
|
|
103
|
+
"--flyweight-h": u(e)
|
|
104
|
+
}, t && l, {
|
|
105
|
+
"--flyweight-w": u(t)
|
|
106
|
+
}, "mix"), l;
|
|
83
107
|
}
|
|
84
108
|
},
|
|
85
109
|
data() {
|
|
@@ -97,82 +121,82 @@ const le = {
|
|
|
97
121
|
};
|
|
98
122
|
},
|
|
99
123
|
watch: {
|
|
100
|
-
flys(
|
|
101
|
-
this.count =
|
|
102
|
-
let
|
|
103
|
-
|
|
104
|
-
this.setview(
|
|
124
|
+
flys(t) {
|
|
125
|
+
this.count = t.length, this.rebuild();
|
|
126
|
+
let e = this.task.shift();
|
|
127
|
+
e && this.$nextTick(() => {
|
|
128
|
+
this.setview(e);
|
|
105
129
|
});
|
|
106
130
|
},
|
|
107
131
|
view: {
|
|
108
|
-
handler(
|
|
109
|
-
this.setview(
|
|
132
|
+
handler(t) {
|
|
133
|
+
this.setview(t);
|
|
110
134
|
},
|
|
111
135
|
immediate: !0,
|
|
112
136
|
deep: !0
|
|
113
137
|
},
|
|
114
|
-
index(
|
|
115
|
-
this.setindex(
|
|
138
|
+
index(t) {
|
|
139
|
+
this.setindex(t);
|
|
116
140
|
},
|
|
117
|
-
top(
|
|
118
|
-
this.flyweight.scrollTop =
|
|
141
|
+
top(t) {
|
|
142
|
+
this.flyweight.scrollTop = t;
|
|
119
143
|
},
|
|
120
|
-
left(
|
|
121
|
-
this.flyweight.scrollLeft =
|
|
144
|
+
left(t) {
|
|
145
|
+
this.flyweight.scrollLeft = t;
|
|
122
146
|
}
|
|
123
147
|
},
|
|
124
148
|
mounted() {
|
|
125
|
-
this.flyweights = [], this.$set || (this.$set = (
|
|
126
|
-
e
|
|
149
|
+
this.flyweights = [], this.$set || (this.$set = (t, e, s) => {
|
|
150
|
+
t[e] = s;
|
|
127
151
|
}), this.setindex(this.index);
|
|
128
152
|
try {
|
|
129
153
|
new ResizeObserver(() => {
|
|
130
154
|
this.rebuild(), this.$emit("resize");
|
|
131
155
|
}).observe(this.flyweight);
|
|
132
|
-
} catch (
|
|
133
|
-
|
|
156
|
+
} catch (t) {
|
|
157
|
+
lt(t);
|
|
134
158
|
}
|
|
135
|
-
this.scrollx =
|
|
159
|
+
this.scrollx = y("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
|
|
136
160
|
"clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
|
|
137
161
|
},
|
|
138
162
|
methods: {
|
|
139
|
-
exec:
|
|
140
|
-
trigger(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.$emit(
|
|
163
|
+
exec: u,
|
|
164
|
+
trigger(t, e) {
|
|
165
|
+
Y(t) || (t = t && e ? [[t, e]] : []), t.length && this.lazyrun(() => {
|
|
166
|
+
S(t, (s, l) => {
|
|
167
|
+
this.$emit(l[0], V(l[1]) ? !0 : l[1]);
|
|
144
168
|
});
|
|
145
169
|
});
|
|
146
170
|
},
|
|
147
|
-
cheackflys(
|
|
171
|
+
cheackflys(t) {
|
|
148
172
|
if (!this.flys.length)
|
|
149
|
-
return
|
|
150
|
-
},
|
|
151
|
-
setview(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
let s =
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
}], this,
|
|
160
|
-
},
|
|
161
|
-
setindex(
|
|
162
|
-
|
|
163
|
-
this.selectIndex =
|
|
164
|
-
let s =
|
|
165
|
-
(this.flyweight[this.direction] /
|
|
173
|
+
return t && this.task.push(t), !0;
|
|
174
|
+
},
|
|
175
|
+
setview(t) {
|
|
176
|
+
y([this.cheackflys, (e) => {
|
|
177
|
+
e = e || {};
|
|
178
|
+
let s = e.index || S(this.flys, (l, h, r, i) => {
|
|
179
|
+
if (h[r] == i)
|
|
180
|
+
return l;
|
|
181
|
+
}, e.picker, e.id);
|
|
182
|
+
V(s) || this.setindex(s);
|
|
183
|
+
}], this, t);
|
|
184
|
+
},
|
|
185
|
+
setindex(t) {
|
|
186
|
+
y([this.cheackflys, ({ index: e }) => {
|
|
187
|
+
this.selectIndex = e, this.$nextTick(() => {
|
|
188
|
+
let s = e / this.column >> 0, l = this.expand;
|
|
189
|
+
(this.flyweight[this.direction] / l >> 0) + this.row - s - 1 > 0 || (this.flyweight[this.direction] = s * l, this.scroll());
|
|
166
190
|
});
|
|
167
|
-
}], this, { index:
|
|
191
|
+
}], this, { index: t });
|
|
168
192
|
},
|
|
169
|
-
lazyrun(
|
|
193
|
+
lazyrun(t, e) {
|
|
170
194
|
clearTimeout(this.time), this.time = setTimeout(() => {
|
|
171
|
-
|
|
172
|
-
},
|
|
195
|
+
y(t);
|
|
196
|
+
}, e || this.lazy);
|
|
173
197
|
},
|
|
174
|
-
run(
|
|
175
|
-
let
|
|
198
|
+
run(t) {
|
|
199
|
+
let e = [], s = y(this.direction, t.target), l = {
|
|
176
200
|
// ...this
|
|
177
201
|
offset: s,
|
|
178
202
|
top: s,
|
|
@@ -181,125 +205,121 @@ const le = {
|
|
|
181
205
|
/* 显示区域第一行的索引 */
|
|
182
206
|
index: s / this.expand >> 0
|
|
183
207
|
};
|
|
184
|
-
|
|
185
|
-
let
|
|
186
|
-
|
|
208
|
+
R(l, this.space), t.from || e.push(["onscroll", l]);
|
|
209
|
+
let h = !1;
|
|
210
|
+
S(
|
|
187
211
|
this.flyweights,
|
|
188
|
-
(r, i, n,
|
|
189
|
-
if (n = r /
|
|
190
|
-
(+(n <
|
|
191
|
-
|
|
212
|
+
(r, i, n, c, d, a, f, g, o) => {
|
|
213
|
+
if (n = r / d >> 0, g = n + c * /* 偏移量, 如果超出顶部 + 1轮,排列到列队后, 否则保持在当前*/
|
|
214
|
+
(+(n < a % c) + (a / c >> 0)), o = g * d + r % d, o >= this.count) {
|
|
215
|
+
h || (e.push(["onend"]), h = !0);
|
|
192
216
|
return;
|
|
193
217
|
}
|
|
194
|
-
i.index =
|
|
218
|
+
i.index = g, i.i = o, i.data = this.flys[o];
|
|
195
219
|
let m = [
|
|
196
220
|
/* top */
|
|
197
|
-
|
|
221
|
+
g * this.expand + i.x,
|
|
198
222
|
/* left */
|
|
199
223
|
i.space
|
|
200
224
|
];
|
|
201
|
-
|
|
225
|
+
f && m.reverse(), i.top = m[0], i.left = m[1];
|
|
202
226
|
},
|
|
203
227
|
null,
|
|
204
228
|
this.row,
|
|
205
229
|
this.column,
|
|
206
230
|
/* 显示区域第一行的索引 */
|
|
207
|
-
|
|
231
|
+
l.index,
|
|
208
232
|
this.scrollx
|
|
209
|
-
), this.trigger(
|
|
233
|
+
), this.trigger(e), e = null;
|
|
210
234
|
},
|
|
211
|
-
scroll(
|
|
212
|
-
this.run(
|
|
235
|
+
scroll(t) {
|
|
236
|
+
this.run(t || { target: this.flyweight, from: "space" });
|
|
213
237
|
},
|
|
214
238
|
rebuild() {
|
|
215
|
-
let
|
|
216
|
-
if (!
|
|
217
|
-
return
|
|
218
|
-
this.count =
|
|
219
|
-
let s = this.scrollx,
|
|
239
|
+
let t = this.count || this.flys.length, e = this.flyweights;
|
|
240
|
+
if (!t)
|
|
241
|
+
return e.length = t;
|
|
242
|
+
this.count = t;
|
|
243
|
+
let s = this.scrollx, l = this.flyweight, h = A(l, this.BoxRule);
|
|
220
244
|
this.$nextTick(() => {
|
|
221
|
-
let r = /true/.test(this.auto), [i, n] = this.offset,
|
|
222
|
-
s &&
|
|
223
|
-
let [o, m] =
|
|
224
|
-
s ? (
|
|
245
|
+
let r = /true/.test(this.auto), [i, n] = this.offset, c = h.width, d = h.height, a = (j(this.width, c) || c) + i, f = j(this.height, d) + n, g = [c / a >> 0 || 1, d / f >> 0 || 1];
|
|
246
|
+
s && g.reverse();
|
|
247
|
+
let [o, m] = g, z = this.padding, v, N = 0, x, B;
|
|
248
|
+
s ? (x = a, a -= i, B = (_) => (
|
|
225
249
|
/* 计算top偏移量 */
|
|
226
|
-
|
|
227
|
-
)) : (r ? (
|
|
228
|
-
let
|
|
229
|
-
for (;
|
|
230
|
-
|
|
250
|
+
_ * (f - n) + (_ + 1) * n
|
|
251
|
+
)) : (r ? (a = (c - i * (o + 2 * z - 1)) / o, v = !z * i, N = z * i) : (v = 0, N = (c % a + i * o) / (o + 1) >> 0, a -= i), B = (_) => _ * (a + v) + (_ + 1) * N, x = f), this.row = m + 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, L;
|
|
253
|
+
for (; C-- > 0; )
|
|
254
|
+
L = $ - C, this.$set(e, L, {
|
|
231
255
|
x: i,
|
|
232
256
|
y: n,
|
|
233
|
-
width:
|
|
234
|
-
height:
|
|
235
|
-
space: B(
|
|
257
|
+
width: a,
|
|
258
|
+
height: f - n,
|
|
259
|
+
space: B(L % o),
|
|
236
260
|
data: {}
|
|
237
261
|
});
|
|
238
|
-
|
|
239
|
-
let
|
|
240
|
-
|
|
262
|
+
e.length = $ + 1;
|
|
263
|
+
let H = [];
|
|
264
|
+
d / x > $ / o && H.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
|
|
241
265
|
this.setindex(this.selectIndex || 0), this.scroll();
|
|
242
|
-
}),
|
|
243
|
-
row: (
|
|
266
|
+
}), H.push(["update:space", {
|
|
267
|
+
row: ($ / o >> 0) + 1,
|
|
244
268
|
column: o,
|
|
245
269
|
showrow: this.row,
|
|
246
270
|
showcolumn: this.column
|
|
247
|
-
}]), this.trigger(
|
|
271
|
+
}]), this.trigger(H);
|
|
248
272
|
});
|
|
249
273
|
}
|
|
250
274
|
}
|
|
251
|
-
},
|
|
252
|
-
function
|
|
253
|
-
return
|
|
275
|
+
}, ht = { class: "flyweight-all" };
|
|
276
|
+
function nt(t, e, s, l, h, r) {
|
|
277
|
+
return w(), b("div", {
|
|
254
278
|
ref: "flyweight",
|
|
255
279
|
class: D(["flyweight", {
|
|
256
|
-
"flyweight-active":
|
|
280
|
+
"flyweight-active": h.actice
|
|
257
281
|
}]),
|
|
258
|
-
style: k(
|
|
259
|
-
|
|
260
|
-
"--height": r.exec(l.realH),
|
|
261
|
-
"--flyweight-content": r.exec(l.Size)
|
|
262
|
-
}),
|
|
263
|
-
onScroll: t[0] || (t[0] = (...i) => r.scroll && r.scroll(...i))
|
|
282
|
+
style: k(r.style),
|
|
283
|
+
onScroll: e[0] || (e[0] = (...i) => r.scroll && r.scroll(...i))
|
|
264
284
|
}, [
|
|
265
|
-
T("div",
|
|
266
|
-
(
|
|
285
|
+
T("div", ht, [
|
|
286
|
+
(w(!0), b(G, null, P(h.flyweights, (i, n) => (w(), b("div", {
|
|
267
287
|
key: n,
|
|
268
288
|
style: k({
|
|
269
289
|
top: i.top + "px",
|
|
270
290
|
left: i.left + "px"
|
|
271
291
|
})
|
|
272
292
|
}, [
|
|
273
|
-
|
|
293
|
+
p(t.$slots, "default", E({ ref_for: !0 }, i), void 0, !0)
|
|
274
294
|
], 4))), 128))
|
|
275
295
|
]),
|
|
276
|
-
|
|
296
|
+
h.flyweights.length ? p(t.$slots, "end", { key: 0 }, void 0, !0) : K("", !0)
|
|
277
297
|
], 38);
|
|
278
298
|
}
|
|
279
|
-
const
|
|
280
|
-
function
|
|
281
|
-
return
|
|
299
|
+
const ot = /* @__PURE__ */ F(rt, [["render", nt], ["__scopeId", "data-v-ae52e0f1"]]);
|
|
300
|
+
function O(t, e) {
|
|
301
|
+
return e && (t = t.replace(/[a-z]/g, "")), t.toLowerCase();
|
|
282
302
|
}
|
|
283
|
-
let
|
|
303
|
+
let U = {
|
|
284
304
|
close: {
|
|
285
|
-
handler(
|
|
286
|
-
this.change(
|
|
305
|
+
handler(t) {
|
|
306
|
+
this.change(t);
|
|
287
307
|
},
|
|
288
308
|
deep: !0
|
|
289
309
|
},
|
|
290
310
|
offset: {
|
|
291
|
-
handler(
|
|
292
|
-
this.margin(
|
|
311
|
+
handler(t) {
|
|
312
|
+
this.margin(t);
|
|
293
313
|
},
|
|
294
314
|
deep: !0
|
|
295
315
|
}
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
|
|
316
|
+
}, at = ["BackGround", "BordeR", "Height", "Width", "Top", "Right", "Bottom", "Left"], X = {};
|
|
317
|
+
S(at, (t, e, s) => {
|
|
318
|
+
t = O(e), X["--" + O(e, !0)] = t, s[t] = function() {
|
|
299
319
|
this.trigger++;
|
|
300
320
|
};
|
|
301
|
-
},
|
|
302
|
-
const
|
|
321
|
+
}, U);
|
|
322
|
+
const ct = {
|
|
303
323
|
name: "Card",
|
|
304
324
|
// inheritAttrs: false,
|
|
305
325
|
props: {
|
|
@@ -358,28 +378,28 @@ const ce = {
|
|
|
358
378
|
return this.tr();
|
|
359
379
|
}
|
|
360
380
|
},
|
|
361
|
-
watch:
|
|
381
|
+
watch: U,
|
|
362
382
|
methods: {
|
|
363
|
-
exec:
|
|
364
|
-
isEmpty:
|
|
365
|
-
isSimplyType:
|
|
383
|
+
exec: u,
|
|
384
|
+
isEmpty: q,
|
|
385
|
+
isSimplyType: I,
|
|
366
386
|
tr() {
|
|
367
|
-
let
|
|
368
|
-
return this.margin(this.offset),
|
|
369
|
-
this.css(
|
|
370
|
-
}),
|
|
371
|
-
},
|
|
372
|
-
tolower:
|
|
373
|
-
css(
|
|
374
|
-
let
|
|
375
|
-
!
|
|
376
|
-
},
|
|
377
|
-
change(
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
margin(
|
|
381
|
-
|
|
382
|
-
|
|
387
|
+
let t = {};
|
|
388
|
+
return this.margin(this.offset), S(X, (e, s) => {
|
|
389
|
+
this.css(t, e, s);
|
|
390
|
+
}), t;
|
|
391
|
+
},
|
|
392
|
+
tolower: O,
|
|
393
|
+
css(t, e, s) {
|
|
394
|
+
let l = this[s] || this.default[s];
|
|
395
|
+
!l || this.default[s] == l || (t[e] = u(l));
|
|
396
|
+
},
|
|
397
|
+
change(t) {
|
|
398
|
+
I(t) || (this.closecss = A(t, "color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"));
|
|
399
|
+
},
|
|
400
|
+
margin(t) {
|
|
401
|
+
R(this, A(
|
|
402
|
+
J(t) ? t.split(/\s*(?:,|\s+)\s*/) : t,
|
|
383
403
|
"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
|
|
384
404
|
!0
|
|
385
405
|
), !0);
|
|
@@ -388,33 +408,33 @@ const ce = {
|
|
|
388
408
|
mounted() {
|
|
389
409
|
this.change(this.close);
|
|
390
410
|
}
|
|
391
|
-
},
|
|
392
|
-
function
|
|
393
|
-
return
|
|
411
|
+
}, ut = { class: "card-title" }, dt = { class: "card-content" };
|
|
412
|
+
function ft(t, e, s, l, h, r) {
|
|
413
|
+
return w(), b("div", {
|
|
394
414
|
class: "card",
|
|
395
|
-
key:
|
|
415
|
+
key: h.trigger,
|
|
396
416
|
style: k(r.isEmpty(r.style) ? r.tr() : r.style)
|
|
397
417
|
}, [
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
T("div",
|
|
401
|
-
|
|
418
|
+
p(t.$slots, "default", {}, () => [
|
|
419
|
+
p(t.$slots, "title", {}, () => [
|
|
420
|
+
T("div", ut, [
|
|
421
|
+
Q(Z(s.show || s.title) + " ", 1),
|
|
402
422
|
T("div", {
|
|
403
423
|
class: D(["card-close", { hide: r.isSimplyType(s.close) ? !s.close : !1 }]),
|
|
404
|
-
style: k(
|
|
405
|
-
onClick:
|
|
424
|
+
style: k(h.closecss),
|
|
425
|
+
onClick: e[0] || (e[0] = (i) => t.$emit("close"))
|
|
406
426
|
}, null, 6)
|
|
407
427
|
])
|
|
408
428
|
], !0),
|
|
409
|
-
|
|
410
|
-
T("div",
|
|
411
|
-
|
|
429
|
+
p(t.$slots, "content", {}, () => [
|
|
430
|
+
T("div", dt, [
|
|
431
|
+
p(t.$slots, "inner", {}, void 0, !0)
|
|
412
432
|
])
|
|
413
433
|
], !0)
|
|
414
434
|
], !0)
|
|
415
435
|
], 4);
|
|
416
436
|
}
|
|
417
|
-
const
|
|
437
|
+
const gt = /* @__PURE__ */ F(ct, [["render", ft], ["__scopeId", "data-v-4c41de24"]]), pt = {
|
|
418
438
|
name: "Stream",
|
|
419
439
|
props: {
|
|
420
440
|
type: {
|
|
@@ -431,16 +451,16 @@ const fe = /* @__PURE__ */ E(ce, [["render", de], ["__scopeId", "data-v-4c41de24
|
|
|
431
451
|
}
|
|
432
452
|
},
|
|
433
453
|
methods: {
|
|
434
|
-
trigger(
|
|
435
|
-
let
|
|
436
|
-
return (this.$scopedSlots || this.$slots)[
|
|
454
|
+
trigger(t) {
|
|
455
|
+
let e = t.slot || t.type;
|
|
456
|
+
return (this.$scopedSlots || this.$slots)[e] ? e : "default";
|
|
437
457
|
}
|
|
438
458
|
}
|
|
439
459
|
};
|
|
440
|
-
function
|
|
441
|
-
return
|
|
442
|
-
default:
|
|
443
|
-
(
|
|
460
|
+
function yt(t, e, s, l, h, r) {
|
|
461
|
+
return w(), tt(et(s.type), E(t.$attrs, { data: s.data }), {
|
|
462
|
+
default: st(() => [
|
|
463
|
+
(w(!0), b(G, null, P(s.T, (i) => p(t.$slots, r.trigger(i), E({
|
|
444
464
|
key: i.type,
|
|
445
465
|
ref_for: !0
|
|
446
466
|
}, i))), 128))
|
|
@@ -448,16 +468,16 @@ function pe(e, t, s, h, l, r) {
|
|
|
448
468
|
_: 3
|
|
449
469
|
}, 16, ["data"]);
|
|
450
470
|
}
|
|
451
|
-
const
|
|
452
|
-
install(
|
|
453
|
-
|
|
454
|
-
|
|
471
|
+
const wt = /* @__PURE__ */ F(pt, [["render", yt]]), mt = [ot, gt, wt], St = {
|
|
472
|
+
install(t) {
|
|
473
|
+
mt.forEach((e) => {
|
|
474
|
+
t.component("S" + e.name, e), t.component(e.name + "S", e);
|
|
455
475
|
});
|
|
456
476
|
}
|
|
457
477
|
};
|
|
458
478
|
export {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
479
|
+
gt as Card,
|
|
480
|
+
ot as Flyweight,
|
|
481
|
+
wt as Stream,
|
|
482
|
+
St as default
|
|
463
483
|
};
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.flyweight[data-v-
|
|
1
|
+
@charset "UTF-8";.flyweight[data-v-ae52e0f1]{height:var(--flyweight-h, 100%);width:var(--flyweight-w, 100%);overflow:auto;position:relative}.flyweight[hover-scroll][data-v-ae52e0f1]::-webkit-scrollbar-track,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar-track{border-radius:10px}.flyweight[hover-scroll][data-v-ae52e0f1]::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.flyweight[hover-scroll][data-v-ae52e0f1]::-webkit-scrollbar,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.flyweight[hover-scroll][data-v-ae52e0f1]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.flyweight[hover-scroll][data-v-ae52e0f1]:hover::-webkit-scrollbar-thumb:hover,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.flyweight[hover-scroll][data-v-ae52e0f1]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-ae52e0f1]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.flyweight[scroll-x] .flyweight-all[data-v-ae52e0f1]{width:var(--flyweight-content);height:auto;min-height:100%}.flyweight[scroll-x] .flyweight-all[data-v-ae52e0f1]+*{left:var(--flyweight-content);position:absolute;top:0;height:100%}.flyweight .flyweight-all[data-v-ae52e0f1]{height:var(--flyweight-content)}.flyweight .flyweight-all[data-v-ae52e0f1]>*{width:calc(var(--width));height:var(--height);position:absolute}@media screen and (-apple-system: Macintosh){.flyweight .flyweight-all[data-v-ae52e0f1]{background-color:red!important}}.card[data-v-4c41de24]{--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:10px;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-4c41de24]::-webkit-scrollbar-track,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar-track{border-radius:10px}.card[hover-scroll][data-v-4c41de24]::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.card[hover-scroll][data-v-4c41de24]::-webkit-scrollbar,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.card[hover-scroll][data-v-4c41de24]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.card[hover-scroll][data-v-4c41de24]:hover::-webkit-scrollbar-thumb:hover,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.card[hover-scroll][data-v-4c41de24]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-4c41de24]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.card[simply][data-v-4c41de24],.card [simply][data-v-4c41de24]{background-color:inherit;border:0!important}.card[flex][data-v-4c41de24],.card [flex][data-v-4c41de24]{display:flex}.card[column][data-v-4c41de24],.card [column][data-v-4c41de24]{flex-direction:column}.card[row][data-v-4c41de24],.card [row][data-v-4c41de24]{flex-direction:row}.card[center][data-v-4c41de24],.card [center][data-v-4c41de24]{justify-content:center}.card[vcenter][data-v-4c41de24],.card [vcenter][data-v-4c41de24]{align-items:center}.card .card-title[data-v-4c41de24]{max-height:40px}.card .card-close[data-v-4c41de24]{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-4c41de24]{display:none}.card .card-close[data-v-4c41de24]:before,.card .card-close[data-v-4c41de24]: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-4c41de24]:before{transform:rotate(var(--s-transform, 45deg))}.card .card-close[data-v-4c41de24]:after{transform:rotate(calc(0deg - var(--s-transform, 45deg)))}.card .card-close[data-v-4c41de24]:hover:before{transform:rotate(var(--s-hover-transform, 45deg))}.card .card-close[data-v-4c41de24]:hover:after{transform:rotate(calc(0deg - var(--s-hover-transform, 45deg)))}.card .card-content[data-v-4c41de24]{overflow:auto;height:100%}
|
package/vue2/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
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,n,c=0,r,o=[];for(;s--;)c=i.shift(),c in R?(n&&o.push(n),c==="%"&&(o.length=2),r=c):+c&&o.push(+c),o.length==2&&(o.push(t),n=R[r].apply(null,o),o.length=0);+n||(n=+o.pop()),e=n>>0}return e},F={},y=(e,t)=>(e+"").replace(/\w+\((.*)\)/g,"$1").replace(F[t]||(F[t]=new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)","g")),"$1px");function k(e,t,i,s,n,c,r,o){var l=typeof e=="function"?e.options:e;t&&(l.render=t,l.staticRenderFns=i,l._compiled=!0),s&&(l.functional=!0),c&&(l._scopeId="data-v-"+c);var f;if(r?(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__),n&&n.call(this,u),u&&u._registeredComponents&&u._registeredComponents.add(r)},l._ssrRegister=f):n&&(f=o?function(){n.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:n),f)if(l.functional){l._injectStyles=f;var d=l.render;l.render=function(a,g){return f.call(g),d(a,g)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,f):[f]}return{exports:e,options:l}}let O=e=>e==null||e==null,M=(...e)=>{console.info("::::FLYWEIGHT",...e)};const I={name:"Flyweight",props:{flys:{type:Array,default:()=>[]},width:{type:Number,default:0},height:{type: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:Number,default:!1},left:{type:Number,default:!1},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],O(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,n,c,r)=>{if(n[c]==r)return s},t.picker,t.id);O(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 n=!1;h.each(this.flyweights,(c,r,o,l,f,d,p,u,a)=>{if(o=c/f>>0,u=o+l*(+(o<d%l)+(d/l>>0)),a=u*f+c%f,a>=this.count){n||(t.push(["onend"]),n=!0);return}r.index=u,r.i=a,r.data=this.flys[a];let g=[u*this.expand+r.x,r.space];p&&g.reverse(),r.top=g[0],r.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,n=h.picker(s,this.BoxRule);this.$nextTick(()=>{let c=/true/.test(this.auto),[r,o]=this.offset,l=n.width,f=n.height,d=(N(this.width,l)||l)+r,p=N(this.height,f)+o,u=[l/d>>0||1,f/p>>0||1];i&&u.reverse();let[a,g]=u,x=this.padding,v,b=0,_,$;i?(_=d,d-=r,$=m=>m*(p-o)+(m+1)*o):(c?(d=(l-r*(a+2*x-1))/a,v=!x*r,b=x*r):(v=0,b=(l%d+r*a)/(a+1)>>0,d-=r),$=m=>m*(d+v)+(m+1)*b,_=p),this.row=g+2,this.column=a,this.realH=p-o,this.realW=d,this.expand=_,this.Size=Math.ceil(e/a)*_;let S=Math.min(e,a*this.row),w=S-1,T;for(;S-- >0;)T=w-S,this.$set(t,T,{x:r,y:o,width:d,height:p-o,space:$(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 U=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,n){return i("div",{key:n,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)},X=[],j=k(I,U,X,!1,null,"3416ac53",null,null);const H=j.exports;function z(e,t){return t&&(e=e.replace(/[a-z]/g,"")),e.toLowerCase()}let L={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"],A={};h.each(G,(e,t,i)=>{e=z(t),A["--"+z(t,!0)]=e,i[e]=function(){this.trigger++}},L);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:L,methods:{exec:y,isEmpty:h.isEmpty,isSimplyType:h.isSimplyType,tr(){let e={};return this.margin(this.offset),h.each(A,(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(){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,on:{click:function(s){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,"6065b432",null,null);const B=Y.exports,D={name:"Stream",props:{type:{type:String,default:"div"},data:{type:Array,default:()=>[]},T:{type:Array,default:()=>[]}},methods:{trigger(e){let t=e.slot||e.type;return(this.$scopedSlots||this.$slots)[t]?t:"default"}}};var J=function(){var t=this,i=t._self._c;return i(t.type,t._b({tag:"component",attrs:{data:t.data}},"component",t.$attrs,!1),[t._l(t.T,function(s){return[t._t(t.trigger(s),null,null,s)]})],2)},K=[],Q=k(D,J,K,!1,null,null,null,null);const E=Q.exports,Z=[H,B,E],tt={install(e){Z.forEach(t=>{e.component("S"+t.name,t),e.component(t.name+"S",t)})}};exports.Card=B;exports.Flyweight=H;exports.Stream=E;exports.default=tt;
|
package/vue2/index.js
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
|
-
import { runer as
|
|
2
|
-
let X = /(\d+|[+\-\*/]|%)/g,
|
|
1
|
+
import { runer as y, merge as R, isArray as I, each as m, picker as k, isEmpty as M, isSimplyType as H, isString as U } from "@soei/util";
|
|
2
|
+
let X = /(\d+|[+\-\*/]|%)/g, L = {
|
|
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
7
|
"%": (e, t, s) => parseFloat(e) / 100 * s
|
|
8
|
-
},
|
|
8
|
+
}, O = (e, t) => {
|
|
9
9
|
let s;
|
|
10
|
-
if (s =
|
|
10
|
+
if (s = y("match", e, X)) {
|
|
11
11
|
let i = s.length, n, a = 0, l, h = [];
|
|
12
12
|
for (; i--; )
|
|
13
|
-
a = s.shift(), a in
|
|
13
|
+
a = s.shift(), a in L ? (n && h.push(n), a === "%" && (h.length = 2), l = a) : +a && h.push(+a), h.length == 2 && (h.push(t), n = L[l].apply(null, h), h.length = 0);
|
|
14
14
|
+n || (n = +h.pop()), e = n >> 0;
|
|
15
15
|
}
|
|
16
16
|
return e;
|
|
17
|
-
},
|
|
17
|
+
}, A = {}, g = (e, t) => (e + "").replace(
|
|
18
|
+
/\w+\((.*)\)/g,
|
|
19
|
+
"$1"
|
|
20
|
+
).replace(
|
|
21
|
+
A[t] || (A[t] = new RegExp("(?=\\s+|^)(\\d+)(?:\\.\\d{1,})?(?!(?:\\.)*\\d|%|\\w)", "g")),
|
|
22
|
+
"$1px"
|
|
23
|
+
);
|
|
18
24
|
function F(e, t, s, i, n, a, l, h) {
|
|
19
25
|
var r = typeof e == "function" ? e.options : e;
|
|
20
26
|
t && (r.render = t, r.staticRenderFns = s, r._compiled = !0), i && (r.functional = !0), a && (r._scopeId = "data-v-" + a);
|
|
@@ -44,10 +50,10 @@ function F(e, t, s, i, n, a, l, h) {
|
|
|
44
50
|
options: r
|
|
45
51
|
};
|
|
46
52
|
}
|
|
47
|
-
let
|
|
53
|
+
let B = (e) => e == null || e == null, G = (...e) => {
|
|
48
54
|
console.info("::::FLYWEIGHT", ...e);
|
|
49
55
|
};
|
|
50
|
-
const
|
|
56
|
+
const V = {
|
|
51
57
|
name: "Flyweight",
|
|
52
58
|
props: {
|
|
53
59
|
flys: {
|
|
@@ -62,6 +68,12 @@ const M = {
|
|
|
62
68
|
type: Number,
|
|
63
69
|
default: 100
|
|
64
70
|
},
|
|
71
|
+
w: {
|
|
72
|
+
type: [Number, String]
|
|
73
|
+
},
|
|
74
|
+
h: {
|
|
75
|
+
type: [Number, String]
|
|
76
|
+
},
|
|
65
77
|
offset: {
|
|
66
78
|
type: Array,
|
|
67
79
|
default: () => [0, 0]
|
|
@@ -102,6 +114,18 @@ const M = {
|
|
|
102
114
|
computed: {
|
|
103
115
|
flyweight() {
|
|
104
116
|
return this.$refs.flyweight || "";
|
|
117
|
+
},
|
|
118
|
+
style() {
|
|
119
|
+
var e = this.w, t = this.h, s = this.Size, i = {};
|
|
120
|
+
return R(i, {
|
|
121
|
+
"--width": g(this.realW),
|
|
122
|
+
"--height": g(this.realH),
|
|
123
|
+
"--flyweight-content": g(s)
|
|
124
|
+
}, t && {
|
|
125
|
+
"--flyweight-h": g(t)
|
|
126
|
+
}, e && i, {
|
|
127
|
+
"--flyweight-w": g(e)
|
|
128
|
+
}, "mix"), i;
|
|
105
129
|
}
|
|
106
130
|
},
|
|
107
131
|
data() {
|
|
@@ -154,15 +178,15 @@ const M = {
|
|
|
154
178
|
} catch (e) {
|
|
155
179
|
G(e);
|
|
156
180
|
}
|
|
157
|
-
this.scrollx =
|
|
181
|
+
this.scrollx = y("hasAttribute", this.flyweight, "scroll-x"), this.BoxRule = /* this.scrollx ? 'clientHeight=>width,clientWidth=>height' : */
|
|
158
182
|
"clientHeight=>height,clientWidth=>width", this.direction = this.scrollx ? "scrollLeft" : "scrollTop";
|
|
159
183
|
},
|
|
160
184
|
methods: {
|
|
161
|
-
exec:
|
|
185
|
+
exec: g,
|
|
162
186
|
trigger(e, t) {
|
|
163
|
-
|
|
187
|
+
I(e) || (e = e && t ? [[e, t]] : []), e.length && this.lazyrun(() => {
|
|
164
188
|
m(e, (s, i) => {
|
|
165
|
-
this.$emit(i[0],
|
|
189
|
+
this.$emit(i[0], B(i[1]) ? !0 : i[1]);
|
|
166
190
|
});
|
|
167
191
|
});
|
|
168
192
|
},
|
|
@@ -171,17 +195,17 @@ const M = {
|
|
|
171
195
|
return e && this.task.push(e), !0;
|
|
172
196
|
},
|
|
173
197
|
setview(e) {
|
|
174
|
-
|
|
198
|
+
y([this.cheackflys, (t) => {
|
|
175
199
|
t = t || {};
|
|
176
200
|
let s = t.index || m(this.flys, (i, n, a, l) => {
|
|
177
201
|
if (n[a] == l)
|
|
178
202
|
return i;
|
|
179
203
|
}, t.picker, t.id);
|
|
180
|
-
|
|
204
|
+
B(s) || this.setindex(s);
|
|
181
205
|
}], this, e);
|
|
182
206
|
},
|
|
183
207
|
setindex(e) {
|
|
184
|
-
|
|
208
|
+
y([this.cheackflys, ({ index: t }) => {
|
|
185
209
|
this.selectIndex = t, this.$nextTick(() => {
|
|
186
210
|
let s = t / this.column >> 0, i = this.expand;
|
|
187
211
|
(this.flyweight[this.direction] / i >> 0) + this.row - s - 1 > 0 || (this.flyweight[this.direction] = s * i, this.scroll());
|
|
@@ -190,11 +214,11 @@ const M = {
|
|
|
190
214
|
},
|
|
191
215
|
lazyrun(e, t) {
|
|
192
216
|
clearTimeout(this.time), this.time = setTimeout(() => {
|
|
193
|
-
|
|
217
|
+
y(e);
|
|
194
218
|
}, t || this.lazy);
|
|
195
219
|
},
|
|
196
220
|
run(e) {
|
|
197
|
-
let t = [], s =
|
|
221
|
+
let t = [], s = y(this.direction, e.target), i = {
|
|
198
222
|
// ...this
|
|
199
223
|
offset: s,
|
|
200
224
|
top: s,
|
|
@@ -203,7 +227,7 @@ const M = {
|
|
|
203
227
|
/* 显示区域第一行的索引 */
|
|
204
228
|
index: s / this.expand >> 0
|
|
205
229
|
};
|
|
206
|
-
|
|
230
|
+
R(i, this.space), e.from || t.push(["onscroll", i]);
|
|
207
231
|
let n = !1;
|
|
208
232
|
m(
|
|
209
233
|
this.flyweights,
|
|
@@ -238,68 +262,64 @@ const M = {
|
|
|
238
262
|
if (!e)
|
|
239
263
|
return t.length = e;
|
|
240
264
|
this.count = e;
|
|
241
|
-
let s = this.scrollx, i = this.flyweight, n =
|
|
265
|
+
let s = this.scrollx, i = this.flyweight, n = k(i, this.BoxRule);
|
|
242
266
|
this.$nextTick(() => {
|
|
243
|
-
let a = /true/.test(this.auto), [l, h] = this.offset, r = n.width, f = n.height, u = (
|
|
267
|
+
let a = /true/.test(this.auto), [l, h] = this.offset, r = n.width, f = n.height, u = (O(this.width, r) || r) + l, d = O(this.height, f) + h, c = [r / u >> 0 || 1, f / d >> 0 || 1];
|
|
244
268
|
s && c.reverse();
|
|
245
|
-
let [o, p] = c,
|
|
246
|
-
s ? (_ = u, u -= l,
|
|
269
|
+
let [o, p] = c, v = this.padding, $, b = 0, _, S;
|
|
270
|
+
s ? (_ = u, u -= l, S = (w) => (
|
|
247
271
|
/* 计算top偏移量 */
|
|
248
|
-
|
|
249
|
-
)) : (a ? (u = (r - l * (o + 2 *
|
|
250
|
-
let
|
|
251
|
-
for (;
|
|
252
|
-
|
|
272
|
+
w * (d - h) + (w + 1) * h
|
|
273
|
+
)) : (a ? (u = (r - l * (o + 2 * v - 1)) / o, $ = !v * l, b = v * l) : ($ = 0, b = (r % u + l * o) / (o + 1) >> 0, u -= l), S = (w) => w * (u + $) + (w + 1) * b, _ = d), this.row = p + 2, this.column = o, this.realH = d - h, this.realW = u, this.expand = _, this.Size = Math.ceil(e / o) * _;
|
|
274
|
+
let T = Math.min(e, o * this.row), x = T - 1, C;
|
|
275
|
+
for (; T-- > 0; )
|
|
276
|
+
C = x - T, this.$set(t, C, {
|
|
253
277
|
x: l,
|
|
254
278
|
y: h,
|
|
255
279
|
width: u,
|
|
256
280
|
height: d - h,
|
|
257
|
-
space:
|
|
281
|
+
space: S(C % o),
|
|
258
282
|
data: {}
|
|
259
283
|
});
|
|
260
|
-
t.length =
|
|
261
|
-
let
|
|
262
|
-
f / _ >
|
|
284
|
+
t.length = x + 1;
|
|
285
|
+
let z = [];
|
|
286
|
+
f / _ > x / o && z.push(["onend"]), this.flyweight && (this.flyweight[this.direction] = 0), this.$nextTick(() => {
|
|
263
287
|
this.setindex(this.selectIndex || 0), this.scroll();
|
|
264
|
-
}),
|
|
265
|
-
row: (
|
|
288
|
+
}), z.push(["update:space", {
|
|
289
|
+
row: (x / o >> 0) + 1,
|
|
266
290
|
column: o,
|
|
267
291
|
showrow: this.row,
|
|
268
292
|
showcolumn: this.column
|
|
269
|
-
}]), this.trigger(
|
|
293
|
+
}]), this.trigger(z);
|
|
270
294
|
});
|
|
271
295
|
}
|
|
272
296
|
}
|
|
273
297
|
};
|
|
274
|
-
var
|
|
298
|
+
var j = function() {
|
|
275
299
|
var t = this, s = t._self._c;
|
|
276
300
|
return s("div", { ref: "flyweight", staticClass: "flyweight", class: {
|
|
277
301
|
"flyweight-active": t.actice
|
|
278
|
-
}, style: {
|
|
279
|
-
"--width": t.exec(t.realW),
|
|
280
|
-
"--height": t.exec(t.realH),
|
|
281
|
-
"--flyweight-content": t.exec(t.Size)
|
|
282
|
-
}, on: { scroll: t.scroll } }, [s("div", { staticClass: "flyweight-all" }, t._l(t.flyweights, function(i, n) {
|
|
302
|
+
}, style: t.style, on: { scroll: t.scroll } }, [s("div", { staticClass: "flyweight-all" }, t._l(t.flyweights, function(i, n) {
|
|
283
303
|
return s("div", { key: n, style: {
|
|
284
304
|
top: i.top + "px",
|
|
285
305
|
left: i.left + "px"
|
|
286
306
|
} }, [t._t("default", null, null, i)], 2);
|
|
287
307
|
}), 0), t.flyweights.length ? t._t("end") : t._e()], 2);
|
|
288
|
-
},
|
|
289
|
-
M,
|
|
308
|
+
}, Y = [], q = /* @__PURE__ */ F(
|
|
290
309
|
V,
|
|
291
310
|
j,
|
|
311
|
+
Y,
|
|
292
312
|
!1,
|
|
293
313
|
null,
|
|
294
|
-
"
|
|
314
|
+
"3416ac53",
|
|
295
315
|
null,
|
|
296
316
|
null
|
|
297
317
|
);
|
|
298
|
-
const
|
|
299
|
-
function
|
|
318
|
+
const D = q.exports;
|
|
319
|
+
function N(e, t) {
|
|
300
320
|
return t && (e = e.replace(/[a-z]/g, "")), e.toLowerCase();
|
|
301
321
|
}
|
|
302
|
-
let
|
|
322
|
+
let W = {
|
|
303
323
|
close: {
|
|
304
324
|
handler(e) {
|
|
305
325
|
this.change(e);
|
|
@@ -312,13 +332,13 @@ let B = {
|
|
|
312
332
|
},
|
|
313
333
|
deep: !0
|
|
314
334
|
}
|
|
315
|
-
},
|
|
316
|
-
m(
|
|
317
|
-
e =
|
|
335
|
+
}, J = ["BackGround", "BordeR", "Height", "Width", "Top", "Right", "Bottom", "Left"], E = {};
|
|
336
|
+
m(J, (e, t, s) => {
|
|
337
|
+
e = N(t), E["--" + N(t, !0)] = e, s[e] = function() {
|
|
318
338
|
this.trigger++;
|
|
319
339
|
};
|
|
320
|
-
},
|
|
321
|
-
const
|
|
340
|
+
}, W);
|
|
341
|
+
const K = {
|
|
322
342
|
name: "Card",
|
|
323
343
|
// inheritAttrs: false,
|
|
324
344
|
props: {
|
|
@@ -377,27 +397,27 @@ const J = {
|
|
|
377
397
|
return this.tr();
|
|
378
398
|
}
|
|
379
399
|
},
|
|
380
|
-
watch:
|
|
400
|
+
watch: W,
|
|
381
401
|
methods: {
|
|
382
|
-
exec:
|
|
383
|
-
isEmpty:
|
|
384
|
-
isSimplyType:
|
|
402
|
+
exec: g,
|
|
403
|
+
isEmpty: M,
|
|
404
|
+
isSimplyType: H,
|
|
385
405
|
tr() {
|
|
386
406
|
let e = {};
|
|
387
|
-
return this.margin(this.offset), m(
|
|
407
|
+
return this.margin(this.offset), m(E, (t, s) => {
|
|
388
408
|
this.css(e, t, s);
|
|
389
409
|
}), e;
|
|
390
410
|
},
|
|
391
|
-
tolower:
|
|
411
|
+
tolower: N,
|
|
392
412
|
css(e, t, s) {
|
|
393
413
|
let i = this[s] || this.default[s];
|
|
394
|
-
!i || this.default[s] == i || (e[t] =
|
|
414
|
+
!i || this.default[s] == i || (e[t] = g(i));
|
|
395
415
|
},
|
|
396
416
|
change(e) {
|
|
397
|
-
|
|
417
|
+
H(e) || (this.closecss = k(e, "color=>--s-card-close-color,size=>--s-close-width,bold=>--s-close-height,*"));
|
|
398
418
|
},
|
|
399
419
|
margin(e) {
|
|
400
|
-
|
|
420
|
+
R(this, k(
|
|
401
421
|
U(e) ? e.split(/\s*(?:,|\s+)\s*/) : e,
|
|
402
422
|
"0=>top,1|0=>right,2|0=>bottom,3|1|0=>left",
|
|
403
423
|
!0
|
|
@@ -408,7 +428,7 @@ const J = {
|
|
|
408
428
|
this.change(this.close);
|
|
409
429
|
}
|
|
410
430
|
};
|
|
411
|
-
var
|
|
431
|
+
var P = function() {
|
|
412
432
|
var t = this, s = t._self._c;
|
|
413
433
|
return s("div", { key: t.trigger, staticClass: "card", style: t.isEmpty(t.style) ? t.tr() : t.style }, [t._t("default", function() {
|
|
414
434
|
return [t._t("title", function() {
|
|
@@ -419,17 +439,17 @@ var K = function() {
|
|
|
419
439
|
return [s("div", { staticClass: "card-content" }, [t._t("inner")], 2)];
|
|
420
440
|
})];
|
|
421
441
|
})], 2);
|
|
422
|
-
},
|
|
423
|
-
J,
|
|
442
|
+
}, Q = [], Z = /* @__PURE__ */ F(
|
|
424
443
|
K,
|
|
425
444
|
P,
|
|
445
|
+
Q,
|
|
426
446
|
!1,
|
|
427
447
|
null,
|
|
428
448
|
"6065b432",
|
|
429
449
|
null,
|
|
430
450
|
null
|
|
431
451
|
);
|
|
432
|
-
const
|
|
452
|
+
const tt = Z.exports, et = {
|
|
433
453
|
name: "Stream",
|
|
434
454
|
props: {
|
|
435
455
|
type: {
|
|
@@ -452,31 +472,31 @@ const Z = Q.exports, tt = {
|
|
|
452
472
|
}
|
|
453
473
|
}
|
|
454
474
|
};
|
|
455
|
-
var
|
|
475
|
+
var st = function() {
|
|
456
476
|
var t = this, s = t._self._c;
|
|
457
477
|
return s(t.type, t._b({ tag: "component", attrs: { data: t.data } }, "component", t.$attrs, !1), [t._l(t.T, function(i) {
|
|
458
478
|
return [t._t(t.trigger(i), null, null, i)];
|
|
459
479
|
})], 2);
|
|
460
|
-
},
|
|
461
|
-
tt,
|
|
480
|
+
}, it = [], lt = /* @__PURE__ */ F(
|
|
462
481
|
et,
|
|
463
482
|
st,
|
|
483
|
+
it,
|
|
464
484
|
!1,
|
|
465
485
|
null,
|
|
466
486
|
null,
|
|
467
487
|
null,
|
|
468
488
|
null
|
|
469
489
|
);
|
|
470
|
-
const
|
|
490
|
+
const rt = lt.exports, nt = [D, tt, rt], ot = {
|
|
471
491
|
install(e) {
|
|
472
|
-
|
|
492
|
+
nt.forEach((t) => {
|
|
473
493
|
e.component("S" + t.name, t), e.component(t.name + "S", t);
|
|
474
494
|
});
|
|
475
495
|
}
|
|
476
496
|
};
|
|
477
497
|
export {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
498
|
+
tt as Card,
|
|
499
|
+
D as Flyweight,
|
|
500
|
+
rt as Stream,
|
|
501
|
+
ot as default
|
|
482
502
|
};
|
package/vue2/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.flyweight[data-v-
|
|
1
|
+
@charset "UTF-8";.flyweight[data-v-3416ac53]{height:var(--flyweight-h, 100%);width:var(--flyweight-w, 100%);overflow:auto;position:relative}.flyweight[hover-scroll][data-v-3416ac53]::-webkit-scrollbar-track,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar-track{border-radius:10px}.flyweight[hover-scroll][data-v-3416ac53]::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.flyweight[hover-scroll][data-v-3416ac53]::-webkit-scrollbar,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.flyweight[hover-scroll][data-v-3416ac53]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.flyweight[hover-scroll][data-v-3416ac53]:hover::-webkit-scrollbar-thumb:hover,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.flyweight[hover-scroll][data-v-3416ac53]:hover::-webkit-scrollbar-thumb,.flyweight[auto-scroll][data-v-3416ac53]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.flyweight[scroll-x] .flyweight-all[data-v-3416ac53]{width:var(--flyweight-content);height:auto;min-height:100%}.flyweight[scroll-x] .flyweight-all+*[data-v-3416ac53]{left:var(--flyweight-content);position:absolute;top:0;height:100%}.flyweight .flyweight-all[data-v-3416ac53]{height:var(--flyweight-content)}.flyweight .flyweight-all>*[data-v-3416ac53]{width:calc(var(--width));height:var(--height);position:absolute}@media screen and (-apple-system: Macintosh){.flyweight .flyweight-all[data-v-3416ac53]{background-color:red!important}}.card[data-v-6065b432]{--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:10px;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-6065b432]::-webkit-scrollbar-track,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar-track{border-radius:10px}.card[hover-scroll][data-v-6065b432]::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar-thumb{border-radius:10px;background-color:transparent}.card[hover-scroll][data-v-6065b432]::-webkit-scrollbar,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar{border-radius:10px;width:var(--scrollbar-width, 8px);height:var(--scrollbar-width, 8px)}.card[hover-scroll][data-v-6065b432]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar-thumb{border-style:dashed;border-color:transparent;border-width:2px;background-clip:padding-box;cursor:pointer}.card[hover-scroll][data-v-6065b432]:hover::-webkit-scrollbar-thumb:hover,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-color, #101010)}.card[hover-scroll][data-v-6065b432]:hover::-webkit-scrollbar-thumb,.card[auto-scroll][data-v-6065b432]::-webkit-scrollbar-thumb{background-color:var(--scrollbar-color, #101010)}.card[simply][data-v-6065b432],.card [simply][data-v-6065b432]{background-color:inherit;border:0!important}.card[flex][data-v-6065b432],.card [flex][data-v-6065b432]{display:flex}.card[column][data-v-6065b432],.card [column][data-v-6065b432]{flex-direction:column}.card[row][data-v-6065b432],.card [row][data-v-6065b432]{flex-direction:row}.card[center][data-v-6065b432],.card [center][data-v-6065b432]{justify-content:center}.card[vcenter][data-v-6065b432],.card [vcenter][data-v-6065b432]{align-items:center}.card .card-title[data-v-6065b432]{max-height:40px}.card .card-close[data-v-6065b432]{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-6065b432]{display:none}.card .card-close[data-v-6065b432]:before,.card .card-close[data-v-6065b432]: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-6065b432]:before{transform:rotate(var(--s-transform, 45deg))}.card .card-close[data-v-6065b432]:after{transform:rotate(calc(0deg - var(--s-transform, 45deg)))}.card .card-close[data-v-6065b432]:hover:before{transform:rotate(var(--s-hover-transform, 45deg))}.card .card-close[data-v-6065b432]:hover:after{transform:rotate(calc(0deg - var(--s-hover-transform, 45deg)))}.card .card-content[data-v-6065b432]{overflow:auto;height:100%}
|