jsbox-cview 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,6 +70,7 @@ export class DynamicItemSizeMatrix extends Base<UIView, UiTypes.ViewOptions> {
70
70
  private _events: DynamicItemSizeMatrixEvents;
71
71
  private _itemSizeWidth: number;
72
72
  private _itemSizeHeight: number;
73
+ private _totalWidth: number = 0;
73
74
  matrix: Matrix;
74
75
  _defineView: () => UiTypes.ViewOptions;
75
76
 
@@ -115,6 +116,7 @@ export class DynamicItemSizeMatrix extends Base<UIView, UiTypes.ViewOptions> {
115
116
  events: {
116
117
  layoutSubviews: sender => {
117
118
  sender.relayout();
119
+ if (sender.frame.width === this._totalWidth) return;
118
120
  const { itemSizeWidth } = this._getColumnsAndItemSizeWidth(
119
121
  sender.frame.width,
120
122
  this._props.minItemWidth,
@@ -26,12 +26,14 @@ class SecondaryView extends Base<UIView, UiTypes.ViewOptions> {
26
26
  make.top.bottom.inset(0);
27
27
  make.right.equalTo(view.super.left);
28
28
  make.width.greaterThanOrEqualTo(250);
29
+ make.width.lessThanOrEqualTo(350);
29
30
  make.width.equalTo(view.super).dividedBy(2.5).priority(999);
30
31
  },
31
32
  shown: (make, view) => {
32
33
  make.top.bottom.inset(0);
33
34
  make.left.equalTo(view.super.left);
34
35
  make.width.greaterThanOrEqualTo(250);
36
+ make.width.lessThanOrEqualTo(350);
35
37
  make.width.equalTo(view.super).dividedBy(2.5).priority(999);
36
38
  }
37
39
  };
@@ -60,6 +60,7 @@ const single_views_1 = require("./single-views");
60
60
  class DynamicItemSizeMatrix extends base_1.Base {
61
61
  constructor({ props, layout, events = {} }) {
62
62
  super();
63
+ this._totalWidth = 0;
63
64
  this._props = Object.assign({ fixedItemHeight: 40, minItemWidth: 96, maxColumns: 5, spacing: 6, dynamicHeightEnabled: false }, props);
64
65
  this._events = events;
65
66
  const _a = this._events, { itemHeight, heightChanged } = _a, rest = __rest(_a, ["itemHeight", "heightChanged"]);
@@ -82,6 +83,8 @@ class DynamicItemSizeMatrix extends base_1.Base {
82
83
  events: {
83
84
  layoutSubviews: sender => {
84
85
  sender.relayout();
86
+ if (sender.frame.width === this._totalWidth)
87
+ return;
85
88
  const { itemSizeWidth } = this._getColumnsAndItemSizeWidth(sender.frame.width, this._props.minItemWidth, this._props.maxColumns, this._props.spacing);
86
89
  this._itemSizeWidth = itemSizeWidth;
87
90
  this._itemSizeHeight = this._events.itemHeight
@@ -14,12 +14,14 @@ class SecondaryView extends base_1.Base {
14
14
  make.top.bottom.inset(0);
15
15
  make.right.equalTo(view.super.left);
16
16
  make.width.greaterThanOrEqualTo(250);
17
+ make.width.lessThanOrEqualTo(350);
17
18
  make.width.equalTo(view.super).dividedBy(2.5).priority(999);
18
19
  },
19
20
  shown: (make, view) => {
20
21
  make.top.bottom.inset(0);
21
22
  make.left.equalTo(view.super.left);
22
23
  make.width.greaterThanOrEqualTo(250);
24
+ make.width.lessThanOrEqualTo(350);
23
25
  make.width.equalTo(view.super).dividedBy(2.5).priority(999);
24
26
  }
25
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsbox-cview",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "为 JSBox 设计的微型框架",
5
5
  "repository": {
6
6
  "type": "git",