esoftplay 0.0.113 → 0.0.114
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/bin/build.js +14 -29
- package/bin/cli.js +8 -7
- package/bin/router.js +2 -0
- package/error.ts +16 -12
- package/esp.ts +26 -3
- package/modules/lib/curl.ts +27 -7
- package/modules/lib/datepicker.tsx +4 -5
- package/modules/lib/document.ts +1 -1
- package/modules/{content → lib}/gallery.tsx +3 -3
- package/modules/lib/image.tsx +2 -2
- package/modules/lib/infinite.tsx +4 -3
- package/modules/lib/roll.tsx +1 -1
- package/modules/lib/scrollpicker.tsx +219 -0
- package/modules/lib/timepicker.tsx +5 -6
- package/modules/{content → lib}/video.tsx +3 -3
- package/modules/lib/worker.tsx +4 -4
- package/modules/lib/workloop.tsx +1 -0
- package/modules/lib/workview.tsx +1 -1
- package/modules/main/index.tsx +19 -0
- package/modules/use/curl.ts +1 -1
- package/modules/user/class.ts +1 -1
- package/modules/user/index.tsx +19 -8
- package/modules/user/login.tsx +1 -1
- package/package.json +1 -1
- package/modules/content/audio.tsx +0 -126
- package/modules/content/bookmark.tsx +0 -81
- package/modules/content/category.tsx +0 -59
- package/modules/content/category_list.tsx +0 -52
- package/modules/content/comment.tsx +0 -173
- package/modules/content/comment_item.tsx +0 -60
- package/modules/content/config.tsx +0 -79
- package/modules/content/detail.tsx +0 -150
- package/modules/content/header.tsx +0 -49
- package/modules/content/index.tsx +0 -52
- package/modules/content/item.tsx +0 -112
- package/modules/content/item_header.tsx +0 -59
- package/modules/content/list.tsx +0 -60
- package/modules/content/search.tsx +0 -37
- package/modules/lib/menu.tsx +0 -51
- package/modules/lib/menusub.tsx +0 -58
package/bin/build.js
CHANGED
|
@@ -13,7 +13,8 @@ const tsconfig = DIR + "tsconfig.json"
|
|
|
13
13
|
const appjs = DIR + "App.js"
|
|
14
14
|
const appts = DIR + "App.tsx"
|
|
15
15
|
const pathJSTimer = DIR + "node_modules/react-native/Libraries/Core/Timers/JSTimers.js"
|
|
16
|
-
|
|
16
|
+
const lowercasePrompt = 'if (/^[a-z]/.test(component.name)) {'
|
|
17
|
+
const pathLowercasePrompt = DIR + 'node_modules/@react-navigation/core/src/useNavigationBuilder.tsx'
|
|
17
18
|
/**
|
|
18
19
|
* function ini untuk mengambil name autocomplete dari @expo/vector-icons untuk library LibIcon
|
|
19
20
|
* function akan di injectkan di folder @expo/vector-icons/build dengan nama file esoftplay_icons.ts
|
|
@@ -52,8 +53,8 @@ if (fs.existsSync(packjson)) {
|
|
|
52
53
|
"group_id": 4,
|
|
53
54
|
"salt": "CHANGE_INTO_YOUR_OWN_SALT",
|
|
54
55
|
"home": {
|
|
55
|
-
"public": "
|
|
56
|
-
"member": "
|
|
56
|
+
"public": "main/index",
|
|
57
|
+
"member": "main/index"
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
}
|
|
@@ -117,6 +118,16 @@ if (fs.existsSync(packjson)) {
|
|
|
117
118
|
fs.writeFileSync(pathJSTimer, JSTimers)
|
|
118
119
|
}
|
|
119
120
|
|
|
121
|
+
/* hide prompt lowercase */
|
|
122
|
+
if (fs.existsSync(pathLowercasePrompt)) {
|
|
123
|
+
console.log('Fixing lowercase prompt')
|
|
124
|
+
let useNavigationBuilder = fs.readFileSync(pathLowercasePrompt, { encoding: 'utf8' })
|
|
125
|
+
useNavigationBuilder = useNavigationBuilder.replace(lowercasePrompt, lowercasePrompt + '\nreturn;')
|
|
126
|
+
fs.writeFileSync(pathLowercasePrompt, useNavigationBuilder)
|
|
127
|
+
} else {
|
|
128
|
+
console.log('Path not exists')
|
|
129
|
+
}
|
|
130
|
+
|
|
120
131
|
const easconfg = `{
|
|
121
132
|
"cli": {
|
|
122
133
|
"version": ">= 0.52.0"
|
|
@@ -213,29 +224,6 @@ yarn-error.log\n\
|
|
|
213
224
|
console.log('.gitignore has been created');
|
|
214
225
|
});
|
|
215
226
|
|
|
216
|
-
// const AppJS = `import { esp, LibNotification } from 'esoftplay';
|
|
217
|
-
// import * as ErrorReport from 'esoftplay/error';
|
|
218
|
-
// import * as Notifications from 'expo-notifications';
|
|
219
|
-
// import React, { useEffect, useRef } from 'react';
|
|
220
|
-
// import { enableFreeze, enableScreens } from 'react-native-screens';
|
|
221
|
-
// const { globalIdx } = require('esoftplay/global')
|
|
222
|
-
// enableScreens();
|
|
223
|
-
// enableFreeze(true);
|
|
224
|
-
|
|
225
|
-
// Notifications.addNotificationResponseReceivedListener(x => LibNotification.onAction(x))
|
|
226
|
-
|
|
227
|
-
// export default function App() {
|
|
228
|
-
// const Home = useRef(esp.home()).current
|
|
229
|
-
|
|
230
|
-
// useEffect(() => {
|
|
231
|
-
// globalIdx.reset()
|
|
232
|
-
// ErrorReport.getError()
|
|
233
|
-
// }, [])
|
|
234
|
-
|
|
235
|
-
// return <Home />
|
|
236
|
-
// }`;
|
|
237
|
-
|
|
238
|
-
|
|
239
227
|
const AppJS = `import { esp, LibNotification } from 'esoftplay';
|
|
240
228
|
import * as ErrorReport from 'esoftplay/error';
|
|
241
229
|
import * as Notifications from 'expo-notifications';
|
|
@@ -271,7 +259,6 @@ export default function App() {
|
|
|
271
259
|
'@react-navigation/native',
|
|
272
260
|
'@react-navigation/stack',
|
|
273
261
|
'buffer',
|
|
274
|
-
'expo-av',
|
|
275
262
|
'expo-application',
|
|
276
263
|
'expo-camera',
|
|
277
264
|
'expo-clipboard',
|
|
@@ -282,7 +269,6 @@ export default function App() {
|
|
|
282
269
|
'expo-font',
|
|
283
270
|
'expo-image-manipulator',
|
|
284
271
|
'expo-image-picker',
|
|
285
|
-
'expo-linear-gradient',
|
|
286
272
|
'expo-media-library',
|
|
287
273
|
'expo-notifications',
|
|
288
274
|
'expo-status-bar',
|
|
@@ -295,7 +281,6 @@ export default function App() {
|
|
|
295
281
|
'react-native-gesture-handler',
|
|
296
282
|
'react-native-awesome-gallery',
|
|
297
283
|
'react-native-fast-image',
|
|
298
|
-
'react-native-picker-scrollview',
|
|
299
284
|
'react-native-pinch-zoom-view-movable',
|
|
300
285
|
'react-native-reanimated',
|
|
301
286
|
'react-native-safe-area-context',
|
package/bin/cli.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
2
|
const fs = require('fs');
|
|
5
3
|
const exec = require('child_process').execSync;
|
|
6
4
|
const path = require('path');
|
|
@@ -312,13 +310,15 @@ function createMaster(module_name) {
|
|
|
312
310
|
if (fs.existsSync("./assets"))
|
|
313
311
|
shell("rm -r ./assets")
|
|
314
312
|
shell("mkdir -p assets")
|
|
315
|
-
|
|
313
|
+
if (fs.existsSync('../mobile/' + assetsModule + '/*'))
|
|
314
|
+
shell("cp -r ../mobile/" + assetsModule + "/* ./assets/")
|
|
316
315
|
|
|
317
316
|
/* copy fonts */
|
|
318
317
|
if (fs.existsSync("./fonts"))
|
|
319
318
|
shell("rm -r ./fonts")
|
|
320
319
|
shell("mkdir -p fonts")
|
|
321
|
-
|
|
320
|
+
if (fs.existsSync('../mobile/' + assetsFonts + '/*'))
|
|
321
|
+
shell("cp -r ../mobile/" + assetsFonts + "/* ./assets/")
|
|
322
322
|
|
|
323
323
|
/* copy lang */
|
|
324
324
|
if (fs.existsSync("../mobile/assets/locale/id.json")) {
|
|
@@ -338,7 +338,7 @@ function createMaster(module_name) {
|
|
|
338
338
|
|
|
339
339
|
if (fs.existsSync("./package.json")) {
|
|
340
340
|
const packJson = require("./package.json")
|
|
341
|
-
const letterVersion =
|
|
341
|
+
const letterVersion = "abcdefghijklmnopqrstuvwxyz"
|
|
342
342
|
const version = packJson.version
|
|
343
343
|
const letter = version.match(/([a-z])/g)
|
|
344
344
|
const number = version.replace(/-/g, "").replace(letter, "")
|
|
@@ -357,10 +357,11 @@ function createMaster(module_name) {
|
|
|
357
357
|
nextNumber = Number(nextNumber) + 1
|
|
358
358
|
nextVersion += nextNumber
|
|
359
359
|
}
|
|
360
|
+
|
|
360
361
|
const newPackJson = { ...packJson, version: nextVersion }
|
|
361
362
|
fs.writeFileSync("./package.json", JSON.stringify(newPackJson, undefined, 2))
|
|
362
363
|
shell("npm publish")
|
|
363
|
-
console.log("
|
|
364
|
+
console.log("\nnpm install --save esoftplay-" + moduleName + "@" + nextVersion + "\n")
|
|
364
365
|
}`
|
|
365
366
|
if (!fs.existsSync(PATH + "master/")) {
|
|
366
367
|
fs.mkdirSync(PATH + "master")
|
|
@@ -787,7 +788,7 @@ function doInc(file) {
|
|
|
787
788
|
consoleSucces(file + " Versi yang lama " + app.expo.version)
|
|
788
789
|
app.expo.android.versionCode = lastVersion + 1
|
|
789
790
|
app.expo.ios.buildNumber = String(lastVersion + 1)
|
|
790
|
-
app.expo.runtimeVersion = String(lastVersion + 1)
|
|
791
|
+
// app.expo.runtimeVersion = String(lastVersion + 1)
|
|
791
792
|
app.expo.version = args[1] || ('0.' + String(lastVersion + 1))
|
|
792
793
|
consoleSucces(file + " Berhasil diupdate ke versi " + app.expo.version)
|
|
793
794
|
fs.writeFileSync(file, JSON.stringify(app, undefined, 2))
|
package/bin/router.js
CHANGED
|
@@ -584,6 +584,8 @@ function createRouter() {
|
|
|
584
584
|
staticImport.splice(2, 0, item)
|
|
585
585
|
} else if (task == 'style') {
|
|
586
586
|
staticImport.splice(9, 0, item)
|
|
587
|
+
} else if (task == 'scrollpicker') {
|
|
588
|
+
staticImport.splice(10, 0, item)
|
|
587
589
|
} else {
|
|
588
590
|
staticImport.push(item);
|
|
589
591
|
}
|
package/error.ts
CHANGED
|
@@ -9,12 +9,12 @@ let app = require('../../app.json');
|
|
|
9
9
|
const { manifest } = Constants;
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const defaultErrorHandler = ErrorUtils
|
|
12
|
+
// const defaultErrorHandler = ErrorUtils?.getGlobalHandler?.()
|
|
13
13
|
|
|
14
14
|
const myErrorHandler = (e: any, isFatal: any) => {
|
|
15
15
|
if (!manifest?.packagerOpts)
|
|
16
16
|
setError(e)
|
|
17
|
-
defaultErrorHandler(e, isFatal)
|
|
17
|
+
// defaultErrorHandler?.(e, isFatal)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function setError(error?: any) {
|
|
@@ -34,7 +34,7 @@ export function reportApiError(fetch: any, error: any) {
|
|
|
34
34
|
const user = UserClass.state().get()
|
|
35
35
|
let config = esp.config()
|
|
36
36
|
let msg = [
|
|
37
|
-
'slug: ' + "#" +
|
|
37
|
+
'slug: ' + "#" + manifest?.slug,
|
|
38
38
|
'dev: ' + Platform.OS + ' - ' + Constants.deviceName,
|
|
39
39
|
'app/pub_id: ' + Constants.appOwnership + '/' + (config?.publish_id || '-'),
|
|
40
40
|
'user_id: ' + user?.id || user?.user_id || '-',
|
|
@@ -66,24 +66,28 @@ export function getError() {
|
|
|
66
66
|
if (e) {
|
|
67
67
|
let _e = JSON.parse(e)
|
|
68
68
|
let msg = [
|
|
69
|
-
'slug: ' + "#" +
|
|
70
|
-
'name: ' +
|
|
69
|
+
'slug: ' + "#" + manifest?.slug,
|
|
70
|
+
'name: ' + manifest?.name + ' - sdk' + pack?.dependencies?.expo,
|
|
71
71
|
'domain: ' + config.domain + config.uri,
|
|
72
|
-
'package: ' + (Platform.OS == 'ios' ?
|
|
72
|
+
'package: ' + (Platform.OS == 'ios' ? manifest?.ios?.bundleIdentifier : manifest?.android?.package) + ' - v' + (Platform.OS == 'ios' ? app.expo.ios.buildNumber : app.expo.android.versionCode),
|
|
73
73
|
'device: ' + Platform.OS + ' | ' + Constants.deviceName,
|
|
74
|
-
'
|
|
74
|
+
'native/pub_id: ' + manifest?.sdkVersion + '/' + (config?.publish_id || '-'),
|
|
75
75
|
'user_id: ' + _e?.user?.id || _e?.user?.user_id || '-',
|
|
76
76
|
'username: ' + _e?.user?.username || '-',
|
|
77
77
|
'module: ' + _e.routes,
|
|
78
78
|
'error: \n' + _e.error,
|
|
79
79
|
].join('\n')
|
|
80
80
|
// config?.errorReport?.telegramIds?.forEach?.((id: string) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
if (msg.includes(`Invariant Violation: "main" has not been registered. This can happen if`)) {
|
|
82
|
+
// remove error that unsolved
|
|
83
|
+
} else {
|
|
84
|
+
let post = {
|
|
85
|
+
text: msg,
|
|
86
|
+
chat_id: "-1001212227631",
|
|
87
|
+
disable_web_page_preview: true
|
|
88
|
+
}
|
|
89
|
+
new LibCurl().custom('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
|
|
85
90
|
}
|
|
86
|
-
new LibCurl().custom('https://api.telegram.org/bot923808407:AAEFBlllQNKCEn8E66fwEzCj5vs9qGwVGT4/sendMessage', post)
|
|
87
91
|
// });
|
|
88
92
|
AsyncStorage.removeItem(config.domain + 'error')
|
|
89
93
|
}
|
package/esp.ts
CHANGED
|
@@ -6,9 +6,32 @@ import _assets from './cache/assets';
|
|
|
6
6
|
import navs from './cache/navigations';
|
|
7
7
|
import routers from './cache/routers';
|
|
8
8
|
import './oneplusfixfont';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const ignoreWarns = [
|
|
10
|
+
"Setting a timer for a long period of time",
|
|
11
|
+
"VirtualizedLists should never be nested inside plain ScrollViews with the same orientation",
|
|
12
|
+
"ViewPropTypes will be removed",
|
|
13
|
+
"AsyncStorage has been extracted from react-native",
|
|
14
|
+
"EventEmitter.removeListener",
|
|
15
|
+
"Got a component with the name 'm'",
|
|
16
|
+
"Did not receive response to shouldStartLoad in time,"
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const err = console.error;
|
|
20
|
+
console.error = (...arg) => {
|
|
21
|
+
for (let i = 0; i < ignoreWarns.length; i++) {
|
|
22
|
+
if (arg[0].startsWith(ignoreWarns[i])) return;
|
|
23
|
+
}
|
|
24
|
+
err(...arg);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const warn = console.warn;
|
|
28
|
+
console.warn = (...arg) => {
|
|
29
|
+
for (let i = 0; i < ignoreWarns.length; i++) {
|
|
30
|
+
if (arg[0].startsWith(ignoreWarns[i])) return;
|
|
31
|
+
}
|
|
32
|
+
warn(...arg);
|
|
33
|
+
};
|
|
34
|
+
LogBox.ignoreLogs(ignoreWarns);
|
|
12
35
|
let app = require('../../app.json');
|
|
13
36
|
let conf = require('../../config.json');
|
|
14
37
|
let lconf
|
package/modules/lib/curl.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { esp, LibCrypt, LibNet_status, LibObject, LibProgress, LibUtils, LogStateProperty } from 'esoftplay';
|
|
1
|
+
import { esp, LibCrypt, LibNet_status, LibObject, LibProgress, LibToastProperty, LibUtils, LogStateProperty } from 'esoftplay';
|
|
2
2
|
import { reportApiError } from "esoftplay/error";
|
|
3
3
|
import moment from "esoftplay/moment";
|
|
4
4
|
import Constants from 'expo-constants';
|
|
@@ -6,7 +6,9 @@ import Constants from 'expo-constants';
|
|
|
6
6
|
const { manifest } = Constants;
|
|
7
7
|
|
|
8
8
|
export default class ecurl {
|
|
9
|
-
|
|
9
|
+
controller = new AbortController()
|
|
10
|
+
signal = this.controller.signal
|
|
11
|
+
timeout = 30000;
|
|
10
12
|
maxRetry = 2;
|
|
11
13
|
timeoutContext: any = null;
|
|
12
14
|
isDebug = esp.config("isDebug");
|
|
@@ -56,10 +58,11 @@ export default class ecurl {
|
|
|
56
58
|
protected initTimeout(customTimeout?: number): void {
|
|
57
59
|
this.cancelTimeout()
|
|
58
60
|
this.timeoutContext = setTimeout(() => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
if (typeof this?.controller?.abort == 'function') {
|
|
62
|
+
this.closeConnection()
|
|
63
|
+
LibProgress.hide()
|
|
64
|
+
LibToastProperty.show(this.refineErrorMessage('timeout exceeded'))
|
|
65
|
+
}
|
|
63
66
|
}, customTimeout ?? this.timeout);
|
|
64
67
|
}
|
|
65
68
|
|
|
@@ -128,6 +131,7 @@ export default class ecurl {
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
protected closeConnection(): void {
|
|
134
|
+
this.controller?.abort?.()
|
|
131
135
|
// this?.abort?.cancel('Oops, Sepertinya ada gangguan jaringan... Silahkan coba beberapa saat lagi');
|
|
132
136
|
}
|
|
133
137
|
|
|
@@ -165,6 +169,7 @@ export default class ecurl {
|
|
|
165
169
|
let ps = Object.keys(_post).map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(_post[key])).join('&');
|
|
166
170
|
var options: any = {
|
|
167
171
|
method: "POST",
|
|
172
|
+
signal: this.signal,
|
|
168
173
|
headers: {
|
|
169
174
|
...this.header,
|
|
170
175
|
["Content-Type"]: "application/x-www-form-urlencoded;charset=UTF-8"
|
|
@@ -173,7 +178,9 @@ export default class ecurl {
|
|
|
173
178
|
cache: "no-store",
|
|
174
179
|
_post: _post
|
|
175
180
|
}
|
|
181
|
+
this.initTimeout(this.timeout);
|
|
176
182
|
fetch(this.url + this.uri + (token_uri || 'get_token'), options).then(async (res) => {
|
|
183
|
+
this.cancelTimeout()
|
|
177
184
|
let resText = await res.text()
|
|
178
185
|
this.onFetched(resText,
|
|
179
186
|
(res, msg) => {
|
|
@@ -183,6 +190,7 @@ export default class ecurl {
|
|
|
183
190
|
onFailed(msg, false)
|
|
184
191
|
}, debug)
|
|
185
192
|
}).catch((r) => {
|
|
193
|
+
this.cancelTimeout()
|
|
186
194
|
LibProgress.hide()
|
|
187
195
|
this.onFetchFailed(r)
|
|
188
196
|
// if (onFailed)
|
|
@@ -283,6 +291,7 @@ export default class ecurl {
|
|
|
283
291
|
await this.setHeader()
|
|
284
292
|
var options: any = {
|
|
285
293
|
method: !this.post ? "GET" : "POST",
|
|
294
|
+
signal: this.signal,
|
|
286
295
|
headers: {
|
|
287
296
|
...this.header,
|
|
288
297
|
["Content-Type"]: "application/x-www-form-urlencoded;charset=UTF-8"
|
|
@@ -297,7 +306,9 @@ export default class ecurl {
|
|
|
297
306
|
if (debug == 1)
|
|
298
307
|
esp.log(this.url + this.uri, options)
|
|
299
308
|
this.fetchConf = { url: this.url + this.uri, options: options }
|
|
309
|
+
this.initTimeout(this.timeout);
|
|
300
310
|
fetch(this.url + this.uri, options).then(async (res) => {
|
|
311
|
+
this.cancelTimeout()
|
|
301
312
|
var resText = await res.text()
|
|
302
313
|
var resJson = (resText.startsWith("{") || resText.startsWith("[")) ? JSON.parse(resText) : null
|
|
303
314
|
if (resJson) {
|
|
@@ -321,6 +332,7 @@ export default class ecurl {
|
|
|
321
332
|
this.onError(resText)
|
|
322
333
|
}
|
|
323
334
|
}).catch((e) => {
|
|
335
|
+
this.cancelTimeout()
|
|
324
336
|
LibProgress.hide()
|
|
325
337
|
// Alert.alert(this.alertTimeout.title, this.alertTimeout.message, [
|
|
326
338
|
// {
|
|
@@ -375,6 +387,7 @@ export default class ecurl {
|
|
|
375
387
|
method: !this.post ? "GET" : "POST",
|
|
376
388
|
headers: this.header,
|
|
377
389
|
body: this.post,
|
|
390
|
+
signal: this.signal,
|
|
378
391
|
cache: "no-store",
|
|
379
392
|
Pragma: "no-cache",
|
|
380
393
|
["Cache-Control"]: 'no-cache, no-store, must-revalidate',
|
|
@@ -441,7 +454,7 @@ export default class ecurl {
|
|
|
441
454
|
}
|
|
442
455
|
}
|
|
443
456
|
|
|
444
|
-
this.initTimeout(upload ? 120000 :
|
|
457
|
+
this.initTimeout(upload ? 120000 : this.timeout)
|
|
445
458
|
if (debug == 1) esp.log(this.url + this.uri, options)
|
|
446
459
|
this.fetchConf = { url: this.url + this.uri, options: options }
|
|
447
460
|
|
|
@@ -458,6 +471,7 @@ export default class ecurl {
|
|
|
458
471
|
// })
|
|
459
472
|
// } else {
|
|
460
473
|
fetch(this.url + this.uri, options).then(async (res) => {
|
|
474
|
+
this.cancelTimeout()
|
|
461
475
|
let resText = await res.text()
|
|
462
476
|
this.onFetched(resText, onDone, onFailed, debug)
|
|
463
477
|
}).catch((r) => {
|
|
@@ -473,6 +487,12 @@ export default class ecurl {
|
|
|
473
487
|
// onPress: () => { }
|
|
474
488
|
// }
|
|
475
489
|
// ])
|
|
490
|
+
if (this.maxRetry > 0) {
|
|
491
|
+
this.init(uri, post, onDone, onFailed, debug)
|
|
492
|
+
this.maxRetry = this.maxRetry - 1
|
|
493
|
+
} else {
|
|
494
|
+
LibToastProperty.show("Koneksi internet anda tidak stabil, silahkan coba beberapa saat lagi")
|
|
495
|
+
}
|
|
476
496
|
this.onFetchFailed(r)
|
|
477
497
|
LibProgress.hide()
|
|
478
498
|
})
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// withHooks
|
|
2
2
|
// noPage
|
|
3
3
|
|
|
4
|
-
import { LibLoading, LibStyle, LibToastProperty, useSafeState } from 'esoftplay';
|
|
4
|
+
import { LibLoading, LibScrollpicker, LibStyle, LibToastProperty, useSafeState } from 'esoftplay';
|
|
5
5
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
6
|
import React, { useEffect, useRef } from 'react';
|
|
7
7
|
import { Text, TouchableOpacity, View } from 'react-native';
|
|
8
|
-
import ScrollPicker from 'react-native-picker-scrollview';
|
|
9
8
|
export interface LibDatepickerProps {
|
|
10
9
|
minDate: string,
|
|
11
10
|
maxDate: string,
|
|
@@ -165,7 +164,7 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
165
164
|
</View>
|
|
166
165
|
<View style={{ height: 175, flexDirection: 'row' }} >
|
|
167
166
|
<View style={{ width: showDateView ? undefined : 0, flex: showDateView ? 1 : 0, }} >
|
|
168
|
-
<
|
|
167
|
+
<LibScrollpicker
|
|
169
168
|
ref={refDate}
|
|
170
169
|
dataSource={dates}
|
|
171
170
|
selectedIndex={dates.indexOf(date)}
|
|
@@ -178,7 +177,7 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
178
177
|
/>
|
|
179
178
|
</View>
|
|
180
179
|
<View style={{ width: showMonthView ? undefined : 0, flex: showMonthView ? 1 : 0, }} >
|
|
181
|
-
<
|
|
180
|
+
<LibScrollpicker
|
|
182
181
|
ref={refMonth}
|
|
183
182
|
dataSource={months}
|
|
184
183
|
selectedIndex={months.indexOf(month)}
|
|
@@ -191,7 +190,7 @@ export default function m(props: LibDatepickerProps): any {
|
|
|
191
190
|
/>
|
|
192
191
|
</View>
|
|
193
192
|
<View style={{ width: showYearView ? undefined : 0, flex: showYearView ? 1 : 0, }} >
|
|
194
|
-
<
|
|
193
|
+
<LibScrollpicker
|
|
195
194
|
ref={refYear}
|
|
196
195
|
dataSource={years}
|
|
197
196
|
selectedIndex={years.indexOf(year)}
|
package/modules/lib/document.ts
CHANGED
|
@@ -5,13 +5,13 @@ import React, { useRef } from 'react';
|
|
|
5
5
|
import { Pressable, View } from 'react-native';
|
|
6
6
|
import Gallery from 'react-native-awesome-gallery';
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface LibGalleryArgs {
|
|
9
9
|
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface LibGalleryProps {
|
|
12
12
|
|
|
13
13
|
}
|
|
14
|
-
export default function m(props:
|
|
14
|
+
export default function m(props: LibGalleryProps): any {
|
|
15
15
|
let images = LibNavigation.getArgs(props, "images", [])
|
|
16
16
|
const image = LibNavigation.getArgs(props, "image", "")
|
|
17
17
|
const index = LibNavigation.getArgs(props, "index", 0)
|
package/modules/lib/image.tsx
CHANGED
|
@@ -222,7 +222,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
224
|
(msg: any) => {
|
|
225
|
-
console.log(msg.
|
|
225
|
+
console.log(msg.message, "NOOO")
|
|
226
226
|
if (x.length - 1 == i)
|
|
227
227
|
LibProgress.hide()
|
|
228
228
|
}, 1)
|
|
@@ -261,7 +261,7 @@ class m extends LibComponent<LibImageProps, LibImageState> {
|
|
|
261
261
|
},
|
|
262
262
|
(msg: any) => {
|
|
263
263
|
LibProgress.hide()
|
|
264
|
-
r(msg.
|
|
264
|
+
r(msg.message);
|
|
265
265
|
}, 1)
|
|
266
266
|
}, 1);
|
|
267
267
|
}
|
package/modules/lib/infinite.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export interface LibInfiniteProps {
|
|
|
25
25
|
ItemSeparatorComponent?: any,
|
|
26
26
|
ListEmptyComponent?: any,
|
|
27
27
|
ListFooterComponent?: any,
|
|
28
|
+
ListEndedComponent?: any,
|
|
28
29
|
ListHeaderComponent?: any,
|
|
29
30
|
columnWrapperStyle?: any,
|
|
30
31
|
onScroll?: (e: any) => void,
|
|
@@ -134,12 +135,12 @@ export default class m extends LibComponent<LibInfiniteProps, LibInfiniteState>{
|
|
|
134
135
|
},
|
|
135
136
|
(msg) => {
|
|
136
137
|
if (this.props.isDebug) {
|
|
137
|
-
esp.log(msg
|
|
138
|
+
esp.log(msg)
|
|
138
139
|
}
|
|
139
140
|
this.page = page
|
|
140
141
|
this.isStop = true
|
|
141
142
|
this.setState({
|
|
142
|
-
error: msg
|
|
143
|
+
error: msg?.message,
|
|
143
144
|
})
|
|
144
145
|
}, this.props.isDebug
|
|
145
146
|
)
|
|
@@ -200,7 +201,7 @@ export default class m extends LibComponent<LibInfiniteProps, LibInfiniteState>{
|
|
|
200
201
|
maxToRenderPerBatch={10}
|
|
201
202
|
windowSize={10}
|
|
202
203
|
ListFooterComponent={
|
|
203
|
-
(!this.isStop) ? <View style={{ padding: 20 }} ><LibLoading /></View> : <View style={{ height: 50 }} />
|
|
204
|
+
(!this.isStop) ? <View style={{ padding: 20 }} ><LibLoading /></View> : (this.props?.ListEndedComponent || <View style={{ height: 50 }} />)
|
|
204
205
|
}
|
|
205
206
|
onEndReachedThreshold={0.5}
|
|
206
207
|
onEndReached={() => {
|