@oliasoft-open-source/react-ui-library 4.5.0 → 4.5.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/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/storybook/assets/{Color-6VNJS4EI-HEi_eHev.js → Color-6VNJS4EI-hAS5LjG0.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-NNNQARDV-inNf3vhV.js → DocsRenderer-NNNQARDV-t6iXcjlI.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-4HIR6TLV-YjRbtiQd.js → WithTooltip-4HIR6TLV-EXM_UisT.js} +1 -1
- package/dist/storybook/assets/{accordion.stories-DAmwlTmm.js → accordion.stories-HoiQl98a.js} +1 -1
- package/dist/storybook/assets/{afe.stories-YefEu4ve.js → afe.stories-n9sXDAMv.js} +1 -1
- package/dist/storybook/assets/{blowout.stories-FLPAE9fr.js → blowout.stories-ro9WCHli.js} +1 -1
- package/dist/storybook/assets/{buttons-and-links-M1gBHZkR.js → buttons-and-links-ftv0zbwN.js} +1 -1
- package/dist/storybook/assets/{casing-loads.stories-7fO3E08h.js → casing-loads.stories-ONI2BhpU.js} +1 -1
- package/dist/storybook/assets/{cell.stories-S9IDsuIA.js → cell.stories-FGJr13HC.js} +1 -1
- package/dist/storybook/assets/{chunk-HLWAVYOI-H4e42Z9I.js → chunk-HLWAVYOI-jhhGhXKB.js} +1 -1
- package/dist/storybook/assets/{color-heFzWL2m.js → color-4GYIInYi.js} +1 -1
- package/dist/storybook/assets/{drawer.stories-HJN51eTr.js → drawer.stories-a2C35tbD.js} +1 -1
- package/dist/storybook/assets/{footer.stories-4uhW-z_4.js → footer.stories-nCkpV7Yt.js} +1 -1
- package/dist/storybook/assets/{formation.stories-PmRbjLVy.js → formation.stories-R3W7H_Rc.js} +1 -1
- package/dist/storybook/assets/{formatter-SWP5E3XI-PYpdbOxZ.js → formatter-SWP5E3XI-nDlvV_yz.js} +1 -1
- package/dist/storybook/assets/iframe-fZf8RXY8.js +7 -0
- package/dist/storybook/assets/{index-kEA1EH0x.js → index-J809fMmq.js} +5 -5
- package/dist/storybook/assets/{input-validation-SIDSAFaH.js → input-validation-KCJCN0yQ.js} +1 -1
- package/dist/storybook/assets/{inputs-Q-JCPEm_.js → inputs-5Dsixbp9.js} +1 -1
- package/dist/storybook/assets/{layout-forms-sTxS59Zq.js → layout-forms-hLUZFgjt.js} +1 -1
- package/dist/storybook/assets/{layout-general-82Ja2Lb_.js → layout-general-pWHB8pQP.js} +1 -1
- package/dist/storybook/assets/{list-5kbN7yr8.js → list-FJ7byNrg.js} +1 -1
- package/dist/storybook/assets/{list.stories-a1qTCCEj.js → list.stories-nWamVbJ2.js} +1 -1
- package/dist/storybook/assets/{padding-and-spacing-CLf0dRGb.js → padding-and-spacing-PD_4uQcK.js} +1 -1
- package/dist/storybook/assets/{page.stories-eHXLB7iO.js → page.stories-B5gzoAi8.js} +1 -1
- package/dist/storybook/assets/{preview-niHg4y_T.js → preview-cyb8LEBC.js} +1 -1
- package/dist/storybook/assets/{preview-kCAXH-J5.js → preview-jdsgMyUk.js} +2 -2
- package/dist/storybook/assets/{projects.stories-GYkShoTB.js → projects.stories-UU4irLQZ.js} +1 -1
- package/dist/storybook/assets/{reservoirs.stories-ZhxgN63G.js → reservoirs.stories-iKvudcEf.js} +1 -1
- package/dist/storybook/assets/{row.stories-HVr8m6RK.js → row.stories-J389Ezfp.js} +1 -1
- package/dist/storybook/assets/{site.stories-AbEac__s.js → site.stories-4pPVEtn7.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-NMPM6SWI-q5ulcVwD.js → syntaxhighlighter-NMPM6SWI-Bt8NQoOb.js} +1 -1
- package/dist/storybook/assets/{table-_jWgMFOi.js → table-fX2iU96a.js} +1 -1
- package/dist/storybook/assets/{table.stories-lwqVUJHa.js → table.stories-CIbyraqh.js} +1 -1
- package/dist/storybook/assets/{title.stories-Djnk3crF.js → title.stories-nSN4OumV.js} +1 -1
- package/dist/storybook/assets/{top-bar-uqbsCAt-.js → top-bar-0fDAFWyC.js} +1 -1
- package/dist/storybook/assets/{top-bar.stories-lt8T4EVJ.js → top-bar.stories-YKtteM_h.js} +1 -1
- package/dist/storybook/assets/{top-bar.testcase.stories-_Nc_6uY7.js → top-bar.testcase.stories-Z-6C5D2R.js} +1 -1
- package/dist/storybook/assets/unit-input.stories-0l2v-aF9.js +273 -0
- package/dist/storybook/assets/unit-table.stories-62i0bHyO.js +103 -0
- package/dist/storybook/assets/use-previous-VKMmnaK7.js +1 -0
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/index.json +1 -1
- package/dist/storybook/project.json +1 -1
- package/dist/storybook/stories.json +1 -1
- package/package.json +3 -3
- package/dist/storybook/assets/iframe-IZZyfjHT.js +0 -7
- package/dist/storybook/assets/unit-input.stories-ZdrR9JWT.js +0 -273
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "Reusable UI components for React projects",
|
|
5
5
|
"homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
|
|
6
6
|
"bugs": {
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@oliasoft-open-source/eslint-config-oliasoft": "^1.0.4",
|
|
84
|
-
"@oliasoft-open-source/units": "^3.
|
|
84
|
+
"@oliasoft-open-source/units": "^3.12.0",
|
|
85
85
|
"@storybook/addon-actions": "^7.5.3",
|
|
86
86
|
"@storybook/addon-essentials": "^7.5.3",
|
|
87
87
|
"@storybook/addon-links": "^7.5.3",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"vitest": "^1.0.0"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
139
|
-
"@oliasoft-open-source/units": "^3.
|
|
139
|
+
"@oliasoft-open-source/units": "^3.12.0",
|
|
140
140
|
"immer": "^9",
|
|
141
141
|
"lodash": "^4",
|
|
142
142
|
"prop-types": "^15",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import"../sb-preview/runtime.js";(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))m(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const e of r.addedNodes)e.tagName==="LINK"&&e.rel==="modulepreload"&&m(e)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function m(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();const d="modulepreload",O=function(s,i){return new URL(s,i).href},l={},t=function(i,n,m){let o=Promise.resolve();if(n&&n.length>0){const r=document.getElementsByTagName("link");o=Promise.all(n.map(e=>{if(e=O(e,m),e in l)return;l[e]=!0;const c=e.endsWith(".css"),E=c?'[rel="stylesheet"]':"";if(!!m)for(let p=r.length-1;p>=0;p--){const a=r[p];if(a.href===e&&(!c||a.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${E}`))return;const _=document.createElement("link");if(_.rel=c?"stylesheet":d,c||(_.as="script",_.crossOrigin=""),_.href=e,document.head.appendChild(_),c)return new Promise((p,a)=>{_.addEventListener("load",p),_.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${e}`)))})}))}return o.then(()=>i()).catch(r=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=r,window.dispatchEvent(e),!e.defaultPrevented)throw r})},{createBrowserChannel:y}=__STORYBOOK_MODULE_CHANNELS__,{addons:R}=__STORYBOOK_MODULE_PREVIEW_API__,u=y({page:"preview"});R.setChannel(u);window.__STORYBOOK_ADDONS_CHANNEL__=u;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=u);const P={"./src/components/padding-and-spacing.mdx":async()=>t(()=>import("./padding-and-spacing-CLf0dRGb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),"./src/components/layout-general.mdx":async()=>t(()=>import("./layout-general-82Ja2Lb_.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,9]),import.meta.url),"./src/components/layout-forms.mdx":async()=>t(()=>import("./layout-forms-sTxS59Zq.js"),__vite__mapDeps([40,1,2,3,4,5,6,7,8,41,42,14,43,15,37,23,24,19,20,21,16,22,38,44,45,46,47,48,49,26,27,50,51,52,53,54,13,17,18,25,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,9]),import.meta.url),"./src/components/inputs.mdx":async()=>t(()=>import("./inputs-Q-JCPEm_.js"),__vite__mapDeps([80,1,2,3,4,5,6,7,8,81,12,13,14,15,16,17,18,19,20,21,22,23,24,25,82,60,37,38,61,83,66,67,46,47,48,49,84,85,86,74,75,87,88,89,90,91,92,68,69,51,52,53,26,27,54,55,56,57,58,59,93,94,95,96,97,76,77,98,99,70,71,72,73,100,101,64,65,9]),import.meta.url),"./src/components/input-validation.mdx":async()=>t(()=>import("./input-validation-SIDSAFaH.js"),__vite__mapDeps([102,1,2,3,4,5,6,7,8,98,51,14,15,16,47,48,23,24,21,52,53,26,27,54,13,17,18,19,20,22,25,55,56,57,58,59,84,9]),import.meta.url),"./src/components/buttons-and-links.mdx":async()=>t(()=>import("./buttons-and-links-M1gBHZkR.js"),__vite__mapDeps([103,1,2,3,4,5,6,7,8,81,12,13,14,15,16,17,18,19,20,21,22,23,24,25,104,26,27,9]),import.meta.url),"./src/components/color/color.mdx":async()=>t(()=>import("./color-heFzWL2m.js"),__vite__mapDeps([105,1,2,106,107,4,3,5,6,7,8,108,85,14,15,19,20,21,16,22,86,109,9]),import.meta.url),"./src/components/unit-input/unit-input.stories.tsx":async()=>t(()=>import("./unit-input.stories-ZdrR9JWT.js"),__vite__mapDeps([110,1,2,91,92,14,54,48,15,16,13,17,18,19,7,20,21,22,23,4,24,25,53,47,55,56,57,68,69,66,67,84,26,27,46,49,94,95,34,30,35,42,43,37,38,44,45,85,86,111]),import.meta.url),"./src/components/tree/tree.stories.tsx":async()=>t(()=>import("./tree.stories-5fjCVN1S.js"),__vite__mapDeps([112,1,2,19,14,7,20,21,16,22,92,15,113,55,56,23,4,24,36,37,38,39,54,48,13,17,18,25,53,47,57,114,115,71,26,27,116]),import.meta.url),"./src/components/top-bar/top-bar.testcase.stories.tsx":async()=>t(()=>import("./top-bar.testcase.stories-_Nc_6uY7.js"),__vite__mapDeps([117,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,120]),import.meta.url),"./src/components/top-bar/top-bar.stories.tsx":async()=>t(()=>import("./top-bar.stories-lt8T4EVJ.js"),__vite__mapDeps([121,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,120,122]),import.meta.url),"./src/components/tooltip/tooltip.test-case.stories.tsx":async()=>t(()=>import("./tooltip.test-case.stories-y-bQOM0s.js"),__vite__mapDeps([123,1,2,23,4,14,24,54,48,15,16,13,17,18,19,7,20,21,22,25,53,47,55,56,57,124,12]),import.meta.url),"./src/components/tooltip/tooltip.stories.tsx":async()=>t(()=>import("./tooltip.stories-gTfOeEzv.js"),__vite__mapDeps([125,1,2,23,4,14,24]),import.meta.url),"./src/components/toggle/toggle.stories.tsx":async()=>t(()=>import("./toggle.stories-LC6LSCD2.js"),__vite__mapDeps([101,1,2,12,26,14,27,64,15,16,37,23,4,24,19,7,20,21,22,38,65]),import.meta.url),"./src/components/toaster/toaster.stories.tsx":async()=>t(()=>import("./toaster.stories-ft_M65x0.js"),__vite__mapDeps([126,1,2,29,30,20,26,14,27,12,108,4,85,15,19,7,21,16,22,86,109,13,17,18,23,24,25,84]),import.meta.url),"./src/components/textarea/textarea.stories.tsx":async()=>t(()=>import("./textarea.stories-twGqf34D.js"),__vite__mapDeps([100,1,2,74,14,47,48,16,23,4,24,75]),import.meta.url),"./src/components/text-link/text-link.stories.tsx":async()=>t(()=>import("./text-link.stories-kjfUeFtk.js"),__vite__mapDeps([104,1,2,26,14,27]),import.meta.url),"./src/components/text/text.stories.tsx":async()=>t(()=>import("./text.stories-4JGfMLkI.js"),__vite__mapDeps([127,1,2,26,14,27]),import.meta.url),"./src/components/tabs/tabs.stories.tsx":async()=>t(()=>import("./tabs.stories-KtJc5Yci.js"),__vite__mapDeps([128,1,2,129,14,16,55,56,58,53,130]),import.meta.url),"./src/components/table/table.stories.tsx":async()=>t(()=>import("./table.stories-lwqVUJHa.js"),__vite__mapDeps([131,1,2,132,48,29,30,20,26,14,27,133,134,7,5,115,71,4,52,19,21,16,22,54,15,13,17,18,23,24,25,53,47,55,56,57,36,37,38,39,135,51,6,58,59,46,49,66,67,68,69,136,90,91,92,60,61,70,72,73,137,138,139,31,32,42,43,44,45,140,12]),import.meta.url),"./src/components/spinner/spinner.stories.tsx":async()=>t(()=>import("./spinner.stories-w5R_Yjfw.js"),__vite__mapDeps([141,1,2,17,18]),import.meta.url),"./src/components/slider/slider.stories.tsx":async()=>t(()=>import("./slider.stories-QyyBB_rz.js"),__vite__mapDeps([99,1,2,70,48,71,14,5,19,7,20,21,16,22,52,72,15,23,4,24,13,17,18,25,73,26,27]),import.meta.url),"./src/components/side-bar/side-bar.stories.tsx":async()=>t(()=>import("./side-bar.stories-q_bRwHV_.js"),__vite__mapDeps([142,1,2,15,143,14,72,144,55,56,48,21,4,19,7,20,16,22,13,17,18,23,24,25,145,146,12,122]),import.meta.url),"./src/components/select/select.stories.tsx":async()=>t(()=>import("./select.stories-oUxeDUts.js"),__vite__mapDeps([98,1,2,51,14,15,16,47,48,23,4,24,21,5,6,7,52,53,26,27,54,13,17,18,19,20,22,25,55,56,57,58,59,84]),import.meta.url),"./src/components/rich-text-input/rich-text-input.stories.tsx":async()=>t(()=>import("./rich-text-input.stories-D55Op5Gf.js"),__vite__mapDeps([147,1,2,16,15,13,14,17,18,19,7,20,21,22,23,4,24,25,51,47,48,5,6,52,53,26,27,54,55,56,57,58,59,148]),import.meta.url),"./src/components/radio-button/radio-button.stories.tsx":async()=>t(()=>import("./radio-button.stories-KCS981-F.js"),__vite__mapDeps([97,1,2,76,14,16,58,53,15,37,23,4,24,19,7,20,21,22,38,77]),import.meta.url),"./src/components/progress-bar/progress-bar.stories.tsx":async()=>t(()=>import("./progress-bar.stories-5x1LDEkb.js"),__vite__mapDeps([149,1,2,150,14,151]),import.meta.url),"./src/components/portal/portal.stories.tsx":async()=>t(()=>import("./portal.stories-UGkzdgVk.js"),__vite__mapDeps([152,1,2,4,153]),import.meta.url),"./src/components/popover/popover.stories.tsx":async()=>t(()=>import("./popover.stories-XaqJOrng.js"),__vite__mapDeps([154,1,2,137,23,4,14,24,15,16,13,17,18,19,7,20,21,22,25,138,46,47,48,49,12,51,5,6,52,53,26,27,54,55,56,57,58,59]),import.meta.url),"./src/components/pop-confirm/pop-confirm.stories.tsx":async()=>t(()=>import("./pop-confirm.stories-94l3Xg8w.js"),__vite__mapDeps([155,1,2,137,23,4,14,24,15,16,13,17,18,19,7,20,21,22,25,138,26,27,108,85,86,109,156]),import.meta.url),"./src/components/pagination/pagination.stories.tsx":async()=>t(()=>import("./pagination.stories-sl2a8BMq.js"),__vite__mapDeps([157,1,2,135,15,51,14,16,47,48,23,4,24,21,5,6,7,52,53,26,27,54,13,17,18,19,20,22,25,55,56,57,58,59,46,49,66,67,68,69,136]),import.meta.url),"./src/components/option-dropdown/option-dropdown.stories.tsx":async()=>t(()=>import("./option-dropdown.stories-1Y5JDaBF.js"),__vite__mapDeps([93,1,2,15,54,14,48,16,13,17,18,19,7,20,21,22,23,4,24,25,53,47,55,56,57,60,37,38,61,94,26,27,95,96]),import.meta.url),"./src/components/number-input/number-input.stories.tsx":async()=>t(()=>import("./number-input.stories-SOsG2FLJ.js"),__vite__mapDeps([89,1,2,90,91,92,48,46,14,16,47,23,4,24,49,66,15,67,68,69,51,21,5,6,7,52,53,26,27,54,13,17,18,19,20,22,25,55,56,57,58,59]),import.meta.url),"./src/components/modal/modal.stories.tsx":async()=>t(()=>import("./modal.stories-K4XxeWTp.js"),__vite__mapDeps([158,1,2,15,159,14,153,4,48,36,37,23,24,19,7,20,21,16,22,38,39,13,17,18,25,160,137,138,46,47,49,66,67,42,43,44,45,54,53,55,56,57,51,5,6,52,26,27,58,59,84]),import.meta.url),"./src/components/message/message.stories.tsx":async()=>t(()=>import("./message.stories-BqM_-mrZ.js"),__vite__mapDeps([161,1,2,85,14,15,19,7,20,21,16,22,86,13,17,18,23,4,24,25,29,30]),import.meta.url),"./src/components/menu/menu.stories.tsx":async()=>t(()=>import("./menu.stories-sot2Whii.js"),__vite__mapDeps([162,1,2,15,54,14,48,16,13,17,18,19,7,20,21,22,23,4,24,25,53,47,55,56,57,12,124]),import.meta.url),"./src/components/loader/loader.stories.tsx":async()=>t(()=>import("./loader.stories-G8Q_Fm8u.js"),__vite__mapDeps([163,1,2,15,164,14,165,150,151,17,18,84,13,16,19,7,20,21,22,23,4,24,25,31,32]),import.meta.url),"./src/components/list/list.stories.tsx":async()=>t(()=>import("./list.stories-a1qTCCEj.js"),__vite__mapDeps([166,1,2,132,167,14,134,7,5,115,71,4,52,19,20,21,16,22,31,32,113,55,56,23,24,15,36,37,38,39,54,48,13,17,18,25,53,47,57,114,164,165,12,168]),import.meta.url),"./src/components/layout/page.stories.tsx":async()=>t(()=>import("./page.stories-eHXLB7iO.js"),__vite__mapDeps([169,1,2,170,14,171,118,19,7,20,21,16,22,15,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,120,172]),import.meta.url),"./src/components/layout/column.stories.tsx":async()=>t(()=>import("./column.stories-5pd3N4bE.js"),__vite__mapDeps([33,1,2,34,30,20,14,35,36,15,37,23,4,24,19,7,21,16,22,38,39]),import.meta.url),"./src/components/label/label.stories.tsx":async()=>t(()=>import("./label.stories-HcdQ1bEB.js"),__vite__mapDeps([173,1,2,43,14,15,37,23,4,24,19,7,20,21,16,22,38,44]),import.meta.url),"./src/components/input-group/input-group.stories.tsx":async()=>t(()=>import("./input-group.stories-EouZEW-v.js"),__vite__mapDeps([174,1,2,15,66,14,67,68,69,46,16,47,48,23,4,24,49,13,17,18,19,7,20,21,22,25,54,53,55,56,57,51,5,6,52,26,27,58,59]),import.meta.url),"./src/components/input/input.stories.tsx":async()=>t(()=>import("./input.stories-iopguZKB.js"),__vite__mapDeps([88,1,2,46,14,16,47,48,23,4,24,49]),import.meta.url),"./src/components/icon/icon.stories.tsx":async()=>t(()=>import("./icon.stories-icqUrCtQ.js"),__vite__mapDeps([175,1,2,19,14,7,20,21,16,22,122,29,30,12,26,27]),import.meta.url),"./src/components/help-icon/help-icon.stories.tsx":async()=>t(()=>import("./help-icon.stories-Qz7MKCnQ.js"),__vite__mapDeps([176,1,2,15,37,14,23,4,24,19,7,20,21,16,22,38]),import.meta.url),"./src/components/heading/heading.stories.tsx":async()=>t(()=>import("./heading.stories-K-Z0sIoo.js"),__vite__mapDeps([177,1,2,15,36,14,37,23,4,24,19,7,20,21,16,22,38,39,12]),import.meta.url),"./src/components/form/form.stories.tsx":async()=>t(()=>import("./form.stories-_A7_Mppm.js"),__vite__mapDeps([50,1,2,15,16,42,14,43,37,23,4,24,19,7,20,21,22,38,44,45,46,47,48,49,51,5,6,52,53,26,27,54,13,17,18,25,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),"./src/components/form/field.stories.tsx":async()=>t(()=>import("./field.stories-aEccauPi.js"),__vite__mapDeps([41,1,2,42,14,43,15,37,23,4,24,19,7,20,21,16,22,38,44,45,46,47,48,49,26,27]),import.meta.url),"./src/components/file-input/file-input.stories.tsx":async()=>t(()=>import("./file-input.stories-22XjkzbO.js"),__vite__mapDeps([83,1,2,16,66,14,15,67,46,47,48,23,4,24,49,13,17,18,19,7,20,21,22,25,84,85,86,74,75,87]),import.meta.url),"./src/components/empty/empty.stories.tsx":async()=>t(()=>import("./empty.stories-KIByp315.js"),__vite__mapDeps([178,1,2,26,14,27,13,15,16,17,18,19,7,20,21,22,23,4,24,25,179]),import.meta.url),"./src/components/drawer/drawer.stories.tsx":async()=>t(()=>import("./drawer.stories-HJN51eTr.js"),__vite__mapDeps([180,1,2,15,144,14,55,56,48,21,4,19,7,20,16,22,13,17,18,23,24,25,145,167,134,5,115,71,52,31,32,113,36,37,38,39,54,53,47,57,114,164,165,12,168]),import.meta.url),"./src/components/divider/divider.stories.tsx":async()=>t(()=>import("./divider.stories-FO3XrgMC.js"),__vite__mapDeps([181,1,2,15,26,14,27,94,95]),import.meta.url),"./src/components/check-box/check-box.stories.tsx":async()=>t(()=>import("./check-box.stories-FNs72smP.js"),__vite__mapDeps([82,1,2,60,14,15,16,37,23,4,24,19,7,20,21,22,38,61]),import.meta.url),"./src/components/card/card.stories.tsx":async()=>t(()=>import("./card.stories-OtRekExg.js"),__vite__mapDeps([182,1,2,31,14,32,36,15,37,23,4,24,19,7,20,21,16,22,38,39]),import.meta.url),"./src/components/button-group/button-group.stories.tsx":async()=>t(()=>import("./button-group.stories-DG3i2d7K.js"),__vite__mapDeps([183,1,2,62,15,16,47,48,13,14,17,18,19,7,20,21,22,23,4,24,25,63]),import.meta.url),"./src/components/button/button.stories.tsx":async()=>t(()=>import("./button.stories-R9_1tl9l.js"),__vite__mapDeps([81,1,2,12,13,14,15,16,17,18,19,7,20,21,22,23,4,24,25]),import.meta.url),"./src/components/breadcrumb/breadcrumb.stories.tsx":async()=>t(()=>import("./breadcrumb.stories-V7ozYBO-.js"),__vite__mapDeps([184,1,2,14,16,185]),import.meta.url),"./src/components/badge/badge.stories.tsx":async()=>t(()=>import("./badge.stories-nzXJ1qip.js"),__vite__mapDeps([186,1,2,55,14,56,13,15,16,17,18,19,7,20,21,22,23,4,24,25]),import.meta.url),"./src/components/actions/actions.stories.tsx":async()=>t(()=>import("./actions.stories-dDCC23QK.js"),__vite__mapDeps([187,1,2,54,14,48,15,16,13,17,18,19,7,20,21,22,23,4,24,25,53,47,55,56,57]),import.meta.url),"./src/components/accordion/accordion.stories.tsx":async()=>t(()=>import("./accordion.stories-DAmwlTmm.js"),__vite__mapDeps([188,1,2,15,14,189,19,7,20,21,16,22,190,60,37,23,4,24,38,61,36,39,94,26,27,95,133,134,5,115,71,52,48,54,13,17,18,25,53,47,55,56,57,135,51,6,58,59,46,49,66,67,68,69,136,90,91,92,70,72,73,137,138,139,191]),import.meta.url),"./src/components/table/title/title.stories.tsx":async()=>t(()=>import("./title.stories-Djnk3crF.js"),__vite__mapDeps([192,1,2,133,14,134,7,5,115,71,4,52,19,20,21,16,22,48,54,15,13,17,18,23,24,25,53,47,55,56,57,36,37,38,39,135,51,6,26,27,58,59,46,49,66,67,68,69,136,90,91,92,60,61,70,72,73,137,138,139,140,12]),import.meta.url),"./src/components/table/row/row.stories.tsx":async()=>t(()=>import("./row.stories-HVr8m6RK.js"),__vite__mapDeps([193,1,2,133,14,134,7,5,115,71,4,52,19,20,21,16,22,48,54,15,13,17,18,23,24,25,53,47,55,56,57,36,37,38,39,135,51,6,26,27,58,59,46,49,66,67,68,69,136,90,91,92,60,61,70,72,73,137,138,139,140,12]),import.meta.url),"./src/components/table/footer/footer.stories.tsx":async()=>t(()=>import("./footer.stories-4uhW-z_4.js"),__vite__mapDeps([194,1,2,133,14,134,7,5,115,71,4,52,19,20,21,16,22,48,54,15,13,17,18,23,24,25,53,47,55,56,57,36,37,38,39,135,51,6,26,27,58,59,46,49,66,67,68,69,136,90,91,92,60,61,70,72,73,137,138,139,140,12]),import.meta.url),"./src/components/table/cell/cell.stories.tsx":async()=>t(()=>import("./cell.stories-S9IDsuIA.js"),__vite__mapDeps([195,1,2,133,14,134,7,5,115,71,4,52,19,20,21,16,22,48,54,15,13,17,18,23,24,25,53,47,55,56,57,36,37,38,39,135,51,6,26,27,58,59,46,49,66,67,68,69,136,90,91,92,60,61,70,72,73,137,138,139,42,43,44,45,12,140]),import.meta.url),"./src/components/layout/spacer/spacer.stories.tsx":async()=>t(()=>import("./spacer.stories-CWSQp7tw.js"),__vite__mapDeps([196,1,2,84,12,13,14,15,16,17,18,19,7,20,21,22,23,4,24,25]),import.meta.url),"./src/components/layout/grid/grid.stories.tsx":async()=>t(()=>import("./grid.stories-hPfW-CxX.js"),__vite__mapDeps([28,1,2,29,30,20,31,14,32]),import.meta.url),"./src/components/layout/flex/flex.stories.tsx":async()=>t(()=>import("./flex.stories-kjbyZMWP.js"),__vite__mapDeps([11,1,2,12,13,14,15,16,17,18,19,7,20,21,22,23,4,24,25,26,27]),import.meta.url),"./src/components/layout/examples/site.stories.jsx":async()=>t(()=>import("./site.stories-AbEac__s.js"),__vite__mapDeps([197,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,167,134,5,115,71,52,31,32,113,114,164,165,42,43,44,45,46,49,60,61,170,171,34,30,35,189,190,84,129,58,130]),import.meta.url),"./src/components/layout/examples/reservoirs.stories.jsx":async()=>t(()=>import("./reservoirs.stories-ZhxgN63G.js"),__vite__mapDeps([198,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,167,134,5,115,71,52,31,32,113,114,164,165,42,43,44,45,46,49,60,61,76,58,77,78,79,170,171,34,30,35,51,6,26,27,59,84]),import.meta.url),"./src/components/layout/examples/projects.stories.jsx":async()=>t(()=>import("./projects.stories-GYkShoTB.js"),__vite__mapDeps([199,1,2,118,14,19,7,20,21,16,22,15,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,167,134,5,115,71,52,31,32,113,36,37,38,39,114,164,165,170,171,34,30,35,129,58,130,84]),import.meta.url),"./src/components/layout/examples/formation.stories.jsx":async()=>t(()=>import("./formation.stories-PmRbjLVy.js"),__vite__mapDeps([200,1,2,118,14,19,7,20,21,16,22,15,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,170,171,34,30,35,84,129,58,130,133,134,5,115,71,52,135,51,6,26,27,59,46,49,66,67,68,69,136,90,91,92,60,61,70,73,137,138,139]),import.meta.url),"./src/components/layout/examples/casing-loads.stories.jsx":async()=>t(()=>import("./casing-loads.stories-7fO3E08h.js"),__vite__mapDeps([201,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,167,134,5,115,71,52,31,32,113,114,164,165,42,43,44,45,46,49,159,153,160,60,61,78,79,170,171,34,30,35,51,6,26,27,58,59,84,129,130,133,135,66,67,68,69,136,90,91,92,70,73,137,138,139]),import.meta.url),"./src/components/layout/examples/blowout.stories.jsx":async()=>t(()=>import("./blowout.stories-FLPAE9fr.js"),__vite__mapDeps([202,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,31,32,170,171,34,30,35,84]),import.meta.url),"./src/components/layout/examples/afe.stories.jsx":async()=>t(()=>import("./afe.stories-YefEu4ve.js"),__vite__mapDeps([203,1,2,15,118,14,19,7,20,21,16,22,13,17,18,23,4,24,25,54,48,53,47,55,56,57,119,143,72,144,145,146,36,37,38,39,167,134,5,115,71,52,31,32,113,114,164,165,42,43,44,45,46,49,189,190,60,61,78,79,170,171,34,30,35,51,6,26,27,58,59,84,129,130,66,67,68,69]),import.meta.url)};async function T(s){return P[s]()}const{composeConfigs:v,PreviewWeb:L,ClientApi:x}=__STORYBOOK_MODULE_PREVIEW_API__,I=async()=>{const s=await Promise.all([t(()=>import("./config-b-_d5fwn.js"),__vite__mapDeps([204,2,107,4,8,21,205]),import.meta.url),t(()=>import("./preview-Fi7DQdoQ.js"),__vite__mapDeps([]),import.meta.url),t(()=>import("./preview-kCAXH-J5.js"),__vite__mapDeps([]),import.meta.url),t(()=>import("./preview-niHg4y_T.js"),__vite__mapDeps([206,1,2,108,4,85,14,15,19,7,20,21,16,22,86,109,8,3,5,6,205,92,106,107,207]),import.meta.url)]);return v(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new L;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new x({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:T,getProjectAnnotations:I});export{t as _};
|
|
2
|
-
function __vite__mapDeps(indexes) {
|
|
3
|
-
if (!__vite__mapDeps.viteFileDeps) {
|
|
4
|
-
__vite__mapDeps.viteFileDeps = ["./padding-and-spacing-CLf0dRGb.js","./jsx-runtime-FsUICBgo.js","./index-RfLt4OUa.js","./index-kEA1EH0x.js","./index-miLrID2P.js","./extends-dGVwEr9R.js","./assertThisInitialized-4q6YPdh3.js","./inheritsLoose-Y9jOMJLd.js","./index-gM75B7fB.js","./index-4YXVTraW.js","./layout-general-82Ja2Lb_.js","./flex.stories-kjbyZMWP.js","./flex-ZVra76N-.js","./button-IoNblLER.js","./index-VW3EWkuE.js","./common-types-U65vzrrz.js","./disabled-context-urNQThQz.js","./spinner-R8Il4aRe.js","./spinner-tO8fikLm.css","./icon-y1a2N5SZ.js","./tslib.es6-OIsz3r9a.js","./index-4QtD-hFu.js","./icon-l7R76_J0.css","./tooltip-ZHdi6rl-.js","./tooltip-jr3F-ie6.css","./button-aRSI9lcJ.css","./text-6KQ6ntOV.js","./text-Njvh0hvI.css","./grid.stories-hPfW-CxX.js","./grid-u1mZpaML.js","./styled-components.browser.esm-qIipjd6c.js","./card-0r8RRVk-.js","./card-FRQxSCqd.css","./column.stories-5pd3N4bE.js","./row-vFUhHoz5.js","./row-_hDFhU-t.css","./heading-cUVItwKq.js","./help-icon-nI9A506M.js","./help-icon-3sHkLODS.css","./heading-zGDwg1Yz.css","./layout-forms-sTxS59Zq.js","./field.stories-aEccauPi.js","./field-kOZPBHf6.js","./label-RpB4JmHX.js","./label-ZsCidjJ8.css","./field-jQwmeVEW.css","./input-iDZqV-2m.js","./types-5uVBABF4.js","./lodash-Bmg8FrMx.js","./input-Fje0itH2.css","./form.stories-_A7_Mppm.js","./select-Z1HqJ5aU.js","./memoize-one.esm-hqe5SRxC.js","./types-VB5zD18b.js","./actions-SGexXf58.js","./badge-23Ty_zBt.js","./badge-YmqKjusH.css","./actions-W12osUP0.css","./select.input-zP5tW20f.js","./select-codRSLz-.css","./check-box-BX5dfQFk.js","./check-box-lfs3fyP9.css","./button-group-KeeGgC4K.js","./button-group-NIYwVeLc.css","./toggle-wk0GbVB8.js","./toggle-Mg-49VUp.css","./input-group-R8LoqKRn.js","./input-group-uD4dOWa6.css","./input-group-addon-BHVsW9mL.js","./input-group-addon-im08H5HG.css","./slider-_5NQKbM-.js","./objectSpread2-93s0nBry.js","./index-ugi_ZH6T.js","./slider-50XXQQsj.css","./textarea-1cVdadvY.js","./textarea-2qQbcmFS.css","./radio-button-QcS9mLYi.js","./radio-button-77m09BoF.css","./form-row-bwoDTUga.js","./form-row-WM-bvlay.css","./inputs-Q-JCPEm_.js","./button.stories-R9_1tl9l.js","./check-box.stories-FNs72smP.js","./file-input.stories-22XjkzbO.js","./spacer-Yji9g2AW.js","./message-uMHaTEXV.js","./message-J8OVkKuk.css","./file-input-G_eVIuoe.css","./input.stories-iopguZKB.js","./number-input.stories-SOsG2FLJ.js","./number-input-d7hXQldd.js","./index-IQMsp8Ab.js","./index-cCpkwrS5.js","./option-dropdown.stories-1Y5JDaBF.js","./divider-RwW2f_N0.js","./divider-MEMf2853.css","./option-dropdown-qj2LBRz5.css","./radio-button.stories-KCS981-F.js","./select.stories-oUxeDUts.js","./slider.stories-QyyBB_rz.js","./textarea.stories-twGqf34D.js","./toggle.stories-LC6LSCD2.js","./input-validation-SIDSAFaH.js","./buttons-and-links-M1gBHZkR.js","./text-link.stories-kjfUeFtk.js","./color-heFzWL2m.js","./chunk-HLWAVYOI-H4e42Z9I.js","./react-16-hgR7FrAp.js","./toaster-eOozfa7U.js","./toaster-8C7zmNfJ.css","./unit-input.stories-ZdrR9JWT.js","./unit-input-qBUtqoTb.css","./tree.stories-5fjCVN1S.js","./list-heading-XbqCJOHh.js","./list-heading-Y8BAUuV6.css","./redux-F5dueAP3.js","./tree-zmq4MRb6.css","./top-bar.testcase.stories-_Nc_6uY7.js","./top-bar-uqbsCAt-.js","./top-bar-cBtxm6yr.css","./logo-nHW4TqZt.js","./top-bar.stories-lt8T4EVJ.js","./icon-custom-PyWFQsS3.js","./tooltip.test-case.stories-y-bQOM0s.js","./menu.stories-data-VCYkzuDD.js","./tooltip.stories-gTfOeEzv.js","./toaster.stories-ft_M65x0.js","./text.stories-4JGfMLkI.js","./tabs.stories-KtJc5Yci.js","./tabs-fcLbHC1n.js","./tabs-51rNj7QN.css","./table.stories-lwqVUJHa.js","./immer.esm-bD7SSJ7T.js","./table-_jWgMFOi.js","./index.es-JXn3JM7k.js","./pagination-Eaj_UOBW.js","./pagination-79rymMEE.css","./popover-uAo1e4-D.js","./popover-knPvPg4S.css","./table-PWodWi0p.css","./table.stories-data-2BZDVr2X.js","./spinner.stories-w5R_Yjfw.js","./side-bar.stories-q_bRwHV_.js","./side-bar-GJ2tcZYY.js","./drawer-TM-jK3WR.js","./drawer-L_geICAt.css","./side-bar-78DAkitE.css","./rich-text-input.stories-D55Op5Gf.js","./rich-text-input-zzFhJRmL.css","./progress-bar.stories-5x1LDEkb.js","./progress-bar-NRjN2baY.js","./progress-bar-M7WIcFG5.css","./portal.stories-UGkzdgVk.js","./portal-zPiHHKoC.js","./popover.stories-XaqJOrng.js","./pop-confirm.stories-94l3Xg8w.js","./pop-confirm-1_6P1_NS.css","./pagination.stories-sl2a8BMq.js","./modal.stories-K4XxeWTp.js","./dialog-dekS0lUR.js","./dialog-gTGZ42G6.css","./message.stories-BqM_-mrZ.js","./menu.stories-sot2Whii.js","./loader.stories-G8Q_Fm8u.js","./loader-TGOJBZQG.js","./loader-ePthe3P6.css","./list.stories-a1qTCCEj.js","./list-5kbN7yr8.js","./list.stories-data-spFiMtCi.js","./page.stories-eHXLB7iO.js","./page-9-f6BzS0.js","./page-ZwBY88Xw.css","./page-6iak35D6.css","./label.stories-HcdQ1bEB.js","./input-group.stories-EouZEW-v.js","./icon.stories-icqUrCtQ.js","./help-icon.stories-Qz7MKCnQ.js","./heading.stories-K-Z0sIoo.js","./empty.stories-KIByp315.js","./empty-C9BF8m3k.css","./drawer.stories-HJN51eTr.js","./divider.stories-FO3XrgMC.js","./card.stories-OtRekExg.js","./button-group.stories-DG3i2d7K.js","./breadcrumb.stories-V7ozYBO-.js","./breadcrumb-zMfjLuCW.css","./badge.stories-nzXJ1qip.js","./actions.stories-dDCC23QK.js","./accordion.stories-DAmwlTmm.js","./accordion-6_27SROY.js","./accordion-4RINpLG4.css","./accordion-tw1O4Ru6.css","./title.stories-Djnk3crF.js","./row.stories-HVr8m6RK.js","./footer.stories-4uhW-z_4.js","./cell.stories-S9IDsuIA.js","./spacer.stories-CWSQp7tw.js","./site.stories-AbEac__s.js","./reservoirs.stories-ZhxgN63G.js","./projects.stories-GYkShoTB.js","./formation.stories-PmRbjLVy.js","./casing-loads.stories-7fO3E08h.js","./blowout.stories-FLPAE9fr.js","./afe.stories-YefEu4ve.js","./config-b-_d5fwn.js","./isPlainObject-4RuU_w9g.js","./preview-niHg4y_T.js","./preview-QdB_aBj_.css"]
|
|
5
|
-
}
|
|
6
|
-
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
7
|
-
}
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./jsx-runtime-FsUICBgo.js";import{r as o}from"./index-RfLt4OUa.js";import{d as r,r as rn}from"./index-IQMsp8Ab.js";import{c as sn}from"./index-VW3EWkuE.js";import{M as we}from"./actions-SGexXf58.js";import{I as un}from"./input-group-addon-BHVsW9mL.js";import{B as m}from"./button-IoNblLER.js";import{T as on}from"./tooltip-ZHdi6rl-.js";import{I as dn}from"./input-group-R8LoqKRn.js";import{S}from"./spacer-Yji9g2AW.js";import{T as cn}from"./text-6KQ6ntOV.js";import{I as mn}from"./input-iDZqV-2m.js";import{M as Ee}from"./types-VB5zD18b.js";import{l as E}from"./lodash-Bmg8FrMx.js";import{D as pn}from"./divider-RwW2f_N0.js";import{R as qt,C as pe}from"./row-vFUhHoz5.js";import{F as I}from"./field-kOZPBHf6.js";import{a as ge}from"./message-uMHaTEXV.js";import"./index-cCpkwrS5.js";import"./common-types-U65vzrrz.js";import"./disabled-context-urNQThQz.js";import"./icon-y1a2N5SZ.js";import"./inheritsLoose-Y9jOMJLd.js";import"./tslib.es6-OIsz3r9a.js";import"./index-4QtD-hFu.js";import"./types-5uVBABF4.js";import"./badge-23Ty_zBt.js";import"./spinner-R8Il4aRe.js";import"./index-miLrID2P.js";import"./styled-components.browser.esm-qIipjd6c.js";import"./label-RpB4JmHX.js";import"./help-icon-nI9A506M.js";const gn=()=>{const t=o.useRef(null);return o.useLayoutEffect(()=>{t.current&&(t.current(),t.current=null)}),n=>{t.current=n}},hn=t=>{const a=o.useRef();return o.useEffect(()=>{a.current=t},[t]),a.current},vn=(t,a)=>{const n=a==null?void 0:a[t];return n||(console.log(`Warning: 'unitTemplate' does not define a preferred unit for '${t}'. Defaulting to standard unit.`),r.unitFromQuantity(t)??"")};var b=(t=>(t.CUSTOM="custom",t.PREDEFINED="predefined",t))(b||{});const Wt=t=>t==="undefined"||t===void 0||t===""||t==="null"||t===null||t==="NaN"||isNaN(t),Rt=(t="",a,n="",i=!1)=>{if(i)return t;if(a&&!Wt(t))try{const u=r.isValueWithUnit(t)?t:r.withUnit(t,n),d=r.convertSamePrecision(u,a);return r.getValue(d)}catch{}return t},fn=t=>t?!!r.getUnit(t):!1,F=(t="",a,n,i)=>{if(i)return t;const u=fn(t)||r.isValueWithUnit(t),d=r.getValue(t);return Wt(d)?d:u?Rt(d,a,n,i):t},Ne=t=>E.isObject(t)&&!E.isArray(t)&&!E.isFunction(t)?E.get(t,"fieldName",""):typeof t=="string"?t:"",Cn=t=>E.isObjectLike(t)&&E.has(t,"message"),bn=t=>typeof t=="string"?t:Cn(t)?t.message:null;var Un=rn();const yn=t=>t.search(RegExp(/(^0{2}\.)|(^0+[1-9])/g))===0,Ae=(t,a)=>{var j;const{allowEmpty:n=!1,autoValue:i,placeholder:u,disabledValidation:d=!1}=a||{},s=String(t);if(d||i||u)return null;const g=Un.isValueWithUnit(s)?r.getValue(s):s;if(n&&g==="")return null;if(yn(g))return"Invalid number format due to leading zeroes";const h=r.validateNumber(g);if(!h.valid){const re=((j=h==null?void 0:h.errors)==null?void 0:j[0])??null;return bn(re)}return null},Pe=(t="")=>{var a;return(a=r.KNOWN_UNITS)==null?void 0:a.includes(t)},xn=(t,a)=>{const n=r.getUnit(t||"");return Pe(a)&&Pe(n)},Vn="_predefinedMenuActive_1yvt4_1",In={predefinedMenuActive:Vn},p=({name:t,placeholder:a="",disabled:n=!1,disabledUnit:i=!1,error:u=null,left:d=!1,small:s=!1,width:g="100%",value:h,unitkey:j="",initUnit:re,noConversion:Tt=!1,onChange:se=()=>{},onClick:kn=()=>{},onFocus:Lt=()=>{},onSwitchUnit:he=()=>{},unitTemplate:ve,doNotConvertValue:A=!1,testId:w,warning:Kt=null,predefinedOptions:x,initialPredefinedOption:$t=!1,shouldLinkAutomaticly:fe=!0,selectedPredefinedOptionKey:Ce,validationCallback:be=()=>({name:"",error:null}),disabledValidation:Ue=!1,allowEmpty:ye=!1,autoValue:V})=>{typeof h=="number"&&(h=`${h}`);const Ht=gn(),[ie="",P=""]=h!==void 0?r.split(h):[],xe=V?r.getUnit(V):"",Ve=o.useMemo(()=>vn(j,ve),[j,ve]),zt=xn(h,Ve),U=re||Ve||P,Jt=hn(U),Ie=F(h,U,P,A),je=F(V,U,xe,A),Yt=Ie!==""?{value:Ie,unit:U}:je!==""?{value:je,unit:U}:{value:ie,unit:P},[v,Y]=o.useState(Yt),[Zt,ue]=o.useState(null),[k,oe]=o.useState($t?b.PREDEFINED:b.CUSTOM),de=ie===""&&V,D=x&&x.find(l=>{if(Ce)return Ce===l.valueKey;const c=r.isValueWithUnit(l.value)?r.getUnit(l.value):"";return r.withUnit(Rt(h,c),c)===l.value}),Gt=()=>{if(j)try{const l=de?V:h??"";let c=r.altUnitsList(l,j);return r.getValue(l)===""?c.map(f=>["",f[1]]):c}catch{return null}},Qt=l=>{const c=Ne(t),f=l.target,{value:y,selectionStart:X}=f,Se=r.cleanNumStr(y.replaceAll(" ","").replaceAll("|","")),ce=r.withUnit(Se,(v==null?void 0:v.unit)||""),nn=r.getValue(ce),me=Ae(nn,{allowEmpty:ye,autoValue:V,placeholder:a,disabledValidation:Ue});if(me===null){se({target:{value:ce,name:c}});const[an,ln]=r.split(ce);Y({value:an,unit:ln}),ue(null),be(c,null)}else Y({value:Se,unit:v.unit}),ue(me),be(c,me);Ht(()=>{f.selectionStart=X,f.selectionEnd=X})},Xt=(l,c)=>{c===v.unit||isNaN(Number(l))||(Y({value:l,unit:c}),he&&he(c))};o.useEffect(()=>{if(U){let f,y="";Jt!==U?(f=F(h,U,P,A),y=U):r.withUnit(v.value,v.unit)!==h&&(f=F(h,v.unit,P,A),y=v.unit),f!==void 0&&Y({value:f,unit:y}),x&&oe(D&&fe?b.PREDEFINED:b.CUSTOM)}const l=r.checkAndCleanDecimalComma(ie),c=Ae(l,{allowEmpty:ye,autoValue:V,placeholder:a,disabledValidation:Ue});ue(c)},[U,h,u,fe]);const Z=Gt(),G=r.label(v.unit)||v.unit||"",en=Tt||!Z||Z&&Z.length===1,ke=Ne(t);let Q;const tn=l=>{const[c,f=""]=r.isValueWithUnit(l.value)?r.split(l.value):[l.value];return{type:Ee.OPTION,inline:!0,onClick:()=>{r.validateNumber(c).valid&&!n&&(oe(b.PREDEFINED),se({target:{value:l.value,name:typeof t=="string"?t:(t==null?void 0:t.fieldName)||"",predefinedSelected:!0,predefinedOption:l}}))},label:e.jsxs(e.Fragment,{children:[e.jsx(cn,{children:l.label}),e.jsx(S,{width:"20px",height:"0"})]}),description:r.isValueWithUnit(l.value)?`${c} ${f}`:l.value,selected:D===l&&k===b.PREDEFINED}};if(Q=[{type:Ee.OPTION,inline:!0,onClick:()=>{k!==b.CUSTOM&&!n&&se({target:{value:r.withUnit(v.value,v.unit),name:typeof t=="string"?t:(t==null?void 0:t.fieldName)||""}})},label:"Custom",selected:k===b.CUSTOM}],x!=null&&x.length){const l=x.map(tn);Q=[...Q,...l]}return e.jsx("div",{className:k===b.PREDEFINED?sn(In.predefinedMenuActive):"",children:e.jsxs(dn,{small:s,width:g,children:[x&&e.jsx(on,{text:k===b.PREDEFINED?D==null?void 0:D.label:"",children:e.jsx(we,{maxHeight:380,groupOrder:"first",testId:w&&`${w}-predefined-menu`,disabled:n,menu:{colored:!0,trigger:"Component",component:e.jsx(m,{groupOrder:"first",active:k===b.PREDEFINED,icon:k===b.PREDEFINED?"link":"unlink"}),small:s,sections:Q}})}),e.jsx(mn,{type:"text",name:ke,testId:w,disabled:n,placeholder:de?F(V,v.unit,xe,A):a,value:v.value,onChange:Qt,onFocus:Lt,error:u||Zt,warning:Kt,right:!d},ke),G&&(en||!zt?e.jsx(un,{groupOrder:"last",children:G}):e.jsx(we,{maxHeight:380,groupOrder:"last",disabled:i,testId:w&&`${w}-menu`,menu:{label:G,trigger:"DropDownButton",small:s,sections:Z.map(([l,c,f])=>{const y=f||c||"";return{type:"Option",label:isNaN(Number(l))?"":l,inline:!0,onClick:X=>{X.stopPropagation(),Xt(de?"":l,c)},description:y,selected:y===G,testId:`${w}-unit-${y}`}})}}))]})})};try{p.displayName="UnitInput",p.__docgenInfo={description:"",displayName:"UnitInput",props:{name:{defaultValue:null,description:"",name:"name",required:!0,type:{name:"string | { fieldName?: string | undefined; }"}},placeholder:{defaultValue:{value:""},description:"",name:"placeholder",required:!1,type:{name:"string"}},disabled:{defaultValue:{value:"false"},description:"",name:"disabled",required:!1,type:{name:"boolean"}},disabledUnit:{defaultValue:{value:"false"},description:"",name:"disabledUnit",required:!1,type:{name:"boolean"}},error:{defaultValue:{value:"null"},description:"",name:"error",required:!1,type:{name:"string | boolean | null"}},left:{defaultValue:{value:"false"},description:"",name:"left",required:!1,type:{name:"boolean"}},small:{defaultValue:{value:"false"},description:"",name:"small",required:!1,type:{name:"boolean"}},width:{defaultValue:{value:"100%"},description:"",name:"width",required:!1,type:{name:"string | number"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"string"}},unitkey:{defaultValue:{value:""},description:"",name:"unitkey",required:!1,type:{name:"string"}},initUnit:{defaultValue:null,description:"",name:"initUnit",required:!1,type:{name:"string"}},noConversion:{defaultValue:{value:"false"},description:"",name:"noConversion",required:!1,type:{name:"boolean"}},doNotConvertValue:{defaultValue:{value:"false"},description:"",name:"doNotConvertValue",required:!1,type:{name:"boolean"}},testId:{defaultValue:null,description:"",name:"testId",required:!1,type:{name:"string"}},warning:{defaultValue:{value:"null"},description:"",name:"warning",required:!1,type:{name:"string | null"}},predefinedOptions:{defaultValue:null,description:"",name:"predefinedOptions",required:!1,type:{name:"IPredefinedOption[]"}},initialPredefinedOption:{defaultValue:{value:"false"},description:"",name:"initialPredefinedOption",required:!1,type:{name:"boolean"}},shouldLinkAutomaticly:{defaultValue:{value:"true"},description:"",name:"shouldLinkAutomaticly",required:!1,type:{name:"boolean"}},selectedPredefinedOptionKey:{defaultValue:null,description:"",name:"selectedPredefinedOptionKey",required:!1,type:{name:"string"}},validationCallback:{defaultValue:{value:"() => ({ name: '', error: null })"},description:"",name:"validationCallback",required:!1,type:{name:"((name: string, message: string | null) => { name: string; error: string | null; })"}},disabledValidation:{defaultValue:{value:"false"},description:"",name:"disabledValidation",required:!1,type:{name:"boolean"}},allowEmpty:{defaultValue:{value:"false"},description:"",name:"allowEmpty",required:!1,type:{name:"boolean"}},autoValue:{defaultValue:null,description:"",name:"autoValue",required:!1,type:{name:"string"}},onChange:{defaultValue:{value:"() => {}"},description:"",name:"onChange",required:!1,type:{name:"(event: ChangeEvent<HTMLInputElement> | ICustomChangeEvent) => void"}},onSwitchUnit:{defaultValue:{value:"() => {}"},description:"",name:"onSwitchUnit",required:!1,type:{name:"((unit: string) => void)"}},onClick:{defaultValue:{value:"() => {}"},description:"",name:"onClick",required:!1,type:{name:"MouseEventHandler<HTMLInputElement>"}},onFocus:{defaultValue:{value:"() => {}"},description:"",name:"onFocus",required:!1,type:{name:"FocusEventHandler<HTMLInputElement>"}},unitTemplate:{defaultValue:null,description:"",name:"unitTemplate",required:!1,type:{name:"Record<string, any>"}}}}}catch{}const{useArgs:jn}=__STORYBOOK_MODULE_ADDONS__,ra={title:"Basic/UnitInput",component:p,args:{name:"example",unitkey:"length",value:"123|m"}},C=t=>{const[a,n]=jn(),i=u=>{n({value:u.target.value})};return e.jsx(p,{...t,onChange:i})},ee=C.bind({}),M=C.bind({});M.args={initUnit:"ft",unitTemplate:{length:"ft"}};const _=C.bind({});_.args={value:'123|"',unitkey:'"'};const O=C.bind({});O.args={width:"180px"};const B=C.bind({});B.args={noConversion:!0};const q=C.bind({});q.args={small:!0};const W=C.bind({});W.args={error:"Error message goes here"};const R=C.bind({});R.args={value:"asas123asd|%"};const N=C.bind({});N.args={disabled:!0,disabledUnit:!0};N.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 T=C.bind({});T.args={disabled:!0,disabledUnit:!0,noConversion:!0};const L=C.bind({});L.args={disabledUnit:!0,unitkey:void 0};const K=C.bind({});K.args={disabledUnit:!0,unitkey:"length"};const $=C.bind({});$.args={disabledUnit:!1,disabled:!0};const H=t=>{const[a,n]=o.useState("123|m"),[i,u]=o.useState("223|m"),[d,s]=o.useState("ft");return e.jsxs(e.Fragment,{children:[e.jsx(m,{label:"Change initUnit",onClick:()=>s(d==="m"?"ft":"m")}),e.jsx(S,{}),e.jsx(m,{label:"Change value",onClick:()=>n(a==="123|m"?"456|m":"123|m")}),e.jsx(S,{}),e.jsx(p,{name:"example",onChange:g=>{n(g.target.value)},unitkey:"length",value:a,initUnit:d,onSwitchUnit:s}),e.jsx(S,{}),e.jsx(p,{name:"example2",onChange:g=>{u(g.target.value)},unitkey:"length",value:i,initUnit:d,onSwitchUnit:s}),e.jsx(pn,{}),e.jsx("h4",{children:"Without initUnit property (taken from the redux store)"}),e.jsx(p,{name:"example",onChange:g=>{n(g.target.value)},unitkey:"length",value:a,onSwitchUnit:s}),e.jsx(p,{name:"example2",onChange:g=>{u(g.target.value)},unitkey:"length",value:i,onSwitchUnit:s})]})};H.parameters={docs:{description:{story:"[OW-4380](https://oliasoft.atlassian.net/browse/OW-4380?atlOrigin=eyJpIjoiMmM1N2RkNWU3Mjk5NDYxY2E0YzhkMzk5ZTVmZTJhMjciLCJwIjoiaiJ9)"}}};const z=C.bind({});z.args={predefinedOptions:[{label:"bottom of casing",value:"12|km"},{label:"mud weight at shoe depth",value:"8|mm"}]};const J=()=>{const t="500px",[a,n]=o.useState(void 0);return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different edge cases such as +/- infinity, undefined, NaN, null:"}),e.jsxs(qt,{children:[e.jsxs(pe,{width:"25%",children:[e.jsx(m,{label:"Change value infinity",onClick:()=>n(1/0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value -infinity",onClick:()=>n(-1/0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value null",onClick:()=>n(null)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - undefined",onClick:()=>n(void 0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - NaN",onClick:()=>n(NaN)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - nothing (empty)",onClick:()=>n(void 0)}),e.jsx("br",{}),e.jsx(m,{label:"Change value - empty string",onClick:()=>n("")})]}),e.jsxs(pe,{width:"25%",children:[e.jsx(m,{label:"Change value infinity|m",onClick:()=>n("Infinity|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value -infinity|m",onClick:()=>n("-Infinity|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value null|m",onClick:()=>n("null|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - undefined|m",onClick:()=>n("undefined|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - NaN|m",onClick:()=>n("NaN|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value - nothing (empty)|m",onClick:()=>n("|m")})]})]}),e.jsx("br",{}),e.jsx(I,{label:"Normal PUI",children:e.jsx(p,{name:"example1",onChange:i=>n(i.target.value),value:a,unitkey:"length",width:t,placeholder:"value|unit"})}),e.jsx(I,{label:"Disabled validation",children:e.jsx(p,{name:"example2",onChange:i=>n(i.target.value),value:a,unitkey:"length",disabledValidation:!0,width:t})}),e.jsx(I,{label:"Disabled validation and manual error",children:e.jsx(p,{name:"example3",onChange:i=>n(i.target.value),value:a,unitkey:"length",error:"test",disabledValidation:!0,width:t})}),e.jsx(ge,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})},te=()=>{const t="500px",[a,n]=o.useState("1|m"),[i,u]=o.useState("|m"),d="123|km";return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Different cases for automatic (placeholder) values:"}),e.jsx(qt,{children:e.jsxs(pe,{width:"25%",children:[e.jsx(m,{label:"Change value to ''",onClick:()=>n("")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to 1",onClick:()=>n("1")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to 1|m",onClick:()=>n("1|m")}),e.jsx("br",{}),e.jsx(m,{label:"Change value to |m - empty value",onClick:()=>n("|m")})]})}),e.jsx("br",{}),e.jsx(I,{label:"Normal PUI (placeholder + auto)",children:e.jsx(p,{name:"example1",onChange:s=>n(s.target.value),value:a,unitkey:"length",width:t,placeholder:"value|unit",autoValue:d})}),e.jsx(I,{label:"Normal PUI (only auto)",children:e.jsx(p,{name:"example1",onChange:s=>n(s.target.value),value:a,unitkey:"length",width:t,autoValue:d})}),e.jsx(I,{label:"Empty PUI with autoValue",children:e.jsx(p,{name:"example1",onChange:s=>u(s.target.value),value:i,unitkey:"length",width:t,autoValue:d})}),e.jsx(I,{label:"Normal PUI (only placeholder)",children:e.jsx(p,{name:"example1",onChange:s=>n(s.target.value),value:a,unitkey:"length",width:t,placeholder:"Placeholder test"})}),e.jsx(I,{label:"Normal PUI (placeholder + allowEmpty)",children:e.jsx(p,{name:"example1",onChange:s=>n(s.target.value),value:a,unitkey:"length",width:t,placeholder:"Placeholder test",allowEmpty:!0})}),e.jsx(ge,{message:{heading:"Current value inside PUI: "+a,visible:!0}})]})};J.parameters={docs:{description:{story:"[OW-8884](https://oliasoft.atlassian.net/browse/OW-8884)"}}};const ne=()=>{const[t,a]=o.useState("123|%"),[n,i]=o.useState(null),u="This should be visible when an error appears",d=(s,g)=>(i(g),{name:s,error:g});return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"3rd party validation message when inputting invalid value:"}),e.jsx(p,{name:"example",onChange:s=>a(s.target.value),error:!n||u,validationCallback:d,value:t}),e.jsx("br",{}),e.jsx(S,{}),e.jsx("h4",{children:"Original validation message: "}),e.jsx(ge,{message:{heading:n,visible:!0}})]})},ae=()=>{const[t,a]=o.useState("123|m"),[n,i]=o.useState(""),[u,d]=o.useState("km"),s=()=>{d("ft"),i("placeholder"),a("|m")};return e.jsxs(e.Fragment,{children:[e.jsx("h4",{children:"Empty value case:"}),e.jsx(p,{name:"example",onChange:g=>a(g.target.value),value:t,allowEmpty:!0,placeholder:n,initUnit:u,unitkey:"length"}),e.jsx("br",{}),e.jsx(S,{}),e.jsx(m,{label:"Change value |m and unit ft",onClick:()=>s()})]})},le=()=>{const[t,a]=o.useState("123|m"),[n,i]=o.useState("m");return e.jsxs(e.Fragment,{children:[e.jsx(p,{name:"example",onChange:u=>a(u.target.value),value:t,initUnit:n,unitkey:"length",onSwitchUnit:i}),e.jsx(S,{}),e.jsx(p,{name:"example",onChange:u=>a(u.target.value),value:t,initUnit:n,unitkey:"length",onSwitchUnit:i})]})};var De,Fe,Me;ee.parameters={...ee.parameters,docs:{...(De=ee.parameters)==null?void 0:De.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
|
-
}`,...(Me=(Fe=ee.parameters)==null?void 0:Fe.docs)==null?void 0:Me.source}}};var _e,Oe,Be;M.parameters={...M.parameters,docs:{...(_e=M.parameters)==null?void 0:_e.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
|
-
}`,...(Be=(Oe=M.parameters)==null?void 0:Oe.docs)==null?void 0:Be.source}}};var qe,We,Re;_.parameters={..._.parameters,docs:{...(qe=_.parameters)==null?void 0:qe.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
|
-
}`,...(Re=(We=_.parameters)==null?void 0:We.docs)==null?void 0:Re.source}}};var Te,Le,Ke;O.parameters={...O.parameters,docs:{...(Te=O.parameters)==null?void 0:Te.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
|
-
}`,...(Ke=(Le=O.parameters)==null?void 0:Le.docs)==null?void 0:Ke.source}}};var $e,He,ze;B.parameters={...B.parameters,docs:{...($e=B.parameters)==null?void 0:$e.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
|
-
}`,...(ze=(He=B.parameters)==null?void 0:He.docs)==null?void 0:ze.source}}};var Je,Ye,Ze;q.parameters={...q.parameters,docs:{...(Je=q.parameters)==null?void 0:Je.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
|
-
}`,...(Ze=(Ye=q.parameters)==null?void 0:Ye.docs)==null?void 0:Ze.source}}};var Ge,Qe,Xe;W.parameters={...W.parameters,docs:{...(Ge=W.parameters)==null?void 0:Ge.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
|
-
}`,...(Xe=(Qe=W.parameters)==null?void 0:Qe.docs)==null?void 0:Xe.source}}};var et,tt,nt;R.parameters={...R.parameters,docs:{...(et=R.parameters)==null?void 0:et.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
|
-
}`,...(nt=(tt=R.parameters)==null?void 0:tt.docs)==null?void 0:nt.source}}};var at,lt,rt;N.parameters={...N.parameters,docs:{...(at=N.parameters)==null?void 0:at.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
|
-
}`,...(rt=(lt=N.parameters)==null?void 0:lt.docs)==null?void 0:rt.source}}};var st,it,ut;T.parameters={...T.parameters,docs:{...(st=T.parameters)==null?void 0:st.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
|
-
}`,...(ut=(it=T.parameters)==null?void 0:it.docs)==null?void 0:ut.source}}};var ot,dt,ct;L.parameters={...L.parameters,docs:{...(ot=L.parameters)==null?void 0:ot.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
|
-
}`,...(ct=(dt=L.parameters)==null?void 0:dt.docs)==null?void 0:ct.source}}};var mt,pt,gt;K.parameters={...K.parameters,docs:{...(mt=K.parameters)==null?void 0:mt.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
|
-
}`,...(gt=(pt=K.parameters)==null?void 0:pt.docs)==null?void 0:gt.source}}};var ht,vt,ft;$.parameters={...$.parameters,docs:{...(ht=$.parameters)==null?void 0:ht.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
|
-
}`,...(ft=(vt=$.parameters)==null?void 0:vt.docs)==null?void 0:ft.source}}};var Ct,bt,Ut;H.parameters={...H.parameters,docs:{...(Ct=H.parameters)==null?void 0:Ct.docs,source:{originalSource:`(args: IUnitInputProps) => {
|
|
106
|
-
const [value, setValue] = useState('123|m');
|
|
107
|
-
const [value2, setValue2] = useState('223|m');
|
|
108
|
-
const [initUnit, setInitUnit] = useState('ft');
|
|
109
|
-
return <>
|
|
110
|
-
<Button label="Change initUnit" onClick={() => setInitUnit(initUnit === 'm' ? 'ft' : 'm')} />
|
|
111
|
-
<Spacer />
|
|
112
|
-
<Button label="Change value" onClick={() => setValue(value === '123|m' ? '456|m' : '123|m')} />
|
|
113
|
-
<Spacer />
|
|
114
|
-
<UnitInput name="example" onChange={evt => {
|
|
115
|
-
setValue(evt.target.value);
|
|
116
|
-
}} unitkey="length" value={value} initUnit={initUnit} onSwitchUnit={setInitUnit} />
|
|
117
|
-
<Spacer />
|
|
118
|
-
<UnitInput name="example2" onChange={evt => {
|
|
119
|
-
setValue2(evt.target.value);
|
|
120
|
-
}} unitkey="length" value={value2} initUnit={initUnit} onSwitchUnit={setInitUnit} />
|
|
121
|
-
<Divider />
|
|
122
|
-
<h4>Without initUnit property (taken from the redux store)</h4>
|
|
123
|
-
<UnitInput name="example" onChange={evt => {
|
|
124
|
-
setValue(evt.target.value);
|
|
125
|
-
}} unitkey="length" value={value} onSwitchUnit={setInitUnit} />
|
|
126
|
-
<UnitInput name="example2" onChange={evt => {
|
|
127
|
-
setValue2(evt.target.value);
|
|
128
|
-
}} unitkey="length" value={value2} onSwitchUnit={setInitUnit} />
|
|
129
|
-
</>;
|
|
130
|
-
}`,...(Ut=(bt=H.parameters)==null?void 0:bt.docs)==null?void 0:Ut.source}}};var yt,xt,Vt;z.parameters={...z.parameters,docs:{...(yt=z.parameters)==null?void 0:yt.docs,source:{originalSource:`args => {
|
|
131
|
-
const [_, updateArgs] = useArgs();
|
|
132
|
-
const handleChange = (evt: any) => {
|
|
133
|
-
updateArgs({
|
|
134
|
-
value: evt.target.value
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
return <UnitInput {...args} onChange={handleChange} />;
|
|
138
|
-
}`,...(Vt=(xt=z.parameters)==null?void 0:xt.docs)==null?void 0:Vt.source}}};var It,jt,kt;J.parameters={...J.parameters,docs:{...(It=J.parameters)==null?void 0:It.docs,source:{originalSource:`() => {
|
|
139
|
-
const width = '500px';
|
|
140
|
-
const [value, setValue] = useState<any>(undefined);
|
|
141
|
-
return <>
|
|
142
|
-
<h4>Different edge cases such as +/- infinity, undefined, NaN, null:</h4>
|
|
143
|
-
<Row>
|
|
144
|
-
<Column width="25%">
|
|
145
|
-
<Button label="Change value infinity" onClick={() => setValue(Infinity)} />
|
|
146
|
-
<br />
|
|
147
|
-
<Button label="Change value -infinity" onClick={() => setValue(-Infinity)} />
|
|
148
|
-
<br />
|
|
149
|
-
<Button label="Change value null" onClick={() => setValue(null)} />
|
|
150
|
-
<br />
|
|
151
|
-
<Button label="Change value - undefined" onClick={() => setValue(undefined)} />
|
|
152
|
-
<br />
|
|
153
|
-
<Button label="Change value - NaN" onClick={() => setValue(NaN)} />
|
|
154
|
-
<br />
|
|
155
|
-
<Button label="Change value - nothing (empty)" onClick={() => setValue(undefined)} />
|
|
156
|
-
<br />
|
|
157
|
-
<Button label="Change value - empty string" onClick={() => setValue('')} />
|
|
158
|
-
</Column>
|
|
159
|
-
<Column width="25%">
|
|
160
|
-
<Button label="Change value infinity|m" onClick={() => setValue(Infinity + '|m')} />
|
|
161
|
-
<br />
|
|
162
|
-
<Button label="Change value -infinity|m" onClick={() => setValue(-Infinity + '|m')} />
|
|
163
|
-
<br />
|
|
164
|
-
<Button label="Change value null|m" onClick={() => setValue(null + '|m')} />
|
|
165
|
-
<br />
|
|
166
|
-
<Button label="Change value - undefined|m" onClick={() => setValue(undefined + '|m')} />
|
|
167
|
-
<br />
|
|
168
|
-
<Button label="Change value - NaN|m" onClick={() => setValue(NaN + '|m')} />
|
|
169
|
-
<br />
|
|
170
|
-
<Button label="Change value - nothing (empty)|m" onClick={() => setValue('|m')} />
|
|
171
|
-
</Column>
|
|
172
|
-
</Row>
|
|
173
|
-
<br />
|
|
174
|
-
<Field label="Normal PUI">
|
|
175
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" />
|
|
176
|
-
</Field>
|
|
177
|
-
<Field label="Disabled validation">
|
|
178
|
-
<UnitInput name="example2" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" disabledValidation width={width} />
|
|
179
|
-
</Field>
|
|
180
|
-
<Field label="Disabled validation and manual error">
|
|
181
|
-
<UnitInput name="example3" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" error="test" disabledValidation width={width} />
|
|
182
|
-
</Field>
|
|
183
|
-
<Message message={{
|
|
184
|
-
heading: 'Current value inside PUI: ' + value,
|
|
185
|
-
visible: true
|
|
186
|
-
}} />
|
|
187
|
-
</>;
|
|
188
|
-
}`,...(kt=(jt=J.parameters)==null?void 0:jt.docs)==null?void 0:kt.source}}};var St,wt,Et;te.parameters={...te.parameters,docs:{...(St=te.parameters)==null?void 0:St.docs,source:{originalSource:`() => {
|
|
189
|
-
const width = '500px';
|
|
190
|
-
const [value, setValue] = useState<string>('1|m');
|
|
191
|
-
const [valueB, setValueB] = useState('|m');
|
|
192
|
-
const automaticValue = '123|km';
|
|
193
|
-
return <>
|
|
194
|
-
<h4>Different cases for automatic (placeholder) values:</h4>
|
|
195
|
-
<Row>
|
|
196
|
-
<Column width="25%">
|
|
197
|
-
<Button label="Change value to ''" onClick={() => setValue('')} />
|
|
198
|
-
<br />
|
|
199
|
-
<Button label="Change value to 1" onClick={() => setValue('1')} />
|
|
200
|
-
<br />
|
|
201
|
-
<Button label="Change value to 1|m" onClick={() => setValue('1|m')} />
|
|
202
|
-
<br />
|
|
203
|
-
<Button label="Change value to |m - empty value" onClick={() => setValue('|m')} />
|
|
204
|
-
</Column>
|
|
205
|
-
</Row>
|
|
206
|
-
<br />
|
|
207
|
-
<Field label="Normal PUI (placeholder + auto)">
|
|
208
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="value|unit" autoValue={automaticValue} />
|
|
209
|
-
</Field>
|
|
210
|
-
<Field label="Normal PUI (only auto)">
|
|
211
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} autoValue={automaticValue} />
|
|
212
|
-
</Field>
|
|
213
|
-
<Field label="Empty PUI with autoValue">
|
|
214
|
-
<UnitInput name="example1" onChange={evt => setValueB(evt.target.value)} value={valueB} unitkey="length" width={width} autoValue={automaticValue} />
|
|
215
|
-
</Field>
|
|
216
|
-
<Field label="Normal PUI (only placeholder)">
|
|
217
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" />
|
|
218
|
-
</Field>
|
|
219
|
-
<Field label="Normal PUI (placeholder + allowEmpty)">
|
|
220
|
-
<UnitInput name="example1" onChange={evt => setValue(evt.target.value)} value={value} unitkey="length" width={width} placeholder="Placeholder test" allowEmpty />
|
|
221
|
-
</Field>
|
|
222
|
-
<Message message={{
|
|
223
|
-
heading: 'Current value inside PUI: ' + value,
|
|
224
|
-
visible: true
|
|
225
|
-
}} />
|
|
226
|
-
</>;
|
|
227
|
-
}`,...(Et=(wt=te.parameters)==null?void 0:wt.docs)==null?void 0:Et.source}}};var Nt,At,Pt;ne.parameters={...ne.parameters,docs:{...(Nt=ne.parameters)==null?void 0:Nt.docs,source:{originalSource:`() => {
|
|
228
|
-
const [value, setValue] = useState('123|%');
|
|
229
|
-
const [validation, setValidation] = useState<string | null>(null);
|
|
230
|
-
const predictedMessage = 'This should be visible when an error appears';
|
|
231
|
-
const handleValidation = (name: string, message: string | null) => {
|
|
232
|
-
setValidation(message);
|
|
233
|
-
return {
|
|
234
|
-
name,
|
|
235
|
-
error: message
|
|
236
|
-
};
|
|
237
|
-
};
|
|
238
|
-
return <>
|
|
239
|
-
<h4>3rd party validation message when inputting invalid value:</h4>
|
|
240
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} error={!validation || predictedMessage} validationCallback={handleValidation} value={value} />
|
|
241
|
-
<br />
|
|
242
|
-
<Spacer />
|
|
243
|
-
<h4>Original validation message: </h4>
|
|
244
|
-
<Message message={{
|
|
245
|
-
heading: validation,
|
|
246
|
-
visible: true
|
|
247
|
-
}} />
|
|
248
|
-
</>;
|
|
249
|
-
}`,...(Pt=(At=ne.parameters)==null?void 0:At.docs)==null?void 0:Pt.source}}};var Dt,Ft,Mt;ae.parameters={...ae.parameters,docs:{...(Dt=ae.parameters)==null?void 0:Dt.docs,source:{originalSource:`() => {
|
|
250
|
-
const [value, setValue] = useState('123|m');
|
|
251
|
-
const [placeholder, setPlaceholder] = useState('');
|
|
252
|
-
const [initUnit, setInitUnit] = useState('km');
|
|
253
|
-
const setPlaceholderValue = () => {
|
|
254
|
-
setInitUnit('ft');
|
|
255
|
-
setPlaceholder('placeholder');
|
|
256
|
-
setValue('|m');
|
|
257
|
-
};
|
|
258
|
-
return <>
|
|
259
|
-
<h4>Empty value case:</h4>
|
|
260
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} allowEmpty placeholder={placeholder} initUnit={initUnit} unitkey="length" />
|
|
261
|
-
<br />
|
|
262
|
-
<Spacer />
|
|
263
|
-
<Button label="Change value |m and unit ft" onClick={() => setPlaceholderValue()} />
|
|
264
|
-
</>;
|
|
265
|
-
}`,...(Mt=(Ft=ae.parameters)==null?void 0:Ft.docs)==null?void 0:Mt.source}}};var _t,Ot,Bt;le.parameters={...le.parameters,docs:{...(_t=le.parameters)==null?void 0:_t.docs,source:{originalSource:`() => {
|
|
266
|
-
const [value, setValue] = useState('123|m');
|
|
267
|
-
const [unit, setUnit] = useState('m');
|
|
268
|
-
return <>
|
|
269
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
|
|
270
|
-
<Spacer />
|
|
271
|
-
<UnitInput name="example" onChange={evt => setValue(evt.target.value)} value={value} initUnit={unit} unitkey="length" onSwitchUnit={setUnit} />
|
|
272
|
-
</>;
|
|
273
|
-
}`,...(Bt=(Ot=le.parameters)==null?void 0:Ot.docs)==null?void 0:Bt.source}}};const sa=["Default","InitUnit","notKnownUnit","Width","NoConversion","Small","Error","InternalValidationError","Disabled","DisabledNoConversion","DisabledUnitWithoutUnitKey","DisabledUnitWithUnitKey","DisabledWithEnabledUnitMenu","TestExternalStateChangeWithSynchronizedUnits","PredefinedOptionsMenu","TestEdgeCases","AutomaticValues","ValidationCallback","AllowEmptyPUI","onSwitchUnit"];export{ae as AllowEmptyPUI,te as AutomaticValues,ee as Default,N as Disabled,T as DisabledNoConversion,K as DisabledUnitWithUnitKey,L as DisabledUnitWithoutUnitKey,$ as DisabledWithEnabledUnitMenu,W as Error,M as InitUnit,R as InternalValidationError,B as NoConversion,z as PredefinedOptionsMenu,q as Small,J as TestEdgeCases,H as TestExternalStateChangeWithSynchronizedUnits,ne as ValidationCallback,O as Width,sa as __namedExportsOrder,ra as default,_ as notKnownUnit,le as onSwitchUnit};
|