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