sales-frontend-bridge 0.0.26 → 0.0.28

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 CHANGED
@@ -2063,6 +2063,18 @@ var NativeBridgeOz = class extends CommonBridge {
2063
2063
  async hideOzPdfViewer() {
2064
2064
  return this.core.callToTarget("hideOzPdfViewer");
2065
2065
  }
2066
+ async showSignatureShortcut() {
2067
+ return this.core.callToTarget("showSignatureShortcut");
2068
+ }
2069
+ async hideSignatureShortcut() {
2070
+ return this.core.callToTarget("hideSignatureShortcut");
2071
+ }
2072
+ async showMissingFieldWarning() {
2073
+ return this.core.callToTarget("showMissingFieldWarning");
2074
+ }
2075
+ async hideMissingFieldWarning() {
2076
+ return this.core.callToTarget("hideMissingFieldWarning");
2077
+ }
2066
2078
  // TODO: 필요 플러그인들 추가
2067
2079
  };
2068
2080
 
@@ -2260,6 +2272,100 @@ function getFileListByGlobalIndex(index, data) {
2260
2272
  }
2261
2273
  return null;
2262
2274
  }
2275
+ async function getReportCount() {
2276
+ const { data } = await Bridge.nativeOz.getInformation({ command: "REPORT_COUNT" });
2277
+ return Number(data);
2278
+ }
2279
+ async function enableFocusOnValidation(reportCount) {
2280
+ const count = reportCount ?? await getReportCount();
2281
+ for (let i = 0; i < count; i++) {
2282
+ await sleep();
2283
+ await Bridge.nativeOz.setGlobal({ key: "chkFlag", value: "1", docIndex: i });
2284
+ }
2285
+ return;
2286
+ }
2287
+ async function disableFocusOnValidation(reportCount) {
2288
+ const count = reportCount ?? await getReportCount();
2289
+ for (let i = 0; i < count; i++) {
2290
+ await sleep();
2291
+ await Bridge.nativeOz.setGlobal({ key: "chkFlag", value: "0", docIndex: i });
2292
+ }
2293
+ return;
2294
+ }
2295
+ async function sleep(ms = 10) {
2296
+ return new Promise((resolve) => setTimeout(resolve, ms));
2297
+ }
2298
+ async function triggerClickOnAllDocuments(reportCount) {
2299
+ const count = reportCount ?? await getReportCount();
2300
+ for (let i = 0; i < count; i++) {
2301
+ await sleep();
2302
+ const command = `INPUT_TRIGGER_CLICK_AT=${i}`;
2303
+ await Bridge.nativeOz.getInformation({ command });
2304
+ }
2305
+ }
2306
+ async function triggerCropImageOnAllDocuments(reportCount) {
2307
+ const count = reportCount ?? await getReportCount();
2308
+ for (let i = 0; i < count; i++) {
2309
+ await sleep();
2310
+ await Bridge.nativeOz.triggerExternalEventByDocIndex({ docIndex: Number(i), param1: "cropimage" });
2311
+ }
2312
+ }
2313
+ async function getTotalPageOnAllDocuments(reportCount) {
2314
+ const count = reportCount ?? await getReportCount();
2315
+ const totalPages = [];
2316
+ for (let i = 0; i < count; i++) {
2317
+ await sleep();
2318
+ const command = `TOTAL_PAGE_OF_REPORT_FILE_AT=${i}`;
2319
+ const { data } = await Bridge.nativeOz.getInformation({ command });
2320
+ totalPages.push(Number(data));
2321
+ }
2322
+ return totalPages;
2323
+ }
2324
+ async function checkDocumentsValidityByIndex(indexList) {
2325
+ const VALID = "";
2326
+ for (let i = 0; i < indexList.length; i++) {
2327
+ await sleep();
2328
+ const command = `INVALID_INFO_JSON_AT=${indexList[i]}`;
2329
+ const { data } = await Bridge.nativeOz.getInformation({ command });
2330
+ if (data !== VALID) {
2331
+ return false;
2332
+ }
2333
+ }
2334
+ return true;
2335
+ }
2336
+ async function validatePages(pageList) {
2337
+ const VALID = "valid";
2338
+ for (let i = 0; i < pageList.length; i++) {
2339
+ await sleep();
2340
+ const command = `INPUT_CHECK_VALIDITY_PAGE_AT=${pageList[i]}`;
2341
+ const { data } = await Bridge.nativeOz.getInformation({ command });
2342
+ if (data !== VALID) {
2343
+ return false;
2344
+ }
2345
+ }
2346
+ return true;
2347
+ }
2348
+ async function validateAllDocuments(reportCount) {
2349
+ const VALID = "valid";
2350
+ const count = reportCount ?? await getReportCount();
2351
+ for (let i = 0; i < count; i++) {
2352
+ await sleep();
2353
+ const command = `INPUT_CHECK_VALIDITY_AT=${i}`;
2354
+ const { data } = await Bridge.nativeOz.getInformation({ command });
2355
+ if (data !== VALID) {
2356
+ return false;
2357
+ }
2358
+ }
2359
+ return true;
2360
+ }
2361
+ async function getTotalPage() {
2362
+ const { data } = await Bridge.nativeOz.getInformation({ command: "TOTAL_PAGE" });
2363
+ return Number(data);
2364
+ }
2365
+ async function getCurrentPage() {
2366
+ const { data } = await Bridge.nativeOz.getInformation({ command: `CURRENT_PAGE` });
2367
+ return Number(data);
2368
+ }
2263
2369
 
2264
2370
  // src/oz/use-create-report.ts
2265
2371
  function useCreateReport({ documentList, extraData = {} }) {
@@ -2385,15 +2491,27 @@ exports.Bridge = Bridge;
2385
2491
  exports.OZViewerEvent = OZViewerEvent;
2386
2492
  exports.btnStyle = btnStyle;
2387
2493
  exports.categorizeByPageRange = categorizeByPageRange;
2494
+ exports.checkDocumentsValidityByIndex = checkDocumentsValidityByIndex;
2388
2495
  exports.commonOzParam = commonOzParam;
2389
2496
  exports.commonPdfExportParam = commonPdfExportParam;
2497
+ exports.disableFocusOnValidation = disableFocusOnValidation;
2498
+ exports.enableFocusOnValidation = enableFocusOnValidation;
2390
2499
  exports.extractFileName = extractFileName;
2391
2500
  exports.fetchDocument = fetchDocument;
2392
2501
  exports.fetchFont = fetchFont;
2502
+ exports.getCurrentPage = getCurrentPage;
2393
2503
  exports.getFileListByGlobalIndex = getFileListByGlobalIndex;
2504
+ exports.getReportCount = getReportCount;
2505
+ exports.getTotalPage = getTotalPage;
2506
+ exports.getTotalPageOnAllDocuments = getTotalPageOnAllDocuments;
2507
+ exports.sleep = sleep;
2508
+ exports.triggerClickOnAllDocuments = triggerClickOnAllDocuments;
2509
+ exports.triggerCropImageOnAllDocuments = triggerCropImageOnAllDocuments;
2394
2510
  exports.useCreateReport = useCreateReport;
2395
2511
  exports.useDocumentInfo = useDocumentInfo;
2396
2512
  exports.useOzEventListener = useOzEventListener;
2513
+ exports.validateAllDocuments = validateAllDocuments;
2514
+ exports.validatePages = validatePages;
2397
2515
  exports.wrapperStyle = wrapperStyle;
2398
2516
  //# sourceMappingURL=index.cjs.map
2399
2517
  //# sourceMappingURL=index.cjs.map