@terraware/web-components 1.0.3 → 1.0.4

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 (327) hide show
  1. package/components/Autocomplete.d.ts +16 -0
  2. package/components/Autocomplete.d.ts.map +1 -0
  3. package/components/Autocomplete.js +53 -0
  4. package/components/Button/Button.d.ts +18 -0
  5. package/components/Button/Button.d.ts.map +1 -0
  6. package/components/Button/Button.js +42 -0
  7. package/components/Button/button.test.d.ts +2 -0
  8. package/components/Button/button.test.d.ts.map +1 -0
  9. package/components/Button/button.test.js +33 -0
  10. package/components/Button/styles.scss +443 -0
  11. package/components/Checkbox.d.ts +12 -0
  12. package/components/Checkbox.d.ts.map +1 -0
  13. package/components/Checkbox.js +33 -0
  14. package/components/DatePicker.d.ts +19 -0
  15. package/components/DatePicker.d.ts.map +1 -0
  16. package/components/DatePicker.js +45 -0
  17. package/components/DialogBox/DialogBox.d.ts +16 -0
  18. package/components/DialogBox/DialogBox.d.ts.map +1 -0
  19. package/components/DialogBox/DialogBox.js +85 -0
  20. package/components/DialogBox/styles.scss +138 -0
  21. package/components/Divisor.d.ts +6 -0
  22. package/components/Divisor.d.ts.map +1 -0
  23. package/components/Divisor.js +24 -0
  24. package/components/Dropdown.d.ts +15 -0
  25. package/components/Dropdown.d.ts.map +1 -0
  26. package/components/Dropdown.js +59 -0
  27. package/components/Icon/Icon.d.ts +11 -0
  28. package/components/Icon/Icon.d.ts.map +1 -0
  29. package/components/Icon/Icon.js +25 -0
  30. package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts +8 -0
  31. package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts.map +1 -0
  32. package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.js +41 -0
  33. package/components/Icon/icons/assets/BlobbyIconHappy.d.ts +8 -0
  34. package/components/Icon/icons/assets/BlobbyIconHappy.d.ts.map +1 -0
  35. package/components/Icon/icons/assets/BlobbyIconHappy.js +165 -0
  36. package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts +8 -0
  37. package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts.map +1 -0
  38. package/components/Icon/icons/assets/BlobbyIconHeartMonitor.js +165 -0
  39. package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts +8 -0
  40. package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts.map +1 -0
  41. package/components/Icon/icons/assets/BlobbyIconLeaf.js +165 -0
  42. package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts +8 -0
  43. package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts.map +1 -0
  44. package/components/Icon/icons/assets/BlobbyIconLibrary.js +165 -0
  45. package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts +8 -0
  46. package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts.map +1 -0
  47. package/components/Icon/icons/assets/BlobbyIconOrganization.js +158 -0
  48. package/components/Icon/icons/assets/BlobbyIconPeople.d.ts +8 -0
  49. package/components/Icon/icons/assets/BlobbyIconPeople.d.ts.map +1 -0
  50. package/components/Icon/icons/assets/BlobbyIconPeople.js +158 -0
  51. package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts +8 -0
  52. package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts.map +1 -0
  53. package/components/Icon/icons/assets/BlobbyIconSeedBank.js +165 -0
  54. package/components/Icon/icons/assets/BlobbyIconWrench.d.ts +8 -0
  55. package/components/Icon/icons/assets/BlobbyIconWrench.d.ts.map +1 -0
  56. package/components/Icon/icons/assets/BlobbyIconWrench.js +165 -0
  57. package/components/Icon/icons/assets/Bug.d.ts +8 -0
  58. package/components/Icon/icons/assets/Bug.d.ts.map +1 -0
  59. package/components/Icon/icons/assets/Bug.js +36 -0
  60. package/components/Icon/icons/assets/Calendar.d.ts +8 -0
  61. package/components/Icon/icons/assets/Calendar.d.ts.map +1 -0
  62. package/components/Icon/icons/assets/Calendar.js +35 -0
  63. package/components/Icon/icons/assets/CaretDown.d.ts +8 -0
  64. package/components/Icon/icons/assets/CaretDown.d.ts.map +1 -0
  65. package/components/Icon/icons/assets/CaretDown.js +35 -0
  66. package/components/Icon/icons/assets/CaretLeft.d.ts +8 -0
  67. package/components/Icon/icons/assets/CaretLeft.d.ts.map +1 -0
  68. package/components/Icon/icons/assets/CaretLeft.js +35 -0
  69. package/components/Icon/icons/assets/CaretUp.d.ts +8 -0
  70. package/components/Icon/icons/assets/CaretUp.d.ts.map +1 -0
  71. package/components/Icon/icons/assets/CaretUp.js +35 -0
  72. package/components/Icon/icons/assets/ChevronDown.d.ts +8 -0
  73. package/components/Icon/icons/assets/ChevronDown.d.ts.map +1 -0
  74. package/components/Icon/icons/assets/ChevronDown.js +36 -0
  75. package/components/Icon/icons/assets/ChevronUp.d.ts +8 -0
  76. package/components/Icon/icons/assets/ChevronUp.d.ts.map +1 -0
  77. package/components/Icon/icons/assets/ChevronUp.js +35 -0
  78. package/components/Icon/icons/assets/Close.d.ts +8 -0
  79. package/components/Icon/icons/assets/Close.d.ts.map +1 -0
  80. package/components/Icon/icons/assets/Close.js +35 -0
  81. package/components/Icon/icons/assets/Critical.d.ts +8 -0
  82. package/components/Icon/icons/assets/Critical.d.ts.map +1 -0
  83. package/components/Icon/icons/assets/Critical.js +35 -0
  84. package/components/Icon/icons/assets/Edit.d.ts +8 -0
  85. package/components/Icon/icons/assets/Edit.d.ts.map +1 -0
  86. package/components/Icon/icons/assets/Edit.js +158 -0
  87. package/components/Icon/icons/assets/Error.d.ts +8 -0
  88. package/components/Icon/icons/assets/Error.d.ts.map +1 -0
  89. package/components/Icon/icons/assets/Error.js +35 -0
  90. package/components/Icon/icons/assets/Export.d.ts +8 -0
  91. package/components/Icon/icons/assets/Export.d.ts.map +1 -0
  92. package/components/Icon/icons/assets/Export.js +36 -0
  93. package/components/Icon/icons/assets/Filter.d.ts +8 -0
  94. package/components/Icon/icons/assets/Filter.d.ts.map +1 -0
  95. package/components/Icon/icons/assets/Filter.js +36 -0
  96. package/components/Icon/icons/assets/Folder.d.ts +8 -0
  97. package/components/Icon/icons/assets/Folder.d.ts.map +1 -0
  98. package/components/Icon/icons/assets/Folder.js +35 -0
  99. package/components/Icon/icons/assets/Help.d.ts +8 -0
  100. package/components/Icon/icons/assets/Help.d.ts.map +1 -0
  101. package/components/Icon/icons/assets/Help.js +35 -0
  102. package/components/Icon/icons/assets/Home.d.ts +8 -0
  103. package/components/Icon/icons/assets/Home.d.ts.map +1 -0
  104. package/components/Icon/icons/assets/Home.js +35 -0
  105. package/components/Icon/icons/assets/IconCancel.d.ts +8 -0
  106. package/components/Icon/icons/assets/IconCancel.d.ts.map +1 -0
  107. package/components/Icon/icons/assets/IconCancel.js +36 -0
  108. package/components/Icon/icons/assets/IconChargingBattery.d.ts +8 -0
  109. package/components/Icon/icons/assets/IconChargingBattery.d.ts.map +1 -0
  110. package/components/Icon/icons/assets/IconChargingBattery.js +36 -0
  111. package/components/Icon/icons/assets/IconCheckmark.d.ts +8 -0
  112. package/components/Icon/icons/assets/IconCheckmark.d.ts.map +1 -0
  113. package/components/Icon/icons/assets/IconCheckmark.js +36 -0
  114. package/components/Icon/icons/assets/IconDashboard.d.ts +8 -0
  115. package/components/Icon/icons/assets/IconDashboard.d.ts.map +1 -0
  116. package/components/Icon/icons/assets/IconDashboard.js +36 -0
  117. package/components/Icon/icons/assets/IconHeartMonitor.d.ts +8 -0
  118. package/components/Icon/icons/assets/IconHeartMonitor.d.ts.map +1 -0
  119. package/components/Icon/icons/assets/IconHeartMonitor.js +35 -0
  120. package/components/Icon/icons/assets/IconMail.d.ts +8 -0
  121. package/components/Icon/icons/assets/IconMail.d.ts.map +1 -0
  122. package/components/Icon/icons/assets/IconMail.js +36 -0
  123. package/components/Icon/icons/assets/IconManager.d.ts +8 -0
  124. package/components/Icon/icons/assets/IconManager.d.ts.map +1 -0
  125. package/components/Icon/icons/assets/IconManager.js +36 -0
  126. package/components/Icon/icons/assets/IconMenu.d.ts +8 -0
  127. package/components/Icon/icons/assets/IconMenu.d.ts.map +1 -0
  128. package/components/Icon/icons/assets/IconMenu.js +36 -0
  129. package/components/Icon/icons/assets/IconOrg.d.ts +8 -0
  130. package/components/Icon/icons/assets/IconOrg.d.ts.map +1 -0
  131. package/components/Icon/icons/assets/IconOrg.js +36 -0
  132. package/components/Icon/icons/assets/IconSeedBank.d.ts +8 -0
  133. package/components/Icon/icons/assets/IconSeedBank.d.ts.map +1 -0
  134. package/components/Icon/icons/assets/IconSeedBank.js +35 -0
  135. package/components/Icon/icons/assets/IconWifi.d.ts +8 -0
  136. package/components/Icon/icons/assets/IconWifi.d.ts.map +1 -0
  137. package/components/Icon/icons/assets/IconWifi.js +36 -0
  138. package/components/Icon/icons/assets/Info.d.ts +8 -0
  139. package/components/Icon/icons/assets/Info.d.ts.map +1 -0
  140. package/components/Icon/icons/assets/Info.js +35 -0
  141. package/components/Icon/icons/assets/Key.d.ts +8 -0
  142. package/components/Icon/icons/assets/Key.d.ts.map +1 -0
  143. package/components/Icon/icons/assets/Key.js +35 -0
  144. package/components/Icon/icons/assets/Leaf.d.ts +8 -0
  145. package/components/Icon/icons/assets/Leaf.d.ts.map +1 -0
  146. package/components/Icon/icons/assets/Leaf.js +35 -0
  147. package/components/Icon/icons/assets/Lock.d.ts +8 -0
  148. package/components/Icon/icons/assets/Lock.d.ts.map +1 -0
  149. package/components/Icon/icons/assets/Lock.js +34 -0
  150. package/components/Icon/icons/assets/MenuVertical.d.ts +8 -0
  151. package/components/Icon/icons/assets/MenuVertical.d.ts.map +1 -0
  152. package/components/Icon/icons/assets/MenuVertical.js +36 -0
  153. package/components/Icon/icons/assets/Notification.d.ts +8 -0
  154. package/components/Icon/icons/assets/Notification.d.ts.map +1 -0
  155. package/components/Icon/icons/assets/Notification.js +35 -0
  156. package/components/Icon/icons/assets/Person.d.ts +8 -0
  157. package/components/Icon/icons/assets/Person.d.ts.map +1 -0
  158. package/components/Icon/icons/assets/Person.js +35 -0
  159. package/components/Icon/icons/assets/Plus.d.ts +8 -0
  160. package/components/Icon/icons/assets/Plus.d.ts.map +1 -0
  161. package/components/Icon/icons/assets/Plus.js +35 -0
  162. package/components/Icon/icons/assets/RestorationSite.d.ts +8 -0
  163. package/components/Icon/icons/assets/RestorationSite.d.ts.map +1 -0
  164. package/components/Icon/icons/assets/RestorationSite.js +35 -0
  165. package/components/Icon/icons/assets/Search.d.ts +8 -0
  166. package/components/Icon/icons/assets/Search.d.ts.map +1 -0
  167. package/components/Icon/icons/assets/Search.js +35 -0
  168. package/components/Icon/icons/assets/Seeds.d.ts +8 -0
  169. package/components/Icon/icons/assets/Seeds.d.ts.map +1 -0
  170. package/components/Icon/icons/assets/Seeds.js +35 -0
  171. package/components/Icon/icons/assets/Site.d.ts +8 -0
  172. package/components/Icon/icons/assets/Site.d.ts.map +1 -0
  173. package/components/Icon/icons/assets/Site.js +35 -0
  174. package/components/Icon/icons/assets/Sparkles.d.ts +8 -0
  175. package/components/Icon/icons/assets/Sparkles.d.ts.map +1 -0
  176. package/components/Icon/icons/assets/Sparkles.js +36 -0
  177. package/components/Icon/icons/assets/Species.d.ts +8 -0
  178. package/components/Icon/icons/assets/Species.d.ts.map +1 -0
  179. package/components/Icon/icons/assets/Species.js +35 -0
  180. package/components/Icon/icons/assets/Species2.d.ts +8 -0
  181. package/components/Icon/icons/assets/Species2.d.ts.map +1 -0
  182. package/components/Icon/icons/assets/Species2.js +158 -0
  183. package/components/Icon/icons/assets/Spinner.d.ts +8 -0
  184. package/components/Icon/icons/assets/Spinner.d.ts.map +1 -0
  185. package/components/Icon/icons/assets/Spinner.js +61 -0
  186. package/components/Icon/icons/assets/Success.d.ts +8 -0
  187. package/components/Icon/icons/assets/Success.d.ts.map +1 -0
  188. package/components/Icon/icons/assets/Success.js +35 -0
  189. package/components/Icon/icons/assets/Touchscreen.d.ts +8 -0
  190. package/components/Icon/icons/assets/Touchscreen.d.ts.map +1 -0
  191. package/components/Icon/icons/assets/Touchscreen.js +36 -0
  192. package/components/Icon/icons/assets/UploadCloud.d.ts +8 -0
  193. package/components/Icon/icons/assets/UploadCloud.d.ts.map +1 -0
  194. package/components/Icon/icons/assets/UploadCloud.js +158 -0
  195. package/components/Icon/icons/assets/Warning.d.ts +8 -0
  196. package/components/Icon/icons/assets/Warning.d.ts.map +1 -0
  197. package/components/Icon/icons/assets/Warning.js +35 -0
  198. package/components/Icon/icons/assets/index.d.ts +57 -0
  199. package/components/Icon/icons/assets/index.d.ts.map +1 -0
  200. package/components/Icon/icons/assets/index.js +455 -0
  201. package/components/Icon/icons/index.d.ts +8 -0
  202. package/components/Icon/icons/index.d.ts.map +1 -0
  203. package/components/Icon/icons/index.js +179 -0
  204. package/components/Icon/styles.scss +43 -0
  205. package/components/Navbar/NavFooter.d.ts +7 -0
  206. package/components/Navbar/NavFooter.d.ts.map +1 -0
  207. package/components/Navbar/NavFooter.js +19 -0
  208. package/components/Navbar/NavItem.d.ts +13 -0
  209. package/components/Navbar/NavItem.d.ts.map +1 -0
  210. package/components/Navbar/NavItem.js +42 -0
  211. package/components/Navbar/NavSection.d.ts +7 -0
  212. package/components/Navbar/NavSection.d.ts.map +1 -0
  213. package/components/Navbar/NavSection.js +23 -0
  214. package/components/Navbar/Navbar.d.ts +8 -0
  215. package/components/Navbar/Navbar.d.ts.map +1 -0
  216. package/components/Navbar/Navbar.js +64 -0
  217. package/components/Navbar/logo.svg +25 -0
  218. package/components/Navbar/styles.scss +159 -0
  219. package/components/Note.d.ts +6 -0
  220. package/components/Note.d.ts.map +1 -0
  221. package/components/Note.js +35 -0
  222. package/components/ProgressCircle/ProgressCircle.d.ts +10 -0
  223. package/components/ProgressCircle/ProgressCircle.d.ts.map +1 -0
  224. package/components/ProgressCircle/ProgressCircle.js +37 -0
  225. package/components/ProgressCircle/styles.scss +84 -0
  226. package/components/RadioButton.d.ts +10 -0
  227. package/components/RadioButton.d.ts.map +1 -0
  228. package/components/RadioButton.js +31 -0
  229. package/components/Select/Select.d.ts +23 -0
  230. package/components/Select/Select.d.ts.map +1 -0
  231. package/components/Select/Select.js +248 -0
  232. package/components/Select/styles.scss +282 -0
  233. package/components/Size.d.ts +2 -0
  234. package/components/Size.d.ts.map +1 -0
  235. package/components/Size.js +5 -0
  236. package/components/SummaryBox.d.ts +11 -0
  237. package/components/SummaryBox.d.ts.map +1 -0
  238. package/components/SummaryBox.js +79 -0
  239. package/components/Textfield/Textfield.d.ts +27 -0
  240. package/components/Textfield/Textfield.d.ts.map +1 -0
  241. package/components/Textfield/Textfield.js +123 -0
  242. package/components/Textfield/styles.scss +216 -0
  243. package/components/table/EnhancedTableToolbar.d.ts +9 -0
  244. package/components/table/EnhancedTableToolbar.d.ts.map +1 -0
  245. package/components/table/EnhancedTableToolbar.js +53 -0
  246. package/components/table/TableCellRenderer.d.ts +26 -0
  247. package/components/table/TableCellRenderer.d.ts.map +1 -0
  248. package/components/table/TableCellRenderer.js +166 -0
  249. package/components/table/TableHeader.d.ts +16 -0
  250. package/components/table/TableHeader.d.ts.map +1 -0
  251. package/components/table/TableHeader.js +68 -0
  252. package/components/table/TableHeaderItem.d.ts +17 -0
  253. package/components/table/TableHeaderItem.d.ts.map +1 -0
  254. package/components/table/TableHeaderItem.js +77 -0
  255. package/components/table/index.d.ts +40 -0
  256. package/components/table/index.d.ts.map +1 -0
  257. package/components/table/index.js +322 -0
  258. package/components/table/sort.d.ts +9 -0
  259. package/components/table/sort.d.ts.map +1 -0
  260. package/components/table/sort.js +51 -0
  261. package/components/table/types.d.ts +34 -0
  262. package/components/table/types.d.ts.map +1 -0
  263. package/components/table/types.js +5 -0
  264. package/fonts/Inter.ttf +0 -0
  265. package/index.css +13 -0
  266. package/index.d.ts +26 -0
  267. package/index.d.ts.map +1 -0
  268. package/license-report.html +50 -0
  269. package/package.json +1 -4
  270. package/setupTests.d.ts +2 -0
  271. package/setupTests.d.ts.map +1 -0
  272. package/setupTests.js +5 -0
  273. package/stories/Autocomplete.stories.d.ts +9 -0
  274. package/stories/Autocomplete.stories.d.ts.map +1 -0
  275. package/stories/Button.stories.d.ts +35 -0
  276. package/stories/Button.stories.d.ts.map +1 -0
  277. package/stories/Checkbox.stories.d.ts +9 -0
  278. package/stories/Checkbox.stories.d.ts.map +1 -0
  279. package/stories/DatePicker.stories.d.ts +11 -0
  280. package/stories/DatePicker.stories.d.ts.map +1 -0
  281. package/stories/DialogBox.stories.d.ts +14 -0
  282. package/stories/DialogBox.stories.d.ts.map +1 -0
  283. package/stories/Divisor.stories.d.ts +20 -0
  284. package/stories/Divisor.stories.d.ts.map +1 -0
  285. package/stories/Dropdown.stories.d.ts +9 -0
  286. package/stories/Dropdown.stories.d.ts.map +1 -0
  287. package/stories/Icon.stories.d.ts +9 -0
  288. package/stories/Icon.stories.d.ts.map +1 -0
  289. package/stories/Navbar.stories.d.ts +10 -0
  290. package/stories/Navbar.stories.d.ts.map +1 -0
  291. package/stories/Note.stories.d.ts +9 -0
  292. package/stories/Note.stories.d.ts.map +1 -0
  293. package/stories/ProgressCircle.stories.d.ts +9 -0
  294. package/stories/ProgressCircle.stories.d.ts.map +1 -0
  295. package/stories/RadioButton.stories.d.ts +9 -0
  296. package/stories/RadioButton.stories.d.ts.map +1 -0
  297. package/stories/Select.stories.d.ts +9 -0
  298. package/stories/Select.stories.d.ts.map +1 -0
  299. package/stories/SummaryBox.stories.d.ts +11 -0
  300. package/stories/SummaryBox.stories.d.ts.map +1 -0
  301. package/stories/Table.stories.d.ts +12 -0
  302. package/stories/Table.stories.d.ts.map +1 -0
  303. package/stories/TextfieldNew.stories.d.ts +29 -0
  304. package/stories/TextfieldNew.stories.d.ts.map +1 -0
  305. package/style-dictionary-dist/button_variables.scss +299 -0
  306. package/style-dictionary-dist/dialogBox_variables.scss +251 -0
  307. package/style-dictionary-dist/navbar_variables.scss +257 -0
  308. package/style-dictionary-dist/progressCircle_variables.scss +251 -0
  309. package/style-dictionary-dist/textfield_variables.scss +297 -0
  310. package/theme.d.ts +60 -0
  311. package/theme.d.ts.map +1 -0
  312. package/theme.js +76 -0
  313. package/utils/date.d.ts +3 -0
  314. package/utils/date.d.ts.map +1 -0
  315. package/utils/date.js +13 -0
  316. package/utils/index.d.ts +6 -0
  317. package/utils/index.d.ts.map +1 -0
  318. package/utils/index.js +39 -0
  319. package/utils/preventDefaultEvent.d.ts +4 -0
  320. package/utils/preventDefaultEvent.d.ts.map +1 -0
  321. package/utils/preventDefaultEvent.js +13 -0
  322. package/utils/text.d.ts +3 -0
  323. package/utils/text.d.ts.map +1 -0
  324. package/utils/text.js +13 -0
  325. package/utils/useDeviceInfo.d.ts +42 -0
  326. package/utils/useDeviceInfo.d.ts.map +1 -0
  327. package/utils/useDeviceInfo.js +87 -0
@@ -0,0 +1,216 @@
1
+ @use 'sass:math';
2
+
3
+ @import '../../style-dictionary-dist/textfield_variables.scss';
4
+
5
+ @font-face {
6
+ font-family: 'Inter';
7
+ src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
8
+ }
9
+
10
+ .textfield {
11
+ display: flex;
12
+ flex-flow: row wrap;
13
+ .textfield-label {
14
+ font-family: $tw-fnt-frm-fld-label-font-family;
15
+ font-size: $tw-fnt-frm-fld-label-font-size;
16
+ font-weight: $tw-fnt-frm-fld-label-font-weight;
17
+ line-height: $tw-fnt-frm-fld-label-line-height;
18
+ color: $tw-clr-frm-fld-label;
19
+ margin-bottom: $tw-spc-base-xx-small;
20
+ display: block;
21
+ width: 100%;
22
+ max-width: 100%;
23
+ }
24
+
25
+ .textfield-help-text {
26
+ font-family: $tw-fnt-frm-fld-help-text-font-family;
27
+ font-size: $tw-fnt-frm-fld-help-text-font-size;
28
+ font-weight: $tw-fnt-frm-fld-help-text-font-weight;
29
+ line-height: $tw-fnt-frm-fld-help-text-line-height;
30
+ color: $tw-clr-frm-fld-help-text;
31
+ display: block;
32
+ width: 100%;
33
+ max-width: 100%;
34
+ margin-top: $tw-spc-base-xx-small;
35
+ }
36
+
37
+ textarea {
38
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
39
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
40
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
41
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
42
+ color: $tw-clr-frm-fld-value;
43
+ padding-top: 0;
44
+ padding-bottom: 0;
45
+ &::placeholder {
46
+ font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
47
+ font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
48
+ font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
49
+ line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
50
+ color: $tw-clr-base-gray-300;
51
+ }
52
+ &:focus-visible {
53
+ outline: none;
54
+ }
55
+ }
56
+
57
+ .textfield-value {
58
+ background-color: $tw-clr-frm-fld-text-input-fill;
59
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
60
+ padding: $tw-spc-base-x-small;
61
+ border-radius: $tw-rds-frm-fld-text-input;
62
+ border-width: $tw-sz-frm-fld-text-input-stroke;
63
+ width: 100%;
64
+ max-width: 100%;
65
+ display: flex;
66
+
67
+ &:hover {
68
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-hover;
69
+ }
70
+
71
+ &:active {
72
+ border: math.div($tw-sz-frm-fld-text-input-stroke-active, 2) solid $tw-clr-frm-fld-text-input-stroke-hover;
73
+ outline: math.div($tw-sz-frm-fld-text-input-stroke-active, 2) solid $tw-clr-frm-fld-text-input-stroke-hover;
74
+ }
75
+
76
+ input {
77
+ border: none;
78
+ width: 100%;
79
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
80
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
81
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
82
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
83
+ color: $tw-clr-frm-fld-value;
84
+ background: transparent;
85
+ padding-top: 0;
86
+ padding-bottom: 0;
87
+ &::placeholder {
88
+ font-family: $tw-fnt-frm-fld-text-placeholder-font-family;
89
+ font-size: $tw-fnt-frm-fld-text-placeholder-font-size;
90
+ font-weight: $tw-fnt-frm-fld-text-placeholder-font-weight;
91
+ line-height: $tw-fnt-frm-fld-text-placeholder-line-height;
92
+ color: $tw-clr-base-gray-300;
93
+ }
94
+ &:focus-visible {
95
+ outline: none;
96
+ }
97
+ }
98
+
99
+ &--display {
100
+ font-family: $tw-fnt-frm-fld-text-value-font-family;
101
+ font-size: $tw-fnt-frm-fld-text-value-font-size;
102
+ font-weight: $tw-fnt-frm-fld-text-value-font-weight;
103
+ line-height: $tw-fnt-frm-fld-text-value-line-height;
104
+ padding: 0;
105
+ margin: 0;
106
+ }
107
+
108
+ &--disabled {
109
+ opacity: $tw-opcty-semantic-off;
110
+ &:hover {
111
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
112
+ }
113
+
114
+ &:active {
115
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
116
+ }
117
+ }
118
+
119
+ &--icon-container {
120
+ background: none;
121
+ border: 0;
122
+ }
123
+
124
+ &--icon-right {
125
+ width: $tw-fnt-frm-fld-text-value-line-height;
126
+ height: $tw-fnt-frm-fld-text-value-line-height;
127
+ fill: $tw-clr-frm-fld-value;
128
+ }
129
+
130
+ &--icon-left {
131
+ width: $tw-fnt-frm-fld-text-value-line-height;
132
+ height: $tw-fnt-frm-fld-text-value-line-height;
133
+ fill: $tw-clr-frm-fld-value;
134
+ margin-right: $tw-spc-base-x-small;
135
+ }
136
+
137
+ &--error {
138
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-error;
139
+ background-color: $tw-clr-frm-fld-text-input-fill-error;
140
+
141
+ &:hover {
142
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-error;
143
+ }
144
+
145
+ &:active {
146
+ border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-frm-fld-text-input-stroke-error;
147
+ }
148
+ }
149
+
150
+ &--warning {
151
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-warning;
152
+ background-color: $tw-clr-frm-fld-text-input-fill-warning;
153
+
154
+ &:hover {
155
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke-warning;
156
+ }
157
+
158
+ &:active {
159
+ border: $tw-sz-frm-fld-text-input-stroke-active solid $tw-clr-frm-fld-text-input-stroke-warning;
160
+ }
161
+ }
162
+
163
+ &--readonly {
164
+ background-color: $tw-clr-frm-fld-text-input-fill-read-only;
165
+ &:hover {
166
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
167
+ }
168
+
169
+ &:active {
170
+ border: $tw-sz-frm-fld-text-input-stroke solid $tw-clr-frm-fld-text-input-stroke;
171
+ }
172
+ }
173
+ }
174
+
175
+ .textfield-error-text {
176
+ font-family: $tw-fnt-frm-fld-error-text-font-family;
177
+ font-size: $tw-fnt-frm-fld-error-text-font-size;
178
+ font-weight: $tw-fnt-frm-fld-error-text-font-weight;
179
+ line-height: $tw-fnt-frm-fld-error-text-line-height;
180
+ color: $tw-clr-frm-fld-error-text;
181
+ display: block;
182
+ width: 100%;
183
+ max-width: 100%;
184
+
185
+ &--icon {
186
+ fill: $tw-clr-frm-fld-error-text;
187
+ width: $tw-fnt-frm-fld-error-text-line-height;
188
+ height: $tw-fnt-frm-fld-error-text-line-height;
189
+ margin-right: $tw-spc-base-x-small;
190
+ }
191
+ }
192
+
193
+ .textfield-warning-text {
194
+ font-family: $tw-fnt-frm-fld-warning-text-font-family;
195
+ font-size: $tw-fnt-frm-fld-warning-text-font-size;
196
+ font-weight: $tw-fnt-frm-fld-warning-text-font-weight;
197
+ line-height: $tw-fnt-frm-fld-warning-text-line-height;
198
+ color: $tw-clr-frm-fld-warning-text;
199
+ display: block;
200
+ width: 100%;
201
+ max-width: 100%;
202
+
203
+ &--icon {
204
+ fill: $tw-clr-frm-fld-warning-text;
205
+ width: $tw-fnt-frm-fld-error-text-line-height;
206
+ height: $tw-fnt-frm-fld-error-text-line-height;
207
+ margin-right: $tw-spc-base-x-small;
208
+ }
209
+ }
210
+
211
+ .textfield-label-container {
212
+ display: flex;
213
+ width: 100%;
214
+ margin-top: $tw-spc-base-xx-small;
215
+ }
216
+ }
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { TopBarButton } from '.';
3
+ interface EnhancedTableToolbarProps {
4
+ numSelected: number;
5
+ topBarButtons?: TopBarButton[];
6
+ }
7
+ export default function EnhancedTableToolbar(props: EnhancedTableToolbarProps): JSX.Element | null;
8
+ export {};
9
+ //# sourceMappingURL=EnhancedTableToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnhancedTableToolbar.d.ts","sourceRoot":"","sources":["../../../src/components/table/EnhancedTableToolbar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,CAAC;AAiBjC,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAuBjG"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = EnhancedTableToolbar;
9
+
10
+ var _material = require("@mui/material");
11
+
12
+ var _Button = _interopRequireDefault(require("../Button/Button"));
13
+
14
+ var _styles = require("@mui/styles");
15
+
16
+ var _react = _interopRequireDefault(require("react"));
17
+
18
+ var styles = (0, _styles.makeStyles)(function (theme) {
19
+ return {
20
+ toolbar: {
21
+ background: '#EDF0F1'
22
+ },
23
+ flexText: {
24
+ flex: '1 1 100%'
25
+ },
26
+ buttonSpacing: {
27
+ marginLeft: theme.spacing(1)
28
+ }
29
+ };
30
+ });
31
+
32
+ function EnhancedTableToolbar(props) {
33
+ var numSelected = props.numSelected,
34
+ topBarButtons = props.topBarButtons;
35
+ var classes = styles();
36
+ return numSelected > 0 ? /*#__PURE__*/_react.default.createElement(_material.Toolbar, {
37
+ className: classes.toolbar
38
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
39
+ color: "inherit",
40
+ variant: "subtitle1",
41
+ component: "div",
42
+ className: classes.flexText
43
+ }, numSelected, " selected"), topBarButtons === null || topBarButtons === void 0 ? void 0 : topBarButtons.map(function (tbButton) {
44
+ return /*#__PURE__*/_react.default.createElement(_Button.default, {
45
+ className: classes.buttonSpacing,
46
+ key: tbButton.buttonText,
47
+ label: tbButton.buttonText,
48
+ priority: "secondary",
49
+ type: tbButton.buttonType,
50
+ onClick: tbButton.onButtonClick
51
+ });
52
+ })) : null;
53
+ }
@@ -0,0 +1,26 @@
1
+ import { ReactNode } from 'react';
2
+ import { RendererProps } from './types';
3
+ export declare type TableRowType = Record<string, any>;
4
+ export default function CellRenderer(props: RendererProps<TableRowType>): JSX.Element;
5
+ export declare const cellDateFormatter: (value?: string | undefined) => string | undefined;
6
+ export declare function CellDateRenderer({ id, value }: {
7
+ id: string;
8
+ value: string;
9
+ }): JSX.Element;
10
+ export declare function CellTextRenderer({ id, value, }: {
11
+ id: string;
12
+ value?: string | number | any[] | ReactNode;
13
+ }): JSX.Element;
14
+ export declare function CellBooleanRenderer({ id, value, }: {
15
+ id: string;
16
+ value?: string | number | any[] | ReactNode;
17
+ }): JSX.Element;
18
+ export declare function CellNotesRenderer({ id, value }: {
19
+ id: string;
20
+ value?: string;
21
+ }): JSX.Element;
22
+ export declare function CellEditRenderer({ id, onRowClick }: {
23
+ id: string;
24
+ onRowClick?: () => void;
25
+ }): JSX.Element;
26
+ //# sourceMappingURL=TableCellRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCellRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableCellRenderer.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgBxC,oBAAY,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,OAAO,CAcpF;AAED,eAAO,MAAM,iBAAiB,kCAAqB,MAAM,GAAG,SAI3D,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAU1F;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC;CAC7C,GAAG,GAAG,CAAC,OAAO,CAUd;AAED,wBAAgB,mBAAmB,CAAC,EAClC,EAAE,EACF,KAAK,GACN,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,GAAG,SAAS,CAAC;CAC7C,GAAG,GAAG,CAAC,OAAO,CAQd;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAQ5F;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,GAAG,CAAC,OAAO,CAwBzG"}
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = CellRenderer;
9
+ exports.CellDateRenderer = CellDateRenderer;
10
+ exports.CellTextRenderer = CellTextRenderer;
11
+ exports.CellBooleanRenderer = CellBooleanRenderer;
12
+ exports.CellNotesRenderer = CellNotesRenderer;
13
+ exports.CellEditRenderer = CellEditRenderer;
14
+ exports.cellDateFormatter = void 0;
15
+
16
+ var _iconsMaterial = require("@mui/icons-material");
17
+
18
+ var _material = require("@mui/material");
19
+
20
+ var _react = _interopRequireDefault(require("react"));
21
+
22
+ var _styles = require("@mui/styles");
23
+
24
+ var _utils = require("../../utils");
25
+
26
+ var useStyles = (0, _styles.makeStyles)(function (theme) {
27
+ return {
28
+ editIcon: {
29
+ marginLeft: theme.spacing(1)
30
+ },
31
+ textRoot: {
32
+ maxWidth: 400
33
+ },
34
+ date: {
35
+ whiteSpace: 'nowrap'
36
+ }
37
+ };
38
+ });
39
+
40
+ function CellRenderer(props) {
41
+ var column = props.column,
42
+ value = props.value,
43
+ onRowClick = props.onRowClick,
44
+ index = props.index;
45
+ var id = "row".concat(index, "-").concat(column.key);
46
+
47
+ if (column.type === 'date' && typeof value === 'string' && value) {
48
+ return /*#__PURE__*/_react.default.createElement(CellDateRenderer, {
49
+ id: id,
50
+ value: value
51
+ });
52
+ } else if (column.type === 'notes' && value && typeof value === 'string') {
53
+ return /*#__PURE__*/_react.default.createElement(CellNotesRenderer, {
54
+ id: id,
55
+ value: value
56
+ });
57
+ } else if (column.type === 'boolean') {
58
+ return /*#__PURE__*/_react.default.createElement(CellBooleanRenderer, {
59
+ id: id,
60
+ value: value
61
+ });
62
+ } else if (column.type === 'edit') {
63
+ return /*#__PURE__*/_react.default.createElement(CellEditRenderer, {
64
+ id: id,
65
+ onRowClick: onRowClick
66
+ });
67
+ }
68
+
69
+ return /*#__PURE__*/_react.default.createElement(CellTextRenderer, {
70
+ id: id,
71
+ value: value
72
+ });
73
+ }
74
+
75
+ var cellDateFormatter = function cellDateFormatter(value) {
76
+ if (value) {
77
+ return (0, _utils.getDateDisplayValue)(value);
78
+ }
79
+ };
80
+
81
+ exports.cellDateFormatter = cellDateFormatter;
82
+
83
+ function CellDateRenderer(_ref) {
84
+ var id = _ref.id,
85
+ value = _ref.value;
86
+ var classes = useStyles();
87
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
88
+ id: id,
89
+ align: "left",
90
+ className: classes.date
91
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
92
+ component: "p",
93
+ variant: "body1"
94
+ }, cellDateFormatter(value)));
95
+ }
96
+
97
+ function CellTextRenderer(_ref2) {
98
+ var id = _ref2.id,
99
+ value = _ref2.value;
100
+ var classes = useStyles();
101
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
102
+ id: id,
103
+ align: "left",
104
+ title: typeof value === 'string' ? value : ''
105
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
106
+ component: "p",
107
+ variant: "body1",
108
+ noWrap: true,
109
+ classes: {
110
+ root: classes.textRoot
111
+ }
112
+ }, value));
113
+ }
114
+
115
+ function CellBooleanRenderer(_ref3) {
116
+ var id = _ref3.id,
117
+ value = _ref3.value;
118
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
119
+ id: id,
120
+ align: "left"
121
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
122
+ component: "p",
123
+ variant: "body1"
124
+ }, value === 'true' ? 'YES' : 'NO'));
125
+ }
126
+
127
+ function CellNotesRenderer(_ref4) {
128
+ var id = _ref4.id,
129
+ value = _ref4.value;
130
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
131
+ id: id,
132
+ align: "left"
133
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
134
+ id: id,
135
+ component: "p",
136
+ variant: "body1"
137
+ }, value && value.length > 0 ? /*#__PURE__*/_react.default.createElement(_iconsMaterial.Notes, null) : ''));
138
+ }
139
+
140
+ function CellEditRenderer(_ref5) {
141
+ var id = _ref5.id,
142
+ onRowClick = _ref5.onRowClick;
143
+ var classes = useStyles();
144
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
145
+ id: id,
146
+ align: "left"
147
+ }, /*#__PURE__*/_react.default.createElement(_material.Link, {
148
+ id: "".concat(id, "-button"),
149
+ href: "#",
150
+ onClick: function onClick(event) {
151
+ (0, _utils.preventDefaultEvent)(event);
152
+
153
+ if (onRowClick) {
154
+ onRowClick();
155
+ }
156
+ }
157
+ }, /*#__PURE__*/_react.default.createElement(_material.Box, {
158
+ display: "flex"
159
+ }, /*#__PURE__*/_react.default.createElement(_material.Typography, {
160
+ component: "p",
161
+ variant: "body1"
162
+ }, "Edit"), /*#__PURE__*/_react.default.createElement(_iconsMaterial.Edit, {
163
+ fontSize: "small",
164
+ className: classes.editIcon
165
+ }))));
166
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Order } from './sort';
3
+ import { TableColumnType } from './types';
4
+ interface Props {
5
+ onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
6
+ order: Order;
7
+ orderBy?: string;
8
+ columns: TableColumnType[];
9
+ onReorderEnd?: ({ oldIndex, newIndex }: any) => void;
10
+ numSelected?: number;
11
+ rowCount?: number;
12
+ onSelectAllClick?: (event: React.ChangeEvent<HTMLInputElement>) => void;
13
+ }
14
+ export default function EnhancedTableHead(props: Props): JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=TableHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAK1C,UAAU,KAAK;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACzE;AAUD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAqCnE"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = EnhancedTableHead;
9
+
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
12
+ var _material = require("@mui/material");
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _sortable = require("@dnd-kit/sortable");
17
+
18
+ var _TableHeaderItem = _interopRequireDefault(require("./TableHeaderItem"));
19
+
20
+ function columnsToHeadCells(columns) {
21
+ return columns.map(function (c) {
22
+ return {
23
+ id: c.key,
24
+ disablePadding: false,
25
+ label: typeof c.name === 'string' ? c.name.toUpperCase() : c.name
26
+ };
27
+ });
28
+ }
29
+
30
+ function EnhancedTableHead(props) {
31
+ var order = props.order,
32
+ orderBy = props.orderBy,
33
+ onRequestSort = props.onRequestSort,
34
+ numSelected = props.numSelected,
35
+ rowCount = props.rowCount,
36
+ onSelectAllClick = props.onSelectAllClick;
37
+
38
+ var _React$useState = _react.default.useState(columnsToHeadCells(props.columns)),
39
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
40
+ headCells = _React$useState2[0],
41
+ setHeadCells = _React$useState2[1];
42
+
43
+ _react.default.useEffect(function () {
44
+ setHeadCells(columnsToHeadCells(props.columns));
45
+ }, [props.columns]);
46
+
47
+ return /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement(_material.TableRow, {
48
+ id: "table-header"
49
+ }, numSelected !== undefined && rowCount !== undefined && rowCount > 0 && onSelectAllClick && /*#__PURE__*/_react.default.createElement(_material.TableCell, {
50
+ padding: "checkbox"
51
+ }, /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
52
+ color: "primary",
53
+ indeterminate: numSelected > 0 && numSelected < rowCount,
54
+ checked: rowCount > 0 && numSelected === rowCount,
55
+ onChange: onSelectAllClick
56
+ })), /*#__PURE__*/_react.default.createElement(_sortable.SortableContext, {
57
+ items: headCells
58
+ }, headCells.map(function (headCell, i) {
59
+ return /*#__PURE__*/_react.default.createElement(_TableHeaderItem.default, {
60
+ headCell: headCell,
61
+ order: order,
62
+ orderBy: orderBy,
63
+ onRequestSort: onRequestSort,
64
+ i: i,
65
+ key: i
66
+ });
67
+ }))));
68
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { Order } from './sort';
3
+ interface HeadCell {
4
+ disablePadding: boolean;
5
+ id: string;
6
+ label: string | JSX.Element;
7
+ }
8
+ declare type Props = {
9
+ headCell: HeadCell;
10
+ order: Order;
11
+ orderBy?: string;
12
+ onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
13
+ i: number;
14
+ };
15
+ export default function TableHeaderItem(props: Props): JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=TableHeaderItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeaderItem.d.ts","sourceRoot":"","sources":["../../../src/components/table/TableHeaderItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,UAAU,QAAQ;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;CAC7B;AAED,aAAK,KAAK,GAAG;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA8CjE"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = TableHeaderItem;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _sortable = require("@dnd-kit/sortable");
13
+
14
+ var _utilities = require("@dnd-kit/utilities");
15
+
16
+ var _iconsMaterial = require("@mui/icons-material");
17
+
18
+ var _material = require("@mui/material");
19
+
20
+ var _styles = require("@mui/styles");
21
+
22
+ function TableHeaderItem(props) {
23
+ var headCell = props.headCell,
24
+ order = props.order,
25
+ orderBy = props.orderBy,
26
+ onRequestSort = props.onRequestSort,
27
+ i = props.i;
28
+
29
+ var _useSortable = (0, _sortable.useSortable)({
30
+ id: headCell.id
31
+ }),
32
+ attributes = _useSortable.attributes,
33
+ listeners = _useSortable.listeners,
34
+ setNodeRef = _useSortable.setNodeRef,
35
+ transform = _useSortable.transform,
36
+ transition = _useSortable.transition,
37
+ isDragging = _useSortable.isDragging;
38
+
39
+ var style = {
40
+ transform: _utilities.CSS.Transform.toString(transform),
41
+ transition: transition,
42
+ opacity: isDragging ? 0.5 : 1
43
+ };
44
+
45
+ var createSortHandler = function createSortHandler(property) {
46
+ return function (event) {
47
+ onRequestSort(event, property);
48
+ };
49
+ };
50
+
51
+ var dragIconStyles = (0, _styles.makeStyles)(function (theme) {
52
+ return {
53
+ root: {
54
+ marginLeft: -20,
55
+ color: theme.palette.common.white,
56
+ '&:hover': {
57
+ color: theme.palette.neutral[600]
58
+ }
59
+ }
60
+ };
61
+ });
62
+ return /*#__PURE__*/_react.default.createElement(_material.TableCell, {
63
+ ref: setNodeRef,
64
+ id: "table-header-".concat(headCell.id),
65
+ key: headCell.id,
66
+ align: "left",
67
+ padding: headCell.disablePadding ? 'none' : 'normal',
68
+ sortDirection: orderBy === headCell.id ? order : false,
69
+ style: style
70
+ }, headCell.label && /*#__PURE__*/_react.default.createElement(_material.TableSortLabel, {
71
+ active: orderBy === headCell.id,
72
+ direction: orderBy === headCell.id ? order : 'asc',
73
+ onClick: createSortHandler(headCell.id)
74
+ }, i > 0 && /*#__PURE__*/_react.default.createElement(_iconsMaterial.DragHandle, Object.assign({
75
+ classes: dragIconStyles()
76
+ }, attributes, listeners)), headCell.label));
77
+ }