@convep_mobilogy/react-native-qms-plugin 0.5.2 → 0.6.1
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/android/build.gradle +1 -1
- package/lib/module/NativeQmsPlugin.js +6 -0
- package/lib/module/NativeQmsPlugin.js.map +1 -0
- package/lib/module/QmsDashboardView.js +2 -39
- package/lib/module/QmsDashboardView.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeQmsPlugin.d.ts +7 -0
- package/lib/typescript/src/NativeQmsPlugin.d.ts.map +1 -0
- package/lib/typescript/src/QmsDashboardView.d.ts +1 -13
- package/lib/typescript/src/QmsDashboardView.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/NativeQmsPlugin.ts +8 -0
- package/src/QmsDashboardView.ts +6 -0
- package/src/index.tsx +2 -0
- package/src/QmsDashboardView.tsx +0 -75
package/android/build.gradle
CHANGED
|
@@ -75,7 +75,7 @@ dependencies {
|
|
|
75
75
|
implementation "com.facebook.react:react-android"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
77
|
implementation 'com.facebook.react:react-native:+'
|
|
78
|
-
implementation "com.convep.qms:qms-plugin:1.
|
|
78
|
+
implementation "com.convep.qms:qms-plugin:1.2.0"
|
|
79
79
|
// implementation files('libs/Qms_plugin-release.aar')
|
|
80
80
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
81
81
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeQmsPlugin.ts"],"mappings":";;AAAA;AACA,SAASA,mBAAmB,QAA0B,cAAc;AAMpE,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
|
@@ -1,42 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const {
|
|
7
|
-
QmsModule
|
|
8
|
-
} = NativeModules;
|
|
9
|
-
|
|
10
|
-
// Only resolve the native view on iOS to avoid runtime errors on Android
|
|
11
|
-
const NativeQmsDashboardView = Platform.OS === 'ios' ? requireNativeComponent('QmsDashboardView') : null;
|
|
12
|
-
export const showQms = (token, clientID, clientCode) => {
|
|
13
|
-
QmsModule?.showQms?.(token, clientID, clientCode);
|
|
14
|
-
};
|
|
15
|
-
export const QmsDashboardView = ({
|
|
16
|
-
style,
|
|
17
|
-
clientID = '',
|
|
18
|
-
clientCode = '',
|
|
19
|
-
user_token,
|
|
20
|
-
token,
|
|
21
|
-
userToken,
|
|
22
|
-
autoShow = true
|
|
23
|
-
}) => {
|
|
24
|
-
const effectiveToken = user_token ?? token ?? userToken ?? '';
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (Platform.OS === 'android' && autoShow) {
|
|
27
|
-
QmsModule?.showQms?.(effectiveToken, clientID, clientCode);
|
|
28
|
-
}
|
|
29
|
-
}, [effectiveToken, clientID, clientCode, autoShow]);
|
|
30
|
-
if (Platform.OS === 'ios') {
|
|
31
|
-
return NativeQmsDashboardView && /*#__PURE__*/_jsx(NativeQmsDashboardView, {
|
|
32
|
-
style: style,
|
|
33
|
-
ClientID: clientID,
|
|
34
|
-
ClientCode: clientCode,
|
|
35
|
-
user_token: effectiveToken
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return /*#__PURE__*/_jsx(View, {
|
|
39
|
-
style: style
|
|
40
|
-
});
|
|
41
|
-
};
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
export const QmsDashboardView = Platform.OS === 'ios' ? require('./QmsDashboardView.ios').QmsDashboardView : require('./QmsDashboardView.android').QmsDashboardView;
|
|
42
5
|
//# sourceMappingURL=QmsDashboardView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Platform","QmsDashboardView","OS","require"],"sourceRoot":"../../src","sources":["QmsDashboardView.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,gBAAgB,GAC3BD,QAAQ,CAACE,EAAE,KAAK,KAAK,GACjBC,OAAO,CAAC,wBAAwB,CAAC,CAACF,gBAAgB,GAClDE,OAAO,CAAC,4BAA4B,CAAC,CAACF,gBAAgB","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["QmsDashboardView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"names":["QmsDashboardView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeQmsPlugin.d.ts","sourceRoot":"","sources":["../../../src/NativeQmsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,YAAY,IAAI,IAAI,CAAC;CACtB;;AAED,wBAAmE"}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ViewStyle } from 'react-native';
|
|
3
|
-
export type QmsDashboardProps = {
|
|
4
|
-
style?: ViewStyle;
|
|
5
|
-
clientID?: string;
|
|
6
|
-
clientCode?: string;
|
|
7
|
-
user_token?: string;
|
|
8
|
-
token?: string;
|
|
9
|
-
userToken?: string;
|
|
10
|
-
autoShow?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare const showQms: (token?: string, clientID?: string, clientCode?: string) => void;
|
|
13
|
-
export declare const QmsDashboardView: React.FC<QmsDashboardProps>;
|
|
1
|
+
export declare const QmsDashboardView: any;
|
|
14
2
|
//# sourceMappingURL=QmsDashboardView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QmsDashboardView.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.
|
|
1
|
+
{"version":3,"file":"QmsDashboardView.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,KAG+B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@convep_mobilogy/react-native-qms-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "To handle defect managment",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -148,6 +148,14 @@
|
|
|
148
148
|
]
|
|
149
149
|
]
|
|
150
150
|
},
|
|
151
|
+
"codegenConfig": {
|
|
152
|
+
"name": "QmsPluginSpec",
|
|
153
|
+
"type": "modules",
|
|
154
|
+
"jsSrcsDir": "src",
|
|
155
|
+
"android": {
|
|
156
|
+
"javaPackageName": "com.qmsplugin"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
151
159
|
"create-react-native-library": {
|
|
152
160
|
"languages": "kotlin-objc",
|
|
153
161
|
"type": "turbo-module",
|
package/src/index.tsx
CHANGED
package/src/QmsDashboardView.tsx
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
NativeModules,
|
|
4
|
-
Platform,
|
|
5
|
-
requireNativeComponent,
|
|
6
|
-
View,
|
|
7
|
-
} from 'react-native';
|
|
8
|
-
import type { ViewStyle } from 'react-native';
|
|
9
|
-
|
|
10
|
-
type IOSProps = {
|
|
11
|
-
style?: ViewStyle;
|
|
12
|
-
ClientID?: string;
|
|
13
|
-
ClientCode?: string;
|
|
14
|
-
user_token?: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type QmsDashboardProps = {
|
|
18
|
-
style?: ViewStyle;
|
|
19
|
-
clientID?: string;
|
|
20
|
-
clientCode?: string;
|
|
21
|
-
// prefer snake_case to match native expectation; keep others for compatibility
|
|
22
|
-
user_token?: string;
|
|
23
|
-
token?: string;
|
|
24
|
-
userToken?: string;
|
|
25
|
-
autoShow?: boolean;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const { QmsModule } = NativeModules;
|
|
29
|
-
|
|
30
|
-
// Only resolve the native view on iOS to avoid runtime errors on Android
|
|
31
|
-
const NativeQmsDashboardView =
|
|
32
|
-
Platform.OS === 'ios'
|
|
33
|
-
? requireNativeComponent<IOSProps>('QmsDashboardView')
|
|
34
|
-
: null;
|
|
35
|
-
|
|
36
|
-
export const showQms = (
|
|
37
|
-
token?: string,
|
|
38
|
-
clientID?: string,
|
|
39
|
-
clientCode?: string
|
|
40
|
-
) => {
|
|
41
|
-
QmsModule?.showQms?.(token, clientID, clientCode);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const QmsDashboardView: React.FC<QmsDashboardProps> = ({
|
|
45
|
-
style,
|
|
46
|
-
clientID = '',
|
|
47
|
-
clientCode = '',
|
|
48
|
-
user_token,
|
|
49
|
-
token,
|
|
50
|
-
userToken,
|
|
51
|
-
autoShow = true,
|
|
52
|
-
}) => {
|
|
53
|
-
const effectiveToken = user_token ?? token ?? userToken ?? '';
|
|
54
|
-
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
if (Platform.OS === 'android' && autoShow) {
|
|
57
|
-
QmsModule?.showQms?.(effectiveToken, clientID, clientCode);
|
|
58
|
-
}
|
|
59
|
-
}, [effectiveToken, clientID, clientCode, autoShow]);
|
|
60
|
-
|
|
61
|
-
if (Platform.OS === 'ios') {
|
|
62
|
-
return (
|
|
63
|
-
NativeQmsDashboardView && (
|
|
64
|
-
<NativeQmsDashboardView
|
|
65
|
-
style={style}
|
|
66
|
-
ClientID={clientID}
|
|
67
|
-
ClientCode={clientCode}
|
|
68
|
-
user_token={effectiveToken}
|
|
69
|
-
/>
|
|
70
|
-
)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return <View style={style} />;
|
|
75
|
-
};
|