@leafer-in/flow 2.2.11 → 2.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/dist/flow.cjs CHANGED
@@ -300,6 +300,8 @@ function flowX(box, reverse) {
300
300
  child = children[index = reverse ? len - 1 - i : i];
301
301
  if (child.__.inFlow && child.__.visible !== 0) {
302
302
  local = getItemBounds(child, itemBox);
303
+ if (child.__.autoWidth && draw.isObject(child.__.autoWidth)) resizeWidth(child, local, draw.UnitConvertHelper.number(child.__.autoWidth, width));
304
+ if (child.__.autoHeight && draw.isObject(child.__.autoHeight)) resizeHeight(child, local, draw.UnitConvertHelper.number(child.__.autoHeight, height));
303
305
  if (complex) {
304
306
  child.__flowBounds = local;
305
307
  if (!data) data = getDrawData(index, xGapTempNum);
@@ -397,6 +399,8 @@ function flowY(box, reverse) {
397
399
  child = children[index = reverse ? len - 1 - i : i];
398
400
  if (child.__.inFlow && child.__.visible !== 0) {
399
401
  local = getItemBounds(child, itemBox);
402
+ if (child.__.autoWidth && draw.isObject(child.__.autoWidth)) resizeWidth(child, local, draw.UnitConvertHelper.number(child.__.autoWidth, width));
403
+ if (child.__.autoHeight && draw.isObject(child.__.autoHeight)) resizeHeight(child, local, draw.UnitConvertHelper.number(child.__.autoHeight, height));
400
404
  if (complex) {
401
405
  child.__flowBounds = local;
402
406
  if (!data) data = getDrawData(index, yGapTempNum);
package/dist/flow.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BoxData, dataProcessor, autoLayoutType, registerUI, Box, AlignHelper, PointHelper, isObject, tryToNumber, isString, MathHelper, decorateLeafAttr, attr, isNumber, doBoundsType, Plugin, UIData, Group, UI, boundsType, BoundsHelper } from "@leafer-ui/draw";
1
+ import { BoxData, dataProcessor, autoLayoutType, registerUI, Box, AlignHelper, PointHelper, isObject, tryToNumber, isString, MathHelper, UnitConvertHelper, decorateLeafAttr, attr, isNumber, doBoundsType, Plugin, UIData, Group, UI, boundsType, BoundsHelper } from "@leafer-ui/draw";
2
2
 
3
3
  import "@leafer-in/resize";
4
4
 
@@ -298,6 +298,8 @@ function flowX(box, reverse) {
298
298
  child = children[index = reverse ? len - 1 - i : i];
299
299
  if (child.__.inFlow && child.__.visible !== 0) {
300
300
  local = getItemBounds(child, itemBox);
301
+ if (child.__.autoWidth && isObject(child.__.autoWidth)) resizeWidth(child, local, UnitConvertHelper.number(child.__.autoWidth, width));
302
+ if (child.__.autoHeight && isObject(child.__.autoHeight)) resizeHeight(child, local, UnitConvertHelper.number(child.__.autoHeight, height));
301
303
  if (complex) {
302
304
  child.__flowBounds = local;
303
305
  if (!data) data = getDrawData(index, xGapTempNum);
@@ -395,6 +397,8 @@ function flowY(box, reverse) {
395
397
  child = children[index = reverse ? len - 1 - i : i];
396
398
  if (child.__.inFlow && child.__.visible !== 0) {
397
399
  local = getItemBounds(child, itemBox);
400
+ if (child.__.autoWidth && isObject(child.__.autoWidth)) resizeWidth(child, local, UnitConvertHelper.number(child.__.autoWidth, width));
401
+ if (child.__.autoHeight && isObject(child.__.autoHeight)) resizeHeight(child, local, UnitConvertHelper.number(child.__.autoHeight, height));
398
402
  if (complex) {
399
403
  child.__flowBounds = local;
400
404
  if (!data) data = getDrawData(index, yGapTempNum);
@@ -1,2 +1,2 @@
1
- import{BoxData as t,dataProcessor as e,autoLayoutType as o,registerUI as i,Box as n,AlignHelper as h,PointHelper as r,isObject as s,tryToNumber as _,isString as a,MathHelper as l,decorateLeafAttr as c,attr as u,isNumber as d,doBoundsType as g,Plugin as f,UIData as w,Group as p,UI as x,boundsType as y,BoundsHelper as G}from"@leafer-ui/draw";import"@leafer-in/resize";function m(t,e,o,i){var n,h=arguments.length,r=h<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,i);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(r=(h<3?n(r):h>3?n(e,o,r):n(e,o))||r);return h>3&&r&&Object.defineProperty(e,o,r),r}"function"==typeof SuppressedError&&SuppressedError;let B=class extends n{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}};m([e(class extends t{})],B.prototype,"__",void 0),m([o("x")],B.prototype,"flow",void 0),B=m([i()],B);const A={},b={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},v={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function R(t,e,o){const i=t.__,{contentBounds:n}=t.__layout;h.toPoint(o,e,n,A),e.x=i.__autoWidth?n.x:A.x,e.y=i.__autoHeight?n.y:A.y}const{move:S}=r;function F(t,e,o,i,n,h){const{children:r}=t;let s,_,{x:a,start:l}=e,c=i;a+=o;for(let t=0,o=e.count;t<o;t++)s=r[h?l-t:l+t],s.__.inFlow&&0!==s.__.visible?(_=s.__flowBounds,"from"!==n&&(c=i+(e.height-_.height)/("center"===n?2:1)),S(s,a-_.x,c-_.y),a+=_.width+e.gap):o++}function W(t,e,o){const i="width"===o?"height":"width";t[o]=Math.max(t[o],e[o]),t[i]+=t.count?e[i]+t.gap:e[i],t.list.push(e),t.count++}const z={};function X(t,e){const{gap:o,flowAlign:i,flowWrap:n,__autoWidth:h,__autoHeight:r}=t.__,l=n&&(e?!h:!r);return s(o)?(z.xGap=o.x||0,z.yGap=o.y||0):z.xGap=z.yGap=_(o),z.isAutoXGap=a(z.xGap)&&!h,z.isAutoYGap=a(z.yGap)&&!r,z.complex=l||"top-left"!==i||t.__hasGrow||z.isAutoXGap||z.isAutoYGap,z.wrap=l,z.complex&&(z.isFitXGap="fit"===z.xGap&&!h,z.isFitYGap="fit"===z.yGap&&!r,s(i)?(z.contentAlign=i.content||"top-left",z.rowXAlign=i.x||"from",z.rowYAlign=i.y||"from"):(z.contentAlign=i,z.rowXAlign=b[i],z.rowYAlign=v[i])),z}function Y(t,e){return{x:0,y:0,width:0,height:0,gap:e,start:t,count:0,grow:0}}function k(t,e,o,i){const{count:n}=t;n>1&&(o>t[e]||i)&&(t.gap=(o-t[e])/(n-1),t[e]=o)}function P(t,e){return"box"===e?t.__local:t.__layout.localStrokeBounds}const{within:j}=l;function C(t,e,o,i){let n,h,r,s=0,_=e.hasRangeSize&&[],{grow:a,start:l}=e;const c=(o-e.width)/a,{children:u}=t;if(!(c<=0)){e.width=o;for(let t=0,o=e.count;t<o;t++)n=u[i?l-t:l+t],n.__.inFlow&&0!==n.__.visible?(h=n.__widthGrow)&&(r=H(n,n.__flowBounds,c*h),r?(s+=r,a-=h):_&&(n.__.widthRange?_.unshift(n):_.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__widthGrow,n=e/o*i,r=H(t,h=t.__flowBounds,h.width+n),e-=n-r,o-=i})}(_,s,a)}}function H(t,e,o){const{widthRange:i,lockRatio:n}=t.__,h=i?j(o,i):o;e.width||(t.__.width=e.width=1);const r=h/e.width;return t.scaleResize(r,n?r:1),e.width=h,o-h}const{within:O}=l;function E(t,e,o,i){let n,h,r,s=0,_=e.hasRangeSize&&[],{grow:a,start:l}=e;const c=(o-e.height)/a,{children:u}=t;if(!(c<=0)){e.height=o;for(let t=0,o=e.count;t<o;t++)n=u[i?l-t:l+t],n.__.inFlow&&0!==n.__.visible?(h=n.__heightGrow)&&(r=M(n,n.__flowBounds,c*h),r?(s+=r,a-=h):_&&(n.__.heightRange?_.unshift(n):_.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__heightGrow,n=e/o*i,r=M(t,h=t.__flowBounds,h.height+n),e-=n-r,o-=i})}(_,s,a)}}function M(t,e,o){const{heightRange:i,lockRatio:n}=t.__,h=i?O(o,i):o;e.height||(t.__.height=e.height=1);const r=h/e.height;return t.scaleResize(n?r:1,r),e.height=h,o-h}const{move:L}=r;function D(t,e){const o="width",{children:i,itemBox:n}=t,h=X(t,!0),{complex:r,wrap:s,xGap:_,yGap:a,isAutoXGap:l,isFitXGap:c}=h;if(!i.length)return;const u=s&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},d=l?0:_;let g,f,w,p,x,{x:y,y:G,width:m,height:B}=t.__layout.contentBounds;for(let h=0,_=i.length;h<_;h++)g=i[p=e?_-1-h:h],g.__.inFlow&&0!==g.__.visible&&(f=P(g,n),r?(g.__flowBounds=f,x||(x=Y(p,d)),s&&x.count&&x.width+f.width>m&&(x.grow?C(t,x,m,e):l&&k(x,o,m,c),W(u,x,o),x=Y(p,d)),w=f.width,g.__widthGrow&&(x.grow+=g.__widthGrow,w=0,g.__.widthRange&&(x.hasRangeSize=!0)),g.__heightGrow&&M(g,f,B),x.width+=x.count?w+d:w,x.height=Math.max(x.height,f.height),x.count++):(L(g,y-f.x,G-f.y),y+=f.width+d));if(r&&x){const{isAutoYGap:i,isFitYGap:n,contentAlign:r,rowXAlign:_,rowYAlign:d}=h;x.count&&(x.grow?C(t,x,m,e):l&&k(x,o,m,c),s&&W(u,x,o)),s?(i?k(u,"height",B,n):u.height+=(u.gap=a)*(u.list.length-1),function(t,e,o,i){R(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=b[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.x=e.width-t.width,"center"===i&&(t.x/=2)}}(t,u,r,_),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:_}=e;for(let a=0,l=n.length;a<l;a++)r=n[h?l-1-a:a],F(t,r,s,_,o,i),_+=r.height+e.gap}(t,u,d,e)):(R(t,x,r),F(t,x,0,x.y,d,e))}}const{move:I}=r;function N(t,e,o,i,n,h){const{children:r}=t;let s,_,{y:a,start:l}=e,c=o;a+=i;for(let t=0,i=e.count;t<i;t++)s=r[h?l-t:l+t],s.__.inFlow&&0!==s.__.visible?(_=s.__flowBounds,"from"!==n&&(c=o+(e.width-_.width)/("center"===n?2:1)),I(s,c-_.x,a-_.y),a+=_.height+e.gap):i++}const{move:U}=r;function q(t,e){const o="height",{children:i,itemBox:n}=t,h=X(t,!1),{complex:r,wrap:s,xGap:_,yGap:a,isAutoYGap:l,isFitYGap:c}=h;if(!i.length)return;const u=s&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},d=l?0:a;let g,f,w,p,x,{x:y,y:G,width:m,height:B}=t.__layout.contentBounds;for(let h=0,_=i.length;h<_;h++)g=i[p=e?_-1-h:h],g.__.inFlow&&0!==g.__.visible&&(f=P(g,n),r?(g.__flowBounds=f,x||(x=Y(p,d)),s&&x.count&&x.height+f.height>B&&(x.grow&&E(t,x,B,e),l&&k(x,o,B,c),W(u,x,o),x=Y(p,d)),w=f.height,g.__heightGrow&&(x.grow+=g.__heightGrow,w=0,g.__.heightRange&&(x.hasRangeSize=!0)),g.__widthGrow&&H(g,f,m),x.height+=x.count?w+d:w,x.width=Math.max(x.width,f.width),x.count++):(U(g,y-f.x,G-f.y),G+=f.height+d));if(r&&x){const{isAutoXGap:i,isFitXGap:n,contentAlign:r,rowXAlign:a,rowYAlign:d}=h;x.count&&(x.grow&&E(t,x,B,e),l&&k(x,o,B,c),s&&W(u,x,o)),s?(i?k(u,"width",m,n):u.width+=(u.gap=_)*(u.list.length-1),function(t,e,o,i){R(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=v[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.y=e.height-t.height,"center"===i&&(t.y/=2)}}(t,u,r,d),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:_}=e;for(let a=0,l=n.length;a<l;a++)r=n[h?l-1-a:a],N(t,r,s,_,o,i),s+=r.width+e.gap}(t,u,a,e)):(R(t,x,r),N(t,x,x.x,0,a,e))}}function J(t){t.__hasGrow=!0}function K(t){return c(t,t=>u({set(e){const o=d(e)?e:0;"autoWidth"===t?this.__widthGrow=o:this.__heightGrow=o,this.__setAttr(t,e)&&(o&&this.waitParentChange(J),g(this))}}))}f.add("flow","resize");const Q=n.prototype,T=w.prototype,{__updateBoxBounds:V}=p.prototype;x.addAttr("flow",!1,o),x.addAttr("gap",0,y),x.addAttr("flowAlign","top-left",y),x.addAttr("flowWrap",!1,y),x.addAttr("itemBox","box",y),x.addAttr("inFlow",!0,y),x.addAttr("autoWidth",void 0,K),x.addAttr("autoHeight",void 0,K),x.addAttr("autoBox",void 0,y);const{copyAndSpread:Z,unsign:$}=G;Q.__updateFlowLayout=function(){const{leaferIsCreated:t,flow:e}=this;switch(t&&(this.leafer.created=!1),e){case"x":case!0:D(this);break;case"y":q(this);break;case"x-reverse":D(this,!0);break;case"y-reverse":q(this,!0)}t&&(this.leafer.created=!0)},Q.__updateContentBounds=function(){const{padding:t}=this.__,e=this.__layout,o=e.contentBounds===e.boxBounds;t?(o&&e.shrinkContent(),Z(e.contentBounds,e.boxBounds,t,!0),$(e.contentBounds)):o||e.shrinkContentCancel()},Q.__updateBoxBounds=function(t){if(this.children.length&&!this.__useSelfBox){const e=this.__,{flow:o}=e;if(e.__autoSide){e.__hasSurface&&this.__extraUpdate(),o&&!t?this.__updateRectBoxBounds():V.call(this);const{boxBounds:i}=this.__layout;e.__autoSize||(e.__autoWidth?(o||(i.width+=i.x,i.x=0),i.height=e.height,i.y=0):(o||(i.height+=i.y,i.y=0),i.width=e.width,i.x=0)),o&&t&&e.padding&&Z(i,i,e.padding,!1,e.__autoSize?null:e.__autoWidth?"width":"height"),this.__updateNaturalSize()}else this.__updateRectBoxBounds();o&&this.__updateContentBounds()}else this.__updateRectBoxBounds()},Object.defineProperty(T,"__autoWidth",{get(){return null==this._width&&null==this._autoWidth}}),Object.defineProperty(T,"__autoHeight",{get(){return null==this._height&&null==this._autoHeight}}),Object.defineProperty(T,"__autoSide",{get(){return this.__autoWidth||this.__autoHeight}}),Object.defineProperty(T,"__autoSize",{get(){return this.__autoWidth&&this.__autoHeight}});export{B as Flow};
1
+ import{BoxData as t,dataProcessor as e,autoLayoutType as o,registerUI as i,Box as n,AlignHelper as h,PointHelper as r,isObject as _,tryToNumber as a,isString as s,MathHelper as u,UnitConvertHelper as l,decorateLeafAttr as c,attr as d,isNumber as g,doBoundsType as f,Plugin as w,UIData as p,Group as x,UI as y,boundsType as m,BoundsHelper as G}from"@leafer-ui/draw";import"@leafer-in/resize";function b(t,e,o,i){var n,h=arguments.length,r=h<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,i);else for(var _=t.length-1;_>=0;_--)(n=t[_])&&(r=(h<3?n(r):h>3?n(e,o,r):n(e,o))||r);return h>3&&r&&Object.defineProperty(e,o,r),r}"function"==typeof SuppressedError&&SuppressedError;let B=class extends n{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}};b([e(class extends t{})],B.prototype,"__",void 0),b([o("x")],B.prototype,"flow",void 0),B=b([i()],B);const A={},v={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},R={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function W(t,e,o){const i=t.__,{contentBounds:n}=t.__layout;h.toPoint(o,e,n,A),e.x=i.__autoWidth?n.x:A.x,e.y=i.__autoHeight?n.y:A.y}const{move:S}=r;function F(t,e,o,i,n,h){const{children:r}=t;let _,a,{x:s,start:u}=e,l=i;s+=o;for(let t=0,o=e.count;t<o;t++)_=r[h?u-t:u+t],_.__.inFlow&&0!==_.__.visible?(a=_.__flowBounds,"from"!==n&&(l=i+(e.height-a.height)/("center"===n?2:1)),S(_,s-a.x,l-a.y),s+=a.width+e.gap):o++}function H(t,e,o){const i="width"===o?"height":"width";t[o]=Math.max(t[o],e[o]),t[i]+=t.count?e[i]+t.gap:e[i],t.list.push(e),t.count++}const z={};function X(t,e){const{gap:o,flowAlign:i,flowWrap:n,__autoWidth:h,__autoHeight:r}=t.__,u=n&&(e?!h:!r);return _(o)?(z.xGap=o.x||0,z.yGap=o.y||0):z.xGap=z.yGap=a(o),z.isAutoXGap=s(z.xGap)&&!h,z.isAutoYGap=s(z.yGap)&&!r,z.complex=u||"top-left"!==i||t.__hasGrow||z.isAutoXGap||z.isAutoYGap,z.wrap=u,z.complex&&(z.isFitXGap="fit"===z.xGap&&!h,z.isFitYGap="fit"===z.yGap&&!r,_(i)?(z.contentAlign=i.content||"top-left",z.rowXAlign=i.x||"from",z.rowYAlign=i.y||"from"):(z.contentAlign=i,z.rowXAlign=v[i],z.rowYAlign=R[i])),z}function Y(t,e){return{x:0,y:0,width:0,height:0,gap:e,start:t,count:0,grow:0}}function k(t,e,o,i){const{count:n}=t;n>1&&(o>t[e]||i)&&(t.gap=(o-t[e])/(n-1),t[e]=o)}function P(t,e){return"box"===e?t.__local:t.__layout.localStrokeBounds}const{within:j}=u;function C(t,e,o,i){let n,h,r,_=0,a=e.hasRangeSize&&[],{grow:s,start:u}=e;const l=(o-e.width)/s,{children:c}=t;if(!(l<=0)){e.width=o;for(let t=0,o=e.count;t<o;t++)n=c[i?u-t:u+t],n.__.inFlow&&0!==n.__.visible?(h=n.__widthGrow)&&(r=O(n,n.__flowBounds,l*h),r?(_+=r,s-=h):a&&(n.__.widthRange?a.unshift(n):a.push(n))):o++;_&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__widthGrow,n=e/o*i,r=O(t,h=t.__flowBounds,h.width+n),e-=n-r,o-=i})}(a,_,s)}}function O(t,e,o){const{widthRange:i,lockRatio:n}=t.__,h=i?j(o,i):o;e.width||(t.__.width=e.width=1);const r=h/e.width;return t.scaleResize(r,n?r:1),e.width=h,o-h}const{within:E}=u;function M(t,e,o,i){let n,h,r,_=0,a=e.hasRangeSize&&[],{grow:s,start:u}=e;const l=(o-e.height)/s,{children:c}=t;if(!(l<=0)){e.height=o;for(let t=0,o=e.count;t<o;t++)n=c[i?u-t:u+t],n.__.inFlow&&0!==n.__.visible?(h=n.__heightGrow)&&(r=L(n,n.__flowBounds,l*h),r?(_+=r,s-=h):a&&(n.__.heightRange?a.unshift(n):a.push(n))):o++;_&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__heightGrow,n=e/o*i,r=L(t,h=t.__flowBounds,h.height+n),e-=n-r,o-=i})}(a,_,s)}}function L(t,e,o){const{heightRange:i,lockRatio:n}=t.__,h=i?E(o,i):o;e.height||(t.__.height=e.height=1);const r=h/e.height;return t.scaleResize(n?r:1,r),e.height=h,o-h}const{move:D}=r;function I(t,e){const o="width",{children:i,itemBox:n}=t,h=X(t,!0),{complex:r,wrap:a,xGap:s,yGap:u,isAutoXGap:c,isFitXGap:d}=h;if(!i.length)return;const g=a&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},f=c?0:s;let w,p,x,y,m,{x:G,y:b,width:B,height:A}=t.__layout.contentBounds;for(let h=0,s=i.length;h<s;h++)w=i[y=e?s-1-h:h],w.__.inFlow&&0!==w.__.visible&&(p=P(w,n),w.__.autoWidth&&_(w.__.autoWidth)&&O(w,p,l.number(w.__.autoWidth,B)),w.__.autoHeight&&_(w.__.autoHeight)&&L(w,p,l.number(w.__.autoHeight,A)),r?(w.__flowBounds=p,m||(m=Y(y,f)),a&&m.count&&m.width+p.width>B&&(m.grow?C(t,m,B,e):c&&k(m,o,B,d),H(g,m,o),m=Y(y,f)),x=p.width,w.__widthGrow&&(m.grow+=w.__widthGrow,x=0,w.__.widthRange&&(m.hasRangeSize=!0)),w.__heightGrow&&L(w,p,A),m.width+=m.count?x+f:x,m.height=Math.max(m.height,p.height),m.count++):(D(w,G-p.x,b-p.y),G+=p.width+f));if(r&&m){const{isAutoYGap:i,isFitYGap:n,contentAlign:r,rowXAlign:_,rowYAlign:s}=h;m.count&&(m.grow?C(t,m,B,e):c&&k(m,o,B,d),a&&H(g,m,o)),a?(i?k(g,"height",A,n):g.height+=(g.gap=u)*(g.list.length-1),function(t,e,o,i){W(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=v[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.x=e.width-t.width,"center"===i&&(t.x/=2)}}(t,g,r,_),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:_,y:a}=e;for(let s=0,u=n.length;s<u;s++)r=n[h?u-1-s:s],F(t,r,_,a,o,i),a+=r.height+e.gap}(t,g,s,e)):(W(t,m,r),F(t,m,0,m.y,s,e))}}const{move:N}=r;function U(t,e,o,i,n,h){const{children:r}=t;let _,a,{y:s,start:u}=e,l=o;s+=i;for(let t=0,i=e.count;t<i;t++)_=r[h?u-t:u+t],_.__.inFlow&&0!==_.__.visible?(a=_.__flowBounds,"from"!==n&&(l=o+(e.width-a.width)/("center"===n?2:1)),N(_,l-a.x,s-a.y),s+=a.height+e.gap):i++}const{move:q}=r;function J(t,e){const o="height",{children:i,itemBox:n}=t,h=X(t,!1),{complex:r,wrap:a,xGap:s,yGap:u,isAutoYGap:c,isFitYGap:d}=h;if(!i.length)return;const g=a&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},f=c?0:u;let w,p,x,y,m,{x:G,y:b,width:B,height:A}=t.__layout.contentBounds;for(let h=0,s=i.length;h<s;h++)w=i[y=e?s-1-h:h],w.__.inFlow&&0!==w.__.visible&&(p=P(w,n),w.__.autoWidth&&_(w.__.autoWidth)&&O(w,p,l.number(w.__.autoWidth,B)),w.__.autoHeight&&_(w.__.autoHeight)&&L(w,p,l.number(w.__.autoHeight,A)),r?(w.__flowBounds=p,m||(m=Y(y,f)),a&&m.count&&m.height+p.height>A&&(m.grow&&M(t,m,A,e),c&&k(m,o,A,d),H(g,m,o),m=Y(y,f)),x=p.height,w.__heightGrow&&(m.grow+=w.__heightGrow,x=0,w.__.heightRange&&(m.hasRangeSize=!0)),w.__widthGrow&&O(w,p,B),m.height+=m.count?x+f:x,m.width=Math.max(m.width,p.width),m.count++):(q(w,G-p.x,b-p.y),b+=p.height+f));if(r&&m){const{isAutoXGap:i,isFitXGap:n,contentAlign:r,rowXAlign:_,rowYAlign:u}=h;m.count&&(m.grow&&M(t,m,A,e),c&&k(m,o,A,d),a&&H(g,m,o)),a?(i?k(g,"width",B,n):g.width+=(g.gap=s)*(g.list.length-1),function(t,e,o,i){W(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=R[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.y=e.height-t.height,"center"===i&&(t.y/=2)}}(t,g,r,u),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:_,y:a}=e;for(let s=0,u=n.length;s<u;s++)r=n[h?u-1-s:s],U(t,r,_,a,o,i),_+=r.width+e.gap}(t,g,_,e)):(W(t,m,r),U(t,m,m.x,0,_,e))}}function K(t){t.__hasGrow=!0}function Q(t){return c(t,t=>d({set(e){const o=g(e)?e:0;"autoWidth"===t?this.__widthGrow=o:this.__heightGrow=o,this.__setAttr(t,e)&&(o&&this.waitParentChange(K),f(this))}}))}w.add("flow","resize");const T=n.prototype,V=p.prototype,{__updateBoxBounds:Z}=x.prototype;y.addAttr("flow",!1,o),y.addAttr("gap",0,m),y.addAttr("flowAlign","top-left",m),y.addAttr("flowWrap",!1,m),y.addAttr("itemBox","box",m),y.addAttr("inFlow",!0,m),y.addAttr("autoWidth",void 0,Q),y.addAttr("autoHeight",void 0,Q),y.addAttr("autoBox",void 0,m);const{copyAndSpread:$,unsign:tt}=G;T.__updateFlowLayout=function(){const{leaferIsCreated:t,flow:e}=this;switch(t&&(this.leafer.created=!1),e){case"x":case!0:I(this);break;case"y":J(this);break;case"x-reverse":I(this,!0);break;case"y-reverse":J(this,!0)}t&&(this.leafer.created=!0)},T.__updateContentBounds=function(){const{padding:t}=this.__,e=this.__layout,o=e.contentBounds===e.boxBounds;t?(o&&e.shrinkContent(),$(e.contentBounds,e.boxBounds,t,!0),tt(e.contentBounds)):o||e.shrinkContentCancel()},T.__updateBoxBounds=function(t){if(this.children.length&&!this.__useSelfBox){const e=this.__,{flow:o}=e;if(e.__autoSide){e.__hasSurface&&this.__extraUpdate(),o&&!t?this.__updateRectBoxBounds():Z.call(this);const{boxBounds:i}=this.__layout;e.__autoSize||(e.__autoWidth?(o||(i.width+=i.x,i.x=0),i.height=e.height,i.y=0):(o||(i.height+=i.y,i.y=0),i.width=e.width,i.x=0)),o&&t&&e.padding&&$(i,i,e.padding,!1,e.__autoSize?null:e.__autoWidth?"width":"height"),this.__updateNaturalSize()}else this.__updateRectBoxBounds();o&&this.__updateContentBounds()}else this.__updateRectBoxBounds()},Object.defineProperty(V,"__autoWidth",{get(){return null==this._width&&null==this._autoWidth}}),Object.defineProperty(V,"__autoHeight",{get(){return null==this._height&&null==this._autoHeight}}),Object.defineProperty(V,"__autoSide",{get(){return this.__autoWidth||this.__autoHeight}}),Object.defineProperty(V,"__autoSize",{get(){return this.__autoWidth&&this.__autoHeight}});export{B as Flow};
2
2
  //# sourceMappingURL=flow.esm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flow.esm.min.js","sources":["../../../../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.44.2_tslib@2.8.1_typescript@5.8.3/node_modules/tslib/tslib.es6.js","../../../../../../src/in/packages/flow/src/Flow.ts","../../../../../../src/in/packages/flow/src/data/FlowData.ts","../../../../../../src/in/packages/flow/src/layout/common/align.ts","../../../../../../src/in/packages/flow/src/layout/x/layout.ts","../../../../../../src/in/packages/flow/src/layout/common/wrap.ts","../../../../../../src/in/packages/flow/src/layout/common/data.ts","../../../../../../src/in/packages/flow/src/layout/common/gap.ts","../../../../../../src/in/packages/flow/src/layout/common/bounds.ts","../../../../../../src/in/packages/flow/src/layout/x/grow.ts","../../../../../../src/in/packages/flow/src/layout/y/grow.ts","../../../../../../src/in/packages/flow/src/layout/flowX.ts","../../../../../../src/in/packages/flow/src/layout/x/align.ts","../../../../../../src/in/packages/flow/src/layout/y/layout.ts","../../../../../../src/in/packages/flow/src/layout/flowY.ts","../../../../../../src/in/packages/flow/src/layout/y/align.ts","../../../../../../src/in/packages/flow/src/decorate.ts","../../../../../../src/in/packages/flow/src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { IFlow, IFlowData, IFlowInputData, IFlowType } from '@leafer-ui/interface'\nimport { registerUI, dataProcessor, Box, autoLayoutType } from '@leafer-ui/draw'\n\nimport { FlowData } from './data/FlowData'\n\n\n@registerUI()\nexport class Flow extends Box implements IFlow {\n\n public get __tag() { return 'Flow' }\n\n @dataProcessor(FlowData)\n declare public __: IFlowData\n\n @autoLayoutType('x')\n declare public flow?: IFlowType\n\n constructor(data?: IFlowInputData) {\n super(data)\n this.__hasAutoLayout = true\n }\n\n}","import { IFlowData } from \"@leafer-ui/interface\"\nimport { BoxData } from '@leafer-ui/draw'\n\n\nexport class FlowData extends BoxData implements IFlowData {\n\n}\n","import { IBoundsData, IBox, IFlowAlign, IPointData } from '@leafer-ui/interface'\nimport { AlignHelper } from '@leafer-ui/draw'\n\nimport { IFlowAlignToAxisAlignMap } from '@leafer-in/interface'\n\n\nconst point = {} as IPointData\n\nexport const alignToInnerXMap: IFlowAlignToAxisAlignMap = {\n 'top-left': 'from',\n 'top': 'center',\n 'top-right': 'to',\n 'right': 'to',\n 'bottom-right': 'to',\n 'bottom': 'center',\n 'bottom-left': 'from',\n 'left': 'from',\n 'center': 'center',\n 'baseline-left': 'from',\n 'baseline-center': 'center',\n 'baseline-right': 'to',\n}\n\nexport const alignToInnerYMap: IFlowAlignToAxisAlignMap = {\n 'top-left': 'from',\n 'top': 'from',\n 'top-right': 'from',\n 'right': 'center',\n 'bottom-right': 'to',\n 'bottom': 'to',\n 'bottom-left': 'to',\n 'left': 'center',\n 'center': 'center',\n 'baseline-left': 'to',\n 'baseline-center': 'to',\n 'baseline-right': 'to',\n}\n\nexport function alignContent(box: IBox, content: IBoundsData, align: IFlowAlign): void {\n const data = box.__\n const { contentBounds } = box.__layout\n AlignHelper.toPoint(align as any, content, contentBounds, point)\n content.x = data.__autoWidth ? contentBounds.x : point.x\n content.y = data.__autoHeight ? contentBounds.y : point.y\n}","import { IBoundsData, IBox, IUI, IPointData, IAxisAlign } from '@leafer-ui/interface'\n\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\n\nconst { move } = PointHelper\n\nexport function layout(box: IBox, data: IFlowWrapDrawData, rowYAlign?: IAxisAlign, reverse?: boolean): void {\n const { list } = data, reverseWrap = box.__.flowWrap === 'reverse'\n let row: IFlowDrawData, { x, y } = data\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[reverseWrap ? len - 1 - i : i]\n layoutX(box, row, x, y, rowYAlign, reverse)\n y += row.height + data.gap\n }\n}\n\nexport function layoutX(box: IBox, row: IFlowDrawData, fromX: number, fromY: number, rowYAlign: IAxisAlign, reverse?: boolean): void {\n const { children } = box\n let child: IUI, local: IBoundsData, { x, start } = row, y = fromY\n x += fromX\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n local = child.__flowBounds\n if (rowYAlign !== 'from') y = fromY + (row.height - local.height) / (rowYAlign === 'center' ? 2 : 1)\n\n move(child as IPointData, x - local.x, y - local.y)\n x += local.width + row.gap\n } else {\n end++\n }\n }\n}","import { IFlowWrapDrawData, IFlowDrawData, ISide } from '@leafer-in/interface'\n\n\nexport function flowWrap(wrapData: IFlowWrapDrawData, data: IFlowDrawData, wrapSide: ISide): void {\n const otherSide = wrapSide === 'width' ? 'height' : 'width'\n wrapData[wrapSide] = Math.max(wrapData[wrapSide], data[wrapSide])\n wrapData[otherSide] += wrapData.count ? data[otherSide] + wrapData.gap : data[otherSide]\n wrapData.list.push(data)\n wrapData.count++\n}\n","import { IBox } from '@leafer-ui/interface'\nimport { isObject, isString, tryToNumber } from '@leafer-ui/draw'\n\nimport { IFlowWrapDrawData, IFlowDrawData, IFlowParseData } from '@leafer-in/interface'\n\nimport { alignToInnerXMap, alignToInnerYMap } from './align'\n\n\nconst p = {} as IFlowParseData\n\nexport function getParseData(box: IBox, isFlowX: boolean): IFlowParseData {\n const { gap, flowAlign: align, flowWrap: wrap, __autoWidth, __autoHeight } = box.__\n const needWrap = wrap && (isFlowX ? !__autoWidth : !__autoHeight)\n\n if (isObject(gap)) {\n p.xGap = gap.x || 0\n p.yGap = gap.y || 0\n } else {\n p.xGap = p.yGap = tryToNumber(gap)\n }\n\n p.isAutoXGap = isString(p.xGap) && !__autoWidth\n p.isAutoYGap = isString(p.yGap) && !__autoHeight\n\n p.complex = needWrap || align !== 'top-left' || box.__hasGrow || p.isAutoXGap || p.isAutoYGap\n p.wrap = needWrap\n\n if (p.complex) {\n p.isFitXGap = p.xGap === 'fit' && !__autoWidth\n p.isFitYGap = p.yGap === 'fit' && !__autoHeight\n\n if (isObject(align)) {\n p.contentAlign = align.content || 'top-left'\n p.rowXAlign = align.x || 'from'\n p.rowYAlign = align.y || 'from'\n } else {\n p.contentAlign = align\n p.rowXAlign = alignToInnerXMap[align]\n p.rowYAlign = alignToInnerYMap[align]\n }\n\n }\n\n return p\n}\n\nexport function getDrawData(start: number, gap: number): IFlowDrawData {\n return { x: 0, y: 0, width: 0, height: 0, gap, start, count: 0, grow: 0 }\n}\n\nexport function getWrapDrawData(): IFlowWrapDrawData {\n return { x: 0, y: 0, width: 0, height: 0, gap: 0, count: 0, list: [] }\n}","import { IGapBoundsData, ISide } from '@leafer-in/interface'\n\n\nexport function autoGap(data: IGapBoundsData, side: ISide, sideTotal: number, fit: boolean): void {\n const { count } = data\n if (count > 1 && (sideTotal > data[side] || fit)) {\n data.gap = (sideTotal - data[side]) / (count - 1)\n data[side] = sideTotal\n }\n}","import { IBoundsData, IBoundsType, IUI } from '@leafer-ui/interface'\n\nexport function getItemBounds(child: IUI, itemBox: IBoundsType): IBoundsData {\n return itemBox === 'box' ? child.__local : child.__layout.localStrokeBounds\n\n}","import { IBoundsData, IBox, IUI, IAutoSize } from '@leafer-ui/interface'\nimport { MathHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\n\nconst { within } = MathHelper\n\nexport function growX(box: IBox, row: IFlowDrawData, width: number, reverse: boolean): void {\n let child: IUI, grow: IAutoSize, remainSpace: number, remainTotalSpace = 0, list: IUI[] = row.hasRangeSize && [], { grow: totalGrow, start } = row\n const growSize = (width - row.width) / totalGrow, { children } = box\n if (growSize <= 0) return\n\n row.width = width\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n if (grow = child.__widthGrow) {\n remainSpace = resizeWidth(child, child.__flowBounds, growSize * grow)\n\n if (remainSpace) {\n remainTotalSpace += remainSpace\n totalGrow -= grow\n } else if (list) {\n child.__.widthRange ? list.unshift(child) : list.push(child)\n }\n }\n\n } else {\n end++\n }\n }\n\n if (remainTotalSpace) assignRemainSpace(list, remainTotalSpace, totalGrow)\n}\n\n\nfunction assignRemainSpace(list: IUI[], totalSpace: number, countGrow: number): void {\n let grow: IAutoSize, space: number, local: IBoundsData, remain: number\n list.forEach(child => {\n grow = child.__widthGrow\n space = totalSpace / countGrow * grow\n remain = resizeWidth(child, local = child.__flowBounds, local.width + space)\n totalSpace -= space - remain\n countGrow -= grow\n })\n}\n\n\nexport function resizeWidth(child: IUI, local: IBoundsData, size: number): number {\n const { widthRange, lockRatio } = child.__\n const realSize = widthRange ? within(size, widthRange) : size\n if (!local.width) child.__.width = local.width = 1 // fix: 防止宽度为0导致NaN\n const scale = realSize / local.width\n child.scaleResize(scale, lockRatio ? scale : 1)\n local.width = realSize\n return size - realSize\n}","import { IBoundsData, IBox, IUI, IAutoSize } from '@leafer-ui/interface'\nimport { MathHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\n\nconst { within } = MathHelper\n\nexport function growY(box: IBox, row: IFlowDrawData, height: number, reverse: boolean): void {\n let child: IUI, grow: IAutoSize, remainSpace: number, remainTotalSpace = 0, list: IUI[] = row.hasRangeSize && [], { grow: totalGrow, start } = row\n const growSize = (height - row.height) / totalGrow, { children } = box\n if (growSize <= 0) return\n\n row.height = height\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n if (grow = child.__heightGrow) {\n remainSpace = resizeHeight(child, child.__flowBounds, growSize * grow)\n\n if (remainSpace) {\n remainTotalSpace += remainSpace\n totalGrow -= grow\n } else if (list) {\n child.__.heightRange ? list.unshift(child) : list.push(child)\n }\n }\n\n } else {\n end++\n }\n }\n\n if (remainTotalSpace) assignRemainSpace(list, remainTotalSpace, totalGrow)\n}\n\n\nfunction assignRemainSpace(list: IUI[], totalSpace: number, countGrow: number): void {\n let grow: IAutoSize, space: number, local: IBoundsData, remain: number\n list.forEach(child => {\n grow = child.__heightGrow\n space = totalSpace / countGrow * grow\n remain = resizeHeight(child, local = child.__flowBounds, local.height + space)\n totalSpace -= space - remain\n countGrow -= grow\n })\n}\n\n\nexport function resizeHeight(child: IUI, local: IBoundsData, size: number): number {\n const { heightRange, lockRatio } = child.__\n const realSize = heightRange ? within(size, heightRange) : size\n if (!local.height) child.__.height = local.height = 1 // fix: 防止高度为0导致NaN\n const scale = realSize / local.height\n child.scaleResize(lockRatio ? scale : 1, scale)\n local.height = realSize\n return size - realSize\n}","import { IBoundsData, IBox, IUI, IPointData } from '@leafer-ui/interface'\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\nimport { align } from './x/align'\nimport { alignContent } from './common/align'\nimport { layout, layoutX } from './x/layout'\nimport { flowWrap } from './common/wrap'\nimport { getDrawData, getParseData, getWrapDrawData } from './common/data'\nimport { autoGap } from './common/gap'\nimport { getItemBounds } from './common/bounds'\nimport { growX } from './x/grow'\nimport { resizeHeight } from './y/grow'\n\n\nconst { move } = PointHelper\n\nexport function flowX(box: IBox, reverse?: boolean): void {\n const side = 'width', { children, itemBox } = box, pData = getParseData(box, true)\n const { complex, wrap, xGap, yGap, isAutoXGap, isFitXGap } = pData\n if (!children.length) return\n\n const wrapData = wrap && getWrapDrawData(), xGapTempNum = isAutoXGap ? 0 : xGap as number\n let child: IUI, local: IBoundsData, localWidth: number, index: number, data: IFlowDrawData, { x, y, width, height } = box.__layout.contentBounds\n\n for (let i = 0, len = children.length; i < len; i++) {\n child = children[index = reverse ? len - 1 - i : i]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n local = getItemBounds(child, itemBox)\n\n if (complex) {\n\n child.__flowBounds = local\n if (!data) data = getDrawData(index, xGapTempNum)\n\n if (wrap && data.count && data.width + local.width > width) {\n\n if (data.grow) growX(box, data, width, reverse)\n else if (isAutoXGap) autoGap(data, side, width, isFitXGap)\n flowWrap(wrapData, data, side)\n\n data = getDrawData(index, xGapTempNum)\n }\n\n localWidth = local.width\n\n if (child.__widthGrow) {\n data.grow += child.__widthGrow, localWidth = 0\n if (child.__.widthRange) data.hasRangeSize = true\n }\n\n if (child.__heightGrow) resizeHeight(child, local, height)\n\n data.width += data.count ? localWidth + xGapTempNum : localWidth\n data.height = Math.max(data.height, local.height)\n data.count++\n\n\n } else {\n\n move(child as IPointData, x - local.x, y - local.y)\n x += local.width + xGapTempNum\n\n }\n\n }\n\n }\n\n if (complex && data) {\n\n const { isAutoYGap, isFitYGap, contentAlign, rowXAlign, rowYAlign } = pData\n\n if (data.count) {\n if (data.grow) growX(box, data, width, reverse)\n else if (isAutoXGap) autoGap(data, side, width, isFitXGap)\n if (wrap) flowWrap(wrapData, data, side)\n }\n\n if (wrap) {\n\n if (isAutoYGap) autoGap(wrapData, 'height', height, isFitYGap)\n else wrapData.height += (wrapData.gap = yGap as number) * (wrapData.list.length - 1)\n\n align(box, wrapData, contentAlign, rowXAlign)\n layout(box, wrapData, rowYAlign, reverse)\n\n } else {\n\n alignContent(box, data, contentAlign)\n layoutX(box, data, 0, data.y, rowYAlign, reverse)\n\n }\n\n }\n}","import { IBox, IFlowAlign, IAxisAlign } from '@leafer-ui/interface'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\nimport { alignContent, alignToInnerXMap } from '../common/align'\n\n\nexport function align(box: IBox, data: IFlowWrapDrawData, contentAlign: IFlowAlign, innerXAlign: IAxisAlign): void {\n alignContent(box, data, contentAlign)\n\n const { list } = data\n if (list.length > 1) {\n\n if (!innerXAlign) innerXAlign = alignToInnerXMap[contentAlign]\n\n if (innerXAlign !== 'from') {\n let row: IFlowDrawData\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[i]\n row.x = data.width - row.width\n if (innerXAlign === 'center') row.x /= 2\n }\n\n }\n }\n}","import { IBoundsData, IBox, IUI, IPointData, IAxisAlign } from '@leafer-ui/interface'\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\n\nconst { move } = PointHelper\n\nexport function layout(box: IBox, data: IFlowWrapDrawData, rowXAlign: IAxisAlign, reverse?: boolean): void {\n const { list } = data, reverseWrap = box.__.flowWrap === 'reverse'\n let row: IFlowDrawData, { x, y } = data\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[reverseWrap ? len - 1 - i : i]\n layoutY(box, row, x, y, rowXAlign, reverse)\n x += row.width + data.gap\n }\n}\n\nexport function layoutY(box: IBox, row: IFlowDrawData, fromX: number, fromY: number, rowXAlign: IAxisAlign, reverse?: boolean): void {\n const { children } = box\n let child: IUI, local: IBoundsData, { y, start } = row, x = fromX\n y += fromY\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n local = child.__flowBounds\n if (rowXAlign !== 'from') x = fromX + (row.width - local.width) / (rowXAlign === 'center' ? 2 : 1)\n\n move(child as IPointData, x - local.x, y - local.y)\n y += local.height + row.gap\n } else {\n end++\n }\n }\n}","import { IBoundsData, IBox, IUI, IPointData } from '@leafer-ui/interface'\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\nimport { align } from './y/align'\nimport { alignContent } from './common/align'\nimport { layout, layoutY } from './y/layout'\nimport { flowWrap } from './common/wrap'\nimport { getDrawData, getParseData, getWrapDrawData } from './common/data'\nimport { autoGap } from './common/gap'\nimport { getItemBounds } from './common/bounds'\nimport { growY } from './y/grow'\nimport { resizeWidth } from './x/grow'\n\n\nconst { move } = PointHelper\n\nexport function flowY(box: IBox, reverse?: boolean): void {\n const side = 'height', { children, itemBox } = box, pData = getParseData(box, false)\n const { complex, wrap, xGap, yGap, isAutoYGap, isFitYGap } = pData\n if (!children.length) return\n\n const wrapData = wrap && getWrapDrawData(), yGapTempNum = isAutoYGap ? 0 : yGap as number\n let child: IUI, local: IBoundsData, localHeight: number, index: number, data: IFlowDrawData, { x, y, width, height } = box.__layout.contentBounds\n\n for (let i = 0, len = children.length; i < len; i++) {\n child = children[index = reverse ? len - 1 - i : i]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n local = getItemBounds(child, itemBox)\n\n if (complex) {\n\n child.__flowBounds = local\n if (!data) data = getDrawData(index, yGapTempNum)\n\n if (wrap && data.count && data.height + local.height > height) {\n if (data.grow) growY(box, data, height, reverse)\n if (isAutoYGap) autoGap(data, side, height, isFitYGap)\n flowWrap(wrapData, data, side)\n\n data = getDrawData(index, yGapTempNum)\n }\n\n localHeight = local.height\n\n if (child.__heightGrow) {\n data.grow += child.__heightGrow, localHeight = 0\n if (child.__.heightRange) data.hasRangeSize = true\n }\n\n if (child.__widthGrow) resizeWidth(child, local, width)\n\n data.height += data.count ? localHeight + yGapTempNum : localHeight\n data.width = Math.max(data.width, local.width)\n data.count++\n\n } else {\n\n move(child as IPointData, x - local.x, y - local.y)\n y += local.height + yGapTempNum\n\n }\n\n }\n\n }\n\n if (complex && data) {\n\n const { isAutoXGap, isFitXGap, contentAlign, rowXAlign, rowYAlign } = pData\n\n if (data.count) {\n if (data.grow) growY(box, data, height, reverse)\n if (isAutoYGap) autoGap(data, side, height, isFitYGap)\n if (wrap) flowWrap(wrapData, data, side)\n }\n\n if (wrap) {\n\n if (isAutoXGap) autoGap(wrapData, 'width', width, isFitXGap)\n else wrapData.width += (wrapData.gap = xGap as number) * (wrapData.list.length - 1)\n\n align(box, wrapData, contentAlign, rowYAlign)\n layout(box, wrapData, rowXAlign, reverse)\n\n } else {\n\n alignContent(box, data, contentAlign)\n layoutY(box, data, data.x, 0, rowXAlign, reverse)\n\n }\n\n }\n}","import { IAxisAlign, IBox, IFlowAlign } from '@leafer-ui/interface'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\nimport { alignContent, alignToInnerYMap } from '../common/align'\n\n\nexport function align(box: IBox, data: IFlowWrapDrawData, contentAlign: IFlowAlign, rowYAlign: IAxisAlign): void {\n alignContent(box, data, contentAlign)\n\n const { list } = data\n if (list.length > 1) {\n\n if (!rowYAlign) rowYAlign = alignToInnerYMap[contentAlign]\n\n if (rowYAlign !== 'from') {\n let row: IFlowDrawData\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[i]\n row.y = data.height - row.height\n if (rowYAlign === 'center') row.y /= 2\n }\n\n }\n }\n}\n\n","import { attr, decorateLeafAttr, doBoundsType, isNumber } from '@leafer-ui/draw'\nimport { ILeaf, IValue } from '@leafer/interface'\n\n\nfunction autoBoundsParentChange(parent: ILeaf) {\n parent.__hasGrow = true\n}\n\nexport function autoBoundsType(defaultValue?: IValue) {\n return decorateLeafAttr(defaultValue, (key: string) => attr({\n set(value: IValue) {\n const grow = isNumber(value) ? value : 0\n key === 'autoWidth' ? this.__widthGrow = grow : this.__heightGrow = grow\n if (this.__setAttr(key, value)) {\n if (grow) this.waitParentChange(autoBoundsParentChange)\n doBoundsType(this)\n }\n }\n }))\n}","export { Flow } from './Flow'\n\n\nimport { BoundsHelper, Box, Group, UI, autoLayoutType, boundsType, Plugin, UIData } from '@leafer-ui/draw'\n\nimport '@leafer-in/resize'\n\nimport { flowX } from './layout/flowX'\nimport { flowY } from './layout/flowY'\nimport { autoBoundsType } from './decorate'\n\n\nPlugin.add('flow', 'resize')\n\n\nconst box = Box.prototype, uiData = UIData.prototype, { __updateBoxBounds } = Group.prototype\n\n// addAttr\nUI.addAttr('flow', false, autoLayoutType)\nUI.addAttr('gap', 0, boundsType)\nUI.addAttr('flowAlign', 'top-left', boundsType)\nUI.addAttr('flowWrap', false, boundsType)\n\nUI.addAttr('itemBox', 'box', boundsType)\nUI.addAttr('inFlow', true, boundsType)\n\nUI.addAttr('autoWidth', undefined, autoBoundsType)\nUI.addAttr('autoHeight', undefined, autoBoundsType)\nUI.addAttr('autoBox', undefined, boundsType)\n\n\nconst { copyAndSpread, unsign } = BoundsHelper\n\nbox.__updateFlowLayout = function (): void {\n const { leaferIsCreated, flow } = this\n\n if (leaferIsCreated) this.leafer.created = false // 拦截布局更新通知,进行手动更新布局\n\n switch (flow) {\n case 'x':\n case true:\n flowX(this)\n break\n case 'y':\n flowY(this)\n break\n case 'x-reverse':\n flowX(this, true)\n break\n case 'y-reverse':\n flowY(this, true)\n break\n }\n\n if (leaferIsCreated) this.leafer.created = true\n}\n\nbox.__updateContentBounds = function (): void {\n const { padding } = this.__\n const layout = this.__layout\n const same = layout.contentBounds === layout.boxBounds\n\n if (padding) {\n if (same) layout.shrinkContent()\n\n copyAndSpread(layout.contentBounds, layout.boxBounds, padding, true)\n unsign(layout.contentBounds) // fix: 防止产生负数宽高,导致排版异常\n\n } else {\n if (!same) layout.shrinkContentCancel()\n }\n}\n\nbox.__updateBoxBounds = function (secondLayout?: boolean): void { // autoSide且自动布局时需要二次布局\n if (this.children.length && !this.__useSelfBox) {\n\n const data = this.__, { flow } = data\n\n if (data.__autoSide) {\n\n if (data.__hasSurface) this.__extraUpdate() // Box自身存在样式,需要额外更新\n\n flow && !secondLayout ? this.__updateRectBoxBounds() : __updateBoxBounds.call(this)\n\n const { boxBounds } = this.__layout\n\n if (!data.__autoSize) {\n if (data.__autoWidth) {\n if (!flow) boxBounds.width += boxBounds.x, boxBounds.x = 0\n boxBounds.height = data.height, boxBounds.y = 0\n } else {\n if (!flow) boxBounds.height += boxBounds.y, boxBounds.y = 0\n boxBounds.width = data.width, boxBounds.x = 0\n }\n }\n\n flow && secondLayout && data.padding && copyAndSpread(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : (data.__autoWidth ? 'width' : 'height'))\n\n this.__updateNaturalSize()\n\n } else {\n this.__updateRectBoxBounds()\n }\n\n if (flow) this.__updateContentBounds()\n\n } else {\n this.__updateRectBoxBounds()\n }\n}\n\nObject.defineProperty(uiData, '__autoWidth', {\n get(): boolean { return this._width == null && this._autoWidth == null }\n})\n\nObject.defineProperty(uiData, '__autoHeight', {\n get(): boolean { return this._height == null && this._autoHeight == null }\n})\n\nObject.defineProperty(uiData, '__autoSide', {\n get(): boolean { return this.__autoWidth || this.__autoHeight }\n})\n\nObject.defineProperty(uiData, '__autoSize', {\n get(): boolean { return this.__autoWidth && this.__autoHeight }\n})"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","Flow","Box","__tag","constructor","data","super","this","__hasAutoLayout","dataProcessor","BoxData","prototype","autoLayoutType","registerUI","point","alignToInnerXMap","top","right","bottom","left","center","alignToInnerYMap","alignContent","box","content","align","__","contentBounds","__layout","AlignHelper","toPoint","x","__autoWidth","y","__autoHeight","move","PointHelper","layoutX","row","fromX","fromY","rowYAlign","reverse","children","child","local","start","j","end","count","inFlow","visible","__flowBounds","height","width","gap","flowWrap","wrapData","wrapSide","otherSide","Math","max","list","push","p","getParseData","isFlowX","flowAlign","wrap","needWrap","isObject","xGap","yGap","tryToNumber","isAutoXGap","isString","isAutoYGap","complex","__hasGrow","isFitXGap","isFitYGap","contentAlign","rowXAlign","getDrawData","grow","autoGap","side","sideTotal","fit","getItemBounds","itemBox","__local","localStrokeBounds","within","MathHelper","growX","remainSpace","remainTotalSpace","hasRangeSize","totalGrow","growSize","__widthGrow","resizeWidth","widthRange","unshift","totalSpace","countGrow","space","remain","forEach","assignRemainSpace","size","lockRatio","realSize","scale","scaleResize","growY","__heightGrow","resizeHeight","heightRange","flowX","pData","xGapTempNum","localWidth","index","len","innerXAlign","reverseWrap","layout","layoutY","flowY","yGapTempNum","localHeight","autoBoundsParentChange","parent","autoBoundsType","defaultValue","decorateLeafAttr","attr","set","value","isNumber","__setAttr","waitParentChange","doBoundsType","Plugin","add","uiData","UIData","__updateBoxBounds","Group","UI","addAttr","boundsType","undefined","copyAndSpread","unsign","BoundsHelper","__updateFlowLayout","leaferIsCreated","flow","leafer","created","__updateContentBounds","padding","same","boxBounds","shrinkContent","shrinkContentCancel","secondLayout","__useSelfBox","__autoSide","__hasSurface","__extraUpdate","__updateRectBoxBounds","call","__autoSize","__updateNaturalSize","get","_width","_autoWidth","_height","_autoHeight"],"mappings":"gXAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,EAAQC,EAAKM,GAAKJ,EAAEH,EAAQC,KAASM,GAChJ,OAAOH,EAAI,GAAKG,GAAKC,OAAOK,eAAeb,EAAQC,EAAKM,GAAIA,CAChE,CA6QkD,mBAApBO,iBAAiCA,gBCjUxD,IAAMC,EAAN,cAAmBC,EAEtB,SAAWC,GAAU,MAAO,MAAO,CAQnC,WAAAC,CAAYC,GACRC,MAAMD,GACNE,KAAKC,iBAAkB,CAC3B,GARexB,EAAA,CADdyB,ECPC,c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List":[0]}
1
+ {"version":3,"file":"flow.esm.min.js","sources":["../../../../../node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@4.44.2_tslib@2.8.1_typescript@5.8.3/node_modules/tslib/tslib.es6.js","../../../../../../src/in/packages/flow/src/Flow.ts","../../../../../../src/in/packages/flow/src/data/FlowData.ts","../../../../../../src/in/packages/flow/src/layout/common/align.ts","../../../../../../src/in/packages/flow/src/layout/x/layout.ts","../../../../../../src/in/packages/flow/src/layout/common/wrap.ts","../../../../../../src/in/packages/flow/src/layout/common/data.ts","../../../../../../src/in/packages/flow/src/layout/common/gap.ts","../../../../../../src/in/packages/flow/src/layout/common/bounds.ts","../../../../../../src/in/packages/flow/src/layout/x/grow.ts","../../../../../../src/in/packages/flow/src/layout/y/grow.ts","../../../../../../src/in/packages/flow/src/layout/flowX.ts","../../../../../../src/in/packages/flow/src/layout/x/align.ts","../../../../../../src/in/packages/flow/src/layout/y/layout.ts","../../../../../../src/in/packages/flow/src/layout/flowY.ts","../../../../../../src/in/packages/flow/src/layout/y/align.ts","../../../../../../src/in/packages/flow/src/decorate.ts","../../../../../../src/in/packages/flow/src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import { IFlow, IFlowData, IFlowInputData, IFlowType } from '@leafer-ui/interface'\nimport { registerUI, dataProcessor, Box, autoLayoutType } from '@leafer-ui/draw'\n\nimport { FlowData } from './data/FlowData'\n\n\n@registerUI()\nexport class Flow extends Box implements IFlow {\n\n public get __tag() { return 'Flow' }\n\n @dataProcessor(FlowData)\n declare public __: IFlowData\n\n @autoLayoutType('x')\n declare public flow?: IFlowType\n\n constructor(data?: IFlowInputData) {\n super(data)\n this.__hasAutoLayout = true\n }\n\n}","import { IFlowData } from \"@leafer-ui/interface\"\nimport { BoxData } from '@leafer-ui/draw'\n\n\nexport class FlowData extends BoxData implements IFlowData {\n\n}\n","import { IBoundsData, IBox, IFlowAlign, IPointData } from '@leafer-ui/interface'\nimport { AlignHelper } from '@leafer-ui/draw'\n\nimport { IFlowAlignToAxisAlignMap } from '@leafer-in/interface'\n\n\nconst point = {} as IPointData\n\nexport const alignToInnerXMap: IFlowAlignToAxisAlignMap = {\n 'top-left': 'from',\n 'top': 'center',\n 'top-right': 'to',\n 'right': 'to',\n 'bottom-right': 'to',\n 'bottom': 'center',\n 'bottom-left': 'from',\n 'left': 'from',\n 'center': 'center',\n 'baseline-left': 'from',\n 'baseline-center': 'center',\n 'baseline-right': 'to',\n}\n\nexport const alignToInnerYMap: IFlowAlignToAxisAlignMap = {\n 'top-left': 'from',\n 'top': 'from',\n 'top-right': 'from',\n 'right': 'center',\n 'bottom-right': 'to',\n 'bottom': 'to',\n 'bottom-left': 'to',\n 'left': 'center',\n 'center': 'center',\n 'baseline-left': 'to',\n 'baseline-center': 'to',\n 'baseline-right': 'to',\n}\n\nexport function alignContent(box: IBox, content: IBoundsData, align: IFlowAlign): void {\n const data = box.__\n const { contentBounds } = box.__layout\n AlignHelper.toPoint(align as any, content, contentBounds, point)\n content.x = data.__autoWidth ? contentBounds.x : point.x\n content.y = data.__autoHeight ? contentBounds.y : point.y\n}","import { IBoundsData, IBox, IUI, IPointData, IAxisAlign } from '@leafer-ui/interface'\n\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\n\nconst { move } = PointHelper\n\nexport function layout(box: IBox, data: IFlowWrapDrawData, rowYAlign?: IAxisAlign, reverse?: boolean): void {\n const { list } = data, reverseWrap = box.__.flowWrap === 'reverse'\n let row: IFlowDrawData, { x, y } = data\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[reverseWrap ? len - 1 - i : i]\n layoutX(box, row, x, y, rowYAlign, reverse)\n y += row.height + data.gap\n }\n}\n\nexport function layoutX(box: IBox, row: IFlowDrawData, fromX: number, fromY: number, rowYAlign: IAxisAlign, reverse?: boolean): void {\n const { children } = box\n let child: IUI, local: IBoundsData, { x, start } = row, y = fromY\n x += fromX\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n local = child.__flowBounds\n if (rowYAlign !== 'from') y = fromY + (row.height - local.height) / (rowYAlign === 'center' ? 2 : 1)\n\n move(child as IPointData, x - local.x, y - local.y)\n x += local.width + row.gap\n } else {\n end++\n }\n }\n}","import { IFlowWrapDrawData, IFlowDrawData, ISide } from '@leafer-in/interface'\n\n\nexport function flowWrap(wrapData: IFlowWrapDrawData, data: IFlowDrawData, wrapSide: ISide): void {\n const otherSide = wrapSide === 'width' ? 'height' : 'width'\n wrapData[wrapSide] = Math.max(wrapData[wrapSide], data[wrapSide])\n wrapData[otherSide] += wrapData.count ? data[otherSide] + wrapData.gap : data[otherSide]\n wrapData.list.push(data)\n wrapData.count++\n}\n","import { IBox } from '@leafer-ui/interface'\nimport { isObject, isString, tryToNumber } from '@leafer-ui/draw'\n\nimport { IFlowWrapDrawData, IFlowDrawData, IFlowParseData } from '@leafer-in/interface'\n\nimport { alignToInnerXMap, alignToInnerYMap } from './align'\n\n\nconst p = {} as IFlowParseData\n\nexport function getParseData(box: IBox, isFlowX: boolean): IFlowParseData {\n const { gap, flowAlign: align, flowWrap: wrap, __autoWidth, __autoHeight } = box.__\n const needWrap = wrap && (isFlowX ? !__autoWidth : !__autoHeight)\n\n if (isObject(gap)) {\n p.xGap = gap.x || 0\n p.yGap = gap.y || 0\n } else {\n p.xGap = p.yGap = tryToNumber(gap)\n }\n\n p.isAutoXGap = isString(p.xGap) && !__autoWidth\n p.isAutoYGap = isString(p.yGap) && !__autoHeight\n\n p.complex = needWrap || align !== 'top-left' || box.__hasGrow || p.isAutoXGap || p.isAutoYGap\n p.wrap = needWrap\n\n if (p.complex) {\n p.isFitXGap = p.xGap === 'fit' && !__autoWidth\n p.isFitYGap = p.yGap === 'fit' && !__autoHeight\n\n if (isObject(align)) {\n p.contentAlign = align.content || 'top-left'\n p.rowXAlign = align.x || 'from'\n p.rowYAlign = align.y || 'from'\n } else {\n p.contentAlign = align\n p.rowXAlign = alignToInnerXMap[align]\n p.rowYAlign = alignToInnerYMap[align]\n }\n\n }\n\n return p\n}\n\nexport function getDrawData(start: number, gap: number): IFlowDrawData {\n return { x: 0, y: 0, width: 0, height: 0, gap, start, count: 0, grow: 0 }\n}\n\nexport function getWrapDrawData(): IFlowWrapDrawData {\n return { x: 0, y: 0, width: 0, height: 0, gap: 0, count: 0, list: [] }\n}","import { IGapBoundsData, ISide } from '@leafer-in/interface'\n\n\nexport function autoGap(data: IGapBoundsData, side: ISide, sideTotal: number, fit: boolean): void {\n const { count } = data\n if (count > 1 && (sideTotal > data[side] || fit)) {\n data.gap = (sideTotal - data[side]) / (count - 1)\n data[side] = sideTotal\n }\n}","import { IBoundsData, IBoundsType, IUI } from '@leafer-ui/interface'\n\nexport function getItemBounds(child: IUI, itemBox: IBoundsType): IBoundsData {\n return itemBox === 'box' ? child.__local : child.__layout.localStrokeBounds\n\n}","import { IBoundsData, IBox, IUI, IAutoSize } from '@leafer-ui/interface'\nimport { MathHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\n\nconst { within } = MathHelper\n\nexport function growX(box: IBox, row: IFlowDrawData, width: number, reverse: boolean): void {\n let child: IUI, grow: IAutoSize, remainSpace: number, remainTotalSpace = 0, list: IUI[] = row.hasRangeSize && [], { grow: totalGrow, start } = row\n const growSize = (width - row.width) / totalGrow, { children } = box\n if (growSize <= 0) return\n\n row.width = width\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n if (grow = child.__widthGrow) {\n remainSpace = resizeWidth(child, child.__flowBounds, growSize * grow)\n\n if (remainSpace) {\n remainTotalSpace += remainSpace\n totalGrow -= grow\n } else if (list) {\n child.__.widthRange ? list.unshift(child) : list.push(child)\n }\n }\n\n } else {\n end++\n }\n }\n\n if (remainTotalSpace) assignRemainSpace(list, remainTotalSpace, totalGrow)\n}\n\n\nfunction assignRemainSpace(list: IUI[], totalSpace: number, countGrow: number): void {\n let grow: IAutoSize, space: number, local: IBoundsData, remain: number\n list.forEach(child => {\n grow = child.__widthGrow\n space = totalSpace / countGrow * grow\n remain = resizeWidth(child, local = child.__flowBounds, local.width + space)\n totalSpace -= space - remain\n countGrow -= grow\n })\n}\n\n\nexport function resizeWidth(child: IUI, local: IBoundsData, size: number): number {\n const { widthRange, lockRatio } = child.__\n const realSize = widthRange ? within(size, widthRange) : size\n if (!local.width) child.__.width = local.width = 1 // fix: 防止宽度为0导致NaN\n const scale = realSize / local.width\n child.scaleResize(scale, lockRatio ? scale : 1)\n local.width = realSize\n return size - realSize\n}","import { IBoundsData, IBox, IUI, IAutoSize } from '@leafer-ui/interface'\nimport { MathHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\n\nconst { within } = MathHelper\n\nexport function growY(box: IBox, row: IFlowDrawData, height: number, reverse: boolean): void {\n let child: IUI, grow: IAutoSize, remainSpace: number, remainTotalSpace = 0, list: IUI[] = row.hasRangeSize && [], { grow: totalGrow, start } = row\n const growSize = (height - row.height) / totalGrow, { children } = box\n if (growSize <= 0) return\n\n row.height = height\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n if (grow = child.__heightGrow) {\n remainSpace = resizeHeight(child, child.__flowBounds, growSize * grow)\n\n if (remainSpace) {\n remainTotalSpace += remainSpace\n totalGrow -= grow\n } else if (list) {\n child.__.heightRange ? list.unshift(child) : list.push(child)\n }\n }\n\n } else {\n end++\n }\n }\n\n if (remainTotalSpace) assignRemainSpace(list, remainTotalSpace, totalGrow)\n}\n\n\nfunction assignRemainSpace(list: IUI[], totalSpace: number, countGrow: number): void {\n let grow: IAutoSize, space: number, local: IBoundsData, remain: number\n list.forEach(child => {\n grow = child.__heightGrow\n space = totalSpace / countGrow * grow\n remain = resizeHeight(child, local = child.__flowBounds, local.height + space)\n totalSpace -= space - remain\n countGrow -= grow\n })\n}\n\n\nexport function resizeHeight(child: IUI, local: IBoundsData, size: number): number {\n const { heightRange, lockRatio } = child.__\n const realSize = heightRange ? within(size, heightRange) : size\n if (!local.height) child.__.height = local.height = 1 // fix: 防止高度为0导致NaN\n const scale = realSize / local.height\n child.scaleResize(lockRatio ? scale : 1, scale)\n local.height = realSize\n return size - realSize\n}","import { IBoundsData, IBox, IUI, IPointData } from '@leafer-ui/interface'\nimport { isObject, PointHelper, UnitConvertHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\nimport { align } from './x/align'\nimport { alignContent } from './common/align'\nimport { layout, layoutX } from './x/layout'\nimport { flowWrap } from './common/wrap'\nimport { getDrawData, getParseData, getWrapDrawData } from './common/data'\nimport { autoGap } from './common/gap'\nimport { getItemBounds } from './common/bounds'\nimport { growX } from './x/grow'\nimport { resizeWidth } from './x/grow'\nimport { resizeHeight } from './y/grow'\n\n\nconst { move } = PointHelper\n\nexport function flowX(box: IBox, reverse?: boolean): void {\n const side = 'width', { children, itemBox } = box, pData = getParseData(box, true)\n const { complex, wrap, xGap, yGap, isAutoXGap, isFitXGap } = pData\n if (!children.length) return\n\n const wrapData = wrap && getWrapDrawData(), xGapTempNum = isAutoXGap ? 0 : xGap as number\n let child: IUI, local: IBoundsData, localWidth: number, index: number, data: IFlowDrawData, { x, y, width, height } = box.__layout.contentBounds\n\n for (let i = 0, len = children.length; i < len; i++) {\n child = children[index = reverse ? len - 1 - i : i]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n local = getItemBounds(child, itemBox)\n\n if (child.__.autoWidth && isObject(child.__.autoWidth)) resizeWidth(child, local, UnitConvertHelper.number(child.__.autoWidth, width))\n if (child.__.autoHeight && isObject(child.__.autoHeight)) resizeHeight(child, local, UnitConvertHelper.number(child.__.autoHeight, height))\n\n if (complex) {\n\n child.__flowBounds = local\n if (!data) data = getDrawData(index, xGapTempNum)\n\n if (wrap && data.count && data.width + local.width > width) {\n\n if (data.grow) growX(box, data, width, reverse)\n else if (isAutoXGap) autoGap(data, side, width, isFitXGap)\n flowWrap(wrapData, data, side)\n\n data = getDrawData(index, xGapTempNum)\n }\n\n localWidth = local.width\n\n if (child.__widthGrow) {\n data.grow += child.__widthGrow, localWidth = 0\n if (child.__.widthRange) data.hasRangeSize = true\n }\n\n if (child.__heightGrow) resizeHeight(child, local, height)\n\n data.width += data.count ? localWidth + xGapTempNum : localWidth\n data.height = Math.max(data.height, local.height)\n data.count++\n\n\n } else {\n\n move(child as IPointData, x - local.x, y - local.y)\n x += local.width + xGapTempNum\n\n }\n\n }\n\n }\n\n if (complex && data) {\n\n const { isAutoYGap, isFitYGap, contentAlign, rowXAlign, rowYAlign } = pData\n\n if (data.count) {\n if (data.grow) growX(box, data, width, reverse)\n else if (isAutoXGap) autoGap(data, side, width, isFitXGap)\n if (wrap) flowWrap(wrapData, data, side)\n }\n\n if (wrap) {\n\n if (isAutoYGap) autoGap(wrapData, 'height', height, isFitYGap)\n else wrapData.height += (wrapData.gap = yGap as number) * (wrapData.list.length - 1)\n\n align(box, wrapData, contentAlign, rowXAlign)\n layout(box, wrapData, rowYAlign, reverse)\n\n } else {\n\n alignContent(box, data, contentAlign)\n layoutX(box, data, 0, data.y, rowYAlign, reverse)\n\n }\n\n }\n}","import { IBox, IFlowAlign, IAxisAlign } from '@leafer-ui/interface'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\nimport { alignContent, alignToInnerXMap } from '../common/align'\n\n\nexport function align(box: IBox, data: IFlowWrapDrawData, contentAlign: IFlowAlign, innerXAlign: IAxisAlign): void {\n alignContent(box, data, contentAlign)\n\n const { list } = data\n if (list.length > 1) {\n\n if (!innerXAlign) innerXAlign = alignToInnerXMap[contentAlign]\n\n if (innerXAlign !== 'from') {\n let row: IFlowDrawData\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[i]\n row.x = data.width - row.width\n if (innerXAlign === 'center') row.x /= 2\n }\n\n }\n }\n}","import { IBoundsData, IBox, IUI, IPointData, IAxisAlign } from '@leafer-ui/interface'\nimport { PointHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\n\nconst { move } = PointHelper\n\nexport function layout(box: IBox, data: IFlowWrapDrawData, rowXAlign: IAxisAlign, reverse?: boolean): void {\n const { list } = data, reverseWrap = box.__.flowWrap === 'reverse'\n let row: IFlowDrawData, { x, y } = data\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[reverseWrap ? len - 1 - i : i]\n layoutY(box, row, x, y, rowXAlign, reverse)\n x += row.width + data.gap\n }\n}\n\nexport function layoutY(box: IBox, row: IFlowDrawData, fromX: number, fromY: number, rowXAlign: IAxisAlign, reverse?: boolean): void {\n const { children } = box\n let child: IUI, local: IBoundsData, { y, start } = row, x = fromX\n y += fromY\n\n for (let j = 0, end = row.count; j < end; j++) {\n child = children[reverse ? start - j : start + j]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n local = child.__flowBounds\n if (rowXAlign !== 'from') x = fromX + (row.width - local.width) / (rowXAlign === 'center' ? 2 : 1)\n\n move(child as IPointData, x - local.x, y - local.y)\n y += local.height + row.gap\n } else {\n end++\n }\n }\n}","import { IBoundsData, IBox, IUI, IPointData } from '@leafer-ui/interface'\nimport { isObject, PointHelper, UnitConvertHelper } from '@leafer-ui/draw'\n\nimport { IFlowDrawData } from '@leafer-in/interface'\n\nimport { align } from './y/align'\nimport { alignContent } from './common/align'\nimport { layout, layoutY } from './y/layout'\nimport { flowWrap } from './common/wrap'\nimport { getDrawData, getParseData, getWrapDrawData } from './common/data'\nimport { autoGap } from './common/gap'\nimport { getItemBounds } from './common/bounds'\nimport { growY } from './y/grow'\nimport { resizeWidth } from './x/grow'\nimport { resizeHeight } from './y/grow'\n\n\nconst { move } = PointHelper\n\nexport function flowY(box: IBox, reverse?: boolean): void {\n const side = 'height', { children, itemBox } = box, pData = getParseData(box, false)\n const { complex, wrap, xGap, yGap, isAutoYGap, isFitYGap } = pData\n if (!children.length) return\n\n const wrapData = wrap && getWrapDrawData(), yGapTempNum = isAutoYGap ? 0 : yGap as number\n let child: IUI, local: IBoundsData, localHeight: number, index: number, data: IFlowDrawData, { x, y, width, height } = box.__layout.contentBounds\n\n for (let i = 0, len = children.length; i < len; i++) {\n child = children[index = reverse ? len - 1 - i : i]\n\n if (child.__.inFlow && child.__.visible !== 0) {\n\n local = getItemBounds(child, itemBox)\n\n if (child.__.autoWidth && isObject(child.__.autoWidth)) resizeWidth(child, local, UnitConvertHelper.number(child.__.autoWidth, width))\n if (child.__.autoHeight && isObject(child.__.autoHeight)) resizeHeight(child, local, UnitConvertHelper.number(child.__.autoHeight, height))\n\n if (complex) {\n\n child.__flowBounds = local\n if (!data) data = getDrawData(index, yGapTempNum)\n\n if (wrap && data.count && data.height + local.height > height) {\n if (data.grow) growY(box, data, height, reverse)\n if (isAutoYGap) autoGap(data, side, height, isFitYGap)\n flowWrap(wrapData, data, side)\n\n data = getDrawData(index, yGapTempNum)\n }\n\n localHeight = local.height\n\n if (child.__heightGrow) {\n data.grow += child.__heightGrow, localHeight = 0\n if (child.__.heightRange) data.hasRangeSize = true\n }\n\n if (child.__widthGrow) resizeWidth(child, local, width)\n\n data.height += data.count ? localHeight + yGapTempNum : localHeight\n data.width = Math.max(data.width, local.width)\n data.count++\n\n } else {\n\n move(child as IPointData, x - local.x, y - local.y)\n y += local.height + yGapTempNum\n\n }\n\n }\n\n }\n\n if (complex && data) {\n\n const { isAutoXGap, isFitXGap, contentAlign, rowXAlign, rowYAlign } = pData\n\n if (data.count) {\n if (data.grow) growY(box, data, height, reverse)\n if (isAutoYGap) autoGap(data, side, height, isFitYGap)\n if (wrap) flowWrap(wrapData, data, side)\n }\n\n if (wrap) {\n\n if (isAutoXGap) autoGap(wrapData, 'width', width, isFitXGap)\n else wrapData.width += (wrapData.gap = xGap as number) * (wrapData.list.length - 1)\n\n align(box, wrapData, contentAlign, rowYAlign)\n layout(box, wrapData, rowXAlign, reverse)\n\n } else {\n\n alignContent(box, data, contentAlign)\n layoutY(box, data, data.x, 0, rowXAlign, reverse)\n\n }\n\n }\n}","import { IAxisAlign, IBox, IFlowAlign } from '@leafer-ui/interface'\n\nimport { IFlowDrawData, IFlowWrapDrawData } from '@leafer-in/interface'\n\nimport { alignContent, alignToInnerYMap } from '../common/align'\n\n\nexport function align(box: IBox, data: IFlowWrapDrawData, contentAlign: IFlowAlign, rowYAlign: IAxisAlign): void {\n alignContent(box, data, contentAlign)\n\n const { list } = data\n if (list.length > 1) {\n\n if (!rowYAlign) rowYAlign = alignToInnerYMap[contentAlign]\n\n if (rowYAlign !== 'from') {\n let row: IFlowDrawData\n\n for (let i = 0, len = list.length; i < len; i++) {\n row = list[i]\n row.y = data.height - row.height\n if (rowYAlign === 'center') row.y /= 2\n }\n\n }\n }\n}\n\n","import { attr, decorateLeafAttr, doBoundsType, isNumber } from '@leafer-ui/draw'\nimport { ILeaf, IValue } from '@leafer/interface'\n\n\nfunction autoBoundsParentChange(parent: ILeaf) {\n parent.__hasGrow = true\n}\n\nexport function autoBoundsType(defaultValue?: IValue) {\n return decorateLeafAttr(defaultValue, (key: string) => attr({\n set(value: IValue) {\n const grow = isNumber(value) ? value : 0\n key === 'autoWidth' ? this.__widthGrow = grow : this.__heightGrow = grow\n if (this.__setAttr(key, value)) {\n if (grow) this.waitParentChange(autoBoundsParentChange)\n doBoundsType(this)\n }\n }\n }))\n}","export { Flow } from './Flow'\n\n\nimport { BoundsHelper, Box, Group, UI, autoLayoutType, boundsType, Plugin, UIData } from '@leafer-ui/draw'\n\nimport '@leafer-in/resize'\n\nimport { flowX } from './layout/flowX'\nimport { flowY } from './layout/flowY'\nimport { autoBoundsType } from './decorate'\n\n\nPlugin.add('flow', 'resize')\n\n\nconst box = Box.prototype, uiData = UIData.prototype, { __updateBoxBounds } = Group.prototype\n\n// addAttr\nUI.addAttr('flow', false, autoLayoutType)\nUI.addAttr('gap', 0, boundsType)\nUI.addAttr('flowAlign', 'top-left', boundsType)\nUI.addAttr('flowWrap', false, boundsType)\n\nUI.addAttr('itemBox', 'box', boundsType)\nUI.addAttr('inFlow', true, boundsType)\n\nUI.addAttr('autoWidth', undefined, autoBoundsType)\nUI.addAttr('autoHeight', undefined, autoBoundsType)\nUI.addAttr('autoBox', undefined, boundsType)\n\n\nconst { copyAndSpread, unsign } = BoundsHelper\n\nbox.__updateFlowLayout = function (): void {\n const { leaferIsCreated, flow } = this\n\n if (leaferIsCreated) this.leafer.created = false // 拦截布局更新通知,进行手动更新布局\n\n switch (flow) {\n case 'x':\n case true:\n flowX(this)\n break\n case 'y':\n flowY(this)\n break\n case 'x-reverse':\n flowX(this, true)\n break\n case 'y-reverse':\n flowY(this, true)\n break\n }\n\n if (leaferIsCreated) this.leafer.created = true\n}\n\nbox.__updateContentBounds = function (): void {\n const { padding } = this.__\n const layout = this.__layout\n const same = layout.contentBounds === layout.boxBounds\n\n if (padding) {\n if (same) layout.shrinkContent()\n\n copyAndSpread(layout.contentBounds, layout.boxBounds, padding, true)\n unsign(layout.contentBounds) // fix: 防止产生负数宽高,导致排版异常\n\n } else {\n if (!same) layout.shrinkContentCancel()\n }\n}\n\nbox.__updateBoxBounds = function (secondLayout?: boolean): void { // autoSide且自动布局时需要二次布局\n if (this.children.length && !this.__useSelfBox) {\n\n const data = this.__, { flow } = data\n\n if (data.__autoSide) {\n\n if (data.__hasSurface) this.__extraUpdate() // Box自身存在样式,需要额外更新\n\n flow && !secondLayout ? this.__updateRectBoxBounds() : __updateBoxBounds.call(this)\n\n const { boxBounds } = this.__layout\n\n if (!data.__autoSize) {\n if (data.__autoWidth) {\n if (!flow) boxBounds.width += boxBounds.x, boxBounds.x = 0\n boxBounds.height = data.height, boxBounds.y = 0\n } else {\n if (!flow) boxBounds.height += boxBounds.y, boxBounds.y = 0\n boxBounds.width = data.width, boxBounds.x = 0\n }\n }\n\n flow && secondLayout && data.padding && copyAndSpread(boxBounds, boxBounds, data.padding, false, data.__autoSize ? null : (data.__autoWidth ? 'width' : 'height'))\n\n this.__updateNaturalSize()\n\n } else {\n this.__updateRectBoxBounds()\n }\n\n if (flow) this.__updateContentBounds()\n\n } else {\n this.__updateRectBoxBounds()\n }\n}\n\nObject.defineProperty(uiData, '__autoWidth', {\n get(): boolean { return this._width == null && this._autoWidth == null }\n})\n\nObject.defineProperty(uiData, '__autoHeight', {\n get(): boolean { return this._height == null && this._autoHeight == null }\n})\n\nObject.defineProperty(uiData, '__autoSide', {\n get(): boolean { return this.__autoWidth || this.__autoHeight }\n})\n\nObject.defineProperty(uiData, '__autoSize', {\n get(): boolean { return this.__autoWidth && this.__autoHeight }\n})"],"names":["__decorate","decorators","target","key","desc","d","c","arguments","length","r","Object","getOwnPropertyDescriptor","Reflect","decorate","i","defineProperty","SuppressedError","Flow","Box","__tag","constructor","data","super","this","__hasAutoLayout","dataProcessor","BoxData","prototype","autoLayoutType","registerUI","point","alignToInnerXMap","top","right","bottom","left","center","alignToInnerYMap","alignContent","box","content","align","__","contentBounds","__layout","AlignHelper","toPoint","x","__autoWidth","y","__autoHeight","move","PointHelper","layoutX","row","fromX","fromY","rowYAlign","reverse","children","child","local","start","j","end","count","inFlow","visible","__flowBounds","height","width","gap","flowWrap","wrapData","wrapSide","otherSide","Math","max","list","push","p","getParseData","isFlowX","flowAlign","wrap","needWrap","isObject","xGap","yGap","tryToNumber","isAutoXGap","isString","isAutoYGap","complex","__hasGrow","isFitXGap","isFitYGap","contentAlign","rowXAlign","getDrawData","grow","autoGap","side","sideTotal","fit","getItemBounds","itemBox","__local","localStrokeBounds","within","MathHelper","growX","remainSpace","remainTotalSpace","hasRangeSize","totalGrow","growSize","__widthGrow","resizeWidth","widthRange","unshift","totalSpace","countGrow","space","remain","forEach","assignRemainSpace","size","lockRatio","realSize","scale","scaleResize","growY","__heightGrow","resizeHeight","heightRange","flowX","pData","xGapTempNum","localWidth","index","len","autoWidth","UnitConvertHelper","number","autoHeight","innerXAlign","reverseWrap","layout","layoutY","flowY","yGapTempNum","localHeight","autoBoundsParentChange","parent","autoBoundsType","defaultValue","decorateLeafAttr","attr","set","value","isNumber","__setAttr","waitParentChange","doBoundsType","Plugin","add","uiData","UIData","__updateBoxBounds","Group","UI","addAttr","boundsType","undefined","copyAndSpread","unsign","BoundsHelper","__updateFlowLayout","leaferIsCreated","flow","leafer","created","__updateContentBounds","padding","same","boxBounds","shrinkContent","shrinkContentCancel","secondLayout","__useSelfBox","__autoSide","__hasSurface","__extraUpdate","__updateRectBoxBounds","call","__autoSize","__updateNaturalSize","get","_width","_autoWidth","_height","_autoHeight"],"mappings":"uYAsDO,SAASA,EAAWC,EAAYC,EAAQC,EAAKC,GAChD,IAA2HC,EAAvHC,EAAIC,UAAUC,OAAQC,EAAIH,EAAI,EAAIJ,EAAkB,OAATE,EAAgBA,EAAOM,OAAOC,yBAAyBT,EAAQC,GAAOC,EACrH,GAAuB,iBAAZQ,SAAoD,mBAArBA,QAAQC,SAAyBJ,EAAIG,QAAQC,SAASZ,EAAYC,EAAQC,EAAKC,QACpH,IAAK,IAAIU,EAAIb,EAAWO,OAAS,EAAGM,GAAK,EAAGA,KAAST,EAAIJ,EAAWa,MAAIL,GAAKH,EAAI,EAAID,EAAEI,GAAKH,EAAI,EAAID,EAAEH,EAAQC,EAAKM,GAAKJ,EAAEH,EAAQC,KAASM,GAChJ,OAAOH,EAAI,GAAKG,GAAKC,OAAOK,eAAeb,EAAQC,EAAKM,GAAIA,CAChE,CA6QkD,mBAApBO,iBAAiCA,gBCjUxD,IAAMC,EAAN,cAAmBC,EAEtB,SAAWC,GAAU,MAAO,MAAO,CAQnC,WAAAC,CAAYC,GACRC,MAAMD,GACNE,KAAKC,iBAAkB,CAC3B,GARexB,EAAA,CADdyB,ECPC,cAAwBC,MDQET,EAAAU,UAAA,UAAA,GAGb3B,EAAA,CADd4B,EAAe,MACeX,EAAAU,UAAA,YAAA,GARtBV,EAAIjB,EAAA,CADhB6B,KACYZ,GEDb,MAAMa,EAAQ,CAAA,EAEDC,EAA6C,CACtD,WAAY,OACZC,IAAO,SACP,YAAa,KACbC,MAAS,KACT,eAAgB,KAChBC,OAAU,SACV,cAAe,OACfC,KAAQ,OACRC,OAAU,SACV,gBAAiB,OACjB,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AAuC,MAApBlL,KAAKmL,WAAoB,IAG7EhM,OAAOK,eAAewJ,EAAQ,aAAc,CACxC,GAAA+B,GAAiB,OAAO/K,KAAKyB,aAAezB,KAAK2B,YAAa,IAGlExC,OAAOK,eAAewJ,EAAQ,aAAc,CACxC,GAAA+B,GAAiB,OAAO/K,KAAKyB,aAAezB,KAAK2B,YAAa","x_google_ignoreList":[0]}
package/dist/flow.js CHANGED
@@ -267,6 +267,8 @@ this.LeaferIN.flow = function(exports, draw) {
267
267
  child = children[index = reverse ? len - 1 - i : i];
268
268
  if (child.__.inFlow && child.__.visible !== 0) {
269
269
  local = getItemBounds(child, itemBox);
270
+ if (child.__.autoWidth && draw.isObject(child.__.autoWidth)) resizeWidth(child, local, draw.UnitConvertHelper.number(child.__.autoWidth, width));
271
+ if (child.__.autoHeight && draw.isObject(child.__.autoHeight)) resizeHeight(child, local, draw.UnitConvertHelper.number(child.__.autoHeight, height));
270
272
  if (complex) {
271
273
  child.__flowBounds = local;
272
274
  if (!data) data = getDrawData(index, xGapTempNum);
@@ -358,6 +360,8 @@ this.LeaferIN.flow = function(exports, draw) {
358
360
  child = children[index = reverse ? len - 1 - i : i];
359
361
  if (child.__.inFlow && child.__.visible !== 0) {
360
362
  local = getItemBounds(child, itemBox);
363
+ if (child.__.autoWidth && draw.isObject(child.__.autoWidth)) resizeWidth(child, local, draw.UnitConvertHelper.number(child.__.autoWidth, width));
364
+ if (child.__.autoHeight && draw.isObject(child.__.autoHeight)) resizeHeight(child, local, draw.UnitConvertHelper.number(child.__.autoHeight, height));
361
365
  if (complex) {
362
366
  child.__flowBounds = local;
363
367
  if (!data) data = getDrawData(index, yGapTempNum);
package/dist/flow.min.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("@leafer-ui/draw");function e(t,e,o,i){var n,h=arguments.length,r=h<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,i);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(r=(h<3?n(r):h>3?n(e,o,r):n(e,o))||r);return h>3&&r&&Object.defineProperty(e,o,r),r}require("@leafer-in/resize"),"function"==typeof SuppressedError&&SuppressedError;class o extends t.BoxData{}exports.Flow=class extends t.Box{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}},e([t.dataProcessor(o)],exports.Flow.prototype,"__",void 0),e([t.autoLayoutType("x")],exports.Flow.prototype,"flow",void 0),exports.Flow=e([t.registerUI()],exports.Flow);const i={},n={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},h={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function r(e,o,n){const h=e.__,{contentBounds:r}=e.__layout;t.AlignHelper.toPoint(n,o,r,i),o.x=h.__autoWidth?r.x:i.x,o.y=h.__autoHeight?r.y:i.y}const{move:s}=t.PointHelper;function a(t,e,o,i,n,h){const{children:r}=t;let a,l,{x:_,start:u}=e,c=i;_+=o;for(let t=0,o=e.count;t<o;t++)a=r[h?u-t:u+t],a.__.inFlow&&0!==a.__.visible?(l=a.__flowBounds,"from"!==n&&(c=i+(e.height-l.height)/("center"===n?2:1)),s(a,_-l.x,c-l.y),_+=l.width+e.gap):o++}function l(t,e,o){const i="width"===o?"height":"width";t[o]=Math.max(t[o],e[o]),t[i]+=t.count?e[i]+t.gap:e[i],t.list.push(e),t.count++}const _={};function u(e,o){const{gap:i,flowAlign:r,flowWrap:s,__autoWidth:a,__autoHeight:l}=e.__,u=s&&(o?!a:!l);return t.isObject(i)?(_.xGap=i.x||0,_.yGap=i.y||0):_.xGap=_.yGap=t.tryToNumber(i),_.isAutoXGap=t.isString(_.xGap)&&!a,_.isAutoYGap=t.isString(_.yGap)&&!l,_.complex=u||"top-left"!==r||e.__hasGrow||_.isAutoXGap||_.isAutoYGap,_.wrap=u,_.complex&&(_.isFitXGap="fit"===_.xGap&&!a,_.isFitYGap="fit"===_.yGap&&!l,t.isObject(r)?(_.contentAlign=r.content||"top-left",_.rowXAlign=r.x||"from",_.rowYAlign=r.y||"from"):(_.contentAlign=r,_.rowXAlign=n[r],_.rowYAlign=h[r])),_}function c(t,e){return{x:0,y:0,width:0,height:0,gap:e,start:t,count:0,grow:0}}function d(t,e,o,i){const{count:n}=t;n>1&&(o>t[e]||i)&&(t.gap=(o-t[e])/(n-1),t[e]=o)}function g(t,e){return"box"===e?t.__local:t.__layout.localStrokeBounds}const{within:p}=t.MathHelper;function w(t,e,o,i){let n,h,r,s=0,a=e.hasRangeSize&&[],{grow:l,start:_}=e;const u=(o-e.width)/l,{children:c}=t;if(!(u<=0)){e.width=o;for(let t=0,o=e.count;t<o;t++)n=c[i?_-t:_+t],n.__.inFlow&&0!==n.__.visible?(h=n.__widthGrow)&&(r=f(n,n.__flowBounds,u*h),r?(s+=r,l-=h):a&&(n.__.widthRange?a.unshift(n):a.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__widthGrow,n=e/o*i,r=f(t,h=t.__flowBounds,h.width+n),e-=n-r,o-=i})}(a,s,l)}}function f(t,e,o){const{widthRange:i,lockRatio:n}=t.__,h=i?p(o,i):o;e.width||(t.__.width=e.width=1);const r=h/e.width;return t.scaleResize(r,n?r:1),e.width=h,o-h}const{within:y}=t.MathHelper;function x(t,e,o,i){let n,h,r,s=0,a=e.hasRangeSize&&[],{grow:l,start:_}=e;const u=(o-e.height)/l,{children:c}=t;if(!(u<=0)){e.height=o;for(let t=0,o=e.count;t<o;t++)n=c[i?_-t:_+t],n.__.inFlow&&0!==n.__.visible?(h=n.__heightGrow)&&(r=b(n,n.__flowBounds,u*h),r?(s+=r,l-=h):a&&(n.__.heightRange?a.unshift(n):a.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__heightGrow,n=e/o*i,r=b(t,h=t.__flowBounds,h.height+n),e-=n-r,o-=i})}(a,s,l)}}function b(t,e,o){const{heightRange:i,lockRatio:n}=t.__,h=i?y(o,i):o;e.height||(t.__.height=e.height=1);const r=h/e.height;return t.scaleResize(n?r:1,r),e.height=h,o-h}const{move:G}=t.PointHelper;function B(t,e){const o="width",{children:i,itemBox:h}=t,s=u(t,!0),{complex:_,wrap:p,xGap:f,yGap:y,isAutoXGap:x,isFitXGap:B}=s;if(!i.length)return;const A=p&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},m=x?0:f;let v,F,R,S,H,{x:P,y:W,width:z,height:I}=t.__layout.contentBounds;for(let n=0,r=i.length;n<r;n++)v=i[S=e?r-1-n:n],v.__.inFlow&&0!==v.__.visible&&(F=g(v,h),_?(v.__flowBounds=F,H||(H=c(S,m)),p&&H.count&&H.width+F.width>z&&(H.grow?w(t,H,z,e):x&&d(H,o,z,B),l(A,H,o),H=c(S,m)),R=F.width,v.__widthGrow&&(H.grow+=v.__widthGrow,R=0,v.__.widthRange&&(H.hasRangeSize=!0)),v.__heightGrow&&b(v,F,I),H.width+=H.count?R+m:R,H.height=Math.max(H.height,F.height),H.count++):(G(v,P-F.x,W-F.y),P+=F.width+m));if(_&&H){const{isAutoYGap:i,isFitYGap:h,contentAlign:_,rowXAlign:u,rowYAlign:c}=s;H.count&&(H.grow?w(t,H,z,e):x&&d(H,o,z,B),p&&l(A,H,o)),p?(i?d(A,"height",I,h):A.height+=(A.gap=y)*(A.list.length-1),function(t,e,o,i){r(t,e,o);const{list:h}=e;if(h.length>1&&(i||(i=n[o]),"from"!==i)){let t;for(let o=0,n=h.length;o<n;o++)t=h[o],t.x=e.width-t.width,"center"===i&&(t.x/=2)}}(t,A,_,u),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:l}=e;for(let _=0,u=n.length;_<u;_++)r=n[h?u-1-_:_],a(t,r,s,l,o,i),l+=r.height+e.gap}(t,A,c,e)):(r(t,H,_),a(t,H,0,H.y,c,e))}}const{move:A}=t.PointHelper;function m(t,e,o,i,n,h){const{children:r}=t;let s,a,{y:l,start:_}=e,u=o;l+=i;for(let t=0,i=e.count;t<i;t++)s=r[h?_-t:_+t],s.__.inFlow&&0!==s.__.visible?(a=s.__flowBounds,"from"!==n&&(u=o+(e.width-a.width)/("center"===n?2:1)),A(s,u-a.x,l-a.y),l+=a.height+e.gap):i++}const{move:v}=t.PointHelper;function F(t,e){const o="height",{children:i,itemBox:n}=t,s=u(t,!1),{complex:a,wrap:_,xGap:p,yGap:w,isAutoYGap:y,isFitYGap:b}=s;if(!i.length)return;const G=_&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},B=y?0:w;let A,F,R,S,H,{x:P,y:W,width:z,height:I}=t.__layout.contentBounds;for(let h=0,r=i.length;h<r;h++)A=i[S=e?r-1-h:h],A.__.inFlow&&0!==A.__.visible&&(F=g(A,n),a?(A.__flowBounds=F,H||(H=c(S,B)),_&&H.count&&H.height+F.height>I&&(H.grow&&x(t,H,I,e),y&&d(H,o,I,b),l(G,H,o),H=c(S,B)),R=F.height,A.__heightGrow&&(H.grow+=A.__heightGrow,R=0,A.__.heightRange&&(H.hasRangeSize=!0)),A.__widthGrow&&f(A,F,z),H.height+=H.count?R+B:R,H.width=Math.max(H.width,F.width),H.count++):(v(A,P-F.x,W-F.y),W+=F.height+B));if(a&&H){const{isAutoXGap:i,isFitXGap:n,contentAlign:a,rowXAlign:u,rowYAlign:c}=s;H.count&&(H.grow&&x(t,H,I,e),y&&d(H,o,I,b),_&&l(G,H,o)),_?(i?d(G,"width",z,n):G.width+=(G.gap=p)*(G.list.length-1),function(t,e,o,i){r(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=h[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.y=e.height-t.height,"center"===i&&(t.y/=2)}}(t,G,a,c),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:a}=e;for(let l=0,_=n.length;l<_;l++)r=n[h?_-1-l:l],m(t,r,s,a,o,i),s+=r.width+e.gap}(t,G,u,e)):(r(t,H,a),m(t,H,H.x,0,u,e))}}function R(t){t.__hasGrow=!0}function S(e){return t.decorateLeafAttr(e,e=>t.attr({set(o){const i=t.isNumber(o)?o:0;"autoWidth"===e?this.__widthGrow=i:this.__heightGrow=i,this.__setAttr(e,o)&&(i&&this.waitParentChange(R),t.doBoundsType(this))}}))}t.Plugin.add("flow","resize");const H=t.Box.prototype,P=t.UIData.prototype,{__updateBoxBounds:W}=t.Group.prototype;t.UI.addAttr("flow",!1,t.autoLayoutType),t.UI.addAttr("gap",0,t.boundsType),t.UI.addAttr("flowAlign","top-left",t.boundsType),t.UI.addAttr("flowWrap",!1,t.boundsType),t.UI.addAttr("itemBox","box",t.boundsType),t.UI.addAttr("inFlow",!0,t.boundsType),t.UI.addAttr("autoWidth",void 0,S),t.UI.addAttr("autoHeight",void 0,S),t.UI.addAttr("autoBox",void 0,t.boundsType);const{copyAndSpread:z,unsign:I}=t.BoundsHelper;H.__updateFlowLayout=function(){const{leaferIsCreated:t,flow:e}=this;switch(t&&(this.leafer.created=!1),e){case"x":case!0:B(this);break;case"y":F(this);break;case"x-reverse":B(this,!0);break;case"y-reverse":F(this,!0)}t&&(this.leafer.created=!0)},H.__updateContentBounds=function(){const{padding:t}=this.__,e=this.__layout,o=e.contentBounds===e.boxBounds;t?(o&&e.shrinkContent(),z(e.contentBounds,e.boxBounds,t,!0),I(e.contentBounds)):o||e.shrinkContentCancel()},H.__updateBoxBounds=function(t){if(this.children.length&&!this.__useSelfBox){const e=this.__,{flow:o}=e;if(e.__autoSide){e.__hasSurface&&this.__extraUpdate(),o&&!t?this.__updateRectBoxBounds():W.call(this);const{boxBounds:i}=this.__layout;e.__autoSize||(e.__autoWidth?(o||(i.width+=i.x,i.x=0),i.height=e.height,i.y=0):(o||(i.height+=i.y,i.y=0),i.width=e.width,i.x=0)),o&&t&&e.padding&&z(i,i,e.padding,!1,e.__autoSize?null:e.__autoWidth?"width":"height"),this.__updateNaturalSize()}else this.__updateRectBoxBounds();o&&this.__updateContentBounds()}else this.__updateRectBoxBounds()},Object.defineProperty(P,"__autoWidth",{get(){return null==this._width&&null==this._autoWidth}}),Object.defineProperty(P,"__autoHeight",{get(){return null==this._height&&null==this._autoHeight}}),Object.defineProperty(P,"__autoSide",{get(){return this.__autoWidth||this.__autoHeight}}),Object.defineProperty(P,"__autoSize",{get(){return this.__autoWidth&&this.__autoHeight}});
1
+ "use strict";var t=require("@leafer-ui/draw");function e(t,e,o,i){var n,h=arguments.length,r=h<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,i);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(r=(h<3?n(r):h>3?n(e,o,r):n(e,o))||r);return h>3&&r&&Object.defineProperty(e,o,r),r}require("@leafer-in/resize"),"function"==typeof SuppressedError&&SuppressedError;class o extends t.BoxData{}exports.Flow=class extends t.Box{get __tag(){return"Flow"}constructor(t){super(t),this.__hasAutoLayout=!0}},e([t.dataProcessor(o)],exports.Flow.prototype,"__",void 0),e([t.autoLayoutType("x")],exports.Flow.prototype,"flow",void 0),exports.Flow=e([t.registerUI()],exports.Flow);const i={},n={"top-left":"from",top:"center","top-right":"to",right:"to","bottom-right":"to",bottom:"center","bottom-left":"from",left:"from",center:"center","baseline-left":"from","baseline-center":"center","baseline-right":"to"},h={"top-left":"from",top:"from","top-right":"from",right:"center","bottom-right":"to",bottom:"to","bottom-left":"to",left:"center",center:"center","baseline-left":"to","baseline-center":"to","baseline-right":"to"};function r(e,o,n){const h=e.__,{contentBounds:r}=e.__layout;t.AlignHelper.toPoint(n,o,r,i),o.x=h.__autoWidth?r.x:i.x,o.y=h.__autoHeight?r.y:i.y}const{move:s}=t.PointHelper;function a(t,e,o,i,n,h){const{children:r}=t;let a,_,{x:u,start:l}=e,c=i;u+=o;for(let t=0,o=e.count;t<o;t++)a=r[h?l-t:l+t],a.__.inFlow&&0!==a.__.visible?(_=a.__flowBounds,"from"!==n&&(c=i+(e.height-_.height)/("center"===n?2:1)),s(a,u-_.x,c-_.y),u+=_.width+e.gap):o++}function _(t,e,o){const i="width"===o?"height":"width";t[o]=Math.max(t[o],e[o]),t[i]+=t.count?e[i]+t.gap:e[i],t.list.push(e),t.count++}const u={};function l(e,o){const{gap:i,flowAlign:r,flowWrap:s,__autoWidth:a,__autoHeight:_}=e.__,l=s&&(o?!a:!_);return t.isObject(i)?(u.xGap=i.x||0,u.yGap=i.y||0):u.xGap=u.yGap=t.tryToNumber(i),u.isAutoXGap=t.isString(u.xGap)&&!a,u.isAutoYGap=t.isString(u.yGap)&&!_,u.complex=l||"top-left"!==r||e.__hasGrow||u.isAutoXGap||u.isAutoYGap,u.wrap=l,u.complex&&(u.isFitXGap="fit"===u.xGap&&!a,u.isFitYGap="fit"===u.yGap&&!_,t.isObject(r)?(u.contentAlign=r.content||"top-left",u.rowXAlign=r.x||"from",u.rowYAlign=r.y||"from"):(u.contentAlign=r,u.rowXAlign=n[r],u.rowYAlign=h[r])),u}function c(t,e){return{x:0,y:0,width:0,height:0,gap:e,start:t,count:0,grow:0}}function d(t,e,o,i){const{count:n}=t;n>1&&(o>t[e]||i)&&(t.gap=(o-t[e])/(n-1),t[e]=o)}function g(t,e){return"box"===e?t.__local:t.__layout.localStrokeBounds}const{within:p}=t.MathHelper;function w(t,e,o,i){let n,h,r,s=0,a=e.hasRangeSize&&[],{grow:_,start:u}=e;const l=(o-e.width)/_,{children:c}=t;if(!(l<=0)){e.width=o;for(let t=0,o=e.count;t<o;t++)n=c[i?u-t:u+t],n.__.inFlow&&0!==n.__.visible?(h=n.__widthGrow)&&(r=f(n,n.__flowBounds,l*h),r?(s+=r,_-=h):a&&(n.__.widthRange?a.unshift(n):a.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__widthGrow,n=e/o*i,r=f(t,h=t.__flowBounds,h.width+n),e-=n-r,o-=i})}(a,s,_)}}function f(t,e,o){const{widthRange:i,lockRatio:n}=t.__,h=i?p(o,i):o;e.width||(t.__.width=e.width=1);const r=h/e.width;return t.scaleResize(r,n?r:1),e.width=h,o-h}const{within:y}=t.MathHelper;function x(t,e,o,i){let n,h,r,s=0,a=e.hasRangeSize&&[],{grow:_,start:u}=e;const l=(o-e.height)/_,{children:c}=t;if(!(l<=0)){e.height=o;for(let t=0,o=e.count;t<o;t++)n=c[i?u-t:u+t],n.__.inFlow&&0!==n.__.visible?(h=n.__heightGrow)&&(r=b(n,n.__flowBounds,l*h),r?(s+=r,_-=h):a&&(n.__.heightRange?a.unshift(n):a.push(n))):o++;s&&function(t,e,o){let i,n,h,r;t.forEach(t=>{i=t.__heightGrow,n=e/o*i,r=b(t,h=t.__flowBounds,h.height+n),e-=n-r,o-=i})}(a,s,_)}}function b(t,e,o){const{heightRange:i,lockRatio:n}=t.__,h=i?y(o,i):o;e.height||(t.__.height=e.height=1);const r=h/e.height;return t.scaleResize(n?r:1,r),e.height=h,o-h}const{move:G}=t.PointHelper;function B(e,o){const i="width",{children:h,itemBox:s}=e,u=l(e,!0),{complex:p,wrap:y,xGap:x,yGap:B,isAutoXGap:m,isFitXGap:A}=u;if(!h.length)return;const v=y&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},H=m?0:x;let F,R,W,S,U,{x:P,y:j,width:O,height:z}=e.__layout.contentBounds;for(let n=0,r=h.length;n<r;n++)F=h[S=o?r-1-n:n],F.__.inFlow&&0!==F.__.visible&&(R=g(F,s),F.__.autoWidth&&t.isObject(F.__.autoWidth)&&f(F,R,t.UnitConvertHelper.number(F.__.autoWidth,O)),F.__.autoHeight&&t.isObject(F.__.autoHeight)&&b(F,R,t.UnitConvertHelper.number(F.__.autoHeight,z)),p?(F.__flowBounds=R,U||(U=c(S,H)),y&&U.count&&U.width+R.width>O&&(U.grow?w(e,U,O,o):m&&d(U,i,O,A),_(v,U,i),U=c(S,H)),W=R.width,F.__widthGrow&&(U.grow+=F.__widthGrow,W=0,F.__.widthRange&&(U.hasRangeSize=!0)),F.__heightGrow&&b(F,R,z),U.width+=U.count?W+H:W,U.height=Math.max(U.height,R.height),U.count++):(G(F,P-R.x,j-R.y),P+=R.width+H));if(p&&U){const{isAutoYGap:t,isFitYGap:h,contentAlign:s,rowXAlign:l,rowYAlign:c}=u;U.count&&(U.grow?w(e,U,O,o):m&&d(U,i,O,A),y&&_(v,U,i)),y?(t?d(v,"height",z,h):v.height+=(v.gap=B)*(v.list.length-1),function(t,e,o,i){r(t,e,o);const{list:h}=e;if(h.length>1&&(i||(i=n[o]),"from"!==i)){let t;for(let o=0,n=h.length;o<n;o++)t=h[o],t.x=e.width-t.width,"center"===i&&(t.x/=2)}}(e,v,s,l),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:_}=e;for(let u=0,l=n.length;u<l;u++)r=n[h?l-1-u:u],a(t,r,s,_,o,i),_+=r.height+e.gap}(e,v,c,o)):(r(e,U,s),a(e,U,0,U.y,c,o))}}const{move:m}=t.PointHelper;function A(t,e,o,i,n,h){const{children:r}=t;let s,a,{y:_,start:u}=e,l=o;_+=i;for(let t=0,i=e.count;t<i;t++)s=r[h?u-t:u+t],s.__.inFlow&&0!==s.__.visible?(a=s.__flowBounds,"from"!==n&&(l=o+(e.width-a.width)/("center"===n?2:1)),m(s,l-a.x,_-a.y),_+=a.height+e.gap):i++}const{move:v}=t.PointHelper;function H(e,o){const i="height",{children:n,itemBox:s}=e,a=l(e,!1),{complex:u,wrap:p,xGap:w,yGap:y,isAutoYGap:G,isFitYGap:B}=a;if(!n.length)return;const m=p&&{x:0,y:0,width:0,height:0,gap:0,count:0,list:[]},H=G?0:y;let F,R,W,S,U,{x:P,y:j,width:O,height:z}=e.__layout.contentBounds;for(let h=0,r=n.length;h<r;h++)F=n[S=o?r-1-h:h],F.__.inFlow&&0!==F.__.visible&&(R=g(F,s),F.__.autoWidth&&t.isObject(F.__.autoWidth)&&f(F,R,t.UnitConvertHelper.number(F.__.autoWidth,O)),F.__.autoHeight&&t.isObject(F.__.autoHeight)&&b(F,R,t.UnitConvertHelper.number(F.__.autoHeight,z)),u?(F.__flowBounds=R,U||(U=c(S,H)),p&&U.count&&U.height+R.height>z&&(U.grow&&x(e,U,z,o),G&&d(U,i,z,B),_(m,U,i),U=c(S,H)),W=R.height,F.__heightGrow&&(U.grow+=F.__heightGrow,W=0,F.__.heightRange&&(U.hasRangeSize=!0)),F.__widthGrow&&f(F,R,O),U.height+=U.count?W+H:W,U.width=Math.max(U.width,R.width),U.count++):(v(F,P-R.x,j-R.y),j+=R.height+H));if(u&&U){const{isAutoXGap:t,isFitXGap:n,contentAlign:s,rowXAlign:u,rowYAlign:l}=a;U.count&&(U.grow&&x(e,U,z,o),G&&d(U,i,z,B),p&&_(m,U,i)),p?(t?d(m,"width",O,n):m.width+=(m.gap=w)*(m.list.length-1),function(t,e,o,i){r(t,e,o);const{list:n}=e;if(n.length>1&&(i||(i=h[o]),"from"!==i)){let t;for(let o=0,h=n.length;o<h;o++)t=n[o],t.y=e.height-t.height,"center"===i&&(t.y/=2)}}(e,m,s,l),function(t,e,o,i){const{list:n}=e,h="reverse"===t.__.flowWrap;let r,{x:s,y:a}=e;for(let _=0,u=n.length;_<u;_++)r=n[h?u-1-_:_],A(t,r,s,a,o,i),s+=r.width+e.gap}(e,m,u,o)):(r(e,U,s),A(e,U,U.x,0,u,o))}}function F(t){t.__hasGrow=!0}function R(e){return t.decorateLeafAttr(e,e=>t.attr({set(o){const i=t.isNumber(o)?o:0;"autoWidth"===e?this.__widthGrow=i:this.__heightGrow=i,this.__setAttr(e,o)&&(i&&this.waitParentChange(F),t.doBoundsType(this))}}))}t.Plugin.add("flow","resize");const W=t.Box.prototype,S=t.UIData.prototype,{__updateBoxBounds:U}=t.Group.prototype;t.UI.addAttr("flow",!1,t.autoLayoutType),t.UI.addAttr("gap",0,t.boundsType),t.UI.addAttr("flowAlign","top-left",t.boundsType),t.UI.addAttr("flowWrap",!1,t.boundsType),t.UI.addAttr("itemBox","box",t.boundsType),t.UI.addAttr("inFlow",!0,t.boundsType),t.UI.addAttr("autoWidth",void 0,R),t.UI.addAttr("autoHeight",void 0,R),t.UI.addAttr("autoBox",void 0,t.boundsType);const{copyAndSpread:P,unsign:j}=t.BoundsHelper;W.__updateFlowLayout=function(){const{leaferIsCreated:t,flow:e}=this;switch(t&&(this.leafer.created=!1),e){case"x":case!0:B(this);break;case"y":H(this);break;case"x-reverse":B(this,!0);break;case"y-reverse":H(this,!0)}t&&(this.leafer.created=!0)},W.__updateContentBounds=function(){const{padding:t}=this.__,e=this.__layout,o=e.contentBounds===e.boxBounds;t?(o&&e.shrinkContent(),P(e.contentBounds,e.boxBounds,t,!0),j(e.contentBounds)):o||e.shrinkContentCancel()},W.__updateBoxBounds=function(t){if(this.children.length&&!this.__useSelfBox){const e=this.__,{flow:o}=e;if(e.__autoSide){e.__hasSurface&&this.__extraUpdate(),o&&!t?this.__updateRectBoxBounds():U.call(this);const{boxBounds:i}=this.__layout;e.__autoSize||(e.__autoWidth?(o||(i.width+=i.x,i.x=0),i.height=e.height,i.y=0):(o||(i.height+=i.y,i.y=0),i.width=e.width,i.x=0)),o&&t&&e.padding&&P(i,i,e.padding,!1,e.__autoSize?null:e.__autoWidth?"width":"height"),this.__updateNaturalSize()}else this.__updateRectBoxBounds();o&&this.__updateContentBounds()}else this.__updateRectBoxBounds()},Object.defineProperty(S,"__autoWidth",{get(){return null==this._width&&null==this._autoWidth}}),Object.defineProperty(S,"__autoHeight",{get(){return null==this._height&&null==this._autoHeight}}),Object.defineProperty(S,"__autoSide",{get(){return this.__autoWidth||this.__autoHeight}}),Object.defineProperty(S,"__autoSize",{get(){return this.__autoWidth&&this.__autoHeight}});
2
2
  //# sourceMappingURL=flow.min.cjs.map