暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

datatables-bootstrap5.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Core libraries
  2. import JSZip from 'jszip';
  3. import pdfMake from 'pdfmake/build/pdfmake';
  4. import pdfFonts from 'pdfmake/build/vfs_fonts';
  5. // DataTables libraries (with related plugins)
  6. import DataTable from 'datatables.net-bs5';
  7. import 'datatables.net-fixedcolumns-bs5';
  8. import 'datatables.net-fixedheader-bs5';
  9. import 'datatables.net-select-bs5';
  10. import 'datatables.net-buttons';
  11. import 'datatables.net-buttons-bs5';
  12. import 'datatables.net-buttons/js/buttons.html5';
  13. import 'datatables.net-buttons/js/buttons.print';
  14. import 'datatables.net-responsive';
  15. import 'datatables.net-responsive-bs5';
  16. import 'datatables.net-rowgroup-bs5';
  17. import 'datatables.net-datetime';
  18. // This solution related to font issues with pdfMake
  19. pdfMake.fonts = {
  20. Roboto: {
  21. normal: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Regular.ttf',
  22. bold: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Medium.ttf',
  23. italics: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-Italic.ttf',
  24. bolditalics: 'https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.66/fonts/Roboto/Roboto-MediumItalic.ttf'
  25. }
  26. };
  27. $.fn.dataTable.ext.buttons.pdfMake = pdfMake;
  28. // Attach libraries to the window object (if needed globally)
  29. try {
  30. window.pdfMake = pdfMake;
  31. window.pdfFonts = pdfFonts;
  32. window.JSZip = JSZip;
  33. } catch (e) {}
  34. window.DataTable = DataTable;
  35. // Export the libraries/modules
  36. export { DataTable, JSZip, pdfMake, pdfFonts };