jsbox-cview 1.5.20 → 1.5.22

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.
@@ -194,7 +194,24 @@ export class SplitViewController extends BaseController {
194
194
  props: {
195
195
  id: props.id,
196
196
  bgcolor: props.bgcolor
197
- }, layout, events
197
+ },
198
+ layout,
199
+ events: {
200
+ ...events,
201
+ didAppear: sender => {
202
+ if (this._sideBarShown) {
203
+ this._secondaryController.appear();
204
+ } else {
205
+ this._primaryController.appear();
206
+ }
207
+ events?.didAppear?.(this);
208
+ },
209
+ didDisappear: () => {
210
+ this._primaryController.disappear();
211
+ this._secondaryController.disappear();
212
+ events?.didDisappear?.(this);
213
+ }
214
+ }
198
215
  });
199
216
  this._sideBarShown = false;
200
217
  this._canShowSidebar = true;
@@ -36,7 +36,6 @@ interface TabBarControllerEvents extends BaseControllerEvents {
36
36
  */
37
37
  export class TabBarController extends BaseController {
38
38
  _props: TabBarControllerProps;
39
- _events: TabBarControllerEvents;
40
39
  cviews: {
41
40
  tabbar: TabBar;
42
41
  pageContentView: ContentView;
@@ -51,17 +50,17 @@ export class TabBarController extends BaseController {
51
50
  props: {
52
51
  id: props.id,
53
52
  bgcolor: props.bgcolor
54
- },
53
+ },
55
54
  layout,
56
55
  events: {
57
56
  ...events,
58
57
  didAppear: () => {
59
58
  this._props.items[this.index].controller.appear();
60
- this._events.didAppear?.(this);
59
+ events.didAppear?.(this);
61
60
  },
62
61
  didDisappear: () => {
63
62
  this._props.items[this.index].controller.disappear();
64
- this._events.didDisappear?.(this);
63
+ events.didDisappear?.(this);
65
64
  }
66
65
  }
67
66
  });
@@ -69,7 +68,6 @@ export class TabBarController extends BaseController {
69
68
  items: props.items,
70
69
  index: props.index || 0
71
70
  };
72
- this._events = events;
73
71
  this.cviews = {} as {
74
72
  tabbar: TabBar;
75
73
  pageContentView: ContentView;
@@ -82,12 +80,12 @@ export class TabBarController extends BaseController {
82
80
  events: {
83
81
  changed: (cview, index) => {
84
82
  this.index = index;
85
- this._props.items.find(item=>item.controller.status === 2)?.controller.disappear();
83
+ this._props.items.find(item => item.controller.status === 2)?.controller.disappear();
86
84
  this._props.items[index].controller.appear();
87
- this._events.changed?.(this, index);
85
+ events.changed?.(this, index);
88
86
  },
89
87
  doubleTapped: (cview, index) => {
90
- this._events.doubleTapped?.(this, index);
88
+ events.doubleTapped?.(this, index);
91
89
  }
92
90
  }
93
91
  });
@@ -137,7 +137,23 @@ class SplitViewController extends base_controller_1.BaseController {
137
137
  props: {
138
138
  id: props.id,
139
139
  bgcolor: props.bgcolor
140
- }, layout, events
140
+ },
141
+ layout,
142
+ events: Object.assign(Object.assign({}, events), { didAppear: sender => {
143
+ var _a;
144
+ if (this._sideBarShown) {
145
+ this._secondaryController.appear();
146
+ }
147
+ else {
148
+ this._primaryController.appear();
149
+ }
150
+ (_a = events === null || events === void 0 ? void 0 : events.didAppear) === null || _a === void 0 ? void 0 : _a.call(events, this);
151
+ }, didDisappear: () => {
152
+ var _a;
153
+ this._primaryController.disappear();
154
+ this._secondaryController.disappear();
155
+ (_a = events === null || events === void 0 ? void 0 : events.didDisappear) === null || _a === void 0 ? void 0 : _a.call(events, this);
156
+ } })
141
157
  });
142
158
  this._sideBarShown = false;
143
159
  this._canShowSidebar = true;
@@ -28,20 +28,19 @@ class TabBarController extends base_controller_1.BaseController {
28
28
  },
29
29
  layout,
30
30
  events: Object.assign(Object.assign({}, events), { didAppear: () => {
31
- var _a, _b;
31
+ var _a;
32
32
  this._props.items[this.index].controller.appear();
33
- (_b = (_a = this._events).didAppear) === null || _b === void 0 ? void 0 : _b.call(_a, this);
33
+ (_a = events.didAppear) === null || _a === void 0 ? void 0 : _a.call(events, this);
34
34
  }, didDisappear: () => {
35
- var _a, _b;
35
+ var _a;
36
36
  this._props.items[this.index].controller.disappear();
37
- (_b = (_a = this._events).didDisappear) === null || _b === void 0 ? void 0 : _b.call(_a, this);
37
+ (_a = events.didDisappear) === null || _a === void 0 ? void 0 : _a.call(events, this);
38
38
  } })
39
39
  });
40
40
  this._props = {
41
41
  items: props.items,
42
42
  index: props.index || 0
43
43
  };
44
- this._events = events;
45
44
  this.cviews = {};
46
45
  this.cviews.tabbar = new tabbar_1.TabBar({
47
46
  props: {
@@ -50,15 +49,15 @@ class TabBarController extends base_controller_1.BaseController {
50
49
  },
51
50
  events: {
52
51
  changed: (cview, index) => {
53
- var _a, _b, _c;
52
+ var _a, _b;
54
53
  this.index = index;
55
54
  (_a = this._props.items.find(item => item.controller.status === 2)) === null || _a === void 0 ? void 0 : _a.controller.disappear();
56
55
  this._props.items[index].controller.appear();
57
- (_c = (_b = this._events).changed) === null || _c === void 0 ? void 0 : _c.call(_b, this, index);
56
+ (_b = events.changed) === null || _b === void 0 ? void 0 : _b.call(events, this, index);
58
57
  },
59
58
  doubleTapped: (cview, index) => {
60
- var _a, _b;
61
- (_b = (_a = this._events).doubleTapped) === null || _b === void 0 ? void 0 : _b.call(_a, this, index);
59
+ var _a;
60
+ (_a = events.doubleTapped) === null || _a === void 0 ? void 0 : _a.call(events, this, index);
62
61
  }
63
62
  }
64
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsbox-cview",
3
- "version": "1.5.20",
3
+ "version": "1.5.22",
4
4
  "description": "为 JSBox 设计的微型框架",
5
5
  "repository": {
6
6
  "type": "git",