@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.
- package/package.json +1 -1
- package/dist/404.html +0 -1
- package/dist/assets/bg-rock-D_kpA0sy.jpg +0 -0
- package/dist/assets/index-CPEB8SXA.css +0 -8859
- package/dist/assets/index-qClThfBd.js +0 -76217
- package/dist/assets/noto-sans-cyrillic-400-italic-BY-huaZy.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-400-italic-V6PUkjg4.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-400-normal--jh3sVvp.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-400-normal-XY9qUppk.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-700-italic-BsvNKSfQ.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-700-italic-DSFghSMx.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-700-normal-8ZAWbjJL.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-700-normal-CTzjhoZt.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-400-italic-Bb5b47eb.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-400-italic-DGWPeY37.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-400-normal-CFQi7qvd.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-400-normal-CH_iUxq2.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-700-italic-BdqKfCVQ.woff2 +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-700-italic-C55zR5rk.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-700-normal-B5dGcPIT.woff +0 -0
- package/dist/assets/noto-sans-cyrillic-ext-700-normal-CojAy5w4.woff2 +0 -0
- package/dist/assets/noto-sans-devanagari-400-italic-KeY3OvDe.woff +0 -0
- package/dist/assets/noto-sans-devanagari-400-italic-Lk_flmKd.woff2 +0 -0
- package/dist/assets/noto-sans-devanagari-400-normal-BV8n3Zrw.woff2 +0 -0
- package/dist/assets/noto-sans-devanagari-400-normal-Da_uNpmI.woff +0 -0
- package/dist/assets/noto-sans-devanagari-700-italic-DX_Ben-x.woff2 +0 -0
- package/dist/assets/noto-sans-devanagari-700-italic-Df3Sqs2H.woff +0 -0
- package/dist/assets/noto-sans-devanagari-700-normal-C2VYeOxD.woff +0 -0
- package/dist/assets/noto-sans-devanagari-700-normal-C8e99gZj.woff2 +0 -0
- package/dist/assets/noto-sans-greek-400-italic-BXJxTOvj.woff +0 -0
- package/dist/assets/noto-sans-greek-400-italic-DHwB0AdM.woff2 +0 -0
- package/dist/assets/noto-sans-greek-400-normal-BroOW-sQ.woff +0 -0
- package/dist/assets/noto-sans-greek-400-normal-CPTbu1sO.woff2 +0 -0
- package/dist/assets/noto-sans-greek-700-italic-CfolioWa.woff2 +0 -0
- package/dist/assets/noto-sans-greek-700-italic-DBCdhGrj.woff +0 -0
- package/dist/assets/noto-sans-greek-700-normal-BVjVfDKs.woff +0 -0
- package/dist/assets/noto-sans-greek-700-normal-P_B9BfF7.woff2 +0 -0
- package/dist/assets/noto-sans-greek-ext-400-italic-9zOpfpOs.woff2 +0 -0
- package/dist/assets/noto-sans-greek-ext-400-italic-D2WbBWVW.woff +0 -0
- package/dist/assets/noto-sans-greek-ext-400-normal-D73iK5X1.woff2 +0 -0
- package/dist/assets/noto-sans-greek-ext-400-normal-DWouWyWY.woff +0 -0
- package/dist/assets/noto-sans-greek-ext-700-italic-C5zCcdM3.woff2 +0 -0
- package/dist/assets/noto-sans-greek-ext-700-italic-YPo3ecki.woff +0 -0
- package/dist/assets/noto-sans-greek-ext-700-normal-BJpqEDTw.woff +0 -0
- package/dist/assets/noto-sans-greek-ext-700-normal-ZrWkOZr4.woff2 +0 -0
- package/dist/assets/noto-sans-latin-400-italic-BT87CHj2.woff +0 -0
- package/dist/assets/noto-sans-latin-400-italic-NApRWGLz.woff2 +0 -0
- package/dist/assets/noto-sans-latin-400-normal-CF_EggQ_.woff2 +0 -0
- package/dist/assets/noto-sans-latin-400-normal-DMz6UGTQ.woff +0 -0
- package/dist/assets/noto-sans-latin-700-italic-Cw3cBBZk.woff2 +0 -0
- package/dist/assets/noto-sans-latin-700-italic-qe_3Da_h.woff +0 -0
- package/dist/assets/noto-sans-latin-700-normal-CkyHDghY.woff +0 -0
- package/dist/assets/noto-sans-latin-700-normal-DwlQfr5s.woff2 +0 -0
- package/dist/assets/noto-sans-latin-ext-400-italic-BOMiliBU.woff +0 -0
- package/dist/assets/noto-sans-latin-ext-400-italic-UXQeYjoB.woff2 +0 -0
- package/dist/assets/noto-sans-latin-ext-400-normal-BIBIZdeZ.woff2 +0 -0
- package/dist/assets/noto-sans-latin-ext-400-normal-vP3vnBxr.woff +0 -0
- package/dist/assets/noto-sans-latin-ext-700-italic-o2AF7PF_.woff2 +0 -0
- package/dist/assets/noto-sans-latin-ext-700-italic-zILg070W.woff +0 -0
- package/dist/assets/noto-sans-latin-ext-700-normal-BInqjRdw.woff +0 -0
- package/dist/assets/noto-sans-latin-ext-700-normal-BS3CI2D1.woff2 +0 -0
- package/dist/assets/noto-sans-vietnamese-400-italic-CDqW7NCu.woff2 +0 -0
- package/dist/assets/noto-sans-vietnamese-400-italic-DJmGvf9Z.woff +0 -0
- package/dist/assets/noto-sans-vietnamese-400-normal-DziUSn_1.woff +0 -0
- package/dist/assets/noto-sans-vietnamese-400-normal-l431O8bE.woff2 +0 -0
- package/dist/assets/noto-sans-vietnamese-700-italic-D0f5b0SE.woff +0 -0
- package/dist/assets/noto-sans-vietnamese-700-italic-GQhDhRZX.woff2 +0 -0
- package/dist/assets/noto-sans-vietnamese-700-normal-Dp2_pAUa.woff +0 -0
- package/dist/assets/noto-sans-vietnamese-700-normal-RhAWG0gK.woff2 +0 -0
- package/dist/index.html +0 -1
- package/dist/storybook/assets/Color-KGDBMAHA-8cfDWfgV.js +0 -1
- package/dist/storybook/assets/DocsRenderer-PKQXORMH-CVj7TkuP.js +0 -1
- package/dist/storybook/assets/accordion-BiuI_LCA.js +0 -1
- package/dist/storybook/assets/accordion-C3DU7hG7.css +0 -1
- package/dist/storybook/assets/accordion-DhEg2ksb.css +0 -1
- package/dist/storybook/assets/accordion.stories-CrmHu75y.js +0 -170
- package/dist/storybook/assets/actions-Bax0KeqM.js +0 -39
- package/dist/storybook/assets/actions-D8UgHts6.css +0 -1
- package/dist/storybook/assets/actions.stories-BnPZKqOJ.js +0 -1
- package/dist/storybook/assets/afe.stories-C9XjJj62.js +0 -88
- package/dist/storybook/assets/assertThisInitialized-B9jnkVVz.js +0 -1
- package/dist/storybook/assets/badge-BiaoqO6w.css +0 -1
- package/dist/storybook/assets/badge-CLQ59MDF.js +0 -1
- package/dist/storybook/assets/badge.stories-DA_eeQyi.js +0 -1
- package/dist/storybook/assets/bg-rock-D_kpA0sy.jpg +0 -0
- package/dist/storybook/assets/blowout.stories-DH-sYHgB.js +0 -40
- package/dist/storybook/assets/breadcrumb-DMx-Mu4J.css +0 -1
- package/dist/storybook/assets/breadcrumb.stories-CJArS18Q.js +0 -1
- package/dist/storybook/assets/button-Cbv7WK6k.js +0 -1
- package/dist/storybook/assets/button-DtgxLQCF.css +0 -1
- package/dist/storybook/assets/button-group-0hjBV4tw.css +0 -1
- package/dist/storybook/assets/button-group-D2fGP_bX.js +0 -1
- package/dist/storybook/assets/button-group.stories-BETADGti.js +0 -71
- package/dist/storybook/assets/button.stories-C03VvX8K.js +0 -80
- package/dist/storybook/assets/buttons-and-links-DUNnvnXk.js +0 -14
- package/dist/storybook/assets/card-EcjmryU9.js +0 -1
- package/dist/storybook/assets/card-VFDFIKp2.css +0 -1
- package/dist/storybook/assets/card.stories-CsTB0DuM.js +0 -1
- package/dist/storybook/assets/casing-loads.stories-Buy0-e_n.js +0 -209
- package/dist/storybook/assets/cell.stories-CPNfDo9l.js +0 -245
- package/dist/storybook/assets/check-box-CV-zd_I_.css +0 -1
- package/dist/storybook/assets/check-box-DPLaOkRR.js +0 -13
- package/dist/storybook/assets/check-box.stories-BJ0ShmeC.js +0 -97
- package/dist/storybook/assets/check-box.test-case.stories-CzuYZkUh.js +0 -30
- package/dist/storybook/assets/chunk-HLWAVYOI-C49c1Yvv.js +0 -2
- package/dist/storybook/assets/color-CuU_llEh.js +0 -25
- package/dist/storybook/assets/column.stories-DDTHFELF.js +0 -88
- package/dist/storybook/assets/common-types-Sih75Sav.js +0 -1
- package/dist/storybook/assets/dialog-CBMZnjYb.css +0 -1
- package/dist/storybook/assets/dialog-DkpQscuI.js +0 -1
- package/dist/storybook/assets/disabled-context-rmpd7YJS.js +0 -1
- package/dist/storybook/assets/divider-DY9nJ_7N.js +0 -1
- package/dist/storybook/assets/divider-wQx_bznd.css +0 -1
- package/dist/storybook/assets/divider.stories-Dd-yyGrX.js +0 -1
- package/dist/storybook/assets/drawer-BVc1xI9q.css +0 -1
- package/dist/storybook/assets/drawer-DaQ1xGjV.js +0 -3
- package/dist/storybook/assets/drawer.stories-C08XBVTq.js +0 -113
- package/dist/storybook/assets/empty-L0EXybeR.css +0 -1
- package/dist/storybook/assets/empty.stories-L7LSMcLe.js +0 -1
- package/dist/storybook/assets/entry-preview-CHonU0lQ.js +0 -1
- package/dist/storybook/assets/entry-preview-docs-DUYczTxA.js +0 -54
- package/dist/storybook/assets/enum-Bnn40S8Q.js +0 -1
- package/dist/storybook/assets/field-CNDCZ5UR.css +0 -1
- package/dist/storybook/assets/field-HrLaMLbx.js +0 -7
- package/dist/storybook/assets/field.stories-CYpQ669-.js +0 -49
- package/dist/storybook/assets/file-button.stories-CRaTdLfv.js +0 -22
- package/dist/storybook/assets/file-input-b95Ui6h6.css +0 -1
- package/dist/storybook/assets/file-input-yalPf7-m.js +0 -13
- package/dist/storybook/assets/file-input.stories-DMTQqAF8.js +0 -66
- package/dist/storybook/assets/flex-EllkLxgO.js +0 -1
- package/dist/storybook/assets/flex.stories-CLwPyEMp.js +0 -15
- package/dist/storybook/assets/footer.stories-DniqHrTZ.js +0 -3
- package/dist/storybook/assets/form-row-BYz5u-Vr.css +0 -1
- package/dist/storybook/assets/form-row-CM112EYF.js +0 -1
- package/dist/storybook/assets/form.stories-Cr5Pz40F.js +0 -49
- package/dist/storybook/assets/formation.stories-C4Kugh7C.js +0 -74
- package/dist/storybook/assets/grid-DRkC-bt8.js +0 -15
- package/dist/storybook/assets/grid.stories-DqjhHHwX.js +0 -13
- package/dist/storybook/assets/heading-CRNoBc7q.js +0 -1
- package/dist/storybook/assets/heading-DMYPCDVj.css +0 -1
- package/dist/storybook/assets/heading.stories-DahFxeiX.js +0 -15
- package/dist/storybook/assets/help-icon-Buhx5nl6.js +0 -1
- package/dist/storybook/assets/help-icon-DeweQs4N.css +0 -1
- package/dist/storybook/assets/help-icon.stories-DbmZ1fgP.js +0 -4
- package/dist/storybook/assets/helpers-JJxzGegQ.js +0 -1
- package/dist/storybook/assets/icon-BSFY3vDO.js +0 -8
- package/dist/storybook/assets/icon-CXtHvr8n.css +0 -1
- package/dist/storybook/assets/icon-custom-Xcl4YkWP.js +0 -1
- package/dist/storybook/assets/icon.stories-fnZUR-LK.js +0 -6
- package/dist/storybook/assets/iframe-BN-sM7va.js +0 -2
- package/dist/storybook/assets/immer.esm-BwVl9PS2.js +0 -1
- package/dist/storybook/assets/index-BEZ0hk8m.js +0 -1
- package/dist/storybook/assets/index-BI4_Bp97.js +0 -1
- package/dist/storybook/assets/index-BcNHZKhG.js +0 -1
- package/dist/storybook/assets/index-Bk2sglWO.js +0 -5
- package/dist/storybook/assets/index-C0x1JmaP.js +0 -14
- package/dist/storybook/assets/index-CEuq6vkz.js +0 -1
- package/dist/storybook/assets/index-CF7H4eMJ.js +0 -28
- package/dist/storybook/assets/index-CUZDtIZe.js +0 -23
- package/dist/storybook/assets/index-D6rZ4wEC.js +0 -13
- package/dist/storybook/assets/index-DMAnyMX5.js +0 -179
- package/dist/storybook/assets/index-DRSy5Ssd.js +0 -1
- package/dist/storybook/assets/index-DhsZuJvc.js +0 -12
- package/dist/storybook/assets/index-dlFP5Vuh.js +0 -574
- package/dist/storybook/assets/index.es-DazXb-ul.js +0 -79
- package/dist/storybook/assets/inheritsLoose-DP0QEDDI.js +0 -1
- package/dist/storybook/assets/initialize-context-Y03pJPr5.js +0 -1
- package/dist/storybook/assets/input-Db9WkmPP.js +0 -1
- package/dist/storybook/assets/input-Dz1ZZYN5.css +0 -1
- package/dist/storybook/assets/input-group-BaRSJAEN.js +0 -1
- package/dist/storybook/assets/input-group-C4Ph05Zr.css +0 -1
- package/dist/storybook/assets/input-group-addon-CKbTwfkc.css +0 -1
- package/dist/storybook/assets/input-group-addon-D68iUKV2.js +0 -1
- package/dist/storybook/assets/input-group.stories-BCajsqAk.js +0 -167
- package/dist/storybook/assets/input-validation-D_iNtfvz.js +0 -26
- package/dist/storybook/assets/input.stories-SJy3TKkD.js +0 -41
- package/dist/storybook/assets/inputs-BLstsfPQ.js +0 -62
- package/dist/storybook/assets/jsx-runtime-eps93zm2.js +0 -8
- package/dist/storybook/assets/label-BmwKJ2Mn.css +0 -1
- package/dist/storybook/assets/label-CqmyC9he.js +0 -7
- package/dist/storybook/assets/label.stories-C0AO5F1a.js +0 -11
- package/dist/storybook/assets/layout-forms-BLRQsBhL.js +0 -16
- package/dist/storybook/assets/layout-general-CxuvOgwW.js +0 -35
- package/dist/storybook/assets/list-By3wp5Wa.js +0 -13
- package/dist/storybook/assets/list.stories-BcDHHHYJ.js +0 -476
- package/dist/storybook/assets/list.stories-data-Doo2Rqun.js +0 -1
- package/dist/storybook/assets/loader-B4-2F7c_.css +0 -1
- package/dist/storybook/assets/loader-XHoVniao.js +0 -1
- package/dist/storybook/assets/loader.stories-Q0U2BqZX.js +0 -83
- package/dist/storybook/assets/lodash-c4VUpsOs.js +0 -27
- package/dist/storybook/assets/logo-BVP9045W.js +0 -1
- package/dist/storybook/assets/memoize-one.esm-CcMeOnPo.js +0 -1
- package/dist/storybook/assets/menu.stories-1I5AGGQx.js +0 -82
- package/dist/storybook/assets/menu.stories-data-CQ59XhzU.js +0 -1
- package/dist/storybook/assets/menu.test-case.stories-XN9XFV-D.js +0 -3
- package/dist/storybook/assets/message-BRyKdRaX.js +0 -1
- package/dist/storybook/assets/message-C2ZCkHX6.css +0 -1
- package/dist/storybook/assets/message.stories-bCqCYIuN.js +0 -341
- package/dist/storybook/assets/meta-content-ByVTG0hd.css +0 -1
- package/dist/storybook/assets/meta-content-DNgQbAW0.js +0 -9
- package/dist/storybook/assets/modal.stories-C2d-Em5V.js +0 -200
- package/dist/storybook/assets/modal.test-case.stories-Ci1WRYdo.js +0 -21
- package/dist/storybook/assets/noto-sans-cyrillic-400-italic-BY-huaZy.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-400-italic-V6PUkjg4.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-400-normal--jh3sVvp.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-400-normal-XY9qUppk.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-700-italic-BsvNKSfQ.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-700-italic-DSFghSMx.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-700-normal-8ZAWbjJL.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-700-normal-CTzjhoZt.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-400-italic-Bb5b47eb.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-400-italic-DGWPeY37.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-400-normal-CFQi7qvd.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-400-normal-CH_iUxq2.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-700-italic-BdqKfCVQ.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-700-italic-C55zR5rk.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-700-normal-B5dGcPIT.woff +0 -0
- package/dist/storybook/assets/noto-sans-cyrillic-ext-700-normal-CojAy5w4.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-400-italic-KeY3OvDe.woff +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-400-italic-Lk_flmKd.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-400-normal-BV8n3Zrw.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-400-normal-Da_uNpmI.woff +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-700-italic-DX_Ben-x.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-700-italic-Df3Sqs2H.woff +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-700-normal-C2VYeOxD.woff +0 -0
- package/dist/storybook/assets/noto-sans-devanagari-700-normal-C8e99gZj.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-400-italic-BXJxTOvj.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-400-italic-DHwB0AdM.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-400-normal-BroOW-sQ.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-400-normal-CPTbu1sO.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-700-italic-CfolioWa.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-700-italic-DBCdhGrj.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-700-normal-BVjVfDKs.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-700-normal-P_B9BfF7.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-400-italic-9zOpfpOs.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-400-italic-D2WbBWVW.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-400-normal-D73iK5X1.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-400-normal-DWouWyWY.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-700-italic-C5zCcdM3.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-700-italic-YPo3ecki.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-700-normal-BJpqEDTw.woff +0 -0
- package/dist/storybook/assets/noto-sans-greek-ext-700-normal-ZrWkOZr4.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-400-italic-BT87CHj2.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-400-italic-NApRWGLz.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-400-normal-CF_EggQ_.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-400-normal-DMz6UGTQ.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-700-italic-Cw3cBBZk.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-700-italic-qe_3Da_h.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-700-normal-CkyHDghY.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-700-normal-DwlQfr5s.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-400-italic-BOMiliBU.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-400-italic-UXQeYjoB.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-400-normal-BIBIZdeZ.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-400-normal-vP3vnBxr.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-700-italic-o2AF7PF_.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-700-italic-zILg070W.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-700-normal-BInqjRdw.woff +0 -0
- package/dist/storybook/assets/noto-sans-latin-ext-700-normal-BS3CI2D1.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-400-italic-CDqW7NCu.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-400-italic-DJmGvf9Z.woff +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-400-normal-DziUSn_1.woff +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-400-normal-l431O8bE.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-700-italic-D0f5b0SE.woff +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-700-italic-GQhDhRZX.woff2 +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-700-normal-Dp2_pAUa.woff +0 -0
- package/dist/storybook/assets/noto-sans-vietnamese-700-normal-RhAWG0gK.woff2 +0 -0
- package/dist/storybook/assets/number-input-B3_gmeWr.js +0 -16
- package/dist/storybook/assets/number-input.stories-epjUq9ve.js +0 -89
- package/dist/storybook/assets/number-input.test-case.stories-DeEtalIU.js +0 -95
- package/dist/storybook/assets/objectSpread2-DW4nTBoq.js +0 -1
- package/dist/storybook/assets/objectWithoutPropertiesLoose-CAYKN5F1.js +0 -1
- package/dist/storybook/assets/option-dropdown-CqPYsFHP.css +0 -1
- package/dist/storybook/assets/option-dropdown.stories-CznUbXVi.js +0 -52
- package/dist/storybook/assets/padding-and-spacing-qL1P8fJl.js +0 -19
- package/dist/storybook/assets/page-7SSpdYhb.js +0 -1
- package/dist/storybook/assets/page-BnAFjzxf.css +0 -1
- package/dist/storybook/assets/page-DqJqTfkP.css +0 -1
- package/dist/storybook/assets/page.stories-DthnK8qb.js +0 -57
- package/dist/storybook/assets/pagination-CR1nxnnq.js +0 -1
- package/dist/storybook/assets/pagination-Dv2vKYwQ.css +0 -1
- package/dist/storybook/assets/pagination.stories-qXmBYwYc.js +0 -59
- package/dist/storybook/assets/pop-confirm-DX_o_X81.css +0 -1
- package/dist/storybook/assets/pop-confirm.stories-CHa0qUBe.js +0 -9
- package/dist/storybook/assets/popover-CSc-8-Dh.css +0 -1
- package/dist/storybook/assets/popover-C_2P8LFJ.js +0 -1
- package/dist/storybook/assets/popover.stories-DZTfimDf.js +0 -10
- package/dist/storybook/assets/portal-GQ0_cLB6.js +0 -1
- package/dist/storybook/assets/portal.stories-BvRfNPz3.js +0 -20
- package/dist/storybook/assets/preview-C_R8uZLy.js +0 -3
- package/dist/storybook/assets/preview-CsXFMCpR.js +0 -2
- package/dist/storybook/assets/preview-Ct5NkTJf.js +0 -1
- package/dist/storybook/assets/preview-DLBQXbKW.js +0 -1
- package/dist/storybook/assets/preview-DeFlgNaS.css +0 -1
- package/dist/storybook/assets/progress-bar-C_kV6r0Q.js +0 -1
- package/dist/storybook/assets/progress-bar-ztYhwUbl.css +0 -1
- package/dist/storybook/assets/progress-bar.stories-CpbgT43D.js +0 -1
- package/dist/storybook/assets/projects.stories-BPm6ucAe.js +0 -47
- package/dist/storybook/assets/radio-button-C4ljBRED.js +0 -13
- package/dist/storybook/assets/radio-button-DvubT0Gg.css +0 -1
- package/dist/storybook/assets/radio-button.stories-D1rWr6ms.js +0 -61
- package/dist/storybook/assets/radio-button.test-case.stories-DglmHlWs.js +0 -11
- package/dist/storybook/assets/react-16-DXAfArL2.js +0 -1
- package/dist/storybook/assets/react-router-dom-Ck2Y_Fzc.js +0 -8
- package/dist/storybook/assets/redux-tRgGMjwY.js +0 -1
- package/dist/storybook/assets/reservoirs.stories-r1Ip90kJ.js +0 -156
- package/dist/storybook/assets/rich-text-input-BJfL0Me_.css +0 -1
- package/dist/storybook/assets/rich-text-input.stories-DwaseXZv.js +0 -256
- package/dist/storybook/assets/row-Bmiy2Lh0.js +0 -39
- package/dist/storybook/assets/row-D-EMWFT6.css +0 -1
- package/dist/storybook/assets/row.stories-jKh8Ms1e.js +0 -130
- package/dist/storybook/assets/select-BmYXTl_0.css +0 -1
- package/dist/storybook/assets/select-Cwks-WA0.js +0 -61
- package/dist/storybook/assets/select.input-CJed_LLR.js +0 -1
- package/dist/storybook/assets/select.stories-DjGSNDXK.js +0 -498
- package/dist/storybook/assets/select.stories-data-DxgWKlU6.js +0 -1
- package/dist/storybook/assets/select.test-case.stories-CrXzt4qn.js +0 -82
- package/dist/storybook/assets/side-bar-fBbBqyAT.css +0 -1
- package/dist/storybook/assets/side-bar-wpFQ5NEE.js +0 -24
- package/dist/storybook/assets/side-bar.stories-LjClxJcG.js +0 -1
- package/dist/storybook/assets/site.stories-BnWmALGd.js +0 -166
- package/dist/storybook/assets/slider-DPdTVMP0.css +0 -1
- package/dist/storybook/assets/slider-DxaD8LU4.js +0 -27
- package/dist/storybook/assets/slider.stories-DuGie_AX.js +0 -134
- package/dist/storybook/assets/smart-upload-modal.stories-BlTSF64K.js +0 -25
- package/dist/storybook/assets/spacer-BWoNR27H.js +0 -1
- package/dist/storybook/assets/spacer.stories-BT2S6B0R.js +0 -1
- package/dist/storybook/assets/spinner-AWUe4xwQ.js +0 -1
- package/dist/storybook/assets/spinner-C07x-KQu.css +0 -1
- package/dist/storybook/assets/spinner.stories-DuQNhl1V.js +0 -26
- package/dist/storybook/assets/styled-components.browser.esm-BQ9GQzDc.js +0 -2
- package/dist/storybook/assets/table-BSABGfWm.js +0 -86
- package/dist/storybook/assets/table-BtBtDwPu.css +0 -1
- package/dist/storybook/assets/table.stories-CHwzAdud.js +0 -772
- package/dist/storybook/assets/table.stories-data-C7mC5R8Q.js +0 -1
- package/dist/storybook/assets/tabs-BoToLVEP.js +0 -13
- package/dist/storybook/assets/tabs-DnWs2PtA.css +0 -1
- package/dist/storybook/assets/tabs.stories-B52iEaHf.js +0 -30
- package/dist/storybook/assets/text-2O-HSG8g.css +0 -1
- package/dist/storybook/assets/text-B3-TSWok.js +0 -1
- package/dist/storybook/assets/text-link.stories-BQAkVO-W.js +0 -14
- package/dist/storybook/assets/text.stories-B8L4FWPt.js +0 -1
- package/dist/storybook/assets/textarea-DflOOrxV.js +0 -13
- package/dist/storybook/assets/textarea-TqxidmV4.css +0 -1
- package/dist/storybook/assets/textarea.stories-CzsqRVpC.js +0 -9
- package/dist/storybook/assets/tiny-invariant-DqLgxztJ.js +0 -8
- package/dist/storybook/assets/title.stories-D0VjujmM.js +0 -37
- package/dist/storybook/assets/toaster-7wnI6hqB.js +0 -1
- package/dist/storybook/assets/toaster-DwLvOY18.css +0 -1
- package/dist/storybook/assets/toaster-O8ftrUAJ.js +0 -1
- package/dist/storybook/assets/toaster.stories-CdpwLBSo.js +0 -84
- package/dist/storybook/assets/toaster.test-case.stories-Cy3_Gvs_.js +0 -6
- package/dist/storybook/assets/toggle-BbFVf61v.js +0 -13
- package/dist/storybook/assets/toggle-yD7j1VSk.css +0 -1
- package/dist/storybook/assets/toggle.stories-BAislK3I.js +0 -106
- package/dist/storybook/assets/toggle.test-case.stories-CeUwdhGD.js +0 -36
- package/dist/storybook/assets/tooltip-1V7clEnw.js +0 -29
- package/dist/storybook/assets/tooltip-COvcX6J7.css +0 -1
- package/dist/storybook/assets/tooltip.stories-1YexWg6N.js +0 -17
- package/dist/storybook/assets/tooltip.test-case.stories-De9h8ThH.js +0 -5
- package/dist/storybook/assets/top-bar-Bjf6PQE1.js +0 -163
- package/dist/storybook/assets/top-bar-u7j8EgRd.css +0 -1
- package/dist/storybook/assets/top-bar.stories-1hZmlzDT.js +0 -21
- package/dist/storybook/assets/top-bar.testcase.stories-BsFYqaw6.js +0 -30
- package/dist/storybook/assets/tree-BTgu2lWb.css +0 -1
- package/dist/storybook/assets/tree.stories-NGZfmH_B.js +0 -181
- package/dist/storybook/assets/types-BmbYqTX_.js +0 -1
- package/dist/storybook/assets/types-Dx2TtIG9.js +0 -1
- package/dist/storybook/assets/unit-input-5P4Cogho.css +0 -1
- package/dist/storybook/assets/unit-input-DTOrVqdm.js +0 -5
- package/dist/storybook/assets/unit-input.stories-BhSBzB95.js +0 -198
- package/dist/storybook/assets/unit-input.test-case.stories-Dk5SRvMt.js +0 -215
- package/dist/storybook/assets/unit-table.stories-DwZVHcZo.js +0 -152
- package/dist/storybook/assets/unit-table.test-case.stories-C9Swzooe.js +0 -1
- package/dist/storybook/favicon.svg +0 -1
- package/dist/storybook/iframe.html +0 -639
- package/dist/storybook/index.html +0 -153
- package/dist/storybook/index.json +0 -1
- package/dist/storybook/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/storybook/nunito-sans-bold.woff2 +0 -0
- package/dist/storybook/nunito-sans-italic.woff2 +0 -0
- package/dist/storybook/nunito-sans-regular.woff2 +0 -0
- package/dist/storybook/project.json +0 -1
- package/dist/storybook/sb-addons/actions-1/manager-bundle.js +0 -3
- package/dist/storybook/sb-addons/actions-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/storybook/sb-addons/interactions-2/manager-bundle.js +0 -234
- package/dist/storybook/sb-addons/interactions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/storybook/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +0 -3
- package/dist/storybook/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/storybook/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js +0 -5
- package/dist/storybook/sb-addons/storybook-dark-mode-esm-preset-3/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/storybook/sb-common-assets/favicon.svg +0 -1
- package/dist/storybook/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/storybook/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/storybook/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/storybook/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/storybook/sb-manager/globals-module-info.js +0 -995
- package/dist/storybook/sb-manager/globals-runtime.js +0 -53525
- package/dist/storybook/sb-manager/globals.js +0 -48
- package/dist/storybook/sb-manager/runtime.js +0 -11884
- package/dist/storybook/sb-preview/globals.js +0 -33
- package/dist/storybook/sb-preview/runtime.js +0 -9485
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i=(r=>(r.HEADING="Heading",r.DIVIDER="Divider",r.OPTION="Option",r.MENU="Menu",r))(i||{}),D=(r=>(r.FALSE="false",r.RIGHT="right",r.DOWN="down",r))(D||{});export{i as M,D as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t}from"./index-DhsZuJvc.js";import{l as s}from"./lodash-c4VUpsOs.js";const a=r=>s.isString(r)||s.isNumber(r)||t.isValidElement(r),e=r=>Array.isArray(r)?"array":typeof r;export{e as g,a as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._predefinedMenuActive_ye9w9_1 input{background:var(--color-background-disabled)!important}._inputWrapper_ye9w9_4{flex:1}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./jsx-runtime-eps93zm2.js";import{r as q}from"./index-DhsZuJvc.js";import{d as r}from"./index-C0x1JmaP.js";import{c as Ne}from"./index-Bk2sglWO.js";import{c as ne,i as Ce,a as De,g as Pe,u as Me,b as Oe}from"./initialize-context-Y03pJPr5.js";import{M as X}from"./actions-Bax0KeqM.js";import{I as Fe}from"./input-group-addon-D68iUKV2.js";import{B as Se}from"./button-Cbv7WK6k.js";import{T as xe}from"./tooltip-1V7clEnw.js";import{I as je}from"./input-group-BaRSJAEN.js";import{S as Ae}from"./spacer-BWoNR27H.js";import{T as We}from"./text-B3-TSWok.js";import{M as Y}from"./types-BmbYqTX_.js";import{l as v}from"./lodash-c4VUpsOs.js";import{N as Re,r as _e}from"./number-input-B3_gmeWr.js";const He=()=>{const e=q.useRef(null);return q.useLayoutEffect(()=>{e.current&&(e.current(),e.current=null)}),f=>{e.current=f}};var d=(e=>(e.CUSTOM="custom",e.PREDEFINED="predefined",e))(d||{});const ke=e=>{if(!e)return!1;const c=r.getUnit(e);return!r.KNOWN_UNITS.includes(c)},w=({value:e="",toUnit:c,unitkey:f,defaultFromUnit:F,doNotConvertValue:I})=>{const N=r.getValue(e),E=Ce(N);return ke(e)?{value:N}:E?{value:N}:r.isValueWithUnit(e)?ne({value:e,unitkey:f,toUnit:c,fromUnit:F,doNotConvertValue:I,exactPrecision:!0}):{value:e}},Z=e=>v.isObject(e)&&!v.isArray(e)&&!v.isFunction(e)?v.get(e,"fieldName",""):typeof e=="string"?e:"",ee=(e="")=>{var c;return(c=r.KNOWN_UNITS)==null?void 0:c.includes(e)},Le=(e,c)=>{const f=r.getUnit(e||"");return ee(c)&&ee(f)},Be="_predefinedMenuActive_ye9w9_1",$e="_inputWrapper_ye9w9_4",te={predefinedMenuActive:Be,inputWrapper:$e},Ke=({name:e,placeholder:c="",disabled:f=!1,disabledUnit:F=!1,error:I=null,left:N=!1,small:E=!1,width:re="100%",value:l,unitkey:u="",initUnit:ae,noConversion:ie=!1,onChange:S=v.noop,onClick:Ge=v.noop,onFocus:se=v.noop,onSwitchUnit:_=v.noop,unitTemplate:H,doNotConvertValue:V=!1,testId:b,warning:k=null,predefinedOptions:g,initialPredefinedOption:le=!1,shouldLinkAutomaticly:L=!0,selectedPredefinedOptionKey:B,validationCallback:ue=()=>({name:"",error:null}),disabledValidation:oe=!1,allowEmpty:de=!1,autoValue:U,convertBackToStorageUnit:pe=!1,enableCosmeticRounding:$=!0,enableDisplayRounding:ce=!1})=>{const h=De(),fe=He();typeof l=="number"&&(l=`${l}`);const[K="",y=""]=l!==void 0?r.split(l):[],G=U?r.getUnit(U):"",Q=q.useMemo(()=>Pe(u,H||(h==null?void 0:h.unitTemplate)),[u,H,h==null?void 0:h.unitTemplate]),me=Le(l,Q),m=ae||Q||y,ge=Me(m),{value:z}=w({value:l,toUnit:m,unitkey:u,defaultFromUnit:y,doNotConvertValue:V}),{value:J}=w({value:U,toUnit:m,unitkey:u,defaultFromUnit:G,doNotConvertValue:V}),ve=z!==""?{value:z,unit:m}:J!==""?{value:J,unit:m}:{value:K,unit:y},[a,x]=q.useState(ve),Ue=de||(a==null?void 0:a.value)===void 0,[T,j]=q.useState(le?d.PREDEFINED:d.CUSTOM),A=K===""&&U,ye=!!(oe||U),C=g&&g.find(t=>{if(!(t!=null&&t.value))return;if(B)return B===t.valueKey;const n=r.isValueWithUnit(t.value)?r.getUnit(t.value):"",{value:i=l}=ne({value:String(l),unitkey:u,toUnit:n});return r.withUnit(i,n)===t.value}),Te=()=>{const t=A?U:l??"",n=a.unit;if(Oe({value:t,unitkey:u,toUnit:n})){if(u)try{let s=r.altUnitsList(t,u);return r.getValue(t)===""?s.map(p=>["",p[1]]):s}catch{return null}}else{let s=r.getAltUnitsListByQuantity(u);return s==null?void 0:s.map(p=>["",p==null?void 0:p.unit])}},Ee=t=>{const n=Z(e),i=t.target,{value:s,selectionStart:p}=i,O=r.withUnit(s,(a==null?void 0:a.unit)||""),R=pe?r.withUnit(r.convertAndGetValue(O,y),y):O;S({target:{value:R,name:n}});const[qe,Ie]=r.split(O);x({value:qe,unit:Ie}),fe(()=>{i.selectionStart=p,i.selectionEnd=p})},Ve=(t,n)=>{n===a.unit||isNaN(Number(t))||(x({value:t,unit:n}),_&&_(n))};q.useEffect(()=>{if(m){let t,n="";if(ge!==m){const{value:i}=w({value:l,toUnit:m,unitkey:u,defaultFromUnit:y,doNotConvertValue:V});t=i,n=m}else if(r.withUnit(a.value,a.unit)!==l){const{value:i}=w({value:l,toUnit:a.unit,unitkey:u,defaultFromUnit:y,doNotConvertValue:V});t=i,n=a.unit}t!==void 0&&x({value:t,unit:n}),g&&j(C&&L?d.PREDEFINED:d.CUSTOM)}},[m,l,I,L]);const D=Te(),P=r.label(a.unit)||a.unit||"",be=ie||!D||D&&D.length===1,W=Z(e);let M;const he=t=>{const n=t!=null&&t.value?t.value:"",[i="",s=""]=r.isValueWithUnit(n)?r.split(n):[n];return{type:Y.OPTION,inline:!0,onClick:()=>{r.validateNumber(i).valid&&!f&&(j(d.PREDEFINED),S({target:{value:n,name:typeof e=="string"?e:(e==null?void 0:e.fieldName)||"",predefinedSelected:!0,predefinedOption:t}}))},label:o.jsxs(o.Fragment,{children:[o.jsx(We,{children:t.label}),o.jsx(Ae,{width:"20px",height:"0"})]}),description:r.isValueWithUnit(n)?`${i} ${s}`:n,selected:C===t&&T===d.PREDEFINED}};if(M=[{type:Y.OPTION,inline:!0,onClick:()=>{T!==d.CUSTOM&&!f&&S({target:{value:r.withUnit(a.value,a.unit),name:typeof e=="string"?e:(e==null?void 0:e.fieldName)||""}})},label:"Custom",selected:T===d.CUSTOM}],g!=null&&g.length){const t=g.map(he);M=[...M,...t]}const we=t=>{if(A){const{value:n}=w({value:U,toUnit:a.unit,unitkey:u,defaultFromUnit:G,doNotConvertValue:V});return n}else if(r.isValueWithUnit(t)){const n=r.getUnit(t),{value:i}=w({value:t,toUnit:a.unit,unitkey:u,defaultFromUnit:n,doNotConvertValue:V});return i}return t};return o.jsx("div",{className:T===d.PREDEFINED?Ne(te.predefinedMenuActive):"",children:o.jsxs(je,{small:E,width:re,children:[g&&o.jsx(xe,{text:T===d.PREDEFINED?C==null?void 0:C.label:"",children:o.jsx(X,{maxHeight:380,groupOrder:"first",testId:b&&`${b}-predefined-menu`,disabled:f,menu:{colored:!0,trigger:"Component",component:o.jsx(Se,{groupOrder:"first",active:T===d.PREDEFINED,icon:T===d.PREDEFINED?"link":"unlink"}),small:E,sections:M}})}),o.jsx("div",{className:te.inputWrapper,children:o.jsx(Re,{name:W,testId:b,disabled:f,placeholder:we(c),value:a.value,onChange:Ee,onFocus:se,error:I===null?void 0:I,warning:k===null?void 0:k,left:N,allowEmpty:Ue,validationCallback:(t,n)=>ue(W,n),enableCosmeticRounding:$,enableDisplayRounding:ce,groupOrder:g?"middle":"first",disableInternalErrorValidationMessages:ye,small:E},W)}),P&&(be||!me?o.jsx(Fe,{groupOrder:"last",children:P}):o.jsx(X,{maxHeight:380,groupOrder:"last",disabled:F,testId:b&&`${b}-menu`,menu:{label:P,trigger:"DropDownButton",small:E,sections:D.map(([t,n,i])=>{const s=i||n||"",p=r.isValidNum(t)?t:"";return{type:"Option",label:$?_e(p):p,inline:!0,onClick:R=>{R.stopPropagation(),Ve(A?"":t,n)},description:s,selected:s===P,testId:`${b}-unit-${s}`}})}}))]})})};Ke.__docgenInfo={description:"",methods:[],displayName:"UnitInput",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},disabledUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:"",defaultValue:{value:"null",computed:!1}},left:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},small:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"",defaultValue:{value:"'100%'",computed:!1}},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:"",defaultValue:{value:"''",computed:!1}},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:"",defaultValue:{value:"null",computed:!1}},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:"(name: string, error: string | null) => any",signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"any"}}},description:"",defaultValue:{value:"() => ({ name: '', error: null })",computed:!1}},disabledValidation:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},allowEmpty:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: TOnChangeEvent) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ target: TOnChangeEventTarget }",signature:{properties:[{key:"target",value:{name:"union",raw:`| TOnChangeEventBaseTarget
|
|
2
|
-
| (TOnChangeEventBaseTarget & {
|
|
3
|
-
predefinedSelected: boolean;
|
|
4
|
-
predefinedOption: IPredefinedOption;
|
|
5
|
-
})`,elements:[{name:"signature",type:"object",raw:"{ name: string; value: string }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"value",value:{name:"string",required:!0}}]}},{name:"unknown"}],required:!0}}]}},name:"evt"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:"",defaultValue:{value:"noop",computed:!0}},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"noop",computed:!0}},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:"",defaultValue:{value:"noop",computed:!0}},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""},convertBackToStorageUnit:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}},enableCosmeticRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"true",computed:!1}},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:"",defaultValue:{value:"false",computed:!1}}}};export{Ke as U};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as u}from"./index-DhsZuJvc.js";import{U as o}from"./unit-input-DTOrVqdm.js";import{B as p}from"./button-Cbv7WK6k.js";import{S as E}from"./spacer-BWoNR27H.js";import{R as Fe,C as De}from"./row-Bmiy2Lh0.js";import{F as g}from"./field-HrLaMLbx.js";import{M as Ne}from"./message-BRyKdRaX.js";import"./index-C0x1JmaP.js";import"./index-DRSy5Ssd.js";import"./index-Bk2sglWO.js";import"./initialize-context-Y03pJPr5.js";import"./number-input-B3_gmeWr.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./lodash-c4VUpsOs.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./icon-BSFY3vDO.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./inheritsLoose-DP0QEDDI.js";import"./types-BmbYqTX_.js";import"./badge-CLQ59MDF.js";import"./input-group-addon-D68iUKV2.js";import"./input-group-BaRSJAEN.js";import"./text-B3-TSWok.js";import"./spinner-AWUe4xwQ.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./label-CqmyC9he.js";import"./help-icon-Buhx5nl6.js";const{useArgs:Be}=__STORYBOOK_MODULE_PREVIEW_API__,Ua={title:"Forms/UnitInput",component:o,args:{name:"example",unitkey:"length",value:"123|m"}},s=n=>{const[r,a]=Be(),i=l=>{a({value:l.target.value})};return e.jsx(o,{...n,onChange:i})},P=s.bind({}),m=s.bind({});m.args={initUnit:"ft",unitTemplate:{length:"ft"}};const h=s.bind({});h.args={value:'123|"',unitkey:'"'};const v=s.bind({});v.args={width:"180px"};const C=s.bind({});C.args={noConversion:!0};const b=s.bind({});b.args={small:!0};const U=s.bind({});U.args={error:"Error message goes here"};const x=s.bind({});x.args={value:"asas123asd|%"};const c=s.bind({});c.args={disabled:!0,disabledUnit:!0};c.parameters={docs:{description:{story:"Each part of UnitInput can be disabled separately. `disabled` disables only the main text input, `disabledUnit` disables only the unit menu. **Needs review (comes from Reservoir input requirements)**"}}};const y=s.bind({});y.args={disabled:!0,disabledUnit:!0,noConversion:!0};const I=s.bind({});I.args={disabledUnit:!0,unitkey:void 0};const V=s.bind({});V.args={disabledUnit:!0,unitkey:"length"};const A=s.bind({});A.args={disabledUnit:!1,disabled:!0};const S=s.bind({});S.args={predefinedOptions:[{label:"bottom of casing",value:"12|km"},{label:"mud weight at shoe depth",value:"8|mm"}]};const w=()=>{const n="500px",[r,a]=u.useState("1|m"),[i,l]=u.useState("|m"),d="123|km";return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different cases for automatic (placeholder) values:"}),e.jsx(Fe,{children:e.jsxs(De,{width:"25%",children:[e.jsx(p,{label:"Change value to ''",onClick:()=>a("")}),e.jsx("br",{}),e.jsx(p,{label:"Change value to 1",onClick:()=>a("1")}),e.jsx("br",{}),e.jsx(p,{label:"Change value to 1|m",onClick:()=>a("1|m")}),e.jsx("br",{}),e.jsx(p,{label:"Change value to |m - empty value",onClick:()=>a("|m")})]})}),e.jsx("br",{}),e.jsx(g,{label:"Normal PUI (placeholder + auto)",children:e.jsx(o,{name:"example1",onChange:t=>a(t.target.value),value:r,unitkey:"length",width:n,placeholder:"value|unit",autoValue:d})}),e.jsx(g,{label:"Normal PUI (only auto)",children:e.jsx(o,{name:"example1",onChange:t=>a(t.target.value),value:r,unitkey:"length",width:n,autoValue:d})}),e.jsx(g,{label:"Empty PUI with autoValue",children:e.jsx(o,{name:"example1",onChange:t=>l(t.target.value),value:i,unitkey:"length",width:n,autoValue:d})}),e.jsx(g,{label:"Normal PUI (only placeholder)",children:e.jsx(o,{name:"example1",onChange:t=>a(t.target.value),value:r,unitkey:"length",width:n,placeholder:"Placeholder test"})}),e.jsx(g,{label:"Normal PUI (placeholder + allowEmpty)",children:e.jsx(o,{name:"example1",onChange:t=>a(t.target.value),value:r,unitkey:"length",width:n,placeholder:"Placeholder test",allowEmpty:!0})}),e.jsx(Ne,{message:{heading:"Current value inside PUI: "+r,visible:!0}})]})},j=()=>{const[n,r]=u.useState("123|%"),[a,i]=u.useState(null),l="This should be visible when an error appears",d=(t,_)=>(i(_),{name:t,error:_});return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"3rd party validation message when inputting invalid value:"}),e.jsx(o,{name:"example",onChange:t=>r(t.target.value),error:!a||l,validationCallback:d,value:n}),e.jsx("br",{}),e.jsx(E,{}),e.jsx("h4",{children:"Original validation message: "}),e.jsx(Ne,{message:{heading:a,visible:!0}})]})},k=()=>{const[n,r]=u.useState("123|m"),[a,i]=u.useState(""),[l,d]=u.useState("km"),t=()=>{d("ft"),i("placeholder"),r("|m")};return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Empty value case:"}),e.jsx(o,{name:"example",onChange:_=>r(_.target.value),value:n,allowEmpty:!0,placeholder:a,initUnit:l,unitkey:"length"}),e.jsx("br",{}),e.jsx(E,{}),e.jsx(p,{label:"Change value |m and unit ft",onClick:()=>t()})]})},f=()=>{const[n,r]=u.useState("123|m"),[a,i]=u.useState("m");return e.jsxs(e.Fragment,{children:[e.jsx(o,{name:"example",onChange:l=>r(l.target.value),value:n,initUnit:a,unitkey:"length",onSwitchUnit:i}),e.jsx(E,{}),e.jsx(o,{name:"example",onChange:l=>r(l.target.value),value:n,initUnit:a,unitkey:"length",onSwitchUnit:i})]})};w.__docgenInfo={description:"",methods:[],displayName:"AutomaticValues"};j.__docgenInfo={description:"",methods:[],displayName:"ValidationCallback"};k.__docgenInfo={description:"",methods:[],displayName:"AllowEmptyPUI"};f.__docgenInfo={description:"",methods:[],displayName:"OnSwitchUnit"};var N,F,D;P.parameters={...P.parameters,docs:{...(N=P.parameters)==null?void 0:N.docs,source:{originalSource:`args => {
|
|
2
|
-
const [_, updateArgs] = useArgs();
|
|
3
|
-
const handleChange = (evt: any) => {
|
|
4
|
-
updateArgs({
|
|
5
|
-
value: evt.target.value
|
|
6
|
-
});
|
|
7
|
-
};
|
|
8
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
9
|
-
}`,...(D=(F=P.parameters)==null?void 0:F.docs)==null?void 0:D.source}}};var B,O,M;m.parameters={...m.parameters,docs:{...(B=m.parameters)==null?void 0:B.docs,source:{originalSource:`args => {
|
|
10
|
-
const [_, updateArgs] = useArgs();
|
|
11
|
-
const handleChange = (evt: any) => {
|
|
12
|
-
updateArgs({
|
|
13
|
-
value: evt.target.value
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
17
|
-
}`,...(M=(O=m.parameters)==null?void 0:O.docs)==null?void 0:M.source}}};var W,R,K;h.parameters={...h.parameters,docs:{...(W=h.parameters)==null?void 0:W.docs,source:{originalSource:`args => {
|
|
18
|
-
const [_, updateArgs] = useArgs();
|
|
19
|
-
const handleChange = (evt: any) => {
|
|
20
|
-
updateArgs({
|
|
21
|
-
value: evt.target.value
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
25
|
-
}`,...(K=(R=h.parameters)==null?void 0:R.docs)==null?void 0:K.source}}};var T,q,L;v.parameters={...v.parameters,docs:{...(T=v.parameters)==null?void 0:T.docs,source:{originalSource:`args => {
|
|
26
|
-
const [_, updateArgs] = useArgs();
|
|
27
|
-
const handleChange = (evt: any) => {
|
|
28
|
-
updateArgs({
|
|
29
|
-
value: evt.target.value
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
33
|
-
}`,...(L=(q=v.parameters)==null?void 0:q.docs)==null?void 0:L.source}}};var Y,z,G;C.parameters={...C.parameters,docs:{...(Y=C.parameters)==null?void 0:Y.docs,source:{originalSource:`args => {
|
|
34
|
-
const [_, updateArgs] = useArgs();
|
|
35
|
-
const handleChange = (evt: any) => {
|
|
36
|
-
updateArgs({
|
|
37
|
-
value: evt.target.value
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
41
|
-
}`,...(G=(z=C.parameters)==null?void 0:z.docs)==null?void 0:G.source}}};var H,J,Q;b.parameters={...b.parameters,docs:{...(H=b.parameters)==null?void 0:H.docs,source:{originalSource:`args => {
|
|
42
|
-
const [_, updateArgs] = useArgs();
|
|
43
|
-
const handleChange = (evt: any) => {
|
|
44
|
-
updateArgs({
|
|
45
|
-
value: evt.target.value
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
49
|
-
}`,...(Q=(J=b.parameters)==null?void 0:J.docs)==null?void 0:Q.source}}};var X,Z,$;U.parameters={...U.parameters,docs:{...(X=U.parameters)==null?void 0:X.docs,source:{originalSource:`args => {
|
|
50
|
-
const [_, updateArgs] = useArgs();
|
|
51
|
-
const handleChange = (evt: any) => {
|
|
52
|
-
updateArgs({
|
|
53
|
-
value: evt.target.value
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
57
|
-
}`,...($=(Z=U.parameters)==null?void 0:Z.docs)==null?void 0:$.source}}};var ee,ae,te;x.parameters={...x.parameters,docs:{...(ee=x.parameters)==null?void 0:ee.docs,source:{originalSource:`args => {
|
|
58
|
-
const [_, updateArgs] = useArgs();
|
|
59
|
-
const handleChange = (evt: any) => {
|
|
60
|
-
updateArgs({
|
|
61
|
-
value: evt.target.value
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
65
|
-
}`,...(te=(ae=x.parameters)==null?void 0:ae.docs)==null?void 0:te.source}}};var ne,re,se;c.parameters={...c.parameters,docs:{...(ne=c.parameters)==null?void 0:ne.docs,source:{originalSource:`args => {
|
|
66
|
-
const [_, updateArgs] = useArgs();
|
|
67
|
-
const handleChange = (evt: any) => {
|
|
68
|
-
updateArgs({
|
|
69
|
-
value: evt.target.value
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
73
|
-
}`,...(se=(re=c.parameters)==null?void 0:re.docs)==null?void 0:se.source}}};var le,oe,ie;y.parameters={...y.parameters,docs:{...(le=y.parameters)==null?void 0:le.docs,source:{originalSource:`args => {
|
|
74
|
-
const [_, updateArgs] = useArgs();
|
|
75
|
-
const handleChange = (evt: any) => {
|
|
76
|
-
updateArgs({
|
|
77
|
-
value: evt.target.value
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
81
|
-
}`,...(ie=(oe=y.parameters)==null?void 0:oe.docs)==null?void 0:ie.source}}};var ue,de,ce;I.parameters={...I.parameters,docs:{...(ue=I.parameters)==null?void 0:ue.docs,source:{originalSource:`args => {
|
|
82
|
-
const [_, updateArgs] = useArgs();
|
|
83
|
-
const handleChange = (evt: any) => {
|
|
84
|
-
updateArgs({
|
|
85
|
-
value: evt.target.value
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
89
|
-
}`,...(ce=(de=I.parameters)==null?void 0:de.docs)==null?void 0:ce.source}}};var ge,pe,me;V.parameters={...V.parameters,docs:{...(ge=V.parameters)==null?void 0:ge.docs,source:{originalSource:`args => {
|
|
90
|
-
const [_, updateArgs] = useArgs();
|
|
91
|
-
const handleChange = (evt: any) => {
|
|
92
|
-
updateArgs({
|
|
93
|
-
value: evt.target.value
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
97
|
-
}`,...(me=(pe=V.parameters)==null?void 0:pe.docs)==null?void 0:me.source}}};var he,ve,Ce;A.parameters={...A.parameters,docs:{...(he=A.parameters)==null?void 0:he.docs,source:{originalSource:`args => {
|
|
98
|
-
const [_, updateArgs] = useArgs();
|
|
99
|
-
const handleChange = (evt: any) => {
|
|
100
|
-
updateArgs({
|
|
101
|
-
value: evt.target.value
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
105
|
-
}`,...(Ce=(ve=A.parameters)==null?void 0:ve.docs)==null?void 0:Ce.source}}};var be,Ue,xe;S.parameters={...S.parameters,docs:{...(be=S.parameters)==null?void 0:be.docs,source:{originalSource:`args => {
|
|
106
|
-
const [_, updateArgs] = useArgs();
|
|
107
|
-
const handleChange = (evt: any) => {
|
|
108
|
-
updateArgs({
|
|
109
|
-
value: evt.target.value
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
113
|
-
}`,...(xe=(Ue=S.parameters)==null?void 0:Ue.docs)==null?void 0:xe.source}}};var ye,Ie,Ve;w.parameters={...w.parameters,docs:{...(ye=w.parameters)==null?void 0:ye.docs,source:{originalSource:`() => {
|
|
114
|
-
const width = '500px';
|
|
115
|
-
const [value, setValue] = useState<string>('1|m');
|
|
116
|
-
const [valueB, setValueB] = useState('|m');
|
|
117
|
-
const automaticValue = '123|km';
|
|
118
|
-
return <>
|
|
119
|
-
<h4>Different cases for automatic (placeholder) values:</h4>
|
|
120
|
-
<Row>
|
|
121
|
-
<Column width="25%">
|
|
122
|
-
<Button label="Change value to ''" onClick={() => setValue('')} />
|
|
123
|
-
<br />
|
|
124
|
-
<Button label="Change value to 1" onClick={() => setValue('1')} />
|
|
125
|
-
<br />
|
|
126
|
-
<Button label="Change value to 1|m" onClick={() => setValue('1|m')} />
|
|
127
|
-
<br />
|
|
128
|
-
<Button label="Change value to |m - empty value" onClick={() => setValue('|m')} />
|
|
129
|
-
</Column>
|
|
130
|
-
</Row>
|
|
131
|
-
<br />
|
|
132
|
-
<Field label="Normal PUI (placeholder + auto)">
|
|
133
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" autoValue={automaticValue} />
|
|
134
|
-
</Field>
|
|
135
|
-
<Field label="Normal PUI (only auto)">
|
|
136
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} autoValue={automaticValue} />
|
|
137
|
-
</Field>
|
|
138
|
-
<Field label="Empty PUI with autoValue">
|
|
139
|
-
<UnitInput name="example1" onChange={evt => setValueB(evt.target.value)} value={valueB} unitkey="length" width={width} autoValue={automaticValue} />
|
|
140
|
-
</Field>
|
|
141
|
-
<Field label="Normal PUI (only placeholder)">
|
|
142
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" />
|
|
143
|
-
</Field>
|
|
144
|
-
<Field label="Normal PUI (placeholder + allowEmpty)">
|
|
145
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" allowEmpty />
|
|
146
|
-
</Field>
|
|
147
|
-
<Message message={{
|
|
148
|
-
heading: 'Current value inside PUI: ' + value,
|
|
149
|
-
visible: true
|
|
150
|
-
}} />
|
|
151
|
-
</>;
|
|
152
|
-
}`,...(Ve=(Ie=w.parameters)==null?void 0:Ie.docs)==null?void 0:Ve.source}}};var Ae,Se,we;j.parameters={...j.parameters,docs:{...(Ae=j.parameters)==null?void 0:Ae.docs,source:{originalSource:`() => {
|
|
153
|
-
const [value, setValue] = useState('123|%');
|
|
154
|
-
const [validation, setValidation] = useState<string | null>(null);
|
|
155
|
-
const predictedMessage = 'This should be visible when an error appears';
|
|
156
|
-
const handleValidation = (name: string, error: string | null) => {
|
|
157
|
-
setValidation(error);
|
|
158
|
-
return {
|
|
159
|
-
name,
|
|
160
|
-
error
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
return <>
|
|
164
|
-
<h4>3rd party validation message when inputting invalid value:</h4>
|
|
165
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} error={!validation || predictedMessage} validationCallback={handleValidation} value={value} />
|
|
166
|
-
<br />
|
|
167
|
-
<Spacer />
|
|
168
|
-
<h4>Original validation message: </h4>
|
|
169
|
-
<Message message={{
|
|
170
|
-
heading: validation,
|
|
171
|
-
visible: true
|
|
172
|
-
}} />
|
|
173
|
-
</>;
|
|
174
|
-
}`,...(we=(Se=j.parameters)==null?void 0:Se.docs)==null?void 0:we.source}}};var je,ke,fe;k.parameters={...k.parameters,docs:{...(je=k.parameters)==null?void 0:je.docs,source:{originalSource:`() => {
|
|
175
|
-
const [value, setValue] = useState('123|m');
|
|
176
|
-
const [placeholder, setPlaceholder] = useState('');
|
|
177
|
-
const [initUnit, setInitUnit] = useState('km');
|
|
178
|
-
const setPlaceholderValue = () => {
|
|
179
|
-
setInitUnit('ft');
|
|
180
|
-
setPlaceholder('placeholder');
|
|
181
|
-
setValue('|m');
|
|
182
|
-
};
|
|
183
|
-
return <>
|
|
184
|
-
<h4>Empty value case:</h4>
|
|
185
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} allowEmpty placeholder={placeholder} initUnit={initUnit} unitkey="length" />
|
|
186
|
-
<br />
|
|
187
|
-
<Spacer />
|
|
188
|
-
<Button label="Change value |m and unit ft" onClick={() => setPlaceholderValue()} />
|
|
189
|
-
</>;
|
|
190
|
-
}`,...(fe=(ke=k.parameters)==null?void 0:ke.docs)==null?void 0:fe.source}}};var _e,Pe,Ee;f.parameters={...f.parameters,docs:{...(_e=f.parameters)==null?void 0:_e.docs,source:{originalSource:`() => {
|
|
191
|
-
const [value, setValue] = useState('123|m');
|
|
192
|
-
const [unit, setUnit] = useState('m');
|
|
193
|
-
return <>
|
|
194
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
|
|
195
|
-
<Spacer />
|
|
196
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
|
|
197
|
-
</>;
|
|
198
|
-
}`,...(Ee=(Pe=f.parameters)==null?void 0:Pe.docs)==null?void 0:Ee.source}}};const xa=["Default","InitUnit","NotKnownUnit","Width","NoConversion","Small","Error","InternalValidationError","Disabled","DisabledNoConversion","DisabledUnitWithoutUnitKey","DisabledUnitWithUnitKey","DisabledWithEnabledUnitMenu","PredefinedOptionsMenu","AutomaticValues","ValidationCallback","AllowEmptyPUI","OnSwitchUnit"];export{k as AllowEmptyPUI,w as AutomaticValues,P as Default,c as Disabled,y as DisabledNoConversion,V as DisabledUnitWithUnitKey,I as DisabledUnitWithoutUnitKey,A as DisabledWithEnabledUnitMenu,U as Error,m as InitUnit,x as InternalValidationError,C as NoConversion,h as NotKnownUnit,f as OnSwitchUnit,S as PredefinedOptionsMenu,b as Small,j as ValidationCallback,v as Width,xa as __namedExportsOrder,Ua as default};
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-eps93zm2.js";import{r as d}from"./index-DhsZuJvc.js";import{d as b}from"./index-C0x1JmaP.js";import{w as f,u as l,e as r,f as V,a as D}from"./index-DMAnyMX5.js";import{U as u}from"./unit-input-DTOrVqdm.js";import{B as o}from"./button-Cbv7WK6k.js";import{S as g}from"./spacer-BWoNR27H.js";import{D as fe}from"./divider-DY9nJ_7N.js";import{R as Ce,C as F}from"./row-Bmiy2Lh0.js";import{F as U}from"./field-HrLaMLbx.js";import{M as pe}from"./message-BRyKdRaX.js";import{G as ge}from"./grid-DRkC-bt8.js";import{C as v}from"./card-EcjmryU9.js";import{H as y}from"./heading-CRNoBc7q.js";import{T as N}from"./toggle-BbFVf61v.js";import{T as q}from"./text-B3-TSWok.js";import{S as xe}from"./select-Cwks-WA0.js";import{I as he}from"./icon-BSFY3vDO.js";import"./index-DRSy5Ssd.js";import"./index-CF7H4eMJ.js";import"./index-Bk2sglWO.js";import"./initialize-context-Y03pJPr5.js";import"./number-input-B3_gmeWr.js";import"./enum-Bnn40S8Q.js";import"./index-CEuq6vkz.js";import"./lodash-c4VUpsOs.js";import"./helpers-JJxzGegQ.js";import"./input-Db9WkmPP.js";import"./disabled-context-rmpd7YJS.js";import"./types-Dx2TtIG9.js";import"./tooltip-1V7clEnw.js";import"./index-CUZDtIZe.js";import"./actions-Bax0KeqM.js";import"./common-types-Sih75Sav.js";import"./types-BmbYqTX_.js";import"./badge-CLQ59MDF.js";import"./input-group-addon-D68iUKV2.js";import"./input-group-BaRSJAEN.js";import"./spinner-AWUe4xwQ.js";import"./styled-components.browser.esm-BQ9GQzDc.js";import"./label-CqmyC9he.js";import"./help-icon-Buhx5nl6.js";import"./inheritsLoose-DP0QEDDI.js";import"./assertThisInitialized-B9jnkVVz.js";import"./memoize-one.esm-CcMeOnPo.js";import"./select.input-CJed_LLR.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";const ht={title:"Forms/UnitInput/Test Cases",component:u,tags:["!autodocs"]},C=()=>{const[i,a]=d.useState("123|m");return e.jsx(u,{name:"example",onChange:t=>a(t.target.value),placeholder:"Type a value...",value:i,initUnit:"m",unitkey:"depth",unitTemplate:{depth:"m"},testId:"testId"})};C.play=async({canvasElement:i,step:a})=>{const t=f(i),s=f(i.ownerDocument.body);await a("Shows validation error for non-numeric input",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"123x45s6"),await r(t.getByDisplayValue("123x45s6")).toBeInTheDocument(),await r(n.getAttribute("data-error")).toEqual("Must be a numerical value"),await V.mouseOver(n),await D(()=>{r(s.getByText("Must be a numerical value")).toBeInTheDocument()})})};const x=()=>{const[i,a]=d.useState("|m");return e.jsx(u,{name:"example-ft",onChange:t=>a(t.target.value),placeholder:"7|ft",value:i,initUnit:"m",unitkey:"depth",unitTemplate:{depth:"m"},testId:"testId-ft"})};x.play=async({canvasElement:i,step:a})=>{const t=f(i),s=f(i.ownerDocument.body);await a("Handle input with unit only",async()=>{const n=t.getByTestId("testId-ft");await r(t.getByDisplayValue("")).toBeInTheDocument(),await r(n.getAttribute("data-error")).toBeNull(),await V.mouseOver(n),await D(()=>{r(s.queryByText("Must be a numerical value")).not.toBeInTheDocument()})}),await a("Clear input and check placeholder",async()=>{const n=t.getByTestId("testId-ft");await l.clear(n),await r(n).toHaveAttribute("placeholder","2.13")}),await a("Type a correct numeric value and ensure no error",async()=>{const n=t.getByTestId("testId-ft");await l.type(n,"123"),await r(t.getByDisplayValue("123")).toBeInTheDocument(),await r(n.getAttribute("data-error")).toBeNull(),await V.mouseOver(n),await D(()=>{r(s.queryByText("Must be a numerical value")).not.toBeInTheDocument()})}),await a("Remove value, type incorrect value and check for error",async()=>{const n=t.getByTestId("testId-ft");await l.clear(n),await l.type(n,"123abc"),await r(t.getByDisplayValue("123abc")).toBeInTheDocument(),await r(n.getAttribute("data-error")).toEqual("Must be a numerical value"),await V.mouseOver(n),await D(()=>{r(s.getByText("Must be a numerical value")).toBeInTheDocument()})})};const T=i=>{const[a,t]=d.useState("123|m"),[s,n]=d.useState("223|m"),[c,h]=d.useState("ft");return e.jsxs(e.Fragment,{children:[e.jsx(o,{label:"Change initUnit",onClick:()=>h(c==="m"?"ft":"m")}),e.jsx(g,{}),e.jsx(o,{label:"Change value",onClick:()=>t(a==="123|m"?"456|m":"123|m")}),e.jsx(g,{}),e.jsx(u,{name:"example",onChange:m=>{t(m.target.value)},unitkey:"length",value:a,initUnit:c,onSwitchUnit:h}),e.jsx(g,{}),e.jsx(u,{name:"example2",onChange:m=>{n(m.target.value)},unitkey:"length",value:s,initUnit:c,onSwitchUnit:h}),e.jsx(fe,{}),e.jsx("h4",{children:"Without initUnit property (taken from the redux store)"}),e.jsx(u,{name:"example",onChange:m=>{t(m.target.value)},unitkey:"length",value:a,onSwitchUnit:h}),e.jsx(u,{name:"example2",onChange:m=>{n(m.target.value)},unitkey:"length",value:s,onSwitchUnit:h})]})};T.parameters={docs:{description:{story:"[OW-4380](https://oliasoft.atlassian.net/browse/OW-4380?atlOrigin=eyJpIjoiMmM1N2RkNWU3Mjk5NDYxY2E0YzhkMzk5ZTVmZTJhMjciLCJwIjoiaiJ9)"}}};const I=()=>{const i="500px",[a,t]=d.useState(void 0);return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different edge cases such as +/- infinity, undefined, NaN, null:"}),e.jsxs(Ce,{children:[e.jsxs(F,{width:"25%",children:[e.jsx(o,{label:"Change value infinity",onClick:()=>t(1/0)}),e.jsx("br",{}),e.jsx(o,{label:"Change value -infinity",onClick:()=>t(-1/0)}),e.jsx("br",{}),e.jsx(o,{label:"Change value null",onClick:()=>t(null)}),e.jsx("br",{}),e.jsx(o,{label:"Change value - undefined",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(o,{label:"Change value - NaN",onClick:()=>t(NaN)}),e.jsx("br",{}),e.jsx(o,{label:"Change value - nothing (empty)",onClick:()=>t(void 0)}),e.jsx("br",{}),e.jsx(o,{label:"Change value - empty string",onClick:()=>t("")})]}),e.jsxs(F,{width:"25%",children:[e.jsx(o,{label:"Change value infinity|m",onClick:()=>t("Infinity|m")}),e.jsx("br",{}),e.jsx(o,{label:"Change value -infinity|m",onClick:()=>t("-Infinity|m")}),e.jsx("br",{}),e.jsx(o,{label:"Change value null|m",onClick:()=>t("null|m")}),e.jsx("br",{}),e.jsx(o,{label:"Change value - undefined|m",onClick:()=>t("undefined|m")}),e.jsx("br",{}),e.jsx(o,{label:"Change value - NaN|m",onClick:()=>t("NaN|m")}),e.jsx("br",{}),e.jsx(o,{label:"Change value - nothing (empty)|m",onClick:()=>t("|m")})]})]}),e.jsx("br",{}),e.jsx(U,{label:"Normal PUI",children:e.jsx(u,{name:"example1",onChange:s=>t(s.target.value),value:a,unitkey:"length",width:i,placeholder:"value|unit"})}),e.jsx(U,{label:"Disabled validation",children:e.jsx(u,{name:"example2",onChange:s=>t(s.target.value),value:a,unitkey:"length",disabledValidation:!0,width:i})}),e.jsx(U,{label:"Disabled validation and manual error",children:e.jsx(u,{name:"example3",onChange:s=>t(s.target.value),value:a,unitkey:"length",error:"test",disabledValidation:!0,width:i})}),e.jsx(pe,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})};I.parameters={docs:{description:{story:"[OW-8884](https://oliasoft.atlassian.net/browse/OW-8884)"}}};const j=()=>{const[i,a]=d.useState(!0),t=()=>{a(!1),setTimeout(()=>a(!0),0)},[s,n]=d.useState("123|ft");return e.jsxs(ge,{columns:"1fr 1fr",gap:!0,children:[e.jsxs(v,{heading:e.jsx(y,{children:"Storage State (Redux)"}),children:[s,e.jsx(g,{}),e.jsx(o,{label:"Change value",onClick:()=>n(b.withUnit(String(Math.floor(Math.random()*100)),"ft"))})]}),e.jsx(v,{heading:e.jsx(y,{icon:e.jsx(he,{icon:"refresh",testId:"triggerRerenderTestId"}),onIconClick:t,children:"UnitInput"}),children:i&&e.jsx(u,{name:"example",onChange:c=>n(c.target.value),value:s,initUnit:"m",unitkey:"depth",unitTemplate:{depth:"m"}})})]})},S=()=>e.jsxs(e.Fragment,{children:[e.jsx(q,{faint:!0,children:"Reproduce OW-10614 rounding noise bug when storing values in a different unit to the display unit"}),e.jsx(g,{}),e.jsx(u,{name:"example",onChange:()=>{},value:b.withUnit(b.convertAndGetValue("9750|psi","bar"),"bar"),initUnit:"psi",unitkey:"pressure",unitTemplate:{pressure:"psi"}}),e.jsx(g,{}),e.jsx(u,{name:"example2",onChange:()=>{},value:b.withUnit(b.convertAndGetValue("8642|lbf","tonneForce"),"tonneForce"),initUnit:"lbf",unitkey:"force",unitTemplate:{force:"tonneForce"}})]}),w=()=>e.jsxs(e.Fragment,{children:[e.jsx(u,{name:"example",unitkey:"moleWeight",initUnit:"g/mol",doNotConvertValue:!0,value:"170|g/mol",unitTemplate:{moleWeight:"g/mol"},testId:"case1"}),e.jsx(g,{}),e.jsx(u,{name:"gor",unitkey:"moleWeight",initUnit:"gor",value:"Infinity|SCF/STB",testId:"case2"})]});w.play=async({canvasElement:i,step:a})=>{const t=f(i);await a("Can enter decimal values",async()=>{await r(t.getByDisplayValue("170")).toBeInTheDocument(),await r(t.getByDisplayValue("")).toBeInTheDocument()})};const B=()=>{const[i,a]=d.useState(!0),t=()=>{a(!1),setTimeout(()=>a(!0),0)},[s,n]=d.useState("psi"),[c,h]=d.useState(!1),[m,ve]=d.useState(!0),[M,ye]=d.useState(!0),[R,W]=d.useState("672.2388357750001|bar"),[O,be]=d.useState("");return e.jsxs(ge,{columns:"1fr 1fr",gap:!0,children:[e.jsxs(v,{heading:e.jsx(y,{children:"Settings"}),children:[e.jsx(U,{label:"Enable display rounding:",labelLeft:!0,labelWidth:200,children:e.jsx(N,{checked:c,onChange:p=>h(p.target.checked)})}),e.jsx(U,{label:"Enable cosmetic rounding:",labelLeft:!0,labelWidth:200,children:e.jsx(N,{checked:m,onChange:p=>ve(p.target.checked)})}),e.jsx(U,{label:"Convert back to storage unit (onChange):",labelLeft:!0,labelWidth:200,children:e.jsx(N,{checked:M,onChange:p=>ye(p.target.checked)})})]}),e.jsxs(v,{heading:e.jsx(y,{icon:e.jsx(he,{icon:"refresh",testId:"triggerRerenderTestId"}),onIconClick:t,children:"UnitInput"}),children:[e.jsx(q,{faint:!0,children:"Cosmetic Rounding Test Case: type 9750 then return (compare with enableCosmeticRounding on and off)"}),e.jsx(g,{}),e.jsx(q,{warning:!0,children:"Note: UnitInput uses convertSamePrecision internally (decision prior to cosmetic value implementation). This means not all rounding noise occurrences seen in NumberInput will be reproducible in UnitInput, because they get rounded off by other logic."}),e.jsx(g,{}),i&&e.jsx(u,{name:"Example",unitkey:"pressure",initUnit:s,unitTemplate:{pressure:"psi"},value:R,onChange:p=>{const{value:E}=p.target;E&&W(E)},enableDisplayRounding:c,enableCosmeticRounding:m,error:b.convertAndGetValue(R,"bar")>=0?"":"Value must be positive",validationCallback:(p,E)=>{be(E??"")},convertBackToStorageUnit:M})]}),e.jsx(v,{heading:e.jsx(y,{children:"Unit Template"}),children:e.jsx(xe,{options:[{label:"Bar",value:"bar"},{label:"psi",value:"psi"}],value:s,width:70,onChange:p=>n(p.target.value)})}),e.jsx(v,{heading:e.jsx(y,{children:"Test Validation Callback"}),children:O&&e.jsx(pe,{message:{content:O,icon:!0,type:"Error",visible:!0}})}),e.jsxs(v,{heading:e.jsx(y,{children:"Storage State / Redux"}),children:[R,e.jsx(g,{}),e.jsx(o,{label:"Change value",onClick:()=>W(b.withUnit(String(Math.floor(Math.random()*100)),"bar"))})]})]})},k=()=>{const[i,a]=d.useState("123|m");return e.jsx(u,{name:"example",onChange:t=>a(t.target.value),value:i,initUnit:"m",unitkey:"depth",unitTemplate:{depth:"m"},testId:"testId"})};k.play=async({canvasElement:i,step:a})=>{const t=f(i),s=f(i.ownerDocument.body);await a("Can enter decimal values",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"123.123456789"),await r(t.getByDisplayValue("123.123456789")).toBeInTheDocument()}),await a("Can enter scientific notation",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"-1.12e3"),await r(t.getByDisplayValue("-1.12e3")).toBeInTheDocument()}),await a("Can enter comma decimals (converts to dot)",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"123,456"),await r(t.getByDisplayValue("123.456")).toBeInTheDocument()}),await a("Can enter small numbers",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"0.0000000023"),await r(t.getByDisplayValue("0.0000000023")).toBeInTheDocument()}),await a("Can enter large numbers",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"999999999999"),await r(t.getByDisplayValue("999999999999")).toBeInTheDocument()}),await a("Can convert units",async()=>{const n=t.getByTestId("testId"),c=t.getByTestId("testId-menu");await l.clear(n),await l.type(n,"456.1"),await l.click(c),await l.click(s.getByTestId("testId-unit-ft")),await r(t.getByDisplayValue("1496")).toBeInTheDocument()}),await a("Shows validation error for non-numeric input",async()=>{const n=t.getByTestId("testId");await l.clear(n),await l.type(n,"123x45s6"),await r(t.getByDisplayValue("123x45s6")).toBeInTheDocument(),await r(n.getAttribute("data-error")).toEqual("Must be a numerical value"),await V.mouseOver(n),await D(()=>{r(s.getByText("Must be a numerical value")).toBeInTheDocument()})})};C.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"Placeholder"};x.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"PlaceholderWithUnit"};T.__docgenInfo={description:"",methods:[],displayName:"TestExternalStateChangeWithSynchronizedUnits",props:{name:{required:!0,tsType:{name:"union",raw:"string | { fieldName?: string }",elements:[{name:"string"},{name:"signature",type:"object",raw:"{ fieldName?: string }",signature:{properties:[{key:"fieldName",value:{name:"string",required:!1}}]}}]},description:""},placeholder:{required:!1,tsType:{name:"string"},description:""},disabled:{required:!1,tsType:{name:"boolean"},description:""},disabledUnit:{required:!1,tsType:{name:"boolean"},description:""},error:{required:!1,tsType:{name:"union",raw:"string | null | boolean",elements:[{name:"string"},{name:"null"},{name:"boolean"}]},description:""},left:{required:!1,tsType:{name:"boolean"},description:""},small:{required:!1,tsType:{name:"boolean"},description:""},width:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:""},value:{required:!1,tsType:{name:"string"},description:""},unitkey:{required:!1,tsType:{name:"string"},description:""},initUnit:{required:!1,tsType:{name:"string"},description:""},noConversion:{required:!1,tsType:{name:"boolean"},description:""},doNotConvertValue:{required:!1,tsType:{name:"boolean"},description:""},testId:{required:!1,tsType:{name:"string"},description:""},warning:{required:!1,tsType:{name:"union",raw:"string | boolean | null",elements:[{name:"string"},{name:"boolean"},{name:"null"}]},description:""},predefinedOptions:{required:!1,tsType:{name:"union",raw:"IPredefinedOption[] | null",elements:[{name:"Array",elements:[{name:"IPredefinedOption"}],raw:"IPredefinedOption[]"},{name:"null"}]},description:""},initialPredefinedOption:{required:!1,tsType:{name:"boolean"},description:""},shouldLinkAutomaticly:{required:!1,tsType:{name:"boolean"},description:""},selectedPredefinedOptionKey:{required:!1,tsType:{name:"string"},description:""},validationCallback:{required:!1,tsType:{name:"signature",type:"function",raw:"(name: string, error: string | null) => any",signature:{arguments:[{type:{name:"string"},name:"name"},{type:{name:"union",raw:"string | null",elements:[{name:"string"},{name:"null"}]},name:"error"}],return:{name:"any"}}},description:""},disabledValidation:{required:!1,tsType:{name:"boolean"},description:""},allowEmpty:{required:!1,tsType:{name:"boolean"},description:""},autoValue:{required:!1,tsType:{name:"string"},description:""},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(evt: TOnChangeEvent) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ target: TOnChangeEventTarget }",signature:{properties:[{key:"target",value:{name:"union",raw:`| TOnChangeEventBaseTarget
|
|
2
|
-
| (TOnChangeEventBaseTarget & {
|
|
3
|
-
predefinedSelected: boolean;
|
|
4
|
-
predefinedOption: IPredefinedOption;
|
|
5
|
-
})`,elements:[{name:"signature",type:"object",raw:"{ name: string; value: string }",signature:{properties:[{key:"name",value:{name:"string",required:!0}},{key:"value",value:{name:"string",required:!0}}]}},{name:"unknown"}],required:!0}}]}},name:"evt"}],return:{name:"void"}}},description:""},onSwitchUnit:{required:!1,tsType:{name:"signature",type:"function",raw:"(unit: string) => void",signature:{arguments:[{type:{name:"string"},name:"unit"}],return:{name:"void"}}},description:""},onClick:{required:!1,tsType:{name:"MouseEventHandler",elements:[{name:"HTMLInputElement"}],raw:"MouseEventHandler<HTMLInputElement>"},description:""},onFocus:{required:!1,tsType:{name:"FocusEventHandler",elements:[{name:"HTMLInputElement"}],raw:"FocusEventHandler<HTMLInputElement>"},description:""},unitTemplate:{required:!1,tsType:{name:"Record",elements:[{name:"string"},{name:"any"}],raw:"Record<string, any>"},description:""},convertBackToStorageUnit:{required:!1,tsType:{name:"boolean"},description:""},enableCosmeticRounding:{required:!1,tsType:{name:"boolean"},description:""},enableDisplayRounding:{required:!1,tsType:{name:"boolean"},description:""}}};I.__docgenInfo={description:"",methods:[],displayName:"TestEdgeCases"};j.__docgenInfo={description:"",methods:[],displayName:"ManagedTestCase"};S.__docgenInfo={description:"",methods:[],displayName:"OW_10614TestCase"};w.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"OW_17784TestCase"};B.__docgenInfo={description:"",methods:[],displayName:"DemoCosmeticRounding"};k.__docgenInfo={description:"",methods:[{name:"play",docblock:null,modifiers:["static"],params:[{name:"{ canvasElement, step }",optional:!1,type:null}],returns:null}],displayName:"TestUserInput"};var _,H,P;C.parameters={...C.parameters,docs:{...(_=C.parameters)==null?void 0:_.docs,source:{originalSource:`() => {
|
|
6
|
-
const [value, setValue] = useState('123|m');
|
|
7
|
-
return <UnitInput name="example" onChange={evt => setValue(evt.target.value)} placeholder="Type a value..." value={value} initUnit="m" unitkey="depth" unitTemplate={{
|
|
8
|
-
depth: 'm'
|
|
9
|
-
}} testId="testId" />;
|
|
10
|
-
}`,...(P=(H=C.parameters)==null?void 0:H.docs)==null?void 0:P.source}}};var A,G,L;x.parameters={...x.parameters,docs:{...(A=x.parameters)==null?void 0:A.docs,source:{originalSource:`() => {
|
|
11
|
-
const [value, setValue] = useState('|m');
|
|
12
|
-
return <UnitInput name="example-ft" onChange={evt => setValue(evt.target.value)} placeholder="7|ft" value={value} initUnit="m" unitkey="depth" unitTemplate={{
|
|
13
|
-
depth: 'm'
|
|
14
|
-
}} testId="testId-ft" />;
|
|
15
|
-
}`,...(L=(G=x.parameters)==null?void 0:G.docs)==null?void 0:L.source}}};var z,J,Y;T.parameters={...T.parameters,docs:{...(z=T.parameters)==null?void 0:z.docs,source:{originalSource:`(args: IUnitInputProps) => {
|
|
16
|
-
const [value, setValue] = useState('123|m');
|
|
17
|
-
const [value2, setValue2] = useState('223|m');
|
|
18
|
-
const [initUnit, setInitUnit] = useState('ft');
|
|
19
|
-
return <>
|
|
20
|
-
<Button label="Change initUnit" onClick={() => setInitUnit(initUnit === 'm' ? 'ft' : 'm')} />
|
|
21
|
-
<Spacer />
|
|
22
|
-
<Button label="Change value" onClick={() => setValue(value === '123|m' ? '456|m' : '123|m')} />
|
|
23
|
-
<Spacer />
|
|
24
|
-
<UnitInput name="example" onChange={evt => {
|
|
25
|
-
setValue(evt.target.value);
|
|
26
|
-
}} unitkey="length" value={value} initUnit={initUnit} onSwitchUnit={setInitUnit} />
|
|
27
|
-
<Spacer />
|
|
28
|
-
<UnitInput name="example2" onChange={evt => {
|
|
29
|
-
setValue2(evt.target.value);
|
|
30
|
-
}} unitkey="length" value={value2} initUnit={initUnit} onSwitchUnit={setInitUnit} />
|
|
31
|
-
<Divider />
|
|
32
|
-
<h4>Without initUnit property (taken from the redux store)</h4>
|
|
33
|
-
<UnitInput name="example" onChange={evt => {
|
|
34
|
-
setValue(evt.target.value);
|
|
35
|
-
}} unitkey="length" value={value} onSwitchUnit={setInitUnit} />
|
|
36
|
-
<UnitInput name="example2" onChange={evt => {
|
|
37
|
-
setValue2(evt.target.value);
|
|
38
|
-
}} unitkey="length" value={value2} onSwitchUnit={setInitUnit} />
|
|
39
|
-
</>;
|
|
40
|
-
}`,...(Y=(J=T.parameters)==null?void 0:J.docs)==null?void 0:Y.source}}};var Z,K,Q;I.parameters={...I.parameters,docs:{...(Z=I.parameters)==null?void 0:Z.docs,source:{originalSource:`() => {
|
|
41
|
-
const width = '500px';
|
|
42
|
-
const [value, setValue] = useState<any>(undefined);
|
|
43
|
-
return <>
|
|
44
|
-
<h4>Different edge cases such as +/- infinity, undefined, NaN, null:</h4>
|
|
45
|
-
<Row>
|
|
46
|
-
<Column width="25%">
|
|
47
|
-
<Button label="Change value infinity" onClick={() => setValue(Infinity)} />
|
|
48
|
-
<br />
|
|
49
|
-
<Button label="Change value -infinity" onClick={() => setValue(-Infinity)} />
|
|
50
|
-
<br />
|
|
51
|
-
<Button label="Change value null" onClick={() => setValue(null)} />
|
|
52
|
-
<br />
|
|
53
|
-
<Button label="Change value - undefined" onClick={() => setValue(undefined)} />
|
|
54
|
-
<br />
|
|
55
|
-
<Button label="Change value - NaN" onClick={() => setValue(NaN)} />
|
|
56
|
-
<br />
|
|
57
|
-
<Button label="Change value - nothing (empty)" onClick={() => setValue(undefined)} />
|
|
58
|
-
<br />
|
|
59
|
-
<Button label="Change value - empty string" onClick={() => setValue('')} />
|
|
60
|
-
</Column>
|
|
61
|
-
<Column width="25%">
|
|
62
|
-
<Button label="Change value infinity|m" onClick={() => setValue(Infinity + '|m')} />
|
|
63
|
-
<br />
|
|
64
|
-
<Button label="Change value -infinity|m" onClick={() => setValue(-Infinity + '|m')} />
|
|
65
|
-
<br />
|
|
66
|
-
<Button label="Change value null|m" onClick={() => setValue(null + '|m')} />
|
|
67
|
-
<br />
|
|
68
|
-
<Button label="Change value - undefined|m" onClick={() => setValue(undefined + '|m')} />
|
|
69
|
-
<br />
|
|
70
|
-
<Button label="Change value - NaN|m" onClick={() => setValue(NaN + '|m')} />
|
|
71
|
-
<br />
|
|
72
|
-
<Button label="Change value - nothing (empty)|m" onClick={() => setValue('|m')} />
|
|
73
|
-
</Column>
|
|
74
|
-
</Row>
|
|
75
|
-
<br />
|
|
76
|
-
<Field label="Normal PUI">
|
|
77
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" />
|
|
78
|
-
</Field>
|
|
79
|
-
<Field label="Disabled validation">
|
|
80
|
-
<UnitInput name="example2" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" disabledValidation width={width} />
|
|
81
|
-
</Field>
|
|
82
|
-
<Field label="Disabled validation and manual error">
|
|
83
|
-
<UnitInput name="example3" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" error="test" disabledValidation width={width} />
|
|
84
|
-
</Field>
|
|
85
|
-
<Message message={{
|
|
86
|
-
heading: 'Current value inside PUI: ' + value,
|
|
87
|
-
visible: true
|
|
88
|
-
}} />
|
|
89
|
-
</>;
|
|
90
|
-
}`,...(Q=(K=I.parameters)==null?void 0:K.docs)==null?void 0:Q.source}}};var X,$,ee;j.parameters={...j.parameters,docs:{...(X=j.parameters)==null?void 0:X.docs,source:{originalSource:`() => {
|
|
91
|
-
const [visible, setVisible] = useState(true);
|
|
92
|
-
const triggerRerender = () => {
|
|
93
|
-
setVisible(false);
|
|
94
|
-
setTimeout(() => setVisible(true), 0);
|
|
95
|
-
};
|
|
96
|
-
const [value, setValue] = useState('123|ft');
|
|
97
|
-
return <Grid columns="1fr 1fr" gap>
|
|
98
|
-
<Card heading={<Heading>Storage State (Redux)</Heading>}>
|
|
99
|
-
{value}
|
|
100
|
-
<Spacer />
|
|
101
|
-
<Button label="Change value" onClick={() => setValue(withUnit(String(Math.floor(Math.random() * 100)), 'ft'))} />
|
|
102
|
-
</Card>
|
|
103
|
-
<Card heading={<Heading icon={<Icon icon="refresh" testId="triggerRerenderTestId" />} onIconClick={triggerRerender}>
|
|
104
|
-
UnitInput
|
|
105
|
-
</Heading>}>
|
|
106
|
-
{visible && <UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit="m" unitkey="depth" unitTemplate={{
|
|
107
|
-
depth: 'm'
|
|
108
|
-
}} />}
|
|
109
|
-
</Card>
|
|
110
|
-
</Grid>;
|
|
111
|
-
}`,...(ee=($=j.parameters)==null?void 0:$.docs)==null?void 0:ee.source}}};var te,ne,ae;S.parameters={...S.parameters,docs:{...(te=S.parameters)==null?void 0:te.docs,source:{originalSource:`() => {
|
|
112
|
-
return <>
|
|
113
|
-
<Text faint>
|
|
114
|
-
Reproduce OW-10614 rounding noise bug when storing values in a different
|
|
115
|
-
unit to the display unit
|
|
116
|
-
</Text>
|
|
117
|
-
<Spacer />
|
|
118
|
-
<UnitInput name="example" onChange={() => {}} value={withUnit(convertAndGetValue('9750|psi', 'bar'), 'bar')} initUnit="psi" unitkey="pressure" unitTemplate={{
|
|
119
|
-
pressure: 'psi'
|
|
120
|
-
}} />
|
|
121
|
-
<Spacer />
|
|
122
|
-
<UnitInput name="example2" onChange={() => {}} value={withUnit(convertAndGetValue('8642|lbf', 'tonneForce'), 'tonneForce')} initUnit="lbf" unitkey="force" unitTemplate={{
|
|
123
|
-
force: 'tonneForce'
|
|
124
|
-
}} />
|
|
125
|
-
</>;
|
|
126
|
-
}`,...(ae=(ne=S.parameters)==null?void 0:ne.docs)==null?void 0:ae.source}}};var ie,re,se;w.parameters={...w.parameters,docs:{...(ie=w.parameters)==null?void 0:ie.docs,source:{originalSource:`() => {
|
|
127
|
-
return <>
|
|
128
|
-
<UnitInput name="example" unitkey="moleWeight" initUnit="g/mol" doNotConvertValue //reproduces OW_17784
|
|
129
|
-
value="170|g/mol" unitTemplate={{
|
|
130
|
-
moleWeight: 'g/mol'
|
|
131
|
-
}} testId="case1" />
|
|
132
|
-
<Spacer />
|
|
133
|
-
<UnitInput name="gor" unitkey="moleWeight" initUnit="gor" value="Infinity|SCF/STB" testId="case2" />
|
|
134
|
-
</>;
|
|
135
|
-
}`,...(se=(re=w.parameters)==null?void 0:re.docs)==null?void 0:se.source}}};var le,oe,ue;B.parameters={...B.parameters,docs:{...(le=B.parameters)==null?void 0:le.docs,source:{originalSource:`() => {
|
|
136
|
-
const [visible, setVisible] = useState(true);
|
|
137
|
-
const triggerRerender = () => {
|
|
138
|
-
setVisible(false);
|
|
139
|
-
setTimeout(() => setVisible(true), 0);
|
|
140
|
-
};
|
|
141
|
-
const [preferredUnit, setPreferredUnit] = useState('psi');
|
|
142
|
-
const [enableDisplayRounding, setEnableDisplayRounding] = useState(false);
|
|
143
|
-
const [enableCosmeticRounding, setEnableCosmeticRounding] = useState(true);
|
|
144
|
-
const [convertBackToStorageUnit, setConvertBackToStorageUnit] = useState(true);
|
|
145
|
-
const [value, setValue] = useState('672.2388357750001|bar');
|
|
146
|
-
const [callBackError, setCallBackError] = useState('');
|
|
147
|
-
return <Grid columns="1fr 1fr" gap>
|
|
148
|
-
<Card heading={<Heading>Settings</Heading>}>
|
|
149
|
-
<Field label="Enable display rounding:" labelLeft labelWidth={200}>
|
|
150
|
-
<Toggle checked={enableDisplayRounding} onChange={evt => setEnableDisplayRounding(evt.target.checked)} />
|
|
151
|
-
</Field>
|
|
152
|
-
<Field label="Enable cosmetic rounding:" labelLeft labelWidth={200}>
|
|
153
|
-
<Toggle checked={enableCosmeticRounding} onChange={evt => setEnableCosmeticRounding(evt.target.checked)} />
|
|
154
|
-
</Field>
|
|
155
|
-
<Field label="Convert back to storage unit (onChange):" labelLeft labelWidth={200}>
|
|
156
|
-
<Toggle checked={convertBackToStorageUnit} onChange={evt => setConvertBackToStorageUnit(evt.target.checked)} />
|
|
157
|
-
</Field>
|
|
158
|
-
</Card>
|
|
159
|
-
<Card heading={<Heading icon={<Icon icon="refresh" testId="triggerRerenderTestId" />} onIconClick={triggerRerender}>
|
|
160
|
-
UnitInput
|
|
161
|
-
</Heading>}>
|
|
162
|
-
<Text faint>
|
|
163
|
-
Cosmetic Rounding Test Case: type 9750 then return (compare with
|
|
164
|
-
enableCosmeticRounding on and off)
|
|
165
|
-
</Text>
|
|
166
|
-
<Spacer />
|
|
167
|
-
<Text warning>
|
|
168
|
-
Note: UnitInput uses convertSamePrecision internally (decision prior
|
|
169
|
-
to cosmetic value implementation). This means not all rounding noise
|
|
170
|
-
occurrences seen in NumberInput will be reproducible in UnitInput,
|
|
171
|
-
because they get rounded off by other logic.
|
|
172
|
-
</Text>
|
|
173
|
-
<Spacer />
|
|
174
|
-
{visible && <UnitInput name="Example" unitkey="pressure" initUnit={preferredUnit} unitTemplate={{
|
|
175
|
-
pressure: 'psi'
|
|
176
|
-
}} value={value} onChange={evt => {
|
|
177
|
-
const {
|
|
178
|
-
value
|
|
179
|
-
} = evt.target;
|
|
180
|
-
if (value) {
|
|
181
|
-
setValue(value);
|
|
182
|
-
}
|
|
183
|
-
}} enableDisplayRounding={enableDisplayRounding} enableCosmeticRounding={enableCosmeticRounding} error={convertAndGetValue(value, 'bar') >= 0 ? '' : 'Value must be positive'} validationCallback={(name, error) => {
|
|
184
|
-
setCallBackError(error ?? '');
|
|
185
|
-
}} convertBackToStorageUnit={convertBackToStorageUnit} />}
|
|
186
|
-
</Card>
|
|
187
|
-
<Card heading={<Heading>Unit Template</Heading>}>
|
|
188
|
-
<Select options={[{
|
|
189
|
-
label: 'Bar',
|
|
190
|
-
value: 'bar'
|
|
191
|
-
}, {
|
|
192
|
-
label: 'psi',
|
|
193
|
-
value: 'psi'
|
|
194
|
-
}]} value={preferredUnit} width={70} onChange={evt => setPreferredUnit(evt.target.value)} />
|
|
195
|
-
</Card>
|
|
196
|
-
<Card heading={<Heading>Test Validation Callback</Heading>}>
|
|
197
|
-
{callBackError && <Message message={{
|
|
198
|
-
content: callBackError,
|
|
199
|
-
icon: true,
|
|
200
|
-
type: 'Error',
|
|
201
|
-
visible: true
|
|
202
|
-
}} />}
|
|
203
|
-
</Card>
|
|
204
|
-
<Card heading={<Heading>Storage State / Redux</Heading>}>
|
|
205
|
-
{value}
|
|
206
|
-
<Spacer />
|
|
207
|
-
<Button label="Change value" onClick={() => setValue(withUnit(String(Math.floor(Math.random() * 100)), 'bar'))} />
|
|
208
|
-
</Card>
|
|
209
|
-
</Grid>;
|
|
210
|
-
}`,...(ue=(oe=B.parameters)==null?void 0:oe.docs)==null?void 0:ue.source}}};var de,ce,me;k.parameters={...k.parameters,docs:{...(de=k.parameters)==null?void 0:de.docs,source:{originalSource:`() => {
|
|
211
|
-
const [value, setValue] = useState('123|m');
|
|
212
|
-
return <UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit="m" unitkey="depth" unitTemplate={{
|
|
213
|
-
depth: 'm'
|
|
214
|
-
}} testId="testId" />;
|
|
215
|
-
}`,...(me=(ce=k.parameters)==null?void 0:ce.docs)==null?void 0:me.source}}};const vt=["Placeholder","PlaceholderWithUnit","TestExternalStateChangeWithSynchronizedUnits","TestEdgeCases","ManagedTestCase","OW_10614TestCase","OW_17784TestCase","DemoCosmeticRounding","TestUserInput"];export{B as DemoCosmeticRounding,j as ManagedTestCase,S as OW_10614TestCase,w as OW_17784TestCase,C as Placeholder,x as PlaceholderWithUnit,I as TestEdgeCases,T as TestExternalStateChangeWithSynchronizedUnits,k as TestUserInput,vt as __namedExportsOrder,ht as default};
|