create-basicjs 0.1.4 → 0.1.6

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 (625) hide show
  1. package/README.md +12 -2
  2. package/bin/create-basicjs.js +58 -5
  3. package/bin/verify-package.js +1 -1
  4. package/package.json +2 -2
  5. package/payload/projects/tauri/.github/workflows/build.yml +86 -0
  6. package/payload/projects/tauri/.github/workflows/tests.yml +87 -0
  7. package/payload/projects/tauri/AGENTS.md +128 -0
  8. package/payload/projects/tauri/CLAUDE.md +1 -0
  9. package/payload/projects/tauri/LICENSE +201 -0
  10. package/payload/projects/tauri/NOTICE +8 -0
  11. package/payload/projects/tauri/README.md +269 -0
  12. package/payload/projects/tauri/checks/window-check.js +189 -0
  13. package/payload/projects/tauri/gitignore +8 -0
  14. package/payload/projects/tauri/handbook/01-getting-started.md +188 -0
  15. package/payload/projects/tauri/handbook/02-the-project.md +264 -0
  16. package/payload/projects/tauri/handbook/03-the-page.md +260 -0
  17. package/payload/projects/tauri/handbook/04-commands.md +265 -0
  18. package/payload/projects/tauri/handbook/05-events-and-state.md +275 -0
  19. package/payload/projects/tauri/handbook/06-plugins.md +282 -0
  20. package/payload/projects/tauri/handbook/07-the-window-and-the-app.md +431 -0
  21. package/payload/projects/tauri/handbook/08-security.md +374 -0
  22. package/payload/projects/tauri/handbook/09-tests-and-checks.md +266 -0
  23. package/payload/projects/tauri/handbook/10-building-and-releasing.md +238 -0
  24. package/payload/projects/tauri/handbook/11-troubleshooting.md +259 -0
  25. package/payload/projects/tauri/handbook/README.md +125 -0
  26. package/payload/projects/tauri/handbook/turkce/01-getting-started.md +193 -0
  27. package/payload/projects/tauri/handbook/turkce/02-the-project.md +272 -0
  28. package/payload/projects/tauri/handbook/turkce/03-the-page.md +272 -0
  29. package/payload/projects/tauri/handbook/turkce/04-commands.md +271 -0
  30. package/payload/projects/tauri/handbook/turkce/05-events-and-state.md +284 -0
  31. package/payload/projects/tauri/handbook/turkce/06-plugins.md +286 -0
  32. package/payload/projects/tauri/handbook/turkce/07-the-window-and-the-app.md +433 -0
  33. package/payload/projects/tauri/handbook/turkce/08-security.md +384 -0
  34. package/payload/projects/tauri/handbook/turkce/09-tests-and-checks.md +275 -0
  35. package/payload/projects/tauri/handbook/turkce/10-building-and-releasing.md +241 -0
  36. package/payload/projects/tauri/handbook/turkce/11-troubleshooting.md +264 -0
  37. package/payload/projects/tauri/handbook/turkce/README.md +128 -0
  38. package/payload/projects/tauri/images/app.png +0 -0
  39. package/payload/projects/tauri/src-tauri/Cargo.lock +4389 -0
  40. package/payload/projects/tauri/src-tauri/Cargo.toml +31 -0
  41. package/payload/projects/tauri/src-tauri/app-icon.svg +16 -0
  42. package/payload/projects/tauri/src-tauri/build.rs +15 -0
  43. package/payload/projects/tauri/src-tauri/capabilities/default.json +7 -0
  44. package/payload/projects/tauri/src-tauri/gitignore +5 -0
  45. package/payload/projects/tauri/src-tauri/icons/128x128.png +0 -0
  46. package/payload/projects/tauri/src-tauri/icons/128x128@2x.png +0 -0
  47. package/payload/projects/tauri/src-tauri/icons/32x32.png +0 -0
  48. package/payload/projects/tauri/src-tauri/icons/icon.icns +0 -0
  49. package/payload/projects/tauri/src-tauri/icons/icon.ico +0 -0
  50. package/payload/projects/tauri/src-tauri/src/check.rs +144 -0
  51. package/payload/projects/tauri/src-tauri/src/files.rs +255 -0
  52. package/payload/projects/tauri/src-tauri/src/main.rs +45 -0
  53. package/payload/projects/tauri/src-tauri/src/sizes.rs +214 -0
  54. package/payload/projects/tauri/src-tauri/tauri.conf.json +44 -0
  55. package/payload/projects/tauri/src-tauri/tests/project.rs +243 -0
  56. package/payload/projects/tauri/ui/app.js +459 -0
  57. package/payload/projects/tauri/ui/backend.js +196 -0
  58. package/payload/projects/tauri/ui/basic/LICENSE +14 -0
  59. package/payload/projects/tauri/ui/basic/basic.min.css +1 -0
  60. package/payload/projects/tauri/ui/basic/basic.min.js +78 -0
  61. package/payload/projects/tauri/ui/basic/font/open-sans/LICENSE.txt +206 -0
  62. package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Bold.ttf +0 -0
  63. package/payload/projects/tauri/ui/basic/font/open-sans/OpenSans-Regular.ttf +0 -0
  64. package/payload/projects/tauri/ui/basic/scroll-bar.min.js +3 -0
  65. package/payload/projects/tauri/ui/comp/_sources.txt +9 -0
  66. package/payload/projects/tauri/ui/comp/components.min.js +21 -0
  67. package/payload/projects/tauri/ui/index.html +28 -0
  68. package/payload/projects/tauri/ui/sizes.js +104 -0
  69. package/payload/starter/AGENTS.md +11 -6
  70. package/payload/starter/README.md +1 -1
  71. package/payload/starter/_basic/VERSION +1 -1
  72. package/payload/starter/_basic/assets/cards/almond-blossom.png +0 -0
  73. package/payload/starter/_basic/assets/cards/blackberry.png +0 -0
  74. package/payload/starter/_basic/assets/cards/borage.png +0 -0
  75. package/payload/starter/_basic/assets/cards/chamomile.png +0 -0
  76. package/payload/starter/_basic/assets/cards/dill.png +0 -0
  77. package/payload/starter/_basic/assets/cards/eucalyptus.png +0 -0
  78. package/payload/starter/_basic/assets/cards/fennel.png +0 -0
  79. package/payload/starter/_basic/assets/cards/fig.png +0 -0
  80. package/payload/starter/_basic/assets/cards/juniper.png +0 -0
  81. package/payload/starter/_basic/assets/cards/lavender.png +0 -0
  82. package/payload/starter/_basic/assets/cards/lemon.png +0 -0
  83. package/payload/starter/_basic/assets/cards/olives.png +0 -0
  84. package/payload/starter/_basic/assets/cards/oregano.png +0 -0
  85. package/payload/starter/_basic/assets/cards/pepper.png +0 -0
  86. package/payload/starter/_basic/assets/cards/physalis.png +0 -0
  87. package/payload/starter/_basic/assets/cards/pomegranate.png +0 -0
  88. package/payload/starter/_basic/assets/cards/poppy.png +0 -0
  89. package/payload/starter/_basic/assets/cards/rosehip.png +0 -0
  90. package/payload/starter/_basic/assets/cards/saffron.png +0 -0
  91. package/payload/starter/_basic/assets/categories/cappuccino.png +0 -0
  92. package/payload/starter/_basic/assets/categories/chocolate-milk.png +0 -0
  93. package/payload/starter/_basic/assets/categories/coffee.png +0 -0
  94. package/payload/starter/_basic/assets/categories/frappe.png +0 -0
  95. package/payload/starter/_basic/assets/categories/iced-caffee.png +0 -0
  96. package/payload/starter/_basic/assets/categories/milkshake.png +0 -0
  97. package/payload/starter/_basic/assets/categories/orange-juice.png +0 -0
  98. package/payload/starter/_basic/assets/categories/tea.png +0 -0
  99. package/payload/starter/_basic/assets/fruids/brokoli.png +0 -0
  100. package/payload/starter/_basic/assets/fruids/cilek.png +0 -0
  101. package/payload/starter/_basic/assets/fruids/domates.png +0 -0
  102. package/payload/starter/_basic/assets/fruids/elma.png +0 -0
  103. package/payload/starter/_basic/assets/fruids/havuc.png +0 -0
  104. package/payload/starter/_basic/assets/fruids/karpuz.png +0 -0
  105. package/payload/starter/_basic/assets/fruids/limon.png +0 -0
  106. package/payload/starter/_basic/assets/fruids/muz.png +0 -0
  107. package/payload/starter/_basic/assets/fruids/nar.png +0 -0
  108. package/payload/starter/_basic/assets/fruids/patlican.png +0 -0
  109. package/payload/starter/_basic/assets/fruids/yabanmersini.png +0 -0
  110. package/payload/starter/_basic/assets/fruids/yesilbiber.png +0 -0
  111. package/payload/starter/_basic/basic/LICENSE +1 -1
  112. package/payload/starter/_basic/basic/basic.css +3 -6
  113. package/payload/starter/_basic/basic/basic.js +154 -60
  114. package/payload/starter/_basic/basic/basic.min.js +19 -6
  115. package/payload/starter/_basic/basic/scroll-bar.js +4 -2
  116. package/payload/starter/_basic/basic/scroll-bar.min.js +1 -0
  117. package/payload/starter/_basic/comp/accordion.js +659 -0
  118. package/payload/starter/_basic/comp/action-button.js +22 -23
  119. package/payload/starter/_basic/comp/action-tab-bar.js +8 -8
  120. package/payload/starter/_basic/comp/app-bar.js +12 -11
  121. package/payload/starter/_basic/comp/{badge-v2.js → badge.js} +51 -5
  122. package/payload/starter/_basic/comp/bottom-bar.js +62 -26
  123. package/payload/starter/_basic/comp/breadcrumbs.js +4 -2
  124. package/payload/starter/_basic/comp/canvas.js +652 -0
  125. package/payload/starter/_basic/comp/chat-view.js +827 -0
  126. package/payload/starter/_basic/comp/check-box.js +137 -21
  127. package/payload/starter/_basic/comp/code-editor.js +1171 -0
  128. package/payload/starter/_basic/comp/{select-color.js → color-picker.js} +62 -29
  129. package/payload/starter/_basic/comp/context-menu.js +348 -31
  130. package/payload/starter/_basic/comp/{currency-input-b.js → currency-field.js} +48 -29
  131. package/payload/starter/_basic/comp/data-table.js +114 -42
  132. package/payload/starter/_basic/comp/{select-date.js → date-picker.js} +104 -52
  133. package/payload/starter/_basic/comp/dialog.js +214 -76
  134. package/payload/starter/_basic/comp/email-field.js +65 -0
  135. package/payload/starter/_basic/comp/{select-file.js → file-picker.js} +245 -57
  136. package/payload/starter/_basic/comp/filters.js +374 -60
  137. package/payload/starter/_basic/comp/form.js +38 -26
  138. package/payload/starter/_basic/comp/full-screen-select.js +36 -33
  139. package/payload/starter/_basic/comp/gauge.js +12 -8
  140. package/payload/starter/_basic/comp/graph-box.js +3911 -0
  141. package/payload/starter/_basic/comp/grid-group.js +185 -0
  142. package/payload/starter/_basic/comp/hold-to-confirm-button.js +16 -7
  143. package/payload/starter/_basic/comp/image-view.js +598 -0
  144. package/payload/starter/_basic/comp/item-list.js +507 -163
  145. package/payload/starter/_basic/comp/json-editor.js +3221 -0
  146. package/payload/starter/_basic/comp/json-view.js +597 -0
  147. package/payload/starter/_basic/comp/label-editor.js +22 -19
  148. package/payload/starter/_basic/comp/left-menu.js +89 -22
  149. package/payload/starter/_basic/comp/line-progress-bar.js +196 -45
  150. package/payload/starter/_basic/comp/loading-screen.js +49 -18
  151. package/payload/starter/_basic/comp/log-view.js +530 -0
  152. package/payload/starter/_basic/comp/{login-page-v2.js → login-page.js} +205 -106
  153. package/payload/starter/_basic/comp/markdown-view.js +1046 -0
  154. package/payload/starter/_basic/comp/menu-bar.js +624 -0
  155. package/payload/starter/_basic/comp/mini-graph-box.js +20 -11
  156. package/payload/starter/_basic/comp/minimal-accent.js +208 -0
  157. package/payload/starter/_basic/comp/notice.js +15 -13
  158. package/payload/starter/_basic/comp/{number-input-b.js → number-field.js} +26 -19
  159. package/payload/starter/_basic/comp/numeric-keyboard.js +15 -13
  160. package/payload/starter/_basic/comp/page-control.js +21 -4
  161. package/payload/starter/_basic/comp/page-header.js +7 -6
  162. package/payload/starter/_basic/comp/password-field.js +192 -0
  163. package/payload/starter/_basic/comp/period-bar.js +8 -7
  164. package/payload/starter/_basic/comp/{phone-input-b.js → phone-field.js} +80 -45
  165. package/payload/starter/_basic/comp/progress-bar.js +401 -85
  166. package/payload/starter/_basic/comp/property-panel.js +1022 -123
  167. package/payload/starter/_basic/comp/radio-button.js +79 -19
  168. package/payload/starter/_basic/comp/range-slider.js +569 -0
  169. package/payload/starter/_basic/comp/rich-text-editor.js +33 -30
  170. package/payload/starter/_basic/comp/scroll-area.js +308 -0
  171. package/payload/starter/_basic/comp/scrolling-text.js +10 -9
  172. package/payload/starter/_basic/comp/search-input.js +725 -0
  173. package/payload/starter/_basic/comp/search-results.js +60 -24
  174. package/payload/starter/_basic/comp/select-box.js +229 -107
  175. package/payload/starter/_basic/comp/settings-row.js +20 -19
  176. package/payload/starter/_basic/comp/side-panel.js +53 -10
  177. package/payload/starter/_basic/comp/slider-field.js +264 -88
  178. package/payload/starter/_basic/comp/slider.js +556 -86
  179. package/payload/starter/_basic/comp/smart-button.js +438 -353
  180. package/payload/starter/_basic/comp/smart-table.js +748 -186
  181. package/payload/starter/_basic/comp/sortable-list.js +47 -38
  182. package/payload/starter/_basic/comp/spark-line-box.js +25 -16
  183. package/payload/starter/_basic/comp/splitter.js +411 -0
  184. package/payload/starter/_basic/comp/status-bar.js +408 -0
  185. package/payload/starter/_basic/comp/step-bar.js +345 -0
  186. package/payload/starter/_basic/comp/stepper.js +103 -49
  187. package/payload/starter/_basic/comp/tabs.js +67 -18
  188. package/payload/starter/_basic/comp/tag-input.js +50 -10
  189. package/payload/starter/_basic/comp/tap-effect.js +6 -4
  190. package/payload/starter/_basic/comp/text-area-field.js +233 -0
  191. package/payload/starter/_basic/comp/text-field.js +1006 -0
  192. package/payload/starter/_basic/comp/time-line.js +102 -28
  193. package/payload/starter/_basic/comp/{select-time.js → time-picker.js} +104 -51
  194. package/payload/starter/_basic/comp/tiny-select.js +79 -39
  195. package/payload/starter/_basic/comp/tiny-table.js +12 -8
  196. package/payload/starter/_basic/comp/toast.js +87 -34
  197. package/payload/starter/_basic/comp/toggle.js +149 -28
  198. package/payload/starter/_basic/comp/tool-bar.js +760 -0
  199. package/payload/starter/_basic/comp/tooltip.js +80 -17
  200. package/payload/starter/_basic/comp/tree-view.js +124 -41
  201. package/payload/starter/_basic/comp/ui-effects.js +17 -11
  202. package/payload/starter/_basic/comp/ui-standards.js +5 -4
  203. package/payload/starter/_basic/comp/url-field.js +190 -0
  204. package/payload/starter/_basic/comp/web-view.js +70 -16
  205. package/payload/starter/_basic/docs/basic-js-animated-rules.md +15 -9
  206. package/payload/starter/_basic/docs/basic-js-code-rules.md +42 -5
  207. package/payload/starter/_basic/docs/basic-js-components.md +12 -17
  208. package/payload/starter/_basic/docs/basic-js-core.md +5 -4
  209. package/payload/starter/_basic/docs/component-index.md +248 -107
  210. package/payload/starter/_basic/docs/component-template.js +28 -24
  211. package/payload/starter/_basic/docs/handbook/00-introduction.md +6 -2
  212. package/payload/starter/_basic/docs/handbook/00-what-is-new.md +21 -0
  213. package/payload/starter/_basic/docs/handbook/01-label.md +4 -4
  214. package/payload/starter/_basic/docs/handbook/02-box.md +7 -7
  215. package/payload/starter/_basic/docs/handbook/03-image.md +4 -4
  216. package/payload/starter/_basic/docs/handbook/04-common-properties.md +6 -5
  217. package/payload/starter/_basic/docs/handbook/05-autolayout.md +8 -7
  218. package/payload/starter/_basic/docs/handbook/06-button.md +3 -3
  219. package/payload/starter/_basic/docs/handbook/07-input.md +3 -3
  220. package/payload/starter/_basic/docs/handbook/08-page.md +3 -3
  221. package/payload/starter/_basic/docs/handbook/09-useful-examples.md +39 -58
  222. package/payload/starter/_basic/docs/handbook/10-motion.md +6 -6
  223. package/payload/starter/_basic/docs/handbook/11-other-functions.md +1 -0
  224. package/payload/starter/_basic/docs/handbook/13-sound.md +3 -3
  225. package/payload/starter/_basic/docs/handbook/14-using-components.md +180 -0
  226. package/payload/starter/_basic/docs/handbook/15-making-a-component.md +338 -0
  227. package/payload/starter/_basic/docs/what-is-new.md +106 -0
  228. package/payload/starter/_basic/examples/accordion.htm +174 -0
  229. package/payload/starter/_basic/examples/action-button.htm +74 -32
  230. package/payload/starter/_basic/examples/action-tab-bar.htm +5 -6
  231. package/payload/starter/_basic/examples/app-bar.htm +63 -41
  232. package/payload/starter/_basic/examples/badge.htm +96 -0
  233. package/payload/starter/_basic/examples/bottom-bar-2.htm +61 -48
  234. package/payload/starter/_basic/examples/bottom-bar.htm +74 -16
  235. package/payload/starter/_basic/examples/breadcrumbs.htm +160 -150
  236. package/payload/starter/_basic/examples/canvas.htm +190 -0
  237. package/payload/starter/_basic/examples/chat-view.htm +143 -0
  238. package/payload/starter/_basic/examples/check-box-2.htm +71 -82
  239. package/payload/starter/_basic/examples/check-box-3.htm +72 -83
  240. package/payload/starter/_basic/examples/check-box.htm +207 -0
  241. package/payload/starter/_basic/examples/code-editor-2.htm +259 -0
  242. package/payload/starter/_basic/examples/code-editor.htm +272 -0
  243. package/payload/starter/_basic/examples/color-picker.htm +206 -0
  244. package/payload/starter/_basic/examples/context-menu.htm +180 -139
  245. package/payload/starter/_basic/examples/currency-field.htm +105 -0
  246. package/payload/starter/_basic/examples/data-table-2.htm +2 -1
  247. package/payload/starter/_basic/examples/data-table-3.htm +1 -1
  248. package/payload/starter/_basic/examples/data-table-4.htm +15 -12
  249. package/payload/starter/_basic/examples/data-table-5.htm +11 -3
  250. package/payload/starter/_basic/examples/data-table.htm +90 -40
  251. package/payload/starter/_basic/examples/date-picker.htm +239 -0
  252. package/payload/starter/_basic/examples/dialog-centered.htm +394 -40
  253. package/payload/starter/_basic/examples/dialog.htm +267 -46
  254. package/payload/starter/_basic/examples/email-field.htm +102 -0
  255. package/payload/starter/_basic/examples/file-picker.htm +296 -0
  256. package/payload/starter/_basic/examples/filters.htm +33 -22
  257. package/payload/starter/_basic/examples/{form-1.htm → form.htm} +18 -19
  258. package/payload/starter/_basic/examples/full-screen-select.htm +81 -58
  259. package/payload/starter/_basic/examples/gallery-styled.htm +896 -0
  260. package/payload/starter/_basic/examples/gauge.htm +95 -81
  261. package/payload/starter/_basic/examples/graph-box.htm +365 -0
  262. package/payload/starter/_basic/examples/grid-group.htm +179 -0
  263. package/payload/starter/_basic/examples/hold-to-confirm-button.htm +102 -113
  264. package/payload/starter/_basic/examples/image-view.htm +195 -0
  265. package/payload/starter/_basic/examples/item-list-2.htm +138 -94
  266. package/payload/starter/_basic/examples/item-list.htm +191 -86
  267. package/payload/starter/_basic/examples/json-editor.htm +206 -0
  268. package/payload/starter/_basic/examples/json-view.htm +153 -0
  269. package/payload/starter/_basic/examples/label-editor.htm +85 -89
  270. package/payload/starter/_basic/examples/left-menu-2.htm +93 -0
  271. package/payload/starter/_basic/examples/left-menu.htm +42 -37
  272. package/payload/starter/_basic/examples/line-progress-bar.htm +155 -114
  273. package/payload/starter/_basic/examples/loading-screen.htm +149 -125
  274. package/payload/starter/_basic/examples/log-view.htm +175 -0
  275. package/payload/starter/_basic/examples/{login-page-dark-v2.htm → login-page-dark.htm} +265 -267
  276. package/payload/starter/_basic/examples/{login-page-v2.htm → login-page.htm} +266 -267
  277. package/payload/starter/_basic/examples/markdown-view.htm +220 -0
  278. package/payload/starter/_basic/examples/menu-bar-2.htm +225 -0
  279. package/payload/starter/_basic/examples/menu-bar.htm +145 -0
  280. package/payload/starter/_basic/examples/mini-graph-box.htm +98 -109
  281. package/payload/starter/_basic/examples/minimal-accent.htm +196 -0
  282. package/payload/starter/_basic/examples/minimal-theme.htm +432 -0
  283. package/payload/starter/_basic/examples/notice.htm +13 -4
  284. package/payload/starter/_basic/examples/number-field.htm +103 -0
  285. package/payload/starter/_basic/examples/numeric-keyboard.htm +44 -42
  286. package/payload/starter/_basic/examples/page-control.htm +181 -130
  287. package/payload/starter/_basic/examples/page-header.htm +57 -30
  288. package/payload/starter/_basic/examples/password-field.htm +117 -0
  289. package/payload/starter/_basic/examples/period-bar.htm +43 -29
  290. package/payload/starter/_basic/examples/phone-field-select-country.htm +292 -0
  291. package/payload/starter/_basic/examples/phone-field.htm +104 -0
  292. package/payload/starter/_basic/examples/progress-bar-ozden.htm +229 -92
  293. package/payload/starter/_basic/examples/progress-bar.htm +222 -174
  294. package/payload/starter/_basic/examples/property-panel.htm +152 -52
  295. package/payload/starter/_basic/examples/radio-button-2.htm +101 -109
  296. package/payload/starter/_basic/examples/radio-button-3.htm +81 -71
  297. package/payload/starter/_basic/examples/radio-button.htm +289 -0
  298. package/payload/starter/_basic/examples/range-slider.htm +171 -0
  299. package/payload/starter/_basic/examples/rich-text-editor.htm +115 -110
  300. package/payload/starter/_basic/examples/scroll-area.htm +293 -0
  301. package/payload/starter/_basic/examples/scrolling-text.htm +27 -6
  302. package/payload/starter/_basic/examples/search-input-2-light.htm +112 -0
  303. package/payload/starter/_basic/examples/search-input-3-dark.htm +105 -0
  304. package/payload/starter/_basic/examples/{search-input-v2-place.htm → search-input-place.htm} +25 -26
  305. package/payload/starter/_basic/examples/search-input.htm +159 -0
  306. package/payload/starter/_basic/examples/search-results.htm +85 -88
  307. package/payload/starter/_basic/examples/select-box-2-item-view.htm +304 -0
  308. package/payload/starter/_basic/examples/select-box-ozden-dark-text.htm +70 -0
  309. package/payload/starter/_basic/examples/select-box-ozden-item.htm +6 -5
  310. package/payload/starter/_basic/examples/select-box-ozden-text.htm +5 -3
  311. package/payload/starter/_basic/examples/select-box.htm +190 -159
  312. package/payload/starter/_basic/examples/settings-row.htm +92 -43
  313. package/payload/starter/_basic/examples/side-panel-2.htm +63 -25
  314. package/payload/starter/_basic/examples/side-panel.htm +84 -70
  315. package/payload/starter/_basic/examples/slider-2-split.htm +186 -0
  316. package/payload/starter/_basic/examples/slider-field-ozden.htm +286 -0
  317. package/payload/starter/_basic/examples/slider-field.htm +174 -134
  318. package/payload/starter/_basic/examples/slider.htm +257 -180
  319. package/payload/starter/_basic/examples/smart-button-3-ozden.htm +170 -257
  320. package/payload/starter/_basic/examples/smart-button-4-dark.htm +86 -47
  321. package/payload/starter/_basic/examples/smart-button-5-features.htm +130 -125
  322. package/payload/starter/_basic/examples/smart-button-alternatif.htm +266 -0
  323. package/payload/starter/_basic/examples/smart-button.htm +207 -174
  324. package/payload/starter/_basic/examples/smart-table-2.htm +43 -56
  325. package/payload/starter/_basic/examples/smart-table-3.htm +148 -113
  326. package/payload/starter/_basic/examples/smart-table-4.htm +37 -50
  327. package/payload/starter/_basic/examples/{smart-table-1.htm → smart-table-5.htm} +37 -48
  328. package/payload/starter/_basic/examples/smart-table.htm +183 -0
  329. package/payload/starter/_basic/examples/sortable-list.htm +191 -142
  330. package/payload/starter/_basic/examples/spark-line-box.htm +149 -161
  331. package/payload/starter/_basic/examples/splitter.htm +164 -0
  332. package/payload/starter/_basic/examples/status-bar.htm +166 -0
  333. package/payload/starter/_basic/examples/step-bar.htm +129 -0
  334. package/payload/starter/_basic/examples/stepper-2.htm +86 -58
  335. package/payload/starter/_basic/examples/stepper.htm +146 -135
  336. package/payload/starter/_basic/examples/tabs-2.htm +58 -67
  337. package/payload/starter/_basic/examples/tabs.htm +197 -180
  338. package/payload/starter/_basic/examples/tag-input.htm +150 -153
  339. package/payload/starter/_basic/examples/tap-effect.htm +23 -19
  340. package/payload/starter/_basic/examples/text-area-field.htm +104 -0
  341. package/payload/starter/_basic/examples/text-field-2.htm +113 -0
  342. package/payload/starter/_basic/examples/text-field-3-style.htm +105 -0
  343. package/payload/starter/_basic/examples/text-field-4-custom-unit.htm +96 -0
  344. package/payload/starter/_basic/examples/{input-b-ex5-warning-icon.htm → text-field-5-warning-icon.htm} +19 -19
  345. package/payload/starter/_basic/examples/text-field-6-modern-dark.htm +114 -0
  346. package/payload/starter/_basic/examples/text-field-7-modern.htm +106 -0
  347. package/payload/starter/_basic/examples/text-field-8-light-dark.htm +159 -0
  348. package/payload/starter/_basic/examples/text-field.htm +163 -0
  349. package/payload/starter/_basic/examples/time-line.htm +180 -116
  350. package/payload/starter/_basic/examples/time-picker.htm +240 -0
  351. package/payload/starter/_basic/examples/tiny-select.htm +118 -86
  352. package/payload/starter/_basic/examples/tiny-table.htm +40 -34
  353. package/payload/starter/_basic/examples/toast.htm +145 -147
  354. package/payload/starter/_basic/examples/toggle-2.htm +99 -68
  355. package/payload/starter/_basic/examples/toggle-3.htm +104 -101
  356. package/payload/starter/_basic/examples/toggle.htm +161 -93
  357. package/payload/starter/_basic/examples/tool-bar.htm +172 -0
  358. package/payload/starter/_basic/examples/tooltip-2.htm +110 -60
  359. package/payload/starter/_basic/examples/tooltip-3.htm +124 -65
  360. package/payload/starter/_basic/examples/tooltip-4.htm +218 -0
  361. package/payload/starter/_basic/examples/tooltip.htm +206 -124
  362. package/payload/starter/_basic/examples/tree-view.htm +210 -182
  363. package/payload/starter/_basic/examples/ui-effects.htm +207 -185
  364. package/payload/starter/_basic/examples/ui-standards.htm +200 -139
  365. package/payload/starter/_basic/examples/url-field.htm +120 -0
  366. package/payload/starter/_basic/examples/web-view.htm +109 -110
  367. package/payload/starter/_basic/min/accordion.min.js +2 -0
  368. package/payload/starter/_basic/min/action-button.min.js +1 -1
  369. package/payload/starter/_basic/min/app-bar.min.js +1 -1
  370. package/payload/starter/_basic/min/badge.min.js +2 -0
  371. package/payload/starter/_basic/min/bottom-bar.min.js +1 -1
  372. package/payload/starter/_basic/min/canvas.min.js +2 -0
  373. package/payload/starter/_basic/min/chat-view.min.js +2 -0
  374. package/payload/starter/_basic/min/check-box.min.js +1 -1
  375. package/payload/starter/_basic/min/code-editor.min.js +2 -0
  376. package/payload/starter/_basic/min/color-picker.min.js +2 -0
  377. package/payload/starter/_basic/min/context-menu.min.js +1 -1
  378. package/payload/starter/_basic/min/currency-field.min.js +2 -0
  379. package/payload/starter/_basic/min/data-table.min.js +1 -1
  380. package/payload/starter/_basic/min/date-picker.min.js +2 -0
  381. package/payload/starter/_basic/min/dialog.min.js +1 -1
  382. package/payload/starter/_basic/min/email-field.min.js +2 -0
  383. package/payload/starter/_basic/min/file-picker.min.js +2 -0
  384. package/payload/starter/_basic/min/filters.min.js +1 -1
  385. package/payload/starter/_basic/min/form.min.js +1 -1
  386. package/payload/starter/_basic/min/full-screen-select.min.js +1 -1
  387. package/payload/starter/_basic/min/gauge.min.js +1 -1
  388. package/payload/starter/_basic/min/graph-box.min.js +2 -0
  389. package/payload/starter/_basic/min/grid-group.min.js +2 -0
  390. package/payload/starter/_basic/min/hold-to-confirm-button.min.js +1 -1
  391. package/payload/starter/_basic/min/image-view.min.js +2 -0
  392. package/payload/starter/_basic/min/item-list.min.js +1 -1
  393. package/payload/starter/_basic/min/json-editor.min.js +2 -0
  394. package/payload/starter/_basic/min/json-view.min.js +2 -0
  395. package/payload/starter/_basic/min/label-editor.min.js +1 -1
  396. package/payload/starter/_basic/min/left-menu.min.js +1 -1
  397. package/payload/starter/_basic/min/line-progress-bar.min.js +1 -1
  398. package/payload/starter/_basic/min/loading-screen.min.js +1 -1
  399. package/payload/starter/_basic/min/log-view.min.js +2 -0
  400. package/payload/starter/_basic/min/login-page.min.js +2 -0
  401. package/payload/starter/_basic/min/markdown-view.min.js +2 -0
  402. package/payload/starter/_basic/min/menu-bar.min.js +2 -0
  403. package/payload/starter/_basic/min/mini-graph-box.min.js +1 -1
  404. package/payload/starter/_basic/min/minimal-accent.min.js +2 -0
  405. package/payload/starter/_basic/min/notice.min.js +1 -1
  406. package/payload/starter/_basic/min/number-field.min.js +2 -0
  407. package/payload/starter/_basic/min/numeric-keyboard.min.js +1 -1
  408. package/payload/starter/_basic/min/page-control.min.js +1 -1
  409. package/payload/starter/_basic/min/password-field.min.js +2 -0
  410. package/payload/starter/_basic/min/phone-field.min.js +2 -0
  411. package/payload/starter/_basic/min/progress-bar.min.js +1 -1
  412. package/payload/starter/_basic/min/property-panel.min.js +1 -1
  413. package/payload/starter/_basic/min/radio-button.min.js +1 -1
  414. package/payload/starter/_basic/min/range-slider.min.js +2 -0
  415. package/payload/starter/_basic/min/rich-text-editor.min.js +1 -1
  416. package/payload/starter/_basic/min/scroll-area.min.js +2 -0
  417. package/payload/starter/_basic/min/scrolling-text.min.js +1 -1
  418. package/payload/starter/_basic/min/search-input.min.js +2 -0
  419. package/payload/starter/_basic/min/search-results.min.js +1 -1
  420. package/payload/starter/_basic/min/select-box.min.js +1 -1
  421. package/payload/starter/_basic/min/settings-row.min.js +1 -1
  422. package/payload/starter/_basic/min/side-panel.min.js +1 -1
  423. package/payload/starter/_basic/min/slider-field.min.js +1 -1
  424. package/payload/starter/_basic/min/slider.min.js +1 -1
  425. package/payload/starter/_basic/min/smart-button.min.js +1 -1
  426. package/payload/starter/_basic/min/smart-table.min.js +1 -1
  427. package/payload/starter/_basic/min/sortable-list.min.js +1 -1
  428. package/payload/starter/_basic/min/spark-line-box.min.js +1 -1
  429. package/payload/starter/_basic/min/splitter.min.js +2 -0
  430. package/payload/starter/_basic/min/status-bar.min.js +2 -0
  431. package/payload/starter/_basic/min/step-bar.min.js +2 -0
  432. package/payload/starter/_basic/min/stepper.min.js +1 -1
  433. package/payload/starter/_basic/min/tabs.min.js +1 -1
  434. package/payload/starter/_basic/min/tag-input.min.js +1 -1
  435. package/payload/starter/_basic/min/text-area-field.min.js +2 -0
  436. package/payload/starter/_basic/min/text-field.min.js +2 -0
  437. package/payload/starter/_basic/min/time-line.min.js +1 -1
  438. package/payload/starter/_basic/min/time-picker.min.js +2 -0
  439. package/payload/starter/_basic/min/tiny-select.min.js +1 -1
  440. package/payload/starter/_basic/min/toast.min.js +1 -1
  441. package/payload/starter/_basic/min/toggle.min.js +1 -1
  442. package/payload/starter/_basic/min/tool-bar.min.js +2 -0
  443. package/payload/starter/_basic/min/tooltip.min.js +1 -1
  444. package/payload/starter/_basic/min/tree-view.min.js +1 -1
  445. package/payload/starter/_basic/min/ui-effects.min.js +1 -1
  446. package/payload/starter/_basic/min/url-field.min.js +2 -0
  447. package/payload/starter/_basic/min/web-view.min.js +1 -1
  448. package/payload/templates/booking/app/app.js +11 -8
  449. package/payload/templates/booking/app/settings.js +4 -4
  450. package/payload/templates/booking/index.htm +3 -3
  451. package/payload/templates/booking/pages/account.js +6 -6
  452. package/payload/templates/booking/pages/book.js +1 -1
  453. package/payload/templates/booking/pages/services.js +5 -4
  454. package/payload/templates/classic/app/app.js +15 -11
  455. package/payload/templates/classic/app/settings.js +22 -20
  456. package/payload/templates/classic/assets/_attribute.txt +2 -0
  457. package/payload/templates/classic/assets/cards/dill.png +0 -0
  458. package/payload/templates/classic/assets/cards/fennel.png +0 -0
  459. package/payload/templates/classic/assets/cards/juniper.png +0 -0
  460. package/payload/templates/classic/assets/cards/olives.png +0 -0
  461. package/payload/templates/classic/assets/cards/oregano.png +0 -0
  462. package/payload/templates/classic/assets/cards/pepper.png +0 -0
  463. package/payload/templates/classic/assets/cards/rosehip.png +0 -0
  464. package/payload/templates/classic/assets/categories/cappuccino.png +0 -0
  465. package/payload/templates/classic/assets/categories/chocolate-milk.png +0 -0
  466. package/payload/templates/classic/assets/categories/coffee.png +0 -0
  467. package/payload/templates/classic/assets/categories/frappe.png +0 -0
  468. package/payload/templates/classic/assets/categories/iced-caffee.png +0 -0
  469. package/payload/templates/classic/assets/categories/milkshake.png +0 -0
  470. package/payload/templates/classic/assets/categories/orange-juice.png +0 -0
  471. package/payload/templates/classic/assets/categories/tea.png +0 -0
  472. package/payload/templates/classic/index.htm +2 -2
  473. package/payload/templates/classic/pages/example.js +10 -10
  474. package/payload/templates/classic/pages/examples.js +44 -43
  475. package/payload/templates/classic/pages/home.js +16 -15
  476. package/payload/templates/classic/pages/info-pages.js +5 -5
  477. package/payload/templates/classic/pages/search.js +8 -7
  478. package/payload/templates/classic/pages/settings.js +13 -13
  479. package/payload/templates/classic/pages/tasks.js +1 -0
  480. package/payload/templates/classic/pages/template-pages.js +12 -11
  481. package/payload/templates/coffee-shop/app/app.js +12 -8
  482. package/payload/templates/coffee-shop/app/settings.js +4 -4
  483. package/payload/templates/coffee-shop/index.htm +3 -3
  484. package/payload/templates/coffee-shop/pages/drink.js +1 -1
  485. package/payload/templates/coffee-shop/pages/menu.js +5 -4
  486. package/payload/templates/forms/TEMPLATE.md +1 -1
  487. package/payload/templates/forms/appointment-form.htm +55 -53
  488. package/payload/templates/forms/contact-form-to-mail.htm +38 -37
  489. package/payload/templates/forms/contact-form-to-supabase.htm +47 -46
  490. package/payload/templates/forms/dark-contact-form.htm +43 -40
  491. package/payload/templates/forms/event-registration-form.htm +80 -77
  492. package/payload/templates/forms/feedback-form.htm +54 -54
  493. package/payload/templates/forms/order-form.htm +88 -84
  494. package/payload/templates/forms/recruitment-form.htm +60 -60
  495. package/payload/templates/forms/service/readme.md +9 -8
  496. package/payload/templates/forms/service/send-form-mail.php +38 -21
  497. package/payload/templates/forms/support-ticket-form.htm +67 -65
  498. package/payload/templates/panel/common/module-page.js +2 -2
  499. package/payload/templates/panel/common/theme.js +37 -10
  500. package/payload/templates/panel/common/top-bar.js +45 -40
  501. package/payload/templates/panel/index.htm +59 -60
  502. package/payload/templates/panel/module10/greenhouse.htm +98 -113
  503. package/payload/templates/panel/module11/arduino-projects.htm +47 -58
  504. package/payload/templates/panel/module6/energy-hub.htm +71 -103
  505. package/payload/templates/panel/module7/3d-printers.htm +58 -81
  506. package/payload/templates/panel/module8/cold-rooms.htm +58 -79
  507. package/payload/templates/panel/module9/elevator-fleet.htm +72 -93
  508. package/payload/templates/panel/pages/activity.js +134 -152
  509. package/payload/templates/panel/pages/contents.js +291 -308
  510. package/payload/templates/panel/pages/customers.js +250 -267
  511. package/payload/templates/panel/pages/edit-user.js +31 -30
  512. package/payload/templates/panel/pages/home.js +39 -70
  513. package/payload/templates/panel/pages/media.js +166 -183
  514. package/payload/templates/panel/pages/notifications.js +7 -7
  515. package/payload/templates/panel/pages/orders.js +200 -217
  516. package/payload/templates/panel/pages/products.js +259 -278
  517. package/payload/templates/panel/pages/reports.js +74 -123
  518. package/payload/templates/panel/pages/roles.js +57 -60
  519. package/payload/templates/panel/pages/settings.js +127 -143
  520. package/payload/templates/panel/pages/user-actions.js +106 -110
  521. package/payload/templates/panel/pages/user-list.js +221 -238
  522. package/payload/templates/panel/pages/users.js +14 -29
  523. package/payload/templates/shop/TEMPLATE.md +1 -1
  524. package/payload/templates/shop/app/app.js +11 -8
  525. package/payload/templates/shop/app/settings.js +4 -4
  526. package/payload/templates/shop/index.htm +3 -3
  527. package/payload/templates/shop/pages/account.js +7 -7
  528. package/payload/templates/shop/pages/cart.js +1 -1
  529. package/payload/templates/shop/pages/checkout.js +2 -2
  530. package/payload/templates/shop/pages/product.js +2 -2
  531. package/payload/templates/shop/pages/shop.js +6 -5
  532. package/payload/templates/starter/TEMPLATE.md +1 -1
  533. package/payload/templates/starter/app/app.js +12 -8
  534. package/payload/templates/starter/app/settings.js +14 -11
  535. package/payload/templates/starter/index.htm +3 -3
  536. package/payload/templates/starter/pages/about.js +1 -1
  537. package/payload/templates/starter/pages/home.js +2 -2
  538. package/payload/templates/starter/pages/product.js +1 -1
  539. package/payload/templates/starter/pages/products.js +5 -5
  540. package/payload/templates/starter/pages/settings.js +1 -1
  541. package/payload/templates/starter/pages/tasks.js +8 -8
  542. package/payload/templates/starter/pages/website.js +1 -1
  543. package/payload/starter/_basic/comp/chart-box/chart-4.5.1.umd.min.js +0 -13
  544. package/payload/starter/_basic/comp/chart-box/chart-js-LICENSE.md +0 -9
  545. package/payload/starter/_basic/comp/chart-box.js +0 -868
  546. package/payload/starter/_basic/comp/email-input-b.js +0 -57
  547. package/payload/starter/_basic/comp/input-b.js +0 -759
  548. package/payload/starter/_basic/comp/password-input-b.js +0 -164
  549. package/payload/starter/_basic/comp/search-input-v2.js +0 -427
  550. package/payload/starter/_basic/comp/textarea-b.js +0 -184
  551. package/payload/starter/_basic/comp/url-input-b.js +0 -145
  552. package/payload/starter/_basic/examples/badgeV2.htm +0 -68
  553. package/payload/starter/_basic/examples/chart-box.htm +0 -287
  554. package/payload/starter/_basic/examples/check-box-1.htm +0 -220
  555. package/payload/starter/_basic/examples/currency-input-b.htm +0 -71
  556. package/payload/starter/_basic/examples/email-input-b.htm +0 -67
  557. package/payload/starter/_basic/examples/input-b-ex1.htm +0 -132
  558. package/payload/starter/_basic/examples/input-b-ex2.htm +0 -136
  559. package/payload/starter/_basic/examples/input-b-ex3-style.htm +0 -113
  560. package/payload/starter/_basic/examples/input-b-ex4-custom-unit.htm +0 -112
  561. package/payload/starter/_basic/examples/input-b-ex6-dark.htm +0 -108
  562. package/payload/starter/_basic/examples/input-b-ex7-ozden.htm +0 -153
  563. package/payload/starter/_basic/examples/number-input-b.htm +0 -68
  564. package/payload/starter/_basic/examples/password-input-b.htm +0 -70
  565. package/payload/starter/_basic/examples/phone-input-b-select-country.htm +0 -298
  566. package/payload/starter/_basic/examples/phone-input-b.htm +0 -72
  567. package/payload/starter/_basic/examples/radio-button-1.htm +0 -264
  568. package/payload/starter/_basic/examples/search-input-v2-ozden.htm +0 -128
  569. package/payload/starter/_basic/examples/search-input-v2.htm +0 -65
  570. package/payload/starter/_basic/examples/select-color.htm +0 -215
  571. package/payload/starter/_basic/examples/select-date.htm +0 -244
  572. package/payload/starter/_basic/examples/select-file.htm +0 -268
  573. package/payload/starter/_basic/examples/select-time.htm +0 -249
  574. package/payload/starter/_basic/examples/smart-button-2.htm +0 -220
  575. package/payload/starter/_basic/examples/textarea-b.htm +0 -76
  576. package/payload/starter/_basic/examples/unfinished-login-page-dark-supabase.htm +0 -221
  577. package/payload/starter/_basic/examples/unfinished-login-page-supabase.htm +0 -221
  578. package/payload/starter/_basic/examples/url-input-b.htm +0 -85
  579. package/payload/starter/_basic/min/badge-v2.min.js +0 -2
  580. package/payload/starter/_basic/min/chart-box.min.js +0 -2
  581. package/payload/starter/_basic/min/currency-input-b.min.js +0 -2
  582. package/payload/starter/_basic/min/email-input-b.min.js +0 -2
  583. package/payload/starter/_basic/min/input-b.min.js +0 -2
  584. package/payload/starter/_basic/min/login-page-v2.min.js +0 -2
  585. package/payload/starter/_basic/min/number-input-b.min.js +0 -2
  586. package/payload/starter/_basic/min/password-input-b.min.js +0 -2
  587. package/payload/starter/_basic/min/phone-input-b.min.js +0 -2
  588. package/payload/starter/_basic/min/search-input-v2.min.js +0 -2
  589. package/payload/starter/_basic/min/select-color.min.js +0 -2
  590. package/payload/starter/_basic/min/select-date.min.js +0 -2
  591. package/payload/starter/_basic/min/select-file.min.js +0 -2
  592. package/payload/starter/_basic/min/select-time.min.js +0 -2
  593. package/payload/starter/_basic/min/textarea-b.min.js +0 -2
  594. package/payload/starter/_basic/min/url-input-b.min.js +0 -2
  595. package/payload/templates/panel/common/bridge.min.js +0 -0
  596. package/payload/templates/panel/common/full-view.min.js +0 -1
  597. package/payload/templates/panel/common/main-view.min.js +0 -1
  598. package/payload/templates/panel/common/module-page.min.js +0 -1
  599. package/payload/templates/panel/common/right-view.min.js +0 -1
  600. package/payload/templates/panel/common/start-page.min.js +0 -1
  601. package/payload/templates/panel/common/top-bar-v25-07-29-1.js +0 -330
  602. package/payload/templates/panel/common/top-bar-v25-07-29-2.js +0 -265
  603. package/payload/templates/panel/common/top-bar.min.js +0 -1
  604. package/payload/templates/panel/common/ui-standards.min.js +0 -1
  605. package/payload/templates/panel/managers/database.min.js +0 -1
  606. package/payload/templates/panel/managers/login.min.js +0 -1
  607. package/payload/templates/panel/pages/_page-template.min.js +0 -1
  608. package/payload/templates/panel/pages/contents.min.js +0 -1
  609. package/payload/templates/panel/pages/edit-user.min.js +0 -1
  610. package/payload/templates/panel/pages/edit-users-table.min.js +0 -1
  611. package/payload/templates/panel/pages/home.min.js +0 -1
  612. package/payload/templates/panel/pages/notifications.min.js +0 -1
  613. package/payload/templates/panel/pages/reports.min.js +0 -1
  614. package/payload/templates/panel/pages/settings.min.js +0 -1
  615. package/payload/templates/panel/pages/user-actions.min.js +0 -2
  616. package/payload/templates/panel/pages/users.min.js +0 -1
  617. /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn.png +0 -0
  618. /package/payload/starter/_basic/comp/{password-input-b → password-field}/hide-btn2.png +0 -0
  619. /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn.png +0 -0
  620. /package/payload/starter/_basic/comp/{password-input-b → password-field}/show-btn2.png +0 -0
  621. /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear-round.svg +0 -0
  622. /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/clear.svg +0 -0
  623. /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.png +0 -0
  624. /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/filter.svg +0 -0
  625. /package/payload/starter/_basic/comp/{search-input-v2 → search-input}/search.svg +0 -0
@@ -2,26 +2,62 @@
2
2
 
3
3
  /*
4
4
 
5
- SmartTable- v25.07 - "Optimized for big data"
5
+ SmartTable - v26.11 - "Optimized for big data"
6
6
 
7
- - SmartTable is a JavaScript table component designed to run smoothly even with millions of records. Thanks to its virtual scroll architecture, it only writes the visible rows to the DOM, eliminating memory and performance issues with large datasets. It makes data exploration easy with real-time filtering, multi-column sorting, and both horizontal and vertical scroll support. Custom cell designs can be created for each column via createCustomItemCell, allowing flexible visual content per column. Since column widths, heights, and colors are all configurable through parameters, it can be quickly adapted to different projects.
7
+ WHEN TO USE IT: to show very big data well, in both directions: very many rows (only the rows
8
+ that are seen are made) and very many columns (it scrolls sideways). A table that looks better for data that is not so
9
+ big: comp/data-table.js (DataTable). A few rows inside a text: comp/tiny-table.js (TinyTable).
8
10
 
11
+ STYLE PACKAGES: "light" (default; the old name "classic" works too) and "dark" are the looks of DataTable (comp/data-table.js);
12
+ "minimal" / "minimalDark": the minimal theme (_designs/minimal-theme.htm);
13
+ new pages use "light" on a light page and "dark" on a dark page. "green" is the look of SmartTable before them (the
14
+ green title line, the dark edge). A package is a package of params: it also gives searchInputParams (the filter box is
15
+ a SearchInput package: "ozden" / "ozdenDark"), scrollBarParams and searchTitleMenuParams. (SmartTable.styles)
16
+ Sample: _basic/examples/smart-table.htm (the model page of SmartTable).
17
+ - SmartTable({ styleName: "dark" }), SmartTable({ styleName: "dark", style: { lblItemCell: { fontSize: 14 } } })
18
+ - A page with its own colors over the green look names it: SmartTable({ styleName: "green", style: {...} }) (the keys it
19
+ does not give come from that package, not from classic).
20
+ - A cut text: a cell whose text does not fit (its end is "...") shows all of it in a bubble over
21
+ the cell when the mouse rests on it (style.cellTooltip: the look; showCellTooltip: 0 turns it off). The bubble is
22
+ comp/tooltip.js (Tooltip.show); without that file the browser's own hint (the title of the cell) shows the text.
23
+
24
+ - SmartTable is a JavaScript table component designed to run smoothly even with millions of records. Thanks to its virtual scroll architecture, it only writes the visible rows to the DOM, eliminating memory and performance issues with large datasets. It makes data exploration easy with real-time filtering, multi-column sorting, and both horizontal and vertical scroll support. Custom cell designs can be created for each column via createCellView / updateCellView, allowing flexible visual content per column. Since column widths, heights, and colors are all configurable through parameters, it can be quickly adapted to different projects.
9
25
 
10
- Started Date: Mar 2026
11
- Developer: Bugra Ozden
12
- Email: bugra.ozden@gmail.com
13
- Webpage: https://bug7a.github.io/js-components/
14
26
 
27
+ Started Date: March 2026
28
+ Webpage: https://bug7a.github.io/js-components/
15
29
 
16
- - Arama sütunu: Arama kutusunun sağındaki kutuya (ALL) basınca sütun listesi açılır. Arama sadece seçilen sütunda yapılır.
17
- -- searchTitleIndex: -1 (ALL: tüm sütunlar), showSearchTitleSelect: 0 ise kutu gizlenir.
18
- -- Liste için comp/context-menu.js yüklenmelidir. Yüklenmemiş ise, kutuya her basışta sıradaki sütuna geçer.
19
- - Eğer itemHeight 20px den küçük ise otomatik itemLineCount düşür ve eğer itemHeight büyükse 100px den itemLineCount arttır.
20
- - wheelScroll: 1 ise fare tekerleği tablonun satırlarını kaydırır (sayfa kaymaz). Varsayılan 0: tekerlek sayfayı kaydırır, satırlar scroll çubuğu ve butonlar ile kaydırılır.
21
- -- smartTable.setWheelScroll(1) ile sonradan açılabilir.
22
- - allowHtml (2026-10-29): 0 (varsayılan): hücre değerleri düz metin yazılır (kullanıcının yazdığı bir ad veya başlık
23
- HTML olarak çalışmaz). 1: değerler HTML olarak yazılır (Ex: "<b>12</b>"). createCustomItemCell / updateCustomItemCell
24
- içinde cell.label.text ile yazılan kendi değerleriniz etkilenmez.
30
+ Copyright 2020-2026 Bugra Ozden <bugra.ozden@gmail.com> (https://bug7a.github.io/)
31
+ Licensed under the Apache License, Version 2.0
32
+ SPDX-License-Identifier: Apache-2.0
33
+
34
+
35
+ - The search column: a press on the label at the right end of the search box (ALL) opens the list of the columns. The search looks only in the chosen column.
36
+ -- The chip is in the filter box at its right end; the clear icon shows at its left while
37
+ there is a text, and a narrow box shows no clear icon (searchInputParams.clearIconMinTextWidth: 80 px of text).
38
+ A narrow table gives the filter box the room up to the count (up to 240 px). Escape clears the filter
39
+ (searchInputParams.clearOnEscape: 1); in an empty filter it goes on to the page (a Dialog around closes).
40
+ -- searchTitleIndex: -1 (ALL: every column); showSearchTitleSelect: 0 hides the label.
41
+ -- The list needs comp/context-menu.js. Without it, every press on the label goes to the next column.
42
+ - fitLineCount: 1: the rows are about itemHeight px high and their count follows the height of the table
43
+ (style.height "100%" in a window that grows or shrinks). 0 (default): itemLineCount rows share the height of the table.
44
+ setItemLineCount(count) makes another count of rows.
45
+ - The keys (canSelect: 1 by default): a click selects a row and gives the table the focus. The selected
46
+ row: style.selectedItemCellColor (null: the color of the row under the mouse) and the line style.selectedBar at its
47
+ left. Then ↑ ↓ move one row, Page Up / Page Down one page, Home / End to the first / the last record, Enter runs
48
+ onSelect like a click. The selected row stays seen after a sort or a filter. The edge of the table shows the focus
49
+ of the keyboard (style.focusRingColor). selectItem(itemData), clearSelection(), getSelectedIndex(),
50
+ box.selectedItemData. canSelect: 0: no selection and no keys (a click only runs onSelect).
51
+ - locale: the language of the numbers of the info line. "": the language of the page (<html lang>); a page
52
+ with no language keeps "tr-TR". Ex: "en-US" -> 12,499, "tr-TR" -> 12.499. setLocale(locale).
53
+ - wheelScroll: 1: the mouse wheel scrolls the rows of the table (the page does not move). The default 0: the wheel scrolls the page; the rows move with the scroll bar and its buttons.
54
+ -- smartTable.setWheelScroll(1) turns it on later.
55
+ - The scroll buttons stand right of the table, outside its box (22 px: getVerticalScrollWidth()). The table keeps that
56
+ room: a width in percent is that much narrower, another width has a margin at its right, so in a group the next
57
+ object stands after the buttons. A table with a place of its own (left, top): leave the room yourself.
58
+ - allowHtml: 0 (default): the values of the cells are written as plain text (a name or a title a user wrote does not
59
+ run as HTML). 1: the values are written as HTML (Ex: "<b>12</b>"). Your own values written with cell.label.text in
60
+ createCellView / updateCellView are not touched.
25
61
 
26
62
 
27
63
  */
@@ -44,19 +80,23 @@ const SmartTableDefaults = {
44
80
  searchTitleIndex: -1, // -1: Search in all columns (ALL). 0, 1...: Search only in this column.
45
81
  showSearchTitleSelect: 1, // 0: Hide the column select box (ALL) next to the search input.
46
82
  wheelScroll: 0, // 1: The mouse wheel scrolls the rows (and the page does not scroll). 0: The wheel is left to the page.
47
- allowHtml: 0, // 1: The cell values are written as HTML. 0: As plain text (safe for the text of the users)
83
+ allowHtml: 0, // 1: The cell values, the titles of the columns and the texts are written as HTML. 0: As plain text (safe for the text of the users)
84
+ showCellTooltip: 1, // 1: a cell whose text does not fit shows all of it in a bubble (comp/tooltip.js). 0: no bubble
48
85
  allTitlesText: "ALL",
86
+ canSelect: 1, // 1: a click or a key selects a row; Enter runs onSelect. 0: no selection, no keys
87
+ fitLineCount: 0, // 1: rows of about itemHeight px, as many as the height of the table holds
88
+ locale: "", // the numbers of the info line ("": the language of the page). Ex: "en-US", "tr-TR"
49
89
  sortByTitleIndex: 0,
50
90
  sortDirection: "A-Z", // "A-Z" or "Z-A"
51
91
  fillTestData: 0,
52
- onSelect: function (itemData) { },
53
- createCustomItemCell: function (cell, titleDataIndex) { return cell },
54
- updateCustomItemCell: function (cell, titleDataIndex, data) { },
92
+ onSelect: function (self, itemData) { },
93
+ createCellView: null, // function (cell, titleDataIndex, self) { } Once for every cell (a cell shows other rows as the table scrolls): objects created here go into the cell; cell.label is its text
94
+ updateCellView: null, // function (cell, titleDataIndex, value, self) { } Every time a cell shows a value: paint what createCellView made
55
95
  titleDataList: [
56
- { name: "ID", dataTitle: "id", dataType: "integer", width: 100, shortable: 1 },
57
- { name: "NAME", dataTitle: "name", dataType: "string", width: 100, shortable: 1 },
58
- { name: "EMAIL", dataTitle: "email", dataType: "string", width: 290, shortable: 0 },
59
- { name: "", dataTitle: "active", dataType: "boolean", width: 40, shortable: 0 },
96
+ { name: "ID", dataTitle: "id", dataType: "integer", width: 100, sortable: 1 },
97
+ { name: "NAME", dataTitle: "name", dataType: "string", width: 100, sortable: 1 },
98
+ { name: "EMAIL", dataTitle: "email", dataType: "string", width: 290, sortable: 0 },
99
+ { name: "", dataTitle: "active", dataType: "boolean", width: 40, sortable: 0 },
60
100
  ],
61
101
  itemDataList: [
62
102
  { id: 1, name: "Bugra", desc: "about", email: "emainil", active: 1 },
@@ -84,84 +124,117 @@ const SmartTableDefaults = {
84
124
  neverHide: 0,
85
125
  showDots: 0,
86
126
  },
87
- // Filtredeki sütun listesinin (ContextMenu) parametreleri. (Sadece stil için; onClick bileşen tarafından verilir.)
127
+ // The params of the list of the columns in the filter (ContextMenu): only its look, the component gives its onClick.
88
128
  searchTitleMenuParams: {},
129
+ // The filter box (a SearchInput): its colors and edges come from the SearchInput package of styleName.
89
130
  searchInputParams: {
131
+ styleName: "ozden", // a SearchInput package: "ozden" (a light page), "ozdenDark"
90
132
  width: "50%",
91
133
  height: 36,
92
- border: 1,
93
- round: 8,
94
- color: "white",
134
+ fontSize: 15,
95
135
  searchIconSize: 16,
96
- placeholderText: "Filter",
97
- fontSize: 16,
98
- borderColor: "rgba(0, 0, 0, 0.4)",
99
- borderBottomStyle: "1px solid rgba(0, 0, 0, 0.4)",
100
- searchIconFile: "_basic/comp/search-input-v2/filter.png",
136
+ searchIconOpacity: 0.5,
137
+ placeholder: "Filter",
138
+ searchIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" preserveAspectRatio="none" fill="#000000"><rect x="0" y="85" width="512" height="57"/><rect x="85" y="227" width="342" height="56"/><rect x="199" y="370" width="114" height="57"/></svg>'), // three bars
139
+ clearIconMinTextWidth: 80, // (a narrow filter box has no clear icon; its text keeps that place)
140
+ clearOnEscape: 1, // Escape clears the filter (a narrow box has no clear icon)
101
141
  },
102
- style: {
142
+ styleName: "light", // "light" ("classic": its old name), "dark", "green", "minimal", "minimalDark" or a name added to SmartTable.styles
143
+ style: { // Light style package (default): the look of DataTable "light"
103
144
 
104
145
  width: "auto",
105
146
  height: "auto",
106
147
  round: 6,
107
148
  line1Color: "white",
108
- line2Color: "whitesmoke",
109
- highlightItemCellColor: "#F3E7C2",
110
- highlightTitleCellColor: White(0.2),
149
+ line2Color: "#F7F7F7",
150
+ // WHY solid colors: the cells are painted over the stripes of the rows; DataTable's soft yellow
151
+ // (rgba(254, 193, 8, 0.08) / 0.18) is mixed with white here, so a row looks the same on every stripe.
152
+ highlightItemCellColor: "#FFFAEB",
153
+ selectedItemCellColor: "#FFF4D3", // null: highlightItemCellColor (the row under the mouse)
154
+ selectedBar: { width: 0, color: "rgba(95, 158, 160, 0.9)" }, // the line at the left of the selected row (width 0: none)
155
+ focusRingColor: "rgba(95, 158, 160, 0.6)", // the edge of the table when the keys move its rows
156
+ highlightTitleCellColor: "white",
157
+ titleUppercase: 1, // 1: the titles in capital letters (0: as titleDataList writes them)
111
158
  verticalScrollWidth: 20,
112
159
  verticalScrollMargin: 2,
113
- btnScrollDownIconFile: "_basic/comp/smart-table/down.png",
114
- btnScrollUpIconFile: "_basic/comp/smart-table/up.png",
115
- btnScrollCenterIconFile: "_basic/comp/smart-table/scroll.png",
116
- sortIconFile: "_basic/comp/smart-table/sort.png",
117
- loadingIconFile: "_basic/comp/smart-table/clock.png",
160
+ btnScrollDownIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 84V116M27 103L40 116L53 103"/></svg>'),
161
+ btnScrollUpIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 116V84M27 97L40 84L53 97"/></svg>'),
162
+ btnScrollCenterIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 50" fill="none" stroke="#000000" stroke-opacity="0.4" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17.5v15M6.5 21 10 17.5 13.5 21M6.5 29 10 32.5 13.5 29"/></svg>'),
163
+ sortIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.71,9.88l-4.3-4.29a2,2,0,0,0-2.82,0L6.29,9.88a1,1,0,0,0,0,1.41,1,1,0,0,0,1.42,0L11,8V19a1,1,0,0,0,2,0V8l3.29,3.29a1,1,0,1,0,1.42-1.41Z"/></svg>'),
164
+ loadingIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" preserveAspectRatio="none"><circle cx="256" cy="256" r="206" fill="#FFFFFF" stroke="#141414" stroke-width="20"/><path d="M256 113V256H358" fill="none" stroke="#141414" stroke-width="20" stroke-linecap="round" stroke-linejoin="round"/></svg>'),
118
165
  searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#373836" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
119
- invertIconColor: 0,
166
+ invertIconColor: 0, // 1: the sort and the scroll arrows are drawn light (a dark page)
167
+ sortIcon: { size: 16, opacity: 0.25, activeOpacity: 1 }, // the arrow of a title: not sorted / sorted
168
+ // The bubble of a cut text: the keys of Tooltip.BUBBLE_LOOK (comp/tooltip.js) and maxWidth (px: a longer
169
+ // text goes on more lines)
170
+ cellTooltip: { fontSize: 14, color: "white", textColor: Black(0.8), round: 6, border: 1, borderColor: Black(0.15), shadow: "0 6px 16px " + Black(0.12), arrow: 10, padding: [12, 8], maxWidth: 360 },
120
171
 
121
172
  box: { color: "white" },
122
- boxBorder: { border: 2, borderColor: Black(0.8) },
123
- boxTitleLine: { color: "#65A293", },
124
- boxTitleCell: { padding: [8, 0], borderRight: "1px solid rgba(0, 0, 0, 0.5)", borderBottom: "2px solid #141414", },
125
- lblTitleCell: { fontSize: 20, fontFamily: "opensans", textColor: Black(0.8), },
126
- boxItemCell: { borderBottom: "1px solid darkgray", borderRight: "1px solid rgba(0, 0, 0, 0.05)", padding: [8, 0], },
127
- lblItemCell: { fontSize: 20, textColor: Black(0.75), fontFamily: "opensans", },
128
- boxInfoLine: { color: "#E4E4E4", borderTop: "1px solid rgba(0, 0, 0, 0)" },
129
- lblBoxInfoLine: { fontSize: 16, textColor: Black(0.85), },
130
- lblNoDataFound: { color: "lightgray", padding: [8, 2], fontSize: 14, round: 8, border: 1, borderColor: Black(0.4), },
131
- // Filtre kutusundaki sütun seçim etiketi (ALL). Boş ise lblNoDataFound stili kullanılır.
132
- lblSearchTitle: {},
133
- btnScrollCenter: { color: "white", round: 100, borderColor: "rgba(0,0,0,0.4)", border: 1, },
134
- btnScrollUp: { color: "lightgray", round: 100, border: 1, },
135
- btnScrollDown: { color: "lightgray", round: 100, border: 1, },
136
- boxSort: { color: "#65A293" },
173
+ boxBorder: { border: 1, borderColor: Black(0.15) },
174
+ boxTitleLine: { color: "whitesmoke" },
175
+ boxTitleCell: { padding: [10, 0], borderRight: "1px solid " + Black(0.08), borderBottom: "1px solid " + Black(0.2) },
176
+ lblTitleCell: { fontSize: 15, fontFamily: "opensans-bold", textColor: Black(0.8) },
177
+ boxItemCell: { borderBottom: "1px solid " + Black(0.08), borderRight: "none", padding: [10, 0] },
178
+ lblItemCell: { fontSize: 15, textColor: Black(0.7), fontFamily: "opensans" },
179
+ boxInfoLine: { color: "white", borderTop: "1px solid " + Black(0.2) },
180
+ lblBoxInfoLine: { fontSize: 14, textColor: Black(0.5) },
181
+ lblNoDataFound: { color: "transparent", textColor: Black(0.45), padding: [8, 2], fontSize: 15, round: 8, border: 0, borderColor: "transparent" },
182
+ // The label that chooses the column in the filter box (ALL), over the style of lblNoDataFound.
183
+ lblSearchTitle: { color: "white", textColor: Black(0.6), padding: [8, 2], fontSize: 12, round: 50, border: 1, borderColor: Black(0.12) },
184
+ btnScrollCenter: { color: "white", round: 100, border: 1, borderColor: Black(0.2) },
185
+ btnScrollUp: { color: "whitesmoke", round: 100, border: 1, borderColor: Black(0.15) },
186
+ btnScrollDown: { color: "whitesmoke", round: 100, border: 1, borderColor: Black(0.15) },
187
+ boxSort: { color: "transparent" },
137
188
 
138
189
  },
139
190
  };
140
191
 
141
192
  const SmartTable = function (params = {}) {
142
193
 
194
+ // Merge style package: params.style > SmartTable.styles[styleName] (a package of params) > SmartTableDefaults (light)
195
+ basic.applyStylePackage(params, SmartTable.styles, SmartTableDefaults);
196
+
197
+ // Merge params:
143
198
  mergeIntoIfMissing(params, SmartTableDefaults);
144
199
 
145
200
  // BOX: Component container
146
201
  let box = startObject(params);
147
202
 
148
- // WHY: mergeIntoIfMissing dizileri referansla kopyalıyor. Kopyalanmaz ise setTitleCellWidth, SmartTableDefaults (ve diğer tabloları) değiştirir.
203
+ // WHY: mergeIntoIfMissing copies an array by reference. Without a copy, setTitleCellWidth would change SmartTableDefaults (and the other tables).
149
204
  box.titleDataList = box.titleDataList.map(titleData => ({ ...titleData }));
150
205
  box.itemDataList = [...box.itemDataList];
151
206
 
152
207
  // *** PRIVATE VARIABLES:
153
208
  const DEFAULT_CELL_WIDTH = 100;
154
- const SORT_ICON_SIZE = 22;
155
209
  const SCROLL_CENTER_HEIGHT = 50;
210
+ const CELL_TOOLTIP_DELAY = 300; // ms: the mouse rests on a cell before its bubble shows (no bubbles while it moves)
156
211
  const LOADING_ICON_SIZE = 32;
157
212
  const SEARCH_TITLE_MAX_WIDTH = "160px";
213
+ const SEARCH_TITLE_RIGHT = 6; // px: the chip (ALL) from the right side of the filter box
214
+ const SEARCH_TITLE_GAP = 6; // px: between the clear icon of the filter box and the chip
215
+ const SEARCH_MIN_WIDTH = 240; // px: a narrow table gives the filter box more than its share of the line, up to this
216
+ const TOOLBAR_PADDING = 8; // px: the filter box from the left side of the info line
217
+ const TOOLBAR_GAP = 12; // px: between the filter box and the count
218
+ const COUNT_RIGHT = 14; // px: the count from the right side of the info line
158
219
  const FILTER_DELAY = 50; // ms
159
220
  const RESIZE_DELAY = 3; // ms
160
- const LOADING_MIN_ITEM_COUNT = 1000; // WHY: Küçük listelerde loading bir an yanıp sönmesin.
221
+ const LOADING_MIN_ITEM_COUNT = 1000; // WHY: a short list must not flash the loading for a moment.
161
222
  const TEST_DATA_REPEAT_COUNT = 100000;
223
+ const DEFAULT_LOCALE = "tr-TR"; // WHY: the numbers were always Turkish before; a page with no language keeps them
224
+ const targetItemHeight = box.itemHeight; // fitLineCount: the height of a row, before the rows share the height
225
+ let searchClearIconRight = 0; // the place of the clear icon of the filter box with no chip (its own)
226
+ let hoveredCell = null; // the cell under the mouse (the bubble of a cut text: showCellTooltip)
227
+ let cellTooltip = null; // the bubble of a cut text (Tooltip.show), null: none
228
+ let cancelCellTooltipTimer = null;
162
229
 
163
230
  // *** PRIVATE FUNCTIONS:
164
231
 
232
+ const setText = function (label, text) {
233
+ const value = (text === undefined || text === null) ? "" : String(text);
234
+ if (box.allowHtml == 1) label.text = value;
235
+ else label.plainText = value;
236
+ };
237
+
165
238
  // The last top index: the last page of rows ends with the last record.
166
239
  const getMaxScrollIndex = function () {
167
240
  return Math.max(0, box.visibleItemDataList.length - box.itemLineCount);
@@ -172,7 +245,7 @@ const SmartTable = function (params = {}) {
172
245
  return Math.min(index, getMaxScrollIndex());
173
246
  };
174
247
 
175
- // WHY: isNaN("") false döndüğü için boş değerler sayı sanılıyor, parseFloat("") NaN verip sıralamayı bozuyordu.
248
+ // WHY: isNaN("") is false, so an empty value was taken as a number, and parseFloat("") gave NaN and broke the sorting.
176
249
  const toSortNumber = function (value) {
177
250
  if (typeof value === "number") return value;
178
251
  if (typeof value === "string" && value.trim() !== "") return Number(value);
@@ -184,15 +257,19 @@ const SmartTable = function (params = {}) {
184
257
  box.state = "normal";
185
258
  // Created items by data [var]
186
259
  box.visibleItemDataList = [...box.itemDataList];
260
+ // The SearchInput of the filter, made in createToolbar [var]. USAGE: table.searchInput.setValue("") (a new list)
261
+ box.searchInput = null;
262
+ // The selected record (canSelect: 1), null: none [var]. USAGE: table.selectItem(data), table.getSelectedIndex()
263
+ box.selectedItemData = null;
187
264
  // [var]
188
265
  box.titleCellList = [];
189
266
  // [var]
190
267
  box.titleCellCount = 0;
191
268
  // [var]
192
269
  box.itemLineList = [];
193
- // [var] en üstteki kaydın index i
270
+ // [var] the index of the record at the top
194
271
  box.startedItemIndexForScrolling = 0;
195
- // Scroll haraketi için gerekli değişkenler [var]
272
+ // The variables of the scroll [var]
196
273
  box.scrollVars = {};
197
274
  // [var] if height not auto will recallItemHeight
198
275
  box.recalcItemHeight = 0;
@@ -231,8 +308,9 @@ const SmartTable = function (params = {}) {
231
308
  clearTimeout(box.refreshTimer);
232
309
  clearTimeout(box.filterTimer);
233
310
 
234
- // WHY: Menü page üzerinde oluşturuluyor; box.remove() onu silmez. (Before the cascade: it detaches from its target label.)
311
+ // WHY: the menu is made on the page: box.remove() does not remove it. (Before the cascade: it detaches from its target label.)
235
312
  if (box.searchTitleMenu) box.searchTitleMenu.remove();
313
+ closeCellTooltip(); // WHY: the bubble is on the page too
236
314
 
237
315
  superRemove.call(box); // NOTE: basic.js remove(). It cleans all the events (listenTo too) and the objects inside.
238
316
  box = null;
@@ -243,15 +321,18 @@ const SmartTable = function (params = {}) {
243
321
  const hideItemLine = function (itemLine) {
244
322
  itemLine.opacity = 0;
245
323
  itemLine.clickable = 0;
324
+ itemLine.cursor = ""; // (its cells take the cursor of the row: no hand over the empty part of the table)
325
+ itemLine.itemData = null;
326
+ paintItemLine(itemLine);
246
327
  };
247
328
 
248
329
  const fillItemLine = function (itemLine, rowData) {
249
330
 
250
331
  itemLine.opacity = 1;
251
332
  itemLine.clickable = 1;
252
- itemLine.itemData = rowData; // WHY: Line a basıldığında bu bilgi kullanılacak.
253
-
254
- // TODO: If selected itemData == this item data then make colored.
333
+ itemLine.cursor = "pointer";
334
+ itemLine.itemData = rowData; // WHY: a press on the row uses it
335
+ paintItemLine(itemLine);
255
336
 
256
337
  for (let j = 0; j < box.titleCellCount; j++) {
257
338
 
@@ -259,16 +340,15 @@ const SmartTable = function (params = {}) {
259
340
  const cell = itemLine["itemCell" + j];
260
341
  const newValue = rowData[titleData.dataTitle] ?? "";
261
342
 
262
- // Sadece değer değişmişse DOM'a dokun
263
- // WHY: label.text innerHTML (string) döndürüyor; sayı veya "&" içeren değerlerle karşılaştırma hep farklı çıkıyordu. Son yazılan değer hücrede tutuluyor.
264
- if (!("lastValue" in cell) || cell.lastValue !== newValue) { // WHY: eğer !== olmaz ise, 0 ile "" aynı sayılıyor.
343
+ // The DOM is touched only when the value changed
344
+ // WHY: label.text gives the innerHTML (a string): a number or a value with "&" was always different. The cell keeps the last value it wrote.
345
+ if (!("lastValue" in cell) || cell.lastValue !== newValue) { // WHY: without !==, 0 and "" were the same.
265
346
  cell.lastValue = newValue;
266
347
  // WHY plainText: a value from a user (a name, a title) ran as HTML in the cell
267
- if (box.allowHtml == 1) cell.label.text = newValue;
268
- else cell.label.plainText = newValue;
348
+ setText(cell.label, newValue);
269
349
  }
270
350
 
271
- box.updateCustomItemCell(cell, j, newValue);
351
+ if (box.updateCellView) box.updateCellView(cell, j, newValue, box);
272
352
 
273
353
  }
274
354
 
@@ -296,6 +376,7 @@ const SmartTable = function (params = {}) {
296
376
 
297
377
  box.setVerticalScrollEnabled(dataList.length > lineCount);
298
378
  box.updateInfoLabel();
379
+ refreshCellTooltip();
299
380
 
300
381
  };
301
382
 
@@ -306,7 +387,7 @@ const SmartTable = function (params = {}) {
306
387
 
307
388
  box.setVerticalScrollEnabled = function (enabled) {
308
389
 
309
- // Sadece kullanılabilir durumda ise enabled yapılabilir.
390
+ // It is enabled only when it can be used.
310
391
  if (enabled && box.visibleItemDataList.length > box.itemLineCount) {
311
392
  setScrollButtonState(box.btnScrollCenter, 1, 1);
312
393
  setScrollButtonState(box.btnScrollUp, 1, 1);
@@ -333,7 +414,7 @@ const SmartTable = function (params = {}) {
333
414
 
334
415
  }
335
416
 
336
- // Başlık listesini oluştur
417
+ // The row of the titles
337
418
  box.createTitleLine = function () { // [GOOD]
338
419
 
339
420
  box.titleCellList = [];
@@ -355,41 +436,43 @@ const SmartTable = function (params = {}) {
355
436
 
356
437
  box.titleDataList = titleDataList.map(titleData => ({ ...titleData }));
357
438
  box.createTitleLine();
358
- // WHY: Satırlardaki hücre sayısı başlık sayısı ile aynı olmalı. Yoksa refreshData olmayan hücreye erişir.
439
+ // WHY: a row has as many cells as there are titles, or refreshData reaches a cell that is not there.
359
440
  box.createItemLines();
360
441
  if (box.recalcItemHeight) box.setItemHeight(box.itemHeight);
361
442
  box.stretchLastCell(box.calcLastCellWidth());
362
443
  if (!box.titleDataList[box.sortByTitleIndex]) box.sortByTitleIndex = 0;
363
444
  box.updateSortIcon();
364
- box.updateSearchTitleSelect(); // WHY: Sütunlar değişti; liste yenilensin, olmayan sütun seçili ise ALL olsun.
445
+ box.updateSearchTitleSelect(); // WHY: the columns changed: the list is made again, and a chosen column that is gone becomes ALL.
365
446
  box.filterAndSortData();
366
447
 
367
448
  }
368
449
 
369
450
  box.createSortIcon = function (titleCell) {
370
451
 
452
+ const iconSize = box.style.sortIcon.size;
453
+
371
454
  startBox({
372
455
  align: "right center",
373
456
  color: box.style.boxSort.color,
374
457
  round: 100,
375
458
  border: 0,
376
459
  borderColor: "rgba(0,0,0,0.1)",
377
- width: SORT_ICON_SIZE,
378
- height: SORT_ICON_SIZE,
460
+ width: iconSize,
461
+ height: iconSize,
379
462
  right: 2,
380
463
  padding: [4, 0],
381
464
  position: "absolute",
382
465
  });
383
- if (titleCell.shortable == 0) that.opacity = 0;
466
+ if (titleCell.sortable == 0) that.opacity = 0;
384
467
  titleCell.add(that);
385
468
  that.center("top");
386
469
 
387
470
  titleCell.icon = Icon({
388
- width: SORT_ICON_SIZE,
389
- height: SORT_ICON_SIZE,
471
+ width: iconSize,
472
+ height: iconSize,
390
473
  left: 0,
391
474
  top: 0,
392
- opacity: 0.5,
475
+ opacity: box.style.sortIcon.opacity,
393
476
  });
394
477
  that.setMotion("opacity 0.3s, transform 0.3s");
395
478
  that.load(box.style.sortIconFile);
@@ -405,14 +488,14 @@ const SmartTable = function (params = {}) {
405
488
  box.titleCellList.forEach(function (titleCell, titleCellIndex) {
406
489
  if (titleCellIndex != currentTitleCell.titleCellIndex) {
407
490
  titleCell.icon.rotate = 0;
408
- titleCell.icon.opacity = 0.5;
491
+ titleCell.icon.opacity = box.style.sortIcon.opacity;
409
492
  titleCell.sortDirection = "";
410
493
  }
411
494
  });
412
495
 
413
496
  };
414
497
 
415
- // Başlık hücresi oluştur
498
+ // A title cell
416
499
  box.createTitleCell = function (titleData, titleCellIndex) {
417
500
 
418
501
  // TitleCell
@@ -435,13 +518,14 @@ const SmartTable = function (params = {}) {
435
518
  // DATA IN OBJECT (titleCell)
436
519
  that.titleCellIndex = titleCellIndex;
437
520
  that.titleDataTitle = titleData.dataTitle;
438
- that.shortable = titleData.shortable;
521
+ that.sortable = titleData.sortable;
439
522
 
440
523
  titleCell.label = Label({
441
- text: titleData.name,
442
524
  ...box.style.lblTitleCell,
443
525
  });
526
+ setText(titleCell.label, titleData.name);
444
527
  that.css.fontFamily = box.style.lblTitleCell.fontFamily;
528
+ if (box.style.titleUppercase == 1) that.css.textTransform = "uppercase";
445
529
 
446
530
  endAutoLayout();
447
531
 
@@ -449,7 +533,7 @@ const SmartTable = function (params = {}) {
449
533
 
450
534
  titleCell.on("click", function (self, event) {
451
535
 
452
- if (self.shortable != 1) return;
536
+ if (self.sortable != 1) return;
453
537
 
454
538
  box.resetSortIcons(self);
455
539
  box.sortByTitleIndex = self.titleCellIndex;
@@ -475,7 +559,7 @@ const SmartTable = function (params = {}) {
475
559
  box.updateSortIcon = function() {
476
560
 
477
561
  const titleCell = box.titleCellList[box.sortByTitleIndex];
478
- if (!titleCell) return; // WHY: Geçersiz sortByTitleIndex verilirse hata vermesin.
562
+ if (!titleCell) return; // WHY: a sortByTitleIndex with no column must not throw.
479
563
 
480
564
  if (box.sortDirection == "A-Z") {
481
565
  titleCell.sortDirection = "A-Z";
@@ -485,7 +569,7 @@ const SmartTable = function (params = {}) {
485
569
  titleCell.icon.rotate = 180;
486
570
  }
487
571
 
488
- titleCell.icon.opacity = 1;
572
+ titleCell.icon.opacity = box.style.sortIcon.activeOpacity;
489
573
 
490
574
  };
491
575
 
@@ -499,6 +583,7 @@ const SmartTable = function (params = {}) {
499
583
  box.clearColumnHighlight = function (titleCell) {
500
584
  if (!box.highlightTitle) return;
501
585
  paintColumn(titleCell, "transparent", "transparent");
586
+ box.itemLineList.forEach(paintItemLine); // WHY: the selected row gets its color back
502
587
  };
503
588
 
504
589
  box.applyColumnHighlight = function (titleCell) {
@@ -506,11 +591,13 @@ const SmartTable = function (params = {}) {
506
591
  paintColumn(titleCell, box.style.highlightTitleCellColor, box.style.highlightItemCellColor);
507
592
  };
508
593
 
509
- // Tüm bilgi satırlarını oluştur.
594
+ // All the rows.
510
595
  box.createItemLines = function () {
511
596
 
597
+ setHoveredCell(null); // WHY: the cell under the mouse is removed with its row
598
+ // WHY remove(): the objects of the old rows (and of the cells of the page) are cleaned, not only taken off the page
599
+ box.itemLineList.forEach(function (itemLine) { itemLine.remove(); });
512
600
  box.itemLineList = [];
513
- box.boxItemLineGroup.html = "";
514
601
 
515
602
  for (let i = 0; i < box.itemLineCount; i++) {
516
603
  const itemLineIndex = i;
@@ -522,7 +609,7 @@ const SmartTable = function (params = {}) {
522
609
 
523
610
  }
524
611
 
525
- // Bir bilgi satırı oluştur
612
+ // A row
526
613
  box.createItemLine = function (itemData, itemLineIndex) {
527
614
 
528
615
  // GROUP: ItemLine
@@ -543,10 +630,16 @@ const SmartTable = function (params = {}) {
543
630
  endGroup();
544
631
 
545
632
  itemLine.on("click", function (self) {
546
- box.onSelect(self.itemData);
633
+ // WHY: a row with no record is unseen, but its cells still take the mouse (their hover makes them clickable)
634
+ if (!self.itemData) return;
635
+ if (box.canSelect == 1) {
636
+ box.selectItem(self.itemData);
637
+ box.elem.focus({ preventScroll: true }); // WHY preventScroll: the page must not move to the table
638
+ }
639
+ box.onSelect(box, self.itemData);
547
640
  });
548
641
 
549
- if (box.style.height != "auto") itemLine.visible = 0; // WHY: Yüksekli yeniden hesaplanması gerekirse, ekranda kırpma yapması için gizli oluşturuluyor.
642
+ if (box.style.height != "auto") itemLine.visible = 0; // WHY: made hidden, so it is not seen cut while its height is measured again.
550
643
  return itemLine;
551
644
 
552
645
  };
@@ -557,7 +650,114 @@ const SmartTable = function (params = {}) {
557
650
  }
558
651
  };
559
652
 
560
- // Hücre oluştur.
653
+ // The color of the cells of a row: the selected record, else the row under the mouse (highlightLine), else none
654
+ const paintItemLine = function (itemLine) {
655
+
656
+ const isSelected = Boolean(itemLine.itemData) && itemLine.itemData === box.selectedItemData;
657
+ let color = "transparent";
658
+ if (itemLine.isHover && box.highlightLine) color = box.style.highlightItemCellColor;
659
+ if (isSelected) color = getSelectedColor();
660
+ paintItemLineCells(itemLine, color);
661
+
662
+ // WHY the bar: by default the selected row has the color of the row under the mouse; the bar tells them apart
663
+ const firstCell = itemLine["itemCell0"];
664
+ if (firstCell) firstCell.boxShadow = isSelected ? getSelectedBarShadow() : "none";
665
+
666
+ };
667
+
668
+ const getSelectedBarShadow = function () {
669
+ if (!box.style.selectedBar.width) return "none";
670
+ // WHY + the border: the edge of the table (style.boxBorder) is drawn over the first px of the row
671
+ const width = (basic.num(box.style.boxBorder.border) || 0) + box.style.selectedBar.width;
672
+ return "inset " + width + "px 0 0 " + box.style.selectedBar.color;
673
+ };
674
+
675
+ const getSelectedColor = function () {
676
+ return box.style.selectedItemCellColor || box.style.highlightItemCellColor;
677
+ };
678
+
679
+ // *** THE BUBBLE OF A CUT TEXT (showCellTooltip: 1):
680
+
681
+ const onCellHoverChange = function (cell, isOver) {
682
+ if (isOver) {
683
+ setHoveredCell(cell);
684
+ return;
685
+ }
686
+ if (hoveredCell === cell) setHoveredCell(null);
687
+ };
688
+
689
+ const setHoveredCell = function (cell) {
690
+ hoveredCell = cell;
691
+ planCellTooltip();
692
+ };
693
+
694
+ // The bubble waits until the mouse rests on the cell
695
+ const planCellTooltip = function () {
696
+ closeCellTooltip();
697
+ if (!hoveredCell || box.showCellTooltip != 1) return;
698
+ cancelCellTooltipTimer = box.after(CELL_TOOLTIP_DELAY, openCellTooltip);
699
+ };
700
+
701
+ const openCellTooltip = function () {
702
+
703
+ cancelCellTooltipTimer = null;
704
+ const text = getCutText(hoveredCell);
705
+
706
+ // WHY: without comp/tooltip.js the browser's own hint (the title of the cell) shows the text
707
+ if (typeof Tooltip === "undefined") {
708
+ hoveredCell.elem.title = text;
709
+ return;
710
+ }
711
+
712
+ if (!text) return;
713
+ cellTooltip = Tooltip.show(hoveredCell, text, box.style.cellTooltip, "top", function (bubble) {
714
+ createTooltipText(text, bubble.look);
715
+ });
716
+ cellTooltip.cellText = text;
717
+
718
+ };
719
+
720
+ // The whole text of a cell whose text does not fit (its end is "..."). "": it fits, or the row has no record.
721
+ const getCutText = function (cell) {
722
+ // WHY itemData: a row with no record keeps the text of its last record, unseen
723
+ if (!cell.itemLine.itemData) return "";
724
+ const label = cell.label.elem;
725
+ // (a hidden label, Ex: a cell of createCellView, is 0 px wide: it fits)
726
+ if (label.scrollWidth <= label.clientWidth) return "";
727
+ return label.textContent;
728
+ };
729
+
730
+ // LABEL: The whole text in the bubble (a long text goes on more lines: look.maxWidth)
731
+ const createTooltipText = function (text, look) {
732
+ Label({
733
+ plainText: text,
734
+ fontSize: look.fontSize,
735
+ textColor: look.textColor,
736
+ css: { whiteSpace: "normal", overflowWrap: "anywhere", width: "max-content", maxWidth: look.maxWidth + "px" },
737
+ });
738
+ };
739
+
740
+ const closeCellTooltip = function () {
741
+ if (cancelCellTooltipTimer) cancelCellTooltipTimer();
742
+ cancelCellTooltipTimer = null;
743
+ if (cellTooltip) cellTooltip.remove();
744
+ cellTooltip = null;
745
+ };
746
+
747
+ // The rows were filled again (a scroll, a filter, a click): a bubble with an old text is made again
748
+ const refreshCellTooltip = function () {
749
+ if (!hoveredCell) return;
750
+ if (cellTooltip && cellTooltip.cellText === hoveredCell.label.elem.textContent) return;
751
+ planCellTooltip();
752
+ };
753
+
754
+ box.setShowCellTooltip = function (value) {
755
+ box.showCellTooltip = basic.isOn(value) ? 1 : 0;
756
+ planCellTooltip();
757
+ };
758
+ // USAGE: smartTable.setShowCellTooltip(0)
759
+
760
+ // A cell.
561
761
  box.createItemCell = function (cellWidth, titleDataIndex, itemLine) {
562
762
 
563
763
  // GROUP: ItemCell
@@ -573,7 +773,6 @@ const SmartTable = function (params = {}) {
573
773
  borderBottom: box.style.boxItemCell.borderBottom,
574
774
  borderRight: box.style.boxItemCell.borderRight,
575
775
  };
576
- that.cursor = "pointer";
577
776
 
578
777
  itemCell.label = Label({
579
778
  text: "",
@@ -588,16 +787,25 @@ const SmartTable = function (params = {}) {
588
787
  endAutoLayout();
589
788
 
590
789
  itemCell.on("mouseover", function (self, event) {
591
- if (!box.highlightLine) return;
592
- paintItemLineCells(itemLine, box.style.highlightItemCellColor);
790
+ itemLine.isHover = 1;
791
+ paintItemLine(itemLine);
593
792
  });
594
793
 
595
794
  itemCell.on("mouseout", function (self, event) {
596
- if (!box.highlightLine) return;
597
- paintItemLineCells(itemLine, "transparent");
795
+ itemLine.isHover = 0;
796
+ paintItemLine(itemLine);
797
+ });
798
+
799
+ itemCell.itemLine = itemLine; // (a row with no record shows no bubble)
800
+ itemCell.onHoverChange(function (self, isOver) {
801
+ onCellHoverChange(itemCell, isOver);
598
802
  });
599
803
 
600
- itemCell = box.createCustomItemCell(itemCell, titleDataIndex);
804
+ if (box.createCellView) {
805
+ createIn(itemCell, function () {
806
+ box.createCellView(itemCell, titleDataIndex, box);
807
+ });
808
+ }
601
809
 
602
810
  return itemCell;
603
811
 
@@ -606,7 +814,7 @@ const SmartTable = function (params = {}) {
606
814
  // RIGHT Scroll
607
815
  box.initScrollMetrics = function () {
608
816
 
609
- // Değişkenler
817
+ // Variables
610
818
  box.scrollVars.minY = box.titleHeight;
611
819
  box.scrollVars.scrollAreaHeight = box.height - box.titleHeight - box.infoHeight;
612
820
  box.scrollVars.scrollIconHeight = box.btnScrollCenter.height;
@@ -640,7 +848,7 @@ const SmartTable = function (params = {}) {
640
848
  // WHEEL: one row for each wheel step.
641
849
  box.on("wheel", function (self, event) {
642
850
 
643
- // WHY: Varsayılan olarak tekerlek sayfaya bırakılır; tablo sayfanın kaymasını engellemesin. (wheelScroll: 1 ile açılır)
851
+ // WHY: the wheel is left to the page by default: the table must not stop the page from scrolling (wheelScroll: 1 turns it on).
644
852
  if (box.wheelScroll != 1) return;
645
853
 
646
854
  // WHY: A mostly horizontal move is left to the browser (the horizontal scroll of the columns).
@@ -690,7 +898,7 @@ const SmartTable = function (params = {}) {
690
898
 
691
899
  box.btnScrollCenter.top = newTop;
692
900
 
693
- // WHY: Tablo çok kısa ise totalPath 0 olabilir; 0'a bölme NaN index üretir.
901
+ // WHY: totalPath can be 0 in a very short table, and a division by 0 makes a NaN index.
694
902
  if (box.scrollVars.totalPath <= 0) return;
695
903
 
696
904
  const currentProgress = (newTop - box.scrollVars.minY) / box.scrollVars.totalPath;
@@ -712,7 +920,97 @@ const SmartTable = function (params = {}) {
712
920
 
713
921
  };
714
922
 
715
- box.scrollPage = function (direction) { // +1 ise aşağı (bir sayfa boyu), -1 ise yukarı
923
+ // *** SELECTION AND KEYS (canSelect: 1):
924
+
925
+ // The index of the selected record in the records that are seen (filtered and sorted), -1: none
926
+ box.getSelectedIndex = function () {
927
+ if (!box.selectedItemData) return -1;
928
+ return box.visibleItemDataList.indexOf(box.selectedItemData);
929
+ };
930
+
931
+ // Selects a record (one of itemDataList, null: none) and scrolls the rows to it
932
+ box.selectItem = function (itemData) {
933
+ if (box.canSelect != 1) return;
934
+ box.selectedItemData = itemData || null;
935
+ scrollToSelected();
936
+ box.refreshData();
937
+ };
938
+ // USAGE: smartTable.selectItem(smartTable.visibleItemDataList[0])
939
+
940
+ box.clearSelection = function () {
941
+ box.selectItem(null);
942
+ };
943
+
944
+ box.setCanSelect = function (value) {
945
+ box.canSelect = basic.isOn(value) ? 1 : 0;
946
+ if (box.canSelect != 1) box.selectedItemData = null;
947
+ applyCanSelect();
948
+ box.refreshData();
949
+ };
950
+ // USAGE: smartTable.setCanSelect(0)
951
+
952
+ // The table takes the focus (Tab, a click on a row) only when it can select
953
+ const applyCanSelect = function () {
954
+ box.tabIndex = (box.canSelect == 1) ? 0 : null;
955
+ if (box.canSelect != 1) box.elem.blur();
956
+ };
957
+
958
+ // The edge of the table shows the focus of the keyboard (:focus-visible), not of the mouse.
959
+ // WHY on boxBorder (not setFocusRing): the rows cover an outline that is drawn inside the table itself
960
+ const paintFocus = function () {
961
+ const hasKeyboardFocus = box.elem.matches(":focus-visible");
962
+ box.boxBorder.css.outline = hasKeyboardFocus ? "2px solid " + box.style.focusRingColor : "none";
963
+ box.boxBorder.css.outlineOffset = "-2px";
964
+ };
965
+
966
+ // The rows move as little as they can to show the selected record
967
+ const scrollToSelected = function () {
968
+ const index = box.getSelectedIndex();
969
+ if (index == -1) return;
970
+ let topIndex = box.startedItemIndexForScrolling;
971
+ if (index < topIndex) topIndex = index;
972
+ if (index >= topIndex + box.itemLineCount) topIndex = index - box.itemLineCount + 1;
973
+ box.startedItemIndexForScrolling = clampScrollIndex(topIndex);
974
+ box.syncScrollPosition();
975
+ };
976
+
977
+ // A step of rows from the selected record. Nothing selected: a step down starts before the first record, up after the last.
978
+ const moveSelection = function (step) {
979
+ const count = box.visibleItemDataList.length;
980
+ if (count == 0) return;
981
+ let index = box.getSelectedIndex();
982
+ if (index == -1) index = (step > 0) ? -1 : count;
983
+ box.selectItem(box.visibleItemDataList[basic.clamp(index + step, 0, count - 1)]);
984
+ };
985
+
986
+ // ↑ ↓ one row, Page Up / Page Down one page, Home / End to the first / the last record (0: not a key of the rows)
987
+ const getKeyStep = function (key) {
988
+ const pageStep = box.itemLineCount;
989
+ const count = box.visibleItemDataList.length;
990
+ const steps = { ArrowDown: 1, ArrowUp: -1, PageDown: pageStep, PageUp: -pageStep, Home: -count, End: count };
991
+ return steps[key] || 0;
992
+ };
993
+
994
+ const onKeyDown = function (self, event) {
995
+
996
+ // WHY: only the table itself takes the keys (not its filter box); a key with Cmd / Ctrl / Alt is left to the page
997
+ if (box.canSelect != 1 || event.target != box.elem) return;
998
+ if (event.metaKey || event.ctrlKey || event.altKey) return;
999
+
1000
+ if (event.key == "Enter") {
1001
+ if (box.selectedItemData) box.onSelect(box, box.selectedItemData);
1002
+ return;
1003
+ }
1004
+
1005
+ const step = getKeyStep(event.key);
1006
+ if (step == 0) return;
1007
+ event.preventDefault(); // WHY: the arrows and the page keys must not scroll the page
1008
+ moveSelection(step);
1009
+ paintFocus(); // WHY: a table that got the focus with a click shows it once the keys are used
1010
+
1011
+ };
1012
+
1013
+ box.scrollPage = function (direction) { // +1: down (one page), -1: up
716
1014
 
717
1015
  const newIndex = clampScrollIndex(box.startedItemIndexForScrolling + (direction * box.itemLineCount));
718
1016
  if (newIndex === box.startedItemIndexForScrolling) return;
@@ -736,20 +1034,33 @@ const SmartTable = function (params = {}) {
736
1034
 
737
1035
  box.lblNoDataFound.opacity = 0;
738
1036
 
739
- // Başlangıç indeksi (İnsanların okuması için +1 ekliyoruz, 0 yerine 1'den başlasın)
1037
+ // The first index (+1: people count from 1, not from 0)
740
1038
  const start = box.startedItemIndexForScrolling + 1;
741
1039
 
742
- // Bitiş indeksi (Ya sayfa sonu ya da toplam veri miktarı)
1040
+ // The last index (the end of the page or the count of the data)
743
1041
  let end = box.startedItemIndexForScrolling + box.itemLineCount;
744
1042
  if (end > totalData) end = totalData;
745
1043
 
746
- // Sayıları binlik ayırıcı ile formatlamak (12499 -> 12.499)
747
- const formatNumber = (number) => number.toLocaleString('tr-TR');
748
-
749
1044
  box.boxInfoLine.label.text = `${formatNumber(start)} - ${formatNumber(end)} / ${formatNumber(totalData)}`;
750
1045
 
751
1046
  };
752
1047
 
1048
+ // A number in the language of the numbers (locale): 12499 -> "12,499" (en) or "12.499" (tr)
1049
+ const formatNumber = function (number) {
1050
+ try {
1051
+ return number.toLocaleString(box.locale || document.documentElement.lang || DEFAULT_LOCALE);
1052
+ } catch (error) {
1053
+ // WHY: a wrong language tag (Ex: "en_US") throws a RangeError
1054
+ return number.toLocaleString(DEFAULT_LOCALE);
1055
+ }
1056
+ };
1057
+
1058
+ box.setLocale = function (locale) {
1059
+ box.locale = locale;
1060
+ box.updateInfoLabel();
1061
+ };
1062
+ // USAGE: smartTable.setLocale("en-US")
1063
+
753
1064
  box.setScrollToTop = function () {
754
1065
  box.startedItemIndexForScrolling = 0;
755
1066
  box.btnScrollCenter.top = box.scrollVars.minY;
@@ -760,17 +1071,17 @@ const SmartTable = function (params = {}) {
760
1071
  box.filterAndSortData();
761
1072
  };
762
1073
 
763
- // WHY: "value ?" kontrolü 0 ve false değerlerini aranamaz yapıyordu.
1074
+ // WHY: a "value ?" check made 0 and false impossible to find.
764
1075
  const hasKeyword = function (value, searchKeyword) {
765
1076
  if (value === undefined || value === null) return false;
766
- return String(value).toLowerCase().includes(searchKeyword);
1077
+ return SmartTable.toSearchText(value).includes(searchKeyword);
767
1078
  };
768
1079
 
769
1080
  const filterItems = function (itemList, searchKeyword) {
770
1081
 
771
1082
  if (searchKeyword === "") return itemList;
772
1083
 
773
- // Sütun seçili ise sadece o sütunda, değil ise (ALL) tüm sütunlarda ara.
1084
+ // A chosen column: the search looks only in it; none (ALL): in every column.
774
1085
  const searchTitleData = box.titleDataList[box.searchTitleIndex];
775
1086
  const searchTitleList = (searchTitleData) ? [searchTitleData] : box.titleDataList;
776
1087
 
@@ -794,7 +1105,7 @@ const SmartTable = function (params = {}) {
794
1105
  const sortItems = function (itemList, sortByTitleIndex, sortDirection) {
795
1106
 
796
1107
  const titleData = box.titleDataList[sortByTitleIndex];
797
- if (!titleData || titleData.shortable === 0) return;
1108
+ if (!titleData || titleData.sortable === 0) return;
798
1109
 
799
1110
  const key = titleData.dataTitle;
800
1111
 
@@ -809,11 +1120,11 @@ const SmartTable = function (params = {}) {
809
1120
 
810
1121
  if (box.itemDataList.length > LOADING_MIN_ITEM_COUNT) box.showLoading(1);
811
1122
 
812
- // WHY: Arka arkaya çağrılırsa (ör. hızlı arama) sadece son çağrı çalışsın; eski sonuç yenisinin üzerine yazılmasın.
1123
+ // WHY: calls one after the other (a fast search): only the last one runs, an old result must not write over a new one.
813
1124
  box.filterTimer = waitAndRun(box.filterTimer, function () {
814
1125
 
815
1126
  box.filterTimer = null;
816
- const searchKeyword = String(box.searchKeyword ?? "").toLowerCase().trim();
1127
+ const searchKeyword = SmartTable.toSearchText(box.searchKeyword ?? "").trim();
817
1128
 
818
1129
  // WHY: A copy; sort() must not change the order of box.itemDataList.
819
1130
  const filteredList = filterItems([...box.itemDataList], searchKeyword);
@@ -822,6 +1133,9 @@ const SmartTable = function (params = {}) {
822
1133
  box.visibleItemDataList = filteredList;
823
1134
 
824
1135
  box.setScrollToTop();
1136
+ // WHY: the selected record stays selected and seen after a sort or a filter; a record that is gone is not
1137
+ if (box.getSelectedIndex() == -1) box.selectedItemData = null;
1138
+ scrollToSelected();
825
1139
  box.refreshData();
826
1140
 
827
1141
  box.showLoading(0);
@@ -835,10 +1149,10 @@ const SmartTable = function (params = {}) {
835
1149
  let bigData = [];
836
1150
 
837
1151
  for (let i = 0; i < TEST_DATA_REPEAT_COUNT; i++) {
838
- // Nesneleri klonlayarak ekliyoruz ki ID'leri çakışmasın veya referans karışmasın
1152
+ // The objects are copied: their ids must not repeat, and they must not share a reference
839
1153
  const clonedBatch = box.itemDataList.map(item => ({
840
1154
  ...item,
841
- id: bigData.length + item.id // Benzersiz ID oluşturmak için
1155
+ id: bigData.length + item.id // a unique id
842
1156
  }));
843
1157
 
844
1158
  bigData.push(...clonedBatch);
@@ -901,62 +1215,76 @@ const SmartTable = function (params = {}) {
901
1215
 
902
1216
  };
903
1217
 
1218
+ // A narrow table: the filter box is wider than its share of the line (searchInputParams.width, Ex: "50%"), up to
1219
+ // SEARCH_MIN_WIDTH and up to the count. A width in px stays as it is.
1220
+ const applySearchWidth = function () {
1221
+ const width = String(box.searchInputParams.width);
1222
+ box.searchInput.css.minWidth = "0px"; // WHY: a long count makes it narrower
1223
+ if (!width.endsWith("%")) return;
1224
+ box.searchInput.css.flexGrow = "1";
1225
+ box.searchInput.css.maxWidth = "max(" + width + ", " + SEARCH_MIN_WIDTH + "px)";
1226
+ };
1227
+
1228
+ // The chip keeps the right end of the filter box: the clear icon and the text of SearchInput are at its left.
1229
+ const fitSearchToTitle = function () {
1230
+ const titleWidth = box.lblSelectedSortKey.elem.offsetWidth;
1231
+ const hasTitle = (titleWidth > 0);
1232
+ box.searchInput.setClearIconRight(hasTitle ? SEARCH_TITLE_RIGHT + titleWidth + SEARCH_TITLE_GAP : searchClearIconRight);
1233
+ };
1234
+
904
1235
  box.createToolbar = function () {
905
1236
 
1237
+ // GROUP: The filter box and the count, in one line
1238
+ // WHY one line (flex): a narrow table gives the filter box the room up to the count, and a long count makes
1239
+ // it narrower (it never covers the count).
906
1240
  HGroup({
907
1241
  align: "left center",
908
- padding: [8, 0],
1242
+ gap: TOOLBAR_GAP,
1243
+ padding: [TOOLBAR_PADDING, 0],
909
1244
  });
910
1245
  box.boxInfoLine.add(that);
911
1246
 
912
- SearchInput(box.searchInputParams);
913
- that.setText(box.searchKeyword);
914
- that.onSubmit = function (searchedText, self) {
915
- box.searchKeyword = searchedText;
1247
+ box.searchInput = SearchInput(box.searchInputParams);
1248
+ that.setValue(box.searchKeyword, 1);
1249
+ that.onEnter = function (self) {
1250
+ box.searchKeyword = self.getSearchText();
916
1251
  box.filterAndSortData();
917
1252
  }
918
-
919
- endGroup();
920
-
921
- HGroup({
922
- align: "right center",
923
- padding: [14, 0],
924
- });
925
- box.boxInfoLine.add(that);
1253
+ searchClearIconRight = that.clearIconRight;
1254
+ applySearchWidth();
926
1255
 
927
1256
  box.boxInfoLine.label = Label({
928
1257
  text: "0 - 0 / 0",
929
1258
  ...box.style.lblBoxInfoLine,
930
1259
  });
1260
+ that.css = { marginLeft: "auto", marginRight: (COUNT_RIGHT - TOOLBAR_PADDING) + "px", flexShrink: "0" };
931
1261
 
932
1262
  endGroup();
933
1263
 
934
- // Center the label
935
- HGroup({
936
- align: "right center",
937
- width: "50%",
938
- padding: [40, 0],
939
- });
940
- box.boxInfoLine.add(that);
941
-
942
- // LABEL: Arama sütunu seçimi (ALL)
943
- box.lblSelectedSortKey = Label({
944
- text: box.allTitlesText,
945
- opacity: 1,
946
- clickable: 1,
947
- ...box.style.lblNoDataFound,
948
- ...box.style.lblSearchTitle, // WHY: Etiket filtre kutusunun içinde duruyor; "no data" etiketinden ayrı stil verilebilsin.
1264
+ // LABEL: The choice of the search column (ALL): in the filter box, at its right end
1265
+ box.lblSelectedSortKey = createIn(box.searchInput, function () {
1266
+ return Label({
1267
+ right: SEARCH_TITLE_RIGHT,
1268
+ opacity: 1,
1269
+ clickable: 1,
1270
+ ...box.style.lblNoDataFound,
1271
+ ...box.style.lblSearchTitle, // WHY: the label is in the filter box: it gets a look apart from the "no data" label.
1272
+ });
949
1273
  });
1274
+ setText(box.lblSelectedSortKey, box.allTitlesText);
950
1275
  that.cursor = "pointer";
951
1276
  that.ellipsis = 1;
952
1277
  that.css.maxWidth = SEARCH_TITLE_MAX_WIDTH;
1278
+ // WHY CSS: the chip stays in the middle of the box when its text or its font changes
1279
+ that.css.top = "50%";
1280
+ that.css.transform = "translateY(-50%)";
953
1281
  that.setMotion("opacity 0.2s");
954
-
955
- endGroup();
1282
+ // WHY onResize: a column name is wider than ALL; a hidden chip is 0 px (showSearchTitleSelect: 0)
1283
+ that.onResize(fitSearchToTitle);
956
1284
 
957
1285
  if (typeof ContextMenu === "function") {
958
1286
 
959
- // MENU: Sütun listesi (Items: box.updateSearchTitleSelect)
1287
+ // MENU: The list of the columns (items: box.updateSearchTitleSelect)
960
1288
  box.searchTitleMenu = ContextMenu({
961
1289
  minWidth: 160,
962
1290
  ...box.searchTitleMenuParams,
@@ -968,7 +1296,7 @@ const SmartTable = function (params = {}) {
968
1296
 
969
1297
  } else {
970
1298
 
971
- // WHY: context-menu.js yüklenmemiş ise özellik yine çalışsın; her basışta sıradaki sütuna geç.
1299
+ // WHY: without context-menu.js it still works: every press goes to the next column.
972
1300
  box.lblSelectedSortKey.on("click", function () {
973
1301
  box.selectNextSearchTitle();
974
1302
  });
@@ -999,7 +1327,7 @@ const SmartTable = function (params = {}) {
999
1327
 
1000
1328
  if (titleDataList.length == 0) return 0;
1001
1329
 
1002
- // WHY: createTitleCell/createItemCell width yoksa DEFAULT_CELL_WIDTH kullanıyor; burada da aynısı olmalı, yoksa basic.num(undefined) NaN olur.
1330
+ // WHY: createTitleCell / createItemCell use DEFAULT_CELL_WIDTH when there is no width: the same here, or basic.num(undefined) is NaN.
1003
1331
  let totalWidth = 0;
1004
1332
  titleDataList.forEach(function (titleData) {
1005
1333
  totalWidth += basic.num(titleData.width || DEFAULT_CELL_WIDTH);
@@ -1009,7 +1337,7 @@ const SmartTable = function (params = {}) {
1009
1337
 
1010
1338
  if (tableWidth > totalWidth) return tableWidth - totalWidth + lastCellWidth;
1011
1339
 
1012
- // WHY: Tablo daraldığında son hücre, önceki genişletilmiş boyutunda kalıyordu. Orijinal genişliğe dön.
1340
+ // WHY: when the table got narrower, the last cell kept its old wider size: back to its own width.
1013
1341
  return lastCellWidth;
1014
1342
 
1015
1343
  };
@@ -1020,14 +1348,14 @@ const SmartTable = function (params = {}) {
1020
1348
 
1021
1349
  box.itemLineList.forEach(function (itemLine) {
1022
1350
  itemLine.height = box.itemHeight;
1023
- itemLine.visible = 1; // WHY: Yükseklik hesaplandıktan sonra göster.
1351
+ itemLine.visible = 1; // WHY: shown after its height is measured
1024
1352
  });
1025
1353
 
1026
1354
  };
1027
1355
 
1028
1356
  box.setHeight = function (height) {
1029
1357
 
1030
- // Yükseklik otomatik değil ise, ItemCell yüksekliği resize sırasında hesaplanır.
1358
+ // When the height is not "auto", the height of the cells is measured on a resize.
1031
1359
  box.recalcItemHeight = (height != "auto") ? 1 : 0;
1032
1360
  box.height = height;
1033
1361
 
@@ -1035,15 +1363,19 @@ const SmartTable = function (params = {}) {
1035
1363
 
1036
1364
  box.setWidth = function (width) {
1037
1365
 
1038
- // WHY: Sayı verilirse (width: 800) .includes hata veriyordu.
1366
+ // WHY: a number (width: 800) made .includes throw.
1039
1367
  const isPercent = typeof width === "string" && width.includes("%");
1040
1368
 
1369
+ // The vertical scroll stands right of the table, outside its box: the table keeps that room for it.
1041
1370
  if (!isPercent) {
1371
+ // WHY a margin: in a group the next object stood on the scroll (a table that takes the room that is
1372
+ // left, a table of 600 px next to a chart). A table with a place of its own is not moved by it.
1042
1373
  box.width = width;
1374
+ box.css = { marginRight: box.getVerticalScrollWidth() + "px" };
1043
1375
  return;
1044
1376
  }
1045
1377
 
1046
- // A percent width leaves room for the vertical scroll at the right side.
1378
+ if (box.css.marginRight) box.css = { marginRight: "" }; // a width in px before
1047
1379
  box.width = "calc(" + width + " - " + box.getVerticalScrollWidth() + "px)";
1048
1380
 
1049
1381
  };
@@ -1092,34 +1424,34 @@ const SmartTable = function (params = {}) {
1092
1424
  HGroup();
1093
1425
 
1094
1426
  box.lblNoDataFound = Label({
1095
- text: box.noDataFoundAlert,
1096
1427
  opacity: 0,
1097
1428
  ...box.style.lblNoDataFound,
1098
1429
  });
1430
+ setText(box.lblNoDataFound, box.noDataFoundAlert);
1099
1431
  that.setMotion("opacity 0.2s");
1100
1432
 
1101
1433
  endGroup();
1102
1434
 
1103
1435
  };
1104
1436
 
1105
- // Sütunun listede görünen adı. (HTML etiketleri olmadan; adı boş ise dataTitle)
1437
+ // The name of a column in the list (without HTML tags; its dataTitle when it has no name)
1106
1438
  const getTitleText = function (titleData) {
1107
1439
  const name = String(titleData.name ?? "").replace(/<[^>]*>/g, "").trim();
1108
1440
  return name || String(titleData.dataTitle ?? "");
1109
1441
  };
1110
1442
 
1111
- // Arama sütunu kutusunu ve listesini, seçime göre yenile.
1443
+ // The label of the search column and its list, as the choice is.
1112
1444
  box.updateSearchTitleSelect = function () {
1113
1445
 
1114
1446
  if (!box.titleDataList[box.searchTitleIndex]) box.searchTitleIndex = -1;
1115
1447
 
1116
1448
  const selectedTitleData = box.titleDataList[box.searchTitleIndex];
1117
- box.lblSelectedSortKey.text = (selectedTitleData) ? getTitleText(selectedTitleData) : box.allTitlesText;
1449
+ setText(box.lblSelectedSortKey, (selectedTitleData) ? getTitleText(selectedTitleData) : box.allTitlesText);
1118
1450
  box.lblSelectedSortKey.visible = (box.showSearchTitleSelect == 1) ? 1 : 0;
1119
1451
 
1120
1452
  if (!box.searchTitleMenu) return;
1121
1453
 
1122
- // WHY: Sadece seçili olanda ikon var; ContextMenu diğerlerine boş ikon alanı verir, metinler aynı hizada durur.
1454
+ // WHY: only the chosen one has an icon; ContextMenu gives the others an empty place of an icon, so the texts stay in line.
1123
1455
  const getCheckIcon = function (titleIndex) {
1124
1456
  return (box.searchTitleIndex == titleIndex) ? box.style.searchTitleCheckIconFile : "";
1125
1457
  };
@@ -1138,19 +1470,19 @@ const SmartTable = function (params = {}) {
1138
1470
 
1139
1471
  };
1140
1472
 
1141
- // Arama sütununu seç. -1: ALL (tüm sütunlar)
1473
+ // Choose the search column. -1: ALL (every column)
1142
1474
  box.setSearchTitleIndex = function (titleIndex) {
1143
1475
 
1144
1476
  box.searchTitleIndex = (box.titleDataList[titleIndex]) ? titleIndex : -1;
1145
1477
  box.updateSearchTitleSelect();
1146
1478
 
1147
- // WHY: Arama kutusu boş ise sonuç değişmez; scroll boşuna başa dönmesin.
1479
+ // WHY: an empty search box changes no result: the scroll must not go back to the top for nothing.
1148
1480
  if (String(box.searchKeyword ?? "").trim() !== "") box.filterAndSortData();
1149
1481
 
1150
1482
  };
1151
1483
  // USAGE: smartTable.setSearchTitleIndex(1) or smartTable.setSearchTitleIndex(-1)
1152
1484
 
1153
- // Sıradaki sütuna geç: ALL -> 0 -> 1 -> ... -> ALL
1485
+ // The next column: ALL -> 0 -> 1 -> ... -> ALL
1154
1486
  box.selectNextSearchTitle = function () {
1155
1487
  const nextIndex = box.searchTitleIndex + 1;
1156
1488
  box.setSearchTitleIndex((nextIndex < box.titleDataList.length) ? nextIndex : -1);
@@ -1162,38 +1494,87 @@ const SmartTable = function (params = {}) {
1162
1494
  };
1163
1495
  // USAGE: smartTable.setShowSearchTitleSelect(0)
1164
1496
 
1165
- // Fare tekerleği ile satır kaydırma. 0: Tekerlek sayfaya bırakılır.
1497
+ // The mouse wheel scrolls the rows. 0: the wheel is left to the page.
1166
1498
  box.setWheelScroll = function (enabled) {
1167
1499
  box.wheelScroll = basic.isOn(enabled) ? 1 : 0;
1168
1500
  };
1169
1501
  // USAGE: smartTable.setWheelScroll(1)
1170
1502
 
1171
- box.createResizeEvent = function () {
1503
+ // The height the rows share: the table without its title line and its info line
1504
+ const getRowsHeight = function () {
1505
+ return box.height - box.titleHeight - box.infoHeight;
1506
+ };
1507
+
1508
+ // The parts that depend on the size of the table (onResize)
1509
+ const refreshLayout = function () {
1172
1510
 
1173
- const resizeUI = function () {
1511
+ if (box.recalcItemHeight && box.fitLineCount == 1) {
1174
1512
 
1175
- if (box.recalcItemHeight) {
1513
+ fitItemLines();
1176
1514
 
1177
- const itemHeight = (box.height - box.titleHeight - box.infoHeight) / box.itemLineCount;
1515
+ } else if (box.recalcItemHeight) {
1178
1516
 
1179
- // WHY: Hesaplanan yükseklik mevcut itemHeight ile aynı ise satırlar hiç görünür yapılmıyordu.
1180
- if (box.itemHeight != itemHeight || (box.itemLineList[0] && !box.itemLineList[0].visible)) {
1181
- box.setItemHeight(itemHeight);
1182
- }
1517
+ const itemHeight = getRowsHeight() / box.itemLineCount;
1183
1518
 
1519
+ // WHY: when the measured height was the same as itemHeight, the rows were never shown.
1520
+ if (box.itemHeight != itemHeight || (box.itemLineList[0] && !box.itemLineList[0].visible)) {
1521
+ box.setItemHeight(itemHeight);
1184
1522
  }
1185
1523
 
1186
- box.stretchLastCell(box.calcLastCellWidth());
1187
- box.initScrollMetrics();
1188
- box.syncScrollPosition();
1189
- box.scrollBar.refreshScroll(); // Ekranı daraltırken, scroll gereksiz görünmesin diye.
1524
+ }
1190
1525
 
1191
- box.refreshData();
1526
+ box.stretchLastCell(box.calcLastCellWidth());
1527
+ box.initScrollMetrics();
1528
+ box.syncScrollPosition();
1529
+ box.scrollBar.refreshScroll(); // WHY: a narrower window must not show a scroll bar it does not need
1192
1530
 
1193
- };
1531
+ box.refreshData();
1532
+
1533
+ };
1534
+
1535
+ // fitLineCount: 1 -> as many rows of about targetItemHeight as the table holds; they share its height exactly
1536
+ const fitItemLines = function () {
1537
+ const rowsHeight = getRowsHeight();
1538
+ if (rowsHeight <= 0) return; // WHY: the table is not drawn yet
1539
+ const lineCount = Math.max(1, Math.round(rowsHeight / targetItemHeight));
1540
+ if (lineCount != box.itemLineList.length) {
1541
+ box.setItemLineCount(lineCount);
1542
+ return;
1543
+ }
1544
+ box.setItemHeight(rowsHeight / lineCount);
1545
+ };
1546
+
1547
+ // Makes count rows: only these rows exist, they show the records from startedItemIndexForScrolling.
1548
+ // (fitLineCount: 1 makes the count again when the size of the table changes.)
1549
+ box.setItemLineCount = function (count) {
1550
+
1551
+ box.itemLineCount = Math.max(1, Math.round(count));
1552
+ box.createItemLines();
1553
+
1554
+ const rowsHeight = getRowsHeight();
1555
+ const hasRowsHeight = box.recalcItemHeight && rowsHeight > 0;
1556
+ box.setItemHeight(hasRowsHeight ? rowsHeight / box.itemLineCount : box.itemHeight);
1557
+
1558
+ box.stretchLastCell(box.calcLastCellWidth());
1559
+ box.startedItemIndexForScrolling = clampScrollIndex(box.startedItemIndexForScrolling);
1560
+ scrollToSelected();
1561
+ box.initScrollMetrics();
1562
+ box.syncScrollPosition();
1563
+ box.refreshData();
1564
+
1565
+ };
1566
+ // USAGE: smartTable.setItemLineCount(20)
1567
+
1568
+ box.setFitLineCount = function (value) {
1569
+ box.fitLineCount = basic.isOn(value) ? 1 : 0;
1570
+ refreshLayout();
1571
+ };
1572
+ // USAGE: smartTable.setFitLineCount(1)
1573
+
1574
+ box.createResizeEvent = function () {
1194
1575
 
1195
1576
  box.onResize(function (self) {
1196
- box.resizeTimer = waitAndRun(box.resizeTimer, resizeUI, RESIZE_DELAY);
1577
+ box.resizeTimer = waitAndRun(box.resizeTimer, refreshLayout, RESIZE_DELAY);
1197
1578
  });
1198
1579
 
1199
1580
  };
@@ -1213,7 +1594,7 @@ const SmartTable = function (params = {}) {
1213
1594
 
1214
1595
  // CREATE the structure:
1215
1596
 
1216
- // Tıtle and Item Lıne Group Container
1597
+ // Title and Item Line Group Container
1217
1598
  box.boxHorizontalScrollable = VGroup({
1218
1599
  align: "top left",
1219
1600
  width: "auto",
@@ -1248,7 +1629,7 @@ const SmartTable = function (params = {}) {
1248
1629
 
1249
1630
  endGroup();
1250
1631
 
1251
- // Item Lıne Group
1632
+ // Item Line Group
1252
1633
  box.boxItemLineGroup = VGroup({
1253
1634
  align: "top left",
1254
1635
  width: "auto",
@@ -1261,7 +1642,7 @@ const SmartTable = function (params = {}) {
1261
1642
 
1262
1643
  endGroup();
1263
1644
 
1264
- endGroup(); // Tıtle and Item Lıne Group Container
1645
+ endGroup(); // Title and Item Line Group Container
1265
1646
 
1266
1647
  box.boxInfoLine = HGroup({
1267
1648
  bottom: 0,
@@ -1309,13 +1690,194 @@ const SmartTable = function (params = {}) {
1309
1690
  box.createTitleLine();
1310
1691
  box.createItemLines();
1311
1692
  box.createScrollEvents();
1693
+ box.on("keydown", onKeyDown);
1694
+ box.on("focus", paintFocus);
1695
+ box.on("blur", paintFocus);
1696
+ applyCanSelect();
1312
1697
  box.stretchLastCell(box.calcLastCellWidth());
1313
1698
  box.updateSortIcon();
1314
1699
  box.updateSearchTitleSelect();
1315
- // Add test data WHY: filterAndSortData dan önce olmalı; böylece kayıtlar düz yüklenmeden sıralanır ve büyük veri için loading gösterilir.
1700
+ // Add test data. WHY before filterAndSortData: the records are sorted before they are shown, and big data shows the loading.
1316
1701
  if (box.fillTestData) box.generateTestData();
1317
1702
  box.filterAndSortData();
1318
1703
 
1319
1704
  return endObject(box);
1320
1705
 
1321
- };
1706
+ };
1707
+
1708
+ // The text of a cell (and of the keyword) for the filter: lowercase in Turkish ("İ" -> "i", not "i" + a dot), without
1709
+ // the marks of the letters, "ı" as "i" (as DataTable.toSearchText).
1710
+ // WHY: toLowerCase() made "İstanbul" "i̇stanbul": the keyword "istanbul" found nothing.
1711
+ // WHY the fast way: most texts have no letter outside ASCII after the lowercase, and a table can have 100 000 rows.
1712
+ SmartTable.toSearchText = function (value) {
1713
+ const text = String(value).toLocaleLowerCase("tr");
1714
+ if (!SmartTable.NOT_ASCII.test(text)) return text;
1715
+ return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ı/g, "i");
1716
+ };
1717
+ SmartTable.NOT_ASCII = /[^\u0000-\u007f]/;
1718
+
1719
+ // *** STYLE PACKAGES:
1720
+ // USAGE: SmartTable({ styleName: "dark" })
1721
+ // USAGE: SmartTable({ styleName: "dark", style: { lblItemCell: { fontSize: 14 } } }) // Change only some keys.
1722
+ // NOTE: A package is a package of params (it has a "style" key): its other keys (searchInputParams, scrollBarParams,
1723
+ // searchTitleMenuParams) fill the params you did not give. A new package needs only the keys that differ from
1724
+ // the classic look (SmartTableDefaults).
1725
+ SmartTable.styles = {
1726
+
1727
+ // The look of DataTable "light": a light gray title line, striped rows, a soft yellow row under the mouse and
1728
+ // a stronger one for the selected row; the filter box is the SearchInput "ozden". (SmartTableDefaults)
1729
+ light: { style: {} },
1730
+
1731
+ // The look of DataTable "dark", for a dark page; the filter box is the SearchInput "ozdenDark", the column list
1732
+ // is the ContextMenu "dark".
1733
+ dark: {
1734
+ style: {
1735
+ line1Color: "#232428",
1736
+ line2Color: "#27292D",
1737
+ highlightItemCellColor: "#2E3035",
1738
+ selectedItemCellColor: "#24383A",
1739
+ focusRingColor: "rgba(95, 179, 181, 0.7)",
1740
+ highlightTitleCellColor: "#33353A",
1741
+ // WHY its own icon: invertIconColor turns only the sort and the up / down arrows
1742
+ btnScrollCenterIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 50" fill="none" stroke="#FFFFFF" stroke-opacity="0.5" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 17.5v15M6.5 21 10 17.5 13.5 21M6.5 29 10 32.5 13.5 29"/></svg>'),
1743
+ searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#E6E6E6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
1744
+ invertIconColor: 1,
1745
+ sortIcon: { size: 16, opacity: 0.3, activeOpacity: 1 },
1746
+ cellTooltip: { color: "#2B2D31", textColor: "rgba(255, 255, 255, 0.88)", borderColor: "rgba(255, 255, 255, 0.14)", shadow: "0 8px 24px rgba(0, 0, 0, 0.5)" },
1747
+ box: { color: "#232428" },
1748
+ boxBorder: { border: 1, borderColor: "rgba(255, 255, 255, 0.12)" },
1749
+ boxTitleLine: { color: "#2B2D31" },
1750
+ boxTitleCell: { borderRight: "1px solid rgba(255, 255, 255, 0.08)", borderBottom: "1px solid rgba(255, 255, 255, 0.14)" },
1751
+ lblTitleCell: { textColor: "rgba(255, 255, 255, 0.85)" },
1752
+ boxItemCell: { borderBottom: "1px solid rgba(255, 255, 255, 0.06)" },
1753
+ lblItemCell: { textColor: "rgba(255, 255, 255, 0.75)" },
1754
+ boxInfoLine: { color: "#232428", borderTop: "1px solid rgba(255, 255, 255, 0.14)" },
1755
+ lblBoxInfoLine: { textColor: "rgba(255, 255, 255, 0.5)" },
1756
+ lblNoDataFound: { textColor: "rgba(255, 255, 255, 0.45)" },
1757
+ lblSearchTitle: { color: "#33353A", textColor: "rgba(255, 255, 255, 0.7)", borderColor: "rgba(255, 255, 255, 0.14)" },
1758
+ btnScrollCenter: { color: "#2B2D31", borderColor: "rgba(255, 255, 255, 0.2)" },
1759
+ btnScrollUp: { color: "#2B2D31", borderColor: "rgba(255, 255, 255, 0.14)" },
1760
+ btnScrollDown: { color: "#2B2D31", borderColor: "rgba(255, 255, 255, 0.14)" },
1761
+ },
1762
+ searchInputParams: { styleName: "ozdenDark" },
1763
+ scrollBarParams: { bar_color: "#A0A0A0", bar_mouseOverColor: "#D0D0D0" },
1764
+ searchTitleMenuParams: { styleName: "dark" },
1765
+ },
1766
+
1767
+ // The green title line, a dark edge, big texts. Every
1768
+ // key is here: a page that changes some of them over this look (styleName: "green") gets the rest from it.
1769
+ green: {
1770
+ style: {
1771
+ width: "auto",
1772
+ height: "auto",
1773
+ round: 6,
1774
+ line1Color: "white",
1775
+ line2Color: "whitesmoke",
1776
+ highlightItemCellColor: "#F3E7C2",
1777
+ selectedItemCellColor: null, // null: highlightItemCellColor (the row under the mouse)
1778
+ selectedBar: { width: 3, color: "rgba(95, 158, 160, 0.9)" },
1779
+ focusRingColor: "rgba(95, 158, 160, 0.6)",
1780
+ highlightTitleCellColor: White(0.2),
1781
+ titleUppercase: 0,
1782
+ verticalScrollWidth: 20,
1783
+ verticalScrollMargin: 2,
1784
+ btnScrollDownIconFile: SmartTableDefaults.style.btnScrollDownIconFile,
1785
+ btnScrollUpIconFile: SmartTableDefaults.style.btnScrollUpIconFile,
1786
+ btnScrollCenterIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 200" preserveAspectRatio="none" fill="none" stroke="#D96450" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 28V172M27 41L40 28L53 41M27 159L40 172L53 159"/></svg>'), // a red line with two heads
1787
+ sortIconFile: "data:image/svg+xml;utf8," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" preserveAspectRatio="none" fill="none" stroke="#141414" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M40 24V56M27 43L40 56L53 43"/></svg>'), // an arrow down
1788
+ loadingIconFile: SmartTableDefaults.style.loadingIconFile,
1789
+ searchTitleCheckIconFile: "data:image/svg+xml," + encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#373836" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12.5 10 17.5 19 7"/></svg>'),
1790
+ invertIconColor: 0,
1791
+ sortIcon: { size: 22, opacity: 0.5, activeOpacity: 1 },
1792
+ box: { color: "white" },
1793
+ boxBorder: { border: 2, borderColor: Black(0.8) },
1794
+ boxTitleLine: { color: "#65A293" },
1795
+ boxTitleCell: { padding: [8, 0], borderRight: "1px solid rgba(0, 0, 0, 0.5)", borderBottom: "2px solid #141414" },
1796
+ lblTitleCell: { fontSize: 20, fontFamily: "opensans", textColor: Black(0.8) },
1797
+ boxItemCell: { borderBottom: "1px solid darkgray", borderRight: "1px solid rgba(0, 0, 0, 0.05)", padding: [8, 0] },
1798
+ lblItemCell: { fontSize: 20, textColor: Black(0.75), fontFamily: "opensans" },
1799
+ boxInfoLine: { color: "#E4E4E4", borderTop: "1px solid rgba(0, 0, 0, 0)" },
1800
+ lblBoxInfoLine: { fontSize: 16, textColor: Black(0.85) },
1801
+ lblNoDataFound: { color: "lightgray", textColor: Black(0.8), padding: [8, 2], fontSize: 14, round: 8, border: 1, borderColor: Black(0.4) },
1802
+ // (whitesmoke, as the pale lines of the table; the edge of the filter box)
1803
+ lblSearchTitle: { color: "whitesmoke", textColor: Black(0.8), padding: [8, 2], fontSize: 14, round: 8, border: 1, borderColor: Black(0.15) },
1804
+ btnScrollCenter: { color: "white", round: 100, border: 1, borderColor: "rgba(0,0,0,0.4)" },
1805
+ btnScrollUp: { color: "lightgray", round: 100, border: 1, borderColor: "rgba(0, 0, 0, 0.6)" },
1806
+ btnScrollDown: { color: "lightgray", round: 100, border: 1, borderColor: "rgba(0, 0, 0, 0.6)" },
1807
+ boxSort: { color: "#65A293" },
1808
+ },
1809
+ searchInputParams: {
1810
+ styleName: "original", // the first look of SearchInput
1811
+ width: "50%",
1812
+ height: 36,
1813
+ border: 1,
1814
+ round: 8,
1815
+ color: "white",
1816
+ searchIconSize: 16,
1817
+ placeholder: "Filter",
1818
+ fontSize: 16,
1819
+ borderColor: Black(0.15), // (light edges in the filter)
1820
+ borderBottomStyle: "1px solid " + Black(0.15),
1821
+ searchIconFile: SmartTableDefaults.searchInputParams.searchIconFile,
1822
+ searchIconOpacity: 0.8, // (a softer filter icon, in tune with the edges)
1823
+ },
1824
+ },
1825
+
1826
+ };
1827
+ SmartTable.styles.classic = SmartTable.styles.light; // the old name of light: the pages made with it keep their look
1828
+
1829
+ // The minimal theme (_designs/minimal-theme.htm): small (28 px rows, 30 px titles, a 13 px text), on the ground of the
1830
+ // window with a line around it; no stripes, thin lines between the rows, a soft title over a line, a faint row under
1831
+ // the mouse, a 2 px ink line at the left of the selected row. minimalDark: the same on a dark window.
1832
+ // WHY faint fills for the rows: a row of SmartTable is its cells (a line around a row needs a row box).
1833
+ SmartTable.createMinimalStyle = function (colors) {
1834
+ return {
1835
+ titleHeight: 30,
1836
+ itemHeight: 28,
1837
+ infoHeight: 28,
1838
+ style: Object.assign({
1839
+ round: 4,
1840
+ line1Color: colors.ground,
1841
+ line2Color: colors.ground,
1842
+ highlightItemCellColor: colors.hover,
1843
+ selectedItemCellColor: colors.selected,
1844
+ selectedBar: { width: 2, color: colors.ink },
1845
+ focusRingColor: colors.focus,
1846
+ highlightTitleCellColor: colors.ground,
1847
+ titleUppercase: 0,
1848
+ invertIconColor: colors.invertIcons,
1849
+ sortIcon: { size: 14, opacity: 0.3, activeOpacity: 1 },
1850
+ cellTooltip: { fontSize: 12, color: colors.ground, textColor: colors.text, round: 4, border: 1, borderColor: colors.line, shadow: "none" },
1851
+ box: { color: colors.ground },
1852
+ boxBorder: { border: 1, borderColor: colors.line },
1853
+ boxTitleLine: { color: colors.ground },
1854
+ boxTitleCell: { padding: [10, 0], borderRight: "none", borderBottom: "1px solid " + colors.line },
1855
+ lblTitleCell: { fontSize: 12, fontFamily: "opensans-bold", textColor: colors.softText },
1856
+ boxItemCell: { borderBottom: "1px solid " + colors.track, borderRight: "none", padding: [10, 0] },
1857
+ lblItemCell: { fontSize: 13, textColor: colors.text, fontFamily: "opensans" },
1858
+ boxInfoLine: { color: colors.ground, borderTop: "1px solid " + colors.line },
1859
+ lblBoxInfoLine: { fontSize: 12, textColor: colors.softText },
1860
+ lblNoDataFound: { color: "transparent", textColor: colors.softText, fontSize: 12 },
1861
+ lblSearchTitle: { color: "transparent", textColor: colors.softText, fontSize: 11, border: 0, borderColor: "transparent" }, // WHY no edge: a pill in the 22 px filter box met its edge
1862
+ btnScrollCenter: { color: colors.ground, borderColor: colors.line },
1863
+ btnScrollUp: { color: colors.ground, borderColor: colors.line },
1864
+ btnScrollDown: { color: colors.ground, borderColor: colors.line },
1865
+ }, colors.icons),
1866
+ // WHY its sizes: the filter box of the default is 36 px high, more than the 28 px line of the minimal table
1867
+ searchInputParams: { styleName: colors.minimalName, height: 22, fontSize: 12, searchIconSize: 12, searchIconLeft: 8 },
1868
+ scrollBarParams: { bar_color: colors.scrollBar, bar_mouseOverColor: colors.scrollBar, bar_width: 3 },
1869
+ searchTitleMenuParams: { styleName: colors.minimalName },
1870
+ };
1871
+ };
1872
+ SmartTable.MINIMAL_COLORS = {
1873
+ ground: "#FFFFFF", text: Black(0.85), softText: Black(0.55), line: Black(0.2), track: Black(0.08), hover: Black(0.03),
1874
+ selected: Black(0.06), ink: "#1F1F1F", focus: "#3D8BD9", scrollBar: "#9A9A98", invertIcons: 0, minimalName: "minimal", icons: {},
1875
+ };
1876
+ SmartTable.styles.minimal = SmartTable.createMinimalStyle(SmartTable.MINIMAL_COLORS);
1877
+ SmartTable.MINIMAL_DARK_COLORS = {
1878
+ ground: "#1A1A19", text: White(0.88), softText: White(0.55), line: White(0.18), track: White(0.08), hover: White(0.04),
1879
+ selected: White(0.08), ink: "#EDEDEB", focus: "#7FB6DE", scrollBar: "#A0A0A0", invertIcons: 1, minimalName: "minimalDark",
1880
+ // WHY the icons of dark: invertIconColor turns only the sort and the up / down arrows
1881
+ icons: { btnScrollCenterIconFile: SmartTable.styles.dark.style.btnScrollCenterIconFile, searchTitleCheckIconFile: SmartTable.styles.dark.style.searchTitleCheckIconFile },
1882
+ };
1883
+ SmartTable.styles.minimalDark = SmartTable.createMinimalStyle(SmartTable.MINIMAL_DARK_COLORS);