limitng 0.22.26 → 0.22.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.
Files changed (377) hide show
  1. package/fesm2022/limitng-alt-buyuk-kart.mjs +191 -37
  2. package/fesm2022/limitng-alt-buyuk-kart.mjs.map +1 -1
  3. package/fesm2022/limitng-alt-kucuk-kart.mjs +157 -32
  4. package/fesm2022/limitng-alt-kucuk-kart.mjs.map +1 -1
  5. package/fesm2022/limitng-api-models-bildirimler.mjs +41 -45
  6. package/fesm2022/limitng-api-models-bildirimler.mjs.map +1 -1
  7. package/fesm2022/limitng-api-models-enums.mjs +345 -350
  8. package/fesm2022/limitng-api-models-enums.mjs.map +1 -1
  9. package/fesm2022/limitng-api-models-fourDConstants.mjs +84 -88
  10. package/fesm2022/limitng-api-models-fourDConstants.mjs.map +1 -1
  11. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izindetaylari.mjs +25 -30
  12. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izindetaylari.mjs.map +1 -1
  13. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinfiltre.mjs +17 -22
  14. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinfiltre.mjs.map +1 -1
  15. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinguncelle.mjs +0 -4
  16. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinliste.mjs +28 -32
  17. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinliste.mjs.map +1 -1
  18. package/fesm2022/limitng-api-models-kisisel-izinislemleri.mjs +1 -5
  19. package/fesm2022/limitng-api-models-kisisel-izinislemleri.mjs.map +1 -1
  20. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafdetaylari.mjs +61 -66
  21. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafdetaylari.mjs.map +1 -1
  22. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masraffiltre.mjs +18 -23
  23. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masraffiltre.mjs.map +1 -1
  24. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafguncelle.mjs +0 -4
  25. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafliste.mjs +47 -51
  26. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafliste.mjs.map +1 -1
  27. package/fesm2022/limitng-api-models-kisisel-masrafislemleri.mjs +1 -5
  28. package/fesm2022/limitng-api-models-kisisel-masrafislemleri.mjs.map +1 -1
  29. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onaydetaylari.mjs +47 -51
  30. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onaydetaylari.mjs.map +1 -1
  31. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayfiltre.mjs +37 -42
  32. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayfiltre.mjs.map +1 -1
  33. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayguncelle.mjs +11 -15
  34. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayguncelle.mjs.map +1 -1
  35. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayliste.mjs +37 -41
  36. package/fesm2022/limitng-api-models-kisisel-onayislemleri-onayliste.mjs.map +1 -1
  37. package/fesm2022/limitng-api-models-kisisel-onayislemleri.mjs +1 -5
  38. package/fesm2022/limitng-api-models-kisisel-onayislemleri.mjs.map +1 -1
  39. package/fesm2022/limitng-api-models-kisisel.mjs +1 -5
  40. package/fesm2022/limitng-api-models-kisisel.mjs.map +1 -1
  41. package/fesm2022/limitng-api-models-logbook.mjs +130 -135
  42. package/fesm2022/limitng-api-models-logbook.mjs.map +1 -1
  43. package/fesm2022/limitng-api-models-login.mjs +61 -79
  44. package/fesm2022/limitng-api-models-login.mjs.map +1 -1
  45. package/fesm2022/limitng-api-models-onay-onayagonderdetaylari.mjs +57 -61
  46. package/fesm2022/limitng-api-models-onay-onayagonderdetaylari.mjs.map +1 -1
  47. package/fesm2022/limitng-api-models-onay-onaybilgi.mjs +0 -4
  48. package/fesm2022/limitng-api-models-onay.mjs +1 -5
  49. package/fesm2022/limitng-api-models-onay.mjs.map +1 -1
  50. package/fesm2022/limitng-api-models-ortak.mjs +169 -178
  51. package/fesm2022/limitng-api-models-ortak.mjs.map +1 -1
  52. package/fesm2022/limitng-api-models-ozet-ozetdata.mjs +0 -4
  53. package/fesm2022/limitng-api-models-ozet-ozetkartalan.mjs +0 -4
  54. package/fesm2022/limitng-api-models-ozet.mjs +1 -5
  55. package/fesm2022/limitng-api-models-ozet.mjs.map +1 -1
  56. package/fesm2022/limitng-api-models-raporlar-izinraporu-izinrapordetaylari.mjs +9 -13
  57. package/fesm2022/limitng-api-models-raporlar-izinraporu-izinrapordetaylari.mjs.map +1 -1
  58. package/fesm2022/limitng-api-models-raporlar-izinraporu-izinraporliste.mjs +21 -26
  59. package/fesm2022/limitng-api-models-raporlar-izinraporu-izinraporliste.mjs.map +1 -1
  60. package/fesm2022/limitng-api-models-raporlar-izinraporu.mjs +1 -5
  61. package/fesm2022/limitng-api-models-raporlar-izinraporu.mjs.map +1 -1
  62. package/fesm2022/limitng-api-models-raporlar-listedensec.mjs +32 -30
  63. package/fesm2022/limitng-api-models-raporlar-listedensec.mjs.map +1 -1
  64. package/fesm2022/limitng-api-models-raporlar-rapordetaylari.mjs +75 -79
  65. package/fesm2022/limitng-api-models-raporlar-rapordetaylari.mjs.map +1 -1
  66. package/fesm2022/limitng-api-models-raporlar-raporzamanlama.mjs +43 -47
  67. package/fesm2022/limitng-api-models-raporlar-raporzamanlama.mjs.map +1 -1
  68. package/fesm2022/limitng-api-models-raporlar-tablodansec.mjs +22 -26
  69. package/fesm2022/limitng-api-models-raporlar-tablodansec.mjs.map +1 -1
  70. package/fesm2022/limitng-api-models-raporlar.mjs +1 -5
  71. package/fesm2022/limitng-api-models-raporlar.mjs.map +1 -1
  72. package/fesm2022/limitng-api-models-sistemozet.mjs +192 -196
  73. package/fesm2022/limitng-api-models-sistemozet.mjs.map +1 -1
  74. package/fesm2022/limitng-api-models-sistemraporlari.mjs +9 -14
  75. package/fesm2022/limitng-api-models-sistemraporlari.mjs.map +1 -1
  76. package/fesm2022/limitng-api-models-timeSheet-timeSheetGirisListeler.mjs +315 -320
  77. package/fesm2022/limitng-api-models-timeSheet-timeSheetGirisListeler.mjs.map +1 -1
  78. package/fesm2022/limitng-api-models-timeSheet-timeSheetLog.mjs +15 -19
  79. package/fesm2022/limitng-api-models-timeSheet-timeSheetLog.mjs.map +1 -1
  80. package/fesm2022/limitng-api-models-timeSheet-timeSheetOzetListe.mjs +24 -29
  81. package/fesm2022/limitng-api-models-timeSheet-timeSheetOzetListe.mjs.map +1 -1
  82. package/fesm2022/limitng-api-models-timeSheet-timeSheetSecenekler.mjs +32 -36
  83. package/fesm2022/limitng-api-models-timeSheet-timeSheetSecenekler.mjs.map +1 -1
  84. package/fesm2022/limitng-api-models-timeSheet.mjs +1 -5
  85. package/fesm2022/limitng-api-models-timeSheet.mjs.map +1 -1
  86. package/fesm2022/limitng-api-models-xl-xlConfig.mjs +379 -420
  87. package/fesm2022/limitng-api-models-xl-xlConfig.mjs.map +1 -1
  88. package/fesm2022/limitng-api-models-xl-xlConstants.mjs +60 -64
  89. package/fesm2022/limitng-api-models-xl-xlConstants.mjs.map +1 -1
  90. package/fesm2022/limitng-api-models-xl-xlOptions.mjs +35 -39
  91. package/fesm2022/limitng-api-models-xl-xlOptions.mjs.map +1 -1
  92. package/fesm2022/limitng-api-models-xl-xlTools.mjs +3 -8
  93. package/fesm2022/limitng-api-models-xl-xlTools.mjs.map +1 -1
  94. package/fesm2022/limitng-api-models-xl.mjs +1 -5
  95. package/fesm2022/limitng-api-models-xl.mjs.map +1 -1
  96. package/fesm2022/limitng-api-models.mjs +1 -5
  97. package/fesm2022/limitng-api-models.mjs.map +1 -1
  98. package/fesm2022/limitng-api.mjs +724 -846
  99. package/fesm2022/limitng-api.mjs.map +1 -1
  100. package/fesm2022/limitng-blob-response-handler.mjs +1000 -1205
  101. package/fesm2022/limitng-blob-response-handler.mjs.map +1 -1
  102. package/fesm2022/limitng-dikey-baslikli-panel-sol.mjs +121 -27
  103. package/fesm2022/limitng-dikey-baslikli-panel-sol.mjs.map +1 -1
  104. package/fesm2022/limitng-dikey-baslikli-panel.mjs +121 -27
  105. package/fesm2022/limitng-dikey-baslikli-panel.mjs.map +1 -1
  106. package/fesm2022/limitng-directives-adAlani.directive.mjs +100 -83
  107. package/fesm2022/limitng-directives-adAlani.directive.mjs.map +1 -1
  108. package/fesm2022/limitng-directives-adresAlani.directive.mjs +101 -84
  109. package/fesm2022/limitng-directives-adresAlani.directive.mjs.map +1 -1
  110. package/fesm2022/limitng-directives-buyukHarf.directive.mjs +83 -69
  111. package/fesm2022/limitng-directives-buyukHarf.directive.mjs.map +1 -1
  112. package/fesm2022/limitng-directives-ciftBoslukTek.directive.mjs +83 -69
  113. package/fesm2022/limitng-directives-ciftBoslukTek.directive.mjs.map +1 -1
  114. package/fesm2022/limitng-directives-dirty.directive.mjs +70 -34
  115. package/fesm2022/limitng-directives-dirty.directive.mjs.map +1 -1
  116. package/fesm2022/limitng-directives-disable.directive.mjs +289 -155
  117. package/fesm2022/limitng-directives-disable.directive.mjs.map +1 -1
  118. package/fesm2022/limitng-directives-flexBasis.directive.mjs +187 -63
  119. package/fesm2022/limitng-directives-flexBasis.directive.mjs.map +1 -1
  120. package/fesm2022/limitng-directives-ilkHarfBuyuk.directive.mjs +83 -69
  121. package/fesm2022/limitng-directives-ilkHarfBuyuk.directive.mjs.map +1 -1
  122. package/fesm2022/limitng-directives-imleciBasaAl.directive.mjs +56 -45
  123. package/fesm2022/limitng-directives-imleciBasaAl.directive.mjs.map +1 -1
  124. package/fesm2022/limitng-directives-kodAlani.directive.mjs +106 -93
  125. package/fesm2022/limitng-directives-kodAlani.directive.mjs.map +1 -1
  126. package/fesm2022/limitng-directives-maksimumUzunluk.directive.mjs +106 -71
  127. package/fesm2022/limitng-directives-maksimumUzunluk.directive.mjs.map +1 -1
  128. package/fesm2022/limitng-directives-okTuslariylaIcerdeGezin.directive.mjs +44 -28
  129. package/fesm2022/limitng-directives-okTuslariylaIcerdeGezin.directive.mjs.map +1 -1
  130. package/fesm2022/limitng-directives-sagSolBoslukSil.directive.mjs +82 -68
  131. package/fesm2022/limitng-directives-sagSolBoslukSil.directive.mjs.map +1 -1
  132. package/fesm2022/limitng-directives-standartAlan.directive.mjs +100 -83
  133. package/fesm2022/limitng-directives-standartAlan.directive.mjs.map +1 -1
  134. package/fesm2022/limitng-directives-sutunGenisligi.directive.mjs +255 -96
  135. package/fesm2022/limitng-directives-sutunGenisligi.directive.mjs.map +1 -1
  136. package/fesm2022/limitng-directives-translate-key.directive.ts.mjs +52 -37
  137. package/fesm2022/limitng-directives-translate-key.directive.ts.mjs.map +1 -1
  138. package/fesm2022/limitng-directives-tumBoslukSil.directive.mjs +83 -69
  139. package/fesm2022/limitng-directives-tumBoslukSil.directive.mjs.map +1 -1
  140. package/fesm2022/limitng-directives-tumIlkHarfBuyuk.directive.mjs +93 -70
  141. package/fesm2022/limitng-directives-tumIlkHarfBuyuk.directive.mjs.map +1 -1
  142. package/fesm2022/limitng-directives.mjs +1747 -1046
  143. package/fesm2022/limitng-directives.mjs.map +1 -1
  144. package/fesm2022/limitng-filtre-bar.mjs +241 -90
  145. package/fesm2022/limitng-filtre-bar.mjs.map +1 -1
  146. package/fesm2022/limitng-geri-ileri-detay.mjs +335 -229
  147. package/fesm2022/limitng-geri-ileri-detay.mjs.map +1 -1
  148. package/fesm2022/limitng-geri-ileri-liste.mjs +382 -281
  149. package/fesm2022/limitng-geri-ileri-liste.mjs.map +1 -1
  150. package/fesm2022/limitng-pipes-ayAdiPipe.mjs +54 -40
  151. package/fesm2022/limitng-pipes-ayAdiPipe.mjs.map +1 -1
  152. package/fesm2022/limitng-pipes-boolToPlus.pipe.mjs +42 -23
  153. package/fesm2022/limitng-pipes-boolToPlus.pipe.mjs.map +1 -1
  154. package/fesm2022/limitng-pipes-boolToPlusMinus.pipe.mjs +42 -23
  155. package/fesm2022/limitng-pipes-boolToPlusMinus.pipe.mjs.map +1 -1
  156. package/fesm2022/limitng-pipes-dateToText.pipe.mjs +43 -24
  157. package/fesm2022/limitng-pipes-dateToText.pipe.mjs.map +1 -1
  158. package/fesm2022/limitng-pipes-evetHayir.pipe.mjs +50 -33
  159. package/fesm2022/limitng-pipes-evetHayir.pipe.mjs.map +1 -1
  160. package/fesm2022/limitng-pipes-global-filter-formatter.pipe.mjs +51 -36
  161. package/fesm2022/limitng-pipes-global-filter-formatter.pipe.mjs.map +1 -1
  162. package/fesm2022/limitng-pipes-mecraTuru.pipe.mjs +43 -24
  163. package/fesm2022/limitng-pipes-mecraTuru.pipe.mjs.map +1 -1
  164. package/fesm2022/limitng-pipes-safe.pipe.mjs +53 -34
  165. package/fesm2022/limitng-pipes-safe.pipe.mjs.map +1 -1
  166. package/fesm2022/limitng-pipes-toSeverity.pipe.mjs +50 -30
  167. package/fesm2022/limitng-pipes-toSeverity.pipe.mjs.map +1 -1
  168. package/fesm2022/limitng-pipes-tooltip-formatter.pipe.mjs +56 -47
  169. package/fesm2022/limitng-pipes-tooltip-formatter.pipe.mjs.map +1 -1
  170. package/fesm2022/limitng-pipes.mjs +1 -5
  171. package/fesm2022/limitng-pipes.mjs.map +1 -1
  172. package/fesm2022/limitng-rapor-kart-models.mjs +18 -23
  173. package/fesm2022/limitng-rapor-kart-models.mjs.map +1 -1
  174. package/fesm2022/limitng-rapor-kart.mjs +215 -58
  175. package/fesm2022/limitng-rapor-kart.mjs.map +1 -1
  176. package/fesm2022/limitng-sol-buyuk-kart.mjs +184 -37
  177. package/fesm2022/limitng-sol-buyuk-kart.mjs.map +1 -1
  178. package/fesm2022/limitng-sol-kucuk-kart.mjs +150 -32
  179. package/fesm2022/limitng-sol-kucuk-kart.mjs.map +1 -1
  180. package/fesm2022/limitng-yatay-baslikli-panel.mjs +231 -49
  181. package/fesm2022/limitng-yatay-baslikli-panel.mjs.map +1 -1
  182. package/fesm2022/limitng.mjs +6 -11
  183. package/package.json +1 -1
  184. package/types/limitng-alt-buyuk-kart.d.ts +48 -20
  185. package/types/limitng-alt-buyuk-kart.d.ts.map +1 -1
  186. package/types/limitng-alt-kucuk-kart.d.ts +43 -15
  187. package/types/limitng-alt-kucuk-kart.d.ts.map +1 -1
  188. package/types/limitng-api-models-bildirimler.d.ts +29 -32
  189. package/types/limitng-api-models-bildirimler.d.ts.map +1 -1
  190. package/types/limitng-api-models-enums.d.ts +389 -391
  191. package/types/limitng-api-models-enums.d.ts.map +1 -1
  192. package/types/limitng-api-models-fourDConstants.d.ts +83 -85
  193. package/types/limitng-api-models-fourDConstants.d.ts.map +1 -1
  194. package/types/limitng-api-models-kisisel-izinislemleri-izindetaylari.d.ts +23 -27
  195. package/types/limitng-api-models-kisisel-izinislemleri-izindetaylari.d.ts.map +1 -1
  196. package/types/limitng-api-models-kisisel-izinislemleri-izinfiltre.d.ts +10 -13
  197. package/types/limitng-api-models-kisisel-izinislemleri-izinfiltre.d.ts.map +1 -1
  198. package/types/limitng-api-models-kisisel-izinislemleri-izinguncelle.d.ts +5 -8
  199. package/types/limitng-api-models-kisisel-izinislemleri-izinguncelle.d.ts.map +1 -1
  200. package/types/limitng-api-models-kisisel-izinislemleri-izinliste.d.ts +24 -27
  201. package/types/limitng-api-models-kisisel-izinislemleri-izinliste.d.ts.map +1 -1
  202. package/types/limitng-api-models-kisisel-izinislemleri.d.ts +3 -3
  203. package/types/limitng-api-models-kisisel-izinislemleri.d.ts.map +1 -1
  204. package/types/limitng-api-models-kisisel-masrafislemleri-masrafdetaylari.d.ts +57 -61
  205. package/types/limitng-api-models-kisisel-masrafislemleri-masrafdetaylari.d.ts.map +1 -1
  206. package/types/limitng-api-models-kisisel-masrafislemleri-masraffiltre.d.ts +11 -14
  207. package/types/limitng-api-models-kisisel-masrafislemleri-masraffiltre.d.ts.map +1 -1
  208. package/types/limitng-api-models-kisisel-masrafislemleri-masrafguncelle.d.ts +6 -9
  209. package/types/limitng-api-models-kisisel-masrafislemleri-masrafguncelle.d.ts.map +1 -1
  210. package/types/limitng-api-models-kisisel-masrafislemleri-masrafliste.d.ts +70 -74
  211. package/types/limitng-api-models-kisisel-masrafislemleri-masrafliste.d.ts.map +1 -1
  212. package/types/limitng-api-models-kisisel-masrafislemleri.d.ts +3 -3
  213. package/types/limitng-api-models-kisisel-masrafislemleri.d.ts.map +1 -1
  214. package/types/limitng-api-models-kisisel-onayislemleri-onaydetaylari.d.ts +71 -74
  215. package/types/limitng-api-models-kisisel-onayislemleri-onaydetaylari.d.ts.map +1 -1
  216. package/types/limitng-api-models-kisisel-onayislemleri-onayfiltre.d.ts +30 -33
  217. package/types/limitng-api-models-kisisel-onayislemleri-onayfiltre.d.ts.map +1 -1
  218. package/types/limitng-api-models-kisisel-onayislemleri-onayguncelle.d.ts +7 -9
  219. package/types/limitng-api-models-kisisel-onayislemleri-onayguncelle.d.ts.map +1 -1
  220. package/types/limitng-api-models-kisisel-onayislemleri-onayliste.d.ts +30 -32
  221. package/types/limitng-api-models-kisisel-onayislemleri-onayliste.d.ts.map +1 -1
  222. package/types/limitng-api-models-kisisel-onayislemleri.d.ts +3 -3
  223. package/types/limitng-api-models-kisisel-onayislemleri.d.ts.map +1 -1
  224. package/types/limitng-api-models-kisisel.d.ts +3 -3
  225. package/types/limitng-api-models-kisisel.d.ts.map +1 -1
  226. package/types/limitng-api-models-logbook.d.ts +100 -103
  227. package/types/limitng-api-models-logbook.d.ts.map +1 -1
  228. package/types/limitng-api-models-login.d.ts +52 -55
  229. package/types/limitng-api-models-login.d.ts.map +1 -1
  230. package/types/limitng-api-models-onay-onayagonderdetaylari.d.ts +61 -65
  231. package/types/limitng-api-models-onay-onayagonderdetaylari.d.ts.map +1 -1
  232. package/types/limitng-api-models-onay-onaybilgi.d.ts +3 -5
  233. package/types/limitng-api-models-onay-onaybilgi.d.ts.map +1 -1
  234. package/types/limitng-api-models-onay.d.ts +3 -3
  235. package/types/limitng-api-models-onay.d.ts.map +1 -1
  236. package/types/limitng-api-models-ortak.d.ts +240 -244
  237. package/types/limitng-api-models-ortak.d.ts.map +1 -1
  238. package/types/limitng-api-models-ozet-ozetdata.d.ts +16 -19
  239. package/types/limitng-api-models-ozet-ozetdata.d.ts.map +1 -1
  240. package/types/limitng-api-models-ozet-ozetkartalan.d.ts +11 -13
  241. package/types/limitng-api-models-ozet-ozetkartalan.d.ts.map +1 -1
  242. package/types/limitng-api-models-ozet.d.ts +3 -3
  243. package/types/limitng-api-models-ozet.d.ts.map +1 -1
  244. package/types/limitng-api-models-raporlar-izinraporu-izinrapordetaylari.d.ts +13 -16
  245. package/types/limitng-api-models-raporlar-izinraporu-izinrapordetaylari.d.ts.map +1 -1
  246. package/types/limitng-api-models-raporlar-izinraporu-izinraporliste.d.ts +14 -17
  247. package/types/limitng-api-models-raporlar-izinraporu-izinraporliste.d.ts.map +1 -1
  248. package/types/limitng-api-models-raporlar-izinraporu.d.ts +3 -3
  249. package/types/limitng-api-models-raporlar-izinraporu.d.ts.map +1 -1
  250. package/types/limitng-api-models-raporlar-listedensec.d.ts +21 -24
  251. package/types/limitng-api-models-raporlar-listedensec.d.ts.map +1 -1
  252. package/types/limitng-api-models-raporlar-rapordetaylari.d.ts +53 -55
  253. package/types/limitng-api-models-raporlar-rapordetaylari.d.ts.map +1 -1
  254. package/types/limitng-api-models-raporlar-raporzamanlama.d.ts +41 -44
  255. package/types/limitng-api-models-raporlar-raporzamanlama.d.ts.map +1 -1
  256. package/types/limitng-api-models-raporlar-tablodansec.d.ts +23 -26
  257. package/types/limitng-api-models-raporlar-tablodansec.d.ts.map +1 -1
  258. package/types/limitng-api-models-raporlar.d.ts +3 -3
  259. package/types/limitng-api-models-raporlar.d.ts.map +1 -1
  260. package/types/limitng-api-models-sistemozet.d.ts +169 -173
  261. package/types/limitng-api-models-sistemozet.d.ts.map +1 -1
  262. package/types/limitng-api-models-sistemraporlari.d.ts +9 -13
  263. package/types/limitng-api-models-sistemraporlari.d.ts.map +1 -1
  264. package/types/limitng-api-models-timeSheet-timeSheetGirisListeler.d.ts +295 -299
  265. package/types/limitng-api-models-timeSheet-timeSheetGirisListeler.d.ts.map +1 -1
  266. package/types/limitng-api-models-timeSheet-timeSheetLog.d.ts +12 -15
  267. package/types/limitng-api-models-timeSheet-timeSheetLog.d.ts.map +1 -1
  268. package/types/limitng-api-models-timeSheet-timeSheetOzetListe.d.ts +17 -20
  269. package/types/limitng-api-models-timeSheet-timeSheetOzetListe.d.ts.map +1 -1
  270. package/types/limitng-api-models-timeSheet-timeSheetSecenekler.d.ts +28 -30
  271. package/types/limitng-api-models-timeSheet-timeSheetSecenekler.d.ts.map +1 -1
  272. package/types/limitng-api-models-timeSheet.d.ts +3 -3
  273. package/types/limitng-api-models-timeSheet.d.ts.map +1 -1
  274. package/types/limitng-api-models-xl-xlConfig.d.ts +196 -199
  275. package/types/limitng-api-models-xl-xlConfig.d.ts.map +1 -1
  276. package/types/limitng-api-models-xl-xlConstants.d.ts +59 -61
  277. package/types/limitng-api-models-xl-xlConstants.d.ts.map +1 -1
  278. package/types/limitng-api-models-xl-xlOptions.d.ts +23 -26
  279. package/types/limitng-api-models-xl-xlOptions.d.ts.map +1 -1
  280. package/types/limitng-api-models-xl-xlTools.d.ts +2 -5
  281. package/types/limitng-api-models-xl-xlTools.d.ts.map +1 -1
  282. package/types/limitng-api-models-xl.d.ts +3 -3
  283. package/types/limitng-api-models-xl.d.ts.map +1 -1
  284. package/types/limitng-api-models.d.ts +3 -3
  285. package/types/limitng-api-models.d.ts.map +1 -1
  286. package/types/limitng-api.d.ts +65 -68
  287. package/types/limitng-api.d.ts.map +1 -1
  288. package/types/limitng-blob-response-handler.d.ts +285 -291
  289. package/types/limitng-blob-response-handler.d.ts.map +1 -1
  290. package/types/limitng-dikey-baslikli-panel-sol.d.ts +30 -12
  291. package/types/limitng-dikey-baslikli-panel-sol.d.ts.map +1 -1
  292. package/types/limitng-dikey-baslikli-panel.d.ts +30 -12
  293. package/types/limitng-dikey-baslikli-panel.d.ts.map +1 -1
  294. package/types/limitng-directives-adAlani.directive.d.ts +26 -27
  295. package/types/limitng-directives-adAlani.directive.d.ts.map +1 -1
  296. package/types/limitng-directives-adresAlani.directive.d.ts +26 -27
  297. package/types/limitng-directives-adresAlani.directive.d.ts.map +1 -1
  298. package/types/limitng-directives-buyukHarf.directive.d.ts +24 -25
  299. package/types/limitng-directives-buyukHarf.directive.d.ts.map +1 -1
  300. package/types/limitng-directives-ciftBoslukTek.directive.d.ts +24 -25
  301. package/types/limitng-directives-ciftBoslukTek.directive.d.ts.map +1 -1
  302. package/types/limitng-directives-dirty.directive.d.ts +15 -12
  303. package/types/limitng-directives-dirty.directive.d.ts.map +1 -1
  304. package/types/limitng-directives-disable.directive.d.ts +40 -38
  305. package/types/limitng-directives-disable.directive.d.ts.map +1 -1
  306. package/types/limitng-directives-flexBasis.directive.d.ts +39 -24
  307. package/types/limitng-directives-flexBasis.directive.d.ts.map +1 -1
  308. package/types/limitng-directives-ilkHarfBuyuk.directive.d.ts +24 -25
  309. package/types/limitng-directives-ilkHarfBuyuk.directive.d.ts.map +1 -1
  310. package/types/limitng-directives-imleciBasaAl.directive.d.ts +11 -14
  311. package/types/limitng-directives-imleciBasaAl.directive.d.ts.map +1 -1
  312. package/types/limitng-directives-kodAlani.directive.d.ts +26 -29
  313. package/types/limitng-directives-kodAlani.directive.d.ts.map +1 -1
  314. package/types/limitng-directives-maksimumUzunluk.directive.d.ts +31 -26
  315. package/types/limitng-directives-maksimumUzunluk.directive.d.ts.map +1 -1
  316. package/types/limitng-directives-okTuslariylaIcerdeGezin.directive.d.ts +6 -9
  317. package/types/limitng-directives-okTuslariylaIcerdeGezin.directive.d.ts.map +1 -1
  318. package/types/limitng-directives-sagSolBoslukSil.directive.d.ts +24 -25
  319. package/types/limitng-directives-sagSolBoslukSil.directive.d.ts.map +1 -1
  320. package/types/limitng-directives-standartAlan.directive.d.ts +26 -27
  321. package/types/limitng-directives-standartAlan.directive.d.ts.map +1 -1
  322. package/types/limitng-directives-sutunGenisligi.directive.d.ts +53 -32
  323. package/types/limitng-directives-sutunGenisligi.directive.d.ts.map +1 -1
  324. package/types/limitng-directives-translate-key.directive.ts.d.ts +9 -12
  325. package/types/limitng-directives-translate-key.directive.ts.d.ts.map +1 -1
  326. package/types/limitng-directives-tumBoslukSil.directive.d.ts +24 -25
  327. package/types/limitng-directives-tumBoslukSil.directive.d.ts.map +1 -1
  328. package/types/limitng-directives-tumIlkHarfBuyuk.directive.d.ts +26 -26
  329. package/types/limitng-directives-tumIlkHarfBuyuk.directive.d.ts.map +1 -1
  330. package/types/limitng-directives.d.ts +386 -323
  331. package/types/limitng-directives.d.ts.map +1 -1
  332. package/types/limitng-filtre-bar.d.ts +55 -30
  333. package/types/limitng-filtre-bar.d.ts.map +1 -1
  334. package/types/limitng-geri-ileri-detay.d.ts +59 -57
  335. package/types/limitng-geri-ileri-detay.d.ts.map +1 -1
  336. package/types/limitng-geri-ileri-liste.d.ts +66 -64
  337. package/types/limitng-geri-ileri-liste.d.ts.map +1 -1
  338. package/types/limitng-pipes-ayAdiPipe.d.ts +8 -11
  339. package/types/limitng-pipes-ayAdiPipe.d.ts.map +1 -1
  340. package/types/limitng-pipes-boolToPlus.pipe.d.ts +7 -10
  341. package/types/limitng-pipes-boolToPlus.pipe.d.ts.map +1 -1
  342. package/types/limitng-pipes-boolToPlusMinus.pipe.d.ts +7 -10
  343. package/types/limitng-pipes-boolToPlusMinus.pipe.d.ts.map +1 -1
  344. package/types/limitng-pipes-dateToText.pipe.d.ts +7 -10
  345. package/types/limitng-pipes-dateToText.pipe.d.ts.map +1 -1
  346. package/types/limitng-pipes-evetHayir.pipe.d.ts +9 -12
  347. package/types/limitng-pipes-evetHayir.pipe.d.ts.map +1 -1
  348. package/types/limitng-pipes-global-filter-formatter.pipe.d.ts +8 -11
  349. package/types/limitng-pipes-global-filter-formatter.pipe.d.ts.map +1 -1
  350. package/types/limitng-pipes-mecraTuru.pipe.d.ts +7 -10
  351. package/types/limitng-pipes-mecraTuru.pipe.d.ts.map +1 -1
  352. package/types/limitng-pipes-safe.pipe.d.ts +9 -12
  353. package/types/limitng-pipes-safe.pipe.d.ts.map +1 -1
  354. package/types/limitng-pipes-toSeverity.pipe.d.ts +8 -12
  355. package/types/limitng-pipes-toSeverity.pipe.d.ts.map +1 -1
  356. package/types/limitng-pipes-tooltip-formatter.pipe.d.ts +8 -11
  357. package/types/limitng-pipes-tooltip-formatter.pipe.d.ts.map +1 -1
  358. package/types/limitng-pipes.d.ts +3 -3
  359. package/types/limitng-pipes.d.ts.map +1 -1
  360. package/types/limitng-rapor-kart-models.d.ts +14 -17
  361. package/types/limitng-rapor-kart-models.d.ts.map +1 -1
  362. package/types/limitng-rapor-kart.d.ts +36 -24
  363. package/types/limitng-rapor-kart.d.ts.map +1 -1
  364. package/types/limitng-sol-buyuk-kart.d.ts +47 -19
  365. package/types/limitng-sol-buyuk-kart.d.ts.map +1 -1
  366. package/types/limitng-sol-kucuk-kart.d.ts +42 -14
  367. package/types/limitng-sol-kucuk-kart.d.ts.map +1 -1
  368. package/types/limitng-yatay-baslikli-panel.d.ts +66 -22
  369. package/types/limitng-yatay-baslikli-panel.d.ts.map +1 -1
  370. package/types/limitng.d.ts +6 -7
  371. package/fesm2022/limitng-api-models-kisisel-izinislemleri-izinguncelle.mjs.map +0 -1
  372. package/fesm2022/limitng-api-models-kisisel-masrafislemleri-masrafguncelle.mjs.map +0 -1
  373. package/fesm2022/limitng-api-models-onay-onaybilgi.mjs.map +0 -1
  374. package/fesm2022/limitng-api-models-ozet-ozetdata.mjs.map +0 -1
  375. package/fesm2022/limitng-api-models-ozet-ozetkartalan.mjs.map +0 -1
  376. package/fesm2022/limitng.mjs.map +0 -1
  377. package/types/limitng.d.ts.map +0 -1
@@ -1,1208 +1,1003 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, Injectable } from '@angular/core';
3
- import saveAs from 'file-saver';
4
- import { TranslateService } from '@ngx-translate/core';
5
- import { GlobalFunctions } from 'limitng/api';
6
- import ExcelJS from 'exceljs';
7
- import { VariableType, NumberFormatlar, FontStyle } from 'limitng/api/models/fourDConstants';
8
- import { XLHAlign, XLVAlign } from 'limitng/api/models/xl/xlConstants';
9
-
10
- class ExcelRaporuSonuc {
11
- constructor() {
12
- this.book = {
13
- author: 'MedPlan',
14
- activeSheetNo: 1
15
- };
16
- this.defaultFont = {
17
- name: 'Calibri',
18
- size: 11
19
- };
20
- this.currentTableStyle = '';
21
- this.sifirlariBasmaSayi = false;
22
- this.sifirlariBasmaTarih = false;
23
- // Yeni format: her sheet kendi tablolarını, üst bilgilerini ve notlarını taşır
24
- this.sheets = [];
25
- this.window = {
26
- displayGridLines: false
27
- };
28
- }
29
- }
30
-
31
- class JsonToExcelTableBuilder {
32
- constructor(table) {
33
- this.table = table;
34
- }
35
- addColumn(column) {
36
- this.table.columns.push({
37
- arrayType: VariableType.text,
38
- ...column
39
- });
40
- return this;
41
- }
42
- setRows(rows) {
43
- this.table.collection = rows;
44
- return this;
45
- }
46
- setStartColumn(sol) {
47
- this.table.sol = sol;
48
- return this;
49
- }
50
- setStartRow(ust) {
51
- this.table.ust = ust;
52
- return this;
53
- }
54
- getColumnSayisi() {
55
- return this.table.columns.length;
56
- }
57
- }
58
- class JsonToExcelSheetBuilder {
59
- constructor(sheet) {
60
- this.sheet = sheet;
61
- }
62
- addTable(rows, options = {}) {
63
- const table = {
64
- collection: rows,
65
- columns: [],
66
- ...(options.autoFit !== undefined && { autoFit: options.autoFit }),
67
- ...(options.data && { data: options.data }),
68
- ...(options.footer && { footer: options.footer }),
69
- ...(options.header && { header: options.header }),
70
- ...(options.sol !== undefined && { sol: options.sol }),
71
- ...(options.ust !== undefined && { ust: options.ust })
72
- };
73
- this.sheet.tables ??= [];
74
- this.sheet.tables.push(table);
75
- return new JsonToExcelTableBuilder(table);
76
- }
77
- addUstBilgi(ustBilgi, font) {
78
- this.sheet.ustBilgiler ??= [];
79
- this.sheet.ustBilgiler.push(JsonToExcelParser.ustBilgiEkle(ustBilgi, font));
80
- return this;
81
- }
82
- getUstBilgiSayisi() {
83
- return this.sheet.ustBilgiler?.length ?? 0;
84
- }
85
- getSheetNo() {
86
- return this.sheet.sheetNo;
87
- }
88
- setSheetName(sheetName) {
89
- this.sheet.sheetName = sheetName;
90
- return this;
91
- }
92
- setZoom(zoom) {
93
- this.sheet.zoom = zoom;
94
- return this;
95
- }
96
- }
97
- class JsonToExcelReportBuilder {
98
- constructor() {
99
- this.sonuc = new ExcelRaporuSonuc();
100
- }
101
- addSheet(sheetName, options = {}) {
102
- const sheet = {
103
- sheetName,
104
- sheetNo: this.sonuc.sheets.length + 1,
105
- ...(options.pageSetup && { pageSetup: options.pageSetup }),
106
- ...(options.zoom !== undefined && { zoom: options.zoom })
107
- };
108
- this.sonuc.sheets.push(sheet);
109
- return new JsonToExcelSheetBuilder(sheet);
110
- }
111
- build() {
112
- return this.sonuc;
113
- }
114
- setAuthor(author) {
115
- this.sonuc.book.author = author;
116
- return this;
117
- }
118
- setCurrentTableStyle(currentTableStyle) {
119
- this.sonuc.currentTableStyle = currentTableStyle;
120
- return this;
121
- }
122
- setSubject(subject) {
123
- this.sonuc.book.subject = subject;
124
- return this;
125
- }
126
- }
127
- class JsonToExcelParser {
128
- static async indir(sonuc, dosyaAdi) {
129
- const blob = await this.blobOlustur(sonuc);
130
- const normalizeDosyaAdi = this.dosyaAdiDuzenle(dosyaAdi);
131
- saveAs(blob, `${normalizeDosyaAdi}.xlsx`);
132
- }
133
- static async blobOlustur(sonuc) {
134
- const workbook = this.workbookOlustur(sonuc);
135
- const buffer = await workbook.xlsx.writeBuffer();
136
- return new Blob([buffer], {
137
- type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
138
- });
139
- }
140
- static standartPageSetupOlustur() {
141
- return {
142
- bottomMargin: 1,
143
- centerHorizontally: true,
144
- centerVertically: true,
145
- fitToPagesTall: 1,
146
- fitToPagesWide: 1,
147
- leftMargin: 1,
148
- orientation: 2,
149
- rightMargin: 1,
150
- topMargin: 1
151
- };
152
- }
153
- static ustBilgiEkle(ustBilgi, font) {
154
- return font ? { font, ustBilgi } : { ustBilgi };
155
- }
156
- static raporOlustur() {
157
- return new JsonToExcelReportBuilder();
158
- }
159
- static workbookOlustur(sonuc) {
160
- const workbook = new ExcelJS.Workbook();
161
- workbook.created = new Date();
162
- workbook.calcProperties.fullCalcOnLoad = true;
163
- const gridLinesGorunur = sonuc.window.displayGridLines;
164
- if (this.yeniYapiMi(sonuc)) {
165
- workbook.creator = sonuc.book.author || 'MedPlan';
166
- workbook.subject = '';
167
- workbook.description = '';
168
- this.yeniFormatSheetsYaz(workbook, sonuc, gridLinesGorunur);
169
- }
170
- else {
171
- workbook.creator = sonuc.book.author || 'MedPlan';
172
- workbook.subject = this.konuVer(sonuc.book, sonuc.ustBilgiler?.[0]?.ustBilgi);
173
- workbook.description = sonuc.book.comments || '';
174
- this.eskiFormatSheetsYaz(workbook, sonuc, gridLinesGorunur);
175
- }
176
- this.aktifSayfayiAyarla(workbook, sonuc.book.activeSheetNo, workbook.worksheets.length);
177
- return workbook;
178
- }
179
- static yeniYapiMi(sonuc) {
180
- const ilkSheet = sonuc.sheets[0];
181
- if (Array.isArray(ilkSheet?.tables)) {
182
- return true;
183
- }
184
- const runtimeSonuc = sonuc;
185
- return !Array.isArray(runtimeSonuc.tables);
186
- }
187
- static yeniFormatSheetsYaz(workbook, sonuc, gridLinesGorunur) {
188
- for (let index = 0; index < sonuc.sheets.length; index++) {
189
- const sheet = sonuc.sheets[index];
190
- const sheetAdi = this.sayfaAdiDuzenle(sheet.sheetName || 'Rapor', index + 1);
191
- const worksheet = workbook.addWorksheet(sheetAdi);
192
- const zoomScale = sheet.zoom && sheet.zoom > 0 ? sheet.zoom : undefined;
193
- worksheet.views = [{ showGridLines: gridLinesGorunur, ...(zoomScale !== undefined && { zoomScale }) }];
194
- this.sayfaDuzeniniBelirle(worksheet, sheet);
195
- const ustBilgiler = sheet.ustBilgiler ?? [];
196
- this.yeniFormatUstBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
197
- let sonSatir = ustBilgiler.length + 1;
198
- for (const table of sheet.tables ?? []) {
199
- sonSatir = Math.max(sonSatir, this.tabloyuYaz(worksheet, sonuc, table));
200
- }
201
- if (sheet.notlar?.length) {
202
- this.notlariYazList(worksheet, sheet.notlar, sheet.not?.font, sonSatir + 2, sonuc.defaultFont);
203
- }
204
- }
205
- if (sonuc.sheets.length === 0) {
206
- const worksheet = workbook.addWorksheet('Rapor');
207
- worksheet.views = [{ showGridLines: gridLinesGorunur }];
208
- }
209
- }
210
- static eskiFormatSheetsYaz(workbook, sonuc, gridLinesGorunur) {
211
- const tablesBySheet = this.sheetBazliTablolar(sonuc);
212
- const ustBilgiler = sonuc.ustBilgiler ?? [];
213
- const notlar = sonuc.notlar ?? [];
214
- for (const sheetGrup of tablesBySheet) {
215
- const worksheet = workbook.addWorksheet(sheetGrup.sheetName);
216
- worksheet.views = [{ showGridLines: gridLinesGorunur }];
217
- this.ustBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
218
- let sonSatir = 1;
219
- for (const table of sheetGrup.tables) {
220
- sonSatir = Math.max(sonSatir, this.tabloyuYaz(worksheet, sonuc, table));
221
- }
222
- this.notlariYazList(worksheet, notlar, sonuc.not?.font, sonSatir + 2, sonuc.defaultFont);
223
- }
224
- if (tablesBySheet.length === 0) {
225
- const worksheet = workbook.addWorksheet(this.bosRaporSheetAdiniVer(sonuc));
226
- worksheet.views = [{ showGridLines: gridLinesGorunur }];
227
- this.ustBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
228
- this.notlariYazList(worksheet, notlar, sonuc.not?.font, ustBilgiler.length + 2, sonuc.defaultFont);
229
- }
230
- }
231
- static sheetBazliTablolar(sonuc) {
232
- const grouped = new Map();
233
- for (const table of sonuc.tables ?? []) {
234
- const sheetNo = this.tableSheetNoVer(table);
235
- const sheetKey = this.sheetKeyVer(table, sheetNo, grouped.size + 1);
236
- const existing = grouped.get(sheetKey);
237
- if (existing) {
238
- existing.tables.push(table);
239
- continue;
240
- }
241
- grouped.set(sheetKey, {
242
- sheetName: this.sheetAdiniBelirle(sonuc, table, grouped.size + 1, sheetNo),
243
- ...(sheetNo !== undefined && { sheetNo }),
244
- tables: [table]
245
- });
246
- }
247
- return Array.from(grouped.values()).sort((a, b) => this.sheetGrupSirasiVer(a) - this.sheetGrupSirasiVer(b));
248
- }
249
- static tableSheetNoVer(table) {
250
- const runtimeTable = table;
251
- return runtimeTable.sheetNo;
252
- }
253
- static sheetKeyVer(table, sheetNo, index) {
254
- if (sheetNo !== undefined) {
255
- return `sheet-no-${sheetNo}`;
256
- }
257
- const eskiSheetName = table.sheetName?.trim();
258
- if (eskiSheetName) {
259
- return `sheet-name-${eskiSheetName}`;
260
- }
261
- return `sheet-index-${index}`;
262
- }
263
- static sheetAdiniBelirle(sonuc, table, index, sheetNo) {
264
- const jsonSheet = this.jsonSheetBul(sonuc.sheets, sheetNo, index);
265
- if (jsonSheet?.sheetName?.trim()) {
266
- return this.sayfaAdiDuzenle(jsonSheet.sheetName, index);
267
- }
268
- return this.sayfaAdiDuzenle(table.sheetName || 'Rapor', index);
269
- }
270
- static jsonSheetBul(sheets, sheetNo, index) {
271
- if (sheetNo !== undefined) {
272
- return sheets.find(sheet => sheet.sheetNo === sheetNo);
273
- }
274
- return sheets.find(sheet => sheet.sheetNo === index) ?? sheets[index - 1];
275
- }
276
- static konuVer(book, ilkUstBilgi) {
277
- return book.subject || ilkUstBilgi || 'Rapor';
278
- }
279
- static bosRaporSheetAdiniVer(sonuc) {
280
- const ilkSheetAdi = sonuc.sheets[0]?.sheetName;
281
- return this.sayfaAdiDuzenle(ilkSheetAdi || 'Rapor', 1);
282
- }
283
- static aktifSayfayiAyarla(workbook, activeSheetNo, toplamSheetSayisi) {
284
- const aktifTab = this.aktifTabNoVer(activeSheetNo, toplamSheetSayisi);
285
- if (aktifTab === undefined) {
286
- return;
287
- }
288
- workbook.views = [{
289
- activeTab: aktifTab,
290
- firstSheet: aktifTab,
291
- height: 20000,
292
- visibility: 'visible',
293
- width: 20000,
294
- x: 0,
295
- y: 0
296
- }];
297
- }
298
- static aktifTabNoVer(activeSheetNo, toplamSheetSayisi) {
299
- if (toplamSheetSayisi <= 0) {
300
- return undefined;
301
- }
302
- const aktifSheetNo = Number.isFinite(activeSheetNo) && activeSheetNo > 0 ? activeSheetNo : 1;
303
- return Math.min(aktifSheetNo - 1, toplamSheetSayisi - 1);
304
- }
305
- static sheetGrupSirasiVer(sheetGrup) {
306
- return sheetGrup.sheetNo ?? Number.MAX_SAFE_INTEGER;
307
- }
308
- static yeniFormatUstBilgileriYaz(worksheet, ustBilgiler, defaultFont) {
309
- for (let index = 0; index < ustBilgiler.length; index++) {
310
- const ustBilgi = ustBilgiler[index];
311
- const hucre = worksheet.getCell(index + 1, 1);
312
- hucre.value = ustBilgi.ustBilgi;
313
- this.hucreFontunuUygula(hucre, ustBilgi.font, defaultFont);
314
- hucre.alignment = { horizontal: 'left', vertical: 'middle', wrapText: false };
315
- }
316
- }
317
- static ustBilgileriYaz(worksheet, ustBilgiler, defaultFont) {
318
- for (const ustBilgi of ustBilgiler) {
319
- const hucre = worksheet.getCell(ustBilgi.rowNo ?? 1, 1);
320
- hucre.value = ustBilgi.ustBilgi;
321
- this.hucreFontunuUygula(hucre, ustBilgi.font, defaultFont);
322
- hucre.alignment = { horizontal: 'left', vertical: 'middle', wrapText: false };
323
- }
324
- }
325
- static notlariYazList(worksheet, notlar, notFont, baslangicSatiri, defaultFont) {
326
- let satirNo = baslangicSatiri;
327
- for (const not of notlar) {
328
- const cell = worksheet.getCell(satirNo, 1);
329
- cell.value = not;
330
- this.hucreFontunuUygula(cell, notFont, defaultFont);
331
- cell.alignment = { vertical: 'middle', wrapText: true };
332
- satirNo++;
333
- }
334
- }
335
- static sayfaDuzeniniBelirle(worksheet, sheet) {
336
- const { pageSetup } = sheet;
337
- if (!pageSetup) {
338
- return;
339
- }
340
- if (pageSetup.orientation === 2) {
341
- worksheet.pageSetup.orientation = 'landscape';
342
- }
343
- else if (pageSetup.orientation === 1) {
344
- worksheet.pageSetup.orientation = 'portrait';
345
- }
346
- const hasMargin = pageSetup.leftMargin !== undefined ||
347
- pageSetup.rightMargin !== undefined ||
348
- pageSetup.topMargin !== undefined ||
349
- pageSetup.bottomMargin !== undefined ||
350
- pageSetup.headerMargin !== undefined ||
351
- pageSetup.footerMargin !== undefined;
352
- if (hasMargin) {
353
- worksheet.pageSetup.margins = {
354
- left: pageSetup.leftMargin ?? 0.7,
355
- right: pageSetup.rightMargin ?? 0.7,
356
- top: pageSetup.topMargin ?? 0.75,
357
- bottom: pageSetup.bottomMargin ?? 0.75,
358
- header: pageSetup.headerMargin ?? 0.3,
359
- footer: pageSetup.footerMargin ?? 0.3
360
- };
361
- }
362
- if (pageSetup.centerHorizontally !== undefined) {
363
- worksheet.pageSetup.horizontalCentered = pageSetup.centerHorizontally;
364
- }
365
- if (pageSetup.centerVertically !== undefined) {
366
- worksheet.pageSetup.verticalCentered = pageSetup.centerVertically;
367
- }
368
- const fitTall = pageSetup.fitToPagesTall;
369
- const fitWide = pageSetup.fitToPagesWide;
370
- if (fitTall !== undefined || fitWide !== undefined || pageSetup.fitToPagesTAut || pageSetup.fitToPagesWAut) {
371
- worksheet.pageSetup.fitToPage = true;
372
- worksheet.pageSetup.fitToHeight = pageSetup.fitToPagesTAut ? 0 : (fitTall ?? 1);
373
- worksheet.pageSetup.fitToWidth = pageSetup.fitToPagesWAut ? 0 : (fitWide ?? 1);
374
- }
375
- if (typeof pageSetup.zoom === 'number' && pageSetup.zoom > 0) {
376
- worksheet.pageSetup.scale = pageSetup.zoom;
377
- }
378
- if (pageSetup.printArea) {
379
- worksheet.pageSetup.printArea = pageSetup.printArea;
380
- }
381
- const pageHeader = this.baslikAltbilgiMetniOlustur(pageSetup.leftHeader, pageSetup.centerHeader, pageSetup.rightHeader);
382
- const pageFooter = this.baslikAltbilgiMetniOlustur(pageSetup.leftFooter, pageSetup.centerFooter, pageSetup.rightFooter);
383
- if (pageHeader) {
384
- worksheet.headerFooter.oddHeader = pageHeader;
385
- }
386
- if (pageFooter) {
387
- worksheet.headerFooter.oddFooter = pageFooter;
388
- }
389
- }
390
- static baslikAltbilgiMetniOlustur(sol, orta, sag) {
391
- const parcalar = [];
392
- if (sol) {
393
- parcalar.push(`&L${sol}`);
394
- }
395
- if (orta) {
396
- parcalar.push(`&C${orta}`);
397
- }
398
- if (sag) {
399
- parcalar.push(`&R${sag}`);
400
- }
401
- return parcalar.length ? parcalar.join('') : undefined;
402
- }
403
- static tabloyuYaz(worksheet, sonuc, table) {
404
- if (!table.columns.length) {
405
- return table.ust ?? 1;
406
- }
407
- const startRow = Math.max(1, table.ust ?? 1);
408
- const startCol = Math.max(1, table.sol ?? 1);
409
- const gecerliTableStyle = this.gecerliTableStyleVer(sonuc.currentTableStyle);
410
- const headerTitlelari = table.columns.map(column => this.baslikMetniniHazirla(column.header.title || ''));
411
- const gorunenBaslikMetinleri = headerTitlelari.map(title => title.replaceAll('\n', ' '));
412
- const tabloKolonAdlari = this.benzersizKolonAdlariOlustur(gorunenBaslikMetinleri);
413
- const headerFont = table.header?.font;
414
- const uygulanacakHeaderFont = headerFont?.color ? headerFont : {
415
- ...headerFont,
416
- color: 'FFFFFFFF'
417
- };
418
- const dataFont = table.data?.font;
419
- const hiddenRowSet = new Set(table.hiddenRows ?? []);
420
- const formulCeller = [];
421
- const hucreFontRenkleri = [];
422
- const satirlar = table.collection.map((rowData, rowIndex) => table.columns.map((column, colIndex) => {
423
- const hazirHucre = this.hucreDegeriniHazirla(rowData, column, sonuc.sifirlariBasmaSayi);
424
- hucreFontRenkleri[rowIndex] ??= [];
425
- hucreFontRenkleri[rowIndex][colIndex] = hazirHucre.fontColorArgb;
426
- if (hazirHucre.deger !== null && typeof hazirHucre.deger === 'object' && 'formula' in hazirHucre.deger) {
427
- formulCeller.push({ rowIndex, colIndex, column, formula: hazirHucre.deger });
428
- return '';
429
- }
430
- return hazirHucre.deger;
431
- }));
432
- this.kolonGrubuYaz(worksheet, startRow, startCol, table);
433
- const headerRow = worksheet.getRow(startRow);
434
- const tableStyle = this.tableStyleDonustur(gecerliTableStyle);
435
- const bosSatirEklendi = satirlar.length === 0;
436
- const tabloSatirlari = bosSatirEklendi ? [table.columns.map(() => '')] : satirlar;
437
- worksheet.addTable({
438
- name: this.tabloAdiOlustur(worksheet.name, startRow, startCol),
439
- ref: worksheet.getCell(startRow, startCol).address,
440
- headerRow: true,
441
- totalsRow: false,
442
- ...(tableStyle && { style: tableStyle }),
443
- columns: tabloKolonAdlari.map(ad => ({ name: ad, filterButton: true })),
444
- rows: tabloSatirlari
445
- });
446
- if (bosSatirEklendi) {
447
- worksheet.getRow(startRow + 1).hidden = true;
448
- }
449
- this.kolonGenislikleriniUygula(worksheet, startCol, table.columns, satirlar, table.autoFit);
450
- for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
451
- const column = table.columns[colIndex];
452
- const cell = headerRow.getCell(startCol + colIndex);
453
- cell.alignment = {
454
- horizontal: this.yatayHizaDonustur(column.header.horizontalAlignment),
455
- vertical: 'bottom',
456
- wrapText: false
457
- };
458
- this.hucreFontunuUygula(cell, uygulanacakHeaderFont, sonuc.defaultFont);
459
- }
460
- for (let rowIndex = 0; rowIndex < table.collection.length; rowIndex++) {
461
- const wsRow = worksheet.getRow(startRow + 1 + rowIndex);
462
- const satir1Bazli = rowIndex + 1;
463
- if (hiddenRowSet.has(satir1Bazli)) {
464
- wsRow.hidden = true;
465
- }
466
- const rowHeight = table.rowHeights?.find(rh => rh.rowNo === satir1Bazli);
467
- if (rowHeight?.height) {
468
- wsRow.height = rowHeight.height;
469
- }
470
- for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
471
- const column = table.columns[colIndex];
472
- const cell = wsRow.getCell(startCol + colIndex);
473
- const hucreDegeri = satirlar[rowIndex][colIndex];
474
- cell.value = hucreDegeri;
475
- this.hucreFontunuUygula(cell, dataFont, sonuc.defaultFont);
476
- const hucreFontRengi = hucreFontRenkleri[rowIndex]?.[colIndex];
477
- if (hucreFontRengi) {
478
- cell.font = { ...(cell.font ?? {}), color: { argb: hucreFontRengi } };
479
- }
480
- const numFmt = this.numberFormatDonustur(this.kolonFormatiniBelirle(column));
481
- if (numFmt) {
482
- cell.numFmt = numFmt;
483
- }
484
- else if (hucreDegeri instanceof Date) {
485
- cell.numFmt = this.varsayilanTarihFormatiniVer();
486
- }
487
- const hucreHizasi = this.hucreYatayHizasiniBelirle(column);
488
- cell.alignment = {
489
- ...(hucreHizasi !== undefined && { horizontal: hucreHizasi }),
490
- vertical: this.dikeyHizaDonustur(column.verticalAlignment),
491
- wrapText: false
492
- };
493
- // Sütun rengi
494
- const colFontColor = table.columnFontColors?.[colIndex];
495
- if (colFontColor) {
496
- const argb = this.argbDonustur(colFontColor);
497
- if (argb) {
498
- cell.font = { ...(cell.font ?? {}), color: { argb } };
499
- }
500
- }
501
- const colIntColor = this.kolonRenginiBul(table.columnInteriorColors, colIndex);
502
- if (colIntColor) {
503
- const argb = this.argbDonustur(colIntColor);
504
- if (argb) {
505
- cell.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb } };
506
- }
507
- }
508
- // Satır rengi (sütun rengini ezer)
509
- const rowFontColor = table.rowFontColors?.find(rc => rc.rowNo === satir1Bazli);
510
- if (rowFontColor) {
511
- const argb = this.argbDonustur(rowFontColor.color);
512
- if (argb) {
513
- cell.font = { ...(cell.font ?? {}), color: { argb } };
514
- }
515
- }
516
- const rowIntColor = table.rowInteriorColors?.find(rc => rc.rowNo === satir1Bazli);
517
- if (rowIntColor) {
518
- const argb = this.argbDonustur(rowIntColor.color);
519
- if (argb) {
520
- cell.fill = { type: 'pattern', pattern: 'solid', fgColor: { argb } };
521
- }
522
- }
523
- }
524
- }
525
- for (const { rowIndex, colIndex, column, formula } of formulCeller) {
526
- const cell = worksheet.getRow(startRow + 1 + rowIndex).getCell(startCol + colIndex);
527
- cell.value = formula;
528
- const formulHizasi = this.hucreYatayHizasiniBelirle(column);
529
- cell.alignment = {
530
- ...(cell.alignment ?? {}),
531
- ...(formulHizasi !== undefined && { horizontal: formulHizasi })
532
- };
533
- }
534
- let sonSatir = startRow + table.collection.length;
535
- // Footer satırları
536
- const footer = table.footer;
537
- if (footer?.basilacak) {
538
- const ustBosluk = footer.ustBosluk ?? 0;
539
- const satirSayisi = footer.satirSayisi ?? 1;
540
- const footerBasSatir = sonSatir + 1 + ustBosluk;
541
- for (let fi = 0; fi < satirSayisi; fi++) {
542
- const footerRow = worksheet.getRow(footerBasSatir + fi);
543
- for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
544
- const column = table.columns[colIndex];
545
- const cell = footerRow.getCell(startCol + colIndex);
546
- this.hucreFontunuUygula(cell, footer.font, sonuc.defaultFont);
547
- const colFooter = column.footer;
548
- if (colFooter?.isFunction) {
549
- const footerFormula = this.footerFormulunuOlustur(column, colIndex, startRow, startCol, table.collection.length);
550
- if (footerFormula) {
551
- cell.value = { formula: footerFormula };
552
- const numFmt = this.numberFormatDonustur(this.kolonFormatiniBelirle(column));
553
- if (numFmt) {
554
- cell.numFmt = numFmt;
555
- }
556
- }
557
- }
558
- else if (colFooter?.title) {
559
- cell.value = colFooter.title;
560
- }
561
- const footerHizasi = colFooter?.isFunction
562
- ? this.hucreYatayHizasiniBelirle(column)
563
- : this.yatayHizaDonustur(colFooter?.horizontalAlignment);
564
- cell.alignment = {
565
- ...(footerHizasi !== undefined && { horizontal: footerHizasi }),
566
- vertical: 'middle',
567
- wrapText: false
568
- };
569
- }
570
- }
571
- sonSatir = footerBasSatir + satirSayisi - 1;
572
- }
573
- return sonSatir;
574
- }
575
- static kolonGenislikleriniUygula(worksheet, startCol, columns, satirlar, autoFit) {
576
- const filtreButonuBoslukPayi = 1.25;
577
- const veriSagBoslukPayi = 1;
578
- const autoFitAktif = autoFit !== false;
579
- for (let index = 0; index < columns.length; index++) {
580
- const worksheetColumn = worksheet.getColumn(startCol + index);
581
- const tasarimGenisligi = (columns[index].width ?? 0) > 0 ? Math.round(columns[index].width / 7) : 0;
582
- if (!autoFitAktif) {
583
- worksheetColumn.width = tasarimGenisligi > 0 ? tasarimGenisligi : 10;
584
- continue;
585
- }
586
- const baslikUzunlugu = this.metinUzunlugu(this.baslikMetniniHazirla(columns[index].header.title));
587
- const veriUzunlugu = satirlar.reduce((max, satir) => Math.max(max, this.hucreMetinUzunlugu(satir[index])), 0);
588
- worksheetColumn.width = Math.max(10, tasarimGenisligi, baslikUzunlugu + 2 + filtreButonuBoslukPayi, veriUzunlugu + 2 + veriSagBoslukPayi);
589
- }
590
- }
591
- static baslikMetniniHazirla(metin) {
592
- return metin
593
- .replaceAll('\r\n', ' ')
594
- .replaceAll('\r', ' ')
595
- .replaceAll('\n', ' ')
596
- .trim();
597
- }
598
- static hucreMetinUzunlugu(deger) {
599
- if (deger === null || deger === undefined) {
600
- return 0;
601
- }
602
- if (typeof deger === 'string') {
603
- return this.metinUzunlugu(deger);
604
- }
605
- if (typeof deger === 'number' || typeof deger === 'boolean') {
606
- return String(deger).length;
607
- }
608
- if (deger instanceof Date) {
609
- return '14.05.2026 09:13:29'.length;
610
- }
611
- if (typeof deger === 'object' && 'formula' in deger) {
612
- return this.metinUzunlugu(String(deger.formula));
613
- }
614
- return this.metinUzunlugu(String(deger));
615
- }
616
- static hucreYatayHizasiniBelirle(column) {
617
- if (this.sayisalKolonMu(column.arrayType)) {
618
- return 'right';
619
- }
620
- if (this.booleanKolonMu(column.arrayType)) {
621
- return 'center';
622
- }
623
- if (column.horizontalAlignment === undefined) {
624
- return undefined;
625
- }
626
- return this.yatayHizaDonustur(column.horizontalAlignment);
627
- }
628
- static kolonFormatiniBelirle(column) {
629
- if (column.format !== undefined && column.format !== NumberFormatlar.belirsiz) {
630
- return column.format;
631
- }
632
- switch (column.arrayType) {
633
- case VariableType.integer:
634
- case VariableType.longint:
635
- return NumberFormatlar.long;
636
- case VariableType.real:
637
- return NumberFormatlar.real;
638
- case VariableType.date:
639
- return NumberFormatlar.tarih;
640
- default:
641
- return column.format;
642
- }
643
- }
644
- static sayisalKolonMu(arrayType) {
645
- switch (arrayType) {
646
- case VariableType.integer:
647
- case VariableType.longint:
648
- case VariableType.real:
649
- return true;
650
- default:
651
- return false;
652
- }
653
- }
654
- static booleanKolonMu(arrayType) {
655
- return arrayType === VariableType.boolean;
656
- }
657
- static metinUzunlugu(metin) {
658
- return metin
659
- .replaceAll('\r', '')
660
- .split('\n')
661
- .reduce((max, parca) => Math.max(max, parca.trim().length), 0);
662
- }
663
- static kolonGrubuYaz(worksheet, startRow, startCol, table) {
664
- const columnGroups = table.columnGroup;
665
- if (!columnGroups?.length || startRow <= 1) {
666
- return;
667
- }
668
- const grupSatiri = startRow - 1;
669
- for (const columnGroup of columnGroups) {
670
- const baslangicIndex = table.columns.findIndex(column => column.property === columnGroup.groupStart);
671
- const bitisIndex = table.columns.findIndex(column => column.property === columnGroup.groupEnd);
672
- const baslangicKolonu = baslangicIndex >= 0 ? startCol + baslangicIndex : undefined;
673
- const bitisKolonu = bitisIndex >= 0 ? startCol + bitisIndex : undefined;
674
- if (!baslangicKolonu || !bitisKolonu || bitisKolonu < baslangicKolonu) {
675
- continue;
676
- }
677
- worksheet.mergeCells(grupSatiri, baslangicKolonu, grupSatiri, bitisKolonu);
678
- const grupHucre = worksheet.getCell(grupSatiri, baslangicKolonu);
679
- grupHucre.value = columnGroup.groupName;
680
- grupHucre.alignment = { horizontal: 'center', vertical: 'middle' };
681
- grupHucre.font = { bold: true, size: 11, color: { argb: 'FFF79646' } };
682
- grupHucre.fill = {
683
- type: 'pattern',
684
- pattern: 'solid',
685
- fgColor: { argb: 'FFFFFFFF' }
686
- };
687
- for (let col = baslangicKolonu; col <= bitisKolonu; col++) {
688
- const hucre = worksheet.getCell(grupSatiri, col);
689
- hucre.border = {
690
- ...hucre.border,
691
- top: { style: 'medium', color: { argb: 'FFF79646' } },
692
- ...(col === baslangicKolonu ? { left: { style: 'medium', color: { argb: 'FFF79646' } } } : (hucre.border?.left ? { left: hucre.border.left } : {})),
693
- ...(col === bitisKolonu ? { right: { style: 'medium', color: { argb: 'FFF79646' } } } : (hucre.border?.right ? { right: hucre.border.right } : {}))
694
- };
695
- }
696
- }
697
- }
698
- static hucreDegeriniHazirla(row, column, sifirlariBasmaSayi) {
699
- const value = row[column.property];
700
- if ((typeof value === 'string') && value.startsWith('=')) {
701
- return { deger: { formula: this.excelFormuluneDonustur(value) } };
702
- }
703
- const sifirDegerMi = (typeof value === 'number' && value === 0) ||
704
- (typeof value === 'string' && this.sayisalKolonMu(column.arrayType) && value.trim() !== '' && Number(value) === 0);
705
- if (sifirDegerMi && sifirlariBasmaSayi) {
706
- return { deger: null };
707
- }
708
- if (value === null || value === undefined) {
709
- return { deger: '' };
710
- }
711
- const htmlHucre = (column.htmlKoduGelebilir === true) && typeof value === 'string' ? this.htmlHucreIceriginiHazirla(value) : undefined;
712
- const normallesenDeger = htmlHucre?.deger ?? value;
713
- if ((typeof normallesenDeger === 'string') && normallesenDeger.startsWith('=')) {
714
- return this.hazirHucreDegeriOlustur({ formula: this.excelFormuluneDonustur(normallesenDeger) }, htmlHucre?.fontColorArgb);
715
- }
716
- if ((typeof value === 'string') && (typeof normallesenDeger === 'string')) {
717
- const tarihMetni = this.tarihStringiniExcelMetnineDonustur(normallesenDeger, column);
718
- if (tarihMetni) {
719
- return this.hazirHucreDegeriOlustur(tarihMetni, htmlHucre?.fontColorArgb);
720
- }
721
- const tarihDegeri = this.tarihStringiniDateeDonustur(normallesenDeger);
722
- if (tarihDegeri) {
723
- return this.hazirHucreDegeriOlustur(tarihDegeri, htmlHucre?.fontColorArgb);
724
- }
725
- }
726
- if (normallesenDeger instanceof Date) {
727
- return this.hazirHucreDegeriOlustur(this.excelIcinTarihiNormalizeEt(normallesenDeger), htmlHucre?.fontColorArgb);
728
- }
729
- if (this.booleanKolonMu(column.arrayType)) {
730
- return this.hazirHucreDegeriOlustur(normallesenDeger === true ? '+' : '', htmlHucre?.fontColorArgb);
731
- }
732
- if ((typeof normallesenDeger === 'number') || (typeof normallesenDeger === 'string')) {
733
- return this.hazirHucreDegeriOlustur(normallesenDeger, htmlHucre?.fontColorArgb);
734
- }
735
- return this.hazirHucreDegeriOlustur(String(normallesenDeger), htmlHucre?.fontColorArgb);
736
- }
737
- static hazirHucreDegeriOlustur(deger, fontColorArgb) {
738
- return {
739
- deger,
740
- ...(fontColorArgb ? { fontColorArgb } : {})
741
- };
742
- }
743
- static htmlHucreIceriginiHazirla(value) {
744
- if (!/[<>]/.test(value)) {
745
- return undefined;
746
- }
747
- const deger = value
748
- .replaceAll(/<br\s*\/?>/gi, '\n')
749
- .replaceAll(/<\/p\s*>/gi, '\n')
750
- .replaceAll(/<p\b[^>]*>/gi, '')
751
- .replaceAll(/<\/div\s*>/gi, '\n')
752
- .replaceAll(/<div\b[^>]*>/gi, '')
753
- .replaceAll(/<[^>]+>/g, '')
754
- .replaceAll(/&nbsp;/gi, ' ')
755
- .trim();
756
- const colorValue = this.htmlFontRenginiBul(value);
757
- const fontColorArgb = this.argbDonustur(colorValue);
758
- if ((deger === value) && !fontColorArgb) {
759
- return undefined;
760
- }
761
- return { deger, ...(fontColorArgb && { fontColorArgb }) };
762
- }
763
- static htmlFontRenginiBul(value) {
764
- const fontColorMatch = /<font\b[^>]*\bcolor\s*=\s*["']?([^"' >]+)["']?[^>]*>/i.exec(value);
765
- if (fontColorMatch?.[1]) {
766
- return fontColorMatch[1].trim();
767
- }
768
- const styleColorMatch = /<(?:font|span)\b[^>]*\bstyle\s*=\s*["'][^"']*\bcolor\s*:\s*([^;"']+)/i.exec(value);
769
- if (styleColorMatch?.[1]) {
770
- return styleColorMatch[1].trim();
771
- }
772
- return undefined;
773
- }
774
- static tarihStringiniDateeDonustur(value) {
775
- const trimmedValue = value.trim();
776
- const isoDateMatch = /^(\d{4})-(\d{2})-(\d{2})(?:$|[T\s])/.exec(trimmedValue);
777
- if (!isoDateMatch) {
778
- return undefined;
779
- }
780
- const year = Number(isoDateMatch[1]);
781
- const month = Number(isoDateMatch[2]);
782
- const day = Number(isoDateMatch[3]);
783
- if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day)) {
784
- return undefined;
785
- }
786
- const date = new Date(year, month - 1, day);
787
- if (date.getFullYear() !== year || date.getMonth() !== (month - 1) || date.getDate() !== day) {
788
- return undefined;
789
- }
790
- return new Date(Date.UTC(year, month - 1, day, 12, 0, 0, 0));
791
- }
792
- static tarihStringiniExcelMetnineDonustur(value, column) {
793
- if (!this.sadeceTarihKolonuMu(column)) {
794
- return undefined;
795
- }
796
- const trimmedValue = value.trim();
797
- const isoDateMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(trimmedValue);
798
- if (!isoDateMatch) {
799
- return undefined;
800
- }
801
- const year = Number(isoDateMatch[1]);
802
- const month = Number(isoDateMatch[2]);
803
- const day = Number(isoDateMatch[3]);
804
- if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day)) {
805
- return undefined;
806
- }
807
- const date = new Date(year, month - 1, day);
808
- if (date.getFullYear() !== year || date.getMonth() !== (month - 1) || date.getDate() !== day) {
809
- return undefined;
810
- }
811
- return `${String(day).padStart(2, '0')}.${String(month).padStart(2, '0')}.${year}`;
812
- }
813
- static excelIcinTarihiNormalizeEt(value) {
814
- if (value.getHours() !== 0 || value.getMinutes() !== 0 || value.getSeconds() !== 0 || value.getMilliseconds() !== 0) {
815
- return value;
816
- }
817
- return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), 12, 0, 0, 0));
818
- }
819
- static varsayilanTarihFormatiniVer() {
820
- return 'dd.mm.yyyy';
821
- }
822
- static sadeceTarihKolonuMu(column) {
823
- return this.kolonFormatiniBelirle(column) === NumberFormatlar.tarih;
824
- }
825
- static benzersizKolonAdlariOlustur(adlar) {
826
- const sayaclar = new Map();
827
- return adlar.map(ad => {
828
- const temelAd = ad || ' ';
829
- const sayi = sayaclar.get(temelAd) ?? 0;
830
- sayaclar.set(temelAd, sayi + 1);
831
- return sayi === 0 ? temelAd : `${temelAd}_${sayi}`;
832
- });
833
- }
834
- static hucreFontunuUygula(cell, font, defaultFont) {
835
- const style = font?.style ?? 0;
836
- const excelFont = {};
837
- const fontName = font?.name || defaultFont?.name;
838
- if (fontName) {
839
- excelFont.name = fontName;
840
- }
841
- const fontSize = (font?.size && font.size > 0) ? font.size : defaultFont?.size;
842
- if (fontSize && fontSize > 0) {
843
- excelFont.size = fontSize;
844
- }
845
- if (font?.color) {
846
- const color = this.argbDonustur(font.color);
847
- if (color) {
848
- excelFont.color = { argb: color };
849
- }
850
- }
851
- excelFont.bold = Boolean(style & FontStyle.bold);
852
- excelFont.italic = Boolean(style & FontStyle.italic);
853
- excelFont.underline = Boolean(style & FontStyle.underline);
854
- cell.font = excelFont;
855
- }
856
- static gecerliTableStyleVer(tableStyle) {
857
- if (!tableStyle) {
858
- return undefined;
859
- }
860
- const style = tableStyle.trim();
861
- if (/^TableStyleLight([1-9]|1\d|2[0-1])$/.test(style)) {
862
- return style;
863
- }
864
- if (/^TableStyleMedium([1-9]|1\d|2[0-1])$/.test(style)) {
865
- return style;
866
- }
867
- if (/^TableStyleDark([1-9]|10|11)$/.test(style)) {
868
- return style;
869
- }
870
- return undefined;
871
- }
872
- static tableStyleDonustur(theme) {
873
- if (!theme) {
874
- return undefined;
875
- }
876
- return {
877
- theme: theme,
878
- showRowStripes: true
879
- };
880
- }
881
- static tabloAdiOlustur(sheetName, startRow, startCol) {
882
- const temizSheetName = sheetName.replaceAll(/[^A-Za-z0-9]/g, '_');
883
- return `T_${temizSheetName}_R${startRow}C${startCol}`;
884
- }
885
- static yatayHizaDonustur(value) {
886
- switch (value) {
887
- case XLHAlign.xlHAlignCenter: return 'center';
888
- case XLHAlign.xlHAlignCenterAcrossSelection: return 'centerContinuous';
889
- case XLHAlign.xlHAlignDistributed: return 'distributed';
890
- case XLHAlign.xlHAlignFill: return 'fill';
891
- case XLHAlign.xlHAlignGeneral: return 'left';
892
- case XLHAlign.xlHAlignJustify: return 'justify';
893
- case XLHAlign.xlHAlignLeft: return 'left';
894
- case XLHAlign.xlHAlignRight: return 'right';
895
- default: return 'left';
896
- }
897
- }
898
- static dikeyHizaDonustur(value) {
899
- switch (value) {
900
- case XLVAlign.xlVAlignTop: return 'top';
901
- case XLVAlign.xlVAlignBottom: return 'bottom';
902
- case XLVAlign.xlVAlignDistributed: return 'distributed';
903
- case XLVAlign.xlVAlignJustify: return 'justify';
904
- default: return 'middle';
905
- }
906
- }
907
- static argbDonustur(color) {
908
- if (!color) {
909
- return undefined;
910
- }
911
- const cssColor = color.trim().toLowerCase();
912
- const rgbMatch = cssColor.match(/^rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);
913
- if (rgbMatch) {
914
- const rgbDegerleri = rgbMatch.slice(1).map(value => Number(value));
915
- if (rgbDegerleri.every(value => Number.isInteger(value) && value >= 0 && value <= 255)) {
916
- return `FF${rgbDegerleri.map(value => value.toString(16).padStart(2, '0')).join('').toUpperCase()}`;
917
- }
918
- }
919
- const namedColors = {
920
- black: 'FF000000',
921
- blue: 'FF0000FF',
922
- cyan: 'FF00FFFF',
923
- gray: 'FF808080',
924
- green: 'FF008000',
925
- grey: 'FF808080',
926
- magenta: 'FFFF00FF',
927
- orange: 'FFFFA500',
928
- purple: 'FF800080',
929
- red: 'FFFF0000',
930
- white: 'FFFFFFFF',
931
- yellow: 'FFFFFF00'
932
- };
933
- if (namedColors[cssColor]) {
934
- return namedColors[cssColor];
935
- }
936
- const hexColor = cssColor.replace('#', '');
937
- if (/^[0-9a-f]{6}$/i.test(hexColor)) {
938
- return `FF${hexColor.toUpperCase()}`;
939
- }
940
- if (/^[0-9A-Fa-f]{8}$/.test(color)) {
941
- return color.toUpperCase();
942
- }
943
- const numericColor = Number(color);
944
- if (!Number.isFinite(numericColor)) {
945
- return undefined;
946
- }
947
- const r = numericColor & 255;
948
- const g = (numericColor >> 8) & 255;
949
- const b = (numericColor >> 16) & 255;
950
- return `FF${[r, g, b].map(value => value.toString(16).padStart(2, '0')).join('').toUpperCase()}`;
951
- }
952
- static kolonRenginiBul(kolonRenkleri, colIndex) {
953
- const kolonRengi = kolonRenkleri?.[colIndex];
954
- if (typeof kolonRengi === 'string') {
955
- return kolonRengi;
956
- }
957
- const kolonNo = colIndex + 1;
958
- for (const kolon of kolonRenkleri ?? []) {
959
- if (typeof kolon === 'object' && kolon.columnNo === kolonNo) {
960
- return kolon.color;
961
- }
962
- }
963
- return undefined;
964
- }
965
- static excelFormuluneDonustur(formul) {
966
- const ceviriler = {
967
- 'TOPLA': 'SUM',
968
- 'EĞER': 'IF',
969
- 'VE': 'AND',
970
- 'VEYA': 'OR',
971
- 'YUVARLA': 'ROUND',
972
- 'EĞERSAY': 'COUNTIF',
973
- 'ETOPLA': 'SUMIF',
974
- 'ORTALAMA': 'AVERAGE',
975
- 'MİN': 'MIN',
976
- 'MAK': 'MAX'
977
- };
978
- let sonuc = formul.slice(1).replaceAll(';', ',');
979
- for (const [kaynak, hedef] of Object.entries(ceviriler)) {
980
- const pattern = new RegExp(`\\b${kaynak}\\b`, 'g');
981
- sonuc = sonuc.replace(pattern, hedef);
982
- }
983
- return sonuc;
984
- }
985
- static footerFormulunuOlustur(column, colIndex, startRow, startCol, veriSatirSayisi) {
986
- if (!veriSatirSayisi) {
987
- return undefined;
988
- }
989
- const fonksiyon = String(column.footer?.function ?? '').trim().toUpperCase();
990
- if (!fonksiyon) {
991
- return undefined;
992
- }
993
- const kolonHarf = worksheetColumnName(startCol + colIndex);
994
- const ilkVeriSatiri = startRow + 1;
995
- const sonVeriSatiri = startRow + veriSatirSayisi;
996
- const aralik = `${kolonHarf}${ilkVeriSatiri}:${kolonHarf}${sonVeriSatiri}`;
997
- if (fonksiyon === 'SUBTOTAL') {
998
- return `SUBTOTAL(9,${aralik})`;
999
- }
1000
- const desteklenenFonksiyonlar = ['SUM', 'AVERAGE', 'COUNT', 'COUNTA', 'MAX', 'MIN'];
1001
- if (desteklenenFonksiyonlar.includes(fonksiyon)) {
1002
- return `${fonksiyon}(${aralik})`;
1003
- }
1004
- return undefined;
1005
- }
1006
- static sayfaAdiDuzenle(sheetName, index) {
1007
- const temizAd = sheetName
1008
- .replaceAll(/[\\/*?:[\]]/g, ' ')
1009
- .trim()
1010
- .slice(0, 31);
1011
- if (temizAd) {
1012
- return temizAd;
1013
- }
1014
- return `Sheet${index}`;
1015
- }
1016
- static dosyaAdiDuzenle(dosyaAdi) {
1017
- const temizAd = dosyaAdi
1018
- .replaceAll(/[<>:"/\\|?*]/g, ' ')
1019
- .trim()
1020
- .replaceAll(/\s+/g, ' ');
1021
- if (temizAd) {
1022
- return temizAd;
1023
- }
1024
- return 'Rapor';
1025
- }
1026
- static numberFormatDonustur(format) {
1027
- switch (format) {
1028
- case NumberFormatlar.long:
1029
- case 2:
1030
- case 5:
1031
- case 11:
1032
- return '#,##0';
1033
- case NumberFormatlar.real:
1034
- case 7:
1035
- case 12:
1036
- return '#,##0.00';
1037
- case 8:
1038
- return 'hh:mm';
1039
- case NumberFormatlar.tarih:
1040
- return 'dd.mm.yyyy';
1041
- case NumberFormatlar.tarih_yyyymmdd_tireli:
1042
- return 'yyyy-mm-dd';
1043
- case NumberFormatlar.tarih_AAAAYYYY:
1044
- return 'mmmm yyyy';
1045
- case NumberFormatlar.tarih_GGAAAAYYYY:
1046
- return 'dd mmmm yyyy';
1047
- case NumberFormatlar.tarih_YYYYMMDD:
1048
- return 'yyyy/mm/dd';
1049
- case NumberFormatlar.tarih_LongDate:
1050
- return 'dd mmmm yyyy dddd';
1051
- case NumberFormatlar.tarih_ga:
1052
- return 'd.m;@';
1053
- case NumberFormatlar.tarih_ggaa:
1054
- return 'dd.mm';
1055
- case NumberFormatlar.tarih_gaaaa:
1056
- return 'd.mmmm';
1057
- case NumberFormatlar.tarih_ggaaa:
1058
- return 'dd.mmm';
1059
- case NumberFormatlar.tarih_ggaaaa:
1060
- return 'dd.mmmm';
1061
- case NumberFormatlar.yuzde_BirHane:
1062
- return '0.0%';
1063
- case NumberFormatlar.genel:
1064
- return 'General';
1065
- case NumberFormatlar.metin:
1066
- return '@';
1067
- case NumberFormatlar.imp:
1068
- return '#,##0 "imp"';
1069
- case NumberFormatlar.clicks:
1070
- return '#,##0 "Clicks"';
1071
- case NumberFormatlar.gun:
1072
- return '#,##0 "Gün"';
1073
- case NumberFormatlar.view:
1074
- return '#,##0 "View"';
1075
- case NumberFormatlar.session:
1076
- return '#,##0 "Session"';
1077
- case NumberFormatlar.kisi:
1078
- return '#,##0 "Kişi"';
1079
- case NumberFormatlar.okunma:
1080
- return '#,##0 "Okunma"';
1081
- case NumberFormatlar.dinlenme:
1082
- return '#,##0 "Dinlenme"';
1083
- case NumberFormatlar.lead:
1084
- return '#,##0 "Lead"';
1085
- case NumberFormatlar.gizli:
1086
- return ';;;';
1087
- case 28:
1088
- return '#,##0.00 "₺"';
1089
- default:
1090
- return undefined;
1091
- }
1092
- }
1093
- }
1
+ import * as i0 from "@angular/core";
2
+ import { Injectable, inject } from "@angular/core";
3
+ import saveAs from "file-saver";
4
+ import { TranslateService } from "@ngx-translate/core";
5
+ import { GlobalFunctions } from "limitng/api";
6
+ import ExcelJS from "exceljs";
7
+ import { FontStyle, NumberFormatlar, VariableType } from "limitng/api/models/fourDConstants";
8
+ import { XLHAlign, XLVAlign } from "limitng/api/models/xl/xlConstants";
9
+ var ExcelRaporuSonuc = class {
10
+ constructor() {
11
+ this.book = {
12
+ author: "MedPlan",
13
+ activeSheetNo: 1
14
+ };
15
+ this.defaultFont = {
16
+ name: "Calibri",
17
+ size: 11
18
+ };
19
+ this.currentTableStyle = "";
20
+ this.sifirlariBasmaSayi = false;
21
+ this.sifirlariBasmaTarih = false;
22
+ this.sheets = [];
23
+ this.window = { displayGridLines: false };
24
+ }
25
+ };
26
+ var JsonToExcelTableBuilder = class {
27
+ constructor(table) {
28
+ this.table = table;
29
+ }
30
+ addColumn(column) {
31
+ this.table.columns.push({
32
+ arrayType: VariableType.text,
33
+ ...column
34
+ });
35
+ return this;
36
+ }
37
+ setRows(rows) {
38
+ this.table.collection = rows;
39
+ return this;
40
+ }
41
+ setStartColumn(sol) {
42
+ this.table.sol = sol;
43
+ return this;
44
+ }
45
+ setStartRow(ust) {
46
+ this.table.ust = ust;
47
+ return this;
48
+ }
49
+ getColumnSayisi() {
50
+ return this.table.columns.length;
51
+ }
52
+ };
53
+ var JsonToExcelSheetBuilder = class {
54
+ constructor(sheet) {
55
+ this.sheet = sheet;
56
+ }
57
+ addTable(rows, options = {}) {
58
+ const table = {
59
+ collection: rows,
60
+ columns: [],
61
+ ...options.autoFit !== void 0 && { autoFit: options.autoFit },
62
+ ...options.data && { data: options.data },
63
+ ...options.footer && { footer: options.footer },
64
+ ...options.header && { header: options.header },
65
+ ...options.sol !== void 0 && { sol: options.sol },
66
+ ...options.ust !== void 0 && { ust: options.ust }
67
+ };
68
+ this.sheet.tables ??= [];
69
+ this.sheet.tables.push(table);
70
+ return new JsonToExcelTableBuilder(table);
71
+ }
72
+ addUstBilgi(ustBilgi, font) {
73
+ this.sheet.ustBilgiler ??= [];
74
+ this.sheet.ustBilgiler.push(JsonToExcelParser.ustBilgiEkle(ustBilgi, font));
75
+ return this;
76
+ }
77
+ getUstBilgiSayisi() {
78
+ return this.sheet.ustBilgiler?.length ?? 0;
79
+ }
80
+ getSheetNo() {
81
+ return this.sheet.sheetNo;
82
+ }
83
+ setSheetName(sheetName) {
84
+ this.sheet.sheetName = sheetName;
85
+ return this;
86
+ }
87
+ setZoom(zoom) {
88
+ this.sheet.zoom = zoom;
89
+ return this;
90
+ }
91
+ };
92
+ var JsonToExcelReportBuilder = class {
93
+ constructor() {
94
+ this.sonuc = new ExcelRaporuSonuc();
95
+ }
96
+ addSheet(sheetName, options = {}) {
97
+ const sheet = {
98
+ sheetName,
99
+ sheetNo: this.sonuc.sheets.length + 1,
100
+ ...options.pageSetup && { pageSetup: options.pageSetup },
101
+ ...options.zoom !== void 0 && { zoom: options.zoom }
102
+ };
103
+ this.sonuc.sheets.push(sheet);
104
+ return new JsonToExcelSheetBuilder(sheet);
105
+ }
106
+ build() {
107
+ return this.sonuc;
108
+ }
109
+ setAuthor(author) {
110
+ this.sonuc.book.author = author;
111
+ return this;
112
+ }
113
+ setCurrentTableStyle(currentTableStyle) {
114
+ this.sonuc.currentTableStyle = currentTableStyle;
115
+ return this;
116
+ }
117
+ setSubject(subject) {
118
+ this.sonuc.book.subject = subject;
119
+ return this;
120
+ }
121
+ };
122
+ var JsonToExcelParser = class {
123
+ static async indir(sonuc, dosyaAdi) {
124
+ saveAs(await this.blobOlustur(sonuc), `${this.dosyaAdiDuzenle(dosyaAdi)}.xlsx`);
125
+ }
126
+ static async blobOlustur(sonuc) {
127
+ const buffer = await this.workbookOlustur(sonuc).xlsx.writeBuffer();
128
+ return new Blob([buffer], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
129
+ }
130
+ static standartPageSetupOlustur() {
131
+ return {
132
+ bottomMargin: 1,
133
+ centerHorizontally: true,
134
+ centerVertically: true,
135
+ fitToPagesTall: 1,
136
+ fitToPagesWide: 1,
137
+ leftMargin: 1,
138
+ orientation: 2,
139
+ rightMargin: 1,
140
+ topMargin: 1
141
+ };
142
+ }
143
+ static ustBilgiEkle(ustBilgi, font) {
144
+ return font ? {
145
+ font,
146
+ ustBilgi
147
+ } : { ustBilgi };
148
+ }
149
+ static raporOlustur() {
150
+ return new JsonToExcelReportBuilder();
151
+ }
152
+ static workbookOlustur(sonuc) {
153
+ const workbook = new ExcelJS.Workbook();
154
+ workbook.created = /* @__PURE__ */ new Date();
155
+ workbook.calcProperties.fullCalcOnLoad = true;
156
+ const gridLinesGorunur = sonuc.window.displayGridLines;
157
+ if (this.yeniYapiMi(sonuc)) {
158
+ workbook.creator = sonuc.book.author || "MedPlan";
159
+ workbook.subject = "";
160
+ workbook.description = "";
161
+ this.yeniFormatSheetsYaz(workbook, sonuc, gridLinesGorunur);
162
+ } else {
163
+ workbook.creator = sonuc.book.author || "MedPlan";
164
+ workbook.subject = this.konuVer(sonuc.book, sonuc.ustBilgiler?.[0]?.ustBilgi);
165
+ workbook.description = sonuc.book.comments || "";
166
+ this.eskiFormatSheetsYaz(workbook, sonuc, gridLinesGorunur);
167
+ }
168
+ this.aktifSayfayiAyarla(workbook, sonuc.book.activeSheetNo, workbook.worksheets.length);
169
+ return workbook;
170
+ }
171
+ static yeniYapiMi(sonuc) {
172
+ const ilkSheet = sonuc.sheets[0];
173
+ if (Array.isArray(ilkSheet?.tables)) return true;
174
+ const runtimeSonuc = sonuc;
175
+ return !Array.isArray(runtimeSonuc.tables);
176
+ }
177
+ static yeniFormatSheetsYaz(workbook, sonuc, gridLinesGorunur) {
178
+ for (let index = 0; index < sonuc.sheets.length; index++) {
179
+ const sheet = sonuc.sheets[index];
180
+ const sheetAdi = this.sayfaAdiDuzenle(sheet.sheetName || "Rapor", index + 1);
181
+ const worksheet = workbook.addWorksheet(sheetAdi);
182
+ const zoomScale = sheet.zoom && sheet.zoom > 0 ? sheet.zoom : void 0;
183
+ worksheet.views = [{
184
+ showGridLines: gridLinesGorunur,
185
+ ...zoomScale !== void 0 && { zoomScale }
186
+ }];
187
+ this.sayfaDuzeniniBelirle(worksheet, sheet);
188
+ const ustBilgiler = sheet.ustBilgiler ?? [];
189
+ this.yeniFormatUstBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
190
+ let sonSatir = ustBilgiler.length + 1;
191
+ for (const table of sheet.tables ?? []) sonSatir = Math.max(sonSatir, this.tabloyuYaz(worksheet, sonuc, table));
192
+ if (sheet.notlar?.length) this.notlariYazList(worksheet, sheet.notlar, sheet.not?.font, sonSatir + 2, sonuc.defaultFont);
193
+ }
194
+ if (sonuc.sheets.length === 0) {
195
+ const worksheet = workbook.addWorksheet("Rapor");
196
+ worksheet.views = [{ showGridLines: gridLinesGorunur }];
197
+ }
198
+ }
199
+ static eskiFormatSheetsYaz(workbook, sonuc, gridLinesGorunur) {
200
+ const tablesBySheet = this.sheetBazliTablolar(sonuc);
201
+ const ustBilgiler = sonuc.ustBilgiler ?? [];
202
+ const notlar = sonuc.notlar ?? [];
203
+ for (const sheetGrup of tablesBySheet) {
204
+ const worksheet = workbook.addWorksheet(sheetGrup.sheetName);
205
+ worksheet.views = [{ showGridLines: gridLinesGorunur }];
206
+ this.ustBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
207
+ let sonSatir = 1;
208
+ for (const table of sheetGrup.tables) sonSatir = Math.max(sonSatir, this.tabloyuYaz(worksheet, sonuc, table));
209
+ this.notlariYazList(worksheet, notlar, sonuc.not?.font, sonSatir + 2, sonuc.defaultFont);
210
+ }
211
+ if (tablesBySheet.length === 0) {
212
+ const worksheet = workbook.addWorksheet(this.bosRaporSheetAdiniVer(sonuc));
213
+ worksheet.views = [{ showGridLines: gridLinesGorunur }];
214
+ this.ustBilgileriYaz(worksheet, ustBilgiler, sonuc.defaultFont);
215
+ this.notlariYazList(worksheet, notlar, sonuc.not?.font, ustBilgiler.length + 2, sonuc.defaultFont);
216
+ }
217
+ }
218
+ static sheetBazliTablolar(sonuc) {
219
+ const grouped = /* @__PURE__ */ new Map();
220
+ for (const table of sonuc.tables ?? []) {
221
+ const sheetNo = this.tableSheetNoVer(table);
222
+ const sheetKey = this.sheetKeyVer(table, sheetNo, grouped.size + 1);
223
+ const existing = grouped.get(sheetKey);
224
+ if (existing) {
225
+ existing.tables.push(table);
226
+ continue;
227
+ }
228
+ grouped.set(sheetKey, {
229
+ sheetName: this.sheetAdiniBelirle(sonuc, table, grouped.size + 1, sheetNo),
230
+ ...sheetNo !== void 0 && { sheetNo },
231
+ tables: [table]
232
+ });
233
+ }
234
+ return Array.from(grouped.values()).sort((a, b) => this.sheetGrupSirasiVer(a) - this.sheetGrupSirasiVer(b));
235
+ }
236
+ static tableSheetNoVer(table) {
237
+ return table.sheetNo;
238
+ }
239
+ static sheetKeyVer(table, sheetNo, index) {
240
+ if (sheetNo !== void 0) return `sheet-no-${sheetNo}`;
241
+ const eskiSheetName = table.sheetName?.trim();
242
+ if (eskiSheetName) return `sheet-name-${eskiSheetName}`;
243
+ return `sheet-index-${index}`;
244
+ }
245
+ static sheetAdiniBelirle(sonuc, table, index, sheetNo) {
246
+ const jsonSheet = this.jsonSheetBul(sonuc.sheets, sheetNo, index);
247
+ if (jsonSheet?.sheetName?.trim()) return this.sayfaAdiDuzenle(jsonSheet.sheetName, index);
248
+ return this.sayfaAdiDuzenle(table.sheetName || "Rapor", index);
249
+ }
250
+ static jsonSheetBul(sheets, sheetNo, index) {
251
+ if (sheetNo !== void 0) return sheets.find((sheet) => sheet.sheetNo === sheetNo);
252
+ return sheets.find((sheet) => sheet.sheetNo === index) ?? sheets[index - 1];
253
+ }
254
+ static konuVer(book, ilkUstBilgi) {
255
+ return book.subject || ilkUstBilgi || "Rapor";
256
+ }
257
+ static bosRaporSheetAdiniVer(sonuc) {
258
+ const ilkSheetAdi = sonuc.sheets[0]?.sheetName;
259
+ return this.sayfaAdiDuzenle(ilkSheetAdi || "Rapor", 1);
260
+ }
261
+ static aktifSayfayiAyarla(workbook, activeSheetNo, toplamSheetSayisi) {
262
+ const aktifTab = this.aktifTabNoVer(activeSheetNo, toplamSheetSayisi);
263
+ if (aktifTab === void 0) return;
264
+ workbook.views = [{
265
+ activeTab: aktifTab,
266
+ firstSheet: aktifTab,
267
+ height: 2e4,
268
+ visibility: "visible",
269
+ width: 2e4,
270
+ x: 0,
271
+ y: 0
272
+ }];
273
+ }
274
+ static aktifTabNoVer(activeSheetNo, toplamSheetSayisi) {
275
+ if (toplamSheetSayisi <= 0) return;
276
+ return Math.min((Number.isFinite(activeSheetNo) && activeSheetNo > 0 ? activeSheetNo : 1) - 1, toplamSheetSayisi - 1);
277
+ }
278
+ static sheetGrupSirasiVer(sheetGrup) {
279
+ return sheetGrup.sheetNo ?? Number.MAX_SAFE_INTEGER;
280
+ }
281
+ static yeniFormatUstBilgileriYaz(worksheet, ustBilgiler, defaultFont) {
282
+ for (let index = 0; index < ustBilgiler.length; index++) {
283
+ const ustBilgi = ustBilgiler[index];
284
+ const hucre = worksheet.getCell(index + 1, 1);
285
+ hucre.value = ustBilgi.ustBilgi;
286
+ this.hucreFontunuUygula(hucre, ustBilgi.font, defaultFont);
287
+ hucre.alignment = {
288
+ horizontal: "left",
289
+ vertical: "middle",
290
+ wrapText: false
291
+ };
292
+ }
293
+ }
294
+ static ustBilgileriYaz(worksheet, ustBilgiler, defaultFont) {
295
+ for (const ustBilgi of ustBilgiler) {
296
+ const hucre = worksheet.getCell(ustBilgi.rowNo ?? 1, 1);
297
+ hucre.value = ustBilgi.ustBilgi;
298
+ this.hucreFontunuUygula(hucre, ustBilgi.font, defaultFont);
299
+ hucre.alignment = {
300
+ horizontal: "left",
301
+ vertical: "middle",
302
+ wrapText: false
303
+ };
304
+ }
305
+ }
306
+ static notlariYazList(worksheet, notlar, notFont, baslangicSatiri, defaultFont) {
307
+ let satirNo = baslangicSatiri;
308
+ for (const not of notlar) {
309
+ const cell = worksheet.getCell(satirNo, 1);
310
+ cell.value = not;
311
+ this.hucreFontunuUygula(cell, notFont, defaultFont);
312
+ cell.alignment = {
313
+ vertical: "middle",
314
+ wrapText: true
315
+ };
316
+ satirNo++;
317
+ }
318
+ }
319
+ static sayfaDuzeniniBelirle(worksheet, sheet) {
320
+ const { pageSetup } = sheet;
321
+ if (!pageSetup) return;
322
+ if (pageSetup.orientation === 2) worksheet.pageSetup.orientation = "landscape";
323
+ else if (pageSetup.orientation === 1) worksheet.pageSetup.orientation = "portrait";
324
+ if (pageSetup.leftMargin !== void 0 || pageSetup.rightMargin !== void 0 || pageSetup.topMargin !== void 0 || pageSetup.bottomMargin !== void 0 || pageSetup.headerMargin !== void 0 || pageSetup.footerMargin !== void 0) worksheet.pageSetup.margins = {
325
+ left: pageSetup.leftMargin ?? .7,
326
+ right: pageSetup.rightMargin ?? .7,
327
+ top: pageSetup.topMargin ?? .75,
328
+ bottom: pageSetup.bottomMargin ?? .75,
329
+ header: pageSetup.headerMargin ?? .3,
330
+ footer: pageSetup.footerMargin ?? .3
331
+ };
332
+ if (pageSetup.centerHorizontally !== void 0) worksheet.pageSetup.horizontalCentered = pageSetup.centerHorizontally;
333
+ if (pageSetup.centerVertically !== void 0) worksheet.pageSetup.verticalCentered = pageSetup.centerVertically;
334
+ const fitTall = pageSetup.fitToPagesTall;
335
+ const fitWide = pageSetup.fitToPagesWide;
336
+ if (fitTall !== void 0 || fitWide !== void 0 || pageSetup.fitToPagesTAut || pageSetup.fitToPagesWAut) {
337
+ worksheet.pageSetup.fitToPage = true;
338
+ worksheet.pageSetup.fitToHeight = pageSetup.fitToPagesTAut ? 0 : fitTall ?? 1;
339
+ worksheet.pageSetup.fitToWidth = pageSetup.fitToPagesWAut ? 0 : fitWide ?? 1;
340
+ }
341
+ if (typeof pageSetup.zoom === "number" && pageSetup.zoom > 0) worksheet.pageSetup.scale = pageSetup.zoom;
342
+ if (pageSetup.printArea) worksheet.pageSetup.printArea = pageSetup.printArea;
343
+ const pageHeader = this.baslikAltbilgiMetniOlustur(pageSetup.leftHeader, pageSetup.centerHeader, pageSetup.rightHeader);
344
+ const pageFooter = this.baslikAltbilgiMetniOlustur(pageSetup.leftFooter, pageSetup.centerFooter, pageSetup.rightFooter);
345
+ if (pageHeader) worksheet.headerFooter.oddHeader = pageHeader;
346
+ if (pageFooter) worksheet.headerFooter.oddFooter = pageFooter;
347
+ }
348
+ static baslikAltbilgiMetniOlustur(sol, orta, sag) {
349
+ const parcalar = [];
350
+ if (sol) parcalar.push(`&L${sol}`);
351
+ if (orta) parcalar.push(`&C${orta}`);
352
+ if (sag) parcalar.push(`&R${sag}`);
353
+ return parcalar.length ? parcalar.join("") : void 0;
354
+ }
355
+ static tabloyuYaz(worksheet, sonuc, table) {
356
+ if (!table.columns.length) return table.ust ?? 1;
357
+ const startRow = Math.max(1, table.ust ?? 1);
358
+ const startCol = Math.max(1, table.sol ?? 1);
359
+ const gecerliTableStyle = this.gecerliTableStyleVer(sonuc.currentTableStyle);
360
+ const gorunenBaslikMetinleri = table.columns.map((column) => this.baslikMetniniHazirla(column.header.title || "")).map((title) => title.replaceAll("\n", " "));
361
+ const tabloKolonAdlari = this.benzersizKolonAdlariOlustur(gorunenBaslikMetinleri);
362
+ const headerFont = table.header?.font;
363
+ const uygulanacakHeaderFont = headerFont?.color ? headerFont : {
364
+ ...headerFont,
365
+ color: "FFFFFFFF"
366
+ };
367
+ const dataFont = table.data?.font;
368
+ const hiddenRowSet = new Set(table.hiddenRows ?? []);
369
+ const formulCeller = [];
370
+ const hucreFontRenkleri = [];
371
+ const satirlar = table.collection.map((rowData, rowIndex) => table.columns.map((column, colIndex) => {
372
+ const hazirHucre = this.hucreDegeriniHazirla(rowData, column, sonuc.sifirlariBasmaSayi);
373
+ hucreFontRenkleri[rowIndex] ??= [];
374
+ hucreFontRenkleri[rowIndex][colIndex] = hazirHucre.fontColorArgb;
375
+ if (hazirHucre.deger !== null && typeof hazirHucre.deger === "object" && "formula" in hazirHucre.deger) {
376
+ formulCeller.push({
377
+ rowIndex,
378
+ colIndex,
379
+ column,
380
+ formula: hazirHucre.deger
381
+ });
382
+ return "";
383
+ }
384
+ return hazirHucre.deger;
385
+ }));
386
+ this.kolonGrubuYaz(worksheet, startRow, startCol, table);
387
+ const headerRow = worksheet.getRow(startRow);
388
+ const tableStyle = this.tableStyleDonustur(gecerliTableStyle);
389
+ const bosSatirEklendi = satirlar.length === 0;
390
+ const tabloSatirlari = bosSatirEklendi ? [table.columns.map(() => "")] : satirlar;
391
+ worksheet.addTable({
392
+ name: this.tabloAdiOlustur(worksheet.name, startRow, startCol),
393
+ ref: worksheet.getCell(startRow, startCol).address,
394
+ headerRow: true,
395
+ totalsRow: false,
396
+ ...tableStyle && { style: tableStyle },
397
+ columns: tabloKolonAdlari.map((ad) => ({
398
+ name: ad,
399
+ filterButton: true
400
+ })),
401
+ rows: tabloSatirlari
402
+ });
403
+ if (bosSatirEklendi) worksheet.getRow(startRow + 1).hidden = true;
404
+ this.kolonGenislikleriniUygula(worksheet, startCol, table.columns, satirlar, table.autoFit);
405
+ for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
406
+ const column = table.columns[colIndex];
407
+ const cell = headerRow.getCell(startCol + colIndex);
408
+ cell.alignment = {
409
+ horizontal: this.yatayHizaDonustur(column.header.horizontalAlignment),
410
+ vertical: "bottom",
411
+ wrapText: false
412
+ };
413
+ this.hucreFontunuUygula(cell, uygulanacakHeaderFont, sonuc.defaultFont);
414
+ }
415
+ for (let rowIndex = 0; rowIndex < table.collection.length; rowIndex++) {
416
+ const wsRow = worksheet.getRow(startRow + 1 + rowIndex);
417
+ const satir1Bazli = rowIndex + 1;
418
+ if (hiddenRowSet.has(satir1Bazli)) wsRow.hidden = true;
419
+ const rowHeight = table.rowHeights?.find((rh) => rh.rowNo === satir1Bazli);
420
+ if (rowHeight?.height) wsRow.height = rowHeight.height;
421
+ for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
422
+ const column = table.columns[colIndex];
423
+ const cell = wsRow.getCell(startCol + colIndex);
424
+ const hucreDegeri = satirlar[rowIndex][colIndex];
425
+ cell.value = hucreDegeri;
426
+ this.hucreFontunuUygula(cell, dataFont, sonuc.defaultFont);
427
+ const hucreFontRengi = hucreFontRenkleri[rowIndex]?.[colIndex];
428
+ if (hucreFontRengi) cell.font = {
429
+ ...cell.font ?? {},
430
+ color: { argb: hucreFontRengi }
431
+ };
432
+ const numFmt = this.numberFormatDonustur(this.kolonFormatiniBelirle(column));
433
+ if (numFmt) cell.numFmt = numFmt;
434
+ else if (hucreDegeri instanceof Date) cell.numFmt = this.varsayilanTarihFormatiniVer();
435
+ const hucreHizasi = this.hucreYatayHizasiniBelirle(column);
436
+ cell.alignment = {
437
+ ...hucreHizasi !== void 0 && { horizontal: hucreHizasi },
438
+ vertical: this.dikeyHizaDonustur(column.verticalAlignment),
439
+ wrapText: false
440
+ };
441
+ const colFontColor = table.columnFontColors?.[colIndex];
442
+ if (colFontColor) {
443
+ const argb = this.argbDonustur(colFontColor);
444
+ if (argb) cell.font = {
445
+ ...cell.font ?? {},
446
+ color: { argb }
447
+ };
448
+ }
449
+ const colIntColor = this.kolonRenginiBul(table.columnInteriorColors, colIndex);
450
+ if (colIntColor) {
451
+ const argb = this.argbDonustur(colIntColor);
452
+ if (argb) cell.fill = {
453
+ type: "pattern",
454
+ pattern: "solid",
455
+ fgColor: { argb }
456
+ };
457
+ }
458
+ const rowFontColor = table.rowFontColors?.find((rc) => rc.rowNo === satir1Bazli);
459
+ if (rowFontColor) {
460
+ const argb = this.argbDonustur(rowFontColor.color);
461
+ if (argb) cell.font = {
462
+ ...cell.font ?? {},
463
+ color: { argb }
464
+ };
465
+ }
466
+ const rowIntColor = table.rowInteriorColors?.find((rc) => rc.rowNo === satir1Bazli);
467
+ if (rowIntColor) {
468
+ const argb = this.argbDonustur(rowIntColor.color);
469
+ if (argb) cell.fill = {
470
+ type: "pattern",
471
+ pattern: "solid",
472
+ fgColor: { argb }
473
+ };
474
+ }
475
+ }
476
+ }
477
+ for (const { rowIndex, colIndex, column, formula } of formulCeller) {
478
+ const cell = worksheet.getRow(startRow + 1 + rowIndex).getCell(startCol + colIndex);
479
+ cell.value = formula;
480
+ const formulHizasi = this.hucreYatayHizasiniBelirle(column);
481
+ cell.alignment = {
482
+ ...cell.alignment ?? {},
483
+ ...formulHizasi !== void 0 && { horizontal: formulHizasi }
484
+ };
485
+ }
486
+ let sonSatir = startRow + table.collection.length;
487
+ const footer = table.footer;
488
+ if (footer?.basilacak) {
489
+ const ustBosluk = footer.ustBosluk ?? 0;
490
+ const satirSayisi = footer.satirSayisi ?? 1;
491
+ const footerBasSatir = sonSatir + 1 + ustBosluk;
492
+ for (let fi = 0; fi < satirSayisi; fi++) {
493
+ const footerRow = worksheet.getRow(footerBasSatir + fi);
494
+ for (let colIndex = 0; colIndex < table.columns.length; colIndex++) {
495
+ const column = table.columns[colIndex];
496
+ const cell = footerRow.getCell(startCol + colIndex);
497
+ this.hucreFontunuUygula(cell, footer.font, sonuc.defaultFont);
498
+ const colFooter = column.footer;
499
+ if (colFooter?.isFunction) {
500
+ const footerFormula = this.footerFormulunuOlustur(column, colIndex, startRow, startCol, table.collection.length);
501
+ if (footerFormula) {
502
+ cell.value = { formula: footerFormula };
503
+ const numFmt = this.numberFormatDonustur(this.kolonFormatiniBelirle(column));
504
+ if (numFmt) cell.numFmt = numFmt;
505
+ }
506
+ } else if (colFooter?.title) cell.value = colFooter.title;
507
+ const footerHizasi = colFooter?.isFunction ? this.hucreYatayHizasiniBelirle(column) : this.yatayHizaDonustur(colFooter?.horizontalAlignment);
508
+ cell.alignment = {
509
+ ...footerHizasi !== void 0 && { horizontal: footerHizasi },
510
+ vertical: "middle",
511
+ wrapText: false
512
+ };
513
+ }
514
+ }
515
+ sonSatir = footerBasSatir + satirSayisi - 1;
516
+ }
517
+ return sonSatir;
518
+ }
519
+ static kolonGenislikleriniUygula(worksheet, startCol, columns, satirlar, autoFit) {
520
+ const filtreButonuBoslukPayi = 1.25;
521
+ const veriSagBoslukPayi = 1;
522
+ const autoFitAktif = autoFit !== false;
523
+ for (let index = 0; index < columns.length; index++) {
524
+ const worksheetColumn = worksheet.getColumn(startCol + index);
525
+ const tasarimGenisligi = (columns[index].width ?? 0) > 0 ? Math.round(columns[index].width / 7) : 0;
526
+ if (!autoFitAktif) {
527
+ worksheetColumn.width = tasarimGenisligi > 0 ? tasarimGenisligi : 10;
528
+ continue;
529
+ }
530
+ const baslikUzunlugu = this.metinUzunlugu(this.baslikMetniniHazirla(columns[index].header.title));
531
+ const veriUzunlugu = satirlar.reduce((max, satir) => Math.max(max, this.hucreMetinUzunlugu(satir[index])), 0);
532
+ worksheetColumn.width = Math.max(10, tasarimGenisligi, baslikUzunlugu + 2 + filtreButonuBoslukPayi, veriUzunlugu + 2 + veriSagBoslukPayi);
533
+ }
534
+ }
535
+ static baslikMetniniHazirla(metin) {
536
+ return metin.replaceAll("\r\n", " ").replaceAll("\r", " ").replaceAll("\n", " ").trim();
537
+ }
538
+ static hucreMetinUzunlugu(deger) {
539
+ if (deger === null || deger === void 0) return 0;
540
+ if (typeof deger === "string") return this.metinUzunlugu(deger);
541
+ if (typeof deger === "number" || typeof deger === "boolean") return String(deger).length;
542
+ if (deger instanceof Date) return 19;
543
+ if (typeof deger === "object" && "formula" in deger) return this.metinUzunlugu(String(deger.formula));
544
+ return this.metinUzunlugu(String(deger));
545
+ }
546
+ static hucreYatayHizasiniBelirle(column) {
547
+ if (this.sayisalKolonMu(column.arrayType)) return "right";
548
+ if (this.booleanKolonMu(column.arrayType)) return "center";
549
+ if (column.horizontalAlignment === void 0) return;
550
+ return this.yatayHizaDonustur(column.horizontalAlignment);
551
+ }
552
+ static kolonFormatiniBelirle(column) {
553
+ if (column.format !== void 0 && column.format !== NumberFormatlar.belirsiz) return column.format;
554
+ switch (column.arrayType) {
555
+ case VariableType.integer:
556
+ case VariableType.longint: return NumberFormatlar.long;
557
+ case VariableType.real: return NumberFormatlar.real;
558
+ case VariableType.date: return NumberFormatlar.tarih;
559
+ default: return column.format;
560
+ }
561
+ }
562
+ static sayisalKolonMu(arrayType) {
563
+ switch (arrayType) {
564
+ case VariableType.integer:
565
+ case VariableType.longint:
566
+ case VariableType.real: return true;
567
+ default: return false;
568
+ }
569
+ }
570
+ static booleanKolonMu(arrayType) {
571
+ return arrayType === VariableType.boolean;
572
+ }
573
+ static metinUzunlugu(metin) {
574
+ return metin.replaceAll("\r", "").split("\n").reduce((max, parca) => Math.max(max, parca.trim().length), 0);
575
+ }
576
+ static kolonGrubuYaz(worksheet, startRow, startCol, table) {
577
+ const columnGroups = table.columnGroup;
578
+ if (!columnGroups?.length || startRow <= 1) return;
579
+ const grupSatiri = startRow - 1;
580
+ for (const columnGroup of columnGroups) {
581
+ const baslangicIndex = table.columns.findIndex((column) => column.property === columnGroup.groupStart);
582
+ const bitisIndex = table.columns.findIndex((column) => column.property === columnGroup.groupEnd);
583
+ const baslangicKolonu = baslangicIndex >= 0 ? startCol + baslangicIndex : void 0;
584
+ const bitisKolonu = bitisIndex >= 0 ? startCol + bitisIndex : void 0;
585
+ if (!baslangicKolonu || !bitisKolonu || bitisKolonu < baslangicKolonu) continue;
586
+ worksheet.mergeCells(grupSatiri, baslangicKolonu, grupSatiri, bitisKolonu);
587
+ const grupHucre = worksheet.getCell(grupSatiri, baslangicKolonu);
588
+ grupHucre.value = columnGroup.groupName;
589
+ grupHucre.alignment = {
590
+ horizontal: "center",
591
+ vertical: "middle"
592
+ };
593
+ grupHucre.font = {
594
+ bold: true,
595
+ size: 11,
596
+ color: { argb: "FFF79646" }
597
+ };
598
+ grupHucre.fill = {
599
+ type: "pattern",
600
+ pattern: "solid",
601
+ fgColor: { argb: "FFFFFFFF" }
602
+ };
603
+ for (let col = baslangicKolonu; col <= bitisKolonu; col++) {
604
+ const hucre = worksheet.getCell(grupSatiri, col);
605
+ hucre.border = {
606
+ ...hucre.border,
607
+ top: {
608
+ style: "medium",
609
+ color: { argb: "FFF79646" }
610
+ },
611
+ ...col === baslangicKolonu ? { left: {
612
+ style: "medium",
613
+ color: { argb: "FFF79646" }
614
+ } } : hucre.border?.left ? { left: hucre.border.left } : {},
615
+ ...col === bitisKolonu ? { right: {
616
+ style: "medium",
617
+ color: { argb: "FFF79646" }
618
+ } } : hucre.border?.right ? { right: hucre.border.right } : {}
619
+ };
620
+ }
621
+ }
622
+ }
623
+ static hucreDegeriniHazirla(row, column, sifirlariBasmaSayi) {
624
+ const value = row[column.property];
625
+ if (typeof value === "string" && value.startsWith("=")) return { deger: { formula: this.excelFormuluneDonustur(value) } };
626
+ if ((typeof value === "number" && value === 0 || typeof value === "string" && this.sayisalKolonMu(column.arrayType) && value.trim() !== "" && Number(value) === 0) && sifirlariBasmaSayi) return { deger: null };
627
+ if (value === null || value === void 0) return { deger: "" };
628
+ const htmlHucre = column.htmlKoduGelebilir === true && typeof value === "string" ? this.htmlHucreIceriginiHazirla(value) : void 0;
629
+ const normallesenDeger = htmlHucre?.deger ?? value;
630
+ if (typeof normallesenDeger === "string" && normallesenDeger.startsWith("=")) return this.hazirHucreDegeriOlustur({ formula: this.excelFormuluneDonustur(normallesenDeger) }, htmlHucre?.fontColorArgb);
631
+ if (typeof value === "string" && typeof normallesenDeger === "string") {
632
+ const tarihMetni = this.tarihStringiniExcelMetnineDonustur(normallesenDeger, column);
633
+ if (tarihMetni) return this.hazirHucreDegeriOlustur(tarihMetni, htmlHucre?.fontColorArgb);
634
+ const tarihDegeri = this.tarihStringiniDateeDonustur(normallesenDeger);
635
+ if (tarihDegeri) return this.hazirHucreDegeriOlustur(tarihDegeri, htmlHucre?.fontColorArgb);
636
+ }
637
+ if (normallesenDeger instanceof Date) return this.hazirHucreDegeriOlustur(this.excelIcinTarihiNormalizeEt(normallesenDeger), htmlHucre?.fontColorArgb);
638
+ if (this.booleanKolonMu(column.arrayType)) return this.hazirHucreDegeriOlustur(normallesenDeger === true ? "+" : "", htmlHucre?.fontColorArgb);
639
+ if (typeof normallesenDeger === "number" || typeof normallesenDeger === "string") return this.hazirHucreDegeriOlustur(normallesenDeger, htmlHucre?.fontColorArgb);
640
+ return this.hazirHucreDegeriOlustur(String(normallesenDeger), htmlHucre?.fontColorArgb);
641
+ }
642
+ static hazirHucreDegeriOlustur(deger, fontColorArgb) {
643
+ return {
644
+ deger,
645
+ ...fontColorArgb ? { fontColorArgb } : {}
646
+ };
647
+ }
648
+ static htmlHucreIceriginiHazirla(value) {
649
+ if (!/[<>]/.test(value)) return;
650
+ const deger = value.replaceAll(/<br\s*\/?>/gi, "\n").replaceAll(/<\/p\s*>/gi, "\n").replaceAll(/<p\b[^>]*>/gi, "").replaceAll(/<\/div\s*>/gi, "\n").replaceAll(/<div\b[^>]*>/gi, "").replaceAll(/<[^>]+>/g, "").replaceAll(/&nbsp;/gi, " ").trim();
651
+ const colorValue = this.htmlFontRenginiBul(value);
652
+ const fontColorArgb = this.argbDonustur(colorValue);
653
+ if (deger === value && !fontColorArgb) return;
654
+ return {
655
+ deger,
656
+ ...fontColorArgb && { fontColorArgb }
657
+ };
658
+ }
659
+ static htmlFontRenginiBul(value) {
660
+ const fontColorMatch = /<font\b[^>]*\bcolor\s*=\s*["']?([^"' >]+)["']?[^>]*>/i.exec(value);
661
+ if (fontColorMatch?.[1]) return fontColorMatch[1].trim();
662
+ const styleColorMatch = /<(?:font|span)\b[^>]*\bstyle\s*=\s*["'][^"']*\bcolor\s*:\s*([^;"']+)/i.exec(value);
663
+ if (styleColorMatch?.[1]) return styleColorMatch[1].trim();
664
+ }
665
+ static tarihStringiniDateeDonustur(value) {
666
+ const trimmedValue = value.trim();
667
+ const isoDateMatch = /^(\d{4})-(\d{2})-(\d{2})(?:$|[T\s])/.exec(trimmedValue);
668
+ if (!isoDateMatch) return;
669
+ const year = Number(isoDateMatch[1]);
670
+ const month = Number(isoDateMatch[2]);
671
+ const day = Number(isoDateMatch[3]);
672
+ if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day)) return;
673
+ const date = new Date(year, month - 1, day);
674
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) return;
675
+ return new Date(Date.UTC(year, month - 1, day, 12, 0, 0, 0));
676
+ }
677
+ static tarihStringiniExcelMetnineDonustur(value, column) {
678
+ if (!this.sadeceTarihKolonuMu(column)) return;
679
+ const trimmedValue = value.trim();
680
+ const isoDateMatch = /^(\d{4})-(\d{2})-(\d{2})$/.exec(trimmedValue);
681
+ if (!isoDateMatch) return;
682
+ const year = Number(isoDateMatch[1]);
683
+ const month = Number(isoDateMatch[2]);
684
+ const day = Number(isoDateMatch[3]);
685
+ if (!Number.isInteger(year) || !Number.isInteger(month) || !Number.isInteger(day)) return;
686
+ const date = new Date(year, month - 1, day);
687
+ if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) return;
688
+ return `${String(day).padStart(2, "0")}.${String(month).padStart(2, "0")}.${year}`;
689
+ }
690
+ static excelIcinTarihiNormalizeEt(value) {
691
+ if (value.getHours() !== 0 || value.getMinutes() !== 0 || value.getSeconds() !== 0 || value.getMilliseconds() !== 0) return value;
692
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), 12, 0, 0, 0));
693
+ }
694
+ static varsayilanTarihFormatiniVer() {
695
+ return "dd.mm.yyyy";
696
+ }
697
+ static sadeceTarihKolonuMu(column) {
698
+ return this.kolonFormatiniBelirle(column) === NumberFormatlar.tarih;
699
+ }
700
+ static benzersizKolonAdlariOlustur(adlar) {
701
+ const sayaclar = /* @__PURE__ */ new Map();
702
+ return adlar.map((ad) => {
703
+ const temelAd = ad || " ";
704
+ const sayi = sayaclar.get(temelAd) ?? 0;
705
+ sayaclar.set(temelAd, sayi + 1);
706
+ return sayi === 0 ? temelAd : `${temelAd}_${sayi}`;
707
+ });
708
+ }
709
+ static hucreFontunuUygula(cell, font, defaultFont) {
710
+ const style = font?.style ?? 0;
711
+ const excelFont = {};
712
+ const fontName = font?.name || defaultFont?.name;
713
+ if (fontName) excelFont.name = fontName;
714
+ const fontSize = font?.size && font.size > 0 ? font.size : defaultFont?.size;
715
+ if (fontSize && fontSize > 0) excelFont.size = fontSize;
716
+ if (font?.color) {
717
+ const color = this.argbDonustur(font.color);
718
+ if (color) excelFont.color = { argb: color };
719
+ }
720
+ excelFont.bold = Boolean(style & FontStyle.bold);
721
+ excelFont.italic = Boolean(style & FontStyle.italic);
722
+ excelFont.underline = Boolean(style & FontStyle.underline);
723
+ cell.font = excelFont;
724
+ }
725
+ static gecerliTableStyleVer(tableStyle) {
726
+ if (!tableStyle) return;
727
+ const style = tableStyle.trim();
728
+ if (/^TableStyleLight([1-9]|1\d|2[0-1])$/.test(style)) return style;
729
+ if (/^TableStyleMedium([1-9]|1\d|2[0-1])$/.test(style)) return style;
730
+ if (/^TableStyleDark([1-9]|10|11)$/.test(style)) return style;
731
+ }
732
+ static tableStyleDonustur(theme) {
733
+ if (!theme) return;
734
+ return {
735
+ theme,
736
+ showRowStripes: true
737
+ };
738
+ }
739
+ static tabloAdiOlustur(sheetName, startRow, startCol) {
740
+ return `T_${sheetName.replaceAll(/[^A-Za-z0-9]/g, "_")}_R${startRow}C${startCol}`;
741
+ }
742
+ static yatayHizaDonustur(value) {
743
+ switch (value) {
744
+ case XLHAlign.xlHAlignCenter: return "center";
745
+ case XLHAlign.xlHAlignCenterAcrossSelection: return "centerContinuous";
746
+ case XLHAlign.xlHAlignDistributed: return "distributed";
747
+ case XLHAlign.xlHAlignFill: return "fill";
748
+ case XLHAlign.xlHAlignGeneral: return "left";
749
+ case XLHAlign.xlHAlignJustify: return "justify";
750
+ case XLHAlign.xlHAlignLeft: return "left";
751
+ case XLHAlign.xlHAlignRight: return "right";
752
+ default: return "left";
753
+ }
754
+ }
755
+ static dikeyHizaDonustur(value) {
756
+ switch (value) {
757
+ case XLVAlign.xlVAlignTop: return "top";
758
+ case XLVAlign.xlVAlignBottom: return "bottom";
759
+ case XLVAlign.xlVAlignDistributed: return "distributed";
760
+ case XLVAlign.xlVAlignJustify: return "justify";
761
+ default: return "middle";
762
+ }
763
+ }
764
+ static argbDonustur(color) {
765
+ if (!color) return;
766
+ const cssColor = color.trim().toLowerCase();
767
+ const rgbMatch = cssColor.match(/^rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);
768
+ if (rgbMatch) {
769
+ const rgbDegerleri = rgbMatch.slice(1).map((value) => Number(value));
770
+ if (rgbDegerleri.every((value) => Number.isInteger(value) && value >= 0 && value <= 255)) return `FF${rgbDegerleri.map((value) => value.toString(16).padStart(2, "0")).join("").toUpperCase()}`;
771
+ }
772
+ const namedColors = {
773
+ black: "FF000000",
774
+ blue: "FF0000FF",
775
+ cyan: "FF00FFFF",
776
+ gray: "FF808080",
777
+ green: "FF008000",
778
+ grey: "FF808080",
779
+ magenta: "FFFF00FF",
780
+ orange: "FFFFA500",
781
+ purple: "FF800080",
782
+ red: "FFFF0000",
783
+ white: "FFFFFFFF",
784
+ yellow: "FFFFFF00"
785
+ };
786
+ if (namedColors[cssColor]) return namedColors[cssColor];
787
+ const hexColor = cssColor.replace("#", "");
788
+ if (/^[0-9a-f]{6}$/i.test(hexColor)) return `FF${hexColor.toUpperCase()}`;
789
+ if (/^[0-9A-Fa-f]{8}$/.test(color)) return color.toUpperCase();
790
+ const numericColor = Number(color);
791
+ if (!Number.isFinite(numericColor)) return;
792
+ return `FF${[
793
+ numericColor & 255,
794
+ numericColor >> 8 & 255,
795
+ numericColor >> 16 & 255
796
+ ].map((value) => value.toString(16).padStart(2, "0")).join("").toUpperCase()}`;
797
+ }
798
+ static kolonRenginiBul(kolonRenkleri, colIndex) {
799
+ const kolonRengi = kolonRenkleri?.[colIndex];
800
+ if (typeof kolonRengi === "string") return kolonRengi;
801
+ const kolonNo = colIndex + 1;
802
+ for (const kolon of kolonRenkleri ?? []) if (typeof kolon === "object" && kolon.columnNo === kolonNo) return kolon.color;
803
+ }
804
+ static excelFormuluneDonustur(formul) {
805
+ const ceviriler = {
806
+ "TOPLA": "SUM",
807
+ "EĞER": "IF",
808
+ "VE": "AND",
809
+ "VEYA": "OR",
810
+ "YUVARLA": "ROUND",
811
+ "EĞERSAY": "COUNTIF",
812
+ "ETOPLA": "SUMIF",
813
+ "ORTALAMA": "AVERAGE",
814
+ "MİN": "MIN",
815
+ "MAK": "MAX"
816
+ };
817
+ let sonuc = formul.slice(1).replaceAll(";", ",");
818
+ for (const [kaynak, hedef] of Object.entries(ceviriler)) {
819
+ const pattern = new RegExp(`\\b${kaynak}\\b`, "g");
820
+ sonuc = sonuc.replace(pattern, hedef);
821
+ }
822
+ return sonuc;
823
+ }
824
+ static footerFormulunuOlustur(column, colIndex, startRow, startCol, veriSatirSayisi) {
825
+ if (!veriSatirSayisi) return;
826
+ const fonksiyon = String(column.footer?.function ?? "").trim().toUpperCase();
827
+ if (!fonksiyon) return;
828
+ const kolonHarf = worksheetColumnName(startCol + colIndex);
829
+ const aralik = `${kolonHarf}${startRow + 1}:${kolonHarf}${startRow + veriSatirSayisi}`;
830
+ if (fonksiyon === "SUBTOTAL") return `SUBTOTAL(9,${aralik})`;
831
+ if ([
832
+ "SUM",
833
+ "AVERAGE",
834
+ "COUNT",
835
+ "COUNTA",
836
+ "MAX",
837
+ "MIN"
838
+ ].includes(fonksiyon)) return `${fonksiyon}(${aralik})`;
839
+ }
840
+ static sayfaAdiDuzenle(sheetName, index) {
841
+ const temizAd = sheetName.replaceAll(/[\\/*?:[\]]/g, " ").trim().slice(0, 31);
842
+ if (temizAd) return temizAd;
843
+ return `Sheet${index}`;
844
+ }
845
+ static dosyaAdiDuzenle(dosyaAdi) {
846
+ const temizAd = dosyaAdi.replaceAll(/[<>:"/\\|?*]/g, " ").trim().replaceAll(/\s+/g, " ");
847
+ if (temizAd) return temizAd;
848
+ return "Rapor";
849
+ }
850
+ static numberFormatDonustur(format) {
851
+ switch (format) {
852
+ case NumberFormatlar.long:
853
+ case 2:
854
+ case 5:
855
+ case 11: return "#,##0";
856
+ case NumberFormatlar.real:
857
+ case 7:
858
+ case 12: return "#,##0.00";
859
+ case 8: return "hh:mm";
860
+ case NumberFormatlar.tarih: return "dd.mm.yyyy";
861
+ case NumberFormatlar.tarih_yyyymmdd_tireli: return "yyyy-mm-dd";
862
+ case NumberFormatlar.tarih_AAAAYYYY: return "mmmm yyyy";
863
+ case NumberFormatlar.tarih_GGAAAAYYYY: return "dd mmmm yyyy";
864
+ case NumberFormatlar.tarih_YYYYMMDD: return "yyyy/mm/dd";
865
+ case NumberFormatlar.tarih_LongDate: return "dd mmmm yyyy dddd";
866
+ case NumberFormatlar.tarih_ga: return "d.m;@";
867
+ case NumberFormatlar.tarih_ggaa: return "dd.mm";
868
+ case NumberFormatlar.tarih_gaaaa: return "d.mmmm";
869
+ case NumberFormatlar.tarih_ggaaa: return "dd.mmm";
870
+ case NumberFormatlar.tarih_ggaaaa: return "dd.mmmm";
871
+ case NumberFormatlar.yuzde_BirHane: return "0.0%";
872
+ case NumberFormatlar.genel: return "General";
873
+ case NumberFormatlar.metin: return "@";
874
+ case NumberFormatlar.imp: return "#,##0 \"imp\"";
875
+ case NumberFormatlar.clicks: return "#,##0 \"Clicks\"";
876
+ case NumberFormatlar.gun: return "#,##0 \"Gün\"";
877
+ case NumberFormatlar.view: return "#,##0 \"View\"";
878
+ case NumberFormatlar.session: return "#,##0 \"Session\"";
879
+ case NumberFormatlar.kisi: return "#,##0 \"Kişi\"";
880
+ case NumberFormatlar.okunma: return "#,##0 \"Okunma\"";
881
+ case NumberFormatlar.dinlenme: return "#,##0 \"Dinlenme\"";
882
+ case NumberFormatlar.lead: return "#,##0 \"Lead\"";
883
+ case NumberFormatlar.gizli: return ";;;";
884
+ case 28: return "#,##0.00 \"₺\"";
885
+ default: return;
886
+ }
887
+ }
888
+ };
1094
889
  function worksheetColumnName(columnNumber) {
1095
- let kalan = columnNumber;
1096
- let sonuc = '';
1097
- while (kalan > 0) {
1098
- const mod = (kalan - 1) % 26;
1099
- sonuc = String.fromCharCode(65 + mod) + sonuc;
1100
- kalan = Math.floor((kalan - 1) / 26);
1101
- }
1102
- return sonuc;
1103
- }
1104
-
1105
- class BlobResponseHandlerService {
1106
- constructor() {
1107
- this.translateService = inject(TranslateService);
1108
- }
1109
- handleReportResponse(response, successDetailKey, htmlTitle = 'Rapor Sonucu') {
1110
- const body = response.body;
1111
- if (!body) {
1112
- return null;
1113
- }
1114
- const contentDisposition = response.headers.get('content-disposition');
1115
- const contentType = response.headers.get('Content-Type') ?? body.type;
1116
- if (contentDisposition) {
1117
- return this.handleDownload(body, contentDisposition, contentType, successDetailKey);
1118
- }
1119
- this.handleViewHtml(body, htmlTitle);
1120
- return null;
1121
- }
1122
- downloadResponse(response) {
1123
- const body = response.body;
1124
- if (!body) {
1125
- return false;
1126
- }
1127
- const contentDisposition = response.headers.get('content-disposition');
1128
- if (!contentDisposition) {
1129
- return false;
1130
- }
1131
- const contentType = response.headers.get('Content-Type') ?? (body instanceof Blob ? body.type : 'application/octet-stream');
1132
- this.downloadBlob(body, contentDisposition, contentType);
1133
- return true;
1134
- }
1135
- viewHtmlBody(body, htmlTitle = 'Rapor Sonucu') {
1136
- if (!body) {
1137
- return;
1138
- }
1139
- this.handleViewHtml(body, htmlTitle);
1140
- }
1141
- async handleJsonExcelResponse(body, options) {
1142
- if (!body) {
1143
- return null;
1144
- }
1145
- try {
1146
- const jsonStr = await body.text();
1147
- const result = Object.assign(options.createResult(), JSON.parse(jsonStr));
1148
- const fileName = options.getFileName?.(result) ?? options.fileName;
1149
- if (!fileName) {
1150
- return null;
1151
- }
1152
- await JsonToExcelParser.indir(result, fileName);
1153
- return {
1154
- severity: 'success',
1155
- summary: this.translateService.instant('genel.bilgi'),
1156
- detail: options.successDetail ?? this.translateService.instant(options.successDetailKey ?? '')
1157
- };
1158
- }
1159
- catch (error) {
1160
- console.error(options.errorLogMessage, error);
1161
- return null;
1162
- }
1163
- }
1164
- handleDownload(body, contentDisposition, contentType, successDetailKey) {
1165
- this.downloadBlob(body, contentDisposition, contentType);
1166
- return {
1167
- severity: 'success',
1168
- summary: this.translateService.instant('genel.bilgi'),
1169
- detail: this.translateService.instant(successDetailKey)
1170
- };
1171
- }
1172
- downloadBlob(body, contentDisposition, contentType) {
1173
- const decodedContentDisposition = contentDisposition.replaceAll(/\\u([0-9A-Fa-f]{4})/g, (_, code) => String.fromCodePoint(Number.parseInt(code, 16)));
1174
- const filename = GlobalFunctions.getFilenameFromContentDisposition(decodedContentDisposition);
1175
- const blob = new Blob([body], { type: contentType });
1176
- saveAs(blob, filename);
1177
- }
1178
- handleViewHtml(body, htmlTitle) {
1179
- body.text().then((html) => {
1180
- const wnd = window.open('', '_blank');
1181
- if (!wnd) {
1182
- return;
1183
- }
1184
- wnd.document.title = htmlTitle;
1185
- const iframe = wnd.document.createElement('iframe');
1186
- iframe.style.width = '100%';
1187
- iframe.style.height = '100%';
1188
- iframe.style.border = 'none';
1189
- iframe.setAttribute('srcdoc', html);
1190
- wnd.document.body.style.margin = '0';
1191
- wnd.document.body.style.padding = '0';
1192
- wnd.document.body.appendChild(iframe);
1193
- });
1194
- }
1195
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: BlobResponseHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1196
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: BlobResponseHandlerService, providedIn: 'root' }); }
890
+ let kalan = columnNumber;
891
+ let sonuc = "";
892
+ while (kalan > 0) {
893
+ const mod = (kalan - 1) % 26;
894
+ sonuc = String.fromCharCode(65 + mod) + sonuc;
895
+ kalan = Math.floor((kalan - 1) / 26);
896
+ }
897
+ return sonuc;
1197
898
  }
1198
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: BlobResponseHandlerService, decorators: [{
1199
- type: Injectable,
1200
- args: [{ providedIn: 'root' }]
1201
- }] });
1202
-
1203
- /**
1204
- * Generated bundle index. Do not edit.
1205
- */
1206
-
899
+ var BlobResponseHandlerService = class BlobResponseHandlerService {
900
+ constructor() {
901
+ this.translateService = inject(TranslateService);
902
+ }
903
+ handleReportResponse(response, successDetailKey, htmlTitle = "Rapor Sonucu") {
904
+ const body = response.body;
905
+ if (!body) return null;
906
+ const contentDisposition = response.headers.get("content-disposition");
907
+ const contentType = response.headers.get("Content-Type") ?? body.type;
908
+ if (contentDisposition) return this.handleDownload(body, contentDisposition, contentType, successDetailKey);
909
+ this.handleViewHtml(body, htmlTitle);
910
+ return null;
911
+ }
912
+ downloadResponse(response) {
913
+ const body = response.body;
914
+ if (!body) return false;
915
+ const contentDisposition = response.headers.get("content-disposition");
916
+ if (!contentDisposition) return false;
917
+ const contentType = response.headers.get("Content-Type") ?? (body instanceof Blob ? body.type : "application/octet-stream");
918
+ this.downloadBlob(body, contentDisposition, contentType);
919
+ return true;
920
+ }
921
+ viewHtmlBody(body, htmlTitle = "Rapor Sonucu") {
922
+ if (!body) return;
923
+ this.handleViewHtml(body, htmlTitle);
924
+ }
925
+ async handleJsonExcelResponse(body, options) {
926
+ if (!body) return null;
927
+ try {
928
+ const jsonStr = await body.text();
929
+ const result = Object.assign(options.createResult(), JSON.parse(jsonStr));
930
+ const fileName = options.getFileName?.(result) ?? options.fileName;
931
+ if (!fileName) return null;
932
+ await JsonToExcelParser.indir(result, fileName);
933
+ return {
934
+ severity: "success",
935
+ summary: this.translateService.instant("genel.bilgi"),
936
+ detail: options.successDetail ?? this.translateService.instant(options.successDetailKey ?? "")
937
+ };
938
+ } catch (error) {
939
+ console.error(options.errorLogMessage, error);
940
+ return null;
941
+ }
942
+ }
943
+ handleDownload(body, contentDisposition, contentType, successDetailKey) {
944
+ this.downloadBlob(body, contentDisposition, contentType);
945
+ return {
946
+ severity: "success",
947
+ summary: this.translateService.instant("genel.bilgi"),
948
+ detail: this.translateService.instant(successDetailKey)
949
+ };
950
+ }
951
+ downloadBlob(body, contentDisposition, contentType) {
952
+ const decodedContentDisposition = contentDisposition.replaceAll(/\\u([0-9A-Fa-f]{4})/g, (_, code) => String.fromCodePoint(Number.parseInt(code, 16)));
953
+ const filename = GlobalFunctions.getFilenameFromContentDisposition(decodedContentDisposition);
954
+ saveAs(new Blob([body], { type: contentType }), filename);
955
+ }
956
+ handleViewHtml(body, htmlTitle) {
957
+ body.text().then((html) => {
958
+ const wnd = window.open("", "_blank");
959
+ if (!wnd) return;
960
+ wnd.document.title = htmlTitle;
961
+ const iframe = wnd.document.createElement("iframe");
962
+ iframe.style.width = "100%";
963
+ iframe.style.height = "100%";
964
+ iframe.style.border = "none";
965
+ iframe.setAttribute("srcdoc", html);
966
+ wnd.document.body.style.margin = "0";
967
+ wnd.document.body.style.padding = "0";
968
+ wnd.document.body.appendChild(iframe);
969
+ });
970
+ }
971
+ static {
972
+ this.ɵfac = i0.ɵɵngDeclareFactory({
973
+ minVersion: "12.0.0",
974
+ version: "22.1.8",
975
+ ngImport: i0,
976
+ type: BlobResponseHandlerService,
977
+ deps: [],
978
+ target: i0.ɵɵFactoryTarget.Injectable
979
+ });
980
+ }
981
+ static {
982
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
983
+ minVersion: "12.0.0",
984
+ version: "22.1.8",
985
+ ngImport: i0,
986
+ type: BlobResponseHandlerService,
987
+ providedIn: "root"
988
+ });
989
+ }
990
+ };
991
+ i0.ɵɵngDeclareClassMetadata({
992
+ minVersion: "12.0.0",
993
+ version: "22.1.8",
994
+ ngImport: i0,
995
+ type: BlobResponseHandlerService,
996
+ decorators: [{
997
+ type: Injectable,
998
+ args: [{ providedIn: "root" }]
999
+ }]
1000
+ });
1207
1001
  export { BlobResponseHandlerService, ExcelRaporuSonuc, JsonToExcelParser, JsonToExcelReportBuilder, JsonToExcelSheetBuilder, JsonToExcelTableBuilder };
1208
- //# sourceMappingURL=limitng-blob-response-handler.mjs.map
1002
+
1003
+ //# sourceMappingURL=limitng-blob-response-handler.mjs.map