jsbox-cview 1.4.1 → 1.4.2
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,
|
|
@@ -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
|