kempo-ui 0.0.76 → 0.0.78

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 (170) hide show
  1. package/.github/skills/get-icon/SKILL.md +144 -0
  2. package/.github/skills/highlight-code/SKILL.md +57 -0
  3. package/README.md +83 -1
  4. package/bin/get_icon.js +106 -0
  5. package/bin/highlight_code.js +39 -0
  6. package/bin/icon.js +131 -0
  7. package/bin/list_icons.js +70 -0
  8. package/dist/components/Resize.js +1 -0
  9. package/dist/components/Table.js +88 -78
  10. package/dist/components/Tree.js +1 -1
  11. package/docs/components/icon.html +28 -6
  12. package/docs/components/photo-viewer.html +7 -7
  13. package/docs/components/tree.html +26 -6
  14. package/docs/icons/account-circle.svg +1 -1
  15. package/docs/icons/add.svg +1 -1
  16. package/docs/icons/arrow-circle.svg +1 -1
  17. package/docs/icons/arrow-line.svg +1 -1
  18. package/docs/icons/arrow.svg +1 -1
  19. package/docs/icons/arrow_drop_down.svg +1 -1
  20. package/docs/icons/cards.svg +1 -1
  21. package/docs/icons/check.svg +1 -1
  22. package/docs/icons/chevron-double.svg +1 -1
  23. package/docs/icons/chevron-line.svg +1 -1
  24. package/docs/icons/chevron.svg +1 -1
  25. package/docs/icons/close.svg +1 -1
  26. package/docs/icons/code.svg +1 -1
  27. package/docs/icons/code_blocks.svg +1 -1
  28. package/docs/icons/copy.svg +1 -1
  29. package/docs/icons/delete.svg +1 -1
  30. package/docs/icons/drag-handle.svg +1 -1
  31. package/docs/icons/edit.svg +1 -1
  32. package/docs/icons/error.svg +1 -1
  33. package/docs/icons/export-file.svg +1 -1
  34. package/docs/icons/file-text.svg +1 -1
  35. package/docs/icons/file.svg +1 -1
  36. package/docs/icons/filter.svg +1 -1
  37. package/docs/icons/folder-open.svg +1 -1
  38. package/docs/icons/folder.svg +1 -1
  39. package/docs/icons/format_align_center.svg +1 -1
  40. package/docs/icons/format_align_justify.svg +1 -1
  41. package/docs/icons/format_align_left.svg +1 -1
  42. package/docs/icons/format_align_right.svg +1 -1
  43. package/docs/icons/format_bold.svg +1 -1
  44. package/docs/icons/format_clear.svg +1 -1
  45. package/docs/icons/format_color_fill.svg +1 -1
  46. package/docs/icons/format_color_text.svg +1 -1
  47. package/docs/icons/format_h1.svg +1 -1
  48. package/docs/icons/format_h2.svg +1 -1
  49. package/docs/icons/format_h3.svg +1 -1
  50. package/docs/icons/format_h4.svg +1 -1
  51. package/docs/icons/format_h5.svg +1 -1
  52. package/docs/icons/format_h6.svg +1 -1
  53. package/docs/icons/format_italic.svg +1 -1
  54. package/docs/icons/format_list_bulleted.svg +1 -1
  55. package/docs/icons/format_list_numbered.svg +1 -1
  56. package/docs/icons/format_paragraph.svg +1 -1
  57. package/docs/icons/format_underlined.svg +1 -1
  58. package/docs/icons/github-mark.svg +1 -1
  59. package/docs/icons/help.svg +1 -1
  60. package/docs/icons/hide.svg +1 -1
  61. package/docs/icons/image.svg +1 -1
  62. package/docs/icons/label.svg +1 -1
  63. package/docs/icons/license.svg +1 -1
  64. package/docs/icons/link.svg +1 -1
  65. package/docs/icons/menu.svg +1 -1
  66. package/docs/icons/mode-auto.svg +1 -1
  67. package/docs/icons/mode-dark.svg +1 -1
  68. package/docs/icons/mode-light.svg +1 -1
  69. package/docs/icons/more_vert.svg +1 -1
  70. package/docs/icons/settings.svg +1 -1
  71. package/docs/icons/show.svg +1 -1
  72. package/docs/icons/strikethrough_s.svg +1 -1
  73. package/docs/icons/table-visibility.svg +1 -1
  74. package/docs/icons/table.svg +1 -1
  75. package/docs/icons/warning.svg +1 -1
  76. package/docs/icons/wysiwyg.svg +1 -1
  77. package/docs/src/components/Resize.js +1 -0
  78. package/docs/src/components/Table.js +88 -78
  79. package/docs/src/components/Tree.js +1 -1
  80. package/icons/account-circle.svg +1 -1
  81. package/icons/add.svg +1 -1
  82. package/icons/arrow-circle.svg +1 -1
  83. package/icons/arrow-line.svg +1 -1
  84. package/icons/arrow.svg +1 -1
  85. package/icons/arrow_drop_down.svg +1 -1
  86. package/icons/cards.svg +1 -1
  87. package/icons/check.svg +1 -1
  88. package/icons/chevron-double.svg +1 -1
  89. package/icons/chevron-line.svg +1 -1
  90. package/icons/chevron.svg +1 -1
  91. package/icons/close.svg +1 -1
  92. package/icons/code.svg +1 -1
  93. package/icons/code_blocks.svg +1 -1
  94. package/icons/copy.svg +1 -1
  95. package/icons/delete.svg +1 -1
  96. package/icons/drag-handle.svg +1 -1
  97. package/icons/edit.svg +1 -1
  98. package/icons/error.svg +1 -1
  99. package/icons/export-file.svg +1 -1
  100. package/icons/file-text.svg +1 -1
  101. package/icons/file.svg +1 -1
  102. package/icons/filter.svg +1 -1
  103. package/icons/folder-open.svg +1 -1
  104. package/icons/folder.svg +1 -1
  105. package/icons/format_align_center.svg +1 -1
  106. package/icons/format_align_justify.svg +1 -1
  107. package/icons/format_align_left.svg +1 -1
  108. package/icons/format_align_right.svg +1 -1
  109. package/icons/format_bold.svg +1 -1
  110. package/icons/format_clear.svg +1 -1
  111. package/icons/format_color_fill.svg +1 -1
  112. package/icons/format_color_text.svg +1 -1
  113. package/icons/format_h1.svg +1 -1
  114. package/icons/format_h2.svg +1 -1
  115. package/icons/format_h3.svg +1 -1
  116. package/icons/format_h4.svg +1 -1
  117. package/icons/format_h5.svg +1 -1
  118. package/icons/format_h6.svg +1 -1
  119. package/icons/format_italic.svg +1 -1
  120. package/icons/format_list_bulleted.svg +1 -1
  121. package/icons/format_list_numbered.svg +1 -1
  122. package/icons/format_paragraph.svg +1 -1
  123. package/icons/format_underlined.svg +1 -1
  124. package/icons/github-mark.svg +1 -1
  125. package/icons/help.svg +1 -1
  126. package/icons/hide.svg +1 -1
  127. package/icons/image.svg +1 -1
  128. package/icons/label.svg +1 -1
  129. package/icons/license.svg +1 -1
  130. package/icons/link.svg +1 -1
  131. package/icons/menu.svg +1 -1
  132. package/icons/mode-auto.svg +1 -1
  133. package/icons/mode-dark.svg +1 -1
  134. package/icons/mode-light.svg +1 -1
  135. package/icons/more_vert.svg +1 -1
  136. package/icons/settings.svg +1 -1
  137. package/icons/show.svg +1 -1
  138. package/icons/strikethrough_s.svg +1 -1
  139. package/icons/table-visibility.svg +1 -1
  140. package/icons/table.svg +1 -1
  141. package/icons/warning.svg +1 -1
  142. package/icons/wysiwyg.svg +1 -1
  143. package/package.json +13 -4
  144. package/src/components/Resize.js +1 -0
  145. package/src/components/Table.js +136 -186
  146. package/src/components/Tree.js +4 -5
  147. package/icons/circle.svg +0 -1
  148. package/icons/compare.svg +0 -1
  149. package/icons/drawing2.svg +0 -124
  150. package/icons/filter-off.svg +0 -1
  151. package/icons/first.svg +0 -1
  152. package/icons/folder-clear.svg +0 -1
  153. package/icons/folder-create.svg +0 -1
  154. package/icons/key.svg +0 -1
  155. package/icons/label-add.svg +0 -1
  156. package/icons/last.svg +0 -1
  157. package/icons/login.svg +0 -1
  158. package/icons/logout.svg +0 -1
  159. package/icons/open-in-browser.svg +0 -1
  160. package/icons/pause.svg +0 -1
  161. package/icons/play.svg +0 -1
  162. package/icons/refresh.svg +0 -1
  163. package/icons/remove.svg +0 -1
  164. package/icons/save.svg +0 -1
  165. package/icons/search.svg +0 -1
  166. package/icons/storage.svg +0 -1
  167. package/icons/tag.svg +0 -1
  168. package/icons/tools.svg +0 -1
  169. package/icons/trash-x.svg +0 -1
  170. package/scripts/getIcon.js +0 -52
package/icons/label.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h440q19 0 36 8.5t28 23.5l216 288-216 288q-11 15-28 23.5t-36 8.5H160Zm0-80h440l180-240-180-240H160v480Zm220-240Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h440q19 0 36 8.5t28 23.5l216 288-216 288q-11 15-28 23.5t-36 8.5H160Zm0-80h440l180-240-180-240H160v480Zm220-240Z"/></svg>
package/icons/license.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg>
package/icons/link.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"/></svg>
package/icons/menu.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"/></svg>
@@ -1 +1 @@
1
- <svg viewBox="0 -960 960 960" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M 440 -920 L 440 -760 L 520 -760 L 520 -920 L 440 -920 z M 818.67969 -885.5332 L 583.66602 -651.38281 C 553.04363 -670.31258 518.55019 -680 480 -680 C 424.66678 -680 377.49992 -660.49992 338.5 -621.5 C 299.50008 -582.50008 280 -535.33322 280 -480 C 280 -441.71314 289.5643 -407.43184 308.23633 -376.96484 L 97.058594 -166.5625 L 168.59375 -92.332031 L 263.80078 -187.18945 C 267.09506 -183.63709 270.46257 -180.11555 273.9375 -176.64062 C 343.93736 -106.64077 428.9377 -71.640625 528.9375 -71.640625 C 628.9373 -71.640625 713.93764 -106.64077 783.9375 -176.64062 C 853.93736 -246.64049 888.9375 -331.64082 888.9375 -431.64062 C 888.9375 -440.97395 888.60417 -450.14064 887.9375 -459.14062 C 887.27083 -468.14062 886.27083 -476.97398 884.9375 -485.64062 C 865.60421 -458.30735 840.60411 -436.47393 809.9375 -420.14062 C 779.27089 -403.80733 745.60409 -395.64062 708.9375 -395.64062 C 648.93762 -395.64062 597.93742 -416.64072 555.9375 -458.64062 C 552.62172 -461.95641 549.47084 -465.3433 546.42188 -468.77344 L 890.21484 -811.30273 L 818.67969 -885.5332 z M 212 -806 L 155 -747 L 256 -650 L 308 -706 L 212 -806 z M 480 -600 C 495.83397 -600 510.50253 -597.28065 524.08008 -592.01562 L 367.83594 -436.34375 C 362.67843 -449.80488 360 -464.32853 360 -480 C 360 -513.33327 371.66671 -541.66671 395 -565 C 418.33329 -588.33329 446.66673 -600 480 -600 z M 40 -520 L 40 -440 L 200 -440 L 200 -520 L 40 -520 z M 489.73047 -412.28906 C 492.87534 -408.86757 496.09809 -405.48004 499.4375 -402.14062 C 557.10405 -344.47408 626.93766 -315.64062 708.9375 -315.64062 C 722.27081 -315.64062 735.60419 -316.64064 748.9375 -318.64062 C 762.27081 -320.64062 775.60419 -323.3073 788.9375 -326.64062 C 767.60421 -274.64074 733.60407 -232.4739 686.9375 -200.14062 C 640.27093 -167.80736 587.60405 -151.64062 528.9375 -151.64062 C 451.60432 -151.64062 385.60406 -178.97407 330.9375 -233.64062 C 327.48999 -237.08813 324.17746 -240.59082 320.95312 -244.13086 L 489.73047 -412.28906 z " /></svg>
1
+ <svg viewBox="0 -960 960 960" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M 440 -920 L 440 -760 L 520 -760 L 520 -920 L 440 -920 z M 818.67969 -885.5332 L 583.66602 -651.38281 C 553.04363 -670.31258 518.55019 -680 480 -680 C 424.66678 -680 377.49992 -660.49992 338.5 -621.5 C 299.50008 -582.50008 280 -535.33322 280 -480 C 280 -441.71314 289.5643 -407.43184 308.23633 -376.96484 L 97.058594 -166.5625 L 168.59375 -92.332031 L 263.80078 -187.18945 C 267.09506 -183.63709 270.46257 -180.11555 273.9375 -176.64062 C 343.93736 -106.64077 428.9377 -71.640625 528.9375 -71.640625 C 628.9373 -71.640625 713.93764 -106.64077 783.9375 -176.64062 C 853.93736 -246.64049 888.9375 -331.64082 888.9375 -431.64062 C 888.9375 -440.97395 888.60417 -450.14064 887.9375 -459.14062 C 887.27083 -468.14062 886.27083 -476.97398 884.9375 -485.64062 C 865.60421 -458.30735 840.60411 -436.47393 809.9375 -420.14062 C 779.27089 -403.80733 745.60409 -395.64062 708.9375 -395.64062 C 648.93762 -395.64062 597.93742 -416.64072 555.9375 -458.64062 C 552.62172 -461.95641 549.47084 -465.3433 546.42188 -468.77344 L 890.21484 -811.30273 L 818.67969 -885.5332 z M 212 -806 L 155 -747 L 256 -650 L 308 -706 L 212 -806 z M 480 -600 C 495.83397 -600 510.50253 -597.28065 524.08008 -592.01562 L 367.83594 -436.34375 C 362.67843 -449.80488 360 -464.32853 360 -480 C 360 -513.33327 371.66671 -541.66671 395 -565 C 418.33329 -588.33329 446.66673 -600 480 -600 z M 40 -520 L 40 -440 L 200 -440 L 200 -520 L 40 -520 z M 489.73047 -412.28906 C 492.87534 -408.86757 496.09809 -405.48004 499.4375 -402.14062 C 557.10405 -344.47408 626.93766 -315.64062 708.9375 -315.64062 C 722.27081 -315.64062 735.60419 -316.64064 748.9375 -318.64062 C 762.27081 -320.64062 775.60419 -323.3073 788.9375 -326.64062 C 767.60421 -274.64074 733.60407 -232.4739 686.9375 -200.14062 C 640.27093 -167.80736 587.60405 -151.64062 528.9375 -151.64062 C 451.60432 -151.64062 385.60406 -178.97407 330.9375 -233.64062 C 327.48999 -237.08813 324.17746 -240.59082 320.95312 -244.13086 L 489.73047 -412.28906 z " /></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q14 0 27.5 1t26.5 3q-41 29-65.5 75.5T444-660q0 90 63 153t153 63q55 0 101-24.5t75-65.5q2 13 3 26.5t1 27.5q0 150-105 255T480-120Zm0-80q88 0 158-48.5T740-375q-20 5-40 8t-40 3q-123 0-209.5-86.5T364-660q0-20 3-40t8-40q-78 32-126.5 102T200-480q0 116 82 198t198 82Zm-10-270Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q14 0 27.5 1t26.5 3q-41 29-65.5 75.5T444-660q0 90 63 153t153 63q55 0 101-24.5t75-65.5q2 13 3 26.5t1 27.5q0 150-105 255T480-120Zm0-80q88 0 158-48.5T740-375q-20 5-40 8t-40 3q-123 0-209.5-86.5T364-660q0-20 3-40t8-40q-78 32-126.5 102T200-480q0 116 82 198t198 82Zm-10-270Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-83 0-141.5-58.5T280-480q0-83 58.5-141.5T480-680q83 0 141.5 58.5T680-480q0 83-58.5 141.5T480-280ZM200-440H40v-80h160v80Zm720 0H760v-80h160v80ZM440-760v-160h80v160h-80Zm0 720v-160h80v160h-80ZM256-650l-101-97 57-59 96 100-52 56Zm492 496-97-101 53-55 101 97-57 59Zm-98-550 97-101 59 57-100 96-56-52ZM154-212l101-97 55 53-97 101-59-57Zm326-268Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-83 0-141.5-58.5T280-480q0-83 58.5-141.5T480-680q83 0 141.5 58.5T680-480q0 83-58.5 141.5T480-280ZM200-440H40v-80h160v80Zm720 0H760v-80h160v80ZM440-760v-160h80v160h-80Zm0 720v-160h80v160h-80ZM256-650l-101-97 57-59 96 100-52 56Zm492 496-97-101 53-55 101 97-57 59Zm-98-550 97-101 59 57-100 96-56-52ZM154-212l101-97 55 53-97 101-59-57Zm326-268Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"/></svg>
package/icons/show.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"/></svg>
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v333q-19-11-39-20t-41-16v-137H520v137q-46 14-86 40t-74 63H200v160h82q11 22 22 42t24 38H200Zm0-320h240v-160H200v160Zm0-240h560v-80H200v80Zm280 200Zm0 0Zm0 0Zm0 0ZM640-40q-91 0-168-48T360-220q35-84 112-132t168-48q91 0 168 48t112 132q-35 84-112 132T640-40Zm0-80q57 0 107.5-26t82.5-74q-32-48-82.5-74T640-320q-57 0-107.5 26T450-220q32 48 82.5 74T640-120Zm0-40q-25 0-42.5-17.5T580-220q0-25 17.5-42.5T640-280q25 0 42.5 17.5T700-220q0 25-17.5 42.5T640-160Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v333q-19-11-39-20t-41-16v-137H520v137q-46 14-86 40t-74 63H200v160h82q11 22 22 42t24 38H200Zm0-320h240v-160H200v160Zm0-240h560v-80H200v80Zm280 200Zm0 0Zm0 0Zm0 0ZM640-40q-91 0-168-48T360-220q35-84 112-132t168-48q91 0 168 48t112 132q-35 84-112 132T640-40Zm0-80q57 0 107.5-26t82.5-74q-32-48-82.5-74T640-320q-57 0-107.5 26T450-220q32 48 82.5 74T640-120Zm0-40q-25 0-42.5-17.5T580-220q0-25 17.5-42.5T640-280q25 0 42.5 17.5T700-220q0 25-17.5 42.5T640-160Z"/></svg>
package/icons/table.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"/></svg>
package/icons/warning.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="m40-120 440-760 440 760H40Zm138-80h604L480-720 178-200Zm302-40q17 0 28.5-11.5T520-280q0-17-11.5-28.5T480-320q-17 0-28.5 11.5T440-280q0 17 11.5 28.5T480-240Zm-40-120h80v-200h-80v200Zm40-100Z"/></svg>
package/icons/wysiwyg.svg CHANGED
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-480H200v480Zm80-280v-80h400v80H280Zm0 160v-80h240v80H280Z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-480H200v480Zm80-280v-80h400v80H280Zm0 160v-80h240v80H280Z"/></svg>
package/package.json CHANGED
@@ -1,20 +1,28 @@
1
1
  {
2
2
  "name": "kempo-ui",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "type": "module",
5
5
  "description": "A Lit based web-component library",
6
6
  "main": "index.js",
7
+ "bin": {
8
+ "kempo-icon": "./bin/icon.js",
9
+ "kempo-geticon": "./bin/get_icon.js",
10
+ "kempo-listicons": "./bin/list_icons.js",
11
+ "kempo-highlightcode": "./bin/highlight_code.js"
12
+ },
7
13
  "scripts": {
8
14
  "build": "node scripts/build.js",
9
15
  "prod": "node scripts/docs.js",
10
16
  "dev": "node scripts/docs.js --src --logging silent",
11
- "geticon": "node scripts/getIcon.js",
17
+ "icon": "node bin/icon.js",
18
+ "geticon": "node bin/get_icon.js",
19
+ "listicons": "node bin/list_icons.js",
20
+ "highlightcode": "node bin/highlight_code.js",
12
21
  "test": "npx kempo-test",
13
22
  "test:gui": "npx kempo-test --gui",
14
23
  "test:browser": "npx kempo-test -b",
15
24
  "test:node": "npx kempo-test -n",
16
- "update-kempo-css": "node scripts/update-kempo-css.js",
17
- "update-kempo-ui-cdn": "node scripts/update-kempo-ui-cdn.js"
25
+ "update-kempo-css": "node scripts/update-kempo-css.js"
18
26
  },
19
27
  "repository": {
20
28
  "type": "git",
@@ -33,6 +41,7 @@
33
41
  "terser": "^5.43.1"
34
42
  },
35
43
  "dependencies": {
44
+ "@inquirer/prompts": "^8.3.0",
36
45
  "kempo-css": "^1.3.11"
37
46
  }
38
47
  }
@@ -162,6 +162,7 @@ export default class Resize extends ShadowComponent {
162
162
  }
163
163
  :host(:not([resizing=""])) #main {
164
164
  pointer-events: none;
165
+ user-select: none;
165
166
  }
166
167
  :host([resizing="side"]) #side,
167
168
  :host([resizing="corner"]) #side,
@@ -80,86 +80,72 @@ export default class Table extends ShadowComponent {
80
80
 
81
81
  updated(changedProperties) {
82
82
  super.updated(changedProperties);
83
-
84
- // Update select-all checkbox state when selection or page changes
85
- if (this.enableSelection) {
83
+
84
+ if(this.enableSelection) {
86
85
  const selectAllCheckbox = this.shadowRoot.getElementById('select-all');
87
- if (selectAllCheckbox) {
86
+ if(selectAllCheckbox) {
88
87
  selectAllCheckbox.checked = this.allOnPageSelected();
89
88
  }
90
89
  }
91
-
92
- // Update container widths
93
- this.updateContainerWidths();
94
- }
95
-
96
- updateContainerWidths() {
97
- const totalWidth = this.columnSizes.total + 'px';
98
- const fieldsEl = this.shadowRoot.getElementById('fields');
99
- const topEl = this.shadowRoot.getElementById('top');
100
- const bottomEl = this.shadowRoot.getElementById('bottom');
101
- const recordsEl = this.shadowRoot.getElementById('records');
102
-
103
- if (fieldsEl) fieldsEl.style.width = totalWidth;
104
- if (topEl) topEl.style.width = totalWidth;
105
- if (bottomEl) bottomEl.style.width = totalWidth;
106
- if (recordsEl) recordsEl.style.width = totalWidth;
107
90
  }
108
91
 
109
92
  /*
110
93
  Rendering Functions
111
94
  */
112
95
 
113
- renderFieldsTemplate() {
114
- this.calculateColumnSizes();
115
- this.hasTopControls() ? this.setAttribute('top-controls', 'true') : this.removeAttribute('top-controls');
116
- this.hasBottomControls() ? this.setAttribute('bottom-controls', 'true') : this.removeAttribute('bottom-controls');
96
+ renderColgroupTemplate() {
97
+ const cols = [];
98
+ if(this.enableSelection) cols.push(html`<col style="width: 40px" />`);
99
+ if(this.hasBeforeControls()) cols.push(html`<col style="width: ${this.columnSizes.beforeControls}px" />`);
100
+ this.fields.forEach(({ size, hidden }) => {
101
+ if(hidden) return;
102
+ cols.push(size ? html`<col style="width: ${size}px" />` : html`<col />`);
103
+ });
104
+ if(this.hasAfterControls()) cols.push(html`<col style="width: ${this.columnSizes.afterControls}px" />`);
105
+ return cols;
106
+ }
117
107
 
118
- const fieldCells = [];
108
+ getColumnCount() {
109
+ let count = 0;
110
+ if(this.enableSelection) count++;
111
+ if(this.hasBeforeControls()) count++;
112
+ this.fields.forEach(({ hidden }) => { if(!hidden) count++; });
113
+ if(this.hasAfterControls()) count++;
114
+ return count;
115
+ }
119
116
 
120
- if (this.enableSelection) {
121
- fieldCells.push(html`
122
- <div class="field controls cell field-select" style="width: 40px">
123
- <input
124
- type="checkbox"
125
- id="select-all"
126
- @change=${this.handleSelectAllChange}
127
- />
128
- </div>
117
+ renderFieldsTemplate() {
118
+ const headers = [];
119
+ if(this.enableSelection) {
120
+ headers.push(html`
121
+ <th class="controls field-select">
122
+ <input type="checkbox" id="select-all" @change=${this.handleSelectAllChange} />
123
+ </th>
129
124
  `);
130
125
  }
131
-
132
- if (this.hasBeforeControls()) {
133
- fieldCells.push(html`
134
- <div class="field cell field-before-controls" style="width: ${this.columnSizes.beforeControls}px"></div>
135
- `);
126
+ if(this.hasBeforeControls()) {
127
+ headers.push(html`<th class="controls field-before-controls"></th>`);
136
128
  }
137
-
138
129
  this.fields.forEach(({ name, label, hidden }) => {
139
- if (hidden) return;
130
+ if(hidden) return;
140
131
  const sortItem = this.sort.find(item => item.name === name);
141
132
  const isCurrentSort = this.sort.length > 0 && this.sort[this.sort.length - 1].name === name;
142
133
  const sortClass = sortItem ? (sortItem.asc ? 'sort-asc' : 'sort-desc') : '';
143
-
144
- fieldCells.push(html`
145
- <div
146
- class="field cell ${sortClass}"
147
- style="width: ${this.columnSizes[name]}px; ${this.enableSorting ? 'cursor: pointer;' : ''}"
134
+ headers.push(html`
135
+ <th
136
+ class="${sortClass}"
137
+ style="${this.enableSorting ? 'cursor: pointer;' : ''}"
148
138
  @click=${this.enableSorting ? () => this.handleFieldClick(name) : null}
149
139
  >
150
140
  ${label}
151
141
  ${isCurrentSort ? html`<k-icon name="arrow" direction="${sortItem.asc ? 'down' : 'up'}" class="icon-sort"></k-icon>` : ''}
152
- </div>
142
+ </th>
153
143
  `);
154
144
  });
155
-
156
- if (this.hasAfterControls()) {
157
- fieldCells.push(html`
158
- <div class="field cell field-after-controls" style="width: ${this.columnSizes.afterControls}px"></div>
159
- `);
145
+ if(this.hasAfterControls()) {
146
+ headers.push(html`<th class="controls field-after-controls"></th>`);
160
147
  }
161
-
162
- return fieldCells;
148
+ return headers;
163
149
  }
164
150
 
165
151
  renderRecordsTemplate() {
@@ -182,7 +168,7 @@ export default class Table extends ShadowComponent {
182
168
  } else {
183
169
  if (fetchStart === null) fetchStart = start + idx;
184
170
  fetchCount++;
185
- return html`<div class="record fetching"><div class="cell">Loading...</div></div>`;
171
+ return html`<tr class="record fetching"><td class="cell" colspan="${this.getColumnCount()}">Loading...</td></tr>`;
186
172
  }
187
173
  });
188
174
 
@@ -202,42 +188,41 @@ export default class Table extends ShadowComponent {
202
188
 
203
189
  renderRecordTemplate(record) {
204
190
  const recordCells = [];
205
-
206
- if (this.enableSelection) {
191
+
192
+ if(this.enableSelection) {
207
193
  recordCells.push(html`
208
- <div class="cell selection controls" style="width: 40px">
209
- <input
210
- type="checkbox"
194
+ <td class="cell selection controls">
195
+ <input
196
+ type="checkbox"
211
197
  .checked=${record[selected]}
212
198
  @change=${(e) => this.handleRecordSelectionChange(record, e)}
213
199
  />
214
- </div>
200
+ </td>
215
201
  `);
216
202
  }
217
-
218
- if (this.hasBeforeControls()) {
203
+
204
+ if(this.hasBeforeControls()) {
219
205
  recordCells.push(this.renderBeforeControlsTemplate());
220
206
  }
221
-
207
+
222
208
  this.fields.forEach(({ name, formatter, calculator, type, editor, hidden }) => {
223
- if (hidden) return;
209
+ if(hidden) return;
224
210
  let value = record[name] || '';
225
-
226
211
  recordCells.push(html`
227
- <div class="cell" data-field=${name} style="width: ${this.columnSizes[name]}px">
212
+ <td class="cell" data-field=${name}>
228
213
  ${record[editing] ? this.renderEditingCell(record, name, value, calculator, editor, type) : this.renderDisplayCell(record, name, value, calculator, formatter)}
229
- </div>
214
+ </td>
230
215
  `);
231
216
  });
232
-
233
- if (this.hasAfterControls()) {
217
+
218
+ if(this.hasAfterControls()) {
234
219
  recordCells.push(this.renderAfterControlsTemplate());
235
220
  }
236
-
221
+
237
222
  return html`
238
- <div class="record ${record[editing] ? 'editing' : ''}" data-index=${record[index]}>
223
+ <tr class="record ${record[editing] ? 'editing' : ''}" data-index=${record[index]}>
239
224
  ${recordCells}
240
- </div>
225
+ </tr>
241
226
  `;
242
227
  }
243
228
 
@@ -280,55 +265,37 @@ export default class Table extends ShadowComponent {
280
265
 
281
266
  renderBeforeControlsTemplate() {
282
267
  const controls = [];
283
-
284
268
  this.querySelectorAll('[slot="before"]').forEach(control => {
285
269
  const tagName = control.tagName.toLowerCase();
286
270
  const newControl = document.createElement(tagName);
287
-
288
271
  Array.from(control.attributes).forEach(attr => {
289
- if(attr.name !== 'slot'){
290
- newControl.setAttribute(attr.name, attr.value);
291
- }
272
+ if(attr.name !== 'slot') newControl.setAttribute(attr.name, attr.value);
292
273
  });
293
-
294
- if(control.innerHTML){
295
- newControl.innerHTML = control.innerHTML;
296
- }
297
-
274
+ if(control.innerHTML) newControl.innerHTML = control.innerHTML;
298
275
  controls.push(newControl);
299
276
  });
300
-
301
277
  return html`
302
- <div class="cell controls controls-before" style="width: ${this.columnSizes.beforeControls}px">
278
+ <td class="cell controls controls-before">
303
279
  ${controls}
304
- </div>
280
+ </td>
305
281
  `;
306
282
  }
307
283
 
308
284
  renderAfterControlsTemplate() {
309
285
  const controls = [];
310
-
311
286
  this.querySelectorAll('[slot="after"]').forEach(control => {
312
287
  const tagName = control.tagName.toLowerCase();
313
288
  const newControl = document.createElement(tagName);
314
-
315
289
  Array.from(control.attributes).forEach(attr => {
316
- if(attr.name !== 'slot'){
317
- newControl.setAttribute(attr.name, attr.value);
318
- }
290
+ if(attr.name !== 'slot') newControl.setAttribute(attr.name, attr.value);
319
291
  });
320
-
321
- if(control.innerHTML){
322
- newControl.innerHTML = control.innerHTML;
323
- }
324
-
292
+ if(control.innerHTML) newControl.innerHTML = control.innerHTML;
325
293
  controls.push(newControl);
326
294
  });
327
-
328
295
  return html`
329
- <div class="cell controls controls-after" style="width: ${this.columnSizes.afterControls}px">
296
+ <td class="cell controls controls-after">
330
297
  ${controls}
331
- </div>
298
+ </td>
332
299
  `;
333
300
  }
334
301
 
@@ -949,54 +916,19 @@ export default class Table extends ShadowComponent {
949
916
  }
950
917
 
951
918
  calculateColumnSizes() {
952
- const newSizes = {};
953
- newSizes.total = 0;
954
-
955
- if (this.enableSelection) newSizes.total += 40;
956
-
957
919
  const beforeEls = Array.from(this.querySelectorAll('[slot="before"]'));
958
920
  const afterEls = Array.from(this.querySelectorAll('[slot="after"]'));
959
-
960
- newSizes.beforeControls = beforeEls.reduce((total, el) => total + (el.maxWidth || 40), 0);
961
- newSizes.afterControls = afterEls.reduce((total, el) => total + (el.maxWidth || 40), 0);
962
-
963
- if (this.hasBeforeControls()) newSizes.total += newSizes.beforeControls;
964
- if (this.hasAfterControls()) newSizes.total += newSizes.afterControls;
965
-
966
- this.fields.forEach(field => {
967
- if (field.size) {
968
- newSizes[field.name] = field.size;
969
- newSizes.total += field.size;
970
- } else {
971
- let maxLength = 0;
972
- this.records.slice(0, 100).forEach(record => {
973
- if(record === null) return;
974
- let value = record[field.name];
975
- if (field.calculator) {
976
- value = field.calculator(record, this);
977
- }
978
- if (field.formatter) {
979
- value = field.formatter(value);
980
- }
981
- if (value && value.toString().length > maxLength) {
982
- maxLength = value.toString().length;
983
- }
984
- });
985
- newSizes[field.name] = Math.max((maxLength * 10 + 32), 128);
986
- if (!field.hidden) newSizes.total += newSizes[field.name];
987
- }
988
- });
989
-
921
+ const newSizes = {
922
+ beforeControls: beforeEls.reduce((total, el) => total + (el.maxWidth || 40), 0),
923
+ afterControls: afterEls.reduce((total, el) => total + (el.maxWidth || 40), 0)
924
+ };
990
925
  const hasUndefinedMaxWidth = [...beforeEls, ...afterEls].some(el => el.maxWidth === undefined);
991
-
992
- if (JSON.stringify(this.columnSizes) !== JSON.stringify(newSizes)) {
926
+ if(JSON.stringify(this.columnSizes) !== JSON.stringify(newSizes)) {
993
927
  this.columnSizes = newSizes;
994
928
  }
995
-
996
- if (hasUndefinedMaxWidth) {
929
+ if(hasUndefinedMaxWidth) {
997
930
  setTimeout(() => this.calculateColumnSizes(), 0);
998
931
  }
999
-
1000
932
  return this.columnSizes;
1001
933
  }
1002
934
 
@@ -1040,13 +972,12 @@ export default class Table extends ShadowComponent {
1040
972
  /* Rendering */
1041
973
 
1042
974
  render() {
1043
- if (!this.records || !this.fields) {
975
+ if(!this.records || !this.fields) {
1044
976
  return html`
1045
977
  <div id="wrapper">
1046
978
  <div id="top"><slot name="top"></slot></div>
1047
- <div id="table">
1048
- <div id="fields"></div>
1049
- <div id="records"></div>
979
+ <div id="table-container">
980
+ <table><thead><tr></tr></thead><tbody></tbody></table>
1050
981
  </div>
1051
982
  <div id="bottom"><slot></slot></div>
1052
983
  </div>
@@ -1063,16 +994,23 @@ export default class Table extends ShadowComponent {
1063
994
 
1064
995
  return html`
1065
996
  <div id="wrapper">
1066
- <div id="top" style="width: ${this.columnSizes.total}px"><slot name="top"></slot></div>
1067
- <div id="table">
1068
- <div id="fields" style="width: ${this.columnSizes.total}px">
1069
- ${this.renderFieldsTemplate()}
1070
- </div>
1071
- <div id="records" style="width: ${this.columnSizes.total}px">
1072
- ${this.renderRecordsTemplate()}
1073
- </div>
997
+ <div id="top"><slot name="top"></slot></div>
998
+ <div id="table-container">
999
+ <table>
1000
+ <colgroup>
1001
+ ${this.renderColgroupTemplate()}
1002
+ </colgroup>
1003
+ <thead>
1004
+ <tr>
1005
+ ${this.renderFieldsTemplate()}
1006
+ </tr>
1007
+ </thead>
1008
+ <tbody>
1009
+ ${this.renderRecordsTemplate()}
1010
+ </tbody>
1011
+ </table>
1074
1012
  </div>
1075
- <div id="bottom" style="width: ${this.columnSizes.total}px"><slot></slot></div>
1013
+ <div id="bottom"><slot></slot></div>
1076
1014
  </div>
1077
1015
  <div style="display: none">
1078
1016
  <slot name="before"></slot>
@@ -1084,40 +1022,67 @@ export default class Table extends ShadowComponent {
1084
1022
  static styles = css`
1085
1023
  :host {
1086
1024
  display: block;
1087
- width: 100%;
1088
- overflow: auto;
1089
1025
  margin-bottom: var(--spacer);
1090
1026
  }
1091
1027
  #wrapper {
1092
- width: min-content;
1093
1028
  border: 1px solid var(--c_border);
1094
1029
  border-radius: var(--radius);
1030
+ overflow: hidden;
1095
1031
  }
1096
- #table {
1097
- width: min-content;
1032
+ #table-container {
1033
+ overflow-x: auto;
1098
1034
  }
1099
- #fields,
1100
- .record {
1101
- display: flex;
1035
+ table {
1036
+ width: 100%;
1037
+ border-collapse: collapse;
1102
1038
  }
1103
- #fields {
1039
+ thead tr {
1104
1040
  background-color: var(--c_bg__alt);
1105
- border-bottom: 1px solid var(--c_border);
1106
1041
  }
1107
- .record:not([editing="true"]) .cell:not(.controls),
1108
- #fields .cell:not(.controls) {
1042
+ th, td {
1109
1043
  padding: calc(0.5 * var(--spacer)) var(--spacer);
1044
+ vertical-align: middle;
1110
1045
  }
1111
- .cell {
1112
- display: flex;
1113
- align-items: center;
1046
+ th:not(:last-child),
1047
+ td:not(:last-child) {
1048
+ border-right: 1px solid var(--c_border);
1049
+ }
1050
+ th:first-child,
1051
+ td:first-child {
1052
+ border-left: none;
1114
1053
  }
1115
- .cell:not(:first-child) {
1116
- border-left: 1px solid var(--c_border);
1054
+ th:last-child,
1055
+ td:last-child {
1056
+ border-right: none;
1117
1057
  }
1118
- .record:not(:last-child) .cell {
1058
+ thead tr th {
1059
+ border-top: none;
1119
1060
  border-bottom: 1px solid var(--c_border);
1120
1061
  }
1062
+ tbody tr:not(:last-child) td {
1063
+ border-bottom: 1px solid var(--c_border);
1064
+ }
1065
+ tbody tr:last-child td {
1066
+ border-bottom: none;
1067
+ }
1068
+ th.controls,
1069
+ td.controls {
1070
+ padding: 0;
1071
+ }
1072
+ .field-select,
1073
+ .selection {
1074
+ width: 40px;
1075
+ text-align: center;
1076
+ }
1077
+ .field-select input,
1078
+ .selection input {
1079
+ width: 1.25rem;
1080
+ height: 1.25rem;
1081
+ }
1082
+ .icon-sort {
1083
+ float: right;
1084
+ opacity: 0.5;
1085
+ }
1121
1086
  #top, #bottom {
1122
1087
  display: flex;
1123
1088
  width: 100%;
@@ -1136,21 +1101,6 @@ export default class Table extends ShadowComponent {
1136
1101
  :host(:not([bottom-controls])) #bottom {
1137
1102
  display: none;
1138
1103
  }
1139
- .field-select,
1140
- .selection {
1141
- display: flex;
1142
- justify-content: center;
1143
- align-items: center;
1144
- }
1145
- .field-select input,
1146
- .selection input {
1147
- width: 1.25rem;
1148
- height: 1.25rem;
1149
- }
1150
- .icon-sort {
1151
- float: right;
1152
- opacity: 0.5;
1153
- }
1154
1104
  `;
1155
1105
 
1156
1106
  /*
@@ -59,15 +59,14 @@ export default class Tree extends ShadowComponent {
59
59
 
60
60
  /* Static Methods */
61
61
  static renderValue(value, key = null, depth = 0, maxDepth = 0){
62
- const LeafClass = Tree.nodes.find(n => n.detect(value));
63
- if(LeafClass){
64
- const instance = new LeafClass(value);
62
+ const NodeClass = Tree.nodes.find(n => n.detect(value));
63
+ if(NodeClass && NodeClass.prototype.getChildren === TreeNode.prototype.getChildren){
65
64
  const keyLabel = key !== null
66
65
  ? html`<span class="${typeof key === 'number' ? 'tc-muted' : ''}">${key}: </span>`
67
66
  : '';
68
- return html`<span class="d-b">${keyLabel}${instance.renderLabel()}</span>`;
67
+ return html`<span class="d-b">${keyLabel}${new NodeClass(value).renderLabel()}</span>`;
69
68
  }
70
- const el = document.createElement(TreeNode.nodeTag);
69
+ const el = document.createElement((NodeClass ?? TreeNode).nodeTag);
71
70
  el.value = value;
72
71
  el.key = key;
73
72
  el.depth = depth;
package/icons/circle.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
package/icons/compare.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="currentColor" d="M400-40v-80H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h200v-80h80v880h-80ZM200-240h200v-240L200-240Zm360 120v-360l200 240v-520H560v-80h200q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H560Z"/></svg>