@oliasoft-open-source/react-ui-library 4.12.3 → 4.12.4-beta-1

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 (401) hide show
  1. package/package.json +1 -1
  2. package/dist/404.html +0 -1
  3. package/dist/assets/bg-rock-D_kpA0sy.jpg +0 -0
  4. package/dist/assets/index-CPEB8SXA.css +0 -8859
  5. package/dist/assets/index-qClThfBd.js +0 -76217
  6. package/dist/assets/noto-sans-cyrillic-400-italic-BY-huaZy.woff +0 -0
  7. package/dist/assets/noto-sans-cyrillic-400-italic-V6PUkjg4.woff2 +0 -0
  8. package/dist/assets/noto-sans-cyrillic-400-normal--jh3sVvp.woff +0 -0
  9. package/dist/assets/noto-sans-cyrillic-400-normal-XY9qUppk.woff2 +0 -0
  10. package/dist/assets/noto-sans-cyrillic-700-italic-BsvNKSfQ.woff2 +0 -0
  11. package/dist/assets/noto-sans-cyrillic-700-italic-DSFghSMx.woff +0 -0
  12. package/dist/assets/noto-sans-cyrillic-700-normal-8ZAWbjJL.woff2 +0 -0
  13. package/dist/assets/noto-sans-cyrillic-700-normal-CTzjhoZt.woff +0 -0
  14. package/dist/assets/noto-sans-cyrillic-ext-400-italic-Bb5b47eb.woff +0 -0
  15. package/dist/assets/noto-sans-cyrillic-ext-400-italic-DGWPeY37.woff2 +0 -0
  16. package/dist/assets/noto-sans-cyrillic-ext-400-normal-CFQi7qvd.woff +0 -0
  17. package/dist/assets/noto-sans-cyrillic-ext-400-normal-CH_iUxq2.woff2 +0 -0
  18. package/dist/assets/noto-sans-cyrillic-ext-700-italic-BdqKfCVQ.woff2 +0 -0
  19. package/dist/assets/noto-sans-cyrillic-ext-700-italic-C55zR5rk.woff +0 -0
  20. package/dist/assets/noto-sans-cyrillic-ext-700-normal-B5dGcPIT.woff +0 -0
  21. package/dist/assets/noto-sans-cyrillic-ext-700-normal-CojAy5w4.woff2 +0 -0
  22. package/dist/assets/noto-sans-devanagari-400-italic-KeY3OvDe.woff +0 -0
  23. package/dist/assets/noto-sans-devanagari-400-italic-Lk_flmKd.woff2 +0 -0
  24. package/dist/assets/noto-sans-devanagari-400-normal-BV8n3Zrw.woff2 +0 -0
  25. package/dist/assets/noto-sans-devanagari-400-normal-Da_uNpmI.woff +0 -0
  26. package/dist/assets/noto-sans-devanagari-700-italic-DX_Ben-x.woff2 +0 -0
  27. package/dist/assets/noto-sans-devanagari-700-italic-Df3Sqs2H.woff +0 -0
  28. package/dist/assets/noto-sans-devanagari-700-normal-C2VYeOxD.woff +0 -0
  29. package/dist/assets/noto-sans-devanagari-700-normal-C8e99gZj.woff2 +0 -0
  30. package/dist/assets/noto-sans-greek-400-italic-BXJxTOvj.woff +0 -0
  31. package/dist/assets/noto-sans-greek-400-italic-DHwB0AdM.woff2 +0 -0
  32. package/dist/assets/noto-sans-greek-400-normal-BroOW-sQ.woff +0 -0
  33. package/dist/assets/noto-sans-greek-400-normal-CPTbu1sO.woff2 +0 -0
  34. package/dist/assets/noto-sans-greek-700-italic-CfolioWa.woff2 +0 -0
  35. package/dist/assets/noto-sans-greek-700-italic-DBCdhGrj.woff +0 -0
  36. package/dist/assets/noto-sans-greek-700-normal-BVjVfDKs.woff +0 -0
  37. package/dist/assets/noto-sans-greek-700-normal-P_B9BfF7.woff2 +0 -0
  38. package/dist/assets/noto-sans-greek-ext-400-italic-9zOpfpOs.woff2 +0 -0
  39. package/dist/assets/noto-sans-greek-ext-400-italic-D2WbBWVW.woff +0 -0
  40. package/dist/assets/noto-sans-greek-ext-400-normal-D73iK5X1.woff2 +0 -0
  41. package/dist/assets/noto-sans-greek-ext-400-normal-DWouWyWY.woff +0 -0
  42. package/dist/assets/noto-sans-greek-ext-700-italic-C5zCcdM3.woff2 +0 -0
  43. package/dist/assets/noto-sans-greek-ext-700-italic-YPo3ecki.woff +0 -0
  44. package/dist/assets/noto-sans-greek-ext-700-normal-BJpqEDTw.woff +0 -0
  45. package/dist/assets/noto-sans-greek-ext-700-normal-ZrWkOZr4.woff2 +0 -0
  46. package/dist/assets/noto-sans-latin-400-italic-BT87CHj2.woff +0 -0
  47. package/dist/assets/noto-sans-latin-400-italic-NApRWGLz.woff2 +0 -0
  48. package/dist/assets/noto-sans-latin-400-normal-CF_EggQ_.woff2 +0 -0
  49. package/dist/assets/noto-sans-latin-400-normal-DMz6UGTQ.woff +0 -0
  50. package/dist/assets/noto-sans-latin-700-italic-Cw3cBBZk.woff2 +0 -0
  51. package/dist/assets/noto-sans-latin-700-italic-qe_3Da_h.woff +0 -0
  52. package/dist/assets/noto-sans-latin-700-normal-CkyHDghY.woff +0 -0
  53. package/dist/assets/noto-sans-latin-700-normal-DwlQfr5s.woff2 +0 -0
  54. package/dist/assets/noto-sans-latin-ext-400-italic-BOMiliBU.woff +0 -0
  55. package/dist/assets/noto-sans-latin-ext-400-italic-UXQeYjoB.woff2 +0 -0
  56. package/dist/assets/noto-sans-latin-ext-400-normal-BIBIZdeZ.woff2 +0 -0
  57. package/dist/assets/noto-sans-latin-ext-400-normal-vP3vnBxr.woff +0 -0
  58. package/dist/assets/noto-sans-latin-ext-700-italic-o2AF7PF_.woff2 +0 -0
  59. package/dist/assets/noto-sans-latin-ext-700-italic-zILg070W.woff +0 -0
  60. package/dist/assets/noto-sans-latin-ext-700-normal-BInqjRdw.woff +0 -0
  61. package/dist/assets/noto-sans-latin-ext-700-normal-BS3CI2D1.woff2 +0 -0
  62. package/dist/assets/noto-sans-vietnamese-400-italic-CDqW7NCu.woff2 +0 -0
  63. package/dist/assets/noto-sans-vietnamese-400-italic-DJmGvf9Z.woff +0 -0
  64. package/dist/assets/noto-sans-vietnamese-400-normal-DziUSn_1.woff +0 -0
  65. package/dist/assets/noto-sans-vietnamese-400-normal-l431O8bE.woff2 +0 -0
  66. package/dist/assets/noto-sans-vietnamese-700-italic-D0f5b0SE.woff +0 -0
  67. package/dist/assets/noto-sans-vietnamese-700-italic-GQhDhRZX.woff2 +0 -0
  68. package/dist/assets/noto-sans-vietnamese-700-normal-Dp2_pAUa.woff +0 -0
  69. package/dist/assets/noto-sans-vietnamese-700-normal-RhAWG0gK.woff2 +0 -0
  70. package/dist/index.html +0 -1
  71. package/dist/storybook/assets/Color-KGDBMAHA-8cfDWfgV.js +0 -1
  72. package/dist/storybook/assets/DocsRenderer-PKQXORMH-CVj7TkuP.js +0 -1
  73. package/dist/storybook/assets/accordion-BiuI_LCA.js +0 -1
  74. package/dist/storybook/assets/accordion-C3DU7hG7.css +0 -1
  75. package/dist/storybook/assets/accordion-DhEg2ksb.css +0 -1
  76. package/dist/storybook/assets/accordion.stories-CrmHu75y.js +0 -170
  77. package/dist/storybook/assets/actions-Bax0KeqM.js +0 -39
  78. package/dist/storybook/assets/actions-D8UgHts6.css +0 -1
  79. package/dist/storybook/assets/actions.stories-BnPZKqOJ.js +0 -1
  80. package/dist/storybook/assets/afe.stories-C9XjJj62.js +0 -88
  81. package/dist/storybook/assets/assertThisInitialized-B9jnkVVz.js +0 -1
  82. package/dist/storybook/assets/badge-BiaoqO6w.css +0 -1
  83. package/dist/storybook/assets/badge-CLQ59MDF.js +0 -1
  84. package/dist/storybook/assets/badge.stories-DA_eeQyi.js +0 -1
  85. package/dist/storybook/assets/bg-rock-D_kpA0sy.jpg +0 -0
  86. package/dist/storybook/assets/blowout.stories-DH-sYHgB.js +0 -40
  87. package/dist/storybook/assets/breadcrumb-DMx-Mu4J.css +0 -1
  88. package/dist/storybook/assets/breadcrumb.stories-CJArS18Q.js +0 -1
  89. package/dist/storybook/assets/button-Cbv7WK6k.js +0 -1
  90. package/dist/storybook/assets/button-DtgxLQCF.css +0 -1
  91. package/dist/storybook/assets/button-group-0hjBV4tw.css +0 -1
  92. package/dist/storybook/assets/button-group-D2fGP_bX.js +0 -1
  93. package/dist/storybook/assets/button-group.stories-BETADGti.js +0 -71
  94. package/dist/storybook/assets/button.stories-C03VvX8K.js +0 -80
  95. package/dist/storybook/assets/buttons-and-links-DUNnvnXk.js +0 -14
  96. package/dist/storybook/assets/card-EcjmryU9.js +0 -1
  97. package/dist/storybook/assets/card-VFDFIKp2.css +0 -1
  98. package/dist/storybook/assets/card.stories-CsTB0DuM.js +0 -1
  99. package/dist/storybook/assets/casing-loads.stories-Buy0-e_n.js +0 -209
  100. package/dist/storybook/assets/cell.stories-CPNfDo9l.js +0 -245
  101. package/dist/storybook/assets/check-box-CV-zd_I_.css +0 -1
  102. package/dist/storybook/assets/check-box-DPLaOkRR.js +0 -13
  103. package/dist/storybook/assets/check-box.stories-BJ0ShmeC.js +0 -97
  104. package/dist/storybook/assets/check-box.test-case.stories-CzuYZkUh.js +0 -30
  105. package/dist/storybook/assets/chunk-HLWAVYOI-C49c1Yvv.js +0 -2
  106. package/dist/storybook/assets/color-CuU_llEh.js +0 -25
  107. package/dist/storybook/assets/column.stories-DDTHFELF.js +0 -88
  108. package/dist/storybook/assets/common-types-Sih75Sav.js +0 -1
  109. package/dist/storybook/assets/dialog-CBMZnjYb.css +0 -1
  110. package/dist/storybook/assets/dialog-DkpQscuI.js +0 -1
  111. package/dist/storybook/assets/disabled-context-rmpd7YJS.js +0 -1
  112. package/dist/storybook/assets/divider-DY9nJ_7N.js +0 -1
  113. package/dist/storybook/assets/divider-wQx_bznd.css +0 -1
  114. package/dist/storybook/assets/divider.stories-Dd-yyGrX.js +0 -1
  115. package/dist/storybook/assets/drawer-BVc1xI9q.css +0 -1
  116. package/dist/storybook/assets/drawer-DaQ1xGjV.js +0 -3
  117. package/dist/storybook/assets/drawer.stories-C08XBVTq.js +0 -113
  118. package/dist/storybook/assets/empty-L0EXybeR.css +0 -1
  119. package/dist/storybook/assets/empty.stories-L7LSMcLe.js +0 -1
  120. package/dist/storybook/assets/entry-preview-CHonU0lQ.js +0 -1
  121. package/dist/storybook/assets/entry-preview-docs-DUYczTxA.js +0 -54
  122. package/dist/storybook/assets/enum-Bnn40S8Q.js +0 -1
  123. package/dist/storybook/assets/field-CNDCZ5UR.css +0 -1
  124. package/dist/storybook/assets/field-HrLaMLbx.js +0 -7
  125. package/dist/storybook/assets/field.stories-CYpQ669-.js +0 -49
  126. package/dist/storybook/assets/file-button.stories-CRaTdLfv.js +0 -22
  127. package/dist/storybook/assets/file-input-b95Ui6h6.css +0 -1
  128. package/dist/storybook/assets/file-input-yalPf7-m.js +0 -13
  129. package/dist/storybook/assets/file-input.stories-DMTQqAF8.js +0 -66
  130. package/dist/storybook/assets/flex-EllkLxgO.js +0 -1
  131. package/dist/storybook/assets/flex.stories-CLwPyEMp.js +0 -15
  132. package/dist/storybook/assets/footer.stories-DniqHrTZ.js +0 -3
  133. package/dist/storybook/assets/form-row-BYz5u-Vr.css +0 -1
  134. package/dist/storybook/assets/form-row-CM112EYF.js +0 -1
  135. package/dist/storybook/assets/form.stories-Cr5Pz40F.js +0 -49
  136. package/dist/storybook/assets/formation.stories-C4Kugh7C.js +0 -74
  137. package/dist/storybook/assets/grid-DRkC-bt8.js +0 -15
  138. package/dist/storybook/assets/grid.stories-DqjhHHwX.js +0 -13
  139. package/dist/storybook/assets/heading-CRNoBc7q.js +0 -1
  140. package/dist/storybook/assets/heading-DMYPCDVj.css +0 -1
  141. package/dist/storybook/assets/heading.stories-DahFxeiX.js +0 -15
  142. package/dist/storybook/assets/help-icon-Buhx5nl6.js +0 -1
  143. package/dist/storybook/assets/help-icon-DeweQs4N.css +0 -1
  144. package/dist/storybook/assets/help-icon.stories-DbmZ1fgP.js +0 -4
  145. package/dist/storybook/assets/helpers-JJxzGegQ.js +0 -1
  146. package/dist/storybook/assets/icon-BSFY3vDO.js +0 -8
  147. package/dist/storybook/assets/icon-CXtHvr8n.css +0 -1
  148. package/dist/storybook/assets/icon-custom-Xcl4YkWP.js +0 -1
  149. package/dist/storybook/assets/icon.stories-fnZUR-LK.js +0 -6
  150. package/dist/storybook/assets/iframe-BN-sM7va.js +0 -2
  151. package/dist/storybook/assets/immer.esm-BwVl9PS2.js +0 -1
  152. package/dist/storybook/assets/index-BEZ0hk8m.js +0 -1
  153. package/dist/storybook/assets/index-BI4_Bp97.js +0 -1
  154. package/dist/storybook/assets/index-BcNHZKhG.js +0 -1
  155. package/dist/storybook/assets/index-Bk2sglWO.js +0 -5
  156. package/dist/storybook/assets/index-C0x1JmaP.js +0 -14
  157. package/dist/storybook/assets/index-CEuq6vkz.js +0 -1
  158. package/dist/storybook/assets/index-CF7H4eMJ.js +0 -28
  159. package/dist/storybook/assets/index-CUZDtIZe.js +0 -23
  160. package/dist/storybook/assets/index-D6rZ4wEC.js +0 -13
  161. package/dist/storybook/assets/index-DMAnyMX5.js +0 -179
  162. package/dist/storybook/assets/index-DRSy5Ssd.js +0 -1
  163. package/dist/storybook/assets/index-DhsZuJvc.js +0 -12
  164. package/dist/storybook/assets/index-dlFP5Vuh.js +0 -574
  165. package/dist/storybook/assets/index.es-DazXb-ul.js +0 -79
  166. package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +0 -1
  167. package/dist/storybook/assets/initialize-context-Y03pJPr5.js +0 -1
  168. package/dist/storybook/assets/input-Db9WkmPP.js +0 -1
  169. package/dist/storybook/assets/input-Dz1ZZYN5.css +0 -1
  170. package/dist/storybook/assets/input-group-BaRSJAEN.js +0 -1
  171. package/dist/storybook/assets/input-group-C4Ph05Zr.css +0 -1
  172. package/dist/storybook/assets/input-group-addon-CKbTwfkc.css +0 -1
  173. package/dist/storybook/assets/input-group-addon-D68iUKV2.js +0 -1
  174. package/dist/storybook/assets/input-group.stories-BCajsqAk.js +0 -167
  175. package/dist/storybook/assets/input-validation-D_iNtfvz.js +0 -26
  176. package/dist/storybook/assets/input.stories-SJy3TKkD.js +0 -41
  177. package/dist/storybook/assets/inputs-BLstsfPQ.js +0 -62
  178. package/dist/storybook/assets/jsx-runtime-eps93zm2.js +0 -8
  179. package/dist/storybook/assets/label-BmwKJ2Mn.css +0 -1
  180. package/dist/storybook/assets/label-CqmyC9he.js +0 -7
  181. package/dist/storybook/assets/label.stories-C0AO5F1a.js +0 -11
  182. package/dist/storybook/assets/layout-forms-BLRQsBhL.js +0 -16
  183. package/dist/storybook/assets/layout-general-CxuvOgwW.js +0 -35
  184. package/dist/storybook/assets/list-By3wp5Wa.js +0 -13
  185. package/dist/storybook/assets/list.stories-BcDHHHYJ.js +0 -476
  186. package/dist/storybook/assets/list.stories-data-Doo2Rqun.js +0 -1
  187. package/dist/storybook/assets/loader-B4-2F7c_.css +0 -1
  188. package/dist/storybook/assets/loader-XHoVniao.js +0 -1
  189. package/dist/storybook/assets/loader.stories-Q0U2BqZX.js +0 -83
  190. package/dist/storybook/assets/lodash-c4VUpsOs.js +0 -27
  191. package/dist/storybook/assets/logo-BVP9045W.js +0 -1
  192. package/dist/storybook/assets/memoize-one.esm-CcMeOnPo.js +0 -1
  193. package/dist/storybook/assets/menu.stories-1I5AGGQx.js +0 -82
  194. package/dist/storybook/assets/menu.stories-data-CQ59XhzU.js +0 -1
  195. package/dist/storybook/assets/menu.test-case.stories-XN9XFV-D.js +0 -3
  196. package/dist/storybook/assets/message-BRyKdRaX.js +0 -1
  197. package/dist/storybook/assets/message-C2ZCkHX6.css +0 -1
  198. package/dist/storybook/assets/message.stories-bCqCYIuN.js +0 -341
  199. package/dist/storybook/assets/meta-content-ByVTG0hd.css +0 -1
  200. package/dist/storybook/assets/meta-content-DNgQbAW0.js +0 -9
  201. package/dist/storybook/assets/modal.stories-C2d-Em5V.js +0 -200
  202. package/dist/storybook/assets/modal.test-case.stories-Ci1WRYdo.js +0 -21
  203. package/dist/storybook/assets/noto-sans-cyrillic-400-italic-BY-huaZy.woff +0 -0
  204. package/dist/storybook/assets/noto-sans-cyrillic-400-italic-V6PUkjg4.woff2 +0 -0
  205. package/dist/storybook/assets/noto-sans-cyrillic-400-normal--jh3sVvp.woff +0 -0
  206. package/dist/storybook/assets/noto-sans-cyrillic-400-normal-XY9qUppk.woff2 +0 -0
  207. package/dist/storybook/assets/noto-sans-cyrillic-700-italic-BsvNKSfQ.woff2 +0 -0
  208. package/dist/storybook/assets/noto-sans-cyrillic-700-italic-DSFghSMx.woff +0 -0
  209. package/dist/storybook/assets/noto-sans-cyrillic-700-normal-8ZAWbjJL.woff2 +0 -0
  210. package/dist/storybook/assets/noto-sans-cyrillic-700-normal-CTzjhoZt.woff +0 -0
  211. package/dist/storybook/assets/noto-sans-cyrillic-ext-400-italic-Bb5b47eb.woff +0 -0
  212. package/dist/storybook/assets/noto-sans-cyrillic-ext-400-italic-DGWPeY37.woff2 +0 -0
  213. package/dist/storybook/assets/noto-sans-cyrillic-ext-400-normal-CFQi7qvd.woff +0 -0
  214. package/dist/storybook/assets/noto-sans-cyrillic-ext-400-normal-CH_iUxq2.woff2 +0 -0
  215. package/dist/storybook/assets/noto-sans-cyrillic-ext-700-italic-BdqKfCVQ.woff2 +0 -0
  216. package/dist/storybook/assets/noto-sans-cyrillic-ext-700-italic-C55zR5rk.woff +0 -0
  217. package/dist/storybook/assets/noto-sans-cyrillic-ext-700-normal-B5dGcPIT.woff +0 -0
  218. package/dist/storybook/assets/noto-sans-cyrillic-ext-700-normal-CojAy5w4.woff2 +0 -0
  219. package/dist/storybook/assets/noto-sans-devanagari-400-italic-KeY3OvDe.woff +0 -0
  220. package/dist/storybook/assets/noto-sans-devanagari-400-italic-Lk_flmKd.woff2 +0 -0
  221. package/dist/storybook/assets/noto-sans-devanagari-400-normal-BV8n3Zrw.woff2 +0 -0
  222. package/dist/storybook/assets/noto-sans-devanagari-400-normal-Da_uNpmI.woff +0 -0
  223. package/dist/storybook/assets/noto-sans-devanagari-700-italic-DX_Ben-x.woff2 +0 -0
  224. package/dist/storybook/assets/noto-sans-devanagari-700-italic-Df3Sqs2H.woff +0 -0
  225. package/dist/storybook/assets/noto-sans-devanagari-700-normal-C2VYeOxD.woff +0 -0
  226. package/dist/storybook/assets/noto-sans-devanagari-700-normal-C8e99gZj.woff2 +0 -0
  227. package/dist/storybook/assets/noto-sans-greek-400-italic-BXJxTOvj.woff +0 -0
  228. package/dist/storybook/assets/noto-sans-greek-400-italic-DHwB0AdM.woff2 +0 -0
  229. package/dist/storybook/assets/noto-sans-greek-400-normal-BroOW-sQ.woff +0 -0
  230. package/dist/storybook/assets/noto-sans-greek-400-normal-CPTbu1sO.woff2 +0 -0
  231. package/dist/storybook/assets/noto-sans-greek-700-italic-CfolioWa.woff2 +0 -0
  232. package/dist/storybook/assets/noto-sans-greek-700-italic-DBCdhGrj.woff +0 -0
  233. package/dist/storybook/assets/noto-sans-greek-700-normal-BVjVfDKs.woff +0 -0
  234. package/dist/storybook/assets/noto-sans-greek-700-normal-P_B9BfF7.woff2 +0 -0
  235. package/dist/storybook/assets/noto-sans-greek-ext-400-italic-9zOpfpOs.woff2 +0 -0
  236. package/dist/storybook/assets/noto-sans-greek-ext-400-italic-D2WbBWVW.woff +0 -0
  237. package/dist/storybook/assets/noto-sans-greek-ext-400-normal-D73iK5X1.woff2 +0 -0
  238. package/dist/storybook/assets/noto-sans-greek-ext-400-normal-DWouWyWY.woff +0 -0
  239. package/dist/storybook/assets/noto-sans-greek-ext-700-italic-C5zCcdM3.woff2 +0 -0
  240. package/dist/storybook/assets/noto-sans-greek-ext-700-italic-YPo3ecki.woff +0 -0
  241. package/dist/storybook/assets/noto-sans-greek-ext-700-normal-BJpqEDTw.woff +0 -0
  242. package/dist/storybook/assets/noto-sans-greek-ext-700-normal-ZrWkOZr4.woff2 +0 -0
  243. package/dist/storybook/assets/noto-sans-latin-400-italic-BT87CHj2.woff +0 -0
  244. package/dist/storybook/assets/noto-sans-latin-400-italic-NApRWGLz.woff2 +0 -0
  245. package/dist/storybook/assets/noto-sans-latin-400-normal-CF_EggQ_.woff2 +0 -0
  246. package/dist/storybook/assets/noto-sans-latin-400-normal-DMz6UGTQ.woff +0 -0
  247. package/dist/storybook/assets/noto-sans-latin-700-italic-Cw3cBBZk.woff2 +0 -0
  248. package/dist/storybook/assets/noto-sans-latin-700-italic-qe_3Da_h.woff +0 -0
  249. package/dist/storybook/assets/noto-sans-latin-700-normal-CkyHDghY.woff +0 -0
  250. package/dist/storybook/assets/noto-sans-latin-700-normal-DwlQfr5s.woff2 +0 -0
  251. package/dist/storybook/assets/noto-sans-latin-ext-400-italic-BOMiliBU.woff +0 -0
  252. package/dist/storybook/assets/noto-sans-latin-ext-400-italic-UXQeYjoB.woff2 +0 -0
  253. package/dist/storybook/assets/noto-sans-latin-ext-400-normal-BIBIZdeZ.woff2 +0 -0
  254. package/dist/storybook/assets/noto-sans-latin-ext-400-normal-vP3vnBxr.woff +0 -0
  255. package/dist/storybook/assets/noto-sans-latin-ext-700-italic-o2AF7PF_.woff2 +0 -0
  256. package/dist/storybook/assets/noto-sans-latin-ext-700-italic-zILg070W.woff +0 -0
  257. package/dist/storybook/assets/noto-sans-latin-ext-700-normal-BInqjRdw.woff +0 -0
  258. package/dist/storybook/assets/noto-sans-latin-ext-700-normal-BS3CI2D1.woff2 +0 -0
  259. package/dist/storybook/assets/noto-sans-vietnamese-400-italic-CDqW7NCu.woff2 +0 -0
  260. package/dist/storybook/assets/noto-sans-vietnamese-400-italic-DJmGvf9Z.woff +0 -0
  261. package/dist/storybook/assets/noto-sans-vietnamese-400-normal-DziUSn_1.woff +0 -0
  262. package/dist/storybook/assets/noto-sans-vietnamese-400-normal-l431O8bE.woff2 +0 -0
  263. package/dist/storybook/assets/noto-sans-vietnamese-700-italic-D0f5b0SE.woff +0 -0
  264. package/dist/storybook/assets/noto-sans-vietnamese-700-italic-GQhDhRZX.woff2 +0 -0
  265. package/dist/storybook/assets/noto-sans-vietnamese-700-normal-Dp2_pAUa.woff +0 -0
  266. package/dist/storybook/assets/noto-sans-vietnamese-700-normal-RhAWG0gK.woff2 +0 -0
  267. package/dist/storybook/assets/number-input-B3_gmeWr.js +0 -16
  268. package/dist/storybook/assets/number-input.stories-epjUq9ve.js +0 -89
  269. package/dist/storybook/assets/number-input.test-case.stories-DeEtalIU.js +0 -95
  270. package/dist/storybook/assets/objectSpread2-DW4nTBoq.js +0 -1
  271. package/dist/storybook/assets/objectWithoutPropertiesLoose-CAYKN5F1.js +0 -1
  272. package/dist/storybook/assets/option-dropdown-CqPYsFHP.css +0 -1
  273. package/dist/storybook/assets/option-dropdown.stories-CznUbXVi.js +0 -52
  274. package/dist/storybook/assets/padding-and-spacing-qL1P8fJl.js +0 -19
  275. package/dist/storybook/assets/page-7SSpdYhb.js +0 -1
  276. package/dist/storybook/assets/page-BnAFjzxf.css +0 -1
  277. package/dist/storybook/assets/page-DqJqTfkP.css +0 -1
  278. package/dist/storybook/assets/page.stories-DthnK8qb.js +0 -57
  279. package/dist/storybook/assets/pagination-CR1nxnnq.js +0 -1
  280. package/dist/storybook/assets/pagination-Dv2vKYwQ.css +0 -1
  281. package/dist/storybook/assets/pagination.stories-qXmBYwYc.js +0 -59
  282. package/dist/storybook/assets/pop-confirm-DX_o_X81.css +0 -1
  283. package/dist/storybook/assets/pop-confirm.stories-CHa0qUBe.js +0 -9
  284. package/dist/storybook/assets/popover-CSc-8-Dh.css +0 -1
  285. package/dist/storybook/assets/popover-C_2P8LFJ.js +0 -1
  286. package/dist/storybook/assets/popover.stories-DZTfimDf.js +0 -10
  287. package/dist/storybook/assets/portal-GQ0_cLB6.js +0 -1
  288. package/dist/storybook/assets/portal.stories-BvRfNPz3.js +0 -20
  289. package/dist/storybook/assets/preview-C_R8uZLy.js +0 -3
  290. package/dist/storybook/assets/preview-CsXFMCpR.js +0 -2
  291. package/dist/storybook/assets/preview-Ct5NkTJf.js +0 -1
  292. package/dist/storybook/assets/preview-DLBQXbKW.js +0 -1
  293. package/dist/storybook/assets/preview-DeFlgNaS.css +0 -1
  294. package/dist/storybook/assets/progress-bar-C_kV6r0Q.js +0 -1
  295. package/dist/storybook/assets/progress-bar-ztYhwUbl.css +0 -1
  296. package/dist/storybook/assets/progress-bar.stories-CpbgT43D.js +0 -1
  297. package/dist/storybook/assets/projects.stories-BPm6ucAe.js +0 -47
  298. package/dist/storybook/assets/radio-button-C4ljBRED.js +0 -13
  299. package/dist/storybook/assets/radio-button-DvubT0Gg.css +0 -1
  300. package/dist/storybook/assets/radio-button.stories-D1rWr6ms.js +0 -61
  301. package/dist/storybook/assets/radio-button.test-case.stories-DglmHlWs.js +0 -11
  302. package/dist/storybook/assets/react-16-DXAfArL2.js +0 -1
  303. package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +0 -8
  304. package/dist/storybook/assets/redux-tRgGMjwY.js +0 -1
  305. package/dist/storybook/assets/reservoirs.stories-r1Ip90kJ.js +0 -156
  306. package/dist/storybook/assets/rich-text-input-BJfL0Me_.css +0 -1
  307. package/dist/storybook/assets/rich-text-input.stories-DwaseXZv.js +0 -256
  308. package/dist/storybook/assets/row-Bmiy2Lh0.js +0 -39
  309. package/dist/storybook/assets/row-D-EMWFT6.css +0 -1
  310. package/dist/storybook/assets/row.stories-jKh8Ms1e.js +0 -130
  311. package/dist/storybook/assets/select-BmYXTl_0.css +0 -1
  312. package/dist/storybook/assets/select-Cwks-WA0.js +0 -61
  313. package/dist/storybook/assets/select.input-CJed_LLR.js +0 -1
  314. package/dist/storybook/assets/select.stories-DjGSNDXK.js +0 -498
  315. package/dist/storybook/assets/select.stories-data-DxgWKlU6.js +0 -1
  316. package/dist/storybook/assets/select.test-case.stories-CrXzt4qn.js +0 -82
  317. package/dist/storybook/assets/side-bar-fBbBqyAT.css +0 -1
  318. package/dist/storybook/assets/side-bar-wpFQ5NEE.js +0 -24
  319. package/dist/storybook/assets/side-bar.stories-LjClxJcG.js +0 -1
  320. package/dist/storybook/assets/site.stories-BnWmALGd.js +0 -166
  321. package/dist/storybook/assets/slider-DPdTVMP0.css +0 -1
  322. package/dist/storybook/assets/slider-DxaD8LU4.js +0 -27
  323. package/dist/storybook/assets/slider.stories-DuGie_AX.js +0 -134
  324. package/dist/storybook/assets/smart-upload-modal.stories-BlTSF64K.js +0 -25
  325. package/dist/storybook/assets/spacer-BWoNR27H.js +0 -1
  326. package/dist/storybook/assets/spacer.stories-BT2S6B0R.js +0 -1
  327. package/dist/storybook/assets/spinner-AWUe4xwQ.js +0 -1
  328. package/dist/storybook/assets/spinner-C07x-KQu.css +0 -1
  329. package/dist/storybook/assets/spinner.stories-DuQNhl1V.js +0 -26
  330. package/dist/storybook/assets/styled-components.browser.esm-BQ9GQzDc.js +0 -2
  331. package/dist/storybook/assets/table-BSABGfWm.js +0 -86
  332. package/dist/storybook/assets/table-BtBtDwPu.css +0 -1
  333. package/dist/storybook/assets/table.stories-CHwzAdud.js +0 -772
  334. package/dist/storybook/assets/table.stories-data-C7mC5R8Q.js +0 -1
  335. package/dist/storybook/assets/tabs-BoToLVEP.js +0 -13
  336. package/dist/storybook/assets/tabs-DnWs2PtA.css +0 -1
  337. package/dist/storybook/assets/tabs.stories-B52iEaHf.js +0 -30
  338. package/dist/storybook/assets/text-2O-HSG8g.css +0 -1
  339. package/dist/storybook/assets/text-B3-TSWok.js +0 -1
  340. package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +0 -14
  341. package/dist/storybook/assets/text.stories-B8L4FWPt.js +0 -1
  342. package/dist/storybook/assets/textarea-DflOOrxV.js +0 -13
  343. package/dist/storybook/assets/textarea-TqxidmV4.css +0 -1
  344. package/dist/storybook/assets/textarea.stories-CzsqRVpC.js +0 -9
  345. package/dist/storybook/assets/tiny-invariant-DqLgxztJ.js +0 -8
  346. package/dist/storybook/assets/title.stories-D0VjujmM.js +0 -37
  347. package/dist/storybook/assets/toaster-7wnI6hqB.js +0 -1
  348. package/dist/storybook/assets/toaster-DwLvOY18.css +0 -1
  349. package/dist/storybook/assets/toaster-O8ftrUAJ.js +0 -1
  350. package/dist/storybook/assets/toaster.stories-CdpwLBSo.js +0 -84
  351. package/dist/storybook/assets/toaster.test-case.stories-Cy3_Gvs_.js +0 -6
  352. package/dist/storybook/assets/toggle-BbFVf61v.js +0 -13
  353. package/dist/storybook/assets/toggle-yD7j1VSk.css +0 -1
  354. package/dist/storybook/assets/toggle.stories-BAislK3I.js +0 -106
  355. package/dist/storybook/assets/toggle.test-case.stories-CeUwdhGD.js +0 -36
  356. package/dist/storybook/assets/tooltip-1V7clEnw.js +0 -29
  357. package/dist/storybook/assets/tooltip-COvcX6J7.css +0 -1
  358. package/dist/storybook/assets/tooltip.stories-1YexWg6N.js +0 -17
  359. package/dist/storybook/assets/tooltip.test-case.stories-De9h8ThH.js +0 -5
  360. package/dist/storybook/assets/top-bar-Bjf6PQE1.js +0 -163
  361. package/dist/storybook/assets/top-bar-u7j8EgRd.css +0 -1
  362. package/dist/storybook/assets/top-bar.stories-1hZmlzDT.js +0 -21
  363. package/dist/storybook/assets/top-bar.testcase.stories-BsFYqaw6.js +0 -30
  364. package/dist/storybook/assets/tree-BTgu2lWb.css +0 -1
  365. package/dist/storybook/assets/tree.stories-NGZfmH_B.js +0 -181
  366. package/dist/storybook/assets/types-BmbYqTX_.js +0 -1
  367. package/dist/storybook/assets/types-Dx2TtIG9.js +0 -1
  368. package/dist/storybook/assets/unit-input-5P4Cogho.css +0 -1
  369. package/dist/storybook/assets/unit-input-DTOrVqdm.js +0 -5
  370. package/dist/storybook/assets/unit-input.stories-BhSBzB95.js +0 -198
  371. package/dist/storybook/assets/unit-input.test-case.stories-Dk5SRvMt.js +0 -215
  372. package/dist/storybook/assets/unit-table.stories-DwZVHcZo.js +0 -152
  373. package/dist/storybook/assets/unit-table.test-case.stories-C9Swzooe.js +0 -1
  374. package/dist/storybook/favicon.svg +0 -1
  375. package/dist/storybook/iframe.html +0 -639
  376. package/dist/storybook/index.html +0 -153
  377. package/dist/storybook/index.json +0 -1
  378. package/dist/storybook/nunito-sans-bold-italic.woff2 +0 -0
  379. package/dist/storybook/nunito-sans-bold.woff2 +0 -0
  380. package/dist/storybook/nunito-sans-italic.woff2 +0 -0
  381. package/dist/storybook/nunito-sans-regular.woff2 +0 -0
  382. package/dist/storybook/project.json +0 -1
  383. package/dist/storybook/sb-addons/actions-1/manager-bundle.js +0 -3
  384. package/dist/storybook/sb-addons/actions-1/manager-bundle.js.LEGAL.txt +0 -0
  385. package/dist/storybook/sb-addons/interactions-2/manager-bundle.js +0 -234
  386. package/dist/storybook/sb-addons/interactions-2/manager-bundle.js.LEGAL.txt +0 -0
  387. package/dist/storybook/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
  388. package/dist/storybook/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  389. package/dist/storybook/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +0 -5
  390. package/dist/storybook/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js.LEGAL.txt +0 -0
  391. package/dist/storybook/sb-common-assets/favicon.svg +0 -1
  392. package/dist/storybook/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  393. package/dist/storybook/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  394. package/dist/storybook/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  395. package/dist/storybook/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  396. package/dist/storybook/sb-manager/globals-module-info.js +0 -995
  397. package/dist/storybook/sb-manager/globals-runtime.js +0 -53525
  398. package/dist/storybook/sb-manager/globals.js +0 -48
  399. package/dist/storybook/sb-manager/runtime.js +0 -11884
  400. package/dist/storybook/sb-preview/globals.js +0 -33
  401. package/dist/storybook/sb-preview/runtime.js +0 -9485
@@ -1,772 +0,0 @@
1
- import{j as n}from"./jsx-runtime-eps93zm2.js";import{r as S}from"./index-DhsZuJvc.js";import{f as ne}from"./immer.esm-BwVl9PS2.js";import{l as Z}from"./lodash-c4VUpsOs.js";import{G as le}from"./grid-DRkC-bt8.js";import{T as W}from"./text-B3-TSWok.js";import{T as D}from"./table-BSABGfWm.js";import{C as dn}from"./card-EcjmryU9.js";import{I as se}from"./input-Db9WkmPP.js";import{F as oe}from"./field-HrLaMLbx.js";import{H as un}from"./heading-CRNoBc7q.js";import{t as ae,x as pn,y as mn,z as gn,A as bn,B as hn,C as wn,D as yn}from"./table.stories-data-C7mC5R8Q.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./index-Bk2sglWO.js";import"./index.es-DazXb-ul.js";import"./inheritsLoose-DP0QEDDI.js";import"./redux-tRgGMjwY.js";import"./objectSpread2-DW4nTBoq.js";import"./tiny-invariant-DqLgxztJ.js";import"./index-CUZDtIZe.js";import"./memoize-one.esm-CcMeOnPo.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./disabled-context-rmpd7YJS.js";import"./button-Cbv7WK6k.js";import"./spinner-AWUe4xwQ.js";import"./icon-BSFY3vDO.js";import"./index-CEuq6vkz.js";import"./tooltip-1V7clEnw.js";import"./types-BmbYqTX_.js";import"./types-Dx2TtIG9.js";import"./badge-CLQ59MDF.js";import"./pagination-CR1nxnnq.js";import"./select-Cwks-WA0.js";import"./enum-Bnn40S8Q.js";import"./assertThisInitialized-B9jnkVVz.js";import"./select.input-CJed_LLR.js";import"./helpers-JJxzGegQ.js";import"./input-group-BaRSJAEN.js";import"./input-group-addon-D68iUKV2.js";import"./number-input-B3_gmeWr.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./check-box-DPLaOkRR.js";import"./help-icon-Buhx5nl6.js";import"./slider-DxaD8LU4.js";import"./index-BI4_Bp97.js";import"./popover-C_2P8LFJ.js";import"./label-CqmyC9he.js";import"./flex-EllkLxgO.js";const ht={title:"Basic/Table",component:D,args:{table:{...ae}}},A=h=>n.jsx(D,{...h}),te=A.bind({}),E=A.bind({});E.args={table:{...ae,fixedWidth:"400px"}};const L=A.bind({});L.args={table:{...ae,fixedWidth:"auto"}};const _=A.bind({});_.args={table:pn};_.parameters={docs:{description:{story:"Use sparingly when certain columns cannot be below a certain width. Unless the Table is auto width, set one column to `auto` to use remaining space."}}};const Q=A.bind({});Q.args={table:mn};const O=A.bind({});O.args={table:gn};O.parameters={docs:{description:{story:"This is only required when you need to override `columnAlignment` in header cells (i.e. they have different alignment)"}}};const G=A.bind({});G.args={table:bn};const N=A.bind({});N.args={table:hn};N.decorators=[h=>n.jsx("div",{style:{position:"absolute",inset:0,padding:"var(--padding)"},children:n.jsx(h,{})})];const U=A.bind({});U.args={table:wn};U.parameters={docs:{description:{story:"If a `maxHeight` is set, the table should only fill that height if it needs to."}}};const $=A.bind({});$.args={table:yn};const M=()=>n.jsx(dn,{heading:n.jsx(un,{children:"Card heading"}),padding:!1,children:n.jsx(D,{table:{...ae,bordered:!1}})});M.parameters={docs:{source:{type:"dynamic"}}};const q=()=>{const h=["Section","Width","Height"];let g=["","m","m"],o=[...Array(175).keys()].map((l,t)=>[t,t*2,t*2]);const x=(l,t,r)=>l==="m"&&t==="ft"?r*3.28084:l==="ft"&&t==="m"?r/3.28084:r,i=(l,t,r,c)=>{o[t][r]=l.target.value,c()},R=l=>{o=o.concat([["","",""]]),l()},k=(l,t)=>{o=o.filter((r,c)=>c!==l),t()},p=(l,t,r)=>{const c=g[t],b=l.target.value;g=g.map((y,s)=>s===t?b:y),o=o.map(y=>y.map((s,u)=>u===t?x(c,b,s):s)),r()},w=()=>{const l=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[t,r]=S.useState(10),[c,b]=S.useState(1),[y,s]=S.useState(!1),u=()=>{s(!y)},j=()=>{const e=Math.ceil(o.length/t);b(e)},T=(c-1)*t,a=t===0?o.length-1:T+t,m={headers:[{cells:h.map(e=>({value:e})),actions:[{primary:!0,label:"Add",icon:"add",onClick:()=>{R(u),j()}}]},{cells:[{},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[1],type:"Select",native:!0,onChange:e=>p(e,1,u)},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:g[2],type:"Select",native:!0,onChange:e=>p(e,2,u)}]}],rows:o.slice(T,a).map((e,d)=>{const I=T+d;return{cells:[...Array(3).keys()].map((P,v)=>({value:e[v],type:"Input",onChange:C=>i(C,I,v,u)})),actions:[{label:"Delete",icon:"minus",onClick:()=>k(I,u)}]}}),footer:{pagination:{rowCount:o.length,selectedPage:c,rowsPerPage:{onChange:e=>{const{value:d}=e.target;r(Number(d))},options:l,value:t},onSelectPage:e=>b(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(w,{})},K=()=>{const h=["Section","Width","Height"];let g=[...Array(20).keys()].map((x,i)=>({Section:Z.random(0,100),Width:Z.random(0,100),Height:Z.random(0,100)}));const o=()=>{const[x,i]=S.useState({Section:"up"}),R=(r,c)=>r.sort((b,y)=>Object.entries(c).map(([s,u])=>{switch(u){case"up":return b[s]-y[s];case"down":return y[s]-b[s];default:return 0}}).reduce((s,u)=>s||u,0)),k=(r,c,b)=>({dataSortCells:r.map(s=>{const u=Object.keys(c).includes(s)?c[s]:"",j=`${s[0].toUpperCase()}${s.slice(1)}`;return{key:s,value:j,hasSort:!0,sort:u,onSort:()=>{const T=u==="up"?"down":"up";b({[s]:T})}}})}),{dataSortCells:p}=k(h,x,i),l=[...R(g,x).map(r=>({cells:Object.entries(r).map(([b,y])=>({key:b,value:y,type:"Input",disabled:!0}))}))],t={headers:[{cells:p}],rows:l};return n.jsx(D,{table:t})};return n.jsx(o,{})},B=()=>{const h=["Section","Width","Height"];let g=[...Array(175).keys()].map((x,i)=>({Section:i,Width:i*2,Height:i*2}));const o=()=>{const x=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[i,R]=S.useState(10),[k,p]=S.useState(1),[w,l]=S.useState({}),[t,r]=S.useState({});S.useEffect(()=>{p(1)},[w,t]);const c=(k-1)*i,b=i===0?g.length-1:c+i,y=(e,d,I)=>e.filter(P=>Object.keys(d).every(v=>d[v]===""?!0:P[v].toString().includes(d[v]))).sort((P,v)=>Object.entries(I).map(([C,H])=>{switch(H){case"up":return P[C]-v[C];case"down":return v[C]-P[C];default:return 0}}).reduce((C,H)=>C||H,0)),s=(e,d,I,P,v)=>{const C=e.map(f=>{const V=Object.keys(P).includes(f)?P[f]:"",F=`${f[0].toUpperCase()}${f.slice(1)}`;return{key:f,value:F,hasSort:!0,sort:V,onSort:()=>{const ee=V===""?"up":V==="up"?"down":"";v({...P,[f]:ee})}}}),H=e.map(f=>{const V=Object.keys(d).includes(f)?d[f]:"";return{key:f,value:V,type:"Input",placeholder:"Filter",onChange:F=>I({...d,[f]:F.target.value})}});return{dataSortCells:C,dataFilterCells:H}},{dataSortCells:u,dataFilterCells:j}=s(h,w,l,t,r),T=y(g,w,t),a=[...T.slice(c,b).map(e=>({cells:Object.entries(e).map(([I,P])=>({key:I,value:P,type:"Input",disabled:!0}))}))],m={headers:[{cells:u},{cells:j}],rows:a,footer:{pagination:{rowCount:T.length,selectedPage:k,rowsPerPage:{onChange:e=>{const{value:d}=e.target;R(Number(d))},options:x,value:i},onSelectPage:e=>p(e),small:!0}}};return n.jsx(D,{table:m})};return n.jsx(o,{})},z=()=>{const h={tea:3.6,coffee:3.2,orange:4.1},g=[{label:"Tea",value:"tea"},{label:"Coffee",value:"coffee"},{label:"Orange juice",value:"orange"}],o={cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input"},{type:"Static"}]},x=[...Array(15).keys()].map((a,m)=>({cells:[{type:"Select",options:g,value:{value:"tea"}},{type:"Input",value:m+1},{type:"Static"}]})),[i,R]=S.useState(x),k=[{label:"10 / page",value:10},{label:"20 / page",value:20},{label:"50 / page",value:50},{label:"Show all",value:0}],[p,w]=S.useState(10),[l,t]=S.useState(1),r=(l-1)*p,c=p===0?i.length-1:r+p,b=({newRow:a}={})=>{const m=ne(i,e=>{e.push(a??o)});R(m)},y=({rowIndex:a})=>{const m=ne(i,e=>{delete e[a]}).filter(e=>e);R(m)},s=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[0].value.value=m});R(e)},u=({rowIndex:a,value:m})=>{const e=ne(i,d=>{d[a].cells[1].value=m});R(e)},j=({value:a})=>{const m=Number(a);return!Z.isNaN(m)&&Z.isInteger(m)&&m>0},T=i.slice(r,c).map((a,m)=>{const e=r+m;return i.length-1,{...a,cells:a==null?void 0:a.cells.map((d,I)=>{var f,V,F,ee,ie;const P=(F=(V=(f=a==null?void 0:a.cells)==null?void 0:f[0])==null?void 0:V.value)==null?void 0:F.value,v=Number((ie=(ee=a==null?void 0:a.cells)==null?void 0:ee[1])==null?void 0:ie.value),C=h==null?void 0:h[P],H=C&&j({value:v})?(C*v).toFixed(2):null;if(I===0)return{...d,onChange:re=>s({rowIndex:e,value:re.target.value})};if(I===1)return{...d,onChange:re=>u({rowIndex:e,value:re.target.value}),error:j({value:d.value})?null:"Must be valid whole number"};if(I===2)return{...d,value:H}}),actions:[{label:"Delete",icon:"minus",onClick:()=>y({rowIndex:e})}]}});return n.jsx(D,{table:{defaultEmptyRow:o,onAddRow:b,columnAlignment:["left","right","right"],headers:[{cells:[{value:"Drink"},{value:"Quantity"},{value:"Total Price (£)"}],actions:[{primary:!0,icon:"plus",label:"Add",onClick:()=>b()}]}],rows:T,footer:{pagination:{rowCount:i.length,selectedPage:l,rowsPerPage:{onChange:a=>{const{value:m}=a.target;w(Number(m))},options:k,value:p},onSelectPage:a=>t(a),small:!0}}}})},J=()=>{const h=["Section","Width","Height"];let g=Array.from(Array(10),(p,w)=>[w,w*2,w*2]);const[o,x]=S.useState({pastedValues:"",rowIndex:0,cellIndex:0}),i=(p,w,l,t)=>{g[w][l]=Number(p.target.value),t()},R=(p,w,l,t)=>{var c;let r=((c=p==null?void 0:p.clipboardData)==null?void 0:c.getData("text"))??"";return x({rowIndex:w,cellIndex:l,pastedValues:r}),t(),{pastedData:o}},k=()=>{const[p,w]=S.useState(!1),l=()=>{w(!p)},t={headers:[{cells:h.map(r=>({value:r}))}],rows:g.map((r,c)=>{const b=c;return{cells:[...Array(3).keys()].map((y,s)=>({value:r[s],type:"Input",onChange:u=>i(u,b,s,l),onPaste:u=>R(u,b,s,l)}))}})};return n.jsxs(n.Fragment,{children:[n.jsx(D,{table:t}),n.jsx(oe,{label:"Pasted Data",children:n.jsx(se,{value:o.pastedValues})}),n.jsx(oe,{label:"At Row",children:n.jsx(se,{value:o.rowIndex})}),n.jsx(oe,{label:"At Cell Index",children:n.jsx(se,{value:o.cellIndex})})]})};return n.jsx(k,{})},X=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],columnAlignment:[...Array(10)].map((g,o)=>"right"),headers:[{cells:[...Array(10)].map((g,o)=>({value:"Heading"}))},{cells:[...Array(10)].map((g,o)=>({options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],type:"Select",searchable:!1,value:{label:"m",value:"m"},autoLayerWidth:!0}))}],rows:[...Array(10)].map((g,o)=>({cells:[...Array(10)].map((x,i)=>({value:123.45})),actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here lorem ipsum"}),n.jsx(W,{children:"Label: 123.45m"}),n.jsx(W,{children:"Another label: 123.45m"}),n.jsx(W,{children:"Label: 123.45m"})]})}]}))};return n.jsx(D,{table:h})},Y=()=>{const h={fixedWidth:"auto",name:"Table title",actions:[{icon:"download",tooltip:"Download"}],headers:[{cells:[{value:"Label"},{value:"Value",colSpan:2}]}],rows:[{cells:[{value:"Country",style:{fontWeight:"bold"},width:"120px"},{value:"Norway",colSpan:2}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]},{cells:[{value:"Depth",style:{fontWeight:"bold"}},{value:123,width:"80px"},{options:[{label:"m",value:"m"},{label:"ft",value:"ft"}],value:{label:"m",value:"m"},type:"Select",width:"80px"}],actions:[{icon:"help",tooltip:n.jsxs(le,{children:[n.jsx(W,{bold:!0,children:"Title goes here"}),n.jsx(W,{children:"Details go here"})]})}]}]};return n.jsx(D,{table:h})};M.__docgenInfo={description:"",methods:[],displayName:"InCard"};q.__docgenInfo={description:"",methods:[],displayName:"Managed"};K.__docgenInfo={description:"",methods:[],displayName:"ManagedWithSort"};B.__docgenInfo={description:"",methods:[],displayName:"ManagedWithFilterAndMultipleSort"};z.__docgenInfo={description:"",methods:[],displayName:"AutoAddNewRow"};J.__docgenInfo={description:"",methods:[],displayName:"OnPasteCallback"};X.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInfoTooltips"};Y.__docgenInfo={description:"",methods:[],displayName:"ExampleTableWithInlineUnits"};var ce,de,ue;te.parameters={...te.parameters,docs:{...(ce=te.parameters)==null?void 0:ce.docs,source:{originalSource:`args => {
2
- return <Table
3
- // eslint-disable-next-line react/jsx-props-no-spreading
4
- {...args} />;
5
- }`,...(ue=(de=te.parameters)==null?void 0:de.docs)==null?void 0:ue.source}}};var pe,me,ge;E.parameters={...E.parameters,docs:{...(pe=E.parameters)==null?void 0:pe.docs,source:{originalSource:`args => {
6
- return <Table
7
- // eslint-disable-next-line react/jsx-props-no-spreading
8
- {...args} />;
9
- }`,...(ge=(me=E.parameters)==null?void 0:me.docs)==null?void 0:ge.source}}};var be,he,we;L.parameters={...L.parameters,docs:{...(be=L.parameters)==null?void 0:be.docs,source:{originalSource:`args => {
10
- return <Table
11
- // eslint-disable-next-line react/jsx-props-no-spreading
12
- {...args} />;
13
- }`,...(we=(he=L.parameters)==null?void 0:he.docs)==null?void 0:we.source}}};var ye,ve,fe;_.parameters={..._.parameters,docs:{...(ye=_.parameters)==null?void 0:ye.docs,source:{originalSource:`args => {
14
- return <Table
15
- // eslint-disable-next-line react/jsx-props-no-spreading
16
- {...args} />;
17
- }`,...(fe=(ve=_.parameters)==null?void 0:ve.docs)==null?void 0:fe.source}}};var Se,xe,Pe;Q.parameters={...Q.parameters,docs:{...(Se=Q.parameters)==null?void 0:Se.docs,source:{originalSource:`args => {
18
- return <Table
19
- // eslint-disable-next-line react/jsx-props-no-spreading
20
- {...args} />;
21
- }`,...(Pe=(xe=Q.parameters)==null?void 0:xe.docs)==null?void 0:Pe.source}}};var Ce,Re,Ie;O.parameters={...O.parameters,docs:{...(Ce=O.parameters)==null?void 0:Ce.docs,source:{originalSource:`args => {
22
- return <Table
23
- // eslint-disable-next-line react/jsx-props-no-spreading
24
- {...args} />;
25
- }`,...(Ie=(Re=O.parameters)==null?void 0:Re.docs)==null?void 0:Ie.source}}};var ke,Te,De;G.parameters={...G.parameters,docs:{...(ke=G.parameters)==null?void 0:ke.docs,source:{originalSource:`args => {
26
- return <Table
27
- // eslint-disable-next-line react/jsx-props-no-spreading
28
- {...args} />;
29
- }`,...(De=(Te=G.parameters)==null?void 0:Te.docs)==null?void 0:De.source}}};var Ae,je,Ve;N.parameters={...N.parameters,docs:{...(Ae=N.parameters)==null?void 0:Ae.docs,source:{originalSource:`args => {
30
- return <Table
31
- // eslint-disable-next-line react/jsx-props-no-spreading
32
- {...args} />;
33
- }`,...(Ve=(je=N.parameters)==null?void 0:je.docs)==null?void 0:Ve.source}}};var We,He,Fe;U.parameters={...U.parameters,docs:{...(We=U.parameters)==null?void 0:We.docs,source:{originalSource:`args => {
34
- return <Table
35
- // eslint-disable-next-line react/jsx-props-no-spreading
36
- {...args} />;
37
- }`,...(Fe=(He=U.parameters)==null?void 0:He.docs)==null?void 0:Fe.source}}};var _e,Oe,Ne;$.parameters={...$.parameters,docs:{...(_e=$.parameters)==null?void 0:_e.docs,source:{originalSource:`args => {
38
- return <Table
39
- // eslint-disable-next-line react/jsx-props-no-spreading
40
- {...args} />;
41
- }`,...(Ne=(Oe=$.parameters)==null?void 0:Oe.docs)==null?void 0:Ne.source}}};var Ue,Me,Ee;M.parameters={...M.parameters,docs:{...(Ue=M.parameters)==null?void 0:Ue.docs,source:{originalSource:`() => <Card heading={<Heading>Card heading</Heading>} padding={false}>
42
- <Table table={({
43
- ...storyData.table,
44
- bordered: false
45
- } as any)} />
46
- </Card>`,...(Ee=(Me=M.parameters)==null?void 0:Me.docs)==null?void 0:Ee.source}}};var Le,Qe,Ge;q.parameters={...q.parameters,docs:{...(Le=q.parameters)==null?void 0:Le.docs,source:{originalSource:`() => {
47
- /*
48
- Mock table data store (real apps should use Redux or similar)
49
- */
50
- const headings = ['Section', 'Width', 'Height'];
51
- let units = ['', 'm', 'm'];
52
- let data = [...Array(175).keys()].map((c, i) => [i, i * 2, i * 2]);
53
- /*
54
- Mock table data actions (real apps should use Redux or similar)
55
- */
56
- const convertUnit = (fromUnit: any, toUnit: any, value: any) => {
57
- return fromUnit === 'm' && toUnit === 'ft' ? value * 3.28084 : fromUnit === 'ft' && toUnit === 'm' ? value / 3.28084 : value;
58
- };
59
- const onChangeValue = (evt: any, rowIndex: any, cellIndex: any, render: any) => {
60
- data[rowIndex][cellIndex] = evt.target.value;
61
- render();
62
- };
63
- const onAddRow = (render: any) => {
64
- data = data.concat(([['', '', '']] as any));
65
- render();
66
- };
67
- const onDeleteRow = (rowIndex: any, render: any) => {
68
- data = data.filter((r, i) => i !== rowIndex);
69
- render();
70
- };
71
- const onChangeUnit = (evt: any, columnIndex: any, render: any) => {
72
- const fromUnit = units[columnIndex];
73
- const toUnit = evt.target.value;
74
- units = units.map((u, i) => i === columnIndex ? toUnit : u);
75
- data = data.map(r => r.map((c, i) => i === columnIndex ? convertUnit(fromUnit, toUnit, c) : c));
76
- render();
77
- };
78
- /*
79
- Container component manages state and configuration of table
80
- */
81
- const ManagedTable = () => {
82
- const rowsPerPageOptions = [{
83
- label: '10 / page',
84
- value: 10
85
- }, {
86
- label: '20 / page',
87
- value: 20
88
- }, {
89
- label: '50 / page',
90
- value: 50
91
- }, {
92
- label: 'Show all',
93
- value: 0
94
- }];
95
- const [rowsPerPage, setRowsPerPage] = useState(10);
96
- const [selectedPage, setSelectedPage] = useState(1);
97
- //hack to make Storybook re-render after event handlers alter data
98
- //only using this because example does not manage data with Redux / props
99
- const [toggle, forceRender] = useState(false);
100
- const render = () => {
101
- forceRender(!toggle);
102
- };
103
- const goToLastPage = () => {
104
- const lastPage = Math.ceil(data.length / rowsPerPage);
105
- setSelectedPage(lastPage);
106
- };
107
- const firstVisibleRow = (selectedPage - 1) * rowsPerPage;
108
- const lastVisibleRow = rowsPerPage === 0 ? data.length - 1 : firstVisibleRow + rowsPerPage;
109
- const table = {
110
- headers: [{
111
- cells: headings.map(h => ({
112
- value: h
113
- })),
114
- actions: [{
115
- primary: true,
116
- label: 'Add',
117
- icon: 'add',
118
- onClick: () => {
119
- onAddRow(render);
120
- goToLastPage();
121
- }
122
- }]
123
- }, {
124
- cells: [{}, {
125
- options: [{
126
- label: 'm',
127
- value: 'm'
128
- }, {
129
- label: 'ft',
130
- value: 'ft'
131
- }],
132
- value: units[1],
133
- type: 'Select',
134
- native: true,
135
- onChange: (evt: any) => onChangeUnit(evt, 1, render)
136
- }, {
137
- options: [{
138
- label: 'm',
139
- value: 'm'
140
- }, {
141
- label: 'ft',
142
- value: 'ft'
143
- }],
144
- value: units[2],
145
- type: 'Select',
146
- native: true,
147
- onChange: (evt: any) => onChangeUnit(evt, 2, render)
148
- }]
149
- }],
150
- rows: data.slice(firstVisibleRow, lastVisibleRow).map((row, i) => {
151
- const rowIndex = firstVisibleRow + i;
152
- return {
153
- cells: [...Array(3).keys()].map((c, i) => ({
154
- //https://stackoverflow.com/a/33352604
155
- value: row[i],
156
- type: 'Input',
157
- onChange: (evt: any) => onChangeValue(evt, rowIndex, i, render)
158
- })),
159
- actions: [{
160
- label: 'Delete',
161
- icon: 'minus',
162
- onClick: () => onDeleteRow(rowIndex, render)
163
- }]
164
- };
165
- }),
166
- footer: {
167
- pagination: {
168
- rowCount: data.length,
169
- selectedPage,
170
- rowsPerPage: {
171
- onChange: (evt: any) => {
172
- const {
173
- value
174
- } = evt.target;
175
- setRowsPerPage(Number(value));
176
- },
177
- options: rowsPerPageOptions,
178
- value: rowsPerPage
179
- },
180
- onSelectPage: (evt: any) => setSelectedPage(evt),
181
- small: true
182
- }
183
- }
184
- };
185
- return <Table table={(table as any)} />;
186
- };
187
- return <ManagedTable />;
188
- }`,...(Ge=(Qe=q.parameters)==null?void 0:Qe.docs)==null?void 0:Ge.source}}};var $e,qe,Ke;K.parameters={...K.parameters,docs:{...($e=K.parameters)==null?void 0:$e.docs,source:{originalSource:`() => {
189
- /*
190
- Mock table data store (real apps should use Redux or similar)
191
- */
192
- const headings = ['Section', 'Width', 'Height'];
193
- let keyedData = [...Array(20).keys()].map((_c, i) => ({
194
- Section: random(0, 100),
195
- Width: random(0, 100),
196
- Height: random(0, 100)
197
- }));
198
- /*
199
- Container component manages state and configuration of table
200
- */
201
- const TableWithSort: StoryFn<any> = () => {
202
- const [sort, setSort] = useState({
203
- Section: 'up'
204
- });
205
- const sortDataRows = (dataRows: any, sort: any) => dataRows.sort((a: any, b: any) => Object.entries(sort).map(([key, value]) => {
206
- switch (value) {
207
- case 'up':
208
- {
209
- return a[key] - b[key];
210
- }
211
- case 'down':
212
- {
213
- return b[key] - a[key];
214
- }
215
- default:
216
- return 0;
217
- }
218
- }).reduce((a, acc) => a || acc, 0));
219
- const dataHeaders = (dataRowsKeys: any, sort: any, setSort: any) => {
220
- const dataSortCells = dataRowsKeys.map((key: any) => {
221
- const sortDirection = Object.keys(sort).includes(key) ? sort[key] : '';
222
- const prettifyHeaderValue = \`\${key[0].toUpperCase()}\${key.slice(1)}\`;
223
- return {
224
- key,
225
- value: prettifyHeaderValue,
226
- hasSort: true,
227
- sort: sortDirection,
228
- onSort: () => {
229
- const newSortDirection = sortDirection === 'up' ? 'down' : 'up';
230
- setSort({
231
- [key]: newSortDirection
232
- });
233
- }
234
- };
235
- });
236
- return {
237
- dataSortCells
238
- };
239
- };
240
- const {
241
- dataSortCells
242
- } = dataHeaders(headings, sort, setSort);
243
- const sortedData = sortDataRows(keyedData, sort);
244
- const dataRows = [...sortedData.map((dataRow: any) => {
245
- const rowsCells = Object.entries(dataRow).map(([key, value]) => ({
246
- key,
247
- value,
248
- type: 'Input',
249
- disabled: true
250
- }));
251
- return {
252
- cells: rowsCells
253
- };
254
- })];
255
- const table = {
256
- headers: [{
257
- cells: dataSortCells
258
- }],
259
- rows: dataRows
260
- };
261
- return <Table table={(table as any)} />;
262
- };
263
- return <TableWithSort />;
264
- }`,...(Ke=(qe=K.parameters)==null?void 0:qe.docs)==null?void 0:Ke.source}}};var Be,ze,Je;B.parameters={...B.parameters,docs:{...(Be=B.parameters)==null?void 0:Be.docs,source:{originalSource:`() => {
265
- /*
266
- Mock table data store (real apps should use Redux or similar)
267
- */
268
- const headings = ['Section', 'Width', 'Height'];
269
- let keyedData = [...Array(175).keys()].map((_c, i) => ({
270
- Section: i,
271
- Width: i * 2,
272
- Height: i * 2
273
- }));
274
- /*
275
- Container component manages state and configuration of table
276
- */
277
- const TableWithSortAndFilter: StoryFn<any> = () => {
278
- const rowsPerPageOptions = [{
279
- label: '10 / page',
280
- value: 10
281
- }, {
282
- label: '20 / page',
283
- value: 20
284
- }, {
285
- label: '50 / page',
286
- value: 50
287
- }, {
288
- label: 'Show all',
289
- value: 0
290
- }];
291
- const [rowsPerPage, setRowsPerPage] = useState(10);
292
- const [selectedPage, setSelectedPage] = useState(1);
293
- const [filters, setFilters] = useState({});
294
- const [sorts, setSorts] = useState({});
295
- useEffect(() => {
296
- setSelectedPage(1);
297
- }, [filters, sorts]);
298
- const firstVisibleRow = (selectedPage - 1) * rowsPerPage;
299
- const lastVisibleRow = rowsPerPage === 0 ? keyedData.length - 1 : firstVisibleRow + rowsPerPage;
300
- const filterAndSortDataRows = (dataRows: any, filters: any, sorts: any) => dataRows.filter((row: any) => Object.keys(filters).every(key => {
301
- return filters[key] === '' ? true : row[key].toString().includes(filters[key]);
302
- })).sort((a: any, b: any) => Object.entries(sorts).map(([key, value]) => {
303
- switch (value) {
304
- case 'up':
305
- {
306
- return a[key] - b[key];
307
- }
308
- case 'down':
309
- {
310
- return b[key] - a[key];
311
- }
312
- default:
313
- return 0;
314
- }
315
- }).reduce((a, acc) => a || acc, 0));
316
- const dataHeaders = (dataRowsKeys: any, filters: any, setFilters: any, sorts: any, setSorts: any) => {
317
- const dataSortCells = dataRowsKeys.map((key: any) => {
318
- const sort = Object.keys(sorts).includes(key) ? sorts[key] : '';
319
- const prettifyHeaderValue = \`\${key[0].toUpperCase()}\${key.slice(1)}\`;
320
- return {
321
- key,
322
- value: prettifyHeaderValue,
323
- hasSort: true,
324
- sort,
325
- onSort: () => {
326
- const newSort = sort === '' ? 'up' : sort === 'up' ? 'down' : '';
327
- setSorts({
328
- ...sorts,
329
- [key]: newSort
330
- });
331
- }
332
- };
333
- });
334
- const dataFilterCells = dataRowsKeys.map((key: any) => {
335
- const filterValue = Object.keys(filters).includes(key) ? filters[key] : '';
336
- return {
337
- key,
338
- value: filterValue,
339
- type: 'Input',
340
- placeholder: 'Filter',
341
- onChange: (ev: any) => setFilters({
342
- ...filters,
343
- [key]: ev.target.value
344
- })
345
- };
346
- });
347
- return {
348
- dataSortCells,
349
- dataFilterCells
350
- };
351
- };
352
- const {
353
- dataSortCells,
354
- dataFilterCells
355
- } = dataHeaders(headings, filters, setFilters, sorts, setSorts);
356
- const filteredAndSortedData = filterAndSortDataRows(keyedData, filters, sorts);
357
- const dataRows = [...filteredAndSortedData.slice(firstVisibleRow, lastVisibleRow).map((dataRow: any) => {
358
- const rowsCells = Object.entries(dataRow).map(([key, value]) => ({
359
- key,
360
- value,
361
- type: 'Input',
362
- disabled: true
363
- }));
364
- return {
365
- cells: rowsCells
366
- };
367
- })];
368
- const table = {
369
- headers: [{
370
- cells: dataSortCells
371
- }, {
372
- cells: dataFilterCells
373
- }],
374
- rows: dataRows,
375
- footer: {
376
- pagination: {
377
- rowCount: filteredAndSortedData.length,
378
- selectedPage,
379
- rowsPerPage: {
380
- onChange: (evt: any) => {
381
- const {
382
- value
383
- } = evt.target;
384
- setRowsPerPage(Number(value));
385
- },
386
- options: rowsPerPageOptions,
387
- value: rowsPerPage
388
- },
389
- onSelectPage: (evt: any) => setSelectedPage(evt),
390
- small: true
391
- }
392
- }
393
- };
394
- return <Table table={(table as any)} />;
395
- };
396
- return <TableWithSortAndFilter />;
397
- }`,...(Je=(ze=B.parameters)==null?void 0:ze.docs)==null?void 0:Je.source}}};var Xe,Ye,Ze;z.parameters={...z.parameters,docs:{...(Xe=z.parameters)==null?void 0:Xe.docs,source:{originalSource:`() => {
398
- const prices = {
399
- tea: 3.6,
400
- coffee: 3.2,
401
- orange: 4.1
402
- };
403
- const drinks = [{
404
- label: 'Tea',
405
- value: 'tea'
406
- }, {
407
- label: 'Coffee',
408
- value: 'coffee'
409
- }, {
410
- label: 'Orange juice',
411
- value: 'orange'
412
- }];
413
- const defaultEmptyRow = {
414
- cells: [{
415
- type: 'Select',
416
- options: drinks,
417
- value: {
418
- value: 'tea'
419
- }
420
- }, {
421
- type: 'Input'
422
- }, {
423
- type: 'Static'
424
- }]
425
- };
426
- const initialRows = [...Array(15).keys()].map((row, rowIndex) => ({
427
- cells: [{
428
- type: 'Select',
429
- options: drinks,
430
- value: {
431
- value: 'tea'
432
- }
433
- }, {
434
- type: 'Input',
435
- value: rowIndex + 1
436
- }, {
437
- type: 'Static'
438
- }]
439
- }));
440
- const [rows, setRows] = useState(initialRows);
441
- const rowsPerPageOptions = [{
442
- label: '10 / page',
443
- value: 10
444
- }, {
445
- label: '20 / page',
446
- value: 20
447
- }, {
448
- label: '50 / page',
449
- value: 50
450
- }, {
451
- label: 'Show all',
452
- value: 0
453
- }];
454
- const [rowsPerPage, setRowsPerPage] = useState(10);
455
- const [selectedPage, setSelectedPage] = useState(1);
456
- const firstVisibleRow = (selectedPage - 1) * rowsPerPage;
457
- const lastVisibleRow = rowsPerPage === 0 ? rows.length - 1 : firstVisibleRow + rowsPerPage;
458
- const onAddRow = ({
459
- newRow
460
- }: any = {}) => {
461
- const nextRows = produce(rows, draft => {
462
- draft.push(newRow ?? defaultEmptyRow);
463
- });
464
- setRows(nextRows);
465
- };
466
- const onDeleteRow = ({
467
- rowIndex
468
- }: any) => {
469
- const nextRows = produce(rows, draft => {
470
- delete draft[rowIndex];
471
- }).filter(r => r);
472
- setRows(nextRows);
473
- };
474
- const onChangeDrink = ({
475
- rowIndex,
476
- value
477
- }: any) => {
478
- const nextRows = produce(rows, draft => {
479
- // @ts-ignore: write explicit reason
480
- draft[rowIndex].cells[0].value.value = value;
481
- });
482
- setRows(nextRows);
483
- };
484
- const onChangeQuantity = ({
485
- rowIndex,
486
- value
487
- }: any) => {
488
- const nextRows = produce(rows, draft => {
489
- draft[rowIndex].cells[1].value = value;
490
- });
491
- setRows(nextRows);
492
- };
493
- const validQuantity = ({
494
- value
495
- }: any) => {
496
- const numericValue = Number(value);
497
- return !isNaN(numericValue) && isInteger(numericValue) && numericValue > 0;
498
- };
499
- const hydratedRows = rows.slice(firstVisibleRow, lastVisibleRow).map((row, i) => {
500
- const rowIndex = firstVisibleRow + i;
501
- const isLastRow = rowIndex === rows.length - 1;
502
- return {
503
- ...row,
504
- cells: row?.cells.map((cell, cellIndex) => {
505
- const drink = (row?.cells?.[0]?.value as any)?.value;
506
- const quantity = Number(row?.cells?.[1]?.value);
507
- const drinkPrice = (prices as any)?.[drink];
508
- const price = drinkPrice && validQuantity({
509
- value: quantity
510
- }) ? (drinkPrice * quantity).toFixed(2) : null;
511
- if (cellIndex === 0) {
512
- return {
513
- ...cell,
514
- onChange: (evt: any) => onChangeDrink({
515
- rowIndex,
516
- value: evt.target.value
517
- })
518
- };
519
- } else if (cellIndex === 1) {
520
- return {
521
- ...cell,
522
- onChange: (evt: any) => onChangeQuantity({
523
- rowIndex,
524
- value: evt.target.value
525
- }),
526
- error: !validQuantity({
527
- value: cell.value
528
- }) ? 'Must be valid whole number' : null
529
- };
530
- } else if (cellIndex === 2) {
531
- return {
532
- ...cell,
533
- value: price
534
- };
535
- }
536
- }),
537
- actions: [{
538
- label: 'Delete',
539
- icon: 'minus',
540
- onClick: () => onDeleteRow({
541
- rowIndex
542
- })
543
- }]
544
- };
545
- });
546
- return <Table table={({
547
- defaultEmptyRow,
548
- onAddRow,
549
- columnAlignment: ['left', 'right', 'right'],
550
- headers: [{
551
- cells: [{
552
- value: 'Drink'
553
- }, {
554
- value: 'Quantity'
555
- }, {
556
- value: 'Total Price (£)'
557
- }],
558
- actions: [{
559
- primary: true,
560
- icon: 'plus',
561
- label: 'Add',
562
- onClick: () => onAddRow()
563
- }]
564
- }],
565
- rows: (hydratedRows as any),
566
- footer: {
567
- pagination: {
568
- rowCount: rows.length,
569
- selectedPage,
570
- rowsPerPage: {
571
- onChange: (evt: any) => {
572
- const {
573
- value
574
- } = evt.target;
575
- setRowsPerPage(Number(value));
576
- },
577
- options: rowsPerPageOptions,
578
- value: rowsPerPage
579
- },
580
- onSelectPage: (evt: any) => setSelectedPage(evt),
581
- small: true
582
- }
583
- }
584
- } as any)} />;
585
- }`,...(Ze=(Ye=z.parameters)==null?void 0:Ye.docs)==null?void 0:Ze.source}}};var en,nn,tn;J.parameters={...J.parameters,docs:{...(en=J.parameters)==null?void 0:en.docs,source:{originalSource:`() => {
586
- const headings = ['Section', 'Width', 'Height'];
587
- let data = Array.from(Array(10), (_, i) => [i, i * 2, i * 2]);
588
- const [pastedData, setpastedData] = useState<PastedData>({
589
- pastedValues: '',
590
- rowIndex: 0,
591
- cellIndex: 0
592
- });
593
- /*
594
- Mock table data
595
- */
596
-
597
- const onChangeValue = (evt: ChangeEvent<HTMLInputElement>, rowIndex: number, cellIndex: number, render: TEmpty) => {
598
- data[rowIndex][cellIndex] = Number(evt.target.value);
599
- render();
600
- };
601
- const handleOnPaste = (evt: ClipboardEvent, rowIndex: number, cellIndex: number, render: TEmpty) => {
602
- let pastedValues = evt?.clipboardData?.getData('text') ?? '';
603
- setpastedData({
604
- rowIndex,
605
- cellIndex,
606
- pastedValues
607
- });
608
- render();
609
- return {
610
- pastedData
611
- };
612
- };
613
- /*
614
- Container component manages state and configuration of table
615
- */
616
- const CallbackCellTable = () => {
617
- //hack to make Storybook re-render after event handlers alter data
618
- //only using this because example does not manage data with Redux / props
619
- const [toggle, forceRender] = useState(false);
620
- const render = () => {
621
- forceRender(!toggle);
622
- };
623
- const table = {
624
- headers: [{
625
- cells: headings.map(h => ({
626
- value: h
627
- }))
628
- }],
629
- rows: data.map((row, i) => {
630
- const rowIndex = i;
631
- //row
632
- return {
633
- cells: [...Array(3).keys()].map((_, i) => ({
634
- //https://stackoverflow.com/a/33352604
635
- value: row[i],
636
- type: 'Input',
637
- onChange: (evt: ChangeEvent<HTMLInputElement>) => onChangeValue(evt, rowIndex, i, render),
638
- onPaste: (evt: ClipboardEvent) => handleOnPaste(evt, rowIndex, i, render)
639
- }))
640
- };
641
- })
642
- };
643
- return <>
644
- <Table table={table} />
645
- <Field label="Pasted Data">
646
- <Input value={pastedData.pastedValues} />
647
- </Field>
648
- <Field label="At Row">
649
- <Input value={pastedData.rowIndex} />
650
- </Field>
651
- <Field label="At Cell Index">
652
- <Input value={pastedData.cellIndex} />
653
- </Field>
654
- </>;
655
- };
656
- return <CallbackCellTable />;
657
- }`,...(tn=(nn=J.parameters)==null?void 0:nn.docs)==null?void 0:tn.source}}};var an,rn,sn;X.parameters={...X.parameters,docs:{...(an=X.parameters)==null?void 0:an.docs,source:{originalSource:`() => {
658
- const table = {
659
- fixedWidth: 'auto',
660
- name: 'Table title',
661
- actions: [{
662
- icon: 'download',
663
- tooltip: 'Download'
664
- }],
665
- columnAlignment: [...Array(10)].map((_, i) => 'right'),
666
- headers: [{
667
- cells: [...Array(10)].map((_, i) => ({
668
- value: 'Heading'
669
- }))
670
- }, {
671
- cells: [...Array(10)].map((_, i) => ({
672
- options: [{
673
- label: 'm',
674
- value: 'm'
675
- }, {
676
- label: 'ft',
677
- value: 'ft'
678
- }],
679
- type: 'Select',
680
- searchable: false,
681
- value: {
682
- label: 'm',
683
- value: 'm'
684
- },
685
- autoLayerWidth: true
686
- }))
687
- }],
688
- rows: [...Array(10)].map((_, i) => ({
689
- cells: [...Array(10)].map((_, i) => ({
690
- value: 123.45
691
- })),
692
- actions: [{
693
- icon: 'help',
694
- tooltip: <Grid>
695
- <Text bold>Title goes here lorem ipsum</Text>
696
- <Text>Label: 123.45m</Text>
697
- <Text>Another label: 123.45m</Text>
698
- <Text>Label: 123.45m</Text>
699
- </Grid>
700
- }]
701
- }))
702
- };
703
- return <Table table={table} />;
704
- }`,...(sn=(rn=X.parameters)==null?void 0:rn.docs)==null?void 0:sn.source}}};var on,ln,cn;Y.parameters={...Y.parameters,docs:{...(on=Y.parameters)==null?void 0:on.docs,source:{originalSource:`() => {
705
- const table = {
706
- fixedWidth: 'auto',
707
- name: 'Table title',
708
- actions: [{
709
- icon: 'download',
710
- tooltip: 'Download'
711
- }],
712
- headers: [{
713
- cells: [{
714
- value: 'Label'
715
- }, {
716
- value: 'Value',
717
- colSpan: 2
718
- }]
719
- }],
720
- rows: [{
721
- cells: [{
722
- value: 'Country',
723
- style: {
724
- fontWeight: 'bold'
725
- },
726
- width: '120px'
727
- }, {
728
- value: 'Norway',
729
- colSpan: 2
730
- }],
731
- actions: [{
732
- icon: 'help',
733
- tooltip: <Grid>
734
- <Text bold>Title goes here</Text>
735
- <Text>Details go here</Text>
736
- </Grid>
737
- }]
738
- }, {
739
- cells: [{
740
- value: 'Depth',
741
- style: {
742
- fontWeight: 'bold'
743
- }
744
- }, {
745
- value: 123,
746
- width: '80px'
747
- }, {
748
- options: [{
749
- label: 'm',
750
- value: 'm'
751
- }, {
752
- label: 'ft',
753
- value: 'ft'
754
- }],
755
- value: {
756
- label: 'm',
757
- value: 'm'
758
- },
759
- type: 'Select',
760
- width: '80px'
761
- }],
762
- actions: [{
763
- icon: 'help',
764
- tooltip: <Grid>
765
- <Text bold>Title goes here</Text>
766
- <Text>Details go here</Text>
767
- </Grid>
768
- }]
769
- }]
770
- };
771
- return <Table table={table} />;
772
- }`,...(cn=(ln=Y.parameters)==null?void 0:ln.docs)==null?void 0:cn.source}}};const wt=["Default","FixedWidth","AutoWidth","ColumnWidths","ColumnAlignment","ColumnHeaderAlignment","InfiniteScrollFixedHeight","InfiniteScrollFullHeight","InfiniteScrollShort","InfiniteScrollWithDragAndDrop","InCard","Managed","ManagedWithSort","ManagedWithFilterAndMultipleSort","AutoAddNewRow","OnPasteCallback","ExampleTableWithInfoTooltips","ExampleTableWithInlineUnits"];export{z as AutoAddNewRow,L as AutoWidth,Q as ColumnAlignment,O as ColumnHeaderAlignment,_ as ColumnWidths,te as Default,X as ExampleTableWithInfoTooltips,Y as ExampleTableWithInlineUnits,E as FixedWidth,M as InCard,G as InfiniteScrollFixedHeight,N as InfiniteScrollFullHeight,U as InfiniteScrollShort,$ as InfiniteScrollWithDragAndDrop,q as Managed,B as ManagedWithFilterAndMultipleSort,K as ManagedWithSort,J as OnPasteCallback,wt as __namedExportsOrder,ht as default};