sales-frontend-bridge 0.0.25 → 0.0.27
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/dist/index.cjs +120 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -32
- package/dist/index.d.ts +91 -32
- package/dist/index.js +111 -36
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1855,6 +1855,40 @@ var NativeBridge = class extends CommonBridge {
|
|
|
1855
1855
|
async downloadDocument(options) {
|
|
1856
1856
|
return this.core.callToTarget("downloadDocument", options);
|
|
1857
1857
|
}
|
|
1858
|
+
/**
|
|
1859
|
+
* ### Bridge for Oz
|
|
1860
|
+
* 오즈 파라미터에서 사용할 폰트 설정들을 조회하는 브릿지입니다
|
|
1861
|
+
* @example
|
|
1862
|
+
* ```tsx
|
|
1863
|
+
* // 사용 예시
|
|
1864
|
+
* await Bridge.native.getOzFontParam()
|
|
1865
|
+
* ```
|
|
1866
|
+
*/
|
|
1867
|
+
async getOzFontParam() {
|
|
1868
|
+
return this.core.callToTarget("getOzFontParam");
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* 로더 컴포넌트 show
|
|
1872
|
+
* @example
|
|
1873
|
+
* ```tsx
|
|
1874
|
+
* // 사용 예시
|
|
1875
|
+
* await Bridge.native.showLoader()
|
|
1876
|
+
* ```
|
|
1877
|
+
*/
|
|
1878
|
+
async showLoader() {
|
|
1879
|
+
return this.core.callToTarget("showLoader");
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* 로더 컴포넌트 hide
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```tsx
|
|
1885
|
+
* // 사용 예시
|
|
1886
|
+
* Bridge.native.hideLoader()
|
|
1887
|
+
* ```
|
|
1888
|
+
*/
|
|
1889
|
+
async hideLoader() {
|
|
1890
|
+
return this.core.callToTarget("hideLoader");
|
|
1891
|
+
}
|
|
1858
1892
|
// TODO: 필요 플러그인들 추가
|
|
1859
1893
|
};
|
|
1860
1894
|
|
|
@@ -1971,18 +2005,6 @@ var NativeBridgeOz = class extends CommonBridge {
|
|
|
1971
2005
|
Object.assign({ param1: "", param2: "", param3: "", param4: "" }, options)
|
|
1972
2006
|
);
|
|
1973
2007
|
}
|
|
1974
|
-
/**
|
|
1975
|
-
* ### Bridge for Oz
|
|
1976
|
-
* 오즈 파라미터에서 사용할 폰트 설정들을 조회하는 브릿지입니다
|
|
1977
|
-
* @example
|
|
1978
|
-
* ```tsx
|
|
1979
|
-
* // 사용 예시
|
|
1980
|
-
* await Bridge.native.getOzFontParam()
|
|
1981
|
-
* ```
|
|
1982
|
-
*/
|
|
1983
|
-
async getOzFontParam() {
|
|
1984
|
-
return this.core.callToTarget("getOzFontParam");
|
|
1985
|
-
}
|
|
1986
2008
|
/**
|
|
1987
2009
|
* ### Bridge for Oz
|
|
1988
2010
|
* 서식의 진행중/완료 상태를 업데이트하는 브릿지
|
|
@@ -2041,28 +2063,6 @@ var NativeBridgeOz = class extends CommonBridge {
|
|
|
2041
2063
|
async hideOzPdfViewer() {
|
|
2042
2064
|
return this.core.callToTarget("hideOzPdfViewer");
|
|
2043
2065
|
}
|
|
2044
|
-
/**
|
|
2045
|
-
* 로더 컴포넌트 show
|
|
2046
|
-
* @example
|
|
2047
|
-
* ```tsx
|
|
2048
|
-
* // 사용 예시
|
|
2049
|
-
* await Bridge.native.showLoader()
|
|
2050
|
-
* ```
|
|
2051
|
-
*/
|
|
2052
|
-
async showLoader() {
|
|
2053
|
-
return this.core.callToTarget("showLoader");
|
|
2054
|
-
}
|
|
2055
|
-
/**
|
|
2056
|
-
* 로더 컴포넌트 hide
|
|
2057
|
-
* @example
|
|
2058
|
-
* ```tsx
|
|
2059
|
-
* // 사용 예시
|
|
2060
|
-
* await Bridge.native.hideLoader()
|
|
2061
|
-
* ```
|
|
2062
|
-
*/
|
|
2063
|
-
async hideLoader() {
|
|
2064
|
-
return this.core.callToTarget("hideLoader");
|
|
2065
|
-
}
|
|
2066
2066
|
// TODO: 필요 플러그인들 추가
|
|
2067
2067
|
};
|
|
2068
2068
|
|
|
@@ -2213,7 +2213,7 @@ async function fetchDocument(options) {
|
|
|
2213
2213
|
return data.map((i) => ({ ...i, startPage: 0, endPage: 0 }));
|
|
2214
2214
|
}
|
|
2215
2215
|
async function fetchFont() {
|
|
2216
|
-
const { data: fontMap } = await Bridge.
|
|
2216
|
+
const { data: fontMap } = await Bridge.native.getOzFontParam();
|
|
2217
2217
|
const fontParms = Object.keys(fontMap).map((i) => `font.${i}=${fontMap[i]}`);
|
|
2218
2218
|
return fontParms;
|
|
2219
2219
|
}
|
|
@@ -2260,6 +2260,81 @@ function getFileListByGlobalIndex(index, data) {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
return null;
|
|
2262
2262
|
}
|
|
2263
|
+
async function getReportCount() {
|
|
2264
|
+
const { data } = await Bridge.nativeOz.getInformation({ command: "REPORT_COUNT" });
|
|
2265
|
+
return Number(data);
|
|
2266
|
+
}
|
|
2267
|
+
async function enableFocusOnValidation(reportCount) {
|
|
2268
|
+
const count = reportCount ?? await getReportCount();
|
|
2269
|
+
for (let i = 0; i < count; i++) {
|
|
2270
|
+
await sleep();
|
|
2271
|
+
await Bridge.nativeOz.setGlobal({ key: "chkFlag", value: "1", docIndex: i });
|
|
2272
|
+
}
|
|
2273
|
+
return;
|
|
2274
|
+
}
|
|
2275
|
+
async function disableFocusOnValidation(reportCount) {
|
|
2276
|
+
const count = reportCount ?? await getReportCount();
|
|
2277
|
+
for (let i = 0; i < count; i++) {
|
|
2278
|
+
await sleep();
|
|
2279
|
+
await Bridge.nativeOz.setGlobal({ key: "chkFlag", value: "0", docIndex: i });
|
|
2280
|
+
}
|
|
2281
|
+
return;
|
|
2282
|
+
}
|
|
2283
|
+
async function sleep(ms = 10) {
|
|
2284
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
2285
|
+
}
|
|
2286
|
+
async function triggerClickOnAllDocuments(reportCount) {
|
|
2287
|
+
const count = reportCount ?? await getReportCount();
|
|
2288
|
+
for (let i = 0; i < count; i++) {
|
|
2289
|
+
await sleep();
|
|
2290
|
+
const command = `INPUT_TRIGGER_CLICK_AT=${i}`;
|
|
2291
|
+
await Bridge.nativeOz.getInformation({ command });
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
async function triggerCropImageOnAllDocuments(reportCount) {
|
|
2295
|
+
const count = reportCount ?? await getReportCount();
|
|
2296
|
+
for (let i = 0; i < count; i++) {
|
|
2297
|
+
await sleep();
|
|
2298
|
+
await Bridge.nativeOz.triggerExternalEventByDocIndex({ docIndex: Number(i), param1: "cropimage" });
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
async function getTotalPageOnAllDocuments(reportCount) {
|
|
2302
|
+
const count = reportCount ?? await getReportCount();
|
|
2303
|
+
const totalPages = [];
|
|
2304
|
+
for (let i = 0; i < count; i++) {
|
|
2305
|
+
await sleep();
|
|
2306
|
+
const command = `TOTAL_PAGE_OF_REPORT_FILE_AT=${i}`;
|
|
2307
|
+
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
2308
|
+
totalPages.push(Number(data));
|
|
2309
|
+
}
|
|
2310
|
+
return totalPages;
|
|
2311
|
+
}
|
|
2312
|
+
async function checkDocumentsValidityByIndex(indexList) {
|
|
2313
|
+
const result = [];
|
|
2314
|
+
for (let i = 0; i < indexList.length; i++) {
|
|
2315
|
+
await sleep();
|
|
2316
|
+
const command = `INVALID_INFO_JSON_AT=${indexList[i]}`;
|
|
2317
|
+
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
2318
|
+
result.push(data === "");
|
|
2319
|
+
}
|
|
2320
|
+
return result.every((i) => i);
|
|
2321
|
+
}
|
|
2322
|
+
async function validateAllDocuments(reportCount) {
|
|
2323
|
+
const count = reportCount ?? await getReportCount();
|
|
2324
|
+
for (let i = 0; i < count; i++) {
|
|
2325
|
+
await sleep();
|
|
2326
|
+
const command = `INPUT_CHECK_VALIDITY_AT=${i}`;
|
|
2327
|
+
const { data } = await Bridge.nativeOz.getInformation({ command });
|
|
2328
|
+
if (data !== "valid") {
|
|
2329
|
+
return false;
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
return true;
|
|
2333
|
+
}
|
|
2334
|
+
async function getTotalPage() {
|
|
2335
|
+
const { data } = await Bridge.nativeOz.getInformation({ command: "TOTAL_PAGE" });
|
|
2336
|
+
return Number(data);
|
|
2337
|
+
}
|
|
2263
2338
|
|
|
2264
2339
|
// src/oz/use-create-report.ts
|
|
2265
2340
|
function useCreateReport({ documentList, extraData = {} }) {
|
|
@@ -2385,15 +2460,25 @@ exports.Bridge = Bridge;
|
|
|
2385
2460
|
exports.OZViewerEvent = OZViewerEvent;
|
|
2386
2461
|
exports.btnStyle = btnStyle;
|
|
2387
2462
|
exports.categorizeByPageRange = categorizeByPageRange;
|
|
2463
|
+
exports.checkDocumentsValidityByIndex = checkDocumentsValidityByIndex;
|
|
2388
2464
|
exports.commonOzParam = commonOzParam;
|
|
2389
2465
|
exports.commonPdfExportParam = commonPdfExportParam;
|
|
2466
|
+
exports.disableFocusOnValidation = disableFocusOnValidation;
|
|
2467
|
+
exports.enableFocusOnValidation = enableFocusOnValidation;
|
|
2390
2468
|
exports.extractFileName = extractFileName;
|
|
2391
2469
|
exports.fetchDocument = fetchDocument;
|
|
2392
2470
|
exports.fetchFont = fetchFont;
|
|
2393
2471
|
exports.getFileListByGlobalIndex = getFileListByGlobalIndex;
|
|
2472
|
+
exports.getReportCount = getReportCount;
|
|
2473
|
+
exports.getTotalPage = getTotalPage;
|
|
2474
|
+
exports.getTotalPageOnAllDocuments = getTotalPageOnAllDocuments;
|
|
2475
|
+
exports.sleep = sleep;
|
|
2476
|
+
exports.triggerClickOnAllDocuments = triggerClickOnAllDocuments;
|
|
2477
|
+
exports.triggerCropImageOnAllDocuments = triggerCropImageOnAllDocuments;
|
|
2394
2478
|
exports.useCreateReport = useCreateReport;
|
|
2395
2479
|
exports.useDocumentInfo = useDocumentInfo;
|
|
2396
2480
|
exports.useOzEventListener = useOzEventListener;
|
|
2481
|
+
exports.validateAllDocuments = validateAllDocuments;
|
|
2397
2482
|
exports.wrapperStyle = wrapperStyle;
|
|
2398
2483
|
//# sourceMappingURL=index.cjs.map
|
|
2399
2484
|
//# sourceMappingURL=index.cjs.map
|