pixuireactcomponents 1.5.34 → 1.5.36

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.
@@ -4,6 +4,7 @@ export declare function singleton<T>(impl: new () => T): {
4
4
  declare class MainLibImpl {
5
5
  private lib;
6
6
  load(): void;
7
+ isLoadSuccess(): boolean;
7
8
  unload(): void;
8
9
  stringToArrayBuffer(content: string): ArrayBuffer;
9
10
  getPlatform(): number;
@@ -34,6 +34,9 @@ var MainLibImpl = /** @class */ (function () {
34
34
  console.log('function table end');
35
35
  }
36
36
  };
37
+ MainLibImpl.prototype.isLoadSuccess = function () {
38
+ return this.lib != undefined;
39
+ };
37
40
  MainLibImpl.prototype.unload = function () {
38
41
  loadlib.unloadLib('openplatform');
39
42
  this.lib = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixuireactcomponents",
3
- "version": "1.5.34",
3
+ "version": "1.5.36",
4
4
  "description": "pixui react components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -167,6 +167,8 @@ export function Carousel(props) {
167
167
  };
168
168
  }, []);
169
169
  var handlePrev = function () {
170
+ if (!loop && showIndex == 1)
171
+ return;
170
172
  if (isMoving.current)
171
173
  return;
172
174
  isMoving.current = true;
@@ -244,7 +246,38 @@ export function Carousel(props) {
244
246
  var b = rect.bottom;
245
247
  var x = e.clientX;
246
248
  var y = e.clientY;
247
- setGestureoffset([e.clientX - mouseDownX.current, e.clientY - mouseDownY.current]);
249
+ //loop=false时,首尾元素不能继续往外滑动
250
+ if (loop == false) {
251
+ if (showIndex == 1) {
252
+ if (!isVertical) {
253
+ if (x - mouseDownX.current > 0) {
254
+ // console.log('stop x', x);
255
+ return;
256
+ }
257
+ }
258
+ else {
259
+ if (y - mouseDownY.current < 0) {
260
+ // console.log('stop y', y);
261
+ return;
262
+ }
263
+ }
264
+ }
265
+ else if (showIndex == carouselItems.length - 2) {
266
+ if (!isVertical) {
267
+ if (x - mouseDownX.current < 0) {
268
+ // console.log('stop x', x);
269
+ return;
270
+ }
271
+ }
272
+ else {
273
+ if (y - mouseDownY.current < 0) {
274
+ // console.log('stop y', y);
275
+ return;
276
+ }
277
+ }
278
+ }
279
+ }
280
+ setGestureoffset([x - mouseDownX.current, y - mouseDownY.current]);
248
281
  //计算滑动超出元素范围
249
282
  if (x < l || x > r || y > b || y < t) {
250
283
  gestureUp();
@@ -34,12 +34,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
- import { GameletAPI } from 'gamelet-pixui-frame';
38
37
  import path from 'path';
39
38
  import { tools } from './tools';
40
39
  import { LibMgr } from '../../../lib/loadlib/lib_mgr';
41
40
  var assetPrefix = 'cacheAsset';
42
- var isJssdkEnv = GameletAPI.getRuntimeEnv() == 'jssdk-appwindow' || GameletAPI.getRuntimeEnv() == 'jssdk-preprocessor';
43
41
  var OPLib = LibMgr.getInstance().getMainLib();
44
42
  console.log('new lib test');
45
43
  /**
@@ -64,7 +62,7 @@ export var assetCache;
64
62
  var urlWithoutParams, localPath, xhr;
65
63
  var _this = this;
66
64
  return __generator(this, function (_a) {
67
- if (!isJssdkEnv) {
65
+ if (!OPLib.isLoadSuccess()) {
68
66
  console.log('非jssdk环境');
69
67
  reject(url);
70
68
  return [2 /*return*/];
@@ -143,7 +141,7 @@ export var assetCache;
143
141
  };
144
142
  assetCache.getFileCachePath = function (url) {
145
143
  console.log('getCachePath', url);
146
- if (!isJssdkEnv) {
144
+ if (!OPLib.isLoadSuccess()) {
147
145
  console.log('非jssdk环境');
148
146
  return '';
149
147
  }