underpost 2.7.7 → 2.7.9

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 (79) hide show
  1. package/.github/workflows/ghpkg.yml +115 -0
  2. package/.github/workflows/publish.yml +20 -3
  3. package/.github/workflows/pwa-microservices-template.page.yml +54 -0
  4. package/.github/workflows/pwa-microservices-template.test.yml +30 -0
  5. package/.vscode/settings.json +6 -0
  6. package/CHANGELOG.md +64 -16
  7. package/bin/cron.js +47 -0
  8. package/bin/db.js +9 -1
  9. package/bin/deploy.js +207 -11
  10. package/bin/file.js +17 -1
  11. package/bin/index.js +1 -1
  12. package/bin/util.js +22 -0
  13. package/conf.js +18 -4
  14. package/docker-compose.yml +1 -1
  15. package/package.json +3 -3
  16. package/src/api/core/core.router.js +9 -9
  17. package/src/api/core/core.service.js +6 -4
  18. package/src/api/default/default.service.js +4 -4
  19. package/src/api/file/file.service.js +3 -3
  20. package/src/api/user/user.service.js +7 -7
  21. package/src/client/components/core/Css.js +0 -222
  22. package/src/client/components/core/CssCore.js +30 -3
  23. package/src/client/components/core/Docs.js +110 -10
  24. package/src/client/components/core/Modal.js +224 -22
  25. package/src/client/components/core/Panel.js +1 -1
  26. package/src/client/components/core/PanelForm.js +2 -1
  27. package/src/client/components/core/Responsive.js +15 -0
  28. package/src/client/components/core/RichText.js +4 -2
  29. package/src/client/components/core/Translate.js +6 -2
  30. package/src/client/components/core/WebComponent.js +44 -0
  31. package/src/client/components/core/Worker.js +12 -4
  32. package/src/client/public/default/plantuml/client-conf.svg +1 -1
  33. package/src/client/public/default/plantuml/client-schema.svg +1 -1
  34. package/src/client/public/default/plantuml/cron-conf.svg +1 -1
  35. package/src/client/public/default/plantuml/cron-schema.svg +1 -1
  36. package/src/client/public/default/plantuml/server-conf.svg +1 -1
  37. package/src/client/public/default/plantuml/server-schema.svg +1 -1
  38. package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
  39. package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
  40. package/src/client/public/default/site.webmanifest +69 -0
  41. package/src/client/services/default/default.management.js +118 -120
  42. package/src/client/ssr/Render.js +224 -3
  43. package/src/client/ssr/common/Alert.js +75 -0
  44. package/src/client/ssr/common/SsrCore.js +91 -0
  45. package/src/client/ssr/common/Translate.js +26 -0
  46. package/src/client/ssr/common/Worker.js +28 -0
  47. package/src/client/ssr/{body-components → components/body}/CacheControl.js +1 -1
  48. package/src/client/ssr/{body-components → components/body}/DefaultSplashScreen.js +15 -4
  49. package/src/client/ssr/components/head/Pwa.js +146 -0
  50. package/src/client/ssr/pages/404.js +12 -0
  51. package/src/client/ssr/pages/500.js +12 -0
  52. package/src/client/ssr/pages/maintenance.js +14 -0
  53. package/src/client/ssr/pages/offline.js +21 -0
  54. package/src/client/sw/default.sw.js +13 -9
  55. package/src/db/DataBaseProvider.js +12 -1
  56. package/src/db/mongo/MongooseDB.js +0 -1
  57. package/src/mailer/EmailRender.js +1 -1
  58. package/src/server/backup.js +82 -70
  59. package/src/server/client-build-live.js +6 -0
  60. package/src/server/client-build.js +76 -73
  61. package/src/server/client-formatted.js +11 -1
  62. package/src/server/client-icons.js +1 -1
  63. package/src/server/conf.js +60 -12
  64. package/src/server/crypto.js +91 -0
  65. package/src/server/dns.js +42 -13
  66. package/src/server/network.js +94 -7
  67. package/src/server/proxy.js +27 -27
  68. package/src/server/runtime.js +27 -8
  69. package/.github/workflows/test.yml +0 -80
  70. package/src/client/ssr/head-components/Microdata.js +0 -11
  71. package/src/cron.js +0 -30
  72. package/src/server/cron.js +0 -35
  73. /package/src/client/ssr/{email-components → components/email}/DefaultRecoverEmail.js +0 -0
  74. /package/src/client/ssr/{email-components → components/email}/DefaultVerifyEmail.js +0 -0
  75. /package/src/client/ssr/{head-components → components/head}/Css.js +0 -0
  76. /package/src/client/ssr/{head-components → components/head}/DefaultScripts.js +0 -0
  77. /package/src/client/ssr/{head-components → components/head}/Production.js +0 -0
  78. /package/src/client/ssr/{head-components → components/head}/PwaDefault.js +0 -0
  79. /package/src/client/ssr/{head-components → components/head}/Seo.js +0 -0
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="148px" preserveAspectRatio="none" style="width:387px;height:148px;background:#FFFFFF;" version="1.1" viewBox="0 0 387 148" width="387px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="21.6094" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="81" x="10" y="67.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="49" x="15" y="84.0332">Default</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="74" y="84.0332">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="69" x2="69" y1="67.5" y2="89.1094"/><rect fill="none" height="21.6094" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="81" x="10" y="67.5"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="67" x="128" y="57"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="34" x="133" y="73.5332">head</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="178" y="73.5332">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="173" x2="173" y1="57" y2="78.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="128" x2="195" y1="78.6094" y2="78.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="133" y="95.1426">body</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="178" y="95.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="173" x2="173" y1="78.6094" y2="100.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="67" x="128" y="57"/><rect fill="#F1F1F1" height="64.8281" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="98" x="254.5" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="72" x="259.5" y="26.5332">PwaDefault</text><line style="stroke:#000000;stroke-width:1.0;" x1="254.5" x2="352.5" y1="31.6094" y2="31.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="24" x="259.5" y="48.1426">Css</text><line style="stroke:#000000;stroke-width:1.0;" x1="254.5" x2="352.5" y1="53.2188" y2="53.2188"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="88" x="259.5" y="69.752">DefaultScripts</text><rect fill="none" height="64.8281" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="98" x="254.5" y="10"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="143" x="232" y="93"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="87" x="237" y="109.5332">CacheControl</text><line style="stroke:#000000;stroke-width:1.0;" x1="232" x2="375" y1="114.6094" y2="114.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="133" x="237" y="131.1426">DefaultSplashScreen</text><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="143" x="232" y="93"/><path d="M183,67.5 L196,67.5 C212.9566,67.5 231.0378,64.4861 247.4183,60.5512 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M248.1643,63.5097 L249.6372,59.9916 L246.6722,57.5926 L254.8146,58.6859 L248.1643,63.5097 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="183" cy="67.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M183,89.5 L196,89.5 C205.4079,89.5 215.162,90.4278 224.7798,91.9259 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M224.253,94.9958 L227.0822,92.3209 L225.3065,88.856 L232.4545,93.2428 L224.253,94.9958 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="183" cy="89.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M79,78.5 L92,78.5 C101.2651,78.5 111.2301,78.5 120.6263,78.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M120.6263,81.5925 L122.9456,78.5 L120.6263,75.4075 L128.3574,78.5 L120.6263,81.5925 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="79" cy="78.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/></g></svg>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="181px" preserveAspectRatio="none" style="width:409px;height:181px;background:#FFFFFF;" version="1.1" viewBox="0 0 409 181" width="409px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="20.2969" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="88" x="10" y="95.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="56" x="15" y="110.4951">Default</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="81" y="110.4951">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="76" x2="76" y1="95.5" y2="115.7969"/><rect fill="none" height="20.2969" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="88" x="10" y="95.5"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="71" x="135" y="85"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="140" y="99.9951">head</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="189" y="99.9951">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="184" x2="184" y1="85" y2="105.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="135" x2="206" y1="105.2969" y2="105.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="140" y="120.292">body</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="189" y="120.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="184" x2="184" y1="105.2969" y2="125.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="71" x="135" y="85"/><rect fill="#F1F1F1" height="101.4844" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="106" x="267" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="27" x="272" y="24.9951">Seo</text><line style="stroke:#000000;stroke-width:1.0;" x1="267" x2="373" y1="30.2969" y2="30.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="28" x="272" y="45.292">Pwa</text><line style="stroke:#000000;stroke-width:1.0;" x1="267" x2="373" y1="50.5938" y2="50.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="26" x="272" y="65.5889">Css</text><line style="stroke:#000000;stroke-width:1.0;" x1="267" x2="373" y1="70.8906" y2="70.8906"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="96" x="272" y="85.8857">DefaultScripts</text><line style="stroke:#000000;stroke-width:1.0;" x1="267" x2="373" y1="91.1875" y2="91.1875"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="75" x="272" y="106.1826">Production</text><rect fill="none" height="101.4844" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="106" x="267" y="10"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="154" x="243" y="129"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="94" x="248" y="143.9951">CacheControl</text><line style="stroke:#000000;stroke-width:1.0;" x1="243" x2="397" y1="149.2969" y2="149.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="144" x="248" y="164.292">DefaultSplashScreen</text><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="154" x="243" y="129"/><path d="M194,94.5 L207,94.5 C224.5169,94.5 242.9373,90.6762 259.6851,85.5933 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M260.651,88.6205 L261.9554,84.8688 L258.7191,82.5661 L267.253,83.1785 L260.651,88.6205 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="194" cy="94.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M194,115.5 L207,115.5 C216.9946,115.5 235.8154,120.4794 255.2433,126.627 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M254.319,129.4949 L257.3942,127.3202 L256.1675,123.759 L262.4131,128.9377 L254.319,129.4949 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="194" cy="115.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M86,105.5 L99,105.5 C108.2448,105.5 118.1667,105.5 127.5755,105.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M127.5755,108.6026 L129.9024,105.5 L127.5755,102.3974 L135.332,105.5 L127.5755,108.6026 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="86" cy="105.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/></g></svg>
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="126px" preserveAspectRatio="none" style="width:786px;height:126px;background:#FFFFFF;" version="1.1" viewBox="0 0 786 126" width="786px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="128" x="10" y="18"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="15" y="34.5332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="38" x="95" y="34.5332">object</text><line style="stroke:#000000;stroke-width:1.0;" x1="90" x2="90" y1="18" y2="39.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="138" y1="39.6094" y2="39.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="70" x="15" y="56.1426">properties</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="95" y="56.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="90" x2="90" y1="39.6094" y2="61.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="128" x="10" y="18"/><rect fill="#F1F1F1" height="21.6094" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="81" x="175" y="39.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="49" x="180" y="56.0332">Default</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="239" y="56.0332">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="234" x2="234" y1="39.5" y2="61.1094"/><rect fill="none" height="21.6094" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="81" x="175" y="39.5"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="128" x="293" y="29"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="298" y="45.5332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="38" x="378" y="45.5332">object</text><line style="stroke:#000000;stroke-width:1.0;" x1="373" x2="373" y1="29" y2="50.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="293" x2="421" y1="50.6094" y2="50.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="70" x="298" y="67.1426">properties</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="378" y="67.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="373" x2="373" y1="50.6094" y2="72.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="128" x="293" y="29"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="67" x="458" y="40"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="34" x="463" y="56.5332">head</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="508" y="56.5332">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="503" x2="503" y1="40" y2="61.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="458" x2="525" y1="61.6094" y2="61.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="463" y="78.1426">body</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="508" y="78.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="503" x2="503" y1="61.6094" y2="83.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="67" x="458" y="40"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="90" x="562" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="567" y="26.5332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="33" x="614" y="26.5332">array</text><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="609" y1="10" y2="31.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="562" x2="652" y1="31.6094" y2="31.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="37" x="567" y="48.1426">items</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="614" y="48.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="609" y1="31.6094" y2="53.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="90" x="562" y="10"/><rect fill="#F1F1F1" height="21.6094" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="85" x="689" y="31.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="694" y="48.0332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="35" x="734" y="48.0332">string</text><line style="stroke:#000000;stroke-width:1.0;" x1="729" x2="729" y1="31.5" y2="53.1094"/><rect fill="none" height="21.6094" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="85" x="689" y="31.5"/><rect fill="#F1F1F1" height="43.2188" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="90" x="562" y="71"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="567" y="87.5332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="33" x="614" y="87.5332">array</text><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="609" y1="71" y2="92.6094"/><line style="stroke:#000000;stroke-width:1.0;" x1="562" x2="652" y1="92.6094" y2="92.6094"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="37" x="567" y="109.1426">items</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="614" y="109.1426">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="609" y1="92.6094" y2="114.2188"/><rect fill="none" height="43.2188" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="90" x="562" y="71"/><rect fill="#F1F1F1" height="21.6094" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="85" x="689" y="92.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="30" x="694" y="109.0332">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="35" x="734" y="109.0332">string</text><line style="stroke:#000000;stroke-width:1.0;" x1="729" x2="729" y1="92.5" y2="114.1094"/><rect fill="none" height="21.6094" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="85" x="689" y="92.5"/><path d="M640,42.5 L653,42.5 C662.2961,42.5 672.2155,42.5 681.7553,42.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M681.7553,45.5201 L684.0204,42.5 L681.7553,39.4799 L689.3056,42.5 L681.7553,45.5201 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="640" cy="42.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M513,50.5 L526,50.5 C535.4045,50.5 545.2657,49.2565 554.7344,47.4057 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M555.3753,50.403 L556.9824,46.925 L554.0935,44.4083 L562.2278,45.8034 L555.3753,50.403 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="513" cy="50.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M640,103.5 L653,103.5 C662.2961,103.5 672.2155,103.5 681.7553,103.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M681.7553,106.5201 L684.0204,103.5 L681.7553,100.4799 L689.3056,103.5 L681.7553,106.5201 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="640" cy="103.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M513,72.5 L526,72.5 C535.4312,72.5 545.3055,73.809 554.7789,75.7572 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M554.1042,78.7553 L557.0275,76.2632 L555.4535,72.759 L562.2743,77.4438 L554.1042,78.7553 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="513" cy="72.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M409,61.5 L422,61.5 C431.2651,61.5 441.2301,61.5 450.6263,61.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M450.6263,64.5925 L452.9456,61.5 L450.6263,58.4075 L458.3574,61.5 L450.6263,64.5925 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="409" cy="61.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M244,50.5 L257,50.5 C266.2687,50.5 276.0232,50.5 285.6525,50.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M285.6525,53.5736 L287.9577,50.5 L285.6525,47.4264 L293.3365,50.5 L285.6525,53.5736 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="244" cy="50.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M126,50.5 L139,50.5 C148.266,50.5 158.1675,50.5 167.6585,50.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M167.6585,53.5014 L169.9096,50.5 L167.6585,47.4986 L175.1621,50.5 L167.6585,53.5014 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="126" cy="50.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/></g></svg>
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentStyleType="text/css" height="121px" preserveAspectRatio="none" style="width:848px;height:121px;background:#FFFFFF;" version="1.1" viewBox="0 0 848 121" width="848px" zoomAndPan="magnify"><defs/><g><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="146" x="10" y="20"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="15" y="34.9951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="43" x="108" y="34.9951">object</text><line style="stroke:#000000;stroke-width:1.0;" x1="103" x2="103" y1="20" y2="40.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="10" x2="156" y1="40.2969" y2="40.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="83" x="15" y="55.292">properties</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="108" y="55.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="103" x2="103" y1="40.2969" y2="60.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="146" x="10" y="20"/><rect fill="#F1F1F1" height="20.2969" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="88" x="193" y="40.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="56" x="198" y="55.4951">Default</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="264" y="55.4951">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="259" x2="259" y1="40.5" y2="60.7969"/><rect fill="none" height="20.2969" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="88" x="193" y="40.5"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="146" x="318" y="30"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="323" y="44.9951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="43" x="416" y="44.9951">object</text><line style="stroke:#000000;stroke-width:1.0;" x1="411" x2="411" y1="30" y2="50.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="318" x2="464" y1="50.2969" y2="50.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="83" x="323" y="65.292">properties</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="416" y="65.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="411" x2="411" y1="50.2969" y2="70.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="146" x="318" y="30"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="71" x="501" y="40"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="506" y="54.9951">head</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="555" y="54.9951">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="550" x2="550" y1="40" y2="60.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="501" x2="572" y1="60.2969" y2="60.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="39" x="506" y="75.292">body</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="555" y="75.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="550" x2="550" y1="60.2969" y2="80.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="71" x="501" y="40"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="96" x="609" y="10"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="614" y="24.9951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="33" x="667" y="24.9951">array</text><line style="stroke:#000000;stroke-width:1.0;" x1="662" x2="662" y1="10" y2="30.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="705" y1="30.2969" y2="30.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="43" x="614" y="45.292">items</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="667" y="45.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="662" x2="662" y1="30.2969" y2="50.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="96" x="609" y="10"/><rect fill="#F1F1F1" height="20.2969" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="94" x="742" y="30.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="747" y="45.4951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="39" x="792" y="45.4951">string</text><line style="stroke:#000000;stroke-width:1.0;" x1="787" x2="787" y1="30.5" y2="50.7969"/><rect fill="none" height="20.2969" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="94" x="742" y="30.5"/><rect fill="#F1F1F1" height="40.5938" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="96" x="609" y="69"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="614" y="83.9951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="33" x="667" y="83.9951">array</text><line style="stroke:#000000;stroke-width:1.0;" x1="662" x2="662" y1="69" y2="89.2969"/><line style="stroke:#000000;stroke-width:1.0;" x1="609" x2="705" y1="89.2969" y2="89.2969"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="43" x="614" y="104.292">items</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="12" x="667" y="104.292">   </text><line style="stroke:#000000;stroke-width:1.0;" x1="662" x2="662" y1="89.2969" y2="109.5938"/><rect fill="none" height="40.5938" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="96" x="609" y="69"/><rect fill="#F1F1F1" height="20.2969" rx="5" ry="5" style="stroke:#F1F1F1;stroke-width:1.5;" width="94" x="742" y="89.5"/><text fill="#000000" font-family="sans-serif" font-size="14" font-weight="bold" lengthAdjust="spacing" textLength="35" x="747" y="104.4951">type</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthAdjust="spacing" textLength="39" x="792" y="104.4951">string</text><line style="stroke:#000000;stroke-width:1.0;" x1="787" x2="787" y1="89.5" y2="109.7969"/><rect fill="none" height="20.2969" rx="5" ry="5" style="stroke:#000000;stroke-width:1.5;" width="94" x="742" y="89.5"/><path d="M693,40.5 L706,40.5 C715.2674,40.5 725.1203,40.5 734.6708,40.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M734.6708,43.531 L736.9441,40.5 L734.6708,37.469 L742.2484,40.5 L734.6708,43.531 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="693" cy="40.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M560,49.5 L573,49.5 C582.3848,49.5 592.2184,48.3447 601.7089,46.604 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M602.3132,49.6129 L603.9656,46.1508 L601.1046,43.595 L609.2313,45.0933 L602.3132,49.6129 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="560" cy="49.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M693,99.5 L706,99.5 C715.2674,99.5 725.1203,99.5 734.6708,99.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M734.6708,102.531 L736.9441,99.5 L734.6708,96.469 L742.2484,99.5 L734.6708,102.531 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="693" cy="99.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M560,70.5 L573,70.5 C582.3848,70.5 592.2184,71.6553 601.7089,73.396 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M601.1046,76.405 L603.9656,73.8492 L602.3132,70.3871 L609.2313,74.9067 L601.1046,76.405 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="560" cy="70.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M452,60.5 L465,60.5 C474.2448,60.5 484.1667,60.5 493.5755,60.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M493.5755,63.6026 L495.9024,60.5 L493.5755,57.3974 L501.332,60.5 L493.5755,63.6026 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="452" cy="60.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M269,50.5 L282,50.5 C291.2896,50.5 301.0267,50.5 310.694,50.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M310.694,53.5913 L313.0124,50.5 L310.694,47.4087 L318.4221,50.5 L310.694,53.5913 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="269" cy="50.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/><path d="M144,50.5 L157,50.5 C166.2571,50.5 176.1205,50.5 185.6372,50.5 " fill="none" style="stroke:#000000;stroke-width:1.0;stroke-dasharray:3.0,3.0;"/><path d="M185.6372,53.5158 L187.899,50.5 L185.6372,47.4842 L193.1767,50.5 L185.6372,53.5158 " fill="#000000" style="stroke:#000000;stroke-width:1.0;"/><ellipse cx="144" cy="50.5" fill="#000000" rx="3" ry="3" style="stroke:#000000;stroke-width:1.0;"/></g></svg>
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "Default",
3
+ "short_name": "Default",
4
+ "description": null,
5
+ "dir": "auto",
6
+ "lang": "en-US",
7
+ "display": "standalone",
8
+ "orientation": "any",
9
+ "scope": "/",
10
+ "start_url": "/?homescreen=1",
11
+ "background_color": "#fff",
12
+ "theme_color": "#fff",
13
+ "icons": [
14
+ {
15
+ "src": "/android-chrome-36x36.png",
16
+ "sizes": "36x36",
17
+ "type": "image/png",
18
+ "purpose": "any maskable"
19
+ },
20
+ {
21
+ "src": "/android-chrome-48x48.png",
22
+ "sizes": "48x48",
23
+ "type": "image/png",
24
+ "purpose": "any maskable"
25
+ },
26
+ {
27
+ "src": "/android-chrome-72x72.png",
28
+ "sizes": "72x72",
29
+ "type": "image/png",
30
+ "purpose": "any maskable"
31
+ },
32
+ {
33
+ "src": "/android-chrome-96x96.png",
34
+ "sizes": "96x96",
35
+ "type": "image/png",
36
+ "purpose": "any maskable"
37
+ },
38
+ {
39
+ "src": "/android-chrome-144x144.png",
40
+ "sizes": "144x144",
41
+ "type": "image/png",
42
+ "purpose": "any maskable"
43
+ },
44
+ {
45
+ "src": "/android-chrome-192x192.png",
46
+ "sizes": "192x192",
47
+ "type": "image/png",
48
+ "purpose": "any maskable"
49
+ },
50
+ {
51
+ "src": "/android-chrome-256x256.png",
52
+ "sizes": "256x256",
53
+ "type": "image/png",
54
+ "purpose": "any maskable"
55
+ },
56
+ {
57
+ "src": "/android-chrome-384x384.png",
58
+ "sizes": "384x384",
59
+ "type": "image/png",
60
+ "purpose": "any maskable"
61
+ },
62
+ {
63
+ "src": "/android-chrome-512x512.png",
64
+ "sizes": "512x512",
65
+ "type": "image/png",
66
+ "purpose": "any maskable"
67
+ }
68
+ ]
69
+ }
@@ -4,6 +4,7 @@ import { getId, timer } from '../../components/core/CommonJs.js';
4
4
  import { darkTheme } from '../../components/core/Css.js';
5
5
  import { EventsUI } from '../../components/core/EventsUI.js';
6
6
  import { loggerFactory } from '../../components/core/Logger.js';
7
+ import { Modal } from '../../components/core/Modal.js';
7
8
  import { NotificationManager } from '../../components/core/NotificationManager.js';
8
9
  import { Translate } from '../../components/core/Translate.js';
9
10
  import { s } from '../../components/core/VanillaJs.js';
@@ -73,35 +74,40 @@ const DefaultManagement = {
73
74
  this.tokens[cellRenderId] = {};
74
75
 
75
76
  this.eGui.innerHTML = html` ${await BtnIcon.Render({
76
- label: html`<div class="abs center btn-remove-${id}-${cellRenderId}-label">
77
- <i class="fas fa-times"></i>
78
- </div>
79
- <div class="abs center btn-remove-${id}-${cellRenderId}-loading hide">
80
- <div class="lds-dual-ring-mini"></div>
81
- </div>`,
77
+ label: html`<div class="abs center">
78
+ <i class="fas fa-times"></i>
79
+ </div> `,
82
80
  class: `in fll section-mp management-table-btn-mini management-table-btn-remove-${id}-${cellRenderId}`,
83
81
  })}`;
84
82
  setTimeout(() => {
85
- EventsUI.onClick(
86
- `.management-table-btn-remove-${id}-${cellRenderId}`,
87
- async () => {
88
- s(`.btn-remove-${id}-${cellRenderId}-label`).classList.add('hide');
89
- s(`.btn-remove-${id}-${cellRenderId}-loading`).classList.remove('hide');
90
-
91
- let result;
92
- if (params.data._id) result = await ServiceProvider.delete({ id: params.data._id });
93
- else result = { status: 'success' };
83
+ EventsUI.onClick(`.management-table-btn-remove-${id}-${cellRenderId}`, async () => {
84
+ const confirmResult = await Modal.RenderConfirm({
85
+ html: async () => {
86
+ return html`
87
+ <div class="in section-mp" style="text-align: center">
88
+ ${Translate.Render('confirm-delete-item')}
89
+ ${Object.keys(params.data).length > 0
90
+ ? html`<br />
91
+ "${params.data[Object.keys(params.data)[0]]}"`
92
+ : ''}
93
+ </div>
94
+ `;
95
+ },
96
+ id: `delete-${params.data._id}`,
97
+ });
98
+ if (confirmResult.status !== 'confirm') return;
99
+ let result;
100
+ if (params.data._id) result = await ServiceProvider.delete({ id: params.data._id });
101
+ else result = { status: 'success' };
94
102
 
95
- NotificationManager.Push({
96
- html: result.status === 'error' ? result.message : Translate.Render('item-success-delete'),
97
- status: result.status,
98
- });
99
- if (result.status === 'success') {
100
- AgGrid.grids[gridId].applyTransaction({ remove: [params.data] });
101
- }
102
- },
103
- { disableSpinner: true },
104
- );
103
+ NotificationManager.Push({
104
+ html: result.status === 'error' ? result.message : Translate.Render('item-success-delete'),
105
+ status: result.status,
106
+ });
107
+ if (result.status === 'success') {
108
+ AgGrid.grids[gridId].applyTransaction({ remove: [params.data] });
109
+ }
110
+ });
105
111
  });
106
112
  }
107
113
 
@@ -133,134 +139,126 @@ const DefaultManagement = {
133
139
  {
134
140
  const result = await ServiceProvider.get();
135
141
  if (result.status === 'success') {
136
- rowDataScope = result.data.reverse().map((row) => columnDefFormatter(row, columnDefs, options.customFormat));
142
+ rowDataScope = result.data.map((row) => columnDefFormatter(row, columnDefs, options.customFormat));
137
143
  AgGrid.grids[gridId].setGridOption('rowData', rowDataScope);
138
144
  }
139
145
  }
140
146
  s(`.management-table-btn-save-${id}`).onclick = () => {
141
147
  AgGrid.grids[gridId].stopEditing();
142
148
  };
143
- EventsUI.onClick(
144
- `.management-table-btn-add-${id}`,
145
- async () => {
146
- s(`.btn-add-${id}-label`).classList.add('hide');
147
- s(`.btn-add-${id}-loading`).classList.remove('hide');
148
- const rowObj = {};
149
- for (const def of columnDefs) {
150
- rowObj[def.field] = '';
151
- }
152
- // const result = await ServiceProvider.post({ body: rowObj });
153
- const result = {
154
- status: 'success',
155
- data: rowObj,
156
- };
157
- // NotificationManager.Push({
158
- // html: result.status === 'error' ? result.message : `${Translate.Render('success-create-item')}`,
159
- // status: result.status,
149
+ EventsUI.onClick(`.management-table-btn-add-${id}`, async () => {
150
+ const rowObj = {};
151
+ for (const def of columnDefs) {
152
+ rowObj[def.field] = '';
153
+ }
154
+ // const result = await ServiceProvider.post({ body: rowObj });
155
+ const result = {
156
+ status: 'success',
157
+ data: rowObj,
158
+ };
159
+ // NotificationManager.Push({
160
+ // html: result.status === 'error' ? result.message : `${Translate.Render('success-create-item')}`,
161
+ // status: result.status,
162
+ // });
163
+ if (result.status === 'success') {
164
+ AgGrid.grids[gridId].applyTransaction({
165
+ add: [columnDefFormatter(result.data, columnDefs, options.customFormat)],
166
+ addIndex: 0,
167
+ });
168
+ // AgGrid.grids[gridId].applyColumnState({
169
+ // state: [
170
+ // // { colId: 'country', sort: 'asc', sortIndex: 1 },
171
+ // { colId: 'updatedAt', sort: 'desc', sortIndex: 0 },
172
+ // ],
173
+ // defaultState: { sort: null },
160
174
  // });
161
- if (result.status === 'success') {
162
- AgGrid.grids[gridId].applyTransaction({
163
- add: [columnDefFormatter(result.data, columnDefs, options.customFormat)],
164
- addIndex: 0,
165
- });
166
- // AgGrid.grids[gridId].applyColumnState({
167
- // state: [
168
- // // { colId: 'country', sort: 'asc', sortIndex: 1 },
169
- // { colId: 'updatedAt', sort: 'desc', sortIndex: 0 },
170
- // ],
171
- // defaultState: { sort: null },
172
- // });
173
- } else {
174
- // AgGrid.grids[gridId].applyColumnState({
175
- // defaultState: { sort: null },
176
- // });
177
- }
175
+ } else {
176
+ // AgGrid.grids[gridId].applyColumnState({
177
+ // defaultState: { sort: null },
178
+ // });
179
+ }
178
180
 
179
- // https://www.ag-grid.com/javascript-data-grid/cell-editing-start-stop/
181
+ // https://www.ag-grid.com/javascript-data-grid/cell-editing-start-stop/
180
182
 
181
- const pinned = undefined;
182
- const key = undefined;
183
+ const pinned = undefined;
184
+ const key = undefined;
183
185
 
184
- // setFocusedCell = (
185
- // rowIndex: number,
186
- // colKey: string | Column,
187
- // rowPinned?: RowPinnedType
188
- // ) => void;
186
+ // setFocusedCell = (
187
+ // rowIndex: number,
188
+ // colKey: string | Column,
189
+ // rowPinned?: RowPinnedType
190
+ // ) => void;
189
191
 
190
- // type RowPinnedType =
191
- // 'top'
192
- // | 'bottom'
193
- // | null
194
- // | undefined
192
+ // type RowPinnedType =
193
+ // 'top'
194
+ // | 'bottom'
195
+ // | null
196
+ // | undefined
195
197
 
196
- AgGrid.grids[gridId].setFocusedCell(0, '0', pinned);
198
+ AgGrid.grids[gridId].setFocusedCell(0, '0', pinned);
197
199
 
198
- // interface StartEditingCellParams {
199
- // // The row index of the row to start editing
200
- // rowIndex: number;
201
- // // The column key of the row to start editing
202
- // colKey: string | Column;
203
- // // Set to `'top'` or `'bottom'` to start editing a pinned row
204
- // rowPinned?: RowPinnedType;
205
- // // The key to pass to the cell editor
206
- // key?: string;
207
- // }
208
- s(`.btn-add-${id}-loading`).classList.add('hide');
209
- s(`.btn-add-${id}-label`).classList.remove('hide');
200
+ // interface StartEditingCellParams {
201
+ // // The row index of the row to start editing
202
+ // rowIndex: number;
203
+ // // The column key of the row to start editing
204
+ // colKey: string | Column;
205
+ // // Set to `'top'` or `'bottom'` to start editing a pinned row
206
+ // rowPinned?: RowPinnedType;
207
+ // // The key to pass to the cell editor
208
+ // key?: string;
209
+ // }
210
210
 
211
- setTimeout(() => {
212
- AgGrid.grids[gridId].startEditingCell({
213
- rowIndex: 0,
214
- colKey: defaultColKeyFocus,
215
- rowPinned: pinned,
216
- key: key,
217
- });
211
+ setTimeout(() => {
212
+ AgGrid.grids[gridId].startEditingCell({
213
+ rowIndex: 0,
214
+ colKey: defaultColKeyFocus,
215
+ rowPinned: pinned,
216
+ key: key,
218
217
  });
219
- },
220
- { disableSpinner: true },
221
- );
222
- EventsUI.onClick(
223
- `.management-table-btn-clean-${id}`,
224
- async () => {
225
- s(`.btn-clean-${id}-label`).classList.add('hide');
226
- s(`.btn-clean-${id}-loading`).classList.remove('hide');
227
- const result = await ServiceProvider.delete();
228
- NotificationManager.Push({
229
- html: result.status === 'error' ? result.message : Translate.Render('success-delete-all-items'),
230
- status: result.status,
231
- });
232
- if (result.status === 'success') {
233
- AgGrid.grids[gridId].setGridOption('rowData', []);
234
- }
235
- s(`.btn-clean-${id}-loading`).classList.add('hide');
236
- s(`.btn-clean-${id}-label`).classList.remove('hide');
237
- },
238
- { disableSpinner: true },
239
- );
218
+ });
219
+ });
220
+ EventsUI.onClick(`.management-table-btn-clean-${id}`, async () => {
221
+ const confirmResult = await Modal.RenderConfirm({
222
+ html: async () => {
223
+ return html`
224
+ <div class="in section-mp" style="text-align: center;">
225
+ <strong>${Translate.Render('confirm-delete-all-data')}</strong>
226
+ </div>
227
+ `;
228
+ },
229
+ id: `clean-table-${id}`,
230
+ });
231
+ if (confirmResult.status === 'cancelled') return;
232
+ const result = await ServiceProvider.delete();
233
+ NotificationManager.Push({
234
+ html: result.status === 'error' ? result.message : Translate.Render('success-delete-all-items'),
235
+ status: result.status,
236
+ });
237
+ if (result.status === 'success') {
238
+ AgGrid.grids[gridId].setGridOption('rowData', []);
239
+ }
240
+ });
240
241
  }, 1);
241
242
  return html`<div class="fl">
242
243
  ${await BtnIcon.Render({
243
244
  class: `in fll section-mp management-table-btn-mini management-table-btn-add-${id} ${
244
245
  permissions.add ? '' : 'hide'
245
246
  }`,
246
- label: html`<div class="abs center btn-add-${id}-label"><i class="fa-solid fa-circle-plus"></i></div>
247
- <div class="abs center btn-add-${id}-loading hide"><div class="lds-dual-ring-mini"></div></div> `,
247
+ label: html`<div class="abs center btn-add-${id}-label"><i class="fa-solid fa-circle-plus"></i></div> `,
248
248
  type: 'button',
249
249
  })}
250
250
  ${await BtnIcon.Render({
251
251
  class: `in fll section-mp management-table-btn-mini management-table-btn-save-${id} ${
252
252
  permissions.add ? '' : 'hide'
253
253
  }`,
254
- label: html`<div class="abs center btn-save-${id}-label"><i class="fas fa-save"></i></div>
255
- <div class="abs center btn-save-${id}-loading hide"><div class="lds-dual-ring-mini"></div></div>`,
254
+ label: html`<div class="abs center btn-save-${id}-label"><i class="fas fa-save"></i></div> `,
256
255
  type: 'button',
257
256
  })}
258
257
  ${await BtnIcon.Render({
259
258
  class: `in fll section-mp management-table-btn-mini management-table-btn-clean-${id} ${
260
259
  permissions.remove ? '' : 'hide'
261
260
  }`,
262
- label: html`<div class="abs center btn-clean-${id}-label"><i class="fas fa-broom"></i></div>
263
- <div class="abs center btn-clean-${id}-loading hide"><div class="lds-dual-ring-mini"></div></div>`,
261
+ label: html`<div class="abs center btn-clean-${id}-label"><i class="fas fa-broom"></i></div> `,
264
262
  type: 'button',
265
263
  })}
266
264
  </div>