@cecee/document-flip-book 1.0.19 → 1.0.21

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.
Files changed (91) hide show
  1. package/dist/cjs/AccountingBook/assets/active-line.png +0 -0
  2. package/dist/cjs/AccountingBook/assets/default-line.png +0 -0
  3. package/dist/cjs/AccountingBook/assets/filp-bg.png +0 -0
  4. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
  5. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.js +398 -0
  6. package/dist/cjs/AccountingBook/components/AccountingVoucher/index.less +231 -0
  7. package/dist/cjs/AccountingBook/components/ExportModal.d.ts +10 -0
  8. package/dist/cjs/AccountingBook/components/ExportModal.js +96 -0
  9. package/dist/cjs/AccountingBook/components/FilpPage.d.ts +7 -0
  10. package/dist/cjs/AccountingBook/components/FilpPage.js +39 -0
  11. package/dist/cjs/AccountingBook/components/HeaderBar.d.ts +28 -0
  12. package/dist/cjs/AccountingBook/components/HeaderBar.js +245 -0
  13. package/dist/cjs/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
  14. package/dist/cjs/AccountingBook/components/ImagePageRenderer.js +91 -0
  15. package/dist/cjs/AccountingBook/components/LoadingComponent.d.ts +7 -0
  16. package/dist/cjs/AccountingBook/components/LoadingComponent.js +54 -0
  17. package/dist/cjs/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
  18. package/dist/cjs/AccountingBook/components/PDFPageRenderer.js +259 -0
  19. package/dist/cjs/AccountingBook/components/index.less +6 -0
  20. package/dist/cjs/AccountingBook/constants.d.ts +11 -0
  21. package/dist/cjs/AccountingBook/constants.js +25 -0
  22. package/dist/cjs/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
  23. package/dist/cjs/AccountingBook/hooks/useAmountSearch.js +165 -0
  24. package/dist/cjs/AccountingBook/hooks/usePageFlip.d.ts +15 -0
  25. package/dist/cjs/AccountingBook/hooks/usePageFlip.js +67 -0
  26. package/dist/cjs/AccountingBook/index.d.ts +29 -1
  27. package/dist/cjs/AccountingBook/index.js +1163 -7
  28. package/dist/cjs/AccountingBook/index.less +188 -0
  29. package/dist/cjs/AccountingBook/types.d.ts +84 -0
  30. package/dist/cjs/AccountingBook/types.js +5 -0
  31. package/dist/cjs/AccountingBook/utils/canvasUtils.d.ts +51 -0
  32. package/dist/cjs/AccountingBook/utils/canvasUtils.js +499 -0
  33. package/dist/cjs/AccountingBook/utils/html.d.ts +9 -0
  34. package/dist/cjs/AccountingBook/utils/html.js +97 -0
  35. package/dist/cjs/AccountingBook/utils/utils.d.ts +38 -0
  36. package/dist/cjs/AccountingBook/utils/utils.js +204 -0
  37. package/dist/cjs/DocumentFlipBook/ExportModal.d.ts +1 -1
  38. package/dist/cjs/DocumentFlipBook/ExportModal.js +1 -1
  39. package/dist/cjs/DocumentFlipBook/HeaderBar.d.ts +2 -1
  40. package/dist/cjs/DocumentFlipBook/HeaderBar.js +13 -11
  41. package/dist/cjs/DocumentFlipBook/SideTabs.js +111 -6
  42. package/dist/cjs/DocumentFlipBook/index.d.ts +1 -0
  43. package/dist/cjs/DocumentFlipBook/index.js +6 -3
  44. package/dist/cjs/DocumentFlipBook/index.less +235 -9
  45. package/dist/cjs/declarations.d.ts +21 -0
  46. package/dist/esm/AccountingBook/assets/active-line.png +0 -0
  47. package/dist/esm/AccountingBook/assets/default-line.png +0 -0
  48. package/dist/esm/AccountingBook/assets/filp-bg.png +0 -0
  49. package/dist/esm/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
  50. package/dist/esm/AccountingBook/components/AccountingVoucher/index.js +391 -0
  51. package/dist/esm/AccountingBook/components/AccountingVoucher/index.less +231 -0
  52. package/dist/esm/AccountingBook/components/ExportModal.d.ts +10 -0
  53. package/dist/esm/AccountingBook/components/ExportModal.js +88 -0
  54. package/dist/esm/AccountingBook/components/FilpPage.d.ts +7 -0
  55. package/dist/esm/AccountingBook/components/FilpPage.js +33 -0
  56. package/dist/esm/AccountingBook/components/HeaderBar.d.ts +28 -0
  57. package/dist/esm/AccountingBook/components/HeaderBar.js +236 -0
  58. package/dist/esm/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
  59. package/dist/esm/AccountingBook/components/ImagePageRenderer.js +85 -0
  60. package/dist/esm/AccountingBook/components/LoadingComponent.d.ts +7 -0
  61. package/dist/esm/AccountingBook/components/LoadingComponent.js +48 -0
  62. package/dist/esm/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
  63. package/dist/esm/AccountingBook/components/PDFPageRenderer.js +252 -0
  64. package/dist/esm/AccountingBook/components/index.less +6 -0
  65. package/dist/esm/AccountingBook/constants.d.ts +11 -0
  66. package/dist/esm/AccountingBook/constants.js +17 -0
  67. package/dist/esm/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
  68. package/dist/esm/AccountingBook/hooks/useAmountSearch.js +158 -0
  69. package/dist/esm/AccountingBook/hooks/usePageFlip.d.ts +15 -0
  70. package/dist/esm/AccountingBook/hooks/usePageFlip.js +61 -0
  71. package/dist/esm/AccountingBook/index.d.ts +29 -1
  72. package/dist/esm/AccountingBook/index.js +1162 -6
  73. package/dist/esm/AccountingBook/index.less +188 -0
  74. package/dist/esm/AccountingBook/types.d.ts +84 -0
  75. package/dist/esm/AccountingBook/types.js +1 -0
  76. package/dist/esm/AccountingBook/utils/canvasUtils.d.ts +51 -0
  77. package/dist/esm/AccountingBook/utils/canvasUtils.js +493 -0
  78. package/dist/esm/AccountingBook/utils/html.d.ts +9 -0
  79. package/dist/esm/AccountingBook/utils/html.js +89 -0
  80. package/dist/esm/AccountingBook/utils/utils.d.ts +38 -0
  81. package/dist/esm/AccountingBook/utils/utils.js +195 -0
  82. package/dist/esm/DocumentFlipBook/ExportModal.d.ts +1 -1
  83. package/dist/esm/DocumentFlipBook/ExportModal.js +1 -1
  84. package/dist/esm/DocumentFlipBook/HeaderBar.d.ts +2 -1
  85. package/dist/esm/DocumentFlipBook/HeaderBar.js +13 -11
  86. package/dist/esm/DocumentFlipBook/SideTabs.js +110 -5
  87. package/dist/esm/DocumentFlipBook/index.d.ts +1 -0
  88. package/dist/esm/DocumentFlipBook/index.js +6 -3
  89. package/dist/esm/DocumentFlipBook/index.less +235 -9
  90. package/dist/esm/declarations.d.ts +21 -0
  91. package/package.json +8 -2
@@ -101,6 +101,7 @@
101
101
 
102
102
  // 偶数页(第 2, 4, 6... 个子元素,对应 Page 1, 3, 5...)是左页 -> 显示左侧厚度
103
103
  &:nth-child(even) {
104
+
104
105
  .dfb-book-thickness-left-1,
105
106
  .dfb-book-thickness-left-2 {
106
107
  display: block;
@@ -109,6 +110,7 @@
109
110
 
110
111
  // 奇数页(第 1, 3, 5... 个子元素,对应 Page 0, 2, 4...)是右页 -> 显示右侧厚度
111
112
  &:nth-child(odd) {
113
+
112
114
  .dfb-book-thickness-right-1,
113
115
  .dfb-book-thickness-right-2 {
114
116
  display: block;
@@ -118,6 +120,10 @@
118
120
 
119
121
  .header-nav-btn {
120
122
  padding: 0 7px;
123
+
124
+ span {
125
+ color: #434343;
126
+ }
121
127
  }
122
128
 
123
129
  .dfb-HTMLFlipBook {
@@ -308,9 +314,32 @@
308
314
  top: 40px;
309
315
  display: flex;
310
316
  flex-direction: column;
311
- gap: 6px; //
317
+ gap: 6px; // 正常间距
312
318
  z-index: 20;
313
319
  transition: all 0.3s ease;
320
+ max-height: calc(100vh - 140px); // 限制最大高度
321
+ padding: 10px 0; // 移除水平内边距
322
+ box-sizing: border-box;
323
+
324
+ // 当标签超过6个时,调整间距让它们重叠
325
+ &.dfb-sideTabs--overlap {
326
+ gap: -10px; // 让标签重叠
327
+
328
+ .dfb-sideTab {
329
+ min-height: 50px; // 进一步减小高度
330
+ padding: 6px 4px 6px 8px; // 更紧凑的内边距
331
+ }
332
+ }
333
+
334
+ // 当标签超过8个时,显示下拉菜单模式
335
+ &.dfb-sideTabs--dropdown {
336
+ gap: 6px; // 正常间距
337
+
338
+ .dfb-sideTab {
339
+ min-height: 60px; // 恢复正常高度
340
+ padding: 8px 4px 8px 8px; // 恢复正常内边距
341
+ }
342
+ }
314
343
 
315
344
  &.is-on-cover {
316
345
  right: -42px; // 封面是单页模式,标签需要向左移动(进入书壳内部边缘)
@@ -319,15 +348,15 @@
319
348
 
320
349
  .dfb-sideTab {
321
350
  width: 42px;
322
- min-height: 80px;
323
- padding: 12px 6px 12px 10px;
351
+ min-height: 60px; // 减小最小高度以容纳更多标签
352
+ padding: 8px 4px 8px 8px; // 优化内边距
324
353
  border: none;
325
354
  border-radius: 0 6px 6px 0;
326
355
  cursor: pointer;
327
356
  color: #fff;
328
- font-size: 13px;
357
+ font-size: 12px; // 稍微减小字体
329
358
  font-weight: 500;
330
- line-height: 1.2;
359
+ line-height: 1.3;
331
360
  writing-mode: vertical-rl;
332
361
  text-align: center;
333
362
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
@@ -337,6 +366,32 @@
337
366
  display: flex;
338
367
  align-items: center;
339
368
  justify-content: center;
369
+ flex-shrink: 0; // 防止标签被压缩
370
+ z-index: 1; // 确保标签层级正确
371
+
372
+ // "更多"按钮特殊样式
373
+ &.dfb-sideTab--more {
374
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
375
+ font-weight: bold;
376
+ animation: pulse 2s infinite;
377
+
378
+
379
+ @keyframes pulse {
380
+
381
+ 0%,
382
+ 100% {
383
+ transform: scale(1);
384
+ }
385
+
386
+ 50% {
387
+ transform: scale(1.05);
388
+ }
389
+ }
390
+
391
+ &:hover {
392
+ background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
393
+ }
394
+ }
340
395
 
341
396
  // 标签左侧的装饰条(仅在选中态或悬浮态显示,模拟折痕)
342
397
  &::before {
@@ -351,7 +406,11 @@
351
406
  opacity: 0;
352
407
  }
353
408
 
354
-
409
+ &:hover:not(.is-active):not(.dfb-sideTab--more) {
410
+ transform: translateX(-3px);
411
+ box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.15);
412
+ z-index: 10;
413
+ }
355
414
 
356
415
  &.is-active {
357
416
  position: relative;
@@ -360,8 +419,8 @@
360
419
  padding-left: 16px;
361
420
  font-weight: 700;
362
421
  box-shadow: 5px 2px 12px rgba(0, 0, 0, 0.2);
363
- z-index: 12;
364
- font-size: 14px;
422
+ z-index: 12; // 确保选中态在最上层
423
+ font-size: 13px;
365
424
 
366
425
  &::before {
367
426
  width: 8px; // 选中态条纹显示且最宽
@@ -371,11 +430,178 @@
371
430
  }
372
431
 
373
432
  .dfb-sideTabText {
374
- letter-spacing: 2px;
433
+ letter-spacing: 1px; // 减小字间距
375
434
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
376
435
  }
377
436
  }
378
437
 
438
+ // 下拉菜单样式
439
+ .dfb-sideTabs__dropdown {
440
+ position: absolute;
441
+ right: 60px;
442
+ top: 0;
443
+ width: 220px;
444
+ max-height: 360px;
445
+ background: #fff;
446
+ border-radius: 12px;
447
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
448
+ z-index: 1000;
449
+ overflow: hidden;
450
+ display: flex;
451
+ flex-direction: column;
452
+ animation: dropdownSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
453
+ backdrop-filter: blur(10px);
454
+
455
+ @keyframes dropdownSlide {
456
+ from {
457
+ opacity: 0;
458
+ transform: translateX(16px) translateY(-8px);
459
+ }
460
+
461
+ to {
462
+ opacity: 1;
463
+ transform: translateX(0) translateY(0);
464
+ }
465
+ }
466
+
467
+ &::before {
468
+ content: "";
469
+ position: absolute;
470
+ right: -8px;
471
+ top: 28px;
472
+ width: 0;
473
+ height: 0;
474
+ border-top: 8px solid transparent;
475
+ border-bottom: 8px solid transparent;
476
+ border-left: 8px solid #fff;
477
+ z-index: 1001;
478
+ filter: drop-shadow(2px 0 3px rgba(0, 0, 0, 0.08));
479
+ }
480
+ }
481
+
482
+ .dfb-sideTabs__dropdown-header {
483
+ display: flex;
484
+ align-items: center;
485
+ justify-content: space-between;
486
+ padding: 8px 10px;
487
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
488
+ color: #fff;
489
+ font-weight: 600;
490
+ font-size: 14px;
491
+ letter-spacing: 0.3px;
492
+ }
493
+
494
+ .dfb-sideTabs__dropdown-close {
495
+ background: rgba(255, 255, 255, 0.18);
496
+ border: none;
497
+ color: #fff;
498
+ width: 24px;
499
+ height: 24px;
500
+ border-radius: 50%;
501
+ cursor: pointer;
502
+ display: flex;
503
+ align-items: center;
504
+ justify-content: center;
505
+ font-size: 12px;
506
+ transition: all 0.2s ease;
507
+
508
+ &:hover {
509
+ background: rgba(255, 255, 255, 0.28);
510
+ transform: rotate(90deg) scale(1.1);
511
+ }
512
+ }
513
+
514
+ .dfb-sideTabs__dropdown-content {
515
+ flex: 1;
516
+ overflow-y: auto;
517
+ padding: 6px 0;
518
+ max-height: 320px;
519
+
520
+ &::-webkit-scrollbar {
521
+ width: 4px;
522
+ }
523
+
524
+ &::-webkit-scrollbar-track {
525
+ background: #f1f1f1;
526
+ border-radius: 2px;
527
+ }
528
+
529
+ &::-webkit-scrollbar-thumb {
530
+ background: #c1c1c1;
531
+ border-radius: 2px;
532
+
533
+ &:hover {
534
+ background: #a1a1a1;
535
+ }
536
+ }
537
+ }
538
+
539
+ .dfb-sideTabs__dropdown-item {
540
+ display: flex;
541
+ align-items: center;
542
+ gap: 10px;
543
+ padding: 10px 16px;
544
+ border: none;
545
+ background: transparent;
546
+ cursor: pointer;
547
+ transition: all 0.2s ease;
548
+ width: 100%;
549
+ text-align: left;
550
+ border-left: 3px solid transparent;
551
+
552
+ &:hover {
553
+ background: #f6f7f8;
554
+ border-left-color: var(--tab-color, #667eea);
555
+ }
556
+
557
+ &.is-active {
558
+ background: rgba(102, 126, 234, 0.06);
559
+ border-left-color: var(--tab-color, #667eea);
560
+
561
+ .dfb-sideTabs__dropdown-item-text {
562
+ color: #1a1a1a;
563
+ font-weight: 600;
564
+ }
565
+
566
+ .dfb-sideTabs__dropdown-item-check {
567
+ display: flex;
568
+ align-items: center;
569
+ justify-content: center;
570
+ width: 18px;
571
+ height: 18px;
572
+ background: var(--tab-color, #667eea);
573
+ border-radius: 50%;
574
+ color: #fff;
575
+ font-size: 10px;
576
+ }
577
+ }
578
+ }
579
+
580
+ .dfb-sideTabs__dropdown-item-color {
581
+ width: 28px;
582
+ height: 28px;
583
+ border-radius: 6px;
584
+ flex-shrink: 0;
585
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
586
+ transition: transform 0.2s ease;
587
+
588
+ &:hover {
589
+ transform: scale(1.08);
590
+ }
591
+ }
592
+
593
+ .dfb-sideTabs__dropdown-item-text {
594
+ flex: 1;
595
+ font-size: 13px;
596
+ color: #333;
597
+ font-weight: 500;
598
+ }
599
+
600
+ .dfb-sideTabs__dropdown-item-check {
601
+ display: none;
602
+ font-size: 12px;
603
+ font-weight: bold;
604
+ }
379
605
  }
380
606
 
381
607
  .is-on-activeTab {
@@ -0,0 +1,21 @@
1
+ declare module '*.png' {
2
+ const value: string;
3
+ export default value;
4
+ }
5
+
6
+ declare module '*.jpg' {
7
+ const value: string;
8
+ export default value;
9
+ }
10
+
11
+ declare module '*.jpeg' {
12
+ const value: string;
13
+ export default value;
14
+ }
15
+
16
+ declare module '*.svg' {
17
+ const value: string;
18
+ export default value;
19
+ }
20
+
21
+ declare module 'react-image-magnifiers';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cecee/document-flip-book",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "A high-performance document flipbook component based on React and Ant Design.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,6 +22,7 @@
22
22
  "license": "ISC",
23
23
  "peerDependencies": {
24
24
  "antd": ">=5.0.0",
25
+ "@ant-design/icons": ">=5.0.0",
25
26
  "dayjs": ">=1.0.0",
26
27
  "html2canvas": ">=1.0.0",
27
28
  "jspdf": ">=2.0.0",
@@ -33,13 +34,18 @@
33
34
  "react-pdf": ">=9.0.0"
34
35
  },
35
36
  "dependencies": {
36
- "jszip": "^3.10.1"
37
+ "jszip": "^3.10.1",
38
+ "moment": "^2.30.1",
39
+ "react-image-magnifiers": "^1.4.0"
37
40
  },
38
41
  "devDependencies": {
39
42
  "@types/jszip": "^3.4.1",
40
43
  "@types/lodash": "^4.14.202",
44
+ "@types/moment": "^2.13.0",
41
45
  "@types/react": "^18.2.48",
42
46
  "@types/react-dom": "^18.2.18",
47
+ "@types/react-image-magnifiers": "^1.3.5",
48
+ "@ant-design/icons": "^5.3.1",
43
49
  "antd": "^5.15.0",
44
50
  "dayjs": "^1.11.10",
45
51
  "esbuild-plugin-less": "^1.3.38",